Skip to content

Commit 79973d5

Browse files
benzeajmberg-intel
authored andcommitted
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 <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
1 parent ff32b45 commit 79973d5

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

net/mac80211/ieee80211_i.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2034,6 +2034,7 @@ void ieee80211_link_stop(struct ieee80211_link_data *link);
20342034
int ieee80211_vif_set_links(struct ieee80211_sub_if_data *sdata,
20352035
u16 new_links, u16 dormant_links);
20362036
void ieee80211_vif_clear_links(struct ieee80211_sub_if_data *sdata);
2037+
int __ieee80211_set_active_links(struct ieee80211_vif *vif, u16 active_links);
20372038

20382039
/* tx handling */
20392040
void ieee80211_clear_tx_pending(struct ieee80211_local *local);

net/mac80211/link.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,14 +447,14 @@ static int _ieee80211_set_active_links(struct ieee80211_sub_if_data *sdata,
447447
return 0;
448448
}
449449

450-
int ieee80211_set_active_links(struct ieee80211_vif *vif, u16 active_links)
450+
int __ieee80211_set_active_links(struct ieee80211_vif *vif, u16 active_links)
451451
{
452452
struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
453453
struct ieee80211_local *local = sdata->local;
454454
u16 old_active;
455455
int ret;
456456

457-
sdata_lock(sdata);
457+
sdata_assert_lock(sdata);
458458
mutex_lock(&local->sta_mtx);
459459
mutex_lock(&local->mtx);
460460
mutex_lock(&local->key_mtx);
@@ -476,6 +476,17 @@ int ieee80211_set_active_links(struct ieee80211_vif *vif, u16 active_links)
476476
mutex_unlock(&local->key_mtx);
477477
mutex_unlock(&local->mtx);
478478
mutex_unlock(&local->sta_mtx);
479+
480+
return ret;
481+
}
482+
483+
int ieee80211_set_active_links(struct ieee80211_vif *vif, u16 active_links)
484+
{
485+
struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
486+
int ret;
487+
488+
sdata_lock(sdata);
489+
ret = __ieee80211_set_active_links(vif, active_links);
479490
sdata_unlock(sdata);
480491

481492
return ret;

0 commit comments

Comments
 (0)