aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intel/iwlwifi
AgeCommit message (Collapse)AuthorFilesLines
2017-07-21iwlwifi: mvm: fix a NULL pointer dereference of error in recoveryEmmanuel Grumbach1-0/+12
Sometimes, we can have an firmware crash while trying to recover from a previous firmware problem. When that happens, lots of things can go wrong. For example the stations don't get added properly to mvm->fw_id_to_mac_id. Mac80211 tries to stop A-MPDU upon reconfig but in case of a firmware crash we will bail out fairly early and in the end, we won't delete the A-MPDU Rx timeout. When that timer expired after a double firmware crash, we end up dereferencing mvm->fw_id_to_mac_id[sta_id] which is NULL. Fixes: 10b2b2019d81 ("iwlwifi: mvm: add infrastructure for tracking BA session in driver") Signed-off-by: Emmanuel Grumbach <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-07-21iwlwifi: pcie: fix unused txq NULL pointer dereferenceMordechai Goodstein1-0/+3
Before TVQM, all TX queues were allocated straight at init. With TVQM, queues are allocated on demand and hence we need to check if a queue exists before dereferencing it. Fixes: 66128fa08806 ("iwlwifi: move to TVQM mode") Signed-off-by: Mordechai Goodstein <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-07-21iwlwifi: dvm: prevent an out of bounds accessEmmanuel Grumbach1-1/+1
iwlagn_check_ratid_empty takes the tid as a parameter, but it doesn't check that it is not IWL_TID_NON_QOS. Since IWL_TID_NON_QOS = 8 and iwl_priv::tid_data is an array with 8 entries, accessing iwl_priv::tid_data[IWL_TID_NON_QOS] is a bad idea. This happened in iwlagn_rx_reply_tx. Since iwlagn_check_ratid_empty is relevant only to check whether we can open A-MPDU, this flow is irrelevant if tid is IWL_TID_NON_QOS. Call iwlagn_check_ratid_empty only inside the if (tid != IWL_TID_NON_QOS) a few lines earlier in the function. Cc: <[email protected]> Reported-by: Seraphime Kirkovski <[email protected]> Tested-by: Seraphime Kirkovski <[email protected]> Signed-off-by: Emmanuel Grumbach <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: bump MAX API for 8000/9000/A000 to 33Luca Coelho3-4/+4
Bump the maximum API supported by these device families to 33. Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: pcie: wait longer after device resetEmmanuel Grumbach4-25/+15
The newest devices need a longer time to reset because of their more complex hardware. Wait 5ms after device reset. Consolidate all the places that reset the device in the PCIe transport to avoid future bugs. While at it, unify the flow to use set_bit instead of full write as requested by the hardware designers. Signed-off-by: Emmanuel Grumbach <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: pcie: propagate iwl_pcie_apm_init's statusEmmanuel Grumbach1-8/+13
iwl_pcie_apm_init can fail so make sure that the caller takes the status into account. Also, ensure that the error that iwl_pcie_apm_init can emit will appear in the kernel log by default. Signed-off-by: Emmanuel Grumbach <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: quietly accept non-sta disassoc framesJohannes Berg1-1/+4
When a station that's not associated sends a data frame (e.g. an NDP) hostapd will respond with a disassoc frame, telling it that it's not associated. The station might also not be authenticated, in which case there will not be a station entry for it, and as a result we need to accept such frames without a station. Fixes: 3ee0f0e23e4f ("iwlwifi: mvm: fix DQA AP mode station assumption") Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: update rx statistics cmd apiLiad Kaufman7-141/+371
The API has changed - update the code. Signed-off-by: Liad Kaufman <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: remove DQA non-STA client mode special caseJohannes Berg1-8/+0
When we get a non-STA frame to transmit in client mode, we try to use the IWL_MVM_DQA_BSS_CLIENT_QUEUE queue (queue #4). However, at this point, the queue might not be allocated at all, causing warnings. The scenario on which this happened was a race condition between mac80211 and our queue allocation work: * mac80211 sends auth * we stop mac80211 queues to allocate a hw queue * authentication is aborted * we allocate HW queue and start mac80211 queues * mac80211 removes station * mac80211 hands us the auth frame from the pending queue At this point, since mac80211 has already removed the station, we try to transmit the frame through this special non-station case on queue 4 anyway. In order to really use it properly, we'd have to again go through the hw queue allocation work, and attach it to a station, etc. In this case that isn't possible (there's no station anymore), but if this special case were needed, then we'd have to do it this way. However, the special case is documented to exist for TDLS, but can't trigger there because the TDLS setup frames etc. are normal to-DS frames going to the peer through the AP. Testing also confirms that this code path isn't triggered in TDLS. Therefore, remove the code path to avoid using an unused queue. The erroneous frame described above will still be transmitted on the AUX queue, but arguably that's a mac80211 problem, which will eventually be fixed by moving everything there to TXQs. Fixes: e3118ad74d7e ("iwlwifi: mvm: support tdls in dqa mode") Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: don't mess the SNAP header in TSO for non-QoS packetsEmmanuel Grumbach1-4/+6
When we get large sends on non-QoS association, we had a bug that mangled the SNAP header. Fix that. Fixes: a6d5e32f247c ("iwlwifi: mvm: send large SKBs to the transport") Signed-off-by: Emmanuel Grumbach <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: pcie: reconfigure MSI-X HW on resumeJohannes Berg1-0/+3
When going into suspend, the HW configuration for MSI-X will likely be lost. As a consequence, after waking up, all IRQ causes will be mapped to interrupt 0, and as a consequence we don't notice the interrupt because in most cases this is an interrupt for a queue, and getting it doesn't read the other cause registers. Fixes: 2e5d4a8f61dc ("iwlwifi: pcie: Add new configuration to enable MSIX") Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: don't send fetch the TID from a non-QoS packet in TSOEmmanuel Grumbach1-5/+5
Getting the TID of a packet before we know it is a QoS data packet isn't a good idea. Delay the TID retrieval until we know the packet is a QoS data packet. Fixes: bb81bb68f472 ("iwlwifi: mvm: add Tx A-MSDU inside A-MPDU") Signed-off-by: Emmanuel Grumbach <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: fix mac80211's hw_queue in DQA modeJohannes Berg1-6/+26
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 <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: map cab_queue to real one earlierJohannes Berg1-5/+6
There may be a difference between the mac80211 vif->cab_queue and mvmvif->cab_queue, particularly with TVQM. Make the code map this earlier, instead of first returning the mac80211 one again from iwl_mvm_get_ctrl_vif_queue(). Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: fix mac80211 queue trackingJohannes Berg3-2/+12
In the driver, we track which hardware queue is associated with which mac80211 "hw_queue", in order to be able to stop and wake it. When moving these bitmaps out of the queue_info structures, the type of the bitmap was erroneously changed from u32 to u8, presumably in order to save memory. Turns out that u32 isn't needed, because the highest queue we can ever tell mac80211 is always < 16, but a u16 definitely is needed, queues >=8 do happen. While at it, throw a BUILD_BUG_ON() into the place where we set the limit (mvm->first_agg_queue) and a warning when it actually gets put into the bitmap. The consequence of this bug is that full HW queues associated with such a too-high mac80211 number never stop higher layer queues when full, and thus would simply drop all packets that couldn't be enqueued to the hardware queue. Fixes: 34e10860ae8d ("iwlwifi: mvm: remove references to queue_info in new TX path") Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: properly enable IP header checksummingJohannes Berg1-8/+12
The code was intended to enable IP header checksumming on AMSDUs, but failed to really do so because the A-MSDU bit was set after all the checksumming bits, and thus checking for A-MSDU could never be true. Fix this by setting the A-MSDU bit before the offload bits. Fixes: 5e6a98dc4863 ("iwlwifi: mvm: enable TCP/UDP checksum support for 9000 family") Reported-by: Emmanuel Grumbach <[email protected]> Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: pcie: add MSI-X interrupt tracingJohannes Berg2-1/+29
We have tracing for both pre-ICT and ICT interrupts, including all the data read there. Extend the tracing to MSI-X interrupts. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: quietly accept non-sta assoc response framesJohannes Berg1-4/+7
When hostapd adds a station, it does so before sending the association response frame, so that it can indicate the correct status code in the response. However, when this then fails, or the association response already is a reject for some other reason, then there's no station entry and thus no per-station management queue to send the response on and it must be sent on the probe response queue. The code should therefore not warn. In theory, we could check and warn if the status code is success, but that seems excessive, so just relax the check to allow any association response frames. Fixes: 3ee0f0e23e4f ("iwlwifi: mvm: fix DQA AP mode station assumption") Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: remove version 2 of paging commandJohannes Berg2-49/+15
Only a000-series devices were going to use this, but actually initialize using the context info, which includes paging, so this code is never invoked; remove it. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: move configuration into sub-directoryJohannes Berg9-2/+2
Since we now support 8 device families, move their configuration files into a new subdirectory "cfg". Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: move notification wait into fw/Johannes Berg7-6/+6
Move the notification wait code into the new fw interaction directory. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: create new subdirectory for FW interactionJohannes Berg14-17/+17
There's a lot of mvm code that really should be more generic and part of the iwlwifi module. Start by making a place to keep such code - in the new "fw" subdirectory - and already move the firmware related header files there. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: rename iwl_shared_mem_cfg_v1 to the correct _v2Johannes Berg2-4/+4
This structure represents V2, V1 has the three last fields missing. Rename it to be more accurate. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: fix deduplication start logicJohannes Berg1-2/+15
If the first frame on a given TID is received with seqno 0 and needed to be retransmitted, we erroneously drop it because the deduplication data is initialized to zero, and then comparing if (unlikely(ieee80211_has_retry(hdr->frame_control) && dup_data->last_seq[tid] == hdr->seq_ctrl && dup_data->last_sub_frame[tid] >= sub_frame_idx)) return true; will return in iwl_mvm_is_dup() since last_sub_frame is also set to zero, and sub_frame_idx is usually zero since this only covers the relatively rare case of A-MSDU. Fix this by initializing the last_seq array to 0xffff, which is an impossible value for hdr->seq_ctrl to have here because the lower four bits are the fragment number, and fragments aren't handled in this code but go to mac80211 instead. Fixes: a571f5f635ef ("iwlwifi: mvm: add duplicate packet detection per rx queue") Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: unconditionally stop device after initJohannes Berg1-1/+1
In commit b93b1fe3b532 ("iwlwifi: mvm: fix init_dbg flow to work as expected"), the code was changed to make the stop conditional on not having failed (and on not having init_dbg), which doesn't make sense - we should stop the device regardless of failures. Failure to do so is leading to the device being enabled when it shouldn't be, and - if it gets re-enabled later - the new context info code gets confused as paging data wasn't freed. Remove the invalid error condition again. Fixes: b93b1fe3b532 ("iwlwifi: mvm: fix init_dbg flow to work as expected") Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: pcie: warn if paging is already initialized during initJohannes Berg1-0/+5
This appears to happen in some cases, like when iwlmvm is unloaded and loaded again without also unloading iwlwifi. Warn in this case and free the paging data to be able to continue without causing corruption and kernel crashes due to it (otherwise, paging data is overwritten, but dram->paging_cnt gets to be twice as big as it should be, and then an eventual free will crash.) Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: pcie: make ctxt-info free idempotentJohannes Berg1-0/+2
By setting the pointers to NULL at the end, these functions are made idempotent. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: unify external & internal modparam namesJohannes Berg15-43/+43
Where possible (all except for "11n_disable", which isn't valid in C) rename the internal names for module parameters to be the same as the externally visible names, to aid finding their use etc. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: support multi tid ba notifLiad Kaufman2-17/+15
When receiving a BA_NOTIF on new TX API, it can contain BAs for several TIDs. Go over them and reclaim TX for every TID. Note that although the small API change, the API version still isn't bumped forward, as this NIC isn't still officially released. Signed-off-by: Liad Kaufman <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: change when the BT_COEX is sentEmmanuel Grumbach4-10/+12
The BT_COEX command should not be sent to the INIT firmware image starting from 8000 family. The firmware team also requested to send the BT_COEX command after the PHY_DB_CMD and the PHY_CFG_CMD. While at it: s/iwl_send_bt_init_conf/iwl_mvm_send_bt_init_conf/ Signed-off-by: Emmanuel Grumbach <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: pcie: improve debug in iwl_pcie_rx_handle_rb()Johannes Berg1-3/+7
Print the queue for the existing debug message and add a new debug message indicating where the RB ended. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: support aggs of 64 frames in A000 familyLiad Kaufman3-3/+16
A SCD bug was fixed in the A000 family, allowing to support aggregations of 64 frames (rather than 63). Signed-off-by: Liad Kaufman <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: pcie: improve "invalid queue" warningJohannes Berg1-2/+6
Print out both queue IDs to be able to see what went wrong. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: use proper CDB check in PHY context modifyJohannes Berg1-2/+2
When the firmware supports CDB, PHY contexts cannot be modified to change their band, but need to be added/remove instead. Instead of relying on iwl_mvm_has_new_tx_api(), check the right FW capa flag IWL_UCODE_TLV_CAPA_BINDING_CDB_SUPPORT and remove the comment. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: add twelve new 9560 series PCI IDsTzipi Peres1-1/+14
Add twelve new PCI IDs for the 9560 series. Signed-off-by: Tzipi Peres <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: add the new a000_2ax seriesTzipi Peres3-0/+16
Add a new config struct for the new a000 2ax series and add the five PCI ID for it. Signed-off-by: Tzipi Peres <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: simplify CHECK_MLME_TRIGGER macroLuca Coelho1-15/+9
There's no reason to pass mvm and trig as parameters to the macro, since it will be expanded inside the function itself. Also remove the bogus buf parameter which doesn't exist and is not used. Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: change sta_id to u8Sharon Dvir1-2/+2
The sta_id variable is used as an index in an array, should be unsigned. Found by Klocwork. Fixes: 9f9af3d7d303 ("iwlwifi: mvm: re-aggregate shared queue after unsharing") Signed-off-by: Sharon Dvir <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: pcie: fix 9000-series RF-kill interrupt propagationJohannes Berg2-1/+11
A hardware issue on 9000 series devices sometimes causes RF-kill interrupts to not be propagated to the host properly if ASPM is enabled. Work around this by setting the right hardware bit to allow it to interrupt the host for this reason (rfkill). Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: pcie: only apply retention workaround on 9000-series A-stepJohannes Berg1-6/+13
Due to a hardware issue, certain power saving had to be disabled. However, this issue was fixed in B-step, so the workaround only needs to apply to A-step. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: dvm: use macros for format stringsJohannes Berg1-5/+4
Some static checkers (e.g. smatch) complain if a non-constant format string is used, even if that's a static const variable. Since there's no impact on code generation, just change those format strings to be macros. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: fix a bunch of kernel-doc warningsJohannes Berg9-58/+127
Fix the kernel-doc, and remove some fields even the firmware doesn't use in ToF, RX, scan, station and generic FW APIS. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: add documentation for all command IDsJohannes Berg4-27/+292
Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: use __le16 even for reserved fieldsJohannes Berg1-1/+1
Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: remove various unused command IDs/structsJohannes Berg2-39/+0
Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: fix various "Excess ... description" kernel-doc warningsJohannes Berg6-13/+10
Fix various "Excess struct/union/enum/typedef member '...' description in '...'" warnings from kernel-doc, mostly caused by typos. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: remove some CamelCase from firmware APIJohannes Berg2-3/+3
Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: Add debugfs entry to retrieve SAR geographic profileHaim Dreyfuss1-0/+50
Add a debugfs entry to get a verbose description of the power settings used in each band with the currently selected SAR geographic profile. Signed-off-by: Haim Dreyfuss <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-29iwlwifi: mvm: refactor geo initHaim Dreyfuss3-18/+67
We are going to add debugfs entry to retrieve the current geographic profile being used in the FW. Currently the driver reads those tables from the BIOS and passes them to the FW. To prepare for this retrieving we want to store those tables in the driver. Signed-off-by: Haim Dreyfuss <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-28Merge tag 'iwlwifi-next-for-kalle-2017-06-28' of ↵Kalle Valo39-450/+845
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;