Commit ff32b450 authored by Benjamin Berg's avatar Benjamin Berg Committed by Johannes Berg

wifi: mac80211: add ___ieee80211_disconnect 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: default avatarBenjamin Berg <benjamin.berg@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 065563b2
...@@ -3353,18 +3353,15 @@ static void ieee80211_report_disconnect(struct ieee80211_sub_if_data *sdata, ...@@ -3353,18 +3353,15 @@ static void ieee80211_report_disconnect(struct ieee80211_sub_if_data *sdata,
drv_event_callback(sdata->local, sdata, &event); drv_event_callback(sdata->local, sdata, &event);
} }
static void __ieee80211_disconnect(struct ieee80211_sub_if_data *sdata) static void ___ieee80211_disconnect(struct ieee80211_sub_if_data *sdata)
{ {
struct ieee80211_local *local = sdata->local; struct ieee80211_local *local = sdata->local;
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
u8 frame_buf[IEEE80211_DEAUTH_FRAME_LEN]; u8 frame_buf[IEEE80211_DEAUTH_FRAME_LEN];
bool tx; bool tx;
sdata_lock(sdata); if (!ifmgd->associated)
if (!ifmgd->associated) {
sdata_unlock(sdata);
return; return;
}
/* in MLO assume we have a link where we can TX the frame */ /* in MLO assume we have a link where we can TX the frame */
tx = ieee80211_vif_is_mld(&sdata->vif) || tx = ieee80211_vif_is_mld(&sdata->vif) ||
...@@ -3413,7 +3410,12 @@ static void __ieee80211_disconnect(struct ieee80211_sub_if_data *sdata) ...@@ -3413,7 +3410,12 @@ static void __ieee80211_disconnect(struct ieee80211_sub_if_data *sdata)
WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY, WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY,
ifmgd->reconnect); ifmgd->reconnect);
ifmgd->reconnect = false; ifmgd->reconnect = false;
}
static void __ieee80211_disconnect(struct ieee80211_sub_if_data *sdata)
{
sdata_lock(sdata);
___ieee80211_disconnect(sdata);
sdata_unlock(sdata); sdata_unlock(sdata);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment