summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* wifi: mac80211: fix multi-BSSID element parsingJohannes Berg2022-07-1510-50/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | When parsing a frame containing a multi-BSSID element, we need to know both the transmitted and non-transmitted BSSID so we can parse it correctly. Unfortunately, in quite a number of cases, we got this wrong and were passing the wrong BSSID or useless information: * the mgmt->bssid from a frame is only the transmitted BSSID if the frame is a beacon * passing just one of the parameters as non-NULL isn't useful and ignored In those case where we need to parse for a specific BSS we always have a BSS structure pointer, representing the BSS we need, whether transmitted or not. Thus, pass that pointer to the parsing function instead of the two BSSIDs. Also fix two bugs: * we need to re-parse all the elements for the other BSS when iterating the non-transmitted BSSes in scan * we need to parse for the correct BSS when setting up the channel data in client code Fixes: 78ac51f81532 ("mac80211: support multi-bssid") Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: move tdls_chan_switch_prohibited to link dataJohannes Berg2022-07-153-3/+4
| | | | | | | This value should be per link, since a TDLS connection is only established on a given link. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: don't re-parse elems in ieee80211_assoc_success()Johannes Berg2022-07-151-15/+4
| | | | | | | | We're already passing the elems pointer, and have parsed them from the same frame with exactly the same parameters, so don't need to do that again. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: replace link_id with link_conf in start/stop_ap()Gregory Greenman2022-07-1510-40/+44
| | | | | | | | | When calling start/stop_ap(), mac80211 already has a protected link_conf pointer. Pass it to the driver, so it shouldn't handle RCU protection. Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: refactor elements parsing with parameter structJohannes Berg2022-07-152-34/+74
| | | | | | | | Refactor the element parsing into a version that has a parameter struct so we can add more parameters more easily in the future. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: extend cfg80211_rx_assoc_resp() for MLOJohannes Berg2022-07-154-32/+59
| | | | | | | | Extend the cfg80211_rx_assoc_resp() to cover multiple BSSes, the AP MLD address and local link addresses for MLO. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: put cfg80211_rx_assoc_resp() arguments into a structJohannes Berg2022-07-155-38/+51
| | | | | | | | For MLO we'll need a lot more arguments, including all the BSS pointers and link addresses, so move the data to a struct to be able to extend it more easily later. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: adjust assoc comeback for MLOJohannes Berg2022-07-154-11/+11
| | | | | | | | We only report the BSSID to userspace, so change the argument from BSS struct pointer to AP address, which we'll use to carry either the BSSID or AP MLD address. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: mlme: unify assoc data event sendingJohannes Berg2022-07-151-31/+20
| | | | | | | | | | | | | | | | There are a few cases where we send an event to cfg80211 manually, but ieee80211_destroy_assoc_data() also handles the case of abandoning; some cases don't need an event and success is handled yet differently. Unify this by providing a single status argument to the ieee80211_destroy_assoc_data() function and then handling all the different cases of events (or no events) there. This will help simplify the code when MLO support is added. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: prepare association failure APIs for MLOJohannes Berg2022-07-154-37/+75
| | | | | | | | | | | | For MLO, we need the ability to report back multiple BSS structures to release, as well as the AP MLD address (if attempting to make an MLO connection). Unify cfg80211_assoc_timeout() and cfg80211_abandon_assoc() into a new cfg80211_assoc_failure() that gets a structure parameter with the necessary data. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: remove BSS pointer from cfg80211_disassoc_requestJohannes Berg2022-07-155-22/+13
| | | | | | | | | | The race described by the comment in mac80211 hasn't existed since the locking rework to use the same lock and for MLO we need to pass the AP MLD address, so just pass the BSSID or AP MLD address instead of the BSS struct pointer, and adjust all the code accordingly. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: mlme: use correct link_staJohannes Berg2022-07-151-17/+33
| | | | | | | For station capabilities, e.g. TWT, we need to use the correct link station instead of deflink. Switch the code to do that. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: mlme: remove sta argument from ieee80211_config_bwJohannes Berg2022-07-151-5/+1
| | | | | | | The argument is unused except for NULL checking, but we already do that anyway, so it's not needed. Remove the argument. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: mlme: use ieee80211_get_link_sband()Johannes Berg2022-07-152-6/+8
| | | | | | | | | This requires a few more changes. While at it, also add a warning to ieee80211_get_sband() to avoid it being used when there are multiple links. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: split IEEE80211_STA_DISABLE_WMM to link dataJohannes Berg2022-07-152-5/+6
| | | | | | | | If we decide to stop tracking QoS/WMM parameters, then this should be a per-link decision. Move the flag to the link instead. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: mlme: first adjustments for MLOJohannes Berg2022-07-153-363/+408
| | | | | | | | | | | | | Do the first adjustments in the client-side code to pass the link pointer (instead of sdata) to most places etc. This is just preparation, so the real MLO patches become smaller. Note that this isn't complete, notably there are still quite a few references to sta->deflink and sta->sta.deflink. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: mlme: do IEEE80211_STA_RESET_SIGNAL_AVE per linkJohannes Berg2022-07-152-5/+4
| | | | | | | | | Remove the IEEE80211_STA_RESET_SIGNAL_AVE flag and use a bool instead, but invert the polarity (now calling it tracking_signal_avg) so we don't have to initialize it, and put that into the link instead. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: mlme: track AP (MLD) address separatelyJohannes Berg2022-07-152-14/+19
| | | | | | | | | To prepare a bit more for MLO in the client code, track the AP's address (for now only the BSSID, but will track the AP MLD's address later) separately from the per-link BSSID. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: remove unused bssid variableJohannes Berg2022-07-151-2/+0
| | | | | | This variable is only written to, remove it. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: change QoS settings API to take link into accountJohannes Berg2022-07-1555-104/+158
| | | | | | | Take the link into account in the QoS settings (EDCA parameters) APIs. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: expect powersave handling in driver for MLOJohannes Berg2022-07-152-2/+5
| | | | | | | | In MLO, expect the driver fully handles powersave handling, including tracking whether or not a beacon was received, the DTIM period, etc. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: move ps setting to vif configJohannes Berg2022-07-1513-22/+22
| | | | | | | | | | This really shouldn't be in a per-link config, we don't want to let anyone control it that way (if anything, link powersave could be forced through APIs to activate/deactivate a link), and we don't support powersave in software with devices that can do MLO. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: provide link ID in link_confJohannes Berg2022-07-152-0/+3
| | | | | | | | It might be useful to drivers to be able to pass only the link_conf pointer, rather than both the pointer and the link_id; add the link_id to the link_conf to facility that. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: set up/tear down client vif links properlyJohannes Berg2022-07-153-151/+232
| | | | | | | | | | | | | | | | | | | | In station/client mode, the link data needs a bit more initialization and destruction than just zero-init and kfree() respectively, implement that. This required some shuffling of the link data handling in general, as we should set it up in setup and do the teardown in teardown, otherwise we're asymmetric in case of interface type changes. Also stop using kfree_rcu(), we cannot guarantee that nothing is scheduling things that live within the link (e.g. the u.mgd.request_smps_work) until we're sure it cannot be referenced anymore, therefore synchronize instead. This isn't very efficient, but we can always optimize it later. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: move ieee80211_request_smps_mgd_workJohannes Berg2022-07-153-13/+12
| | | | | | This function can be static. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: nl80211: acquire wdev mutex for dump_surveyJohannes Berg2022-07-151-0/+2
| | | | | | | | At least the quantenna driver calls wdev_chandef() here which now requires the lock, so acquire it. Fixes: 7b0a0e3c3a88 ("wifi: cfg80211: do some rework towards MLO link APIs") Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: fix key lookupJohannes Berg2022-07-151-0/+4
| | | | | | | | | | | | With the split into keys[]/deflink.gtk[] arrays, WEP keys are still installed into the keys[] array, but we didn't look them up there. This meant they weren't deleted correctly. Fix this by looking up the key there even if it's not pairwise so we can be sure we don't have it. Fixes: bfd8403adddd ("wifi: mac80211: reorg some iface data structs for MLD") Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: separate out connection downgrade flagsJohannes Berg2022-07-157-209/+221
| | | | | | | | | Separate out the connection downgrade flags from the ifmgd->flags and put them into the link information instead. While at it, make them a separate sparse type so we don't get confused about where they belong and have static checking on correct handling. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: Align with Draft P802.11be_D2.0Ilan Peer2022-07-152-11/+18
| | | | | | | Align the mac80211 implementation with P802.11be_D2.0. Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: Align with Draft P802.11be_D1.5Ilan Peer2022-07-154-47/+128
| | | | | | | Align the mac80211 implementation with P802.11be_D1.5. Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: skip powersave recalc if driver SUPPORTS_DYNAMIC_PSJohannes Berg2022-07-151-1/+2
| | | | | | | | | | | | There are a few places that check ps_sdata and/or the dynamic PS timeout, but they're erroneous in case SUPPORTS_DYNAMIC_PS is set by the driver. Skip the entire recalculation in this case so we cannot get into those paths elsewhere, and so we simplify this for the purpose of implementing MLO. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: debug: omit link if non-MLO connectionJohannes Berg2022-07-151-6/+25
| | | | | | | | | If we don't really have multiple links, omit the link ID from link debug prints, otherwise we change the format for all of the existing drivers (most of which might never support MLO), and also have extra noise in the logs. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211_hwsim: Ack link addressed framesAndrei Otcheretianski2022-07-151-1/+18
| | | | | | | Do address matching with link addresses as well. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: drop BSS elements from assoc trace for nowJohannes Berg2022-07-152-21/+3
| | | | | | | | | | | | For multi-link operation, this cannot work as the req->bss pointer will be NULL, and we'll need to do more work on this to really add tracing for the MLO case here. Drop the BSS elements for now as they're not the most useful thing, and it's hard to size things correctly for the MLO case (without adding a lot of code that's also executed when tracing isn't enabled.) Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: make cfg80211_auth_request::key_idx signedJohannes Berg2022-07-151-1/+2
| | | | | | | | | | | We might assign -1 to it in some cases when key is NULL, which means the key_idx isn't used but can lead to a warning from static checkers such as smatch. Make the struct member signed simply to avoid that, we only need a range of -1..3 anyway. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: nl80211: enable setting the link address at new stationShaul Triebitz2022-07-151-1/+19
| | | | | | | | | | | Since for an MLD station the default link is added together with the add station command, allow also setting the link MAC address. Otherwise, it is needed to use the modify link API only for setting the link MAC address. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: RCU-ify link/link_conf pointersJohannes Berg2022-07-1522-275/+420
| | | | | | | | | | Since links can be added and removed dynamically, we need to somehow protect the sdata->link[] and vif->link_conf[] array pointers from disappearing when accessing them without locks. RCU-ify the pointers to achieve this, which requires quite a bit of rework. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: nl80211: hold wdev mutex for station APIsJohannes Berg2022-07-151-1/+10
| | | | | | | Since this will need to refer - at least in part - to the link stations of an MLD, hold the wdev mutex for driver convenience. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: nl80211: hold wdev mutex for channel switch APIsJohannes Berg2022-07-151-5/+16
| | | | | | | Since we deal with links in an MLD here, hold the wdev mutex now. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: nl80211: hold wdev mutex in add/mod/del link stationJohannes Berg2022-07-151-3/+13
| | | | | | | Since we deal with links, and that requires looking at wdev links, we should hold the wdev mutex for driver convenience. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: implement callbacks for <add/mod/del>_link_stationShaul Triebitz2022-07-153-0/+116
| | | | | | | | Implement callbacks for cfg80211 add_link_station, mod_link_station, and del_link_station API. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211/mac80211: separate link params from station paramsShaul Triebitz2022-07-156-152/+180
| | | | | | | | | | | Put the link_station_parameters structure in the station_parameters structure (and remove the station_parameters fields already existing in link_station_parameters). Now, for an MLD station, the default link is added together with the station. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: add API to add/modify/remove a link stationShaul Triebitz2022-07-155-8/+377
| | | | | | | Add an API for adding/modifying/removing a link of a station. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: add an ieee80211_get_link_sbandShaul Triebitz2022-07-151-0/+22
| | | | | | | Similar to ieee80211_get_sband but get the sband of the link_conf. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: Remove AP SMPS leftoversAndrei Otcheretianski2022-07-154-38/+0
| | | | | | | AP SMPS was removed and not needed anymore. Remove the leftovers. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: Allow MLO TX with link source addressAndrei Otcheretianski2022-07-151-1/+13
| | | | | | | | Management frames are transmitted from link address and not device address. Allow that. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: Consider MLO links in offchannel logicAndrei Otcheretianski2022-07-151-2/+16
| | | | | | | Check all the MLO links to decide whether offchannel TX is needed. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: rx: accept link-addressed framesJohannes Berg2022-07-152-8/+63
| | | | | | | | When checking whether or not to accept a frame in RX, take into account the configured link addresses. Also look up the link station correctly. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: consistently use sdata_dereference()Johannes Berg2022-07-152-14/+7
| | | | | | Instead of open-coding it, use sdata_dereference(). Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211_hwsim: Support link channel matching on rxAndrei Otcheretianski2022-07-151-6/+16
| | | | | | | Accept frames from all the links' channels. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>