summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intel/iwlwifi/mvm/sta.h
AgeCommit message (Collapse)AuthorFilesLines
2024-09-03wifi: iwlwifi: s/IWL_MVM_STATION_COUNT_MAX/IWL_STATION_COUNT_MAXMiri Korenblit1-1/+1
This isn't mvm specific. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Link: https://patch.msgid.link/20240901071542.5d71a0a2b56c.I7e0fe636d914852963e7a2f5e6037d0c3e367145@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-08-27wifi: iwlwifi: remove MVM prefix from FW macrosMiri Korenblit1-1/+1
These are not mvm specific. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Link: https://patch.msgid.link/20240729201718.939b32f84f46.I293957bf172680871eba24448d9d1870e49100b6@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-06-26wifi: iwlwifi: fix prototype mismatch kernel-doc warningsJohannes Berg1-1/+1
Fix all the prototype mismatch and "wrong kernel-doc identifier" warnings, due to typos in or misformatting of the kernel-doc. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20240625194805.6ec65cf9b88c.I7804114d7369f352e80a0e8430f7119af8e210de@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-29wifi: iwlwifi: mvm: remove stale STA link data during restartBenjamin Berg1-0/+5
If pre-recovery mac80211 tried to disable a link but this disablement failed, then there might be a mismatch between mac80211 assuming the link has been disabled and the driver still having the data around. During recover itself, that is not a problem, but should the link be activated again at a later point, iwlwifi will refuse the activation as it detects the inconsistent state. Solve this corner-case by iterating the station in the restart cleanup handler. Signed-off-by: Benjamin Berg <benjamin.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240513132416.d2fd60338055.I840d4fdce5fd49fe69896d928b071067e3730259@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-06wifi: iwlwifi: mvm: Activate EMLSR based on traffic volumeMiri Korenblit1-0/+24
Adjust EMLSR activation to account for traffic levels. By tracking the number of RX/TX MPDUs, EMLSR will be activated only when traffic volume meets the required threshold. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240505091420.9480f99ac8fc.If9eb946e929a39e10fe5f4638bc8bc3f8976edf1@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-03-01Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netJakub Kicinski1-1/+2
Cross-merge networking fixes after downstream PR. Conflicts: net/mptcp/protocol.c adf1bb78dab5 ("mptcp: fix snd_wnd initialization for passive socket") 9426ce476a70 ("mptcp: annotate lockless access for RX path fields") https://lore.kernel.org/all/20240228103048.19255709@canb.auug.org.au/ Adjacent changes: drivers/dpll/dpll_core.c 0d60d8df6f49 ("dpll: rely on rcu for netdev_dpll_pin()") e7f8df0e81bf ("dpll: move xa_erase() call in to match dpll_pin_alloc() error path order") drivers/net/veth.c 1ce7d306ea63 ("veth: try harder when allocating queue memory") 0bef512012b1 ("net: add netdev_lockdep_set_classes() to virtual drivers") drivers/net/wireless/intel/iwlwifi/mvm/d3.c 8c9bef26e98b ("wifi: iwlwifi: mvm: d3: implement suspend with MLO") 78f65fbf421a ("wifi: iwlwifi: mvm: ensure offloading TID queue exists") net/wireless/nl80211.c f78c1375339a ("wifi: nl80211: reject iftype change with mesh ID change") 414532d8aa89 ("wifi: cfg80211: use IEEE80211_MAX_MESH_ID_LEN appropriately") Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-02-21wifi: iwlwifi: mvm: ensure offloading TID queue existsBenjamin Berg1-1/+2
The resume code path assumes that the TX queue for the offloading TID has been configured. At resume time it then tries to sync the write pointer as it may have been updated by the firmware. In the unusual event that no packets have been send on TID 0, the queue will not have been allocated and this causes a crash. Fix this by ensuring the queue exist at suspend time. Signed-off-by: Benjamin Berg <benjamin.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240218194912.6632e6dc7b35.Ie6e6a7488c9c7d4529f13d48f752b5439d8ac3c4@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02wifi: iwlwifi: mvm: Add support for removing responder TKsIlan Peer1-1/+2
When removing a PASN station, the TK must be removed before the station is removed as otherwise the FW would assert. To handle this, store the key configuration, and use it to remove the key when the station is removed. Signed-off-by: Ilan Peer <ilan.peer@intel.com> Reviewed-by: Gregory Greenman <gregory.greenman@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240131230734.3e6364730c04.Ia76dc4a9d399f1f68ac6b157d844b63f74d5159f@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-10-23wifi: iwlwifi: mvm: simplify the reorder bufferEmmanuel Grumbach1-7/+0
The firmware / hardware of devices supporting RSS is able to report duplicates and packets that time out inside the reoder buffer. We can now remove all the complex logic that was implemented to keep all the Rx queues more the less synchronized: we used to send a message to all the queues through the firmware to teach the different queues about what is the current SSN every 2048 packets. Now that we rely on the firmware / hardware to detect duplicates, we can completely remove the code that did that in the driver and it has been reported that this code was spuriously dropping legit packets. Suggested-by: Sultan Alsawaf <sultan@kerneltoast.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20231017115047.54cf4d3d5956.Ic06a08c9fb1e1ec315a4b49d632b78b8474dab79@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-09-11wifi: iwlwifi: mvm: fix kernel-docJohannes Berg1-2/+3
Fix kernel-doc, adding various documentation, but in some cases (notably rate scaling) just removing the erroneous comment format. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230830112059.4ce1159b51ab.I2021ae335f6b8e50ee2c1c78a79c5eac1c1aa103@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-06-14wifi: iwlwifi: make debugfs entries link specificBenjamin Berg1-4/+5
All of the station elements are really elements for the link. Create them from the correct callback and return the link specific information rather than always using the default link. Signed-off-by: Benjamin Berg <benjamin.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230612184434.a8e0c40d325e.I374d9433c3b8694667e1ce550d65f6f1f0d23c05@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-06-06wifi: iwlwifi: mvm: adjust csa notifications and commands to MLOGregory Greenman1-1/+3
In the following notifications and commands mac_id was replaced with link_id: * CANCEL_CHANNEL_SWITCH_CMD * CHANNEL_SWITCH_START_NOTIF * CHANNEL_SWITCH_ERROR_NOTIF The logic around was not changed, so only adjust handling mac/link id. Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230524203151.6aa6e394f5fe.Ie9e78918511ca901f9f3966d774fa74a71a186e3@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-06-06wifi: iwlwifi: mvm: support PASN for MLOAvraham Stern1-0/+5
When adding a PASN station, the non MLD API was used. This results in assert when operating as MLD. Fix it to use the MLD API when operating as MLD. For now, the default link is used for the added station. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230524203151.7c35dccc8a12.I7bc78cd16d7c750f42fdd60e07e839a860d279d2@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-06-06wifi: iwlwifi: mvm: make internal callback structs constJohannes Berg1-1/+1
There's no need for these to be writable, so they can be const (and static). Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230524203151.c41eb6687868.I2dac1158e5723187bda1973aa49fde8a794621c8@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-04-18wifi: iwlwifi: mvm: remove RS rate init update argumentJohannes Berg1-0/+2
Track instead whether or not the station was authorized, that's clearer than trying to indicate in the code whether or not the full bandwidth should be used via an 'update' argument. While at it, give rs_fw_rate_init() the iwl_mvm_ prefix. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230417113648.92bd8d36e311.I1877a109104d5ffeaaad6a623e89f0c44decc38e@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-04-17wifi: iwlwifi: mvm: factor out iwl_mvm_sta_fw_id_mask()Johannes Berg1-0/+2
We are going to need this in more places than just the key code, so factor out the functionality of getting the FW station ID mask (filtered to a specific link if needed) to a separate function that can now be called both under RCU and mvm->mutex protection. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230416154301.eff92b93025d.I2c50290a0537d5db3d3460f4d57c78a4712ffb75@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-03-30wifi: iwlwifi: mvm: correctly use link in iwl_mvm_sta_del()Johannes Berg1-1/+1
This function can be invoked for both MLO and non-MLO, so it must deal with multi-link correctly. Notable, on auth timeout, we'd otherwise get a warning due to the erroneous deflink usage in MLO cases. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230329100040.b85f6052d51a.Iedfef4b4c4f3ca557aebc0093fdc3f5cfb49b507@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-03-30wifi: iwlwifi: mvm: move max_agg_bufsize into host TLC lq_staGregory Greenman1-2/+0
This field is used only for host TLC, so it can reside inside the corresponding lq_sta struct. Also, TLC lq_sta is cleared in iwl_mvm_rs_rate_init() upon association, but max_agg_bufsize is set earlier in iwl_mvm_sta_init(). Thus, place this field in the persistent part of lq_sta to retain its value. Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230329100040.d55361064e39.Ib79d30f27d94607d097f0192af2aacd455a17958@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-03-30wifi: iwlwifi: mvm: fix station link data leakJohannes Berg1-2/+1
When we remove the station, we call iwl_mvm_sta_del() which returns true if we cannot remove it from the firmware yet, which happens if this is the station ID for the AP station that's still used because the MAC is still associated. However, we still must free the link data as the station is only kept alive in the firmware, in mac80211 and driver the data structures are destroyed. To fix that, we need to make iwl_mvm_mld_free_sta_link() track whether or not the station is still alive in FW, as otherwise we might reuse the station ID in the meantime and iwl_mvm_mld_rm_sta_from_fw() would reject the later delete from the firmware. Add an argument to it for that. Then we can use the return value of iwl_mvm_sta_del() for that to fix the issue, and call iwl_mvm_mld_rm_sta_from_fw() only if we need to not keep the station in FW. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230329100039.1d81d4c71f35.I8fc60ac28ffc1147e9b1250e5e6237b3cb5516ac@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-03-30wifi: iwlwifi: mvm: implement mac80211 callback change_sta_linksShaul Triebitz1-0/+4
Add/removed from iwl driver and firmware station links. Update the station queues accordingly (which station links are connected to the station queues). Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230329100039.156d1aae5de1.I32973141be1190222169879f8caf7038c1a8f769@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-03-30wifi: iwlwifi: mvm: refactor iwl_mvm_mac_sta_state_common()Gregory Greenman1-1/+2
Move code handling specific state transitions into separate handlers and adjust them for MLO. Adjust relevant callbacks as well. Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230328104949.5a3f8a849723.I0670d20436858a1cd3c055e03c7528db81292811@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-03-30wifi: iwlwifi: mvm: adjust internal stations to MLOGregory Greenman1-5/+10
Internal stations are mcast/bcast and sniffer. They need some link specific data like bss id/phy id. Add link_conf as a parameter. Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230328104949.25b013fd30de.I7f9f5906123acae05040cceec470c9acb07b9d42@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-03-30wifi: iwlwifi: mvm: unite sta_modify_disable_tx flowsMiri Korenblit1-0/+6
These flows are the same in both MLD API and the current API, except for the commands that are being sent during this flows. Instead of checking each time before calling these floews what API we use and then call the correct function, call always the old one, which in turn will call the new one in case we're using the MLD API. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230328104948.5692d8dea9be.Ib1882b2c2f0b0603abc4b7d4a0ecc45cd1fbf9a7@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-03-30wifi: iwlwifi: mvm: add cancel/remain_on_channel for MLD modeMiri Korenblit1-0/+2
Add an MLD version of the remain_on_channel and cancel_remain_on_channel callbacks. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230328104948.b51813dbebd4.Ia25bbd63d3138e4759237ce2be0cd0436fe01c0a@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-03-30wifi: iwlwifi: mvm: add some new MLD opsMiri Korenblit1-0/+2
Add MLD version of bss_info_changed/switch_vif_chanctx/ config_iface_filter and conf_tx() callbacks. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230328104948.9c83c253d610.Ibf2006be9ece87896c17cb43dfe3654ac73d81ff@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-03-30wifi: iwlwifi: mvm: add sta handling flows for MLD modeMiri Korenblit1-0/+45
In MLD mode we have a new STA cmd. As a result, it is also changes the flows of adding/updating/removing and handling state of a station. Add these flows. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230328104948.b5548cfd8fe3.I70f9c8f3c95e18d5c9af0a5681e0830893509531@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-03-30wifi: iwlwifi: mvm: sta preparation for MLOGregory Greenman1-9/+28
Split iwl_mvm_sta into general and link specific parts. As a first step, all link dependent parameters reside in deflink. The change was done mostly using the spatch below with some manual adjustments. @iwl_mvm_sta@ struct iwl_mvm_sta *s; identifier var = {sta_id, lq_sta, avg_energy}; @@ ( s-> - var + deflink.var ) Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230328104948.34eace06d583.I1f8c5e919a71b21030460fbdd220d42401b688b1@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-03-22wifi: iwlwifi: mvm: refactor iwl_mvm_staMiri Korenblit1-1/+1
As the new MLD API is introduced, we have a new enumeration for the different station types. Since struct iwl_mvm_sta's sta_type field will be in use for both new and old API, change its type to a unified one, so it can hold both. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230320122330.c8b86d8ddd3e.I9581235860b91654b4f6c3a8797c777702690998@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-03-22wifi: iwlwifi: mvm: add start_ap() and join_ibss() callbacks for MLD modeMiri Korenblit1-0/+2
This is another patch in the series adding all the ops for the new MLD ieee80211_ops. The callbacks added here use the new MLD FW API Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230320122330.3eb485c359fc.I28be198ea9389083d5a01f68c92763722613ba9b@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-03-15wifi: iwlwifi: mvm: add an unassign_vif_chanctx() callback for MLD modeMiri Korenblit1-0/+7
This is another patch in the series adding all the ops for the new MLD ieee80211_ops. The callback added here uses the new MLD FW API Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230314194113.5d4bcd384425.I263eef3aad8efe23a597843fe7c56924038c8fdc@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-03-15wifi: iwlwifi: mvm: Add a remove_interface() callback for mld modeMiri Korenblit1-0/+2
As the MLD mode and its new APIs are introduced, we've decided to add a new ieee80211_ops dedicated for MLD callbacks. Add the MLD remove_interface() callback which uses the new MLD APIs. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230314194113.b87c5c0a4b6b.I631173a73d6ffd7232aa539ea8b356a222fac398@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-03-15wifi: iwlwifi: mvm: add support for the new STA related commandsMiri Korenblit1-3/+13
As a part of the new MLD FW API changes, we have new commands for STA related operations (add/remove/aux/disable tx). Add structures and enum definitions, along with part of the functions that sends this commands. This functions will be in used and more will be added in the next patches. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230314194113.132873ce015c.I7b12a77e5be066730762e6ceeeaa7190293c3df1@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2022-02-18iwlwifi: mvm: offload channel switch timing to FWNathan Errera1-0/+3
Since FW is now in charge of timing the channel switch, there is no need to send the add/modify/remove time event command to fw with every (e)CSA element. However, the driver needs to cancel the channel switch if the CS start notification arrives and it does not know about an ongoing channel switch. Signed-off-by: Nathan Errera <nathan.errera@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20220128153013.ac3af0ff22c7.Ie87c62047b71b93b12aa80b5dc5391b4798dbe97@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-11-26iwlwifi: integrate with iwlmeiEmmanuel Grumbach1-1/+3
iwlmei needs to know about the follwing events: * Association * De-association * Country Code change * SW Rfkill change * SAR table changes iwlmei can take the device away from us, so report the new rfkill type when this happens. Advertise the required data from the CSME firmware to the usersapce: mostly, the AP that the CSME firmware is currently associated to in case there is an active link protection session. Generate the HOST_ASSOC / HOST_DISSASSOC messages. Don't support WPA1 (non-RSNA) for now. Don't support shared wep either. We can then determine the AUTH parameter by checking the AKM. Feed the cipher from the key installation. SW Rfkill will be implemented later when cfg80211 will allow us to read the SW Rfkill state. Co-Developed-by: Ayala Beker <ayala.beker@intel.com> Signed-off-by: Ayala Beker <ayala.beker@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> v7: Ayala added her signed-off remove pointless function declaration fix a bug due to merge conflict in the HOST_ASSOC message v8: leave a print if we have a SAP connection on a device we do not support (yet) Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20211112062814.7502-4-emmanuel.grumbach@intel.com
2021-04-14iwlwifi: mvm: clean up queue sync implementationJohannes Berg1-8/+30
When we do queue sync, it's confusing that we have the structures declared in the FW API header files that aren't really firmware, and the union is also confusing - especially now in the code that checks the size on the return. So rework this: change the type of sync and whether to do it in a synchronous fashion to arguments, and build the data structure in the function, so we don't need the union. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20210331121101.f62833fd9893.I612d7ac1c655ec4880329360e15d207698c750bc@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2020-12-10iwlwifi: use SPDX tagsJohannes Berg1-64/+6
Use SPDX tags instead of the long copyright notices. Also cleanup some duplicate copyright notices and combine the years where possible. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20201210000603.481bcb512a6f.I8146abe5a637079e7336209f23cb26af98b12b31@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2020-10-08iwlwifi: mvm: support ADD_STA_CMD_API_S ver 12Nathan Errera1-2/+1
ADD_STA_CMD_API_S ver 12 was added in order to properly support auxiliary activities in CDB NICs. In the new version we don't need to allocate an aux station at initialization, instead we add an aux station only when an auxiliary activity that requires a dedicated Tx queue is needed. For now the only case we need this kind of activity is when using hot spot 2.0 Signed-off-by: Nathan Errera <nathan.errera@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/iwlwifi.20201008180656.700e6e2e3077.Icdd807b6a3ad3fed806449ea0a13f856aa20e632@changeid
2020-10-08iwlwifi: mvm: get number of stations from TLVNathan Errera1-1/+1
FW is changing the max number of supported stations. To adapt to the change we get the max number from the TLV and act according to the new number. Signed-off-by: Nathan Errera <nathan.errera@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/iwlwifi.20201008180656.863ab470babc.I393223392f36436663c4e66add03fefe77b74e60@changeid
2020-10-01iwlwifi: mvm: add an option to add PASN stationAvraham Stern1-0/+3
A FTM responder may do PASN authentication with unassociated stations to allow secure ranging. In this case, the driver will add an internal station and install the TK so the FW will accept protected FTM request frames from this station and will send a protected FTM response frame. In addition, the driver needs to configure the HLTK to the FW so the FW can derive the secure LTF bits. This is left for a later patch since it is not yet supported by the FW. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20200911204056.c915b44ad7dd.I72ef7f9753964555561c27ec503241105eddb14e@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2020-05-29iwlwifi: mvm: fix aux station leakSharon1-3/+3
When mvm is initialized we alloc aux station with aux queue. We later free the station memory when driver is stopped, but we never free the queue's memory, which casues a leak. Add a proper de-initialization of the station. Signed-off-by: Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20200529092401.0121c5be55e9.Id7516fbb3482131d0c9dfb51ff20b226617ddb49@changeid
2019-07-30iwlwifi: mvm: replace RS mutex with a spin_lockGregory Greenman1-1/+0
The solution with the worker still had a bug, as in order to get sta, rcu_read_lock should be used and thus no mutex can be used inside iwl_mvm_rs_rate_init. Also, spin_lock is a simpler solution, no need to spawn a dedicated worker. Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2019-07-30iwlwifi: mvm: add a new RSS sync notification for NSSN syncEmmanuel Grumbach1-0/+6
We will soon be using a new notification that will be initiated by the driver, sent to the firmware and sent back to all the RSS queues by the firmware. This new notification will be useful to synchronize the NSSN across all the queues. For now, don't send the notification, just add the code to handle it. Later patch will add the code to actually send it. While at it, validate the baid coming from the firmware to avoid accessing an array with a bad index in the driver. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2019-07-30iwlwifi: mvm: prepare the ground for more RSS notificationsEmmanuel Grumbach1-2/+4
We will need a new type of synchronization message going through all the RSS queues. Prepare the ground for this. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2019-07-30iwlwifi: mvm: avoid races in rate init and rate performMordechay Goodstein1-0/+1
Rate perform uses the lq_sta table to calculate the next rate to scale while rate init resets the same table, Rate perform is done in soft irq context in parallel to rate init that can be called in case we are doing changes like AP changes BW or moving state for auth to assoc. Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2019-06-29iwlwifi: mvm: add a debugfs entry to set a fixed size AMSDU for all TX packetsMordechay Goodstein1-0/+4
The current debugfs entry only limits the max AMSDU for TCP. Add a new debugfs entry to allow setting a fixed AMSDU size for all TX packets, including UDP and ICMP Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-03-22iwlwifi: mvm: fix TX crypto on 22560+ devicesJohannes Berg1-5/+2
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-02-04iwlwifi: mvm: fix AP mode in WEPEmmanuel Grumbach1-0/+3
Recently we started to send the WEP keys to the firmware so that we could use hardware Tx encryption also on newer devices that require the keys to be installed in the firmware for encryption (as opposed to older devices that can get the key in the Tx command for each Tx). When we implemented that, we forgot to remove the key when we remove a station leading to a situation where a station that connects and disconnects a lot of times exhausts the key database inside the firmware. A fix was made for that, but we always removed the same key: mvmvif->ap_wep_key which means that we removed the same key entry in the firmware. This can make sense since in WEP, the key is the same for all the stations, but the internal implementation of iwl_mvm_set_sta_key and iwl_mvm_remove_sta_key assumes that each station uses a different key in the firmware's key database. So now we got to the situation where we have a single ieee80211_key_conf instance that means, a single ieee80211_key_conf.hw_key_idx index for several stations and hence for several keys. ieee80211_key_conf.hw_key_idx is set to 0 when the first station associates, and then it is overwritten to 1 when the second station associates which is a buggy of course. This led to the following message upon the removal of the second station: iwlwifi 0000:00:03.0: offset 1 not used in fw key table. WARNING: CPU: 2 PID: 27883 at net/mac80211/sta_info.c:1122 __sta_info_destroy_part2+0x16b/0x180 [mac80211] RIP: 0010:__sta_info_destroy_part2+0x16b/0x180 [mac80211] Call Trace: __sta_info_destroy+0x2a/0x40 [mac80211] sta_info_destroy_addr_bss+0x38/0x60 [mac80211] ieee80211_del_station+0x1d/0x30 [mac80211] nl80211_del_station+0xe0/0x1f0 [cfg80211] Fix this by copying the ieee80211_key_conf structure for each and every station. This is the easiest way to properly remove the keys with the right index. Another solution would have been to allow several stations to use the same key offset in the firmware. That would require to change the way we track keys in iwlmvm and not really worth it. Also, maintain correctly fw_key_table when we add a key for the multicast station. Remove the key when we remove the multicast station. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Fixes: 337bfc9881a2 ("iwlwifi: mvm: set wep key for all stations in soft ap mode") Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-01-25iwlwifi: mvm: support mac80211 TXQs modelSara Sharon1-4/+0
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>
2018-11-11iwlwifi: mvm: toggle tx antenna if tx fails during connection establishmentAvraham Stern1-0/+4
If tx fails during connection establishment, try another antenna for the next tx. This will increase the chance to establish connection if one of the antennas is blocked. Note that the antenna is toggled even when failing to tx data frames since connection establishment may use EAPOLs for 802.1X authentication/ 4 way handshake. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-10-08iwlwifi: mvm: kill INACTIVE queue stateJohannes Berg1-4/+0
We don't really need this state: instead of having an inactive state where we can awaken zombie queues again if needed, just keep them in their normal state unless a new queue is actually needed and there's no other way of getting one. We do this here by making the inactivity check not free queues unless instructed that we now really need to allocate one to a specific station, and in that case it'll just free the queue immediately, without doing any inactivity step inbetween. The only downside is a little bit more processing in this case, but the code complexity is lower. Additionally, this fixes a corner case: due to the way the code worked, we could only ever reuse an inactive queue if it was the reserved queue for a station, as iwl_mvm_find_free_queue() would never consider returning an inactive queue. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>