diff options
-rw-r--r-- | drivers/net/wireless/wl12xx/cmd.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/scan.c | 20 |
2 files changed, 15 insertions, 6 deletions
diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c index 97ffd7aa57a8..f0aa7ab97bf7 100644 --- a/drivers/net/wireless/wl12xx/cmd.c +++ b/drivers/net/wireless/wl12xx/cmd.c | |||
@@ -63,6 +63,7 @@ int wl1271_cmd_send(struct wl1271 *wl, u16 id, void *buf, size_t len, | |||
63 | cmd->status = 0; | 63 | cmd->status = 0; |
64 | 64 | ||
65 | WARN_ON(len % 4 != 0); | 65 | WARN_ON(len % 4 != 0); |
66 | WARN_ON(test_bit(WL1271_FLAG_IN_ELP, &wl->flags)); | ||
66 | 67 | ||
67 | wl1271_write(wl, wl->cmd_box_addr, buf, len, false); | 68 | wl1271_write(wl, wl->cmd_box_addr, buf, len, false); |
68 | 69 | ||
diff --git a/drivers/net/wireless/wl12xx/scan.c b/drivers/net/wireless/wl12xx/scan.c index 6f897b9d90ca..420653a2859c 100644 --- a/drivers/net/wireless/wl12xx/scan.c +++ b/drivers/net/wireless/wl12xx/scan.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "cmd.h" | 27 | #include "cmd.h" |
28 | #include "scan.h" | 28 | #include "scan.h" |
29 | #include "acx.h" | 29 | #include "acx.h" |
30 | #include "ps.h" | ||
30 | 31 | ||
31 | void wl1271_scan_complete_work(struct work_struct *work) | 32 | void wl1271_scan_complete_work(struct work_struct *work) |
32 | { | 33 | { |
@@ -40,10 +41,11 @@ void wl1271_scan_complete_work(struct work_struct *work) | |||
40 | 41 | ||
41 | mutex_lock(&wl->mutex); | 42 | mutex_lock(&wl->mutex); |
42 | 43 | ||
43 | if (wl->scan.state == WL1271_SCAN_STATE_IDLE) { | 44 | if (wl->state == WL1271_STATE_OFF) |
44 | mutex_unlock(&wl->mutex); | 45 | goto out; |
45 | return; | 46 | |
46 | } | 47 | if (wl->scan.state == WL1271_SCAN_STATE_IDLE) |
48 | goto out; | ||
47 | 49 | ||
48 | wl->scan.state = WL1271_SCAN_STATE_IDLE; | 50 | wl->scan.state = WL1271_SCAN_STATE_IDLE; |
49 | kfree(wl->scan.scanned_ch); | 51 | kfree(wl->scan.scanned_ch); |
@@ -52,13 +54,19 @@ void wl1271_scan_complete_work(struct work_struct *work) | |||
52 | ieee80211_scan_completed(wl->hw, false); | 54 | ieee80211_scan_completed(wl->hw, false); |
53 | 55 | ||
54 | /* restore hardware connection monitoring template */ | 56 | /* restore hardware connection monitoring template */ |
55 | if (test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags)) | 57 | if (test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags)) { |
56 | wl1271_cmd_build_ap_probe_req(wl, wl->probereq); | 58 | if (wl1271_ps_elp_wakeup(wl) == 0) { |
59 | wl1271_cmd_build_ap_probe_req(wl, wl->probereq); | ||
60 | wl1271_ps_elp_sleep(wl); | ||
61 | } | ||
62 | } | ||
57 | 63 | ||
58 | if (wl->scan.failed) { | 64 | if (wl->scan.failed) { |
59 | wl1271_info("Scan completed due to error."); | 65 | wl1271_info("Scan completed due to error."); |
60 | ieee80211_queue_work(wl->hw, &wl->recovery_work); | 66 | ieee80211_queue_work(wl->hw, &wl->recovery_work); |
61 | } | 67 | } |
68 | |||
69 | out: | ||
62 | mutex_unlock(&wl->mutex); | 70 | mutex_unlock(&wl->mutex); |
63 | 71 | ||
64 | } | 72 | } |