Commit 536607c0 authored by Jérôme Pouiller's avatar Jérôme Pouiller Committed by Greg Kroah-Hartman

staging: wfx: simplify handling of tx_lock in wfx_do_join()

In the old days, wfx_do_join() could be called from different contexts.
Now that wfx_do_join() is called only from one place, it is cleaner to
keep lock and unlock of data inside the function.
Signed-off-by: default avatarJérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191217161318.31402-30-Jerome.Pouiller@silabs.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 07c11c18
...@@ -644,7 +644,6 @@ static void wfx_set_mfp(struct wfx_vif *wvif, ...@@ -644,7 +644,6 @@ static void wfx_set_mfp(struct wfx_vif *wvif,
hif_set_mfp(wvif, mfpc, mfpr); hif_set_mfp(wvif, mfpc, mfpr);
} }
/* MUST be called with tx_lock held! It will be unlocked for us. */
static void wfx_do_join(struct wfx_vif *wvif) static void wfx_do_join(struct wfx_vif *wvif)
{ {
const u8 *bssid; const u8 *bssid;
...@@ -659,6 +658,8 @@ static void wfx_do_join(struct wfx_vif *wvif) ...@@ -659,6 +658,8 @@ static void wfx_do_join(struct wfx_vif *wvif)
conf->basic_rates), conf->basic_rates),
}; };
wfx_tx_lock_flush(wvif->wdev);
if (wvif->channel->flags & IEEE80211_CHAN_NO_IR) if (wvif->channel->flags & IEEE80211_CHAN_NO_IR)
join.probe_for_join = 0; join.probe_for_join = 0;
...@@ -1180,10 +1181,8 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, ...@@ -1180,10 +1181,8 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw,
} }
mutex_unlock(&wdev->conf_mutex); mutex_unlock(&wdev->conf_mutex);
if (do_join) { if (do_join)
wfx_tx_lock_flush(wdev); wfx_do_join(wvif);
wfx_do_join(wvif); /* Will unlock it for us */
}
} }
static void wfx_ps_notify(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd, static void wfx_ps_notify(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd,
......
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