diff options
author | Benjamin Berg <benjamin.berg@intel.com> | 2023-05-11 13:13:21 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2023-06-19 13:11:35 +0200 |
commit | 79973d5cfdc15134d08036796a372d7ec8a1d51e (patch) | |
tree | 5e54f70b9975b209952142e2d9dc316b88885727 /net/mac80211/link.c | |
parent | ff32b4506f3ef2228aab601f6d4b37840d05ffaf (diff) |
wifi: mac80211: add set_active_links variant not locking sdata
There are cases where keeping sdata locked for an operation. Add a
variant that does not take sdata lock to permit these usecases.
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/link.c')
-rw-r--r-- | net/mac80211/link.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/net/mac80211/link.c b/net/mac80211/link.c index d090ecc41ea2..6148208b320e 100644 --- a/net/mac80211/link.c +++ b/net/mac80211/link.c @@ -447,14 +447,14 @@ static int _ieee80211_set_active_links(struct ieee80211_sub_if_data *sdata, return 0; } -int ieee80211_set_active_links(struct ieee80211_vif *vif, u16 active_links) +int __ieee80211_set_active_links(struct ieee80211_vif *vif, u16 active_links) { struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); struct ieee80211_local *local = sdata->local; u16 old_active; int ret; - sdata_lock(sdata); + sdata_assert_lock(sdata); mutex_lock(&local->sta_mtx); mutex_lock(&local->mtx); mutex_lock(&local->key_mtx); @@ -476,6 +476,17 @@ int ieee80211_set_active_links(struct ieee80211_vif *vif, u16 active_links) mutex_unlock(&local->key_mtx); mutex_unlock(&local->mtx); mutex_unlock(&local->sta_mtx); + + return ret; +} + +int ieee80211_set_active_links(struct ieee80211_vif *vif, u16 active_links) +{ + struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); + int ret; + + sdata_lock(sdata); + ret = __ieee80211_set_active_links(vif, active_links); sdata_unlock(sdata); return ret; |