summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* wifi: iwlwifi: don't use an uninitialized variableMiri Korenblit2023-09-111-3/+0
| | | | | | | | | | | | | | Don't use variable err uninitialized. The reason for removing the check instead of initializing it in the beginning of the function is because that way static checkers will be able to catch issues if we do something wrong in the future. Fixes: bf976c814c86 ("wifi: iwlwifi: mvm: implement link change ops") 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/20230830112059.431b01bd8779.I31fc4ab35f551b85a10f974a6b18fc30191e9c35@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: iwlwifi: fix some kernel-doc issuesJohannes Berg2023-09-119-27/+24
| | | | | | | | | Fix kernel-doc issues. 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.2edc4d82f717.Ic7c6f1153939903b067062c9aec8fb70e0a2c30d@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: iwlwifi: honor the enable_ini valueEmmanuel Grumbach2023-09-114-36/+25
| | | | | | | | | | | | | | | In case the user sets the enable_ini to some preset, we want to honor the value. Remove the ops to set the value of the module parameter is runtime, we don't want to allow to modify the value in runtime since we configure the firmware once at the beginning on its life. Fixes: b49c2b252b58 ("iwlwifi: Configure FW debug preset via module param.") Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230830112059.5734e0f374bb.I6698eda8ed2112378dd47ac5d62866ebe7a94f77@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: iwlwifi: mvm: disconnect long CSA only w/o alternativeJohannes Berg2023-09-111-1/+2
| | | | | | | | | | | | If there's an alternative link to use while the CSA is in progress, there's no need to disconnect since another link is still usable during the switching time. Change the code here to handle that accordingly. 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.dd1b96a37e51.Idafdcbfcb36ca4c486f4221aef77643869331514@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: iwlwifi: mvm: increase session protection after CSAJohannes Berg2023-09-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the spec, CSA is defined roughly as follows: - TBTT x: beacon with CSA, count=n (old channel) - TBTT x+1: beacon with CSA, count=n-1 (old channel) - TBTT x+n-1: beacon with CSA, count=1 (old channel) "A Channel Switch Count field set to 1 indicates that the switch occurs immediately before the next TBTT. - TBTT x+n: beacon without CSA (new channel) When we detect it, we currently schedule the CSA event to be at 10 TUs before TBTT x+n-1, for a beacon interval, to give us quiet time. When this event *starts*, we currently notify mac80211 that the channel switch happened, which causes us to add a session protection event to listen for the first beacon (and enable TX etc. when that arrives). We don't even ask for a notification when this event ends so the code that handles that is effectively dead code. The session protection duration is 3 beacon intervals, scheduled at 10 TU before TBTT x+n-1. It will thus end just before TBTT x+n+2. Unfortunately, if the AP doesn't transmit or we miss just the first two beacons on the new channel, then this will cause us to disconnect. Or even just one, if the AP isn't quite aligned with the TBTT after the switch. However, listening to the _end_ of the time event isn't what we want either, because we want all the new PHY and other config that needs to come from mac80211 to start early, so we have a head-start for the new channel, since we're not going to use the old one anyway for this time. So since we don't really have anything better to do at this time, and this is relatively rare, just make the session protection use 5x the beacon interval instead of just 3x, so it's more likely we catch a beacon even if the AP neglected to send it, or we just miss it. 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.a74176bac37c.I029a2ebcd1b5012327c728ffa1d33fac19cfdf4b@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: iwlwifi: mvm: support CSA with MLDEmmanuel Grumbach2023-09-112-3/+6
| | | | | | | | | | | Pass the right link_id to ieee80211_chswitch_done. Use the link_conf parameter passed to post_channel_switch() to get the right ap_sta_id. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230830112059.19470584fa51.Iad38b5369bededaa126b3eb3cff79f23d61bd783@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: fix channel switch link dataJohannes Berg2023-09-112-5/+7
| | | | | | | | | | Use the correct link ID and per-link puncturing data instead of hardcoding link ID 0 and using deflink puncturing. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230827135854.0b6a211c8e75.I5724d32bb2dae440888efbc47334d8c115db9d50@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: Do not force off-channel for management Tx with MLOIlan Peer2023-09-111-1/+6
| | | | | | | | | | | | When user space transmits a management frame it is expected to use the MLD addresses if the connection is an MLD one. Thus, in case the management Tx is using the MLD address and no channel is configured off-channel should not be used (as one of the active links would be used). Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230827135854.73c8efce252f.Ie4b0a842debb24ef25c5e6cb2ad69b9f46bc4b2a@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: take MBSSID/EHT data also from probe respJohannes Berg2023-09-111-10/+15
| | | | | | | | | | | | | | | | | | | | The code that sets up the assoc link will currently take the BSS element data from the beacon only. This is correct for some of the data, notably the timing and the "have_beacon", but all the data about MBSSID and EHT really doesn't need to be taken from there, and if the EHT puncturing is misconfigured on the AP but we didn't receive a beacon yet, this causes us to connect but immediately disconnect upon receiving the first beacon, rather than connecting without EHT in the first place. Change the code to take MBSSID and EHT data also from the probe response, for a better picture of what the BSS capabilities are and to avoid that EHT puncturing problem. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230827135854.3c7e52d49482.Iba6b672f6dc74b45bba26bc497e953e27da43ef9@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: Print local link address during authenticationIlan Peer2023-09-111-2/+14
| | | | | | | | | To ease debugging, mostly in cases that authentication fails. Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230827135854.9c08605e2691.I0032e9d6e01325862189e4a20b02ddbe8f2f5e75@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: fix # of MSDU in A-MSDU calculationJohannes Berg2023-09-111-1/+1
| | | | | | | | | | | | During my refactoring I wanted to get rid of the switch, but replaced it with the wrong calculation. Fix that. Fixes: 175ad2ec89fe ("wifi: mac80211: limit A-MSDU subframes for client too") Reported-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230827135854.51bf1b8b0adb.Iffbd337fdad2b86ae12f5a39c69fb82b517f7486@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211_hwsim: clean up kernel-docJohannes Berg2023-09-111-10/+9
| | | | | | | | | Clean up kernel-doc in hwsim's header file. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230827135854.6127359dba54.I8a9ab3d5fc0c0041624b96ab7350097f3f60fbe0@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: reg: fix various kernel-doc issuesJohannes Berg2023-09-111-8/+8
| | | | | | | | | Clean up the kernel-doc comments in reg.h. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230827135854.36d7b52da0f5.I85fbfb3095613f4a0512493cbbdda881dc31be2c@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: fix various kernel-doc issuesJohannes Berg2023-09-112-10/+12
| | | | | | | | | There are various kernel-doc issues here, fix them. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230827135854.7ce9761f9ebb.I0f44e76c518f72135cc855c809bfa7a5e977b894@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: remove unnecessary struct forward declarationJohannes Berg2023-09-111-1/+0
| | | | | | | | | | This just causes kernel-doc to complain at this spot, but isn't actually needed anyway, so remove it. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230827135854.33a5591dfdeb.If4e7e1a1cb4c04f0afd83db7401c780404dca699@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: add more warnings about inserting sta infoBenjamin Berg2023-09-111-2/+6
| | | | | | | | | | The sta info needs to be inserted before its links may be modified. Add a few warnings to prevent accidental usage of these functions. Signed-off-by: Benjamin Berg <benjamin.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230827135854.eeb43b3cc9e3.I5fd8236f70e64bf6268f33c883f7a878d963b83e@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: add ieee80211_fragment_element to public APIBenjamin Berg2023-09-114-31/+41
| | | | | | | | | | This function will be used by the kunit tests within cfg80211. As it is generally useful, move it from mac80211 to cfg80211. Signed-off-by: Benjamin Berg <benjamin.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230827135854.5af9391659f5.Ie534ed6591ba02be8572d4d7242394f29e3af04b@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: add an element parsing unit testJohannes Berg2023-09-116-0/+130
| | | | | | | | | | Add a unit test for the parsing of a fragmented sta profile sub-element inside a fragmented multi-link element. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230827135854.333bc75df13f.I0ddfeb6a88a4d89e7c7850e8ef45a4b19b5a061a@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: add first kunit tests, for element defragJohannes Berg2023-09-115-0/+182
| | | | | | | | | | Add a couple of tests for element defragmentation, to see that the function works correctly. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230827135854.e2a5cead1816.I09f0edc19d162b54ee330991c728c1e9aa42ebf6@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: fix off-by-one in element defragJohannes Berg2023-09-111-2/+2
| | | | | | | | | | | If a fragment is the last element, it's erroneously not accepted. Fix that. Fixes: f837a653a097 ("wifi: cfg80211: add element defragmentation helper") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230827135854.adca9fbd3317.I6b2df45eb71513f3e48efd196ae3cddec362dc1c@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: add support for mld in ieee80211_chswitch_doneEmmanuel Grumbach2023-09-1114-49/+73
| | | | | | | | | | | | This allows to finalize the CSA per link. In case the switch didn't work, tear down the MLD connection. Also pass the ieee80211_bss_conf to post_channel_switch to let the driver know which link completed the switch. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230828130311.3d3eacc88436.Ic2d14e2285aa1646216a56806cfd4a8d0054437c@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: fix RCU usage warning in mesh fast-xmitJohannes Berg2023-09-111-1/+1
| | | | | | | | | | In mesh_fast_tx_flush_addr() we already hold the lock, so don't need additional hashtable RCU protection. Use the rhashtable_lookup_fast() variant to avoid RCU protection warnings. Fixes: d5edb9ae8d56 ("wifi: mac80211: mesh fast xmit support") Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: annotate iftype_data pointer with sparseJohannes Berg2023-09-1116-79/+112
| | | | | | | | | | | | | | | | There were are a number of cases in mac80211 and iwlwifi (at least) that used the sband->iftype_data pointer directly, instead of using the accessors to find the right array entry to use. Make sparse warn when such a thing is done. To not have a lot of casts, add two helper functions/macros - ieee80211_set_sband_iftype_data() - for_each_sband_iftype_data() Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: fix BA session teardown raceJohannes Berg2023-09-113-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | As previously reported by Alexander, whose commit 69403bad97aa ("wifi: mac80211: sdata can be NULL during AMPDU start") I'm reverting as part of this commit, there's a race between station destruction and aggregation setup, where the aggregation setup can happen while the station is being removed and queue the work after ieee80211_sta_tear_down_BA_sessions() has already run in __sta_info_destroy_part1(), and thus the worker will run with a now freed station. In his case, this manifested in a NULL sdata pointer, but really there's no guarantee whatsoever. The real issue seems to be that it's possible at all to have a situation where this occurs - we want to stop the BA sessions when doing _part1, but we cannot be sure, and WLAN_STA_BLOCK_BA isn't necessarily effective since we don't know that the setup isn't concurrently running and already got past the check. Simply call ieee80211_sta_tear_down_BA_sessions() again in the second part of station destruction, since at that point really nothing else can hold a reference to the station any more. Also revert the sdata checks since those are just misleading at this point. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211_hwsim: fix clang-specific fortify warningDmitry Antipov2023-09-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When compiling with clang 16.0.6 and CONFIG_FORTIFY_SOURCE=y, I've noticed the following (somewhat confusing due to absence of an actual source code location): In file included from drivers/net/wireless/virtual/mac80211_hwsim.c:18: In file included from ./include/linux/slab.h:16: In file included from ./include/linux/gfp.h:7: In file included from ./include/linux/mmzone.h:8: In file included from ./include/linux/spinlock.h:56: In file included from ./include/linux/preempt.h:79: In file included from ./arch/x86/include/asm/preempt.h:9: In file included from ./include/linux/thread_info.h:60: In file included from ./arch/x86/include/asm/thread_info.h:53: In file included from ./arch/x86/include/asm/cpufeature.h:5: In file included from ./arch/x86/include/asm/processor.h:23: In file included from ./arch/x86/include/asm/msr.h:11: In file included from ./arch/x86/include/asm/cpumask.h:5: In file included from ./include/linux/cpumask.h:12: In file included from ./include/linux/bitmap.h:11: In file included from ./include/linux/string.h:254: ./include/linux/fortify-string.h:592:4: warning: call to '__read_overflow2_field' declared with 'warning' attribute: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Wattribute-warning] __read_overflow2_field(q_size_field, size); The compiler actually complains on 'mac80211_hwsim_get_et_strings()' where fortification logic inteprets call to 'memcpy()' as an attempt to copy the whole 'mac80211_hwsim_gstrings_stats' array from its first member and so issues an overread warning. This warning may be silenced by passing an address of the whole array and not the first member to 'memcpy()'. Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Link: https://lore.kernel.org/r/20230829094140.234636-1-dmantipov@yandex.ru Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: fix TXQ error path and cleanupJohannes Berg2023-09-112-2/+3
| | | | | | | | | | We currently call ieee80211_txq_teardown_flows() as part of ieee80211_remove_interfaces(), but that's not really right in case of HW registration failures, specifically rate control. Call it separately to fix that issue. Reported-by: Zhengchao Shao <shaozhengchao@huawei.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: Use flexible array in struct ieee80211_tim_ieJeff Johnson2023-09-111-3/+10
| | | | | | | | | | | | | | | | | | | | | | Currently struct ieee80211_tim_ie defines: u8 virtual_map[1]; Per the guidance in [1] change this to be a flexible array. Per the discussion in [2] wrap the virtual_map in a union with a u8 item in order to preserve the existing expectation that the virtual_map must contain at least one octet (at least when used in a non-S1G PPDU). This means that no driver changes are required. [1] https://docs.kernel.org/process/deprecated.html#zero-length-and-one-element-arrays [2] https://lore.kernel.org/linux-wireless/202308301529.AC90A9EF98@keescook/ Suggested-by: Kees Cook <keescook@chromium.org> Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com> Reviewed-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20230831-ieee80211_tim_ie-v3-2-e10ff584ab5d@quicinc.com [add wifi prefix] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: remove wdev mutexJohannes Berg2023-09-1135-974/+300
| | | | | | | | | Since we're now protecting everything with the wiphy mutex (and were really using it for almost everything before), there's no longer any real reason to have a separate wdev mutex. It may feel better, but really has no value. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: set wiphy for virtual monitorsJohannes Berg2023-09-111-0/+1
| | | | | | | Drivers might plausibly want to have this, but also the locking assertions will need it later. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: reduce iflist_mtxJohannes Berg2023-09-117-42/+29
| | | | | | | | | | | | | | | | We now hold the wiphy mutex everywhere that we use or needed the iflist_mtx, so we don't need this mutex any more in mac80211. However, drivers may also iterate, and in some cases (e.g. mt76) do so from high-priority contexts. Thus, keep the mutex around but remove its usage in mac80211 apart from those driver-visible parts that are still needed. Most of this change was done automatically with spatch, with the parts that are still needed as described above reverted manually. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: remove local->mtxJohannes Berg2023-09-1114-269/+135
| | | | | | | | | | We now hold the wiphy mutex everywhere that we use or needed the local->mtx, so we don't need this mutex any more. Remove it. Most of this change was done automatically with spatch. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: remove ampdu_mlme.mtxJohannes Berg2023-09-117-117/+60
| | | | | | | | | | We now hold the wiphy mutex everywhere that we use or needed the A-MPDU locking, so we don't need this mutex any more. Remove it. Most of this change was done automatically with spatch. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: remove chanctx_mtxJohannes Berg2023-09-119-142/+113
| | | | | | | | | | We now hold the wiphy mutex everywhere that we use or needed the chanctx_mtx, so we don't need this mutex any more. Remove it. Most of this change was done automatically with spatch. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: remove key_mtxJohannes Berg2023-09-119-132/+90
| | | | | | | | | | We now hold the wiphy mutex everywhere that we use or needed the key_mtx, so we don't need this mutex any more. Remove it. Most of this change was done automatically with spatch. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: remove sta_mtxJohannes Berg2023-09-1118-214/+112
| | | | | | | | | | We now hold the wiphy mutex everywhere that we use or needed the sta_mtx, so we don't need this mutex any more. Remove it. Most of this change was done automatically with spatch. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: take wiphy lock for MAC addr changeJohannes Berg2023-09-111-3/+16
| | | | | | | We want to ensure everything holds the wiphy lock, so also extend that to the MAC change callback. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: extend wiphy lock in interface removalJohannes Berg2023-09-111-1/+2
| | | | | | | We want to extend the wiphy locking to the interface list, so move that into the section locked with the wiphy lock. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: hold wiphy_lock around concurrency checksJohannes Berg2023-09-111-2/+3
| | | | | | | | We want to replace the locking in mac80211 by just the wiphy mutex, so hold the lock here around concurrency checks for the future where the chanctx_mtx used inside goes away. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: ethtool: hold wiphy mutexJohannes Berg2023-09-111-2/+6
| | | | | | | We should hold the wiphy mutex here since we're going to call the driver and want to remove the sta_mtx. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: check wiphy mutex is held for wdev mutexJohannes Berg2023-09-111-1/+7
| | | | | | | | This might seem pretty pointless rather than changing the locking immediately, but it seems safer to run for a while with checks and the old locking scheme, and then remove the wdev lock later. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: hold wiphy lock in cfg80211_any_wiphy_oper_chan()Johannes Berg2023-09-111-3/+7
| | | | | | | | | | We have the RTNL here for the iteration, but we need to lock each wiphy separately as well for using its data. Hold the wiphy lock for all of the ones in the iteration. Note that this implies we cannot already hold the wiphy mutex for the wiphy passed by the argument, but that's true now. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: sme: hold wiphy lock for wdev iterationJohannes Berg2023-09-111-0/+2
| | | | | | | | | Since we will want to remove the wdev lock in the future, lock the wiphy here to iterate and for checking the status of the connections. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: reg: hold wiphy mutex for wdev iterationJohannes Berg2023-09-111-0/+3
| | | | | | | | Since we will want to remove the wdev lock in the future, lock the wiphy here to iterate and check the flags. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: check wiphy mutex in opsJohannes Berg2023-09-112-0/+95
| | | | | | | | | Check that we hold the wiphy mutex in the ops when calling the driver, since we're now on our way to always hold it, and simplify the locking. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: move color change finalize to wiphy workJohannes Berg2023-09-114-9/+11
| | | | | | | | Again this should be per link and will get cancellation issues, move it to a wiphy work. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: move CSA finalize to wiphy workJohannes Berg2023-09-115-11/+11
| | | | | | | | | This work should be made per link as well, and then will have cancellation issues. Moving it to a wiphy work already fixes those beforehand. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: move filter reconfig to wiphy workJohannes Berg2023-09-114-6/+7
| | | | | | | | | This again is intended for future cleanups that are possible when mac80211 and drivers can assume the wiphy is locked. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: move tspec work to wiphy workJohannes Berg2023-09-112-9/+14
| | | | | | | | One more work that will now execute with the wiphy locked, for future cleanups. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: move key tailroom work to wiphy workJohannes Berg2023-09-116-11/+17
| | | | | | | | This way we hold the wiphy mutex there, as a step towards removing some of the additional locks we have. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: move TDLS work to wiphy workJohannes Berg2023-09-113-10/+12
| | | | | | | Again, to have the wiphy locked for it. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>