aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless
AgeCommit message (Collapse)AuthorFilesLines
2018-11-06prism54: isl_38xx: Mark expected switch fall-throughGustavo A. R. Silva1-0/+1
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114944 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06orinoco_usb: mark expected switch fall-throughGustavo A. R. Silva1-0/+1
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06iwlegacy: common: mark expected switch fall-throughsGustavo A. R. Silva1-0/+2
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 201384 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06iwlegacy: 4965-mac: mark expected switch fall-throughGustavo A. R. Silva1-1/+1
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06rtl8xxxu: Fix missing break in switchGustavo A. R. Silva1-0/+1
Add missing break statement in order to prevent the code from falling through to the default case. Fixes: 26f1fad29ad9 ("New driver: rtl8xxxu (mac80211)") Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06rtl8xxxu: Mark expected switch fall-throughsGustavo A. R. Silva1-0/+4
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1357355 ("Missing break in switch") Addresses-Coverity-ID: 1357378 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06rtlwifi: btcoex: remove set but not used variable 'ppsc'YueHaibing1-4/+0
Fixes gcc '-Wunused-but-set-variable' warning: drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c: In function 'halbtc_leave_lps': drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c:295:21: warning: variable 'ppsc' set but not used [-Wunused-but-set-variable] drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c: In function 'halbtc_enter_lps': drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c:318:21: warning: variable 'ppsc' set but not used [-Wunused-but-set-variable] It never used since introduction in commit aa45a673b291 ("rtlwifi: btcoexist: Add new mini driver") Signed-off-by: YueHaibing <[email protected]> Acked-by: Ping-Ke Shih <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06qtnfmac: fix error handling in control pathSergey Matyukevich1-8/+13
This patch fixes the following warnings: - smatch drivers/net/wireless/quantenna/qtnfmac/commands.c:132 qtnf_cmd_send_with_reply() warn: variable dereferenced before check 'resp' (see line 117) drivers/net/wireless/quantenna/qtnfmac/commands.c:716 qtnf_cmd_get_sta_info() error: uninitialized symbol 'var_resp_len'. drivers/net/wireless/quantenna/qtnfmac/commands.c:1668 qtnf_cmd_get_mac_info() error: uninitialized symbol 'var_data_len'. drivers/net/wireless/quantenna/qtnfmac/commands.c:1697 qtnf_cmd_get_hw_info() error: uninitialized symbol 'info_len'. drivers/net/wireless/quantenna/qtnfmac/commands.c:1753 qtnf_cmd_band_info_get() error: uninitialized symbol 'info_len'. drivers/net/wireless/quantenna/qtnfmac/commands.c:1782 qtnf_cmd_send_get_phy_params() error: uninitialized symbol 'response_size'. drivers/net/wireless/quantenna/qtnfmac/commands.c:2438 qtnf_cmd_get_chan_stats() error: uninitialized symbol 'var_data_len'. - gcc-8.2.1 drivers/net/wireless/quantenna/qtnfmac/commands.c: In function 'qtnf_cmd_send_with_reply': drivers/net/wireless/quantenna/qtnfmac/commands.c:133:54: error: 'resp' may be used uninitialized in this function [-Werror=maybe-uninitialized] Reported-by: Dan Carpenter <[email protected]> Reported-by: Arnd Bergmann <[email protected]> Signed-off-by: Sergey Matyukevich <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06brcmfmac: fix spelling mistake "Retreiving" -> "Retrieving"Colin Ian King1-2/+2
Trivial fix to spelling mistake in brcmf_err error message. Signed-off-by: Colin Ian King <[email protected]> Acked-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06qtnfmac: add support for Topaz chipsetsSergey Matyukevich9-5/+1373
This patch adds support for QSR1000/QSR2000 family of chipsets to qtnfmac_pcie platform driver. QSR1000/QSR2000 (aka Topaz) is a family of 80MHz, 11ac Wave2, 4x4/2x4/2x2 chips, including single and dual band devices. Depending on specific chip model and firmware in use, either STA or both STA and AP modes are supported. Patch adds Topaz support to qtnfmac_pcie driver. Proper platform bus will be selected on probing based on chip ID. Signed-off-by: Igor Mitsyanko <[email protected]> Signed-off-by: Sergey Matyukevich <[email protected]> Signed-off-by: Andrey Shevchenko <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06qtnfmac_pcie: use single PCIe driver for all platformsIgor Mitsyanko7-251/+292
Single PCIe driver can identify hardware type by reading CHIP ID at probe time and invoking a correct initialization sequence. Signed-off-by: Igor Mitsyanko <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06wlcore: Fix the return value in case of error in ↵Christophe JAILLET1-1/+1
'wlcore_vendor_cmd_smart_config_start()' We return 0 unconditionally at the end of 'wlcore_vendor_cmd_smart_config_start()'. However, 'ret' is set to some error codes in several error handling paths and we already return some error codes at the beginning of the function. Return 'ret' instead to propagate the error code. Fixes: 80ff8063e87c ("wlcore: handle smart config vendor commands") Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06libertas: remove set but not used variable 'int_type'YueHaibing1-3/+1
Fixes gcc '-Wunused-but-set-variable' warning: drivers/net/wireless/marvell/libertas/if_spi.c: In function 'if_spi_h2c': drivers/net/wireless/marvell/libertas/if_spi.c:799:6: warning: variable 'int_type' set but not used [-Wunused-but-set-variable] It never used since introduction in commit d2b21f191753 ("libertas: if_spi, driver for libertas GSPI devices") Signed-off-by: YueHaibing <[email protected]> Tested-by: Lubomir Rintel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06rsi: fix spelling mistake "Initialzing" -> "Initializing"Colin Ian King1-2/+2
Trivial fix to spelling mistake in rsi_dbg debug message Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06brcmfmac: Fix ccode from EFI nvram when necessaryHans de Goede1-0/+24
In some cases the EFI-var stored nvram contains "ccode=ALL" or "ccode=XV" to specify "worldwide" compatible settings, but these 2 ccode-s do not work properly. I've tested the different known "worldwide" ccode-s used in various nvram sources with the latest firmwares from linux-firmware for various brcmfmac models, here is a simplified (*) table with what each setting results in: ALL: 12-14 disab, U-NII-1, U-NII-2 no-IR/radar, U-NII-3 XV: 12-14 no-IR, disables all 5G channels XY: 12-13 enab, 14 disab, U-NII-1 enab, U-NII-2 no-IR/radar, U-NII-3 disab X2: 12-13 no-IR, 14 dis, U-NII-1 no-IR, U-NII-2 no-IR/radar, U-NII-3 no-IR Where 12,13,14 are 2.4G channels 12-14 and U-NII-1/2/3 are the 3 different 5G channel groups. no-IR is no-Initiate-Radiation, we will never send on these channels without first having received valid wifi traffic there. This immediately shows that both ALL and XV are not as worldwide as we want them to be. ALL causes channels 12 and 13 to not be available and XV causes all 5GHz channels to not be available. Also ALL unconditionally enables the U-NII-1 and U-NII-3 5G groups, while we really should be using no-IR for these. This commit replace XV and ALL with X2, which allows usage of chan 12-13 and 5G channels, but only after receiving valid wifi traffic there first. Note that this configure the firmware's channel limits, the kernels own regulatory restrictions based on e.g. regulatory info received from the access-point, will be applied on top of this. This fixes channels 12+13 not working on the Asus T200TA and the Lenovo Mixx 2 8 and 5G channels not working on the Asus T100HA. This has been tested on the following models: Acer Iconia Tab8 w1-810, Acer One 10, Asus T100CHI, Asus T100HA, Asus T100TA, Asus T200TA and a Lenovo Mixx 2 8. *) There are some exceptions to this table: 1) On really old firmware e.g. linux-firmware's 2011 brcmfmac4330-sdio.bin ALL really means all, unconditionally enabling everything 2) The exact meaning might be influenced by setting the regrev nvram var. Specifically using ccode=XV + regrev=1 on brcmfmac43241b4 leads to: 12-14 no-ir, U-NII-1 no-ir, U-NII-2 no-ir/radar, U-NII-3 no-ir But only on the brcmfmac43241b4 and not on e.g. the brcmfmac43340 Tested-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06brcmfmac: Add support for getting nvram contents from EFI variablesHans de Goede1-6/+57
Various X86 laptops with a SDIO attached brcmfmac wifi chip, store the nvram contents in a special EFI variable. This commit adds support for getting nvram directly from this EFI variable, without the user needing to manually copy it. This makes Wifi / Bluetooth work out of the box on these devices instead of requiring manual setup. This has been tested on the following models: Acer Iconia Tab8 w1-810, Acer One 10, Asus T100CHI, Asus T100HA, Asus T100TA, Asus T200TA and a Lenovo Mixx 2 8. Tested-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06brcmfmac: Cleanup brcmf_fw_request_done()Hans de Goede1-7/+1
The "cur" variable is now only used for a debug print and we already print the same info from brcmf_fw_complete_request(), so the debug print does not provide any extra info and we can remove it. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06brcmfmac: Set board_type from DMI on x86 based machinesHans de Goede4-1/+127
For x86 based machines, set the board_type used for nvram file selection based on the DMI sys-vendor and product-name strings. Since on some models these strings are too generic, this commit also adds a quirk table overriding the strings for models listed in that table. The board_type setting is used to load the board-specific nvram file with a board-specific name so that we can ship files for each supported board in linux-firmware. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06brcmfmac: Set board_type used for nvram file selection to machine-compatibleHans de Goede4-1/+13
For of/devicetree using machines, set the board_type used for nvram file selection to the first string listed in the top-level's node compatible string, aka the machine-compatible as used by of_machine_is_compatible(). The board_type setting is used to load the board-specific nvram file with a board-specific name so that we can ship files for each supported board in linux-firmware. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06brcmfmac: Add support for first trying to get a board specific nvram fileHans de Goede2-1/+27
The nvram files which some brcmfmac chips need are board-specific. To be able to distribute these as part of linux-firmware, so that devices with such a wifi chip will work OOTB, multiple (one per board) versions must co-exist under /lib/firmware. This commit adds support for callers of the brcmfmac/firmware.c code to pass in a board_type parameter through the request structure. If that parameter is set then the code will first try to load chipmodel.board_type.txt before falling back to the old chipmodel.txt name. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06brcmfmac: Remove recursion from firmware load error handlingHans de Goede1-46/+19
Before this commit brcmf_fw_request_done would call brcmf_fw_request_next_item to load the next item, which on an error would call brcmf_fw_request_done, which if the error is recoverable (*) will then continue calling brcmf_fw_request_next_item for the next item again which on an error will call brcmf_fw_request_done again... This does not blow up because we only have a limited number of items so we never recurse too deep. But the recursion is still quite ugly and frankly is giving me a headache, so lets fix this. This commit fixes this by removing brcmf_fw_request_next_item and by making brcmf_fw_get_firmwares and brcmf_fw_request_done directly call firmware_request_nowait resp. firmware_request themselves. *) brcmf_fw_request_nvram_done fallback path succeeds or BRCMF_FW_REQF_OPTIONAL is set Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06brcmfmac: Remove firmware-loading code duplicationHans de Goede1-31/+31
brcmf_fw_request_next_item and brcmf_fw_request_done both have identical code to complete the fw-request depending on the item-type. This commit adds a new brcmf_fw_complete_request helper removing this code duplication. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06mt76: fix building without CONFIG_LEDS_CLASSArnd Bergmann3-5/+15
When CONFIG_LEDS_CLASS is disabled, or it is a loadable module while mt76 is built-in, we run into a link error: drivers/net/wireless/mediatek/mt76/mac80211.o: In function `mt76_register_device': mac80211.c:(.text+0xb78): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `devm_of_led_classdev_register' We don't really need a hard dependency here as the driver can presumably work just fine without LEDs, so this follows the iwlwifi example and adds a separate Kconfig option for the LED support, this will be available whenever it will link, and otherwise the respective code gets left out from the driver object. Fixes: 17f1de56df05 ("mt76: add common code shared between multiple chipsets") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06brcmutil: really fix decoding channel info for 160 MHz bandwidthRafał Miłecki1-0/+3
Previous commit /adding/ support for 160 MHz chanspecs was incomplete. It didn't set bandwidth info and didn't extract control channel info. As the result it was also using uninitialized "sb" var. This change has been tested for two chanspecs found to be reported by some devices/firmwares: 1) 60/160 (0xee32) Before: chnum:50 control_ch_num:36 After: chnum:50 control_ch_num:60 2) 120/160 (0xed72) Before: chnum:114 control_ch_num:100 After: chnum:114 control_ch_num:120 Fixes: 330994e8e8ec ("brcmfmac: fix for proper support of 160MHz bandwidth") Signed-off-by: Rafał Miłecki <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06wlcore: Fixup "Add support for optional wakeirq"John Stultz1-6/+11
After commit 3c83dd577c7f ("wlcore: Add support for optional wakeirq") landed upstream, I started seeing the following oops on my HiKey board: [ 1.870279] Unable to handle kernel read from unreadable memory at virtual address 0000000000000010 [ 1.870283] Mem abort info: [ 1.870287] ESR = 0x96000005 [ 1.870292] Exception class = DABT (current EL), IL = 32 bits [ 1.870296] SET = 0, FnV = 0 [ 1.870299] EA = 0, S1PTW = 0 [ 1.870302] Data abort info: [ 1.870306] ISV = 0, ISS = 0x00000005 [ 1.870309] CM = 0, WnR = 0 [ 1.870312] [0000000000000010] user address but active_mm is swapper [ 1.870318] Internal error: Oops: 96000005 [#1] PREEMPT SMP [ 1.870327] CPU: 0 PID: 5 Comm: kworker/0:0 Not tainted 4.19.0-05129-gb3d1e8e #48 [ 1.870331] Hardware name: HiKey Development Board (DT) [ 1.870350] Workqueue: events_freezable mmc_rescan [ 1.870358] pstate: 60400005 (nZCv daif +PAN -UAO) [ 1.870366] pc : wl1271_probe+0x210/0x350 [ 1.870371] lr : wl1271_probe+0x210/0x350 [ 1.870374] sp : ffffff80080739b0 [ 1.870377] x29: ffffff80080739b0 x28: 0000000000000000 [ 1.870384] x27: 0000000000000000 x26: 0000000000000000 [ 1.870391] x25: 0000000000000036 x24: ffffffc074ecb598 [ 1.870398] x23: ffffffc07ffdce78 x22: ffffffc0744ed808 [ 1.870404] x21: ffffffc074ecbb98 x20: ffffff8008ff9000 [ 1.870411] x19: ffffffc0744ed800 x18: ffffff8008ff9a48 [ 1.870418] x17: 0000000000000000 x16: 0000000000000000 [ 1.870425] x15: ffffffc074ecb503 x14: ffffffffffffffff [ 1.870431] x13: ffffffc074ecb502 x12: 0000000000000030 [ 1.870438] x11: 0101010101010101 x10: 0000000000000040 [ 1.870444] x9 : ffffffc075400248 x8 : ffffffc075400270 [ 1.870451] x7 : 0000000000000000 x6 : 0000000000000000 [ 1.870457] x5 : 0000000000000000 x4 : 0000000000000000 [ 1.870463] x3 : 0000000000000000 x2 : 0000000000000000 [ 1.870469] x1 : 0000000000000028 x0 : 0000000000000000 [ 1.870477] Process kworker/0:0 (pid: 5, stack limit = 0x(____ptrval____)) [ 1.870480] Call trace: [ 1.870485] wl1271_probe+0x210/0x350 [ 1.870491] sdio_bus_probe+0x100/0x128 [ 1.870500] really_probe+0x1a8/0x2b8 [ 1.870506] driver_probe_device+0x58/0x100 [ 1.870511] __device_attach_driver+0x94/0xd8 [ 1.870517] bus_for_each_drv+0x70/0xc8 [ 1.870522] __device_attach+0xe0/0x140 [ 1.870527] device_initial_probe+0x10/0x18 [ 1.870532] bus_probe_device+0x94/0xa0 [ 1.870537] device_add+0x374/0x5b8 [ 1.870542] sdio_add_func+0x60/0x88 [ 1.870546] mmc_attach_sdio+0x1b0/0x358 [ 1.870551] mmc_rescan+0x2cc/0x390 [ 1.870558] process_one_work+0x12c/0x320 [ 1.870563] worker_thread+0x48/0x458 [ 1.870569] kthread+0xf8/0x128 [ 1.870575] ret_from_fork+0x10/0x18 [ 1.870583] Code: 92400c21 b2760021 a90687a2 97e95bf9 (f9400803) [ 1.870587] ---[ end trace 1e15f81d3c139ca9 ]--- It seems since we don't have a wakeirq value in the dts, the wakeirq value in wl1271_probe() is zero, which then causes trouble in irqd_get_trigger_type(irq_get_irq_data(wakeirq)). This patch tries to address this by checking if wakeirq is zero, and not trying to add it to the resources if that is the case. Fixes: 3c83dd577c7f ("wlcore: Add support for optional wakeirq") Cc: Tony Lindgren <[email protected]> Cc: Kalle Valo <[email protected]> Cc: Eyal Reizer <[email protected]> Cc: Anders Roxell <[email protected]> Cc: [email protected] Acked-by: Tony Lindgren <[email protected]> Signed-off-by: John Stultz <[email protected]> Tested-by: Anders Roxell <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06ath9k: Fix a locking bug in ath9k_add_interface()Dan Carpenter1-2/+1
We tried to revert commit d9c52fd17cb4 ("ath9k: fix tx99 with monitor mode interface") but accidentally missed part of the locking change. The lock has to be held earlier so that we're holding it when we do "sc->tx99_vif = vif;" and also there in the current code there is a stray unlock before we have taken the lock. Fixes: 6df0580be8bc ("ath9k: add back support for using active monitor interfaces for tx99") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06ath9k: dynack: remove 'experimental' tagLorenzo Bianconi1-1/+1
Remove experimental tag from dynack Kconfig entry since it has been tested on outdoor 25Km links Tested-by: Koen Vandeputte <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06ath9k: dynack: make ewma estimation fasterLorenzo Bianconi4-12/+29
In order to make propagation time estimation faster, use current sample as ewma output value during 'late ack' tracking Tested-by: Koen Vandeputte <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06ath9k: dynack: check da->enabled first in sampling routinesLorenzo Bianconi1-2/+2
Check da->enabled flag first in ath_dynack_sample_tx_ts and ath_dynack_sample_ack_ts routines in order to avoid useless processing Tested-by: Koen Vandeputte <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06ath9k: dynack: move debug log after buffer incrementsLorenzo Bianconi1-14/+12
Move debug log in ath_dynack_sample_tx_ts and ath_dynack_sample_ack_ts after timestamp buffer head/tail increments in order to make debugging more user friendly Tested-by: Koen Vandeputte <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06ath9k: dynack: use authentication messages for 'late' ackLorenzo Bianconi1-1/+2
In order to properly support dynack in ad-hoc mode running wpa_supplicant, take into account authentication frames for 'late ack' detection. This patch has been tested on devices mounted on offshore high-voltage stations connected through ~24Km link Reported-by: Koen Vandeputte <[email protected]> Tested-by: Koen Vandeputte <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06ath10k: fix struct init whitespace in SNOC driverBrian Norris1-6/+6
Signed-off-by: Brian Norris <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06ath10k: don't assume this is a PCI dev in generic codeBrian Norris1-2/+1
Not all devices using this driver are backed by a PCI device, so it's not fair to assume 'to_pci_dev()' is valid. Fortunately, we only were using this to convert straight back to a bare 'device', which means we were only doing no-op pointer arithmetic, and not actually accessing potentially out-of-bounds memory. But this is still bad practice. Just use 'ar->dev' directly, since that's really all we're looking for. Fixes: 209b2a68de76 ("ath10k: add platform regulatory domain support") Signed-off-by: Brian Norris <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06ath10k: assign 'n_cipher_suites' for WCN3990Brian Norris1-0/+1
Commit 2ea9f12cefe4 ("ath10k: add new cipher suite support") added a new n_cipher_suites HW param with a fallback value and a warning log. Commit 03a72288c546 ("ath10k: wmi: add hw params entry for wcn3990") later added WCN3990 HW entries, but it missed the n_cipher_suites. Rather than seeing this warning every boot ath10k_snoc 18800000.wifi: invalid hw_params.n_cipher_suites 0 let's provide the appropriate value. Cc: Rakesh Pillai <[email protected]> Cc: Govind Singh <[email protected]> Signed-off-by: Brian Norris <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06ath10k: ath10k_snoc_{read,write}32() should be staticBrian Norris2-4/+2
They're provided as callbacks in ath10k_hif_ops and should be accessed that way, if needed outside of snoc.c, and anyway, they're currently unused outside snoc.c. Signed-off-by: Brian Norris <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06ath10k: snoc: fix unbalanced clock error handlingBrian Norris1-1/+1
Similar to regulator error handling, we should only start tearing down the 'i - 1' clock when clock 'i' fails to enable. Otherwise, we might end up with an unbalanced clock, where we never successfully enabled the clock, but we try to disable it anyway. Fixes: a6a793f98786 ("ath10k: vote for hardware resources for WCN3990") Signed-off-by: Brian Norris <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06ath10k: snoc: relax voltage requirementsBrian Norris1-4/+4
I rarely see drivers specify precise voltage requirements like this, but if we really have to...let's at least give a little wiggle room. Board designs (and accompanying device trees) may not provide exactly the voltage listed here, and we shouldn't fail to probe just because of this. Round these ranges down to the nearest volt, and provide a 0.05V margin. The regulator should provide its own supported ranges, which will helpfully intersect with these ranges. I would just as well remove these ranges entirely, but if I understand correctly, there's some reason that QCOM SoC's like to set zero / non-zero voltages. Signed-off-by: Brian Norris <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06ath10k: snoc: fix unabalanced regulator error handlingBrian Norris1-54/+75
If a regulator fails to set its voltage, we end up with an unbalanced call to regulator_disable(), because the error path starts with the current regulator (which was never enabled). Factor out the "on" function to perform (and unwind if failed) a single regulator at a time, and then main loop (ath10k_snoc_vreg_on()) can just worry about unwinding the regulators that were already enabled. It also helps to factor out the "off" function, to avoid repeating some code here. Signed-off-by: Brian Norris <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06ath10k: snoc: remove 'wcn3990' from generic resource handlingBrian Norris2-21/+21
ath10k_wcn3990_clk_info and ath10k_wcn3990_vreg_info are not WCN3990-specific structures. They hold generic data. So don't name them with wcn3990 specifics. Signed-off-by: Brian Norris <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06wil6210: fix locking in wmi_callLior David1-4/+5
Switch from spin_lock to spin_lock_irqsave, because wmi_ev_lock is used inside interrupt handler. Signed-off-by: Lior David <[email protected]> Signed-off-by: Maya Erez <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06wil6210: fix freeing of rx buffers in EDMA modeAhmad Masri1-30/+14
After being associated with some EDMA rx traffic, upon "down" driver doesn't free all skbs in the rx ring. Modify wil_move_all_rx_buff_to_free_list to loop on active list of rx buffers, unmap the physical memory and free the skb. Signed-off-by: Ahmad Masri <[email protected]> Signed-off-by: Maya Erez <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06wil6210: remove unnecessary alignment code from rx flowAhmad Masri1-6/+4
Rx buffers in EDMA mode are initialized to 4 bytes aligned size. Remove the unnecessary alignment code applied on rx buffer size. Signed-off-by: Ahmad Masri <[email protected]> Signed-off-by: Maya Erez <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06wil6210: fix RGF_CAF_ICR address for Talyn-MBMaya Erez2-2/+10
RGF_CAF_ICR register location has changed in Talyn-MB. Add RGF_CAF_ICR_TALYN_MB to support the new address. Signed-off-by: Maya Erez <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06wil6210: fix L2 RX status handlingMaya Erez1-11/+12
L2 RX status errors should not be treated as a bitmap and the actual error values should be checked. Print L2 errors as wil_err_ratelimited for easier debugging when such errors occurs. Signed-off-by: Maya Erez <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06wil6210: fix debugfs memory access alignmentAhmad Masri1-5/+10
All wil6210 device memory access should be 4 bytes aligned. In io blob wil6210 did not force alignment for read function, this caused alignment fault on some platforms. Fixing that by accessing all 4 lower bytes and return to host the requested data. Signed-off-by: Ahmad Masri <[email protected]> Signed-off-by: Maya Erez <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06wil6210: add general initialization/size checksAlexei Avshalom Lazar2-1/+3
Initialize unset variable, and verify that mid is valid. Signed-off-by: Alexei Avshalom Lazar <[email protected]> Signed-off-by: Maya Erez <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06wil6210: notify cqm packet loss on disable_ap_smeAhmad Masri1-0/+17
wil6210 used to notify cfg80211_del_sta on every fw disconnect event. In disable_ap_sme mode the userspace manages the protocol SME and FW sends disconnect event only due to link loss. In disable_ap_sme mode, indicate CQM packet loss to let the host control the connection and disconnect the link if needed. Signed-off-by: Ahmad Masri <[email protected]> Signed-off-by: Maya Erez <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06wil6210: refactor disconnect flowAhmad Masri5-72/+147
Separate sending command to the fw from the event handling function to simplify the disconnect flow and track the from_event flag correctly. Signed-off-by: Ahmad Masri <[email protected]> Signed-off-by: Maya Erez <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06wil6210: fix memory leak in wil_find_tx_bcast_2Lior David1-0/+2
A successful call to wil_tx_ring takes skb reference so it will only be freed in wil_tx_complete. Consume the skb in wil_find_tx_bcast_2 to prevent memory leak. Signed-off-by: Lior David <[email protected]> Signed-off-by: Maya Erez <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2018-11-06wil6210: add recovery for FW error while in AP modeDedy Lansky3-8/+120
AP configuration is stored by the driver. Upon FW error, disconnect notification is sent to user space for any associated stations. AP is then internally restarted with the stored configuration. Signed-off-by: Dedy Lansky <[email protected]> Signed-off-by: Maya Erez <[email protected]> Signed-off-by: Kalle Valo <[email protected]>