summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1271_scan.c
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2010-08-24 06:28:03 +0300
committerLuciano Coelho <luciano.coelho@nokia.com>2010-09-28 12:30:03 +0300
commitc454f1d9a896d3519c756355b37bb39941093233 (patch)
treead8f35ca3813f2a2462587a746cbc7b9bfe78208 /drivers/net/wireless/wl12xx/wl1271_scan.c
parent9987a9da3eda093ceeff14ad4926adb130a0d0ea (diff)
downloadlinux-c454f1d9a896d3519c756355b37bb39941093233.tar.gz
linux-c454f1d9a896d3519c756355b37bb39941093233.tar.bz2
linux-c454f1d9a896d3519c756355b37bb39941093233.zip
wl1271: Move scan complete invocation into work function
The current scan implementation can jam, if the scan request ends up containing no work. This can especially happen if there is a scan request with only 11a band channels for HW that does not support 11a. Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_scan.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_scan.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_scan.c b/drivers/net/wireless/wl12xx/wl1271_scan.c
index 8d30150f3f46..9f1da82ed8d6 100644
--- a/drivers/net/wireless/wl12xx/wl1271_scan.c
+++ b/drivers/net/wireless/wl12xx/wl1271_scan.c
@@ -28,6 +28,23 @@
#include "wl1271_scan.h"
#include "wl1271_acx.h"
+void wl1271_scan_complete_work(struct work_struct *work)
+{
+ struct wl1271 *wl =
+ container_of(work, struct wl1271, scan_complete_work);
+
+ wl1271_debug(DEBUG_SCAN, "Scanning complete");
+
+ mutex_lock(&wl->mutex);
+ wl->scan.state = WL1271_SCAN_STATE_IDLE;
+ kfree(wl->scan.scanned_ch);
+ wl->scan.scanned_ch = NULL;
+ mutex_unlock(&wl->mutex);
+
+ ieee80211_scan_completed(wl->hw, false);
+}
+
+
static int wl1271_get_scan_channels(struct wl1271 *wl,
struct cfg80211_scan_request *req,
struct basic_scan_channel_params *channels,
@@ -218,11 +235,7 @@ void wl1271_scan_stm(struct wl1271 *wl)
break;
case WL1271_SCAN_STATE_DONE:
- kfree(wl->scan.scanned_ch);
- wl->scan.scanned_ch = NULL;
-
- wl->scan.state = WL1271_SCAN_STATE_IDLE;
- ieee80211_scan_completed(wl->hw, false);
+ ieee80211_queue_work(wl->hw, &wl->scan_complete_work);
break;
default: