forked from Minki/linux
wl12xx: remove unneeded locking
With the scan callback now being callable from any context, these unlocks/locks can go away. This makes the code easier to understand, since callers of these functions must no longer be aware that the mutex may be dropped. As Stanislaw is working on iwlwifi scanning, I didn't change it to take advantage of the new mac80211 semantics. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
8789d459bc
commit
0ec2f2724d
@ -34,9 +34,7 @@ static int wl1251_event_scan_complete(struct wl1251 *wl,
|
|||||||
mbox->scheduled_scan_channels);
|
mbox->scheduled_scan_channels);
|
||||||
|
|
||||||
if (wl->scanning) {
|
if (wl->scanning) {
|
||||||
mutex_unlock(&wl->mutex);
|
|
||||||
ieee80211_scan_completed(wl->hw, false);
|
ieee80211_scan_completed(wl->hw, false);
|
||||||
mutex_lock(&wl->mutex);
|
|
||||||
wl1251_debug(DEBUG_MAC80211, "mac80211 hw scan completed");
|
wl1251_debug(DEBUG_MAC80211, "mac80211 hw scan completed");
|
||||||
wl->scanning = false;
|
wl->scanning = false;
|
||||||
}
|
}
|
||||||
|
@ -467,9 +467,7 @@ static void wl1251_op_stop(struct ieee80211_hw *hw)
|
|||||||
WARN_ON(wl->state != WL1251_STATE_ON);
|
WARN_ON(wl->state != WL1251_STATE_ON);
|
||||||
|
|
||||||
if (wl->scanning) {
|
if (wl->scanning) {
|
||||||
mutex_unlock(&wl->mutex);
|
|
||||||
ieee80211_scan_completed(wl->hw, true);
|
ieee80211_scan_completed(wl->hw, true);
|
||||||
mutex_lock(&wl->mutex);
|
|
||||||
wl->scanning = false;
|
wl->scanning = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -948,9 +948,7 @@ static void wl1271_op_remove_interface(struct ieee80211_hw *hw,
|
|||||||
ieee80211_enable_dyn_ps(wl->vif);
|
ieee80211_enable_dyn_ps(wl->vif);
|
||||||
|
|
||||||
if (wl->scan.state != WL1271_SCAN_STATE_IDLE) {
|
if (wl->scan.state != WL1271_SCAN_STATE_IDLE) {
|
||||||
mutex_unlock(&wl->mutex);
|
|
||||||
ieee80211_scan_completed(wl->hw, true);
|
ieee80211_scan_completed(wl->hw, true);
|
||||||
mutex_lock(&wl->mutex);
|
|
||||||
wl->scan.state = WL1271_SCAN_STATE_IDLE;
|
wl->scan.state = WL1271_SCAN_STATE_IDLE;
|
||||||
kfree(wl->scan.scanned_ch);
|
kfree(wl->scan.scanned_ch);
|
||||||
wl->scan.scanned_ch = NULL;
|
wl->scan.scanned_ch = NULL;
|
||||||
|
@ -215,9 +215,7 @@ void wl1271_scan_stm(struct wl1271 *wl)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case WL1271_SCAN_STATE_DONE:
|
case WL1271_SCAN_STATE_DONE:
|
||||||
mutex_unlock(&wl->mutex);
|
|
||||||
ieee80211_scan_completed(wl->hw, false);
|
ieee80211_scan_completed(wl->hw, false);
|
||||||
mutex_lock(&wl->mutex);
|
|
||||||
|
|
||||||
kfree(wl->scan.scanned_ch);
|
kfree(wl->scan.scanned_ch);
|
||||||
wl->scan.scanned_ch = NULL;
|
wl->scan.scanned_ch = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user