Path: blob/main/sys/contrib/dev/iwlwifi/fw/api/scan.h
48425 views
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */1/*2* Copyright (C) 2012-2014, 2018-2024 Intel Corporation3* Copyright (C) 2013-2015 Intel Mobile Communications GmbH4* Copyright (C) 2016-2017 Intel Deutschland GmbH5*/6#ifndef __iwl_fw_api_scan_h__7#define __iwl_fw_api_scan_h__89/* Scan Commands, Responses, Notifications */1011/**12* enum iwl_scan_subcmd_ids - scan commands13*/14enum iwl_scan_subcmd_ids {15/**16* @CHANNEL_SURVEY_NOTIF: &struct iwl_umac_scan_channel_survey_notif17*/18CHANNEL_SURVEY_NOTIF = 0xFB,19/**20* @OFFLOAD_MATCH_INFO_NOTIF: &struct iwl_scan_offload_match_info21*/22OFFLOAD_MATCH_INFO_NOTIF = 0xFC,23};2425/* Max number of IEs for direct SSID scans in a command */26#define PROBE_OPTION_MAX 202728#define SCAN_SHORT_SSID_MAX_SIZE 829#define SCAN_BSSID_MAX_SIZE 163031/**32* struct iwl_ssid_ie - directed scan network information element33*34* Up to 20 of these may appear in REPLY_SCAN_CMD,35* selected by "type" bit field in struct iwl_scan_channel;36* each channel may select different ssids from among the 20 entries.37* SSID IEs get transmitted in reverse order of entry.38*39* @id: element ID40* @len: element length41* @ssid: element (SSID) data42*/43struct iwl_ssid_ie {44u8 id;45u8 len;46u8 ssid[IEEE80211_MAX_SSID_LEN];47} __packed; /* SCAN_DIRECT_SSID_IE_API_S_VER_1 */4849/* scan offload */50#define IWL_SCAN_MAX_BLACKLIST_LEN 6451#define IWL_SCAN_SHORT_BLACKLIST_LEN 1652#define IWL_SCAN_MAX_PROFILES 1153#define IWL_SCAN_MAX_PROFILES_V2 854#define SCAN_OFFLOAD_PROBE_REQ_SIZE 51255#define SCAN_NUM_BAND_PROBE_DATA_V_1 256#define SCAN_NUM_BAND_PROBE_DATA_V_2 35758/* Default watchdog (in MS) for scheduled scan iteration */59#define IWL_SCHED_SCAN_WATCHDOG cpu_to_le16(15000)6061#define IWL_GOOD_CRC_TH_DEFAULT cpu_to_le16(1)62#define CAN_ABORT_STATUS 16364#define IWL_FULL_SCAN_MULTIPLIER 565#define IWL_FAST_SCHED_SCAN_ITERATIONS 366#define IWL_MAX_SCHED_SCAN_PLANS 26768#define IWL_MAX_NUM_NOISE_RESULTS 226970enum scan_framework_client {71SCAN_CLIENT_SCHED_SCAN = BIT(0),72SCAN_CLIENT_NETDETECT = BIT(1),73SCAN_CLIENT_ASSET_TRACKING = BIT(2),74};7576/**77* struct iwl_scan_offload_blocklist - SCAN_OFFLOAD_BLACKLIST_S78* @ssid: MAC address to filter out79* @reported_rssi: AP rssi reported to the host80* @client_bitmap: clients ignore this entry - enum scan_framework_client81*/82struct iwl_scan_offload_blocklist {83u8 ssid[ETH_ALEN];84u8 reported_rssi;85u8 client_bitmap;86} __packed;8788enum iwl_scan_offload_network_type {89IWL_NETWORK_TYPE_BSS = 1,90IWL_NETWORK_TYPE_IBSS = 2,91IWL_NETWORK_TYPE_ANY = 3,92};9394enum iwl_scan_offload_band_selection {95IWL_SCAN_OFFLOAD_SELECT_2_4 = 0x4,96IWL_SCAN_OFFLOAD_SELECT_5_2 = 0x8,97IWL_SCAN_OFFLOAD_SELECT_ANY = 0xc,98};99100enum iwl_scan_offload_auth_alg {101IWL_AUTH_ALGO_UNSUPPORTED = 0x00,102IWL_AUTH_ALGO_NONE = 0x01,103IWL_AUTH_ALGO_PSK = 0x02,104IWL_AUTH_ALGO_8021X = 0x04,105IWL_AUTH_ALGO_SAE = 0x08,106IWL_AUTH_ALGO_8021X_SHA384 = 0x10,107IWL_AUTH_ALGO_OWE = 0x20,108};109110/**111* struct iwl_scan_offload_profile - SCAN_OFFLOAD_PROFILE_S112* @ssid_index: index to ssid list in fixed part113* @unicast_cipher: encryption algorithm to match - bitmap114* @auth_alg: authentication algorithm to match - bitmap115* @network_type: enum iwl_scan_offload_network_type116* @band_selection: enum iwl_scan_offload_band_selection117* @client_bitmap: clients waiting for match - enum scan_framework_client118* @reserved: reserved119*/120struct iwl_scan_offload_profile {121u8 ssid_index;122u8 unicast_cipher;123u8 auth_alg;124u8 network_type;125u8 band_selection;126u8 client_bitmap;127u8 reserved[2];128} __packed;129130/**131* struct iwl_scan_offload_profile_cfg_data132* @blocklist_len: length of blocklist133* @num_profiles: num of profiles in the list134* @match_notify: clients waiting for match found notification135* @pass_match: clients waiting for the results136* @active_clients: active clients bitmap - enum scan_framework_client137* @any_beacon_notify: clients waiting for match notification without match138* @reserved: reserved139*/140struct iwl_scan_offload_profile_cfg_data {141u8 blocklist_len;142u8 num_profiles;143u8 match_notify;144u8 pass_match;145u8 active_clients;146u8 any_beacon_notify;147u8 reserved[2];148} __packed;149150/**151* struct iwl_scan_offload_profile_cfg_v1 - scan offload profile config152* @profiles: profiles to search for match153* @data: the rest of the data for profile_cfg154*/155struct iwl_scan_offload_profile_cfg_v1 {156struct iwl_scan_offload_profile profiles[IWL_SCAN_MAX_PROFILES];157struct iwl_scan_offload_profile_cfg_data data;158} __packed; /* SCAN_OFFLOAD_PROFILES_CFG_API_S_VER_1-2*/159160/**161* struct iwl_scan_offload_profile_cfg162* @profiles: profiles to search for match163* @data: the rest of the data for profile_cfg164*/165struct iwl_scan_offload_profile_cfg {166struct iwl_scan_offload_profile profiles[IWL_SCAN_MAX_PROFILES_V2];167struct iwl_scan_offload_profile_cfg_data data;168} __packed; /* SCAN_OFFLOAD_PROFILES_CFG_API_S_VER_3*/169170/**171* struct iwl_scan_schedule_lmac - schedule of scan offload172* @delay: delay between iterations, in seconds.173* @iterations: num of scan iterations174* @full_scan_mul: number of partial scans before each full scan175*/176struct iwl_scan_schedule_lmac {177__le16 delay;178u8 iterations;179u8 full_scan_mul;180} __packed; /* SCAN_SCHEDULE_API_S */181182enum iwl_scan_offload_complete_status {183IWL_SCAN_OFFLOAD_COMPLETED = 1,184IWL_SCAN_OFFLOAD_ABORTED = 2,185};186187enum iwl_scan_ebs_status {188IWL_SCAN_EBS_SUCCESS,189IWL_SCAN_EBS_FAILED,190IWL_SCAN_EBS_CHAN_NOT_FOUND,191IWL_SCAN_EBS_INACTIVE,192};193194/**195* struct iwl_scan_req_tx_cmd - SCAN_REQ_TX_CMD_API_S196* @tx_flags: combination of TX_CMD_FLG_*197* @rate_n_flags: rate for *all* Tx attempts, if TX_CMD_FLG_STA_RATE_MSK is198* cleared. Combination of RATE_MCS_*199* @sta_id: index of destination station in FW station table200* @reserved: for alignment and future use201*/202struct iwl_scan_req_tx_cmd {203__le32 tx_flags;204__le32 rate_n_flags;205u8 sta_id;206u8 reserved[3];207} __packed;208209enum iwl_scan_channel_flags_lmac {210IWL_UNIFIED_SCAN_CHANNEL_FULL = BIT(27),211IWL_UNIFIED_SCAN_CHANNEL_PARTIAL = BIT(28),212};213214/**215* struct iwl_scan_channel_cfg_lmac - SCAN_CHANNEL_CFG_S_VER2216* @flags: bits 1-20: directed scan to i'th ssid217* other bits &enum iwl_scan_channel_flags_lmac218* @channel_num: channel number 1-13 etc219* @iter_count: scan iteration on this channel220* @iter_interval: interval in seconds between iterations on one channel221*/222struct iwl_scan_channel_cfg_lmac {223__le32 flags;224__le16 channel_num;225__le16 iter_count;226__le32 iter_interval;227} __packed;228229/**230* struct iwl_scan_probe_segment - PROBE_SEGMENT_API_S_VER_1231* @offset: offset in the data block232* @len: length of the segment233*/234struct iwl_scan_probe_segment {235__le16 offset;236__le16 len;237} __packed;238239/**240* struct iwl_scan_probe_req_v1 - PROBE_REQUEST_FRAME_API_S_VER_2241* @mac_header: first (and common) part of the probe242* @band_data: band specific data243* @common_data: last (and common) part of the probe244* @buf: raw data block245*/246struct iwl_scan_probe_req_v1 {247struct iwl_scan_probe_segment mac_header;248struct iwl_scan_probe_segment band_data[SCAN_NUM_BAND_PROBE_DATA_V_1];249struct iwl_scan_probe_segment common_data;250u8 buf[SCAN_OFFLOAD_PROBE_REQ_SIZE];251} __packed;252253/**254* struct iwl_scan_probe_req - PROBE_REQUEST_FRAME_API_S_VER_v2255* @mac_header: first (and common) part of the probe256* @band_data: band specific data257* @common_data: last (and common) part of the probe258* @buf: raw data block259*/260struct iwl_scan_probe_req {261struct iwl_scan_probe_segment mac_header;262struct iwl_scan_probe_segment band_data[SCAN_NUM_BAND_PROBE_DATA_V_2];263struct iwl_scan_probe_segment common_data;264u8 buf[SCAN_OFFLOAD_PROBE_REQ_SIZE];265} __packed;266267enum iwl_scan_channel_flags {268IWL_SCAN_CHANNEL_FLAG_EBS = BIT(0),269IWL_SCAN_CHANNEL_FLAG_EBS_ACCURATE = BIT(1),270IWL_SCAN_CHANNEL_FLAG_CACHE_ADD = BIT(2),271IWL_SCAN_CHANNEL_FLAG_EBS_FRAG = BIT(3),272IWL_SCAN_CHANNEL_FLAG_FORCE_EBS = BIT(4),273IWL_SCAN_CHANNEL_FLAG_ENABLE_CHAN_ORDER = BIT(5),274IWL_SCAN_CHANNEL_FLAG_6G_PSC_NO_FILTER = BIT(6),275};276277/**278* struct iwl_scan_channel_opt - CHANNEL_OPTIMIZATION_API_S279* @flags: enum iwl_scan_channel_flags280* @non_ebs_ratio: defines the ratio of number of scan iterations where EBS is281* involved.282* 1 - EBS is disabled.283* 2 - every second scan will be full scan(and so on).284*/285struct iwl_scan_channel_opt {286__le16 flags;287__le16 non_ebs_ratio;288} __packed;289290/**291* enum iwl_mvm_lmac_scan_flags - LMAC scan flags292* @IWL_MVM_LMAC_SCAN_FLAG_PASS_ALL: pass all beacons and probe responses293* without filtering.294* @IWL_MVM_LMAC_SCAN_FLAG_PASSIVE: force passive scan on all channels295* @IWL_MVM_LMAC_SCAN_FLAG_PRE_CONNECTION: single channel scan296* @IWL_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE: send iteration complete notification297* @IWL_MVM_LMAC_SCAN_FLAG_MULTIPLE_SSIDS: multiple SSID matching298* @IWL_MVM_LMAC_SCAN_FLAG_FRAGMENTED: all passive scans will be fragmented299* @IWL_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED: insert WFA vendor-specific TPC report300* and DS parameter set IEs into probe requests.301* @IWL_MVM_LMAC_SCAN_FLAG_EXTENDED_DWELL: use extended dwell time on channels302* 1, 6 and 11.303* @IWL_MVM_LMAC_SCAN_FLAG_MATCH: Send match found notification on matches304*/305enum iwl_mvm_lmac_scan_flags {306IWL_MVM_LMAC_SCAN_FLAG_PASS_ALL = BIT(0),307IWL_MVM_LMAC_SCAN_FLAG_PASSIVE = BIT(1),308IWL_MVM_LMAC_SCAN_FLAG_PRE_CONNECTION = BIT(2),309IWL_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE = BIT(3),310IWL_MVM_LMAC_SCAN_FLAG_MULTIPLE_SSIDS = BIT(4),311IWL_MVM_LMAC_SCAN_FLAG_FRAGMENTED = BIT(5),312IWL_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED = BIT(6),313IWL_MVM_LMAC_SCAN_FLAG_EXTENDED_DWELL = BIT(7),314IWL_MVM_LMAC_SCAN_FLAG_MATCH = BIT(9),315};316317enum iwl_scan_priority {318IWL_SCAN_PRIORITY_LOW,319IWL_SCAN_PRIORITY_MEDIUM,320IWL_SCAN_PRIORITY_HIGH,321};322323enum iwl_scan_priority_ext {324IWL_SCAN_PRIORITY_EXT_0_LOWEST,325IWL_SCAN_PRIORITY_EXT_1,326IWL_SCAN_PRIORITY_EXT_2,327IWL_SCAN_PRIORITY_EXT_3,328IWL_SCAN_PRIORITY_EXT_4,329IWL_SCAN_PRIORITY_EXT_5,330IWL_SCAN_PRIORITY_EXT_6,331IWL_SCAN_PRIORITY_EXT_7_HIGHEST,332};333334/**335* struct iwl_scan_req_lmac - SCAN_REQUEST_CMD_API_S_VER_1336* @reserved1: for alignment and future use337* @n_channels: num of channels to scan338* @active_dwell: dwell time for active channels339* @passive_dwell: dwell time for passive channels340* @fragmented_dwell: dwell time for fragmented passive scan341* @extended_dwell: dwell time for channels 1, 6 and 11 (in certain cases)342* @reserved2: for alignment and future use343* @rx_chain_select: PHY_RX_CHAIN_* flags344* @scan_flags: &enum iwl_mvm_lmac_scan_flags345* @max_out_time: max time (in TU) to be out of associated channel346* @suspend_time: pause scan this long (TUs) when returning to service channel347* @flags: RXON flags348* @filter_flags: RXON filter349* @tx_cmd: tx command for active scan; for 2GHz and for 5GHz350* @direct_scan: list of SSIDs for directed active scan351* @scan_prio: enum iwl_scan_priority352* @iter_num: number of scan iterations353* @delay: delay in seconds before first iteration354* @schedule: two scheduling plans. The first one is finite, the second one can355* be infinite.356* @channel_opt: channel optimization options, for full and partial scan357* @data: channel configuration and probe request packet.358*/359struct iwl_scan_req_lmac {360/* SCAN_REQUEST_FIXED_PART_API_S_VER_7 */361__le32 reserved1;362u8 n_channels;363u8 active_dwell;364u8 passive_dwell;365u8 fragmented_dwell;366u8 extended_dwell;367u8 reserved2;368__le16 rx_chain_select;369__le32 scan_flags;370__le32 max_out_time;371__le32 suspend_time;372/* RX_ON_FLAGS_API_S_VER_1 */373__le32 flags;374__le32 filter_flags;375struct iwl_scan_req_tx_cmd tx_cmd[2];376struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];377__le32 scan_prio;378/* SCAN_REQ_PERIODIC_PARAMS_API_S */379__le32 iter_num;380__le32 delay;381struct iwl_scan_schedule_lmac schedule[IWL_MAX_SCHED_SCAN_PLANS];382struct iwl_scan_channel_opt channel_opt[2];383u8 data[];384} __packed;385386/**387* struct iwl_scan_results_notif - scan results for one channel -388* SCAN_RESULT_NTF_API_S_VER_3389* @channel: which channel the results are from390* @band: 0 for 5.2 GHz, 1 for 2.4 GHz391* @probe_status: SCAN_PROBE_STATUS_*, indicates success of probe request392* @num_probe_not_sent: # of request that weren't sent due to not enough time393* @duration: duration spent in channel, in usecs394*/395struct iwl_scan_results_notif {396u8 channel;397u8 band;398u8 probe_status;399u8 num_probe_not_sent;400__le32 duration;401} __packed;402403/**404* struct iwl_lmac_scan_complete_notif - notifies end of scanning (all channels)405* SCAN_COMPLETE_NTF_API_S_VER_3406* @scanned_channels: number of channels scanned (and number of valid results)407* @status: one of SCAN_COMP_STATUS_*408* @bt_status: BT on/off status409* @last_channel: last channel that was scanned410* @tsf_low: TSF timer (lower half) in usecs411* @tsf_high: TSF timer (higher half) in usecs412* @results: an array of scan results, only "scanned_channels" of them are valid413*/414struct iwl_lmac_scan_complete_notif {415u8 scanned_channels;416u8 status;417u8 bt_status;418u8 last_channel;419__le32 tsf_low;420__le32 tsf_high;421struct iwl_scan_results_notif results[];422} __packed;423424/**425* struct iwl_periodic_scan_complete - PERIODIC_SCAN_COMPLETE_NTF_API_S_VER_2426* @last_schedule_line: last schedule line executed (fast or regular)427* @last_schedule_iteration: last scan iteration executed before scan abort428* @status: &enum iwl_scan_offload_complete_status429* @ebs_status: EBS success status &enum iwl_scan_ebs_status430* @time_after_last_iter: time in seconds elapsed after last iteration431* @reserved: reserved432*/433struct iwl_periodic_scan_complete {434u8 last_schedule_line;435u8 last_schedule_iteration;436u8 status;437u8 ebs_status;438__le32 time_after_last_iter;439__le32 reserved;440} __packed;441442/* UMAC Scan API */443444/* The maximum of either of these cannot exceed 8, because we use an445* 8-bit mask (see enum iwl_scan_status).446*/447#define IWL_MAX_UMAC_SCANS 4448#define IWL_MAX_LMAC_SCANS 1449450enum scan_config_flags {451SCAN_CONFIG_FLAG_ACTIVATE = BIT(0),452SCAN_CONFIG_FLAG_DEACTIVATE = BIT(1),453SCAN_CONFIG_FLAG_FORBID_CHUB_REQS = BIT(2),454SCAN_CONFIG_FLAG_ALLOW_CHUB_REQS = BIT(3),455SCAN_CONFIG_FLAG_SET_TX_CHAINS = BIT(8),456SCAN_CONFIG_FLAG_SET_RX_CHAINS = BIT(9),457SCAN_CONFIG_FLAG_SET_AUX_STA_ID = BIT(10),458SCAN_CONFIG_FLAG_SET_ALL_TIMES = BIT(11),459SCAN_CONFIG_FLAG_SET_EFFECTIVE_TIMES = BIT(12),460SCAN_CONFIG_FLAG_SET_CHANNEL_FLAGS = BIT(13),461SCAN_CONFIG_FLAG_SET_LEGACY_RATES = BIT(14),462SCAN_CONFIG_FLAG_SET_MAC_ADDR = BIT(15),463SCAN_CONFIG_FLAG_SET_FRAGMENTED = BIT(16),464SCAN_CONFIG_FLAG_CLEAR_FRAGMENTED = BIT(17),465SCAN_CONFIG_FLAG_SET_CAM_MODE = BIT(18),466SCAN_CONFIG_FLAG_CLEAR_CAM_MODE = BIT(19),467SCAN_CONFIG_FLAG_SET_PROMISC_MODE = BIT(20),468SCAN_CONFIG_FLAG_CLEAR_PROMISC_MODE = BIT(21),469SCAN_CONFIG_FLAG_SET_LMAC2_FRAGMENTED = BIT(22),470SCAN_CONFIG_FLAG_CLEAR_LMAC2_FRAGMENTED = BIT(23),471472/* Bits 26-31 are for num of channels in channel_array */473#define SCAN_CONFIG_N_CHANNELS(n) ((n) << 26)474};475476enum scan_config_rates {477/* OFDM basic rates */478SCAN_CONFIG_RATE_6M = BIT(0),479SCAN_CONFIG_RATE_9M = BIT(1),480SCAN_CONFIG_RATE_12M = BIT(2),481SCAN_CONFIG_RATE_18M = BIT(3),482SCAN_CONFIG_RATE_24M = BIT(4),483SCAN_CONFIG_RATE_36M = BIT(5),484SCAN_CONFIG_RATE_48M = BIT(6),485SCAN_CONFIG_RATE_54M = BIT(7),486/* CCK basic rates */487SCAN_CONFIG_RATE_1M = BIT(8),488SCAN_CONFIG_RATE_2M = BIT(9),489SCAN_CONFIG_RATE_5M = BIT(10),490SCAN_CONFIG_RATE_11M = BIT(11),491492/* Bits 16-27 are for supported rates */493#define SCAN_CONFIG_SUPPORTED_RATE(rate) ((rate) << 16)494};495496enum iwl_channel_flags {497IWL_CHANNEL_FLAG_EBS = BIT(0),498IWL_CHANNEL_FLAG_ACCURATE_EBS = BIT(1),499IWL_CHANNEL_FLAG_EBS_ADD = BIT(2),500IWL_CHANNEL_FLAG_PRE_SCAN_PASSIVE2ACTIVE = BIT(3),501};502503enum iwl_uhb_chan_cfg_flags {504IWL_UHB_CHAN_CFG_FLAG_UNSOLICITED_PROBE_RES = BIT(24),505IWL_UHB_CHAN_CFG_FLAG_PSC_CHAN_NO_LISTEN = BIT(25),506IWL_UHB_CHAN_CFG_FLAG_FORCE_PASSIVE = BIT(26),507};508/**509* struct iwl_scan_dwell510* @active: default dwell time for active scan511* @passive: default dwell time for passive scan512* @fragmented: default dwell time for fragmented scan513* @extended: default dwell time for channels 1, 6 and 11514*/515struct iwl_scan_dwell {516u8 active;517u8 passive;518u8 fragmented;519u8 extended;520} __packed;521522/**523* struct iwl_scan_config_v1 - scan configuration command524* @flags: enum scan_config_flags525* @tx_chains: valid_tx antenna - ANT_* definitions526* @rx_chains: valid_rx antenna - ANT_* definitions527* @legacy_rates: default legacy rates - enum scan_config_rates528* @out_of_channel_time: default max out of serving channel time529* @suspend_time: default max suspend time530* @dwell: dwells for the scan531* @mac_addr: default mac address to be used in probes532* @bcast_sta_id: the index of the station in the fw533* @channel_flags: default channel flags - enum iwl_channel_flags534* scan_config_channel_flag535* @channel_array: default supported channels536*/537struct iwl_scan_config_v1 {538__le32 flags;539__le32 tx_chains;540__le32 rx_chains;541__le32 legacy_rates;542__le32 out_of_channel_time;543__le32 suspend_time;544struct iwl_scan_dwell dwell;545u8 mac_addr[ETH_ALEN];546u8 bcast_sta_id;547u8 channel_flags;548u8 channel_array[];549} __packed; /* SCAN_CONFIG_DB_CMD_API_S */550551#define SCAN_TWO_LMACS 2552#define SCAN_LB_LMAC_IDX 0553#define SCAN_HB_LMAC_IDX 1554555/**556* struct iwl_scan_config_v2 - scan configuration command557* @flags: enum scan_config_flags558* @tx_chains: valid_tx antenna - ANT_* definitions559* @rx_chains: valid_rx antenna - ANT_* definitions560* @legacy_rates: default legacy rates - enum scan_config_rates561* @out_of_channel_time: default max out of serving channel time562* @suspend_time: default max suspend time563* @dwell: dwells for the scan564* @mac_addr: default mac address to be used in probes565* @bcast_sta_id: the index of the station in the fw566* @channel_flags: default channel flags - enum iwl_channel_flags567* scan_config_channel_flag568* @channel_array: default supported channels569*/570struct iwl_scan_config_v2 {571__le32 flags;572__le32 tx_chains;573__le32 rx_chains;574__le32 legacy_rates;575__le32 out_of_channel_time[SCAN_TWO_LMACS];576__le32 suspend_time[SCAN_TWO_LMACS];577struct iwl_scan_dwell dwell;578u8 mac_addr[ETH_ALEN];579u8 bcast_sta_id;580u8 channel_flags;581u8 channel_array[];582} __packed; /* SCAN_CONFIG_DB_CMD_API_S_2 */583584/**585* struct iwl_scan_config - scan configuration command586* @enable_cam_mode: whether to enable CAM mode.587* @enable_promiscouos_mode: whether to enable promiscouos mode588* @bcast_sta_id: the index of the station in the fw. Deprecated starting with589* API version 5.590* @reserved: reserved591* @tx_chains: valid_tx antenna - ANT_* definitions592* @rx_chains: valid_rx antenna - ANT_* definitions593*/594struct iwl_scan_config {595u8 enable_cam_mode;596u8 enable_promiscouos_mode;597u8 bcast_sta_id;598u8 reserved;599__le32 tx_chains;600__le32 rx_chains;601} __packed; /* SCAN_CONFIG_DB_CMD_API_S_5 */602603/**604* enum iwl_umac_scan_flags - UMAC scan flags605* @IWL_UMAC_SCAN_FLAG_PREEMPTIVE: scan process triggered by this scan request606* can be preempted by other scan requests with higher priority.607* The low priority scan will be resumed when the higher proirity scan is608* completed.609* @IWL_UMAC_SCAN_FLAG_START_NOTIF: notification will be sent to the driver610* when scan starts.611*/612enum iwl_umac_scan_flags {613IWL_UMAC_SCAN_FLAG_PREEMPTIVE = BIT(0),614IWL_UMAC_SCAN_FLAG_START_NOTIF = BIT(1),615};616617enum iwl_umac_scan_uid_offsets {618IWL_UMAC_SCAN_UID_TYPE_OFFSET = 0,619IWL_UMAC_SCAN_UID_SEQ_OFFSET = 8,620};621622enum iwl_umac_scan_general_flags {623IWL_UMAC_SCAN_GEN_FLAGS_PERIODIC = BIT(0),624IWL_UMAC_SCAN_GEN_FLAGS_OVER_BT = BIT(1),625IWL_UMAC_SCAN_GEN_FLAGS_PASS_ALL = BIT(2),626IWL_UMAC_SCAN_GEN_FLAGS_PASSIVE = BIT(3),627IWL_UMAC_SCAN_GEN_FLAGS_PRE_CONNECT = BIT(4),628IWL_UMAC_SCAN_GEN_FLAGS_ITER_COMPLETE = BIT(5),629IWL_UMAC_SCAN_GEN_FLAGS_MULTIPLE_SSID = BIT(6),630IWL_UMAC_SCAN_GEN_FLAGS_FRAGMENTED = BIT(7),631IWL_UMAC_SCAN_GEN_FLAGS_RRM_ENABLED = BIT(8),632IWL_UMAC_SCAN_GEN_FLAGS_MATCH = BIT(9),633IWL_UMAC_SCAN_GEN_FLAGS_EXTENDED_DWELL = BIT(10),634/* Extended dwell is obselete when adaptive dwell is used, making this635* bit reusable. Hence, probe request defer is used only when adaptive636* dwell is supported. */637IWL_UMAC_SCAN_GEN_FLAGS_PROB_REQ_DEFER_SUPP = BIT(10),638IWL_UMAC_SCAN_GEN_FLAGS_LMAC2_FRAGMENTED = BIT(11),639IWL_UMAC_SCAN_GEN_FLAGS_ADAPTIVE_DWELL = BIT(13),640IWL_UMAC_SCAN_GEN_FLAGS_MAX_CHNL_TIME = BIT(14),641IWL_UMAC_SCAN_GEN_FLAGS_PROB_REQ_HIGH_TX_RATE = BIT(15),642};643644/**645* enum iwl_umac_scan_general_flags2 - UMAC scan general flags #2646* @IWL_UMAC_SCAN_GEN_FLAGS2_NOTIF_PER_CHNL: Whether to send a complete647* notification per channel or not.648* @IWL_UMAC_SCAN_GEN_FLAGS2_ALLOW_CHNL_REORDER: Whether to allow channel649* reorder optimization or not.650* @IWL_UMAC_SCAN_GEN_FLAGS2_COLLECT_CHANNEL_STATS: Enable channel statistics651* collection when #IWL_UMAC_SCAN_GEN_FLAGS_V2_FORCE_PASSIVE is set.652*/653enum iwl_umac_scan_general_flags2 {654IWL_UMAC_SCAN_GEN_FLAGS2_NOTIF_PER_CHNL = BIT(0),655IWL_UMAC_SCAN_GEN_FLAGS2_ALLOW_CHNL_REORDER = BIT(1),656IWL_UMAC_SCAN_GEN_FLAGS2_COLLECT_CHANNEL_STATS = BIT(3),657};658659/**660* enum iwl_umac_scan_general_flags_v2 - UMAC scan general flags version 2661*662* The FW flags were reordered and hence the driver introduce version 2663*664* @IWL_UMAC_SCAN_GEN_FLAGS_V2_PERIODIC: periodic or scheduled665* @IWL_UMAC_SCAN_GEN_FLAGS_V2_PASS_ALL: pass all probe responses and beacons666* during scan iterations667* @IWL_UMAC_SCAN_GEN_FLAGS_V2_NTFY_ITER_COMPLETE: send complete notification668* on every iteration instead of only once after the last iteration669* @IWL_UMAC_SCAN_GEN_FLAGS_V2_FRAGMENTED_LMAC1: fragmented scan LMAC1670* @IWL_UMAC_SCAN_GEN_FLAGS_V2_FRAGMENTED_LMAC2: fragmented scan LMAC2671* @IWL_UMAC_SCAN_GEN_FLAGS_V2_MATCH: does this scan check for profile matching672* @IWL_UMAC_SCAN_GEN_FLAGS_V2_USE_ALL_RX_CHAINS: use all valid chains for RX673* @IWL_UMAC_SCAN_GEN_FLAGS_V2_ADAPTIVE_DWELL: works with adaptive dwell674* for active channel675* @IWL_UMAC_SCAN_GEN_FLAGS_V2_PREEMPTIVE: can be preempted by other requests676* @IWL_UMAC_SCAN_GEN_FLAGS_V2_NTF_START: send notification of scan start677* @IWL_UMAC_SCAN_GEN_FLAGS_V2_MULTI_SSID: matching on multiple SSIDs678* @IWL_UMAC_SCAN_GEN_FLAGS_V2_FORCE_PASSIVE: all the channels scanned679* as passive680* @IWL_UMAC_SCAN_GEN_FLAGS_V2_TRIGGER_UHB_SCAN: at the end of 2.4GHz and681* 5.2Ghz bands scan, trigger scan on 6GHz band to discover682* the reported collocated APs683* @IWL_UMAC_SCAN_GEN_FLAGS_V2_6GHZ_PASSIVE_SCAN: at the end of 2.4GHz and 5GHz684* bands scan, if not APs were discovered, allow scan to conitnue and scan685* 6GHz PSC channels in order to discover country information.686* @IWL_UMAC_SCAN_GEN_FLAGS_V2_6GHZ_PASSIVE_SCAN_FILTER_IN: in case687* &IWL_UMAC_SCAN_GEN_FLAGS_V2_6GHZ_PASSIVE_SCAN is enabled and scan is688* activated over 6GHz PSC channels, filter in beacons and probe responses.689* @IWL_UMAC_SCAN_GEN_FLAGS_V2_OCE: if set, send probe requests in a minimum690* rate of 5.5Mpbs, filter in broadcast probe responses and set the max691* channel time indication field in the FILS request parameters element692* (if included by the driver in the probe request IEs).693*/694enum iwl_umac_scan_general_flags_v2 {695IWL_UMAC_SCAN_GEN_FLAGS_V2_PERIODIC = BIT(0),696IWL_UMAC_SCAN_GEN_FLAGS_V2_PASS_ALL = BIT(1),697IWL_UMAC_SCAN_GEN_FLAGS_V2_NTFY_ITER_COMPLETE = BIT(2),698IWL_UMAC_SCAN_GEN_FLAGS_V2_FRAGMENTED_LMAC1 = BIT(3),699IWL_UMAC_SCAN_GEN_FLAGS_V2_FRAGMENTED_LMAC2 = BIT(4),700IWL_UMAC_SCAN_GEN_FLAGS_V2_MATCH = BIT(5),701IWL_UMAC_SCAN_GEN_FLAGS_V2_USE_ALL_RX_CHAINS = BIT(6),702IWL_UMAC_SCAN_GEN_FLAGS_V2_ADAPTIVE_DWELL = BIT(7),703IWL_UMAC_SCAN_GEN_FLAGS_V2_PREEMPTIVE = BIT(8),704IWL_UMAC_SCAN_GEN_FLAGS_V2_NTF_START = BIT(9),705IWL_UMAC_SCAN_GEN_FLAGS_V2_MULTI_SSID = BIT(10),706IWL_UMAC_SCAN_GEN_FLAGS_V2_FORCE_PASSIVE = BIT(11),707IWL_UMAC_SCAN_GEN_FLAGS_V2_TRIGGER_UHB_SCAN = BIT(12),708IWL_UMAC_SCAN_GEN_FLAGS_V2_6GHZ_PASSIVE_SCAN = BIT(13),709IWL_UMAC_SCAN_GEN_FLAGS_V2_6GHZ_PASSIVE_SCAN_FILTER_IN = BIT(14),710IWL_UMAC_SCAN_GEN_FLAGS_V2_OCE = BIT(15),711};712713/**714* enum iwl_umac_scan_general_params_flags2 - UMAC scan general flags2715*716* @IWL_UMAC_SCAN_GEN_PARAMS_FLAGS2_RESPECT_P2P_GO_LB: scan event scheduling717* should be aware of a P2P GO operation on the 2GHz band.718* @IWL_UMAC_SCAN_GEN_PARAMS_FLAGS2_RESPECT_P2P_GO_HB: scan event scheduling719* should be aware of a P2P GO operation on the 5GHz or 6GHz band.720* @IWL_UMAC_SCAN_GEN_PARAMS_FLAGS2_DONT_TOGGLE_ANT: don't toggle between721* valid antennas, and use the same antenna as in previous scan722*/723enum iwl_umac_scan_general_params_flags2 {724IWL_UMAC_SCAN_GEN_PARAMS_FLAGS2_RESPECT_P2P_GO_LB = BIT(0),725IWL_UMAC_SCAN_GEN_PARAMS_FLAGS2_RESPECT_P2P_GO_HB = BIT(1),726IWL_UMAC_SCAN_GEN_PARAMS_FLAGS2_DONT_TOGGLE_ANT = BIT(2),727};728729/**730* struct iwl_scan_channel_cfg_umac731* @flags: bitmap - 0-19: directed scan to i'th ssid.732* @channel_num: channel number 1-13 etc.733* @v1: command version 1734* @v1.iter_count: repetition count for the channel.735* @v1.iter_interval: interval between two scan iterations on one channel.736* @v2: command versions 2-4737* @v2.band: band of channel: 0 for 2GHz, 1 for 5GHz738* @v2.iter_count: repetition count for the channel.739* @v2.iter_interval: interval between two scan iterations on one channel.740* @v5: command versions 5 and up741* @v5.iter_count: repetition count for the channel.742* @v5.iter_interval: interval between two scan iterations on one channel.743* @v5.psd_20: highest PSD value for all APs known so far744* on this channel.745*/746struct iwl_scan_channel_cfg_umac {747#define IWL_CHAN_CFG_FLAGS_BAND_POS 30748__le32 flags;749u8 channel_num;750751/* All versions are of the same size, so use a union without adjusting752* the command size later753*/754union {755struct {756u8 iter_count;757__le16 iter_interval;758} __packed v1; /* SCAN_CHANNEL_CONFIG_API_S_VER_1 */759struct {760u8 band;761u8 iter_count;762u8 iter_interval;763} __packed v2; /* SCAN_CHANNEL_CONFIG_API_S_VER_2764* SCAN_CHANNEL_CONFIG_API_S_VER_3765* SCAN_CHANNEL_CONFIG_API_S_VER_4766*/767struct {768u8 psd_20;769u8 iter_count;770u8 iter_interval;771} __packed v5; /* SCAN_CHANNEL_CONFIG_API_S_VER_5 */772} __packed;773} __packed;774775/**776* struct iwl_scan_umac_schedule777* @interval: interval in seconds between scan iterations778* @iter_count: num of scan iterations for schedule plan, 0xff for infinite loop779* @reserved: for alignment and future use780*/781struct iwl_scan_umac_schedule {782__le16 interval;783u8 iter_count;784u8 reserved;785} __packed; /* SCAN_SCHED_PARAM_API_S_VER_1 */786787struct iwl_scan_req_umac_tail_v1 {788/* SCAN_PERIODIC_PARAMS_API_S_VER_1 */789struct iwl_scan_umac_schedule schedule[IWL_MAX_SCHED_SCAN_PLANS];790__le16 delay;791__le16 reserved;792/* SCAN_PROBE_PARAMS_API_S_VER_1 */793struct iwl_scan_probe_req_v1 preq;794struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];795} __packed;796797/**798* struct iwl_scan_req_umac_tail_v2 - the rest of the UMAC scan request command799* parameters following channels configuration array.800* @schedule: two scheduling plans.801* @delay: delay in TUs before starting the first scan iteration802* @reserved: for future use and alignment803* @preq: probe request with IEs blocks804* @direct_scan: list of SSIDs for directed active scan805*/806struct iwl_scan_req_umac_tail_v2 {807/* SCAN_PERIODIC_PARAMS_API_S_VER_1 */808struct iwl_scan_umac_schedule schedule[IWL_MAX_SCHED_SCAN_PLANS];809__le16 delay;810__le16 reserved;811/* SCAN_PROBE_PARAMS_API_S_VER_2 */812struct iwl_scan_probe_req preq;813struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];814} __packed;815816/**817* struct iwl_scan_umac_chan_param818* @flags: channel flags &enum iwl_scan_channel_flags819* @count: num of channels in scan request820* @reserved: for future use and alignment821*/822struct iwl_scan_umac_chan_param {823u8 flags;824u8 count;825__le16 reserved;826} __packed; /*SCAN_CHANNEL_PARAMS_API_S_VER_1 */827828/**829* struct iwl_scan_req_umac830* @flags: &enum iwl_umac_scan_flags831* @uid: scan id, &enum iwl_umac_scan_uid_offsets832* @ooc_priority: out of channel priority - &enum iwl_scan_priority833* @general_flags: &enum iwl_umac_scan_general_flags834* @scan_start_mac_id: report the scan start TSF time according to this mac TSF835* @extended_dwell: dwell time for channels 1, 6 and 11836* @active_dwell: dwell time for active scan per LMAC837* @passive_dwell: dwell time for passive scan per LMAC838* @fragmented_dwell: dwell time for fragmented passive scan839* @adwell_default_n_aps: for adaptive dwell the default number of APs840* per channel841* @adwell_default_n_aps_social: for adaptive dwell the default842* number of APs per social (1,6,11) channel843* @general_flags2: &enum iwl_umac_scan_general_flags2844* @adwell_max_budget: for adaptive dwell the maximal budget of TU to be added845* to total scan time846* @max_out_time: max out of serving channel time, per LMAC - for CDB there847* are 2 LMACs848* @suspend_time: max suspend time, per LMAC - for CDB there are 2 LMACs849* @scan_priority: scan internal prioritization &enum iwl_scan_priority850* @num_of_fragments: Number of fragments needed for full coverage per band.851* Relevant only for fragmented scan.852* @channel: &struct iwl_scan_umac_chan_param853* @reserved: for future use and alignment854* @reserved3: for future use and alignment855* @data: &struct iwl_scan_channel_cfg_umac and856* &struct iwl_scan_req_umac_tail857*/858struct iwl_scan_req_umac {859__le32 flags;860__le32 uid;861__le32 ooc_priority;862__le16 general_flags;863u8 reserved;864u8 scan_start_mac_id;865union {866struct {867u8 extended_dwell;868u8 active_dwell;869u8 passive_dwell;870u8 fragmented_dwell;871__le32 max_out_time;872__le32 suspend_time;873__le32 scan_priority;874struct iwl_scan_umac_chan_param channel;875u8 data[];876} v1; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_1 */877struct {878u8 extended_dwell;879u8 active_dwell;880u8 passive_dwell;881u8 fragmented_dwell;882__le32 max_out_time[SCAN_TWO_LMACS];883__le32 suspend_time[SCAN_TWO_LMACS];884__le32 scan_priority;885struct iwl_scan_umac_chan_param channel;886u8 data[];887} v6; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_6 */888struct {889u8 active_dwell;890u8 passive_dwell;891u8 fragmented_dwell;892u8 adwell_default_n_aps;893u8 adwell_default_n_aps_social;894u8 reserved3;895__le16 adwell_max_budget;896__le32 max_out_time[SCAN_TWO_LMACS];897__le32 suspend_time[SCAN_TWO_LMACS];898__le32 scan_priority;899struct iwl_scan_umac_chan_param channel;900u8 data[];901} v7; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_7 */902struct {903u8 active_dwell[SCAN_TWO_LMACS];904u8 reserved2;905u8 adwell_default_n_aps;906u8 adwell_default_n_aps_social;907u8 general_flags2;908__le16 adwell_max_budget;909__le32 max_out_time[SCAN_TWO_LMACS];910__le32 suspend_time[SCAN_TWO_LMACS];911__le32 scan_priority;912u8 passive_dwell[SCAN_TWO_LMACS];913u8 num_of_fragments[SCAN_TWO_LMACS];914struct iwl_scan_umac_chan_param channel;915u8 data[];916} v8; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_8 */917struct {918u8 active_dwell[SCAN_TWO_LMACS];919u8 adwell_default_hb_n_aps;920u8 adwell_default_lb_n_aps;921u8 adwell_default_n_aps_social;922u8 general_flags2;923__le16 adwell_max_budget;924__le32 max_out_time[SCAN_TWO_LMACS];925__le32 suspend_time[SCAN_TWO_LMACS];926__le32 scan_priority;927u8 passive_dwell[SCAN_TWO_LMACS];928u8 num_of_fragments[SCAN_TWO_LMACS];929struct iwl_scan_umac_chan_param channel;930u8 data[];931} v9; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_9 */932};933} __packed;934935#define IWL_SCAN_REQ_UMAC_SIZE_V8 sizeof(struct iwl_scan_req_umac)936#define IWL_SCAN_REQ_UMAC_SIZE_V7 48937#define IWL_SCAN_REQ_UMAC_SIZE_V6 44938#define IWL_SCAN_REQ_UMAC_SIZE_V1 36939940/**941* struct iwl_scan_probe_params_v3942* @preq: scan probe request params943* @ssid_num: number of valid SSIDs in direct scan array944* @short_ssid_num: number of valid short SSIDs in short ssid array945* @bssid_num: number of valid bssid in bssids array946* @reserved: reserved947* @direct_scan: list of ssids948* @short_ssid: array of short ssids949* @bssid_array: array of bssids950*/951struct iwl_scan_probe_params_v3 {952struct iwl_scan_probe_req preq;953u8 ssid_num;954u8 short_ssid_num;955u8 bssid_num;956u8 reserved;957struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];958__le32 short_ssid[SCAN_SHORT_SSID_MAX_SIZE];959u8 bssid_array[SCAN_BSSID_MAX_SIZE][ETH_ALEN];960} __packed; /* SCAN_PROBE_PARAMS_API_S_VER_3 */961962/**963* struct iwl_scan_probe_params_v4964* @preq: scan probe request params965* @short_ssid_num: number of valid short SSIDs in short ssid array966* @bssid_num: number of valid bssid in bssids array967* @reserved: reserved968* @direct_scan: list of ssids969* @short_ssid: array of short ssids970* @bssid_array: array of bssids971*/972struct iwl_scan_probe_params_v4 {973struct iwl_scan_probe_req preq;974u8 short_ssid_num;975u8 bssid_num;976__le16 reserved;977struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];978__le32 short_ssid[SCAN_SHORT_SSID_MAX_SIZE];979u8 bssid_array[SCAN_BSSID_MAX_SIZE][ETH_ALEN];980} __packed; /* SCAN_PROBE_PARAMS_API_S_VER_4 */981982#define SCAN_MAX_NUM_CHANS_V3 67983984/**985* struct iwl_scan_channel_params_v4986* @flags: channel flags &enum iwl_scan_channel_flags987* @count: num of channels in scan request988* @num_of_aps_override: override the number of APs the FW uses to calculate989* dwell time when adaptive dwell is used990* @reserved: for future use and alignment991* @channel_config: array of explicit channel configurations992* for 2.4Ghz and 5.2Ghz bands993* @adwell_ch_override_bitmap: when using adaptive dwell, override the number994* of APs value with &num_of_aps_override for the channel.995* To cast channel to index, use &iwl_mvm_scan_ch_and_band_to_idx996*/997struct iwl_scan_channel_params_v4 {998u8 flags;999u8 count;1000u8 num_of_aps_override;1001u8 reserved;1002struct iwl_scan_channel_cfg_umac channel_config[SCAN_MAX_NUM_CHANS_V3];1003u8 adwell_ch_override_bitmap[16];1004} __packed; /* SCAN_CHANNEL_PARAMS_API_S_VER_4 also1005SCAN_CHANNEL_PARAMS_API_S_VER_5 */10061007/**1008* struct iwl_scan_channel_params_v71009* @flags: channel flags &enum iwl_scan_channel_flags1010* @count: num of channels in scan request1011* @n_aps_override: override the number of APs the FW uses to calculate dwell1012* time when adaptive dwell is used.1013* Channel k will use n_aps_override[i] when BIT(20 + i) is set in1014* channel_config[k].flags1015* @channel_config: array of explicit channel configurations1016* for 2.4Ghz and 5.2Ghz bands1017*/1018struct iwl_scan_channel_params_v7 {1019u8 flags;1020u8 count;1021u8 n_aps_override[2];1022struct iwl_scan_channel_cfg_umac channel_config[SCAN_MAX_NUM_CHANS_V3];1023} __packed; /* SCAN_CHANNEL_PARAMS_API_S_VER_6 */10241025/**1026* struct iwl_scan_general_params_v111027* @flags: &enum iwl_umac_scan_general_flags_v21028* @reserved: reserved for future1029* @scan_start_mac_or_link_id: report the scan start TSF time according to this1030* mac (up to verion 11) or link (starting with version 12) TSF1031* @active_dwell: dwell time for active scan per LMAC1032* @adwell_default_2g: adaptive dwell default number of APs1033* for 2.4GHz channel1034* @adwell_default_5g: adaptive dwell default number of APs1035* for 5GHz channels1036* @adwell_default_social_chn: adaptive dwell default number of1037* APs per social channel1038* @flags2: for version 11 see &enum iwl_umac_scan_general_params_flags2.1039* Otherwise reserved.1040* @adwell_max_budget: the maximal number of TUs that adaptive dwell1041* can add to the total scan time1042* @max_out_of_time: max out of serving channel time, per LMAC1043* @suspend_time: max suspend time, per LMAC1044* @scan_priority: priority of the request1045* @passive_dwell: continues dwell time for passive channel1046* (without adaptive dwell)1047* @num_of_fragments: number of fragments needed for full fragmented1048* scan coverage.1049*/1050struct iwl_scan_general_params_v11 {1051__le16 flags;1052u8 reserved;1053u8 scan_start_mac_or_link_id;1054u8 active_dwell[SCAN_TWO_LMACS];1055u8 adwell_default_2g;1056u8 adwell_default_5g;1057u8 adwell_default_social_chn;1058u8 flags2;1059__le16 adwell_max_budget;1060__le32 max_out_of_time[SCAN_TWO_LMACS];1061__le32 suspend_time[SCAN_TWO_LMACS];1062__le32 scan_priority;1063u8 passive_dwell[SCAN_TWO_LMACS];1064u8 num_of_fragments[SCAN_TWO_LMACS];1065} __packed; /* SCAN_GENERAL_PARAMS_API_S_VER_12, *_VER_11 and *_VER_10 */10661067/**1068* struct iwl_scan_periodic_parms_v11069* @schedule: can scheduling parameter1070* @delay: initial delay of the periodic scan in seconds1071* @reserved: reserved for future1072*/1073struct iwl_scan_periodic_parms_v1 {1074struct iwl_scan_umac_schedule schedule[IWL_MAX_SCHED_SCAN_PLANS];1075__le16 delay;1076__le16 reserved;1077} __packed; /* SCAN_PERIODIC_PARAMS_API_S_VER_1 */10781079/**1080* struct iwl_scan_req_params_v121081* @general_params: &struct iwl_scan_general_params_v111082* @channel_params: &struct iwl_scan_channel_params_v41083* @periodic_params: &struct iwl_scan_periodic_parms_v11084* @probe_params: &struct iwl_scan_probe_params_v31085*/1086struct iwl_scan_req_params_v12 {1087struct iwl_scan_general_params_v11 general_params;1088struct iwl_scan_channel_params_v4 channel_params;1089struct iwl_scan_periodic_parms_v1 periodic_params;1090struct iwl_scan_probe_params_v3 probe_params;1091} __packed; /* SCAN_REQUEST_PARAMS_API_S_VER_12 */10921093/**1094* struct iwl_scan_req_params_v17 - scan request parameters (v17)1095* @general_params: &struct iwl_scan_general_params_v111096* @channel_params: &struct iwl_scan_channel_params_v71097* @periodic_params: &struct iwl_scan_periodic_parms_v11098* @probe_params: &struct iwl_scan_probe_params_v41099*/1100struct iwl_scan_req_params_v17 {1101struct iwl_scan_general_params_v11 general_params;1102struct iwl_scan_channel_params_v7 channel_params;1103struct iwl_scan_periodic_parms_v1 periodic_params;1104struct iwl_scan_probe_params_v4 probe_params;1105} __packed; /* SCAN_REQUEST_PARAMS_API_S_VER_17 - 14 */11061107/**1108* struct iwl_scan_req_umac_v121109* @uid: scan id, &enum iwl_umac_scan_uid_offsets1110* @ooc_priority: out of channel priority - &enum iwl_scan_priority1111* @scan_params: scan parameters1112*/1113struct iwl_scan_req_umac_v12 {1114__le32 uid;1115__le32 ooc_priority;1116struct iwl_scan_req_params_v12 scan_params;1117} __packed; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_12 */11181119/**1120* struct iwl_scan_req_umac_v17 - scan request command (v17)1121* @uid: scan id, &enum iwl_umac_scan_uid_offsets1122* @ooc_priority: out of channel priority - &enum iwl_scan_priority1123* @scan_params: scan parameters1124*/1125struct iwl_scan_req_umac_v17 {1126__le32 uid;1127__le32 ooc_priority;1128struct iwl_scan_req_params_v17 scan_params;1129} __packed; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_17 - 14 */11301131/**1132* struct iwl_umac_scan_abort1133* @uid: scan id, &enum iwl_umac_scan_uid_offsets1134* @flags: reserved1135*/1136struct iwl_umac_scan_abort {1137__le32 uid;1138__le32 flags;1139} __packed; /* SCAN_ABORT_CMD_UMAC_API_S_VER_1 */11401141/**1142* enum iwl_umac_scan_abort_status1143*1144* @IWL_UMAC_SCAN_ABORT_STATUS_SUCCESS: scan was successfully aborted1145* @IWL_UMAC_SCAN_ABORT_STATUS_IN_PROGRESS: scan abort is in progress1146* @IWL_UMAC_SCAN_ABORT_STATUS_NOT_FOUND: nothing to abort1147*/1148enum iwl_umac_scan_abort_status {1149IWL_UMAC_SCAN_ABORT_STATUS_SUCCESS = 0,1150IWL_UMAC_SCAN_ABORT_STATUS_IN_PROGRESS,1151IWL_UMAC_SCAN_ABORT_STATUS_NOT_FOUND,1152};11531154/**1155* struct iwl_umac_scan_complete1156* @uid: scan id, &enum iwl_umac_scan_uid_offsets1157* @last_schedule: last scheduling line1158* @last_iter: last scan iteration number1159* @status: &enum iwl_scan_offload_complete_status1160* @ebs_status: &enum iwl_scan_ebs_status1161* @time_from_last_iter: time elapsed from last iteration1162* @reserved: for future use1163*/1164struct iwl_umac_scan_complete {1165__le32 uid;1166u8 last_schedule;1167u8 last_iter;1168u8 status;1169u8 ebs_status;1170__le32 time_from_last_iter;1171__le32 reserved;1172} __packed; /* SCAN_COMPLETE_NTF_UMAC_API_S_VER_1 */11731174#define SCAN_OFFLOAD_MATCHING_CHANNELS_LEN_V1 51175#define SCAN_OFFLOAD_MATCHING_CHANNELS_LEN 711761177/**1178* struct iwl_scan_offload_profile_match_v1 - match information1179* @bssid: matched bssid1180* @reserved: reserved1181* @channel: channel where the match occurred1182* @energy: energy1183* @matching_feature: feature matches1184* @matching_channels: bitmap of channels that matched, referencing1185* the channels passed in the scan offload request.1186*/1187struct iwl_scan_offload_profile_match_v1 {1188u8 bssid[ETH_ALEN];1189__le16 reserved;1190u8 channel;1191u8 energy;1192u8 matching_feature;1193u8 matching_channels[SCAN_OFFLOAD_MATCHING_CHANNELS_LEN_V1];1194} __packed; /* SCAN_OFFLOAD_PROFILE_MATCH_RESULTS_S_VER_1 */11951196/**1197* struct iwl_scan_offload_profiles_query_v1 - match results query response1198* @matched_profiles: bitmap of matched profiles, referencing the1199* matches passed in the scan offload request1200* @last_scan_age: age of the last offloaded scan1201* @n_scans_done: number of offloaded scans done1202* @gp2_d0u: GP2 when D0U occurred1203* @gp2_invoked: GP2 when scan offload was invoked1204* @resume_while_scanning: not used1205* @self_recovery: obsolete1206* @reserved: reserved1207* @matches: array of match information, one for each match1208*/1209struct iwl_scan_offload_profiles_query_v1 {1210__le32 matched_profiles;1211__le32 last_scan_age;1212__le32 n_scans_done;1213__le32 gp2_d0u;1214__le32 gp2_invoked;1215u8 resume_while_scanning;1216u8 self_recovery;1217__le16 reserved;1218struct iwl_scan_offload_profile_match_v1 matches[];1219} __packed; /* SCAN_OFFLOAD_PROFILES_QUERY_RSP_S_VER_2 */12201221/**1222* struct iwl_scan_offload_profile_match - match information1223* @bssid: matched bssid1224* @reserved: reserved1225* @channel: channel where the match occurred1226* @energy: energy1227* @matching_feature: feature matches1228* @matching_channels: bitmap of channels that matched, referencing1229* the channels passed in the scan offload request.1230*/1231struct iwl_scan_offload_profile_match {1232u8 bssid[ETH_ALEN];1233__le16 reserved;1234u8 channel;1235u8 energy;1236u8 matching_feature;1237u8 matching_channels[SCAN_OFFLOAD_MATCHING_CHANNELS_LEN];1238} __packed; /* SCAN_OFFLOAD_PROFILE_MATCH_RESULTS_S_VER_2 */12391240/**1241* struct iwl_scan_offload_match_info - match results information1242* @matched_profiles: bitmap of matched profiles, referencing the1243* matches passed in the scan offload request1244* @last_scan_age: age of the last offloaded scan1245* @n_scans_done: number of offloaded scans done1246* @gp2_d0u: GP2 when D0U occurred1247* @gp2_invoked: GP2 when scan offload was invoked1248* @resume_while_scanning: not used1249* @self_recovery: obsolete1250* @reserved: reserved1251* @matches: array of match information, one for each match1252*/1253struct iwl_scan_offload_match_info {1254__le32 matched_profiles;1255__le32 last_scan_age;1256__le32 n_scans_done;1257__le32 gp2_d0u;1258__le32 gp2_invoked;1259u8 resume_while_scanning;1260u8 self_recovery;1261__le16 reserved;1262struct iwl_scan_offload_profile_match matches[];1263} __packed; /* SCAN_OFFLOAD_PROFILES_QUERY_RSP_S_VER_3 and1264* SCAN_OFFLOAD_MATCH_INFO_NOTIFICATION_S_VER_11265*/12661267/**1268* struct iwl_umac_scan_iter_complete_notif - notifies end of scanning iteration1269* @uid: scan id, &enum iwl_umac_scan_uid_offsets1270* @scanned_channels: number of channels scanned and number of valid elements in1271* results array1272* @status: one of SCAN_COMP_STATUS_*1273* @bt_status: BT on/off status1274* @last_channel: last channel that was scanned1275* @start_tsf: TSF timer in usecs of the scan start time for the mac specified1276* in &struct iwl_scan_req_umac.1277* @results: array of scan results, length in @scanned_channels1278*/1279struct iwl_umac_scan_iter_complete_notif {1280__le32 uid;1281u8 scanned_channels;1282u8 status;1283u8 bt_status;1284u8 last_channel;1285__le64 start_tsf;1286struct iwl_scan_results_notif results[];1287} __packed; /* SCAN_ITER_COMPLETE_NTF_UMAC_API_S_VER_2 */12881289/**1290* struct iwl_umac_scan_channel_survey_notif - data for survey1291* @channel: the channel scanned1292* @band: band of channel1293* @noise: noise floor measurements in negative dBm, invalid 0xff1294* @reserved: for future use and alignment1295* @active_time: time in ms the radio was turned on (on the channel)1296* @busy_time: time in ms the channel was sensed busy, 0 for a clean channel1297* @tx_time: time the radio spent transmitting data1298* @rx_time: time the radio spent receiving data1299*/1300struct iwl_umac_scan_channel_survey_notif {1301__le32 channel;1302__le32 band;1303u8 noise[IWL_MAX_NUM_NOISE_RESULTS];1304u8 reserved[2];1305__le32 active_time;1306__le32 busy_time;1307__le32 tx_time;1308__le32 rx_time;1309} __packed; /* SCAN_CHANNEL_SURVEY_NTF_API_S_VER_1 */13101311#endif /* __iwl_fw_api_scan_h__ */131213131314