wlcore: configure dwell times according to scan type
Allow configuring different dwell times to the different scan types (regular and scheduled). Add new configuration entry (dwell_time_dfs) to conf_scan_settings, in order to allow setting different values for normal scan and scheduled scan. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
This commit is contained in:
parent
6507babab4
commit
7c482c1040
8 changed files with 64 additions and 48 deletions
|
@ -267,8 +267,8 @@ static struct wlcore_conf wl12xx_conf = {
|
||||||
.scan = {
|
.scan = {
|
||||||
.min_dwell_time_active = 7500,
|
.min_dwell_time_active = 7500,
|
||||||
.max_dwell_time_active = 30000,
|
.max_dwell_time_active = 30000,
|
||||||
.min_dwell_time_passive = 100000,
|
.dwell_time_passive = 100000,
|
||||||
.max_dwell_time_passive = 100000,
|
.dwell_time_dfs = 150000,
|
||||||
.num_probe_reqs = 2,
|
.num_probe_reqs = 2,
|
||||||
.split_scan_timeout = 50000,
|
.split_scan_timeout = 50000,
|
||||||
},
|
},
|
||||||
|
|
|
@ -68,9 +68,9 @@ static int wl1271_get_scan_channels(struct wl1271 *wl,
|
||||||
cpu_to_le32(c->max_dwell_time_active);
|
cpu_to_le32(c->max_dwell_time_active);
|
||||||
} else {
|
} else {
|
||||||
channels[j].min_duration =
|
channels[j].min_duration =
|
||||||
cpu_to_le32(c->min_dwell_time_passive);
|
cpu_to_le32(c->dwell_time_passive);
|
||||||
channels[j].max_duration =
|
channels[j].max_duration =
|
||||||
cpu_to_le32(c->max_dwell_time_passive);
|
cpu_to_le32(c->dwell_time_passive);
|
||||||
}
|
}
|
||||||
channels[j].early_termination = 0;
|
channels[j].early_termination = 0;
|
||||||
channels[j].tx_power_att = req->channels[i]->max_power;
|
channels[j].tx_power_att = req->channels[i]->max_power;
|
||||||
|
@ -364,7 +364,8 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wlcore_set_scan_chan_params(wl, cfg_channels, req->channels,
|
if (!wlcore_set_scan_chan_params(wl, cfg_channels, req->channels,
|
||||||
req->n_channels, req->n_ssids)) {
|
req->n_channels, req->n_ssids,
|
||||||
|
SCAN_TYPE_PERIODIC)) {
|
||||||
wl1271_error("scan channel list is empty");
|
wl1271_error("scan channel list is empty");
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto out;
|
goto out;
|
||||||
|
|
|
@ -394,8 +394,8 @@ static struct wlcore_conf wl18xx_conf = {
|
||||||
.scan = {
|
.scan = {
|
||||||
.min_dwell_time_active = 7500,
|
.min_dwell_time_active = 7500,
|
||||||
.max_dwell_time_active = 30000,
|
.max_dwell_time_active = 30000,
|
||||||
.min_dwell_time_passive = 100000,
|
.dwell_time_passive = 100000,
|
||||||
.max_dwell_time_passive = 100000,
|
.dwell_time_dfs = 150000,
|
||||||
.num_probe_reqs = 2,
|
.num_probe_reqs = 2,
|
||||||
.split_scan_timeout = 50000,
|
.split_scan_timeout = 50000,
|
||||||
},
|
},
|
||||||
|
|
|
@ -84,7 +84,8 @@ static int wl18xx_scan_send(struct wl1271 *wl, struct wl12xx_vif *wlvif,
|
||||||
}
|
}
|
||||||
|
|
||||||
wlcore_set_scan_chan_params(wl, cmd_channels, req->channels,
|
wlcore_set_scan_chan_params(wl, cmd_channels, req->channels,
|
||||||
req->n_channels, req->n_ssids);
|
req->n_channels, req->n_ssids,
|
||||||
|
SCAN_TYPE_SEARCH);
|
||||||
wl18xx_adjust_channels(cmd, cmd_channels);
|
wl18xx_adjust_channels(cmd, cmd_channels);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -214,7 +215,8 @@ int wl18xx_scan_sched_scan_config(struct wl1271 *wl,
|
||||||
|
|
||||||
/* configure channels */
|
/* configure channels */
|
||||||
wlcore_set_scan_chan_params(wl, cmd_channels, req->channels,
|
wlcore_set_scan_chan_params(wl, cmd_channels, req->channels,
|
||||||
req->n_channels, req->n_ssids);
|
req->n_channels, req->n_ssids,
|
||||||
|
SCAN_TYPE_PERIODIC);
|
||||||
wl18xx_adjust_channels(cmd, cmd_channels);
|
wl18xx_adjust_channels(cmd, cmd_channels);
|
||||||
|
|
||||||
cmd->short_cycles_sec = 0;
|
cmd->short_cycles_sec = 0;
|
||||||
|
|
|
@ -35,13 +35,6 @@ struct tracking_ch_params {
|
||||||
u8 padding[2];
|
u8 padding[2];
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
SCAN_TYPE_SEARCH = 0,
|
|
||||||
SCAN_TYPE_PERIODIC = 1,
|
|
||||||
SCAN_TYPE_TRACKING = 2,
|
|
||||||
};
|
|
||||||
|
|
||||||
/* probe request rate */
|
/* probe request rate */
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
|
|
|
@ -1059,19 +1059,11 @@ struct conf_scan_settings {
|
||||||
*/
|
*/
|
||||||
u32 max_dwell_time_active;
|
u32 max_dwell_time_active;
|
||||||
|
|
||||||
/*
|
/* time to wait on the channel for passive scans (in TU/1000) */
|
||||||
* The minimum time to wait on each channel for passive scans
|
u32 dwell_time_passive;
|
||||||
*
|
|
||||||
* Range: u32 tu/1000
|
|
||||||
*/
|
|
||||||
u32 min_dwell_time_passive;
|
|
||||||
|
|
||||||
/*
|
/* time to wait on the channel for DFS scans (in TU/1000) */
|
||||||
* The maximum time to wait on each channel for passive scans
|
u32 dwell_time_dfs;
|
||||||
*
|
|
||||||
* Range: u32 tu/1000
|
|
||||||
*/
|
|
||||||
u32 max_dwell_time_passive;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Number of probe requests to transmit on each active scan channel
|
* Number of probe requests to transmit on each active scan channel
|
||||||
|
@ -1281,7 +1273,7 @@ struct conf_hangover_settings {
|
||||||
* version, the two LSB are the lower driver's private conf
|
* version, the two LSB are the lower driver's private conf
|
||||||
* version.
|
* version.
|
||||||
*/
|
*/
|
||||||
#define WLCORE_CONF_VERSION (0x0002 << 16)
|
#define WLCORE_CONF_VERSION (0x0003 << 16)
|
||||||
#define WLCORE_CONF_MASK 0xffff0000
|
#define WLCORE_CONF_MASK 0xffff0000
|
||||||
#define WLCORE_CONF_SIZE (sizeof(struct wlcore_conf_header) + \
|
#define WLCORE_CONF_SIZE (sizeof(struct wlcore_conf_header) + \
|
||||||
sizeof(struct wlcore_conf))
|
sizeof(struct wlcore_conf))
|
||||||
|
|
|
@ -97,29 +97,44 @@ wlcore_scan_get_channels(struct wl1271 *wl,
|
||||||
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)
|
u8 *n_pactive_ch,
|
||||||
|
int scan_type)
|
||||||
{
|
{
|
||||||
struct conf_sched_scan_settings *c = &wl->conf.sched_scan;
|
|
||||||
int i, j;
|
int i, j;
|
||||||
u32 flags;
|
u32 flags;
|
||||||
bool force_passive = !n_ssids;
|
bool force_passive = !n_ssids;
|
||||||
u32 min_dwell_time_active, max_dwell_time_active, delta_per_probe;
|
u32 min_dwell_time_active, max_dwell_time_active;
|
||||||
u32 dwell_time_passive, dwell_time_dfs;
|
u32 dwell_time_passive, dwell_time_dfs;
|
||||||
|
|
||||||
if (band == IEEE80211_BAND_5GHZ)
|
/* configure dwell times according to scan type */
|
||||||
delta_per_probe = c->dwell_time_delta_per_probe_5;
|
if (scan_type == SCAN_TYPE_SEARCH) {
|
||||||
else
|
struct conf_scan_settings *c = &wl->conf.scan;
|
||||||
delta_per_probe = c->dwell_time_delta_per_probe;
|
|
||||||
|
|
||||||
min_dwell_time_active = c->base_dwell_time +
|
min_dwell_time_active = c->min_dwell_time_active;
|
||||||
n_ssids * c->num_probe_reqs * delta_per_probe;
|
max_dwell_time_active = c->max_dwell_time_active;
|
||||||
|
dwell_time_passive = c->dwell_time_passive;
|
||||||
|
dwell_time_dfs = c->dwell_time_dfs;
|
||||||
|
} else {
|
||||||
|
struct conf_sched_scan_settings *c = &wl->conf.sched_scan;
|
||||||
|
u32 delta_per_probe;
|
||||||
|
|
||||||
max_dwell_time_active = min_dwell_time_active + c->max_dwell_time_delta;
|
if (band == IEEE80211_BAND_5GHZ)
|
||||||
|
delta_per_probe = c->dwell_time_delta_per_probe_5;
|
||||||
|
else
|
||||||
|
delta_per_probe = c->dwell_time_delta_per_probe;
|
||||||
|
|
||||||
|
min_dwell_time_active = c->base_dwell_time +
|
||||||
|
n_ssids * c->num_probe_reqs * delta_per_probe;
|
||||||
|
|
||||||
|
max_dwell_time_active = min_dwell_time_active +
|
||||||
|
c->max_dwell_time_delta;
|
||||||
|
dwell_time_passive = c->dwell_time_passive;
|
||||||
|
dwell_time_dfs = c->dwell_time_dfs;
|
||||||
|
}
|
||||||
min_dwell_time_active = DIV_ROUND_UP(min_dwell_time_active, 1000);
|
min_dwell_time_active = DIV_ROUND_UP(min_dwell_time_active, 1000);
|
||||||
max_dwell_time_active = DIV_ROUND_UP(max_dwell_time_active, 1000);
|
max_dwell_time_active = DIV_ROUND_UP(max_dwell_time_active, 1000);
|
||||||
dwell_time_passive = DIV_ROUND_UP(c->dwell_time_passive, 1000);
|
dwell_time_passive = DIV_ROUND_UP(dwell_time_passive, 1000);
|
||||||
dwell_time_dfs = DIV_ROUND_UP(c->dwell_time_dfs, 1000);
|
dwell_time_dfs = DIV_ROUND_UP(dwell_time_dfs, 1000);
|
||||||
|
|
||||||
for (i = 0, j = start;
|
for (i = 0, j = start;
|
||||||
i < n_channels && j < max_channels;
|
i < n_channels && j < max_channels;
|
||||||
|
@ -195,7 +210,8 @@ wlcore_set_scan_chan_params(struct wl1271 *wl,
|
||||||
struct wlcore_scan_channels *cfg,
|
struct wlcore_scan_channels *cfg,
|
||||||
struct ieee80211_channel *channels[],
|
struct ieee80211_channel *channels[],
|
||||||
u32 n_channels,
|
u32 n_channels,
|
||||||
u32 n_ssids)
|
u32 n_ssids,
|
||||||
|
int scan_type)
|
||||||
{
|
{
|
||||||
u8 n_pactive_ch = 0;
|
u8 n_pactive_ch = 0;
|
||||||
|
|
||||||
|
@ -208,7 +224,8 @@ wlcore_set_scan_chan_params(struct wl1271 *wl,
|
||||||
IEEE80211_BAND_2GHZ,
|
IEEE80211_BAND_2GHZ,
|
||||||
false, true, 0,
|
false, true, 0,
|
||||||
MAX_CHANNELS_2GHZ,
|
MAX_CHANNELS_2GHZ,
|
||||||
&n_pactive_ch);
|
&n_pactive_ch,
|
||||||
|
scan_type);
|
||||||
cfg->active[0] =
|
cfg->active[0] =
|
||||||
wlcore_scan_get_channels(wl,
|
wlcore_scan_get_channels(wl,
|
||||||
channels,
|
channels,
|
||||||
|
@ -219,7 +236,8 @@ wlcore_set_scan_chan_params(struct wl1271 *wl,
|
||||||
false, false,
|
false, false,
|
||||||
cfg->passive[0],
|
cfg->passive[0],
|
||||||
MAX_CHANNELS_2GHZ,
|
MAX_CHANNELS_2GHZ,
|
||||||
&n_pactive_ch);
|
&n_pactive_ch,
|
||||||
|
scan_type);
|
||||||
cfg->passive[1] =
|
cfg->passive[1] =
|
||||||
wlcore_scan_get_channels(wl,
|
wlcore_scan_get_channels(wl,
|
||||||
channels,
|
channels,
|
||||||
|
@ -229,7 +247,8 @@ wlcore_set_scan_chan_params(struct wl1271 *wl,
|
||||||
IEEE80211_BAND_5GHZ,
|
IEEE80211_BAND_5GHZ,
|
||||||
false, true, 0,
|
false, true, 0,
|
||||||
wl->max_channels_5,
|
wl->max_channels_5,
|
||||||
&n_pactive_ch);
|
&n_pactive_ch,
|
||||||
|
scan_type);
|
||||||
cfg->dfs =
|
cfg->dfs =
|
||||||
wlcore_scan_get_channels(wl,
|
wlcore_scan_get_channels(wl,
|
||||||
channels,
|
channels,
|
||||||
|
@ -240,7 +259,8 @@ wlcore_set_scan_chan_params(struct wl1271 *wl,
|
||||||
true, true,
|
true, true,
|
||||||
cfg->passive[1],
|
cfg->passive[1],
|
||||||
wl->max_channels_5,
|
wl->max_channels_5,
|
||||||
&n_pactive_ch);
|
&n_pactive_ch,
|
||||||
|
scan_type);
|
||||||
cfg->active[1] =
|
cfg->active[1] =
|
||||||
wlcore_scan_get_channels(wl,
|
wlcore_scan_get_channels(wl,
|
||||||
channels,
|
channels,
|
||||||
|
@ -251,7 +271,8 @@ wlcore_set_scan_chan_params(struct wl1271 *wl,
|
||||||
false, false,
|
false, false,
|
||||||
cfg->passive[1] + cfg->dfs,
|
cfg->passive[1] + cfg->dfs,
|
||||||
wl->max_channels_5,
|
wl->max_channels_5,
|
||||||
&n_pactive_ch);
|
&n_pactive_ch,
|
||||||
|
scan_type);
|
||||||
|
|
||||||
/* 802.11j channels are not supported yet */
|
/* 802.11j channels are not supported yet */
|
||||||
cfg->passive[2] = 0;
|
cfg->passive[2] = 0;
|
||||||
|
|
|
@ -150,12 +150,19 @@ struct wlcore_scan_channels {
|
||||||
struct conn_scan_ch_params channels_4[MAX_CHANNELS_4GHZ];
|
struct conn_scan_ch_params channels_4[MAX_CHANNELS_4GHZ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SCAN_TYPE_SEARCH = 0,
|
||||||
|
SCAN_TYPE_PERIODIC = 1,
|
||||||
|
SCAN_TYPE_TRACKING = 2,
|
||||||
|
};
|
||||||
|
|
||||||
bool
|
bool
|
||||||
wlcore_set_scan_chan_params(struct wl1271 *wl,
|
wlcore_set_scan_chan_params(struct wl1271 *wl,
|
||||||
struct wlcore_scan_channels *cfg,
|
struct wlcore_scan_channels *cfg,
|
||||||
struct ieee80211_channel *channels[],
|
struct ieee80211_channel *channels[],
|
||||||
u32 n_channels,
|
u32 n_channels,
|
||||||
u32 n_ssids);
|
u32 n_ssids,
|
||||||
|
int scan_type);
|
||||||
|
|
||||||
int
|
int
|
||||||
wlcore_scan_sched_scan_ssid_list(struct wl1271 *wl,
|
wlcore_scan_sched_scan_ssid_list(struct wl1271 *wl,
|
||||||
|
|
Loading…
Reference in a new issue