xref: /freebsd/contrib/wpa/wpa_supplicant/wpa_supplicant_i.h (revision a90b9d0159070121c221b966469c3e36d912bf82)
139beb93cSSam Leffler /*
239beb93cSSam Leffler  * wpa_supplicant - Internal definitions
3*a90b9d01SCy Schubert  * Copyright (c) 2003-2024, Jouni Malinen <j@w1.fi>
439beb93cSSam Leffler  *
5f05cddf9SRui Paulo  * This software may be distributed under the terms of the BSD license.
6f05cddf9SRui Paulo  * See README for more details.
739beb93cSSam Leffler  */
839beb93cSSam Leffler 
939beb93cSSam Leffler #ifndef WPA_SUPPLICANT_I_H
1039beb93cSSam Leffler #define WPA_SUPPLICANT_I_H
1139beb93cSSam Leffler 
1285732ac8SCy Schubert #include "utils/bitfield.h"
13e28a4053SRui Paulo #include "utils/list.h"
14e28a4053SRui Paulo #include "common/defs.h"
155b9c547cSRui Paulo #include "common/sae.h"
165b9c547cSRui Paulo #include "common/wpa_ctrl.h"
17*a90b9d01SCy Schubert #include "common/dpp.h"
18c1d255d3SCy Schubert #include "crypto/sha384.h"
19c1d255d3SCy Schubert #include "eapol_supp/eapol_supp_sm.h"
205b9c547cSRui Paulo #include "wps/wps_defs.h"
21f05cddf9SRui Paulo #include "config_ssid.h"
225b9c547cSRui Paulo #include "wmm_ac.h"
23*a90b9d01SCy Schubert #include "pasn/pasn_common.h"
2439beb93cSSam Leffler 
25325151a3SRui Paulo extern const char *const wpa_supplicant_version;
26325151a3SRui Paulo extern const char *const wpa_supplicant_license;
2739beb93cSSam Leffler #ifndef CONFIG_NO_STDOUT_DEBUG
28325151a3SRui Paulo extern const char *const wpa_supplicant_full_license1;
29325151a3SRui Paulo extern const char *const wpa_supplicant_full_license2;
30325151a3SRui Paulo extern const char *const wpa_supplicant_full_license3;
31325151a3SRui Paulo extern const char *const wpa_supplicant_full_license4;
32325151a3SRui Paulo extern const char *const wpa_supplicant_full_license5;
3339beb93cSSam Leffler #endif /* CONFIG_NO_STDOUT_DEBUG */
3439beb93cSSam Leffler 
3539beb93cSSam Leffler struct wpa_sm;
3639beb93cSSam Leffler struct wpa_supplicant;
37e28a4053SRui Paulo struct ibss_rsn;
38e28a4053SRui Paulo struct scan_info;
39e28a4053SRui Paulo struct wpa_bss;
40e28a4053SRui Paulo struct wpa_scan_results;
41f05cddf9SRui Paulo struct hostapd_hw_modes;
42f05cddf9SRui Paulo struct wpa_driver_associate_params;
4332a95656SCy Schubert struct wpa_cred;
4439beb93cSSam Leffler 
4539beb93cSSam Leffler /*
4639beb93cSSam Leffler  * Forward declarations of private structures used within the ctrl_iface
4739beb93cSSam Leffler  * backends. Other parts of wpa_supplicant do not have access to data stored in
4839beb93cSSam Leffler  * these structures.
4939beb93cSSam Leffler  */
5039beb93cSSam Leffler struct ctrl_iface_priv;
5139beb93cSSam Leffler struct ctrl_iface_global_priv;
52e28a4053SRui Paulo struct wpas_dbus_priv;
53780fb4a2SCy Schubert struct wpas_binder_priv;
5439beb93cSSam Leffler 
5539beb93cSSam Leffler /**
5639beb93cSSam Leffler  * struct wpa_interface - Parameters for wpa_supplicant_add_iface()
5739beb93cSSam Leffler  */
5839beb93cSSam Leffler struct wpa_interface {
5939beb93cSSam Leffler 	/**
6039beb93cSSam Leffler 	 * confname - Configuration name (file or profile) name
6139beb93cSSam Leffler 	 *
6239beb93cSSam Leffler 	 * This can also be %NULL when a configuration file is not used. In
6339beb93cSSam Leffler 	 * that case, ctrl_interface must be set to allow the interface to be
6439beb93cSSam Leffler 	 * configured.
6539beb93cSSam Leffler 	 */
6639beb93cSSam Leffler 	const char *confname;
6739beb93cSSam Leffler 
6839beb93cSSam Leffler 	/**
695b9c547cSRui Paulo 	 * confanother - Additional configuration name (file or profile) name
705b9c547cSRui Paulo 	 *
715b9c547cSRui Paulo 	 * This can also be %NULL when the additional configuration file is not
725b9c547cSRui Paulo 	 * used.
735b9c547cSRui Paulo 	 */
745b9c547cSRui Paulo 	const char *confanother;
755b9c547cSRui Paulo 
765b9c547cSRui Paulo 	/**
7739beb93cSSam Leffler 	 * ctrl_interface - Control interface parameter
7839beb93cSSam Leffler 	 *
7939beb93cSSam Leffler 	 * If a configuration file is not used, this variable can be used to
8039beb93cSSam Leffler 	 * set the ctrl_interface parameter that would have otherwise been read
8139beb93cSSam Leffler 	 * from the configuration file. If both confname and ctrl_interface are
8239beb93cSSam Leffler 	 * set, ctrl_interface is used to override the value from configuration
8339beb93cSSam Leffler 	 * file.
8439beb93cSSam Leffler 	 */
8539beb93cSSam Leffler 	const char *ctrl_interface;
8639beb93cSSam Leffler 
8739beb93cSSam Leffler 	/**
8839beb93cSSam Leffler 	 * driver - Driver interface name, or %NULL to use the default driver
8939beb93cSSam Leffler 	 */
9039beb93cSSam Leffler 	const char *driver;
9139beb93cSSam Leffler 
9239beb93cSSam Leffler 	/**
9339beb93cSSam Leffler 	 * driver_param - Driver interface parameters
9439beb93cSSam Leffler 	 *
9539beb93cSSam Leffler 	 * If a configuration file is not used, this variable can be used to
9639beb93cSSam Leffler 	 * set the driver_param parameters that would have otherwise been read
9739beb93cSSam Leffler 	 * from the configuration file. If both confname and driver_param are
9839beb93cSSam Leffler 	 * set, driver_param is used to override the value from configuration
9939beb93cSSam Leffler 	 * file.
10039beb93cSSam Leffler 	 */
10139beb93cSSam Leffler 	const char *driver_param;
10239beb93cSSam Leffler 
10339beb93cSSam Leffler 	/**
10439beb93cSSam Leffler 	 * ifname - Interface name
10539beb93cSSam Leffler 	 */
10639beb93cSSam Leffler 	const char *ifname;
10739beb93cSSam Leffler 
10839beb93cSSam Leffler 	/**
10939beb93cSSam Leffler 	 * bridge_ifname - Optional bridge interface name
11039beb93cSSam Leffler 	 *
11139beb93cSSam Leffler 	 * If the driver interface (ifname) is included in a Linux bridge
11239beb93cSSam Leffler 	 * device, the bridge interface may need to be used for receiving EAPOL
11339beb93cSSam Leffler 	 * frames. This can be enabled by setting this variable to enable
11439beb93cSSam Leffler 	 * receiving of EAPOL frames from an additional interface.
11539beb93cSSam Leffler 	 */
11639beb93cSSam Leffler 	const char *bridge_ifname;
1175b9c547cSRui Paulo 
1185b9c547cSRui Paulo 	/**
1195b9c547cSRui Paulo 	 * p2p_mgmt - Interface used for P2P management (P2P Device operations)
1205b9c547cSRui Paulo 	 *
1215b9c547cSRui Paulo 	 * Indicates whether wpas_p2p_init() must be called for this interface.
1225b9c547cSRui Paulo 	 * This is used only when the driver supports a dedicated P2P Device
1235b9c547cSRui Paulo 	 * interface that is not a network interface.
1245b9c547cSRui Paulo 	 */
1255b9c547cSRui Paulo 	int p2p_mgmt;
126c1d255d3SCy Schubert 
127c1d255d3SCy Schubert #ifdef CONFIG_MATCH_IFACE
128c1d255d3SCy Schubert 	/**
129c1d255d3SCy Schubert 	 * matched - Interface was matched rather than specified
130c1d255d3SCy Schubert 	 *
131c1d255d3SCy Schubert 	 */
132c1d255d3SCy Schubert 	enum {
133c1d255d3SCy Schubert 		WPA_IFACE_NOT_MATCHED,
134c1d255d3SCy Schubert 		WPA_IFACE_MATCHED_NULL,
135c1d255d3SCy Schubert 		WPA_IFACE_MATCHED
136c1d255d3SCy Schubert 	} matched;
137c1d255d3SCy Schubert #endif /* CONFIG_MATCH_IFACE */
13839beb93cSSam Leffler };
13939beb93cSSam Leffler 
14039beb93cSSam Leffler /**
14139beb93cSSam Leffler  * struct wpa_params - Parameters for wpa_supplicant_init()
14239beb93cSSam Leffler  */
14339beb93cSSam Leffler struct wpa_params {
14439beb93cSSam Leffler 	/**
14539beb93cSSam Leffler 	 * daemonize - Run %wpa_supplicant in the background
14639beb93cSSam Leffler 	 */
14739beb93cSSam Leffler 	int daemonize;
14839beb93cSSam Leffler 
14939beb93cSSam Leffler 	/**
15039beb93cSSam Leffler 	 * wait_for_monitor - Wait for a monitor program before starting
15139beb93cSSam Leffler 	 */
15239beb93cSSam Leffler 	int wait_for_monitor;
15339beb93cSSam Leffler 
15439beb93cSSam Leffler 	/**
15539beb93cSSam Leffler 	 * pid_file - Path to a PID (process ID) file
15639beb93cSSam Leffler 	 *
15739beb93cSSam Leffler 	 * If this and daemonize are set, process ID of the background process
15839beb93cSSam Leffler 	 * will be written to the specified file.
15939beb93cSSam Leffler 	 */
16039beb93cSSam Leffler 	char *pid_file;
16139beb93cSSam Leffler 
16239beb93cSSam Leffler 	/**
16339beb93cSSam Leffler 	 * wpa_debug_level - Debugging verbosity level (e.g., MSG_INFO)
16439beb93cSSam Leffler 	 */
16539beb93cSSam Leffler 	int wpa_debug_level;
16639beb93cSSam Leffler 
16739beb93cSSam Leffler 	/**
16839beb93cSSam Leffler 	 * wpa_debug_show_keys - Whether keying material is included in debug
16939beb93cSSam Leffler 	 *
17039beb93cSSam Leffler 	 * This parameter can be used to allow keying material to be included
17139beb93cSSam Leffler 	 * in debug messages. This is a security risk and this option should
17239beb93cSSam Leffler 	 * not be enabled in normal configuration. If needed during
17339beb93cSSam Leffler 	 * development or while troubleshooting, this option can provide more
17439beb93cSSam Leffler 	 * details for figuring out what is happening.
17539beb93cSSam Leffler 	 */
17639beb93cSSam Leffler 	int wpa_debug_show_keys;
17739beb93cSSam Leffler 
17839beb93cSSam Leffler 	/**
17939beb93cSSam Leffler 	 * wpa_debug_timestamp - Whether to include timestamp in debug messages
18039beb93cSSam Leffler 	 */
18139beb93cSSam Leffler 	int wpa_debug_timestamp;
18239beb93cSSam Leffler 
18339beb93cSSam Leffler 	/**
18439beb93cSSam Leffler 	 * ctrl_interface - Global ctrl_iface path/parameter
18539beb93cSSam Leffler 	 */
18639beb93cSSam Leffler 	char *ctrl_interface;
18739beb93cSSam Leffler 
18839beb93cSSam Leffler 	/**
1895b9c547cSRui Paulo 	 * ctrl_interface_group - Global ctrl_iface group
1905b9c547cSRui Paulo 	 */
1915b9c547cSRui Paulo 	char *ctrl_interface_group;
1925b9c547cSRui Paulo 
1935b9c547cSRui Paulo 	/**
19439beb93cSSam Leffler 	 * dbus_ctrl_interface - Enable the DBus control interface
19539beb93cSSam Leffler 	 */
19639beb93cSSam Leffler 	int dbus_ctrl_interface;
19739beb93cSSam Leffler 
19839beb93cSSam Leffler 	/**
19939beb93cSSam Leffler 	 * wpa_debug_file_path - Path of debug file or %NULL to use stdout
20039beb93cSSam Leffler 	 */
20139beb93cSSam Leffler 	const char *wpa_debug_file_path;
2022aef0ff7SSam Leffler 
2032aef0ff7SSam Leffler 	/**
2042aef0ff7SSam Leffler 	 * wpa_debug_syslog - Enable log output through syslog
2052aef0ff7SSam Leffler 	 */
206e28a4053SRui Paulo 	int wpa_debug_syslog;
207e28a4053SRui Paulo 
208e28a4053SRui Paulo 	/**
209f05cddf9SRui Paulo 	 * wpa_debug_tracing - Enable log output through Linux tracing
210f05cddf9SRui Paulo 	 */
211f05cddf9SRui Paulo 	int wpa_debug_tracing;
212f05cddf9SRui Paulo 
213f05cddf9SRui Paulo 	/**
214e28a4053SRui Paulo 	 * override_driver - Optional driver parameter override
215e28a4053SRui Paulo 	 *
216e28a4053SRui Paulo 	 * This parameter can be used to override the driver parameter in
217e28a4053SRui Paulo 	 * dynamic interface addition to force a specific driver wrapper to be
218e28a4053SRui Paulo 	 * used instead.
219e28a4053SRui Paulo 	 */
220e28a4053SRui Paulo 	char *override_driver;
221e28a4053SRui Paulo 
222e28a4053SRui Paulo 	/**
223e28a4053SRui Paulo 	 * override_ctrl_interface - Optional ctrl_interface override
224e28a4053SRui Paulo 	 *
225e28a4053SRui Paulo 	 * This parameter can be used to override the ctrl_interface parameter
226e28a4053SRui Paulo 	 * in dynamic interface addition to force a control interface to be
227e28a4053SRui Paulo 	 * created.
228e28a4053SRui Paulo 	 */
229e28a4053SRui Paulo 	char *override_ctrl_interface;
230f05cddf9SRui Paulo 
231f05cddf9SRui Paulo 	/**
232f05cddf9SRui Paulo 	 * entropy_file - Optional entropy file
233f05cddf9SRui Paulo 	 *
234f05cddf9SRui Paulo 	 * This parameter can be used to configure wpa_supplicant to maintain
235f05cddf9SRui Paulo 	 * its internal entropy store over restarts.
236f05cddf9SRui Paulo 	 */
237f05cddf9SRui Paulo 	char *entropy_file;
238325151a3SRui Paulo 
239325151a3SRui Paulo #ifdef CONFIG_P2P
240325151a3SRui Paulo 	/**
241325151a3SRui Paulo 	 * conf_p2p_dev - Configuration file used to hold the
242325151a3SRui Paulo 	 * P2P Device configuration parameters.
243325151a3SRui Paulo 	 *
244325151a3SRui Paulo 	 * This can also be %NULL. In such a case, if a P2P Device dedicated
245325151a3SRui Paulo 	 * interfaces is created, the main configuration file will be used.
246325151a3SRui Paulo 	 */
247325151a3SRui Paulo 	char *conf_p2p_dev;
248325151a3SRui Paulo #endif /* CONFIG_P2P */
249325151a3SRui Paulo 
250780fb4a2SCy Schubert #ifdef CONFIG_MATCH_IFACE
251780fb4a2SCy Schubert 	/**
252780fb4a2SCy Schubert 	 * match_ifaces - Interface descriptions to match
253780fb4a2SCy Schubert 	 */
254780fb4a2SCy Schubert 	struct wpa_interface *match_ifaces;
255780fb4a2SCy Schubert 
256780fb4a2SCy Schubert 	/**
257780fb4a2SCy Schubert 	 * match_iface_count - Number of defined matching interfaces
258780fb4a2SCy Schubert 	 */
259780fb4a2SCy Schubert 	int match_iface_count;
260780fb4a2SCy Schubert #endif /* CONFIG_MATCH_IFACE */
26139beb93cSSam Leffler };
26239beb93cSSam Leffler 
263f05cddf9SRui Paulo struct p2p_srv_bonjour {
264f05cddf9SRui Paulo 	struct dl_list list;
265f05cddf9SRui Paulo 	struct wpabuf *query;
266f05cddf9SRui Paulo 	struct wpabuf *resp;
267f05cddf9SRui Paulo };
268f05cddf9SRui Paulo 
269f05cddf9SRui Paulo struct p2p_srv_upnp {
270f05cddf9SRui Paulo 	struct dl_list list;
271f05cddf9SRui Paulo 	u8 version;
272f05cddf9SRui Paulo 	char *service;
273f05cddf9SRui Paulo };
274f05cddf9SRui Paulo 
27539beb93cSSam Leffler /**
27639beb93cSSam Leffler  * struct wpa_global - Internal, global data for all %wpa_supplicant interfaces
27739beb93cSSam Leffler  *
27839beb93cSSam Leffler  * This structure is initialized by calling wpa_supplicant_init() when starting
27939beb93cSSam Leffler  * %wpa_supplicant.
28039beb93cSSam Leffler  */
28139beb93cSSam Leffler struct wpa_global {
28239beb93cSSam Leffler 	struct wpa_supplicant *ifaces;
28339beb93cSSam Leffler 	struct wpa_params params;
28439beb93cSSam Leffler 	struct ctrl_iface_global_priv *ctrl_iface;
285e28a4053SRui Paulo 	struct wpas_dbus_priv *dbus;
286780fb4a2SCy Schubert 	struct wpas_binder_priv *binder;
28739beb93cSSam Leffler 	void **drv_priv;
28839beb93cSSam Leffler 	size_t drv_count;
289e28a4053SRui Paulo 	struct os_time suspend_time;
290f05cddf9SRui Paulo 	struct p2p_data *p2p;
291f05cddf9SRui Paulo 	struct wpa_supplicant *p2p_init_wpa_s;
292f05cddf9SRui Paulo 	struct wpa_supplicant *p2p_group_formation;
2935b9c547cSRui Paulo 	struct wpa_supplicant *p2p_invite_group;
294f05cddf9SRui Paulo 	u8 p2p_dev_addr[ETH_ALEN];
2955b9c547cSRui Paulo 	struct os_reltime p2p_go_wait_client;
296f05cddf9SRui Paulo 	struct dl_list p2p_srv_bonjour; /* struct p2p_srv_bonjour */
297f05cddf9SRui Paulo 	struct dl_list p2p_srv_upnp; /* struct p2p_srv_upnp */
298f05cddf9SRui Paulo 	int p2p_disabled;
299f05cddf9SRui Paulo 	int cross_connection;
300c1d255d3SCy Schubert 	int p2p_long_listen; /* remaining time in long Listen state in ms */
3015b9c547cSRui Paulo 	struct wpa_freq_range_list p2p_disallow_freq;
3025b9c547cSRui Paulo 	struct wpa_freq_range_list p2p_go_avoid_freq;
303f05cddf9SRui Paulo 	enum wpa_conc_pref {
304f05cddf9SRui Paulo 		WPA_CONC_PREF_NOT_SET,
305f05cddf9SRui Paulo 		WPA_CONC_PREF_STA,
306f05cddf9SRui Paulo 		WPA_CONC_PREF_P2P
307f05cddf9SRui Paulo 	} conc_pref;
3085b9c547cSRui Paulo 	unsigned int p2p_per_sta_psk:1;
3095b9c547cSRui Paulo 	unsigned int p2p_fail_on_wps_complete:1;
3105b9c547cSRui Paulo 	unsigned int p2p_24ghz_social_channels:1;
3115b9c547cSRui Paulo 	unsigned int pending_p2ps_group:1;
3125b9c547cSRui Paulo 	unsigned int pending_group_iface_for_p2ps:1;
313780fb4a2SCy Schubert 	unsigned int pending_p2ps_group_freq;
314f05cddf9SRui Paulo 
315f05cddf9SRui Paulo #ifdef CONFIG_WIFI_DISPLAY
316f05cddf9SRui Paulo 	int wifi_display;
31785732ac8SCy Schubert #define MAX_WFD_SUBELEMS 12
318f05cddf9SRui Paulo 	struct wpabuf *wfd_subelem[MAX_WFD_SUBELEMS];
319f05cddf9SRui Paulo #endif /* CONFIG_WIFI_DISPLAY */
3205b9c547cSRui Paulo 
3215b9c547cSRui Paulo 	struct psk_list_entry *add_psk; /* From group formation */
32239beb93cSSam Leffler };
32339beb93cSSam Leffler 
32439beb93cSSam Leffler 
325f05cddf9SRui Paulo /**
3265b9c547cSRui Paulo  * struct wpa_radio - Internal data for per-radio information
3275b9c547cSRui Paulo  *
3285b9c547cSRui Paulo  * This structure is used to share data about configured interfaces
3295b9c547cSRui Paulo  * (struct wpa_supplicant) that share the same physical radio, e.g., to allow
3305b9c547cSRui Paulo  * better coordination of offchannel operations.
3315b9c547cSRui Paulo  */
3325b9c547cSRui Paulo struct wpa_radio {
3335b9c547cSRui Paulo 	char name[16]; /* from driver_ops get_radio_name() or empty if not
3345b9c547cSRui Paulo 			* available */
335c1d255d3SCy Schubert 	/** NULL if no external scan running. */
336c1d255d3SCy Schubert 	struct wpa_supplicant *external_scan_req_interface;
337780fb4a2SCy Schubert 	unsigned int num_active_works;
3385b9c547cSRui Paulo 	struct dl_list ifaces; /* struct wpa_supplicant::radio_list entries */
3395b9c547cSRui Paulo 	struct dl_list work; /* struct wpa_radio_work::list entries */
3405b9c547cSRui Paulo };
3415b9c547cSRui Paulo 
342c1d255d3SCy Schubert /**
343c1d255d3SCy Schubert  * Checks whether an external scan is running on a given radio.
344c1d255d3SCy Schubert  * @radio: Pointer to radio struct
345c1d255d3SCy Schubert  * Returns: true if an external scan is running, false otherwise.
346c1d255d3SCy Schubert  */
external_scan_running(struct wpa_radio * radio)347c1d255d3SCy Schubert static inline bool external_scan_running(struct wpa_radio *radio)
348c1d255d3SCy Schubert {
349c1d255d3SCy Schubert 	return radio && radio->external_scan_req_interface;
350c1d255d3SCy Schubert }
351c1d255d3SCy Schubert 
352780fb4a2SCy Schubert #define MAX_ACTIVE_WORKS 2
353780fb4a2SCy Schubert 
354780fb4a2SCy Schubert 
3555b9c547cSRui Paulo /**
3565b9c547cSRui Paulo  * struct wpa_radio_work - Radio work item
3575b9c547cSRui Paulo  */
3585b9c547cSRui Paulo struct wpa_radio_work {
3595b9c547cSRui Paulo 	struct dl_list list;
3605b9c547cSRui Paulo 	unsigned int freq; /* known frequency (MHz) or 0 for multiple/unknown */
3615b9c547cSRui Paulo 	const char *type;
3625b9c547cSRui Paulo 	struct wpa_supplicant *wpa_s;
3635b9c547cSRui Paulo 	void (*cb)(struct wpa_radio_work *work, int deinit);
3645b9c547cSRui Paulo 	void *ctx;
3655b9c547cSRui Paulo 	unsigned int started:1;
3665b9c547cSRui Paulo 	struct os_reltime time;
367780fb4a2SCy Schubert 	unsigned int bands;
3685b9c547cSRui Paulo };
3695b9c547cSRui Paulo 
3705b9c547cSRui Paulo int radio_add_work(struct wpa_supplicant *wpa_s, unsigned int freq,
3715b9c547cSRui Paulo 		   const char *type, int next,
3725b9c547cSRui Paulo 		   void (*cb)(struct wpa_radio_work *work, int deinit),
3735b9c547cSRui Paulo 		   void *ctx);
3745b9c547cSRui Paulo void radio_work_done(struct wpa_radio_work *work);
3755b9c547cSRui Paulo void radio_remove_works(struct wpa_supplicant *wpa_s,
3765b9c547cSRui Paulo 			const char *type, int remove_all);
37785732ac8SCy Schubert void radio_remove_pending_work(struct wpa_supplicant *wpa_s, void *ctx);
3785b9c547cSRui Paulo void radio_work_check_next(struct wpa_supplicant *wpa_s);
3795b9c547cSRui Paulo struct wpa_radio_work *
3805b9c547cSRui Paulo radio_work_pending(struct wpa_supplicant *wpa_s, const char *type);
3815b9c547cSRui Paulo 
3825b9c547cSRui Paulo struct wpa_connect_work {
3835b9c547cSRui Paulo 	unsigned int sme:1;
3845b9c547cSRui Paulo 	unsigned int bss_removed:1;
3855b9c547cSRui Paulo 	struct wpa_bss *bss;
3865b9c547cSRui Paulo 	struct wpa_ssid *ssid;
3875b9c547cSRui Paulo };
3885b9c547cSRui Paulo 
3895b9c547cSRui Paulo int wpas_valid_bss_ssid(struct wpa_supplicant *wpa_s, struct wpa_bss *test_bss,
3905b9c547cSRui Paulo 			struct wpa_ssid *test_ssid);
3915b9c547cSRui Paulo void wpas_connect_work_free(struct wpa_connect_work *cwork);
3925b9c547cSRui Paulo void wpas_connect_work_done(struct wpa_supplicant *wpa_s);
3935b9c547cSRui Paulo 
3945b9c547cSRui Paulo struct wpa_external_work {
3955b9c547cSRui Paulo 	unsigned int id;
3965b9c547cSRui Paulo 	char type[100];
3975b9c547cSRui Paulo 	unsigned int timeout;
3985b9c547cSRui Paulo };
3995b9c547cSRui Paulo 
400780fb4a2SCy Schubert enum wpa_radio_work_band wpas_freq_to_band(int freq);
401780fb4a2SCy Schubert unsigned int wpas_get_bands(struct wpa_supplicant *wpa_s, const int *freqs);
402780fb4a2SCy Schubert 
4035b9c547cSRui Paulo /**
404f05cddf9SRui Paulo  * offchannel_send_action_result - Result of offchannel send Action frame
405f05cddf9SRui Paulo  */
406f05cddf9SRui Paulo enum offchannel_send_action_result {
407f05cddf9SRui Paulo 	OFFCHANNEL_SEND_ACTION_SUCCESS /**< Frame was send and acknowledged */,
408f05cddf9SRui Paulo 	OFFCHANNEL_SEND_ACTION_NO_ACK /**< Frame was sent, but not acknowledged
409f05cddf9SRui Paulo 				       */,
410f05cddf9SRui Paulo 	OFFCHANNEL_SEND_ACTION_FAILED /**< Frame was not sent due to a failure
411f05cddf9SRui Paulo 				       */
412f05cddf9SRui Paulo };
413f05cddf9SRui Paulo 
414f05cddf9SRui Paulo struct wps_ap_info {
415f05cddf9SRui Paulo 	u8 bssid[ETH_ALEN];
416f05cddf9SRui Paulo 	enum wps_ap_info_type {
417f05cddf9SRui Paulo 		WPS_AP_NOT_SEL_REG,
418f05cddf9SRui Paulo 		WPS_AP_SEL_REG,
419f05cddf9SRui Paulo 		WPS_AP_SEL_REG_OUR
420f05cddf9SRui Paulo 	} type;
421f05cddf9SRui Paulo 	unsigned int tries;
4225b9c547cSRui Paulo 	struct os_reltime last_attempt;
423325151a3SRui Paulo 	unsigned int pbc_active;
424325151a3SRui Paulo 	u8 uuid[WPS_UUID_LEN];
425f05cddf9SRui Paulo };
426f05cddf9SRui Paulo 
4275b9c547cSRui Paulo #define WPA_FREQ_USED_BY_INFRA_STATION BIT(0)
4285b9c547cSRui Paulo #define WPA_FREQ_USED_BY_P2P_CLIENT BIT(1)
4295b9c547cSRui Paulo 
4305b9c547cSRui Paulo struct wpa_used_freq_data {
4315b9c547cSRui Paulo 	int freq;
4325b9c547cSRui Paulo 	unsigned int flags;
4335b9c547cSRui Paulo };
4345b9c547cSRui Paulo 
4355b9c547cSRui Paulo #define RRM_NEIGHBOR_REPORT_TIMEOUT 1 /* 1 second for AP to send a report */
4365b9c547cSRui Paulo 
4375b9c547cSRui Paulo /*
4385b9c547cSRui Paulo  * struct rrm_data - Data used for managing RRM features
4395b9c547cSRui Paulo  */
4405b9c547cSRui Paulo struct rrm_data {
4415b9c547cSRui Paulo 	/* rrm_used - indication regarding the current connection */
4425b9c547cSRui Paulo 	unsigned int rrm_used:1;
4435b9c547cSRui Paulo 
4445b9c547cSRui Paulo 	/*
4455b9c547cSRui Paulo 	 * notify_neighbor_rep - Callback for notifying report requester
4465b9c547cSRui Paulo 	 */
4475b9c547cSRui Paulo 	void (*notify_neighbor_rep)(void *ctx, struct wpabuf *neighbor_rep);
4485b9c547cSRui Paulo 
4495b9c547cSRui Paulo 	/*
4505b9c547cSRui Paulo 	 * neighbor_rep_cb_ctx - Callback context
4515b9c547cSRui Paulo 	 * Received in the callback registration, and sent to the callback
4525b9c547cSRui Paulo 	 * function as a parameter.
4535b9c547cSRui Paulo 	 */
4545b9c547cSRui Paulo 	void *neighbor_rep_cb_ctx;
4555b9c547cSRui Paulo 
4565b9c547cSRui Paulo 	/* next_neighbor_rep_token - Next request's dialog token */
4575b9c547cSRui Paulo 	u8 next_neighbor_rep_token;
45885732ac8SCy Schubert 
45985732ac8SCy Schubert 	/* token - Dialog token of the current radio measurement */
46085732ac8SCy Schubert 	u8 token;
46185732ac8SCy Schubert 
46285732ac8SCy Schubert 	/* destination address of the current radio measurement request */
46385732ac8SCy Schubert 	u8 dst_addr[ETH_ALEN];
4645b9c547cSRui Paulo };
4655b9c547cSRui Paulo 
4665b9c547cSRui Paulo enum wpa_supplicant_test_failure {
4675b9c547cSRui Paulo 	WPAS_TEST_FAILURE_NONE,
4685b9c547cSRui Paulo 	WPAS_TEST_FAILURE_SCAN_TRIGGER,
4695b9c547cSRui Paulo };
4705b9c547cSRui Paulo 
471780fb4a2SCy Schubert struct icon_entry {
472780fb4a2SCy Schubert 	struct dl_list list;
473780fb4a2SCy Schubert 	u8 bssid[ETH_ALEN];
474780fb4a2SCy Schubert 	u8 dialog_token;
475780fb4a2SCy Schubert 	char *file_name;
476780fb4a2SCy Schubert 	u8 *image;
477780fb4a2SCy Schubert 	size_t image_len;
478780fb4a2SCy Schubert };
479780fb4a2SCy Schubert 
480780fb4a2SCy Schubert struct wpa_bss_tmp_disallowed {
481780fb4a2SCy Schubert 	struct dl_list list;
482780fb4a2SCy Schubert 	u8 bssid[ETH_ALEN];
4834bc52338SCy Schubert 	int rssi_threshold;
48485732ac8SCy Schubert };
48585732ac8SCy Schubert 
48685732ac8SCy Schubert struct beacon_rep_data {
48785732ac8SCy Schubert 	u8 token;
4884bc52338SCy Schubert 	u8 last_indication;
48985732ac8SCy Schubert 	struct wpa_driver_scan_params scan_params;
49085732ac8SCy Schubert 	u8 ssid[SSID_MAX_LEN];
49185732ac8SCy Schubert 	size_t ssid_len;
49285732ac8SCy Schubert 	u8 bssid[ETH_ALEN];
49385732ac8SCy Schubert 	enum beacon_report_detail report_detail;
49485732ac8SCy Schubert 	struct bitfield *eids;
495*a90b9d01SCy Schubert 	struct bitfield *ext_eids;
49685732ac8SCy Schubert };
49785732ac8SCy Schubert 
49885732ac8SCy Schubert 
49985732ac8SCy Schubert struct external_pmksa_cache {
50085732ac8SCy Schubert 	struct dl_list list;
50185732ac8SCy Schubert 	void *pmksa_cache;
50285732ac8SCy Schubert };
50385732ac8SCy Schubert 
50485732ac8SCy Schubert struct fils_hlp_req {
50585732ac8SCy Schubert 	struct dl_list list;
50685732ac8SCy Schubert 	u8 dst[ETH_ALEN];
50785732ac8SCy Schubert 	struct wpabuf *pkt;
508780fb4a2SCy Schubert };
509780fb4a2SCy Schubert 
510c1d255d3SCy Schubert struct driver_signal_override {
511c1d255d3SCy Schubert 	struct dl_list list;
512c1d255d3SCy Schubert 	u8 bssid[ETH_ALEN];
513c1d255d3SCy Schubert 	int si_current_signal;
514c1d255d3SCy Schubert 	int si_avg_signal;
515c1d255d3SCy Schubert 	int si_avg_beacon_signal;
516c1d255d3SCy Schubert 	int si_current_noise;
517c1d255d3SCy Schubert 	int scan_level;
518c1d255d3SCy Schubert };
519c1d255d3SCy Schubert 
520c1d255d3SCy Schubert struct robust_av_data {
521c1d255d3SCy Schubert 	u8 dialog_token;
522c1d255d3SCy Schubert 	enum scs_request_type request_type;
523c1d255d3SCy Schubert 	u8 up_bitmap;
524c1d255d3SCy Schubert 	u8 up_limit;
525c1d255d3SCy Schubert 	u32 stream_timeout;
526c1d255d3SCy Schubert 	u8 frame_classifier[48];
527c1d255d3SCy Schubert 	size_t frame_classifier_len;
528c1d255d3SCy Schubert 	bool valid_config;
529c1d255d3SCy Schubert };
530c1d255d3SCy Schubert 
5314b72b91aSCy Schubert struct dscp_policy_status {
5324b72b91aSCy Schubert 	u8 id;
5334b72b91aSCy Schubert 	u8 status;
5344b72b91aSCy Schubert };
5354b72b91aSCy Schubert 
5364b72b91aSCy Schubert struct dscp_resp_data {
5374b72b91aSCy Schubert 	bool more;
5384b72b91aSCy Schubert 	bool reset;
5394b72b91aSCy Schubert 	bool solicited;
5404b72b91aSCy Schubert 	struct dscp_policy_status *policy;
5414b72b91aSCy Schubert 	int num_policies;
5424b72b91aSCy Schubert };
5434b72b91aSCy Schubert 
5444b72b91aSCy Schubert enum ip_version {
5454b72b91aSCy Schubert 	IPV4 = 4,
5464b72b91aSCy Schubert 	IPV6 = 6,
5474b72b91aSCy Schubert };
5484b72b91aSCy Schubert 
5494b72b91aSCy Schubert 
5504b72b91aSCy Schubert struct ipv4_params {
5514b72b91aSCy Schubert 	struct in_addr src_ip;
5524b72b91aSCy Schubert 	struct in_addr dst_ip;
5534b72b91aSCy Schubert 	u16 src_port;
5544b72b91aSCy Schubert 	u16 dst_port;
5554b72b91aSCy Schubert 	u8 dscp;
5564b72b91aSCy Schubert 	u8 protocol;
5574b72b91aSCy Schubert };
5584b72b91aSCy Schubert 
5594b72b91aSCy Schubert 
5604b72b91aSCy Schubert struct ipv6_params {
5614b72b91aSCy Schubert 	struct in6_addr src_ip;
5624b72b91aSCy Schubert 	struct in6_addr dst_ip;
5634b72b91aSCy Schubert 	u16 src_port;
5644b72b91aSCy Schubert 	u16 dst_port;
5654b72b91aSCy Schubert 	u8 dscp;
5664b72b91aSCy Schubert 	u8 next_header;
5674b72b91aSCy Schubert 	u8 flow_label[3];
5684b72b91aSCy Schubert };
5694b72b91aSCy Schubert 
5704b72b91aSCy Schubert 
5714b72b91aSCy Schubert struct type4_params {
5724b72b91aSCy Schubert 	u8 classifier_mask;
5734b72b91aSCy Schubert 	enum ip_version ip_version;
5744b72b91aSCy Schubert 	union {
5754b72b91aSCy Schubert 		struct ipv4_params v4;
5764b72b91aSCy Schubert 		struct ipv6_params v6;
5774b72b91aSCy Schubert 	} ip_params;
5784b72b91aSCy Schubert };
5794b72b91aSCy Schubert 
5804b72b91aSCy Schubert 
5814b72b91aSCy Schubert struct type10_params {
5824b72b91aSCy Schubert 	u8 prot_instance;
5834b72b91aSCy Schubert 	u8 prot_number;
5844b72b91aSCy Schubert 	u8 *filter_value;
5854b72b91aSCy Schubert 	u8 *filter_mask;
5864b72b91aSCy Schubert 	size_t filter_len;
5874b72b91aSCy Schubert };
5884b72b91aSCy Schubert 
5894b72b91aSCy Schubert 
5904b72b91aSCy Schubert struct tclas_element {
5914b72b91aSCy Schubert 	u8 user_priority;
5924b72b91aSCy Schubert 	u8 classifier_type;
5934b72b91aSCy Schubert 	union {
5944b72b91aSCy Schubert 		struct type4_params type4_param;
5954b72b91aSCy Schubert 		struct type10_params type10_param;
5964b72b91aSCy Schubert 	} frame_classifier;
5974b72b91aSCy Schubert };
5984b72b91aSCy Schubert 
5994b72b91aSCy Schubert 
600*a90b9d01SCy Schubert struct qos_characteristics {
601*a90b9d01SCy Schubert 	bool available;
602*a90b9d01SCy Schubert 
603*a90b9d01SCy Schubert 	/* Control Info Direction */
604*a90b9d01SCy Schubert 	u8 direction;
605*a90b9d01SCy Schubert 	/* Presence Bitmap Of Additional Parameters */
606*a90b9d01SCy Schubert 	u16 mask;
607*a90b9d01SCy Schubert 	/* Minimum Service Interval */
608*a90b9d01SCy Schubert 	u32 min_si;
609*a90b9d01SCy Schubert 	/* Maximum Service Interval */
610*a90b9d01SCy Schubert 	u32 max_si;
611*a90b9d01SCy Schubert 	/* Minimum Data Rate */
612*a90b9d01SCy Schubert 	u32 min_data_rate;
613*a90b9d01SCy Schubert 	/* Delay Bound */
614*a90b9d01SCy Schubert 	u32 delay_bound;
615*a90b9d01SCy Schubert 	/* Maximum MSDU Size */
616*a90b9d01SCy Schubert 	u16 max_msdu_size;
617*a90b9d01SCy Schubert 	/* Service Start Time */
618*a90b9d01SCy Schubert 	u32 service_start_time;
619*a90b9d01SCy Schubert 	/* Service Start Time LinkID */
620*a90b9d01SCy Schubert 	u8 service_start_time_link_id;
621*a90b9d01SCy Schubert 	/* Mean Data Rate */
622*a90b9d01SCy Schubert 	u32 mean_data_rate;
623*a90b9d01SCy Schubert 	/* Delayed Bounded Burst Size */
624*a90b9d01SCy Schubert 	u32 burst_size;
625*a90b9d01SCy Schubert 	/* MSDU Lifetime */
626*a90b9d01SCy Schubert 	u16 msdu_lifetime;
627*a90b9d01SCy Schubert 	/* MSDU Delivery Info */
628*a90b9d01SCy Schubert 	u8 msdu_delivery_info;
629*a90b9d01SCy Schubert 	/* Medium Time */
630*a90b9d01SCy Schubert 	u16 medium_time;
631*a90b9d01SCy Schubert };
632*a90b9d01SCy Schubert 
633*a90b9d01SCy Schubert 
6344b72b91aSCy Schubert struct scs_desc_elem {
6354b72b91aSCy Schubert 	u8 scs_id;
6364b72b91aSCy Schubert 	enum scs_request_type request_type;
6374b72b91aSCy Schubert 	u8 intra_access_priority;
6384b72b91aSCy Schubert 	bool scs_up_avail;
6394b72b91aSCy Schubert 	struct tclas_element *tclas_elems;
6404b72b91aSCy Schubert 	unsigned int num_tclas_elem;
6414b72b91aSCy Schubert 	u8 tclas_processing;
642*a90b9d01SCy Schubert 	struct qos_characteristics qos_char_elem;
6434b72b91aSCy Schubert };
6444b72b91aSCy Schubert 
6454b72b91aSCy Schubert 
6464b72b91aSCy Schubert struct scs_robust_av_data {
6474b72b91aSCy Schubert 	struct scs_desc_elem *scs_desc_elems;
6484b72b91aSCy Schubert 	unsigned int num_scs_desc;
6494b72b91aSCy Schubert };
6504b72b91aSCy Schubert 
6514b72b91aSCy Schubert 
6524b72b91aSCy Schubert enum scs_response_status {
6534b72b91aSCy Schubert 	SCS_DESC_SENT = 0,
6544b72b91aSCy Schubert 	SCS_DESC_SUCCESS = 1,
6554b72b91aSCy Schubert };
6564b72b91aSCy Schubert 
6574b72b91aSCy Schubert 
6584b72b91aSCy Schubert struct active_scs_elem {
6594b72b91aSCy Schubert 	struct dl_list list;
6604b72b91aSCy Schubert 	u8 scs_id;
6614b72b91aSCy Schubert 	enum scs_response_status status;
6624b72b91aSCy Schubert };
6634b72b91aSCy Schubert 
6644b72b91aSCy Schubert 
665*a90b9d01SCy Schubert struct ml_sta_link_info {
666*a90b9d01SCy Schubert 	u8 link_id;
667*a90b9d01SCy Schubert 	u8 bssid[ETH_ALEN];
668*a90b9d01SCy Schubert 	u16 status;
669*a90b9d01SCy Schubert };
670*a90b9d01SCy Schubert 
671*a90b9d01SCy Schubert 
67239beb93cSSam Leffler /**
67339beb93cSSam Leffler  * struct wpa_supplicant - Internal data for wpa_supplicant interface
67439beb93cSSam Leffler  *
67539beb93cSSam Leffler  * This structure contains the internal data for core wpa_supplicant code. This
67639beb93cSSam Leffler  * should be only used directly from the core code. However, a pointer to this
67739beb93cSSam Leffler  * data is used from other files as an arbitrary context pointer in calls to
67839beb93cSSam Leffler  * core functions.
67939beb93cSSam Leffler  */
68039beb93cSSam Leffler struct wpa_supplicant {
68139beb93cSSam Leffler 	struct wpa_global *global;
6825b9c547cSRui Paulo 	struct wpa_radio *radio; /* shared radio context */
6835b9c547cSRui Paulo 	struct dl_list radio_list; /* list head: struct wpa_radio::ifaces */
684f05cddf9SRui Paulo 	struct wpa_supplicant *parent;
685780fb4a2SCy Schubert 	struct wpa_supplicant *p2pdev;
68639beb93cSSam Leffler 	struct wpa_supplicant *next;
68739beb93cSSam Leffler 	struct l2_packet_data *l2;
68839beb93cSSam Leffler 	struct l2_packet_data *l2_br;
6894bc52338SCy Schubert 	struct os_reltime roam_start;
6904bc52338SCy Schubert 	struct os_reltime roam_time;
6914bc52338SCy Schubert 	struct os_reltime session_start;
6924bc52338SCy Schubert 	struct os_reltime session_length;
69339beb93cSSam Leffler 	unsigned char own_addr[ETH_ALEN];
6945b9c547cSRui Paulo 	unsigned char perm_addr[ETH_ALEN];
69539beb93cSSam Leffler 	char ifname[100];
696780fb4a2SCy Schubert #ifdef CONFIG_MATCH_IFACE
697780fb4a2SCy Schubert 	int matched;
698780fb4a2SCy Schubert #endif /* CONFIG_MATCH_IFACE */
699e28a4053SRui Paulo #ifdef CONFIG_CTRL_IFACE_DBUS_NEW
700e28a4053SRui Paulo 	char *dbus_new_path;
701f05cddf9SRui Paulo 	char *dbus_groupobj_path;
702f05cddf9SRui Paulo #ifdef CONFIG_AP
703f05cddf9SRui Paulo 	char *preq_notify_peer;
704f05cddf9SRui Paulo #endif /* CONFIG_AP */
705e28a4053SRui Paulo #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
706780fb4a2SCy Schubert #ifdef CONFIG_CTRL_IFACE_BINDER
707780fb4a2SCy Schubert 	const void *binder_object_key;
708780fb4a2SCy Schubert #endif /* CONFIG_CTRL_IFACE_BINDER */
70939beb93cSSam Leffler 	char bridge_ifname[16];
71039beb93cSSam Leffler 
71139beb93cSSam Leffler 	char *confname;
7125b9c547cSRui Paulo 	char *confanother;
7135b9c547cSRui Paulo 
71439beb93cSSam Leffler 	struct wpa_config *conf;
71539beb93cSSam Leffler 	int countermeasures;
7165b9c547cSRui Paulo 	struct os_reltime last_michael_mic_error;
71739beb93cSSam Leffler 	u8 bssid[ETH_ALEN];
71839beb93cSSam Leffler 	u8 pending_bssid[ETH_ALEN]; /* If wpa_state == WPA_ASSOCIATING, this
719f05cddf9SRui Paulo 				     * field contains the target BSSID. */
72039beb93cSSam Leffler 	int reassociate; /* reassociation requested */
721c1d255d3SCy Schubert 	bool roam_in_progress; /* roam in progress */
722780fb4a2SCy Schubert 	unsigned int reassoc_same_bss:1; /* reassociating to the same BSS */
723780fb4a2SCy Schubert 	unsigned int reassoc_same_ess:1; /* reassociating to the same ESS */
72439beb93cSSam Leffler 	int disconnected; /* all connections disabled; i.e., do no reassociate
72539beb93cSSam Leffler 			   * before this has been cleared */
72639beb93cSSam Leffler 	struct wpa_ssid *current_ssid;
7275b9c547cSRui Paulo 	struct wpa_ssid *last_ssid;
728e28a4053SRui Paulo 	struct wpa_bss *current_bss;
72939beb93cSSam Leffler 	int ap_ies_from_associnfo;
730e28a4053SRui Paulo 	unsigned int assoc_freq;
731*a90b9d01SCy Schubert 	u8 ap_mld_addr[ETH_ALEN];
732*a90b9d01SCy Schubert 	u8 mlo_assoc_link_id;
733*a90b9d01SCy Schubert 	u16 valid_links; /* bitmap of valid MLO link IDs */
734*a90b9d01SCy Schubert 	struct {
735*a90b9d01SCy Schubert 		u8 addr[ETH_ALEN];
736*a90b9d01SCy Schubert 		u8 bssid[ETH_ALEN];
737*a90b9d01SCy Schubert 		unsigned int freq;
738*a90b9d01SCy Schubert 		struct wpa_bss *bss;
739*a90b9d01SCy Schubert 		bool disabled;
740*a90b9d01SCy Schubert 	} links[MAX_NUM_MLD_LINKS];
74185732ac8SCy Schubert 	u8 *last_con_fail_realm;
74285732ac8SCy Schubert 	size_t last_con_fail_realm_len;
74339beb93cSSam Leffler 
74439beb93cSSam Leffler 	/* Selected configuration (based on Beacon/ProbeResp WPA IE) */
74539beb93cSSam Leffler 	int pairwise_cipher;
746c1d255d3SCy Schubert 	int deny_ptk0_rekey;
74739beb93cSSam Leffler 	int group_cipher;
74839beb93cSSam Leffler 	int key_mgmt;
749f05cddf9SRui Paulo 	int wpa_proto;
75039beb93cSSam Leffler 	int mgmt_group_cipher;
751*a90b9d01SCy Schubert 	/*
752*a90b9d01SCy Schubert 	 * Allowed key management suites for roaming/initial connection
753*a90b9d01SCy Schubert 	 * when the driver's SME is in use.
754*a90b9d01SCy Schubert 	 */
755*a90b9d01SCy Schubert 	int allowed_key_mgmts;
75639beb93cSSam Leffler 
75739beb93cSSam Leffler 	void *drv_priv; /* private data used by driver_ops */
7583157ba21SRui Paulo 	void *global_drv_priv;
75939beb93cSSam Leffler 
760f05cddf9SRui Paulo 	u8 *bssid_filter;
761f05cddf9SRui Paulo 	size_t bssid_filter_count;
762f05cddf9SRui Paulo 
763f05cddf9SRui Paulo 	u8 *disallow_aps_bssid;
764f05cddf9SRui Paulo 	size_t disallow_aps_bssid_count;
765f05cddf9SRui Paulo 	struct wpa_ssid_value *disallow_aps_ssid;
766f05cddf9SRui Paulo 	size_t disallow_aps_ssid_count;
767f05cddf9SRui Paulo 
768c1d255d3SCy Schubert 	u32 setband_mask;
7695b9c547cSRui Paulo 
7705b9c547cSRui Paulo 	/* Preferred network for the next connection attempt */
7715b9c547cSRui Paulo 	struct wpa_ssid *next_ssid;
7725b9c547cSRui Paulo 
773f05cddf9SRui Paulo 	/* previous scan was wildcard when interleaving between
774f05cddf9SRui Paulo 	 * wildcard scans and specific SSID scan when max_ssids=1 */
775f05cddf9SRui Paulo 	int prev_scan_wildcard;
77639beb93cSSam Leffler 	struct wpa_ssid *prev_scan_ssid; /* previously scanned SSID;
77739beb93cSSam Leffler 					  * NULL = not yet initialized (start
778e28a4053SRui Paulo 					  * with wildcard SSID)
779e28a4053SRui Paulo 					  * WILDCARD_SSID_SCAN = wildcard
78039beb93cSSam Leffler 					  * SSID was used in the previous scan
78139beb93cSSam Leffler 					  */
782e28a4053SRui Paulo #define WILDCARD_SSID_SCAN ((struct wpa_ssid *) 1)
78339beb93cSSam Leffler 
784f05cddf9SRui Paulo 	struct wpa_ssid *prev_sched_ssid; /* last SSID used in sched scan */
785f05cddf9SRui Paulo 	int sched_scan_timeout;
786f05cddf9SRui Paulo 	int first_sched_scan;
787f05cddf9SRui Paulo 	int sched_scan_timed_out;
788780fb4a2SCy Schubert 	struct sched_scan_plan *sched_scan_plans;
789780fb4a2SCy Schubert 	size_t sched_scan_plans_num;
790f05cddf9SRui Paulo 
791e28a4053SRui Paulo 	void (*scan_res_handler)(struct wpa_supplicant *wpa_s,
792e28a4053SRui Paulo 				 struct wpa_scan_results *scan_res);
793c1d255d3SCy Schubert 	void (*scan_res_fail_handler)(struct wpa_supplicant *wpa_s);
794e28a4053SRui Paulo 	struct dl_list bss; /* struct wpa_bss::list */
795e28a4053SRui Paulo 	struct dl_list bss_id; /* struct wpa_bss::list_id */
796e28a4053SRui Paulo 	size_t num_bss;
797e28a4053SRui Paulo 	unsigned int bss_update_idx;
798e28a4053SRui Paulo 	unsigned int bss_next_id;
79939beb93cSSam Leffler 
800f05cddf9SRui Paulo 	 /*
801f05cddf9SRui Paulo 	  * Pointers to BSS entries in the order they were in the last scan
802f05cddf9SRui Paulo 	  * results.
803f05cddf9SRui Paulo 	  */
804f05cddf9SRui Paulo 	struct wpa_bss **last_scan_res;
805c1d255d3SCy Schubert 	size_t last_scan_res_used;
806c1d255d3SCy Schubert 	size_t last_scan_res_size;
8075b9c547cSRui Paulo 	struct os_reltime last_scan;
808f05cddf9SRui Paulo 
809325151a3SRui Paulo 	const struct wpa_driver_ops *driver;
81039beb93cSSam Leffler 	int interface_removed; /* whether the network interface has been
81139beb93cSSam Leffler 				* removed */
81239beb93cSSam Leffler 	struct wpa_sm *wpa;
813c1d255d3SCy Schubert 	struct ptksa_cache *ptksa;
814c1d255d3SCy Schubert 
81539beb93cSSam Leffler 	struct eapol_sm *eapol;
81639beb93cSSam Leffler 
81739beb93cSSam Leffler 	struct ctrl_iface_priv *ctrl_iface;
81839beb93cSSam Leffler 
819e28a4053SRui Paulo 	enum wpa_states wpa_state;
8205b9c547cSRui Paulo 	struct wpa_radio_work *scan_work;
8213157ba21SRui Paulo 	int scanning;
822f05cddf9SRui Paulo 	int sched_scanning;
823780fb4a2SCy Schubert 	unsigned int sched_scan_stop_req:1;
82439beb93cSSam Leffler 	int new_connection;
82539beb93cSSam Leffler 
82639beb93cSSam Leffler 	int eapol_received; /* number of EAPOL packets received after the
82739beb93cSSam Leffler 			     * previous association event */
82839beb93cSSam Leffler 
829c1d255d3SCy Schubert 	u8 rsnxe[20];
830c1d255d3SCy Schubert 	size_t rsnxe_len;
831c1d255d3SCy Schubert 
83239beb93cSSam Leffler 	struct scard_data *scard;
833f05cddf9SRui Paulo 	char imsi[20];
834f05cddf9SRui Paulo 	int mnc_len;
83539beb93cSSam Leffler 
83639beb93cSSam Leffler 	unsigned char last_eapol_src[ETH_ALEN];
83739beb93cSSam Leffler 
8385b9c547cSRui Paulo 	unsigned int keys_cleared; /* bitfield of key indexes that the driver is
8395b9c547cSRui Paulo 				    * known not to be configured with a key */
84039beb93cSSam Leffler 
841c1d255d3SCy Schubert 	struct wpa_bssid_ignore *bssid_ignore;
84239beb93cSSam Leffler 
843c1d255d3SCy Schubert 	/* Number of connection failures since last successful connection */
844c1d255d3SCy Schubert 	unsigned int consecutive_conn_failures;
84539beb93cSSam Leffler 
846f05cddf9SRui Paulo 	/**
847f05cddf9SRui Paulo 	 * scan_req - Type of the scan request
848f05cddf9SRui Paulo 	 */
849f05cddf9SRui Paulo 	enum scan_req_type {
850f05cddf9SRui Paulo 		/**
851f05cddf9SRui Paulo 		 * NORMAL_SCAN_REQ - Normal scan request
852f05cddf9SRui Paulo 		 *
853f05cddf9SRui Paulo 		 * This is used for scans initiated by wpa_supplicant to find an
854f05cddf9SRui Paulo 		 * AP for a connection.
855f05cddf9SRui Paulo 		 */
856f05cddf9SRui Paulo 		NORMAL_SCAN_REQ,
857f05cddf9SRui Paulo 
858f05cddf9SRui Paulo 		/**
859f05cddf9SRui Paulo 		 * INITIAL_SCAN_REQ - Initial scan request
860f05cddf9SRui Paulo 		 *
861f05cddf9SRui Paulo 		 * This is used for the first scan on an interface to force at
862f05cddf9SRui Paulo 		 * least one scan to be run even if the configuration does not
863f05cddf9SRui Paulo 		 * include any enabled networks.
864f05cddf9SRui Paulo 		 */
865f05cddf9SRui Paulo 		INITIAL_SCAN_REQ,
866f05cddf9SRui Paulo 
867f05cddf9SRui Paulo 		/**
868f05cddf9SRui Paulo 		 * MANUAL_SCAN_REQ - Manual scan request
869f05cddf9SRui Paulo 		 *
870f05cddf9SRui Paulo 		 * This is used for scans where the user request a scan or
871f05cddf9SRui Paulo 		 * a specific wpa_supplicant operation (e.g., WPS) requires scan
872f05cddf9SRui Paulo 		 * to be run.
873f05cddf9SRui Paulo 		 */
874f05cddf9SRui Paulo 		MANUAL_SCAN_REQ
8755b9c547cSRui Paulo 	} scan_req, last_scan_req;
8765b9c547cSRui Paulo 	enum wpa_states scan_prev_wpa_state;
8775b9c547cSRui Paulo 	struct os_reltime scan_trigger_time, scan_start_time;
878325151a3SRui Paulo 	/* Minimum freshness requirement for connection purposes */
879325151a3SRui Paulo 	struct os_reltime scan_min_time;
880f05cddf9SRui Paulo 	int scan_runs; /* number of scan runs since WPS was started */
881f05cddf9SRui Paulo 	int *next_scan_freqs;
88285732ac8SCy Schubert 	int *select_network_scan_freqs;
8835b9c547cSRui Paulo 	int *manual_scan_freqs;
8845b9c547cSRui Paulo 	int *manual_sched_scan_freqs;
8855b9c547cSRui Paulo 	unsigned int manual_scan_passive:1;
8865b9c547cSRui Paulo 	unsigned int manual_scan_use_id:1;
8875b9c547cSRui Paulo 	unsigned int manual_scan_only_new:1;
8885b9c547cSRui Paulo 	unsigned int own_scan_requested:1;
8895b9c547cSRui Paulo 	unsigned int own_scan_running:1;
8905b9c547cSRui Paulo 	unsigned int clear_driver_scan_cache:1;
891*a90b9d01SCy Schubert 	unsigned int manual_non_coloc_6ghz:1;
8925b9c547cSRui Paulo 	unsigned int manual_scan_id;
893f05cddf9SRui Paulo 	int scan_interval; /* time in sec between scans to find suitable AP */
894f05cddf9SRui Paulo 	int normal_scans; /* normal scans run before sched_scan */
895f05cddf9SRui Paulo 	int scan_for_connection; /* whether the scan request was triggered for
896f05cddf9SRui Paulo 				  * finding a connection */
89785732ac8SCy Schubert 	/*
89885732ac8SCy Schubert 	 * A unique cookie representing the vendor scan request. This cookie is
89985732ac8SCy Schubert 	 * returned from the driver interface. 0 indicates that there is no
90085732ac8SCy Schubert 	 * pending vendor scan request.
90185732ac8SCy Schubert 	 */
90285732ac8SCy Schubert 	u64 curr_scan_cookie;
9035b9c547cSRui Paulo #define MAX_SCAN_ID 16
9045b9c547cSRui Paulo 	int scan_id[MAX_SCAN_ID];
9055b9c547cSRui Paulo 	unsigned int scan_id_count;
906780fb4a2SCy Schubert 	u8 next_scan_bssid[ETH_ALEN];
907c1d255d3SCy Schubert 	unsigned int next_scan_bssid_wildcard_ssid:1;
908f05cddf9SRui Paulo 
909325151a3SRui Paulo 	struct wpa_ssid_value *ssids_from_scan_req;
910325151a3SRui Paulo 	unsigned int num_ssids_from_scan_req;
911c1d255d3SCy Schubert 	int *last_scan_freqs;
912c1d255d3SCy Schubert 	unsigned int num_last_scan_freqs;
913c1d255d3SCy Schubert 	unsigned int suitable_network;
914c1d255d3SCy Schubert 	unsigned int no_suitable_network;
915325151a3SRui Paulo 
916*a90b9d01SCy Schubert 	u8 ml_probe_bssid[ETH_ALEN];
917*a90b9d01SCy Schubert 	int ml_probe_mld_id;
918*a90b9d01SCy Schubert 	u16 ml_probe_links;
919*a90b9d01SCy Schubert 
9205b9c547cSRui Paulo 	u64 drv_flags;
921c1d255d3SCy Schubert 	u64 drv_flags2;
922f05cddf9SRui Paulo 	unsigned int drv_enc;
9235b9c547cSRui Paulo 	unsigned int drv_rrm_flags;
924*a90b9d01SCy Schubert 	unsigned int drv_max_acl_mac_addrs;
925f05cddf9SRui Paulo 
926f05cddf9SRui Paulo 	/*
927f05cddf9SRui Paulo 	 * A bitmap of supported protocols for probe response offload. See
928f05cddf9SRui Paulo 	 * struct wpa_driver_capa in driver.h
929f05cddf9SRui Paulo 	 */
930f05cddf9SRui Paulo 	unsigned int probe_resp_offloads;
931f05cddf9SRui Paulo 
9325b9c547cSRui Paulo 	/* extended capabilities supported by the driver */
9335b9c547cSRui Paulo 	const u8 *extended_capa, *extended_capa_mask;
9345b9c547cSRui Paulo 	unsigned int extended_capa_len;
9355b9c547cSRui Paulo 
936e28a4053SRui Paulo 	int max_scan_ssids;
937f05cddf9SRui Paulo 	int max_sched_scan_ssids;
938780fb4a2SCy Schubert 	unsigned int max_sched_scan_plans;
939780fb4a2SCy Schubert 	unsigned int max_sched_scan_plan_interval;
940780fb4a2SCy Schubert 	unsigned int max_sched_scan_plan_iterations;
941f05cddf9SRui Paulo 	int sched_scan_supported;
942f05cddf9SRui Paulo 	unsigned int max_match_sets;
943e28a4053SRui Paulo 	unsigned int max_remain_on_chan;
944f05cddf9SRui Paulo 	unsigned int max_stations;
945*a90b9d01SCy Schubert 	unsigned int max_num_akms;
94639beb93cSSam Leffler 
94739beb93cSSam Leffler 	int pending_mic_error_report;
94839beb93cSSam Leffler 	int pending_mic_error_pairwise;
94939beb93cSSam Leffler 	int mic_errors_seen; /* Michael MIC errors with the current PTK */
95039beb93cSSam Leffler 
95139beb93cSSam Leffler 	struct wps_context *wps;
95239beb93cSSam Leffler 	int wps_success; /* WPS success event received */
953e28a4053SRui Paulo 	struct wps_er *wps_er;
9545b9c547cSRui Paulo 	unsigned int wps_run;
955325151a3SRui Paulo 	struct os_reltime wps_pin_start_time;
956c1d255d3SCy Schubert 	bool bssid_ignore_cleared;
9573157ba21SRui Paulo 
9583157ba21SRui Paulo 	struct wpabuf *pending_eapol_rx;
9595b9c547cSRui Paulo 	struct os_reltime pending_eapol_rx_time;
9603157ba21SRui Paulo 	u8 pending_eapol_rx_src[ETH_ALEN];
961*a90b9d01SCy Schubert 	enum frame_encryption pending_eapol_encrypted;
962f05cddf9SRui Paulo 	unsigned int last_eapol_matches_bssid:1;
963*a90b9d01SCy Schubert 	unsigned int eapol_failed:1;
9645b9c547cSRui Paulo 	unsigned int eap_expected_failure:1;
9655b9c547cSRui Paulo 	unsigned int reattach:1; /* reassociation to the same BSS requested */
9665b9c547cSRui Paulo 	unsigned int mac_addr_changed:1;
967325151a3SRui Paulo 	unsigned int added_vif:1;
968a2063804SGordon Tetlow 	unsigned int wnmsleep_used:1;
96985732ac8SCy Schubert 	unsigned int owe_transition_select:1;
97085732ac8SCy Schubert 	unsigned int owe_transition_search:1;
9714bc52338SCy Schubert 	unsigned int connection_set:1;
9724bc52338SCy Schubert 	unsigned int connection_ht:1;
9734bc52338SCy Schubert 	unsigned int connection_vht:1;
9744bc52338SCy Schubert 	unsigned int connection_he:1;
975*a90b9d01SCy Schubert 	unsigned int connection_eht:1;
976c1d255d3SCy Schubert 	unsigned int disable_mbo_oce:1;
9775b9c547cSRui Paulo 
9785b9c547cSRui Paulo 	struct os_reltime last_mac_addr_change;
979*a90b9d01SCy Schubert 	enum wpas_mac_addr_style last_mac_addr_style;
980e28a4053SRui Paulo 
981e28a4053SRui Paulo 	struct ibss_rsn *ibss_rsn;
982e28a4053SRui Paulo 
983f05cddf9SRui Paulo 	int set_sta_uapsd;
984f05cddf9SRui Paulo 	int sta_uapsd;
985f05cddf9SRui Paulo 	int set_ap_uapsd;
986f05cddf9SRui Paulo 	int ap_uapsd;
98785732ac8SCy Schubert 	int auth_alg;
98885732ac8SCy Schubert 	u16 last_owe_group;
989f05cddf9SRui Paulo 
990e28a4053SRui Paulo #ifdef CONFIG_SME
991e28a4053SRui Paulo 	struct {
992325151a3SRui Paulo 		u8 ssid[SSID_MAX_LEN];
993e28a4053SRui Paulo 		size_t ssid_len;
994e28a4053SRui Paulo 		int freq;
99585732ac8SCy Schubert 		u8 assoc_req_ie[1500];
996e28a4053SRui Paulo 		size_t assoc_req_ie_len;
997e28a4053SRui Paulo 		int mfp;
998e28a4053SRui Paulo 		int ft_used;
999e28a4053SRui Paulo 		u8 mobility_domain[2];
1000e28a4053SRui Paulo 		u8 *ft_ies;
1001e28a4053SRui Paulo 		size_t ft_ies_len;
1002e28a4053SRui Paulo 		u8 prev_bssid[ETH_ALEN];
1003e28a4053SRui Paulo 		int prev_bssid_set;
1004e28a4053SRui Paulo 		int auth_alg;
1005f05cddf9SRui Paulo 		int proto;
1006f05cddf9SRui Paulo 
1007f05cddf9SRui Paulo 		int sa_query_count; /* number of pending SA Query requests;
1008f05cddf9SRui Paulo 				     * 0 = no SA Query in progress */
1009f05cddf9SRui Paulo 		int sa_query_timed_out;
1010f05cddf9SRui Paulo 		u8 *sa_query_trans_id; /* buffer of WLAN_SA_QUERY_TR_ID_LEN *
1011f05cddf9SRui Paulo 					* sa_query_count octets of pending
1012f05cddf9SRui Paulo 					* SA Query transaction identifiers */
10135b9c547cSRui Paulo 		struct os_reltime sa_query_start;
10145b9c547cSRui Paulo 		struct os_reltime last_unprot_disconnect;
10155b9c547cSRui Paulo 		enum { HT_SEC_CHAN_UNKNOWN,
10165b9c547cSRui Paulo 		       HT_SEC_CHAN_ABOVE,
10175b9c547cSRui Paulo 		       HT_SEC_CHAN_BELOW } ht_sec_chan;
1018f05cddf9SRui Paulo 		u8 sched_obss_scan;
1019f05cddf9SRui Paulo 		u16 obss_scan_int;
1020f05cddf9SRui Paulo 		u16 bss_max_idle_period;
10215b9c547cSRui Paulo #ifdef CONFIG_SAE
10225b9c547cSRui Paulo 		struct sae_data sae;
10235b9c547cSRui Paulo 		struct wpabuf *sae_token;
10245b9c547cSRui Paulo 		int sae_group_index;
10255b9c547cSRui Paulo 		unsigned int sae_pmksa_caching:1;
102685732ac8SCy Schubert 		u16 seq_num;
1027206b73d0SCy Schubert 		u8 ext_auth_bssid[ETH_ALEN];
1028*a90b9d01SCy Schubert 		struct wpa_ssid *ext_auth_wpa_ssid;
1029206b73d0SCy Schubert 		u8 ext_auth_ssid[SSID_MAX_LEN];
1030206b73d0SCy Schubert 		size_t ext_auth_ssid_len;
1031*a90b9d01SCy Schubert 		int ext_auth_key_mgmt;
1032*a90b9d01SCy Schubert 		u8 ext_auth_ap_mld_addr[ETH_ALEN];
1033*a90b9d01SCy Schubert 		bool ext_ml_auth;
1034c1d255d3SCy Schubert 		int *sae_rejected_groups;
10355b9c547cSRui Paulo #endif /* CONFIG_SAE */
1036*a90b9d01SCy Schubert 		u16 assoc_auth_type;
1037e28a4053SRui Paulo 	} sme;
1038e28a4053SRui Paulo #endif /* CONFIG_SME */
1039e28a4053SRui Paulo 
1040e28a4053SRui Paulo #ifdef CONFIG_AP
1041e28a4053SRui Paulo 	struct hostapd_iface *ap_iface;
1042e28a4053SRui Paulo 	void (*ap_configured_cb)(void *ctx, void *data);
1043e28a4053SRui Paulo 	void *ap_configured_cb_ctx;
1044e28a4053SRui Paulo 	void *ap_configured_cb_data;
1045e28a4053SRui Paulo #endif /* CONFIG_AP */
1046e28a4053SRui Paulo 
10475b9c547cSRui Paulo 	struct hostapd_iface *ifmsh;
10485b9c547cSRui Paulo #ifdef CONFIG_MESH
10495b9c547cSRui Paulo 	struct mesh_rsn *mesh_rsn;
10505b9c547cSRui Paulo 	int mesh_if_idx;
10515b9c547cSRui Paulo 	unsigned int mesh_if_created:1;
10525b9c547cSRui Paulo 	unsigned int mesh_ht_enabled:1;
1053780fb4a2SCy Schubert 	unsigned int mesh_vht_enabled:1;
1054206b73d0SCy Schubert 	unsigned int mesh_he_enabled:1;
1055*a90b9d01SCy Schubert 	unsigned int mesh_eht_enabled:1;
10564bc52338SCy Schubert 	struct wpa_driver_mesh_join_params *mesh_params;
105785732ac8SCy Schubert #ifdef CONFIG_PMKSA_CACHE_EXTERNAL
105885732ac8SCy Schubert 	/* struct external_pmksa_cache::list */
105985732ac8SCy Schubert 	struct dl_list mesh_external_pmksa_cache;
106085732ac8SCy Schubert #endif /* CONFIG_PMKSA_CACHE_EXTERNAL */
10615b9c547cSRui Paulo #endif /* CONFIG_MESH */
10625b9c547cSRui Paulo 
1063f05cddf9SRui Paulo 	unsigned int off_channel_freq;
1064f05cddf9SRui Paulo 	struct wpabuf *pending_action_tx;
1065f05cddf9SRui Paulo 	u8 pending_action_src[ETH_ALEN];
1066f05cddf9SRui Paulo 	u8 pending_action_dst[ETH_ALEN];
1067f05cddf9SRui Paulo 	u8 pending_action_bssid[ETH_ALEN];
1068f05cddf9SRui Paulo 	unsigned int pending_action_freq;
1069f05cddf9SRui Paulo 	int pending_action_no_cck;
1070f05cddf9SRui Paulo 	int pending_action_without_roc;
10715b9c547cSRui Paulo 	unsigned int pending_action_tx_done:1;
1072f05cddf9SRui Paulo 	void (*pending_action_tx_status_cb)(struct wpa_supplicant *wpa_s,
1073f05cddf9SRui Paulo 					    unsigned int freq, const u8 *dst,
1074f05cddf9SRui Paulo 					    const u8 *src, const u8 *bssid,
1075f05cddf9SRui Paulo 					    const u8 *data, size_t data_len,
1076f05cddf9SRui Paulo 					    enum offchannel_send_action_result
1077f05cddf9SRui Paulo 					    result);
1078f05cddf9SRui Paulo 	unsigned int roc_waiting_drv_freq;
1079f05cddf9SRui Paulo 	int action_tx_wait_time;
108085732ac8SCy Schubert 	int action_tx_wait_time_used;
1081f05cddf9SRui Paulo 
10825b9c547cSRui Paulo 	int p2p_mgmt;
10835b9c547cSRui Paulo 
1084f05cddf9SRui Paulo #ifdef CONFIG_P2P
1085f05cddf9SRui Paulo 	struct p2p_go_neg_results *go_params;
1086f05cddf9SRui Paulo 	int create_p2p_iface;
1087f05cddf9SRui Paulo 	u8 pending_interface_addr[ETH_ALEN];
1088f05cddf9SRui Paulo 	char pending_interface_name[100];
1089f05cddf9SRui Paulo 	int pending_interface_type;
1090f05cddf9SRui Paulo 	int p2p_group_idx;
1091f05cddf9SRui Paulo 	unsigned int pending_listen_freq;
1092f05cddf9SRui Paulo 	unsigned int pending_listen_duration;
1093f05cddf9SRui Paulo 	enum {
1094f05cddf9SRui Paulo 		NOT_P2P_GROUP_INTERFACE,
1095f05cddf9SRui Paulo 		P2P_GROUP_INTERFACE_PENDING,
1096f05cddf9SRui Paulo 		P2P_GROUP_INTERFACE_GO,
1097f05cddf9SRui Paulo 		P2P_GROUP_INTERFACE_CLIENT
1098f05cddf9SRui Paulo 	} p2p_group_interface;
1099f05cddf9SRui Paulo 	struct p2p_group *p2p_group;
1100f05cddf9SRui Paulo 	char p2p_pin[10];
1101f05cddf9SRui Paulo 	int p2p_wps_method;
1102f05cddf9SRui Paulo 	u8 p2p_auth_invite[ETH_ALEN];
1103f05cddf9SRui Paulo 	int p2p_sd_over_ctrl_iface;
1104f05cddf9SRui Paulo 	int p2p_in_provisioning;
11055b9c547cSRui Paulo 	int p2p_in_invitation;
1106*a90b9d01SCy Schubert 	int p2p_retry_limit;
11075b9c547cSRui Paulo 	int p2p_invite_go_freq;
1108f05cddf9SRui Paulo 	int pending_invite_ssid_id;
1109f05cddf9SRui Paulo 	int show_group_started;
1110f05cddf9SRui Paulo 	u8 go_dev_addr[ETH_ALEN];
1111f05cddf9SRui Paulo 	int pending_pd_before_join;
1112f05cddf9SRui Paulo 	u8 pending_join_iface_addr[ETH_ALEN];
1113f05cddf9SRui Paulo 	u8 pending_join_dev_addr[ETH_ALEN];
1114f05cddf9SRui Paulo 	int pending_join_wps_method;
1115325151a3SRui Paulo 	u8 p2p_join_ssid[SSID_MAX_LEN];
11165b9c547cSRui Paulo 	size_t p2p_join_ssid_len;
1117f05cddf9SRui Paulo 	int p2p_join_scan_count;
1118f05cddf9SRui Paulo 	int auto_pd_scan_retry;
1119f05cddf9SRui Paulo 	int force_long_sd;
1120f05cddf9SRui Paulo 	u16 pending_pd_config_methods;
1121f05cddf9SRui Paulo 	enum {
11225b9c547cSRui Paulo 		NORMAL_PD, AUTO_PD_GO_NEG, AUTO_PD_JOIN, AUTO_PD_ASP
1123f05cddf9SRui Paulo 	} pending_pd_use;
1124f05cddf9SRui Paulo 
1125f05cddf9SRui Paulo 	/*
1126f05cddf9SRui Paulo 	 * Whether cross connection is disallowed by the AP to which this
1127f05cddf9SRui Paulo 	 * interface is associated (only valid if there is an association).
1128f05cddf9SRui Paulo 	 */
1129f05cddf9SRui Paulo 	int cross_connect_disallowed;
1130f05cddf9SRui Paulo 
1131f05cddf9SRui Paulo 	/*
1132f05cddf9SRui Paulo 	 * Whether this P2P group is configured to use cross connection (only
1133f05cddf9SRui Paulo 	 * valid if this is P2P GO interface). The actual cross connect packet
1134f05cddf9SRui Paulo 	 * forwarding may not be configured depending on the uplink status.
1135f05cddf9SRui Paulo 	 */
1136f05cddf9SRui Paulo 	int cross_connect_enabled;
1137f05cddf9SRui Paulo 
1138f05cddf9SRui Paulo 	/* Whether cross connection forwarding is in use at the moment. */
1139f05cddf9SRui Paulo 	int cross_connect_in_use;
1140f05cddf9SRui Paulo 
1141f05cddf9SRui Paulo 	/*
1142f05cddf9SRui Paulo 	 * Uplink interface name for cross connection
1143f05cddf9SRui Paulo 	 */
1144f05cddf9SRui Paulo 	char cross_connect_uplink[100];
1145f05cddf9SRui Paulo 
1146f05cddf9SRui Paulo 	unsigned int p2p_auto_join:1;
1147f05cddf9SRui Paulo 	unsigned int p2p_auto_pd:1;
114885732ac8SCy Schubert 	unsigned int p2p_go_do_acs:1;
1149f05cddf9SRui Paulo 	unsigned int p2p_persistent_group:1;
1150f05cddf9SRui Paulo 	unsigned int p2p_fallback_to_go_neg:1;
1151f05cddf9SRui Paulo 	unsigned int p2p_pd_before_go_neg:1;
1152f05cddf9SRui Paulo 	unsigned int p2p_go_ht40:1;
11535b9c547cSRui Paulo 	unsigned int p2p_go_vht:1;
1154c1d255d3SCy Schubert 	unsigned int p2p_go_edmg:1;
11554bc52338SCy Schubert 	unsigned int p2p_go_he:1;
1156f05cddf9SRui Paulo 	unsigned int user_initiated_pd:1;
11575b9c547cSRui Paulo 	unsigned int p2p_go_group_formation_completed:1;
11585b9c547cSRui Paulo 	unsigned int group_formation_reported:1;
1159*a90b9d01SCy Schubert 	unsigned int p2p_go_no_pri_sec_switch:1;
11605b9c547cSRui Paulo 	unsigned int waiting_presence_resp;
11615b9c547cSRui Paulo 	int p2p_first_connection_timeout;
11625b9c547cSRui Paulo 	unsigned int p2p_nfc_tag_enabled:1;
11635b9c547cSRui Paulo 	unsigned int p2p_peer_oob_pk_hash_known:1;
11645b9c547cSRui Paulo 	unsigned int p2p_disable_ip_addr_req:1;
1165325151a3SRui Paulo 	unsigned int p2ps_method_config_any:1;
1166325151a3SRui Paulo 	unsigned int p2p_cli_probe:1;
11674b72b91aSCy Schubert 	unsigned int p2p_go_allow_dfs:1;
116885732ac8SCy Schubert 	enum hostapd_hw_mode p2p_go_acs_band;
1169f05cddf9SRui Paulo 	int p2p_persistent_go_freq;
1170f05cddf9SRui Paulo 	int p2p_persistent_id;
1171f05cddf9SRui Paulo 	int p2p_go_intent;
1172f05cddf9SRui Paulo 	int p2p_connect_freq;
11735b9c547cSRui Paulo 	struct os_reltime p2p_auto_started;
11745b9c547cSRui Paulo 	struct wpa_ssid *p2p_last_4way_hs_fail;
11755b9c547cSRui Paulo 	struct wpa_radio_work *p2p_scan_work;
11765b9c547cSRui Paulo 	struct wpa_radio_work *p2p_listen_work;
11775b9c547cSRui Paulo 	struct wpa_radio_work *p2p_send_action_work;
11785b9c547cSRui Paulo 
11795b9c547cSRui Paulo 	u16 p2p_oob_dev_pw_id; /* OOB Device Password Id for group formation */
11805b9c547cSRui Paulo 	struct wpabuf *p2p_oob_dev_pw; /* OOB Device Password for group
11815b9c547cSRui Paulo 					* formation */
11825b9c547cSRui Paulo 	u8 p2p_peer_oob_pubkey_hash[WPS_OOB_PUBKEY_HASH_LEN];
11835b9c547cSRui Paulo 	u8 p2p_ip_addr_info[3 * 4];
11845b9c547cSRui Paulo 
11855b9c547cSRui Paulo 	/* group common frequencies */
11865b9c547cSRui Paulo 	int *p2p_group_common_freqs;
11875b9c547cSRui Paulo 	unsigned int p2p_group_common_freqs_num;
11885b9c547cSRui Paulo 	u8 p2ps_join_addr[ETH_ALEN];
1189780fb4a2SCy Schubert 
1190780fb4a2SCy Schubert 	unsigned int p2p_go_max_oper_chwidth;
1191780fb4a2SCy Schubert 	unsigned int p2p_go_vht_center_freq2;
1192780fb4a2SCy Schubert 	int p2p_lo_started;
1193f05cddf9SRui Paulo #endif /* CONFIG_P2P */
1194f05cddf9SRui Paulo 
1195e28a4053SRui Paulo 	struct wpa_ssid *bgscan_ssid;
1196e28a4053SRui Paulo 	const struct bgscan_ops *bgscan;
1197e28a4053SRui Paulo 	void *bgscan_priv;
1198*a90b9d01SCy Schubert 	int signal_threshold;
1199e28a4053SRui Paulo 
1200f05cddf9SRui Paulo 	const struct autoscan_ops *autoscan;
1201f05cddf9SRui Paulo 	struct wpa_driver_scan_params *autoscan_params;
1202f05cddf9SRui Paulo 	void *autoscan_priv;
1203f05cddf9SRui Paulo 
1204f05cddf9SRui Paulo 	struct wpa_ssid *connect_without_scan;
1205f05cddf9SRui Paulo 
1206f05cddf9SRui Paulo 	struct wps_ap_info *wps_ap;
1207f05cddf9SRui Paulo 	size_t num_wps_ap;
1208f05cddf9SRui Paulo 	int wps_ap_iter;
1209e28a4053SRui Paulo 
1210e28a4053SRui Paulo 	int after_wps;
1211f05cddf9SRui Paulo 	int known_wps_freq;
1212e28a4053SRui Paulo 	unsigned int wps_freq;
1213f05cddf9SRui Paulo 	int wps_fragment_size;
1214f05cddf9SRui Paulo 	int auto_reconnect_disabled;
1215f05cddf9SRui Paulo 
1216f05cddf9SRui Paulo 	 /* Channel preferences for AP/P2P GO use */
1217f05cddf9SRui Paulo 	int best_24_freq;
1218f05cddf9SRui Paulo 	int best_5_freq;
1219f05cddf9SRui Paulo 	int best_overall_freq;
1220f05cddf9SRui Paulo 
1221f05cddf9SRui Paulo 	struct gas_query *gas;
122285732ac8SCy Schubert 	struct gas_server *gas_server;
1223f05cddf9SRui Paulo 
1224f05cddf9SRui Paulo #ifdef CONFIG_INTERWORKING
1225f05cddf9SRui Paulo 	unsigned int fetch_anqp_in_progress:1;
1226f05cddf9SRui Paulo 	unsigned int network_select:1;
1227f05cddf9SRui Paulo 	unsigned int auto_select:1;
1228f05cddf9SRui Paulo 	unsigned int auto_network_select:1;
12295b9c547cSRui Paulo 	unsigned int interworking_fast_assoc_tried:1;
1230f05cddf9SRui Paulo 	unsigned int fetch_all_anqp:1;
12315b9c547cSRui Paulo 	unsigned int fetch_osu_info:1;
12325b9c547cSRui Paulo 	unsigned int fetch_osu_waiting_scan:1;
12335b9c547cSRui Paulo 	unsigned int fetch_osu_icon_in_progress:1;
12345b9c547cSRui Paulo 	struct wpa_bss *interworking_gas_bss;
12355b9c547cSRui Paulo 	unsigned int osu_icon_id;
1236780fb4a2SCy Schubert 	struct dl_list icon_head; /* struct icon_entry */
12375b9c547cSRui Paulo 	struct osu_provider *osu_prov;
12385b9c547cSRui Paulo 	size_t osu_prov_count;
12395b9c547cSRui Paulo 	struct os_reltime osu_icon_fetch_start;
12405b9c547cSRui Paulo 	unsigned int num_osu_scans;
12415b9c547cSRui Paulo 	unsigned int num_prov_found;
1242f05cddf9SRui Paulo #endif /* CONFIG_INTERWORKING */
1243f05cddf9SRui Paulo 	unsigned int drv_capa_known;
1244f05cddf9SRui Paulo 
1245f05cddf9SRui Paulo 	struct {
1246f05cddf9SRui Paulo 		struct hostapd_hw_modes *modes;
1247f05cddf9SRui Paulo 		u16 num_modes;
1248f05cddf9SRui Paulo 		u16 flags;
1249f05cddf9SRui Paulo 	} hw;
12505b9c547cSRui Paulo 	enum local_hw_capab {
12515b9c547cSRui Paulo 		CAPAB_NO_HT_VHT,
12525b9c547cSRui Paulo 		CAPAB_HT,
12535b9c547cSRui Paulo 		CAPAB_HT40,
12545b9c547cSRui Paulo 		CAPAB_VHT,
12555b9c547cSRui Paulo 	} hw_capab;
12565b9c547cSRui Paulo #ifdef CONFIG_MACSEC
12575b9c547cSRui Paulo 	struct ieee802_1x_kay *kay;
12585b9c547cSRui Paulo #endif /* CONFIG_MACSEC */
1259f05cddf9SRui Paulo 
1260f05cddf9SRui Paulo 	int pno;
12615b9c547cSRui Paulo 	int pno_sched_pending;
1262f05cddf9SRui Paulo 
1263f05cddf9SRui Paulo 	/* WLAN_REASON_* reason codes. Negative if locally generated. */
1264f05cddf9SRui Paulo 	int disconnect_reason;
1265f05cddf9SRui Paulo 
12664bc52338SCy Schubert 	/* WLAN_STATUS_* status codes from last received Authentication frame
12674bc52338SCy Schubert 	 * from the AP. */
12684bc52338SCy Schubert 	u16 auth_status_code;
12694bc52338SCy Schubert 
1270780fb4a2SCy Schubert 	/* WLAN_STATUS_* status codes from (Re)Association Response frame. */
1271780fb4a2SCy Schubert 	u16 assoc_status_code;
1272780fb4a2SCy Schubert 
1273f05cddf9SRui Paulo 	struct ext_password_data *ext_pw;
1274f05cddf9SRui Paulo 
12755b9c547cSRui Paulo 	struct wpabuf *last_gas_resp, *prev_gas_resp;
12765b9c547cSRui Paulo 	u8 last_gas_addr[ETH_ALEN], prev_gas_addr[ETH_ALEN];
12775b9c547cSRui Paulo 	u8 last_gas_dialog_token, prev_gas_dialog_token;
1278f05cddf9SRui Paulo 
1279f05cddf9SRui Paulo 	unsigned int no_keep_alive:1;
12805b9c547cSRui Paulo 	unsigned int ext_mgmt_frame_handling:1;
12815b9c547cSRui Paulo 	unsigned int ext_eapol_frame_io:1;
12825b9c547cSRui Paulo 	unsigned int wmm_ac_supported:1;
12835b9c547cSRui Paulo 	unsigned int ext_work_in_progress:1;
12845b9c547cSRui Paulo 	unsigned int own_disconnect_req:1;
1285c1d255d3SCy Schubert 	unsigned int own_reconnect_req:1;
128685732ac8SCy Schubert 	unsigned int ignore_post_flush_scan_res:1;
12875b9c547cSRui Paulo 
12885b9c547cSRui Paulo #define MAC_ADDR_RAND_SCAN       BIT(0)
12895b9c547cSRui Paulo #define MAC_ADDR_RAND_SCHED_SCAN BIT(1)
12905b9c547cSRui Paulo #define MAC_ADDR_RAND_PNO        BIT(2)
12915b9c547cSRui Paulo #define MAC_ADDR_RAND_ALL        (MAC_ADDR_RAND_SCAN | \
12925b9c547cSRui Paulo 				  MAC_ADDR_RAND_SCHED_SCAN | \
12935b9c547cSRui Paulo 				  MAC_ADDR_RAND_PNO)
12945b9c547cSRui Paulo 	unsigned int mac_addr_rand_supported;
12955b9c547cSRui Paulo 	unsigned int mac_addr_rand_enable;
12965b9c547cSRui Paulo 
12975b9c547cSRui Paulo 	/* MAC Address followed by mask (2 * ETH_ALEN) */
12985b9c547cSRui Paulo 	u8 *mac_addr_scan;
12995b9c547cSRui Paulo 	u8 *mac_addr_sched_scan;
13005b9c547cSRui Paulo 	u8 *mac_addr_pno;
13015b9c547cSRui Paulo 
13025b9c547cSRui Paulo #ifdef CONFIG_WNM
13035b9c547cSRui Paulo 	u8 wnm_dialog_token;
13045b9c547cSRui Paulo 	u8 wnm_reply;
13055b9c547cSRui Paulo 	u8 wnm_num_neighbor_report;
13065b9c547cSRui Paulo 	u8 wnm_mode;
1307*a90b9d01SCy Schubert 	bool wnm_link_removal;
1308*a90b9d01SCy Schubert 	u8 wnm_dissoc_addr[ETH_ALEN];
13095b9c547cSRui Paulo 	u16 wnm_dissoc_timer;
13105b9c547cSRui Paulo 	u8 wnm_bss_termination_duration[12];
13115b9c547cSRui Paulo 	struct neighbor_report *wnm_neighbor_report_elements;
13125b9c547cSRui Paulo 	struct os_reltime wnm_cand_valid_until;
1313*a90b9d01SCy Schubert 	struct wpa_bss *wnm_target_bss;
13144bc52338SCy Schubert 	enum bss_trans_mgmt_status_code bss_tm_status;
1315ec080394SCy Schubert 	bool bss_trans_mgmt_in_progress;
131685732ac8SCy Schubert 	u8 coloc_intf_dialog_token;
131785732ac8SCy Schubert 	u8 coloc_intf_auto_report;
131885732ac8SCy Schubert 	u8 coloc_intf_timeout;
131985732ac8SCy Schubert #ifdef CONFIG_MBO
132085732ac8SCy Schubert 	unsigned int wnm_mbo_trans_reason_present:1;
132185732ac8SCy Schubert 	u8 wnm_mbo_transition_reason;
132285732ac8SCy Schubert #endif /* CONFIG_MBO */
13235b9c547cSRui Paulo #endif /* CONFIG_WNM */
13245b9c547cSRui Paulo 
13255b9c547cSRui Paulo #ifdef CONFIG_TESTING_GET_GTK
13265b9c547cSRui Paulo 	u8 last_gtk[32];
13275b9c547cSRui Paulo 	size_t last_gtk_len;
13285b9c547cSRui Paulo #endif /* CONFIG_TESTING_GET_GTK */
13295b9c547cSRui Paulo 
13305b9c547cSRui Paulo 	unsigned int num_multichan_concurrent;
13315b9c547cSRui Paulo 	struct wpa_radio_work *connect_work;
13325b9c547cSRui Paulo 
13335b9c547cSRui Paulo 	unsigned int ext_work_id;
13345b9c547cSRui Paulo 
13355b9c547cSRui Paulo 	struct wpabuf *vendor_elem[NUM_VENDOR_ELEM_FRAMES];
13365b9c547cSRui Paulo 
13375b9c547cSRui Paulo #ifdef CONFIG_TESTING_OPTIONS
13385b9c547cSRui Paulo 	struct l2_packet_data *l2_test;
13395b9c547cSRui Paulo 	unsigned int extra_roc_dur;
13405b9c547cSRui Paulo 	enum wpa_supplicant_test_failure test_failure;
134185732ac8SCy Schubert 	char *get_pref_freq_list_override;
1342780fb4a2SCy Schubert 	unsigned int reject_btm_req_reason;
1343780fb4a2SCy Schubert 	unsigned int p2p_go_csa_on_inv:1;
1344780fb4a2SCy Schubert 	unsigned int ignore_auth_resp:1;
1345780fb4a2SCy Schubert 	unsigned int ignore_assoc_disallow:1;
1346c1d255d3SCy Schubert 	unsigned int disable_sa_query:1;
134785732ac8SCy Schubert 	unsigned int testing_resend_assoc:1;
1348c1d255d3SCy Schubert 	unsigned int ignore_sae_h2e_only:1;
1349c1d255d3SCy Schubert 	int ft_rsnxe_used;
135085732ac8SCy Schubert 	struct wpabuf *sae_commit_override;
135185732ac8SCy Schubert 	enum wpa_alg last_tk_alg;
135285732ac8SCy Schubert 	u8 last_tk_addr[ETH_ALEN];
135385732ac8SCy Schubert 	int last_tk_key_idx;
135485732ac8SCy Schubert 	u8 last_tk[WPA_TK_MAX_LEN];
135585732ac8SCy Schubert 	size_t last_tk_len;
135685732ac8SCy Schubert 	struct wpabuf *last_assoc_req_wpa_ie;
1357c1d255d3SCy Schubert 	int *extra_sae_rejected_groups;
1358c1d255d3SCy Schubert 	struct wpabuf *rsne_override_eapol;
1359c1d255d3SCy Schubert 	struct wpabuf *rsnxe_override_assoc;
1360c1d255d3SCy Schubert 	struct wpabuf *rsnxe_override_eapol;
1361c1d255d3SCy Schubert 	struct dl_list drv_signal_override;
1362c1d255d3SCy Schubert 	unsigned int oci_freq_override_eapol;
1363c1d255d3SCy Schubert 	unsigned int oci_freq_override_saquery_req;
1364c1d255d3SCy Schubert 	unsigned int oci_freq_override_saquery_resp;
1365c1d255d3SCy Schubert 	unsigned int oci_freq_override_eapol_g2;
1366c1d255d3SCy Schubert 	unsigned int oci_freq_override_ft_assoc;
1367c1d255d3SCy Schubert 	unsigned int oci_freq_override_fils_assoc;
1368c1d255d3SCy Schubert 	unsigned int oci_freq_override_wnm_sleep;
1369*a90b9d01SCy Schubert 	unsigned int disable_eapol_g2_tx;
1370*a90b9d01SCy Schubert 	int test_assoc_comeback_type;
13715b9c547cSRui Paulo #endif /* CONFIG_TESTING_OPTIONS */
13725b9c547cSRui Paulo 
13735b9c547cSRui Paulo 	struct wmm_ac_assoc_data *wmm_ac_assoc_info;
13745b9c547cSRui Paulo 	struct wmm_tspec_element *tspecs[WMM_AC_NUM][TS_DIR_IDX_COUNT];
13755b9c547cSRui Paulo 	struct wmm_ac_addts_request *addts_request;
13765b9c547cSRui Paulo 	u8 wmm_ac_last_dialog_token;
13775b9c547cSRui Paulo 	struct wmm_tspec_element *last_tspecs;
13785b9c547cSRui Paulo 	u8 last_tspecs_count;
13795b9c547cSRui Paulo 
13805b9c547cSRui Paulo 	struct rrm_data rrm;
138185732ac8SCy Schubert 	struct beacon_rep_data beacon_rep_data;
1382325151a3SRui Paulo 
1383325151a3SRui Paulo #ifdef CONFIG_FST
1384325151a3SRui Paulo 	struct fst_iface *fst;
1385325151a3SRui Paulo 	const struct wpabuf *fst_ies;
1386325151a3SRui Paulo 	struct wpabuf *received_mb_ies;
1387325151a3SRui Paulo #endif /* CONFIG_FST */
1388780fb4a2SCy Schubert 
1389780fb4a2SCy Schubert #ifdef CONFIG_MBO
1390780fb4a2SCy Schubert 	/* Multiband operation non-preferred channel */
1391780fb4a2SCy Schubert 	struct wpa_mbo_non_pref_channel {
1392780fb4a2SCy Schubert 		enum mbo_non_pref_chan_reason reason;
1393780fb4a2SCy Schubert 		u8 oper_class;
1394780fb4a2SCy Schubert 		u8 chan;
1395780fb4a2SCy Schubert 		u8 preference;
1396780fb4a2SCy Schubert 	} *non_pref_chan;
1397780fb4a2SCy Schubert 	size_t non_pref_chan_num;
1398780fb4a2SCy Schubert 	u8 mbo_wnm_token;
139985732ac8SCy Schubert 	/**
140085732ac8SCy Schubert 	 * enable_oce - Enable OCE if it is enabled by user and device also
140185732ac8SCy Schubert 	 *		supports OCE.
140285732ac8SCy Schubert 	 * User can enable OCE with wpa_config's 'oce' parameter as follows -
140385732ac8SCy Schubert 	 *  - Set BIT(0) to enable OCE in non-AP STA mode.
140485732ac8SCy Schubert 	 *  - Set BIT(1) to enable OCE in STA-CFON mode.
140585732ac8SCy Schubert 	 */
140685732ac8SCy Schubert 	u8 enable_oce;
1407780fb4a2SCy Schubert #endif /* CONFIG_MBO */
1408780fb4a2SCy Schubert 
1409780fb4a2SCy Schubert 	/*
1410780fb4a2SCy Schubert 	 * This should be under CONFIG_MBO, but it is left out to allow using
1411780fb4a2SCy Schubert 	 * the bss_temp_disallowed list for other purposes as well.
1412780fb4a2SCy Schubert 	 */
1413780fb4a2SCy Schubert 	struct dl_list bss_tmp_disallowed;
1414780fb4a2SCy Schubert 
1415780fb4a2SCy Schubert 	/*
1416780fb4a2SCy Schubert 	 * Content of a measurement report element with type 8 (LCI),
1417780fb4a2SCy Schubert 	 * own location.
1418780fb4a2SCy Schubert 	 */
1419780fb4a2SCy Schubert 	struct wpabuf *lci;
1420780fb4a2SCy Schubert 	struct os_reltime lci_time;
142185732ac8SCy Schubert 
142285732ac8SCy Schubert 	struct os_reltime beacon_rep_scan;
142385732ac8SCy Schubert 
142485732ac8SCy Schubert 	/* FILS HLP requests (struct fils_hlp_req) */
142585732ac8SCy Schubert 	struct dl_list fils_hlp_req;
142685732ac8SCy Schubert 
142785732ac8SCy Schubert 	struct sched_scan_relative_params {
142885732ac8SCy Schubert 		/**
142985732ac8SCy Schubert 		 * relative_rssi_set - Enable relatively preferred BSS reporting
143085732ac8SCy Schubert 		 *
143185732ac8SCy Schubert 		 * 0 = Disable reporting relatively preferred BSSs
143285732ac8SCy Schubert 		 * 1 = Enable reporting relatively preferred BSSs
143385732ac8SCy Schubert 		 */
143485732ac8SCy Schubert 		int relative_rssi_set;
143585732ac8SCy Schubert 
143685732ac8SCy Schubert 		/**
143785732ac8SCy Schubert 		 * relative_rssi - Relative RSSI for reporting better BSSs
143885732ac8SCy Schubert 		 *
143985732ac8SCy Schubert 		 * Amount of RSSI by which a BSS should be better than the
144085732ac8SCy Schubert 		 * current connected BSS so that the new BSS can be reported
144185732ac8SCy Schubert 		 * to user space. This applies to sched_scan operations.
144285732ac8SCy Schubert 		 */
144385732ac8SCy Schubert 		int relative_rssi;
144485732ac8SCy Schubert 
144585732ac8SCy Schubert 		/**
144685732ac8SCy Schubert 		 * relative_adjust_band - Band in which RSSI is to be adjusted
144785732ac8SCy Schubert 		 */
144885732ac8SCy Schubert 		enum set_band relative_adjust_band;
144985732ac8SCy Schubert 
145085732ac8SCy Schubert 		/**
145185732ac8SCy Schubert 		 * relative_adjust_rssi - RSSI adjustment
145285732ac8SCy Schubert 		 *
145385732ac8SCy Schubert 		 * An amount of relative_adjust_rssi should be added to the
145485732ac8SCy Schubert 		 * BSSs that belong to the relative_adjust_band while comparing
145585732ac8SCy Schubert 		 * with other bands for BSS reporting.
145685732ac8SCy Schubert 		 */
145785732ac8SCy Schubert 		int relative_adjust_rssi;
145885732ac8SCy Schubert 	} srp;
145985732ac8SCy Schubert 
146085732ac8SCy Schubert 	/* RIC elements for FT protocol */
146185732ac8SCy Schubert 	struct wpabuf *ric_ies;
146285732ac8SCy Schubert 
146385732ac8SCy Schubert 	int last_auth_timeout_sec;
146485732ac8SCy Schubert 
146585732ac8SCy Schubert #ifdef CONFIG_DPP
14664bc52338SCy Schubert 	struct dpp_global *dpp;
146785732ac8SCy Schubert 	struct dpp_authentication *dpp_auth;
146885732ac8SCy Schubert 	struct wpa_radio_work *dpp_listen_work;
146985732ac8SCy Schubert 	unsigned int dpp_pending_listen_freq;
147085732ac8SCy Schubert 	unsigned int dpp_listen_freq;
1471c1d255d3SCy Schubert 	struct os_reltime dpp_listen_end;
147285732ac8SCy Schubert 	u8 dpp_allowed_roles;
147385732ac8SCy Schubert 	int dpp_qr_mutual;
1474c1d255d3SCy Schubert 	int dpp_netrole;
147585732ac8SCy Schubert 	int dpp_auth_ok_on_ack;
147685732ac8SCy Schubert 	int dpp_in_response_listen;
1477*a90b9d01SCy Schubert 	bool dpp_tx_auth_resp_on_roc_stop;
1478*a90b9d01SCy Schubert 	bool dpp_tx_chan_change;
1479*a90b9d01SCy Schubert 	bool dpp_listen_on_tx_expire;
148085732ac8SCy Schubert 	int dpp_gas_client;
1481*a90b9d01SCy Schubert 	int dpp_gas_server;
148285732ac8SCy Schubert 	int dpp_gas_dialog_token;
148385732ac8SCy Schubert 	u8 dpp_intro_bssid[ETH_ALEN];
148485732ac8SCy Schubert 	void *dpp_intro_network;
1485*a90b9d01SCy Schubert 	u8 dpp_intro_peer_version;
148685732ac8SCy Schubert 	struct dpp_pkex *dpp_pkex;
148785732ac8SCy Schubert 	struct dpp_bootstrap_info *dpp_pkex_bi;
148885732ac8SCy Schubert 	char *dpp_pkex_code;
1489*a90b9d01SCy Schubert 	size_t dpp_pkex_code_len;
149085732ac8SCy Schubert 	char *dpp_pkex_identifier;
1491*a90b9d01SCy Schubert 	enum dpp_pkex_ver dpp_pkex_ver;
149285732ac8SCy Schubert 	char *dpp_pkex_auth_cmd;
149385732ac8SCy Schubert 	char *dpp_configurator_params;
149485732ac8SCy Schubert 	struct os_reltime dpp_last_init;
149585732ac8SCy Schubert 	struct os_reltime dpp_init_iter_start;
149685732ac8SCy Schubert 	unsigned int dpp_init_max_tries;
149785732ac8SCy Schubert 	unsigned int dpp_init_retry_time;
149885732ac8SCy Schubert 	unsigned int dpp_resp_wait_time;
149985732ac8SCy Schubert 	unsigned int dpp_resp_max_tries;
150085732ac8SCy Schubert 	unsigned int dpp_resp_retry_time;
1501c1d255d3SCy Schubert 	u8 dpp_last_ssid[SSID_MAX_LEN];
1502c1d255d3SCy Schubert 	size_t dpp_last_ssid_len;
1503c1d255d3SCy Schubert 	bool dpp_conf_backup_received;
1504*a90b9d01SCy Schubert 	bool dpp_pkex_wait_auth_req;
15054bc52338SCy Schubert #ifdef CONFIG_DPP2
15064bc52338SCy Schubert 	struct dpp_pfs *dpp_pfs;
1507c1d255d3SCy Schubert 	int dpp_pfs_fallback;
1508c1d255d3SCy Schubert 	struct wpabuf *dpp_presence_announcement;
1509c1d255d3SCy Schubert 	struct dpp_bootstrap_info *dpp_chirp_bi;
1510c1d255d3SCy Schubert 	int dpp_chirp_freq;
1511c1d255d3SCy Schubert 	int *dpp_chirp_freqs;
1512c1d255d3SCy Schubert 	int dpp_chirp_iter;
1513c1d255d3SCy Schubert 	int dpp_chirp_round;
1514c1d255d3SCy Schubert 	int dpp_chirp_scan_done;
1515c1d255d3SCy Schubert 	int dpp_chirp_listen;
1516c1d255d3SCy Schubert 	struct wpa_ssid *dpp_reconfig_ssid;
1517c1d255d3SCy Schubert 	int dpp_reconfig_ssid_id;
1518c1d255d3SCy Schubert 	struct dpp_reconfig_id *dpp_reconfig_id;
15194bc52338SCy Schubert #endif /* CONFIG_DPP2 */
1520*a90b9d01SCy Schubert #ifdef CONFIG_DPP3
1521*a90b9d01SCy Schubert 	struct os_reltime dpp_pb_time;
1522*a90b9d01SCy Schubert 	bool dpp_pb_configurator;
1523*a90b9d01SCy Schubert 	int *dpp_pb_freqs;
1524*a90b9d01SCy Schubert 	unsigned int dpp_pb_freq_idx;
1525*a90b9d01SCy Schubert 	unsigned int dpp_pb_announce_count;
1526*a90b9d01SCy Schubert 	struct wpabuf *dpp_pb_announcement;
1527*a90b9d01SCy Schubert 	struct dpp_bootstrap_info *dpp_pb_bi;
1528*a90b9d01SCy Schubert 	unsigned int dpp_pb_resp_freq;
1529*a90b9d01SCy Schubert 	u8 dpp_pb_init_hash[SHA256_MAC_LEN];
1530*a90b9d01SCy Schubert 	int dpp_pb_stop_iter;
1531*a90b9d01SCy Schubert 	bool dpp_pb_discovery_done;
1532*a90b9d01SCy Schubert 	u8 dpp_pb_c_nonce[DPP_MAX_NONCE_LEN];
1533*a90b9d01SCy Schubert 	size_t dpp_pb_c_nonce_len;
1534*a90b9d01SCy Schubert 	bool dpp_pb_result_indicated;
1535*a90b9d01SCy Schubert 	struct os_reltime dpp_pb_announce_time;
1536*a90b9d01SCy Schubert 	struct dpp_pb_info dpp_pb[DPP_PB_INFO_COUNT];
1537*a90b9d01SCy Schubert 	u8 dpp_pb_resp_hash[SHA256_MAC_LEN];
1538*a90b9d01SCy Schubert 	struct os_reltime dpp_pb_last_resp;
1539*a90b9d01SCy Schubert 	char *dpp_pb_cmd;
1540*a90b9d01SCy Schubert #endif /* CONFIG_DPP3 */
154185732ac8SCy Schubert #ifdef CONFIG_TESTING_OPTIONS
154285732ac8SCy Schubert 	char *dpp_config_obj_override;
154385732ac8SCy Schubert 	char *dpp_discovery_override;
154485732ac8SCy Schubert 	char *dpp_groups_override;
154585732ac8SCy Schubert 	unsigned int dpp_ignore_netaccesskey_mismatch:1;
1546*a90b9d01SCy Schubert 	unsigned int dpp_discard_public_action:1;
154785732ac8SCy Schubert #endif /* CONFIG_TESTING_OPTIONS */
154885732ac8SCy Schubert #endif /* CONFIG_DPP */
154985732ac8SCy Schubert 
155085732ac8SCy Schubert #ifdef CONFIG_FILS
155185732ac8SCy Schubert 	unsigned int disable_fils:1;
155285732ac8SCy Schubert #endif /* CONFIG_FILS */
155385732ac8SCy Schubert 	unsigned int ieee80211ac:1;
15544bc52338SCy Schubert 	unsigned int enabled_4addr_mode:1;
15554bc52338SCy Schubert 	unsigned int multi_bss_support:1;
1556c1d255d3SCy Schubert 	unsigned int drv_authorized_port:1;
1557c1d255d3SCy Schubert 	unsigned int multi_ap_ie:1;
1558c1d255d3SCy Schubert 	unsigned int multi_ap_backhaul:1;
1559c1d255d3SCy Schubert 	unsigned int multi_ap_fronthaul:1;
1560*a90b9d01SCy Schubert 
1561*a90b9d01SCy Schubert #ifndef CONFIG_NO_ROBUST_AV
1562c1d255d3SCy Schubert 	struct robust_av_data robust_av;
1563c1d255d3SCy Schubert 	bool mscs_setup_done;
15644b72b91aSCy Schubert 	struct scs_robust_av_data scs_robust_av_req;
15654b72b91aSCy Schubert 	u8 scs_dialog_token;
15664b72b91aSCy Schubert 	struct dl_list active_scs_ids;
15674b72b91aSCy Schubert 	bool ongoing_scs_req;
15684b72b91aSCy Schubert 	u8 dscp_req_dialog_token;
15694b72b91aSCy Schubert 	u8 dscp_query_dialog_token;
15704b72b91aSCy Schubert 	unsigned int enable_dscp_policy_capa:1;
15714b72b91aSCy Schubert 	unsigned int connection_dscp:1;
15724b72b91aSCy Schubert 	unsigned int wait_for_dscp_req:1;
1573*a90b9d01SCy Schubert #ifdef CONFIG_TESTING_OPTIONS
1574*a90b9d01SCy Schubert 	unsigned int disable_scs_support:1;
1575*a90b9d01SCy Schubert 	unsigned int disable_mscs_support:1;
1576*a90b9d01SCy Schubert #endif /* CONFIG_TESTING_OPTIONS */
1577*a90b9d01SCy Schubert #endif /* CONFIG_NO_ROBUST_AV */
1578*a90b9d01SCy Schubert 
1579*a90b9d01SCy Schubert 	bool wps_scan_done; /* Set upon receiving scan results event */
1580*a90b9d01SCy Schubert 	bool supp_pbc_active; /* Set for interface when PBC is triggered */
1581*a90b9d01SCy Schubert 	bool wps_overlap;
1582*a90b9d01SCy Schubert 
1583*a90b9d01SCy Schubert #ifdef CONFIG_PASN
1584*a90b9d01SCy Schubert 	struct pasn_data pasn;
1585*a90b9d01SCy Schubert 	struct wpa_radio_work *pasn_auth_work;
1586*a90b9d01SCy Schubert 	unsigned int pasn_count;
1587*a90b9d01SCy Schubert 	struct pasn_auth *pasn_params;
1588*a90b9d01SCy Schubert #endif /* CONFIG_PASN */
1589*a90b9d01SCy Schubert 
1590*a90b9d01SCy Schubert 	bool is_6ghz_enabled;
1591*a90b9d01SCy Schubert 	bool crossed_6ghz_dom;
1592*a90b9d01SCy Schubert 	bool last_scan_all_chan;
1593*a90b9d01SCy Schubert 	bool last_scan_non_coloc_6ghz;
1594*a90b9d01SCy Schubert 	bool support_6ghz;
1595*a90b9d01SCy Schubert 
1596*a90b9d01SCy Schubert 	struct wpa_signal_info last_signal_info;
1597*a90b9d01SCy Schubert 
1598*a90b9d01SCy Schubert 	struct wpa_ssid *ml_connect_probe_ssid;
1599*a90b9d01SCy Schubert 	struct wpa_bss *ml_connect_probe_bss;
1600*a90b9d01SCy Schubert 
1601*a90b9d01SCy Schubert #ifdef CONFIG_OWE
1602*a90b9d01SCy Schubert 	/* An array of frequencies to scan for OWE transition mode BSSs when
1603*a90b9d01SCy Schubert 	 * owe_transition_search == 1 */
1604*a90b9d01SCy Schubert 	int *owe_trans_scan_freq;
1605*a90b9d01SCy Schubert #endif /* CONFIG_OWE */
1606*a90b9d01SCy Schubert 
1607*a90b9d01SCy Schubert #ifdef CONFIG_NAN_USD
1608*a90b9d01SCy Schubert 	struct nan_de *nan_de;
1609*a90b9d01SCy Schubert 	struct wpa_radio_work *nan_usd_listen_work;
1610*a90b9d01SCy Schubert 	struct wpa_radio_work *nan_usd_tx_work;
1611*a90b9d01SCy Schubert #endif /* CONFIG_NAN_USD */
1612*a90b9d01SCy Schubert 
1613*a90b9d01SCy Schubert 	bool ssid_verified;
1614*a90b9d01SCy Schubert 	bool bigtk_set;
1615*a90b9d01SCy Schubert 	u64 first_beacon_tsf;
1616*a90b9d01SCy Schubert 	unsigned int beacons_checked;
1617*a90b9d01SCy Schubert 	unsigned int next_beacon_check;
161839beb93cSSam Leffler };
161939beb93cSSam Leffler 
162039beb93cSSam Leffler 
162139beb93cSSam Leffler /* wpa_supplicant.c */
1622f05cddf9SRui Paulo void wpa_supplicant_apply_ht_overrides(
1623f05cddf9SRui Paulo 	struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
1624f05cddf9SRui Paulo 	struct wpa_driver_associate_params *params);
16255b9c547cSRui Paulo void wpa_supplicant_apply_vht_overrides(
16265b9c547cSRui Paulo 	struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
16275b9c547cSRui Paulo 	struct wpa_driver_associate_params *params);
1628c1d255d3SCy Schubert void wpa_supplicant_apply_he_overrides(
1629c1d255d3SCy Schubert 	struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
1630c1d255d3SCy Schubert 	struct wpa_driver_associate_params *params);
1631*a90b9d01SCy Schubert void wpa_supplicant_apply_eht_overrides(
1632*a90b9d01SCy Schubert 	struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
1633*a90b9d01SCy Schubert 	struct wpa_driver_associate_params *params);
1634f05cddf9SRui Paulo 
1635e28a4053SRui Paulo int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
16365b9c547cSRui Paulo int wpa_supplicant_set_wpa_none_key(struct wpa_supplicant *wpa_s,
16375b9c547cSRui Paulo 				    struct wpa_ssid *ssid);
1638e28a4053SRui Paulo 
163939beb93cSSam Leffler int wpa_supplicant_reload_configuration(struct wpa_supplicant *wpa_s);
164039beb93cSSam Leffler 
1641e28a4053SRui Paulo const char * wpa_supplicant_state_txt(enum wpa_states state);
1642f05cddf9SRui Paulo int wpa_supplicant_update_mac_addr(struct wpa_supplicant *wpa_s);
164339beb93cSSam Leffler int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s);
1644c1d255d3SCy Schubert int wpa_supplicant_update_bridge_ifname(struct wpa_supplicant *wpa_s,
1645c1d255d3SCy Schubert 					const char *bridge_ifname);
16464b72b91aSCy Schubert void wpas_set_mgmt_group_cipher(struct wpa_supplicant *wpa_s,
16474b72b91aSCy Schubert 				struct wpa_ssid *ssid, struct wpa_ie_data *ie);
164839beb93cSSam Leffler int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
1649e28a4053SRui Paulo 			      struct wpa_bss *bss, struct wpa_ssid *ssid,
1650*a90b9d01SCy Schubert 			      u8 *wpa_ie, size_t *wpa_ie_len,
1651*a90b9d01SCy Schubert 			      bool skip_default_rsne);
1652c1d255d3SCy Schubert int wpas_restore_permanent_mac_addr(struct wpa_supplicant *wpa_s);
165339beb93cSSam Leffler void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
1654e28a4053SRui Paulo 			      struct wpa_bss *bss,
165539beb93cSSam Leffler 			      struct wpa_ssid *ssid);
165639beb93cSSam Leffler void wpa_supplicant_set_non_wpa_policy(struct wpa_supplicant *wpa_s,
165739beb93cSSam Leffler 				       struct wpa_ssid *ssid);
165839beb93cSSam Leffler void wpa_supplicant_initiate_eapol(struct wpa_supplicant *wpa_s);
165939beb93cSSam Leffler void wpa_clear_keys(struct wpa_supplicant *wpa_s, const u8 *addr);
166039beb93cSSam Leffler void wpa_supplicant_req_auth_timeout(struct wpa_supplicant *wpa_s,
166139beb93cSSam Leffler 				     int sec, int usec);
166285732ac8SCy Schubert void wpas_auth_timeout_restart(struct wpa_supplicant *wpa_s, int sec_diff);
1663f05cddf9SRui Paulo void wpa_supplicant_reinit_autoscan(struct wpa_supplicant *wpa_s);
1664e28a4053SRui Paulo void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
1665e28a4053SRui Paulo 			      enum wpa_states state);
166639beb93cSSam Leffler struct wpa_ssid * wpa_supplicant_get_ssid(struct wpa_supplicant *wpa_s);
1667f05cddf9SRui Paulo const char * wpa_supplicant_get_eap_mode(struct wpa_supplicant *wpa_s);
166839beb93cSSam Leffler void wpa_supplicant_cancel_auth_timeout(struct wpa_supplicant *wpa_s);
166939beb93cSSam Leffler void wpa_supplicant_deauthenticate(struct wpa_supplicant *wpa_s,
1670206b73d0SCy Schubert 				   u16 reason_code);
1671c1d255d3SCy Schubert void wpa_supplicant_reconnect(struct wpa_supplicant *wpa_s);
167239beb93cSSam Leffler 
1673780fb4a2SCy Schubert struct wpa_ssid * wpa_supplicant_add_network(struct wpa_supplicant *wpa_s);
1674780fb4a2SCy Schubert int wpa_supplicant_remove_network(struct wpa_supplicant *wpa_s, int id);
1675c1d255d3SCy Schubert int wpa_supplicant_remove_all_networks(struct wpa_supplicant *wpa_s);
1676e28a4053SRui Paulo void wpa_supplicant_enable_network(struct wpa_supplicant *wpa_s,
1677e28a4053SRui Paulo 				   struct wpa_ssid *ssid);
1678e28a4053SRui Paulo void wpa_supplicant_disable_network(struct wpa_supplicant *wpa_s,
1679e28a4053SRui Paulo 				    struct wpa_ssid *ssid);
1680e28a4053SRui Paulo void wpa_supplicant_select_network(struct wpa_supplicant *wpa_s,
1681e28a4053SRui Paulo 				   struct wpa_ssid *ssid);
168232a95656SCy Schubert int wpas_remove_cred(struct wpa_supplicant *wpa_s, struct wpa_cred *cred);
168332a95656SCy Schubert int wpas_remove_all_creds(struct wpa_supplicant *wpa_s);
16845b9c547cSRui Paulo int wpas_set_pkcs11_engine_and_module_path(struct wpa_supplicant *wpa_s,
16855b9c547cSRui Paulo 					   const char *pkcs11_engine_path,
16865b9c547cSRui Paulo 					   const char *pkcs11_module_path);
1687e28a4053SRui Paulo int wpa_supplicant_set_ap_scan(struct wpa_supplicant *wpa_s,
1688e28a4053SRui Paulo 			       int ap_scan);
1689f05cddf9SRui Paulo int wpa_supplicant_set_bss_expiration_age(struct wpa_supplicant *wpa_s,
1690f05cddf9SRui Paulo 					  unsigned int expire_age);
1691f05cddf9SRui Paulo int wpa_supplicant_set_bss_expiration_count(struct wpa_supplicant *wpa_s,
1692f05cddf9SRui Paulo 					    unsigned int expire_count);
1693f05cddf9SRui Paulo int wpa_supplicant_set_scan_interval(struct wpa_supplicant *wpa_s,
1694f05cddf9SRui Paulo 				     int scan_interval);
1695e28a4053SRui Paulo int wpa_supplicant_set_debug_params(struct wpa_global *global,
1696e28a4053SRui Paulo 				    int debug_level, int debug_timestamp,
1697e28a4053SRui Paulo 				    int debug_show_keys);
1698f05cddf9SRui Paulo void free_hw_features(struct wpa_supplicant *wpa_s);
1699e28a4053SRui Paulo 
170039beb93cSSam Leffler void wpa_show_license(void);
170139beb93cSSam Leffler 
1702780fb4a2SCy Schubert struct wpa_interface * wpa_supplicant_match_iface(struct wpa_global *global,
1703780fb4a2SCy Schubert 						  const char *ifname);
170439beb93cSSam Leffler struct wpa_supplicant * wpa_supplicant_add_iface(struct wpa_global *global,
17055b9c547cSRui Paulo 						 struct wpa_interface *iface,
17065b9c547cSRui Paulo 						 struct wpa_supplicant *parent);
170739beb93cSSam Leffler int wpa_supplicant_remove_iface(struct wpa_global *global,
1708f05cddf9SRui Paulo 				struct wpa_supplicant *wpa_s,
1709f05cddf9SRui Paulo 				int terminate);
171039beb93cSSam Leffler struct wpa_supplicant * wpa_supplicant_get_iface(struct wpa_global *global,
171139beb93cSSam Leffler 						 const char *ifname);
171239beb93cSSam Leffler struct wpa_global * wpa_supplicant_init(struct wpa_params *params);
171339beb93cSSam Leffler int wpa_supplicant_run(struct wpa_global *global);
171439beb93cSSam Leffler void wpa_supplicant_deinit(struct wpa_global *global);
171539beb93cSSam Leffler 
171639beb93cSSam Leffler int wpa_supplicant_scard_init(struct wpa_supplicant *wpa_s,
171739beb93cSSam Leffler 			      struct wpa_ssid *ssid);
1718e28a4053SRui Paulo void wpa_supplicant_terminate_proc(struct wpa_global *global);
1719*a90b9d01SCy Schubert void wpa_supplicant_rx_eapol(void *ctx, const u8 *own_addr,
1720*a90b9d01SCy Schubert 			     const u8 *buf, size_t len,
1721*a90b9d01SCy Schubert 			     enum frame_encryption encrypted);
1722f05cddf9SRui Paulo void wpa_supplicant_update_config(struct wpa_supplicant *wpa_s);
1723f05cddf9SRui Paulo void wpa_supplicant_clear_status(struct wpa_supplicant *wpa_s);
1724*a90b9d01SCy Schubert void wpas_connection_failed(struct wpa_supplicant *wpa_s, const u8 *bssid,
1725*a90b9d01SCy Schubert 			    const u8 **link_bssids);
172685732ac8SCy Schubert void fils_connection_failure(struct wpa_supplicant *wpa_s);
1727c1d255d3SCy Schubert void fils_pmksa_cache_flush(struct wpa_supplicant *wpa_s);
1728f05cddf9SRui Paulo int wpas_driver_bss_selection(struct wpa_supplicant *wpa_s);
1729f05cddf9SRui Paulo int wpas_is_p2p_prioritized(struct wpa_supplicant *wpa_s);
1730*a90b9d01SCy Schubert void wpas_auth_failed(struct wpa_supplicant *wpa_s, const char *reason,
1731*a90b9d01SCy Schubert 		      const u8 *bssid);
1732f05cddf9SRui Paulo void wpas_clear_temp_disabled(struct wpa_supplicant *wpa_s,
1733f05cddf9SRui Paulo 			      struct wpa_ssid *ssid, int clear_failures);
1734f05cddf9SRui Paulo int disallowed_bssid(struct wpa_supplicant *wpa_s, const u8 *bssid);
1735f05cddf9SRui Paulo int disallowed_ssid(struct wpa_supplicant *wpa_s, const u8 *ssid,
1736f05cddf9SRui Paulo 		    size_t ssid_len);
1737f05cddf9SRui Paulo void wpas_request_connection(struct wpa_supplicant *wpa_s);
1738780fb4a2SCy Schubert void wpas_request_disconnection(struct wpa_supplicant *wpa_s);
1739*a90b9d01SCy Schubert int wpas_build_ext_capab(struct wpa_supplicant *wpa_s, u8 *buf, size_t buflen,
1740*a90b9d01SCy Schubert 			 struct wpa_bss *bss);
1741*a90b9d01SCy Schubert int wpas_update_random_addr(struct wpa_supplicant *wpa_s,
1742*a90b9d01SCy Schubert 			    enum wpas_mac_addr_style style,
1743*a90b9d01SCy Schubert 			    struct wpa_ssid *ssid);
17445b9c547cSRui Paulo int wpas_update_random_addr_disassoc(struct wpa_supplicant *wpa_s);
17455b9c547cSRui Paulo void add_freq(int *freqs, int *num_freqs, int freq);
17465b9c547cSRui Paulo 
1747c1d255d3SCy Schubert int wpas_get_op_chan_phy(int freq, const u8 *ies, size_t ies_len,
1748c1d255d3SCy Schubert 			 u8 *op_class, u8 *chan, u8 *phy_type);
1749c1d255d3SCy Schubert 
1750c1d255d3SCy Schubert int wpas_twt_send_setup(struct wpa_supplicant *wpa_s, u8 dtok, int exponent,
1751c1d255d3SCy Schubert 			int mantissa, u8 min_twt, int setup_cmd, u64 twt,
1752c1d255d3SCy Schubert 			bool requestor, bool trigger, bool implicit,
1753c1d255d3SCy Schubert 			bool flow_type, u8 flow_id, bool protection,
1754c1d255d3SCy Schubert 			u8 twt_channel, u8 control);
1755c1d255d3SCy Schubert int wpas_twt_send_teardown(struct wpa_supplicant *wpa_s, u8 flags);
1756c1d255d3SCy Schubert 
17575b9c547cSRui Paulo void wpas_rrm_reset(struct wpa_supplicant *wpa_s);
17585b9c547cSRui Paulo void wpas_rrm_process_neighbor_rep(struct wpa_supplicant *wpa_s,
17595b9c547cSRui Paulo 				   const u8 *report, size_t report_len);
17605b9c547cSRui Paulo int wpas_rrm_send_neighbor_rep_request(struct wpa_supplicant *wpa_s,
1761780fb4a2SCy Schubert 				       const struct wpa_ssid_value *ssid,
1762780fb4a2SCy Schubert 				       int lci, int civic,
17635b9c547cSRui Paulo 				       void (*cb)(void *ctx,
17645b9c547cSRui Paulo 						  struct wpabuf *neighbor_rep),
17655b9c547cSRui Paulo 				       void *cb_ctx);
1766780fb4a2SCy Schubert void wpas_rrm_handle_radio_measurement_request(struct wpa_supplicant *wpa_s,
176785732ac8SCy Schubert 					       const u8 *src, const u8 *dst,
1768780fb4a2SCy Schubert 					       const u8 *frame, size_t len);
17695b9c547cSRui Paulo void wpas_rrm_handle_link_measurement_request(struct wpa_supplicant *wpa_s,
17705b9c547cSRui Paulo 					      const u8 *src,
17715b9c547cSRui Paulo 					      const u8 *frame, size_t len,
17725b9c547cSRui Paulo 					      int rssi);
177385732ac8SCy Schubert void wpas_rrm_refuse_request(struct wpa_supplicant *wpa_s);
177485732ac8SCy Schubert int wpas_beacon_rep_scan_process(struct wpa_supplicant *wpa_s,
177585732ac8SCy Schubert 				 struct wpa_scan_results *scan_res,
177685732ac8SCy Schubert 				 struct scan_info *info);
177785732ac8SCy Schubert void wpas_clear_beacon_rep_data(struct wpa_supplicant *wpa_s);
177885732ac8SCy Schubert void wpas_flush_fils_hlp_req(struct wpa_supplicant *wpa_s);
1779c1d255d3SCy Schubert void wpas_clear_disabled_interface(void *eloop_ctx, void *timeout_ctx);
1780c1d255d3SCy Schubert void wpa_supplicant_reset_bgscan(struct wpa_supplicant *wpa_s);
1781f05cddf9SRui Paulo 
1782780fb4a2SCy Schubert 
1783780fb4a2SCy Schubert /* MBO functions */
178485732ac8SCy Schubert int wpas_mbo_ie(struct wpa_supplicant *wpa_s, u8 *buf, size_t len,
178585732ac8SCy Schubert 		int add_oce_capa);
178685732ac8SCy Schubert const u8 * mbo_attr_from_mbo_ie(const u8 *mbo_ie, enum mbo_attr_id attr);
1787*a90b9d01SCy Schubert const u8 * wpas_mbo_check_assoc_disallow(struct wpa_bss *bss);
1788c1d255d3SCy Schubert void wpas_mbo_check_pmf(struct wpa_supplicant *wpa_s, struct wpa_bss *bss,
1789c1d255d3SCy Schubert 			struct wpa_ssid *ssid);
17904bc52338SCy Schubert const u8 * mbo_get_attr_from_ies(const u8 *ies, size_t ies_len,
17914bc52338SCy Schubert 				 enum mbo_attr_id attr);
1792780fb4a2SCy Schubert int wpas_mbo_update_non_pref_chan(struct wpa_supplicant *wpa_s,
1793780fb4a2SCy Schubert 				  const char *non_pref_chan);
1794780fb4a2SCy Schubert void wpas_mbo_scan_ie(struct wpa_supplicant *wpa_s, struct wpabuf *ie);
1795780fb4a2SCy Schubert void wpas_mbo_ie_trans_req(struct wpa_supplicant *wpa_s, const u8 *ie,
1796780fb4a2SCy Schubert 			   size_t len);
1797780fb4a2SCy Schubert size_t wpas_mbo_ie_bss_trans_reject(struct wpa_supplicant *wpa_s, u8 *pos,
1798780fb4a2SCy Schubert 				    size_t len,
1799780fb4a2SCy Schubert 				    enum mbo_transition_reject_reason reason);
1800780fb4a2SCy Schubert void wpas_mbo_update_cell_capa(struct wpa_supplicant *wpa_s, u8 mbo_cell_capa);
1801780fb4a2SCy Schubert struct wpabuf * mbo_build_anqp_buf(struct wpa_supplicant *wpa_s,
180285732ac8SCy Schubert 				   struct wpa_bss *bss, u32 mbo_subtypes);
180385732ac8SCy Schubert void mbo_parse_rx_anqp_resp(struct wpa_supplicant *wpa_s,
180485732ac8SCy Schubert 			    struct wpa_bss *bss, const u8 *sa,
180585732ac8SCy Schubert 			    const u8 *data, size_t slen);
18064bc52338SCy Schubert void wpas_update_mbo_connect_params(struct wpa_supplicant *wpa_s);
180785732ac8SCy Schubert 
180885732ac8SCy Schubert /* op_classes.c */
180985732ac8SCy Schubert enum chan_allowed {
18104b72b91aSCy Schubert 	NOT_ALLOWED, NO_IR, RADAR, ALLOWED
181185732ac8SCy Schubert };
181285732ac8SCy Schubert 
1813c1d255d3SCy Schubert enum chan_allowed verify_channel(struct hostapd_hw_modes *mode, u8 op_class,
1814c1d255d3SCy Schubert 				 u8 channel, u8 bw);
18154bc52338SCy Schubert size_t wpas_supp_op_class_ie(struct wpa_supplicant *wpa_s,
18164bc52338SCy Schubert 			     struct wpa_ssid *ssid,
1817c1d255d3SCy Schubert 			     struct wpa_bss *bss, u8 *pos, size_t len);
1818c1d255d3SCy Schubert int * wpas_supp_op_classes(struct wpa_supplicant *wpa_s);
1819780fb4a2SCy Schubert 
1820206b73d0SCy Schubert int wpas_enable_mac_addr_randomization(struct wpa_supplicant *wpa_s,
1821206b73d0SCy Schubert 				       unsigned int type, const u8 *addr,
1822206b73d0SCy Schubert 				       const u8 *mask);
1823206b73d0SCy Schubert int wpas_disable_mac_addr_randomization(struct wpa_supplicant *wpa_s,
1824206b73d0SCy Schubert 					unsigned int type);
1825206b73d0SCy Schubert 
1826f05cddf9SRui Paulo /**
1827f05cddf9SRui Paulo  * wpa_supplicant_ctrl_iface_ctrl_rsp_handle - Handle a control response
1828f05cddf9SRui Paulo  * @wpa_s: Pointer to wpa_supplicant data
1829f05cddf9SRui Paulo  * @ssid: Pointer to the network block the reply is for
1830f05cddf9SRui Paulo  * @field: field the response is a reply for
1831f05cddf9SRui Paulo  * @value: value (ie, password, etc) for @field
1832f05cddf9SRui Paulo  * Returns: 0 on success, non-zero on error
1833f05cddf9SRui Paulo  *
1834f05cddf9SRui Paulo  * Helper function to handle replies to control interface requests.
1835f05cddf9SRui Paulo  */
1836f05cddf9SRui Paulo int wpa_supplicant_ctrl_iface_ctrl_rsp_handle(struct wpa_supplicant *wpa_s,
1837f05cddf9SRui Paulo 					      struct wpa_ssid *ssid,
1838f05cddf9SRui Paulo 					      const char *field,
1839f05cddf9SRui Paulo 					      const char *value);
184039beb93cSSam Leffler 
18415b9c547cSRui Paulo void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
18425b9c547cSRui Paulo 			  const struct wpa_ssid *ssid,
18435b9c547cSRui Paulo 			  struct hostapd_freq_params *freq);
18445b9c547cSRui Paulo 
184539beb93cSSam Leffler /* events.c */
184639beb93cSSam Leffler void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s);
1847f05cddf9SRui Paulo int wpa_supplicant_connect(struct wpa_supplicant *wpa_s,
1848e28a4053SRui Paulo 			   struct wpa_bss *selected,
1849e28a4053SRui Paulo 			   struct wpa_ssid *ssid);
1850f05cddf9SRui Paulo void wpa_supplicant_stop_countermeasures(void *eloop_ctx, void *sock_ctx);
1851f05cddf9SRui Paulo void wpa_supplicant_delayed_mic_error_report(void *eloop_ctx, void *sock_ctx);
1852f05cddf9SRui Paulo void wnm_bss_keep_alive_deinit(struct wpa_supplicant *wpa_s);
18535b9c547cSRui Paulo int wpa_supplicant_fast_associate(struct wpa_supplicant *wpa_s);
1854*a90b9d01SCy Schubert int wpa_wps_supplicant_fast_associate(struct wpa_supplicant *wpa_s);
18555b9c547cSRui Paulo struct wpa_bss * wpa_supplicant_pick_network(struct wpa_supplicant *wpa_s,
18565b9c547cSRui Paulo 					     struct wpa_ssid **selected_ssid);
185785732ac8SCy Schubert int wpas_temp_disabled(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
18584bc52338SCy Schubert void wpa_supplicant_update_channel_list(struct wpa_supplicant *wpa_s,
18594bc52338SCy Schubert 					struct channel_list_changed *info);
1860c1d255d3SCy Schubert int wpa_supplicant_need_to_roam_within_ess(struct wpa_supplicant *wpa_s,
1861c1d255d3SCy Schubert 					   struct wpa_bss *current_bss,
1862c1d255d3SCy Schubert 					   struct wpa_bss *seleceted);
1863*a90b9d01SCy Schubert void wpas_reset_mlo_info(struct wpa_supplicant *wpa_s);
186439beb93cSSam Leffler 
1865e28a4053SRui Paulo /* eap_register.c */
1866e28a4053SRui Paulo int eap_register_methods(void);
186739beb93cSSam Leffler 
1868f05cddf9SRui Paulo /**
1869325151a3SRui Paulo  * Utility method to tell if a given network is for persistent group storage
1870f05cddf9SRui Paulo  * @ssid: Network object
1871f05cddf9SRui Paulo  * Returns: 1 if network is a persistent group, 0 otherwise
1872f05cddf9SRui Paulo  */
network_is_persistent_group(struct wpa_ssid * ssid)1873f05cddf9SRui Paulo static inline int network_is_persistent_group(struct wpa_ssid *ssid)
1874f05cddf9SRui Paulo {
1875325151a3SRui Paulo 	return ssid->disabled == 2 && ssid->p2p_persistent_group;
1876f05cddf9SRui Paulo }
1877f05cddf9SRui Paulo 
1878206b73d0SCy Schubert 
wpas_mode_to_ieee80211_mode(enum wpas_mode mode)1879206b73d0SCy Schubert static inline int wpas_mode_to_ieee80211_mode(enum wpas_mode mode)
1880206b73d0SCy Schubert {
1881206b73d0SCy Schubert 	switch (mode) {
1882206b73d0SCy Schubert 	default:
1883206b73d0SCy Schubert 	case WPAS_MODE_INFRA:
1884206b73d0SCy Schubert 		return IEEE80211_MODE_INFRA;
1885206b73d0SCy Schubert 	case WPAS_MODE_IBSS:
1886206b73d0SCy Schubert 		return IEEE80211_MODE_IBSS;
1887206b73d0SCy Schubert 	case WPAS_MODE_AP:
1888206b73d0SCy Schubert 	case WPAS_MODE_P2P_GO:
1889206b73d0SCy Schubert 	case WPAS_MODE_P2P_GROUP_FORMATION:
1890206b73d0SCy Schubert 		return IEEE80211_MODE_AP;
1891206b73d0SCy Schubert 	case WPAS_MODE_MESH:
1892206b73d0SCy Schubert 		return IEEE80211_MODE_MESH;
1893206b73d0SCy Schubert 	}
1894206b73d0SCy Schubert }
1895206b73d0SCy Schubert 
1896206b73d0SCy Schubert 
1897f05cddf9SRui Paulo int wpas_network_disabled(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
18985b9c547cSRui Paulo int wpas_get_ssid_pmf(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
18994b72b91aSCy Schubert int pmf_in_use(struct wpa_supplicant *wpa_s, const u8 *addr);
1900*a90b9d01SCy Schubert void wpa_s_setup_sae_pt(struct wpa_config *conf, struct wpa_ssid *ssid,
1901*a90b9d01SCy Schubert 			bool force);
1902*a90b9d01SCy Schubert void wpa_s_clear_sae_rejected(struct wpa_supplicant *wpa_s);
1903*a90b9d01SCy Schubert 
1904*a90b9d01SCy Schubert bool wpas_is_sae_avoided(struct wpa_supplicant *wpa_s,
1905*a90b9d01SCy Schubert 			struct wpa_ssid *ssid,
1906*a90b9d01SCy Schubert 			const struct wpa_ie_data *ie);
1907f05cddf9SRui Paulo 
1908f05cddf9SRui Paulo int wpas_init_ext_pw(struct wpa_supplicant *wpa_s);
1909f05cddf9SRui Paulo 
19105b9c547cSRui Paulo void dump_freq_data(struct wpa_supplicant *wpa_s, const char *title,
19115b9c547cSRui Paulo 		    struct wpa_used_freq_data *freqs_data,
19125b9c547cSRui Paulo 		    unsigned int len);
19135b9c547cSRui Paulo 
19145b9c547cSRui Paulo int get_shared_radio_freqs_data(struct wpa_supplicant *wpa_s,
19155b9c547cSRui Paulo 				struct wpa_used_freq_data *freqs_data,
1916*a90b9d01SCy Schubert 				unsigned int len, bool exclude_current);
19175b9c547cSRui Paulo int get_shared_radio_freqs(struct wpa_supplicant *wpa_s,
1918*a90b9d01SCy Schubert 			   int *freq_array, unsigned int len,
1919*a90b9d01SCy Schubert 			   bool exclude_current);
1920*a90b9d01SCy Schubert int disabled_freq(struct wpa_supplicant *wpa_s, int freq);
19215b9c547cSRui Paulo 
1922325151a3SRui Paulo void wpas_network_reenabled(void *eloop_ctx, void *timeout_ctx);
1923325151a3SRui Paulo 
1924780fb4a2SCy Schubert void wpas_vendor_elem_update(struct wpa_supplicant *wpa_s);
1925780fb4a2SCy Schubert struct wpa_supplicant * wpas_vendor_elem(struct wpa_supplicant *wpa_s,
1926780fb4a2SCy Schubert 					 enum wpa_vendor_elem_frame frame);
1927780fb4a2SCy Schubert int wpas_vendor_elem_remove(struct wpa_supplicant *wpa_s, int frame,
1928780fb4a2SCy Schubert 			    const u8 *elem, size_t len);
1929780fb4a2SCy Schubert 
1930325151a3SRui Paulo #ifdef CONFIG_FST
1931325151a3SRui Paulo 
1932325151a3SRui Paulo struct fst_wpa_obj;
1933325151a3SRui Paulo 
1934325151a3SRui Paulo void fst_wpa_supplicant_fill_iface_obj(struct wpa_supplicant *wpa_s,
1935325151a3SRui Paulo 				       struct fst_wpa_obj *iface_obj);
1936325151a3SRui Paulo 
1937325151a3SRui Paulo #endif /* CONFIG_FST */
1938325151a3SRui Paulo 
1939780fb4a2SCy Schubert int wpas_sched_scan_plans_set(struct wpa_supplicant *wpa_s, const char *cmd);
1940780fb4a2SCy Schubert 
1941780fb4a2SCy Schubert struct hostapd_hw_modes * get_mode(struct hostapd_hw_modes *modes,
1942c1d255d3SCy Schubert 				   u16 num_modes, enum hostapd_hw_mode mode,
1943c1d255d3SCy Schubert 				   bool is_6ghz);
1944c1d255d3SCy Schubert struct hostapd_hw_modes * get_mode_with_freq(struct hostapd_hw_modes *modes,
1945c1d255d3SCy Schubert 					     u16 num_modes, int freq);
1946780fb4a2SCy Schubert 
1947780fb4a2SCy Schubert void wpa_bss_tmp_disallow(struct wpa_supplicant *wpa_s, const u8 *bssid,
19484bc52338SCy Schubert 			  unsigned int sec, int rssi_threshold);
19494bc52338SCy Schubert int wpa_is_bss_tmp_disallowed(struct wpa_supplicant *wpa_s,
19504bc52338SCy Schubert 			      struct wpa_bss *bss);
19514bc52338SCy Schubert void free_bss_tmp_disallowed(struct wpa_supplicant *wpa_s);
1952780fb4a2SCy Schubert 
1953780fb4a2SCy Schubert struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
1954780fb4a2SCy Schubert 				     int i, struct wpa_bss *bss,
1955780fb4a2SCy Schubert 				     struct wpa_ssid *group,
195685732ac8SCy Schubert 				     int only_first_ssid, int debug_print);
195785732ac8SCy Schubert 
195885732ac8SCy Schubert int wpas_ctrl_iface_get_pref_freq_list_override(struct wpa_supplicant *wpa_s,
195985732ac8SCy Schubert 						enum wpa_driver_if_type if_type,
196085732ac8SCy Schubert 						unsigned int *num,
1961*a90b9d01SCy Schubert 						struct weighted_pcl *freq_list);
196285732ac8SCy Schubert 
196385732ac8SCy Schubert int wpa_is_fils_supported(struct wpa_supplicant *wpa_s);
196485732ac8SCy Schubert int wpa_is_fils_sk_pfs_supported(struct wpa_supplicant *wpa_s);
1965780fb4a2SCy Schubert 
1966c1d255d3SCy Schubert void wpas_clear_driver_signal_override(struct wpa_supplicant *wpa_s);
1967c1d255d3SCy Schubert 
1968c1d255d3SCy Schubert int wpas_send_mscs_req(struct wpa_supplicant *wpa_s);
1969c1d255d3SCy Schubert void wpas_populate_mscs_descriptor_ie(struct robust_av_data *robust_av,
1970c1d255d3SCy Schubert 				      struct wpabuf *buf);
1971c1d255d3SCy Schubert void wpas_handle_robust_av_recv_action(struct wpa_supplicant *wpa_s,
1972c1d255d3SCy Schubert 				       const u8 *src, const u8 *buf,
1973c1d255d3SCy Schubert 				       size_t len);
1974c1d255d3SCy Schubert void wpas_handle_assoc_resp_mscs(struct wpa_supplicant *wpa_s, const u8 *bssid,
1975c1d255d3SCy Schubert 				 const u8 *ies, size_t ies_len);
19764b72b91aSCy Schubert int wpas_send_scs_req(struct wpa_supplicant *wpa_s);
19774b72b91aSCy Schubert void free_up_tclas_elem(struct scs_desc_elem *elem);
19784b72b91aSCy Schubert void free_up_scs_desc(struct scs_robust_av_data *data);
19794b72b91aSCy Schubert void wpas_handle_robust_av_scs_recv_action(struct wpa_supplicant *wpa_s,
19804b72b91aSCy Schubert 					   const u8 *src, const u8 *buf,
19814b72b91aSCy Schubert 					   size_t len);
19824b72b91aSCy Schubert void wpas_scs_deinit(struct wpa_supplicant *wpa_s);
19834b72b91aSCy Schubert void wpas_handle_qos_mgmt_recv_action(struct wpa_supplicant *wpa_s,
19844b72b91aSCy Schubert 				      const u8 *src,
19854b72b91aSCy Schubert 				      const u8 *buf, size_t len);
19864b72b91aSCy Schubert void wpas_dscp_deinit(struct wpa_supplicant *wpa_s);
19874b72b91aSCy Schubert int wpas_send_dscp_response(struct wpa_supplicant *wpa_s,
19884b72b91aSCy Schubert 			    struct dscp_resp_data *resp_data);
19894b72b91aSCy Schubert void wpas_handle_assoc_resp_qos_mgmt(struct wpa_supplicant *wpa_s,
19904b72b91aSCy Schubert 				     const u8 *ies, size_t ies_len);
19914b72b91aSCy Schubert int wpas_send_dscp_query(struct wpa_supplicant *wpa_s, const char *domain_name,
19924b72b91aSCy Schubert 			 size_t domain_name_length);
1993c1d255d3SCy Schubert 
1994*a90b9d01SCy Schubert int wpas_pasn_auth_start(struct wpa_supplicant *wpa_s, const u8 *own_addr,
1995c1d255d3SCy Schubert 			 const u8 *bssid, int akmp, int cipher,
1996c1d255d3SCy Schubert 			 u16 group, int network_id,
1997c1d255d3SCy Schubert 			 const u8 *comeback, size_t comeback_len);
1998c1d255d3SCy Schubert void wpas_pasn_auth_stop(struct wpa_supplicant *wpa_s);
1999c1d255d3SCy Schubert int wpas_pasn_auth_tx_status(struct wpa_supplicant *wpa_s,
2000c1d255d3SCy Schubert 			     const u8 *data, size_t data_len, u8 acked);
2001c1d255d3SCy Schubert int wpas_pasn_auth_rx(struct wpa_supplicant *wpa_s,
2002c1d255d3SCy Schubert 		      const struct ieee80211_mgmt *mgmt, size_t len);
2003c1d255d3SCy Schubert 
2004*a90b9d01SCy Schubert int wpas_pasn_deauthenticate(struct wpa_supplicant *wpa_s, const u8 *own_addr,
2005*a90b9d01SCy Schubert 			     const u8 *bssid);
2006*a90b9d01SCy Schubert void wpas_pasn_auth_trigger(struct wpa_supplicant *wpa_s,
2007*a90b9d01SCy Schubert 			    struct pasn_auth *pasn_auth);
2008*a90b9d01SCy Schubert void wpas_pasn_auth_work_done(struct wpa_supplicant *wpa_s, int status);
2009*a90b9d01SCy Schubert bool wpas_is_6ghz_supported(struct wpa_supplicant *wpa_s, bool only_enabled);
2010*a90b9d01SCy Schubert 
2011*a90b9d01SCy Schubert bool wpa_is_non_eht_scs_traffic_desc_supported(struct wpa_bss *bss);
2012*a90b9d01SCy Schubert bool wpas_ap_link_address(struct wpa_supplicant *wpa_s, const u8 *addr);
2013c1d255d3SCy Schubert 
201439beb93cSSam Leffler #endif /* WPA_SUPPLICANT_I_H */
2015