Commit 2497a246 authored by Luciano Coelho's avatar Luciano Coelho Committed by John W. Linville

wl12xx: fix DFS channels handling in scheduled scan

DFS channels were never getting included in the scheduled scans,
because they always contain the passive flag as well and the call was
asking for DFS and active channels.

Fix this by ignoring the passive flag when collecting DFS channels.
Also, move the DFS channels in the channel list before the 5GHz active
channels (this was implemented in the FW differently than specified).
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent dd086821
...@@ -337,10 +337,12 @@ wl1271_scan_get_sched_scan_channels(struct wl1271 *wl, ...@@ -337,10 +337,12 @@ wl1271_scan_get_sched_scan_channels(struct wl1271 *wl,
i++) { i++) {
flags = req->channels[i]->flags; flags = req->channels[i]->flags;
if (!(flags & IEEE80211_CHAN_DISABLED) && if ((req->channels[i]->band == band) &&
(!!(flags & IEEE80211_CHAN_PASSIVE_SCAN) == passive) && !(flags & IEEE80211_CHAN_DISABLED) &&
(!!(flags & IEEE80211_CHAN_RADAR) == radar) && (!!(flags & IEEE80211_CHAN_RADAR) == radar) &&
(req->channels[i]->band == band)) { /* if radar is set, we ignore the passive flag */
(radar ||
!!(flags & IEEE80211_CHAN_PASSIVE_SCAN) == passive)) {
wl1271_debug(DEBUG_SCAN, "band %d, center_freq %d ", wl1271_debug(DEBUG_SCAN, "band %d, center_freq %d ",
req->channels[i]->band, req->channels[i]->band,
req->channels[i]->center_freq); req->channels[i]->center_freq);
...@@ -350,6 +352,8 @@ wl1271_scan_get_sched_scan_channels(struct wl1271 *wl, ...@@ -350,6 +352,8 @@ wl1271_scan_get_sched_scan_channels(struct wl1271 *wl,
wl1271_debug(DEBUG_SCAN, "max_power %d", wl1271_debug(DEBUG_SCAN, "max_power %d",
req->channels[i]->max_power); req->channels[i]->max_power);
if (flags & IEEE80211_CHAN_RADAR)
channels[j].flags |= SCAN_CHANNEL_FLAGS_DFS;
if (flags & IEEE80211_CHAN_PASSIVE_SCAN) { if (flags & IEEE80211_CHAN_PASSIVE_SCAN) {
channels[j].passive_duration = channels[j].passive_duration =
cpu_to_le16(c->dwell_time_passive); cpu_to_le16(c->dwell_time_passive);
...@@ -359,7 +363,7 @@ wl1271_scan_get_sched_scan_channels(struct wl1271 *wl, ...@@ -359,7 +363,7 @@ wl1271_scan_get_sched_scan_channels(struct wl1271 *wl,
channels[j].max_duration = channels[j].max_duration =
cpu_to_le16(c->max_dwell_time_active); cpu_to_le16(c->max_dwell_time_active);
} }
channels[j].tx_power_att = req->channels[j]->max_power; channels[j].tx_power_att = req->channels[i]->max_power;
channels[j].channel = req->channels[i]->hw_value; channels[j].channel = req->channels[i]->hw_value;
j++; j++;
...@@ -386,7 +390,11 @@ wl1271_scan_sched_scan_channels(struct wl1271 *wl, ...@@ -386,7 +390,11 @@ wl1271_scan_sched_scan_channels(struct wl1271 *wl,
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels, wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels,
IEEE80211_BAND_2GHZ, IEEE80211_BAND_2GHZ,
false, false, idx); false, false, idx);
idx += cfg->active[0]; /*
* 5GHz channels always start at position 14, not immediately
* after the last 2.4GHz channel
*/
idx = 14;
cfg->passive[1] = cfg->passive[1] =
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels, wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels,
...@@ -394,22 +402,23 @@ wl1271_scan_sched_scan_channels(struct wl1271 *wl, ...@@ -394,22 +402,23 @@ wl1271_scan_sched_scan_channels(struct wl1271 *wl,
false, true, idx); false, true, idx);
idx += cfg->passive[1]; idx += cfg->passive[1];
cfg->active[1] = cfg->dfs =
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels, wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels,
IEEE80211_BAND_5GHZ, IEEE80211_BAND_5GHZ,
false, false, 14); true, true, idx);
idx += cfg->active[1]; idx += cfg->dfs;
cfg->dfs = cfg->active[1] =
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels, wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels,
IEEE80211_BAND_5GHZ, IEEE80211_BAND_5GHZ,
true, false, idx); false, false, idx);
idx += cfg->dfs; idx += cfg->active[1];
wl1271_debug(DEBUG_SCAN, " 2.4GHz: active %d passive %d", wl1271_debug(DEBUG_SCAN, " 2.4GHz: active %d passive %d",
cfg->active[0], cfg->passive[0]); cfg->active[0], cfg->passive[0]);
wl1271_debug(DEBUG_SCAN, " 5GHz: active %d passive %d", wl1271_debug(DEBUG_SCAN, " 5GHz: active %d passive %d",
cfg->active[1], cfg->passive[1]); cfg->active[1], cfg->passive[1]);
wl1271_debug(DEBUG_SCAN, " DFS: %d", cfg->dfs);
return idx; return idx;
} }
......
...@@ -137,6 +137,9 @@ enum { ...@@ -137,6 +137,9 @@ enum {
SCAN_BSS_TYPE_ANY, SCAN_BSS_TYPE_ANY,
}; };
#define SCAN_CHANNEL_FLAGS_DFS BIT(0)
#define SCAN_CHANNEL_FLAGS_DFS_ENABLED BIT(1)
struct conn_scan_ch_params { struct conn_scan_ch_params {
__le16 min_duration; __le16 min_duration;
__le16 max_duration; __le16 max_duration;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment