Lines Matching +full:in +full:- +full:band

1 // SPDX-License-Identifier: GPL-2.0-only
4 * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.
9 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
22 #define IWL_ACTIVE_DWELL_TIME_24 (30) /* all times in msec */
31 #define IWL_PASSIVE_DWELL_TIME_24 (20) /* all times in msec */
52 if (!test_bit(STATUS_READY, &priv->status) || in iwl_send_scan_abort()
53 !test_bit(STATUS_SCAN_HW, &priv->status) || in iwl_send_scan_abort()
54 test_bit(STATUS_FW_ERROR, &priv->status)) in iwl_send_scan_abort()
55 return -EIO; in iwl_send_scan_abort()
61 status = (void *)cmd.resp_pkt->data; in iwl_send_scan_abort()
65 * due to simply not being in an active scan which in iwl_send_scan_abort()
71 ret = -EIO; in iwl_send_scan_abort()
85 if (priv->scan_request) { in iwl_complete_scan()
86 IWL_DEBUG_SCAN(priv, "Complete scan in mac80211\n"); in iwl_complete_scan()
87 ieee80211_scan_completed(priv->hw, &info); in iwl_complete_scan()
90 priv->scan_type = IWL_SCAN_NORMAL; in iwl_complete_scan()
91 priv->scan_vif = NULL; in iwl_complete_scan()
92 priv->scan_request = NULL; in iwl_complete_scan()
99 lockdep_assert_held(&priv->mutex); in iwl_process_scan_complete()
101 if (!test_and_clear_bit(STATUS_SCAN_COMPLETE, &priv->status)) in iwl_process_scan_complete()
106 cancel_delayed_work(&priv->scan_check); in iwl_process_scan_complete()
108 aborted = test_and_clear_bit(STATUS_SCAN_ABORTING, &priv->status); in iwl_process_scan_complete()
112 if (!test_and_clear_bit(STATUS_SCANNING, &priv->status)) { in iwl_process_scan_complete()
117 if (priv->scan_type != IWL_SCAN_NORMAL && !aborted) { in iwl_process_scan_complete()
121 if (priv->scan_request == NULL) in iwl_process_scan_complete()
125 err = iwl_scan_initiate(priv, priv->scan_vif, IWL_SCAN_NORMAL, in iwl_process_scan_complete()
126 priv->scan_request->channels[0]->band); in iwl_process_scan_complete()
150 lockdep_assert_held(&priv->mutex); in iwl_force_scan_end()
152 if (!test_bit(STATUS_SCANNING, &priv->status)) { in iwl_force_scan_end()
158 clear_bit(STATUS_SCANNING, &priv->status); in iwl_force_scan_end()
159 clear_bit(STATUS_SCAN_HW, &priv->status); in iwl_force_scan_end()
160 clear_bit(STATUS_SCAN_ABORTING, &priv->status); in iwl_force_scan_end()
161 clear_bit(STATUS_SCAN_COMPLETE, &priv->status); in iwl_force_scan_end()
169 lockdep_assert_held(&priv->mutex); in iwl_do_scan_abort()
171 if (!test_bit(STATUS_SCANNING, &priv->status)) { in iwl_do_scan_abort()
176 if (test_and_set_bit(STATUS_SCAN_ABORTING, &priv->status)) { in iwl_do_scan_abort()
177 IWL_DEBUG_SCAN(priv, "Scan abort in progress\n"); in iwl_do_scan_abort()
190 * iwl_scan_cancel - Cancel any currently executing HW scan
195 queue_work(priv->workqueue, &priv->abort_scan); in iwl_scan_cancel()
200 * iwl_scan_cancel_timeout - Cancel any currently executing HW scan
201 * @ms: amount of time to wait (in milliseconds) for scan to abort
207 lockdep_assert_held(&priv->mutex); in iwl_scan_cancel_timeout()
214 if (!test_bit(STATUS_SCAN_HW, &priv->status)) in iwl_scan_cancel_timeout()
241 struct iwl_scanreq_notification *notif = (void *)pkt->data; in iwl_rx_reply_scan()
243 IWL_DEBUG_SCAN(priv, "Scan request status = 0x%x\n", notif->status); in iwl_rx_reply_scan()
252 struct iwl_scanstart_notification *notif = (void *)pkt->data; in iwl_rx_scan_start_notif()
254 priv->scan_start_tsf = le32_to_cpu(notif->tsf_low); in iwl_rx_scan_start_notif()
257 "(TSF: 0x%08X:%08X) - %d (beacon timer %u)\n", in iwl_rx_scan_start_notif()
258 notif->channel, in iwl_rx_scan_start_notif()
259 notif->band ? "bg" : "a", in iwl_rx_scan_start_notif()
260 le32_to_cpu(notif->tsf_high), in iwl_rx_scan_start_notif()
261 le32_to_cpu(notif->tsf_low), in iwl_rx_scan_start_notif()
262 notif->status, notif->beacon_timer); in iwl_rx_scan_start_notif()
271 struct iwl_scanresults_notification *notif = (void *)pkt->data; in iwl_rx_scan_results_notif()
276 "(TSF: 0x%08X:%08X) - %d " in iwl_rx_scan_results_notif()
278 notif->channel, in iwl_rx_scan_results_notif()
279 notif->band ? "bg" : "a", in iwl_rx_scan_results_notif()
280 notif->probe_status, notif->num_probe_not_sent, in iwl_rx_scan_results_notif()
281 le32_to_cpu(notif->tsf_high), in iwl_rx_scan_results_notif()
282 le32_to_cpu(notif->tsf_low), in iwl_rx_scan_results_notif()
283 le32_to_cpu(notif->statistics[0]), in iwl_rx_scan_results_notif()
284 le32_to_cpu(notif->tsf_low) - priv->scan_start_tsf); in iwl_rx_scan_results_notif()
293 struct iwl_scancomplete_notification *scan_notif = (void *)pkt->data; in iwl_rx_scan_complete_notif()
295 IWL_DEBUG_SCAN(priv, "Scan complete: %d channels (TSF 0x%08X:%08X) - %d\n", in iwl_rx_scan_complete_notif()
296 scan_notif->scanned_channels, in iwl_rx_scan_complete_notif()
297 scan_notif->tsf_low, in iwl_rx_scan_complete_notif()
298 scan_notif->tsf_high, scan_notif->status); in iwl_rx_scan_complete_notif()
301 (priv->scan_band == NL80211_BAND_2GHZ) ? "2.4" : "5.2", in iwl_rx_scan_complete_notif()
302 jiffies_to_msecs(jiffies - priv->scan_start)); in iwl_rx_scan_complete_notif()
312 set_bit(STATUS_SCAN_COMPLETE, &priv->status); in iwl_rx_scan_complete_notif()
313 clear_bit(STATUS_SCAN_HW, &priv->status); in iwl_rx_scan_complete_notif()
314 queue_work(priv->workqueue, &priv->scan_completed); in iwl_rx_scan_complete_notif()
316 if (priv->iw_mode != NL80211_IFTYPE_ADHOC && in iwl_rx_scan_complete_notif()
318 priv->bt_status != scan_notif->bt_status) { in iwl_rx_scan_complete_notif()
319 if (scan_notif->bt_status) { in iwl_rx_scan_complete_notif()
321 if (!priv->bt_ch_announce) in iwl_rx_scan_complete_notif()
322 priv->bt_traffic_load = in iwl_rx_scan_complete_notif()
330 priv->bt_traffic_load = in iwl_rx_scan_complete_notif()
333 priv->bt_status = scan_notif->bt_status; in iwl_rx_scan_complete_notif()
334 queue_work(priv->workqueue, in iwl_rx_scan_complete_notif()
335 &priv->bt_traffic_change_work); in iwl_rx_scan_complete_notif()
342 priv->rx_handlers[REPLY_SCAN_CMD] = iwl_rx_reply_scan; in iwl_setup_rx_scan_handlers()
343 priv->rx_handlers[SCAN_START_NOTIFICATION] = iwl_rx_scan_start_notif; in iwl_setup_rx_scan_handlers()
344 priv->rx_handlers[SCAN_RESULTS_NOTIFICATION] = in iwl_setup_rx_scan_handlers()
346 priv->rx_handlers[SCAN_COMPLETE_NOTIFICATION] = in iwl_setup_rx_scan_handlers()
351 enum nl80211_band band, u8 n_probes) in iwl_get_active_dwell_time() argument
353 if (band == NL80211_BAND_5GHZ) in iwl_get_active_dwell_time()
374 * 1/2 of the minimum of them, because they might be in in iwl_limit_dwell()
375 * lock-step with the time inbetween only half of what in iwl_limit_dwell()
376 * time we'd have in each of them. in iwl_limit_dwell()
379 switch (ctx->staging.dev_type) { in iwl_limit_dwell()
393 * active in uCode even when not associated yet. in iwl_limit_dwell()
398 limits[n_active++] = ctx->beacon_int ?: IWL_PASSIVE_DWELL_BASE; in iwl_limit_dwell()
405 limit = (limits[1] * 98) / 100 - IWL_CHANNEL_TUNE_TIME * 2; in iwl_limit_dwell()
410 limit = (limits[0] * 98) / 100 - IWL_CHANNEL_TUNE_TIME * 2; in iwl_limit_dwell()
420 enum nl80211_band band) in iwl_get_passive_dwell_time() argument
422 u16 passive = (band == NL80211_BAND_2GHZ) ? in iwl_get_passive_dwell_time()
431 enum nl80211_band band) in iwl_get_single_channel_number() argument
433 struct ieee80211_supported_band *sband = priv->hw->wiphy->bands[band]; in iwl_get_single_channel_number()
437 for (i = 0; i < sband->n_channels; i++) { in iwl_get_single_channel_number()
441 busy = sband->channels[i].hw_value == in iwl_get_single_channel_number()
442 le16_to_cpu(ctx->staging.channel); in iwl_get_single_channel_number()
450 if (!(sband->channels[i].flags & IEEE80211_CHAN_DISABLED)) in iwl_get_single_channel_number()
451 return sband->channels[i].hw_value; in iwl_get_single_channel_number()
459 enum nl80211_band band, in iwl_get_channel_for_reset_scan() argument
465 sband = iwl_get_hw_mode(priv, band); in iwl_get_channel_for_reset_scan()
467 IWL_ERR(priv, "invalid band\n"); in iwl_get_channel_for_reset_scan()
471 channel = iwl_get_single_channel_number(priv, band); in iwl_get_channel_for_reset_scan()
473 scan_ch->channel = cpu_to_le16(channel); in iwl_get_channel_for_reset_scan()
474 scan_ch->type = SCAN_CHANNEL_TYPE_PASSIVE; in iwl_get_channel_for_reset_scan()
475 scan_ch->active_dwell = in iwl_get_channel_for_reset_scan()
477 scan_ch->passive_dwell = in iwl_get_channel_for_reset_scan()
480 scan_ch->dsp_atten = 110; in iwl_get_channel_for_reset_scan()
481 if (band == NL80211_BAND_5GHZ) in iwl_get_channel_for_reset_scan()
482 scan_ch->tx_gain = ((1 << 5) | (3 << 3)) | 3; in iwl_get_channel_for_reset_scan()
484 scan_ch->tx_gain = ((1 << 5) | (5 << 3)); in iwl_get_channel_for_reset_scan()
494 enum nl80211_band band, in iwl_get_channels_for_scan() argument
505 sband = iwl_get_hw_mode(priv, band); in iwl_get_channels_for_scan()
509 active_dwell = iwl_get_active_dwell_time(priv, band, n_probes); in iwl_get_channels_for_scan()
510 passive_dwell = iwl_get_passive_dwell_time(priv, band); in iwl_get_channels_for_scan()
515 for (i = 0, added = 0; i < priv->scan_request->n_channels; i++) { in iwl_get_channels_for_scan()
516 chan = priv->scan_request->channels[i]; in iwl_get_channels_for_scan()
518 if (chan->band != band) in iwl_get_channels_for_scan()
521 channel = chan->hw_value; in iwl_get_channels_for_scan()
522 scan_ch->channel = cpu_to_le16(channel); in iwl_get_channels_for_scan()
524 if (!is_active || (chan->flags & IEEE80211_CHAN_NO_IR)) in iwl_get_channels_for_scan()
525 scan_ch->type = SCAN_CHANNEL_TYPE_PASSIVE; in iwl_get_channels_for_scan()
527 scan_ch->type = SCAN_CHANNEL_TYPE_ACTIVE; in iwl_get_channels_for_scan()
530 scan_ch->type |= IWL_SCAN_PROBE_MASK(n_probes); in iwl_get_channels_for_scan()
532 scan_ch->active_dwell = cpu_to_le16(active_dwell); in iwl_get_channels_for_scan()
533 scan_ch->passive_dwell = cpu_to_le16(passive_dwell); in iwl_get_channels_for_scan()
536 scan_ch->dsp_atten = 110; in iwl_get_channels_for_scan()
540 * scan_ch->tx_gain = ((1 << 5) | (2 << 3)) | 3; in iwl_get_channels_for_scan()
542 if (band == NL80211_BAND_5GHZ) in iwl_get_channels_for_scan()
543 scan_ch->tx_gain = ((1 << 5) | (3 << 3)) | 3; in iwl_get_channels_for_scan()
545 scan_ch->tx_gain = ((1 << 5) | (5 << 3)); in iwl_get_channels_for_scan()
548 channel, le32_to_cpu(scan_ch->type), in iwl_get_channels_for_scan()
549 (scan_ch->type & SCAN_CHANNEL_TYPE_ACTIVE) ? in iwl_get_channels_for_scan()
551 (scan_ch->type & SCAN_CHANNEL_TYPE_ACTIVE) ? in iwl_get_channels_for_scan()
563 * iwl_fill_probe_req - fill in all required fields and IE for probe request
574 left -= 24; in iwl_fill_probe_req()
578 frame->frame_control = cpu_to_le16(IEEE80211_STYPE_PROBE_REQ); in iwl_fill_probe_req()
579 eth_broadcast_addr(frame->da); in iwl_fill_probe_req()
580 memcpy(frame->sa, ta, ETH_ALEN); in iwl_fill_probe_req()
581 eth_broadcast_addr(frame->bssid); in iwl_fill_probe_req()
582 frame->seq_ctrl = 0; in iwl_fill_probe_req()
587 pos = &frame->u.probe_req.variable[0]; in iwl_fill_probe_req()
589 /* fill in our SSID IE */ in iwl_fill_probe_req()
590 left -= ssid_len + 2; in iwl_fill_probe_req()
620 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS]; in iwlagn_request_scan()
624 enum nl80211_band band; in iwlagn_request_scan() local
626 u8 rx_ant = priv->nvm_data->valid_rx_ant; in iwlagn_request_scan()
631 u8 scan_tx_antennas = priv->nvm_data->valid_tx_ant; in iwlagn_request_scan()
635 priv->fw->ucode_capa.max_probe_length; in iwlagn_request_scan()
639 if (WARN_ON(priv->scan_type == IWL_SCAN_NORMAL && in iwlagn_request_scan()
640 (!priv->scan_request || in iwlagn_request_scan()
641 priv->scan_request->n_channels > MAX_SCAN_CHANNEL))) in iwlagn_request_scan()
642 return -EINVAL; in iwlagn_request_scan()
644 lockdep_assert_held(&priv->mutex); in iwlagn_request_scan()
649 if (!priv->scan_cmd) { in iwlagn_request_scan()
650 priv->scan_cmd = kmalloc(scan_cmd_size, GFP_KERNEL); in iwlagn_request_scan()
651 if (!priv->scan_cmd) { in iwlagn_request_scan()
654 return -ENOMEM; in iwlagn_request_scan()
657 scan = priv->scan_cmd; in iwlagn_request_scan()
660 scan->quiet_plcp_th = IWL_PLCP_QUIET_THRESH; in iwlagn_request_scan()
661 scan->quiet_time = IWL_ACTIVE_QUIET_TIME; in iwlagn_request_scan()
670 switch (priv->scan_type) { in iwlagn_request_scan()
675 interval = vif->bss_conf.beacon_int; in iwlagn_request_scan()
679 scan->suspend_time = 0; in iwlagn_request_scan()
680 scan->max_out_time = cpu_to_le32(200 * 1024); in iwlagn_request_scan()
687 scan->suspend_time = cpu_to_le32(scan_suspend_time); in iwlagn_request_scan()
692 switch (priv->scan_type) { in iwlagn_request_scan()
700 scan->quiet_time = cpu_to_le16(IWL_RADIO_RESET_DWELL_TIME); in iwlagn_request_scan()
703 if (priv->scan_request->n_ssids) { in iwlagn_request_scan()
710 ssid_len = priv->scan_request->ssids[0].ssid_len; in iwlagn_request_scan()
711 ssid = priv->scan_request->ssids[0].ssid; in iwlagn_request_scan()
717 for (i = priv->scan_request->n_ssids - 1; i >= 1; i--) { in iwlagn_request_scan()
718 scan->direct_scan[p].id = WLAN_EID_SSID; in iwlagn_request_scan()
719 scan->direct_scan[p].len = in iwlagn_request_scan()
720 priv->scan_request->ssids[i].ssid_len; in iwlagn_request_scan()
721 memcpy(scan->direct_scan[p].ssid, in iwlagn_request_scan()
722 priv->scan_request->ssids[i].ssid, in iwlagn_request_scan()
723 priv->scan_request->ssids[i].ssid_len); in iwlagn_request_scan()
733 scan->tx_cmd.tx_flags = TX_CMD_FLG_SEQ_CTL_MSK; in iwlagn_request_scan()
734 scan->tx_cmd.sta_id = ctx->bcast_sta_id; in iwlagn_request_scan()
735 scan->tx_cmd.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; in iwlagn_request_scan()
737 switch (priv->scan_band) { in iwlagn_request_scan()
739 scan->flags = RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK; in iwlagn_request_scan()
741 priv->contexts[IWL_RXON_CTX_BSS].active.flags & in iwlagn_request_scan()
744 if ((priv->scan_request && priv->scan_request->no_cck) || in iwlagn_request_scan()
755 if (priv->lib->bt_params && in iwlagn_request_scan()
756 priv->lib->bt_params->advanced_bt_coexist) in iwlagn_request_scan()
757 scan->tx_cmd.tx_flags |= TX_CMD_FLG_IGNORE_BT; in iwlagn_request_scan()
763 IWL_WARN(priv, "Invalid scan band\n"); in iwlagn_request_scan()
764 return -EIO; in iwlagn_request_scan()
779 * sending out probes -- setting this to a huge value will in iwlagn_request_scan()
784 * This was fixed in later versions along with some other in iwlagn_request_scan()
785 * scan changes, and the threshold behaves as a flag in those in iwlagn_request_scan()
788 if (priv->new_scan_threshold_behaviour) in iwlagn_request_scan()
789 scan->good_CRC_th = is_active ? IWL_GOOD_CRC_TH_DEFAULT : in iwlagn_request_scan()
792 scan->good_CRC_th = is_active ? IWL_GOOD_CRC_TH_DEFAULT : in iwlagn_request_scan()
795 band = priv->scan_band; in iwlagn_request_scan()
797 if (band == NL80211_BAND_2GHZ && in iwlagn_request_scan()
798 priv->lib->bt_params && in iwlagn_request_scan()
799 priv->lib->bt_params->advanced_bt_coexist) { in iwlagn_request_scan()
804 priv->scan_tx_ant[band] = iwl_toggle_tx_ant(priv, in iwlagn_request_scan()
805 priv->scan_tx_ant[band], in iwlagn_request_scan()
807 rate_flags |= iwl_ant_idx_to_flags(priv->scan_tx_ant[band]); in iwlagn_request_scan()
808 scan->tx_cmd.rate_n_flags = iwl_hw_set_rate_n_flags(rate, rate_flags); in iwlagn_request_scan()
811 * In power save mode while associated use one chain, in iwlagn_request_scan()
814 if (test_bit(STATUS_POWER_PMI, &priv->status) && in iwlagn_request_scan()
815 !(priv->hw->conf.flags & IEEE80211_CONF_IDLE)) { in iwlagn_request_scan()
818 ((u8)(priv->chain_noise_data.active_chains)); in iwlagn_request_scan()
823 priv->chain_noise_data.active_chains); in iwlagn_request_scan()
827 if (priv->lib->bt_params && in iwlagn_request_scan()
828 priv->lib->bt_params->advanced_bt_coexist && in iwlagn_request_scan()
829 priv->bt_full_concurrent) { in iwlagn_request_scan()
830 /* operated as 1x1 in full concurrency mode */ in iwlagn_request_scan()
836 priv->nvm_data->valid_rx_ant << RXON_RX_CHAIN_VALID_POS; in iwlagn_request_scan()
840 scan->rx_chain = cpu_to_le16(rx_chain); in iwlagn_request_scan()
841 switch (priv->scan_type) { in iwlagn_request_scan()
844 (struct ieee80211_mgmt *)scan->data, in iwlagn_request_scan()
845 vif->addr, in iwlagn_request_scan()
846 priv->scan_request->ie, in iwlagn_request_scan()
847 priv->scan_request->ie_len, in iwlagn_request_scan()
849 scan_cmd_size - sizeof(*scan)); in iwlagn_request_scan()
854 (struct ieee80211_mgmt *)scan->data, in iwlagn_request_scan()
857 scan_cmd_size - sizeof(*scan)); in iwlagn_request_scan()
862 scan->tx_cmd.len = cpu_to_le16(cmd_len); in iwlagn_request_scan()
864 scan->filter_flags |= (RXON_FILTER_ACCEPT_GRP_MSK | in iwlagn_request_scan()
867 switch (priv->scan_type) { in iwlagn_request_scan()
869 scan->channel_count = in iwlagn_request_scan()
870 iwl_get_channel_for_reset_scan(priv, vif, band, in iwlagn_request_scan()
871 (void *)&scan->data[cmd_len]); in iwlagn_request_scan()
874 scan->channel_count = in iwlagn_request_scan()
875 iwl_get_channels_for_scan(priv, vif, band, in iwlagn_request_scan()
877 (void *)&scan->data[cmd_len]); in iwlagn_request_scan()
881 if (scan->channel_count == 0) { in iwlagn_request_scan()
882 IWL_DEBUG_SCAN(priv, "channel count %d\n", scan->channel_count); in iwlagn_request_scan()
883 return -EIO; in iwlagn_request_scan()
886 cmd.len[0] += le16_to_cpu(scan->tx_cmd.len) + in iwlagn_request_scan()
887 scan->channel_count * sizeof(struct iwl_scan_channel); in iwlagn_request_scan()
890 scan->len = cpu_to_le16(cmd.len[0]); in iwlagn_request_scan()
893 set_bit(STATUS_SCAN_HW, &priv->status); in iwlagn_request_scan()
897 clear_bit(STATUS_SCAN_HW, &priv->status); in iwlagn_request_scan()
903 clear_bit(STATUS_SCAN_HW, &priv->status); in iwlagn_request_scan()
912 u8 ant_idx = fls(priv->nvm_data->valid_tx_ant) - 1; in iwl_init_scan_params()
913 if (!priv->scan_tx_ant[NL80211_BAND_5GHZ]) in iwl_init_scan_params()
914 priv->scan_tx_ant[NL80211_BAND_5GHZ] = ant_idx; in iwl_init_scan_params()
915 if (!priv->scan_tx_ant[NL80211_BAND_2GHZ]) in iwl_init_scan_params()
916 priv->scan_tx_ant[NL80211_BAND_2GHZ] = ant_idx; in iwl_init_scan_params()
922 enum nl80211_band band) in iwl_scan_initiate() argument
926 lockdep_assert_held(&priv->mutex); in iwl_scan_initiate()
928 cancel_delayed_work(&priv->scan_check); in iwl_scan_initiate()
932 return -EIO; in iwl_scan_initiate()
935 if (test_bit(STATUS_SCAN_HW, &priv->status)) { in iwl_scan_initiate()
937 "Multiple concurrent scan requests in parallel.\n"); in iwl_scan_initiate()
938 return -EBUSY; in iwl_scan_initiate()
941 if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) { in iwl_scan_initiate()
943 return -EBUSY; in iwl_scan_initiate()
950 set_bit(STATUS_SCANNING, &priv->status); in iwl_scan_initiate()
951 priv->scan_type = scan_type; in iwl_scan_initiate()
952 priv->scan_start = jiffies; in iwl_scan_initiate()
953 priv->scan_band = band; in iwl_scan_initiate()
957 clear_bit(STATUS_SCANNING, &priv->status); in iwl_scan_initiate()
958 priv->scan_type = IWL_SCAN_NORMAL; in iwl_scan_initiate()
962 queue_delayed_work(priv->workqueue, &priv->scan_check, in iwl_scan_initiate()
975 queue_work(priv->workqueue, &priv->start_internal_scan); in iwl_internal_short_hw_scan()
985 mutex_lock(&priv->mutex); in iwl_bg_start_internal_scan()
987 if (priv->scan_type == IWL_SCAN_RADIO_RESET) { in iwl_bg_start_internal_scan()
988 IWL_DEBUG_SCAN(priv, "Internal scan already in progress\n"); in iwl_bg_start_internal_scan()
992 if (test_bit(STATUS_SCANNING, &priv->status)) { in iwl_bg_start_internal_scan()
993 IWL_DEBUG_SCAN(priv, "Scan already in progress.\n"); in iwl_bg_start_internal_scan()
997 if (iwl_scan_initiate(priv, NULL, IWL_SCAN_RADIO_RESET, priv->band)) in iwl_bg_start_internal_scan()
1000 mutex_unlock(&priv->mutex); in iwl_bg_start_internal_scan()
1011 * most likely is in bad shape, so we don't bother to in iwl_bg_scan_check()
1013 mutex_lock(&priv->mutex); in iwl_bg_scan_check()
1015 mutex_unlock(&priv->mutex); in iwl_bg_scan_check()
1024 /* We keep scan_check work queued in case when firmware will not in iwl_bg_abort_scan()
1026 mutex_lock(&priv->mutex); in iwl_bg_abort_scan()
1028 mutex_unlock(&priv->mutex); in iwl_bg_abort_scan()
1036 mutex_lock(&priv->mutex); in iwl_bg_scan_completed()
1038 mutex_unlock(&priv->mutex); in iwl_bg_scan_completed()
1043 INIT_WORK(&priv->scan_completed, iwl_bg_scan_completed); in iwl_setup_scan_deferred_work()
1044 INIT_WORK(&priv->abort_scan, iwl_bg_abort_scan); in iwl_setup_scan_deferred_work()
1045 INIT_WORK(&priv->start_internal_scan, iwl_bg_start_internal_scan); in iwl_setup_scan_deferred_work()
1046 INIT_DELAYED_WORK(&priv->scan_check, iwl_bg_scan_check); in iwl_setup_scan_deferred_work()
1051 cancel_work_sync(&priv->start_internal_scan); in iwl_cancel_scan_deferred_work()
1052 cancel_work_sync(&priv->abort_scan); in iwl_cancel_scan_deferred_work()
1053 cancel_work_sync(&priv->scan_completed); in iwl_cancel_scan_deferred_work()
1055 if (cancel_delayed_work_sync(&priv->scan_check)) { in iwl_cancel_scan_deferred_work()
1056 mutex_lock(&priv->mutex); in iwl_cancel_scan_deferred_work()
1058 mutex_unlock(&priv->mutex); in iwl_cancel_scan_deferred_work()