Lines Matching full:scan

10 #include "scan.h"
16 #include "fw/api/scan.h"
23 /* adaptive dwell max budget time [TU] for full scan */
26 /* adaptive dwell max budget time [TU] for directed scan */
52 /* minimal number of 2GHz and 5GHz channels in the regular scan request */
219 enum iwl_mld_traffic_load load = mld->scan.traffic_load.status; in iwl_mld_get_scan_type()
223 * Force a non-fragmented scan in that case. in iwl_mld_get_scan_type()
235 /* In case of DCM with P2P GO set all scan requests as in iwl_mld_get_scan_type()
236 * fast-balance scan in iwl_mld_get_scan_type()
323 for (int i = 0; i < ARRAY_SIZE(mld->scan.uid_status); i++) in iwl_mld_scan_uid_by_status()
324 if (mld->scan.uid_status[i] == status) in iwl_mld_scan_uid_by_status()
437 /* If no direct SSIDs are provided perform a passive scan. Otherwise, in iwl_mld_scan_get_cmd_gen_flags()
439 * that the scan is intended for roaming purposes and thus enable Rx on in iwl_mld_scan_get_cmd_gen_flags()
459 mld->scan.pass_all_sched_res == SCHED_SCAN_PASS_ALL_STATE_ENABLED) in iwl_mld_scan_get_cmd_gen_flags()
546 "Scan: adwell_max_budget=%d max_out_of_time=%d suspend_time=%d\n", in iwl_mld_scan_cmd_set_dwell()
598 /* If the number of iterations of the last scan plan is set to zero, in iwl_mld_scan_cmd_set_sched_params()
600 * For example, when regular scan is requested the driver sets one scan in iwl_mld_scan_cmd_set_sched_params()
638 /* add SSIDs from scan SSID list */ in iwl_mld_scan_cmd_build_ssids()
678 /* hidden 6ghz scan */ in iwl_mld_scan_fill_6g_chan_list()
717 "scan: invalid BSSID at index %u, index_b=%u\n", in iwl_mld_scan_fill_6g_chan_list()
740 /* relevant only for 2.4 GHz /5 GHz scan */ in iwl_mld_scan_cmd_set_probe_params()
756 * 5. the VIF is not an AP interface (scan wants survey results) in iwl_mld_scan_use_ebs()
759 !mld->scan.last_ebs_failed && in iwl_mld_scan_use_ebs()
780 /* set fragmented ebs for fragmented scan */ in iwl_mld_scan_cmd_set_chan_flags()
784 /* Force EBS in case the scan is a fragmented and there is a need in iwl_mld_scan_cmd_set_chan_flags()
785 * to take P2P GO operation into consideration during scan operation. in iwl_mld_scan_cmd_set_chan_flags()
847 /* 6 GHz channels should only appear in a scan request in iwl_mld_scan_cmd_set_channels()
849 * scan, which has to be passive. in iwl_mld_scan_cmd_set_channels()
887 /* Avoid performing passive scan on non PSC channels unless the in iwl_mld_scan_cfg_channels_6g()
888 * scan is specifically a passive scan, i.e., no SSIDs in iwl_mld_scan_cfg_channels_6g()
889 * configured in the scan command. in iwl_mld_scan_cfg_channels_6g()
925 /* In the following cases apply passive scan: in iwl_mld_scan_cfg_channels_6g()
926 * 1. Non fragmented scan: in iwl_mld_scan_cfg_channels_6g()
935 * 2. Fragmented scan: in iwl_mld_scan_cfg_channels_6g()
968 /* To optimize the scan time, i.e., reduce the scan dwell time in iwl_mld_scan_cfg_channels_6g()
1002 /* Hidden AP, cannot do passive scan */ in iwl_mld_scan_cfg_channels_6g()
1114 /* relevant only for 2.4 GHz/5 GHz scan */ in iwl_mld_scan_cmd_set_chan_params()
1126 /* fill 6 GHz passive scan cfg */ in iwl_mld_scan_cmd_set_chan_params()
1155 struct iwl_scan_req_umac_v17 *cmd = mld->scan.cmd; in iwl_mld_scan_build_cmd()
1160 memset(mld->scan.cmd, 0, mld->scan.cmd_size); in iwl_mld_scan_build_cmd()
1198 "Sending scheduled scan with filtering, n_match_sets %d\n", in iwl_mld_scan_pass_all()
1200 mld->scan.pass_all_sched_res = SCHED_SCAN_PASS_ALL_STATE_DISABLED; in iwl_mld_scan_pass_all()
1204 IWL_DEBUG_SCAN(mld, "Sending Scheduled scan without filtering\n"); in iwl_mld_scan_pass_all()
1205 mld->scan.pass_all_sched_res = SCHED_SCAN_PASS_ALL_STATE_ENABLED; in iwl_mld_scan_pass_all()
1266 "Sending scheduled scan profile config (n_match_sets=%u)\n", in iwl_mld_config_sched_scan_profiles()
1327 /* 6 GHz passive scan may be enabled in the first 2.4 GHz/5 GHz scan in iwl_mld_scan_6ghz_passive_scan()
1329 * we're in the 6 GHz scan phase. in iwl_mld_scan_6ghz_passive_scan()
1334 /* 6 GHz passive scan allowed only on station interface */ in iwl_mld_scan_6ghz_passive_scan()
1337 "6GHz passive scan: not station interface\n"); in iwl_mld_scan_6ghz_passive_scan()
1341 /* 6 GHz passive scan is allowed in a defined time interval following in iwl_mld_scan_6ghz_passive_scan()
1343 * interval has passed since the last 6 GHz passive scan. in iwl_mld_scan_6ghz_passive_scan()
1346 time_after(mld->scan.last_6ghz_passive_jiffies + in iwl_mld_scan_6ghz_passive_scan()
1348 (time_before(mld->scan.last_start_time_jiffies + in iwl_mld_scan_6ghz_passive_scan()
1351 IWL_DEBUG_SCAN(mld, "6GHz passive scan: %s\n", in iwl_mld_scan_6ghz_passive_scan()
1357 /* not enough channels in the regular scan request */ in iwl_mld_scan_6ghz_passive_scan()
1360 "6GHz passive scan: not enough channels %d\n", in iwl_mld_scan_6ghz_passive_scan()
1370 /* not a wildcard scan, so cannot enable passive 6 GHz scan */ in iwl_mld_scan_6ghz_passive_scan()
1373 "6GHz passive scan: no wildcard SSID\n"); in iwl_mld_scan_6ghz_passive_scan()
1379 "6GHz passive scan: no 6GHz channels\n"); in iwl_mld_scan_6ghz_passive_scan()
1389 * passive scan in iwl_mld_scan_6ghz_passive_scan()
1393 "6GHz passive scan: 6GHz channels enabled\n"); in iwl_mld_scan_6ghz_passive_scan()
1397 /* all conditions to enable 6 GHz passive scan are satisfied */ in iwl_mld_scan_6ghz_passive_scan()
1398 IWL_DEBUG_SCAN(mld, "6GHz passive scan: can be enabled\n"); in iwl_mld_scan_6ghz_passive_scan()
1421 /* we to store fw_link_id only for regular scan, in iwl_mld_scan_set_link_id()
1422 * and use it in scan complete notif in iwl_mld_scan_set_link_id()
1425 mld->scan.fw_link_id = link->fw_id; in iwl_mld_scan_set_link_id()
1427 mld->scan.fw_link_id = IWL_MLD_INVALID_FW_ID; in iwl_mld_scan_set_link_id()
1440 .len = { mld->scan.cmd_size, }, in _iwl_mld_single_scan_start()
1441 .data = { mld->scan.cmd, }, in _iwl_mld_single_scan_start()
1452 if (WARN_ON(!mld->scan.cmd)) in _iwl_mld_single_scan_start()
1506 IWL_ERR(mld, "Scan failed! ret %d\n", ret); in _iwl_mld_single_scan_start()
1510 IWL_DEBUG_SCAN(mld, "Scan request send success: status=%u, uid=%u\n", in _iwl_mld_single_scan_start()
1513 mld->scan.uid_status[uid] = scan_status; in _iwl_mld_single_scan_start()
1514 mld->scan.status |= scan_status; in _iwl_mld_single_scan_start()
1517 mld->scan.last_6ghz_passive_jiffies = jiffies; in _iwl_mld_single_scan_start()
1547 "Scan Abort: unexpected response length %d\n", in iwl_mld_scan_send_abort_cmd_status()
1569 IWL_DEBUG_SCAN(mld, "Sending scan abort, uid %u\n", uid); in iwl_mld_scan_abort()
1573 IWL_DEBUG_SCAN(mld, "Scan abort: ret=%d status=%u\n", ret, status); in iwl_mld_scan_abort()
1575 /* We don't need to wait to scan complete in the following cases: in iwl_mld_scan_abort()
1576 * 1. Driver failed to send the scan abort cmd. in iwl_mld_scan_abort()
1577 * 2. The FW is no longer familiar with the scan that needs to be in iwl_mld_scan_abort()
1578 * stopped. It is expected that the scan complete notification was in iwl_mld_scan_abort()
1582 * scan was really aborted. in iwl_mld_scan_abort()
1603 IWL_DEBUG_SCAN(mld, "Preparing to stop scan, type=%x\n", type); in iwl_mld_scan_stop_wait()
1607 IWL_DEBUG_SCAN(mld, "couldn't stop scan type=%d\n", type); in iwl_mld_scan_stop_wait()
1612 IWL_DEBUG_SCAN(mld, "no need to wait for scan type=%d\n", type); in iwl_mld_scan_stop_wait()
1631 .len = { mld->scan.cmd_size, }, in iwl_mld_sched_scan_start()
1632 .data = { mld->scan.cmd, }, in iwl_mld_sched_scan_start()
1643 if (WARN_ON(!mld->scan.cmd)) in iwl_mld_sched_scan_start()
1646 /* FW supports only a single periodic scan */ in iwl_mld_sched_scan_start()
1647 if (mld->scan.status & (IWL_MLD_SCAN_SCHED | IWL_MLD_SCAN_NETDETECT)) in iwl_mld_sched_scan_start()
1674 /* UMAC scan supports up to 16-bit delays, trim it down to 16-bits */ in iwl_mld_sched_scan_start()
1705 "Sched scan request send success: type=%u, uid=%u\n", in iwl_mld_sched_scan_start()
1707 mld->scan.uid_status[uid] = type; in iwl_mld_sched_scan_start()
1708 mld->scan.status |= type; in iwl_mld_sched_scan_start()
1710 IWL_ERR(mld, "Sched scan failed! ret %d\n", ret); in iwl_mld_sched_scan_start()
1711 mld->scan.pass_all_sched_res = SCHED_SCAN_PASS_ALL_STATE_DISABLED; in iwl_mld_sched_scan_start()
1725 "Request to stop scan: type=0x%x, status=0x%x\n", in iwl_mld_scan_stop()
1726 type, mld->scan.status); in iwl_mld_scan_stop()
1728 if (!(mld->scan.status & type)) in iwl_mld_scan_stop()
1738 IWL_DEBUG_SCAN(mld, "Failed to stop scan\n"); in iwl_mld_scan_stop()
1740 /* Clear the scan status so the next scan requests will in iwl_mld_scan_stop()
1741 * succeed and mark the scan as stopping, so that the Rx in iwl_mld_scan_stop()
1742 * handler doesn't do anything, as the scan was stopped from in iwl_mld_scan_stop()
1744 * erroneously after a new scan starts, for example. in iwl_mld_scan_stop()
1746 mld->scan.status &= ~type; in iwl_mld_scan_stop()
1747 mld->scan.uid_status[uid] = IWL_MLD_SCAN_NONE; in iwl_mld_scan_stop()
1761 mld->scan.pass_all_sched_res = SCHED_SCAN_PASS_ALL_STATE_DISABLED; in iwl_mld_scan_stop()
1771 /* Clear survey data when starting the first part of a regular scan */ in iwl_mld_regular_scan_start()
1794 IWL_DEBUG_SCAN(mld, "Starting Internal MLO scan: n_channels=%zu\n", in iwl_mld_int_mlo_scan_start()
1823 mld->scan.last_mlo_scan_time = ktime_get_boottime_ns(); in iwl_mld_int_mlo_scan_start()
1825 IWL_DEBUG_SCAN(mld, "Internal MLO scan: ret=%d\n", ret); in iwl_mld_int_mlo_scan_start()
1844 if (mld->scan.status & IWL_MLD_SCAN_INT_MLO) { in iwl_mld_int_mlo_scan()
1845 IWL_DEBUG_SCAN(mld, "Internal MLO scan is already running\n"); in iwl_mld_int_mlo_scan()
1880 if (IWL_FW_CHECK(mld, uid >= ARRAY_SIZE(mld->scan.uid_status), in iwl_mld_handle_scan_iter_complete_notif()
1881 "FW reports out-of-range scan UID %d\n", uid)) in iwl_mld_handle_scan_iter_complete_notif()
1884 if (mld->scan.uid_status[uid] == IWL_MLD_SCAN_REGULAR) in iwl_mld_handle_scan_iter_complete_notif()
1885 mld->scan.start_tsf = le64_to_cpu(notif->start_tsf); in iwl_mld_handle_scan_iter_complete_notif()
1888 "UMAC Scan iteration complete: status=0x%x scanned_channels=%d\n", in iwl_mld_handle_scan_iter_complete_notif()
1891 if (mld->scan.pass_all_sched_res == SCHED_SCAN_PASS_ALL_STATE_FOUND) { in iwl_mld_handle_scan_iter_complete_notif()
1892 IWL_DEBUG_SCAN(mld, "Pass all scheduled scan results found\n"); in iwl_mld_handle_scan_iter_complete_notif()
1894 mld->scan.pass_all_sched_res = SCHED_SCAN_PASS_ALL_STATE_ENABLED; in iwl_mld_handle_scan_iter_complete_notif()
1898 "UMAC Scan iteration complete: scan started at %llu (TSF)\n", in iwl_mld_handle_scan_iter_complete_notif()
1905 IWL_DEBUG_SCAN(mld, "Scheduled scan results\n"); in iwl_mld_handle_match_found_notif()
1916 if (IWL_FW_CHECK(mld, uid >= ARRAY_SIZE(mld->scan.uid_status), in iwl_mld_handle_scan_complete_notif()
1917 "FW reports out-of-range scan UID %d\n", uid)) in iwl_mld_handle_scan_complete_notif()
1921 "Scan completed: uid=%u type=%u, status=%s, EBS=%s\n", in iwl_mld_handle_scan_complete_notif()
1922 uid, mld->scan.uid_status[uid], in iwl_mld_handle_scan_complete_notif()
1926 IWL_DEBUG_SCAN(mld, "Scan completed: scan_status=0x%x\n", in iwl_mld_handle_scan_complete_notif()
1927 mld->scan.status); in iwl_mld_handle_scan_complete_notif()
1929 "Scan completed: line=%u, iter=%u, elapsed time=%u\n", in iwl_mld_handle_scan_complete_notif()
1933 if (IWL_FW_CHECK(mld, !(mld->scan.uid_status[uid] & mld->scan.status), in iwl_mld_handle_scan_complete_notif()
1934 "FW reports scan UID %d we didn't trigger\n", uid)) in iwl_mld_handle_scan_complete_notif()
1937 /* if the scan is already stopping, we don't need to notify mac80211 */ in iwl_mld_handle_scan_complete_notif()
1938 if (mld->scan.uid_status[uid] == IWL_MLD_SCAN_REGULAR) { in iwl_mld_handle_scan_complete_notif()
1941 .scan_start_tsf = mld->scan.start_tsf, in iwl_mld_handle_scan_complete_notif()
1943 int fw_link_id = mld->scan.fw_link_id; in iwl_mld_handle_scan_complete_notif()
1951 /* It is possible that by the time the scan is complete the in iwl_mld_handle_scan_complete_notif()
1957 IWL_DEBUG_SCAN(mld, "Scan link is no longer valid\n"); in iwl_mld_handle_scan_complete_notif()
1961 /* Scan is over, we can check again the tpt counters */ in iwl_mld_handle_scan_complete_notif()
1963 } else if (mld->scan.uid_status[uid] == IWL_MLD_SCAN_SCHED) { in iwl_mld_handle_scan_complete_notif()
1965 mld->scan.pass_all_sched_res = SCHED_SCAN_PASS_ALL_STATE_DISABLED; in iwl_mld_handle_scan_complete_notif()
1966 } else if (mld->scan.uid_status[uid] == IWL_MLD_SCAN_INT_MLO) { in iwl_mld_handle_scan_complete_notif()
1967 IWL_DEBUG_SCAN(mld, "Internal MLO scan completed\n"); in iwl_mld_handle_scan_complete_notif()
1976 mld->scan.status &= ~mld->scan.uid_status[uid]; in iwl_mld_handle_scan_complete_notif()
1978 IWL_DEBUG_SCAN(mld, "Scan completed: after update: scan_status=0x%x\n", in iwl_mld_handle_scan_complete_notif()
1979 mld->scan.status); in iwl_mld_handle_scan_complete_notif()
1981 mld->scan.uid_status[uid] = IWL_MLD_SCAN_NONE; in iwl_mld_handle_scan_complete_notif()
1985 mld->scan.last_ebs_failed = true; in iwl_mld_handle_scan_complete_notif()
2002 mld->scan.uid_status[uid] = IWL_MLD_SCAN_NONE; in iwl_mld_report_scan_aborted()
2007 mld->scan.pass_all_sched_res = SCHED_SCAN_PASS_ALL_STATE_DISABLED; in iwl_mld_report_scan_aborted()
2008 mld->scan.uid_status[uid] = IWL_MLD_SCAN_NONE; in iwl_mld_report_scan_aborted()
2010 /* sched scan will be restarted by mac80211 in reconfig. in iwl_mld_report_scan_aborted()
2011 * report to mac80211 that sched scan stopped only if we won't in iwl_mld_report_scan_aborted()
2020 IWL_DEBUG_SCAN(mld, "Internal MLO scan aborted\n"); in iwl_mld_report_scan_aborted()
2021 mld->scan.uid_status[uid] = IWL_MLD_SCAN_NONE; in iwl_mld_report_scan_aborted()
2025 memset(mld->scan.uid_status, 0, sizeof(mld->scan.uid_status)); in iwl_mld_report_scan_aborted()
2037 IWL_ERR(mld, "Unexpected scan cmd version %d\n", scan_cmd_ver); in iwl_mld_alloc_scan_cmd()
2041 mld->scan.cmd = kmalloc(scan_cmd_size, GFP_KERNEL); in iwl_mld_alloc_scan_cmd()
2042 if (!mld->scan.cmd) in iwl_mld_alloc_scan_cmd()
2045 mld->scan.cmd_size = scan_cmd_size; in iwl_mld_alloc_scan_cmd()