summaryrefslogtreecommitdiff
path: root/drivers/net/wireless
AgeCommit message (Collapse)Author
2017-08-31wil6210: ratelimit errors in TX/RX interruptsLior David
Sometimes there is a firmware crash but the hardware is not fully stopped and continue to send TX/RX interrupts. This can cause an overload of messages which can bring the host down. Add ratelimit to these error messages to fix this. Signed-off-by: Lior David <qca_liord@qca.qualcomm.com> Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-08-31ath10k: activate user space firmware loading againHauke Mehrtens
In commit 9f5bcfe93315 ("ath10k: silence firmware file probing warnings") the firmware loading was changed from request_firmware() to request_firmware_direct() to silence some warnings in case it fails. request_firmware_direct() directly searches in the file system only and does not send a hotplug event to user space in case it could not find the firmware directly. In LEDE we use a user space script to extract the calibration data from the flash memory which gets triggered by the hotplug event. This way the firmware gets extracted from some vendor specific partition when the driver requests this firmware. This mechanism does not work any more after this change. Fixes: 9f5bcfe93315 ("ath10k: silence firmware file probing warnings") Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Cc: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-08-31ath10k: sdio: remove unused struct memberErik Stromdahl
irq_wq in struct ath10k_sdio is a remnant from an earlier version of the sdio patchset. Its use was removed as a result of Kalle's review, but somehow the struct member survived. It is not used and can therefore safely be removed. Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-08-31ath10k: fix napi_poll budget overflowRyan Hsu
In napi_poll, the budget number is used to control the amount of packets we should handle per poll to balance the resource in the system. In the list of the amsdu packets reception, we check if there is budget count left and handle the complete list of the packets, that it will have chances the very last list will over the budget leftover. So adding one more parameter - budget_left, this would help while traversing the list to avoid handling more than the budget given. Reported-by: Andrey Ryabinin <aryabinin@virtuozzo.com> Fix-suggested-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com> Link: https://lkml.kernel.org/r/26670dce-4dd2-f8e4-0e14-90d74257e739@virtuozzo.com Signed-off-by: Ryan Hsu <ryanhsu@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-08-30rsi: remove memset before memcpyHimanshu Jha
calling memcpy immediately after memset with the same region of memory makes memset redundant. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-30rt2800: fix TX_PIN_CFG setting for non MT7620 chipsStanislaw Gruszka
Since commit 41977e86c984 ("rt2x00: add support for MT7620") we do not initialize TX_PIN_CFG setting. This cause breakage at least on some RT3573 devices. To fix the problem patch restores previous behaviour for non MT7620 chips. Fixes: 41977e86c984 ("rt2x00: add support for MT7620") Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1480829 Reported-and-tested-by: Jussi Eloranta <jussi.eloranta@csun.edu> Cc: Daniel Golle <daniel@makrotopia.org> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Daniel Golle <daniel@makrotopia.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-30rsi: missing unlocks on error pathsDan Carpenter
There is a missing unlock if rsi_find_sta() fails in rsi_mac80211_ampdu_action() or if we hit the -EINVAL path in rsi_mac80211_sta_add(). Fixes: 3528608f3a79 ("rsi: handle station connection in AP mode") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-30rsi: update some commentsDan Carpenter
These functions don't return -1 on failure. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-30iwlwifi: mvm: bump API to 34 for 8000 and upEmmanuel Grumbach
These devices support -34.ucode, so load it. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-30iwlwifi: mvm: Avoid deferring non bufferable framesDavid Spinadel
Use bcast station for all non bufferable frames on AP and AD-HOC. The host is no longer aware of STAs PS status because of buffer station offload, so we can't rely on mac80211 to toggle on IEEE80211_TX_CTL_NO_PS_BUFFER bit. A possible issue with buffering such frames, beside the obvious spec violation, is when a station disconnects while in PS but the AP isn't aware of that. In such scenarios the AP won't be able to send probe responses or auth frames so the STA won't be able to reconnect and the AP will have a queue hang. Fixes: 3e56eadfb6a1 ("iwlwifi: mvm: implement AP/GO uAPSD support") Signed-off-by: David Spinadel <david.spinadel@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-30iwlwifi: fix long debug printLiad Kaufman
There is a debug print that sometimes reaches over 110 chars, thus generating a warning in those cases. Split the print into two to prevent these cases. Fixes: 92b0f7b26b31 ("iwlwifi: split the regulatory rules when the bandwidth flags require it") Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-24iwlwifi: pcie: move rx workqueue initialization to iwl_trans_pcie_alloc()Luca Coelho
Work queues cannot be allocated when a mutex is held because the mutex may be in use and that would make it sleep. Doing so generates the following splat with 4.13+: [ 19.513298] ====================================================== [ 19.513429] WARNING: possible circular locking dependency detected [ 19.513557] 4.13.0-rc5+ #6 Not tainted [ 19.513638] ------------------------------------------------------ [ 19.513767] cpuhp/0/12 is trying to acquire lock: [ 19.513867] (&tz->lock){+.+.+.}, at: [<ffffffff924afebb>] thermal_zone_get_temp+0x5b/0xb0 [ 19.514047] [ 19.514047] but task is already holding lock: [ 19.514166] (cpuhp_state){+.+.+.}, at: [<ffffffff91cc4baa>] cpuhp_thread_fun+0x3a/0x210 [ 19.514338] [ 19.514338] which lock already depends on the new lock. This lock dependency already existed with previous kernel versions, but it was not detected until commit 49dfe2a67797 ("cpuhotplug: Link lock stacks for hotplug callbacks") was introduced. Reported-by: David Weinehall <david.weinehall@intel.com> Reported-by: Jiri Kosina <jikos@kernel.org> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-24Merge git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.gitKalle Valo
Stephen Rothwell reported quite a few conflicts in iwlwifi between wireless-drivers and wireless-drivers-next. To avoid any problems later in other trees merge w-d to w-d-next to fix those conflicts early.
2017-08-24wireless: ipw2x00: make iw_handler_def constBhumika Goyal
Make these const as they are only stored in the const field of a net_device structure. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-24net: rsi: mac80211: constify ieee80211_opsArvind Yadav
ieee80211_ops are not supposed to change at runtime. All functions working with ieee80211_ops provided by <net/mac80211.h> work with const ieee80211_ops. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-24wireless: ipw2200: Replace PCI pool old APIRomain Perier
The PCI pool API is deprecated. This commit replaces the PCI pool old API by the appropriate function with the DMA pool API. Signed-off-by: Romain Perier <romain.perier@collabora.com> Reviewed-by: Peter Senna Tschudin <peter.senna@collabora.com> Acked-by: Stanislav Yakovlev <stas.yakovlev@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-24rtlwifi: rtl8821ae: fix spelling mistake: "faill" -> "failed"Colin Ian King
Trivial fix to spelling mistake in RT_TRACE message Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-24mt7601u: check memory allocation failureChristophe Jaillet
Check memory allocation failure and return -ENOMEM in such a case, as already done a few lines below. As 'dev->tx_q' can be NULL, we also need to check for that in 'mt7601u_free_tx()', and return early. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Acked-by: Jakub Kicinski <kubakici@wp.pl> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-24rtlwifi: make a couple arrays largerDan Carpenter
This is a static checker fix. "cal_num" is 10. We're declaring the tx_dt[] and rx_td[] arrays as 3 element arrays. The static checker complains that we do: tx_dt[cal] = (vdf_y[1]>>20)-(vdf_y[0]>>20); "cal" is the iterator and it is in the 0-9 range so it looks like we could corrupt memory. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-24rtlwifi: btcoex: 23b 1ant: fix duplicated code for different branchesGustavo A. R. Silva
Refactor code in order to avoid identical code for different branches. This issue was detected with the help of Coccinelle. Addresses-Coverity-ID: 1415177 Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-24wlcore: add missing nvs file name info for wilink8Reizer, Eyal
The following commits: commit c815fdebef44 ("wlcore: spi: Populate config firmware data") commit d776fc86b82f ("wlcore: sdio: Populate config firmware data") Populated the nvs entry for wilink6 and wilink7 only while it is still needed for wilink8 as well. This broke user space backward compatibility when upgrading from older kernels, as the alternate mac address would not be read from the nvs that is present in the file system (lib/firmware/ti-connectivity/wl1271-nvs.bin) causing mac address change of the wlan interface. This patch fix this and update the structure field with the same default nvs file name that has been used before. In addition, some distros hold a default wl1271-nvs.bin in the file system with a bogus mac address (deadbeef...) that overrides the mac address that is stored inside the device. Warn users about this bogus mac address and use the internal mac address Fixes: c815fdebef44 ("wlcore: spi: Populate config firmware data") Fixes: d776fc86b82f ("wlcore: sdio: Populate config firmware data") Signed-off-by: Eyal Reizer <eyalr@ti.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Tested-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-24Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.gitKalle Valo
ath.git patches for 4.14. Major changes: ath10k * initial UBS bus support (no full support yet) * add tdls support for 10.4 firmware ath9k * add Dell Wireless 1802 wil6210 * support FW RSSI reporting
2017-08-18iwlwifi: use big-endian for the hw section of the nvmLuca Coelho
Unlike the other sections of the NVM, the hw section is in big-endian. To read a value from it, we had to cast it to __be16. Fix that by using __be16 * for the entire section. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18iwlwifi: mvm: remove useless check for mvm->cfg in iwl_parse_nvm_section()Luca Coelho
At this point we have already copied the cfg pointer to mvm and we have been dereferencing this pointer many times before, so it will never be NULL or we would have crashed. Remove the useless check. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18iwlwifi: mvm: remove useless argument in iwl_nvm_init()Luca Coelho
We always call iwl_nvm_init() with read_nvm_from_nic == true, so this argument is useless. Remove it. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18iwlwifi: fw: fix lar_enabled endian problem in iwl_fw_get_nvmLuca Coelho
We read the regulatory.lar_enabled field in iwl_fw_get_nvm() and store it in nvm->lar_enabled, taking care of endianness. But then later we read it again to pass the value to iwl_init_sbands() without handling endianness. To solve this, simply reuse nvm->lar_enabled when calling that function. Fixes: e9e1ba3dbf00 ("iwlwifi: mvm: support getting nvm data from firmware") Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18iwlwifi: add workaround to disable wide channels in 5GHzLuca Coelho
The OTP in some SKUs have erroneously allowed 40MHz and 80MHz channels in the 5.2GHz band. The firmware has been modified to not allow this in those SKUs, so the driver needs to do the same otherwise the firmware will assert when we try to use it. Cc: stable@vger.kernel.org Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18iwlwifi: mvm: change open and close criteria of a BA sessionGregory Greenman
Tx BA session should be started according to the current throughput without any dependence on the internal rate scaling state. The criteria for opening a BA session will be 10 frames per second. Sending frequent del BAs can cause inter-op issues with some APs. We'll not close a BA session until we receive an explicit del BA from the peer. Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18iwlwifi: update channel flags parserLuca Coelho
There are some new flags in the channel flags that we don't know about. Also, the "WIDE" flag is very confusing, because it actually means 20MHz bandwidth, which is not very wide. Add the new flags and rename the confusing one. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18iwlwifi: pci: add new PCI ID for 7265DLuca Coelho
We have a new PCI subsystem ID for 7265D. Add it to the list. Cc: stable@vger.kernel.org Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18iwlwifi: distinguish different RF modules in A000 devicesTzipi Peres
Newer versions of A000 devices come with two diffenent RF modules. The PCI_ID, the subsystem ID and the RF ID are identical in these two cases, so we need to differentiate them by using the CSR_HW_RF_ID register- in order to load the appropriate firmware. Signed-off-by: Tzipi Peres <tzipi.peres@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18iwlwifi: mvm: Fix channel switch in case of count <= 1Ilan Peer
The code did not consider the case that the channel switch counter is <= 1, which would result with an inaccurate calculation of the time event apply time. As the specification states that in case of counter == 0 the switch occurs at any time after the reception the frame, and for counter == 1 the switch would happens before the next TBTT, schedule the time event immediately. Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18iwlwifi: Demote messages about fw flags size to infoJoão Paulo Rechi Vita
These messages are not reporting a real error, just the fact that the firmware knows about more flags than the driver. Currently these messages are presented to the user during boot if there is no bootsplash covering the console, even when booting the kernel with "quiet". Demoting it to the warn level helps having a clean boot process. Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18iwlwifi: move BT_MBOX_PRINT macro to common headerLuca Coelho
Move the BT_MBOX_PRINT() macro from mvm/debugfs.c to fw/api/coex.h so it can be reused and remove duplicate definition of BT_MBOX_MSG(), keeping only the one already in coex.h. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18iwlwifi: mvm: don't send BAR on flushed framesEmmanuel Grumbach
When we flush a queue, the packets will have a 'failed' status but we shouldn't send a BAR. This check was missing. Because of that, when we got an ampdu_action with IEEE80211_AMPDU_TX_STOP_FLUSH, we started the following ping pong with the firmware: 1) Set the station as 'draining' 2) Get a failed Tx status (DRAINED) 3) Send a BAR because of the failed Tx status (loop of 2 and 3) This loop wasn't endless since the BAR isn't sent on a queue that would trigger a "nested" BAR. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18iwlwifi: mvm: remove session protection to allow channel switchAvraham Stern
If a time event is already scheduled when trying to schedule one for channel switch, the code assumes the channel switch is already scheduled and no further action is required. However, it is possible that the scheduled time event is actually for session protection (e.g. when the first beacon after association contains the CSA IE). In this case the channel switch will not be scheduled which will finally lead to disconnection. Fix this by removing the old time event and schduling a new one for the channel switch. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18iwlwifi: mvm: update the firmware API in TXEmmanuel Grumbach
The firmware team is now re-using a bit that hasn't been used for a few generations. Re-use for TX_ON_AIR drop. This bit will be set by the firmware to indicate that a frame in an A-MPDU was dropped but not because of the already mapped reasons. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18iwlwifi: mvm: use mvmsta consistently in rs.cLuca Coelho
We use mvmsta for the sta->drv_priv in mvm, but in rs.c we have a bunch of instances using sta_priv, which is probably due to it being copied from dvm. Change all occurrences to mvmsta for consistency with the rest of the driver Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18iwlwifi: mvm: group all dummy SAR function declarations togetherLuca Coelho
We have some of the SAR dummy functions when ACPI is not set declared in mvm.h and some declared in fw.c. Group them all together in fw.c for consistency and to avoid static/non-static issues. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18iwlwifi: mvm: include more debug data when we get an unexpected baidEmmanuel Grumbach
When we get a valid baid in a received frame, we need to check that we are aware of this baid. If not, we check that the OLD_SN bit set. If that's not the case, we issue a WARNING. Print more data when that happens. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18iwlwifi: mvm: add command name for FRAME_RELEASEEmmanuel Grumbach
This name was missing in the list. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18iwlwifi: pcie: support short Tx queues for A000 device familyEmmanuel Grumbach
This allows to modify TFD_TX_CMD_SLOTS to a power of 2 which is smaller than 256. Note that we still need to set values to wrap at 256 into the scheduler's write pointer, but all the rest of the code can use shorter transmit queues. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18iwlwifi: mvm: support new Coex firmware APIEmmanuel Grumbach
The firmware now adds more information about time sharing with the Bluetooth core. Adapt the API structures and add the new fields in the debugfs hooks. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18iwlwifi: call iwl_remove_notification from iwl_wait_notificationLuca Coelho
The iwl_wait_notification() function removes the wait entry from the list. To make it clearer that it's doing the same thing as iwl_remove_notification(), call the latter instead of having duplicate code. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18iwlwifi: mvm: consider RFKILL during INIT as successLuca Coelho
There's no need to differentiate an INIT that ended early because of RFKILL from one that succeded. Additionally, if INIT fails later, during calibration, due to RFKILL, we can just return success and continue as if we were already in RFKILL to start with. Remove this unnecessary differentiation and do some other small clean-ups while at it. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18iwlwifi: mvm: remove the corunning supportEmmanuel Grumbach
The corunning block was supposed to help in coex scenarios. It required the driver to configure the firmware based on the coupling between the two antennas of the devices. This was never in use and the configuration sent by the driver has always been blank. Remove all that code. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-17rsi: security enhancements for AP modePrameela Rani Garnepudi
Station id should be set in load key frame configured to device. For WEP mode, key is configured once from mac80211. This key is saved and configured to device every time a station is connected. Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-17rsi: aggregation parameters frame for AP modePrameela Rani Garnepudi
TX command frame ampdu aggregation parameters is updated to include sta_id for AP mode. Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com> Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-17rsi: update tx auto rate command frame for AP modePrameela Rani Garnepudi
Auto rate frame is sent to firmware when a new station is connected. Station id and station's ht capabilities are updated in auto rate command frame. Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com> Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-17rsi: use common descriptor for auto rate framePrameela Rani Garnepudi
TX command frame auto rate request is modified to use common descriptor struture. Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com> Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>