summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
AgeCommit message (Collapse)Author
2019-10-25iwlwifi: mvm: Invert the condition for OFDM rateTova Mussai
OFDM rate used for all bands except to band 2.4 which use CCK rate. Inverting the condition help that in future we won't need to expand the condition for more bands. Signed-off-by: Tova Mussai <tova.mussai@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-10-25iwlwifi: mvm: add notification for missed VAPLior Cohen
A missed VAP notification will be sent from umac when the station is out of sync with its associated non-transmitted BSSID. The notification will be sent only if the transmitted BSSID is an EMA-AP one. The driver will consider this notification as connection loss. Signed-off-by: Lior Cohen <lior2.cohen@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-10-25iwlwifi: dbg_ini: support FW notification dumping in case of missed beaconShahar S Matityahu
Pass the FW notification packet to the dump collection flow to allow the driver to include it in the dump file if requested. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06iwlwifi: dbg_ini: remove apply point, switch to time point APIShahar S Matityahu
Remove the "apply points" mechanism as preparation for the changed debug API where this is now a "time point" instead. Use a new API across the code at the trigger points ("time points"), but don't yet implement it since that requires some more preparation. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06iwlwifi: dbg_ini: separate cfg and dump flows to different modulesShahar S Matityahu
separate configuration flows and dump collection flows. make ini configuration flows be in iwl-dbg-tlv.c and dump related flows in dbg.c to better reflect their logical difference. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06iwlwifi: mvm: simplify the channel switch flow for newer firmwareEmmanuel Grumbach
Any firmware that supports the new channel switch flow is able to close / re-open the queues when needed. It takes into account the channel switch mode etc... Don't open / close the queues or enable / disable beacon abort before and after the channel switch in case the firmware is able to do this by itself. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-08-20iwlwifi: mvm: Allow multicast data frames only when associatedIlan Peer
The MAC context configuration always allowed multicast data frames to pass to the driver for all MAC context types, and in the case of station MAC context both when associated and when not associated. One of the outcomes of this configuration is having the FW forward encrypted multicast frames to the driver with Rx status indicating that the frame was not decrypted (as expected, since no keys were configured yet) which in turn results with unnecessary error messages. Change this behavior to allow multicast data frames only when they are actually expected, e.g., station MAC context is associated etc. Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-06-29iwlwifi: mvm: remove MAC_FILTER_IN_11AX for AP modeLuca Coelho
The FW API was clarified saying that this flag should only be set in BSS client mode. Remove it from the MAC_CTXT command we send in AP and GO modes. Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Fixes: 3b5ee8dd8bb1 ("iwlwifi: mvm: set MAC_FILTER_IN_11AX in AP mode") Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-06-29iwlwifi: mvm: make the usage of TWT configurableEmmanuel Grumbach
TWT is still very new and we expect issues. Make its usage configurable and disable it by default. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-06-29iwlwifi: mvm: correctly fill the ac array in the iwl_mac_ctx_cmdNaftali Goldstein
The indexes into the ac array in the iwl_mac_ctx_cmd are from the iwl_ac enum and not the txfs. The current code therefore puts the edca params in the wrong indexes of the array, causing wrong priority for data-streams of different ACs. Fix this. Note that this bug only occurs in NICs that use the new tx api, since in the old tx api the txf number is equal to the corresponding ac in the iwl_ac enum. Signed-off-by: Naftali Goldstein <naftali.goldstein@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-04-29iwlwifi: mvm: Don't sleep in RX pathAndrei Otcheretianski
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-03iwlwifi: mvm: use correct GP2 register address for 22000 familyAvraham Stern
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: remove buggy and unnecessary hw_queue initializationJohannes Berg
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-03-22iwlwifi: mvm: disconnect in case of bad channel switch parametersSara Sharon
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-02-20iwlwifi: mvm: support non-transmitting APSara Sharon
Add an option to not send beacons and probe responses. This is used for testing multiple-bssid. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-02-20iwlwifi: mvm: reject new beacons when in inject modeSara Sharon
Verify we do not accept new beacon templates while beacon injection is active. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-02-14iwlwifi: mvm: support beacon IE injectionSara Sharon
This is useful for automated tests. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-02-04iwlwifi: mvm: config mac ctxt to HE before TLCLiad Kaufman
If we have a station connecting HE, make sure that the MAC ctxt is updated with indication of this before setting the TLC rates via the TLC manager command. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-02-04iwlwifi: mvm: support new format for the beacon notificationEmmanuel Grumbach
The firmware is changing the format of the beacon notification to remove the dependency on the Tx response format. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-02-04iwlwifi: mvm: support CHANNEL_SWITCH_TIME_EVENT_CMD commandSara Sharon
When we do channel switch, we used to schedule time events ourselves. This was offloaded to FW. Support the new command and flow. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-01-29iwlwifi: mvm: Disconnect on large beacon lossAndrei Otcheretianski
Some buggy APs stop sending beacons, but continue to ack our null data packets or even run some traffic. It's better not to stick connected to such an AP forever, so disconnect after some larger beacon loss threshold is crossed. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-01-29iwlwifi: mvm: add an option to dereference vif by idSara Sharon
Currently whenever we get firmware notification with mac id, we iterate over all the interfaces to find the ID. This is a bit cumbersome. Instead, adding an array of RCU pointers, like we have for station IDs. This is not expensive space wise since we have only up to 4 active MACs, and not complicated code wise, since we have a clear point to init and de-init it. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-01-29iwlwifi: mvm: fix %16 to %016 print formatJohannes Berg
With just %16, it means 16 characters padding, but we really don't want to print "0x 1F4547B", but instead want to have this filled with zeroes, so we need the 0. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-01-25iwlwifi: mvm: Do not set RTS/CTS protection for P2P Device MACIlan Peer
As this is not needed and might cause interoperability issues during pairing with devices that would not reply to RTS frames. Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-01-25iwlwifi: mvm: support mac80211 TXQs modelSara Sharon
Move to use the new mac80211 TXQs implementation. This has quite a few benefits for us. We can get rid of the awkward mapping of DQA to mac80211 queues. We can stop buffering traffic while waiting for the queue to be allocated. We can also use mac80211 AMSDUs instead of building it ourselves. The usage is pretty simple: Each ieee80211_txq contains iwl_mvm_txq. There is such a queue for each TID, and one for management frames. We keep having static AP queues for probes and non-bufferable MMPDUs, along with broadcast and multicast queues. Those are being used from the "old" TX invocation path - iwl_mvm_mac_tx. When there is a new frame in a TXQ, iwl_mvm_mac_wake_tx is being called, and either invokes the TX path, or allocates the queue if it does not exist. Most of the TX path is left untouched, although we can consider cleaning it up some more, for example get rid of the duplication of txq_id in both iwl_mvm_txq and iwl_mvm_dqa_txq_info. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-01-25iwlwifi: mvm: rely on mac80211 to configure TWT supportEmmanuel Grumbach
Mac80211 will check both the HE Capability IE and the Extended Capability IE, so set the TWT support bit when mac80211 tells us to. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-12-14iwlwifi: mvm: activate apply pointsSara Sharon
Call the previously introduced apply points entry point when reaching an apply point. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-11-23iwlwifi: mvm: set MAC_FILTER_IN_11AX in AP modeShaul Triebitz
In AP mode, if AP supports 11ax, add the MAC_FILTER_IN_11AX flag in MAC_CTXT command (needed for various 11ax stuff). Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-11-23iwlwifi: mvm: add support for TWT capabilitiesEmmanuel Grumbach
We need to check the TWT support of the peer and to propagte the capability to the firmware. The current implementation will enable TWT only if the TWT support is advertised in the HE CAP IE and in the Extended Capability IE. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-11-23iwlwifi: mvm: remove assignment of the reciprocalEmmanuel Grumbach
The firmware stopped looking at this field long ago. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-11-11iwlwifi: mvm: switch management tx antenna only on tx failureAvraham Stern
Switch the antenna used for management tx only if previous tx failed. If previous tx succeeded, there is no reason to switch antennas. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-10-06iwlwifi: dbg: group trigger condition to helper functionSara Sharon
The triplet of get trigger, is trigger enabled and is trigger stopped repeats itself. Group them in a function to avoid code duplication. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-09-28iwlwifi: mvm: use correct FIFO lengthSara Sharon
Current FIFO size calculation is wrong for two reasons: - We access lmac 0 by default - We don't take 11ax into consideration. Fix both. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-08-31iwlwifi: remove all occurrences of the FSF address paragraphLuca Coelho
The Free Software Foundation address is superfluous and causes checkpatch to issue a warning when present. Remove all paragraphs with FSF's address to prevent that. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-08-31iwlwifi: mvm: add NOA and CSA to a probe responseGregory Greenman
A probe response built by a P2P GO should contain: 1. CSA/eCSA IE when relevant 2. If the corresponding probe request had P2P IE, then need to add P2P IE with NOA attributes. However, the NOA attributes and the updated channel switch counter are known only to the FW. The solution is that FW will send a notification with the relevant probe response data and the driver will save it and update the probe response accordingly. Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-07-26iwlwifi: add module parameter to disable 802.11axLuca Coelho
Add a module parameter to disable 802.11ax features in supported devices. This is useful for testing or if there are interoperability issues with some APs. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-07-26iwlwifi: add support for IEEE802.11axLuca Coelho
Add support for the HE in the iwlwifi driver conforming with P802.11ax_D2.0. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-02-16iwlwifi: mvm: fix IBSS for devices that support station type APISara Sharon
In IBSS, the mac80211 sets the cab_queue to be invalid. However, the multicast station uses it, so we need to override it. A previous patch did it, but it was nested inside the if's and was applied only for legacy FWs that don't support the new station type API, instead of being applied for all paths. In addition, add a missing NL80211_IFTYPE_ADHOC to the initialization of the queues in iwl_mvm_mac_ctxt_init() Fixes: ee48b72211f8 ("iwlwifi: mvm: support ibss in dqa mode") Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-11-25iwlwifi: mvm: fix packet injectionEmmanuel Grumbach
We need to have a station and a queue for the monitor interface to be able to inject traffic. We used to have this traffic routed to the auxiliary queue, but this queue isn't scheduled for the station we had linked to the monitor vif. Allocate a new queue, link it to the monitor vif's station and make that queue use the BE fifo. This fixes https://bugzilla.kernel.org/show_bug.cgi?id=196715 Cc: stable@vger.kernel.org Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-09iwlwifi: mvm: support new beacon template commandHaim Dreyfuss
Support a new version of the beacon template command. This replaces v8 of the command, which was missing the rate code. Also, export rate decision logic to a separate function. Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-01iwlwifi: mvm: remove non-DQA modeJohannes Berg
All the firmware versions the driver supports enable DQA, and thus the only way to get non-DQA mode is to modify the source. Remove this mode to simplify the code. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-01iwlwifi: mvm: fix the FIFO numbers in A000 devicesEmmanuel Grumbach
The FIFO numbering is different in A000 devices. This means that we routed BE packets to BK FIFO. Fix this. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-01iwlwifi: mvm: refactor beacon template command codeLuca Coelho
We currently support 3 different versions of the beacon template command and the code does some tricks in order to reuse what is possible across these versions. But it is a bit complicated to read and soon there will be one more variation that the driver needs implement, which would complicate it even further. Refactor the way we send beacon template commands, which increases the code size a bit, but makes it much easier to read. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-01iwlwifi: refactor firmware debug codeJohannes Berg
Split out the firmware debug code to be more general, so that it can be used by different subdrivers. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-06-29iwlwifi: mvm: fix mac80211's hw_queue in DQA modeJohannes Berg
When in non-DQA mode, mac80211 actually gets a pretty much perfect idea (in vif->hw_queue/cab_queue) of which queues we're using. But in DQA mode, this isn't true - nonetheless, we were adding all the queues, even the ones stations are using, to the queue allocation bitmap. Fix this, we should only add the queues we really are using in DQA mode: * IWL_MVM_OFFCHANNEL_QUEUE, as we use this in both modes * mvm->aux_queue, as we use this in both modes - mac80211 never really knows about it but we use it as a cookie internally, so can't reuse it * possibly the GCAST queue (cab_queue) * all the "queues" we told mac80211 about we were using on each interface (vif->hw_queue), these are entirely virtual in this mode Also add back the failure now when we can't allocate any more of these - now virtual - queues; this was skipped in DQA mode and would lead to having multiple ACs or even interfaces use the same queue number in mac80211 (10, since that's the limit), which would stop far too many queues if stopped. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-06-28Merge tag 'iwlwifi-next-for-kalle-2017-06-28' of ↵Kalle Valo
git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next More iwlwifi patches for 4.13 * Some changes in suspend/resume handling to support new FWs; * A bunch of RF-kill related fixes; * Continued work towards the A000 family; * Support for a new version of the TX flush FW API; * Some fixes in monitor interfaces; * A few fixes in the recovery flows; * Johannes' documentation fixes and FW API struct cleanups continue; * Remove some noise from the kernel logs; * Some other small improvements, fixes and cleanups;
2017-06-25Merge tag 'wireless-drivers-next-for-davem-2017-06-25' of ↵David S. Miller
git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next Kalle Valo says: ==================== wireless-drivers-next patches for 4.13 New features and bug fixes to quite a few different drivers, but nothing really special standing out. What makes me happy that we have now more vendors actively contributing to upstream drivers. In this pull request we have patches from Broadcom, Intel, Qualcomm, Realtek and Redpine Signals, and I still have patches from Marvell and Quantenna pending in patchwork. Now that's something comparing to how things looked 11 years ago in Jeff Garzik's "State of the Union: Wireless" email: https://lkml.org/lkml/2006/1/5/671 Major changes: wil6210 * add low level RF sector interface via nl80211 vendor commands * add module parameter ftm_mode to load separate firmware for factory testing * support devices with different PCIe bar size * add support for PCIe D3hot in system suspend * remove ioctl interface which should not be in a wireless driver ath10k * go back to using dma_alloc_coherent() for firmware scratch memory * add per chain RSSI reporting brcmfmac * add support multi-scheduled scan * add scheduled scan support for specified BSSIDs * add support for brcm43430 revision 0 wlcore * add wil1285 compatible rsi * add RS9113 USB support iwlwifi * FW API documentation improvements (for tools and htmldoc) * continuing work for the new A000 family * bump the maximum supported FW API to 31 * improve the differentiation between 8000, 9000 and A000 families ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-23iwlwifi: mvm: set assoc_beacon_arrive_timeAvraham Stern
When updating the mac context after association, assoc_beacon_arrive_time is not being set, which causes the FW to set a wrong TSF to the MAC. Fix this by setting the assoc_beacon_arrive_time when updating the mac context after association. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-06-23iwlwifi: mvm: track and report IBSS manager status to mac80211Johannes Berg
Shaul reported that when iwlmvm was sending beacons, it didn't properly also take ownership of the probe responses. This is because the whole mac80211 callback (tx_last_beacon) wasn't implemented. Fix that to make IBSS discovery work better. Reported-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-06-16networking: introduce and use skb_put_data()Johannes Berg
A common pattern with skb_put() is to just want to memcpy() some data into the new space, introduce skb_put_data() for this. An spatch similar to the one for skb_put_zero() converts many of the places using it: @@ identifier p, p2; expression len, skb, data; type t, t2; @@ ( -p = skb_put(skb, len); +p = skb_put_data(skb, data, len); | -p = (t)skb_put(skb, len); +p = skb_put_data(skb, data, len); ) ( p2 = (t2)p; -memcpy(p2, data, len); | -memcpy(p, data, len); ) @@ type t, t2; identifier p, p2; expression skb, data; @@ t *p; ... ( -p = skb_put(skb, sizeof(t)); +p = skb_put_data(skb, data, sizeof(t)); | -p = (t *)skb_put(skb, sizeof(t)); +p = skb_put_data(skb, data, sizeof(t)); ) ( p2 = (t2)p; -memcpy(p2, data, sizeof(*p)); | -memcpy(p, data, sizeof(*p)); ) @@ expression skb, len, data; @@ -memcpy(skb_put(skb, len), data, len); +skb_put_data(skb, data, len); (again, manually post-processed to retain some comments) Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>