123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
#ifndef __iwl_mld_scan_h__
#define __iwl_mld_scan_h__
int iwl_mld_alloc_scan_cmd(struct iwl_mld *mld);
int iwl_mld_regular_scan_start(struct iwl_mld *mld, struct ieee80211_vif *vif,
struct cfg80211_scan_request *req,
struct ieee80211_scan_ies *ies);
void iwl_mld_int_mlo_scan(struct iwl_mld *mld, struct ieee80211_vif *vif);
void iwl_mld_handle_scan_iter_complete_notif(struct iwl_mld *mld,
struct iwl_rx_packet *pkt);
int iwl_mld_scan_stop(struct iwl_mld *mld, int type, bool notify);
int iwl_mld_sched_scan_start(struct iwl_mld *mld,
struct ieee80211_vif *vif,
struct cfg80211_sched_scan_request *req,
struct ieee80211_scan_ies *ies,
int type);
void iwl_mld_handle_match_found_notif(struct iwl_mld *mld,
struct iwl_rx_packet *pkt);
void iwl_mld_handle_scan_start_notif(struct iwl_mld *mld,
struct iwl_rx_packet *pkt);
void iwl_mld_handle_scan_complete_notif(struct iwl_mld *mld,
struct iwl_rx_packet *pkt);
int iwl_mld_mac80211_get_survey(struct ieee80211_hw *hw, int idx,
struct survey_info *survey);
void iwl_mld_handle_channel_survey_notif(struct iwl_mld *mld,
struct iwl_rx_packet *pkt);
#define WFA_TPC_IE_LEN 9
static inline int iwl_mld_scan_max_template_size(void)
{
#define MAC_HDR_LEN 24
#define DS_IE_LEN 3
#define SSID_IE_LEN 2
#define DRIVER_TOTAL_IES_LEN \
(MAC_HDR_LEN + WFA_TPC_IE_LEN + DS_IE_LEN + SSID_IE_LEN)
BUILD_BUG_ON(SCAN_OFFLOAD_PROBE_REQ_SIZE < DRIVER_TOTAL_IES_LEN);
return SCAN_OFFLOAD_PROBE_REQ_SIZE - DRIVER_TOTAL_IES_LEN;
}
void iwl_mld_report_scan_aborted(struct iwl_mld *mld);
enum iwl_mld_scan_status {
IWL_MLD_SCAN_NONE = 0,
IWL_MLD_SCAN_REGULAR = BIT(0),
IWL_MLD_SCAN_SCHED = BIT(1),
IWL_MLD_SCAN_NETDETECT = BIT(2),
IWL_MLD_SCAN_INT_MLO = BIT(3),
};
enum iwl_mld_pass_all_sched_results_states {
SCHED_SCAN_PASS_ALL_STATE_DISABLED,
SCHED_SCAN_PASS_ALL_STATE_ENABLED,
SCHED_SCAN_PASS_ALL_STATE_FOUND,
};
enum iwl_mld_traffic_load {
IWL_MLD_TRAFFIC_LOW,
IWL_MLD_TRAFFIC_MEDIUM,
IWL_MLD_TRAFFIC_HIGH,
};
struct iwl_mld_scan {
struct_group(zeroed_on_hw_restart,
unsigned int status;
u32 uid_status[IWL_MAX_UMAC_SCANS];
u64 start_tsf;
bool last_ebs_failed;
enum iwl_mld_pass_all_sched_results_states pass_all_sched_res;
u8 fw_link_id;
struct {
u32 last_stats_ts_usec;
enum iwl_mld_traffic_load status;
} traffic_load;
);
size_t cmd_size;
void *cmd;
u8 cmd_ver;
unsigned long last_6ghz_passive_jiffies;
unsigned long last_start_time_jiffies;
u64 last_mlo_scan_start_time;
};
struct iwl_mld_survey_channel {
u32 time;
u32 time_busy;
u32 time_rx;
s8 noise;
};
struct iwl_mld_survey {
struct iwl_mld_survey_channel *bands[NUM_NL80211_BANDS];
int n_channels;
struct iwl_mld_survey_channel channels[] __counted_by(n_channels);
};
#endif /* __iwl_mld_scan_h__ */