summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/wl12xx/scan.c
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2012-02-02 15:54:26 +0400
committerLuciano Coelho <coelho@ti.com>2012-02-15 10:38:35 +0400
commit35d7742ff31609d655f8f8b3f869647006a2ac26 (patch)
tree78ec277de371e877811c43436e44670485b9f2ca /drivers/net/wireless/wl12xx/scan.c
parent79aba1baf251e22fbc97a42c711c4b683807ac43 (diff)
downloadlinux-35d7742ff31609d655f8f8b3f869647006a2ac26.tar.xz
wl12xx: don't fail on AP scan
AP role uses its own role_id for scans, so there's no reason to fail the scan if dev_role_id is invalid. 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.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/wireless/wl12xx/scan.c b/drivers/net/wireless/wl12xx/scan.c
index 848a165fa55c..e3566ca90f0d 100644
--- a/drivers/net/wireless/wl12xx/scan.c
+++ b/drivers/net/wireless/wl12xx/scan.c
@@ -175,16 +175,17 @@ static int wl1271_scan_send(struct wl1271 *wl, struct ieee80211_vif *vif,
if (passive)
scan_options |= WL1271_SCAN_OPT_PASSIVE;
- if (WARN_ON(wlvif->role_id == WL12XX_INVALID_ROLE_ID ||
- wlvif->dev_role_id == WL12XX_INVALID_ROLE_ID)) {
- ret = -EINVAL;
- goto out;
- }
- if (test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags))
+ if (wlvif->bss_type == BSS_TYPE_AP_BSS ||
+ test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags))
cmd->params.role_id = wlvif->role_id;
else
cmd->params.role_id = wlvif->dev_role_id;
+ if (WARN_ON(cmd->params.role_id == WL12XX_INVALID_ROLE_ID)) {
+ ret = -EINVAL;
+ goto out;
+ }
+
cmd->params.scan_options = cpu_to_le16(scan_options);
cmd->params.n_ch = wl1271_get_scan_channels(wl, wl->scan.req,