aboutsummaryrefslogtreecommitdiff
path: root/net
AgeCommit message (Collapse)AuthorFilesLines
2022-07-15wifi: mac80211: skip rate statistics for MLD STAsJohannes Berg1-2/+4
For now, skip rate statistics here to avoid warnings in the called code, we'll need to adjust this to have all the statistics for link stations. Signed-off-by: Johannes Berg <[email protected]>
2022-07-15wifi: nl80211: set BSS to NULL if IS_ERR()Johannes Berg1-0/+1
If the BSS lookup returned an error, set it to NULL so we don't try to free it. Fixes: d648c23024bd ("wifi: nl80211: support MLO in auth/assoc") Signed-off-by: Johannes Berg <[email protected]>
2022-07-15wifi: nl80211: add EML/MLD capabilities to per-iftype capabilitiesJohannes Berg1-0/+9
We have the per-interface type capabilities, currently for extended capabilities, add the EML/MLD capabilities there to have this advertised by the driver. Signed-off-by: Johannes Berg <[email protected]>
2022-07-15wifi: nl80211: better validate link ID for stationsJohannes Berg1-9/+17
If we add a station on an MLD, we need a link ID to see where it lives (by default). Validate the link ID against the valid_links. Signed-off-by: Johannes Berg <[email protected]>
2022-07-15wifi: mac80211: fix link manipulationJohannes Berg1-18/+26
When we add non-deflink pointers, we need to remove the link[0] pointer to deflink in case link[0] is not valid afterwards. Also, we need to add that back when there are no more valid links. Reorg the code to fix that. Signed-off-by: Johannes Berg <[email protected]>
2022-07-15wifi: mac80211: tighten locking checkJohannes Berg1-3/+4
When we remove a link that doesn't have a channel context, we don't really need the local->mtx locking. Tighten the check here. Signed-off-by: Johannes Berg <[email protected]>
2022-07-15wifi: cfg80211: clean up links appropriatelyJohannes Berg4-10/+52
This was missing earlier, we need to remove links when interfaces are being destroyed, and we also need to stop (AP) operations when a link is being destroyed. Address these issues to remove many warnings that will otherwise appear in mac80211. Signed-off-by: Johannes Berg <[email protected]>
2022-07-15wifi: mac80211: consider EHT element size in assoc requestJohannes Berg1-0/+3
We need to consider the (maximum) size of the EHT element we'll add for the association request, otherwise we may run out of space. Fixes: 820acc810fb6 ("mac80211: Add EHT capabilities to association/probe request") Signed-off-by: Johannes Berg <[email protected]>
2022-07-15wifi: mac80211: mlme: simplify adding ht/vht/he/eht elementsJohannes Berg1-48/+31
The functions currently take a link and check data from it, but this needs to change for MLO. Simplify the prototypes by passing only the needed arguments. Remove the regulatory checks, the warnings shouldn't trigger, and haven't as far as I know. Signed-off-by: Johannes Berg <[email protected]>
2022-07-15wifi: mac80211: refactor adding custom elementsJohannes Berg1-87/+125
Rework the sorting of custom elements into the association request by moving the elements before HT/VHT/HE to each their own function. While at it, fix the placement of the ones that should be between VHT and HE. This doesn't fix the placement of elements that should be between HE and EHT yet, a similar change might be needed in the future. Signed-off-by: Johannes Berg <[email protected]>
2022-07-15wifi: mac80211: refactor adding rates to assoc requestJohannes Berg1-67/+74
There's some awkward code that really only exists because we want to optimize the allocation size, but that's not really all that necessary. Refactor the code that adds rates to the association request frame to have a separate function, removing the goto. Signed-off-by: Johannes Berg <[email protected]>
2022-07-15wifi: mac80211: use only channel width in ieee80211_parse_bitrates()Johannes Berg4-9/+16
For MLO, we may not have a full chandef here later, so change the API to pass only the width. Signed-off-by: Johannes Berg <[email protected]>
2022-07-15wifi: mac80211: remove redundant conditionJohannes Berg1-1/+1
Here, ext_capa is checked and can only be non-NULL if assoc_data->ie_len was set before, so the check here is redundant. Signed-off-by: Johannes Berg <[email protected]>
2022-07-15wifi: mac80211: don't set link address for stationJohannes Berg1-3/+0
We need to handle the link addresses for station differently, they will be determined by the association code, stored, and then applied when the links are actually created on success, cfg80211 will fill in the right addresses per the data we're sending back to it. Signed-off-by: Johannes Berg <[email protected]>
2022-07-15wifi: mac80211: fix multi-BSSID element parsingJohannes Berg10-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 <[email protected]>
2022-07-15wifi: mac80211: move tdls_chan_switch_prohibited to link dataJohannes Berg3-3/+4
This value should be per link, since a TDLS connection is only established on a given link. Signed-off-by: Johannes Berg <[email protected]>
2022-07-15wifi: mac80211: don't re-parse elems in ieee80211_assoc_success()Johannes Berg1-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 <[email protected]>
2022-07-15wifi: mac80211: replace link_id with link_conf in start/stop_ap()Gregory Greenman4-23/+25
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 <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2022-07-15wifi: mac80211: refactor elements parsing with parameter structJohannes Berg2-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 <[email protected]>
2022-07-15wifi: cfg80211: extend cfg80211_rx_assoc_resp() for MLOJohannes Berg3-31/+51
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 <[email protected]>
2022-07-15wifi: cfg80211: put cfg80211_rx_assoc_resp() arguments into a structJohannes Berg4-31/+34
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 <[email protected]>
2022-07-15wifi: cfg80211: adjust assoc comeback for MLOJohannes Berg3-9/+9
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 <[email protected]>
2022-07-15wifi: mac80211: mlme: unify assoc data event sendingJohannes Berg1-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 <[email protected]>
2022-07-15wifi: cfg80211: prepare association failure APIs for MLOJohannes Berg3-25/+58
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 <[email protected]>
2022-07-15wifi: cfg80211: remove BSS pointer from cfg80211_disassoc_requestJohannes Berg4-19/+10
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 <[email protected]>
2022-07-15wifi: mac80211: mlme: use correct link_staJohannes Berg1-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 <[email protected]>
2022-07-15wifi: mac80211: mlme: remove sta argument from ieee80211_config_bwJohannes Berg1-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 <[email protected]>
2022-07-15wifi: mac80211: mlme: use ieee80211_get_link_sband()Johannes Berg2-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 <[email protected]>
2022-07-15wifi: mac80211: split IEEE80211_STA_DISABLE_WMM to link dataJohannes Berg2-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 <[email protected]>
2022-07-15wifi: mac80211: mlme: first adjustments for MLOJohannes Berg3-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 <[email protected]>
2022-07-15wifi: mac80211: mlme: do IEEE80211_STA_RESET_SIGNAL_AVE per linkJohannes Berg2-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 <[email protected]>
2022-07-15wifi: mac80211: mlme: track AP (MLD) address separatelyJohannes Berg1-14/+16
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 <[email protected]>
2022-07-15wifi: mac80211: remove unused bssid variableJohannes Berg1-2/+0
This variable is only written to, remove it. Signed-off-by: Johannes Berg <[email protected]>
2022-07-15wifi: mac80211: change QoS settings API to take link into accountJohannes Berg10-50/+60
Take the link into account in the QoS settings (EDCA parameters) APIs. Signed-off-by: Johannes Berg <[email protected]>
2022-07-15wifi: mac80211: expect powersave handling in driver for MLOJohannes Berg2-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 <[email protected]>
2022-07-15wifi: mac80211: move ps setting to vif configJohannes Berg3-6/+6
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 <[email protected]>
2022-07-15wifi: mac80211: provide link ID in link_confJohannes Berg1-0/+1
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 <[email protected]>
2022-07-15wifi: mac80211: set up/tear down client vif links properlyJohannes Berg3-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 <[email protected]>
2022-07-15wifi: mac80211: move ieee80211_request_smps_mgd_workJohannes Berg3-13/+12
This function can be static. Signed-off-by: Johannes Berg <[email protected]>
2022-07-15wifi: nl80211: acquire wdev mutex for dump_surveyJohannes Berg1-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 <[email protected]>
2022-07-15wifi: mac80211: fix key lookupJohannes Berg1-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 <[email protected]>
2022-07-15wifi: mac80211: separate out connection downgrade flagsJohannes Berg7-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 <[email protected]>
2022-07-15wifi: mac80211: Align with Draft P802.11be_D1.5Ilan Peer3-31/+92
Align the mac80211 implementation with P802.11be_D1.5. Signed-off-by: Ilan Peer <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2022-07-15wifi: mac80211: skip powersave recalc if driver SUPPORTS_DYNAMIC_PSJohannes Berg1-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 <[email protected]>
2022-07-15wifi: mac80211: debug: omit link if non-MLO connectionJohannes Berg1-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 <[email protected]>
2022-07-15wifi: cfg80211: drop BSS elements from assoc trace for nowJohannes Berg2-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 <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2022-07-15wifi: nl80211: enable setting the link address at new stationShaul Triebitz1-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 <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2022-07-15wifi: mac80211: RCU-ify link/link_conf pointersJohannes Berg20-268/+407
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 <[email protected]>
2022-07-15wifi: nl80211: hold wdev mutex for station APIsJohannes Berg1-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 <[email protected]>
2022-07-15wifi: nl80211: hold wdev mutex for channel switch APIsJohannes Berg1-5/+16
Since we deal with links in an MLD here, hold the wdev mutex now. Signed-off-by: Johannes Berg <[email protected]>