56 wlvif = wl12xx_vif_to_data(vif);
80 if (wl->
scan.failed) {
93 static int wl1271_get_scan_channels(
struct wl1271 *
wl,
124 "max_antenna_gain %d, max_power %d",
145 memset(&channels[j].bssid_lsb, 0xff, 4);
146 memset(&channels[j].bssid_msb, 0xff, 2);
158 #define WL1271_NOTHING_TO_SCAN 1
162 bool passive,
u32 basic_rate)
164 struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
168 u16 scan_options = 0;
171 if (!passive && wl->
scan.req->n_ssids == 0)
175 trigger = kzalloc(
sizeof(*trigger),
GFP_KERNEL);
176 if (!cmd || !trigger) {
181 if (wl->
conf.scan.split_scan_timeout)
196 cmd->
params.n_ch = wl1271_get_scan_channels(wl, wl->
scan.req,
199 if (cmd->
params.n_ch == 0) {
205 cmd->
params.n_probe_reqs = wl->
conf.scan.num_probe_reqs;
214 if (wl->
scan.ssid_len && wl->
scan.ssid) {
222 cmd->
params.role_id, band,
225 wl->
scan.req->ie_len,
false);
233 sizeof(*trigger), 0);
255 struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
260 switch (wl->
scan.state) {
267 if (wl->
scan.req->no_cck) {
273 ret = wl1271_scan_send(wl, vif, band,
false, rate);
284 if (wl->
scan.req->no_cck) {
290 ret = wl1271_scan_send(wl, vif, band,
true, rate);
304 ret = wl1271_scan_send(wl, vif, band,
false, rate);
315 ret = wl1271_scan_send(wl, vif, band,
true, rate);
324 wl->
scan.failed =
false;
357 if (ssid_len && ssid) {
361 wl->
scan.ssid_len = 0;
369 wl->
scan.failed =
true;
406 wl1271_scan_get_sched_scan_channels(
struct wl1271 *wl,
409 u32 band,
bool radar,
bool passive,
410 int start,
int max_channels,
416 bool force_passive = !req->
n_ssids;
417 u32 min_dwell_time_active, max_dwell_time_active, delta_per_probe;
430 min_dwell_time_active =
DIV_ROUND_UP(min_dwell_time_active, 1000);
431 max_dwell_time_active =
DIV_ROUND_UP(max_dwell_time_active, 1000);
435 for (i = 0, j = start;
443 if ((req->
channels[i]->band == band) &&
458 min_dwell_time_active,
459 max_dwell_time_active);
461 if (flags & IEEE80211_CHAN_RADAR) {
482 (flags & IEEE80211_CHAN_PASSIVE_SCAN) &&
504 wl1271_scan_sched_scan_channels(
struct wl1271 *wl,
511 wl1271_scan_get_sched_scan_channels(wl, req, cfg->
channels_2,
517 wl1271_scan_get_sched_scan_channels(wl, req, cfg->
channels_2,
524 wl1271_scan_get_sched_scan_channels(wl, req, cfg->
channels_5,
530 wl1271_scan_get_sched_scan_channels(wl, req, cfg->
channels_5,
537 wl1271_scan_get_sched_scan_channels(wl, req, cfg->
channels_5,
562 wl12xx_scan_sched_scan_ssid_list(
struct wl1271 *wl,
569 int ret = 0,
type,
i,
j, n_match_ssids = 0;
575 if (sets[i].
ssid.ssid_len > 0)
579 if (!n_match_ssids &&
593 if (!n_match_ssids) {
597 for (i = 0; i < req->
n_ssids; i++) {
611 if (!sets[i].
ssid.ssid_len)
617 sets[i].
ssid.ssid, sets[i].
ssid.ssid_len);
626 for (i = 0; i < req->
n_ssids; i++) {
627 if (!req->
ssids[i].ssid_len)
630 for (j = 0; j < cmd->
n_ssids; j++)
631 if ((req->
ssids[i].ssid_len ==
632 cmd->
ssids[j].len) &&
635 req->
ssids[i].ssid_len)) {
674 bool force_passive = !req->
n_ssids;
700 ret = wl12xx_scan_sched_scan_ssid_list(wl, wlvif, req);
708 if (!wl1271_scan_sched_scan_channels(wl, req, cfg)) {
714 if (!force_passive && cfg->
active[0]) {
719 req->
ssids[0].ssid_len,
721 ies->
len[band],
true);
728 if (!force_passive && cfg->
active[1]) {
733 req->
ssids[0].ssid_len,
735 ies->
len[band],
true);
805 wl1271_error(
"failed to alloc memory to send sched scan stop");