summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/wl12xx/scan.c
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2011-08-14 14:17:26 +0400
committerLuciano Coelho <coelho@ti.com>2011-08-22 13:35:28 +0400
commit227e81e18422851901b9de11c5955d292c4a47fc (patch)
tree4c390ca1e95662fd77ee612125faa6e0f2e3e0af /drivers/net/wireless/wl12xx/scan.c
parent31cd3aed29ca7ebcdaa2570a891a3fab75fe35f6 (diff)
downloadlinux-227e81e18422851901b9de11c5955d292c4a47fc.tar.xz
wl12xx: support IBSS vif type
Start IBSS role when the interface type is IBSS. As with sta role, use the dev role until the role is started. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/scan.c')
-rw-r--r--drivers/net/wireless/wl12xx/scan.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/wireless/wl12xx/scan.c b/drivers/net/wireless/wl12xx/scan.c
index 653091a38dce..7229eaa89018 100644
--- a/drivers/net/wireless/wl12xx/scan.c
+++ b/drivers/net/wireless/wl12xx/scan.c
@@ -34,6 +34,7 @@ void wl1271_scan_complete_work(struct work_struct *work)
struct delayed_work *dwork;
struct wl1271 *wl;
int ret;
+ bool is_sta, is_ibss;
dwork = container_of(work, struct delayed_work, work);
wl = container_of(dwork, struct wl1271, scan_complete_work);
@@ -59,7 +60,13 @@ void wl1271_scan_complete_work(struct work_struct *work)
if (test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags)) {
/* restore hardware connection monitoring template */
wl1271_cmd_build_ap_probe_req(wl, wl->probereq);
- } else {
+ }
+
+ /* return to ROC if needed */
+ is_sta = (wl->bss_type == BSS_TYPE_STA_BSS);
+ is_ibss = (wl->bss_type == BSS_TYPE_IBSS);
+ if ((is_sta && !test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags)) ||
+ (is_ibss && !test_bit(WL1271_FLAG_IBSS_JOINED, &wl->flags))) {
/* restore remain on channel */
wl12xx_cmd_role_start_dev(wl);
wl12xx_roc(wl, wl->dev_role_id);