Lines Matching full:scan

8 #include "scan.h"
14 #include "fw/api/scan.h"
21 /* adaptive dwell max budget time [TU] for full scan */
24 /* adaptive dwell max budget time [TU] for directed scan */
50 /* minimal number of 2GHz and 5GHz channels in the regular scan request */
217 enum iwl_mld_traffic_load load = mld->scan.traffic_load.status; in iwl_mld_get_scan_type()
221 * Force a non-fragmented scan in that case. in iwl_mld_get_scan_type()
233 /* In case of DCM with P2P GO set all scan requests as in iwl_mld_get_scan_type()
234 * fast-balance scan in iwl_mld_get_scan_type()
321 for (int i = 0; i < ARRAY_SIZE(mld->scan.uid_status); i++) in iwl_mld_scan_uid_by_status()
322 if (mld->scan.uid_status[i] == status) in iwl_mld_scan_uid_by_status()
435 /* If no direct SSIDs are provided perform a passive scan. Otherwise, in iwl_mld_scan_get_cmd_gen_flags()
437 * that the scan is intended for roaming purposes and thus enable Rx on in iwl_mld_scan_get_cmd_gen_flags()
457 mld->scan.pass_all_sched_res == SCHED_SCAN_PASS_ALL_STATE_ENABLED) in iwl_mld_scan_get_cmd_gen_flags()
531 "Scan: adwell_max_budget=%d max_out_of_time=%d suspend_time=%d\n", in iwl_mld_scan_cmd_set_dwell()
582 /* If the number of iterations of the last scan plan is set to zero, in iwl_mld_scan_cmd_set_sched_params()
584 * For example, when regular scan is requested the driver sets one scan in iwl_mld_scan_cmd_set_sched_params()
622 /* add SSIDs from scan SSID list */ in iwl_mld_scan_cmd_build_ssids()
662 /* hidden 6ghz scan */ in iwl_mld_scan_fill_6g_chan_list()
701 "scan: invalid BSSID at index %u, index_b=%u\n", in iwl_mld_scan_fill_6g_chan_list()
724 /* relevant only for 2.4 GHz /5 GHz scan */ in iwl_mld_scan_cmd_set_probe_params()
740 * 5. the VIF is not an AP interface (scan wants survey results) in iwl_mld_scan_use_ebs()
743 !mld->scan.last_ebs_failed && in iwl_mld_scan_use_ebs()
764 /* set fragmented ebs for fragmented scan */ in iwl_mld_scan_cmd_set_chan_flags()
768 /* Force EBS in case the scan is a fragmented and there is a need in iwl_mld_scan_cmd_set_chan_flags()
769 * to take P2P GO operation into consideration during scan operation. in iwl_mld_scan_cmd_set_chan_flags()
831 /* 6 GHz channels should only appear in a scan request in iwl_mld_scan_cmd_set_channels()
833 * scan, which has to be passive. in iwl_mld_scan_cmd_set_channels()
871 /* Avoid performing passive scan on non PSC channels unless the in iwl_mld_scan_cfg_channels_6g()
872 * scan is specifically a passive scan, i.e., no SSIDs in iwl_mld_scan_cfg_channels_6g()
873 * configured in the scan command. in iwl_mld_scan_cfg_channels_6g()
909 /* In the following cases apply passive scan: in iwl_mld_scan_cfg_channels_6g()
910 * 1. Non fragmented scan: in iwl_mld_scan_cfg_channels_6g()
919 * 2. Fragmented scan: in iwl_mld_scan_cfg_channels_6g()
952 /* To optimize the scan time, i.e., reduce the scan dwell time in iwl_mld_scan_cfg_channels_6g()
986 /* Hidden AP, cannot do passive scan */ in iwl_mld_scan_cfg_channels_6g()
1098 /* relevant only for 2.4 GHz/5 GHz scan */ in iwl_mld_scan_cmd_set_chan_params()
1110 /* fill 6 GHz passive scan cfg */ in iwl_mld_scan_cmd_set_chan_params()
1139 struct iwl_scan_req_umac_v17 *cmd = mld->scan.cmd; in iwl_mld_scan_build_cmd()
1144 memset(mld->scan.cmd, 0, mld->scan.cmd_size); in iwl_mld_scan_build_cmd()
1182 "Sending scheduled scan with filtering, n_match_sets %d\n", in iwl_mld_scan_pass_all()
1184 mld->scan.pass_all_sched_res = SCHED_SCAN_PASS_ALL_STATE_DISABLED; in iwl_mld_scan_pass_all()
1188 IWL_DEBUG_SCAN(mld, "Sending Scheduled scan without filtering\n"); in iwl_mld_scan_pass_all()
1189 mld->scan.pass_all_sched_res = SCHED_SCAN_PASS_ALL_STATE_ENABLED; in iwl_mld_scan_pass_all()
1250 "Sending scheduled scan profile config (n_match_sets=%u)\n", in iwl_mld_config_sched_scan_profiles()
1311 /* 6 GHz passive scan may be enabled in the first 2.4 GHz/5 GHz scan in iwl_mld_scan_6ghz_passive_scan()
1313 * we're in the 6 GHz scan phase. in iwl_mld_scan_6ghz_passive_scan()
1318 /* 6 GHz passive scan allowed only on station interface */ in iwl_mld_scan_6ghz_passive_scan()
1321 "6GHz passive scan: not station interface\n"); in iwl_mld_scan_6ghz_passive_scan()
1325 /* 6 GHz passive scan is allowed in a defined time interval following in iwl_mld_scan_6ghz_passive_scan()
1327 * interval has passed since the last 6 GHz passive scan. in iwl_mld_scan_6ghz_passive_scan()
1330 time_after(mld->scan.last_6ghz_passive_jiffies + in iwl_mld_scan_6ghz_passive_scan()
1332 (time_before(mld->scan.last_start_time_jiffies + in iwl_mld_scan_6ghz_passive_scan()
1335 IWL_DEBUG_SCAN(mld, "6GHz passive scan: %s\n", in iwl_mld_scan_6ghz_passive_scan()
1341 /* not enough channels in the regular scan request */ in iwl_mld_scan_6ghz_passive_scan()
1344 "6GHz passive scan: not enough channels %d\n", in iwl_mld_scan_6ghz_passive_scan()
1354 /* not a wildcard scan, so cannot enable passive 6 GHz scan */ in iwl_mld_scan_6ghz_passive_scan()
1357 "6GHz passive scan: no wildcard SSID\n"); in iwl_mld_scan_6ghz_passive_scan()
1363 "6GHz passive scan: no 6GHz channels\n"); in iwl_mld_scan_6ghz_passive_scan()
1373 * passive scan in iwl_mld_scan_6ghz_passive_scan()
1377 "6GHz passive scan: 6GHz channels enabled\n"); in iwl_mld_scan_6ghz_passive_scan()
1381 /* all conditions to enable 6 GHz passive scan are satisfied */ in iwl_mld_scan_6ghz_passive_scan()
1382 IWL_DEBUG_SCAN(mld, "6GHz passive scan: can be enabled\n"); in iwl_mld_scan_6ghz_passive_scan()
1405 /* we to store fw_link_id only for regular scan, in iwl_mld_scan_set_link_id()
1406 * and use it in scan complete notif in iwl_mld_scan_set_link_id()
1409 mld->scan.fw_link_id = link->fw_id; in iwl_mld_scan_set_link_id()
1411 mld->scan.fw_link_id = IWL_MLD_INVALID_FW_ID; in iwl_mld_scan_set_link_id()
1424 .len = { mld->scan.cmd_size, }, in _iwl_mld_single_scan_start()
1425 .data = { mld->scan.cmd, }, in _iwl_mld_single_scan_start()
1436 if (WARN_ON(!mld->scan.cmd)) in _iwl_mld_single_scan_start()
1490 IWL_ERR(mld, "Scan failed! ret %d\n", ret); in _iwl_mld_single_scan_start()
1494 IWL_DEBUG_SCAN(mld, "Scan request send success: status=%u, uid=%u\n", in _iwl_mld_single_scan_start()
1497 mld->scan.uid_status[uid] = scan_status; in _iwl_mld_single_scan_start()
1498 mld->scan.status |= scan_status; in _iwl_mld_single_scan_start()
1501 mld->scan.last_6ghz_passive_jiffies = jiffies; in _iwl_mld_single_scan_start()
1531 "Scan Abort: unexpected response length %d\n", in iwl_mld_scan_send_abort_cmd_status()
1553 IWL_DEBUG_SCAN(mld, "Sending scan abort, uid %u\n", uid); in iwl_mld_scan_abort()
1557 IWL_DEBUG_SCAN(mld, "Scan abort: ret=%d status=%u\n", ret, status); in iwl_mld_scan_abort()
1559 /* We don't need to wait to scan complete in the following cases: in iwl_mld_scan_abort()
1560 * 1. Driver failed to send the scan abort cmd. in iwl_mld_scan_abort()
1561 * 2. The FW is no longer familiar with the scan that needs to be in iwl_mld_scan_abort()
1562 * stopped. It is expected that the scan complete notification was in iwl_mld_scan_abort()
1566 * scan was really aborted. in iwl_mld_scan_abort()
1587 IWL_DEBUG_SCAN(mld, "Preparing to stop scan, type=%x\n", type); in iwl_mld_scan_stop_wait()
1591 IWL_DEBUG_SCAN(mld, "couldn't stop scan type=%d\n", type); in iwl_mld_scan_stop_wait()
1596 IWL_DEBUG_SCAN(mld, "no need to wait for scan type=%d\n", type); in iwl_mld_scan_stop_wait()
1615 .len = { mld->scan.cmd_size, }, in iwl_mld_sched_scan_start()
1616 .data = { mld->scan.cmd, }, in iwl_mld_sched_scan_start()
1627 if (WARN_ON(!mld->scan.cmd)) in iwl_mld_sched_scan_start()
1630 /* FW supports only a single periodic scan */ in iwl_mld_sched_scan_start()
1631 if (mld->scan.status & (IWL_MLD_SCAN_SCHED | IWL_MLD_SCAN_NETDETECT)) in iwl_mld_sched_scan_start()
1658 /* UMAC scan supports up to 16-bit delays, trim it down to 16-bits */ in iwl_mld_sched_scan_start()
1689 "Sched scan request send success: type=%u, uid=%u\n", in iwl_mld_sched_scan_start()
1691 mld->scan.uid_status[uid] = type; in iwl_mld_sched_scan_start()
1692 mld->scan.status |= type; in iwl_mld_sched_scan_start()
1694 IWL_ERR(mld, "Sched scan failed! ret %d\n", ret); in iwl_mld_sched_scan_start()
1695 mld->scan.pass_all_sched_res = SCHED_SCAN_PASS_ALL_STATE_DISABLED; in iwl_mld_sched_scan_start()
1709 "Request to stop scan: type=0x%x, status=0x%x\n", in iwl_mld_scan_stop()
1710 type, mld->scan.status); in iwl_mld_scan_stop()
1712 if (!(mld->scan.status & type)) in iwl_mld_scan_stop()
1722 IWL_DEBUG_SCAN(mld, "Failed to stop scan\n"); in iwl_mld_scan_stop()
1724 /* Clear the scan status so the next scan requests will in iwl_mld_scan_stop()
1725 * succeed and mark the scan as stopping, so that the Rx in iwl_mld_scan_stop()
1726 * handler doesn't do anything, as the scan was stopped from in iwl_mld_scan_stop()
1728 * erroneously after a new scan starts, for example. in iwl_mld_scan_stop()
1730 mld->scan.status &= ~type; in iwl_mld_scan_stop()
1731 mld->scan.uid_status[uid] = IWL_MLD_SCAN_NONE; in iwl_mld_scan_stop()
1745 mld->scan.pass_all_sched_res = SCHED_SCAN_PASS_ALL_STATE_DISABLED; in iwl_mld_scan_stop()
1769 IWL_DEBUG_SCAN(mld, "Starting Internal MLO scan: n_channels=%zu\n", in iwl_mld_int_mlo_scan_start()
1798 mld->scan.last_mlo_scan_time = ktime_get_boottime_ns(); in iwl_mld_int_mlo_scan_start()
1800 IWL_DEBUG_SCAN(mld, "Internal MLO scan: ret=%d\n", ret); in iwl_mld_int_mlo_scan_start()
1816 if (mld->scan.status & IWL_MLD_SCAN_INT_MLO) { in iwl_mld_int_mlo_scan()
1817 IWL_DEBUG_SCAN(mld, "Internal MLO scan is already running\n"); in iwl_mld_int_mlo_scan()
1843 if (IWL_FW_CHECK(mld, uid >= ARRAY_SIZE(mld->scan.uid_status), in iwl_mld_handle_scan_iter_complete_notif()
1844 "FW reports out-of-range scan UID %d\n", uid)) in iwl_mld_handle_scan_iter_complete_notif()
1847 if (mld->scan.uid_status[uid] == IWL_MLD_SCAN_REGULAR) in iwl_mld_handle_scan_iter_complete_notif()
1848 mld->scan.start_tsf = le64_to_cpu(notif->start_tsf); in iwl_mld_handle_scan_iter_complete_notif()
1851 "UMAC Scan iteration complete: status=0x%x scanned_channels=%d\n", in iwl_mld_handle_scan_iter_complete_notif()
1854 if (mld->scan.pass_all_sched_res == SCHED_SCAN_PASS_ALL_STATE_FOUND) { in iwl_mld_handle_scan_iter_complete_notif()
1855 IWL_DEBUG_SCAN(mld, "Pass all scheduled scan results found\n"); in iwl_mld_handle_scan_iter_complete_notif()
1857 mld->scan.pass_all_sched_res = SCHED_SCAN_PASS_ALL_STATE_ENABLED; in iwl_mld_handle_scan_iter_complete_notif()
1861 "UMAC Scan iteration complete: scan started at %llu (TSF)\n", in iwl_mld_handle_scan_iter_complete_notif()
1868 IWL_DEBUG_SCAN(mld, "Scheduled scan results\n"); in iwl_mld_handle_match_found_notif()
1879 if (IWL_FW_CHECK(mld, uid >= ARRAY_SIZE(mld->scan.uid_status), in iwl_mld_handle_scan_complete_notif()
1880 "FW reports out-of-range scan UID %d\n", uid)) in iwl_mld_handle_scan_complete_notif()
1884 "Scan completed: uid=%u type=%u, status=%s, EBS=%s\n", in iwl_mld_handle_scan_complete_notif()
1885 uid, mld->scan.uid_status[uid], in iwl_mld_handle_scan_complete_notif()
1889 IWL_DEBUG_SCAN(mld, "Scan completed: scan_status=0x%x\n", in iwl_mld_handle_scan_complete_notif()
1890 mld->scan.status); in iwl_mld_handle_scan_complete_notif()
1892 "Scan completed: line=%u, iter=%u, elapsed time=%u\n", in iwl_mld_handle_scan_complete_notif()
1896 if (IWL_FW_CHECK(mld, !(mld->scan.uid_status[uid] & mld->scan.status), in iwl_mld_handle_scan_complete_notif()
1897 "FW reports scan UID %d we didn't trigger\n", uid)) in iwl_mld_handle_scan_complete_notif()
1900 /* if the scan is already stopping, we don't need to notify mac80211 */ in iwl_mld_handle_scan_complete_notif()
1901 if (mld->scan.uid_status[uid] == IWL_MLD_SCAN_REGULAR) { in iwl_mld_handle_scan_complete_notif()
1904 .scan_start_tsf = mld->scan.start_tsf, in iwl_mld_handle_scan_complete_notif()
1906 int fw_link_id = mld->scan.fw_link_id; in iwl_mld_handle_scan_complete_notif()
1914 /* It is possible that by the time the scan is complete the in iwl_mld_handle_scan_complete_notif()
1920 IWL_DEBUG_SCAN(mld, "Scan link is no longer valid\n"); in iwl_mld_handle_scan_complete_notif()
1923 } else if (mld->scan.uid_status[uid] == IWL_MLD_SCAN_SCHED) { in iwl_mld_handle_scan_complete_notif()
1925 mld->scan.pass_all_sched_res = SCHED_SCAN_PASS_ALL_STATE_DISABLED; in iwl_mld_handle_scan_complete_notif()
1926 } else if (mld->scan.uid_status[uid] == IWL_MLD_SCAN_INT_MLO) { in iwl_mld_handle_scan_complete_notif()
1927 IWL_DEBUG_SCAN(mld, "Internal MLO scan completed\n"); in iwl_mld_handle_scan_complete_notif()
1936 mld->scan.status &= ~mld->scan.uid_status[uid]; in iwl_mld_handle_scan_complete_notif()
1938 IWL_DEBUG_SCAN(mld, "Scan completed: after update: scan_status=0x%x\n", in iwl_mld_handle_scan_complete_notif()
1939 mld->scan.status); in iwl_mld_handle_scan_complete_notif()
1941 mld->scan.uid_status[uid] = IWL_MLD_SCAN_NONE; in iwl_mld_handle_scan_complete_notif()
1945 mld->scan.last_ebs_failed = true; in iwl_mld_handle_scan_complete_notif()
1962 mld->scan.uid_status[uid] = IWL_MLD_SCAN_NONE; in iwl_mld_report_scan_aborted()
1967 mld->scan.pass_all_sched_res = SCHED_SCAN_PASS_ALL_STATE_DISABLED; in iwl_mld_report_scan_aborted()
1968 mld->scan.uid_status[uid] = IWL_MLD_SCAN_NONE; in iwl_mld_report_scan_aborted()
1970 /* sched scan will be restarted by mac80211 in reconfig. in iwl_mld_report_scan_aborted()
1971 * report to mac80211 that sched scan stopped only if we won't in iwl_mld_report_scan_aborted()
1980 IWL_DEBUG_SCAN(mld, "Internal MLO scan aborted\n"); in iwl_mld_report_scan_aborted()
1981 mld->scan.uid_status[uid] = IWL_MLD_SCAN_NONE; in iwl_mld_report_scan_aborted()
1985 memset(mld->scan.uid_status, 0, sizeof(mld->scan.uid_status)); in iwl_mld_report_scan_aborted()
1997 IWL_ERR(mld, "Unexpected scan cmd version %d\n", scan_cmd_ver); in iwl_mld_alloc_scan_cmd()
2001 mld->scan.cmd = kmalloc(scan_cmd_size, GFP_KERNEL); in iwl_mld_alloc_scan_cmd()
2002 if (!mld->scan.cmd) in iwl_mld_alloc_scan_cmd()
2005 mld->scan.cmd_size = scan_cmd_size; in iwl_mld_alloc_scan_cmd()