wl12xx: use SCAN_SSID_TYPE_PUBLIC when using the wildcard in sched_scan
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / drivers / net / wireless / wl12xx / scan.c
blobaf4ad2353f59ef45ddc897a299529ee7748f3a24
1 /*
2 * This file is part of wl1271
4 * Copyright (C) 2009-2010 Nokia Corporation
6 * Contact: Luciano Coelho <luciano.coelho@nokia.com>
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * version 2 as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA
24 #include <linux/ieee80211.h>
26 #include "wl12xx.h"
27 #include "cmd.h"
28 #include "scan.h"
29 #include "acx.h"
30 #include "ps.h"
32 void wl1271_scan_complete_work(struct work_struct *work)
34 struct delayed_work *dwork;
35 struct wl1271 *wl;
36 int ret;
37 bool is_sta, is_ibss;
39 dwork = container_of(work, struct delayed_work, work);
40 wl = container_of(dwork, struct wl1271, scan_complete_work);
42 wl1271_debug(DEBUG_SCAN, "Scanning complete");
44 mutex_lock(&wl->mutex);
46 if (wl->state == WL1271_STATE_OFF)
47 goto out;
49 if (wl->scan.state == WL1271_SCAN_STATE_IDLE)
50 goto out;
52 wl->scan.state = WL1271_SCAN_STATE_IDLE;
53 memset(wl->scan.scanned_ch, 0, sizeof(wl->scan.scanned_ch));
54 wl->scan.req = NULL;
56 ret = wl1271_ps_elp_wakeup(wl);
57 if (ret < 0)
58 goto out;
60 if (test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags)) {
61 /* restore hardware connection monitoring template */
62 wl1271_cmd_build_ap_probe_req(wl, wl->probereq);
65 /* return to ROC if needed */
66 is_sta = (wl->bss_type == BSS_TYPE_STA_BSS);
67 is_ibss = (wl->bss_type == BSS_TYPE_IBSS);
68 if ((is_sta && !test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags)) ||
69 (is_ibss && !test_bit(WL1271_FLAG_IBSS_JOINED, &wl->flags))) {
70 /* restore remain on channel */
71 wl12xx_cmd_role_start_dev(wl);
72 wl12xx_roc(wl, wl->dev_role_id);
74 wl1271_ps_elp_sleep(wl);
76 if (wl->scan.failed) {
77 wl1271_info("Scan completed due to error.");
78 wl12xx_queue_recovery_work(wl);
81 ieee80211_scan_completed(wl->hw, false);
83 out:
84 mutex_unlock(&wl->mutex);
89 static int wl1271_get_scan_channels(struct wl1271 *wl,
90 struct cfg80211_scan_request *req,
91 struct basic_scan_channel_params *channels,
92 enum ieee80211_band band, bool passive)
94 struct conf_scan_settings *c = &wl->conf.scan;
95 int i, j;
96 u32 flags;
98 for (i = 0, j = 0;
99 i < req->n_channels && j < WL1271_SCAN_MAX_CHANNELS;
100 i++) {
102 flags = req->channels[i]->flags;
104 if (!test_bit(i, wl->scan.scanned_ch) &&
105 !(flags & IEEE80211_CHAN_DISABLED) &&
106 ((!!(flags & IEEE80211_CHAN_PASSIVE_SCAN)) == passive) &&
107 (req->channels[i]->band == band)) {
109 wl1271_debug(DEBUG_SCAN, "band %d, center_freq %d ",
110 req->channels[i]->band,
111 req->channels[i]->center_freq);
112 wl1271_debug(DEBUG_SCAN, "hw_value %d, flags %X",
113 req->channels[i]->hw_value,
114 req->channels[i]->flags);
115 wl1271_debug(DEBUG_SCAN,
116 "max_antenna_gain %d, max_power %d",
117 req->channels[i]->max_antenna_gain,
118 req->channels[i]->max_power);
119 wl1271_debug(DEBUG_SCAN, "beacon_found %d",
120 req->channels[i]->beacon_found);
122 if (!passive) {
123 channels[j].min_duration =
124 cpu_to_le32(c->min_dwell_time_active);
125 channels[j].max_duration =
126 cpu_to_le32(c->max_dwell_time_active);
127 } else {
128 channels[j].min_duration =
129 cpu_to_le32(c->min_dwell_time_passive);
130 channels[j].max_duration =
131 cpu_to_le32(c->max_dwell_time_passive);
133 channels[j].early_termination = 0;
134 channels[j].tx_power_att = req->channels[i]->max_power;
135 channels[j].channel = req->channels[i]->hw_value;
137 memset(&channels[j].bssid_lsb, 0xff, 4);
138 memset(&channels[j].bssid_msb, 0xff, 2);
140 /* Mark the channels we already used */
141 set_bit(i, wl->scan.scanned_ch);
143 j++;
147 return j;
150 #define WL1271_NOTHING_TO_SCAN 1
152 static int wl1271_scan_send(struct wl1271 *wl, enum ieee80211_band band,
153 bool passive, u32 basic_rate)
155 struct wl1271_cmd_scan *cmd;
156 struct wl1271_cmd_trigger_scan_to *trigger;
157 int ret;
158 u16 scan_options = 0;
160 cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
161 trigger = kzalloc(sizeof(*trigger), GFP_KERNEL);
162 if (!cmd || !trigger) {
163 ret = -ENOMEM;
164 goto out;
167 /* We always use high priority scans */
168 scan_options = WL1271_SCAN_OPT_PRIORITY_HIGH;
170 /* No SSIDs means that we have a forced passive scan */
171 if (passive || wl->scan.req->n_ssids == 0)
172 scan_options |= WL1271_SCAN_OPT_PASSIVE;
174 if (WARN_ON(wl->role_id == WL12XX_INVALID_ROLE_ID)) {
175 ret = -EINVAL;
176 goto out;
178 cmd->params.role_id = wl->role_id;
179 cmd->params.scan_options = cpu_to_le16(scan_options);
181 cmd->params.n_ch = wl1271_get_scan_channels(wl, wl->scan.req,
182 cmd->channels,
183 band, passive);
184 if (cmd->params.n_ch == 0) {
185 ret = WL1271_NOTHING_TO_SCAN;
186 goto out;
189 cmd->params.tx_rate = cpu_to_le32(basic_rate);
190 cmd->params.n_probe_reqs = wl->conf.scan.num_probe_reqs;
191 cmd->params.tx_rate = cpu_to_le32(basic_rate);
192 cmd->params.tid_trigger = 0;
193 cmd->params.scan_tag = WL1271_SCAN_DEFAULT_TAG;
195 if (band == IEEE80211_BAND_2GHZ)
196 cmd->params.band = WL1271_SCAN_BAND_2_4_GHZ;
197 else
198 cmd->params.band = WL1271_SCAN_BAND_5_GHZ;
200 if (wl->scan.ssid_len && wl->scan.ssid) {
201 cmd->params.ssid_len = wl->scan.ssid_len;
202 memcpy(cmd->params.ssid, wl->scan.ssid, wl->scan.ssid_len);
205 memcpy(cmd->addr, wl->mac_addr, ETH_ALEN);
207 ret = wl1271_cmd_build_probe_req(wl, wl->scan.ssid, wl->scan.ssid_len,
208 wl->scan.req->ie, wl->scan.req->ie_len,
209 band);
210 if (ret < 0) {
211 wl1271_error("PROBE request template failed");
212 goto out;
215 /* disable the timeout */
216 trigger->timeout = 0;
217 ret = wl1271_cmd_send(wl, CMD_TRIGGER_SCAN_TO, trigger,
218 sizeof(*trigger), 0);
219 if (ret < 0) {
220 wl1271_error("trigger scan to failed for hw scan");
221 goto out;
224 wl1271_dump(DEBUG_SCAN, "SCAN: ", cmd, sizeof(*cmd));
226 ret = wl1271_cmd_send(wl, CMD_SCAN, cmd, sizeof(*cmd), 0);
227 if (ret < 0) {
228 wl1271_error("SCAN failed");
229 goto out;
232 out:
233 kfree(cmd);
234 kfree(trigger);
235 return ret;
238 void wl1271_scan_stm(struct wl1271 *wl)
240 int ret = 0;
242 switch (wl->scan.state) {
243 case WL1271_SCAN_STATE_IDLE:
244 break;
246 case WL1271_SCAN_STATE_2GHZ_ACTIVE:
247 ret = wl1271_scan_send(wl, IEEE80211_BAND_2GHZ, false,
248 wl->conf.tx.basic_rate);
249 if (ret == WL1271_NOTHING_TO_SCAN) {
250 wl->scan.state = WL1271_SCAN_STATE_2GHZ_PASSIVE;
251 wl1271_scan_stm(wl);
254 break;
256 case WL1271_SCAN_STATE_2GHZ_PASSIVE:
257 ret = wl1271_scan_send(wl, IEEE80211_BAND_2GHZ, true,
258 wl->conf.tx.basic_rate);
259 if (ret == WL1271_NOTHING_TO_SCAN) {
260 if (wl->enable_11a)
261 wl->scan.state = WL1271_SCAN_STATE_5GHZ_ACTIVE;
262 else
263 wl->scan.state = WL1271_SCAN_STATE_DONE;
264 wl1271_scan_stm(wl);
267 break;
269 case WL1271_SCAN_STATE_5GHZ_ACTIVE:
270 ret = wl1271_scan_send(wl, IEEE80211_BAND_5GHZ, false,
271 wl->conf.tx.basic_rate_5);
272 if (ret == WL1271_NOTHING_TO_SCAN) {
273 wl->scan.state = WL1271_SCAN_STATE_5GHZ_PASSIVE;
274 wl1271_scan_stm(wl);
277 break;
279 case WL1271_SCAN_STATE_5GHZ_PASSIVE:
280 ret = wl1271_scan_send(wl, IEEE80211_BAND_5GHZ, true,
281 wl->conf.tx.basic_rate_5);
282 if (ret == WL1271_NOTHING_TO_SCAN) {
283 wl->scan.state = WL1271_SCAN_STATE_DONE;
284 wl1271_scan_stm(wl);
287 break;
289 case WL1271_SCAN_STATE_DONE:
290 wl->scan.failed = false;
291 cancel_delayed_work(&wl->scan_complete_work);
292 ieee80211_queue_delayed_work(wl->hw, &wl->scan_complete_work,
293 msecs_to_jiffies(0));
294 break;
296 default:
297 wl1271_error("invalid scan state");
298 break;
301 if (ret < 0) {
302 cancel_delayed_work(&wl->scan_complete_work);
303 ieee80211_queue_delayed_work(wl->hw, &wl->scan_complete_work,
304 msecs_to_jiffies(0));
308 int wl1271_scan(struct wl1271 *wl, const u8 *ssid, size_t ssid_len,
309 struct cfg80211_scan_request *req)
312 * cfg80211 should guarantee that we don't get more channels
313 * than what we have registered.
315 BUG_ON(req->n_channels > WL1271_MAX_CHANNELS);
317 if (wl->scan.state != WL1271_SCAN_STATE_IDLE)
318 return -EBUSY;
320 wl->scan.state = WL1271_SCAN_STATE_2GHZ_ACTIVE;
322 if (ssid_len && ssid) {
323 wl->scan.ssid_len = ssid_len;
324 memcpy(wl->scan.ssid, ssid, ssid_len);
325 } else {
326 wl->scan.ssid_len = 0;
329 wl->scan.req = req;
330 memset(wl->scan.scanned_ch, 0, sizeof(wl->scan.scanned_ch));
332 /* we assume failure so that timeout scenarios are handled correctly */
333 wl->scan.failed = true;
334 ieee80211_queue_delayed_work(wl->hw, &wl->scan_complete_work,
335 msecs_to_jiffies(WL1271_SCAN_TIMEOUT));
337 wl1271_scan_stm(wl);
339 return 0;
342 int wl1271_scan_stop(struct wl1271 *wl)
344 struct wl1271_cmd_header *cmd = NULL;
345 int ret = 0;
347 if (WARN_ON(wl->scan.state == WL1271_SCAN_STATE_IDLE))
348 return -EINVAL;
350 wl1271_debug(DEBUG_CMD, "cmd scan stop");
352 cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
353 if (!cmd) {
354 ret = -ENOMEM;
355 goto out;
358 ret = wl1271_cmd_send(wl, CMD_STOP_SCAN, cmd,
359 sizeof(*cmd), 0);
360 if (ret < 0) {
361 wl1271_error("cmd stop_scan failed");
362 goto out;
364 out:
365 kfree(cmd);
366 return ret;
369 static int
370 wl1271_scan_get_sched_scan_channels(struct wl1271 *wl,
371 struct cfg80211_sched_scan_request *req,
372 struct conn_scan_ch_params *channels,
373 u32 band, bool radar, bool passive,
374 int start, int max_channels)
376 struct conf_sched_scan_settings *c = &wl->conf.sched_scan;
377 int i, j;
378 u32 flags;
379 bool force_passive = !req->n_ssids;
381 for (i = 0, j = start;
382 i < req->n_channels && j < max_channels;
383 i++) {
384 flags = req->channels[i]->flags;
386 if (force_passive)
387 flags |= IEEE80211_CHAN_PASSIVE_SCAN;
389 if ((req->channels[i]->band == band) &&
390 !(flags & IEEE80211_CHAN_DISABLED) &&
391 (!!(flags & IEEE80211_CHAN_RADAR) == radar) &&
392 /* if radar is set, we ignore the passive flag */
393 (radar ||
394 !!(flags & IEEE80211_CHAN_PASSIVE_SCAN) == passive)) {
395 wl1271_debug(DEBUG_SCAN, "band %d, center_freq %d ",
396 req->channels[i]->band,
397 req->channels[i]->center_freq);
398 wl1271_debug(DEBUG_SCAN, "hw_value %d, flags %X",
399 req->channels[i]->hw_value,
400 req->channels[i]->flags);
401 wl1271_debug(DEBUG_SCAN, "max_power %d",
402 req->channels[i]->max_power);
404 if (flags & IEEE80211_CHAN_RADAR) {
405 channels[j].flags |= SCAN_CHANNEL_FLAGS_DFS;
406 channels[j].passive_duration =
407 cpu_to_le16(c->dwell_time_dfs);
409 else if (flags & IEEE80211_CHAN_PASSIVE_SCAN) {
410 channels[j].passive_duration =
411 cpu_to_le16(c->dwell_time_passive);
412 } else {
413 channels[j].min_duration =
414 cpu_to_le16(c->min_dwell_time_active);
415 channels[j].max_duration =
416 cpu_to_le16(c->max_dwell_time_active);
418 channels[j].tx_power_att = req->channels[i]->max_power;
419 channels[j].channel = req->channels[i]->hw_value;
421 j++;
425 return j - start;
428 static bool
429 wl1271_scan_sched_scan_channels(struct wl1271 *wl,
430 struct cfg80211_sched_scan_request *req,
431 struct wl1271_cmd_sched_scan_config *cfg)
433 cfg->passive[0] =
434 wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_2,
435 IEEE80211_BAND_2GHZ,
436 false, true, 0,
437 MAX_CHANNELS_2GHZ);
438 cfg->active[0] =
439 wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_2,
440 IEEE80211_BAND_2GHZ,
441 false, false,
442 cfg->passive[0],
443 MAX_CHANNELS_2GHZ);
444 cfg->passive[1] =
445 wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_5,
446 IEEE80211_BAND_5GHZ,
447 false, true, 0,
448 MAX_CHANNELS_5GHZ);
449 cfg->dfs =
450 wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_5,
451 IEEE80211_BAND_5GHZ,
452 true, true,
453 cfg->passive[1],
454 MAX_CHANNELS_5GHZ);
455 cfg->active[1] =
456 wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_5,
457 IEEE80211_BAND_5GHZ,
458 false, false,
459 cfg->passive[1] + cfg->dfs,
460 MAX_CHANNELS_5GHZ);
461 /* 802.11j channels are not supported yet */
462 cfg->passive[2] = 0;
463 cfg->active[2] = 0;
465 wl1271_debug(DEBUG_SCAN, " 2.4GHz: active %d passive %d",
466 cfg->active[0], cfg->passive[0]);
467 wl1271_debug(DEBUG_SCAN, " 5GHz: active %d passive %d",
468 cfg->active[1], cfg->passive[1]);
469 wl1271_debug(DEBUG_SCAN, " DFS: %d", cfg->dfs);
471 return cfg->passive[0] || cfg->active[0] ||
472 cfg->passive[1] || cfg->active[1] || cfg->dfs ||
473 cfg->passive[2] || cfg->active[2];
476 /* Returns 0 if no wildcard is used, 1 if wildcard is used or a
477 * negative value on error */
478 static int
479 wl12xx_scan_sched_scan_ssid_list(struct wl1271 *wl,
480 struct cfg80211_sched_scan_request *req)
482 struct wl1271_cmd_sched_scan_ssid_list *cmd = NULL;
483 struct cfg80211_ssid *ssid = req->ssids;
484 int ret, wildcard = 0;
486 wl1271_debug(DEBUG_CMD, "cmd sched scan ssid list");
488 cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
489 if (!cmd)
490 return -ENOMEM;
492 while ((cmd->n_ssids < req->n_ssids) && ssid) {
493 if (ssid->ssid_len == 0) {
494 wildcard = 1;
495 cmd->ssids[cmd->n_ssids].type = SCAN_SSID_TYPE_PUBLIC;
496 } else {
497 cmd->ssids[cmd->n_ssids].type = SCAN_SSID_TYPE_HIDDEN;
499 cmd->ssids[cmd->n_ssids].len = ssid->ssid_len;
500 memcpy(cmd->ssids[cmd->n_ssids].ssid, ssid->ssid,
501 ssid->ssid_len);
502 ssid++;
503 cmd->n_ssids++;
506 wl1271_dump(DEBUG_SCAN, "SSID_LIST: ", cmd, sizeof(*cmd));
508 ret = wl1271_cmd_send(wl, CMD_CONNECTION_SCAN_SSID_CFG, cmd,
509 sizeof(*cmd), 0);
510 if (ret < 0) {
511 wl1271_error("cmd sched scan ssid list failed");
512 goto out;
515 ret = wildcard;
516 out:
517 kfree(cmd);
518 return ret;
521 int wl1271_scan_sched_scan_config(struct wl1271 *wl,
522 struct cfg80211_sched_scan_request *req,
523 struct ieee80211_sched_scan_ies *ies)
525 struct wl1271_cmd_sched_scan_config *cfg = NULL;
526 struct conf_sched_scan_settings *c = &wl->conf.sched_scan;
527 int i, ret;
528 bool force_passive = !req->n_ssids;
530 wl1271_debug(DEBUG_CMD, "cmd sched_scan scan config");
532 cfg = kzalloc(sizeof(*cfg), GFP_KERNEL);
533 if (!cfg)
534 return -ENOMEM;
536 cfg->rssi_threshold = c->rssi_threshold;
537 cfg->snr_threshold = c->snr_threshold;
538 cfg->n_probe_reqs = c->num_probe_reqs;
539 /* cycles set to 0 it means infinite (until manually stopped) */
540 cfg->cycles = 0;
541 /* report APs when at least 1 is found */
542 cfg->report_after = 1;
543 /* don't stop scanning automatically when something is found */
544 cfg->terminate = 0;
545 cfg->tag = WL1271_SCAN_DEFAULT_TAG;
546 /* don't filter on BSS type */
547 cfg->bss_type = SCAN_BSS_TYPE_ANY;
548 /* currently NL80211 supports only a single interval */
549 for (i = 0; i < SCAN_MAX_CYCLE_INTERVALS; i++)
550 cfg->intervals[i] = cpu_to_le32(req->interval);
552 cfg->ssid_len = 0;
553 if (req->n_ssids == 0) {
554 wl1271_debug(DEBUG_SCAN, "using SCAN_SSID_FILTER_ANY");
555 cfg->filter_type = SCAN_SSID_FILTER_ANY;
556 } else {
557 ret = wl12xx_scan_sched_scan_ssid_list(wl, req);
558 if (ret < 0)
559 goto out;
560 if (ret) {
561 wl1271_debug(DEBUG_SCAN, "using SCAN_SSID_FILTER_DISABLED");
562 cfg->filter_type = SCAN_SSID_FILTER_DISABLED;
563 } else {
564 wl1271_debug(DEBUG_SCAN, "using SCAN_SSID_FILTER_LIST");
565 cfg->filter_type = SCAN_SSID_FILTER_LIST;
569 if (!wl1271_scan_sched_scan_channels(wl, req, cfg)) {
570 wl1271_error("scan channel list is empty");
571 ret = -EINVAL;
572 goto out;
575 if (!force_passive && cfg->active[0]) {
576 ret = wl1271_cmd_build_probe_req(wl, req->ssids[0].ssid,
577 req->ssids[0].ssid_len,
578 ies->ie[IEEE80211_BAND_2GHZ],
579 ies->len[IEEE80211_BAND_2GHZ],
580 IEEE80211_BAND_2GHZ);
581 if (ret < 0) {
582 wl1271_error("2.4GHz PROBE request template failed");
583 goto out;
587 if (!force_passive && cfg->active[1]) {
588 ret = wl1271_cmd_build_probe_req(wl, req->ssids[0].ssid,
589 req->ssids[0].ssid_len,
590 ies->ie[IEEE80211_BAND_5GHZ],
591 ies->len[IEEE80211_BAND_5GHZ],
592 IEEE80211_BAND_5GHZ);
593 if (ret < 0) {
594 wl1271_error("5GHz PROBE request template failed");
595 goto out;
599 wl1271_dump(DEBUG_SCAN, "SCAN_CFG: ", cfg, sizeof(*cfg));
601 ret = wl1271_cmd_send(wl, CMD_CONNECTION_SCAN_CFG, cfg,
602 sizeof(*cfg), 0);
603 if (ret < 0) {
604 wl1271_error("SCAN configuration failed");
605 goto out;
607 out:
608 kfree(cfg);
609 return ret;
612 int wl1271_scan_sched_scan_start(struct wl1271 *wl)
614 struct wl1271_cmd_sched_scan_start *start;
615 int ret = 0;
617 wl1271_debug(DEBUG_CMD, "cmd periodic scan start");
619 if (wl->bss_type != BSS_TYPE_STA_BSS)
620 return -EOPNOTSUPP;
622 if (!test_bit(WL1271_FLAG_IDLE, &wl->flags))
623 return -EBUSY;
625 start = kzalloc(sizeof(*start), GFP_KERNEL);
626 if (!start)
627 return -ENOMEM;
629 start->tag = WL1271_SCAN_DEFAULT_TAG;
631 ret = wl1271_cmd_send(wl, CMD_START_PERIODIC_SCAN, start,
632 sizeof(*start), 0);
633 if (ret < 0) {
634 wl1271_error("failed to send scan start command");
635 goto out_free;
638 out_free:
639 kfree(start);
640 return ret;
643 void wl1271_scan_sched_scan_results(struct wl1271 *wl)
645 wl1271_debug(DEBUG_SCAN, "got periodic scan results");
647 ieee80211_sched_scan_results(wl->hw);
650 void wl1271_scan_sched_scan_stop(struct wl1271 *wl)
652 struct wl1271_cmd_sched_scan_stop *stop;
653 int ret = 0;
655 wl1271_debug(DEBUG_CMD, "cmd periodic scan stop");
657 /* FIXME: what to do if alloc'ing to stop fails? */
658 stop = kzalloc(sizeof(*stop), GFP_KERNEL);
659 if (!stop) {
660 wl1271_error("failed to alloc memory to send sched scan stop");
661 return;
664 stop->tag = WL1271_SCAN_DEFAULT_TAG;
666 ret = wl1271_cmd_send(wl, CMD_STOP_PERIODIC_SCAN, stop,
667 sizeof(*stop), 0);
668 if (ret < 0) {
669 wl1271_error("failed to send sched scan stop command");
670 goto out_free;
672 wl->sched_scanning = false;
674 out_free:
675 kfree(stop);