diff options
author | Juuso Oikarinen <juuso.oikarinen@nokia.com> | 2010-09-21 00:23:30 -0400 |
---|---|---|
committer | Luciano Coelho <luciano.coelho@nokia.com> | 2010-09-28 05:30:04 -0400 |
commit | 52a2a37550b604b3c3c7a044ff72d85b60165659 (patch) | |
tree | d248ea1d162a78372881cde5f2c22c9eb5b9ee67 /drivers/net/wireless/wl12xx | |
parent | 8c7f4f3166e16bb350bfc53955ea6cf9bfd34aab (diff) |
wl1271: Separate interface removal to another function
Do this so the interface removal can be triggered from an upcoming hardware
failure recovery mechanism.
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_main.c | 17 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_scan.c | 6 |
2 files changed, 17 insertions, 6 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c index 9ab4fc4f7b4b..e7f096fb6212 100644 --- a/drivers/net/wireless/wl12xx/wl1271_main.c +++ b/drivers/net/wireless/wl12xx/wl1271_main.c | |||
@@ -960,15 +960,10 @@ out: | |||
960 | return ret; | 960 | return ret; |
961 | } | 961 | } |
962 | 962 | ||
963 | static void wl1271_op_remove_interface(struct ieee80211_hw *hw, | 963 | static void __wl1271_op_remove_interface(struct wl1271 *wl) |
964 | struct ieee80211_vif *vif) | ||
965 | { | 964 | { |
966 | struct wl1271 *wl = hw->priv; | ||
967 | int i; | 965 | int i; |
968 | 966 | ||
969 | cancel_work_sync(&wl->scan_complete_work); | ||
970 | |||
971 | mutex_lock(&wl->mutex); | ||
972 | wl1271_debug(DEBUG_MAC80211, "mac80211 remove interface"); | 967 | wl1271_debug(DEBUG_MAC80211, "mac80211 remove interface"); |
973 | 968 | ||
974 | wl1271_info("down"); | 969 | wl1271_info("down"); |
@@ -994,6 +989,7 @@ static void wl1271_op_remove_interface(struct ieee80211_hw *hw, | |||
994 | 989 | ||
995 | mutex_unlock(&wl->mutex); | 990 | mutex_unlock(&wl->mutex); |
996 | 991 | ||
992 | cancel_work_sync(&wl->scan_complete_work); | ||
997 | cancel_work_sync(&wl->irq_work); | 993 | cancel_work_sync(&wl->irq_work); |
998 | cancel_work_sync(&wl->tx_work); | 994 | cancel_work_sync(&wl->tx_work); |
999 | cancel_delayed_work_sync(&wl->pspoll_work); | 995 | cancel_delayed_work_sync(&wl->pspoll_work); |
@@ -1039,7 +1035,16 @@ static void wl1271_op_remove_interface(struct ieee80211_hw *hw, | |||
1039 | wl->tx_res_if = NULL; | 1035 | wl->tx_res_if = NULL; |
1040 | kfree(wl->target_mem_map); | 1036 | kfree(wl->target_mem_map); |
1041 | wl->target_mem_map = NULL; | 1037 | wl->target_mem_map = NULL; |
1038 | } | ||
1042 | 1039 | ||
1040 | static void wl1271_op_remove_interface(struct ieee80211_hw *hw, | ||
1041 | struct ieee80211_vif *vif) | ||
1042 | { | ||
1043 | struct wl1271 *wl = hw->priv; | ||
1044 | |||
1045 | mutex_lock(&wl->mutex); | ||
1046 | WARN_ON(wl->vif != vif); | ||
1047 | __wl1271_op_remove_interface(wl); | ||
1043 | mutex_unlock(&wl->mutex); | 1048 | mutex_unlock(&wl->mutex); |
1044 | } | 1049 | } |
1045 | 1050 | ||
diff --git a/drivers/net/wireless/wl12xx/wl1271_scan.c b/drivers/net/wireless/wl12xx/wl1271_scan.c index 9f1da82ed8d6..20caceba435e 100644 --- a/drivers/net/wireless/wl12xx/wl1271_scan.c +++ b/drivers/net/wireless/wl12xx/wl1271_scan.c | |||
@@ -36,6 +36,12 @@ void wl1271_scan_complete_work(struct work_struct *work) | |||
36 | wl1271_debug(DEBUG_SCAN, "Scanning complete"); | 36 | wl1271_debug(DEBUG_SCAN, "Scanning complete"); |
37 | 37 | ||
38 | mutex_lock(&wl->mutex); | 38 | mutex_lock(&wl->mutex); |
39 | |||
40 | if (wl->scan.state == WL1271_SCAN_STATE_IDLE) { | ||
41 | mutex_unlock(&wl->mutex); | ||
42 | return; | ||
43 | } | ||
44 | |||
39 | wl->scan.state = WL1271_SCAN_STATE_IDLE; | 45 | wl->scan.state = WL1271_SCAN_STATE_IDLE; |
40 | kfree(wl->scan.scanned_ch); | 46 | kfree(wl->scan.scanned_ch); |
41 | wl->scan.scanned_ch = NULL; | 47 | wl->scan.scanned_ch = NULL; |