Skip to content

Commit

Permalink
wl12xx: don't fail on AP scan
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eliad Peller authored and Luciano Coelho committed Feb 15, 2012
1 parent 79aba1b commit 35d7742
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions drivers/net/wireless/wl12xx/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 35d7742

Please sign in to comment.