wlcore: always use wlvif->role_id for scans
authorEliad Peller <eliad@wizery.com>
Thu, 26 Jul 2012 14:17:05 +0000 (17:17 +0300)
committerLuciano Coelho <luca@coelho.fi>
Thu, 27 Sep 2012 09:13:52 +0000 (12:13 +0300)
enabled (but not-started) sta role should be good enough
for scanning (both normal and scheduled), so use it
instead of the device_role.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luca@coelho.fi>
drivers/net/wireless/ti/wlcore/scan.c

index bc924877ca4d9fac07b3f5e11dae8e2eca637cab..d00501493dfec06d9aa314c675e1834f12bb98d2 100644 (file)
@@ -184,11 +184,7 @@ static int wl1271_scan_send(struct wl1271 *wl, struct ieee80211_vif *vif,
        if (passive)
                scan_options |= WL1271_SCAN_OPT_PASSIVE;
 
-       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;
+       cmd->params.role_id = wlvif->role_id;
 
        if (WARN_ON(cmd->params.role_id == WL12XX_INVALID_ROLE_ID)) {
                ret = -EINVAL;
@@ -593,7 +589,7 @@ wl12xx_scan_sched_scan_ssid_list(struct wl1271 *wl,
                goto out;
        }
 
-       cmd->role_id = wlvif->dev_role_id;
+       cmd->role_id = wlvif->role_id;
        if (!n_match_ssids) {
                /* No filter, with ssids */
                type = SCAN_SSID_FILTER_DISABLED;
@@ -683,7 +679,7 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl,
        if (!cfg)
                return -ENOMEM;
 
-       cfg->role_id = wlvif->dev_role_id;
+       cfg->role_id = wlvif->role_id;
        cfg->rssi_threshold = c->rssi_threshold;
        cfg->snr_threshold  = c->snr_threshold;
        cfg->n_probe_reqs = c->num_probe_reqs;
@@ -718,7 +714,7 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl,
        if (!force_passive && cfg->active[0]) {
                u8 band = IEEE80211_BAND_2GHZ;
                ret = wl12xx_cmd_build_probe_req(wl, wlvif,
-                                                wlvif->dev_role_id, band,
+                                                wlvif->role_id, band,
                                                 req->ssids[0].ssid,
                                                 req->ssids[0].ssid_len,
                                                 ies->ie[band],
@@ -732,7 +728,7 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl,
        if (!force_passive && cfg->active[1]) {
                u8 band = IEEE80211_BAND_5GHZ;
                ret = wl12xx_cmd_build_probe_req(wl, wlvif,
-                                                wlvif->dev_role_id, band,
+                                                wlvif->role_id, band,
                                                 req->ssids[0].ssid,
                                                 req->ssids[0].ssid_len,
                                                 ies->ie[band],
@@ -774,7 +770,7 @@ int wl1271_scan_sched_scan_start(struct wl1271 *wl, struct wl12xx_vif *wlvif)
        if (!start)
                return -ENOMEM;
 
-       start->role_id = wlvif->dev_role_id;
+       start->role_id = wlvif->role_id;
        start->tag = WL1271_SCAN_DEFAULT_TAG;
 
        ret = wl1271_cmd_send(wl, CMD_START_PERIODIC_SCAN, start,
@@ -810,7 +806,7 @@ void wl1271_scan_sched_scan_stop(struct wl1271 *wl,  struct wl12xx_vif *wlvif)
                return;
        }
 
-       stop->role_id = wlvif->dev_role_id;
+       stop->role_id = wlvif->role_id;
        stop->tag = WL1271_SCAN_DEFAULT_TAG;
 
        ret = wl1271_cmd_send(wl, CMD_STOP_PERIODIC_SCAN, stop,