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>
This commit is contained in:
parent
587cc286c8
commit
97511b15b1
2 changed files with 38 additions and 8 deletions
|
@ -411,7 +411,8 @@ wl1271_scan_get_sched_scan_channels(struct wl1271 *wl,
|
||||||
struct cfg80211_sched_scan_request *req,
|
struct cfg80211_sched_scan_request *req,
|
||||||
struct conn_scan_ch_params *channels,
|
struct conn_scan_ch_params *channels,
|
||||||
u32 band, bool radar, bool passive,
|
u32 band, bool radar, bool passive,
|
||||||
int start, int max_channels)
|
int start, int max_channels,
|
||||||
|
u8 *n_pactive_ch)
|
||||||
{
|
{
|
||||||
struct conf_sched_scan_settings *c = &wl->conf.sched_scan;
|
struct conf_sched_scan_settings *c = &wl->conf.sched_scan;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
@ -479,6 +480,23 @@ wl1271_scan_get_sched_scan_channels(struct wl1271 *wl,
|
||||||
channels[j].tx_power_att = req->channels[i]->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;
|
||||||
|
|
||||||
|
if ((band == IEEE80211_BAND_2GHZ) &&
|
||||||
|
(channels[j].channel >= 12) &&
|
||||||
|
(channels[j].channel <= 14) &&
|
||||||
|
(flags & IEEE80211_CHAN_PASSIVE_SCAN) &&
|
||||||
|
!force_passive) {
|
||||||
|
/* pactive channels treated as DFS */
|
||||||
|
channels[j].flags = SCAN_CHANNEL_FLAGS_DFS;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* n_pactive_ch is counted down from the end of
|
||||||
|
* the passive channel list
|
||||||
|
*/
|
||||||
|
(*n_pactive_ch)++;
|
||||||
|
wl1271_debug(DEBUG_SCAN, "n_pactive_ch = %d",
|
||||||
|
*n_pactive_ch);
|
||||||
|
}
|
||||||
|
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -491,38 +509,47 @@ wl1271_scan_sched_scan_channels(struct wl1271 *wl,
|
||||||
struct cfg80211_sched_scan_request *req,
|
struct cfg80211_sched_scan_request *req,
|
||||||
struct wl1271_cmd_sched_scan_config *cfg)
|
struct wl1271_cmd_sched_scan_config *cfg)
|
||||||
{
|
{
|
||||||
|
u8 n_pactive_ch = 0;
|
||||||
|
|
||||||
cfg->passive[0] =
|
cfg->passive[0] =
|
||||||
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_2,
|
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_2,
|
||||||
IEEE80211_BAND_2GHZ,
|
IEEE80211_BAND_2GHZ,
|
||||||
false, true, 0,
|
false, true, 0,
|
||||||
MAX_CHANNELS_2GHZ);
|
MAX_CHANNELS_2GHZ,
|
||||||
|
&n_pactive_ch);
|
||||||
cfg->active[0] =
|
cfg->active[0] =
|
||||||
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_2,
|
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_2,
|
||||||
IEEE80211_BAND_2GHZ,
|
IEEE80211_BAND_2GHZ,
|
||||||
false, false,
|
false, false,
|
||||||
cfg->passive[0],
|
cfg->passive[0],
|
||||||
MAX_CHANNELS_2GHZ);
|
MAX_CHANNELS_2GHZ,
|
||||||
|
&n_pactive_ch);
|
||||||
cfg->passive[1] =
|
cfg->passive[1] =
|
||||||
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_5,
|
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_5,
|
||||||
IEEE80211_BAND_5GHZ,
|
IEEE80211_BAND_5GHZ,
|
||||||
false, true, 0,
|
false, true, 0,
|
||||||
MAX_CHANNELS_5GHZ);
|
MAX_CHANNELS_5GHZ,
|
||||||
|
&n_pactive_ch);
|
||||||
cfg->dfs =
|
cfg->dfs =
|
||||||
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_5,
|
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_5,
|
||||||
IEEE80211_BAND_5GHZ,
|
IEEE80211_BAND_5GHZ,
|
||||||
true, true,
|
true, true,
|
||||||
cfg->passive[1],
|
cfg->passive[1],
|
||||||
MAX_CHANNELS_5GHZ);
|
MAX_CHANNELS_5GHZ,
|
||||||
|
&n_pactive_ch);
|
||||||
cfg->active[1] =
|
cfg->active[1] =
|
||||||
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_5,
|
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_5,
|
||||||
IEEE80211_BAND_5GHZ,
|
IEEE80211_BAND_5GHZ,
|
||||||
false, false,
|
false, false,
|
||||||
cfg->passive[1] + cfg->dfs,
|
cfg->passive[1] + cfg->dfs,
|
||||||
MAX_CHANNELS_5GHZ);
|
MAX_CHANNELS_5GHZ,
|
||||||
|
&n_pactive_ch);
|
||||||
/* 802.11j channels are not supported yet */
|
/* 802.11j channels are not supported yet */
|
||||||
cfg->passive[2] = 0;
|
cfg->passive[2] = 0;
|
||||||
cfg->active[2] = 0;
|
cfg->active[2] = 0;
|
||||||
|
|
||||||
|
cfg->n_pactive_ch = n_pactive_ch;
|
||||||
|
|
||||||
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",
|
||||||
|
|
|
@ -142,7 +142,8 @@ enum {
|
||||||
SCAN_BSS_TYPE_ANY,
|
SCAN_BSS_TYPE_ANY,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define SCAN_CHANNEL_FLAGS_DFS BIT(0)
|
#define SCAN_CHANNEL_FLAGS_DFS BIT(0) /* channel is passive until an
|
||||||
|
activity is detected on it */
|
||||||
#define SCAN_CHANNEL_FLAGS_DFS_ENABLED BIT(1)
|
#define SCAN_CHANNEL_FLAGS_DFS_ENABLED BIT(1)
|
||||||
|
|
||||||
struct conn_scan_ch_params {
|
struct conn_scan_ch_params {
|
||||||
|
@ -185,8 +186,10 @@ struct wl1271_cmd_sched_scan_config {
|
||||||
|
|
||||||
u8 dfs;
|
u8 dfs;
|
||||||
|
|
||||||
|
u8 n_pactive_ch; /* number of pactive (passive until fw detects energy)
|
||||||
|
channels in BG band */
|
||||||
u8 role_id;
|
u8 role_id;
|
||||||
u8 padding[2];
|
u8 padding[1];
|
||||||
|
|
||||||
struct conn_scan_ch_params channels_2[MAX_CHANNELS_2GHZ];
|
struct conn_scan_ch_params channels_2[MAX_CHANNELS_2GHZ];
|
||||||
struct conn_scan_ch_params channels_5[MAX_CHANNELS_5GHZ];
|
struct conn_scan_ch_params channels_5[MAX_CHANNELS_5GHZ];
|
||||||
|
|
Loading…
Add table
Reference in a new issue