Path: blob/main/sys/contrib/dev/iwlwifi/mld/scan.h
48285 views
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */1/*2* Copyright (C) 2024-2025 Intel Corporation3*/4#ifndef __iwl_mld_scan_h__5#define __iwl_mld_scan_h__67int iwl_mld_alloc_scan_cmd(struct iwl_mld *mld);89int iwl_mld_regular_scan_start(struct iwl_mld *mld, struct ieee80211_vif *vif,10struct cfg80211_scan_request *req,11struct ieee80211_scan_ies *ies);1213void iwl_mld_int_mlo_scan(struct iwl_mld *mld, struct ieee80211_vif *vif);1415void iwl_mld_handle_scan_iter_complete_notif(struct iwl_mld *mld,16struct iwl_rx_packet *pkt);1718int iwl_mld_scan_stop(struct iwl_mld *mld, int type, bool notify);1920int iwl_mld_sched_scan_start(struct iwl_mld *mld,21struct ieee80211_vif *vif,22struct cfg80211_sched_scan_request *req,23struct ieee80211_scan_ies *ies,24int type);2526void iwl_mld_handle_match_found_notif(struct iwl_mld *mld,27struct iwl_rx_packet *pkt);2829void iwl_mld_handle_scan_complete_notif(struct iwl_mld *mld,30struct iwl_rx_packet *pkt);3132int iwl_mld_mac80211_get_survey(struct ieee80211_hw *hw, int idx,33struct survey_info *survey);3435void iwl_mld_handle_channel_survey_notif(struct iwl_mld *mld,36struct iwl_rx_packet *pkt);3738#define WFA_TPC_IE_LEN 93940static inline int iwl_mld_scan_max_template_size(void)41{42#define MAC_HDR_LEN 2443#define DS_IE_LEN 344#define SSID_IE_LEN 24546/* driver create the 802.11 header, WFA TPC IE, DS parameter and SSID IE */47#define DRIVER_TOTAL_IES_LEN \48(MAC_HDR_LEN + WFA_TPC_IE_LEN + DS_IE_LEN + SSID_IE_LEN)4950BUILD_BUG_ON(SCAN_OFFLOAD_PROBE_REQ_SIZE < DRIVER_TOTAL_IES_LEN);5152return SCAN_OFFLOAD_PROBE_REQ_SIZE - DRIVER_TOTAL_IES_LEN;53}5455void iwl_mld_report_scan_aborted(struct iwl_mld *mld);5657enum iwl_mld_scan_status {58IWL_MLD_SCAN_NONE = 0,59IWL_MLD_SCAN_REGULAR = BIT(0),60IWL_MLD_SCAN_SCHED = BIT(1),61IWL_MLD_SCAN_NETDETECT = BIT(2),62IWL_MLD_SCAN_INT_MLO = BIT(3),63};6465/* enum iwl_mld_pass_all_sched_results_states - Defines the states for66* handling/passing scheduled scan results to mac8021167* @SCHED_SCAN_PASS_ALL_STATE_DISABLED: Don't pass all scan results, only when68* a match found.69* @SCHED_SCAN_PASS_ALL_STATE_ENABLED: Pass all scan results is enabled70* (no filtering).71* @SCHED_SCAN_PASS_ALL_STATE_FOUND: A scan result is found, pass it on the72* next scan iteration complete notification.73*/74enum iwl_mld_pass_all_sched_results_states {75SCHED_SCAN_PASS_ALL_STATE_DISABLED,76SCHED_SCAN_PASS_ALL_STATE_ENABLED,77SCHED_SCAN_PASS_ALL_STATE_FOUND,78};7980/**81* enum iwl_mld_traffic_load - Levels of traffic load82*83* @IWL_MLD_TRAFFIC_LOW: low traffic load84* @IWL_MLD_TRAFFIC_MEDIUM: medium traffic load85* @IWL_MLD_TRAFFIC_HIGH: high traffic load86*/87enum iwl_mld_traffic_load {88IWL_MLD_TRAFFIC_LOW,89IWL_MLD_TRAFFIC_MEDIUM,90IWL_MLD_TRAFFIC_HIGH,91};9293/**94* struct iwl_mld_scan - Scan data95* @status: scan status, a combination of %enum iwl_mld_scan_status,96* reflects the %scan.uid_status array.97* @uid_status: array to track the scan status per uid.98* @start_tsf: start time of last scan in TSF of the link that requested99* the scan.100* @last_ebs_failed: true if the last EBS (Energy Based Scan) failed.101* @pass_all_sched_res: see %enum iwl_mld_pass_all_sched_results_states.102* @fw_link_id: the current (regular) scan fw link id, used by scan103* complete notif.104* @traffic_load: traffic load related data105* @traffic_load.last_stats_ts_usec: The timestamp of the last statistics106* notification, used to calculate the elapsed time between two107* notifications and determine the traffic load108* @traffic_load.status: The current traffic load status, see109* &enum iwl_mld_traffic_load110* @cmd_size: size of %cmd.111* @cmd: pointer to scan cmd buffer (allocated once in op mode start).112* @last_6ghz_passive_jiffies: stores the last 6GHz passive scan time113* in jiffies.114* @last_start_time_jiffies: stores the last start time in jiffies115* (interface up/reset/resume).116* @last_mlo_scan_time: start time of the last MLO scan in nanoseconds since117* boot.118*/119struct iwl_mld_scan {120/* Add here fields that need clean up on restart */121struct_group(zeroed_on_hw_restart,122unsigned int status;123u32 uid_status[IWL_MAX_UMAC_SCANS];124u64 start_tsf;125bool last_ebs_failed;126enum iwl_mld_pass_all_sched_results_states pass_all_sched_res;127u8 fw_link_id;128struct {129u32 last_stats_ts_usec;130enum iwl_mld_traffic_load status;131} traffic_load;132);133/* And here fields that survive a fw restart */134size_t cmd_size;135void *cmd;136unsigned long last_6ghz_passive_jiffies;137unsigned long last_start_time_jiffies;138u64 last_mlo_scan_time;139};140141/**142* struct iwl_mld_survey_channel - per-channel survey information143*144* Driver version of &struct survey_info with just the data we want to report.145*146* @time: time in ms the radio was on the channel147* @time_busy: time in ms the channel was sensed busy148* @noise: channel noise in dBm149*/150struct iwl_mld_survey_channel {151u32 time;152u32 time_busy;153s8 noise;154};155156/**157* struct iwl_mld_survey - survey information158*159* Survey information for all available channels.160*161* @bands: per-band array for per-channel survey data, points into @channels162* @n_channels: Number of @channels entries that are allocated163* @channels: per-channel information164*/165struct iwl_mld_survey {166struct iwl_mld_survey_channel *bands[NUM_NL80211_BANDS];167168int n_channels;169struct iwl_mld_survey_channel channels[] __counted_by(n_channels);170};171172#endif /* __iwl_mld_scan_h__ */173174175