aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel/iwlwifi/mvm (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 322Thomas Gleixner2-24/+2
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of version 2 of the gnu general public license as published by the free software foundation this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details the full gnu general public license is included in this distribution in the file called license extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 29 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190530000435.438503728@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-05Merge tag 'wireless-drivers-next-for-davem-2019-05-03' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-nextDavid S. Miller7-25/+132
Kalle Valo says: ==================== wireless-drivers-next patches for 5.2 Most likely the last patchset of new feature for 5.2, and this time we have quite a lot of new features. Most obvious being rtw88 from Realtek which supports RTL8822BE and RTL8822CE 802.11ac devices. We have also new hardware support for existing drivers and improvements. There's one conflict in iwlwifi, my example conflict resolution below. Major changes: iwlwifi * bump the 20000-series FW API version * work on new hardware continues * RTT confidence indication support for Fine Timing Measurement (FTM) * an improvement in HE (802.11ax) rate-scaling * add command version parsing from the fimware TLVs * add support for a new WoWLAN patterns firmware API rsi * add support for rs9116 mwifiex * add support for SD8987 brcmfmac * add quirk for ACEPC T8 and T11 mini PCs rt2x00 * add RT3883 support qtnfmac * fix debugfs interface to support multiple cards rtw88 * new driver mt76 * share more code across drivers * add support for MT7615 chipset * rework DMA API * tx/rx performance optimizations * use NAPI for tx cleanup on mt76x02 * AP mode support for USB devices * USB stability fixes * tx power handling fixes for 76x2 * endian fixes Conflicts: There's a trivial conflict in drivers/net/wireless/intel/iwlwifi/fw/file.h, just leave IWL_UCODE_TLV_FW_FSEQ_VERSION to the file. 'git diff' output should be just empty: diff --cc drivers/net/wireless/intel/iwlwifi/fw/file.h index cd622af90077,b0671e16e1ce..000000000000 --- a/drivers/net/wireless/intel/iwlwifi/fw/file.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/file.h ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2019-05-02Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller4-6/+33
Three trivial overlapping conflicts. Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-29iwlwifi: dbg_ini: add periodic trigger supportShahar S Matityahu1-0/+1
Allows to configure a periodic data collection Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-04-29iwlwifi: mvm: Don't sleep in RX pathAndrei Otcheretianski2-2/+2
Don't use cancel_delayed_work_sync() inside the channel switch notifications as they are handled synchronously as part of the RX path. Fix that by replacing it with cancel_delayed_work(). This should be safe as we don't really care whether the work is already started and in such case we would disconnect anyway. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-04-29iwlwifi: mvm: limit TLC according to our HE capabilitiesLiad Kaufman1-5/+29
Instead of setting the TLC config command according to the rates the peer supports, make sure that we aren't also limited by our own rates, so take the minimum between the peer's supported RX rates and our supported TX rates. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-04-29iwlwifi: mvm: report FTM start time TSF when applicableAvraham Stern1-3/+17
When the interface that is requesting an FTM measurement is connected to a BSS, it is possible that the FTM request was originated by an RRM request from the AP. In this case the station needs to report the measurement start time in terms of the TSF of the AP. Since there is no indication in the FTM request itself if the TSF is needed, always report the TSF if the station is associated. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-04-29iwlwifi: mvm: support v2 of the WoWLAN patterns commandLuca Coelho1-5/+53
Add new definitions for the WoWLAN patterns API version 2 and support for version 2 of the WoWLAN patterns command without implementing the new features. With this commit we only supporting the existing bitmask pattern match. Use the new version only if the TLV is set. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-04-28iwlwifi: mvm: fix merge damage in iwl_mvm_vif_dbgfs_register()Luca Coelho1-6/+0
When I rebased Greg's patch, I accidentally left the old if block that was already there. Remove it. Fixes: 154d4899e411 ("iwlwifi: mvm: properly check debugfs dentry before using it") Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-04-28iwlwifi: mvm: check for length correctness in iwl_mvm_create_skb()Luca Coelho1-4/+24
We don't check for the validity of the lengths in the packet received from the firmware. If the MPDU length received in the rx descriptor is too short to contain the header length and the crypt length together, we may end up trying to copy a negative number of bytes (headlen - hdrlen < 0) which will underflow and cause us to try to copy a huge amount of data. This causes oopses such as this one: BUG: unable to handle kernel paging request at ffff896be2970000 PGD 5e201067 P4D 5e201067 PUD 5e205067 PMD 16110d063 PTE 8000000162970161 Oops: 0003 [#1] PREEMPT SMP NOPTI CPU: 2 PID: 1824 Comm: irq/134-iwlwifi Not tainted 4.19.33-04308-geea41cf4930f #1 Hardware name: [...] RIP: 0010:memcpy_erms+0x6/0x10 Code: 90 90 90 90 eb 1e 0f 1f 00 48 89 f8 48 89 d1 48 c1 e9 03 83 e2 07 f3 48 a5 89 d1 f3 a4 c3 66 0f 1f 44 00 00 48 89 f8 48 89 d1 <f3> a4 c3 0f 1f 80 00 00 00 00 48 89 f8 48 83 fa 20 72 7e 40 38 fe RSP: 0018:ffffa4630196fc60 EFLAGS: 00010287 RAX: ffff896be2924618 RBX: ffff896bc8ecc600 RCX: 00000000fffb4610 RDX: 00000000fffffff8 RSI: ffff896a835e2a38 RDI: ffff896be2970000 RBP: ffffa4630196fd30 R08: ffff896bc8ecc600 R09: ffff896a83597000 R10: ffff896bd6998400 R11: 000000000200407f R12: ffff896a83597050 R13: 00000000fffffff8 R14: 0000000000000010 R15: ffff896a83597038 FS: 0000000000000000(0000) GS:ffff896be8280000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff896be2970000 CR3: 000000005dc12002 CR4: 00000000003606e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: iwl_mvm_rx_mpdu_mq+0xb51/0x121b [iwlmvm] iwl_pcie_rx_handle+0x58c/0xa89 [iwlwifi] iwl_pcie_irq_rx_msix_handler+0xd9/0x12a [iwlwifi] irq_thread_fn+0x24/0x49 irq_thread+0xb0/0x122 kthread+0x138/0x140 ret_from_fork+0x1f/0x40 Fix that by checking the lengths for correctness and trigger a warning to show that we have received wrong data. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-04-27netlink: make validation more configurable for future strictnessJohannes Berg1-2/+2
We currently have two levels of strict validation: 1) liberal (default) - undefined (type >= max) & NLA_UNSPEC attributes accepted - attribute length >= expected accepted - garbage at end of message accepted 2) strict (opt-in) - NLA_UNSPEC attributes accepted - attribute length >= expected accepted Split out parsing strictness into four different options: * TRAILING - check that there's no trailing data after parsing attributes (in message or nested) * MAXTYPE - reject attrs > max known type * UNSPEC - reject attributes with NLA_UNSPEC policy entries * STRICT_ATTRS - strictly validate attribute size The default for future things should be *everything*. The current *_strict() is a combination of TRAILING and MAXTYPE, and is renamed to _deprecated_strict(). The current regular parsing has none of this, and is renamed to *_parse_deprecated(). Additionally it allows us to selectively set one of the new flags even on old policies. Notably, the UNSPEC flag could be useful in this case, since it can be arranged (by filling in the policy) to not be an incompatible userspace ABI change, but would then going forward prevent forgetting attribute entries. Similar can apply to the POLICY flag. We end up with the following renames: * nla_parse -> nla_parse_deprecated * nla_parse_strict -> nla_parse_deprecated_strict * nlmsg_parse -> nlmsg_parse_deprecated * nlmsg_parse_strict -> nlmsg_parse_deprecated_strict * nla_parse_nested -> nla_parse_nested_deprecated * nla_validate_nested -> nla_validate_nested_deprecated Using spatch, of course: @@ expression TB, MAX, HEAD, LEN, POL, EXT; @@ -nla_parse(TB, MAX, HEAD, LEN, POL, EXT) +nla_parse_deprecated(TB, MAX, HEAD, LEN, POL, EXT) @@ expression NLH, HDRLEN, TB, MAX, POL, EXT; @@ -nlmsg_parse(NLH, HDRLEN, TB, MAX, POL, EXT) +nlmsg_parse_deprecated(NLH, HDRLEN, TB, MAX, POL, EXT) @@ expression NLH, HDRLEN, TB, MAX, POL, EXT; @@ -nlmsg_parse_strict(NLH, HDRLEN, TB, MAX, POL, EXT) +nlmsg_parse_deprecated_strict(NLH, HDRLEN, TB, MAX, POL, EXT) @@ expression TB, MAX, NLA, POL, EXT; @@ -nla_parse_nested(TB, MAX, NLA, POL, EXT) +nla_parse_nested_deprecated(TB, MAX, NLA, POL, EXT) @@ expression START, MAX, POL, EXT; @@ -nla_validate_nested(START, MAX, POL, EXT) +nla_validate_nested_deprecated(START, MAX, POL, EXT) @@ expression NLH, HDRLEN, MAX, POL, EXT; @@ -nlmsg_validate(NLH, HDRLEN, MAX, POL, EXT) +nlmsg_validate_deprecated(NLH, HDRLEN, MAX, POL, EXT) For this patch, don't actually add the strict, non-renamed versions yet so that it breaks compile if I get it wrong. Also, while at it, make nla_validate and nla_parse go down to a common __nla_validate_parse() function to avoid code duplication. Ultimately, this allows us to have very strict validation for every new caller of nla_parse()/nlmsg_parse() etc as re-introduced in the next patch, while existing things will continue to work as is. In effect then, this adds fully strict validation for any new command. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-19iwlwifi: mvm: Change an 'else if' into an 'else' in iwl_mvm_send_add_bcast_staNathan Chancellor1-3/+5
When building with -Wsometimes-uninitialized, Clang warns: drivers/net/wireless/intel/iwlwifi/mvm/sta.c:2114:12: warning: variable 'queue' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] Clang can't evaluate at this point that WARN(1, ...) always returns true because __ret_warn_on is defined as !!(condition), which isn't immediately evaluated as 1. Change this branch to else so that it's clear to Clang that we intend to bail out here. Link: https://github.com/ClangBuiltLinux/linux/issues/399 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> [added a few more braces] Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-04-19iwlwifi: mvm: support rtt confidence indicationAvraham Stern1-1/+12
The range response notification API has changed to add a value that indicates the confidence of the rtt result. Support the new API and print the rtt confidence for debug. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-04-19iwlwifi: rs: consider LDPC capability in case of HEGregory Greenman1-5/+11
When building TLC configuration command, consider in case of HE, if LDPC support is turned on in our capabilities. Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-04-19iwlwifi: mvm: set 512 TX queue slots for AX210 devicesShaul Triebitz1-1/+2
AX210 devices support 256 BA (256 MPDUs in an AMPDU). The firmware requires that the number of TFDs will be minimum twice as big as the BA size (2 * 256 = 512). Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-04-18Merge tag 'wireless-drivers-next-for-davem-2019-04-18' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-nextDavid S. Miller15-263/+400
Kalle Valo says: ==================== wireless-drivers-next patches for 5.2 Nothing really special standing out this time, iwlwifi being the most active driver. Major changes: iwlwifi * send NO_DATA events so they can be captured in radiotap * support for multiple BSSID * support for some new FW API versions * support new hardware * debugfs cleanups by Greg-KH qtnfmac * allow each MAC to specify its own regulatory rules ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-18iwlwifi: mvm: properly check debugfs dentry before using itGreg Kroah-Hartman1-0/+5
debugfs can now report an error code if something went wrong instead of just NULL. So if the return value is to be used as a "real" dentry, it needs to be checked if it is an error before dereferencing it. This is now happening because of ff9fb72bc077 ("debugfs: return error values, not NULL"). If multiple iwlwifi devices are in the system, this can cause problems when the driver attempts to create the main debugfs directory again. Later on in the code we fail horribly by trying to dereference a pointer that is an error value. Reported-by: Laura Abbott <labbott@redhat.com> Reported-by: Gabriel Ramirez <gabriello.ramirez@gmail.com> Cc: Johannes Berg <johannes.berg@intel.com> Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Cc: Luca Coelho <luciano.coelho@intel.com> Cc: Intel Linux Wireless <linuxwifi@intel.com> Cc: Kalle Valo <kvalo@codeaurora.org> Cc: stable <stable@vger.kernel.org> # 5.0 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-04-18iwlwifi: mvm: don't attempt debug collection in rfkillJohannes Berg2-2/+4
If we fail to initialize because rfkill is enabled, then trying to do debug collection currently just fails. Prevent that in the high-level code, although we should probably also fix the lower level code to do things more carefully. It's not 100% clear that it fixes this commit, as the original dump code at the time might've been more careful. In any case, we don't really need to dump anything in this expected scenario. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Fixes: 7125648074e8 ("iwlwifi: add fw dump upon RT ucode start failure") Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-04-03iwlwifi: mvm: support HE context cmd API changeSara Sharon1-1/+11
Support API change to pass all mbssid parameters to the firmware. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-04-03iwlwifi: mvm: use correct GP2 register address for 22000 familyAvraham Stern5-10/+18
The device time register address has changed for 22000 devices. Add a util function for getting the GP2 time and use the correct register address depending on the device family. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-04-03iwlwifi: mvm: no need to check return value of debugfs_create functionsGreg Kroah-Hartman5-95/+38
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: Johannes Berg <johannes.berg@intel.com> Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Cc: Luca Coelho <luciano.coelho@intel.com> Cc: Intel Linux Wireless <linuxwifi@intel.com> Cc: Kalle Valo <kvalo@codeaurora.org> Cc: linux-wireless@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-04-03iwlwifi: mvm: remove buggy and unnecessary hw_queue initializationJohannes Berg1-33/+3
After converting the driver to TXQs, it no longer has any reason to initialize vif->hw_queue/vif->cab_queue since it no longer sets the HW_QUEUE_CONTROL flag. Remove the code that initialized those, it was broken due to relying on an uninitialized stack value in used_hw_queues, as Colin reported. Reported-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-04-03iwlwifi: mvm: fix pointer reference when setting HE QAM thresLiad Kaufman1-4/+6
Pointer referencing when setting HE QAM thresholds (when nominal packet padding bit is on) caused kernel crash due to bad referencing. Fix that. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-04-03iwlwifi: mvm: IBSS: use BE FIFO for multicastJohannes Berg1-1/+2
Back in commit 4d339989acd7 ("iwlwifi: mvm: support ibss in dqa mode") we changed queue selection for IBSS to be: if (ieee80211_is_probe_resp(fc) || ieee80211_is_auth(fc) || ieee80211_is_deauth(fc)) return IWL_MVM_DQA_AP_PROBE_RESP_QUEUE; if (info->hw_queue == info->control.vif->cab_queue) return info->hw_queue; return IWL_MVM_DQA_AP_PROBE_RESP_QUEUE; Clearly, the thought at the time must've been that mac80211 will select the hw_queue as the cab_queue, so that we'll return and use that, where we store the multicast queue for IBSS. This, however, isn't true because mac80211 doesn't implement powersave for IBSS and thus selects the normal IBSS interface AC queue (best effort). This therefore always used the probe response queue, which maps to the BE FIFO. In commit cfbc6c4c5b91 ("iwlwifi: mvm: support mac80211 TXQs model") we rethought this code, and as a consequence now started mapping the multicast traffic to the multicast hardware queue since we no longer relied on mac80211 selecting the queue, doing it ourselves instead. This queue is mapped to the MCAST FIFO. however, this isn't actually enabled/controlled by the firmware in IBSS mode because we don't implement powersave, and frames from this queue can never go out in this case. Therefore, we got queue hang reports such as https://bugzilla.kernel.org/show_bug.cgi?id=201707 Fix this by mapping the multicast queue to the BE FIFO in IBSS so that all the frames can go out. Fixes: cfbc6c4c5b91 ("iwlwifi: mvm: support mac80211 TXQs model") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-04-03iwlwifi: dbg_ini: support HW error triggerShahar S Matityahu1-4/+3
Differentiate between SW and HW error interrupts and support ini HW error trigger. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-04-03iwlwifi: mvm: update offloaded rate control on changesJohannes Berg1-0/+7
With offloaded rate control, if the station parameters (rates, NSS, bandwidth) change (sta_rc_update method), call iwl_mvm_rs_rate_init() to propagate those change to the firmware. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-04-03iwlwifi: mvm: avoid possible deadlock in TX pathJohannes Berg1-0/+2
iwl_mvm_tx_mpdu() may run from iwl_mvm_add_new_dqa_stream_wk(), where soft-IRQs aren't disabled. In this case, it may hold the station lock and be interrupted by a soft-IRQ that also wants to acquire said lock, leading to a deadlock. Fix it by disabling soft-IRQs in iwl_mvm_add_new_dqa_stream_wk(). Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-03-30Merge tag 'iwlwifi-next-for-kalle-2019-03-22' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-nextKalle Valo10-117/+321
First batch of patches intended for v5.2 * Send NO_DATA events so they can be captured in radiotap; * Some channel-switch changes; * Support for multiple BSSID; * Continued work and bugfixes for the new debugging infra; * Support for some new FW API versions; * Some work to support new hardware; * General bugfixes; * Other cleanups;
2019-03-22iwlwifi: dbg_ini: separate between ini and legacy dump flowsShahar S Matityahu1-1/+1
Separate between ini and legacy dump flows to allow adding ini triggers that are not supported in the legacy flow and to increase readabilty. iwl_fw_dbg_ini_collect function is now called with legacy trigger id and _iwl_fw_dbg_ini_collect is called with ini trigger id. Also make the actual dumping function static so that any dump collection will go through iwl_fw_dbg_collect_sync. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-03-22iwlwifi: mvm: set max amsdu for TLC offloadMordechay Goodstein1-3/+41
mac80211 sets max amsdu to min supported ht vs vht but TLC only works with one mode so we can set to the exact mode used (vht/ht) and enable larger amsdu sizes for vht. Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-03-22iwlwifi: mvm: use dump worker during restart instead of sync dumpShahar S Matityahu4-23/+2
In restart flow, the driver requests HW restart from mac80211 and then mac80211 uses a worker to do the restart flow. In that flow a sync dump is performed. Instead, schedule the dump worker before requesting HW restart from mac80211. This approach simplifies the restart flow. Also, it is neeeded in order to differentiate between the handling of SW and HW errors in a future commit. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-03-22iwlwifi: mvm: Support new format of SCAN_OFFLOAD_PROFILES_QUERY_RSPIlan Peer1-15/+74
Newer FWs use a new format of the SCAN_OFFLOAD_PROFILES_QUERY_RSP, which now supports indicating match on an higher number of channels. Modify the code to support both the old format and the newer one, based on a FW TLV. Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-03-22iwlwifi: mvm: be more forgiving if num of channels is too bigShaul Triebitz1-10/+15
If number of channels in the driver is greater than number of scan channels given by firmware TLV, do not fail scan config, but adjust to firmware's number of channels. This is helpful for supporting in driver new channels before it being supported by firmware scan. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-03-22iwlwifi: mvm: enable HT/VHT IBSSJohannes Berg1-0/+3
For some reason we never enabled it, but it appears to work fine. Enable it now. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-03-22iwlwifi: mvm: support multiple BSSIDSara Sharon1-1/+9
Set the capabilities flags and inform firmware Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-03-22iwlwifi: mvm: track changes in beacon count during channel switchSara Sharon2-0/+17
There are some buggy APs that keeps changing the count while forcing us to block TX. This eventually results in queue hang, assert, and disconnection. Detect such APs and disconnect gracefully in advance. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-03-22iwlwifi: mvm: disconnect in case of bad channel switch parametersSara Sharon4-77/+107
In case we receive channel switch announcement with immediate quiet and unknown switching time, we will switch when FW identifies AP left channel. However, if AP remains on channel, we will eventually get TX queue hang. Init a work to disconnect if switch doesn't occur within 1500 milliseconds. Do it also for a too long channel switch. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-03-22iwlwifi: mvm: notify FW on quiet mode in CSASara Sharon1-0/+2
Let FW know if quiet mode is on or not. This is needed in order to disable it in FW when CSA is complete. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-03-22iwlwifi: mvm: track CSA beaconsSara Sharon1-2/+28
Send to FW modify command for every beacon we receive during channel switch. FW will track the count, and make sure the event is scheduled in time even if AP changed count. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-03-22iwlwifi: mvm: report all NO_DATA events to mac80211Johannes Berg3-18/+27
Report all NO_DATA events to mac80211 so they get captured in radiotap for usage in sniffer scenarios; map the info type to a reasonable radiotap type for this. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-03-22iwlwifi: mvm: implement CSA abortSara Sharon1-0/+24
In case we receive abort operation for CSA, clean up our state. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-03-22iwlwifi: mvm: report delayed beacon count to FWSara Sharon1-0/+4
Support passing to FW delayed beacon count. This represents the delay the AP can have when moving to the new channel. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-03-22iwlwifi: mvm: fix TX crypto on 22560+ devicesJohannes Berg4-94/+19
In the old days, we could transmit with HW crypto with an arbitrary key by filling it into TX_CMD. This was broken first with the advent of CCMP/GCMP-256 keys which don't fit there. This was broken *again* with the newer TX_CMD format on 22560+, where we simply cannot pass key material anymore. However, we forgot to update all the cases when we get a key from mac80211 and don't program it into the hardware but still return 0 for HW crypto on TX. In AP mode with WEP, we tried to fix this by programming the keys separately for each station later, but this ultimately turns out to be buggy, for example now it leaks memory when we have more than one WEP key. Fix this by simply using only SW crypto for WEP in newer devices by returning -EOPNOTSUPP instead of trying to program WEP keys later. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-03-07iwlwifi: fix 64-bit divisionArnd Bergmann1-3/+1
do_div() expects unsigned operands and otherwise triggers a warning like: drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c:465:2: error: comparison of distinct pointer types ('typeof ((rtt_avg)) *' (aka 'long long *') and 'uint64_t *' (aka 'unsigned long long *')) [-Werror,-Wcompare-distinct-pointer-types] do_div(rtt_avg, 6666); ^~~~~~~~~~~~~~~~~~~~~ include/asm-generic/div64.h:222:28: note: expanded from macro 'do_div' (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \ ~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~ 1 error generated. Change the do_div() to the simpler div_s64() that can handle negative inputs correctly. Fixes: 937b10c0de68 ("iwlwifi: mvm: add debug prints for FTM") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-02-22Merge tag 'wireless-drivers-next-for-davem-2019-02-22' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-nextDavid S. Miller24-286/+1845
Kalle Valo says: ==================== wireless-drivers-next patches for 5.1 Most likely the last set of patches for 5.1. WPA3 support to ath10k and qtnfmac. FTM support to iwlwifi and ath10k. And of course other new features and bugfixes. wireless-drivers was merged due to dependency in mt76. Major changes: iwlwifi * HE radiotap * FTM (Fine Timing Measurement) initiator and responder implementation * bump supported firmware API to 46 * VHT extended NSS support * new PCI IDs for 9260 and 22000 series ath10k * change QMI interface to support the new (and backwards incompatible) interface from HL3.1 and used in recent HL2.0 branch firmware releases * support WPA3 with WCN3990 * support for mac80211 airtime fairness based on transmit rate estimation, the firmware needs to support WMI_SERVICE_PEER_STATS to enable this * report transmit airtime to mac80211 with firmwares having WMI_SERVICE_REPORT_AIRTIME feature, this to have more accurate airtime fairness based on real transmit time (instead of just estimated from transmit rate) * support Fine Timing Measurement (FTM) responder role * add dynamic VLAN support with firmware having WMI_SERVICE_PER_PACKET_SW_ENCRYPT * switch to use SPDX license identifiers ath * add new country codes for US brcmfmac * support monitor frames with the hardware/ucode header qtnfmac * enable WPA3 SAE and OWE support mt76 * beacon support for USB devices (mesh+ad-hoc only) rtlwifi * convert to use SPDX license identifiers libertas_tf * get the MAC address before registering the device ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2019-02-22Merge remote-tracking branch 'net-next/master' into mac80211-nextJohannes Berg25-1922/+987
Merge net-next to resolve a conflict and to get the mac80211 rhashtable fixes so further patches can be applied on top. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2019-02-22mac80211: update HE IEs to D3.3Liad Kaufman1-0/+40
Update element names and new fields according to D3.3 of the HE spec. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2019-02-20iwlwifi: mvm: add some debug data to TX pathSara Sharon2-5/+14
This helps debugging when things go wrong. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-02-20iwlwifi: mvm: implement VHT extended NSS support in rs.cJohannes Berg1-2/+21
For non-offloaded rate control, implement VHT extended NSS support by just ignoring 160 MHz on transmit if the peer doesn't support the full NSS (2). This is pretty unlikely and gets us 160 MHz RX as well as TX in most cases, since the typical case for this workaround is 4x4 AP only doing 2x2 on 160 MHz. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-02-20iwlwifi: mvm: Allow retries for probe responsesIlan Peer1-1/+3
When hostapd sends a probe response, it does not request an acknowledgment on the probe response. This setting is propagated to the driver and FW from mac80211, and as a result probe responses are transmitted only once without retries. In congested environments, this reduces the likelihood for finding the AP. To overcome this, enable acknowledgment and retries for probe responses, even in case no acknowledgment is requested. In such a case the retry limit is set to 3. Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>