aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless/broadcom
AgeCommit message (Collapse)AuthorFilesLines
2018-02-27brcmsmac: remove duplicated bit-wise or of IEEE80211_CHAN_NO_IRColin Ian King1-1/+0
Bit pattern IEEE80211_CHAN_NO_IR is being bit-wise or'd twice; remove the redundant 2nd IEEE80211_CHAN_NO_IR Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-02-27brcmfmac: reject too long PSKJohannes Berg1-0/+3
nl80211 already allows specifying 48 bytes, but brcmfmac only supports 32. Reject keys that are too long. Signed-off-by: Johannes Berg <[email protected]> Acked-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-02-27brcmfmac: remove duplicate pointer variable from brcmf_sdio_firmware_callback()Arend Van Spriel1-19/+18
In brcmf_sdio_firmware_callback() two pointer variables were used pointing to the same construct. Get rid of sdiodev variable. Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-02-27brcmfmac: change log level for some low-level sdio functionsArend Van Spriel1-5/+5
Reducing the number of trace level messages in sdio code giving them sdio log level instead. Reviewed-by: Hante Meuleman <[email protected]> Reviewed-by: Pieter-Paul Giesberts <[email protected]> Reviewed-by: Franky Lin <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-02-27brcmfmac: remove brcmf_bus_started() from bus apiArend Van Spriel5-57/+16
No longer needed to call this in bus layer so make it static and call it in the last phase of brcmf_attach() instead. Reviewed-by: Hante Meuleman <[email protected]> Reviewed-by: Pieter-Paul Giesberts <[email protected]> Reviewed-by: Franky Lin <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-02-27brcmfmac: move brcmf_attach() function in core.cArend Van Spriel1-49/+49
Moving the function in preparation of subsequent patch. Reviewed-by: Hante Meuleman <[email protected]> Reviewed-by: Pieter-Paul Giesberts <[email protected]> Reviewed-by: Franky Lin <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-02-27brcmfmac: usb: call brcmf_usb_up() during brcmf_bus_preinit()Arend Van Spriel1-5/+2
By calling brcmf_usb_up() during brcmf_bus_preinit() it does not need to be called in brcmf_usb_bus_setup(). Reviewed-by: Hante Meuleman <[email protected]> Reviewed-by: Pieter-Paul Giesberts <[email protected]> Reviewed-by: Franky Lin <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-02-27brcmfmac: call brcmf_attach() just before calling brcmf_bus_started()Arend Van Spriel2-17/+23
Now we can move brcmf_attach() until after the firmware has been downloaded to the device. Make the call just before brcmf_bus_started(). Reviewed-by: Hante Meuleman <[email protected]> Reviewed-by: Pieter-Paul Giesberts <[email protected]> Reviewed-by: Franky Lin <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-02-27brcmfmac: move allocation of control rx buffer to brcmf_sdio_bus_preinit()Arend Van Spriel1-14/+12
Allocate the control rx buffer needed for firmware control interface during brcmf_sdio_bus_preinit(). This relies on common layer setting struct brcmf_bus::maxctl during brcmf_attach(). By moving the allocation we can move brcmf_attach() in subsequent change. Reviewed-by: Hante Meuleman <[email protected]> Reviewed-by: Pieter-Paul Giesberts <[email protected]> Reviewed-by: Franky Lin <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-02-27brcmfmac: move brcmf_bus_preinit() call just after changing bus stateArend Van Spriel2-3/+5
Moving the brcmf_bus_preinit() call allows the bus code to do some required initialization before handling firmware control messages. Reviewed-by: Hante Meuleman <[email protected]> Reviewed-by: Pieter-Paul Giesberts <[email protected]> Reviewed-by: Franky Lin <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-01-24brcmfmac: separate firmware errors from i/o errorsArend Van Spriel4-20/+31
When using the firmware api it can fail simply because firmware does not like the request or it fails due to issues in the host interface. Currently, there is only a single error code which is confusing. So adding a parameter to pass the firmware error separately and in case of a firmware error always return -EBADE to user-space. Reviewed-by: Hante Meuleman <[email protected]> Reviewed-by: Pieter-Paul Giesberts <[email protected]> Reviewed-by: Franky Lin <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-01-24brcmfmac: assure bcdc dcmd api does not return value > 0Arend Van Spriel2-6/+8
The protocol layer api defines callbacks for dongle commands. Although not really well documented these should only return an error code in case of an error, or 0 upon success. In the bcdc protocol it can return value above 0 and we carry a fix in the caller of the protocol layer api. This patch makes it adhere to the intent of the api as described above. Reviewed-by: Hante Meuleman <[email protected]> Reviewed-by: Pieter-Paul Giesberts <[email protected]> Reviewed-by: Franky Lin <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-01-19Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller1-6/+3
The BPF verifier conflict was some minor contextual issue. The TUN conflict was less trivial. Cong Wang fixed a memory leak of tfile->tx_array in 'net'. This is an skb_array. But meanwhile in net-next tun changed tfile->tx_arry into tfile->tx_ring which is a ptr_ring. Signed-off-by: David S. Miller <[email protected]>
2018-01-16brcmfmac: fix CLM load error for legacy chips when user helper is enabledWright Feng1-6/+3
For legacy chips without CLM blob files, kernel with user helper function returns -EAGAIN when we request_firmware(), and then driver got failed when bringing up legacy chips. We expect the CLM blob file for legacy chip is not existence in firmware path, but the -ENOENT error is transferred to -EAGAIN in firmware_class.c with user helper. Because of that, we continue with CLM data currently present in firmware if getting error from doing request_firmware(). Cc: [email protected] # v4.15.y Reviewed-by: Arend van Spriel <[email protected]> Signed-off-by: Wright Feng <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-01-11b43: Replace mdelay with usleep_range in b43_radio_2057_init_postJia-Ju Bai1-1/+1
b43_radio_2057_init_post is not called in an interrupt handler nor holding a spinlock. The function mdelay in it can be replaced with usleep_range, to reduce busy wait. Signed-off-by: Jia-Ju Bai <[email protected]> Acked-by: Larry Finger <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-01-11brcmfmac: Use zeroing memory allocator than allocator/memsetHimanshu Jha1-10/+10
Use dma_zalloc_coherent for allocating zeroed memory and remove unnecessary memset function. Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci Suggested-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Himanshu Jha <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-01-11brcmfmac: rename brcmf_sdiod_buff_{read,write}() functionsArend Van Spriel1-24/+24
Rename functions to brcmf_sdio_skbuff_{read,write}() as we pass an skbuff to this function. Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-01-11brcmfmac: add comment block in brcmf_sdio_buscore_read()Arend Van Spriel1-0/+7
In brcmf_sdio_buscore_read() there is some special handling upon register access to chipid register of the chipcommon core. Add comment explaining why it is done here. Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-01-11brcmfmac: Remove array of functionsArend Van Spriel3-152/+146
Replace the array of functions with a pair of pointers to the relevant functions. Signed-off-by: Ian Molton <[email protected]> Acked-by: Arend van Spriel <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-01-08brcmfmac: Support 43455 save-restore (SR) feature if FW include -srDouble Lo1-0/+1
This patch will add 43455 into the save-restore(SR) capable chip list, so the SR engine will be enabled with 43455 FW which built-in the -sr function. Signed-off-by: Double Lo <[email protected]> Signed-off-by: Wright Feng <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-01-08brcmfmac: Clean up interrupt macrosIan Molton2-4/+7
Make it more obvious that this code acually enables interrupts, and provide nice definitions for the bits in the register. Signed-off-by: Ian Molton <[email protected]> Acked-by: Arend van Spriel <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-01-08brcmfmac: Replace function index with function pointerIan Molton3-50/+56
In preparation for removing the function array, remove all code that refers to function by index and replace with pointers to the function itself. Signed-off-by: Ian Molton <[email protected]> Reviewed-by: Arend van Spriel <[email protected]> [arend: replace BUG() with WARN() macro] Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-01-08brcmfmac: More efficient and slightly easier to read fixup for 4339 chipsArend Van Spriel1-3/+4
Its more efficient to test the register we're interested in first, potentially avoiding two more comparisons, and therefore always avoiding one comparison per call on all other chips. Signed-off-by: Ian Molton <[email protected]> [arend: fix some checkpatch warnings] Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-01-08brcmfmac: Remove func0 from function arrayIan Molton3-14/+11
func0 is not provided by the mmc stack as a function when probing. Instead providing specific access functions to read/write it. This prepares for a patch to remove the actual array entry itself. Signed-off-by: Ian Molton <[email protected]> Acked-by: Arend van Spriel <[email protected]> [arend: rephrased the commit message] [arend: removed unrelated comment for which separate patch is warranted] Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-01-08brcmfmac: Correctly handle accesses to SDIO func0Ian Molton2-2/+6
Rather than workaround the restrictions on func0 addressing in the driver, set MMC_QUIRK_LENIENT_FN0 Signed-off-by: Ian Molton <[email protected]> Acked-by: Arend van Spriel <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-01-08brcmfmac: stabilise the value of ->sbwad in use for some xfer routines.Ian Molton3-4/+10
The IO functions operate within the Chipcommon IO window. Explicitly set this, rather than relying on the last initialisation IO access to leave it set to the right value by chance. Signed-off-by: Ian Molton <[email protected]> Acked-by: Arend van Spriel <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-01-08brcmfmac: Rename buscore to core for consistencyArend Van Spriel1-2/+2
Avoid confusion with unrelated _buscore labels. Signed-off-by: Ian Molton <[email protected]> Acked-by: Arend van Spriel <[email protected]> [arend: only do the rename] Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-01-08brcmfmac: Remove {r,w}_sdreg32Ian Molton1-46/+42
Remove yet another IO function from the code and replace with one that already exists. Signed-off-by: Ian Molton <[email protected]> Reviewed-by: Arend van Spriel <[email protected]> [arend: keep address calculation, ie. (base + offset) in one line] Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-12-19Merge tag 'wireless-drivers-next-for-davem-2017-12-18' of ↵David S. Miller6-770/+384
git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next The drivers/net/wireless/intel/iwlwifi/pcie/drv.c conflict was resolved using a diff provided by Kalle in his pull request. Kalle Valo says: ==================== wireless-drivers-next patches for 4.16 A bigger pull request this time, the most visible change being the new driver mt76. But there's also Kconfig refactoring in ath9k and ath10k, work beginning in iwlwifi to have rate scaling in firmware/hardware, wcn3990 support getting closer in ath10k and lots of smaller changes. mt76 * a new driver for MT76x2e, a 2x2 PCIe 802.11ac chipset by MediaTek ath10k * enable multiqueue support for all hw using mac80211 wake_tx_queue op * new Kconfig option ATH10K_SPECTRAL to save RAM * show tx stats on QCA9880 * new qcom,ath10k-calibration-variant DT entry * WMI layer support for wcn3990 ath9k * new Kconfig option ATH9K_COMMON_SPECTRAL to save RAM wcn36xx * hardware scan offload support wil6210 * run-time PM support when interface is down iwlwifi * initial work for rate-scaling offload * Support for new FW API version 36 * Rename the temporary hw name A000 to 22000 ssb * make SSB a menuconfig to ease disabling it all mwl8k * enable non-DFS 5G channels 149-165 ==================== Signed-off-by: David S. Miller <[email protected]>
2017-12-14brcmfmac: enlarge buffer size of caps to 512 bytesWright Feng1-3/+9
The buffer size of return of cap iovar is greater than 256 bytes in some firmwares. For instance, the return size of cap iovar is 271 bytes in 4373 13.10.246.79 firmare. It makes feature capability parsing failed because caps buffer is default value. So we enlarge caps buffer size to 512 bytes and add the error print for cap iovar error. Signed-off-by: Wright Feng <[email protected]> Acked-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-12-14brcmfmac: Remove repeated calls to brcmf_chip_get_core()Ian Molton1-10/+15
There is no need to repeatdly call brcmf_chip_get_core(), which traverses a list of cores every time its called (including during register access code!). Call it once, and store a pointer to the core structure. The existing code does nto keep track of users of the cores anyway, and even so, this will allow for easier refcounting in future. Signed-off-by: Ian Molton <[email protected]> Reviewed-by: Arend van Spriel <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-12-14brcmfmac: Remove unused macro.Ian Molton1-2/+0
This macro is used exactly nowhere in the code. Delete it. Signed-off-by: Ian Molton <[email protected]> Reviewed-by: Arend van Spriel <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-12-14brcmfmac: Cleanup offsetof()Ian Molton1-21/+14
Create a macro to make the code a bit more readable, whilst we're stuck with using struct element offsets as register offsets. Signed-off-by: Ian Molton <[email protected]> Reviewed-by: Arend van Spriel <[email protected]> [arend: rename macro to SD_REG] Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-12-14brcmfmac: remove unnecessary call to brcmf_sdiod_set_backplane_window()Ian Molton1-5/+0
All functions that might require the window address changing call brcmf_sdiod_set_backplane_window() prior to access. Thus resetting the window is not required. Signed-off-by: Ian Molton <[email protected]> [arend: corrected the driver prefix in the subject] Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-12-14brcmfmac: Remove brcmf_sdiod_addrprep()Ian Molton1-38/+46
This function has become trivial enough that it may as well be pushed into its callers, which has the side-benefit of clarifying what's going on. Remove it, and rename brcmf_sdiod_set_sbaddr_window() to brcmf_sdiod_set_backplane_window() as it's easier to understand. Signed-off-by: Ian Molton <[email protected]> Reviewed-by: Arend van Spriel <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-12-14brcmfmac: Tidy register definitions a littleIan Molton2-11/+12
Trivial tidy of register definitions. Signed-off-by: Ian Molton <[email protected]> Acked-by: Arend van Spriel <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-12-14brcmfmac: Rename / replace old IO functions with simpler ones.Ian Molton3-245/+138
Primarily this patch removes: brcmf_sdiod_f0_writeb() brcmf_sdiod_reg_write() brcmf_sdiod_reg_read() Since we no longer use the quirky method of deciding which function to address via the address being accessed, take the opportunity to rename some IO functions more in line with common kernel code. We also convert those that map directly to sdio_{read,write}*() to macros. Signed-off-by: Ian Molton <[email protected]> Reviewed-by: Arend van Spriel <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-12-14brcmfmac: Clarify if using braces.Ian Molton1-2/+3
Whilst this if () statement is technically correct, it lacks clarity. Signed-off-by: Ian Molton <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-12-14brcmfmac: whitespace fixes in brcmf_sdiod_send_buf()Ian Molton1-1/+2
Signed-off-by: Ian Molton <[email protected]> Reviewed-by: Arend van Spriel <[email protected]> [arend: mention function in patch subject] Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-12-14brcmfmac: Split brcmf_sdiod_buffrw function up.Ian Molton1-22/+45
This function needs to be split up into separate read / write variants for clarity. Signed-off-by: Ian Molton <[email protected]> Reviewed-by: Arend van Spriel <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-12-14brcmsmac: use ARRAY_SIZE on rfseq_updategainu_eventsColin Ian King1-2/+1
Use the ARRAY_SIZE macro on rfseq_updategainu_events to determine size of the array. Improvement suggested by coccinelle. Signed-off-by: Colin Ian King <[email protected]> Acked-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-12-08wireless: use ARRAY_SIZEJérémy Lefaure1-357/+105
Using the ARRAY_SIZE macro improves the readability of the code. Also, it is not always useful to use a variable to store this constant calculated at compile time. Found with Coccinelle with the following semantic patch: @r depends on (org || report)@ type T; T[] E; position p; @@ ( (sizeof(E)@p /sizeof(*E)) | (sizeof(E)@p /sizeof(E[...])) | (sizeof(E)@p /sizeof(T)) ) Signed-off-by: Jérémy Lefaure <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-12-07brcmfmac: Avoid build error with make W=1Andy Shevchenko1-1/+1
When I run make W=1 on gcc (Debian 7.2.0-16) 7.2.0 I got an error for the first run, all next ones are okay. CC [M] drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.o drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:2078: error: Cannot parse struct or union! scripts/Makefile.build:310: recipe for target 'drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.o' failed Seems like something happened with W=1 and wrong kernel doc format. As a quick fix remove dubious /** in the code. Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-12-07brcmfmac: Rename bcmerror to errIan Molton1-7/+7
Trivial cleanup of nasty variable name Signed-off-by: Ian Molton <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-12-07brcmfmac: Remove noisy debugging.Ian Molton1-6/+0
If you need debugging this low level, you're doing something wrong. Remove these noisy debug statements so the code is more readable. Signed-off-by: Ian Molton <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-12-07brcmfmac: Fix asymmetric IO functions.Ian Molton1-1/+1
Unlikely to be a problem, but brcmf_sdiod_regrl() is not symmetric with brcmf_sdiod_regrb() in initializing the data value on stack. Fix that. Signed-off-by: Ian Molton <[email protected]> [arend: reword the commit message a bit] Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-12-07brcmfmac: Remove brcmf_sdiod_request_data()Ian Molton2-152/+87
This function is obfuscating how IO works on this chip. Remove it and push its logic into brcmf_sdiod_reg_{read,write}(). Handling of -ENOMEDIUM is altered, but as that's pretty much broken anyway we can ignore that. Signed-off-by: Ian Molton <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-12-07brcmfmac: Remove bandaid for SleepCSRIan Molton1-27/+1
Register access code is not the place for band-aid fixes like this. If this is a genuine problem, it should be fixed further up in the driver stack. Signed-off-by: Ian Molton <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-12-07brcmfmac: Remove dead IO codeIan Molton1-10/+8
The value passed to brcmf_sdiod_addrprep() is *always* 4 remove this parameter and the unused code to handle it. Signed-off-by: Ian Molton <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-12-07brcmfmac: Clean up brcmf_sdiod_set_sbaddr_window()Ian Molton2-15/+5
This function sets the address of the IO window used for SDIO accesses onto the backplane of the chip. It currently uses 3 separate masks despite the full mask being defined in the code already. Remove the separate masks and clean up. Signed-off-by: Ian Molton <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>