• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * wpa_supplicant - Internal definitions
3  * Copyright (c) 2003-2014, Jouni Malinen <j@w1.fi>
4  *
5  * This software may be distributed under the terms of the BSD license.
6  * See README for more details.
7  */
8 
9 #ifndef WPA_SUPPLICANT_I_H
10 #define WPA_SUPPLICANT_I_H
11 #ifdef LOS_WPA_PATCH
12 #include "utils/common.h"
13 #include "drivers/driver.h"
14 #endif /* LOS_WPA_PATCH */
15 #include "utils/bitfield.h"
16 #include "utils/list.h"
17 #include "common/defs.h"
18 #include "common/sae.h"
19 #include "common/wpa_ctrl.h"
20 #include "crypto/sha384.h"
21 #include "eapol_supp/eapol_supp_sm.h"
22 #include "wps/wps_defs.h"
23 #include "config_ssid.h"
24 
25 #include "wmm_ac.h"
26 
27 #include "wifi_api.h"
28 
29 #ifdef CONFIG_SSID_RECONNECT
30 extern int g_ssid_reconn_count;
31 extern int g_ssid_reconn_max_count;
32 extern struct wpa_bss **g_conf_aps_bssid;
33 #endif
34 
35 extern const char *const wpa_supplicant_version;
36 extern const char *const wpa_supplicant_license;
37 #ifndef CONFIG_NO_STDOUT_DEBUG
38 extern const char *const wpa_supplicant_full_license1;
39 extern const char *const wpa_supplicant_full_license2;
40 extern const char *const wpa_supplicant_full_license3;
41 extern const char *const wpa_supplicant_full_license4;
42 extern const char *const wpa_supplicant_full_license5;
43 #endif /* CONFIG_NO_STDOUT_DEBUG */
44 
45 struct wpa_sm;
46 struct wpa_supplicant;
47 struct ibss_rsn;
48 struct scan_info;
49 struct wpa_bss;
50 struct wpa_scan_results;
51 struct hostapd_hw_modes;
52 struct wpa_driver_associate_params;
53 struct wpa_cred;
54 
55 /*
56  * Forward declarations of private structures used within the ctrl_iface
57  * backends. Other parts of wpa_supplicant do not have access to data stored in
58  * these structures.
59  */
60 struct ctrl_iface_priv;
61 struct ctrl_iface_global_priv;
62 struct wpas_dbus_priv;
63 struct wpas_binder_priv;
64 
65 /**
66  * struct wpa_interface - Parameters for wpa_supplicant_add_iface()
67  */
68 struct wpa_interface {
69 #ifndef EXT_CODE_CROP
70 	/**
71 	 * confname - Configuration name (file or profile) name
72 	 *
73 	 * This can also be %NULL when a configuration file is not used. In
74 	 * that case, ctrl_interface must be set to allow the interface to be
75 	 * configured.
76 	 */
77 	const char *confname;
78 
79 	/**
80 	 * confanother - Additional configuration name (file or profile) name
81 	 *
82 	 * This can also be %NULL when the additional configuration file is not
83 	 * used.
84 	 */
85 	const char *confanother;
86 #endif /* EXT_CODE_CROP */
87 
88 	/**
89 	 * ctrl_interface - Control interface parameter
90 	 *
91 	 * If a configuration file is not used, this variable can be used to
92 	 * set the ctrl_interface parameter that would have otherwise been read
93 	 * from the configuration file. If both confname and ctrl_interface are
94 	 * set, ctrl_interface is used to override the value from configuration
95 	 * file.
96 	 */
97 	const char *ctrl_interface;
98 
99 	/**
100 	 * driver - Driver interface name, or %NULL to use the default driver
101 	 */
102 	const char *driver;
103 
104 	/**
105 	 * driver_param - Driver interface parameters
106 	 *
107 	 * If a configuration file is not used, this variable can be used to
108 	 * set the driver_param parameters that would have otherwise been read
109 	 * from the configuration file. If both confname and driver_param are
110 	 * set, driver_param is used to override the value from configuration
111 	 * file.
112 	 */
113 	const char *driver_param;
114 
115 	/**
116 	 * ifname - Interface name
117 	 */
118 	const char *ifname;
119 
120 	/**
121 	 * bridge_ifname - Optional bridge interface name
122 	 *
123 	 * If the driver interface (ifname) is included in a Linux bridge
124 	 * device, the bridge interface may need to be used for receiving EAPOL
125 	 * frames. This can be enabled by setting this variable to enable
126 	 * receiving of EAPOL frames from an additional interface.
127 	 */
128 	const char *bridge_ifname;
129 
130 	/**
131 	 * p2p_mgmt - Interface used for P2P management (P2P Device operations)
132 	 *
133 	 * Indicates whether wpas_p2p_init() must be called for this interface.
134 	 * This is used only when the driver supports a dedicated P2P Device
135 	 * interface that is not a network interface.
136 	 */
137 	int p2p_mgmt;
138 
139 #ifdef CONFIG_MATCH_IFACE
140 	/**
141 	 * matched - Interface was matched rather than specified
142 	 *
143 	 */
144 	enum {
145 		WPA_IFACE_NOT_MATCHED,
146 		WPA_IFACE_MATCHED_NULL,
147 		WPA_IFACE_MATCHED
148 	} matched;
149 #endif /* CONFIG_MATCH_IFACE */
150 };
151 
152 /**
153  * struct wpa_params - Parameters for wpa_supplicant_init()
154  */
155 struct wpa_params {
156 	/**
157 	 * daemonize - Run %wpa_supplicant in the background
158 	 */
159 	int daemonize;
160 
161 	/**
162 	 * wait_for_monitor - Wait for a monitor program before starting
163 	 */
164 	int wait_for_monitor;
165 
166 	/**
167 	 * pid_file - Path to a PID (process ID) file
168 	 *
169 	 * If this and daemonize are set, process ID of the background process
170 	 * will be written to the specified file.
171 	 */
172 	char *pid_file;
173 
174 	/**
175 	 * wpa_debug_level - Debugging verbosity level (e.g., MSG_INFO)
176 	 */
177 	int wpa_debug_level;
178 
179 	/**
180 	 * wpa_debug_show_keys - Whether keying material is included in debug
181 	 *
182 	 * This parameter can be used to allow keying material to be included
183 	 * in debug messages. This is a security risk and this option should
184 	 * not be enabled in normal configuration. If needed during
185 	 * development or while troubleshooting, this option can provide more
186 	 * details for figuring out what is happening.
187 	 */
188 	int wpa_debug_show_keys;
189 
190 	/**
191 	 * wpa_debug_timestamp - Whether to include timestamp in debug messages
192 	 */
193 	int wpa_debug_timestamp;
194 
195 	/**
196 	 * ctrl_interface - Global ctrl_iface path/parameter
197 	 */
198 	char *ctrl_interface;
199 
200 	/**
201 	 * ctrl_interface_group - Global ctrl_iface group
202 	 */
203 	char *ctrl_interface_group;
204 
205 	/**
206 	 * dbus_ctrl_interface - Enable the DBus control interface
207 	 */
208 	int dbus_ctrl_interface;
209 
210 	/**
211 	 * wpa_debug_file_path - Path of debug file or %NULL to use stdout
212 	 */
213 	const char *wpa_debug_file_path;
214 
215 	/**
216 	 * wpa_debug_syslog - Enable log output through syslog
217 	 */
218 	int wpa_debug_syslog;
219 
220 	/**
221 	 * wpa_debug_tracing - Enable log output through Linux tracing
222 	 */
223 	int wpa_debug_tracing;
224 
225 	/**
226 	 * override_driver - Optional driver parameter override
227 	 *
228 	 * This parameter can be used to override the driver parameter in
229 	 * dynamic interface addition to force a specific driver wrapper to be
230 	 * used instead.
231 	 */
232 	char *override_driver;
233 
234 	/**
235 	 * override_ctrl_interface - Optional ctrl_interface override
236 	 *
237 	 * This parameter can be used to override the ctrl_interface parameter
238 	 * in dynamic interface addition to force a control interface to be
239 	 * created.
240 	 */
241 	char *override_ctrl_interface;
242 
243 	/**
244 	 * entropy_file - Optional entropy file
245 	 *
246 	 * This parameter can be used to configure wpa_supplicant to maintain
247 	 * its internal entropy store over restarts.
248 	 */
249 	char *entropy_file;
250 
251 #ifdef CONFIG_P2P
252 	/**
253 	 * conf_p2p_dev - Configuration file used to hold the
254 	 * P2P Device configuration parameters.
255 	 *
256 	 * This can also be %NULL. In such a case, if a P2P Device dedicated
257 	 * interfaces is created, the main configuration file will be used.
258 	 */
259 	char *conf_p2p_dev;
260 #endif /* CONFIG_P2P */
261 
262 #ifdef CONFIG_MATCH_IFACE
263 	/**
264 	 * match_ifaces - Interface descriptions to match
265 	 */
266 	struct wpa_interface *match_ifaces;
267 
268 	/**
269 	 * match_iface_count - Number of defined matching interfaces
270 	 */
271 	int match_iface_count;
272 #endif /* CONFIG_MATCH_IFACE */
273 };
274 
275 struct p2p_srv_bonjour {
276 	struct dl_list list;
277 	struct wpabuf *query;
278 	struct wpabuf *resp;
279 };
280 
281 struct p2p_srv_upnp {
282 	struct dl_list list;
283 	u8 version;
284 	char *service;
285 };
286 
287 /**
288  * struct wpa_global - Internal, global data for all %wpa_supplicant interfaces
289  *
290  * This structure is initialized by calling wpa_supplicant_init() when starting
291  * %wpa_supplicant.
292  */
293 struct wpa_global {
294 	struct wpa_supplicant *ifaces;
295 	struct wpa_params params;
296 	struct ctrl_iface_global_priv *ctrl_iface;
297 	struct wpas_dbus_priv *dbus;
298 	struct wpas_binder_priv *binder;
299 	void **drv_priv;
300 	size_t drv_count;
301 	struct os_time suspend_time;
302 #ifdef CONFIG_P2P
303 	struct p2p_data *p2p;
304 	struct wpa_supplicant *p2p_init_wpa_s;
305 	struct wpa_supplicant *p2p_group_formation;
306 	struct wpa_supplicant *p2p_invite_group;
307 	u8 p2p_dev_addr[ETH_ALEN];
308 	struct os_reltime p2p_go_wait_client;
309 	struct dl_list p2p_srv_bonjour; /* struct p2p_srv_bonjour */
310 	struct dl_list p2p_srv_upnp; /* struct p2p_srv_upnp */
311 	int p2p_disabled;
312 	int cross_connection;
313 	int p2p_long_listen; /* remaining time in long Listen state in ms */
314 	struct wpa_freq_range_list p2p_disallow_freq;
315 	struct wpa_freq_range_list p2p_go_avoid_freq;
316 	enum wpa_conc_pref {
317 		WPA_CONC_PREF_NOT_SET,
318 		WPA_CONC_PREF_STA,
319 		WPA_CONC_PREF_P2P
320 	} conc_pref;
321 	unsigned int p2p_per_sta_psk:1;
322 	unsigned int p2p_fail_on_wps_complete:1;
323 	unsigned int p2p_24ghz_social_channels:1;
324 	unsigned int pending_p2ps_group:1;
325 	unsigned int pending_group_iface_for_p2ps:1;
326 	unsigned int pending_p2ps_group_freq;
327 
328 #ifdef CONFIG_WIFI_DISPLAY
329 	int wifi_display;
330 #define MAX_WFD_SUBELEMS 12
331 	struct wpabuf *wfd_subelem[MAX_WFD_SUBELEMS];
332 #endif /* CONFIG_WIFI_DISPLAY */
333 
334 	struct psk_list_entry *add_psk; /* From group formation */
335 #endif /* CONFIG_P2P */
336 };
337 
338 
339 /**
340  * struct wpa_radio - Internal data for per-radio information
341  *
342  * This structure is used to share data about configured interfaces
343  * (struct wpa_supplicant) that share the same physical radio, e.g., to allow
344  * better coordination of offchannel operations.
345  */
346 struct wpa_radio {
347 	char name[16]; /* from driver_ops get_radio_name() or empty if not
348 			* available */
349 	/** NULL if no external scan running. */
350 	struct wpa_supplicant *external_scan_req_interface;
351 	unsigned int num_active_works;
352 	struct dl_list ifaces; /* struct wpa_supplicant::radio_list entries */
353 	struct dl_list work; /* struct wpa_radio_work::list entries */
354 };
355 
356 /**
357  * Checks whether an external scan is running on a given radio.
358  * @radio: Pointer to radio struct
359  * Returns: true if an external scan is running, false otherwise.
360  */
external_scan_running(struct wpa_radio * radio)361 static inline bool external_scan_running(struct wpa_radio *radio)
362 {
363 	return radio && radio->external_scan_req_interface;
364 }
365 
366 #define MAX_ACTIVE_WORKS 2
367 
368 
369 /**
370  * struct wpa_radio_work - Radio work item
371  */
372 struct wpa_radio_work {
373 	struct dl_list list;
374 	unsigned int freq; /* known frequency (MHz) or 0 for multiple/unknown */
375 	const char *type;
376 	struct wpa_supplicant *wpa_s;
377 	void (*cb)(struct wpa_radio_work *work, int deinit);
378 	void *ctx;
379 	unsigned int started:1;
380 	struct os_reltime time;
381 	unsigned int bands;
382 };
383 
384 int radio_add_work(struct wpa_supplicant *wpa_s, unsigned int freq,
385 		   const char *type, int next,
386 		   void (*cb)(struct wpa_radio_work *work, int deinit),
387 		   void *ctx);
388 void radio_work_done(struct wpa_radio_work *work);
389 void radio_remove_works(struct wpa_supplicant *wpa_s,
390 			const char *type, int remove_all);
391 void radio_remove_pending_work(struct wpa_supplicant *wpa_s, void *ctx);
392 void radio_work_check_next(struct wpa_supplicant *wpa_s);
393 struct wpa_radio_work *
394 radio_work_pending(struct wpa_supplicant *wpa_s, const char *type);
395 
396 struct wpa_connect_work {
397 	unsigned int sme:1;
398 	unsigned int bss_removed:1;
399 	struct wpa_bss *bss;
400 	struct wpa_ssid *ssid;
401 };
402 
403 int wpas_valid_bss_ssid(struct wpa_supplicant *wpa_s, struct wpa_bss *test_bss,
404 			struct wpa_ssid *test_ssid);
405 void wpas_connect_work_free(struct wpa_connect_work *cwork);
406 void wpas_connect_work_done(struct wpa_supplicant *wpa_s);
407 
408 struct wpa_external_work {
409 	unsigned int id;
410 	char type[100];
411 	unsigned int timeout;
412 };
413 
414 enum wpa_radio_work_band wpas_freq_to_band(int freq);
415 unsigned int wpas_get_bands(struct wpa_supplicant *wpa_s, const int *freqs);
416 
417 /**
418  * offchannel_send_action_result - Result of offchannel send Action frame
419  */
420 enum offchannel_send_action_result {
421 	OFFCHANNEL_SEND_ACTION_SUCCESS /**< Frame was send and acknowledged */,
422 	OFFCHANNEL_SEND_ACTION_NO_ACK /**< Frame was sent, but not acknowledged
423 				       */,
424 	OFFCHANNEL_SEND_ACTION_FAILED /**< Frame was not sent due to a failure
425 				       */
426 };
427 
428 struct wps_ap_info {
429 	u8 bssid[ETH_ALEN];
430 	enum wps_ap_info_type {
431 		WPS_AP_NOT_SEL_REG,
432 		WPS_AP_SEL_REG,
433 		WPS_AP_SEL_REG_OUR
434 	} type;
435 	unsigned int tries;
436 	struct os_reltime last_attempt;
437 	unsigned int pbc_active;
438 	u8 uuid[WPS_UUID_LEN];
439 };
440 
441 #define WPA_FREQ_USED_BY_INFRA_STATION BIT(0)
442 #define WPA_FREQ_USED_BY_P2P_CLIENT BIT(1)
443 
444 struct wpa_used_freq_data {
445 	int freq;
446 	unsigned int flags;
447 };
448 
449 #define RRM_NEIGHBOR_REPORT_TIMEOUT 1 /* 1 second for AP to send a report */
450 
451 /*
452  * struct rrm_data - Data used for managing RRM features
453  */
454 struct rrm_data {
455 	/* rrm_used - indication regarding the current connection */
456 	unsigned int rrm_used:1;
457 
458 	/*
459 	 * notify_neighbor_rep - Callback for notifying report requester
460 	 */
461 	void (*notify_neighbor_rep)(void *ctx, struct wpabuf *neighbor_rep);
462 
463 	/*
464 	 * neighbor_rep_cb_ctx - Callback context
465 	 * Received in the callback registration, and sent to the callback
466 	 * function as a parameter.
467 	 */
468 	void *neighbor_rep_cb_ctx;
469 
470 	/* next_neighbor_rep_token - Next request's dialog token */
471 	u8 next_neighbor_rep_token;
472 
473 	/* token - Dialog token of the current radio measurement */
474 	u8 token;
475 
476 	/* destination address of the current radio measurement request */
477 	u8 dst_addr[ETH_ALEN];
478 };
479 
480 enum wpa_supplicant_test_failure {
481 	WPAS_TEST_FAILURE_NONE,
482 	WPAS_TEST_FAILURE_SCAN_TRIGGER,
483 };
484 
485 struct icon_entry {
486 	struct dl_list list;
487 	u8 bssid[ETH_ALEN];
488 	u8 dialog_token;
489 	char *file_name;
490 	u8 *image;
491 	size_t image_len;
492 };
493 
494 struct wpa_bss_tmp_disallowed {
495 	struct dl_list list;
496 	u8 bssid[ETH_ALEN];
497 	int rssi_threshold;
498 };
499 
500 struct beacon_rep_data {
501 	u8 token;
502 	u8 last_indication;
503 	struct wpa_driver_scan_params scan_params;
504 	u8 ssid[SSID_MAX_LEN];
505 	size_t ssid_len;
506 	u8 bssid[ETH_ALEN];
507 	enum beacon_report_detail report_detail;
508 	struct bitfield *eids;
509 };
510 
511 
512 struct external_pmksa_cache {
513 	struct dl_list list;
514 	void *pmksa_cache;
515 };
516 
517 struct fils_hlp_req {
518 	struct dl_list list;
519 	u8 dst[ETH_ALEN];
520 	struct wpabuf *pkt;
521 };
522 
523 struct driver_signal_override {
524 	struct dl_list list;
525 	u8 bssid[ETH_ALEN];
526 	int si_current_signal;
527 	int si_avg_signal;
528 	int si_avg_beacon_signal;
529 	int si_current_noise;
530 	int scan_level;
531 };
532 
533 struct robust_av_data {
534 	u8 dialog_token;
535 	enum scs_request_type request_type;
536 	u8 up_bitmap;
537 	u8 up_limit;
538 	u32 stream_timeout;
539 	u8 frame_classifier[48];
540 	size_t frame_classifier_len;
541 	bool valid_config;
542 };
543 
544 struct dscp_policy_status {
545 	u8 id;
546 	u8 status;
547 };
548 
549 struct dscp_resp_data {
550 	bool more;
551 	bool reset;
552 	bool solicited;
553 	struct dscp_policy_status *policy;
554 	int num_policies;
555 };
556 
557 #ifdef CONFIG_PASN
558 
559 struct pasn_fils {
560 	u8 nonce[FILS_NONCE_LEN];
561 	u8 anonce[FILS_NONCE_LEN];
562 	u8 session[FILS_SESSION_LEN];
563 	u8 erp_pmkid[PMKID_LEN];
564 	bool completed;
565 };
566 
567 struct wpas_pasn {
568 	int akmp;
569 	int cipher;
570 	u16 group;
571 	int freq;
572 	size_t kdk_len;
573 
574 	u8 trans_seq;
575 	u8 status;
576 
577 	u8 bssid[ETH_ALEN];
578 	size_t pmk_len;
579 	u8 pmk[PMK_LEN_MAX];
580 	bool using_pmksa;
581 
582 	u8 hash[SHA384_MAC_LEN];
583 
584 	struct wpabuf *beacon_rsne_rsnxe;
585 	struct wpa_ptk ptk;
586 	struct crypto_ecdh *ecdh;
587 
588 	struct wpabuf *comeback;
589 	u16 comeback_after;
590 
591 #ifdef CONFIG_SAE
592 	struct sae_data sae;
593 #endif /* CONFIG_SAE */
594 
595 	struct wpa_ssid *ssid;
596 
597 #ifdef CONFIG_FILS
598 	struct pasn_fils fils;
599 #endif /* CONFIG_FILS */
600 
601 #ifdef CONFIG_IEEE80211R
602 	u8 pmk_r1[PMK_LEN_MAX];
603 	size_t pmk_r1_len;
604 	u8 pmk_r1_name[WPA_PMK_NAME_LEN];
605 #endif /* CONFIG_IEEE80211R */
606 };
607 #endif /* CONFIG_PASN */
608 
609 
610 enum ip_version {
611 	IPV4 = 4,
612 	IPV6 = 6,
613 };
614 
615 
616 struct ipv4_params {
617 	struct in_addr src_ip;
618 	struct in_addr dst_ip;
619 	u16 src_port;
620 	u16 dst_port;
621 	u8 dscp;
622 	u8 protocol;
623 	u8 param_mask;
624 };
625 
626 
627 struct ipv6_params {
628 	struct in6_addr src_ip;
629 	struct in6_addr dst_ip;
630 	u16 src_port;
631 	u16 dst_port;
632 	u8 dscp;
633 	u8 next_header;
634 	u8 flow_label[3];
635 	u8 param_mask;
636 };
637 
638 
639 struct type4_params {
640 	u8 classifier_mask;
641 	enum ip_version ip_version;
642 	union {
643 		struct ipv4_params v4;
644 		struct ipv6_params v6;
645 	} ip_params;
646 };
647 
648 
649 struct type10_params {
650 	u8 prot_instance;
651 	u8 prot_number;
652 	u8 *filter_value;
653 	u8 *filter_mask;
654 	size_t filter_len;
655 };
656 
657 
658 struct tclas_element {
659 	u8 user_priority;
660 	u8 classifier_type;
661 	union {
662 		struct type4_params type4_param;
663 		struct type10_params type10_param;
664 	} frame_classifier;
665 };
666 
667 
668 struct scs_desc_elem {
669 	u8 scs_id;
670 	enum scs_request_type request_type;
671 	u8 intra_access_priority;
672 	bool scs_up_avail;
673 	struct tclas_element *tclas_elems;
674 	unsigned int num_tclas_elem;
675 	u8 tclas_processing;
676 };
677 
678 
679 struct scs_robust_av_data {
680 	struct scs_desc_elem *scs_desc_elems;
681 	unsigned int num_scs_desc;
682 };
683 
684 
685 enum scs_response_status {
686 	SCS_DESC_SENT = 0,
687 	SCS_DESC_SUCCESS = 1,
688 };
689 
690 
691 struct active_scs_elem {
692 	struct dl_list list;
693 	u8 scs_id;
694 	enum scs_response_status status;
695 };
696 
697 
698 /**
699  * struct wpa_supplicant - Internal data for wpa_supplicant interface
700  *
701  * This structure contains the internal data for core wpa_supplicant code. This
702  * should be only used directly from the core code. However, a pointer to this
703  * data is used from other files as an arbitrary context pointer in calls to
704  * core functions.
705  */
706 struct wpa_supplicant {
707 	struct wpa_global *global;
708 	struct wpa_radio *radio; /* shared radio context */
709 	struct dl_list radio_list; /* list head: struct wpa_radio::ifaces */
710 	struct wpa_supplicant *parent;
711 	struct wpa_supplicant *p2pdev;
712 	struct wpa_supplicant *next;
713 	struct l2_packet_data *l2;
714 	struct l2_packet_data *l2_br;
715 	struct os_reltime roam_start;
716 	struct os_reltime roam_time;
717 	struct os_reltime session_start;
718 	struct os_reltime session_length;
719 	unsigned char own_addr[ETH_ALEN];
720 	unsigned char perm_addr[ETH_ALEN];
721 	char ifname[100];
722 #ifdef CONFIG_MATCH_IFACE
723 	int matched;
724 #endif /* CONFIG_MATCH_IFACE */
725 #ifdef CONFIG_CTRL_IFACE_DBUS_NEW
726 	char *dbus_new_path;
727 	char *dbus_groupobj_path;
728 #ifdef CONFIG_AP
729 	char *preq_notify_peer;
730 #endif /* CONFIG_AP */
731 #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
732 #ifdef CONFIG_CTRL_IFACE_BINDER
733 	const void *binder_object_key;
734 #endif /* CONFIG_CTRL_IFACE_BINDER */
735     struct wapi_asue_struct *wapi;
736 	char bridge_ifname[16];
737 
738 	char *confname;
739 	char *confanother;
740 
741 	struct wpa_config *conf;
742 	int countermeasures;
743 	struct os_reltime last_michael_mic_error;
744 	u8 bssid[ETH_ALEN];
745 	u8 pending_bssid[ETH_ALEN]; /* If wpa_state == WPA_ASSOCIATING, this
746 				     * field contains the target BSSID. */
747 	int reassociate; /* reassociation requested */
748 	bool roam_in_progress; /* roam in progress */
749 	unsigned int reassoc_same_bss:1; /* reassociating to the same BSS */
750 	unsigned int reassoc_same_ess:1; /* reassociating to the same ESS */
751 	int disconnected; /* all connections disabled; i.e., do no reassociate
752 			   * before this has been cleared */
753 	struct wpa_ssid *current_ssid;
754 	struct wpa_ssid *last_ssid;
755 	struct wpa_bss *current_bss;
756 	int ap_ies_from_associnfo;
757 	unsigned int assoc_freq;
758 	u8 *last_con_fail_realm;
759 	size_t last_con_fail_realm_len;
760 
761 	/* Selected configuration (based on Beacon/ProbeResp WPA IE) */
762 	int pairwise_cipher;
763 	int deny_ptk0_rekey;
764 	int group_cipher;
765 	int key_mgmt;
766 	int wpa_proto;
767 	int mgmt_group_cipher;
768 
769 	void *drv_priv; /* private data used by driver_ops */
770 	void *global_drv_priv;
771 
772 	u8 *bssid_filter;
773 	size_t bssid_filter_count;
774 
775 	u8 *disallow_aps_bssid;
776 	size_t disallow_aps_bssid_count;
777 	struct wpa_ssid_value *disallow_aps_ssid;
778 	size_t disallow_aps_ssid_count;
779 
780 	u32 setband_mask;
781 
782 	/* Preferred network for the next connection attempt */
783 	struct wpa_ssid *next_ssid;
784 
785 	/* previous scan was wildcard when interleaving between
786 	 * wildcard scans and specific SSID scan when max_ssids=1 */
787 	int prev_scan_wildcard;
788 	struct wpa_ssid *prev_scan_ssid; /* previously scanned SSID;
789 					  * NULL = not yet initialized (start
790 					  * with wildcard SSID)
791 					  * WILDCARD_SSID_SCAN = wildcard
792 					  * SSID was used in the previous scan
793 					  */
794 #define WILDCARD_SSID_SCAN ((struct wpa_ssid *) 1)
795 
796 	struct wpa_ssid *prev_sched_ssid; /* last SSID used in sched scan */
797 	int sched_scan_timeout;
798 	int first_sched_scan;
799 	int sched_scan_timed_out;
800 	struct sched_scan_plan *sched_scan_plans;
801 	size_t sched_scan_plans_num;
802 
803 	void (*scan_res_handler)(struct wpa_supplicant *wpa_s,
804 				 struct wpa_scan_results *scan_res);
805 	void (*scan_res_fail_handler)(struct wpa_supplicant *wpa_s);
806 	struct dl_list bss; /* struct wpa_bss::list */
807 	struct dl_list bss_id; /* struct wpa_bss::list_id */
808 	size_t num_bss;
809 	unsigned int bss_update_idx;
810 	unsigned int bss_next_id;
811 
812 	 /*
813 	  * Pointers to BSS entries in the order they were in the last scan
814 	  * results.
815 	  */
816 	struct wpa_bss **last_scan_res;
817 	size_t last_scan_res_used;
818 	size_t last_scan_res_size;
819 	struct os_reltime last_scan;
820 
821 	const struct wpa_driver_ops *driver;
822 	int interface_removed; /* whether the network interface has been
823 				* removed */
824 	struct wpa_sm *wpa;
825 	struct ptksa_cache *ptksa;
826 
827 	struct eapol_sm *eapol;
828 
829 	struct ctrl_iface_priv *ctrl_iface;
830 
831 	enum wpa_states wpa_state;
832 	struct wpa_radio_work *scan_work;
833 	int scanning;
834 	int sched_scanning;
835 	unsigned int sched_scan_stop_req:1;
836 	int new_connection;
837 
838 	int eapol_received; /* number of EAPOL packets received after the
839 			     * previous association event */
840 
841 	u8 rsnxe[20];
842 	size_t rsnxe_len;
843 
844 	struct scard_data *scard;
845 	char imsi[20];
846 	int mnc_len;
847 
848 	unsigned char last_eapol_src[ETH_ALEN];
849 
850 	unsigned int keys_cleared; /* bitfield of key indexes that the driver is
851 				    * known not to be configured with a key */
852 
853 	struct wpa_bssid_ignore *bssid_ignore;
854 
855 	/* Number of connection failures since last successful connection */
856 	unsigned int consecutive_conn_failures;
857 
858 	/**
859 	 * scan_req - Type of the scan request
860 	 */
861 	enum scan_req_type {
862 		/**
863 		 * NORMAL_SCAN_REQ - Normal scan request
864 		 *
865 		 * This is used for scans initiated by wpa_supplicant to find an
866 		 * AP for a connection.
867 		 */
868 		NORMAL_SCAN_REQ,
869 
870 		/**
871 		 * INITIAL_SCAN_REQ - Initial scan request
872 		 *
873 		 * This is used for the first scan on an interface to force at
874 		 * least one scan to be run even if the configuration does not
875 		 * include any enabled networks.
876 		 */
877 		INITIAL_SCAN_REQ,
878 
879 		/**
880 		 * MANUAL_SCAN_REQ - Manual scan request
881 		 *
882 		 * This is used for scans where the user request a scan or
883 		 * a specific wpa_supplicant operation (e.g., WPS) requires scan
884 		 * to be run.
885 		 */
886 		MANUAL_SCAN_REQ
887 	} scan_req, last_scan_req;
888 	enum wpa_states scan_prev_wpa_state;
889 	struct os_reltime scan_trigger_time, scan_start_time;
890 	/* Minimum freshness requirement for connection purposes */
891 	struct os_reltime scan_min_time;
892 	int scan_runs; /* number of scan runs since WPS was started */
893 	int *next_scan_freqs;
894 	int *select_network_scan_freqs;
895 	int *manual_scan_freqs;
896 	int *manual_sched_scan_freqs;
897 	unsigned int manual_scan_passive:1;
898 	unsigned int manual_scan_use_id:1;
899 	unsigned int manual_scan_only_new:1;
900 	unsigned int own_scan_requested:1;
901 	unsigned int own_scan_running:1;
902 	unsigned int clear_driver_scan_cache:1;
903 	unsigned int manual_scan_id;
904 	int scan_interval; /* time in sec between scans to find suitable AP */
905 	int normal_scans; /* normal scans run before sched_scan */
906 	int scan_for_connection; /* whether the scan request was triggered for
907 				  * finding a connection */
908 	/*
909 	 * A unique cookie representing the vendor scan request. This cookie is
910 	 * returned from the driver interface. 0 indicates that there is no
911 	 * pending vendor scan request.
912 	 */
913 	u64 curr_scan_cookie;
914 #define MAX_SCAN_ID 16
915 	int scan_id[MAX_SCAN_ID];
916 	unsigned int scan_id_count;
917 	u8 next_scan_bssid[ETH_ALEN];
918 	unsigned int next_scan_bssid_wildcard_ssid:1;
919 
920 	struct wpa_ssid_value *ssids_from_scan_req;
921 	unsigned int num_ssids_from_scan_req;
922 	int *last_scan_freqs;
923 	unsigned int num_last_scan_freqs;
924 	unsigned int suitable_network;
925 	unsigned int no_suitable_network;
926 
927 	u64 drv_flags;
928 	u64 drv_flags2;
929 	unsigned int drv_enc;
930 	unsigned int drv_rrm_flags;
931 
932 	/*
933 	 * A bitmap of supported protocols for probe response offload. See
934 	 * struct wpa_driver_capa in driver.h
935 	 */
936 	unsigned int probe_resp_offloads;
937 
938 	/* extended capabilities supported by the driver */
939 	const u8 *extended_capa, *extended_capa_mask;
940 	unsigned int extended_capa_len;
941 
942 	int max_scan_ssids;
943 	int max_sched_scan_ssids;
944 	unsigned int max_sched_scan_plans;
945 	unsigned int max_sched_scan_plan_interval;
946 	unsigned int max_sched_scan_plan_iterations;
947 	int sched_scan_supported;
948 	unsigned int max_match_sets;
949 	unsigned int max_remain_on_chan;
950 	unsigned int max_stations;
951 
952 	int pending_mic_error_report;
953 	int pending_mic_error_pairwise;
954 	int mic_errors_seen; /* Michael MIC errors with the current PTK */
955 
956 	struct wps_context *wps;
957 	int wps_success; /* WPS success event received */
958 	struct wps_er *wps_er;
959 	unsigned int wps_run;
960 	struct os_reltime wps_pin_start_time;
961 	bool bssid_ignore_cleared;
962 
963 	struct wpabuf *pending_eapol_rx;
964 	struct os_reltime pending_eapol_rx_time;
965 	u8 pending_eapol_rx_src[ETH_ALEN];
966 	unsigned int last_eapol_matches_bssid:1;
967 	unsigned int eap_expected_failure:1;
968 	unsigned int reattach:1; /* reassociation to the same BSS requested */
969 	unsigned int mac_addr_changed:1;
970 	unsigned int added_vif:1;
971 	unsigned int wnmsleep_used:1;
972 	unsigned int owe_transition_select:1;
973 	unsigned int owe_transition_search:1;
974 	unsigned int connection_set:1;
975 	unsigned int connection_ht:1;
976 	unsigned int connection_vht:1;
977 	unsigned int connection_he:1;
978 	unsigned int disable_mbo_oce:1;
979 
980 	struct os_reltime last_mac_addr_change;
981 	int last_mac_addr_style;
982 
983 	struct ibss_rsn *ibss_rsn;
984 
985 	int set_sta_uapsd;
986 	int sta_uapsd;
987 	int set_ap_uapsd;
988 	int ap_uapsd;
989 	int auth_alg;
990 	u16 last_owe_group;
991 
992 #ifdef CONFIG_SME
993 	struct {
994 		u8 ssid[SSID_MAX_LEN];
995 		size_t ssid_len;
996 		int freq;
997 		u8 assoc_req_ie[1500];
998 		size_t assoc_req_ie_len;
999 		int mfp;
1000 		int ft_used;
1001 		u8 mobility_domain[2];
1002 		u8 *ft_ies;
1003 		size_t ft_ies_len;
1004 		u8 prev_bssid[ETH_ALEN];
1005 		int prev_bssid_set;
1006 		int auth_alg;
1007 		int proto;
1008 
1009 		int sa_query_count; /* number of pending SA Query requests;
1010 				     * 0 = no SA Query in progress */
1011 		int sa_query_timed_out;
1012 		u8 *sa_query_trans_id; /* buffer of WLAN_SA_QUERY_TR_ID_LEN *
1013 					* sa_query_count octets of pending
1014 					* SA Query transaction identifiers */
1015 		struct os_reltime sa_query_start;
1016 		struct os_reltime last_unprot_disconnect;
1017 		enum { HT_SEC_CHAN_UNKNOWN,
1018 		       HT_SEC_CHAN_ABOVE,
1019 		       HT_SEC_CHAN_BELOW } ht_sec_chan;
1020 		u8 sched_obss_scan;
1021 		u16 obss_scan_int;
1022 		u16 bss_max_idle_period;
1023 #ifdef CONFIG_SAE
1024 		struct sae_data sae;
1025 		struct wpabuf *sae_token;
1026 		int sae_group_index;
1027 		unsigned int sae_pmksa_caching:1;
1028 		u16 seq_num;
1029 		u8 ext_auth_bssid[ETH_ALEN];
1030 		u8 ext_auth_ssid[SSID_MAX_LEN];
1031 		size_t ext_auth_ssid_len;
1032 		int *sae_rejected_groups;
1033 #endif /* CONFIG_SAE */
1034 	} sme;
1035 #endif /* CONFIG_SME */
1036 
1037 #if defined(CONFIG_AP) || defined(CONFIG_WPS_AP)
1038 	struct hostapd_iface *ap_iface;
1039 	void (*ap_configured_cb)(void *ctx, void *data);
1040 	void *ap_configured_cb_ctx;
1041 	void *ap_configured_cb_data;
1042 #endif /* CONFIG_AP */
1043 
1044 	struct hostapd_iface *ifmsh;
1045 #ifdef CONFIG_MESH
1046 	struct mesh_rsn *mesh_rsn;
1047 	int mesh_if_idx;
1048 	unsigned int mesh_if_created:1;
1049 	unsigned int mesh_ht_enabled:1;
1050 	unsigned int mesh_vht_enabled:1;
1051 	unsigned int mesh_he_enabled:1;
1052 	struct wpa_driver_mesh_join_params *mesh_params;
1053 #ifdef CONFIG_PMKSA_CACHE_EXTERNAL
1054 	/* struct external_pmksa_cache::list */
1055 	struct dl_list mesh_external_pmksa_cache;
1056 #endif /* CONFIG_PMKSA_CACHE_EXTERNAL */
1057 #endif /* CONFIG_MESH */
1058 
1059 	unsigned int off_channel_freq;
1060 	struct wpabuf *pending_action_tx;
1061 	u8 pending_action_src[ETH_ALEN];
1062 	u8 pending_action_dst[ETH_ALEN];
1063 	u8 pending_action_bssid[ETH_ALEN];
1064 	unsigned int pending_action_freq;
1065 	int pending_action_no_cck;
1066 	int pending_action_without_roc;
1067 	unsigned int pending_action_tx_done:1;
1068 	void (*pending_action_tx_status_cb)(struct wpa_supplicant *wpa_s,
1069 					    unsigned int freq, const u8 *dst,
1070 					    const u8 *src, const u8 *bssid,
1071 					    const u8 *data, size_t data_len,
1072 					    enum offchannel_send_action_result
1073 					    result);
1074 	unsigned int roc_waiting_drv_freq;
1075 	int action_tx_wait_time;
1076 	int action_tx_wait_time_used;
1077 
1078 	int p2p_mgmt;
1079 
1080 #ifdef CONFIG_P2P
1081 	struct p2p_go_neg_results *go_params;
1082 	int create_p2p_iface;
1083 	u8 pending_interface_addr[ETH_ALEN];
1084 	char pending_interface_name[100];
1085 	int pending_interface_type;
1086 	int p2p_group_idx;
1087 	unsigned int pending_listen_freq;
1088 	unsigned int pending_listen_duration;
1089 	enum {
1090 		NOT_P2P_GROUP_INTERFACE,
1091 		P2P_GROUP_INTERFACE_PENDING,
1092 		P2P_GROUP_INTERFACE_GO,
1093 		P2P_GROUP_INTERFACE_CLIENT
1094 	} p2p_group_interface;
1095 	struct p2p_group *p2p_group;
1096 	char p2p_pin[10];
1097 	int p2p_wps_method;
1098 	u8 p2p_auth_invite[ETH_ALEN];
1099 	int p2p_sd_over_ctrl_iface;
1100 	int p2p_in_provisioning;
1101 	int p2p_in_invitation;
1102 	int p2p_invite_go_freq;
1103 	int pending_invite_ssid_id;
1104 	int show_group_started;
1105 	u8 go_dev_addr[ETH_ALEN];
1106 	int pending_pd_before_join;
1107 	u8 pending_join_iface_addr[ETH_ALEN];
1108 	u8 pending_join_dev_addr[ETH_ALEN];
1109 	int pending_join_wps_method;
1110 	u8 p2p_join_ssid[SSID_MAX_LEN];
1111 	size_t p2p_join_ssid_len;
1112 	int p2p_join_scan_count;
1113 	int auto_pd_scan_retry;
1114 	int force_long_sd;
1115 	u16 pending_pd_config_methods;
1116 	enum {
1117 		NORMAL_PD, AUTO_PD_GO_NEG, AUTO_PD_JOIN, AUTO_PD_ASP
1118 	} pending_pd_use;
1119 
1120 	/*
1121 	 * Whether cross connection is disallowed by the AP to which this
1122 	 * interface is associated (only valid if there is an association).
1123 	 */
1124 	int cross_connect_disallowed;
1125 
1126 	/*
1127 	 * Whether this P2P group is configured to use cross connection (only
1128 	 * valid if this is P2P GO interface). The actual cross connect packet
1129 	 * forwarding may not be configured depending on the uplink status.
1130 	 */
1131 	int cross_connect_enabled;
1132 
1133 	/* Whether cross connection forwarding is in use at the moment. */
1134 	int cross_connect_in_use;
1135 
1136 	/*
1137 	 * Uplink interface name for cross connection
1138 	 */
1139 	char cross_connect_uplink[100];
1140 
1141 	unsigned int p2p_auto_join:1;
1142 	unsigned int p2p_auto_pd:1;
1143 	unsigned int p2p_go_do_acs:1;
1144 	unsigned int p2p_persistent_group:1;
1145 	unsigned int p2p_fallback_to_go_neg:1;
1146 	unsigned int p2p_pd_before_go_neg:1;
1147 	unsigned int p2p_go_ht40:1;
1148 	unsigned int p2p_go_vht:1;
1149 	unsigned int p2p_go_edmg:1;
1150 	unsigned int p2p_go_he:1;
1151 	unsigned int user_initiated_pd:1;
1152 	unsigned int p2p_go_group_formation_completed:1;
1153 	unsigned int group_formation_reported:1;
1154 	unsigned int waiting_presence_resp;
1155 	int p2p_first_connection_timeout;
1156 	unsigned int p2p_nfc_tag_enabled:1;
1157 	unsigned int p2p_peer_oob_pk_hash_known:1;
1158 	unsigned int p2p_disable_ip_addr_req:1;
1159 	unsigned int p2ps_method_config_any:1;
1160 	unsigned int p2p_cli_probe:1;
1161 	unsigned int p2p_go_allow_dfs:1;
1162 	enum hostapd_hw_mode p2p_go_acs_band;
1163 	int p2p_persistent_go_freq;
1164 	int p2p_persistent_id;
1165 	int p2p_go_intent;
1166 	int p2p_connect_freq;
1167 	struct os_reltime p2p_auto_started;
1168 	struct wpa_ssid *p2p_last_4way_hs_fail;
1169 	struct wpa_radio_work *p2p_scan_work;
1170 	struct wpa_radio_work *p2p_listen_work;
1171 	struct wpa_radio_work *p2p_send_action_work;
1172 
1173 	u16 p2p_oob_dev_pw_id; /* OOB Device Password Id for group formation */
1174 	struct wpabuf *p2p_oob_dev_pw; /* OOB Device Password for group
1175 					* formation */
1176 	u8 p2p_peer_oob_pubkey_hash[WPS_OOB_PUBKEY_HASH_LEN];
1177 	u8 p2p_ip_addr_info[3 * 4];
1178 
1179 	/* group common frequencies */
1180 	int *p2p_group_common_freqs;
1181 	unsigned int p2p_group_common_freqs_num;
1182 	u8 p2ps_join_addr[ETH_ALEN];
1183 
1184 	unsigned int p2p_go_max_oper_chwidth;
1185 	unsigned int p2p_go_vht_center_freq2;
1186 	int p2p_lo_started;
1187 #endif /* CONFIG_P2P */
1188 
1189 	struct wpa_ssid *bgscan_ssid;
1190 	const struct bgscan_ops *bgscan;
1191 	void *bgscan_priv;
1192 
1193 	const struct autoscan_ops *autoscan;
1194 	struct wpa_driver_scan_params *autoscan_params;
1195 	void *autoscan_priv;
1196 
1197 	struct wpa_ssid *connect_without_scan;
1198 
1199 	struct wps_ap_info *wps_ap;
1200 	size_t num_wps_ap;
1201 	int wps_ap_iter;
1202 
1203 	int after_wps;
1204 	int known_wps_freq;
1205 	unsigned int wps_freq;
1206 	int wps_fragment_size;
1207 	int auto_reconnect_disabled;
1208 
1209 	 /* Channel preferences for AP/P2P GO use */
1210 	int best_24_freq;
1211 	int best_5_freq;
1212 	int best_overall_freq;
1213 
1214 	struct gas_query *gas;
1215 	struct gas_server *gas_server;
1216 
1217 #ifdef CONFIG_INTERWORKING
1218 	unsigned int fetch_anqp_in_progress:1;
1219 	unsigned int network_select:1;
1220 	unsigned int auto_select:1;
1221 	unsigned int auto_network_select:1;
1222 	unsigned int interworking_fast_assoc_tried:1;
1223 	unsigned int fetch_all_anqp:1;
1224 	unsigned int fetch_osu_info:1;
1225 	unsigned int fetch_osu_waiting_scan:1;
1226 	unsigned int fetch_osu_icon_in_progress:1;
1227 	struct wpa_bss *interworking_gas_bss;
1228 	unsigned int osu_icon_id;
1229 	struct dl_list icon_head; /* struct icon_entry */
1230 	struct osu_provider *osu_prov;
1231 	size_t osu_prov_count;
1232 	struct os_reltime osu_icon_fetch_start;
1233 	unsigned int num_osu_scans;
1234 	unsigned int num_prov_found;
1235 #endif /* CONFIG_INTERWORKING */
1236 	unsigned int drv_capa_known;
1237 
1238 	struct {
1239 		struct hostapd_hw_modes *modes;
1240 		u16 num_modes;
1241 		u16 flags;
1242 	} hw;
1243 	enum local_hw_capab {
1244 		CAPAB_NO_HT_VHT,
1245 		CAPAB_HT,
1246 		CAPAB_HT40,
1247 		CAPAB_VHT,
1248 	} hw_capab;
1249 #ifdef CONFIG_MACSEC
1250 	struct ieee802_1x_kay *kay;
1251 #endif /* CONFIG_MACSEC */
1252 
1253 	int pno;
1254 	int pno_sched_pending;
1255 
1256 	/* WLAN_REASON_* reason codes. Negative if locally generated. */
1257 	int disconnect_reason;
1258 
1259 	/* WLAN_STATUS_* status codes from last received Authentication frame
1260 	 * from the AP. */
1261 	u16 auth_status_code;
1262 
1263 	/* WLAN_STATUS_* status codes from (Re)Association Response frame. */
1264 	u16 assoc_status_code;
1265 
1266 	struct ext_password_data *ext_pw;
1267 
1268 	struct wpabuf *last_gas_resp, *prev_gas_resp;
1269 	u8 last_gas_addr[ETH_ALEN], prev_gas_addr[ETH_ALEN];
1270 	u8 last_gas_dialog_token, prev_gas_dialog_token;
1271 
1272 	unsigned int no_keep_alive:1;
1273 	unsigned int ext_mgmt_frame_handling:1;
1274 	unsigned int ext_eapol_frame_io:1;
1275 	unsigned int wmm_ac_supported:1;
1276 	unsigned int ext_work_in_progress:1;
1277 	unsigned int own_disconnect_req:1;
1278 	unsigned int own_reconnect_req:1;
1279 	unsigned int ignore_post_flush_scan_res:1;
1280 
1281 #define MAC_ADDR_RAND_SCAN       BIT(0)
1282 #define MAC_ADDR_RAND_SCHED_SCAN BIT(1)
1283 #define MAC_ADDR_RAND_PNO        BIT(2)
1284 #define MAC_ADDR_RAND_ALL        (MAC_ADDR_RAND_SCAN | \
1285 				  MAC_ADDR_RAND_SCHED_SCAN | \
1286 				  MAC_ADDR_RAND_PNO)
1287 	unsigned int mac_addr_rand_supported;
1288 	unsigned int mac_addr_rand_enable;
1289 
1290 	/* MAC Address followed by mask (2 * ETH_ALEN) */
1291 	u8 *mac_addr_scan;
1292 	u8 *mac_addr_sched_scan;
1293 	u8 *mac_addr_pno;
1294 
1295 #ifdef CONFIG_WNM
1296 	u8 wnm_dialog_token;
1297 	u8 wnm_reply;
1298 	u8 wnm_num_neighbor_report;
1299 	u8 wnm_mode;
1300 	u16 wnm_dissoc_timer;
1301 	u8 wnm_bss_termination_duration[12];
1302 	struct neighbor_report *wnm_neighbor_report_elements;
1303 	struct os_reltime wnm_cand_valid_until;
1304 	u8 wnm_cand_from_bss[ETH_ALEN];
1305 	enum bss_trans_mgmt_status_code bss_tm_status;
1306 	bool bss_trans_mgmt_in_progress;
1307 	struct wpabuf *coloc_intf_elems;
1308 	u8 coloc_intf_dialog_token;
1309 	u8 coloc_intf_auto_report;
1310 	u8 coloc_intf_timeout;
1311 #ifdef CONFIG_MBO
1312 	unsigned int wnm_mbo_trans_reason_present:1;
1313 	u8 wnm_mbo_transition_reason;
1314 #endif /* CONFIG_MBO */
1315 #endif /* CONFIG_WNM */
1316 
1317 #ifdef CONFIG_TESTING_GET_GTK
1318 	u8 last_gtk[32];
1319 	size_t last_gtk_len;
1320 #endif /* CONFIG_TESTING_GET_GTK */
1321 
1322 	unsigned int num_multichan_concurrent;
1323 	struct wpa_radio_work *connect_work;
1324 
1325 	unsigned int ext_work_id;
1326 
1327 	struct wpabuf *vendor_elem[NUM_VENDOR_ELEM_FRAMES];
1328 
1329 #ifdef CONFIG_TESTING_OPTIONS
1330 	struct l2_packet_data *l2_test;
1331 	unsigned int extra_roc_dur;
1332 	enum wpa_supplicant_test_failure test_failure;
1333 	char *get_pref_freq_list_override;
1334 	unsigned int reject_btm_req_reason;
1335 	unsigned int p2p_go_csa_on_inv:1;
1336 	unsigned int ignore_auth_resp:1;
1337 	unsigned int ignore_assoc_disallow:1;
1338 	unsigned int disable_sa_query:1;
1339 	unsigned int testing_resend_assoc:1;
1340 	unsigned int ignore_sae_h2e_only:1;
1341 	int ft_rsnxe_used;
1342 	struct wpabuf *sae_commit_override;
1343 	enum wpa_alg last_tk_alg;
1344 	u8 last_tk_addr[ETH_ALEN];
1345 	int last_tk_key_idx;
1346 	u8 last_tk[WPA_TK_MAX_LEN];
1347 	size_t last_tk_len;
1348 	struct wpabuf *last_assoc_req_wpa_ie;
1349 	int *extra_sae_rejected_groups;
1350 	struct wpabuf *rsne_override_eapol;
1351 	struct wpabuf *rsnxe_override_assoc;
1352 	struct wpabuf *rsnxe_override_eapol;
1353 	struct dl_list drv_signal_override;
1354 	unsigned int oci_freq_override_eapol;
1355 	unsigned int oci_freq_override_saquery_req;
1356 	unsigned int oci_freq_override_saquery_resp;
1357 	unsigned int oci_freq_override_eapol_g2;
1358 	unsigned int oci_freq_override_ft_assoc;
1359 	unsigned int oci_freq_override_fils_assoc;
1360 	unsigned int oci_freq_override_wnm_sleep;
1361 #endif /* CONFIG_TESTING_OPTIONS */
1362 
1363 	struct wmm_ac_assoc_data *wmm_ac_assoc_info;
1364 	struct wmm_tspec_element *tspecs[WMM_AC_NUM][TS_DIR_IDX_COUNT];
1365 	struct wmm_ac_addts_request *addts_request;
1366 	u8 wmm_ac_last_dialog_token;
1367 	struct wmm_tspec_element *last_tspecs;
1368 	u8 last_tspecs_count;
1369 
1370 	struct rrm_data rrm;
1371 	struct beacon_rep_data beacon_rep_data;
1372 
1373 #ifdef CONFIG_FST
1374 	struct fst_iface *fst;
1375 	const struct wpabuf *fst_ies;
1376 	struct wpabuf *received_mb_ies;
1377 #endif /* CONFIG_FST */
1378 
1379 #ifdef CONFIG_MBO
1380 	/* Multiband operation non-preferred channel */
1381 	struct wpa_mbo_non_pref_channel {
1382 		enum mbo_non_pref_chan_reason reason;
1383 		u8 oper_class;
1384 		u8 chan;
1385 		u8 preference;
1386 	} *non_pref_chan;
1387 	size_t non_pref_chan_num;
1388 	u8 mbo_wnm_token;
1389 	/**
1390 	 * enable_oce - Enable OCE if it is enabled by user and device also
1391 	 *		supports OCE.
1392 	 * User can enable OCE with wpa_config's 'oce' parameter as follows -
1393 	 *  - Set BIT(0) to enable OCE in non-AP STA mode.
1394 	 *  - Set BIT(1) to enable OCE in STA-CFON mode.
1395 	 */
1396 	u8 enable_oce;
1397 #endif /* CONFIG_MBO */
1398 
1399 	/*
1400 	 * This should be under CONFIG_MBO, but it is left out to allow using
1401 	 * the bss_temp_disallowed list for other purposes as well.
1402 	 */
1403 	struct dl_list bss_tmp_disallowed;
1404 
1405 	/*
1406 	 * Content of a measurement report element with type 8 (LCI),
1407 	 * own location.
1408 	 */
1409 	struct wpabuf *lci;
1410 	struct os_reltime lci_time;
1411 
1412 	struct os_reltime beacon_rep_scan;
1413 
1414 	/* FILS HLP requests (struct fils_hlp_req) */
1415 	struct dl_list fils_hlp_req;
1416 
1417 	struct sched_scan_relative_params {
1418 		/**
1419 		 * relative_rssi_set - Enable relatively preferred BSS reporting
1420 		 *
1421 		 * 0 = Disable reporting relatively preferred BSSs
1422 		 * 1 = Enable reporting relatively preferred BSSs
1423 		 */
1424 		int relative_rssi_set;
1425 
1426 		/**
1427 		 * relative_rssi - Relative RSSI for reporting better BSSs
1428 		 *
1429 		 * Amount of RSSI by which a BSS should be better than the
1430 		 * current connected BSS so that the new BSS can be reported
1431 		 * to user space. This applies to sched_scan operations.
1432 		 */
1433 		int relative_rssi;
1434 
1435 		/**
1436 		 * relative_adjust_band - Band in which RSSI is to be adjusted
1437 		 */
1438 		enum set_band relative_adjust_band;
1439 
1440 		/**
1441 		 * relative_adjust_rssi - RSSI adjustment
1442 		 *
1443 		 * An amount of relative_adjust_rssi should be added to the
1444 		 * BSSs that belong to the relative_adjust_band while comparing
1445 		 * with other bands for BSS reporting.
1446 		 */
1447 		int relative_adjust_rssi;
1448 	} srp;
1449 
1450 	/* RIC elements for FT protocol */
1451 	struct wpabuf *ric_ies;
1452 
1453 	int last_auth_timeout_sec;
1454 
1455 #ifdef CONFIG_DPP
1456 	struct dpp_global *dpp;
1457 	struct dpp_authentication *dpp_auth;
1458 	struct wpa_radio_work *dpp_listen_work;
1459 	unsigned int dpp_pending_listen_freq;
1460 	unsigned int dpp_listen_freq;
1461 	struct os_reltime dpp_listen_end;
1462 	u8 dpp_allowed_roles;
1463 	int dpp_qr_mutual;
1464 	int dpp_netrole;
1465 	int dpp_auth_ok_on_ack;
1466 	int dpp_in_response_listen;
1467 	int dpp_gas_client;
1468 	int dpp_gas_dialog_token;
1469 	u8 dpp_intro_bssid[ETH_ALEN];
1470 	void *dpp_intro_network;
1471 	struct dpp_pkex *dpp_pkex;
1472 	struct dpp_bootstrap_info *dpp_pkex_bi;
1473 	char *dpp_pkex_code;
1474 	char *dpp_pkex_identifier;
1475 	char *dpp_pkex_auth_cmd;
1476 	char *dpp_configurator_params;
1477 	struct os_reltime dpp_last_init;
1478 	struct os_reltime dpp_init_iter_start;
1479 	unsigned int dpp_init_max_tries;
1480 	unsigned int dpp_init_retry_time;
1481 	unsigned int dpp_resp_wait_time;
1482 	unsigned int dpp_resp_max_tries;
1483 	unsigned int dpp_resp_retry_time;
1484 	u8 dpp_last_ssid[SSID_MAX_LEN];
1485 	size_t dpp_last_ssid_len;
1486 	bool dpp_conf_backup_received;
1487 #ifdef CONFIG_DPP2
1488 	struct dpp_pfs *dpp_pfs;
1489 	int dpp_pfs_fallback;
1490 	struct wpabuf *dpp_presence_announcement;
1491 	struct dpp_bootstrap_info *dpp_chirp_bi;
1492 	int dpp_chirp_freq;
1493 	int *dpp_chirp_freqs;
1494 	int dpp_chirp_iter;
1495 	int dpp_chirp_round;
1496 	int dpp_chirp_scan_done;
1497 	int dpp_chirp_listen;
1498 	struct wpa_ssid *dpp_reconfig_ssid;
1499 	int dpp_reconfig_ssid_id;
1500 	struct dpp_reconfig_id *dpp_reconfig_id;
1501 #endif /* CONFIG_DPP2 */
1502 #ifdef CONFIG_TESTING_OPTIONS
1503 	char *dpp_config_obj_override;
1504 	char *dpp_discovery_override;
1505 	char *dpp_groups_override;
1506 	unsigned int dpp_ignore_netaccesskey_mismatch:1;
1507 #endif /* CONFIG_TESTING_OPTIONS */
1508 #endif /* CONFIG_DPP */
1509 
1510 #ifdef CONFIG_FILS
1511 	unsigned int disable_fils:1;
1512 #endif /* CONFIG_FILS */
1513 	unsigned int ieee80211ac:1;
1514 	unsigned int enabled_4addr_mode:1;
1515 	unsigned int multi_bss_support:1;
1516 	unsigned int drv_authorized_port:1;
1517 	unsigned int multi_ap_ie:1;
1518 	unsigned int multi_ap_backhaul:1;
1519 	unsigned int multi_ap_fronthaul:1;
1520 	struct robust_av_data robust_av;
1521 	bool mscs_setup_done;
1522 
1523 #ifdef CONFIG_PASN
1524 	struct wpas_pasn pasn;
1525 	struct wpa_radio_work *pasn_auth_work;
1526 #endif /* CONFIG_PASN */
1527 	struct scs_robust_av_data scs_robust_av_req;
1528 	u8 scs_dialog_token;
1529 #ifdef CONFIG_TESTING_OPTIONS
1530 	unsigned int disable_scs_support:1;
1531 	unsigned int disable_mscs_support:1;
1532 #endif /* CONFIG_TESTING_OPTIONS */
1533 	struct dl_list active_scs_ids;
1534 	bool ongoing_scs_req;
1535 	u8 dscp_req_dialog_token;
1536 	u8 dscp_query_dialog_token;
1537 	unsigned int enable_dscp_policy_capa:1;
1538 	unsigned int connection_dscp:1;
1539 	unsigned int wait_for_dscp_req:1;
1540 };
1541 
1542 
1543 /* wpa_supplicant.c */
1544 void wpa_supplicant_apply_ht_overrides(
1545 	struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
1546 	struct wpa_driver_associate_params *params);
1547 void wpa_supplicant_apply_vht_overrides(
1548 	struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
1549 	struct wpa_driver_associate_params *params);
1550 void wpa_supplicant_apply_he_overrides(
1551 	struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
1552 	struct wpa_driver_associate_params *params);
1553 
1554 int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
1555 int wpa_supplicant_set_wpa_none_key(struct wpa_supplicant *wpa_s,
1556 				    struct wpa_ssid *ssid);
1557 
1558 int wpa_supplicant_reload_configuration(struct wpa_supplicant *wpa_s);
1559 
1560 const char * wpa_supplicant_state_txt(enum wpa_states state);
1561 int wpa_supplicant_update_mac_addr(struct wpa_supplicant *wpa_s);
1562 int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s);
1563 int wpa_supplicant_update_bridge_ifname(struct wpa_supplicant *wpa_s,
1564 					const char *bridge_ifname);
1565 void wpas_set_mgmt_group_cipher(struct wpa_supplicant *wpa_s,
1566 				struct wpa_ssid *ssid, struct wpa_ie_data *ie);
1567 int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
1568 			      struct wpa_bss *bss, struct wpa_ssid *ssid,
1569 			      u8 *wpa_ie, size_t *wpa_ie_len);
1570 int wpas_restore_permanent_mac_addr(struct wpa_supplicant *wpa_s);
1571 void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
1572 			      struct wpa_bss *bss,
1573 			      struct wpa_ssid *ssid);
1574 void wpa_supplicant_set_non_wpa_policy(struct wpa_supplicant *wpa_s,
1575 				       struct wpa_ssid *ssid);
1576 void wpa_supplicant_initiate_eapol(struct wpa_supplicant *wpa_s);
1577 void wpa_clear_keys(struct wpa_supplicant *wpa_s, const u8 *addr);
1578 void wpa_supplicant_req_auth_timeout(struct wpa_supplicant *wpa_s,
1579 				     int sec, int usec);
1580 void wpas_auth_timeout_restart(struct wpa_supplicant *wpa_s, int sec_diff);
1581 void wpa_supplicant_reinit_autoscan(struct wpa_supplicant *wpa_s);
1582 void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
1583 			      enum wpa_states state);
1584 struct wpa_ssid * wpa_supplicant_get_ssid(struct wpa_supplicant *wpa_s);
1585 const char * wpa_supplicant_get_eap_mode(struct wpa_supplicant *wpa_s);
1586 void wpa_supplicant_cancel_auth_timeout(struct wpa_supplicant *wpa_s);
1587 void wpa_supplicant_deauthenticate(struct wpa_supplicant *wpa_s,
1588 				   u16 reason_code);
1589 void wpa_supplicant_reconnect(struct wpa_supplicant *wpa_s);
1590 
1591 struct wpa_ssid * wpa_supplicant_add_network(struct wpa_supplicant *wpa_s);
1592 int wpa_supplicant_remove_network(struct wpa_supplicant *wpa_s, int id);
1593 int wpa_supplicant_remove_all_networks(struct wpa_supplicant *wpa_s);
1594 void wpa_supplicant_enable_network(struct wpa_supplicant *wpa_s,
1595 				   struct wpa_ssid *ssid);
1596 void wpa_supplicant_disable_network(struct wpa_supplicant *wpa_s,
1597 				    struct wpa_ssid *ssid);
1598 void wpa_supplicant_select_network(struct wpa_supplicant *wpa_s,
1599 				   struct wpa_ssid *ssid);
1600 int wpas_remove_cred(struct wpa_supplicant *wpa_s, struct wpa_cred *cred);
1601 int wpas_remove_all_creds(struct wpa_supplicant *wpa_s);
1602 int wpas_set_pkcs11_engine_and_module_path(struct wpa_supplicant *wpa_s,
1603 					   const char *pkcs11_engine_path,
1604 					   const char *pkcs11_module_path);
1605 int wpa_supplicant_set_ap_scan(struct wpa_supplicant *wpa_s,
1606 			       int ap_scan);
1607 int wpa_supplicant_set_bss_expiration_age(struct wpa_supplicant *wpa_s,
1608 					  unsigned int expire_age);
1609 int wpa_supplicant_set_bss_expiration_count(struct wpa_supplicant *wpa_s,
1610 					    unsigned int expire_count);
1611 int wpa_supplicant_set_scan_interval(struct wpa_supplicant *wpa_s,
1612 				     int scan_interval);
1613 int wpa_supplicant_set_debug_params(struct wpa_global *global,
1614 				    int debug_level, int debug_timestamp,
1615 				    int debug_show_keys);
1616 void free_hw_features(struct wpa_supplicant *wpa_s);
1617 
1618 void wpa_show_license(void);
1619 
1620 struct wpa_interface * wpa_supplicant_match_iface(struct wpa_global *global,
1621 						  const char *ifname);
1622 struct wpa_supplicant * wpa_supplicant_add_iface(struct wpa_global *global,
1623 						 struct wpa_interface *iface,
1624 						 struct wpa_supplicant *parent);
1625 int wpa_supplicant_remove_iface(struct wpa_global *global,
1626 				struct wpa_supplicant *wpa_s,
1627 				int terminate);
1628 struct wpa_supplicant * wpa_supplicant_get_iface(struct wpa_global *global,
1629 						 const char *ifname);
1630 #ifndef LOS_WPA_PATCH
1631 struct wpa_global * wpa_supplicant_init(struct wpa_params *params);
1632 #else
1633 struct wpa_global * wpa_supplicant_init(void);
1634 #endif /* LOS_WPA_PATCH */
1635 int wpa_supplicant_run(struct wpa_global *global);
1636 void wpa_supplicant_deinit(struct wpa_global *global);
1637 
1638 int wpa_supplicant_scard_init(struct wpa_supplicant *wpa_s,
1639 			      struct wpa_ssid *ssid);
1640 void wpa_supplicant_terminate_proc(struct wpa_global *global);
1641 void wpa_supplicant_rx_eapol(void *ctx, const u8 *src_addr,
1642 			     const u8 *buf, size_t len);
1643 void wpa_supplicant_update_config(struct wpa_supplicant *wpa_s);
1644 void wpa_supplicant_clear_status(struct wpa_supplicant *wpa_s);
1645 void wpas_connection_failed(struct wpa_supplicant *wpa_s, const u8 *bssid);
1646 void fils_connection_failure(struct wpa_supplicant *wpa_s);
1647 void fils_pmksa_cache_flush(struct wpa_supplicant *wpa_s);
1648 int wpas_driver_bss_selection(struct wpa_supplicant *wpa_s);
1649 int wpas_is_p2p_prioritized(struct wpa_supplicant *wpa_s);
1650 void wpas_auth_failed(struct wpa_supplicant *wpa_s, char *reason);
1651 void wpas_clear_temp_disabled(struct wpa_supplicant *wpa_s,
1652 			      struct wpa_ssid *ssid, int clear_failures);
1653 int disallowed_bssid(struct wpa_supplicant *wpa_s, const u8 *bssid);
1654 int disallowed_ssid(struct wpa_supplicant *wpa_s, const u8 *ssid,
1655 		    size_t ssid_len);
1656 void wpas_request_connection(struct wpa_supplicant *wpa_s);
1657 void wpas_request_disconnection(struct wpa_supplicant *wpa_s);
1658 int wpas_build_ext_capab(struct wpa_supplicant *wpa_s, u8 *buf, size_t buflen);
1659 int wpas_update_random_addr(struct wpa_supplicant *wpa_s, int style);
1660 int wpas_update_random_addr_disassoc(struct wpa_supplicant *wpa_s);
1661 void add_freq(int *freqs, int *num_freqs, int freq);
1662 
1663 int wpas_get_op_chan_phy(int freq, const u8 *ies, size_t ies_len,
1664 			 u8 *op_class, u8 *chan, u8 *phy_type);
1665 
1666 int wpas_twt_send_setup(struct wpa_supplicant *wpa_s, u8 dtok, int exponent,
1667 			int mantissa, u8 min_twt, int setup_cmd, u64 twt,
1668 			bool requestor, bool trigger, bool implicit,
1669 			bool flow_type, u8 flow_id, bool protection,
1670 			u8 twt_channel, u8 control);
1671 int wpas_twt_send_teardown(struct wpa_supplicant *wpa_s, u8 flags);
1672 
1673 void wpas_rrm_reset(struct wpa_supplicant *wpa_s);
1674 void wpas_rrm_process_neighbor_rep(struct wpa_supplicant *wpa_s,
1675 				   const u8 *report, size_t report_len);
1676 int wpas_rrm_send_neighbor_rep_request(struct wpa_supplicant *wpa_s,
1677 				       const struct wpa_ssid_value *ssid,
1678 				       int lci, int civic,
1679 				       void (*cb)(void *ctx,
1680 						  struct wpabuf *neighbor_rep),
1681 				       void *cb_ctx);
1682 void wpas_rrm_handle_radio_measurement_request(struct wpa_supplicant *wpa_s,
1683 					       const u8 *src, const u8 *dst,
1684 					       const u8 *frame, size_t len);
1685 void wpas_rrm_handle_link_measurement_request(struct wpa_supplicant *wpa_s,
1686 					      const u8 *src,
1687 					      const u8 *frame, size_t len,
1688 					      int rssi);
1689 void wpas_rrm_refuse_request(struct wpa_supplicant *wpa_s);
1690 int wpas_beacon_rep_scan_process(struct wpa_supplicant *wpa_s,
1691 				 struct wpa_scan_results *scan_res,
1692 				 struct scan_info *info);
1693 void wpas_clear_beacon_rep_data(struct wpa_supplicant *wpa_s);
1694 void wpas_flush_fils_hlp_req(struct wpa_supplicant *wpa_s);
1695 void wpas_clear_disabled_interface(void *eloop_ctx, void *timeout_ctx);
1696 void wpa_supplicant_reset_bgscan(struct wpa_supplicant *wpa_s);
1697 
1698 
1699 /* MBO functions */
1700 int wpas_mbo_ie(struct wpa_supplicant *wpa_s, u8 *buf, size_t len,
1701 		int add_oce_capa);
1702 const u8 * mbo_attr_from_mbo_ie(const u8 *mbo_ie, enum mbo_attr_id attr);
1703 const u8 * wpas_mbo_get_bss_attr(struct wpa_bss *bss, enum mbo_attr_id attr);
1704 void wpas_mbo_check_pmf(struct wpa_supplicant *wpa_s, struct wpa_bss *bss,
1705 			struct wpa_ssid *ssid);
1706 const u8 * mbo_get_attr_from_ies(const u8 *ies, size_t ies_len,
1707 				 enum mbo_attr_id attr);
1708 int wpas_mbo_update_non_pref_chan(struct wpa_supplicant *wpa_s,
1709 				  const char *non_pref_chan);
1710 void wpas_mbo_scan_ie(struct wpa_supplicant *wpa_s, struct wpabuf *ie);
1711 void wpas_mbo_ie_trans_req(struct wpa_supplicant *wpa_s, const u8 *ie,
1712 			   size_t len);
1713 size_t wpas_mbo_ie_bss_trans_reject(struct wpa_supplicant *wpa_s, u8 *pos,
1714 				    size_t len,
1715 				    enum mbo_transition_reject_reason reason);
1716 void wpas_mbo_update_cell_capa(struct wpa_supplicant *wpa_s, u8 mbo_cell_capa);
1717 struct wpabuf * mbo_build_anqp_buf(struct wpa_supplicant *wpa_s,
1718 				   struct wpa_bss *bss, u32 mbo_subtypes);
1719 void mbo_parse_rx_anqp_resp(struct wpa_supplicant *wpa_s,
1720 			    struct wpa_bss *bss, const u8 *sa,
1721 			    const u8 *data, size_t slen);
1722 void wpas_update_mbo_connect_params(struct wpa_supplicant *wpa_s);
1723 
1724 /* op_classes.c */
1725 enum chan_allowed {
1726 	NOT_ALLOWED, NO_IR, RADAR, ALLOWED
1727 };
1728 
1729 enum chan_allowed verify_channel(struct hostapd_hw_modes *mode, u8 op_class,
1730 				 u8 channel, u8 bw);
1731 size_t wpas_supp_op_class_ie(struct wpa_supplicant *wpa_s,
1732 			     struct wpa_ssid *ssid,
1733 			     struct wpa_bss *bss, u8 *pos, size_t len);
1734 int * wpas_supp_op_classes(struct wpa_supplicant *wpa_s);
1735 
1736 int wpas_enable_mac_addr_randomization(struct wpa_supplicant *wpa_s,
1737 				       unsigned int type, const u8 *addr,
1738 				       const u8 *mask);
1739 int wpas_disable_mac_addr_randomization(struct wpa_supplicant *wpa_s,
1740 					unsigned int type);
1741 
1742 /**
1743  * wpa_supplicant_ctrl_iface_ctrl_rsp_handle - Handle a control response
1744  * @wpa_s: Pointer to wpa_supplicant data
1745  * @ssid: Pointer to the network block the reply is for
1746  * @field: field the response is a reply for
1747  * @value: value (ie, password, etc) for @field
1748  * Returns: 0 on success, non-zero on error
1749  *
1750  * Helper function to handle replies to control interface requests.
1751  */
1752 int wpa_supplicant_ctrl_iface_ctrl_rsp_handle(struct wpa_supplicant *wpa_s,
1753 					      struct wpa_ssid *ssid,
1754 					      const char *field,
1755 					      const char *value);
1756 
1757 void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
1758 			  const struct wpa_ssid *ssid,
1759 			  struct hostapd_freq_params *freq);
1760 
1761 /* events.c */
1762 void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s);
1763 int wpa_supplicant_connect(struct wpa_supplicant *wpa_s,
1764 			   struct wpa_bss *selected,
1765 			   struct wpa_ssid *ssid);
1766 void wpa_supplicant_stop_countermeasures(void *eloop_ctx, void *sock_ctx);
1767 void wpa_supplicant_delayed_mic_error_report(void *eloop_ctx, void *sock_ctx);
1768 void wnm_bss_keep_alive_deinit(struct wpa_supplicant *wpa_s);
1769 int wpa_supplicant_fast_associate(struct wpa_supplicant *wpa_s);
1770 struct wpa_bss * wpa_supplicant_pick_network(struct wpa_supplicant *wpa_s,
1771 					     struct wpa_ssid **selected_ssid);
1772 int wpas_temp_disabled(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
1773 void wpa_supplicant_update_channel_list(struct wpa_supplicant *wpa_s,
1774 					struct channel_list_changed *info);
1775 int wpa_supplicant_need_to_roam_within_ess(struct wpa_supplicant *wpa_s,
1776 					   struct wpa_bss *current_bss,
1777 					   struct wpa_bss *seleceted);
1778 
1779 /* eap_register.c */
1780 int eap_register_methods(void);
1781 
1782 /**
1783  * Utility method to tell if a given network is for persistent group storage
1784  * @ssid: Network object
1785  * Returns: 1 if network is a persistent group, 0 otherwise
1786  */
network_is_persistent_group(struct wpa_ssid * ssid)1787 static inline int network_is_persistent_group(struct wpa_ssid *ssid)
1788 {
1789 	return ssid->disabled == 2 && ssid->p2p_persistent_group;
1790 }
1791 
1792 
wpas_mode_to_ieee80211_mode(enum wpas_mode mode)1793 static inline int wpas_mode_to_ieee80211_mode(enum wpas_mode mode)
1794 {
1795 	switch (mode) {
1796 	default:
1797 	case WPAS_MODE_INFRA:
1798 		return IEEE80211_MODE_INFRA;
1799 	case WPAS_MODE_IBSS:
1800 		return IEEE80211_MODE_IBSS;
1801 	case WPAS_MODE_AP:
1802 	case WPAS_MODE_P2P_GO:
1803 	case WPAS_MODE_P2P_GROUP_FORMATION:
1804 		return IEEE80211_MODE_AP;
1805 	case WPAS_MODE_MESH:
1806 		return IEEE80211_MODE_MESH;
1807 	}
1808 }
1809 
1810 
1811 int wpas_network_disabled(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
1812 int wpas_get_ssid_pmf(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
1813 int pmf_in_use(struct wpa_supplicant *wpa_s, const u8 *addr);
1814 
1815 int wpas_init_ext_pw(struct wpa_supplicant *wpa_s);
1816 
1817 void dump_freq_data(struct wpa_supplicant *wpa_s, const char *title,
1818 		    struct wpa_used_freq_data *freqs_data,
1819 		    unsigned int len);
1820 
1821 int get_shared_radio_freqs_data(struct wpa_supplicant *wpa_s,
1822 				struct wpa_used_freq_data *freqs_data,
1823 				unsigned int len);
1824 int get_shared_radio_freqs(struct wpa_supplicant *wpa_s,
1825 			   int *freq_array, unsigned int len);
1826 
1827 void wpas_network_reenabled(void *eloop_ctx, void *timeout_ctx);
1828 
1829 void wpas_vendor_elem_update(struct wpa_supplicant *wpa_s);
1830 struct wpa_supplicant * wpas_vendor_elem(struct wpa_supplicant *wpa_s,
1831 					 enum wpa_vendor_elem_frame frame);
1832 int wpas_vendor_elem_remove(struct wpa_supplicant *wpa_s, int frame,
1833 			    const u8 *elem, size_t len);
1834 
1835 #ifdef CONFIG_FST
1836 
1837 struct fst_wpa_obj;
1838 
1839 void fst_wpa_supplicant_fill_iface_obj(struct wpa_supplicant *wpa_s,
1840 				       struct fst_wpa_obj *iface_obj);
1841 
1842 #endif /* CONFIG_FST */
1843 
1844 int wpas_sched_scan_plans_set(struct wpa_supplicant *wpa_s, const char *cmd);
1845 
1846 struct hostapd_hw_modes * get_mode(struct hostapd_hw_modes *modes,
1847 				   u16 num_modes, enum hostapd_hw_mode mode,
1848 				   bool is_6ghz);
1849 struct hostapd_hw_modes * get_mode_with_freq(struct hostapd_hw_modes *modes,
1850 					     u16 num_modes, int freq);
1851 
1852 void wpa_bss_tmp_disallow(struct wpa_supplicant *wpa_s, const u8 *bssid,
1853 			  unsigned int sec, int rssi_threshold);
1854 int wpa_is_bss_tmp_disallowed(struct wpa_supplicant *wpa_s,
1855 			      struct wpa_bss *bss);
1856 void free_bss_tmp_disallowed(struct wpa_supplicant *wpa_s);
1857 
1858 #ifndef LOS_WPA_PATCH
1859 struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
1860 				     int i, struct wpa_bss *bss,
1861 				     struct wpa_ssid *group,
1862 				     int only_first_ssid, int debug_print);
1863 #else
1864 struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
1865 				     int i, struct wpa_bss *bss,
1866 				     struct wpa_ssid *group,
1867 				     int only_first_ssid);
1868 void wpa_comm_event_report(ext_wifi_event_type event, const void *ctx, const void *data);
1869 void wpa_set_scan_triggered_by_rm_net_cli_flag(bool flag);
1870 bool wpa_get_scan_triggered_by_rm_net_cli_flag(void);
1871 #endif /* LOS_WPA_PATCH */
1872 
1873 int wpas_ctrl_iface_get_pref_freq_list_override(struct wpa_supplicant *wpa_s,
1874 						enum wpa_driver_if_type if_type,
1875 						unsigned int *num,
1876 						unsigned int *freq_list);
1877 
1878 int wpa_is_fils_supported(struct wpa_supplicant *wpa_s);
1879 int wpa_is_fils_sk_pfs_supported(struct wpa_supplicant *wpa_s);
1880 
1881 void wpas_clear_driver_signal_override(struct wpa_supplicant *wpa_s);
1882 
1883 int wpas_send_mscs_req(struct wpa_supplicant *wpa_s);
1884 void wpas_populate_mscs_descriptor_ie(struct robust_av_data *robust_av,
1885 				      struct wpabuf *buf);
1886 void wpas_handle_robust_av_recv_action(struct wpa_supplicant *wpa_s,
1887 				       const u8 *src, const u8 *buf,
1888 				       size_t len);
1889 void wpas_handle_assoc_resp_mscs(struct wpa_supplicant *wpa_s, const u8 *bssid,
1890 				 const u8 *ies, size_t ies_len);
1891 int wpas_send_scs_req(struct wpa_supplicant *wpa_s);
1892 void free_up_tclas_elem(struct scs_desc_elem *elem);
1893 void free_up_scs_desc(struct scs_robust_av_data *data);
1894 void wpas_handle_robust_av_scs_recv_action(struct wpa_supplicant *wpa_s,
1895 					   const u8 *src, const u8 *buf,
1896 					   size_t len);
1897 void wpas_scs_deinit(struct wpa_supplicant *wpa_s);
1898 void wpas_handle_qos_mgmt_recv_action(struct wpa_supplicant *wpa_s,
1899 				      const u8 *src,
1900 				      const u8 *buf, size_t len);
1901 void wpas_dscp_deinit(struct wpa_supplicant *wpa_s);
1902 int wpas_send_dscp_response(struct wpa_supplicant *wpa_s,
1903 			    struct dscp_resp_data *resp_data);
1904 void wpas_handle_assoc_resp_qos_mgmt(struct wpa_supplicant *wpa_s,
1905 				     const u8 *ies, size_t ies_len);
1906 int wpas_send_dscp_query(struct wpa_supplicant *wpa_s, const char *domain_name,
1907 			 size_t domain_name_length);
1908 
1909 int wpas_pasn_auth_start(struct wpa_supplicant *wpa_s,
1910 			 const u8 *bssid, int akmp, int cipher,
1911 			 u16 group, int network_id,
1912 			 const u8 *comeback, size_t comeback_len);
1913 void wpas_pasn_auth_stop(struct wpa_supplicant *wpa_s);
1914 int wpas_pasn_auth_tx_status(struct wpa_supplicant *wpa_s,
1915 			     const u8 *data, size_t data_len, u8 acked);
1916 int wpas_pasn_auth_rx(struct wpa_supplicant *wpa_s,
1917 		      const struct ieee80211_mgmt *mgmt, size_t len);
1918 
1919 int wpas_pasn_deauthenticate(struct wpa_supplicant *wpa_s, const u8 *bssid);
1920 
1921 #endif /* WPA_SUPPLICANT_I_H */
1922