diff options
author | Eliad Peller <eliad@wizery.com> | 2012-11-26 11:05:40 -0500 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2012-11-28 04:45:42 -0500 |
commit | 7c482c1040ae54e89a8fd4d6415577070d5a915d (patch) | |
tree | f95c28757cb6335030fb06f5154f23c8478cb6d6 | |
parent | 6507babab4f7fe6c51c20abedd66d7449b7a9aca (diff) |
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>
-rw-r--r-- | drivers/net/wireless/ti/wl12xx/main.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wl12xx/scan.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wl18xx/main.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wl18xx/scan.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wl18xx/scan.h | 7 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/conf.h | 18 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/scan.c | 57 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/scan.h | 9 |
8 files changed, 64 insertions, 48 deletions
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c index 7138fe49c63d..17ee0fd14bcc 100644 --- a/drivers/net/wireless/ti/wl12xx/main.c +++ b/drivers/net/wireless/ti/wl12xx/main.c | |||
@@ -267,8 +267,8 @@ static struct wlcore_conf wl12xx_conf = { | |||
267 | .scan = { | 267 | .scan = { |
268 | .min_dwell_time_active = 7500, | 268 | .min_dwell_time_active = 7500, |
269 | .max_dwell_time_active = 30000, | 269 | .max_dwell_time_active = 30000, |
270 | .min_dwell_time_passive = 100000, | 270 | .dwell_time_passive = 100000, |
271 | .max_dwell_time_passive = 100000, | 271 | .dwell_time_dfs = 150000, |
272 | .num_probe_reqs = 2, | 272 | .num_probe_reqs = 2, |
273 | .split_scan_timeout = 50000, | 273 | .split_scan_timeout = 50000, |
274 | }, | 274 | }, |
diff --git a/drivers/net/wireless/ti/wl12xx/scan.c b/drivers/net/wireless/ti/wl12xx/scan.c index a99e8764162d..affdb3ec6225 100644 --- a/drivers/net/wireless/ti/wl12xx/scan.c +++ b/drivers/net/wireless/ti/wl12xx/scan.c | |||
@@ -68,9 +68,9 @@ static int wl1271_get_scan_channels(struct wl1271 *wl, | |||
68 | cpu_to_le32(c->max_dwell_time_active); | 68 | cpu_to_le32(c->max_dwell_time_active); |
69 | } else { | 69 | } else { |
70 | channels[j].min_duration = | 70 | channels[j].min_duration = |
71 | cpu_to_le32(c->min_dwell_time_passive); | 71 | cpu_to_le32(c->dwell_time_passive); |
72 | channels[j].max_duration = | 72 | channels[j].max_duration = |
73 | cpu_to_le32(c->max_dwell_time_passive); | 73 | cpu_to_le32(c->dwell_time_passive); |
74 | } | 74 | } |
75 | channels[j].early_termination = 0; | 75 | channels[j].early_termination = 0; |
76 | channels[j].tx_power_att = req->channels[i]->max_power; | 76 | channels[j].tx_power_att = req->channels[i]->max_power; |
@@ -364,7 +364,8 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl, | |||
364 | } | 364 | } |
365 | 365 | ||
366 | if (!wlcore_set_scan_chan_params(wl, cfg_channels, req->channels, | 366 | if (!wlcore_set_scan_chan_params(wl, cfg_channels, req->channels, |
367 | req->n_channels, req->n_ssids)) { | 367 | req->n_channels, req->n_ssids, |
368 | SCAN_TYPE_PERIODIC)) { | ||
368 | wl1271_error("scan channel list is empty"); | 369 | wl1271_error("scan channel list is empty"); |
369 | ret = -EINVAL; | 370 | ret = -EINVAL; |
370 | goto out; | 371 | goto out; |
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c index bb67d701f8a4..c015231d295f 100644 --- a/drivers/net/wireless/ti/wl18xx/main.c +++ b/drivers/net/wireless/ti/wl18xx/main.c | |||
@@ -394,8 +394,8 @@ static struct wlcore_conf wl18xx_conf = { | |||
394 | .scan = { | 394 | .scan = { |
395 | .min_dwell_time_active = 7500, | 395 | .min_dwell_time_active = 7500, |
396 | .max_dwell_time_active = 30000, | 396 | .max_dwell_time_active = 30000, |
397 | .min_dwell_time_passive = 100000, | 397 | .dwell_time_passive = 100000, |
398 | .max_dwell_time_passive = 100000, | 398 | .dwell_time_dfs = 150000, |
399 | .num_probe_reqs = 2, | 399 | .num_probe_reqs = 2, |
400 | .split_scan_timeout = 50000, | 400 | .split_scan_timeout = 50000, |
401 | }, | 401 | }, |
diff --git a/drivers/net/wireless/ti/wl18xx/scan.c b/drivers/net/wireless/ti/wl18xx/scan.c index f31d0d480d1b..daaebad78e1c 100644 --- a/drivers/net/wireless/ti/wl18xx/scan.c +++ b/drivers/net/wireless/ti/wl18xx/scan.c | |||
@@ -84,7 +84,8 @@ static int wl18xx_scan_send(struct wl1271 *wl, struct wl12xx_vif *wlvif, | |||
84 | } | 84 | } |
85 | 85 | ||
86 | wlcore_set_scan_chan_params(wl, cmd_channels, req->channels, | 86 | wlcore_set_scan_chan_params(wl, cmd_channels, req->channels, |
87 | req->n_channels, req->n_ssids); | 87 | req->n_channels, req->n_ssids, |
88 | SCAN_TYPE_SEARCH); | ||
88 | wl18xx_adjust_channels(cmd, cmd_channels); | 89 | wl18xx_adjust_channels(cmd, cmd_channels); |
89 | 90 | ||
90 | /* | 91 | /* |
@@ -214,7 +215,8 @@ int wl18xx_scan_sched_scan_config(struct wl1271 *wl, | |||
214 | 215 | ||
215 | /* configure channels */ | 216 | /* configure channels */ |
216 | wlcore_set_scan_chan_params(wl, cmd_channels, req->channels, | 217 | wlcore_set_scan_chan_params(wl, cmd_channels, req->channels, |
217 | req->n_channels, req->n_ssids); | 218 | req->n_channels, req->n_ssids, |
219 | SCAN_TYPE_PERIODIC); | ||
218 | wl18xx_adjust_channels(cmd, cmd_channels); | 220 | wl18xx_adjust_channels(cmd, cmd_channels); |
219 | 221 | ||
220 | cmd->short_cycles_sec = 0; | 222 | cmd->short_cycles_sec = 0; |
diff --git a/drivers/net/wireless/ti/wl18xx/scan.h b/drivers/net/wireless/ti/wl18xx/scan.h index 0e026ecb311e..5eb8c7fc1567 100644 --- a/drivers/net/wireless/ti/wl18xx/scan.h +++ b/drivers/net/wireless/ti/wl18xx/scan.h | |||
@@ -35,13 +35,6 @@ struct tracking_ch_params { | |||
35 | u8 padding[2]; | 35 | u8 padding[2]; |
36 | } __packed; | 36 | } __packed; |
37 | 37 | ||
38 | enum | ||
39 | { | ||
40 | SCAN_TYPE_SEARCH = 0, | ||
41 | SCAN_TYPE_PERIODIC = 1, | ||
42 | SCAN_TYPE_TRACKING = 2, | ||
43 | }; | ||
44 | |||
45 | /* probe request rate */ | 38 | /* probe request rate */ |
46 | enum | 39 | enum |
47 | { | 40 | { |
diff --git a/drivers/net/wireless/ti/wlcore/conf.h b/drivers/net/wireless/ti/wlcore/conf.h index a5d190816f34..c9de4d5c8965 100644 --- a/drivers/net/wireless/ti/wlcore/conf.h +++ b/drivers/net/wireless/ti/wlcore/conf.h | |||
@@ -1059,19 +1059,11 @@ struct conf_scan_settings { | |||
1059 | */ | 1059 | */ |
1060 | u32 max_dwell_time_active; | 1060 | u32 max_dwell_time_active; |
1061 | 1061 | ||
1062 | /* | 1062 | /* time to wait on the channel for passive scans (in TU/1000) */ |
1063 | * The minimum time to wait on each channel for passive scans | 1063 | u32 dwell_time_passive; |
1064 | * | ||
1065 | * Range: u32 tu/1000 | ||
1066 | */ | ||
1067 | u32 min_dwell_time_passive; | ||
1068 | 1064 | ||
1069 | /* | 1065 | /* time to wait on the channel for DFS scans (in TU/1000) */ |
1070 | * The maximum time to wait on each channel for passive scans | 1066 | u32 dwell_time_dfs; |
1071 | * | ||
1072 | * Range: u32 tu/1000 | ||
1073 | */ | ||
1074 | u32 max_dwell_time_passive; | ||
1075 | 1067 | ||
1076 | /* | 1068 | /* |
1077 | * Number of probe requests to transmit on each active scan channel | 1069 | * Number of probe requests to transmit on each active scan channel |
@@ -1281,7 +1273,7 @@ struct conf_hangover_settings { | |||
1281 | * version, the two LSB are the lower driver's private conf | 1273 | * version, the two LSB are the lower driver's private conf |
1282 | * version. | 1274 | * version. |
1283 | */ | 1275 | */ |
1284 | #define WLCORE_CONF_VERSION (0x0002 << 16) | 1276 | #define WLCORE_CONF_VERSION (0x0003 << 16) |
1285 | #define WLCORE_CONF_MASK 0xffff0000 | 1277 | #define WLCORE_CONF_MASK 0xffff0000 |
1286 | #define WLCORE_CONF_SIZE (sizeof(struct wlcore_conf_header) + \ | 1278 | #define WLCORE_CONF_SIZE (sizeof(struct wlcore_conf_header) + \ |
1287 | sizeof(struct wlcore_conf)) | 1279 | sizeof(struct wlcore_conf)) |
diff --git a/drivers/net/wireless/ti/wlcore/scan.c b/drivers/net/wireless/ti/wlcore/scan.c index c9137004982e..7f42f8a4d90b 100644 --- a/drivers/net/wireless/ti/wlcore/scan.c +++ b/drivers/net/wireless/ti/wlcore/scan.c | |||
@@ -97,29 +97,44 @@ wlcore_scan_get_channels(struct wl1271 *wl, | |||
97 | struct conn_scan_ch_params *channels, | 97 | struct conn_scan_ch_params *channels, |
98 | u32 band, bool radar, bool passive, | 98 | u32 band, bool radar, bool passive, |
99 | int start, int max_channels, | 99 | int start, int max_channels, |
100 | u8 *n_pactive_ch) | 100 | u8 *n_pactive_ch, |
101 | int scan_type) | ||
101 | { | 102 | { |
102 | struct conf_sched_scan_settings *c = &wl->conf.sched_scan; | ||
103 | int i, j; | 103 | int i, j; |
104 | u32 flags; | 104 | u32 flags; |
105 | bool force_passive = !n_ssids; | 105 | bool force_passive = !n_ssids; |
106 | u32 min_dwell_time_active, max_dwell_time_active, delta_per_probe; | 106 | u32 min_dwell_time_active, max_dwell_time_active; |
107 | u32 dwell_time_passive, dwell_time_dfs; | 107 | u32 dwell_time_passive, dwell_time_dfs; |
108 | 108 | ||
109 | if (band == IEEE80211_BAND_5GHZ) | 109 | /* configure dwell times according to scan type */ |
110 | delta_per_probe = c->dwell_time_delta_per_probe_5; | 110 | if (scan_type == SCAN_TYPE_SEARCH) { |
111 | else | 111 | struct conf_scan_settings *c = &wl->conf.scan; |
112 | delta_per_probe = c->dwell_time_delta_per_probe; | ||
113 | 112 | ||
114 | min_dwell_time_active = c->base_dwell_time + | 113 | min_dwell_time_active = c->min_dwell_time_active; |
115 | n_ssids * c->num_probe_reqs * delta_per_probe; | 114 | max_dwell_time_active = c->max_dwell_time_active; |
115 | dwell_time_passive = c->dwell_time_passive; | ||
116 | dwell_time_dfs = c->dwell_time_dfs; | ||
117 | } else { | ||
118 | struct conf_sched_scan_settings *c = &wl->conf.sched_scan; | ||
119 | u32 delta_per_probe; | ||
120 | |||
121 | if (band == IEEE80211_BAND_5GHZ) | ||
122 | delta_per_probe = c->dwell_time_delta_per_probe_5; | ||
123 | else | ||
124 | delta_per_probe = c->dwell_time_delta_per_probe; | ||
116 | 125 | ||
117 | max_dwell_time_active = min_dwell_time_active + c->max_dwell_time_delta; | 126 | min_dwell_time_active = c->base_dwell_time + |
127 | n_ssids * c->num_probe_reqs * delta_per_probe; | ||
118 | 128 | ||
129 | max_dwell_time_active = min_dwell_time_active + | ||
130 | c->max_dwell_time_delta; | ||
131 | dwell_time_passive = c->dwell_time_passive; | ||
132 | dwell_time_dfs = c->dwell_time_dfs; | ||
133 | } | ||
119 | min_dwell_time_active = DIV_ROUND_UP(min_dwell_time_active, 1000); | 134 | min_dwell_time_active = DIV_ROUND_UP(min_dwell_time_active, 1000); |
120 | max_dwell_time_active = DIV_ROUND_UP(max_dwell_time_active, 1000); | 135 | max_dwell_time_active = DIV_ROUND_UP(max_dwell_time_active, 1000); |
121 | dwell_time_passive = DIV_ROUND_UP(c->dwell_time_passive, 1000); | 136 | dwell_time_passive = DIV_ROUND_UP(dwell_time_passive, 1000); |
122 | dwell_time_dfs = DIV_ROUND_UP(c->dwell_time_dfs, 1000); | 137 | dwell_time_dfs = DIV_ROUND_UP(dwell_time_dfs, 1000); |
123 | 138 | ||
124 | for (i = 0, j = start; | 139 | for (i = 0, j = start; |
125 | i < n_channels && j < max_channels; | 140 | i < n_channels && j < max_channels; |
@@ -195,7 +210,8 @@ wlcore_set_scan_chan_params(struct wl1271 *wl, | |||
195 | struct wlcore_scan_channels *cfg, | 210 | struct wlcore_scan_channels *cfg, |
196 | struct ieee80211_channel *channels[], | 211 | struct ieee80211_channel *channels[], |
197 | u32 n_channels, | 212 | u32 n_channels, |
198 | u32 n_ssids) | 213 | u32 n_ssids, |
214 | int scan_type) | ||
199 | { | 215 | { |
200 | u8 n_pactive_ch = 0; | 216 | u8 n_pactive_ch = 0; |
201 | 217 | ||
@@ -208,7 +224,8 @@ wlcore_set_scan_chan_params(struct wl1271 *wl, | |||
208 | IEEE80211_BAND_2GHZ, | 224 | IEEE80211_BAND_2GHZ, |
209 | false, true, 0, | 225 | false, true, 0, |
210 | MAX_CHANNELS_2GHZ, | 226 | MAX_CHANNELS_2GHZ, |
211 | &n_pactive_ch); | 227 | &n_pactive_ch, |
228 | scan_type); | ||
212 | cfg->active[0] = | 229 | cfg->active[0] = |
213 | wlcore_scan_get_channels(wl, | 230 | wlcore_scan_get_channels(wl, |
214 | channels, | 231 | channels, |
@@ -219,7 +236,8 @@ wlcore_set_scan_chan_params(struct wl1271 *wl, | |||
219 | false, false, | 236 | false, false, |
220 | cfg->passive[0], | 237 | cfg->passive[0], |
221 | MAX_CHANNELS_2GHZ, | 238 | MAX_CHANNELS_2GHZ, |
222 | &n_pactive_ch); | 239 | &n_pactive_ch, |
240 | scan_type); | ||
223 | cfg->passive[1] = | 241 | cfg->passive[1] = |
224 | wlcore_scan_get_channels(wl, | 242 | wlcore_scan_get_channels(wl, |
225 | channels, | 243 | channels, |
@@ -229,7 +247,8 @@ wlcore_set_scan_chan_params(struct wl1271 *wl, | |||
229 | IEEE80211_BAND_5GHZ, | 247 | IEEE80211_BAND_5GHZ, |
230 | false, true, 0, | 248 | false, true, 0, |
231 | wl->max_channels_5, | 249 | wl->max_channels_5, |
232 | &n_pactive_ch); | 250 | &n_pactive_ch, |
251 | scan_type); | ||
233 | cfg->dfs = | 252 | cfg->dfs = |
234 | wlcore_scan_get_channels(wl, | 253 | wlcore_scan_get_channels(wl, |
235 | channels, | 254 | channels, |
@@ -240,7 +259,8 @@ wlcore_set_scan_chan_params(struct wl1271 *wl, | |||
240 | true, true, | 259 | true, true, |
241 | cfg->passive[1], | 260 | cfg->passive[1], |
242 | wl->max_channels_5, | 261 | wl->max_channels_5, |
243 | &n_pactive_ch); | 262 | &n_pactive_ch, |
263 | scan_type); | ||
244 | cfg->active[1] = | 264 | cfg->active[1] = |
245 | wlcore_scan_get_channels(wl, | 265 | wlcore_scan_get_channels(wl, |
246 | channels, | 266 | channels, |
@@ -251,7 +271,8 @@ wlcore_set_scan_chan_params(struct wl1271 *wl, | |||
251 | false, false, | 271 | false, false, |
252 | cfg->passive[1] + cfg->dfs, | 272 | cfg->passive[1] + cfg->dfs, |
253 | wl->max_channels_5, | 273 | wl->max_channels_5, |
254 | &n_pactive_ch); | 274 | &n_pactive_ch, |
275 | scan_type); | ||
255 | 276 | ||
256 | /* 802.11j channels are not supported yet */ | 277 | /* 802.11j channels are not supported yet */ |
257 | cfg->passive[2] = 0; | 278 | cfg->passive[2] = 0; |
diff --git a/drivers/net/wireless/ti/wlcore/scan.h b/drivers/net/wireless/ti/wlcore/scan.h index 8465f35c6a06..9ae606555aeb 100644 --- a/drivers/net/wireless/ti/wlcore/scan.h +++ b/drivers/net/wireless/ti/wlcore/scan.h | |||
@@ -150,12 +150,19 @@ struct wlcore_scan_channels { | |||
150 | struct conn_scan_ch_params channels_4[MAX_CHANNELS_4GHZ]; | 150 | struct conn_scan_ch_params channels_4[MAX_CHANNELS_4GHZ]; |
151 | }; | 151 | }; |
152 | 152 | ||
153 | enum { | ||
154 | SCAN_TYPE_SEARCH = 0, | ||
155 | SCAN_TYPE_PERIODIC = 1, | ||
156 | SCAN_TYPE_TRACKING = 2, | ||
157 | }; | ||
158 | |||
153 | bool | 159 | bool |
154 | wlcore_set_scan_chan_params(struct wl1271 *wl, | 160 | wlcore_set_scan_chan_params(struct wl1271 *wl, |
155 | struct wlcore_scan_channels *cfg, | 161 | struct wlcore_scan_channels *cfg, |
156 | struct ieee80211_channel *channels[], | 162 | struct ieee80211_channel *channels[], |
157 | u32 n_channels, | 163 | u32 n_channels, |
158 | u32 n_ssids); | 164 | u32 n_ssids, |
165 | int scan_type); | ||
159 | 166 | ||
160 | int | 167 | int |
161 | wlcore_scan_sched_scan_ssid_list(struct wl1271 *wl, | 168 | wlcore_scan_sched_scan_ssid_list(struct wl1271 *wl, |