diff options
author | Victor Goldenshtein <victorg@ti.com> | 2012-05-15 10:04:40 -0400 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2012-06-06 12:40:27 -0400 |
commit | 97511b15b1926337f90226b3cb735e52f2dc8a85 (patch) | |
tree | 5c38ec3a425fa0049b1044d22d57e108358ba841 /drivers | |
parent | 587cc286c8a8e22bbe4521c331b88d62d0cb1076 (diff) |
wlcore: set channels 12-14 as pactive for sched scan
Introduce “pactive” scan mode – which instructs the fw to
perform a passive scan until an activity/energy is detected
on these channels, once energy detected the channel becomes
active.
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ti/wlcore/scan.c | 39 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/scan.h | 7 |
2 files changed, 38 insertions, 8 deletions
diff --git a/drivers/net/wireless/ti/wlcore/scan.c b/drivers/net/wireless/ti/wlcore/scan.c index e1dbe812615f..d9daed53ceb7 100644 --- a/drivers/net/wireless/ti/wlcore/scan.c +++ b/drivers/net/wireless/ti/wlcore/scan.c | |||
@@ -411,7 +411,8 @@ wl1271_scan_get_sched_scan_channels(struct wl1271 *wl, | |||
411 | struct cfg80211_sched_scan_request *req, | 411 | struct cfg80211_sched_scan_request *req, |
412 | struct conn_scan_ch_params *channels, | 412 | struct conn_scan_ch_params *channels, |
413 | u32 band, bool radar, bool passive, | 413 | u32 band, bool radar, bool passive, |
414 | int start, int max_channels) | 414 | int start, int max_channels, |
415 | u8 *n_pactive_ch) | ||
415 | { | 416 | { |
416 | struct conf_sched_scan_settings *c = &wl->conf.sched_scan; | 417 | struct conf_sched_scan_settings *c = &wl->conf.sched_scan; |
417 | int i, j; | 418 | int i, j; |
@@ -479,6 +480,23 @@ wl1271_scan_get_sched_scan_channels(struct wl1271 *wl, | |||
479 | channels[j].tx_power_att = req->channels[i]->max_power; | 480 | channels[j].tx_power_att = req->channels[i]->max_power; |
480 | channels[j].channel = req->channels[i]->hw_value; | 481 | channels[j].channel = req->channels[i]->hw_value; |
481 | 482 | ||
483 | if ((band == IEEE80211_BAND_2GHZ) && | ||
484 | (channels[j].channel >= 12) && | ||
485 | (channels[j].channel <= 14) && | ||
486 | (flags & IEEE80211_CHAN_PASSIVE_SCAN) && | ||
487 | !force_passive) { | ||
488 | /* pactive channels treated as DFS */ | ||
489 | channels[j].flags = SCAN_CHANNEL_FLAGS_DFS; | ||
490 | |||
491 | /* | ||
492 | * n_pactive_ch is counted down from the end of | ||
493 | * the passive channel list | ||
494 | */ | ||
495 | (*n_pactive_ch)++; | ||
496 | wl1271_debug(DEBUG_SCAN, "n_pactive_ch = %d", | ||
497 | *n_pactive_ch); | ||
498 | } | ||
499 | |||
482 | j++; | 500 | j++; |
483 | } | 501 | } |
484 | } | 502 | } |
@@ -491,38 +509,47 @@ wl1271_scan_sched_scan_channels(struct wl1271 *wl, | |||
491 | struct cfg80211_sched_scan_request *req, | 509 | struct cfg80211_sched_scan_request *req, |
492 | struct wl1271_cmd_sched_scan_config *cfg) | 510 | struct wl1271_cmd_sched_scan_config *cfg) |
493 | { | 511 | { |
512 | u8 n_pactive_ch = 0; | ||
513 | |||
494 | cfg->passive[0] = | 514 | cfg->passive[0] = |
495 | wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_2, | 515 | wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_2, |
496 | IEEE80211_BAND_2GHZ, | 516 | IEEE80211_BAND_2GHZ, |
497 | false, true, 0, | 517 | false, true, 0, |
498 | MAX_CHANNELS_2GHZ); | 518 | MAX_CHANNELS_2GHZ, |
519 | &n_pactive_ch); | ||
499 | cfg->active[0] = | 520 | cfg->active[0] = |
500 | wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_2, | 521 | wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_2, |
501 | IEEE80211_BAND_2GHZ, | 522 | IEEE80211_BAND_2GHZ, |
502 | false, false, | 523 | false, false, |
503 | cfg->passive[0], | 524 | cfg->passive[0], |
504 | MAX_CHANNELS_2GHZ); | 525 | MAX_CHANNELS_2GHZ, |
526 | &n_pactive_ch); | ||
505 | cfg->passive[1] = | 527 | cfg->passive[1] = |
506 | wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_5, | 528 | wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_5, |
507 | IEEE80211_BAND_5GHZ, | 529 | IEEE80211_BAND_5GHZ, |
508 | false, true, 0, | 530 | false, true, 0, |
509 | MAX_CHANNELS_5GHZ); | 531 | MAX_CHANNELS_5GHZ, |
532 | &n_pactive_ch); | ||
510 | cfg->dfs = | 533 | cfg->dfs = |
511 | wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_5, | 534 | wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_5, |
512 | IEEE80211_BAND_5GHZ, | 535 | IEEE80211_BAND_5GHZ, |
513 | true, true, | 536 | true, true, |
514 | cfg->passive[1], | 537 | cfg->passive[1], |
515 | MAX_CHANNELS_5GHZ); | 538 | MAX_CHANNELS_5GHZ, |
539 | &n_pactive_ch); | ||
516 | cfg->active[1] = | 540 | cfg->active[1] = |
517 | wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_5, | 541 | wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_5, |
518 | IEEE80211_BAND_5GHZ, | 542 | IEEE80211_BAND_5GHZ, |
519 | false, false, | 543 | false, false, |
520 | cfg->passive[1] + cfg->dfs, | 544 | cfg->passive[1] + cfg->dfs, |
521 | MAX_CHANNELS_5GHZ); | 545 | MAX_CHANNELS_5GHZ, |
546 | &n_pactive_ch); | ||
522 | /* 802.11j channels are not supported yet */ | 547 | /* 802.11j channels are not supported yet */ |
523 | cfg->passive[2] = 0; | 548 | cfg->passive[2] = 0; |
524 | cfg->active[2] = 0; | 549 | cfg->active[2] = 0; |
525 | 550 | ||
551 | cfg->n_pactive_ch = n_pactive_ch; | ||
552 | |||
526 | wl1271_debug(DEBUG_SCAN, " 2.4GHz: active %d passive %d", | 553 | wl1271_debug(DEBUG_SCAN, " 2.4GHz: active %d passive %d", |
527 | cfg->active[0], cfg->passive[0]); | 554 | cfg->active[0], cfg->passive[0]); |
528 | wl1271_debug(DEBUG_SCAN, " 5GHz: active %d passive %d", | 555 | wl1271_debug(DEBUG_SCAN, " 5GHz: active %d passive %d", |
diff --git a/drivers/net/wireless/ti/wlcore/scan.h b/drivers/net/wireless/ti/wlcore/scan.h index 5b6a609fb460..29f3c8d6b046 100644 --- a/drivers/net/wireless/ti/wlcore/scan.h +++ b/drivers/net/wireless/ti/wlcore/scan.h | |||
@@ -142,7 +142,8 @@ enum { | |||
142 | SCAN_BSS_TYPE_ANY, | 142 | SCAN_BSS_TYPE_ANY, |
143 | }; | 143 | }; |
144 | 144 | ||
145 | #define SCAN_CHANNEL_FLAGS_DFS BIT(0) | 145 | #define SCAN_CHANNEL_FLAGS_DFS BIT(0) /* channel is passive until an |
146 | activity is detected on it */ | ||
146 | #define SCAN_CHANNEL_FLAGS_DFS_ENABLED BIT(1) | 147 | #define SCAN_CHANNEL_FLAGS_DFS_ENABLED BIT(1) |
147 | 148 | ||
148 | struct conn_scan_ch_params { | 149 | struct conn_scan_ch_params { |
@@ -185,8 +186,10 @@ struct wl1271_cmd_sched_scan_config { | |||
185 | 186 | ||
186 | u8 dfs; | 187 | u8 dfs; |
187 | 188 | ||
189 | u8 n_pactive_ch; /* number of pactive (passive until fw detects energy) | ||
190 | channels in BG band */ | ||
188 | u8 role_id; | 191 | u8 role_id; |
189 | u8 padding[2]; | 192 | u8 padding[1]; |
190 | 193 | ||
191 | struct conn_scan_ch_params channels_2[MAX_CHANNELS_2GHZ]; | 194 | struct conn_scan_ch_params channels_2[MAX_CHANNELS_2GHZ]; |
192 | struct conn_scan_ch_params channels_5[MAX_CHANNELS_5GHZ]; | 195 | struct conn_scan_ch_params channels_5[MAX_CHANNELS_5GHZ]; |