aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/wl12xx/scan.c31
-rw-r--r--drivers/net/wireless/wl12xx/scan.h3
2 files changed, 23 insertions, 11 deletions
diff --git a/drivers/net/wireless/wl12xx/scan.c b/drivers/net/wireless/wl12xx/scan.c
index f223e0ed0c41..8ccbb911776a 100644
--- a/drivers/net/wireless/wl12xx/scan.c
+++ b/drivers/net/wireless/wl12xx/scan.c
@@ -337,10 +337,12 @@ wl1271_scan_get_sched_scan_channels(struct wl1271 *wl,
337 i++) { 337 i++) {
338 flags = req->channels[i]->flags; 338 flags = req->channels[i]->flags;
339 339
340 if (!(flags & IEEE80211_CHAN_DISABLED) && 340 if ((req->channels[i]->band == band) &&
341 (!!(flags & IEEE80211_CHAN_PASSIVE_SCAN) == passive) && 341 !(flags & IEEE80211_CHAN_DISABLED) &&
342 (!!(flags & IEEE80211_CHAN_RADAR) == radar) && 342 (!!(flags & IEEE80211_CHAN_RADAR) == radar) &&
343 (req->channels[i]->band == band)) { 343 /* if radar is set, we ignore the passive flag */
344 (radar ||
345 !!(flags & IEEE80211_CHAN_PASSIVE_SCAN) == passive)) {
344 wl1271_debug(DEBUG_SCAN, "band %d, center_freq %d ", 346 wl1271_debug(DEBUG_SCAN, "band %d, center_freq %d ",
345 req->channels[i]->band, 347 req->channels[i]->band,
346 req->channels[i]->center_freq); 348 req->channels[i]->center_freq);
@@ -350,6 +352,8 @@ wl1271_scan_get_sched_scan_channels(struct wl1271 *wl,
350 wl1271_debug(DEBUG_SCAN, "max_power %d", 352 wl1271_debug(DEBUG_SCAN, "max_power %d",
351 req->channels[i]->max_power); 353 req->channels[i]->max_power);
352 354
355 if (flags & IEEE80211_CHAN_RADAR)
356 channels[j].flags |= SCAN_CHANNEL_FLAGS_DFS;
353 if (flags & IEEE80211_CHAN_PASSIVE_SCAN) { 357 if (flags & IEEE80211_CHAN_PASSIVE_SCAN) {
354 channels[j].passive_duration = 358 channels[j].passive_duration =
355 cpu_to_le16(c->dwell_time_passive); 359 cpu_to_le16(c->dwell_time_passive);
@@ -359,7 +363,7 @@ wl1271_scan_get_sched_scan_channels(struct wl1271 *wl,
359 channels[j].max_duration = 363 channels[j].max_duration =
360 cpu_to_le16(c->max_dwell_time_active); 364 cpu_to_le16(c->max_dwell_time_active);
361 } 365 }
362 channels[j].tx_power_att = req->channels[j]->max_power; 366 channels[j].tx_power_att = req->channels[i]->max_power;
363 channels[j].channel = req->channels[i]->hw_value; 367 channels[j].channel = req->channels[i]->hw_value;
364 368
365 j++; 369 j++;
@@ -386,7 +390,11 @@ wl1271_scan_sched_scan_channels(struct wl1271 *wl,
386 wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels, 390 wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels,
387 IEEE80211_BAND_2GHZ, 391 IEEE80211_BAND_2GHZ,
388 false, false, idx); 392 false, false, idx);
389 idx += cfg->active[0]; 393 /*
394 * 5GHz channels always start at position 14, not immediately
395 * after the last 2.4GHz channel
396 */
397 idx = 14;
390 398
391 cfg->passive[1] = 399 cfg->passive[1] =
392 wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels, 400 wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels,
@@ -394,22 +402,23 @@ wl1271_scan_sched_scan_channels(struct wl1271 *wl,
394 false, true, idx); 402 false, true, idx);
395 idx += cfg->passive[1]; 403 idx += cfg->passive[1];
396 404
397 cfg->active[1] = 405 cfg->dfs =
398 wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels, 406 wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels,
399 IEEE80211_BAND_5GHZ, 407 IEEE80211_BAND_5GHZ,
400 false, false, 14); 408 true, true, idx);
401 idx += cfg->active[1]; 409 idx += cfg->dfs;
402 410
403 cfg->dfs = 411 cfg->active[1] =
404 wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels, 412 wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels,
405 IEEE80211_BAND_5GHZ, 413 IEEE80211_BAND_5GHZ,
406 true, false, idx); 414 false, false, idx);
407 idx += cfg->dfs; 415 idx += cfg->active[1];
408 416
409 wl1271_debug(DEBUG_SCAN, " 2.4GHz: active %d passive %d", 417 wl1271_debug(DEBUG_SCAN, " 2.4GHz: active %d passive %d",
410 cfg->active[0], cfg->passive[0]); 418 cfg->active[0], cfg->passive[0]);
411 wl1271_debug(DEBUG_SCAN, " 5GHz: active %d passive %d", 419 wl1271_debug(DEBUG_SCAN, " 5GHz: active %d passive %d",
412 cfg->active[1], cfg->passive[1]); 420 cfg->active[1], cfg->passive[1]);
421 wl1271_debug(DEBUG_SCAN, " DFS: %d", cfg->dfs);
413 422
414 return idx; 423 return idx;
415} 424}
diff --git a/drivers/net/wireless/wl12xx/scan.h b/drivers/net/wireless/wl12xx/scan.h
index c83319579ca3..a0b6c5d67b07 100644
--- a/drivers/net/wireless/wl12xx/scan.h
+++ b/drivers/net/wireless/wl12xx/scan.h
@@ -137,6 +137,9 @@ enum {
137 SCAN_BSS_TYPE_ANY, 137 SCAN_BSS_TYPE_ANY,
138}; 138};
139 139
140#define SCAN_CHANNEL_FLAGS_DFS BIT(0)
141#define SCAN_CHANNEL_FLAGS_DFS_ENABLED BIT(1)
142
140struct conn_scan_ch_params { 143struct conn_scan_ch_params {
141 __le16 min_duration; 144 __le16 min_duration;
142 __le16 max_duration; 145 __le16 max_duration;