xref: /freebsd/contrib/wpa/src/drivers/driver.h (revision 71e72c9e91c4b8007a4292e09669e8b549c29e97)
1 /*
2  * Driver interface definition
3  * Copyright (c) 2003-2017, 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  * This file defines a driver interface used by both %wpa_supplicant and
9  * hostapd. The first part of the file defines data structures used in various
10  * driver operations. This is followed by the struct wpa_driver_ops that each
11  * driver wrapper will beed to define with callback functions for requesting
12  * driver operations. After this, there are definitions for driver event
13  * reporting with wpa_supplicant_event() and some convenience helper functions
14  * that can be used to report events.
15  */
16 
17 #ifndef DRIVER_H
18 #define DRIVER_H
19 
20 #define WPA_SUPPLICANT_DRIVER_VERSION 4
21 
22 #include "common/defs.h"
23 #include "common/ieee802_11_defs.h"
24 #include "common/wpa_common.h"
25 #include "common/nan_defs.h"
26 #ifdef CONFIG_MACSEC
27 #include "pae/ieee802_1x_kay.h"
28 #endif /* CONFIG_MACSEC */
29 #include "utils/list.h"
30 
31 struct nan_subscribe_params;
32 struct nan_publish_params;
33 struct pr_pasn_ranging_params;
34 
35 #define HOSTAPD_CHAN_DISABLED 0x00000001
36 #define HOSTAPD_CHAN_NO_IR 0x00000002
37 #define HOSTAPD_CHAN_RADAR 0x00000008
38 #define HOSTAPD_CHAN_HT40PLUS 0x00000010
39 #define HOSTAPD_CHAN_HT40MINUS 0x00000020
40 #define HOSTAPD_CHAN_HT40 0x00000040
41 #define HOSTAPD_CHAN_SURVEY_LIST_INITIALIZED 0x00000080
42 
43 #define HOSTAPD_CHAN_DFS_UNKNOWN 0x00000000
44 #define HOSTAPD_CHAN_DFS_USABLE 0x00000100
45 #define HOSTAPD_CHAN_DFS_UNAVAILABLE 0x00000200
46 #define HOSTAPD_CHAN_DFS_AVAILABLE 0x00000300
47 #define HOSTAPD_CHAN_DFS_MASK 0x00000300
48 
49 #define HOSTAPD_CHAN_VHT_80MHZ_SUBCHANNEL 0x00000800
50 #define HOSTAPD_CHAN_VHT_160MHZ_SUBCHANNEL 0x00001000
51 #define HOSTAPD_CHAN_EHT_320MHZ_SUBCHANNEL 0x00002000
52 
53 #define HOSTAPD_CHAN_INDOOR_ONLY 0x00010000
54 #define HOSTAPD_CHAN_GO_CONCURRENT 0x00020000
55 #define HOSTAPD_CHAN_AUTO_BW 0x00040000
56 
57 /* Allowed bandwidth mask */
58 enum hostapd_chan_width_attr {
59 	HOSTAPD_CHAN_WIDTH_10   = BIT(0),
60 	HOSTAPD_CHAN_WIDTH_20   = BIT(1),
61 	HOSTAPD_CHAN_WIDTH_40P  = BIT(2),
62 	HOSTAPD_CHAN_WIDTH_40M  = BIT(3),
63 	HOSTAPD_CHAN_WIDTH_80   = BIT(4),
64 	HOSTAPD_CHAN_WIDTH_160  = BIT(5),
65 	HOSTAPD_CHAN_WIDTH_320  = BIT(6),
66 };
67 
68 /* Filter gratuitous ARP */
69 #define WPA_DATA_FRAME_FILTER_FLAG_ARP BIT(0)
70 /* Filter unsolicited Neighbor Advertisement */
71 #define WPA_DATA_FRAME_FILTER_FLAG_NA BIT(1)
72 /* Filter unicast IP packets encrypted using the GTK */
73 #define WPA_DATA_FRAME_FILTER_FLAG_GTK BIT(2)
74 
75 #define HOSTAPD_DFS_REGION_FCC	1
76 #define HOSTAPD_DFS_REGION_ETSI	2
77 #define HOSTAPD_DFS_REGION_JP	3
78 
79 /**
80  * enum reg_change_initiator - Regulatory change initiator
81  */
82 enum reg_change_initiator {
83 	REGDOM_SET_BY_CORE,
84 	REGDOM_SET_BY_USER,
85 	REGDOM_SET_BY_DRIVER,
86 	REGDOM_SET_BY_COUNTRY_IE,
87 	REGDOM_BEACON_HINT,
88 };
89 
90 /**
91  * enum reg_type - Regulatory change types
92  */
93 enum reg_type {
94 	REGDOM_TYPE_UNKNOWN,
95 	REGDOM_TYPE_COUNTRY,
96 	REGDOM_TYPE_WORLD,
97 	REGDOM_TYPE_CUSTOM_WORLD,
98 	REGDOM_TYPE_INTERSECTION,
99 };
100 
101 /**
102  * struct hostapd_wmm_rule - WMM regulatory rule
103  * @min_cwmin: Lower bound of CW_min value
104  * @min_cwmax: Lower bound of CW_max value
105  * @min_aifs: Lower bound of AIFS value
106  * @max_txop: Upper bound of TXOP, value in units of 32 usec
107  */
108 struct hostapd_wmm_rule {
109 	int min_cwmin;
110 	int min_cwmax;
111 	int min_aifs;
112 	int max_txop;
113 };
114 
115 /**
116  * struct hostapd_channel_data - Channel information
117  */
118 struct hostapd_channel_data {
119 	/**
120 	 * chan - Channel number (IEEE 802.11)
121 	 */
122 	short chan;
123 
124 	/**
125 	 * freq - Frequency in MHz
126 	 */
127 	int freq;
128 
129 	/**
130 	 * flag - Channel flags (HOSTAPD_CHAN_*)
131 	 */
132 	int flag;
133 
134 	/**
135 	 * allowed_bw - Allowed channel width bitmask
136 	 *
137 	 * See enum hostapd_chan_width_attr.
138 	 */
139 	u32 allowed_bw;
140 
141 	/**
142 	 * max_tx_power - Regulatory transmit power limit in dBm
143 	 */
144 	u8 max_tx_power;
145 
146 	/**
147 	 * survey_list - Linked list of surveys (struct freq_survey)
148 	 */
149 	struct dl_list survey_list;
150 
151 	/**
152 	 * min_nf - Minimum observed noise floor, in dBm, based on all
153 	 * surveyed channel data
154 	 */
155 	s8 min_nf;
156 
157 #ifdef CONFIG_ACS
158 	/**
159 	 * interference_factor - Computed interference factor on this
160 	 * channel (used internally in src/ap/acs.c; driver wrappers do not
161 	 * need to set this)
162 	 */
163 	long double interference_factor;
164 
165 	/**
166 	 * interference_bss_based - Indicates whether the interference was
167 	 * calculated from number of BSSs
168 	 */
169 	bool interference_bss_based;
170 #endif /* CONFIG_ACS */
171 
172 	/**
173 	 * dfs_cac_ms - DFS CAC time in milliseconds
174 	 */
175 	unsigned int dfs_cac_ms;
176 
177 	/**
178 	 * wmm_rules_valid - Indicates wmm_rules state
179 	 */
180 	int wmm_rules_valid;
181 
182 	/**
183 	 * wmm_rules - WMM regulatory rules
184 	 */
185 	struct hostapd_wmm_rule wmm_rules[WMM_AC_NUM];
186 
187 	/**
188 	 * punct_bitmap - RU puncturing bitmap
189 	 */
190 	u16 punct_bitmap;
191 };
192 
193 #define HE_MAC_CAPAB_0		0
194 #define HE_MAX_MAC_CAPAB_SIZE	6
195 #define HE_MAX_PHY_CAPAB_SIZE	11
196 #define HE_MAX_MCS_CAPAB_SIZE	12
197 #define HE_MAX_PPET_CAPAB_SIZE	25
198 
199 /**
200  * struct he_capabilities - IEEE 802.11ax HE capabilities
201  */
202 struct he_capabilities {
203 	u8 he_supported;
204 	u8 phy_cap[HE_MAX_PHY_CAPAB_SIZE];
205 	u8 mac_cap[HE_MAX_MAC_CAPAB_SIZE];
206 	u8 mcs[HE_MAX_MCS_CAPAB_SIZE];
207 	u8 ppet[HE_MAX_PPET_CAPAB_SIZE];
208 	u16 he_6ghz_capa;
209 };
210 
211 /* struct eht_capabilities - IEEE 802.11be EHT capabilities */
212 struct eht_capabilities {
213 	bool eht_supported;
214 	u16 mac_cap;
215 	u8 phy_cap[EHT_PHY_CAPAB_LEN];
216 	u8 mcs[EHT_MCS_NSS_CAPAB_LEN];
217 	u8 ppet[EHT_PPE_THRESH_CAPAB_LEN];
218 };
219 
220 #define HOSTAPD_MODE_FLAG_HT_INFO_KNOWN BIT(0)
221 #define HOSTAPD_MODE_FLAG_VHT_INFO_KNOWN BIT(1)
222 #define HOSTAPD_MODE_FLAG_HE_INFO_KNOWN BIT(2)
223 #define HOSTAPD_MODE_FLAG_EHT_INFO_KNOWN BIT(3)
224 
225 
226 enum ieee80211_op_mode {
227 	IEEE80211_MODE_INFRA = 0,
228 	IEEE80211_MODE_IBSS = 1,
229 	IEEE80211_MODE_AP = 2,
230 	IEEE80211_MODE_MESH = 5,
231 
232 	/* only add new entries before IEEE80211_MODE_NUM */
233 	IEEE80211_MODE_NUM
234 };
235 
236 /**
237  * struct ieee80211_edmg_config - EDMG configuration
238  *
239  * This structure describes most essential parameters needed
240  * for IEEE 802.11ay EDMG configuration
241  *
242  * @channels: Bitmap that indicates the 2.16 GHz channel(s)
243  *	that are allowed to be used for transmissions.
244  *	Bit 0 indicates channel 1, bit 1 indicates channel 2, etc.
245  *	Set to 0 to indicate EDMG not supported.
246  * @bw_config: Channel BW Configuration subfield encodes
247  *	the allowed channel bandwidth configurations
248  */
249 struct ieee80211_edmg_config {
250 	u8 channels;
251 	enum edmg_bw_config bw_config;
252 };
253 
254 /**
255  * struct hostapd_hw_modes - Supported hardware mode information
256  */
257 struct hostapd_hw_modes {
258 	/**
259 	 * mode - Hardware mode
260 	 */
261 	enum hostapd_hw_mode mode;
262 
263 	/**
264 	 * is_6ghz - Whether the mode information is for the 6 GHz band
265 	 */
266 	bool is_6ghz;
267 
268 	/**
269 	 * num_channels - Number of entries in the channels array
270 	 */
271 	int num_channels;
272 
273 	/**
274 	 * channels - Array of supported channels
275 	 */
276 	struct hostapd_channel_data *channels;
277 
278 	/**
279 	 * num_rates - Number of entries in the rates array
280 	 */
281 	int num_rates;
282 
283 	/**
284 	 * rates - Array of supported rates in 100 kbps units
285 	 */
286 	int *rates;
287 
288 	/**
289 	 * ht_capab - HT (IEEE 802.11n) capabilities
290 	 */
291 	u16 ht_capab;
292 
293 	/**
294 	 * mcs_set - MCS (IEEE 802.11n) rate parameters
295 	 */
296 	u8 mcs_set[16];
297 
298 	/**
299 	 * a_mpdu_params - A-MPDU (IEEE 802.11n) parameters
300 	 */
301 	u8 a_mpdu_params;
302 
303 	/**
304 	 * vht_capab - VHT (IEEE 802.11ac) capabilities
305 	 */
306 	u32 vht_capab;
307 
308 	/**
309 	 * vht_mcs_set - VHT MCS (IEEE 802.11ac) rate parameters
310 	 */
311 	u8 vht_mcs_set[8];
312 
313 	unsigned int flags; /* HOSTAPD_MODE_FLAG_* */
314 
315 	/**
316 	 * he_capab - HE (IEEE 802.11ax) capabilities
317 	 */
318 	struct he_capabilities he_capab[IEEE80211_MODE_NUM];
319 
320 	/**
321 	 * This structure describes the most essential parameters needed
322 	 * for IEEE 802.11ay EDMG configuration.
323 	 */
324 	struct ieee80211_edmg_config edmg;
325 
326 	/**
327 	 * eht_capab - EHT (IEEE 802.11be) capabilities
328 	 */
329 	struct eht_capabilities eht_capab[IEEE80211_MODE_NUM];
330 };
331 
332 
333 /**
334  * struct hostapd_multi_hw_info: Supported multiple underlying hardware info
335  */
336 struct hostapd_multi_hw_info {
337 	/**
338 	 * hw_idx - Hardware index
339 	 */
340 	u8 hw_idx;
341 
342 	/**
343 	 * start_freq - Frequency range start in MHz
344 	 */
345 	int start_freq;
346 
347 	/**
348 	 * end_freq - Frequency range end in MHz
349 	 */
350 	int end_freq;
351 };
352 
353 
354 #define IEEE80211_CAP_ESS	0x0001
355 #define IEEE80211_CAP_IBSS	0x0002
356 #define IEEE80211_CAP_PRIVACY	0x0010
357 #define IEEE80211_CAP_RRM	0x1000
358 
359 /* DMG (60 GHz) IEEE 802.11ad */
360 /* type - bits 0..1 */
361 #define IEEE80211_CAP_DMG_MASK	0x0003
362 #define IEEE80211_CAP_DMG_IBSS	0x0001 /* Tx by: STA */
363 #define IEEE80211_CAP_DMG_PBSS	0x0002 /* Tx by: PCP */
364 #define IEEE80211_CAP_DMG_AP	0x0003 /* Tx by: AP */
365 
366 #define WPA_SCAN_QUAL_INVALID		BIT(0)
367 #define WPA_SCAN_NOISE_INVALID		BIT(1)
368 #define WPA_SCAN_LEVEL_INVALID		BIT(2)
369 #define WPA_SCAN_LEVEL_DBM		BIT(3)
370 #define WPA_SCAN_ASSOCIATED		BIT(5)
371 
372 /**
373  * struct wpa_scan_res - Scan result for an BSS/IBSS
374  * @flags: information flags about the BSS/IBSS (WPA_SCAN_*)
375  * @bssid: BSSID
376  * @freq: frequency of the channel in MHz (e.g., 2412 = channel 1)
377  * @max_cw: the max channel width of the connection (calculated during scan
378  * result processing)
379  * @beacon_int: beacon interval in TUs (host byte order)
380  * @caps: capability information field in host byte order
381  * @qual: signal quality
382  * @noise: noise level
383  * @level: signal level
384  * @tsf: Timestamp
385  * @age: Age of the information in milliseconds (i.e., how many milliseconds
386  * ago the last Beacon or Probe Response frame was received)
387  * @est_throughput: Estimated throughput in kbps (this is calculated during
388  * scan result processing if left zero by the driver wrapper)
389  * @snr: Signal-to-noise ratio in dB (calculated during scan result processing)
390  * @parent_tsf: Time when the Beacon/Probe Response frame was received in terms
391  * of TSF of the BSS specified by %tsf_bssid.
392  * @tsf_bssid: The BSS that %parent_tsf TSF time refers to.
393  * @beacon_newer: Whether the Beacon frame data is known to be newer
394  * @mlo_tput_accumulated: Whether the scan result throughput is accumulated
395  * (used during scan result processing)
396  * @ie_len: length of the following IE field in octets
397  * @beacon_ie_len: length of the following Beacon IE field in octets
398  *
399  * This structure is used as a generic format for scan results from the
400  * driver. Each driver interface implementation is responsible for converting
401  * the driver or OS specific scan results into this format.
402  *
403  * If the driver does not support reporting all IEs, the IE data structure is
404  * constructed of the IEs that are available. This field will also need to
405  * include SSID in IE format. All drivers are encouraged to be extended to
406  * report all IEs to make it easier to support future additions.
407  *
408  * This structure data is followed by ie_len octets of IEs from Probe Response
409  * frame (or if the driver does not indicate source of IEs, these may also be
410  * from Beacon frame). After the first set of IEs, another set of IEs may follow
411  * (with beacon_ie_len octets of data) if the driver provides both IE sets.
412  */
413 struct wpa_scan_res {
414 	unsigned int flags;
415 	u8 bssid[ETH_ALEN];
416 	int freq;
417 	enum chan_width max_cw;
418 	u16 beacon_int;
419 	u16 caps;
420 	int qual;
421 	int noise;
422 	int level;
423 	u64 tsf;
424 	unsigned int age;
425 	unsigned int est_throughput;
426 	int snr;
427 	u64 parent_tsf;
428 	u8 tsf_bssid[ETH_ALEN];
429 	bool beacon_newer;
430 	bool mlo_tput_accumulated;
431 	size_t ie_len;
432 	size_t beacon_ie_len;
433 	/* Followed by ie_len + beacon_ie_len octets of IE data */
434 };
435 
436 /**
437  * struct wpa_scan_results - Scan results
438  * @res: Array of pointers to allocated variable length scan result entries
439  * @num: Number of entries in the scan result array
440  * @fetch_time: Time when the results were fetched from the driver
441  */
442 struct wpa_scan_results {
443 	struct wpa_scan_res **res;
444 	size_t num;
445 	struct os_reltime fetch_time;
446 };
447 
448 /**
449  * struct wpa_interface_info - Network interface information
450  * @next: Pointer to the next interface or NULL if this is the last one
451  * @ifname: Interface name that can be used with init() or init2()
452  * @desc: Human readable adapter description (e.g., vendor/model) or NULL if
453  *	not available
454  * @drv_name: struct wpa_driver_ops::name (note: unlike other strings, this one
455  *	is not an allocated copy, i.e., get_interfaces() caller will not free
456  *	this)
457  */
458 struct wpa_interface_info {
459 	struct wpa_interface_info *next;
460 	char *ifname;
461 	char *desc;
462 	const char *drv_name;
463 };
464 
465 #define WPAS_MAX_SCAN_SSIDS 16
466 
467 /**
468  * struct wpa_driver_scan_ssid - SSIDs to scan for
469  * @ssid - specific SSID to scan for (ProbeReq)
470  *	%NULL or zero-length SSID is used to indicate active scan
471  *	with wildcard SSID.
472  * @ssid_len - Length of the SSID in octets
473  */
474 struct wpa_driver_scan_ssid {
475 	const u8 *ssid;
476 	size_t ssid_len;
477 };
478 
479 struct t2lm_mapping {
480 	/**
481 	 * downlink - Bitmap of TIDs mapped with a link in downlink direction
482 	 */
483 	u8 downlink;
484 
485 	/**
486 	 * uplink - Bitmap of TIDs mapped with a link in uplink direction
487 	 */
488 	u8 uplink;
489 };
490 
491 /**
492  * struct wpa_driver_scan_params - Scan parameters
493  * Data for struct wpa_driver_ops::scan2().
494  */
495 struct wpa_driver_scan_params {
496 	/**
497 	 * ssids - SSIDs to scan for
498 	 */
499 	struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS];
500 
501 	/**
502 	 * num_ssids - Number of entries in ssids array
503 	 * Zero indicates a request for a passive scan.
504 	 */
505 	size_t num_ssids;
506 
507 	/**
508 	 * extra_ies - Extra IE(s) to add into Probe Request or %NULL
509 	 */
510 	const u8 *extra_ies;
511 
512 	/**
513 	 * extra_ies_len - Length of extra_ies in octets
514 	 */
515 	size_t extra_ies_len;
516 
517 	/**
518 	 * freqs - Array of frequencies to scan or %NULL for all frequencies
519 	 *
520 	 * The frequency is set in MHz. The array is zero-terminated.
521 	 */
522 	int *freqs;
523 
524 	/**
525 	 * filter_ssids - Filter for reporting SSIDs
526 	 *
527 	 * This optional parameter can be used to request the driver wrapper to
528 	 * filter scan results to include only the specified SSIDs. %NULL
529 	 * indicates that no filtering is to be done. This can be used to
530 	 * reduce memory needs for scan results in environments that have large
531 	 * number of APs with different SSIDs.
532 	 *
533 	 * The driver wrapper is allowed to take this allocated buffer into its
534 	 * own use by setting the pointer to %NULL. In that case, the driver
535 	 * wrapper is responsible for freeing the buffer with os_free() once it
536 	 * is not needed anymore.
537 	 */
538 	struct wpa_driver_scan_filter {
539 		u8 ssid[SSID_MAX_LEN];
540 		size_t ssid_len;
541 	} *filter_ssids;
542 
543 	/**
544 	 * num_filter_ssids - Number of entries in filter_ssids array
545 	 */
546 	size_t num_filter_ssids;
547 
548 	/**
549 	 * filter_rssi - Filter by RSSI
550 	 *
551 	 * The driver may filter scan results in firmware to reduce host
552 	 * wakeups and thereby save power. Specify the RSSI threshold in s32
553 	 * dBm.
554 	 */
555 	s32 filter_rssi;
556 
557 	/**
558 	 * p2p_probe - Used to disable CCK (802.11b) rates for P2P probes
559 	 *
560 	 * When set, the driver is expected to remove rates 1, 2, 5.5, and 11
561 	 * Mbps from the support rates element(s) in the Probe Request frames
562 	 * and not to transmit the frames at any of those rates.
563 	 */
564 	unsigned int p2p_probe:1;
565 
566 	/**
567 	 * only_new_results - Request driver to report only new results
568 	 *
569 	 * This is used to request the driver to report only BSSes that have
570 	 * been detected after this scan request has been started, i.e., to
571 	 * flush old cached BSS entries.
572 	 */
573 	unsigned int only_new_results:1;
574 
575 	/**
576 	 * low_priority - Requests driver to use a lower scan priority
577 	 *
578 	 * This is used to request the driver to use a lower scan priority
579 	 * if it supports such a thing.
580 	 */
581 	unsigned int low_priority:1;
582 
583 	/**
584 	 * mac_addr_rand - Requests driver to randomize MAC address
585 	 */
586 	unsigned int mac_addr_rand:1;
587 
588 	/**
589 	 * mac_addr - MAC address used with randomization. The address cannot be
590 	 * a multicast one, i.e., bit 0 of byte 0 should not be set.
591 	 */
592 	u8 *mac_addr;
593 
594 	/**
595 	 * mac_addr_mask - MAC address mask used with randomization.
596 	 *
597 	 * Bits that are 0 in the mask should be randomized. Bits that are 1 in
598 	 * the mask should be taken as is from mac_addr. The mask should not
599 	 * allow the generation of a multicast address, i.e., bit 0 of byte 0
600 	 * must be set.
601 	 */
602 	const u8 *mac_addr_mask;
603 
604 	/**
605 	 * sched_scan_plans - Scan plans for scheduled scan
606 	 *
607 	 * Each scan plan consists of the number of iterations to scan and the
608 	 * interval between scans. When a scan plan finishes (i.e., it was run
609 	 * for the specified number of iterations), the next scan plan is
610 	 * executed. The scan plans are executed in the order they appear in
611 	 * the array (lower index first). The last scan plan will run infinitely
612 	 * (until requested to stop), thus must not specify the number of
613 	 * iterations. All other scan plans must specify the number of
614 	 * iterations.
615 	 */
616 	struct sched_scan_plan {
617 		 u32 interval; /* In seconds */
618 		 u32 iterations; /* Zero to run infinitely */
619 	 } *sched_scan_plans;
620 
621 	/**
622 	 * sched_scan_plans_num - Number of scan plans in sched_scan_plans array
623 	 */
624 	 unsigned int sched_scan_plans_num;
625 
626 	/**
627 	 * sched_scan_start_delay - Delay to use before starting the first scan
628 	 *
629 	 * Delay (in seconds) before scheduling first scan plan cycle. The
630 	 * driver may ignore this parameter and start immediately (or at any
631 	 * other time), if this feature is not supported.
632 	 */
633 	 u32 sched_scan_start_delay;
634 
635 	/**
636 	 * bssid - Specific BSSID to scan for
637 	 *
638 	 * This optional parameter can be used to replace the default wildcard
639 	 * BSSID with a specific BSSID to scan for if results are needed from
640 	 * only a single BSS.
641 	 */
642 	const u8 *bssid;
643 
644 	/**
645 	 * scan_cookie - Unique identification representing the scan request
646 	 *
647 	 * This scan_cookie carries a unique identification representing the
648 	 * scan request if the host driver/kernel supports concurrent scan
649 	 * requests. This cookie is returned from the corresponding driver
650 	 * interface.
651 	 *
652 	 * Note: Unlike other parameters in this structure, scan_cookie is used
653 	 * only to return information instead of setting parameters for the
654 	 * scan.
655 	 */
656 	u64 scan_cookie;
657 
658 	 /**
659 	  * duration - Dwell time on each channel
660 	  *
661 	  * This optional parameter can be used to set the dwell time on each
662 	  * channel. In TUs.
663 	  */
664 	 u16 duration;
665 
666 	 /**
667 	  * duration_mandatory - Whether the specified duration is mandatory
668 	  *
669 	  * If this is set, the duration specified by the %duration field is
670 	  * mandatory (and the driver should reject the scan request if it is
671 	  * unable to comply with the specified duration), otherwise it is the
672 	  * maximum duration and the actual duration may be shorter.
673 	  */
674 	 unsigned int duration_mandatory:1;
675 
676 	/**
677 	 * relative_rssi_set - Whether relative RSSI parameters are set
678 	 */
679 	unsigned int relative_rssi_set:1;
680 
681 	/**
682 	 * relative_rssi - Relative RSSI for reporting better BSSs
683 	 *
684 	 * Amount of RSSI by which a BSS should be better than the current
685 	 * connected BSS to report the new BSS to user space.
686 	 */
687 	s8 relative_rssi;
688 
689 	/**
690 	 * relative_adjust_band - Band to which RSSI should be adjusted
691 	 *
692 	 * The relative_adjust_rssi should be added to the band specified
693 	 * by relative_adjust_band.
694 	 */
695 	enum set_band relative_adjust_band;
696 
697 	/**
698 	 * relative_adjust_rssi - RSSI to be added to relative_adjust_band
699 	 *
700 	 * An amount of relative_band_rssi should be added to the BSSs that
701 	 * belong to the band specified by relative_adjust_band while comparing
702 	 * with other bands for BSS reporting.
703 	 */
704 	s8 relative_adjust_rssi;
705 
706 	/**
707 	 * oce_scan
708 	 *
709 	 * Enable the following OCE scan features: (WFA OCE TechSpec v1.0)
710 	 * - Accept broadcast Probe Response frame.
711 	 * - Probe Request frame deferral and suppression.
712 	 * - Max Channel Time - driver fills FILS request params IE with
713 	 *   Maximum Channel Time.
714 	 * - Send 1st Probe Request frame in rate of minimum 5.5 Mbps.
715 	 */
716 	unsigned int oce_scan:1;
717 
718 	/**
719 	 * p2p_include_6ghz - Include 6 GHz channels for P2P full scan
720 	 *
721 	 */
722 	unsigned int p2p_include_6ghz:1;
723 
724 	/**
725 	 * non_coloc_6ghz - Force scanning of non-PSC 6 GHz channels
726 	 *
727 	 * If this is set, the driver should scan non-PSC channels from the
728 	 * scan request even if neighbor reports from 2.4/5 GHz APs did not
729 	 * report a co-located AP on these channels. The default is to scan
730 	 * non-PSC channels only if a co-located AP was reported on the channel.
731 	 */
732 	unsigned int non_coloc_6ghz:1;
733 
734 	/**
735 	 * min_probe_req_content - Minimize probe request content to only have
736 	 * minimal requirement elements, e.g., supported rates etc., and no
737 	 * additional elements other then those provided by user space.
738 	 */
739 	unsigned int min_probe_req_content:1;
740 
741 	/**
742 	 * link_id - Specify the link that is requesting the scan on an MLD
743 	 *
744 	 * This is set when operating as an AP MLD and doing an OBSS scan.
745 	 * -1 indicates that no particular link ID is set.
746 	 */
747 	s8 link_id;
748 
749 	/*
750 	 * NOTE: Whenever adding new parameters here, please make sure
751 	 * wpa_scan_clone_params() and wpa_scan_free_params() get updated with
752 	 * matching changes.
753 	 */
754 };
755 
756 /**
757  * struct wpa_driver_auth_params - Authentication parameters
758  * Data for struct wpa_driver_ops::authenticate().
759  */
760 struct wpa_driver_auth_params {
761 	int freq;
762 	const u8 *bssid;
763 	const u8 *ssid;
764 	size_t ssid_len;
765 	int auth_alg;
766 	const u8 *ie;
767 	size_t ie_len;
768 	const u8 *wep_key[4];
769 	size_t wep_key_len[4];
770 	int wep_tx_keyidx;
771 	int local_state_change;
772 
773 	/**
774 	 * p2p - Whether this connection is a P2P group
775 	 */
776 	int p2p;
777 
778 	/**
779 	 * auth_data - Additional elements for Authentication frame
780 	 *
781 	 * This buffer starts with the Authentication transaction sequence
782 	 * number field. If no special handling of such elements is needed, this
783 	 * pointer is %NULL. This is used with SAE and FILS.
784 	 */
785 	const u8 *auth_data;
786 
787 	/**
788 	 * auth_data_len - Length of auth_data buffer in octets
789 	 */
790 	size_t auth_data_len;
791 
792 	/**
793 	 * mld - Establish an MLD connection
794 	 */
795 	bool mld;
796 
797 	/**
798 	 * mld_link_id - The link ID of the MLD AP to which we are associating
799 	 */
800 	u8 mld_link_id;
801 
802 	/**
803 	 * The MLD AP address
804 	 */
805 	const u8 *ap_mld_addr;
806 };
807 
808 /**
809  * enum wps_mode - WPS mode
810  */
811 enum wps_mode {
812 	/**
813 	 * WPS_MODE_NONE - No WPS provisioning being used
814 	 */
815 	WPS_MODE_NONE,
816 
817 	/**
818 	 * WPS_MODE_OPEN - WPS provisioning with AP that is in open mode
819 	 */
820 	WPS_MODE_OPEN,
821 
822 	/**
823 	 * WPS_MODE_PRIVACY - WPS provisioning with AP that is using protection
824 	 */
825 	WPS_MODE_PRIVACY
826 };
827 
828 /**
829  * struct hostapd_freq_params - Channel parameters
830  */
831 struct hostapd_freq_params {
832 	/**
833 	 * mode - Mode/band (HOSTAPD_MODE_IEEE80211A, ..)
834 	 */
835 	enum hostapd_hw_mode mode;
836 
837 	/**
838 	 * freq - Primary channel center frequency in MHz
839 	 */
840 	int freq;
841 
842 	/**
843 	 * channel - Channel number
844 	 */
845 	int channel;
846 
847 	/**
848 	 * ht_enabled - Whether HT is enabled
849 	 */
850 	int ht_enabled;
851 
852 	/**
853 	 * sec_channel_offset - Secondary channel offset for HT40
854 	 *
855 	 * 0 = HT40 disabled,
856 	 * -1 = HT40 enabled, secondary channel below primary,
857 	 * 1 = HT40 enabled, secondary channel above primary
858 	 */
859 	int sec_channel_offset;
860 
861 	/**
862 	 * vht_enabled - Whether VHT is enabled
863 	 */
864 	int vht_enabled;
865 
866 	/**
867 	 * he_enabled - Whether HE is enabled
868 	 */
869 	int he_enabled;
870 
871 	/**
872 	 * center_freq1 - Segment 0 center frequency in MHz
873 	 *
874 	 * Valid for both HT and VHT.
875 	 */
876 	int center_freq1;
877 
878 	/**
879 	 * center_freq2 - Segment 1 center frequency in MHz
880 	 *
881 	 * Non-zero only for bandwidth 80 and an 80+80 channel
882 	 */
883 	int center_freq2;
884 
885 	/**
886 	 * bandwidth - Channel bandwidth in MHz (20, 40, 80, 160)
887 	 */
888 	int bandwidth;
889 
890 	/**
891 	 * This structure describes the most essential parameters needed
892 	 * for IEEE 802.11ay EDMG configuration.
893 	 */
894 	struct ieee80211_edmg_config edmg;
895 
896 	/**
897 	 * radar_background - Whether radar/CAC background is requested
898 	 */
899 	bool radar_background;
900 
901 	/**
902 	 * eht_enabled - Whether EHT is enabled
903 	 */
904 	bool eht_enabled;
905 
906 	/**
907 	 * punct_bitmap - Preamble puncturing bitmap
908 	 * Each bit corresponds to a 20 MHz subchannel, the lowest bit for the
909 	 * channel with the lowest frequency. A bit set to 1 indicates that the
910 	 * subchannel is punctured, otherwise active.
911 	 */
912 	u16 punct_bitmap;
913 
914 	/**
915 	 * link_id: If >=0 indicates the link of the AP MLD to configure
916 	 */
917 	int link_id;
918 };
919 
920 /**
921  * struct wpa_driver_sta_auth_params - Authentication parameters
922  * Data for struct wpa_driver_ops::sta_auth().
923  */
924 struct wpa_driver_sta_auth_params {
925 
926 	/**
927 	 * own_addr - Source address and BSSID for authentication frame
928 	 */
929 	const u8 *own_addr;
930 
931 	/**
932 	 * addr - MAC address of the station to associate
933 	 */
934 	const u8 *addr;
935 
936 	/**
937 	 * seq - authentication sequence number
938 	 */
939 	u16 seq;
940 
941 	/**
942 	 * status - authentication response status code
943 	 */
944 	u16 status;
945 
946 	/**
947 	 * ie - authentication frame ie buffer
948 	 */
949 	const u8 *ie;
950 
951 	/**
952 	 * len - ie buffer length
953 	 */
954 	size_t len;
955 
956 	/**
957 	 * fils_auth - Indicates whether FILS authentication is being performed
958 	 */
959 	int fils_auth;
960 
961 	/**
962 	 * fils_anonce - ANonce (required for FILS)
963 	 */
964 	u8 fils_anonce[WPA_NONCE_LEN];
965 
966 	/**
967 	 * fils_snonce - SNonce (required for FILS)
968 	*/
969 	u8 fils_snonce[WPA_NONCE_LEN];
970 
971 	/**
972 	 * fils_kek - key for encryption (required for FILS)
973 	 */
974 	u8 fils_kek[WPA_KEK_MAX_LEN];
975 
976 	/**
977 	 * fils_kek_len - Length of the fils_kek in octets (required for FILS)
978 	 */
979 	size_t fils_kek_len;
980 };
981 
982 struct wpa_driver_mld_params {
983 	/**
984 	 * mld_addr - AP's MLD address
985 	 */
986 	const u8 *mld_addr;
987 
988 	/**
989 	 * valid_links - The valid links including the association link
990 	 */
991 	u16 valid_links;
992 
993 	/**
994 	 * assoc_link_id - The link on which the association is performed
995 	 */
996 	u8 assoc_link_id;
997 
998 	/**
999 	 * mld_links - Link information
1000 	 *
1001 	 * Should include information on all the requested links for association
1002 	 * including the link on which the association should take place.
1003 	 * For the association link, the ies and ies_len should be NULL and
1004 	 * 0 respectively.
1005 	 */
1006 	struct {
1007 		int freq;
1008 		const u8 *bssid;
1009 		const u8 *ies;
1010 		size_t ies_len;
1011 		int error;
1012 		bool disabled;
1013 	} mld_links[MAX_NUM_MLD_LINKS];
1014 };
1015 
1016 /**
1017  * struct wpa_driver_associate_params - Association parameters
1018  * Data for struct wpa_driver_ops::associate().
1019  */
1020 struct wpa_driver_associate_params {
1021 	/**
1022 	 * bssid - BSSID of the selected AP
1023 	 * This can be %NULL, if ap_scan=2 mode is used and the driver is
1024 	 * responsible for selecting with which BSS to associate. */
1025 	const u8 *bssid;
1026 
1027 	/**
1028 	 * bssid_hint - BSSID of a proposed AP
1029 	 *
1030 	 * This indicates which BSS has been found a suitable candidate for
1031 	 * initial association for drivers that use driver/firmwate-based BSS
1032 	 * selection. Unlike the @bssid parameter, @bssid_hint does not limit
1033 	 * the driver from selecting other BSSes in the ESS.
1034 	 */
1035 	const u8 *bssid_hint;
1036 
1037 	/**
1038 	 * ssid - The selected SSID
1039 	 */
1040 	const u8 *ssid;
1041 
1042 	/**
1043 	 * ssid_len - Length of the SSID (1..32)
1044 	 */
1045 	size_t ssid_len;
1046 
1047 	/**
1048 	 * freq - channel parameters
1049 	 */
1050 	struct hostapd_freq_params freq;
1051 
1052 	/**
1053 	 * freq_hint - Frequency of the channel the proposed AP is using
1054 	 *
1055 	 * This provides a channel on which a suitable BSS has been found as a
1056 	 * hint for the driver. Unlike the @freq parameter, @freq_hint does not
1057 	 * limit the driver from selecting other channels for
1058 	 * driver/firmware-based BSS selection.
1059 	 */
1060 	int freq_hint;
1061 
1062 	/**
1063 	 * bg_scan_period - Background scan period in seconds, 0 to disable
1064 	 * background scan, or -1 to indicate no change to default driver
1065 	 * configuration
1066 	 */
1067 	int bg_scan_period;
1068 
1069 	/**
1070 	 * beacon_int - Beacon interval for IBSS or 0 to use driver default
1071 	 */
1072 	int beacon_int;
1073 
1074 	/**
1075 	 * wpa_ie - WPA information element for (Re)Association Request
1076 	 * WPA information element to be included in (Re)Association
1077 	 * Request (including information element id and length). Use
1078 	 * of this WPA IE is optional. If the driver generates the WPA
1079 	 * IE, it can use pairwise_suite, group_suite, group_mgmt_suite, and
1080 	 * key_mgmt_suite to select proper algorithms. In this case,
1081 	 * the driver has to notify wpa_supplicant about the used WPA
1082 	 * IE by generating an event that the interface code will
1083 	 * convert into EVENT_ASSOCINFO data (see below).
1084 	 *
1085 	 * When using WPA2/IEEE 802.11i, wpa_ie is used for RSN IE
1086 	 * instead. The driver can determine which version is used by
1087 	 * looking at the first byte of the IE (0xdd for WPA, 0x30 for
1088 	 * WPA2/RSN).
1089 	 *
1090 	 * When using WPS, wpa_ie is used for WPS IE instead of WPA/RSN IE.
1091 	 */
1092 	const u8 *wpa_ie;
1093 
1094 	/**
1095 	 * wpa_ie_len - length of the wpa_ie
1096 	 */
1097 	size_t wpa_ie_len;
1098 
1099 	/**
1100 	 * wpa_proto - Bitfield of WPA_PROTO_* values to indicate WPA/WPA2
1101 	 */
1102 	unsigned int wpa_proto;
1103 
1104 	/**
1105 	 * pairwise_suite - Selected pairwise cipher suite (WPA_CIPHER_*)
1106 	 *
1107 	 * This is usually ignored if @wpa_ie is used.
1108 	 */
1109 	unsigned int pairwise_suite;
1110 
1111 	/**
1112 	 * group_suite - Selected group cipher suite (WPA_CIPHER_*)
1113 	 *
1114 	 * This is usually ignored if @wpa_ie is used.
1115 	 */
1116 	unsigned int group_suite;
1117 
1118 	/**
1119 	 * mgmt_group_suite - Selected group management cipher suite (WPA_CIPHER_*)
1120 	 *
1121 	 * This is usually ignored if @wpa_ie is used.
1122 	 */
1123 	unsigned int mgmt_group_suite;
1124 
1125 	/**
1126 	 * key_mgmt_suite - Selected key management suite (WPA_KEY_MGMT_*)
1127 	 *
1128 	 * This is usually ignored if @wpa_ie is used.
1129 	 */
1130 	unsigned int key_mgmt_suite;
1131 
1132 	/**
1133 	 * allowed_key_mgmts - Bitfield of allowed key management suites
1134 	 * (WPA_KEY_MGMT_*) other than @key_mgmt_suite for the current
1135 	 * connection
1136 	 *
1137 	 * SME in the driver may choose key_mgmt from this list for the initial
1138 	 * connection or roaming. The driver which doesn't support this
1139 	 * ignores this parameter.
1140 	 */
1141 	unsigned int allowed_key_mgmts;
1142 
1143 	/**
1144 	 * auth_alg - Allowed authentication algorithms
1145 	 * Bit field of WPA_AUTH_ALG_*
1146 	 */
1147 	int auth_alg;
1148 
1149 	/**
1150 	 * mode - Operation mode (infra/ibss) IEEE80211_MODE_*
1151 	 */
1152 	int mode;
1153 
1154 	/**
1155 	 * wep_key - WEP keys for static WEP configuration
1156 	 */
1157 	const u8 *wep_key[4];
1158 
1159 	/**
1160 	 * wep_key_len - WEP key length for static WEP configuration
1161 	 */
1162 	size_t wep_key_len[4];
1163 
1164 	/**
1165 	 * wep_tx_keyidx - WEP TX key index for static WEP configuration
1166 	 */
1167 	int wep_tx_keyidx;
1168 
1169 	/**
1170 	 * mgmt_frame_protection - IEEE 802.11w management frame protection
1171 	 */
1172 	enum mfp_options mgmt_frame_protection;
1173 
1174 	/**
1175 	 * passphrase - RSN passphrase for PSK
1176 	 *
1177 	 * This value is made available only for WPA/WPA2-Personal (PSK) and
1178 	 * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK. This
1179 	 * is the 8..63 character ASCII passphrase, if available. Please note
1180 	 * that this can be %NULL if passphrase was not used to generate the
1181 	 * PSK. In that case, the psk field must be used to fetch the PSK.
1182 	 */
1183 	const char *passphrase;
1184 
1185 	/**
1186 	 * psk - RSN PSK (alternative for passphrase for PSK)
1187 	 *
1188 	 * This value is made available only for WPA/WPA2-Personal (PSK) and
1189 	 * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK. This
1190 	 * is the 32-octet (256-bit) PSK, if available. The driver wrapper
1191 	 * should be prepared to handle %NULL value as an error.
1192 	 */
1193 	const u8 *psk;
1194 
1195 	/**
1196 	 * sae_password - Password for SAE authentication
1197 	 *
1198 	 * This value is made available only for WPA3-Personal (SAE) and only
1199 	 * for drivers that set WPA_DRIVER_FLAGS2_SAE_OFFLOAD.
1200 	 */
1201 	const char *sae_password;
1202 
1203 	/**
1204 	 * sae_password_id - Password Identifier for SAE authentication
1205 	 *
1206 	 * This value is made available only for WPA3-Personal (SAE) and only
1207 	 * for drivers that set WPA_DRIVER_FLAGS2_SAE_OFFLOAD. If %NULL, SAE
1208 	 * password identifier is not used.
1209 	 */
1210 	const char *sae_password_id;
1211 
1212 	/**
1213 	 * drop_unencrypted - Enable/disable unencrypted frame filtering
1214 	 *
1215 	 * Configure the driver to drop all non-EAPOL frames (both receive and
1216 	 * transmit paths). Unencrypted EAPOL frames (ethertype 0x888e) must
1217 	 * still be allowed for key negotiation.
1218 	 */
1219 	int drop_unencrypted;
1220 
1221 	/**
1222 	 * prev_bssid - Previously used BSSID in this ESS
1223 	 *
1224 	 * When not %NULL, this is a request to use reassociation instead of
1225 	 * association.
1226 	 */
1227 	const u8 *prev_bssid;
1228 
1229 	/**
1230 	 * wps - WPS mode
1231 	 *
1232 	 * If the driver needs to do special configuration for WPS association,
1233 	 * this variable provides more information on what type of association
1234 	 * is being requested. Most drivers should not need to use this.
1235 	 */
1236 	enum wps_mode wps;
1237 
1238 	/**
1239 	 * p2p - Whether this connection is a P2P group
1240 	 */
1241 	int p2p;
1242 
1243 	/**
1244 	 * uapsd - UAPSD parameters for the network
1245 	 * -1 = do not change defaults
1246 	 * AP mode: 1 = enabled, 0 = disabled
1247 	 * STA mode: bits 0..3 UAPSD enabled for VO,VI,BK,BE
1248 	 */
1249 	int uapsd;
1250 
1251 	/**
1252 	 * fixed_bssid - Whether to force this BSSID in IBSS mode
1253 	 * 1 = Fix this BSSID and prevent merges.
1254 	 * 0 = Do not fix BSSID.
1255 	 */
1256 	int fixed_bssid;
1257 
1258 	/**
1259 	 * fixed_freq - Fix control channel in IBSS mode
1260 	 * 0 = don't fix control channel (default)
1261 	 * 1 = fix control channel; this prevents IBSS merging with another
1262 	 *	channel
1263 	 */
1264 	int fixed_freq;
1265 
1266 	/**
1267 	 * disable_ht - Disable HT (IEEE 802.11n) for this connection
1268 	 */
1269 	int disable_ht;
1270 
1271 	/**
1272 	 * htcaps - HT Capabilities over-rides
1273 	 *
1274 	 * Only bits set in the mask will be used, and not all values are used
1275 	 * by the kernel anyway. Currently, MCS, MPDU and MSDU fields are used.
1276 	 *
1277 	 * Pointer to struct ieee80211_ht_capabilities.
1278 	 */
1279 	const u8 *htcaps;
1280 
1281 	/**
1282 	 * htcaps_mask - HT Capabilities over-rides mask
1283 	 *
1284 	 * Pointer to struct ieee80211_ht_capabilities.
1285 	 */
1286 	const u8 *htcaps_mask;
1287 
1288 #ifdef CONFIG_VHT_OVERRIDES
1289 	/**
1290 	 * disable_vht - Disable VHT for this connection
1291 	 */
1292 	int disable_vht;
1293 
1294 	/**
1295 	 * VHT capability overrides.
1296 	 */
1297 	const struct ieee80211_vht_capabilities *vhtcaps;
1298 	const struct ieee80211_vht_capabilities *vhtcaps_mask;
1299 #endif /* CONFIG_VHT_OVERRIDES */
1300 
1301 #ifdef CONFIG_HE_OVERRIDES
1302 	/**
1303 	 * disable_he - Disable HE for this connection
1304 	 */
1305 	int disable_he;
1306 #endif /* CONFIG_HE_OVERRIDES */
1307 
1308 	/**
1309 	 * req_key_mgmt_offload - Request key management offload for connection
1310 	 *
1311 	 * Request key management offload for this connection if the device
1312 	 * supports it.
1313 	 */
1314 	int req_key_mgmt_offload;
1315 
1316 	/**
1317 	 * req_handshake_offload - Request EAPOL handshake offload
1318 	 *
1319 	 * Request EAPOL handshake offload for this connection if the device
1320 	 * supports it.
1321 	 */
1322 	int req_handshake_offload;
1323 
1324 	/**
1325 	 * Flag for indicating whether this association includes support for
1326 	 * RRM (Radio Resource Measurements)
1327 	 */
1328 	int rrm_used;
1329 
1330 	/**
1331 	 * pbss - If set, connect to a PCP in a PBSS. Otherwise, connect to an
1332 	 * AP as usual. Valid for DMG network only.
1333 	 */
1334 	int pbss;
1335 
1336 	/**
1337 	 * fils_kek - KEK for FILS association frame protection (AES-SIV)
1338 	 */
1339 	const u8 *fils_kek;
1340 
1341 	/**
1342 	 * fils_kek_len: Length of fils_kek in bytes
1343 	 */
1344 	size_t fils_kek_len;
1345 
1346 	/**
1347 	 * fils_nonces - Nonces for FILS association frame protection
1348 	 * (AES-SIV AAD)
1349 	 */
1350 	const u8 *fils_nonces;
1351 
1352 	/**
1353 	 * fils_nonces_len: Length of fils_nonce in bytes
1354 	 */
1355 	size_t fils_nonces_len;
1356 
1357 	/**
1358 	 * fils_erp_username - Username part of keyName-NAI
1359 	 */
1360 	const u8 *fils_erp_username;
1361 
1362 	/**
1363 	 * fils_erp_username_len - Length of fils_erp_username in bytes
1364 	 */
1365 	size_t fils_erp_username_len;
1366 
1367 	/**
1368 	 * fils_erp_realm - Realm/domain name to use in FILS ERP
1369 	 */
1370 	const u8 *fils_erp_realm;
1371 
1372 	/**
1373 	 * fils_erp_realm_len - Length of fils_erp_realm in bytes
1374 	 */
1375 	size_t fils_erp_realm_len;
1376 
1377 	/**
1378 	 * fils_erp_next_seq_num - The next sequence number to use in FILS ERP
1379 	 * messages
1380 	 */
1381 	u16 fils_erp_next_seq_num;
1382 
1383 	/**
1384 	 * fils_erp_rrk - Re-authentication root key (rRK) for the keyName-NAI
1385 	 * specified by fils_erp_username@fils_erp_realm.
1386 	 */
1387 	const u8 *fils_erp_rrk;
1388 
1389 	/**
1390 	 * fils_erp_rrk_len - Length of fils_erp_rrk in bytes
1391 	 */
1392 	size_t fils_erp_rrk_len;
1393 
1394 	/**
1395 	 * sae_pwe - SAE mechanism for PWE derivation
1396 	 * 0 = hunting-and-pecking loop only
1397 	 * 1 = hash-to-element only
1398 	 * 2 = both hunting-and-pecking loop and hash-to-element enabled
1399 	 */
1400 	enum sae_pwe sae_pwe;
1401 
1402 	/**
1403 	 * disable_eht - Disable EHT for this connection
1404 	 */
1405 	int disable_eht;
1406 
1407 	/*
1408 	 * mld_params - MLD association parameters
1409 	 */
1410 	struct wpa_driver_mld_params mld_params;
1411 
1412 	/**
1413 	 * rsn_overriding - wpa_supplicant RSN overriding support
1414 	 */
1415 	bool rsn_overriding;
1416 
1417 	/**
1418 	 * spp_amsdu - SPP A-MSDU used on this connection
1419 	 */
1420 	bool spp_amsdu;
1421 
1422 	/**
1423 	 * bssid_filter - Allowed BSSIDs for the current association
1424 	 * This can be %NULL to indicate no constraint. */
1425 	const u8 *bssid_filter;
1426 
1427 	/**
1428 	 * bssid_filter_count - Number of allowed BSSIDs
1429 	 */
1430 	unsigned int bssid_filter_count;
1431 
1432 	/**
1433 	 * p2p_mode - P2P R1 only, P2P R2 only, or PCC mode
1434 	 */
1435 	enum wpa_p2p_mode p2p_mode;
1436 
1437 	/**
1438 	 * eppke_supported - Whether EPPKE authentication is supported
1439 	 */
1440 	bool eppke_supported;
1441 
1442 	/**
1443 	 * ieee8021x_auth_supported - Whether IEEE 802.1X authentication in
1444 	 * Authentication frames is supported by wpa_supplicant
1445 	 */
1446 	bool ieee8021x_auth_supported;
1447 };
1448 
1449 enum hide_ssid {
1450 	NO_SSID_HIDING,
1451 	HIDDEN_SSID_ZERO_LEN,
1452 	HIDDEN_SSID_ZERO_CONTENTS
1453 };
1454 
1455 enum ch_switch_state {
1456 	CH_SW_STARTED,
1457 	CH_SW_FINISHED
1458 };
1459 
1460 struct wowlan_triggers {
1461 	u8 any;
1462 	u8 disconnect;
1463 	u8 magic_pkt;
1464 	u8 gtk_rekey_failure;
1465 	u8 eap_identity_req;
1466 	u8 four_way_handshake;
1467 	u8 rfkill_release;
1468 };
1469 
1470 struct unsol_bcast_probe_resp {
1471 	/**
1472 	 * Unsolicited broadcast Probe Response interval in TUs
1473 	 */
1474 	unsigned int unsol_bcast_probe_resp_interval;
1475 
1476 	/**
1477 	 * Unsolicited broadcast Probe Response template data
1478 	 */
1479 	u8 *unsol_bcast_probe_resp_tmpl;
1480 
1481 	/**
1482 	 * Unsolicited broadcast Probe Response template length
1483 	 */
1484 	size_t unsol_bcast_probe_resp_tmpl_len;
1485 };
1486 
1487 struct mbssid_data {
1488 	/**
1489 	 * mbssid_tx_iface - Transmitting interface of the MBSSID set
1490 	 */
1491 	const char *mbssid_tx_iface;
1492 
1493 	/**
1494 	 * mbssid_tx_iface_linkid - Link ID of the transmitting interface if
1495 	 * it is part of an MLD. Otherwise, -1.
1496 	 */
1497 	int mbssid_tx_iface_linkid;
1498 
1499 	/**
1500 	 * mbssid_index - The index of this BSS in the MBSSID set
1501 	 */
1502 	unsigned int mbssid_index;
1503 
1504 	/**
1505 	 * mbssid_elem - Buffer containing all MBSSID elements
1506 	 */
1507 	u8 *mbssid_elem;
1508 
1509 	/**
1510 	 * mbssid_elem_len - Total length of all MBSSID elements
1511 	 */
1512 	size_t mbssid_elem_len;
1513 
1514 	/**
1515 	 * mbssid_elem_count - The number of MBSSID elements
1516 	 */
1517 	u8 mbssid_elem_count;
1518 
1519 	/**
1520 	 * mbssid_elem_offset - Offsets to elements in mbssid_elem.
1521 	 * Kernel will use these offsets to generate multiple BSSID beacons.
1522 	 */
1523 	u8 **mbssid_elem_offset;
1524 
1525 	/**
1526 	 * ema - Enhanced MBSSID advertisements support.
1527 	 */
1528 	bool ema;
1529 
1530 	/**
1531 	 * rnr_elem - This buffer contains all of reduced neighbor report (RNR)
1532 	 * elements
1533 	 */
1534 	u8 *rnr_elem;
1535 
1536 	/**
1537 	 * rnr_elem_len - Length of rnr_elem buffer
1538 	 */
1539 	size_t rnr_elem_len;
1540 
1541 	/**
1542 	 * rnr_elem_count - Number of RNR elements
1543 	 */
1544 	u8 rnr_elem_count;
1545 
1546 	/**
1547 	 * rnr_elem_offset - The offsets to the elements in rnr_elem.
1548 	 * The driver will use these to include RNR elements in EMA beacons.
1549 	 */
1550 	u8 **rnr_elem_offset;
1551 };
1552 
1553 struct wpa_driver_ap_params {
1554 	/**
1555 	 * head - Beacon head from IEEE 802.11 header to IEs before TIM IE
1556 	 */
1557 	u8 *head;
1558 
1559 	/**
1560 	 * head_len - Length of the head buffer in octets
1561 	 */
1562 	size_t head_len;
1563 
1564 	/**
1565 	 * tail - Beacon tail following TIM IE
1566 	 */
1567 	u8 *tail;
1568 
1569 	/**
1570 	 * tail_len - Length of the tail buffer in octets
1571 	 */
1572 	size_t tail_len;
1573 
1574 	/**
1575 	 * dtim_period - DTIM period
1576 	 */
1577 	int dtim_period;
1578 
1579 	/**
1580 	 * beacon_int - Beacon interval
1581 	 */
1582 	int beacon_int;
1583 
1584 	/**
1585 	 * basic_rates: -1 terminated array of basic rates in 100 kbps
1586 	 *
1587 	 * This parameter can be used to set a specific basic rate set for the
1588 	 * BSS. If %NULL, default basic rate set is used.
1589 	 */
1590 	int *basic_rates;
1591 
1592 	/**
1593 	 * beacon_rate: Beacon frame data rate
1594 	 *
1595 	 * This parameter can be used to set a specific Beacon frame data rate
1596 	 * for the BSS. The interpretation of this value depends on the
1597 	 * rate_type (legacy: in 100 kbps units, HT: HT-MCS, VHT: VHT-MCS,
1598 	 * HE: HE-MCS). If beacon_rate == 0 and rate_type == 0
1599 	 * (BEACON_RATE_LEGACY), the default Beacon frame data rate is used.
1600 	 */
1601 	unsigned int beacon_rate;
1602 
1603 	/**
1604 	 * beacon_rate_type: Beacon data rate type (legacy/HT/VHT/HE)
1605 	 */
1606 	enum beacon_rate_type rate_type;
1607 
1608 	/**
1609 	 * proberesp - Probe Response template
1610 	 *
1611 	 * This is used by drivers that reply to Probe Requests internally in
1612 	 * AP mode and require the full Probe Response template.
1613 	 */
1614 	u8 *proberesp;
1615 
1616 	/**
1617 	 * proberesp_len - Length of the proberesp buffer in octets
1618 	 */
1619 	size_t proberesp_len;
1620 
1621 	/**
1622 	 * ssid - The SSID to use in Beacon/Probe Response frames
1623 	 */
1624 	const u8 *ssid;
1625 
1626 	/**
1627 	 * ssid_len - Length of the SSID (1..32)
1628 	 */
1629 	size_t ssid_len;
1630 
1631 	/**
1632 	 * hide_ssid - Whether to hide the SSID
1633 	 */
1634 	enum hide_ssid hide_ssid;
1635 
1636 	/**
1637 	 * pairwise_ciphers - WPA_CIPHER_* bitfield
1638 	 */
1639 	unsigned int pairwise_ciphers;
1640 
1641 	/**
1642 	 * group_cipher - WPA_CIPHER_*
1643 	 */
1644 	unsigned int group_cipher;
1645 
1646 	/**
1647 	 * key_mgmt_suites - WPA_KEY_MGMT_* bitfield
1648 	 */
1649 	unsigned int key_mgmt_suites;
1650 
1651 	/**
1652 	 * auth_algs - WPA_AUTH_ALG_* bitfield
1653 	 */
1654 	unsigned int auth_algs;
1655 
1656 	/**
1657 	 * wpa_version - WPA_PROTO_* bitfield
1658 	 */
1659 	unsigned int wpa_version;
1660 
1661 	/**
1662 	 * privacy - Whether privacy is used in the BSS
1663 	 */
1664 	int privacy;
1665 
1666 	/**
1667 	 * beacon_ies - WPS/P2P IE(s) for Beacon frames
1668 	 *
1669 	 * This is used to add IEs like WPS IE and P2P IE by drivers that do
1670 	 * not use the full Beacon template.
1671 	 */
1672 	const struct wpabuf *beacon_ies;
1673 
1674 	/**
1675 	 * proberesp_ies - P2P/WPS IE(s) for Probe Response frames
1676 	 *
1677 	 * This is used to add IEs like WPS IE and P2P IE by drivers that
1678 	 * reply to Probe Request frames internally.
1679 	 */
1680 	const struct wpabuf *proberesp_ies;
1681 
1682 	/**
1683 	 * assocresp_ies - WPS IE(s) for (Re)Association Response frames
1684 	 *
1685 	 * This is used to add IEs like WPS IE by drivers that reply to
1686 	 * (Re)Association Request frames internally.
1687 	 */
1688 	const struct wpabuf *assocresp_ies;
1689 
1690 	/**
1691 	 * isolate - Whether to isolate frames between associated stations
1692 	 *
1693 	 * If this is non-zero, the AP is requested to disable forwarding of
1694 	 * frames between associated stations.
1695 	 */
1696 	int isolate;
1697 
1698 	/**
1699 	 * cts_protect - Whether CTS protection is enabled
1700 	 */
1701 	int cts_protect;
1702 
1703 	/**
1704 	 * preamble - Whether short preamble is enabled
1705 	 */
1706 	int preamble;
1707 
1708 	/**
1709 	 * short_slot_time - Whether short slot time is enabled
1710 	 *
1711 	 * 0 = short slot time disable, 1 = short slot time enabled, -1 = do
1712 	 * not set (e.g., when 802.11g mode is not in use)
1713 	 */
1714 	int short_slot_time;
1715 
1716 	/**
1717 	 * ht_opmode - HT operation mode or -1 if HT not in use
1718 	 */
1719 	int ht_opmode;
1720 
1721 	/**
1722 	 * interworking - Whether Interworking is enabled
1723 	 */
1724 	int interworking;
1725 
1726 	/**
1727 	 * hessid - Homogeneous ESS identifier or %NULL if not set
1728 	 */
1729 	const u8 *hessid;
1730 
1731 	/**
1732 	 * access_network_type - Access Network Type (0..15)
1733 	 *
1734 	 * This is used for filtering Probe Request frames when Interworking is
1735 	 * enabled.
1736 	 */
1737 	u8 access_network_type;
1738 
1739 	/**
1740 	 * ap_max_inactivity - Timeout in seconds to detect STA's inactivity
1741 	 *
1742 	 * This is used by driver which advertises this capability.
1743 	 */
1744 	int ap_max_inactivity;
1745 
1746 	/**
1747 	 * ctwindow - Client Traffic Window (in TUs)
1748 	 */
1749 	u8 p2p_go_ctwindow;
1750 
1751 	/**
1752 	 * disable_dgaf - Whether group-addressed frames are disabled
1753 	 */
1754 	int disable_dgaf;
1755 
1756 	/**
1757 	 * freq - Channel parameters for dynamic bandwidth changes
1758 	 */
1759 	struct hostapd_freq_params *freq;
1760 
1761 	/**
1762 	 * reenable - Whether this is to re-enable beaconing
1763 	 */
1764 	int reenable;
1765 
1766 	/**
1767 	 * pbss - Whether to start a PCP (in PBSS) instead of an AP in
1768 	 * infrastructure BSS. Valid only for DMG network.
1769 	 */
1770 	int pbss;
1771 
1772 	/**
1773 	 * multicast_to_unicast - Whether to use multicast_to_unicast
1774 	 *
1775 	 * If this is non-zero, the AP is requested to perform multicast to
1776 	 * unicast conversion for ARP, IPv4, and IPv6 frames (possibly within
1777 	 * 802.1Q). If enabled, such frames are to be sent to each station
1778 	 * separately, with the DA replaced by their own MAC address rather
1779 	 * than the group address.
1780 	 *
1781 	 * Note that this may break certain expectations of the receiver, such
1782 	 * as the ability to drop unicast IP packets received within multicast
1783 	 * L2 frames, or the ability to not send ICMP destination unreachable
1784 	 * messages for packets received in L2 multicast (which is required,
1785 	 * but the receiver can't tell the difference if this new option is
1786 	 * enabled.)
1787 	 *
1788 	 * This also doesn't implement the 802.11 DMS (directed multicast
1789 	 * service).
1790 	 */
1791 	int multicast_to_unicast;
1792 
1793 	/**
1794 	 * ftm_responder - Whether FTM responder is enabled
1795 	 */
1796 	int ftm_responder;
1797 
1798 	/**
1799 	 * lci - Binary data, the content of an LCI report IE with type 8 as
1800 	 * defined in IEEE Std 802.11-2016, 9.4.2.22.10
1801 	 */
1802 	const struct wpabuf *lci;
1803 
1804 	/**
1805 	 * civic - Binary data, the content of a measurement report IE with
1806 	 * type 11 as defined in IEEE Std 802.11-2016, 9.4.2.22.13
1807 	 */
1808 	const struct wpabuf *civic;
1809 
1810 	/**
1811 	 * he_spr_ctrl - Spatial Reuse control field of SPR element
1812 	 */
1813 	u8 he_spr_ctrl;
1814 
1815 	/**
1816 	 * he_spr_non_srg_obss_pd_max_offset - Non-SRG Maximum TX power offset
1817 	 */
1818 	u8 he_spr_non_srg_obss_pd_max_offset;
1819 
1820 	/**
1821 	 * he_spr_srg_obss_pd_min_offset - Minimum TX power offset
1822 	 */
1823 	u8 he_spr_srg_obss_pd_min_offset;
1824 
1825 	/**
1826 	 * he_spr_srg_obss_pd_max_offset - Maximum TX power offset
1827 	 */
1828 	u8 he_spr_srg_obss_pd_max_offset;
1829 
1830 	/**
1831 	 * he_spr_bss_color_bitmap - BSS color values used by members of the
1832 	 * SRG.
1833 	 */
1834 	u8 he_spr_bss_color_bitmap[8];
1835 
1836 	/**
1837 	 * he_spr_partial_bssid_bitmap - Partial BSSID values used by members
1838 	 * of the SRG.
1839 	 */
1840 	u8 he_spr_partial_bssid_bitmap[8];
1841 
1842 	/**
1843 	 * he_bss_color - Whether the BSS Color is disabled
1844 	 */
1845 	int he_bss_color_disabled;
1846 
1847 	/**
1848 	 * he_bss_color_partial - The BSS Color AID equation
1849 	 */
1850 	int he_bss_color_partial;
1851 
1852 	/**
1853 	 * he_bss_color - The BSS Color of the AP
1854 	 */
1855 	int he_bss_color;
1856 
1857 	/**
1858 	 * twt_responder - Whether Target Wait Time responder is enabled
1859 	 */
1860 	int twt_responder;
1861 
1862 	/**
1863 	 * sae_pwe - SAE mechanism for PWE derivation
1864 	 * 0 = hunting-and-pecking loop only
1865 	 * 1 = hash-to-element only
1866 	 * 2 = both hunting-and-pecking loop and hash-to-element enabled
1867 	 */
1868 	enum sae_pwe sae_pwe;
1869 
1870 	/**
1871 	 * FILS Discovery frame minimum interval in TUs
1872 	 */
1873 	u32 fd_min_int;
1874 
1875 	/**
1876 	 * FILS Discovery frame maximum interval in TUs (0 = FD frame disabled)
1877 	 */
1878 	u32 fd_max_int;
1879 
1880 	/**
1881 	 * FILS Discovery frame template data
1882 	 */
1883 	u8 *fd_frame_tmpl;
1884 
1885 	/**
1886 	 * FILS Discovery frame template length
1887 	 */
1888 	size_t fd_frame_tmpl_len;
1889 
1890 	/**
1891 	 * mbssid - MBSSID element related params for Beacon frames
1892 	 *
1893 	 * This is used to add MBSSID element in beacon data.
1894 	 */
1895 	struct mbssid_data mbssid;
1896 
1897 	/**
1898 	 * punct_bitmap - Preamble puncturing bitmap
1899 	 * Each bit corresponds to a 20 MHz subchannel, the lowest bit for the
1900 	 * channel with the lowest frequency. A bit set to 1 indicates that the
1901 	 * subchannel is punctured, otherwise active.
1902 	 */
1903 	u16 punct_bitmap;
1904 
1905 
1906 	/* Unsolicited broadcast Probe Response data */
1907 	struct unsol_bcast_probe_resp ubpr;
1908 
1909 	/**
1910 	 * allowed_freqs - List of allowed 20 MHz channel center frequencies in
1911 	 * MHz for AP operation. Drivers which support this parameter will
1912 	 * generate a new list based on this provided list by filtering out
1913 	 * channels that cannot be used at that time due to regulatory or other
1914 	 * constraints. The resulting list is used as the list of all allowed
1915 	 * channels whenever performing operations like ACS and DFS.
1916 	 */
1917 	int *allowed_freqs;
1918 
1919 	/*
1920 	 * mld_ap - Whether operating as an AP MLD
1921 	 */
1922 	bool mld_ap;
1923 
1924 	/**
1925 	 * mld_link_id - Link id for MLD BSS's
1926 	 */
1927 	u8 mld_link_id;
1928 
1929 	/**
1930 	 * psk - PSK passed to the driver for 4-way handshake offload
1931 	 */
1932 	u8 psk[PMK_LEN];
1933 
1934 	/**
1935 	 * psk_len - PSK length in bytes (0 = not set)
1936 	 */
1937 	size_t psk_len;
1938 
1939 	/**
1940 	 * sae_password - SAE password for SAE offload
1941 	 */
1942 	const char *sae_password;
1943 };
1944 
1945 struct wpa_driver_mesh_bss_params {
1946 #define WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS		0x00000001
1947 #define WPA_DRIVER_MESH_CONF_FLAG_PEER_LINK_TIMEOUT	0x00000002
1948 #define WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS	0x00000004
1949 #define WPA_DRIVER_MESH_CONF_FLAG_HT_OP_MODE		0x00000008
1950 #define WPA_DRIVER_MESH_CONF_FLAG_RSSI_THRESHOLD	0x00000010
1951 #define WPA_DRIVER_MESH_CONF_FLAG_FORWARDING		0x00000020
1952 	/*
1953 	 * TODO: Other mesh configuration parameters would go here.
1954 	 * See NL80211_MESHCONF_* for all the mesh config parameters.
1955 	 */
1956 	unsigned int flags;
1957 	int auto_plinks;
1958 	int peer_link_timeout;
1959 	int max_peer_links;
1960 	int rssi_threshold;
1961 	int forwarding;
1962 	u16 ht_opmode;
1963 };
1964 
1965 struct wpa_driver_mesh_join_params {
1966 	const u8 *meshid;
1967 	int meshid_len;
1968 	const int *basic_rates;
1969 	const u8 *ies;
1970 	int ie_len;
1971 	struct hostapd_freq_params freq;
1972 	int beacon_int;
1973 	int dtim_period;
1974 	struct wpa_driver_mesh_bss_params conf;
1975 #define WPA_DRIVER_MESH_FLAG_USER_MPM	0x00000001
1976 #define WPA_DRIVER_MESH_FLAG_DRIVER_MPM	0x00000002
1977 #define WPA_DRIVER_MESH_FLAG_SAE_AUTH	0x00000004
1978 #define WPA_DRIVER_MESH_FLAG_AMPE	0x00000008
1979 	unsigned int flags;
1980 	bool handle_dfs;
1981 };
1982 
1983 struct wpa_driver_set_key_params {
1984 	/**
1985 	 * ifname - Interface name (for multi-SSID/VLAN support) */
1986 	const char *ifname;
1987 
1988 	/**
1989 	 * own_addr - Own MAC address identifying the virtual interface for
1990 	 * the key operation, or %NULL to use the default interface (ifname)
1991 	 */
1992 	const u8 *own_addr;
1993 
1994 	/**
1995 	 * alg - Encryption algorithm
1996 	 *
1997 	 * (%WPA_ALG_NONE, %WPA_ALG_WEP, %WPA_ALG_TKIP, %WPA_ALG_CCMP,
1998 	 * %WPA_ALG_BIP_AES_CMAC_128, %WPA_ALG_GCMP, %WPA_ALG_GCMP_256,
1999 	 * %WPA_ALG_CCMP_256, %WPA_ALG_BIP_GMAC_128, %WPA_ALG_BIP_GMAC_256,
2000 	 * %WPA_ALG_BIP_CMAC_256);
2001 	 * %WPA_ALG_NONE clears the key. */
2002 	enum wpa_alg alg;
2003 
2004 	/**
2005 	 * addr - Address of the peer STA
2006 	 *
2007 	 * (BSSID of the current AP when setting pairwise key in station mode),
2008 	 * ff:ff:ff:ff:ff:ff for broadcast keys, %NULL for default keys that
2009 	 * are used both for broadcast and unicast; when clearing keys, %NULL
2010 	 * is used to indicate that both the broadcast-only and default key of
2011 	 * the specified key index is to be cleared */
2012 	const u8 *addr;
2013 
2014 	/**
2015 	 * key_idx - Key index
2016 	 *
2017 	 * (0..3), usually 0 for unicast keys; 4..5 for IGTK; 6..7 for BIGTK */
2018 	int key_idx;
2019 
2020 	/**
2021 	 * set_tx - Configure this key as the default Tx key
2022 	 *
2023 	 * Only used when driver does not support separate unicast/individual
2024 	 * key */
2025 	int set_tx;
2026 
2027 	/**
2028 	 * seq - Sequence number/packet number
2029 	 *
2030 	 * seq_len octets, the next packet number to be used for in replay
2031 	 * protection; configured for Rx keys (in most cases, this is only used
2032 	 * with broadcast keys and set to zero for unicast keys); %NULL if not
2033 	 * set */
2034 	const u8 *seq;
2035 
2036 	/**
2037 	 * seq_len - Length of the seq, depends on the algorithm
2038 	 *
2039 	 * TKIP: 6 octets, CCMP/GCMP: 6 octets, IGTK: 6 octets */
2040 	size_t seq_len;
2041 
2042 	/**
2043 	 * key - Key buffer
2044 	 *
2045 	 * TKIP: 16-byte temporal key, 8-byte Tx Mic key, 8-byte Rx Mic Key */
2046 	const u8 *key;
2047 
2048 	/**
2049 	 * key_len - Length of the key buffer in octets
2050 	 *
2051 	 * WEP: 5 or 13, TKIP: 32, CCMP/GCMP: 16, IGTK: 16 */
2052 	size_t key_len;
2053 
2054 	/**
2055 	 * vlan_id - VLAN index (0..4095) for VLAN offload cases */
2056 	int vlan_id;
2057 
2058 	/**
2059 	 * key_flag - Additional key flags
2060 	 *
2061 	 * %KEY_FLAG_MODIFY
2062 	 *  Set when an already installed key must be updated.
2063 	 *  So far the only use-case is changing RX/TX status for
2064 	 *  pairwise keys. Must not be set when deleting a key.
2065 	 * %KEY_FLAG_DEFAULT
2066 	 *  Set when the key is also a default key. Must not be set when
2067 	 *  deleting a key.
2068 	 * %KEY_FLAG_RX
2069 	 *  The key is valid for RX. Must not be set when deleting a key.
2070 	 * %KEY_FLAG_TX
2071 	 *  The key is valid for TX. Must not be set when deleting a key.
2072 	 * %KEY_FLAG_GROUP
2073 	 *  The key is a broadcast or group key.
2074 	 * %KEY_FLAG_PAIRWISE
2075 	 *  The key is a pairwise key.
2076 	 * %KEY_FLAG_PMK
2077 	 *  The key is a Pairwise Master Key (PMK).
2078 	 *
2079 	 * Valid and pre-defined combinations are:
2080 	 * %KEY_FLAG_GROUP_RX_TX
2081 	 *  WEP key not to be installed as default key.
2082 	 * %KEY_FLAG_GROUP_RX_TX_DEFAULT
2083 	 *  Default WEP or WPA-NONE key.
2084 	 * %KEY_FLAG_GROUP_RX
2085 	 *  GTK key valid for RX only.
2086 	 * %KEY_FLAG_GROUP_TX_DEFAULT
2087 	 *  GTK key valid for TX only, immediately taking over TX.
2088 	 * %KEY_FLAG_PAIRWISE_RX_TX
2089 	 *  Pairwise key immediately becoming the active pairwise key. If this
2090 	 *  key was previously set as an alternative RX-only key with
2091 	 *  %KEY_FLAG_PAIRWISE_RX | %KEY_FLAG_NEXT, the alternative RX-only key
2092 	 *  is taken into use for both TX and RX without changing the RX counter
2093 	 *  values.
2094 	 * %KEY_FLAG_PAIRWISE_RX
2095 	 *  Pairwise key not yet valid for TX. (Only usable when Extended
2096 	 *  Key ID is supported by the driver or when configuring the next TK
2097 	 *  for RX-only with %KEY_FLAG_NEXT in which case the new TK can be used
2098 	 *  as an alternative key for decrypting received frames without
2099 	 *  replacing the possibly already configured old TK.)
2100 	 * %KEY_FLAG_PAIRWISE_RX_TX_MODIFY
2101 	 *  Enable TX for a pairwise key installed with
2102 	 *  KEY_FLAG_PAIRWISE_RX.
2103 	 *
2104 	 * Not a valid standalone key type but pre-defined to be combined
2105 	 * with other key_flags:
2106 	 * %KEY_FLAG_RX_TX
2107 	 *  RX/TX key. */
2108 	enum key_flag key_flag;
2109 
2110 	/**
2111 	 * link_id - MLO Link ID
2112 	 *
2113 	 * Set to a valid Link ID (0-14) when applicable, otherwise -1. */
2114 	int link_id;
2115 
2116 	/**
2117 	 * ltf_keyseed_len - Length of the LTF keyseed in octets
2118 	 *
2119 	 * Set to 0 if no LTF keyseed is provided.
2120 	 */
2121 	u8 ltf_keyseed_len;
2122 
2123 	/**
2124 	 * ltf_keyseed - LTF keyseed for secure ranging (IEEE 802.11az)
2125 	 *
2126 	 * Used to configure the secure LTF key seed for a peer measurement
2127 	 * session. Set to NULL if not applicable.
2128 	 */
2129 	const u8 *ltf_keyseed;
2130 };
2131 
2132 enum wpa_driver_if_type {
2133 	/**
2134 	 * WPA_IF_STATION - Station mode interface
2135 	 */
2136 	WPA_IF_STATION,
2137 
2138 	/**
2139 	 * WPA_IF_AP_VLAN - AP mode VLAN interface
2140 	 *
2141 	 * This interface shares its address and Beacon frame with the main
2142 	 * BSS.
2143 	 */
2144 	WPA_IF_AP_VLAN,
2145 
2146 	/**
2147 	 * WPA_IF_AP_BSS - AP mode BSS interface
2148 	 *
2149 	 * This interface has its own address and Beacon frame.
2150 	 */
2151 	WPA_IF_AP_BSS,
2152 
2153 	/**
2154 	 * WPA_IF_P2P_GO - P2P Group Owner
2155 	 */
2156 	WPA_IF_P2P_GO,
2157 
2158 	/**
2159 	 * WPA_IF_P2P_CLIENT - P2P Client
2160 	 */
2161 	WPA_IF_P2P_CLIENT,
2162 
2163 	/**
2164 	 * WPA_IF_P2P_GROUP - P2P Group interface (will become either
2165 	 * WPA_IF_P2P_GO or WPA_IF_P2P_CLIENT, but the role is not yet known)
2166 	 */
2167 	WPA_IF_P2P_GROUP,
2168 
2169 	/**
2170 	 * WPA_IF_P2P_DEVICE - P2P Device interface is used to identify the
2171 	 * abstracted P2P Device function in the driver
2172 	 */
2173 	WPA_IF_P2P_DEVICE,
2174 
2175 	/*
2176 	 * WPA_IF_MESH - Mesh interface
2177 	 */
2178 	WPA_IF_MESH,
2179 
2180 	/*
2181 	 * WPA_IF_TDLS - TDLS offchannel interface (used for pref freq only)
2182 	 */
2183 	WPA_IF_TDLS,
2184 
2185 	/*
2186 	 * WPA_IF_IBSS - IBSS interface (used for pref freq only)
2187 	 */
2188 	WPA_IF_IBSS,
2189 
2190 	/*
2191 	 * WPA_IF_NAN - NAN Device
2192 	 */
2193 	WPA_IF_NAN,
2194 
2195 	/*
2196 	 * WPA_IF_NAN_DATA - NAN Data interface
2197 	 */
2198 	WPA_IF_NAN_DATA,
2199 
2200 	/*
2201 	 * WPA_IF_PD - Proxymity Detection (PD) Device
2202 	 */
2203 	WPA_IF_PD,
2204 
2205 	/* keep last */
2206 	WPA_IF_MAX
2207 };
2208 
2209 /**
2210  * struct nan_capa - NAN capabilities
2211  *
2212  * @drv_flags: NAN capability flags (WPA_DRIVER_FLAGS_NAN_*)
2213  * @num_radios: Maximum number of NAN radios
2214  * @sched_chans: Maximum number of channels in NAN schedule (per map)
2215  * @slot_duration: NAN schedule bitmap slot duration (16, 32, 64, or 128) in TUs
2216  * @schedule_period: Schedule period (powers of 2 in range: 128-8192) in TUs
2217  * @max_channel_switch_time: Max channel switch time in microseconds
2218  * @num_antennas: Number of antennas (lower nibble TX, upper nibble RX)
2219  * @op_modes: NAN capability operation modes
2220  * @dev_capa: NAN device capabilities
2221  * @ht_capab: HT capabilities information as defined in IEEE Std 802.11-2024,
2222  *     9.4.2.54.2 (HT Capability Information field)
2223  * @ht_ampdu_params: HT A-MPDU parameters as defined in IEEE Std 802.11-2024,
2224  *     9.4.2.54.3 (A-MPDU Parameters field)
2225  * @ht_mcs_set: HT MCS set as defined in IEEE Std 802.11-2024,9.4.2.54.4
2226  *     (Supported MCS Set field)
2227  * @vht_capab: VHT capabilities information as defined in IEEE Std 802.11-2024,
2228  *     9.4.2.156.2 (VHT Capabilities Information field)
2229  * @vht_mcs_set: VHT MCS set as defined in IEEE Std 802.11-2024, 9.4.2.156.3
2230  *     (Supported VHT-MCS and NSS Set field)
2231  * @vht_valid: Whether &vht_capab and &vht_mcs_set are both valid
2232  * @he_capab: HE capabilities. See &struct he_capabilities.
2233  * @he_valid: Whether HE capabilities are valid
2234  *
2235  * For the schedule capabilities, even if the driver/device supports multiple
2236  * options, only a single option should be selected. For example, if both 16 TU
2237  * and 32 TU slot durations are supported, the driver should report the shortest
2238  * supported slot duration (16 TU). For schedule period, the driver should
2239  * report the maximum supported period, as longer periods can always be
2240  * represented by repetitions of the shorter schedule bitmap. In any case,
2241  * 512/16 configuration is recommended for better interoperability.
2242  *
2243  * As for the PHY capabilities, HT must be supported for NAN Data path, and
2244  * without valid HT capabilities NAN Data path would be disabled.
2245  *
2246  * TODO: For now support only a single PHY capabilities configuration. This
2247  * might need to be extended to support multiple configurations in the future.
2248  */
2249 struct nan_capa {
2250 /* Driver supports dual band NAN operation */
2251 #define WPA_DRIVER_FLAGS_NAN_SUPPORT_DUAL_BAND		0x00000001
2252 /* Driver supports NAN synchronization configuration */
2253 #define WPA_DRIVER_FLAGS_NAN_SUPPORT_SYNC_CONFIG	0x00000002
2254 /* Driver supports DW notifications and SDF TX/RX over NAN device interface */
2255 #define WPA_DRIVER_FLAGS_NAN_SUPPORT_USERSPACE_DE	0x00000004
2256 /** Driver supports NAN Data path */
2257 #define WPA_DRIVER_FLAGS_NAN_SUPPORT_NDP		0x00000008
2258 /** Driver supports NAN beacon protection */
2259 #define WPA_DRIVER_FLAGS_NAN_SUPPORT_BEACON_PROT	0x00000010
2260 	u32 drv_flags;
2261 	u8 num_radios;
2262 	u8 sched_chans;
2263 	u8 slot_duration;
2264 	u16 schedule_period;
2265 	u16 max_channel_switch_time;
2266 	u8 num_antennas;
2267 	u8 op_modes;
2268 	u8 dev_capa;
2269 
2270 	u16 ht_capab;
2271 	u8 ht_mcs_set[16];
2272 	u8 ht_ampdu_params;
2273 
2274 	u32 vht_capab;
2275 	u8 vht_mcs_set[8];
2276 	bool vht_valid;
2277 
2278 	struct he_capabilities he_capab;
2279 	bool he_valid;
2280 };
2281 
2282 /* Bit index values for pd_bandwidths bitmap */
2283 #define WPA_PR_CHAN_WIDTH_20	0
2284 #define WPA_PR_CHAN_WIDTH_40	1
2285 #define WPA_PR_CHAN_WIDTH_80	2
2286 #define WPA_PR_CHAN_WIDTH_80P80	3
2287 #define WPA_PR_CHAN_WIDTH_160	4
2288 
2289 /* Bit index values for pd_preambles bitmap */
2290 #define WPA_PR_PREAMBLE_HT	0
2291 #define WPA_PR_PREAMBLE_VHT	1
2292 #define WPA_PR_PREAMBLE_HE	2
2293 
2294 /**
2295  * struct wpa_driver_capa - Driver capability information
2296  */
2297 struct wpa_driver_capa {
2298 #define WPA_DRIVER_CAPA_KEY_MGMT_WPA		0x00000001
2299 #define WPA_DRIVER_CAPA_KEY_MGMT_WPA2		0x00000002
2300 #define WPA_DRIVER_CAPA_KEY_MGMT_WPA_PSK	0x00000004
2301 #define WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK	0x00000008
2302 #define WPA_DRIVER_CAPA_KEY_MGMT_WPA_NONE	0x00000010
2303 #define WPA_DRIVER_CAPA_KEY_MGMT_FT		0x00000020
2304 #define WPA_DRIVER_CAPA_KEY_MGMT_FT_PSK		0x00000040
2305 #define WPA_DRIVER_CAPA_KEY_MGMT_WAPI_PSK	0x00000080
2306 #define WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B	0x00000100
2307 #define WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B_192	0x00000200
2308 #define WPA_DRIVER_CAPA_KEY_MGMT_OWE		0x00000400
2309 #define WPA_DRIVER_CAPA_KEY_MGMT_DPP		0x00000800
2310 #define WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA256    0x00001000
2311 #define WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA384    0x00002000
2312 #define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA256 0x00004000
2313 #define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA384 0x00008000
2314 #define WPA_DRIVER_CAPA_KEY_MGMT_SAE 		0x00010000
2315 #define WPA_DRIVER_CAPA_KEY_MGMT_802_1X_SHA256	0x00020000
2316 #define WPA_DRIVER_CAPA_KEY_MGMT_PSK_SHA256	0x00040000
2317 #define WPA_DRIVER_CAPA_KEY_MGMT_TPK_HANDSHAKE	0x00080000
2318 #define WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE		0x00100000
2319 #define WPA_DRIVER_CAPA_KEY_MGMT_FT_802_1X_SHA384	0x00200000
2320 #define WPA_DRIVER_CAPA_KEY_MGMT_CCKM		0x00400000
2321 #define WPA_DRIVER_CAPA_KEY_MGMT_SAE_EXT_KEY	0x01000000
2322 #define WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE_EXT_KEY	0x02000000
2323 	/** Bitfield of supported key management suites */
2324 	unsigned int key_mgmt;
2325 	unsigned int key_mgmt_iftype[WPA_IF_MAX];
2326 
2327 #define WPA_DRIVER_CAPA_ENC_WEP40	0x00000001
2328 #define WPA_DRIVER_CAPA_ENC_WEP104	0x00000002
2329 #define WPA_DRIVER_CAPA_ENC_TKIP	0x00000004
2330 #define WPA_DRIVER_CAPA_ENC_CCMP	0x00000008
2331 #define WPA_DRIVER_CAPA_ENC_WEP128	0x00000010
2332 #define WPA_DRIVER_CAPA_ENC_GCMP	0x00000020
2333 #define WPA_DRIVER_CAPA_ENC_GCMP_256	0x00000040
2334 #define WPA_DRIVER_CAPA_ENC_CCMP_256	0x00000080
2335 #define WPA_DRIVER_CAPA_ENC_BIP		0x00000100
2336 #define WPA_DRIVER_CAPA_ENC_BIP_GMAC_128	0x00000200
2337 #define WPA_DRIVER_CAPA_ENC_BIP_GMAC_256	0x00000400
2338 #define WPA_DRIVER_CAPA_ENC_BIP_CMAC_256	0x00000800
2339 #define WPA_DRIVER_CAPA_ENC_GTK_NOT_USED	0x00001000
2340 	/** Bitfield of supported cipher suites */
2341 	unsigned int enc;
2342 
2343 #define WPA_DRIVER_AUTH_OPEN		0x00000001
2344 #define WPA_DRIVER_AUTH_SHARED		0x00000002
2345 #define WPA_DRIVER_AUTH_LEAP		0x00000004
2346 	/** Bitfield of supported IEEE 802.11 authentication algorithms */
2347 	unsigned int auth;
2348 
2349 /** Driver generated WPA/RSN IE */
2350 #define WPA_DRIVER_FLAGS_DRIVER_IE	0x00000001
2351 /** Driver needs static WEP key setup after association command */
2352 #define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC 0x00000002
2353 /** Driver takes care of all DFS operations */
2354 #define WPA_DRIVER_FLAGS_DFS_OFFLOAD			0x00000004
2355 /** Driver takes care of RSN 4-way handshake internally; PMK is configured with
2356  * struct wpa_driver_ops::set_key using key_flag = KEY_FLAG_PMK */
2357 #define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X		0x00000008
2358 /** Driver is for a wired Ethernet interface */
2359 #define WPA_DRIVER_FLAGS_WIRED		0x00000010
2360 /** Driver provides separate commands for authentication and association (SME in
2361  * wpa_supplicant). */
2362 #define WPA_DRIVER_FLAGS_SME		0x00000020
2363 /** Driver supports AP mode */
2364 #define WPA_DRIVER_FLAGS_AP		0x00000040
2365 /** Driver needs static WEP key setup after association has been completed */
2366 #define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE	0x00000080
2367 /** Driver supports dynamic HT 20/40 MHz channel changes during BSS lifetime */
2368 #define WPA_DRIVER_FLAGS_HT_2040_COEX			0x00000100
2369 /** Driver supports concurrent P2P operations */
2370 #define WPA_DRIVER_FLAGS_P2P_CONCURRENT	0x00000200
2371 /**
2372  * Driver uses the initial interface as a dedicated management interface, i.e.,
2373  * it cannot be used for P2P group operations or non-P2P purposes.
2374  */
2375 #define WPA_DRIVER_FLAGS_P2P_DEDICATED_INTERFACE	0x00000400
2376 /** This interface is P2P capable (P2P GO or P2P Client) */
2377 #define WPA_DRIVER_FLAGS_P2P_CAPABLE	0x00000800
2378 /** Driver supports station and key removal when stopping an AP */
2379 #define WPA_DRIVER_FLAGS_AP_TEARDOWN_SUPPORT		0x00001000
2380 /**
2381  * Driver uses the initial interface for P2P management interface and non-P2P
2382  * purposes (e.g., connect to infra AP), but this interface cannot be used for
2383  * P2P group operations.
2384  */
2385 #define WPA_DRIVER_FLAGS_P2P_MGMT_AND_NON_P2P		0x00002000
2386 /**
2387  * Driver is known to use valid error codes, i.e., when it indicates that
2388  * something (e.g., association) fails, there was indeed a failure and the
2389  * operation does not end up getting completed successfully later.
2390  */
2391 #define WPA_DRIVER_FLAGS_VALID_ERROR_CODES		0x00004000
2392 /** Driver supports off-channel TX */
2393 #define WPA_DRIVER_FLAGS_OFFCHANNEL_TX			0x00008000
2394 /** Driver indicates TX status events for EAPOL Data frames */
2395 #define WPA_DRIVER_FLAGS_EAPOL_TX_STATUS		0x00010000
2396 /** Driver indicates TX status events for Deauth/Disassoc frames */
2397 #define WPA_DRIVER_FLAGS_DEAUTH_TX_STATUS		0x00020000
2398 /** Driver supports roaming (BSS selection) in firmware */
2399 #define WPA_DRIVER_FLAGS_BSS_SELECTION			0x00040000
2400 /** Driver supports operating as a TDLS peer */
2401 #define WPA_DRIVER_FLAGS_TDLS_SUPPORT			0x00080000
2402 /** Driver requires external TDLS setup/teardown/discovery */
2403 #define WPA_DRIVER_FLAGS_TDLS_EXTERNAL_SETUP		0x00100000
2404 /** Driver indicates support for Probe Response offloading in AP mode */
2405 #define WPA_DRIVER_FLAGS_PROBE_RESP_OFFLOAD		0x00200000
2406 /** Driver supports U-APSD in AP mode */
2407 #define WPA_DRIVER_FLAGS_AP_UAPSD			0x00400000
2408 /** Driver supports inactivity timer in AP mode */
2409 #define WPA_DRIVER_FLAGS_INACTIVITY_TIMER		0x00800000
2410 /** Driver expects user space implementation of MLME in AP mode */
2411 #define WPA_DRIVER_FLAGS_AP_MLME			0x01000000
2412 /** Driver supports SAE with user space SME */
2413 #define WPA_DRIVER_FLAGS_SAE				0x02000000
2414 /** Driver makes use of OBSS scan mechanism in wpa_supplicant */
2415 #define WPA_DRIVER_FLAGS_OBSS_SCAN			0x04000000
2416 /** Driver supports IBSS (Ad-hoc) mode */
2417 #define WPA_DRIVER_FLAGS_IBSS				0x08000000
2418 /** Driver supports radar detection */
2419 #define WPA_DRIVER_FLAGS_RADAR				0x10000000
2420 /** Driver supports a dedicated interface for P2P Device */
2421 #define WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE		0x20000000
2422 /** Driver supports QoS Mapping */
2423 #define WPA_DRIVER_FLAGS_QOS_MAPPING			0x40000000
2424 /** Driver supports CSA in AP mode */
2425 #define WPA_DRIVER_FLAGS_AP_CSA				0x80000000
2426 /** Driver supports mesh */
2427 #define WPA_DRIVER_FLAGS_MESH			0x0000000100000000ULL
2428 /** Driver support ACS offload */
2429 #define WPA_DRIVER_FLAGS_ACS_OFFLOAD		0x0000000200000000ULL
2430 /** Driver supports key management offload */
2431 #define WPA_DRIVER_FLAGS_KEY_MGMT_OFFLOAD	0x0000000400000000ULL
2432 /** Driver supports TDLS channel switching */
2433 #define WPA_DRIVER_FLAGS_TDLS_CHANNEL_SWITCH	0x0000000800000000ULL
2434 /** Driver supports IBSS with HT datarates */
2435 #define WPA_DRIVER_FLAGS_HT_IBSS		0x0000001000000000ULL
2436 /** Driver supports IBSS with VHT datarates */
2437 #define WPA_DRIVER_FLAGS_VHT_IBSS		0x0000002000000000ULL
2438 /** Driver supports automatic band selection */
2439 #define WPA_DRIVER_FLAGS_SUPPORT_HW_MODE_ANY	0x0000004000000000ULL
2440 /** Driver supports simultaneous off-channel operations */
2441 #define WPA_DRIVER_FLAGS_OFFCHANNEL_SIMULTANEOUS	0x0000008000000000ULL
2442 /** Driver supports full AP client state */
2443 #define WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE	0x0000010000000000ULL
2444 /** Driver supports P2P Listen offload */
2445 #define WPA_DRIVER_FLAGS_P2P_LISTEN_OFFLOAD     0x0000020000000000ULL
2446 /** Driver supports FILS */
2447 #define WPA_DRIVER_FLAGS_SUPPORT_FILS		0x0000040000000000ULL
2448 /** Driver supports Beacon frame TX rate configuration (legacy rates) */
2449 #define WPA_DRIVER_FLAGS_BEACON_RATE_LEGACY	0x0000080000000000ULL
2450 /** Driver supports Beacon frame TX rate configuration (HT rates) */
2451 #define WPA_DRIVER_FLAGS_BEACON_RATE_HT		0x0000100000000000ULL
2452 /** Driver supports Beacon frame TX rate configuration (VHT rates) */
2453 #define WPA_DRIVER_FLAGS_BEACON_RATE_VHT	0x0000200000000000ULL
2454 /** Driver supports mgmt_tx with random TX address in non-connected state */
2455 #define WPA_DRIVER_FLAGS_MGMT_TX_RANDOM_TA	0x0000400000000000ULL
2456 /** Driver supports mgmt_tx with random TX addr in connected state */
2457 #define WPA_DRIVER_FLAGS_MGMT_TX_RANDOM_TA_CONNECTED	0x0000800000000000ULL
2458 /** Driver supports better BSS reporting with sched_scan in connected mode */
2459 #define WPA_DRIVER_FLAGS_SCHED_SCAN_RELATIVE_RSSI	0x0001000000000000ULL
2460 /** Driver supports HE capabilities */
2461 #define WPA_DRIVER_FLAGS_HE_CAPABILITIES	0x0002000000000000ULL
2462 /** Driver supports FILS shared key offload */
2463 #define WPA_DRIVER_FLAGS_FILS_SK_OFFLOAD	0x0004000000000000ULL
2464 /** Driver supports all OCE STA specific mandatory features */
2465 #define WPA_DRIVER_FLAGS_OCE_STA		0x0008000000000000ULL
2466 /** Driver supports all OCE AP specific mandatory features */
2467 #define WPA_DRIVER_FLAGS_OCE_AP			0x0010000000000000ULL
2468 /**
2469  * Driver supports all OCE STA-CFON specific mandatory features only.
2470  * If a driver sets this bit but not the %WPA_DRIVER_FLAGS_OCE_AP, the
2471  * userspace shall assume that this driver may not support all OCE AP
2472  * functionality but can support only OCE STA-CFON functionality.
2473  */
2474 #define WPA_DRIVER_FLAGS_OCE_STA_CFON		0x0020000000000000ULL
2475 /** Driver supports MFP-optional in the connect command */
2476 #define WPA_DRIVER_FLAGS_MFP_OPTIONAL		0x0040000000000000ULL
2477 /** Driver is a self-managed regulatory device */
2478 #define WPA_DRIVER_FLAGS_SELF_MANAGED_REGULATORY       0x0080000000000000ULL
2479 /** Driver supports FTM responder functionality */
2480 #define WPA_DRIVER_FLAGS_FTM_RESPONDER		0x0100000000000000ULL
2481 /** Driver support 4-way handshake offload for WPA-Personal */
2482 #define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK	0x0200000000000000ULL
2483 /** Driver supports a separate control port TX for EAPOL frames */
2484 #define WPA_DRIVER_FLAGS_CONTROL_PORT		0x0400000000000000ULL
2485 /** Driver supports VLAN offload */
2486 #define WPA_DRIVER_FLAGS_VLAN_OFFLOAD		0x0800000000000000ULL
2487 /** Driver supports UPDATE_FT_IES command */
2488 #define WPA_DRIVER_FLAGS_UPDATE_FT_IES		0x1000000000000000ULL
2489 /** Driver can correctly rekey PTKs without Extended Key ID */
2490 #define WPA_DRIVER_FLAGS_SAFE_PTK0_REKEYS	0x2000000000000000ULL
2491 /** Driver supports Beacon protection */
2492 #define WPA_DRIVER_FLAGS_BEACON_PROTECTION	0x4000000000000000ULL
2493 /** Driver supports Extended Key ID */
2494 #define WPA_DRIVER_FLAGS_EXTENDED_KEY_ID	0x8000000000000000ULL
2495 	u64 flags;
2496 
2497 /** Driver supports a separate control port RX for EAPOL frames */
2498 #define WPA_DRIVER_FLAGS2_CONTROL_PORT_RX	0x0000000000000001ULL
2499 /** Driver supports TX status reports for EAPOL frames through control port */
2500 #define WPA_DRIVER_FLAGS2_CONTROL_PORT_TX_STATUS 0x0000000000000002ULL
2501 /** Driver supports secure LTF in AP mode */
2502 #define WPA_DRIVER_FLAGS2_SEC_LTF_AP		0x0000000000000004ULL
2503 /** Driver supports secure RTT measurement exchange in AP mode */
2504 #define WPA_DRIVER_FLAGS2_SEC_RTT_AP		0x0000000000000008ULL
2505 /**
2506  * Driver supports protection of range negotiation and measurement management
2507  * frames in AP mode
2508  */
2509 #define WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_AP	0x0000000000000010ULL
2510 /** Driver supports Beacon frame TX rate configuration (HE rates) */
2511 #define WPA_DRIVER_FLAGS2_BEACON_RATE_HE	0x0000000000000020ULL
2512 /** Driver supports Beacon protection only in client mode */
2513 #define WPA_DRIVER_FLAGS2_BEACON_PROTECTION_CLIENT 0x0000000000000040ULL
2514 /** Driver supports Operating Channel Validation */
2515 #define WPA_DRIVER_FLAGS2_OCV			0x0000000000000080ULL
2516 /** Driver expects user space implementation of SME in AP mode */
2517 #define WPA_DRIVER_FLAGS2_AP_SME		0x0000000000000100ULL
2518 /** Driver handles SA Query procedures in AP mode */
2519 #define WPA_DRIVER_FLAGS2_SA_QUERY_OFFLOAD_AP	0x0000000000000200ULL
2520 /** Driver supports background radar/CAC detection */
2521 #define WPA_DRIVER_FLAGS2_RADAR_BACKGROUND	0x0000000000000400ULL
2522 /** Driver supports secure LTF in STA mode */
2523 #define WPA_DRIVER_FLAGS2_SEC_LTF_STA		0x0000000000000800ULL
2524 /** Driver supports secure RTT measurement exchange in STA mode */
2525 #define WPA_DRIVER_FLAGS2_SEC_RTT_STA		0x0000000000001000ULL
2526 /**
2527  * Driver supports protection of range negotiation and measurement management
2528  * frames in STA mode
2529  */
2530 #define WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_STA	0x0000000000002000ULL
2531 /** Driver supports MLO in station/AP mode */
2532 #define WPA_DRIVER_FLAGS2_MLO			0x0000000000004000ULL
2533 /** Driver supports minimal scan request probe content  */
2534 #define WPA_DRIVER_FLAGS2_SCAN_MIN_PREQ         0x0000000000008000ULL
2535 /** Driver supports SAE authentication offload in STA mode */
2536 #define WPA_DRIVER_FLAGS2_SAE_OFFLOAD_STA	0x0000000000010000ULL
2537 /** Driver support AP_PSK authentication offload */
2538 #define WPA_DRIVER_FLAGS2_4WAY_HANDSHAKE_AP_PSK	0x0000000000020000ULL
2539 /** Driver supports OWE STA offload */
2540 #define WPA_DRIVER_FLAGS2_OWE_OFFLOAD_STA	0x0000000000040000ULL
2541 /** Driver supports OWE AP offload */
2542 #define WPA_DRIVER_FLAGS2_OWE_OFFLOAD_AP	0x0000000000080000ULL
2543 /** Driver support AP SAE authentication offload */
2544 #define WPA_DRIVER_FLAGS2_SAE_OFFLOAD_AP	0x0000000000100000ULL
2545 /** Driver supports TWT responder in HT and VHT modes */
2546 #define WPA_DRIVER_FLAGS2_HT_VHT_TWT_RESPONDER	0x0000000000200000ULL
2547 /** Driver supports RSN override elements */
2548 #define WPA_DRIVER_FLAGS2_RSN_OVERRIDE_STA	0x0000000000400000ULL
2549 /** Driver supports NAN USD offload */
2550 #define WPA_DRIVER_FLAGS2_NAN_USD_OFFLOAD	0x0000000000800000ULL
2551 /** Driver/device supports SPP A-MSDUs */
2552 #define WPA_DRIVER_FLAGS2_SPP_AMSDU		0x0000000001000000ULL
2553 /** Driver supports P2P V2 */
2554 #define WPA_DRIVER_FLAGS2_P2P_FEATURE_V2	0x0000000002000000ULL
2555 /** Driver supports P2P PCC mode */
2556 #define WPA_DRIVER_FLAGS2_P2P_FEATURE_PCC_MODE	0x0000000004000000ULL
2557 /** Driver supports arbitrary channel width changes in AP mode */
2558 #define WPA_DRIVER_FLAGS2_AP_CHANWIDTH_CHANGE	0x0000000008000000ULL
2559 /** Driver supports FTM initiator functionality */
2560 #define WPA_DRIVER_FLAGS2_FTM_INITIATOR		0x0000000010000000ULL
2561 /** Driver supports non-trigger based ranging responder functionality */
2562 #define WPA_DRIVER_FLAGS2_NON_TRIGGER_BASED_RESPONDER   0x0000000020000000ULL
2563 /** Driver supports non-trigger based ranging initiator functionality */
2564 #define WPA_DRIVER_FLAGS2_NON_TRIGGER_BASED_INITIATOR	0x0000000040000000ULL
2565 /** Driver supports NAN Device interface and NAN Synchronization */
2566 #define WPA_DRIVER_FLAGS2_SUPPORT_NAN			0x0000000080000000ULL
2567 /** Driver supports P2P assisted DFS */
2568 #define WPA_DRIVER_FLAGS2_P2P_ASSISTED_DFS		0x0000000100000000ULL
2569 /** Driver supports (Re)Association Request/Response frame encryption */
2570 #define WPA_DRIVER_FLAGS2_ASSOCIATION_FRAME_ENCRYPTION	0x0000000200000000ULL
2571 /** Driver supports EPPKE authentication */
2572 #define WPA_DRIVER_FLAGS2_EPPKE				0x0000000400000000ULL
2573 /** Driver supports IEEE 802.1X authentication in Authentication frames */
2574 #define WPA_DRIVER_FLAGS2_802_1X_AUTH		0x0000000800000000ULL
2575 /** Driver supports PMKSA caching privacy */
2576 #define WPA_DRIVER_FLAGS2_PMKSA_PRIVACY		0x0000001000000000ULL
2577 /** Driver supports MAC address filter for remain-on-channel */
2578 #define WPA_DRIVER_FLAGS2_ROC_ADDR_FILTER	0x0000002000000000ULL
2579 	u64 flags2;
2580 
2581 #define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \
2582 	(drv_flags & WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE)
2583 
2584 	unsigned int wmm_ac_supported:1;
2585 
2586 	unsigned int mac_addr_rand_scan_supported:1;
2587 	unsigned int mac_addr_rand_sched_scan_supported:1;
2588 
2589 	/** Maximum number of supported active probe SSIDs */
2590 	int max_scan_ssids;
2591 
2592 	/** Maximum number of supported active probe SSIDs for sched_scan */
2593 	int max_sched_scan_ssids;
2594 
2595 	/** Maximum number of supported scan plans for scheduled scan */
2596 	unsigned int max_sched_scan_plans;
2597 
2598 	/** Maximum interval in a scan plan. In seconds */
2599 	u32 max_sched_scan_plan_interval;
2600 
2601 	/** Maximum number of iterations in a single scan plan */
2602 	u32 max_sched_scan_plan_iterations;
2603 
2604 	/** Whether sched_scan (offloaded scanning) is supported */
2605 	int sched_scan_supported;
2606 
2607 	/** Maximum number of supported match sets for sched_scan */
2608 	int max_match_sets;
2609 
2610 	/**
2611 	 * max_remain_on_chan - Maximum remain-on-channel duration in msec
2612 	 */
2613 	unsigned int max_remain_on_chan;
2614 
2615 	/**
2616 	 * max_stations - Maximum number of associated stations the driver
2617 	 * supports in AP mode
2618 	 */
2619 	unsigned int max_stations;
2620 
2621 	/**
2622 	 * probe_resp_offloads - Bitmap of supported protocols by the driver
2623 	 * for Probe Response offloading.
2624 	 */
2625 /** Driver Probe Response offloading support for WPS ver. 1 */
2626 #define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS		0x00000001
2627 /** Driver Probe Response offloading support for WPS ver. 2 */
2628 #define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS2		0x00000002
2629 /** Driver Probe Response offloading support for P2P */
2630 #define WPA_DRIVER_PROBE_RESP_OFFLOAD_P2P		0x00000004
2631 /** Driver Probe Response offloading support for IEEE 802.11u (Interworking) */
2632 #define WPA_DRIVER_PROBE_RESP_OFFLOAD_INTERWORKING	0x00000008
2633 	unsigned int probe_resp_offloads;
2634 
2635 	unsigned int max_acl_mac_addrs;
2636 
2637 	/**
2638 	 * Number of supported concurrent channels
2639 	 */
2640 	unsigned int num_multichan_concurrent;
2641 
2642 	/**
2643 	 * extended_capa - extended capabilities in driver/device
2644 	 *
2645 	 * Must be allocated and freed by driver and the pointers must be
2646 	 * valid for the lifetime of the driver, i.e., freed in deinit()
2647 	 */
2648 	const u8 *extended_capa, *extended_capa_mask;
2649 	unsigned int extended_capa_len;
2650 
2651 	struct wowlan_triggers wowlan_triggers;
2652 
2653 /** Driver adds the DS Params Set IE in Probe Request frames */
2654 #define WPA_DRIVER_FLAGS_DS_PARAM_SET_IE_IN_PROBES	0x00000001
2655 /** Driver adds the WFA TPC IE in Probe Request frames */
2656 #define WPA_DRIVER_FLAGS_WFA_TPC_IE_IN_PROBES		0x00000002
2657 /** Driver handles quiet period requests */
2658 #define WPA_DRIVER_FLAGS_QUIET				0x00000004
2659 /**
2660  * Driver is capable of inserting the current TX power value into the body of
2661  * transmitted frames.
2662  * Background: Some Action frames include a TPC Report IE. This IE contains a
2663  * TX power field, which has to be updated by lower layers. One such Action
2664  * frame is Link Measurement Report (part of RRM). Another is TPC Report (part
2665  * of spectrum management). Note that this insertion takes place at a fixed
2666  * offset, namely the 6th byte in the Action frame body.
2667  */
2668 #define WPA_DRIVER_FLAGS_TX_POWER_INSERTION		0x00000008
2669 /**
2670  * Driver supports RRM. With this support, the driver will accept to use RRM in
2671  * (Re)Association Request frames, without supporting quiet period.
2672  */
2673 #define WPA_DRIVER_FLAGS_SUPPORT_RRM			0x00000010
2674 
2675 /** Driver supports setting the scan dwell time */
2676 #define WPA_DRIVER_FLAGS_SUPPORT_SET_SCAN_DWELL		0x00000020
2677 /** Driver supports Beacon Report Measurement */
2678 #define WPA_DRIVER_FLAGS_SUPPORT_BEACON_REPORT		0x00000040
2679 
2680 	u32 rrm_flags;
2681 
2682 	/* Driver concurrency capabilities */
2683 	unsigned int conc_capab;
2684 	/* Maximum number of concurrent channels on 2.4 GHz */
2685 	unsigned int max_conc_chan_2_4;
2686 	/* Maximum number of concurrent channels on 5 GHz */
2687 	unsigned int max_conc_chan_5_0;
2688 
2689 	/* Maximum number of supported CSA counters */
2690 	u16 max_csa_counters;
2691 
2692 	/* Maximum number of supported AKM suites in commands */
2693 	unsigned int max_num_akms;
2694 
2695 	/* Maximum number of interfaces supported for MBSSID advertisement */
2696 	unsigned int mbssid_max_interfaces;
2697 	/* Maximum profile periodicity for enhanced MBSSID advertisement */
2698 	unsigned int ema_max_periodicity;
2699 
2700 	/* Maximum number of bytes of extra IE(s) that can be added to Probe
2701 	 * Request frames */
2702 	size_t max_probe_req_ie_len;
2703 
2704 	/* EDCA based ranging capabilities */
2705 	u8 max_tx_antenna;
2706 	u8 max_rx_antenna;
2707 	u32 edca_min_ranging_interval;
2708 
2709 	/* NTB based ranging capabilities */
2710 	u8 max_tx_ltf_repetations;
2711 	u8 max_rx_ltf_repetations;
2712 	u8 max_tx_ltf_total;
2713 	u8 max_rx_ltf_total;
2714 	u8 max_rx_sts_le_80;
2715 	u8 max_rx_sts_gt_80;
2716 	u8 max_tx_sts_le_80;
2717 	u8 max_tx_sts_gt_80;
2718 	u32 ntb_min_ranging_interval;
2719 
2720 	/* Peer measurement capabilities */
2721 	u32 pmsr_max_peers;
2722 	u8 max_ftms_per_burst;
2723 	bool concurrent_ista_rsta;
2724 	bool support_6ghz;
2725 	bool asap_support;
2726 	u32 pd_preambles;
2727 	u32 pd_bandwidths;
2728 
2729 	struct {
2730 		bool support_ntb;
2731 		bool support_tb;
2732 		bool support_edca;
2733 		u32 max_peers;
2734 	} ista;
2735 
2736 	struct {
2737 		bool support_ntb;
2738 		bool support_tb;
2739 		bool support_edca;
2740 		u32 max_peers;
2741 	} rsta;
2742 
2743 	struct {
2744 		bool infra_support;
2745 		bool pd_support;
2746 	} ranging_type;
2747 
2748 #ifdef CONFIG_NAN
2749 	struct nan_capa nan_capa;
2750 #endif /* CONFIG_NAN */
2751 };
2752 
2753 
2754 struct hostapd_data;
2755 
2756 enum guard_interval {
2757 	GUARD_INTERVAL_0_4 = 1,
2758 	GUARD_INTERVAL_0_8 = 2,
2759 	GUARD_INTERVAL_1_6 = 3,
2760 	GUARD_INTERVAL_3_2 = 4,
2761 };
2762 
2763 #define STA_DRV_DATA_TX_MCS BIT(0)
2764 #define STA_DRV_DATA_RX_MCS BIT(1)
2765 #define STA_DRV_DATA_TX_VHT_MCS BIT(2)
2766 #define STA_DRV_DATA_RX_VHT_MCS BIT(3)
2767 #define STA_DRV_DATA_TX_VHT_NSS BIT(4)
2768 #define STA_DRV_DATA_RX_VHT_NSS BIT(5)
2769 #define STA_DRV_DATA_TX_SHORT_GI BIT(6)
2770 #define STA_DRV_DATA_RX_SHORT_GI BIT(7)
2771 #define STA_DRV_DATA_LAST_ACK_RSSI BIT(8)
2772 #define STA_DRV_DATA_CONN_TIME BIT(9)
2773 #define STA_DRV_DATA_TX_HE_MCS BIT(10)
2774 #define STA_DRV_DATA_RX_HE_MCS BIT(11)
2775 #define STA_DRV_DATA_TX_HE_NSS BIT(12)
2776 #define STA_DRV_DATA_RX_HE_NSS BIT(13)
2777 #define STA_DRV_DATA_TX_HE_DCM BIT(14)
2778 #define STA_DRV_DATA_RX_HE_DCM BIT(15)
2779 #define STA_DRV_DATA_TX_HE_GI BIT(16)
2780 #define STA_DRV_DATA_RX_HE_GI BIT(17)
2781 
2782 struct hostap_sta_driver_data {
2783 	unsigned long rx_packets, tx_packets;
2784 	unsigned long long rx_bytes, tx_bytes;
2785 	unsigned long long rx_airtime, tx_airtime;
2786 	unsigned long long beacons_count;
2787 	int bytes_64bit; /* whether 64-bit byte counters are supported */
2788 	unsigned long current_tx_rate; /* in kbps */
2789 	unsigned long current_rx_rate; /* in kbps */
2790 	unsigned long inactive_msec;
2791 	unsigned long connected_sec;
2792 	unsigned long flags; /* bitfield of STA_DRV_DATA_* */
2793 	unsigned long num_ps_buf_frames;
2794 	unsigned long tx_retry_failed;
2795 	unsigned long tx_retry_count;
2796 	s8 last_ack_rssi;
2797 	unsigned long backlog_packets;
2798 	unsigned long backlog_bytes;
2799 	unsigned long fcs_error_count;
2800 	unsigned long beacon_loss_count;
2801 	unsigned long expected_throughput;
2802 	unsigned long rx_drop_misc;
2803 	unsigned long rx_mpdus;
2804 	int signal; /* dBm; or -WPA_INVALID_NOISE */
2805 	u8 rx_hemcs;
2806 	u8 tx_hemcs;
2807 	u8 rx_vhtmcs;
2808 	u8 tx_vhtmcs;
2809 	u8 rx_mcs;
2810 	u8 tx_mcs;
2811 	u8 rx_he_nss;
2812 	u8 tx_he_nss;
2813 	u8 rx_vht_nss;
2814 	u8 tx_vht_nss;
2815 	s8 avg_signal; /* dBm */
2816 	s8 avg_beacon_signal; /* dBm */
2817 	s8 avg_ack_signal; /* dBm */
2818 	enum guard_interval rx_guard_interval, tx_guard_interval;
2819 	u8 rx_dcm, tx_dcm;
2820 };
2821 
2822 struct hostapd_sta_add_params {
2823 	const u8 *addr;
2824 	u16 aid;
2825 	u16 capability;
2826 	const u8 *supp_rates;
2827 	size_t supp_rates_len;
2828 	u16 listen_interval;
2829 	const struct ieee80211_ht_capabilities *ht_capabilities;
2830 	const struct ieee80211_vht_capabilities *vht_capabilities;
2831 	int vht_opmode_enabled;
2832 	u8 vht_opmode;
2833 	const struct ieee80211_he_capabilities *he_capab;
2834 	size_t he_capab_len;
2835 	const struct ieee80211_he_6ghz_band_cap *he_6ghz_capab;
2836 	const struct ieee80211_eht_capabilities *eht_capab;
2837 	size_t eht_capab_len;
2838 	u32 flags; /* bitmask of WPA_STA_* flags */
2839 	u32 flags_mask; /* unset bits in flags */
2840 #ifdef CONFIG_ENC_ASSOC
2841 	bool epp_sta;
2842 #endif /* CONFIG_ENC_ASSOC */
2843 #ifdef CONFIG_MESH
2844 	enum mesh_plink_state plink_state;
2845 	u16 peer_aid;
2846 #endif /* CONFIG_MESH */
2847 	int set; /* Set STA parameters instead of add */
2848 	u8 qosinfo;
2849 	const u8 *ext_capab;
2850 	size_t ext_capab_len;
2851 	const u8 *supp_channels;
2852 	size_t supp_channels_len;
2853 	const u8 *supp_oper_classes;
2854 	size_t supp_oper_classes_len;
2855 	int support_p2p_ps;
2856 
2857 	bool mld_link_sta;
2858 	s8 mld_link_id;
2859 	const u8 *mld_link_addr;
2860 	u16 eml_cap;
2861 
2862 #ifdef CONFIG_NAN
2863 	/*
2864 	 * For a station added to a NAN Data Interface (NDI) indicate the
2865 	 * address of the NAN Management Interface (NMI) to which this station
2866 	 * belongs.
2867 	 */
2868 	const u8 *nmi_addr;
2869 #endif /* CONFIG_NAN */
2870 };
2871 
2872 struct mac_address {
2873 	u8 addr[ETH_ALEN];
2874 };
2875 
2876 struct hostapd_acl_params {
2877 	u8 acl_policy;
2878 	unsigned int num_mac_acl;
2879 	struct mac_address mac_acl[0];
2880 };
2881 
2882 struct wpa_init_params {
2883 	void *global_priv;
2884 	const u8 *bssid;
2885 	const char *ifname;
2886 	const char *driver_params;
2887 	int use_pae_group_addr;
2888 	char **bridge;
2889 	size_t num_bridge;
2890 
2891 	u8 *own_addr; /* buffer for writing own MAC address */
2892 };
2893 
2894 
2895 struct wpa_bss_params {
2896 	/** Interface name (for multi-SSID/VLAN support) */
2897 	const char *ifname;
2898 	/** Whether IEEE 802.1X or WPA/WPA2 is enabled */
2899 	int enabled;
2900 
2901 	int wpa;
2902 	int ieee802_1x;
2903 	int wpa_group;
2904 	int wpa_pairwise;
2905 	int wpa_key_mgmt;
2906 	int rsn_preauth;
2907 	enum mfp_options ieee80211w;
2908 };
2909 
2910 #define WPA_STA_AUTHORIZED BIT(0)
2911 #define WPA_STA_WMM BIT(1)
2912 #define WPA_STA_SHORT_PREAMBLE BIT(2)
2913 #define WPA_STA_MFP BIT(3)
2914 #define WPA_STA_TDLS_PEER BIT(4)
2915 #define WPA_STA_AUTHENTICATED BIT(5)
2916 #define WPA_STA_ASSOCIATED BIT(6)
2917 #define WPA_STA_SPP_AMSDU BIT(7)
2918 
2919 enum tdls_oper {
2920 	TDLS_DISCOVERY_REQ,
2921 	TDLS_SETUP,
2922 	TDLS_TEARDOWN,
2923 	TDLS_ENABLE_LINK,
2924 	TDLS_DISABLE_LINK,
2925 	TDLS_ENABLE,
2926 	TDLS_DISABLE
2927 };
2928 
2929 enum wnm_oper {
2930 	WNM_SLEEP_ENTER_CONFIRM,
2931 	WNM_SLEEP_ENTER_FAIL,
2932 	WNM_SLEEP_EXIT_CONFIRM,
2933 	WNM_SLEEP_EXIT_FAIL,
2934 	WNM_SLEEP_TFS_REQ_IE_ADD,   /* STA requests driver to add TFS req IE */
2935 	WNM_SLEEP_TFS_REQ_IE_NONE,  /* STA requests empty TFS req IE */
2936 	WNM_SLEEP_TFS_REQ_IE_SET,   /* AP requests driver to set TFS req IE for
2937 				     * a STA */
2938 	WNM_SLEEP_TFS_RESP_IE_ADD,  /* AP requests driver to add TFS resp IE
2939 				     * for a STA */
2940 	WNM_SLEEP_TFS_RESP_IE_NONE, /* AP requests empty TFS resp IE */
2941 	WNM_SLEEP_TFS_RESP_IE_SET,  /* AP requests driver to set TFS resp IE
2942 				     * for a STA */
2943 	WNM_SLEEP_TFS_IE_DEL        /* AP delete the TFS IE */
2944 };
2945 
2946 /* enum smps_mode - SMPS mode definitions */
2947 enum smps_mode {
2948 	SMPS_AUTOMATIC,
2949 	SMPS_OFF,
2950 	SMPS_DYNAMIC,
2951 	SMPS_STATIC,
2952 
2953 	/* Keep last */
2954 	SMPS_INVALID,
2955 };
2956 
2957 #define WPA_INVALID_NOISE 9999
2958 
2959 /**
2960  * struct wpa_signal_info - Information about channel signal quality
2961  * @frequency: control frequency
2962  * @above_threshold: true if the above threshold was crossed
2963  *	(relevant for a CQM event)
2964  * @data: STA information
2965  * @current_noise: %WPA_INVALID_NOISE if not supported
2966  * @chanwidth: channel width
2967  * @center_frq1: center frequency for the first segment
2968  * @center_frq2: center frequency for the second segment (if relevant)
2969  */
2970 struct wpa_signal_info {
2971 	u32 frequency;
2972 	int above_threshold;
2973 	struct hostap_sta_driver_data data;
2974 	int current_noise;
2975 	enum chan_width chanwidth;
2976 	int center_frq1;
2977 	int center_frq2;
2978 };
2979 
2980 struct wpa_mlo_signal_info {
2981 	u16 valid_links;
2982 	struct wpa_signal_info links[MAX_NUM_MLD_LINKS];
2983 };
2984 
2985 /**
2986  * struct wpa_mlo_reconfig_info - Information about user-requested add and/or
2987  * remove setup links for the current MLO association.
2988  *
2989  * @add_links: Bitmask of links to be added
2990  * @add_link_bssid: Array of BSSIDs for the links to be added
2991  * @add_link_freq: Array of frequencies for the links to be added
2992  * @delete_links: Bitmask of links to be removed
2993  */
2994 struct wpa_mlo_reconfig_info {
2995 	u16 add_links;
2996 	u8 add_link_bssid[MAX_NUM_MLD_LINKS][ETH_ALEN];
2997 	int add_link_freq[MAX_NUM_MLD_LINKS];
2998 	u16 delete_links;
2999 };
3000 
3001 /**
3002  * struct wpa_channel_info - Information about the current channel
3003  * @frequency: Center frequency of the primary 20 MHz channel
3004  * @chanwidth: Width of the current operating channel
3005  * @sec_channel: Location of the secondary 20 MHz channel (either +1 or -1).
3006  *	This field is only filled in when using a 40 MHz channel.
3007  * @center_frq1: Center frequency of frequency segment 0
3008  * @center_frq2: Center frequency of frequency segment 1 (for 80+80 channels)
3009  * @seg1_idx: Frequency segment 1 index when using a 80+80 channel. This is
3010  *	derived from center_frq2 for convenience.
3011  */
3012 struct wpa_channel_info {
3013 	u32 frequency;
3014 	enum chan_width chanwidth;
3015 	int sec_channel;
3016 	int center_frq1;
3017 	int center_frq2;
3018 	u8 seg1_idx;
3019 };
3020 
3021 /**
3022  * struct beacon_data - Beacon data
3023  * @head: Head portion of Beacon frame (before TIM IE)
3024  * @tail: Tail portion of Beacon frame (after TIM IE)
3025  * @beacon_ies: Extra information element(s) to add into Beacon frames or %NULL
3026  * @proberesp_ies: Extra information element(s) to add into Probe Response
3027  *	frames or %NULL
3028  * @assocresp_ies: Extra information element(s) to add into (Re)Association
3029  *	Response frames or %NULL
3030  * @probe_resp: Probe Response frame template
3031  * @head_len: Length of @head
3032  * @tail_len: Length of @tail
3033  * @beacon_ies_len: Length of beacon_ies in octets
3034  * @proberesp_ies_len: Length of proberesp_ies in octets
3035  * @proberesp_ies_len: Length of proberesp_ies in octets
3036  * @probe_resp_len: Length of probe response template (@probe_resp)
3037  * @mbssid: MBSSID element(s) to add into Beacon frames
3038  */
3039 struct beacon_data {
3040 	u8 *head, *tail;
3041 	u8 *beacon_ies;
3042 	u8 *proberesp_ies;
3043 	u8 *assocresp_ies;
3044 	u8 *probe_resp;
3045 
3046 	size_t head_len, tail_len;
3047 	size_t beacon_ies_len;
3048 	size_t proberesp_ies_len;
3049 	size_t assocresp_ies_len;
3050 	size_t probe_resp_len;
3051 
3052 	struct mbssid_data mbssid;
3053 };
3054 
3055 /**
3056  * struct csa_settings - Settings for channel switch command
3057  * @cs_count: Count in Beacon frames (TBTT) to perform the switch
3058  * @block_tx: 1 - block transmission for CSA period
3059  * @freq_params: Next channel frequency parameter
3060  * @beacon_csa: Beacon/probe resp/asooc resp info for CSA period
3061  * @beacon_after: Next beacon/probe resp/asooc resp info
3062  * @counter_offset_beacon: Offset to the count field in beacon's tail
3063  * @counter_offset_presp: Offset to the count field in probe resp.
3064  * @link_id: Link ID to determine the link for MLD; -1 for non-MLD
3065  * @ubpr: Unsolicited broadcast Probe Response frame data
3066  */
3067 struct csa_settings {
3068 	u8 cs_count;
3069 	u8 block_tx;
3070 
3071 	struct hostapd_freq_params freq_params;
3072 	struct beacon_data beacon_csa;
3073 	struct beacon_data beacon_after;
3074 
3075 	u16 counter_offset_beacon[2];
3076 	u16 counter_offset_presp[2];
3077 
3078 	int link_id;
3079 
3080 	struct unsol_bcast_probe_resp ubpr;
3081 };
3082 
3083 /**
3084  * struct cca_settings - Settings for color switch command
3085  * @cca_count: Count in Beacon frames (TBTT) to perform the switch
3086  * @cca_color: The new color that we are switching to
3087  * @beacon_cca: Beacon/Probe Response/(Re)Association Response frame info for
3088  * color switch period
3089  * @beacon_after: Next Beacon/Probe Response/(Re)Association Response frame info
3090  * @counter_offset_beacon: Offset to the count field in Beacon frame tail
3091  * @counter_offset_presp: Offset to the count field in Probe Response frame
3092  * @ubpr: Unsolicited broadcast Probe Response frame data
3093  * @link_id: If >= 0 indicates the link of the AP MLD to configure
3094  */
3095 struct cca_settings {
3096 	u8 cca_count;
3097 	u8 cca_color;
3098 
3099 	struct beacon_data beacon_cca;
3100 	struct beacon_data beacon_after;
3101 
3102 	u16 counter_offset_beacon;
3103 	u16 counter_offset_presp;
3104 
3105 	struct unsol_bcast_probe_resp ubpr;
3106 
3107 	int link_id;
3108 };
3109 
3110 /* TDLS peer capabilities for send_tdls_mgmt() */
3111 enum tdls_peer_capability {
3112 	TDLS_PEER_HT = BIT(0),
3113 	TDLS_PEER_VHT = BIT(1),
3114 	TDLS_PEER_WMM = BIT(2),
3115 	TDLS_PEER_HE = BIT(3),
3116 };
3117 
3118 /* valid info in the wmm_params struct */
3119 enum wmm_params_valid_info {
3120 	WMM_PARAMS_UAPSD_QUEUES_INFO = BIT(0),
3121 };
3122 
3123 /**
3124  * struct wmm_params - WMM parameterss configured for this association
3125  * @info_bitmap: Bitmap of valid wmm_params info; indicates what fields
3126  *	of the struct contain valid information.
3127  * @uapsd_queues: Bitmap of ACs configured for uapsd (valid only if
3128  *	%WMM_PARAMS_UAPSD_QUEUES_INFO is set)
3129  */
3130 struct wmm_params {
3131 	u8 info_bitmap;
3132 	u8 uapsd_queues;
3133 };
3134 
3135 #ifdef CONFIG_MACSEC
3136 struct macsec_init_params {
3137 	bool always_include_sci;
3138 	bool use_es;
3139 	bool use_scb;
3140 };
3141 #endif /* CONFIG_MACSEC */
3142 
3143 enum drv_br_port_attr {
3144 	DRV_BR_PORT_ATTR_PROXYARP,
3145 	DRV_BR_PORT_ATTR_HAIRPIN_MODE,
3146 	DRV_BR_PORT_ATTR_MCAST2UCAST,
3147 };
3148 
3149 enum drv_br_net_param {
3150 	DRV_BR_NET_PARAM_GARP_ACCEPT,
3151 	DRV_BR_MULTICAST_SNOOPING,
3152 };
3153 
3154 struct drv_acs_params {
3155 	/* Selected mode (HOSTAPD_MODE_*) */
3156 	enum hostapd_hw_mode hw_mode;
3157 
3158 	/* Indicates whether HT is enabled */
3159 	int ht_enabled;
3160 
3161 	/* Indicates whether HT40 is enabled */
3162 	int ht40_enabled;
3163 
3164 	/* Indicates whether VHT is enabled */
3165 	int vht_enabled;
3166 
3167 	/* Configured ACS channel width */
3168 	u16 ch_width;
3169 
3170 	/* ACS frequency list info */
3171 	const int *freq_list;
3172 
3173 	/* Indicates whether EDMG is enabled */
3174 	int edmg_enabled;
3175 
3176 	/* Indicates whether EHT is enabled */
3177 	bool eht_enabled;
3178 
3179 	/* Indicates the link if MLO case; -1 otherwise */
3180 	int link_id;
3181 };
3182 
3183 struct wpa_bss_trans_info {
3184 	u8 mbo_transition_reason;
3185 	u8 n_candidates;
3186 	u8 *bssid;
3187 };
3188 
3189 struct wpa_bss_candidate_info {
3190 	u8 num;
3191 	struct candidate_list {
3192 		u8 bssid[ETH_ALEN];
3193 		u8 is_accept;
3194 		u32 reject_reason;
3195 	} *candidates;
3196 };
3197 
3198 struct wpa_pmkid_params {
3199 	const u8 *bssid;
3200 	const u8 *ssid;
3201 	size_t ssid_len;
3202 	const u8 *fils_cache_id;
3203 	const u8 *pmkid;
3204 	const u8 *pmk;
3205 	size_t pmk_len;
3206 	u32 pmk_lifetime;
3207 	u8 pmk_reauth_threshold;
3208 };
3209 
3210 /* Mask used to specify which connection parameters have to be updated */
3211 enum wpa_drv_update_connect_params_mask {
3212 	WPA_DRV_UPDATE_ASSOC_IES	= BIT(0),
3213 	WPA_DRV_UPDATE_FILS_ERP_INFO	= BIT(1),
3214 	WPA_DRV_UPDATE_AUTH_TYPE	= BIT(2),
3215 };
3216 
3217 /**
3218  * struct external_auth - External authentication trigger parameters
3219  *
3220  * These are used across the external authentication request and event
3221  * interfaces.
3222  * @action: Action type / trigger for external authentication. Only significant
3223  *	for the event interface.
3224  * @bssid: BSSID of the peer with which the authentication has to happen. Used
3225  *	by both the request and event interface.
3226  * @ssid: SSID of the AP. Used by both the request and event interface.
3227  * @ssid_len: SSID length in octets.
3228  * @key_mgmt_suite: AKM suite of the respective authentication. Optional for
3229  *	the request interface.
3230  * @status: Status code, %WLAN_STATUS_SUCCESS for successful authentication,
3231  *	use %WLAN_STATUS_UNSPECIFIED_FAILURE if wpa_supplicant cannot give
3232  *	the real status code for failures. Used only for the request interface
3233  *	from user space to the driver.
3234  * @pmkid: Generated PMKID as part of external auth exchange (e.g., SAE).
3235  * @mld_addr: AP's MLD address or %NULL if MLO is not used
3236  * @auth_alg: Authentication algorithm to be used
3237  * @pairwise_cipher: Pairwise cipher to be used, WPA_CIPHER_*
3238  * @group_cipher: Group cipher to be used, WPA_CIPHER_*
3239  * @group_mgmt_cipher: Group management cipher to be used, WPA_CIPHER_*
3240  * @rsn_capab: RSN capabilities
3241  * @rsnxe_data: Extended RSN capabilities data
3242  * @rsnxe_data_len: Length of Extended RSN capabilities data in octets
3243  * @kck: Key Confirmation Key (KCK) to pass to driver for IEEE 802.1X
3244  *	Authentication offload
3245  * @kck_len: Length of the KCK
3246  */
3247 struct external_auth {
3248 	enum {
3249 		EXT_AUTH_START,
3250 		EXT_AUTH_ABORT,
3251 	} action;
3252 	const u8 *bssid;
3253 	const u8 *ssid;
3254 	size_t ssid_len;
3255 	unsigned int key_mgmt_suite;
3256 	u16 status;
3257 	const u8 *pmkid;
3258 	const u8 *mld_addr;
3259 	unsigned int auth_alg;
3260 	int pairwise_cipher;
3261 	int group_cipher;
3262 	int group_mgmt_cipher;
3263 	u16 rsn_capab;
3264 	const u8 *rsnxe_data;
3265 	size_t rsnxe_data_len;
3266 
3267 	const u8 *kck;
3268 	size_t kck_len;
3269 };
3270 
3271 #define WPAS_MAX_PASN_PEERS 10
3272 
3273 enum pasn_status {
3274 	PASN_STATUS_SUCCESS = 0,
3275 	PASN_STATUS_FAILURE = 1,
3276 };
3277 
3278 /**
3279  * struct pasn_peer - PASN peer parameters
3280  *
3281  * Used to process the PASN authentication event from the driver to
3282  * userspace and to send a response back.
3283  * @own_addr: Own MAC address specified by the driver to use for PASN
3284  *	handshake.
3285  * @peer_addr: MAC address of the peer with which PASN authentication is to be
3286  *	performed.
3287  * @network_id: Unique id for the network.
3288  *	This identifier is used as a unique identifier for each network
3289  *	block when using the control interface. Each network is allocated an
3290  *	id when it is being created, either when reading the configuration
3291  *	file or when a new network is added through the control interface.
3292  * @akmp: Authentication key management protocol type supported.
3293  * @cipher: Cipher suite.
3294  * @group: Finite cyclic group. Default group used is 19 (ECC).
3295  * @temporary_network: Indicates if a temporary network was created to perform
3296  *	PASN authentication.
3297  * @password: Password of user requested network.
3298  * @comeback_len: Length of the comeback cookie data.
3299  * @comeback: Comeback cookie data that may be present in case a temporary
3300  * rejection is received from the AP.
3301  * @comeback_after: The time after which the STA can try for PASN handshake in
3302  * case of temporary rejection.
3303  * @ltf_keyseed_required: Indicates whether LTF keyseed generation is required
3304  * @status: PASN response status, %PASN_STATUS_SUCCESS for successful
3305  *	authentication, use %PASN_STATUS_FAILURE if PASN authentication
3306  *	fails or if wpa_supplicant fails to set the security ranging context to
3307  *	the driver
3308  */
3309 struct pasn_peer {
3310 	u8 own_addr[ETH_ALEN];
3311 	u8 peer_addr[ETH_ALEN];
3312 	int network_id;
3313 	int akmp;
3314 	int cipher;
3315 	int group;
3316 	bool temporary_network;
3317 	char *password;
3318 	size_t comeback_len;
3319 	u8 *comeback;
3320 	u16 comeback_after;
3321 	bool ltf_keyseed_required;
3322 	enum pasn_status status;
3323 };
3324 
3325 /**
3326  * struct pasn_auth - PASN authentication trigger parameters
3327  *
3328  * These are used across the PASN authentication event from the driver to
3329  * userspace and to send a response to it.
3330  * @action: Action type. Only significant for the event interface.
3331  * @num_peers: The number of peers for which the PASN handshake is requested
3332  *	for.
3333  * @peer: Holds the peer details.
3334  */
3335 struct pasn_auth {
3336 	enum {
3337 		PASN_ACTION_AUTH,
3338 		PASN_ACTION_DELETE_SECURE_RANGING_CONTEXT,
3339 	} action;
3340 	unsigned int num_peers;
3341 	struct pasn_peer peer[WPAS_MAX_PASN_PEERS];
3342 };
3343 
3344 /**
3345  * struct secure_ranging_params - Parameters required to set secure ranging
3346  *	context for a peer.
3347  *
3348  * @action: Add or delete a security context to the driver.
3349  * @own_addr: Own MAC address used during key derivation.
3350  * @peer_addr: Address of the peer device.
3351  * @cipher: Cipher suite.
3352  * @tk_len: Length of temporal key.
3353  * @tk: Temporal key buffer.
3354  * @ltf_keyseed_len: Length of LTF keyseed.
3355  * @ltf_keyeed: LTF keyseed buffer.
3356  */
3357 struct secure_ranging_params {
3358 	u32 action;
3359 	const u8 *own_addr;
3360 	const u8 *peer_addr;
3361 	u32 cipher;
3362 	u8 tk_len;
3363 	const u8 *tk;
3364 	u8 ltf_keyseed_len;
3365 	const u8 *ltf_keyseed;
3366 };
3367 
3368 /* enum nested_attr - Used to specify if subcommand uses nested attributes */
3369 enum nested_attr {
3370 	NESTED_ATTR_NOT_USED = 0,
3371 	NESTED_ATTR_USED = 1,
3372 	NESTED_ATTR_UNSPECIFIED = 2,
3373 };
3374 
3375 /* Preferred channel list information */
3376 
3377 /* GO role */
3378 #define WEIGHTED_PCL_GO BIT(0)
3379 /* P2P Client role */
3380 #define WEIGHTED_PCL_CLI BIT(1)
3381 /* Must be considered for operating channel */
3382 #define WEIGHTED_PCL_MUST_CONSIDER BIT(2)
3383 /* Should be excluded in GO negotiation */
3384 #define WEIGHTED_PCL_EXCLUDE BIT(3)
3385 
3386 /* Preferred channel list with weight */
3387 struct weighted_pcl {
3388 	u32 freq; /* MHz */
3389 	u8 weight;
3390 	u32 flag; /* bitmap for WEIGHTED_PCL_* */
3391 };
3392 
3393 struct driver_sta_mlo_info {
3394 	bool default_map;
3395 	u16 req_links; /* bitmap of requested link IDs */
3396 	u16 valid_links; /* bitmap of accepted link IDs */
3397 	u8 assoc_link_id;
3398 	u8 ap_mld_addr[ETH_ALEN];
3399 	struct {
3400 		u8 addr[ETH_ALEN];
3401 		u8 bssid[ETH_ALEN];
3402 		unsigned int freq;
3403 		struct t2lm_mapping t2lmap;
3404 	} links[MAX_NUM_MLD_LINKS];
3405 };
3406 
3407 /**
3408  * struct nan_band_config - NAN band specific configuration
3409  *
3410  * For details on NAN band configuration, see the Wi-Fi Aware Specification
3411  *
3412  * @frequency: Frequency in MHz for the band
3413  * @rssi_close: RSSI close threshold used for NAN state transition algorithm
3414  * @rssi_middle: RSSI middle threshold used for NAN state transition algorithm
3415  * @awake_dw_interval: Committed DW information
3416  * @disable_scan: Disable scan for this band
3417  */
3418 struct nan_band_config {
3419 	u16 frequency;
3420 	s8 rssi_close;
3421 	s8 rssi_middle;
3422 	u8 awake_dw_interval;
3423 	bool disable_scan;
3424 };
3425 
3426 /**
3427  * struct nan_cluster_config - NAN cluster configuration
3428  *
3429  * @master_pref: Master preference for the cluster
3430  * @dual_band: Dual band operation enabled
3431  * @enable_dw_notif: Enable discovery window notifications
3432  * @cluster_id: Cluster ID for the NAN cluster
3433  * @scan_period: Period for NAN scan in seconds
3434  * @scan_dwell_time: Dwell time for NAN scan in TUs per channel
3435  * @discovery_beacon_interval: Interval for discovery beacon in TUs
3436  * @low_band_cfg: Configuration for low band NAN operation
3437  * @high_band_cfg: Configuration for high band NAN operation
3438  * @extra_nan_attrs: Extra NAN attributes to be included in NAN beacons
3439  * @extra_nan_attrs_len: Length of the extra NAN attributes
3440  * @vendor_elems: Vendor specific elements to be included in NAN beacons
3441  * @vendor_elems_len: Length of the vendor specific elements
3442  */
3443 struct nan_cluster_config {
3444 	u8 master_pref;
3445 	u8 dual_band;
3446 	bool enable_dw_notif;
3447 
3448 	u8 cluster_id[ETH_ALEN];
3449 	u16 scan_period;
3450 	u16 scan_dwell_time;
3451 	u8 discovery_beacon_interval;
3452 	struct nan_band_config low_band_cfg;
3453 	struct nan_band_config high_band_cfg;
3454 	const u8 *extra_nan_attrs;
3455 	size_t extra_nan_attrs_len;
3456 	const u8 *vendor_elems;
3457 	size_t vendor_elems_len;
3458 };
3459 
3460 /**
3461  * Even if the device supports more channels, 4 channels should be enough
3462  * for any practical purpose
3463  */
3464 #define MAX_NUM_NAN_SCHEDULE_CHANNELS 4
3465 
3466 #define MAX_NUM_NAN_MAPS 2
3467 
3468 /**
3469  * struct nan_schedule_config - NAN schedule configuration
3470  *
3471  * @deferred: true if the driver should announce the schedule update to peers
3472  *	before applying it
3473  * @num_channels: Number of channels in the schedule
3474  * @channels: Channel specific schedule information
3475  * @avail_attr: NAN Availability attribute as defined in Wi-Fi Aware spec v4.0,
3476  *	Table 93
3477  */
3478 struct nan_schedule_config {
3479 	bool deferred;
3480 	u8 num_channels;
3481 
3482 	/**
3483 	 * channels - Channel specific schedule information
3484 	 *
3485 	 * @freq: Frequency in MHz
3486 	 * @center_freq1: Center frequency 1 in MHz
3487 	 * @center_freq2: Center frequency 2 in MHz
3488 	 * @bandwidth: Channel bandwidth
3489 	 * @time_bitmap: Bitmap indicating the committed availability
3490 	 *     on the channel.
3491 	 * @rx_nss: Number of spatial streams supported for RX on the
3492 	 *     channel
3493 	 * @chan_entry: Channel Entry as defined in Wi-Fi Aware spec v4.0,
3494 	 *     Table 100 (Channel Entry format for the NAN Availability
3495 	 *     attribute).
3496 	 *
3497 	 * Note: Time bitmap slot duration and schedule length equal to the
3498 	 * reported NAN capabilities (see &nan_slot_duration and
3499 	 * &nan_schedule_length in &struct wpa_driver_capa).
3500 	 */
3501 	struct nan_schedule_channel {
3502 		int freq;
3503 		int center_freq1;
3504 		int center_freq2;
3505 		int bandwidth;
3506 		struct wpabuf *time_bitmap;
3507 		u8 rx_nss;
3508 
3509 		u8 chan_entry[6];
3510 	} channels[MAX_NUM_NAN_SCHEDULE_CHANNELS];
3511 
3512 	struct wpabuf *avail_attr;
3513 };
3514 
3515 /**
3516  * struct nan_peer_schedule_config - NAN peer schedule configuration
3517  *
3518  * @n_maps: Number of maps in the schedule
3519  * @maps: Map specific schedule information
3520  */
3521 struct nan_peer_schedule_config {
3522 	u8 n_maps;
3523 
3524 	/**
3525 	 * maps - Map specific schedule information
3526 	 *
3527 	 * @map_id: Map ID
3528 	 * @sched: NAN schedule configuration for the map
3529 	 */
3530 	struct nan_schedule_map {
3531 		u8 map_id;
3532 		struct nan_schedule_config sched;
3533 	} maps[MAX_NUM_NAN_MAPS];
3534 };
3535 
3536 /**
3537  * struct wpa_driver_ops - Driver interface API definition
3538  *
3539  * This structure defines the API that each driver interface needs to implement
3540  * for core wpa_supplicant code. All driver specific functionality is captured
3541  * in this wrapper.
3542  */
3543 struct wpa_driver_ops {
3544 	/** Name of the driver interface */
3545 	const char *name;
3546 	/** One line description of the driver interface */
3547 	const char *desc;
3548 
3549 	/**
3550 	 * get_bssid - Get the current BSSID
3551 	 * @priv: private driver interface data
3552 	 * @bssid: buffer for BSSID (ETH_ALEN = 6 bytes)
3553 	 *
3554 	 * Returns: 0 on success, -1 on failure
3555 	 *
3556 	 * Query kernel driver for the current BSSID and copy it to bssid.
3557 	 * Setting bssid to 00:00:00:00:00:00 is recommended if the STA is not
3558 	 * associated.
3559 	 */
3560 	int (*get_bssid)(void *priv, u8 *bssid);
3561 
3562 	/**
3563 	 * get_ssid - Get the current SSID
3564 	 * @priv: private driver interface data
3565 	 * @ssid: buffer for SSID (at least 32 bytes)
3566 	 *
3567 	 * Returns: Length of the SSID on success, -1 on failure
3568 	 *
3569 	 * Query kernel driver for the current SSID and copy it to ssid.
3570 	 * Returning zero is recommended if the STA is not associated.
3571 	 *
3572 	 * Note: SSID is an array of octets, i.e., it is not nul terminated and
3573 	 * can, at least in theory, contain control characters (including nul)
3574 	 * and as such, should be processed as binary data, not a printable
3575 	 * string.
3576 	 */
3577 	int (*get_ssid)(void *priv, u8 *ssid);
3578 
3579 	/**
3580 	 * set_key - Configure encryption key
3581 	 * @priv: private driver interface data
3582 	 * @params: Key parameters
3583 	 * Returns: 0 on success, -1 on failure
3584 	 *
3585 	 * Configure the given key for the kernel driver. If the driver
3586 	 * supports separate individual keys (4 default keys + 1 individual),
3587 	 * addr can be used to determine whether the key is default or
3588 	 * individual. If only 4 keys are supported, the default key with key
3589 	 * index 0 is used as the individual key. STA must be configured to use
3590 	 * it as the default Tx key (set_tx is set) and accept Rx for all the
3591 	 * key indexes. In most cases, WPA uses only key indexes 1 and 2 for
3592 	 * broadcast keys, so key index 0 is available for this kind of
3593 	 * configuration.
3594 	 *
3595 	 * For pairwise keys, there are potential race conditions between
3596 	 * enabling a new TK on each end of the connection and sending the first
3597 	 * protected frame. Drivers have multiple options on which style of key
3598 	 * configuration to support with the simplest option not providing any
3599 	 * protection for the race condition while the more complex options do
3600 	 * provide partial or full protection.
3601 	 *
3602 	 * Option 1: Do not support extended key IDs (i.e., use only Key ID 0
3603 	 * for pairwise keys) and do not support configuration of the next TK
3604 	 * as an alternative RX key. This provides no protection, but is simple
3605 	 * to support. The driver needs to ignore set_key() calls with
3606 	 * KEY_FLAG_NEXT.
3607 	 *
3608 	 * Option 2: Do not support extended key IDs (i.e., use only Key ID 0
3609 	 * for pairwise keys), but support configuration of the next TK as an
3610 	 * alternative RX key for the initial 4-way handshake. This provides
3611 	 * protection for the initial key setup at the beginning of an
3612 	 * association. The driver needs to configure the initial TK for RX-only
3613 	 * when receiving a set_key() call with KEY_FLAG_NEXT. This RX-only key
3614 	 * is ready for receiving protected Data frames from the peer before the
3615 	 * local device has enabled the key for TX. Unprotected EAPOL frames
3616 	 * need to be allowed even when this next TK is configured as RX-only
3617 	 * key. The same key is then set with KEY_FLAG_PAIRWISE_RX_TX to enable
3618 	 * its use for both TX and RX. The driver ignores set_key() calls with
3619 	 * KEY_FLAG_NEXT when a TK has been configured. When fully enabling the
3620 	 * TK for TX and RX, the RX counters associated with the TK must not be
3621 	 * cleared.
3622 	 *
3623 	 * Option 3: Same as option 2, but the driver supports multiple RX keys
3624 	 * in parallel during PTK rekeying. The driver processed set_key() calls
3625 	 * with KEY_FLAG_NEXT also when a TK has been configured. At that point
3626 	 * in the rekeying sequence the driver uses the previously configured TK
3627 	 * for TX and decrypts received frames with either the previously
3628 	 * configured TK or the next TK (RX-only).
3629 	 *
3630 	 * Option 4: The driver supports extended Key IDs and they are used for
3631 	 * an association but does not support KEY_FLAG_NEXT (options 2 and 3).
3632 	 * The next TK is configured as RX-only with KEY_FLAG_PAIRWISE_RX and
3633 	 * it is enabled for TX and RX with KEY_FLAG_PAIRWISE_RX_TX_MODIFY. When
3634 	 * extended key ID is not used for an association, the driver behaves
3635 	 * like in option 1.
3636 	 *
3637 	 * Option 5 and 6: Like option 4 but with support for KEY_FLAG_NEXT as
3638 	 * described above for options 2 and 3, respectively. Option 4 is used
3639 	 * for cases where extended key IDs are used for an association. Option
3640 	 * 2 or 3 is used for cases where extended key IDs are not used.
3641 	 *
3642 	 * Please note that TKIP keys include separate TX and RX MIC keys and
3643 	 * some drivers may expect them in different order than wpa_supplicant
3644 	 * is using. If the TX/RX keys are swapped, all TKIP encrypted packets
3645 	 * will trigger Michael MIC errors. This can be fixed by changing the
3646 	 * order of MIC keys by swapping the bytes 16..23 and 24..31 of the key
3647 	 * in driver_*.c set_key() implementation, see driver_ndis.c for an
3648 	 * example on how this can be done.
3649 	 */
3650 	int (*set_key)(void *priv, struct wpa_driver_set_key_params *params);
3651 
3652 	/**
3653 	 * init - Initialize driver interface
3654 	 * @ctx: context to be used when calling wpa_supplicant functions,
3655 	 * e.g., wpa_supplicant_event()
3656 	 * @ifname: interface name, e.g., wlan0
3657 	 *
3658 	 * Returns: Pointer to private data, %NULL on failure
3659 	 *
3660 	 * Initialize driver interface, including event processing for kernel
3661 	 * driver events (e.g., associated, scan results, Michael MIC failure).
3662 	 * This function can allocate a private configuration data area for
3663 	 * @ctx, file descriptor, interface name, etc. information that may be
3664 	 * needed in future driver operations. If this is not used, non-NULL
3665 	 * value will need to be returned because %NULL is used to indicate
3666 	 * failure. The returned value will be used as 'void *priv' data for
3667 	 * all other driver_ops functions.
3668 	 *
3669 	 * The main event loop (eloop.c) of wpa_supplicant can be used to
3670 	 * register callback for read sockets (eloop_register_read_sock()).
3671 	 *
3672 	 * See below for more information about events and
3673 	 * wpa_supplicant_event() function.
3674 	 */
3675 	void * (*init)(void *ctx, const char *ifname);
3676 
3677 	/**
3678 	 * deinit - Deinitialize driver interface
3679 	 * @priv: private driver interface data from init()
3680 	 *
3681 	 * Shut down driver interface and processing of driver events. Free
3682 	 * private data buffer if one was allocated in init() handler.
3683 	 */
3684 	void (*deinit)(void *priv);
3685 
3686 	/**
3687 	 * set_param - Set driver configuration parameters
3688 	 * @priv: private driver interface data from init()
3689 	 * @param: driver specific configuration parameters
3690 	 *
3691 	 * Returns: 0 on success, -1 on failure
3692 	 *
3693 	 * Optional handler for notifying driver interface about configuration
3694 	 * parameters (driver_param).
3695 	 */
3696 	int (*set_param)(void *priv, const char *param);
3697 
3698 	/**
3699 	 * set_countermeasures - Enable/disable TKIP countermeasures
3700 	 * @priv: private driver interface data
3701 	 * @enabled: 1 = countermeasures enabled, 0 = disabled
3702 	 *
3703 	 * Returns: 0 on success, -1 on failure
3704 	 *
3705 	 * Configure TKIP countermeasures. When these are enabled, the driver
3706 	 * should drop all received and queued frames that are using TKIP.
3707 	 */
3708 	int (*set_countermeasures)(void *priv, int enabled);
3709 
3710 	/**
3711 	 * deauthenticate - Request driver to deauthenticate
3712 	 * @priv: private driver interface data
3713 	 * @addr: peer address (BSSID of the AP)
3714 	 * @reason_code: 16-bit reason code to be sent in the deauthentication
3715 	 *	frame
3716 	 *
3717 	 * Returns: 0 on success, -1 on failure
3718 	 */
3719 	int (*deauthenticate)(void *priv, const u8 *addr, u16 reason_code);
3720 
3721 	/**
3722 	 * associate - Request driver to associate
3723 	 * @priv: private driver interface data
3724 	 * @params: association parameters
3725 	 *
3726 	 * Returns: 0 on success, -1 on failure
3727 	 */
3728 	int (*associate)(void *priv,
3729 			 struct wpa_driver_associate_params *params);
3730 
3731 	/**
3732 	 * add_pmkid - Add PMKSA cache entry to the driver
3733 	 * @priv: private driver interface data
3734 	 * @params: PMKSA parameters
3735 	 *
3736 	 * Returns: 0 on success, -1 on failure
3737 	 *
3738 	 * This function is called when a new PMK is received, as a result of
3739 	 * either normal authentication or RSN pre-authentication. The PMKSA
3740 	 * parameters are either a set of bssid, pmkid, and pmk; or a set of
3741 	 * ssid, fils_cache_id, pmkid, and pmk.
3742 	 *
3743 	 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
3744 	 * associate(), add_pmkid() can be used to add new PMKSA cache entries
3745 	 * in the driver. If the driver uses wpa_ie from wpa_supplicant, this
3746 	 * driver_ops function does not need to be implemented. Likewise, if
3747 	 * the driver does not support WPA, this function is not needed.
3748 	 */
3749 	int (*add_pmkid)(void *priv, struct wpa_pmkid_params *params);
3750 
3751 	/**
3752 	 * remove_pmkid - Remove PMKSA cache entry to the driver
3753 	 * @priv: private driver interface data
3754 	 * @params: PMKSA parameters
3755 	 *
3756 	 * Returns: 0 on success, -1 on failure
3757 	 *
3758 	 * This function is called when the supplicant drops a PMKSA cache
3759 	 * entry for any reason. The PMKSA parameters are either a set of
3760 	 * bssid and pmkid; or a set of ssid, fils_cache_id, and pmkid.
3761 	 *
3762 	 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
3763 	 * associate(), remove_pmkid() can be used to synchronize PMKSA caches
3764 	 * between the driver and wpa_supplicant. If the driver uses wpa_ie
3765 	 * from wpa_supplicant, this driver_ops function does not need to be
3766 	 * implemented. Likewise, if the driver does not support WPA, this
3767 	 * function is not needed.
3768 	 */
3769 	int (*remove_pmkid)(void *priv, struct wpa_pmkid_params *params);
3770 
3771 	/**
3772 	 * flush_pmkid - Flush PMKSA cache
3773 	 * @priv: private driver interface data
3774 	 *
3775 	 * Returns: 0 on success, -1 on failure
3776 	 *
3777 	 * This function is called when the supplicant drops all PMKSA cache
3778 	 * entries for any reason.
3779 	 *
3780 	 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
3781 	 * associate(), remove_pmkid() can be used to synchronize PMKSA caches
3782 	 * between the driver and wpa_supplicant. If the driver uses wpa_ie
3783 	 * from wpa_supplicant, this driver_ops function does not need to be
3784 	 * implemented. Likewise, if the driver does not support WPA, this
3785 	 * function is not needed.
3786 	 */
3787 	int (*flush_pmkid)(void *priv);
3788 
3789 	/**
3790 	 * get_capa - Get driver capabilities
3791 	 * @priv: private driver interface data
3792 	 *
3793 	 * Returns: 0 on success, -1 on failure
3794 	 *
3795 	 * Get driver/firmware/hardware capabilities.
3796 	 */
3797 	int (*get_capa)(void *priv, struct wpa_driver_capa *capa);
3798 
3799 	/**
3800 	 * poll - Poll driver for association information
3801 	 * @priv: private driver interface data
3802 	 *
3803 	 * This is an optional callback that can be used when the driver does
3804 	 * not provide event mechanism for association events. This is called
3805 	 * when receiving WPA/RSN EAPOL-Key messages that require association
3806 	 * information. The driver interface is supposed to generate associnfo
3807 	 * event before returning from this callback function. In addition, the
3808 	 * driver interface should generate an association event after having
3809 	 * sent out associnfo.
3810 	 */
3811 	void (*poll)(void *priv);
3812 
3813 	/**
3814 	 * get_ifindex - Get interface index
3815 	 * @priv: private driver interface data
3816 	 *
3817 	 * Returns: Interface index
3818 	 */
3819 	unsigned int (*get_ifindex)(void *priv);
3820 
3821 	/**
3822 	 * get_ifname - Get interface name
3823 	 * @priv: private driver interface data
3824 	 *
3825 	 * Returns: Pointer to the interface name. This can differ from the
3826 	 * interface name used in init() call. Init() is called first.
3827 	 *
3828 	 * This optional function can be used to allow the driver interface to
3829 	 * replace the interface name with something else, e.g., based on an
3830 	 * interface mapping from a more descriptive name.
3831 	 */
3832 	const char * (*get_ifname)(void *priv);
3833 
3834 	/**
3835 	 * get_mac_addr - Get own MAC address
3836 	 * @priv: private driver interface data
3837 	 *
3838 	 * Returns: Pointer to own MAC address or %NULL on failure
3839 	 *
3840 	 * This optional function can be used to get the own MAC address of the
3841 	 * device from the driver interface code. This is only needed if the
3842 	 * l2_packet implementation for the OS does not provide easy access to
3843 	 * a MAC address. */
3844 	const u8 * (*get_mac_addr)(void *priv);
3845 
3846 	/**
3847 	 * set_operstate - Sets device operating state to DORMANT or UP
3848 	 * @priv: private driver interface data
3849 	 * @state: 0 = dormant, 1 = up
3850 	 * Returns: 0 on success, -1 on failure
3851 	 *
3852 	 * This is an optional function that can be used on operating systems
3853 	 * that support a concept of controlling network device state from user
3854 	 * space applications. This function, if set, gets called with
3855 	 * state = 1 when authentication has been completed and with state = 0
3856 	 * when connection is lost.
3857 	 */
3858 	int (*set_operstate)(void *priv, int state);
3859 
3860 	/**
3861 	 * mlme_setprotection - MLME-SETPROTECTION.request primitive
3862 	 * @priv: Private driver interface data
3863 	 * @addr: Address of the station for which to set protection (may be
3864 	 * %NULL for group keys)
3865 	 * @protect_type: MLME_SETPROTECTION_PROTECT_TYPE_*
3866 	 * @key_type: MLME_SETPROTECTION_KEY_TYPE_*
3867 	 * Returns: 0 on success, -1 on failure
3868 	 *
3869 	 * This is an optional function that can be used to set the driver to
3870 	 * require protection for Tx and/or Rx frames. This uses the layer
3871 	 * interface defined in IEEE 802.11i-2004 clause 10.3.22.1
3872 	 * (MLME-SETPROTECTION.request). Many drivers do not use explicit
3873 	 * set protection operation; instead, they set protection implicitly
3874 	 * based on configured keys.
3875 	 */
3876 	int (*mlme_setprotection)(void *priv, const u8 *addr, int protect_type,
3877 				  int key_type);
3878 
3879 	/**
3880 	 * get_hw_feature_data - Get hardware support data (channels and rates)
3881 	 * @priv: Private driver interface data
3882 	 * @num_modes: Variable for returning the number of returned modes
3883 	 * flags: Variable for returning hardware feature flags
3884 	 * @dfs: Variable for returning DFS region (HOSTAPD_DFS_REGION_*)
3885 	 * @alpha2: Buffer for returning the country code (at least 3 bytes),
3886 	 *	or %NULL if not needed. Set to empty string if not available.
3887 	 * @alpha2_len: Length of the @alpha2 buffer
3888 	 * Returns: Pointer to allocated hardware data on success or %NULL on
3889 	 * failure. Caller is responsible for freeing this.
3890 	 */
3891 	struct hostapd_hw_modes * (*get_hw_feature_data)(void *priv,
3892 							 u16 *num_modes,
3893 							 u16 *flags, u8 *dfs,
3894 							 char *alpha2,
3895 							 size_t alpha2_len);
3896 
3897 	/**
3898 	 * send_mlme - Send management frame from MLME
3899 	 * @priv: Private driver interface data
3900 	 * @data: IEEE 802.11 management frame with IEEE 802.11 header
3901 	 * @data_len: Size of the management frame
3902 	 * @noack: Do not wait for this frame to be acked (disable retries)
3903 	 * @freq: Frequency (in MHz) to send the frame on, or 0 to let the
3904 	 * driver decide
3905 	 * @csa_offs: Array of CSA offsets or %NULL
3906 	 * @csa_offs_len: Number of elements in csa_offs
3907 	 * @no_encrypt: Do not encrypt frame even if appropriate key exists
3908 	 *	(used only for testing purposes)
3909 	 * @wait: Time to wait off-channel for a response (in ms), or zero
3910 	 * @link_id: Link ID to use for TX, or -1 if not set
3911 	 * Returns: 0 on success, -1 on failure
3912 	 */
3913 	int (*send_mlme)(void *priv, const u8 *data, size_t data_len,
3914 			 int noack, unsigned int freq, const u16 *csa_offs,
3915 			 size_t csa_offs_len, int no_encrypt,
3916 			 unsigned int wait, int link_id);
3917 
3918 	/**
3919 	 * update_ft_ies - Update FT (IEEE 802.11r) IEs
3920 	 * @priv: Private driver interface data
3921 	 * @md: Mobility domain (2 octets) (also included inside ies)
3922 	 * @ies: FT IEs (MDIE, FTIE, ...) or %NULL to remove IEs
3923 	 * @ies_len: Length of FT IEs in bytes
3924 	 * Returns: 0 on success, -1 on failure
3925 	 *
3926 	 * The supplicant uses this callback to let the driver know that keying
3927 	 * material for FT is available and that the driver can use the
3928 	 * provided IEs in the next message in FT authentication sequence.
3929 	 *
3930 	 * This function is only needed for driver that support IEEE 802.11r
3931 	 * (Fast BSS Transition).
3932 	 */
3933 	int (*update_ft_ies)(void *priv, const u8 *md, const u8 *ies,
3934 			     size_t ies_len);
3935 
3936 	/**
3937 	 * get_scan_results - Fetch the latest scan results
3938 	 * @priv: Private driver interface data
3939 	 * @bssid: Return results only for the specified BSSID, %NULL for all
3940 	 *
3941 	 * Returns: Allocated buffer of scan results (caller is responsible for
3942 	 * freeing the data structure) on success, NULL on failure
3943 	 */
3944 	struct wpa_scan_results * (*get_scan_results)(void *priv,
3945 						      const u8 *bssid);
3946 
3947 	/**
3948 	 * get_scan_results2 - Fetch the latest scan results
3949 	 * @priv: private driver interface data
3950 	 *
3951 	 * Returns: Allocated buffer of scan results (caller is responsible for
3952 	 * freeing the data structure) on success, NULL on failure
3953 	 */
3954 	 struct wpa_scan_results * (*get_scan_results2)(void *priv);
3955 
3956 	/**
3957 	 * set_country - Set country
3958 	 * @priv: Private driver interface data
3959 	 * @alpha2: country to which to switch to
3960 	 * Returns: 0 on success, -1 on failure
3961 	 *
3962 	 * This function is for drivers which support some form
3963 	 * of setting a regulatory domain.
3964 	 */
3965 	int (*set_country)(void *priv, const char *alpha2);
3966 
3967 	/**
3968 	 * get_country - Get country
3969 	 * @priv: Private driver interface data
3970 	 * @alpha2: Buffer for returning country code (at least 3 octets)
3971 	 * Returns: 0 on success, -1 on failure
3972 	 */
3973 	int (*get_country)(void *priv, char *alpha2);
3974 
3975 	/**
3976 	 * global_init - Global driver initialization
3977 	 * @ctx: wpa_global pointer
3978 	 * Returns: Pointer to private data (global), %NULL on failure
3979 	 *
3980 	 * This optional function is called to initialize the driver wrapper
3981 	 * for global data, i.e., data that applies to all interfaces. If this
3982 	 * function is implemented, global_deinit() will also need to be
3983 	 * implemented to free the private data. The driver will also likely
3984 	 * use init2() function instead of init() to get the pointer to global
3985 	 * data available to per-interface initializer.
3986 	 */
3987 	void * (*global_init)(void *ctx);
3988 
3989 	/**
3990 	 * global_deinit - Global driver deinitialization
3991 	 * @priv: private driver global data from global_init()
3992 	 *
3993 	 * Terminate any global driver related functionality and free the
3994 	 * global data structure.
3995 	 */
3996 	void (*global_deinit)(void *priv);
3997 
3998 	/**
3999 	 * init2 - Initialize driver interface (with global data)
4000 	 * @ctx: context to be used when calling wpa_supplicant functions,
4001 	 * e.g., wpa_supplicant_event()
4002 	 * @ifname: interface name, e.g., wlan0
4003 	 * @global_priv: private driver global data from global_init()
4004 	 * @p2p_mode: P2P mode for a GO (not applicable for other interface
4005 	 *	types)
4006 	 * Returns: Pointer to private data, %NULL on failure
4007 	 *
4008 	 * This function can be used instead of init() if the driver wrapper
4009 	 * uses global data.
4010 	 */
4011 	void * (*init2)(void *ctx, const char *ifname, void *global_priv,
4012 			enum wpa_p2p_mode p2p_mode);
4013 
4014 	/**
4015 	 * get_interfaces - Get information about available interfaces
4016 	 * @global_priv: private driver global data from global_init()
4017 	 * Returns: Allocated buffer of interface information (caller is
4018 	 * responsible for freeing the data structure) on success, NULL on
4019 	 * failure
4020 	 */
4021 	struct wpa_interface_info * (*get_interfaces)(void *global_priv);
4022 
4023 	/**
4024 	 * scan2 - Request the driver to initiate scan
4025 	 * @priv: private driver interface data
4026 	 * @params: Scan parameters
4027 	 *
4028 	 * Returns: 0 on success, -1 on failure
4029 	 *
4030 	 * Once the scan results are ready, the driver should report scan
4031 	 * results event for wpa_supplicant which will eventually request the
4032 	 * results with wpa_driver_get_scan_results2().
4033 	 */
4034 	int (*scan2)(void *priv, struct wpa_driver_scan_params *params);
4035 
4036 	/**
4037 	 * authenticate - Request driver to authenticate
4038 	 * @priv: private driver interface data
4039 	 * @params: authentication parameters
4040 	 * Returns: 0 on success, -1 on failure
4041 	 *
4042 	 * This is an optional function that can be used with drivers that
4043 	 * support separate authentication and association steps, i.e., when
4044 	 * wpa_supplicant can act as the SME. If not implemented, associate()
4045 	 * function is expected to take care of IEEE 802.11 authentication,
4046 	 * too.
4047 	 */
4048 	int (*authenticate)(void *priv,
4049 			    struct wpa_driver_auth_params *params);
4050 
4051 	/**
4052 	 * set_ap - Set Beacon and Probe Response information for AP mode
4053 	 * @priv: Private driver interface data
4054 	 * @params: Parameters to use in AP mode
4055 	 *
4056 	 * This function is used to configure Beacon template and/or extra IEs
4057 	 * to add for Beacon and Probe Response frames for the driver in
4058 	 * AP mode. The driver is responsible for building the full Beacon
4059 	 * frame by concatenating the head part with TIM IE generated by the
4060 	 * driver/firmware and finishing with the tail part. Depending on the
4061 	 * driver architectue, this can be done either by using the full
4062 	 * template or the set of additional IEs (e.g., WPS and P2P IE).
4063 	 * Similarly, Probe Response processing depends on the driver design.
4064 	 * If the driver (or firmware) takes care of replying to Probe Request
4065 	 * frames, the extra IEs provided here needs to be added to the Probe
4066 	 * Response frames.
4067 	 *
4068 	 * Returns: 0 on success, -1 on failure
4069 	 */
4070 	int (*set_ap)(void *priv, struct wpa_driver_ap_params *params);
4071 
4072 	/**
4073 	 * set_acl - Set ACL in AP mode
4074 	 * @priv: Private driver interface data
4075 	 * @params: Parameters to configure ACL
4076 	 * Returns: 0 on success, -1 on failure
4077 	 *
4078 	 * This is used only for the drivers which support MAC address ACL.
4079 	 */
4080 	int (*set_acl)(void *priv, struct hostapd_acl_params *params);
4081 
4082 	/**
4083 	 * hapd_init - Initialize driver interface (hostapd only)
4084 	 * @hapd: Pointer to hostapd context
4085 	 * @params: Configuration for the driver wrapper
4086 	 * Returns: Pointer to private data, %NULL on failure
4087 	 *
4088 	 * This function is used instead of init() or init2() when the driver
4089 	 * wrapper is used with hostapd.
4090 	 */
4091 	void * (*hapd_init)(struct hostapd_data *hapd,
4092 			    struct wpa_init_params *params);
4093 
4094 	/**
4095 	 * hapd_deinit - Deinitialize driver interface (hostapd only)
4096 	 * @priv: Private driver interface data from hapd_init()
4097 	 */
4098 	void (*hapd_deinit)(void *priv);
4099 
4100 	/**
4101 	 * set_ieee8021x - Enable/disable IEEE 802.1X support (AP only)
4102 	 * @priv: Private driver interface data
4103 	 * @params: BSS parameters
4104 	 * Returns: 0 on success, -1 on failure
4105 	 *
4106 	 * This is an optional function to configure the kernel driver to
4107 	 * enable/disable IEEE 802.1X support and set WPA/WPA2 parameters. This
4108 	 * can be left undefined (set to %NULL) if IEEE 802.1X support is
4109 	 * always enabled and the driver uses set_ap() to set WPA/RSN IE
4110 	 * for Beacon frames.
4111 	 *
4112 	 * DEPRECATED - use set_ap() instead
4113 	 */
4114 	int (*set_ieee8021x)(void *priv, struct wpa_bss_params *params);
4115 
4116 	/**
4117 	 * set_privacy - Enable/disable privacy (AP only)
4118 	 * @priv: Private driver interface data
4119 	 * @enabled: 1 = privacy enabled, 0 = disabled
4120 	 * Returns: 0 on success, -1 on failure
4121 	 *
4122 	 * This is an optional function to configure privacy field in the
4123 	 * kernel driver for Beacon frames. This can be left undefined (set to
4124 	 * %NULL) if the driver uses the Beacon template from set_ap().
4125 	 *
4126 	 * DEPRECATED - use set_ap() instead
4127 	 */
4128 	int (*set_privacy)(void *priv, int enabled);
4129 
4130 	/**
4131 	 * get_seqnum - Fetch the current TSC/packet number (AP only)
4132 	 * @ifname: The interface name (main or virtual)
4133 	 * @priv: Private driver interface data
4134 	 * @addr: MAC address of the station or %NULL for group keys
4135 	 * @idx: Key index
4136 	 * @link_id: Link ID for a group key, or -1 if not set
4137 	 * @seq: Buffer for returning the latest used TSC/packet number
4138 	 * Returns: 0 on success, -1 on failure
4139 	 *
4140 	 * This function is used to fetch the last used TSC/packet number for
4141 	 * a TKIP, CCMP, GCMP, or BIP/IGTK key. It is mainly used with group
4142 	 * keys, so there is no strict requirement on implementing support for
4143 	 * unicast keys (i.e., addr != %NULL).
4144 	 */
4145 	int (*get_seqnum)(const char *ifname, void *priv, const u8 *addr,
4146 			  int idx, int link_id, u8 *seq);
4147 
4148 	/**
4149 	 * flush - Flush all association stations (AP only)
4150 	 * @priv: Private driver interface data
4151 	 * @link_id: In case of MLO, valid link ID on which all associated
4152 	 *	stations will be flushed, -1 otherwise.
4153 	 * Returns: 0 on success, -1 on failure
4154 	 *
4155 	 * This function requests the driver to disassociate all associated
4156 	 * stations. This function does not need to be implemented if the
4157 	 * driver does not process association frames internally.
4158 	 */
4159 	int (*flush)(void *priv, int link_id);
4160 
4161 	/**
4162 	 * set_generic_elem - Add IEs into Beacon/Probe Response frames (AP)
4163 	 * @priv: Private driver interface data
4164 	 * @elem: Information elements
4165 	 * @elem_len: Length of the elem buffer in octets
4166 	 * Returns: 0 on success, -1 on failure
4167 	 *
4168 	 * This is an optional function to add information elements in the
4169 	 * kernel driver for Beacon and Probe Response frames. This can be left
4170 	 * undefined (set to %NULL) if the driver uses the Beacon template from
4171 	 * set_ap().
4172 	 *
4173 	 * DEPRECATED - use set_ap() instead
4174 	 */
4175 	int (*set_generic_elem)(void *priv, const u8 *elem, size_t elem_len);
4176 
4177 	/**
4178 	 * read_sta_data - Fetch station data
4179 	 * @priv: Private driver interface data
4180 	 * @data: Buffer for returning station information
4181 	 * @addr: MAC address of the station
4182 	 * Returns: 0 on success, -1 on failure
4183 	 */
4184 	int (*read_sta_data)(void *priv, struct hostap_sta_driver_data *data,
4185 			     const u8 *addr);
4186 
4187 	/**
4188 	 * tx_control_port - Send a frame over the 802.1X controlled port
4189 	 * @priv: Private driver interface data
4190 	 * @dest: Destination MAC address
4191 	 * @proto: Ethertype in host byte order
4192 	 * @buf: Frame payload starting from IEEE 802.1X header
4193 	 * @len: Frame payload length
4194 	 * @no_encrypt: Do not encrypt frame
4195 	 * @link_id: Link ID to use for TX, or -1 if not set
4196 	 *
4197 	 * Returns 0 on success, else an error
4198 	 *
4199 	 * This is like a normal Ethernet send except that the driver is aware
4200 	 * (by other means than the Ethertype) that this frame is special,
4201 	 * and more importantly it gains an ordering between the transmission of
4202 	 * the frame and other driver management operations such as key
4203 	 * installations. This can be used to work around known limitations in
4204 	 * IEEE 802.11 protocols such as race conditions between rekeying 4-way
4205 	 * handshake message 4/4 and a PTK being overwritten.
4206 	 *
4207 	 * This function is only used for a given interface if the driver
4208 	 * instance reports WPA_DRIVER_FLAGS_CONTROL_PORT capability. Otherwise,
4209 	 * API users will fall back to sending the frame via a normal socket.
4210 	 */
4211 	int (*tx_control_port)(void *priv, const u8 *dest,
4212 			       u16 proto, const u8 *buf, size_t len,
4213 			       int no_encrypt, int link_id);
4214 
4215 	/**
4216 	 * hapd_send_eapol - Send an EAPOL packet (AP only)
4217 	 * @priv: private driver interface data
4218 	 * @addr: Destination MAC address
4219 	 * @data: EAPOL packet starting with IEEE 802.1X header
4220 	 * @data_len: Length of the EAPOL packet in octets
4221 	 * @encrypt: Whether the frame should be encrypted
4222 	 * @own_addr: Source MAC address
4223 	 * @flags: WPA_STA_* flags for the destination station
4224 	 * @link_id: Link ID to use for TX, or -1 if not set
4225 	 *
4226 	 * Returns: 0 on success, -1 on failure
4227 	 */
4228 	int (*hapd_send_eapol)(void *priv, const u8 *addr, const u8 *data,
4229 			       size_t data_len, int encrypt,
4230 			       const u8 *own_addr, u32 flags, int link_id);
4231 
4232 	/**
4233 	 * sta_deauth - Deauthenticate a station (AP only)
4234 	 * @priv: Private driver interface data
4235 	 * @own_addr: Source address and BSSID for the Deauthentication frame
4236 	 * @addr: MAC address of the station to deauthenticate
4237 	 * @reason: Reason code for the Deauthentication frame
4238 	 * @link_id: Link ID to use for Deauthentication frame, or -1 if not set
4239 	 * Returns: 0 on success, -1 on failure
4240 	 *
4241 	 * This function requests a specific station to be deauthenticated and
4242 	 * a Deauthentication frame to be sent to it.
4243 	 */
4244 	int (*sta_deauth)(void *priv, const u8 *own_addr, const u8 *addr,
4245 			  u16 reason, int link_id);
4246 
4247 	/**
4248 	 * sta_disassoc - Disassociate a station (AP only)
4249 	 * @priv: Private driver interface data
4250 	 * @own_addr: Source address and BSSID for the Disassociation frame
4251 	 * @addr: MAC address of the station to disassociate
4252 	 * @reason: Reason code for the Disassociation frame
4253 	 * @link_id: Link ID to use for Disassociation frame, or -1 if not set
4254 	 * Returns: 0 on success, -1 on failure
4255 	 *
4256 	 * This function requests a specific station to be disassociated and
4257 	 * a Disassociation frame to be sent to it.
4258 	 */
4259 	int (*sta_disassoc)(void *priv, const u8 *own_addr, const u8 *addr,
4260 			    u16 reason, int link_id);
4261 
4262 	/**
4263 	 * sta_remove - Remove a station entry (AP only)
4264 	 * @priv: Private driver interface data
4265 	 * @addr: MAC address of the station to be removed
4266 	 * Returns: 0 on success, -1 on failure
4267 	 */
4268 	int (*sta_remove)(void *priv, const u8 *addr);
4269 
4270 	/**
4271 	 * hapd_get_ssid - Get the current SSID (AP only)
4272 	 * @priv: Private driver interface data
4273 	 * @buf: Buffer for returning the SSID
4274 	 * @len: Maximum length of the buffer
4275 	 * Returns: Length of the SSID on success, -1 on failure
4276 	 *
4277 	 * This function need not be implemented if the driver uses Beacon
4278 	 * template from set_ap() and does not reply to Probe Request frames.
4279 	 */
4280 	int (*hapd_get_ssid)(void *priv, u8 *buf, int len);
4281 
4282 	/**
4283 	 * hapd_set_ssid - Set SSID (AP only)
4284 	 * @priv: Private driver interface data
4285 	 * @buf: SSID
4286 	 * @len: Length of the SSID in octets
4287 	 * Returns: 0 on success, -1 on failure
4288 	 *
4289 	 * DEPRECATED - use set_ap() instead
4290 	 */
4291 	int (*hapd_set_ssid)(void *priv, const u8 *buf, int len);
4292 
4293 	/**
4294 	 * hapd_set_countermeasures - Enable/disable TKIP countermeasures (AP)
4295 	 * @priv: Private driver interface data
4296 	 * @enabled: 1 = countermeasures enabled, 0 = disabled
4297 	 * Returns: 0 on success, -1 on failure
4298 	 *
4299 	 * This need not be implemented if the driver does not take care of
4300 	 * association processing.
4301 	 */
4302 	int (*hapd_set_countermeasures)(void *priv, int enabled);
4303 
4304 	/**
4305 	 * sta_add - Add a station entry
4306 	 * @priv: Private driver interface data
4307 	 * @params: Station parameters
4308 	 * Returns: 0 on success, -1 on failure
4309 	 *
4310 	 * This function is used to add or set (params->set 1) a station
4311 	 * entry in the driver. Adding STA entries is used only if the driver
4312 	 * does not take care of association processing.
4313 	 *
4314 	 * With drivers that don't support full AP client state, this function
4315 	 * is used to add a station entry to the driver once the station has
4316 	 * completed association.
4317 	 *
4318 	 * With TDLS, this function is used to add or set (params->set 1)
4319 	 * TDLS peer entries (even with drivers that do not support full AP
4320 	 * client state).
4321 	 */
4322 	int (*sta_add)(void *priv, struct hostapd_sta_add_params *params);
4323 
4324 	/**
4325 	 * get_inact_sec - Get station inactivity duration (AP only)
4326 	 * @priv: Private driver interface data
4327 	 * @addr: Station address
4328 	 * Returns: Number of seconds station has been inactive, -1 on failure
4329 	 */
4330 	int (*get_inact_sec)(void *priv, const u8 *addr);
4331 
4332 	/**
4333 	 * sta_clear_stats - Clear station statistics (AP only)
4334 	 * @priv: Private driver interface data
4335 	 * @addr: Station address
4336 	 * Returns: 0 on success, -1 on failure
4337 	 */
4338 	int (*sta_clear_stats)(void *priv, const u8 *addr);
4339 
4340 	/**
4341 	 * set_freq - Set channel/frequency (AP only)
4342 	 * @priv: Private driver interface data
4343 	 * @freq: Channel parameters
4344 	 * Returns: 0 on success, -1 on failure
4345 	 */
4346 	int (*set_freq)(void *priv, struct hostapd_freq_params *freq);
4347 
4348 	/**
4349 	 * set_rts - Set RTS threshold
4350 	 * @priv: Private driver interface data
4351 	 * @rts: RTS threshold in octets
4352 	 * Returns: 0 on success, -1 on failure
4353 	 */
4354 	int (*set_rts)(void *priv, int rts);
4355 
4356 	/**
4357 	 * set_frag - Set fragmentation threshold
4358 	 * @priv: Private driver interface data
4359 	 * @frag: Fragmentation threshold in octets
4360 	 * Returns: 0 on success, -1 on failure
4361 	 */
4362 	int (*set_frag)(void *priv, int frag);
4363 
4364 	/**
4365 	 * sta_set_flags - Set station flags (AP only)
4366 	 * @priv: Private driver interface data
4367 	 * @addr: Station address
4368 	 * @total_flags: Bitmap of all WPA_STA_* flags currently set
4369 	 * @flags_or: Bitmap of WPA_STA_* flags to add
4370 	 * @flags_and: Bitmap of WPA_STA_* flags to us as a mask
4371 	 * Returns: 0 on success, -1 on failure
4372 	 */
4373 	int (*sta_set_flags)(void *priv, const u8 *addr,
4374 			     unsigned int total_flags, unsigned int flags_or,
4375 			     unsigned int flags_and);
4376 
4377 	/**
4378 	 * sta_set_airtime_weight - Set station airtime weight (AP only)
4379 	 * @priv: Private driver interface data
4380 	 * @addr: Station address
4381 	 * @weight: New weight for station airtime assignment
4382 	 * Returns: 0 on success, -1 on failure
4383 	 */
4384 	int (*sta_set_airtime_weight)(void *priv, const u8 *addr,
4385 				      unsigned int weight);
4386 
4387 	/**
4388 	 * set_tx_queue_params - Set TX queue parameters
4389 	 * @priv: Private driver interface data
4390 	 * @queue: Queue number (0 = VO, 1 = VI, 2 = BE, 3 = BK)
4391 	 * @aifs: AIFS
4392 	 * @cw_min: cwMin
4393 	 * @cw_max: cwMax
4394 	 * @burst_time: Maximum length for bursting in 0.1 msec units
4395 	 * @link_id: Link ID to use, or -1 for non MLD.
4396 	 */
4397 	int (*set_tx_queue_params)(void *priv, int queue, int aifs, int cw_min,
4398 				   int cw_max, int burst_time, int link_id);
4399 
4400 	/**
4401 	 * if_add - Add a virtual interface
4402 	 * @priv: Private driver interface data
4403 	 * @type: Interface type
4404 	 * @ifname: Interface name for the new virtual interface
4405 	 * @addr: Local address to use for the interface or %NULL to use the
4406 	 *	parent interface address
4407 	 * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces
4408 	 * @drv_priv: Pointer for overwriting the driver context or %NULL if
4409 	 *	not allowed (applies only to %WPA_IF_AP_BSS type)
4410 	 * @force_ifname: Buffer for returning an interface name that the
4411 	 *	driver ended up using if it differs from the requested ifname
4412 	 * @if_addr: Buffer for returning the allocated interface address
4413 	 *	(this may differ from the requested addr if the driver cannot
4414 	 *	change interface address)
4415 	 * @bridge: Bridge interface to use or %NULL if no bridge configured
4416 	 * @use_existing: Whether to allow existing interface to be used
4417 	 * @setup_ap: Whether to setup AP for %WPA_IF_AP_BSS interfaces
4418 	 * Returns: 0 on success, -1 on failure
4419 	 */
4420 	int (*if_add)(void *priv, enum wpa_driver_if_type type,
4421 		      const char *ifname, const u8 *addr, void *bss_ctx,
4422 		      void **drv_priv, char *force_ifname, u8 *if_addr,
4423 		      const char *bridge, int use_existing, int setup_ap);
4424 
4425 	/**
4426 	 * if_remove - Remove a virtual interface
4427 	 * @priv: Private driver interface data
4428 	 * @type: Interface type
4429 	 * @ifname: Interface name of the virtual interface to be removed
4430 	 * Returns: 0 on success, -1 on failure
4431 	 */
4432 	int (*if_remove)(void *priv, enum wpa_driver_if_type type,
4433 			 const char *ifname);
4434 
4435 	/**
4436 	 * set_sta_vlan - Bind a station into a specific interface (AP only)
4437 	 * @priv: Private driver interface data
4438 	 * @ifname: Interface (main or virtual BSS or VLAN)
4439 	 * @addr: MAC address of the associated station
4440 	 * @vlan_id: VLAN ID
4441 	 * @link_id: The link ID or -1 for non-MLO
4442 	 * Returns: 0 on success, -1 on failure
4443 	 *
4444 	 * This function is used to bind a station to a specific virtual
4445 	 * interface. It is only used if when virtual interfaces are supported,
4446 	 * e.g., to assign stations to different VLAN interfaces based on
4447 	 * information from a RADIUS server. This allows separate broadcast
4448 	 * domains to be used with a single BSS.
4449 	 */
4450 	int (*set_sta_vlan)(void *priv, const u8 *addr, const char *ifname,
4451 			    int vlan_id, int link_id);
4452 
4453 	/**
4454 	 * set_radius_acl_auth - Notification of RADIUS ACL change
4455 	 * @priv: Private driver interface data
4456 	 * @mac: MAC address of the station
4457 	 * @accepted: Whether the station was accepted
4458 	 * @session_timeout: Session timeout for the station
4459 	 * Returns: 0 on success, -1 on failure
4460 	 */
4461 	int (*set_radius_acl_auth)(void *priv, const u8 *mac, int accepted,
4462 				   u32 session_timeout);
4463 
4464 	/**
4465 	 * set_radius_acl_expire - Notification of RADIUS ACL expiration
4466 	 * @priv: Private driver interface data
4467 	 * @mac: MAC address of the station
4468 	 * Returns: 0 on success, -1 on failure
4469 	 */
4470 	int (*set_radius_acl_expire)(void *priv, const u8 *mac);
4471 
4472 	/**
4473 	 * set_ap_wps_ie - Add WPS IE(s) into Beacon/Probe Response frames (AP)
4474 	 * @priv: Private driver interface data
4475 	 * @beacon: WPS IE(s) for Beacon frames or %NULL to remove extra IE(s)
4476 	 * @proberesp: WPS IE(s) for Probe Response frames or %NULL to remove
4477 	 *	extra IE(s)
4478 	 * @assocresp: WPS IE(s) for (Re)Association Response frames or %NULL
4479 	 *	to remove extra IE(s)
4480 	 * Returns: 0 on success, -1 on failure
4481 	 *
4482 	 * This is an optional function to add WPS IE in the kernel driver for
4483 	 * Beacon and Probe Response frames. This can be left undefined (set
4484 	 * to %NULL) if the driver uses the Beacon template from set_ap()
4485 	 * and does not process Probe Request frames. If the driver takes care
4486 	 * of (Re)Association frame processing, the assocresp buffer includes
4487 	 * WPS IE(s) that need to be added to (Re)Association Response frames
4488 	 * whenever a (Re)Association Request frame indicated use of WPS.
4489 	 *
4490 	 * This will also be used to add P2P IE(s) into Beacon/Probe Response
4491 	 * frames when operating as a GO. The driver is responsible for adding
4492 	 * timing related attributes (e.g., NoA) in addition to the IEs
4493 	 * included here by appending them after these buffers. This call is
4494 	 * also used to provide Probe Response IEs for P2P Listen state
4495 	 * operations for drivers that generate the Probe Response frames
4496 	 * internally.
4497 	 *
4498 	 * DEPRECATED - use set_ap() instead
4499 	 */
4500 	int (*set_ap_wps_ie)(void *priv, const struct wpabuf *beacon,
4501 			     const struct wpabuf *proberesp,
4502 			     const struct wpabuf *assocresp);
4503 
4504 	/**
4505 	 * set_supp_port - Set IEEE 802.1X Supplicant Port status
4506 	 * @priv: Private driver interface data
4507 	 * @authorized: Whether the port is authorized
4508 	 * Returns: 0 on success, -1 on failure
4509 	 */
4510 	int (*set_supp_port)(void *priv, int authorized);
4511 
4512 	/**
4513 	 * set_wds_sta - Bind a station into a 4-address WDS (AP only)
4514 	 * @priv: Private driver interface data
4515 	 * @addr: MAC address of the associated station
4516 	 * @aid: Association ID
4517 	 * @val: 1 = bind to 4-address WDS; 0 = unbind
4518 	 * @bridge_ifname: Bridge interface to use for the WDS station or %NULL
4519 	 *	to indicate that bridge is not to be used
4520 	 * @ifname_wds: Buffer to return the interface name for the new WDS
4521 	 *	station or %NULL to indicate name is not returned.
4522 	 * Returns: 0 on success, -1 on failure
4523 	 */
4524 	int (*set_wds_sta)(void *priv, const u8 *addr, int aid, int val,
4525 			   const char *bridge_ifname, char *ifname_wds);
4526 
4527 	/**
4528 	 * send_action - Transmit an Action frame
4529 	 * @priv: Private driver interface data
4530 	 * @freq: Frequency (in MHz) of the channel
4531 	 * @wait: Time to wait off-channel for a response (in ms), or zero
4532 	 * @dst: Destination MAC address (Address 1)
4533 	 * @src: Source MAC address (Address 2)
4534 	 * @bssid: BSSID (Address 3)
4535 	 * @data: Frame body
4536 	 * @data_len: data length in octets
4537 	 * @no_cck: Whether CCK rates must not be used to transmit this frame
4538 	 * @link_id: Link ID of the specified link; -1 for non-MLO cases and for
4539 	 *	frames that target the MLD instead of a specific link in MLO
4540 	 *	cases
4541 	 * Returns: 0 on success, -1 on failure
4542 	 *
4543 	 * This command can be used to request the driver to transmit an action
4544 	 * frame to the specified destination.
4545 	 *
4546 	 * If the %WPA_DRIVER_FLAGS_OFFCHANNEL_TX flag is set, the frame will
4547 	 * be transmitted on the given channel and the device will wait for a
4548 	 * response on that channel for the given wait time.
4549 	 *
4550 	 * If the flag is not set, the wait time will be ignored. In this case,
4551 	 * if a remain-on-channel duration is in progress, the frame must be
4552 	 * transmitted on that channel; alternatively the frame may be sent on
4553 	 * the current operational channel (if in associated state in station
4554 	 * mode or while operating as an AP.)
4555 	 *
4556 	 * If @src differs from the device MAC address, use of a random
4557 	 * transmitter address is requested for this message exchange.
4558 	 */
4559 	int (*send_action)(void *priv, unsigned int freq, unsigned int wait,
4560 			   const u8 *dst, const u8 *src, const u8 *bssid,
4561 			   const u8 *data, size_t data_len, int no_cck,
4562 			   int link_id);
4563 
4564 	/**
4565 	 * send_action_cancel_wait - Cancel action frame TX wait
4566 	 * @priv: Private driver interface data
4567 	 *
4568 	 * This command cancels the wait time associated with sending an action
4569 	 * frame. It is only available when %WPA_DRIVER_FLAGS_OFFCHANNEL_TX is
4570 	 * set in the driver flags.
4571 	 */
4572 	void (*send_action_cancel_wait)(void *priv);
4573 
4574 	/**
4575 	 * remain_on_channel - Remain awake on a channel
4576 	 * @priv: Private driver interface data
4577 	 * @freq: Frequency (in MHz) of the channel
4578 	 * @duration: Duration in milliseconds
4579 	 * @filter_addr: an additional MAC address to accept frames to (NULL for
4580 	 *	using only the interface address)
4581 	 * Returns: 0 on success, -1 on failure
4582 	 *
4583 	 * This command is used to request the driver to remain awake on the
4584 	 * specified channel for the specified duration and report received
4585 	 * Action frames with EVENT_RX_MGMT events. Optionally, received
4586 	 * Probe Request frames may also be requested to be reported by calling
4587 	 * probe_req_report(). These will be reported with EVENT_RX_PROBE_REQ.
4588 	 *
4589 	 * If filter_addr is provided, the driver will configure an additional
4590 	 * MAC address for frame filtering, i.e., this new address will be used
4591 	 * in addition to the interface address.
4592 	 *
4593 	 * The driver may not be at the requested channel when this function
4594 	 * returns, i.e., the return code is only indicating whether the
4595 	 * request was accepted. The caller will need to wait until the
4596 	 * EVENT_REMAIN_ON_CHANNEL event indicates that the driver has
4597 	 * completed the channel change. This may take some time due to other
4598 	 * need for the radio and the caller should be prepared to timing out
4599 	 * its wait since there are no guarantees on when this request can be
4600 	 * executed.
4601 	 */
4602 	int (*remain_on_channel)(void *priv, unsigned int freq,
4603 				 unsigned int duration, const u8 *filter_addr);
4604 
4605 	/**
4606 	 * cancel_remain_on_channel - Cancel remain-on-channel operation
4607 	 * @priv: Private driver interface data
4608 	 *
4609 	 * This command can be used to cancel a remain-on-channel operation
4610 	 * before its originally requested duration has passed. This could be
4611 	 * used, e.g., when remain_on_channel() is used to request extra time
4612 	 * to receive a response to an Action frame and the response is
4613 	 * received when there is still unneeded time remaining on the
4614 	 * remain-on-channel operation.
4615 	 */
4616 	int (*cancel_remain_on_channel)(void *priv);
4617 
4618 	/**
4619 	 * probe_req_report - Request Probe Request frames to be indicated
4620 	 * @priv: Private driver interface data
4621 	 * @report: Whether to report received Probe Request frames
4622 	 * Returns: 0 on success, -1 on failure (or if not supported)
4623 	 *
4624 	 * This command can be used to request the driver to indicate when
4625 	 * Probe Request frames are received with EVENT_RX_PROBE_REQ events.
4626 	 * Since this operation may require extra resources, e.g., due to less
4627 	 * optimal hardware/firmware RX filtering, many drivers may disable
4628 	 * Probe Request reporting at least in station mode. This command is
4629 	 * used to notify the driver when the Probe Request frames need to be
4630 	 * reported, e.g., during remain-on-channel operations.
4631 	 */
4632 	int (*probe_req_report)(void *priv, int report);
4633 
4634 	/**
4635 	 * deinit_ap - Deinitialize AP mode
4636 	 * @priv: Private driver interface data
4637 	 * Returns: 0 on success, -1 on failure (or if not supported)
4638 	 *
4639 	 * This optional function can be used to disable AP mode related
4640 	 * configuration. If the interface was not dynamically added,
4641 	 * change the driver mode to station mode to allow normal station
4642 	 * operations like scanning to be completed.
4643 	 */
4644 	int (*deinit_ap)(void *priv);
4645 
4646 	/**
4647 	 * deinit_p2p_cli - Deinitialize P2P client mode
4648 	 * @priv: Private driver interface data
4649 	 * Returns: 0 on success, -1 on failure (or if not supported)
4650 	 *
4651 	 * This optional function can be used to disable P2P client mode. If the
4652 	 * interface was not dynamically added, change the interface type back
4653 	 * to station mode.
4654 	 */
4655 	int (*deinit_p2p_cli)(void *priv);
4656 
4657 	/**
4658 	 * suspend - Notification on system suspend/hibernate event
4659 	 * @priv: Private driver interface data
4660 	 */
4661 	void (*suspend)(void *priv);
4662 
4663 	/**
4664 	 * resume - Notification on system resume/thaw event
4665 	 * @priv: Private driver interface data
4666 	 */
4667 	void (*resume)(void *priv);
4668 
4669 	/**
4670 	 * signal_monitor - Set signal monitoring parameters
4671 	 * @priv: Private driver interface data
4672 	 * @threshold: Threshold value for signal change events; 0 = disabled
4673 	 * @hysteresis: Minimum change in signal strength before indicating a
4674 	 *	new event
4675 	 * Returns: 0 on success, -1 on failure (or if not supported)
4676 	 *
4677 	 * This function can be used to configure monitoring of signal strength
4678 	 * with the current AP. Whenever signal strength drops below the
4679 	 * %threshold value or increases above it, EVENT_SIGNAL_CHANGE event
4680 	 * should be generated assuming the signal strength has changed at
4681 	 * least %hysteresis from the previously indicated signal change event.
4682 	 */
4683 	int (*signal_monitor)(void *priv, int threshold, int hysteresis);
4684 
4685 	/**
4686 	 * get_noa - Get current Notice of Absence attribute payload
4687 	 * @priv: Private driver interface data
4688 	 * @buf: Buffer for returning NoA
4689 	 * @buf_len: Buffer length in octets
4690 	 * Returns: Number of octets used in buf, 0 to indicate no NoA is being
4691 	 * advertized, or -1 on failure
4692 	 *
4693 	 * This function is used to fetch the current Notice of Absence
4694 	 * attribute value from GO.
4695 	 */
4696 	int (*get_noa)(void *priv, u8 *buf, size_t buf_len);
4697 
4698 	/**
4699 	 * set_noa - Set Notice of Absence parameters for GO (testing)
4700 	 * @priv: Private driver interface data
4701 	 * @count: Count
4702 	 * @start: Start time in ms from next TBTT
4703 	 * @duration: Duration in ms
4704 	 * Returns: 0 on success or -1 on failure
4705 	 *
4706 	 * This function is used to set Notice of Absence parameters for GO. It
4707 	 * is used only for testing. To disable NoA, all parameters are set to
4708 	 * 0.
4709 	 */
4710 	int (*set_noa)(void *priv, u8 count, int start, int duration);
4711 
4712 	/**
4713 	 * set_p2p_powersave - Set P2P power save options
4714 	 * @priv: Private driver interface data
4715 	 * @legacy_ps: 0 = disable, 1 = enable, 2 = maximum PS, -1 = no change
4716 	 * @opp_ps: 0 = disable, 1 = enable, -1 = no change
4717 	 * @ctwindow: 0.. = change (msec), -1 = no change
4718 	 * Returns: 0 on success or -1 on failure
4719 	 */
4720 	int (*set_p2p_powersave)(void *priv, int legacy_ps, int opp_ps,
4721 				 int ctwindow);
4722 
4723 	/**
4724 	 * ampdu - Enable/disable aggregation
4725 	 * @priv: Private driver interface data
4726 	 * @ampdu: 1/0 = enable/disable A-MPDU aggregation
4727 	 * Returns: 0 on success or -1 on failure
4728 	 */
4729 	int (*ampdu)(void *priv, int ampdu);
4730 
4731 	/**
4732 	 * get_radio_name - Get physical radio name for the device
4733 	 * @priv: Private driver interface data
4734 	 * Returns: Radio name or %NULL if not known
4735 	 *
4736 	 * The returned data must not be modified by the caller. It is assumed
4737 	 * that any interface that has the same radio name as another is
4738 	 * sharing the same physical radio. This information can be used to
4739 	 * share scan results etc. information between the virtual interfaces
4740 	 * to speed up various operations.
4741 	 */
4742 	const char * (*get_radio_name)(void *priv);
4743 
4744 	/**
4745 	 * send_tdls_mgmt - for sending TDLS management packets
4746 	 * @priv: private driver interface data
4747 	 * @dst: Destination (peer) MAC address
4748 	 * @action_code: TDLS action code for the mssage
4749 	 * @dialog_token: Dialog Token to use in the message (if needed)
4750 	 * @status_code: Status Code or Reason Code to use (if needed)
4751 	 * @peer_capab: TDLS peer capability (TDLS_PEER_* bitfield)
4752 	 * @initiator: Is the current end the TDLS link initiator
4753 	 * @buf: TDLS IEs to add to the message
4754 	 * @len: Length of buf in octets
4755 	 * @link_id: If >= 0 indicates the link of the AP MLD to specify the
4756 	 * operating channel on which to send a TDLS Discovery Response frame.
4757 	 * Returns: 0 on success, negative (<0) on failure
4758 	 *
4759 	 * This optional function can be used to send packet to driver which is
4760 	 * responsible for receiving and sending all TDLS packets.
4761 	 */
4762 	int (*send_tdls_mgmt)(void *priv, const u8 *dst, u8 action_code,
4763 			      u8 dialog_token, u16 status_code, u32 peer_capab,
4764 			      int initiator, const u8 *buf, size_t len,
4765 			      int link_id);
4766 
4767 	/**
4768 	 * tdls_oper - Ask the driver to perform high-level TDLS operations
4769 	 * @priv: Private driver interface data
4770 	 * @oper: TDLS high-level operation. See %enum tdls_oper
4771 	 * @peer: Destination (peer) MAC address
4772 	 * Returns: 0 on success, negative (<0) on failure
4773 	 *
4774 	 * This optional function can be used to send high-level TDLS commands
4775 	 * to the driver.
4776 	 */
4777 	int (*tdls_oper)(void *priv, enum tdls_oper oper, const u8 *peer);
4778 
4779 	/**
4780 	 * wnm_oper - Notify driver of the WNM frame reception
4781 	 * @priv: Private driver interface data
4782 	 * @oper: WNM operation. See %enum wnm_oper
4783 	 * @peer: Destination (peer) MAC address
4784 	 * @buf: Buffer for the driver to fill in (for getting IE)
4785 	 * @buf_len: Return the len of buf
4786 	 * Returns: 0 on success, negative (<0) on failure
4787 	 */
4788 	int (*wnm_oper)(void *priv, enum wnm_oper oper, const u8 *peer,
4789 			u8 *buf, u16 *buf_len);
4790 
4791 	/**
4792 	 * set_qos_map - Set QoS Map
4793 	 * @priv: Private driver interface data
4794 	 * @qos_map_set: QoS Map
4795 	 * @qos_map_set_len: Length of QoS Map
4796 	 */
4797 	int (*set_qos_map)(void *priv, const u8 *qos_map_set,
4798 			   u8 qos_map_set_len);
4799 
4800 	/**
4801 	 * br_add_ip_neigh - Add a neigh to the bridge ip neigh table
4802 	 * @priv: Private driver interface data
4803 	 * @version: IP version of the IP address, 4 or 6
4804 	 * @ipaddr: IP address for the neigh entry
4805 	 * @prefixlen: IP address prefix length
4806 	 * @addr: Corresponding MAC address
4807 	 * Returns: 0 on success, negative (<0) on failure
4808 	 */
4809 	int (*br_add_ip_neigh)(void *priv, u8 version, const u8 *ipaddr,
4810 			       int prefixlen, const u8 *addr);
4811 
4812 	/**
4813 	 * br_delete_ip_neigh - Remove a neigh from the bridge ip neigh table
4814 	 * @priv: Private driver interface data
4815 	 * @version: IP version of the IP address, 4 or 6
4816 	 * @ipaddr: IP address for the neigh entry
4817 	 * Returns: 0 on success, negative (<0) on failure
4818 	 */
4819 	int (*br_delete_ip_neigh)(void *priv, u8 version, const u8 *ipaddr);
4820 
4821 	/**
4822 	 * br_port_set_attr - Set a bridge port attribute
4823 	 * @attr: Bridge port attribute to set
4824 	 * @val: Value to be set
4825 	 * Returns: 0 on success, negative (<0) on failure
4826 	 */
4827 	int (*br_port_set_attr)(void *priv, enum drv_br_port_attr attr,
4828 				unsigned int val);
4829 
4830 	/**
4831 	 * br_port_set_attr - Set a bridge network parameter
4832 	 * @param: Bridge parameter to set
4833 	 * @val: Value to be set
4834 	 * Returns: 0 on success, negative (<0) on failure
4835 	 */
4836 	int (*br_set_net_param)(void *priv, enum drv_br_net_param param,
4837 				unsigned int val);
4838 
4839 	/**
4840 	 * get_wowlan - Get wake-on-wireless status
4841 	 * @priv: Private driver interface data
4842 	 */
4843 	int (*get_wowlan)(void *priv);
4844 
4845 	/**
4846 	 * set_wowlan - Set wake-on-wireless triggers
4847 	 * @priv: Private driver interface data
4848 	 * @triggers: wowlan triggers
4849 	 */
4850 	int (*set_wowlan)(void *priv, const struct wowlan_triggers *triggers);
4851 
4852 	/**
4853 	 * signal_poll - Get current connection information
4854 	 * @priv: Private driver interface data
4855 	 * @signal_info: Connection info structure
4856 	 */
4857 	int (*signal_poll)(void *priv, struct wpa_signal_info *signal_info);
4858 
4859 	/**
4860 	 * mlo_signal_poll - Get current MLO connection information
4861 	 * @priv: Private driver interface data
4862 	 * @mlo_signal_info: MLO connection info structure
4863 	 */
4864 	int (*mlo_signal_poll)(void *priv,
4865 			       struct wpa_mlo_signal_info *mlo_signal_info);
4866 
4867 	/**
4868 	 * setup_link_reconfig - Used to initiate Link Reconfiguration request
4869 	 * for the current MLO association.
4870 	 * @priv: Private driver interface data
4871 	 * @info: Link reconfiguration request info
4872 	 */
4873 	int (*setup_link_reconfig)(void *priv,
4874 				   struct wpa_mlo_reconfig_info *info);
4875 
4876 	/**
4877 	 * channel_info - Get parameters of the current operating channel
4878 	 * @priv: Private driver interface data
4879 	 * @channel_info: Channel info structure
4880 	 * Returns: 0 on success, negative (<0) on failure
4881 	 */
4882 	int (*channel_info)(void *priv, struct wpa_channel_info *channel_info);
4883 
4884 #ifdef ANDROID
4885 	/**
4886 	 * driver_cmd - Execute driver-specific command
4887 	 * @priv: Private driver interface data
4888 	 * @cmd: Command to execute
4889 	 * @buf: Return buffer
4890 	 * @buf_len: Buffer length
4891 	 * Returns: 0 on success, -1 on failure
4892 	 */
4893 	int (*driver_cmd)(void *priv, char *cmd, char *buf, size_t buf_len);
4894 #endif /* ANDROID */
4895 
4896 	/**
4897 	 * vendor_cmd - Execute vendor specific command
4898 	 * @priv: Private driver interface data
4899 	 * @vendor_id: Vendor id
4900 	 * @subcmd: Vendor command id
4901 	 * @nested_attr_flag: Specifies if vendor subcommand uses nested
4902 	 *	attributes or not
4903 	 * @data: Vendor command parameters (%NULL if no parameters)
4904 	 * @data_len: Data length
4905 	 * @buf: Return buffer (%NULL to ignore reply)
4906 	 * Returns: 0 on success, negative (<0) on failure
4907 	 *
4908 	 * This function handles vendor specific commands that are passed to
4909 	 * the driver/device. The command is identified by vendor id and
4910 	 * command id. The nested_attr_flag specifies whether the subcommand
4911 	 * uses nested attributes or not. Parameters can be passed
4912 	 * as argument to the command in the data buffer. Reply (if any) will be
4913 	 * filled in the supplied return buffer.
4914 	 *
4915 	 * The exact driver behavior is driver interface and vendor specific. As
4916 	 * an example, this will be converted to a vendor specific cfg80211
4917 	 * command in case of the nl80211 driver interface.
4918 	 */
4919 	int (*vendor_cmd)(void *priv, unsigned int vendor_id,
4920 			  unsigned int subcmd, const u8 *data, size_t data_len,
4921 			  enum nested_attr nested_attr_flag,
4922 			  struct wpabuf *buf);
4923 
4924 	/**
4925 	 * set_rekey_info - Set rekey information
4926 	 * @priv: Private driver interface data
4927 	 * @kek: Current KEK
4928 	 * @kek_len: KEK length in octets
4929 	 * @kck: Current KCK
4930 	 * @kck_len: KCK length in octets
4931 	 * @replay_ctr: Current EAPOL-Key Replay Counter
4932 	 *
4933 	 * This optional function can be used to provide information for the
4934 	 * driver/firmware to process EAPOL-Key frames in Group Key Handshake
4935 	 * while the host (including wpa_supplicant) is sleeping.
4936 	 */
4937 	void (*set_rekey_info)(void *priv, const u8 *kek, size_t kek_len,
4938 			       const u8 *kck, size_t kck_len,
4939 			       const u8 *replay_ctr);
4940 
4941 	/**
4942 	 * sta_assoc - Station association indication
4943 	 * @priv: Private driver interface data
4944 	 * @own_addr: Source address and BSSID for association frame
4945 	 * @addr: MAC address of the station to associate
4946 	 * @reassoc: flag to indicate re-association
4947 	 * @status: association response status code
4948 	 * @ie: assoc response ie buffer
4949 	 * @len: ie buffer length
4950 	 * Returns: 0 on success, -1 on failure
4951 	 *
4952 	 * This function indicates the driver to send (Re)Association
4953 	 * Response frame to the station.
4954 	 */
4955 	 int (*sta_assoc)(void *priv, const u8 *own_addr, const u8 *addr,
4956 			  int reassoc, u16 status, const u8 *ie, size_t len);
4957 
4958 	/**
4959 	 * sta_auth - Station authentication indication
4960 	 * @priv: private driver interface data
4961 	 * @params: Station authentication parameters
4962 	 *
4963 	 * Returns: 0 on success, -1 on failure
4964 	 */
4965 	 int (*sta_auth)(void *priv,
4966 			 struct wpa_driver_sta_auth_params *params);
4967 
4968 	/**
4969 	 * add_sta_node - Add a station node in the driver
4970 	 * @priv: Private driver interface data
4971 	 * @addr: MAC address of the station to add
4972 	 * @auth_alg: authentication algorithm used by the station
4973 	 * Returns: 0 on success, -1 on failure
4974 	 *
4975 	 * This function adds the station node in the driver, when
4976 	 * the station gets added by FT-over-DS.
4977 	 */
4978 	int (*add_sta_node)(void *priv, const u8 *addr, u16 auth_alg);
4979 
4980 	/**
4981 	 * sched_scan - Request the driver to initiate scheduled scan
4982 	 * @priv: Private driver interface data
4983 	 * @params: Scan parameters
4984 	 * Returns: 0 on success, -1 on failure
4985 	 *
4986 	 * This operation should be used for scheduled scan offload to
4987 	 * the hardware. Every time scan results are available, the
4988 	 * driver should report scan results event for wpa_supplicant
4989 	 * which will eventually request the results with
4990 	 * wpa_driver_get_scan_results2(). This operation is optional
4991 	 * and if not provided or if it returns -1, we fall back to
4992 	 * normal host-scheduled scans.
4993 	 */
4994 	int (*sched_scan)(void *priv, struct wpa_driver_scan_params *params);
4995 
4996 	/**
4997 	 * stop_sched_scan - Request the driver to stop a scheduled scan
4998 	 * @priv: Private driver interface data
4999 	 * Returns: 0 on success, -1 on failure
5000 	 *
5001 	 * This should cause the scheduled scan to be stopped and
5002 	 * results should stop being sent. Must be supported if
5003 	 * sched_scan is supported.
5004 	 */
5005 	int (*stop_sched_scan)(void *priv);
5006 
5007 	/**
5008 	 * poll_client - Probe (null data or such) the given station
5009 	 * @priv: Private driver interface data
5010 	 * @own_addr: MAC address of sending interface
5011 	 * @addr: MAC address of the station to probe
5012 	 * @qos: Indicates whether station is QoS station
5013 	 *
5014 	 * This function is used to verify whether an associated station is
5015 	 * still present. This function does not need to be implemented if the
5016 	 * driver provides such inactivity polling mechanism.
5017 	 */
5018 	void (*poll_client)(void *priv, const u8 *own_addr,
5019 			    const u8 *addr, int qos);
5020 
5021 	/**
5022 	 * radio_disable - Disable/enable radio
5023 	 * @priv: Private driver interface data
5024 	 * @disabled: 1=disable 0=enable radio
5025 	 * Returns: 0 on success, -1 on failure
5026 	 *
5027 	 * This optional command is for testing purposes. It can be used to
5028 	 * disable the radio on a testbed device to simulate out-of-radio-range
5029 	 * conditions.
5030 	 */
5031 	int (*radio_disable)(void *priv, int disabled);
5032 
5033 	/**
5034 	 * switch_channel - Announce channel switch and migrate the GO to the
5035 	 * given frequency
5036 	 * @priv: Private driver interface data
5037 	 * @settings: Settings for CSA period and new channel
5038 	 * Returns: 0 on success, -1 on failure
5039 	 *
5040 	 * This function is used to move the GO to the legacy STA channel to
5041 	 * avoid frequency conflict in single channel concurrency.
5042 	 */
5043 	int (*switch_channel)(void *priv, struct csa_settings *settings);
5044 
5045 	/**
5046 	 * switch_color - Announce color switch and migrate the BSS to the
5047 	 * given color
5048 	 * @priv: Private driver interface data
5049 	 * @settings: Settings for CCA period and new color
5050 	 * Returns: 0 on success, -1 on failure
5051 	 *
5052 	 * This function is used to move the BSS to its new color.
5053 	 */
5054 	int (*switch_color)(void *priv, struct cca_settings *settings);
5055 
5056 	/**
5057 	 * add_tx_ts - Add traffic stream
5058 	 * @priv: Private driver interface data
5059 	 * @tsid: Traffic stream ID
5060 	 * @addr: Receiver address
5061 	 * @user_prio: User priority of the traffic stream
5062 	 * @admitted_time: Admitted time for this TS in units of
5063 	 *	32 microsecond periods (per second).
5064 	 * Returns: 0 on success, -1 on failure
5065 	 */
5066 	int (*add_tx_ts)(void *priv, u8 tsid, const u8 *addr, u8 user_prio,
5067 			 u16 admitted_time);
5068 
5069 	/**
5070 	 * del_tx_ts - Delete traffic stream
5071 	 * @priv: Private driver interface data
5072 	 * @tsid: Traffic stream ID
5073 	 * @addr: Receiver address
5074 	 * Returns: 0 on success, -1 on failure
5075 	 */
5076 	int (*del_tx_ts)(void *priv, u8 tsid, const u8 *addr);
5077 
5078 	/**
5079 	 * Enable channel-switching with TDLS peer
5080 	 * @priv: Private driver interface data
5081 	 * @addr: MAC address of the TDLS peer
5082 	 * @oper_class: Operating class of the switch channel
5083 	 * @params: Channel specification
5084 	 * Returns: 0 on success, -1 on failure
5085 	 *
5086 	 * The function indicates to driver that it can start switching to a
5087 	 * different channel with a specified TDLS peer. The switching is
5088 	 * assumed on until canceled with tdls_disable_channel_switch().
5089 	 */
5090 	int (*tdls_enable_channel_switch)(
5091 		void *priv, const u8 *addr, u8 oper_class,
5092 		const struct hostapd_freq_params *params);
5093 
5094 	/**
5095 	 * Disable channel switching with TDLS peer
5096 	 * @priv: Private driver interface data
5097 	 * @addr: MAC address of the TDLS peer
5098 	 * Returns: 0 on success, -1 on failure
5099 	 *
5100 	 * This function indicates to the driver that it should stop switching
5101 	 * with a given TDLS peer.
5102 	 */
5103 	int (*tdls_disable_channel_switch)(void *priv, const u8 *addr);
5104 
5105 	/**
5106 	 * start_dfs_cac - Listen for radar interference on the channel
5107 	 * @priv: Private driver interface data
5108 	 * @freq: Channel parameters
5109 	 * Returns: 0 on success, -1 on failure
5110 	 */
5111 	int (*start_dfs_cac)(void *priv, struct hostapd_freq_params *freq);
5112 
5113 	/**
5114 	 * stop_ap - Removes beacon from AP
5115 	 * @priv: Private driver interface data
5116 	 * @link_id: Link ID of the specified link; -1 for non-MLD
5117 	 * Returns: 0 on success, -1 on failure (or if not supported)
5118 	 *
5119 	 * This optional function can be used to disable AP mode related
5120 	 * configuration. Unlike deinit_ap, it does not change to station
5121 	 * mode.
5122 	 */
5123 	int (*stop_ap)(void *priv, int link_id);
5124 
5125 	/**
5126 	 * get_survey - Retrieve survey data
5127 	 * @priv: Private driver interface data
5128 	 * @freq: If set, survey data for the specified frequency is only
5129 	 *	being requested. If not set, all survey data is requested.
5130 	 * Returns: 0 on success, -1 on failure
5131 	 *
5132 	 * Use this to retrieve:
5133 	 *
5134 	 * - the observed channel noise floor
5135 	 * - the amount of time we have spent on the channel
5136 	 * - the amount of time during which we have spent on the channel that
5137 	 *   the radio has determined the medium is busy and we cannot
5138 	 *   transmit
5139 	 * - the amount of time we have spent receiving data
5140 	 * - the amount of time we have spent transmitting data
5141 	 *
5142 	 * This data can be used for spectrum heuristics. One example is
5143 	 * Automatic Channel Selection (ACS). The channel survey data is
5144 	 * kept on a linked list on the channel data, one entry is added
5145 	 * for each survey. The min_nf of the channel is updated for each
5146 	 * survey.
5147 	 */
5148 	int (*get_survey)(void *priv, unsigned int freq);
5149 
5150 	/**
5151 	 * status - Get driver interface status information
5152 	 * @priv: Private driver interface data
5153 	 * @buf: Buffer for printing the status information
5154 	 * @buflen: Maximum length of the buffer
5155 	 * Returns: Length of written status information or -1 on failure
5156 	 */
5157 	int (*status)(void *priv, char *buf, size_t buflen);
5158 
5159 	/**
5160 	 * roaming - Set roaming policy for driver-based BSS selection
5161 	 * @priv: Private driver interface data
5162 	 * @allowed: Whether roaming within ESS is allowed
5163 	 * @bssid: Forced BSSID if roaming is disabled or %NULL if not set
5164 	 * Returns: Length of written status information or -1 on failure
5165 	 *
5166 	 * This optional callback can be used to update roaming policy from the
5167 	 * associate() command (bssid being set there indicates that the driver
5168 	 * should not roam before getting this roaming() call to allow roaming.
5169 	 * If the driver does not indicate WPA_DRIVER_FLAGS_BSS_SELECTION
5170 	 * capability, roaming policy is handled within wpa_supplicant and there
5171 	 * is no need to implement or react to this callback.
5172 	 */
5173 	int (*roaming)(void *priv, int allowed, const u8 *bssid);
5174 
5175 	/**
5176 	 * disable_fils - Enable/disable FILS feature
5177 	 * @priv: Private driver interface data
5178 	 * @disable: 0-enable and 1-disable FILS feature
5179 	 * Returns: 0 on success, -1 on failure
5180 	 *
5181 	 * This callback can be used to configure driver and below layers to
5182 	 * enable/disable all FILS features.
5183 	 */
5184 	int (*disable_fils)(void *priv, int disable);
5185 
5186 	/**
5187 	 * set_mac_addr - Set MAC address
5188 	 * @priv: Private driver interface data
5189 	 * @addr: MAC address to use or %NULL for setting back to permanent
5190 	 * Returns: 0 on success, -1 on failure
5191 	 */
5192 	int (*set_mac_addr)(void *priv, const u8 *addr);
5193 
5194 #ifdef CONFIG_MACSEC
5195 	int (*macsec_init)(void *priv, struct macsec_init_params *params);
5196 
5197 	int (*macsec_deinit)(void *priv);
5198 
5199 	/**
5200 	 * macsec_get_capability - Inform MKA of this driver's capability
5201 	 * @priv: Private driver interface data
5202 	 * @cap: Driver's capability
5203 	 * Returns: 0 on success, -1 on failure
5204 	 */
5205 	int (*macsec_get_capability)(void *priv, enum macsec_cap *cap);
5206 
5207 	/**
5208 	 * enable_protect_frames - Set protect frames status
5209 	 * @priv: Private driver interface data
5210 	 * @enabled: true = protect frames enabled
5211 	 *           false = protect frames disabled
5212 	 * Returns: 0 on success, -1 on failure (or if not supported)
5213 	 */
5214 	int (*enable_protect_frames)(void *priv, bool enabled);
5215 
5216 	/**
5217 	 * enable_encrypt - Set encryption status
5218 	 * @priv: Private driver interface data
5219 	 * @enabled: true = encrypt outgoing traffic
5220 	 *           false = integrity-only protection on outgoing traffic
5221 	 * Returns: 0 on success, -1 on failure (or if not supported)
5222 	 */
5223 	int (*enable_encrypt)(void *priv, bool enabled);
5224 
5225 	/**
5226 	 * set_replay_protect - Set replay protect status and window size
5227 	 * @priv: Private driver interface data
5228 	 * @enabled: true = replay protect enabled
5229 	 *           false = replay protect disabled
5230 	 * @window: replay window size, valid only when replay protect enabled
5231 	 * Returns: 0 on success, -1 on failure (or if not supported)
5232 	 */
5233 	int (*set_replay_protect)(void *priv, bool enabled, u32 window);
5234 
5235 	/**
5236 	 * set_offload - Set MACsec hardware offload
5237 	 * @priv: Private driver interface data
5238 	 * @offload: 0 = MACSEC_OFFLOAD_OFF
5239 	 *           1 = MACSEC_OFFLOAD_PHY
5240 	 *           2 = MACSEC_OFFLOAD_MAC
5241 	 * Returns: 0 on success, -1 on failure (or if not supported)
5242 	 */
5243 	int (*set_offload)(void *priv, u8 offload);
5244 
5245 	/**
5246 	 * set_current_cipher_suite - Set current cipher suite
5247 	 * @priv: Private driver interface data
5248 	 * @cs: EUI64 identifier
5249 	 * Returns: 0 on success, -1 on failure (or if not supported)
5250 	 */
5251 	int (*set_current_cipher_suite)(void *priv, u64 cs);
5252 
5253 	/**
5254 	 * enable_controlled_port - Set controlled port status
5255 	 * @priv: Private driver interface data
5256 	 * @enabled: true = controlled port enabled
5257 	 *           false = controlled port disabled
5258 	 * Returns: 0 on success, -1 on failure (or if not supported)
5259 	 */
5260 	int (*enable_controlled_port)(void *priv, bool enabled);
5261 
5262 	/**
5263 	 * get_receive_lowest_pn - Get receive lowest pn
5264 	 * @priv: Private driver interface data
5265 	 * @sa: secure association
5266 	 * Returns: 0 on success, -1 on failure (or if not supported)
5267 	 */
5268 	int (*get_receive_lowest_pn)(void *priv, struct receive_sa *sa);
5269 
5270 	/**
5271 	 * get_transmit_next_pn - Get transmit next pn
5272 	 * @priv: Private driver interface data
5273 	 * @sa: secure association
5274 	 * Returns: 0 on success, -1 on failure (or if not supported)
5275 	 */
5276 	int (*get_transmit_next_pn)(void *priv, struct transmit_sa *sa);
5277 
5278 	/**
5279 	 * set_transmit_next_pn - Set transmit next pn
5280 	 * @priv: Private driver interface data
5281 	 * @sa: secure association
5282 	 * Returns: 0 on success, -1 on failure (or if not supported)
5283 	 */
5284 	int (*set_transmit_next_pn)(void *priv, struct transmit_sa *sa);
5285 
5286 	/**
5287 	 * set_receive_lowest_pn - Set receive lowest PN
5288 	 * @priv: Private driver interface data
5289 	 * @sa: secure association
5290 	 * Returns: 0 on success, -1 on failure (or if not supported)
5291 	 */
5292 	int (*set_receive_lowest_pn)(void *priv, struct receive_sa *sa);
5293 
5294 	/**
5295 	 * create_receive_sc - create secure channel for receiving
5296 	 * @priv: Private driver interface data
5297 	 * @sc: secure channel
5298 	 * @conf_offset: confidentiality offset (0, 30, or 50)
5299 	 * @validation: frame validation policy (0 = Disabled, 1 = Checked,
5300 	 *	2 = Strict)
5301 	 * Returns: 0 on success, -1 on failure (or if not supported)
5302 	 */
5303 	int (*create_receive_sc)(void *priv, struct receive_sc *sc,
5304 				 unsigned int conf_offset,
5305 				 int validation);
5306 
5307 	/**
5308 	 * delete_receive_sc - delete secure connection for receiving
5309 	 * @priv: private driver interface data from init()
5310 	 * @sc: secure channel
5311 	 * Returns: 0 on success, -1 on failure
5312 	 */
5313 	int (*delete_receive_sc)(void *priv, struct receive_sc *sc);
5314 
5315 	/**
5316 	 * create_receive_sa - create secure association for receive
5317 	 * @priv: private driver interface data from init()
5318 	 * @sa: secure association
5319 	 * Returns: 0 on success, -1 on failure
5320 	 */
5321 	int (*create_receive_sa)(void *priv, struct receive_sa *sa);
5322 
5323 	/**
5324 	 * delete_receive_sa - Delete secure association for receive
5325 	 * @priv: Private driver interface data from init()
5326 	 * @sa: Secure association
5327 	 * Returns: 0 on success, -1 on failure
5328 	 */
5329 	int (*delete_receive_sa)(void *priv, struct receive_sa *sa);
5330 
5331 	/**
5332 	 * enable_receive_sa - enable the SA for receive
5333 	 * @priv: private driver interface data from init()
5334 	 * @sa: secure association
5335 	 * Returns: 0 on success, -1 on failure
5336 	 */
5337 	int (*enable_receive_sa)(void *priv, struct receive_sa *sa);
5338 
5339 	/**
5340 	 * disable_receive_sa - disable SA for receive
5341 	 * @priv: private driver interface data from init()
5342 	 * @sa: secure association
5343 	 * Returns: 0 on success, -1 on failure
5344 	 */
5345 	int (*disable_receive_sa)(void *priv, struct receive_sa *sa);
5346 
5347 	/**
5348 	 * create_transmit_sc - create secure connection for transmit
5349 	 * @priv: private driver interface data from init()
5350 	 * @sc: secure channel
5351 	 * @conf_offset: confidentiality offset (0, 30, or 50)
5352 	 * Returns: 0 on success, -1 on failure
5353 	 */
5354 	int (*create_transmit_sc)(void *priv, struct transmit_sc *sc,
5355 				  unsigned int conf_offset);
5356 
5357 	/**
5358 	 * delete_transmit_sc - delete secure connection for transmit
5359 	 * @priv: private driver interface data from init()
5360 	 * @sc: secure channel
5361 	 * Returns: 0 on success, -1 on failure
5362 	 */
5363 	int (*delete_transmit_sc)(void *priv, struct transmit_sc *sc);
5364 
5365 	/**
5366 	 * create_transmit_sa - create secure association for transmit
5367 	 * @priv: private driver interface data from init()
5368 	 * @sa: secure association
5369 	 * Returns: 0 on success, -1 on failure
5370 	 */
5371 	int (*create_transmit_sa)(void *priv, struct transmit_sa *sa);
5372 
5373 	/**
5374 	 * delete_transmit_sa - Delete secure association for transmit
5375 	 * @priv: Private driver interface data from init()
5376 	 * @sa: Secure association
5377 	 * Returns: 0 on success, -1 on failure
5378 	 */
5379 	int (*delete_transmit_sa)(void *priv, struct transmit_sa *sa);
5380 
5381 	/**
5382 	 * enable_transmit_sa - enable SA for transmit
5383 	 * @priv: private driver interface data from init()
5384 	 * @sa: secure association
5385 	 * Returns: 0 on success, -1 on failure
5386 	 */
5387 	int (*enable_transmit_sa)(void *priv, struct transmit_sa *sa);
5388 
5389 	/**
5390 	 * disable_transmit_sa - disable SA for transmit
5391 	 * @priv: private driver interface data from init()
5392 	 * @sa: secure association
5393 	 * Returns: 0 on success, -1 on failure
5394 	 */
5395 	int (*disable_transmit_sa)(void *priv, struct transmit_sa *sa);
5396 #endif /* CONFIG_MACSEC */
5397 
5398 	/**
5399 	 * init_mesh - Driver specific initialization for mesh
5400 	 * @priv: Private driver interface data
5401 	 * Returns: 0 on success, -1 on failure
5402 	 */
5403 	int (*init_mesh)(void *priv);
5404 
5405 	/**
5406 	 * join_mesh - Join a mesh network
5407 	 * @priv: Private driver interface data
5408 	 * @params: Mesh configuration parameters
5409 	 * Returns: 0 on success, -1 on failure
5410 	 */
5411 	int (*join_mesh)(void *priv,
5412 			 struct wpa_driver_mesh_join_params *params);
5413 
5414 	/**
5415 	 * leave_mesh - Leave a mesh network
5416 	 * @priv: Private driver interface data
5417 	 * Returns 0 on success, -1 on failure
5418 	 */
5419 	int (*leave_mesh)(void *priv);
5420 
5421 	/**
5422 	 * probe_mesh_link - Inject a frame over direct mesh link to a given
5423 	 *	peer skipping the next_hop lookup from mpath table.
5424 	 * @priv: Private driver interface data
5425 	 * @addr: Peer MAC address
5426 	 * @eth: Ethernet frame to be sent
5427 	 * @len: Ethernet frame lengtn in bytes
5428 	 * Returns 0 on success, -1 on failure
5429 	 */
5430 	int (*probe_mesh_link)(void *priv, const u8 *addr, const u8 *eth,
5431 			       size_t len);
5432 
5433 	/**
5434 	 * do_acs - Automatically select channel
5435 	 * @priv: Private driver interface data
5436 	 * @params: Parameters for ACS
5437 	 * Returns 0 on success, -1 on failure
5438 	 *
5439 	 * This command can be used to offload ACS to the driver if the driver
5440 	 * indicates support for such offloading (WPA_DRIVER_FLAGS_ACS_OFFLOAD).
5441 	 */
5442 	int (*do_acs)(void *priv, struct drv_acs_params *params);
5443 
5444 	/**
5445 	 * set_band - Notify driver of band(s) selection
5446 	 * @priv: Private driver interface data
5447 	 * @band_mask: The selected band(s) bit mask (from enum set_band)
5448 	 * Returns 0 on success, -1 on failure
5449 	 */
5450 	int (*set_band)(void *priv, u32 band_mask);
5451 
5452 	/**
5453 	 * get_pref_freq_list - Get preferred frequency list for an interface
5454 	 * @priv: Private driver interface data
5455 	 * @if_type: Interface type
5456 	 * @num: Number of channels
5457 	 * @freq_list: Weighted preferred channel list
5458 	 * Returns 0 on success, -1 on failure
5459 	 *
5460 	 * This command can be used to query the preferred frequency list from
5461 	 * the driver specific to a particular interface type. The freq_list
5462 	 * array needs to have room for *num entries. *num will be updated to
5463 	 * indicate the number of entries fetched from the driver.
5464 	 */
5465 	int (*get_pref_freq_list)(void *priv, enum wpa_driver_if_type if_type,
5466 				  unsigned int *num,
5467 				  struct weighted_pcl *freq_list);
5468 
5469 	/**
5470 	 * set_prob_oper_freq - Indicate probable P2P operating channel
5471 	 * @priv: Private driver interface data
5472 	 * @freq: Channel frequency in MHz
5473 	 * Returns 0 on success, -1 on failure
5474 	 *
5475 	 * This command can be used to inform the driver of the operating
5476 	 * frequency that an ongoing P2P group formation is likely to come up
5477 	 * on. Local device is assuming P2P Client role.
5478 	 */
5479 	int (*set_prob_oper_freq)(void *priv, unsigned int freq);
5480 
5481 	/**
5482 	 * abort_scan - Request the driver to abort an ongoing scan
5483 	 * @priv: Private driver interface data
5484 	 * @scan_cookie: Cookie identifying the scan request. This is used only
5485 	 *	when the vendor interface QCA_NL80211_VENDOR_SUBCMD_TRIGGER_SCAN
5486 	 *	was used to trigger scan. Otherwise, 0 is used.
5487 	 * Returns 0 on success, -1 on failure
5488 	 */
5489 	int (*abort_scan)(void *priv, u64 scan_cookie);
5490 
5491 	/**
5492 	 * configure_data_frame_filters - Request to configure frame filters
5493 	 * @priv: Private driver interface data
5494 	 * @filter_flags: The type of frames to filter (bitfield of
5495 	 * WPA_DATA_FRAME_FILTER_FLAG_*)
5496 	 * Returns: 0 on success or -1 on failure
5497 	 */
5498 	int (*configure_data_frame_filters)(void *priv, u32 filter_flags);
5499 
5500 	/**
5501 	 * get_ext_capab - Get extended capabilities for the specified interface
5502 	 * @priv: Private driver interface data
5503 	 * @type: Interface type for which to get extended capabilities
5504 	 * @ext_capab: Extended capabilities fetched
5505 	 * @ext_capab_mask: Extended capabilities mask
5506 	 * @ext_capab_len: Length of the extended capabilities
5507 	 * Returns: 0 on success or -1 on failure
5508 	 */
5509 	int (*get_ext_capab)(void *priv, enum wpa_driver_if_type type,
5510 			     const u8 **ext_capab, const u8 **ext_capab_mask,
5511 			     unsigned int *ext_capab_len);
5512 
5513 	/**
5514 	 * get_mld_capab - Get MLD capabilities for the specified interface
5515 	 * @priv: Private driver interface data
5516 	 * @type: Interface type for which to get MLD capabilities
5517 	 * @eml_capa: EML capabilities
5518 	 * @mld_capa_and_ops: MLD Capabilities and Operations
5519 	 * Returns: 0 on success or -1 on failure
5520 	 */
5521 	int (*get_mld_capab)(void *priv, enum wpa_driver_if_type type,
5522 			     u16 *eml_capa, u16 *mld_capa_and_ops);
5523 
5524 	/**
5525 	 * p2p_lo_start - Start offloading P2P listen to device
5526 	 * @priv: Private driver interface data
5527 	 * @freq: Listening frequency (MHz) for P2P listen
5528 	 * @period: Length of the listen operation in milliseconds
5529 	 * @interval: Interval for running the listen operation in milliseconds
5530 	 * @count: Number of times to run the listen operation
5531 	 * @device_types: Device primary and secondary types
5532 	 * @dev_types_len: Number of bytes for device_types
5533 	 * @ies: P2P IE and WSC IE for Probe Response frames
5534 	 * @ies_len: Length of ies in bytes
5535 	 * Returns: 0 on success or -1 on failure
5536 	 */
5537 	int (*p2p_lo_start)(void *priv, unsigned int freq,
5538 			    unsigned int period, unsigned int interval,
5539 			    unsigned int count,
5540 			    const u8 *device_types, size_t dev_types_len,
5541 			    const u8 *ies, size_t ies_len);
5542 
5543 	/**
5544 	 * p2p_lo_stop - Stop P2P listen offload
5545 	 * @priv: Private driver interface data
5546 	 * Returns: 0 on success or -1 on failure
5547 	 */
5548 	int (*p2p_lo_stop)(void *priv);
5549 
5550 	/**
5551 	 * set_default_scan_ies - Set default scan IEs
5552 	 * @priv: Private driver interface data
5553 	 * @ies: Scan default IEs buffer
5554 	 * @ies_len: Length of IEs in bytes
5555 	 * Returns: 0 on success or -1 on failure
5556 	 *
5557 	 * The driver can use these by default when there are no scan IEs coming
5558 	 * in the subsequent scan requests. Also in case of one or more of IEs
5559 	 * given in set_default_scan_ies() are missing in the subsequent scan
5560 	 * request, the driver should merge the missing scan IEs in the scan
5561 	 * request from the IEs set by set_default_scan_ies() in the Probe
5562 	 * Request frames sent.
5563 	 */
5564 	int (*set_default_scan_ies)(void *priv, const u8 *ies, size_t ies_len);
5565 
5566 	/**
5567 	 * set_tdls_mode - Set TDLS trigger mode to the host driver
5568 	 * @priv: Private driver interface data
5569 	 * @tdls_external_control: Represents if TDLS external trigger control
5570 	 *  mode is enabled/disabled.
5571 	 *
5572 	 * This optional callback can be used to configure the TDLS external
5573 	 * trigger control mode to the host driver.
5574 	 */
5575 	int (*set_tdls_mode)(void *priv, int tdls_external_control);
5576 
5577 	/**
5578 	 * get_bss_transition_status - Get candidate BSS's transition status
5579 	 * @priv: Private driver interface data
5580 	 * @params: Candidate BSS list
5581 	 *
5582 	 * Get the accept or reject reason code for a list of BSS transition
5583 	 * candidates.
5584 	 */
5585 	struct wpa_bss_candidate_info *
5586 	(*get_bss_transition_status)(void *priv,
5587 				     struct wpa_bss_trans_info *params);
5588 	/**
5589 	 * ignore_assoc_disallow - Configure driver to ignore assoc_disallow
5590 	 * @priv: Private driver interface data
5591 	 * @ignore_disallow: 0 to not ignore, 1 to ignore
5592 	 * Returns: 0 on success, -1 on failure
5593 	 */
5594 	int (*ignore_assoc_disallow)(void *priv, int ignore_disallow);
5595 
5596 	/**
5597 	 * set_bssid_tmp_disallow - Set disallowed BSSIDs to the driver
5598 	 * @priv: Private driver interface data
5599 	 * @num_bssid: Number of temporarily disallowed BSSIDs
5600 	 * @bssids: List of temporarily disallowed BSSIDs
5601 	 */
5602 	int (*set_bssid_tmp_disallow)(void *priv, unsigned int num_bssid,
5603 				      const u8 *bssid);
5604 
5605 	/**
5606 	 * update_connect_params - Update the connection parameters
5607 	 * @priv: Private driver interface data
5608 	 * @params: Association parameters
5609 	 * @mask: Bit mask indicating which parameters in @params have to be
5610 	 *	updated
5611 	 * Returns: 0 on success, -1 on failure
5612 	 *
5613 	 * Update the connection parameters when in connected state so that the
5614 	 * driver uses the updated parameters for subsequent roaming. This is
5615 	 * used only with drivers that implement internal BSS selection and
5616 	 * roaming.
5617 	 */
5618 	int (*update_connect_params)(
5619 		void *priv, struct wpa_driver_associate_params *params,
5620 		enum wpa_drv_update_connect_params_mask mask);
5621 
5622 	/**
5623 	 * send_external_auth_status - Indicate the status of external
5624 	 * authentication processing to the host driver.
5625 	 * @priv: Private driver interface data
5626 	 * @params: Status of authentication processing.
5627 	 * Returns: 0 on success, -1 on failure
5628 	 */
5629 	int (*send_external_auth_status)(void *priv,
5630 					 struct external_auth *params);
5631 
5632 	/**
5633 	 * set_4addr_mode - Set 4-address mode
5634 	 * @priv: Private driver interface data
5635 	 * @bridge_ifname: Bridge interface name
5636 	 * @val: 0 - disable 4addr mode, 1 - enable 4addr mode
5637 	 * Returns: 0 on success, < 0 on failure
5638 	 */
5639 	int (*set_4addr_mode)(void *priv, const char *bridge_ifname, int val);
5640 
5641 	/**
5642 	 * update_dh_ie - Update DH IE
5643 	 * @priv: Private driver interface data
5644 	 * @peer_mac: Peer MAC address
5645 	 * @reason_code: Reacon code
5646 	 * @ie: DH IE
5647 	 * @ie_len: DH IE length in bytes
5648 	 * Returns: 0 on success, -1 on failure
5649 	 *
5650 	 * This callback is used to let the driver know the DH processing result
5651 	 * and DH IE for a pending association.
5652 	 */
5653 	int (*update_dh_ie)(void *priv, const u8 *peer_mac, u16 reason_code,
5654 			    const u8 *ie, size_t ie_len);
5655 
5656 	/**
5657 	 * dpp_listen - Notify driver about start/stop of DPP listen
5658 	 * @priv: Private driver interface data
5659 	 * @enable: Whether listen state is enabled (or disabled)
5660 	 * Returns: 0 on success, -1 on failure
5661 	 *
5662 	 * This optional callback can be used to update RX frame filtering to
5663 	 * explicitly allow reception of broadcast Public Action frames.
5664 	 */
5665 	int (*dpp_listen)(void *priv, bool enable);
5666 
5667 	/**
5668 	 * set_secure_ranging_ctx - Add or delete secure ranging parameters of
5669 	 * the specified peer to the driver.
5670 	 * @priv: Private driver interface data
5671 	 * @params: Secure ranging parameters
5672 	 * Returns: 0 on success, -1 on failure
5673 	 *
5674 	 */
5675 	int (*set_secure_ranging_ctx)(void *priv,
5676 				      struct secure_ranging_params *params);
5677 
5678 	/**
5679 	 * send_pasn_resp - Send PASN response for a set of peers to the
5680 	 * driver.
5681 	 * @priv: Private driver interface data
5682 	 * @params: Parameters holding peers and respective status.
5683 	 * Returns: 0 on success, -1 on failure
5684 	 */
5685 	int (*send_pasn_resp)(void *priv, struct pasn_auth *params);
5686 
5687 	/**
5688 	 * get_sta_mlo_info - Get the current multi-link association info
5689 	 * @priv: Private driver interface data
5690 	 * @mlo: Pointer to fill multi-link association info
5691 	 * Returns: 0 on success, -1 on failure
5692 	 *
5693 	 * This callback is used to fetch multi-link of the current association.
5694 	 */
5695 	int (*get_sta_mlo_info)(void *priv,
5696 				struct driver_sta_mlo_info *mlo_info);
5697 
5698 	/**
5699 	 * link_add - Add a link to the AP MLD interface
5700 	 * @priv: Private driver interface data
5701 	 * @link_id: The link ID
5702 	 * @addr: The MAC address to use for the link
5703 	 * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces
5704 	 * Returns: 0 on success, negative value on failure
5705 	 */
5706 	int (*link_add)(void *priv, u8 link_id, const u8 *addr, void *bss_ctx);
5707 
5708 	/**
5709 	 * link_remove - Remove a link from the AP MLD interface
5710 	 * @priv: Private driver interface data
5711 	 * @type: Interface type
5712 	 * @ifname: Interface name of the virtual interface from where the link
5713 	 *	is to be removed.
5714 	 * @link_id: Valid link ID to remove
5715 	 * Returns: 0 on success, -1 on failure
5716 	 */
5717 	int (*link_remove)(void *priv, enum wpa_driver_if_type type,
5718 			   const char *ifname, u8 link_id);
5719 
5720 	/**
5721 	 * is_drv_shared - Check whether the driver interface is shared
5722 	 * @priv: Private driver interface data from init()
5723 	 * @link_id: Link ID to match
5724 	 * Returns: true if it is being used or else false.
5725 	 *
5726 	 * Checks whether the driver interface is being used by other partner
5727 	 * BSS(s) or not. This is used to decide whether the driver interface
5728 	 * needs to be deinitilized when one interface is getting deinitialized.
5729 	 *
5730 	 * NOTE: @link_id will be used only when there is only one BSS
5731 	 * present and if that single link is active. In that case, the
5732 	 * link ID is matched with the active link_id to decide whether the
5733 	 * driver interface is being used by other partner BSS(s).
5734 	 */
5735 	bool (*is_drv_shared)(void *priv, int link_id);
5736 
5737 	/**
5738 	 * link_sta_remove - Remove a link STA from an MLD STA
5739 	 * @priv: Private driver interface data
5740 	 * @link_id: The link ID which the link STA is using
5741 	 * @addr: The MLD MAC address of the MLD STA
5742 	 * Returns: 0 on success, negative value on failure
5743 	 */
5744 	int (*link_sta_remove)(void *priv, u8 link_id, const u8 *addr);
5745 
5746 	/**
5747 	 * nan_flush - Flush all NAN offload services
5748 	 * @priv: Private driver interface data
5749 	 * Returns: 0 on success, negative value on failure
5750 	 */
5751 	int (*nan_flush)(void *priv);
5752 
5753 	/**
5754 	 * nan_publish - NAN offload for Publish()
5755 	 * @priv: Private driver interface data
5756 	 * @src: Source P2P device addr
5757 	 * @publish_id: Publish instance to add
5758 	 * @service_name: Service name
5759 	 * @service_id: Service ID (6 octet value derived from service name)
5760 	 * @srv_proto_type: Service protocol type
5761 	 * @ssi: Service specific information or %NULL
5762 	 * @elems: Information elements for Element Container attribute or %NULL
5763 	 * @params: Configuration parameters
5764 	 * Returns: 0 on success, negative value on failure
5765 	 */
5766 	int (*nan_publish)(void *priv, const u8 *src, int publish_id,
5767 			   const char *service_name, const u8 *service_id,
5768 			   enum nan_service_protocol_type srv_proto_type,
5769 			   const struct wpabuf *ssi, const struct wpabuf *elems,
5770 			   struct nan_publish_params *params,
5771 			   const u8 *network_id);
5772 
5773 	/**
5774 	 * nan_cancel_publish - NAN offload for CancelPublish()
5775 	 * @priv: Private driver interface data
5776 	 * @publish_id: Publish instance to cancel
5777 	 * Returns: 0 on success, negative value on failure
5778 	 */
5779 	int (*nan_cancel_publish)(void *priv, int publish_id);
5780 
5781 	/**
5782 	 * nan_update_publish - NAN offload for UpdatePublish()
5783 	 * @priv: Private driver interface data
5784 	 * @ssi: Service specific information or %NULL
5785 	 * Returns: 0 on success, negative value on failure
5786 	 */
5787 	int (*nan_update_publish)(void *priv, int publish_id,
5788 				  const struct wpabuf *ssi);
5789 
5790 	/**
5791 	 * nan_subscribe - NAN offload for Subscribe()
5792 	 * @priv: Private driver interface data
5793 	 * @src: Source P2P device addr
5794 	 * @subscribe_id: Subscribe instance to add
5795 	 * @service_name: Service name
5796 	 * @service_id: Service ID (6 octet value derived from service name)
5797 	 * @srv_proto_type: Service protocol type
5798 	 * @ssi: Service specific information or %NULL
5799 	 * @elems: Information elements for Element Container attribute or %NULL
5800 	 * @params: Configuration parameters
5801 	 * Returns: 0 on success, negative value on failure
5802 	 */
5803 	int (*nan_subscribe)(void *priv, const u8 *src, int subscribe_id,
5804 			     const char *service_name, const u8 *service_id,
5805 			     enum nan_service_protocol_type srv_proto_type,
5806 			     const struct wpabuf *ssi,
5807 			     const struct wpabuf *elems,
5808 			     struct nan_subscribe_params *params,
5809 			     const u8 *network_id);
5810 
5811 	/**
5812 	 * nan_cancel_subscribe - NAN offload for CancelSubscribe()
5813 	 * @priv: Private driver interface data
5814 	 * @subscribe_id: Subscribe instance to cancel
5815 	 * Returns: 0 on success, negative value on failure
5816 	 */
5817 	int (*nan_cancel_subscribe)(void *priv, int subscribe_id);
5818 
5819 	/**
5820 	 * can_share_drv - Check whether driver interface can be shared
5821 	 * @ctx: Pointer to hostapd context
5822 	 * @params: Configuration for the driver wrapper
5823 	 * @hapd: Pointer for overwriting the hapd context or %NULL
5824 	 * 	if can't find a shared drv
5825 	 *
5826 	 * Checks whether the driver interface with same phy name is
5827 	 * already present under the global driver which can be shared
5828 	 * instead of creating a new driver interface instance. If present,
5829 	 * @hapd will be overwritten with the hapd pointer which this shared
5830 	 * drv's first BSS is using. This will help the caller to later call
5831 	 * if_add().
5832 	 *
5833 	 * Returns: true if it can be shared or else false.
5834 	 */
5835 	bool (*can_share_drv)(void *ctx, struct wpa_init_params *params,
5836 			      void **hapd);
5837 
5838 #ifdef CONFIG_TESTING_OPTIONS
5839 	int (*register_frame)(void *priv, u16 type,
5840 			      const u8 *match, size_t match_len,
5841 			      bool multicast);
5842 #endif /* CONFIG_TESTING_OPTIONS */
5843 
5844 	/**
5845 	 * get_multi_hw_info - Get multiple underlying hardware information
5846 	 *		       (hardware IDx and supported frequency range)
5847 	 * @priv: Private driver interface data
5848 	 * @num_multi_hws: Variable for returning the number of returned
5849 	 *	hardware info data
5850 	 * Returns: Pointer to allocated multiple hardware data on success
5851 	 * or %NULL on failure. Caller is responsible for freeing this.
5852 	 */
5853 	struct hostapd_multi_hw_info *
5854 	(*get_multi_hw_info)(void *priv, unsigned int *num_multi_hws);
5855 
5856 #ifdef CONFIG_NAN
5857 	/**
5858 	 * nan_start - Start NAN operation
5859 	 * @priv: Private driver interface data
5860 	 * @conf: NAN configuration parameters
5861 	 * Returns: 0 on success, -1 on failure
5862 	 *
5863 	 * This command joins an existing NAN cluster or starts a new one.
5864 	 */
5865 	int (*nan_start)(void *priv, const struct nan_cluster_config *conf);
5866 
5867 	/**
5868 	 * nan_change_config - Update the NAN cluster configuration
5869 	 * @priv: Private driver interface data
5870 	 * @conf: NAN configuration parameters
5871 	 * Returns: 0 on success, -1 on failure
5872 	 *
5873 	 * This command modifies the NAN cluster configuration.
5874 	 */
5875 	int (*nan_change_config)(void *priv,
5876 				 const struct nan_cluster_config *conf);
5877 
5878 	/**
5879 	 * nan_stop - Stop NAN operation
5880 	 * @priv: Private driver interface data
5881 	 */
5882 	void (*nan_stop)(void *priv);
5883 
5884 	/**
5885 	 * nan_config_schedule - Configure NAN schedule
5886 	 * @priv: Private driver interface data
5887 	 * @map_id: NAN schedule map ID
5888 	 * @conf: NAN schedule configuration parameters
5889 	 * Returns 0 on success, -1 on failure
5890 	 *
5891 	 * This command configures the local NAN schedule. It should be
5892 	 * executed on NAN device interface after NAN has been started.
5893 	 * The configured schedule should be valid for RX for all NAN
5894 	 * activities (management and data).
5895 	 *
5896 	 * For devices that support multiple concurrent NAN radios, this
5897 	 * callback should be called for each radio with the corresponding
5898 	 * %map_id.
5899 	 *
5900 	 * If previous configuration exists, it is replaced with the new
5901 	 * one. To delete previous schedule, set %conf.num_channels = 0.
5902 	 */
5903 	int (*nan_config_schedule)(void *priv, u8 map_id,
5904 				   struct nan_schedule_config *conf);
5905 
5906 	/**
5907 	 * nan_config_peer_schedule - Configure NAN peer schedule
5908 	 * @priv: Private driver interface data
5909 	 * @peer: Peer's NAN device address
5910 	 * @cdw: Peer's committed DW.
5911 	 * @sequence_id: Peer's schedule sequence ID
5912 	 * @max_chan_switch_time: Maximum channel switch time in TUs
5913 	 * @ulw: Peer's unaligned window attributes or %NULL
5914 	 * @sched: NAN peer schedule configuration parameters
5915 	 * Returns 0 on success, -1 on failure
5916 	 *
5917 	 * This command configures peer's NAN schedule. To remove previous
5918 	 * schedule for a given %map_id, set %sched.num_channels = 0.
5919 	 * %ulw attributes are used to provide the initial information about
5920 	 * peer's unaligned schedule. Further updates to ULW should be tracked
5921 	 * internally by the device/driver.
5922 	 */
5923 	int (*nan_config_peer_schedule)(void *priv, const u8 *peer,
5924 					u16 cdw, u8 sequence_id,
5925 					u16 max_chan_switch_time,
5926 					const struct wpabuf *ulw,
5927 					struct nan_peer_schedule_config *sched);
5928 #endif /* CONFIG_NAN */
5929 
5930 #ifdef CONFIG_PR
5931 	/**
5932 	 * pd_start - Create interface for Proximity Detection
5933 	 * @priv: Private driver interface data
5934 	 * @addr: Requested MAC address
5935 	 * @pd_addr: MAC address of the interface
5936 	 * Returns: 0 on success, -1 on failure
5937 	 */
5938 	int (*pd_start)(void *priv, const u8 *addr, u8 *pd_addr);
5939 
5940 	/**
5941 	 * pd_stop - Stop interface for Proximity Detection
5942 	 * @priv: Private driver interface data
5943 	 */
5944 	void (*pd_stop)(void *priv);
5945 
5946 	/**
5947 	 * start_peer_measurement - Start peer measurement (FTM ranging)
5948 	 * @priv: Private driver interface data
5949 	 * @peer_addr: Peer MAC address
5950 	 * @freq: Operating frequency in MHz
5951 	 * @channel: Operating channel number
5952 	 * @bw: Channel bandwidth in MHz
5953 	 * @params: Ranging parameters (EDCA/NTB specific)
5954 	 * Returns: 0 on success, -1 on failure
5955 	 *
5956 	 * This function triggers peer measurement (FTM ranging) after
5957 	 * successful PASN authentication for proximity ranging.
5958 	 */
5959 	int (*start_peer_measurement)(void *priv, const u8 *peer_addr,
5960 				      int freq, u8 channel, int bw,
5961 				      struct pr_pasn_ranging_params *params);
5962 
5963 	/**
5964 	 * stop_peer_measurement - Stop peer measurement and destroy ranging socket
5965 	 * @priv: Private driver interface data
5966 	 *
5967 	 * Unregisters the ranging socket from eloop and frees all associated
5968 	 * resources. Safe to call when no ranging session is active (no-op).
5969 	 */
5970 	void (*stop_peer_measurement)(void *priv);
5971 #endif /* CONFIG_PR */
5972 };
5973 
5974 /**
5975  * enum wpa_event_type - Event type for wpa_supplicant_event() calls
5976  */
5977 enum wpa_event_type {
5978 	/**
5979 	 * EVENT_ASSOC - Association completed
5980 	 *
5981 	 * This event needs to be delivered when the driver completes IEEE
5982 	 * 802.11 association or reassociation successfully.
5983 	 * wpa_driver_ops::get_bssid() is expected to provide the current BSSID
5984 	 * after this event has been generated. In addition, optional
5985 	 * EVENT_ASSOCINFO may be generated just before EVENT_ASSOC to provide
5986 	 * more information about the association. If the driver interface gets
5987 	 * both of these events at the same time, it can also include the
5988 	 * assoc_info data in EVENT_ASSOC call.
5989 	 */
5990 	EVENT_ASSOC,
5991 
5992 	/**
5993 	 * EVENT_DISASSOC - Association lost
5994 	 *
5995 	 * This event should be called when association is lost either due to
5996 	 * receiving deauthenticate or disassociate frame from the AP or when
5997 	 * sending either of these frames to the current AP. If the driver
5998 	 * supports separate deauthentication event, EVENT_DISASSOC should only
5999 	 * be used for disassociation and EVENT_DEAUTH for deauthentication.
6000 	 * In AP mode, union wpa_event_data::disassoc_info is required.
6001 	 */
6002 	EVENT_DISASSOC,
6003 
6004 	/**
6005 	 * EVENT_MICHAEL_MIC_FAILURE - Michael MIC (TKIP) detected
6006 	 *
6007 	 * This event must be delivered when a Michael MIC error is detected by
6008 	 * the local driver. Additional data for event processing is
6009 	 * provided with union wpa_event_data::michael_mic_failure. This
6010 	 * information is used to request new encryption key and to initiate
6011 	 * TKIP countermeasures if needed.
6012 	 */
6013 	EVENT_MICHAEL_MIC_FAILURE,
6014 
6015 	/**
6016 	 * EVENT_SCAN_RESULTS - Scan results available
6017 	 *
6018 	 * This event must be called whenever scan results are available to be
6019 	 * fetched with struct wpa_driver_ops::get_scan_results(). This event
6020 	 * is expected to be used some time after struct wpa_driver_ops::scan()
6021 	 * is called. If the driver provides an unsolicited event when the scan
6022 	 * has been completed, this event can be used to trigger
6023 	 * EVENT_SCAN_RESULTS call. If such event is not available from the
6024 	 * driver, the driver wrapper code is expected to use a registered
6025 	 * timeout to generate EVENT_SCAN_RESULTS call after the time that the
6026 	 * scan is expected to be completed. Optional information about
6027 	 * completed scan can be provided with union wpa_event_data::scan_info.
6028 	 */
6029 	EVENT_SCAN_RESULTS,
6030 
6031 	/**
6032 	 * EVENT_ASSOCINFO - Report optional extra information for association
6033 	 *
6034 	 * This event can be used to report extra association information for
6035 	 * EVENT_ASSOC processing. This extra information includes IEs from
6036 	 * association frames and Beacon/Probe Response frames in union
6037 	 * wpa_event_data::assoc_info. EVENT_ASSOCINFO must be send just before
6038 	 * EVENT_ASSOC. Alternatively, the driver interface can include
6039 	 * assoc_info data in the EVENT_ASSOC call if it has all the
6040 	 * information available at the same point.
6041 	 */
6042 	EVENT_ASSOCINFO,
6043 
6044 	/**
6045 	 * EVENT_INTERFACE_STATUS - Report interface status changes
6046 	 *
6047 	 * This optional event can be used to report changes in interface
6048 	 * status (interface added/removed) using union
6049 	 * wpa_event_data::interface_status. This can be used to trigger
6050 	 * wpa_supplicant to stop and re-start processing for the interface,
6051 	 * e.g., when a cardbus card is ejected/inserted.
6052 	 */
6053 	EVENT_INTERFACE_STATUS,
6054 
6055 	/**
6056 	 * EVENT_PMKID_CANDIDATE - Report a candidate AP for pre-authentication
6057 	 *
6058 	 * This event can be used to inform wpa_supplicant about candidates for
6059 	 * RSN (WPA2) pre-authentication. If wpa_supplicant is not responsible
6060 	 * for scan request (ap_scan=2 mode), this event is required for
6061 	 * pre-authentication. If wpa_supplicant is performing scan request
6062 	 * (ap_scan=1), this event is optional since scan results can be used
6063 	 * to add pre-authentication candidates. union
6064 	 * wpa_event_data::pmkid_candidate is used to report the BSSID of the
6065 	 * candidate and priority of the candidate, e.g., based on the signal
6066 	 * strength, in order to try to pre-authenticate first with candidates
6067 	 * that are most likely targets for re-association.
6068 	 *
6069 	 * EVENT_PMKID_CANDIDATE can be called whenever the driver has updates
6070 	 * on the candidate list. In addition, it can be called for the current
6071 	 * AP and APs that have existing PMKSA cache entries. wpa_supplicant
6072 	 * will automatically skip pre-authentication in cases where a valid
6073 	 * PMKSA exists. When more than one candidate exists, this event should
6074 	 * be generated once for each candidate.
6075 	 *
6076 	 * Driver will be notified about successful pre-authentication with
6077 	 * struct wpa_driver_ops::add_pmkid() calls.
6078 	 */
6079 	EVENT_PMKID_CANDIDATE,
6080 
6081 	/**
6082 	 * EVENT_TDLS - Request TDLS operation
6083 	 *
6084 	 * This event can be used to request a TDLS operation to be performed.
6085 	 */
6086 	EVENT_TDLS,
6087 
6088 	/**
6089 	 * EVENT_FT_RESPONSE - Report FT (IEEE 802.11r) response IEs
6090 	 *
6091 	 * The driver is expected to report the received FT IEs from
6092 	 * FT authentication sequence from the AP. The FT IEs are included in
6093 	 * the extra information in union wpa_event_data::ft_ies.
6094 	 */
6095 	EVENT_FT_RESPONSE,
6096 
6097 	/**
6098 	 * EVENT_IBSS_RSN_START - Request RSN authentication in IBSS
6099 	 *
6100 	 * The driver can use this event to inform wpa_supplicant about a STA
6101 	 * in an IBSS with which protected frames could be exchanged. This
6102 	 * event starts RSN authentication with the other STA to authenticate
6103 	 * the STA and set up encryption keys with it.
6104 	 */
6105 	EVENT_IBSS_RSN_START,
6106 
6107 	/**
6108 	 * EVENT_AUTH - Authentication result
6109 	 *
6110 	 * This event should be called when authentication attempt has been
6111 	 * completed. This is only used if the driver supports separate
6112 	 * authentication step (struct wpa_driver_ops::authenticate).
6113 	 * Information about authentication result is included in
6114 	 * union wpa_event_data::auth.
6115 	 */
6116 	EVENT_AUTH,
6117 
6118 	/**
6119 	 * EVENT_DEAUTH - Authentication lost
6120 	 *
6121 	 * This event should be called when authentication is lost either due
6122 	 * to receiving deauthenticate frame from the AP or when sending that
6123 	 * frame to the current AP.
6124 	 * In AP mode, union wpa_event_data::deauth_info is required.
6125 	 */
6126 	EVENT_DEAUTH,
6127 
6128 	/**
6129 	 * EVENT_ASSOC_REJECT - Association rejected
6130 	 *
6131 	 * This event should be called when (re)association attempt has been
6132 	 * rejected by the AP. Information about the association response is
6133 	 * included in union wpa_event_data::assoc_reject.
6134 	 */
6135 	EVENT_ASSOC_REJECT,
6136 
6137 	/**
6138 	 * EVENT_AUTH_TIMED_OUT - Authentication timed out
6139 	 */
6140 	EVENT_AUTH_TIMED_OUT,
6141 
6142 	/**
6143 	 * EVENT_ASSOC_TIMED_OUT - Association timed out
6144 	 */
6145 	EVENT_ASSOC_TIMED_OUT,
6146 
6147 	/**
6148 	 * EVENT_WPS_BUTTON_PUSHED - Report hardware push button press for WPS
6149 	 */
6150 	EVENT_WPS_BUTTON_PUSHED,
6151 
6152 	/**
6153 	 * EVENT_TX_STATUS - Report TX status
6154 	 */
6155 	EVENT_TX_STATUS,
6156 
6157 	/**
6158 	 * EVENT_RX_FROM_UNKNOWN - Report RX from unknown STA
6159 	 */
6160 	EVENT_RX_FROM_UNKNOWN,
6161 
6162 	/**
6163 	 * EVENT_RX_MGMT - Report RX of a management frame
6164 	 */
6165 	EVENT_RX_MGMT,
6166 
6167 	/**
6168 	 * EVENT_REMAIN_ON_CHANNEL - Remain-on-channel duration started
6169 	 *
6170 	 * This event is used to indicate when the driver has started the
6171 	 * requested remain-on-channel duration. Information about the
6172 	 * operation is included in union wpa_event_data::remain_on_channel.
6173 	 */
6174 	EVENT_REMAIN_ON_CHANNEL,
6175 
6176 	/**
6177 	 * EVENT_CANCEL_REMAIN_ON_CHANNEL - Remain-on-channel timed out
6178 	 *
6179 	 * This event is used to indicate when the driver has completed
6180 	 * remain-on-channel duration, i.e., may noot be available on the
6181 	 * requested channel anymore. Information about the
6182 	 * operation is included in union wpa_event_data::remain_on_channel.
6183 	 */
6184 	EVENT_CANCEL_REMAIN_ON_CHANNEL,
6185 
6186 	/**
6187 	 * EVENT_RX_PROBE_REQ - Indicate received Probe Request frame
6188 	 *
6189 	 * This event is used to indicate when a Probe Request frame has been
6190 	 * received. Information about the received frame is included in
6191 	 * union wpa_event_data::rx_probe_req. The driver is required to report
6192 	 * these events only after successfully completed probe_req_report()
6193 	 * commands to request the events (i.e., report parameter is non-zero)
6194 	 * in station mode. In AP mode, Probe Request frames should always be
6195 	 * reported.
6196 	 */
6197 	EVENT_RX_PROBE_REQ,
6198 
6199 	/**
6200 	 * EVENT_NEW_STA - New wired device noticed
6201 	 *
6202 	 * This event is used to indicate that a new device has been detected
6203 	 * in a network that does not use association-like functionality (i.e.,
6204 	 * mainly wired Ethernet). This can be used to start EAPOL
6205 	 * authenticator when receiving a frame from a device. The address of
6206 	 * the device is included in union wpa_event_data::new_sta.
6207 	 */
6208 	EVENT_NEW_STA,
6209 
6210 	/**
6211 	 * EVENT_EAPOL_RX - Report received EAPOL frame
6212 	 *
6213 	 * When in AP mode with hostapd, this event is required to be used to
6214 	 * deliver the receive EAPOL frames from the driver.
6215 	 */
6216 	EVENT_EAPOL_RX,
6217 
6218 	/**
6219 	 * EVENT_SIGNAL_CHANGE - Indicate change in signal strength
6220 	 *
6221 	 * This event is used to indicate changes in the signal strength
6222 	 * observed in frames received from the current AP if signal strength
6223 	 * monitoring has been enabled with signal_monitor().
6224 	 */
6225 	EVENT_SIGNAL_CHANGE,
6226 
6227 	/**
6228 	 * EVENT_INTERFACE_ENABLED - Notify that interface was enabled
6229 	 *
6230 	 * This event is used to indicate that the interface was enabled after
6231 	 * having been previously disabled, e.g., due to rfkill.
6232 	 */
6233 	EVENT_INTERFACE_ENABLED,
6234 
6235 	/**
6236 	 * EVENT_INTERFACE_DISABLED - Notify that interface was disabled
6237 	 *
6238 	 * This event is used to indicate that the interface was disabled,
6239 	 * e.g., due to rfkill.
6240 	 */
6241 	EVENT_INTERFACE_DISABLED,
6242 
6243 	/**
6244 	 * EVENT_CHANNEL_LIST_CHANGED - Channel list changed
6245 	 *
6246 	 * This event is used to indicate that the channel list has changed,
6247 	 * e.g., because of a regulatory domain change triggered by scan
6248 	 * results including an AP advertising a country code.
6249 	 */
6250 	EVENT_CHANNEL_LIST_CHANGED,
6251 
6252 	/**
6253 	 * EVENT_INTERFACE_UNAVAILABLE - Notify that interface is unavailable
6254 	 *
6255 	 * This event is used to indicate that the driver cannot maintain this
6256 	 * interface in its operation mode anymore. The most likely use for
6257 	 * this is to indicate that AP mode operation is not available due to
6258 	 * operating channel would need to be changed to a DFS channel when
6259 	 * the driver does not support radar detection and another virtual
6260 	 * interfaces caused the operating channel to change. Other similar
6261 	 * resource conflicts could also trigger this for station mode
6262 	 * interfaces. This event can be propagated when channel switching
6263 	 * fails.
6264 	 */
6265 	EVENT_INTERFACE_UNAVAILABLE,
6266 
6267 	/**
6268 	 * EVENT_BEST_CHANNEL
6269 	 *
6270 	 * Driver generates this event whenever it detects a better channel
6271 	 * (e.g., based on RSSI or channel use). This information can be used
6272 	 * to improve channel selection for a new AP/P2P group.
6273 	 */
6274 	EVENT_BEST_CHANNEL,
6275 
6276 	/**
6277 	 * EVENT_UNPROT_DEAUTH - Unprotected Deauthentication frame received
6278 	 *
6279 	 * This event should be called when a Deauthentication frame is dropped
6280 	 * due to it not being protected (MFP/IEEE 802.11w).
6281 	 * union wpa_event_data::unprot_deauth is required to provide more
6282 	 * details of the frame.
6283 	 */
6284 	EVENT_UNPROT_DEAUTH,
6285 
6286 	/**
6287 	 * EVENT_UNPROT_DISASSOC - Unprotected Disassociation frame received
6288 	 *
6289 	 * This event should be called when a Disassociation frame is dropped
6290 	 * due to it not being protected (MFP/IEEE 802.11w).
6291 	 * union wpa_event_data::unprot_disassoc is required to provide more
6292 	 * details of the frame.
6293 	 */
6294 	EVENT_UNPROT_DISASSOC,
6295 
6296 	/**
6297 	 * EVENT_STATION_LOW_ACK
6298 	 *
6299 	 * Driver generates this event whenever it detected that a particular
6300 	 * station was lost. Detection can be through massive transmission
6301 	 * failures for example.
6302 	 */
6303 	EVENT_STATION_LOW_ACK,
6304 
6305 	/**
6306 	 * EVENT_IBSS_PEER_LOST - IBSS peer not reachable anymore
6307 	 */
6308 	EVENT_IBSS_PEER_LOST,
6309 
6310 	/**
6311 	 * EVENT_DRIVER_GTK_REKEY - Device/driver did GTK rekey
6312 	 *
6313 	 * This event carries the new replay counter to notify wpa_supplicant
6314 	 * of the current EAPOL-Key Replay Counter in case the driver/firmware
6315 	 * completed Group Key Handshake while the host (including
6316 	 * wpa_supplicant was sleeping).
6317 	 */
6318 	EVENT_DRIVER_GTK_REKEY,
6319 
6320 	/**
6321 	 * EVENT_SCHED_SCAN_STOPPED - Scheduled scan was stopped
6322 	 */
6323 	EVENT_SCHED_SCAN_STOPPED,
6324 
6325 	/**
6326 	 * EVENT_DRIVER_CLIENT_POLL_OK - Station responded to poll
6327 	 *
6328 	 * This event indicates that the station responded to the poll
6329 	 * initiated with @poll_client.
6330 	 */
6331 	EVENT_DRIVER_CLIENT_POLL_OK,
6332 
6333 	/**
6334 	 * EVENT_EAPOL_TX_STATUS - notify of EAPOL TX status
6335 	 */
6336 	EVENT_EAPOL_TX_STATUS,
6337 
6338 	/**
6339 	 * EVENT_CH_SWITCH - AP or GO decided to switch channels
6340 	 *
6341 	 * Described in wpa_event_data.ch_switch
6342 	 * */
6343 	EVENT_CH_SWITCH,
6344 
6345 	/**
6346 	 * EVENT_CH_SWITCH_STARTED - AP or GO started to switch channels
6347 	 *
6348 	 * This is a pre-switch event indicating the shortly following switch
6349 	 * of operating channels.
6350 	 *
6351 	 * Described in wpa_event_data.ch_switch
6352 	 */
6353 	EVENT_CH_SWITCH_STARTED,
6354 	/**
6355 	 * EVENT_WNM - Request WNM operation
6356 	 *
6357 	 * This event can be used to request a WNM operation to be performed.
6358 	 */
6359 	EVENT_WNM,
6360 
6361 	/**
6362 	 * EVENT_CONNECT_FAILED_REASON - Connection failure reason in AP mode
6363 	 *
6364 	 * This event indicates that the driver reported a connection failure
6365 	 * with the specified client (for example, max client reached, etc.) in
6366 	 * AP mode.
6367 	 */
6368 	EVENT_CONNECT_FAILED_REASON,
6369 
6370 	/**
6371 	 * EVENT_DFS_RADAR_DETECTED - Notify of radar detection
6372 	 *
6373 	 * A radar has been detected on the supplied frequency, hostapd should
6374 	 * react accordingly (e.g., change channel).
6375 	 */
6376 	EVENT_DFS_RADAR_DETECTED,
6377 
6378 	/**
6379 	 * EVENT_DFS_CAC_FINISHED - Notify that channel availability check has been completed
6380 	 *
6381 	 * After a successful CAC, the channel can be marked clear and used.
6382 	 */
6383 	EVENT_DFS_CAC_FINISHED,
6384 
6385 	/**
6386 	 * EVENT_DFS_CAC_ABORTED - Notify that channel availability check has been aborted
6387 	 *
6388 	 * The CAC was not successful, and the channel remains in the previous
6389 	 * state. This may happen due to a radar being detected or other
6390 	 * external influences.
6391 	 */
6392 	EVENT_DFS_CAC_ABORTED,
6393 
6394 	/**
6395 	 * EVENT_DFS_NOP_FINISHED - Notify that non-occupancy period is over
6396 	 *
6397 	 * The channel which was previously unavailable is now available again.
6398 	 */
6399 	EVENT_DFS_NOP_FINISHED,
6400 
6401 	/**
6402 	 * EVENT_SURVEY - Received survey data
6403 	 *
6404 	 * This event gets triggered when a driver query is issued for survey
6405 	 * data and the requested data becomes available. The returned data is
6406 	 * stored in struct survey_results. The results provide at most one
6407 	 * survey entry for each frequency and at minimum will provide one
6408 	 * survey entry for one frequency. The survey data can be os_malloc()'d
6409 	 * and then os_free()'d, so the event callback must only copy data.
6410 	 */
6411 	EVENT_SURVEY,
6412 
6413 	/**
6414 	 * EVENT_SCAN_STARTED - Scan started
6415 	 *
6416 	 * This indicates that driver has started a scan operation either based
6417 	 * on a request from wpa_supplicant/hostapd or from another application.
6418 	 * EVENT_SCAN_RESULTS is used to indicate when the scan has been
6419 	 * completed (either successfully or by getting cancelled).
6420 	 */
6421 	EVENT_SCAN_STARTED,
6422 
6423 	/**
6424 	 * EVENT_AVOID_FREQUENCIES - Received avoid frequency range
6425 	 *
6426 	 * This event indicates a set of frequency ranges that should be avoided
6427 	 * to reduce issues due to interference or internal co-existence
6428 	 * information in the driver.
6429 	 */
6430 	EVENT_AVOID_FREQUENCIES,
6431 
6432 	/**
6433 	 * EVENT_NEW_PEER_CANDIDATE - new (unknown) mesh peer notification
6434 	 */
6435 	EVENT_NEW_PEER_CANDIDATE,
6436 
6437 	/**
6438 	 * EVENT_ACS_CHANNEL_SELECTED - Received selected channels by ACS
6439 	 *
6440 	 * Indicates a pair of primary and secondary channels chosen by ACS
6441 	 * in device.
6442 	 */
6443 	EVENT_ACS_CHANNEL_SELECTED,
6444 
6445 	/**
6446 	 * EVENT_DFS_CAC_STARTED - Notify that channel availability check has
6447 	 * been started.
6448 	 *
6449 	 * This event indicates that channel availability check has been started
6450 	 * on a DFS frequency by a driver that supports DFS Offload.
6451 	 */
6452 	EVENT_DFS_CAC_STARTED,
6453 
6454 	/**
6455 	 * EVENT_P2P_LO_STOP - Notify that P2P listen offload is stopped
6456 	 */
6457 	EVENT_P2P_LO_STOP,
6458 
6459 	/**
6460 	 * EVENT_BEACON_LOSS - Beacon loss detected
6461 	 *
6462 	 * This event indicates that no Beacon frames has been received from
6463 	 * the current AP. This may indicate that the AP is not anymore in
6464 	 * range.
6465 	 */
6466 	EVENT_BEACON_LOSS,
6467 
6468 	/**
6469 	 * EVENT_DFS_PRE_CAC_EXPIRED - Notify that channel availability check
6470 	 * done previously (Pre-CAC) on the channel has expired. This would
6471 	 * normally be on a non-ETSI DFS regulatory domain. DFS state of the
6472 	 * channel will be moved from available to usable. A new CAC has to be
6473 	 * performed before start operating on this channel.
6474 	 */
6475 	EVENT_DFS_PRE_CAC_EXPIRED,
6476 
6477 	/**
6478 	 * EVENT_EXTERNAL_AUTH - This event interface is used by host drivers
6479 	 * that do not define separate commands for authentication and
6480 	 * association (~WPA_DRIVER_FLAGS_SME) but offload the 802.11
6481 	 * authentication to wpa_supplicant. This event carries all the
6482 	 * necessary information from the host driver for the authentication to
6483 	 * happen.
6484 	 */
6485 	EVENT_EXTERNAL_AUTH,
6486 
6487 	/**
6488 	 * EVENT_PORT_AUTHORIZED - Notification that a connection is authorized
6489 	 *
6490 	 * This event should be indicated when the driver completes the 4-way
6491 	 * handshake. This event should be preceded by an EVENT_ASSOC that
6492 	 * indicates the completion of IEEE 802.11 association.
6493 	 */
6494 	EVENT_PORT_AUTHORIZED,
6495 
6496 	/**
6497 	 * EVENT_STATION_OPMODE_CHANGED - Notify STA's HT/VHT operation mode
6498 	 * change event.
6499 	 */
6500 	EVENT_STATION_OPMODE_CHANGED,
6501 
6502 	/**
6503 	 * EVENT_INTERFACE_MAC_CHANGED - Notify that interface MAC changed
6504 	 *
6505 	 * This event is emitted when the MAC changes while the interface is
6506 	 * enabled. When an interface was disabled and becomes enabled, it
6507 	 * must be always assumed that the MAC possibly changed.
6508 	 */
6509 	EVENT_INTERFACE_MAC_CHANGED,
6510 
6511 	/**
6512 	 * EVENT_WDS_STA_INTERFACE_STATUS - Notify WDS STA interface status
6513 	 *
6514 	 * This event is emitted when an interface is added/removed for WDS STA.
6515 	 */
6516 	EVENT_WDS_STA_INTERFACE_STATUS,
6517 
6518 	/**
6519 	  * EVENT_UPDATE_DH - Notification of updated DH information
6520 	  */
6521 	EVENT_UPDATE_DH,
6522 
6523 	/**
6524 	 * EVENT_UNPROT_BEACON - Unprotected Beacon frame received
6525 	 *
6526 	 * This event should be called when a Beacon frame is dropped due to it
6527 	 * not being protected correctly. union wpa_event_data::unprot_beacon
6528 	 * is required to provide more details of the frame.
6529 	 */
6530 	EVENT_UNPROT_BEACON,
6531 
6532 	/**
6533 	 * EVENT_TX_WAIT_EXPIRE - TX wait timed out
6534 	 *
6535 	 * This event is used to indicate when the driver has completed
6536 	 * wait for a response frame based on a TX request that specified a
6537 	 * non-zero wait time and that has not been explicitly cancelled.
6538 	 */
6539 	EVENT_TX_WAIT_EXPIRE,
6540 
6541 	/**
6542 	  * EVENT_BSS_COLOR_COLLISION - Notification of a BSS color collision
6543 	  */
6544 	EVENT_BSS_COLOR_COLLISION,
6545 
6546 	/**
6547 	 * EVENT_CCA_STARTED_NOTIFY - Notification that CCA has started
6548 	 */
6549 	EVENT_CCA_STARTED_NOTIFY,
6550 
6551 	/**
6552 	 * EVENT_CCA_ABORTED_NOTIFY - Notification that CCA has aborted
6553 	 */
6554 	EVENT_CCA_ABORTED_NOTIFY,
6555 
6556 	/**
6557 	 * EVENT_CCA_NOTIFY - Notification that CCA has completed
6558 	 */
6559 	EVENT_CCA_NOTIFY,
6560 
6561 	/**
6562 	 * EVENT_PASN_AUTH - This event is used by the driver that requests
6563 	 * PASN authentication and secure ranging context for multiple peers.
6564 	 */
6565 	EVENT_PASN_AUTH,
6566 
6567 	/**
6568 	 * EVENT_LINK_CH_SWITCH - MLD AP link decided to switch channels
6569 	 *
6570 	 * Described in wpa_event_data.ch_switch.
6571 	 *
6572 	 */
6573 	EVENT_LINK_CH_SWITCH,
6574 
6575 	/**
6576 	 * EVENT_LINK_CH_SWITCH_STARTED - MLD AP link started to switch channels
6577 	 *
6578 	 * This is a pre-switch event indicating the shortly following switch
6579 	 * of operating channels.
6580 	 *
6581 	 * Described in wpa_event_data.ch_switch.
6582 	 */
6583 	EVENT_LINK_CH_SWITCH_STARTED,
6584 
6585 	/**
6586 	 * EVENT_TID_LINK_MAP - MLD event to set TID-to-link mapping
6587 	 *
6588 	 * This event is used by the driver to indicate the received TID-to-link
6589 	 * mapping response from the associated AP MLD.
6590 	 *
6591 	 * Described in wpa_event_data.t2l_map_info.
6592 	 */
6593 	EVENT_TID_LINK_MAP,
6594 
6595 	/**
6596 	 * EVENT_LINK_RECONFIG - Notification that AP links removed
6597 	 */
6598 	EVENT_LINK_RECONFIG,
6599 
6600 	/**
6601 	 * EVENT_MLD_INTERFACE_FREED - Notification of AP MLD interface removal
6602 	 */
6603 	EVENT_MLD_INTERFACE_FREED,
6604 
6605 	/**
6606 	 * EVENT_SETUP_LINK_RECONFIG - Notification that new AP links added
6607 	 */
6608 	EVENT_SETUP_LINK_RECONFIG,
6609 
6610 	/**
6611 	 * EVENT_NAN_CLUSTER_JOIN - Notification of a new cluster having been
6612 	 * joined or started.
6613 	 *
6614 	 * This event is used to notify wpa_supplicant that a NAN cluster has
6615 	 * been joined or started. The event data includes the NAN cluster ID
6616 	 * and a boolean indicating whether a new cluster was started or an
6617 	 * existing cluster was joined.
6618 	 *
6619 	 * Described in wpa_event_data.nan_cluster_join_info.
6620 	 */
6621 	EVENT_NAN_CLUSTER_JOIN,
6622 
6623 	/**
6624 	 * EVENT_NAN_NEXT_DW - Notification of NAN next Discovery Window
6625 	 *
6626 	 * This event is used to notify wpa_supplicant that the device/driver
6627 	 * is ready for the next Discovery Window (DW) frames. It may be used
6628 	 * to trigger transmission of multicast SDFs (active subscribe and
6629 	 * unsolicited publish).
6630 	 * The event data includes the DW frequency.
6631 	 */
6632 	EVENT_NAN_NEXT_DW,
6633 
6634 	/**
6635 	 * EVENT_INCUMBT_SIG_INTF_DETECTED - Notification of incumbent signal
6636 	 * interference detection.
6637 	 */
6638 	EVENT_INCUMBT_SIG_INTF_DETECTED,
6639 
6640 	/**
6641 	 * EVENT_NAN_SCHED_UPDATE_DONE - NAN schedule update completed
6642 	 *
6643 	 * This event is used to notify wpa_supplicant that a NAN schedule
6644 	 * update has been completed by the driver/firmware.
6645 	 */
6646 	EVENT_NAN_SCHED_UPDATE_DONE,
6647 
6648 	/**
6649 	 * EVENT_NAN_ULW_UPDATE - NAN ULW blob update
6650 	 *
6651 	 * This event is used to notify wpa_supplicant that the device ULW blob
6652 	 * has changed and can be attached to outgoing NAN frames.
6653 	 */
6654 	EVENT_NAN_ULW_UPDATE,
6655 
6656 	/**
6657 	 * EVENT_NAN_CHAN_EVACUATION - Notification of NAN channel evacuation
6658 	 *
6659 	 * This event is used to notify wpa_supplicant that the device/driver
6660 	 * evacuated one of the channels used for NAN operation, e.g., due to
6661 	 * resource constraints (not enough resources to support NAN and other
6662 	 * activities).
6663 	 */
6664 	EVENT_NAN_CHAN_EVACUATION,
6665 
6666 	/**
6667 	 * EVENT_PEER_MEASUREMENT_RESULT - Ranging measurement result
6668 	 *
6669 	 * This event is used to indicate a ranging measurement result.
6670 	 */
6671 	EVENT_PEER_MEASUREMENT_RESULT,
6672 
6673 	/**
6674 	 * EVENT_PEER_MEASUREMENT_COMPLETE - Ranging session fully done
6675 	 *
6676 	 * This event is used to notify that the entire peer
6677 	 * measurement session identified by the cookie has ended.
6678 	 */
6679 	EVENT_PEER_MEASUREMENT_COMPLETE,
6680 };
6681 
6682 
6683 /**
6684  * struct freq_survey - Channel survey info
6685  *
6686  * @ifidx: Interface index in which this survey was observed
6687  * @freq: Center of frequency of the surveyed channel
6688  * @nf: Channel noise floor in dBm
6689  * @channel_time: Amount of time in ms the radio spent on the channel
6690  * @channel_time_busy: Amount of time in ms the radio detected some signal
6691  *     that indicated to the radio the channel was not clear
6692  * @channel_time_rx: Amount of time the radio spent receiving data
6693  * @channel_time_tx: Amount of time the radio spent transmitting data
6694  * @filled: bitmask indicating which fields have been reported, see
6695  *     SURVEY_HAS_* defines.
6696  * @list: Internal list pointers
6697  */
6698 struct freq_survey {
6699 	u32 ifidx;
6700 	unsigned int freq;
6701 	s8 nf;
6702 	u64 channel_time;
6703 	u64 channel_time_busy;
6704 	u64 channel_time_rx;
6705 	u64 channel_time_tx;
6706 	unsigned int filled;
6707 	struct dl_list list;
6708 };
6709 
6710 #define SURVEY_HAS_NF BIT(0)
6711 #define SURVEY_HAS_CHAN_TIME BIT(1)
6712 #define SURVEY_HAS_CHAN_TIME_BUSY BIT(2)
6713 #define SURVEY_HAS_CHAN_TIME_RX BIT(3)
6714 #define SURVEY_HAS_CHAN_TIME_TX BIT(4)
6715 
6716 /**
6717  * enum sta_connect_fail_reason_codes - STA connect failure reason code values
6718  * @STA_CONNECT_FAIL_REASON_UNSPECIFIED: No reason code specified for
6719  *	connection failure.
6720  * @STA_CONNECT_FAIL_REASON_NO_BSS_FOUND: No Probe Response frame received
6721  *	for unicast Probe Request frame.
6722  * @STA_CONNECT_FAIL_REASON_AUTH_TX_FAIL: STA failed to send auth request.
6723  * @STA_CONNECT_FAIL_REASON_AUTH_NO_ACK_RECEIVED: AP didn't send ACK for
6724  *	auth request.
6725  * @STA_CONNECT_FAIL_REASON_AUTH_NO_RESP_RECEIVED: Auth response is not
6726  *	received from AP.
6727  * @STA_CONNECT_FAIL_REASON_ASSOC_REQ_TX_FAIL: STA failed to send
6728  *	Association Request frame.
6729  * @STA_CONNECT_FAIL_REASON_ASSOC_NO_ACK_RECEIVED: AP didn't send ACK for
6730  *	Association Request frame.
6731  * @STA_CONNECT_FAIL_REASON_ASSOC_NO_RESP_RECEIVED: Association Response
6732  *	frame is not received from AP.
6733  */
6734 enum sta_connect_fail_reason_codes {
6735 	STA_CONNECT_FAIL_REASON_UNSPECIFIED = 0,
6736 	STA_CONNECT_FAIL_REASON_NO_BSS_FOUND = 1,
6737 	STA_CONNECT_FAIL_REASON_AUTH_TX_FAIL = 2,
6738 	STA_CONNECT_FAIL_REASON_AUTH_NO_ACK_RECEIVED = 3,
6739 	STA_CONNECT_FAIL_REASON_AUTH_NO_RESP_RECEIVED = 4,
6740 	STA_CONNECT_FAIL_REASON_ASSOC_REQ_TX_FAIL = 5,
6741 	STA_CONNECT_FAIL_REASON_ASSOC_NO_ACK_RECEIVED = 6,
6742 	STA_CONNECT_FAIL_REASON_ASSOC_NO_RESP_RECEIVED = 7,
6743 };
6744 
6745 /**
6746  * union wpa_event_data - Additional data for wpa_supplicant_event() calls
6747  */
6748 union wpa_event_data {
6749 	/**
6750 	 * struct assoc_info - Data for EVENT_ASSOC and EVENT_ASSOCINFO events
6751 	 *
6752 	 * This structure is optional for EVENT_ASSOC calls and required for
6753 	 * EVENT_ASSOCINFO calls. By using EVENT_ASSOC with this data, the
6754 	 * driver interface does not need to generate separate EVENT_ASSOCINFO
6755 	 * calls.
6756 	 */
6757 	struct assoc_info {
6758 		/**
6759 		 * reassoc - Flag to indicate association or reassociation
6760 		 */
6761 		int reassoc;
6762 
6763 		/**
6764 		 * req_ies - (Re)Association Request IEs
6765 		 *
6766 		 * If the driver generates WPA/RSN IE, this event data must be
6767 		 * returned for WPA handshake to have needed information. If
6768 		 * wpa_supplicant-generated WPA/RSN IE is used, this
6769 		 * information event is optional.
6770 		 *
6771 		 * This should start with the first IE (fixed fields before IEs
6772 		 * are not included).
6773 		 */
6774 		const u8 *req_ies;
6775 
6776 		/**
6777 		 * req_ies_len - Length of req_ies in bytes
6778 		 */
6779 		size_t req_ies_len;
6780 
6781 		/**
6782 		 * resp_ies - (Re)Association Response IEs
6783 		 *
6784 		 * Optional association data from the driver. This data is not
6785 		 * required WPA, but may be useful for some protocols and as
6786 		 * such, should be reported if this is available to the driver
6787 		 * interface.
6788 		 *
6789 		 * This should start with the first IE (fixed fields before IEs
6790 		 * are not included).
6791 		 */
6792 		const u8 *resp_ies;
6793 
6794 		/**
6795 		 * resp_ies_len - Length of resp_ies in bytes
6796 		 */
6797 		size_t resp_ies_len;
6798 
6799 		/**
6800 		 * resp_frame - (Re)Association Response frame
6801 		 */
6802 		const u8 *resp_frame;
6803 
6804 		/**
6805 		 * resp_frame_len - (Re)Association Response frame length
6806 		 */
6807 		size_t resp_frame_len;
6808 
6809 		/**
6810 		 * beacon_ies - Beacon or Probe Response IEs
6811 		 *
6812 		 * Optional Beacon/ProbeResp data: IEs included in Beacon or
6813 		 * Probe Response frames from the current AP (i.e., the one
6814 		 * that the client just associated with). This information is
6815 		 * used to update WPA/RSN IE for the AP. If this field is not
6816 		 * set, the results from previous scan will be used. If no
6817 		 * data for the new AP is found, scan results will be requested
6818 		 * again (without scan request). At this point, the driver is
6819 		 * expected to provide WPA/RSN IE for the AP (if WPA/WPA2 is
6820 		 * used).
6821 		 *
6822 		 * This should start with the first IE (fixed fields before IEs
6823 		 * are not included).
6824 		 */
6825 		const u8 *beacon_ies;
6826 
6827 		/**
6828 		 * beacon_ies_len - Length of beacon_ies */
6829 		size_t beacon_ies_len;
6830 
6831 		/**
6832 		 * freq - Frequency of the operational channel in MHz
6833 		 */
6834 		unsigned int freq;
6835 
6836 		/**
6837 		 * wmm_params - WMM parameters used in this association.
6838 		 */
6839 		struct wmm_params wmm_params;
6840 
6841 		/**
6842 		 * addr - Station address (for AP mode)
6843 		 */
6844 		const u8 *addr;
6845 
6846 		/**
6847 		 * The following is the key management offload information
6848 		 * @authorized
6849 		 * @key_replay_ctr
6850 		 * @key_replay_ctr_len
6851 		 * @ptk_kck
6852 		 * @ptk_kek_len
6853 		 * @ptk_kek
6854 		 * @ptk_kek_len
6855 		 */
6856 
6857 		/**
6858 		 * authorized - Status of key management offload,
6859 		 * 1 = successful
6860 		 */
6861 		int authorized;
6862 
6863 		/**
6864 		 * key_replay_ctr - Key replay counter value last used
6865 		 * in a valid EAPOL-Key frame
6866 		 */
6867 		const u8 *key_replay_ctr;
6868 
6869 		/**
6870 		 * key_replay_ctr_len - The length of key_replay_ctr
6871 		 */
6872 		size_t key_replay_ctr_len;
6873 
6874 		/**
6875 		 * ptk_kck - The derived PTK KCK
6876 		 */
6877 		const u8 *ptk_kck;
6878 
6879 		/**
6880 		 * ptk_kek_len - The length of ptk_kck
6881 		 */
6882 		size_t ptk_kck_len;
6883 
6884 		/**
6885 		 * ptk_kek - The derived PTK KEK
6886 		 * This is used in key management offload and also in FILS SK
6887 		 * offload.
6888 		 */
6889 		const u8 *ptk_kek;
6890 
6891 		/**
6892 		 * ptk_kek_len - The length of ptk_kek
6893 		 */
6894 		size_t ptk_kek_len;
6895 
6896 		/**
6897 		 * subnet_status - The subnet status:
6898 		 * 0 = unknown, 1 = unchanged, 2 = changed
6899 		 */
6900 		u8 subnet_status;
6901 
6902 		/**
6903 		 * The following information is used in FILS SK offload
6904 		 * @fils_erp_next_seq_num
6905 		 * @fils_pmk
6906 		 * @fils_pmk_len
6907 		 * @fils_pmkid
6908 		 */
6909 
6910 		/**
6911 		 * fils_erp_next_seq_num - The next sequence number to use in
6912 		 * FILS ERP messages
6913 		 */
6914 		u16 fils_erp_next_seq_num;
6915 
6916 		/**
6917 		 * fils_pmk - A new PMK if generated in case of FILS
6918 		 * authentication
6919 		 */
6920 		const u8 *fils_pmk;
6921 
6922 		/**
6923 		 * fils_pmk_len - Length of fils_pmk
6924 		 */
6925 		size_t fils_pmk_len;
6926 
6927 		/**
6928 		 * fils_pmkid - PMKID used or generated in FILS authentication
6929 		 */
6930 		const u8 *fils_pmkid;
6931 
6932 		/**
6933 		 * link_addr - Link address of the STA
6934 		 */
6935 		const u8 *link_addr;
6936 
6937 		/**
6938 		 * assoc_link_id - Association link id of the MLO association or
6939 		 *	-1 if MLO is not used
6940 		 */
6941 		int assoc_link_id;
6942 
6943 		/**
6944 		 * assoc_encrypted - Indicate that the (Re)Association
6945 		 * Request/Response frames are transmitted encrypted over the
6946 		 * air.
6947 		 */
6948 		bool assoc_encrypted;
6949 	} assoc_info;
6950 
6951 	/**
6952 	 * struct disassoc_info - Data for EVENT_DISASSOC events
6953 	 */
6954 	struct disassoc_info {
6955 		/**
6956 		 * addr - Station address (for AP mode)
6957 		 */
6958 		const u8 *addr;
6959 
6960 		/**
6961 		 * reason_code - Reason Code (host byte order) used in
6962 		 *	Deauthentication frame
6963 		 */
6964 		u16 reason_code;
6965 
6966 		/**
6967 		 * ie - Optional IE(s) in Disassociation frame
6968 		 */
6969 		const u8 *ie;
6970 
6971 		/**
6972 		 * ie_len - Length of ie buffer in octets
6973 		 */
6974 		size_t ie_len;
6975 
6976 		/**
6977 		 * locally_generated - Whether the frame was locally generated
6978 		 */
6979 		int locally_generated;
6980 	} disassoc_info;
6981 
6982 	/**
6983 	 * struct deauth_info - Data for EVENT_DEAUTH events
6984 	 */
6985 	struct deauth_info {
6986 		/**
6987 		 * addr - Station address (for AP mode)
6988 		 */
6989 		const u8 *addr;
6990 
6991 		/**
6992 		 * reason_code - Reason Code (host byte order) used in
6993 		 *	Deauthentication frame
6994 		 */
6995 		u16 reason_code;
6996 
6997 		/**
6998 		 * ie - Optional IE(s) in Deauthentication frame
6999 		 */
7000 		const u8 *ie;
7001 
7002 		/**
7003 		 * ie_len - Length of ie buffer in octets
7004 		 */
7005 		size_t ie_len;
7006 
7007 		/**
7008 		 * locally_generated - Whether the frame was locally generated
7009 		 */
7010 		int locally_generated;
7011 	} deauth_info;
7012 
7013 	/**
7014 	 * struct michael_mic_failure - Data for EVENT_MICHAEL_MIC_FAILURE
7015 	 */
7016 	struct michael_mic_failure {
7017 		int unicast;
7018 		const u8 *src;
7019 	} michael_mic_failure;
7020 
7021 	/**
7022 	 * struct interface_status - Data for EVENT_INTERFACE_STATUS
7023 	 */
7024 	struct interface_status {
7025 		unsigned int ifindex;
7026 		char ifname[100];
7027 		enum {
7028 			EVENT_INTERFACE_ADDED, EVENT_INTERFACE_REMOVED
7029 		} ievent;
7030 	} interface_status;
7031 
7032 	/**
7033 	 * struct pmkid_candidate - Data for EVENT_PMKID_CANDIDATE
7034 	 */
7035 	struct pmkid_candidate {
7036 		/** BSSID of the PMKID candidate */
7037 		u8 bssid[ETH_ALEN];
7038 		/** Smaller the index, higher the priority */
7039 		int index;
7040 		/** Whether RSN IE includes pre-authenticate flag */
7041 		int preauth;
7042 	} pmkid_candidate;
7043 
7044 	/**
7045 	 * struct tdls - Data for EVENT_TDLS
7046 	 */
7047 	struct tdls {
7048 		u8 peer[ETH_ALEN];
7049 		enum {
7050 			TDLS_REQUEST_SETUP,
7051 			TDLS_REQUEST_TEARDOWN,
7052 			TDLS_REQUEST_DISCOVER,
7053 		} oper;
7054 		u16 reason_code; /* for teardown */
7055 	} tdls;
7056 
7057 	/**
7058 	 * struct wnm - Data for EVENT_WNM
7059 	 */
7060 	struct wnm {
7061 		u8 addr[ETH_ALEN];
7062 		enum {
7063 			WNM_OPER_SLEEP,
7064 		} oper;
7065 		enum {
7066 			WNM_SLEEP_ENTER,
7067 			WNM_SLEEP_EXIT
7068 		} sleep_action;
7069 		int sleep_intval;
7070 		u16 reason_code;
7071 		u8 *buf;
7072 		u16 buf_len;
7073 	} wnm;
7074 
7075 	/**
7076 	 * struct ft_ies - FT information elements (EVENT_FT_RESPONSE)
7077 	 *
7078 	 * During FT (IEEE 802.11r) authentication sequence, the driver is
7079 	 * expected to use this event to report received FT IEs (MDIE, FTIE,
7080 	 * RSN IE, TIE, possible resource request) to the supplicant. The FT
7081 	 * IEs for the next message will be delivered through the
7082 	 * struct wpa_driver_ops::update_ft_ies() callback.
7083 	 */
7084 	struct ft_ies {
7085 		const u8 *ies;
7086 		size_t ies_len;
7087 		int ft_action;
7088 		u8 target_ap[ETH_ALEN];
7089 		/** Optional IE(s), e.g., WMM TSPEC(s), for RIC-Request */
7090 		const u8 *ric_ies;
7091 		/** Length of ric_ies buffer in octets */
7092 		size_t ric_ies_len;
7093 	} ft_ies;
7094 
7095 	/**
7096 	 * struct ibss_rsn_start - Data for EVENT_IBSS_RSN_START
7097 	 */
7098 	struct ibss_rsn_start {
7099 		u8 peer[ETH_ALEN];
7100 	} ibss_rsn_start;
7101 
7102 	/**
7103 	 * struct auth_info - Data for EVENT_AUTH events
7104 	 */
7105 	struct auth_info {
7106 		u8 peer[ETH_ALEN];
7107 		u8 bssid[ETH_ALEN];
7108 		u16 auth_type;
7109 		u16 auth_transaction;
7110 		u16 status_code;
7111 		const u8 *ies;
7112 		size_t ies_len;
7113 		const u8 *frame_body;
7114 		size_t frame_body_len;
7115 	} auth;
7116 
7117 	/**
7118 	 * struct assoc_reject - Data for EVENT_ASSOC_REJECT events
7119 	 */
7120 	struct assoc_reject {
7121 		/**
7122 		 * bssid - BSSID of the AP that rejected association
7123 		 */
7124 		const u8 *bssid;
7125 
7126 		/**
7127 		 * resp_ies - (Re)Association Response IEs
7128 		 *
7129 		 * Optional association data from the driver. This data is not
7130 		 * required WPA, but may be useful for some protocols and as
7131 		 * such, should be reported if this is available to the driver
7132 		 * interface.
7133 		 *
7134 		 * This should start with the first IE (fixed fields before IEs
7135 		 * are not included).
7136 		 */
7137 		const u8 *resp_ies;
7138 
7139 		/**
7140 		 * resp_ies_len - Length of resp_ies in bytes
7141 		 */
7142 		size_t resp_ies_len;
7143 
7144 		/**
7145 		 * status_code - Status Code from (Re)association Response
7146 		 */
7147 		u16 status_code;
7148 
7149 		/**
7150 		 * timed_out - Whether failure is due to timeout (etc.) rather
7151 		 * than explicit rejection response from the AP.
7152 		 */
7153 		int timed_out;
7154 
7155 		/**
7156 		 * timeout_reason - Reason for the timeout
7157 		 */
7158 		const char *timeout_reason;
7159 
7160 		/**
7161 		 * fils_erp_next_seq_num - The next sequence number to use in
7162 		 * FILS ERP messages
7163 		 */
7164 		u16 fils_erp_next_seq_num;
7165 
7166 		/**
7167 		 * reason_code - Connection failure reason code from the driver
7168 		 */
7169 		enum sta_connect_fail_reason_codes reason_code;
7170 	} assoc_reject;
7171 
7172 	struct timeout_event {
7173 		u8 addr[ETH_ALEN];
7174 	} timeout_event;
7175 
7176 	/**
7177 	 * struct tx_status - Data for EVENT_TX_STATUS events
7178 	 */
7179 	struct tx_status {
7180 		u16 type;
7181 		u16 stype;
7182 		const u8 *dst;
7183 		const u8 *data;
7184 		size_t data_len;
7185 		int ack;
7186 		int link_id;
7187 	} tx_status;
7188 
7189 	/**
7190 	 * struct rx_from_unknown - Data for EVENT_RX_FROM_UNKNOWN events
7191 	 */
7192 	struct rx_from_unknown {
7193 		const u8 *bssid;
7194 		const u8 *addr;
7195 		int wds;
7196 		int link_id;
7197 	} rx_from_unknown;
7198 
7199 	/**
7200 	 * struct rx_mgmt - Data for EVENT_RX_MGMT events
7201 	 */
7202 	struct rx_mgmt {
7203 		const u8 *frame;
7204 		size_t frame_len;
7205 		u32 datarate;
7206 
7207 		/**
7208 		 * drv_priv - Pointer to store driver private BSS information
7209 		 *
7210 		 * If not set to NULL, this is used for comparison with
7211 		 * hostapd_data->drv_priv to determine which BSS should process
7212 		 * the frame.
7213 		 */
7214 		void *drv_priv;
7215 
7216 		/**
7217 		 * ctx - Pointer to store ctx of private BSS information
7218 		 *
7219 		 * If not set to NULL, this is used for forwarding the packet
7220 		 * to right link BSS of ML BSS.
7221 		 */
7222 		void *ctx;
7223 
7224 		/**
7225 		 * freq - Frequency (in MHz) on which the frame was received
7226 		 */
7227 		int freq;
7228 
7229 		/**
7230 		 * ssi_signal - Signal strength in dBm (or 0 if not available)
7231 		 */
7232 		int ssi_signal;
7233 
7234 		/**
7235 		 * link_id - MLO link on which the frame was received or -1 for
7236 		 * non MLD.
7237 		 */
7238 		int link_id;
7239 	} rx_mgmt;
7240 
7241 	/**
7242 	 * struct remain_on_channel - Data for EVENT_REMAIN_ON_CHANNEL events
7243 	 *
7244 	 * This is also used with EVENT_CANCEL_REMAIN_ON_CHANNEL events.
7245 	 */
7246 	struct remain_on_channel {
7247 		/**
7248 		 * freq - Channel frequency in MHz
7249 		 */
7250 		unsigned int freq;
7251 
7252 		/**
7253 		 * duration - Duration to remain on the channel in milliseconds
7254 		 */
7255 		unsigned int duration;
7256 	} remain_on_channel;
7257 
7258 	/**
7259 	 * struct scan_info - Optional data for EVENT_SCAN_RESULTS events
7260 	 * @aborted: Whether the scan was aborted
7261 	 * @freqs: Scanned frequencies in MHz (%NULL = all channels scanned)
7262 	 * @num_freqs: Number of entries in freqs array
7263 	 * @ssids: Scanned SSIDs (%NULL or zero-length SSID indicates wildcard
7264 	 *	SSID)
7265 	 * @num_ssids: Number of entries in ssids array
7266 	 * @external_scan: Whether the scan info is for an external scan
7267 	 * @nl_scan_event: 1 if the source of this scan event is a normal scan,
7268 	 * 	0 if the source of the scan event is a vendor scan
7269 	 * @scan_start_tsf: Time when the scan started in terms of TSF of the
7270 	 *	BSS that the interface that requested the scan is connected to
7271 	 *	(if available).
7272 	 * @scan_start_tsf_bssid: The BSSID according to which %scan_start_tsf
7273 	 *	is set.
7274 	 * @scan_cookie: Unique identification representing the corresponding
7275 	 *      scan request. 0 if no unique identification is available.
7276 	 */
7277 	struct scan_info {
7278 		int aborted;
7279 		const int *freqs;
7280 		size_t num_freqs;
7281 		struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS];
7282 		size_t num_ssids;
7283 		int external_scan;
7284 		int nl_scan_event;
7285 		u64 scan_start_tsf;
7286 		u8 scan_start_tsf_bssid[ETH_ALEN];
7287 		u64 scan_cookie;
7288 	} scan_info;
7289 
7290 	/**
7291 	 * struct rx_probe_req - Data for EVENT_RX_PROBE_REQ events
7292 	 */
7293 	struct rx_probe_req {
7294 		/**
7295 		 * sa - Source address of the received Probe Request frame
7296 		 */
7297 		const u8 *sa;
7298 
7299 		/**
7300 		 * da - Destination address of the received Probe Request frame
7301 		 *	or %NULL if not available
7302 		 */
7303 		const u8 *da;
7304 
7305 		/**
7306 		 * bssid - BSSID of the received Probe Request frame or %NULL
7307 		 *	if not available
7308 		 */
7309 		const u8 *bssid;
7310 
7311 		/**
7312 		 * ie - IEs from the Probe Request body
7313 		 */
7314 		const u8 *ie;
7315 
7316 		/**
7317 		 * ie_len - Length of ie buffer in octets
7318 		 */
7319 		size_t ie_len;
7320 
7321 		/**
7322 		 * signal - signal strength in dBm (or 0 if not available)
7323 		 */
7324 		int ssi_signal;
7325 	} rx_probe_req;
7326 
7327 	/**
7328 	 * struct new_sta - Data for EVENT_NEW_STA events
7329 	 */
7330 	struct new_sta {
7331 		const u8 *addr;
7332 	} new_sta;
7333 
7334 	/**
7335 	 * struct eapol_rx - Data for EVENT_EAPOL_RX events
7336 	 */
7337 	struct eapol_rx {
7338 		const u8 *src;
7339 		const u8 *data;
7340 		size_t data_len;
7341 		enum frame_encryption encrypted;
7342 		int link_id;
7343 	} eapol_rx;
7344 
7345 	/**
7346 	 * signal_change - Data for EVENT_SIGNAL_CHANGE events
7347 	 */
7348 	struct wpa_signal_info signal_change;
7349 
7350 	/**
7351 	 * struct best_channel - Data for EVENT_BEST_CHANNEL events
7352 	 * @freq_24: Best 2.4 GHz band channel frequency in MHz
7353 	 * @freq_5: Best 5 GHz band channel frequency in MHz
7354 	 * @freq_overall: Best channel frequency in MHz
7355 	 *
7356 	 * 0 can be used to indicate no preference in either band.
7357 	 */
7358 	struct best_channel {
7359 		int freq_24;
7360 		int freq_5;
7361 		int freq_overall;
7362 	} best_chan;
7363 
7364 	struct unprot_deauth {
7365 		const u8 *sa;
7366 		const u8 *da;
7367 		u16 reason_code;
7368 	} unprot_deauth;
7369 
7370 	struct unprot_disassoc {
7371 		const u8 *sa;
7372 		const u8 *da;
7373 		u16 reason_code;
7374 	} unprot_disassoc;
7375 
7376 	/**
7377 	 * struct low_ack - Data for EVENT_STATION_LOW_ACK events
7378 	 * @addr: station address
7379 	 * @num_packets: Number of packets lost (consecutive packets not
7380 	 * acknowledged)
7381 	 */
7382 	struct low_ack {
7383 		u8 addr[ETH_ALEN];
7384 		u32 num_packets;
7385 	} low_ack;
7386 
7387 	/**
7388 	 * struct ibss_peer_lost - Data for EVENT_IBSS_PEER_LOST
7389 	 */
7390 	struct ibss_peer_lost {
7391 		u8 peer[ETH_ALEN];
7392 	} ibss_peer_lost;
7393 
7394 	/**
7395 	 * struct driver_gtk_rekey - Data for EVENT_DRIVER_GTK_REKEY
7396 	 */
7397 	struct driver_gtk_rekey {
7398 		const u8 *bssid;
7399 		const u8 *replay_ctr;
7400 	} driver_gtk_rekey;
7401 
7402 	/**
7403 	 * struct client_poll - Data for EVENT_DRIVER_CLIENT_POLL_OK events
7404 	 * @addr: station address
7405 	 */
7406 	struct client_poll {
7407 		u8 addr[ETH_ALEN];
7408 	} client_poll;
7409 
7410 	/**
7411 	 * struct eapol_tx_status
7412 	 * @dst: Original destination
7413 	 * @data: Data starting with IEEE 802.1X header (!)
7414 	 * @data_len: Length of data
7415 	 * @ack: Indicates ack or lost frame
7416 	 * @link_id: MLD link id used to transmit the frame or -1 for non MLO
7417 	 *
7418 	 * This corresponds to hapd_send_eapol if the frame sent
7419 	 * there isn't just reported as EVENT_TX_STATUS.
7420 	 */
7421 	struct eapol_tx_status {
7422 		const u8 *dst;
7423 		const u8 *data;
7424 		int data_len;
7425 		int ack;
7426 		int link_id;
7427 	} eapol_tx_status;
7428 
7429 	/**
7430 	 * struct ch_switch
7431 	 * @freq: Frequency of new channel in MHz
7432 	 * @ht_enabled: Whether this is an HT channel
7433 	 * @ch_offset: Secondary channel offset
7434 	 * @ch_width: Channel width
7435 	 * @cf1: Center frequency 1
7436 	 * @cf2: Center frequency 2
7437 	 * @link_id: Link ID of the MLO link
7438 	 * @punct_bitmap: Puncturing bitmap
7439 	 */
7440 	struct ch_switch {
7441 		int freq;
7442 		int ht_enabled;
7443 		int ch_offset;
7444 		enum chan_width ch_width;
7445 		int cf1;
7446 		int cf2;
7447 		int link_id;
7448 		u16 punct_bitmap;
7449 	} ch_switch;
7450 
7451 	/**
7452 	 * struct connect_failed - Data for EVENT_CONNECT_FAILED_REASON
7453 	 * @addr: Remote client address
7454 	 * @code: Reason code for connection failure
7455 	 */
7456 	struct connect_failed_reason {
7457 		u8 addr[ETH_ALEN];
7458 		enum {
7459 			MAX_CLIENT_REACHED,
7460 			BLOCKED_CLIENT
7461 		} code;
7462 	} connect_failed_reason;
7463 
7464 	/**
7465 	 * struct dfs_event - Data for radar detected events
7466 	 * @freq: Frequency of the channel in MHz
7467 	 * @link_id: If >= 0, Link ID of the MLO link
7468 	 */
7469 	struct dfs_event {
7470 		int freq;
7471 		int ht_enabled;
7472 		int chan_offset;
7473 		enum chan_width chan_width;
7474 		int cf1;
7475 		int cf2;
7476 		int link_id;
7477 	} dfs_event;
7478 
7479 	/**
7480 	 * survey_results - Survey result data for EVENT_SURVEY
7481 	 * @freq_filter: Requested frequency survey filter, 0 if request
7482 	 *	was for all survey data
7483 	 * @survey_list: Linked list of survey data (struct freq_survey)
7484 	 */
7485 	struct survey_results {
7486 		unsigned int freq_filter;
7487 		struct dl_list survey_list; /* struct freq_survey */
7488 	} survey_results;
7489 
7490 	/**
7491 	 * channel_list_changed - Data for EVENT_CHANNEL_LIST_CHANGED
7492 	 * @initiator: Initiator of the regulatory change
7493 	 * @type: Regulatory change type
7494 	 * @alpha2: Country code (or "" if not available)
7495 	 * @beacon_hint_before: Data for frequency attributes before beacon hint
7496 	 *	event if initiator == REGDOM_BEACON_HINT
7497 	 * @beacon_hint_after: Data for frequency attributes after beacon hint
7498 	 *	event if initiator == REGDOM_BEACON_HINT
7499 	 */
7500 	struct channel_list_changed {
7501 		enum reg_change_initiator initiator;
7502 		enum reg_type type;
7503 		char alpha2[3];
7504 		struct frequency_attrs {
7505 			unsigned int freq;
7506 			unsigned int max_tx_power;
7507 			bool disabled;
7508 			bool no_ir;
7509 			bool radar;
7510 		} beacon_hint_before, beacon_hint_after;
7511 	} channel_list_changed;
7512 
7513 	/**
7514 	 * freq_range - List of frequency ranges
7515 	 *
7516 	 * This is used as the data with EVENT_AVOID_FREQUENCIES.
7517 	 */
7518 	struct wpa_freq_range_list freq_range;
7519 
7520 	/**
7521 	 * struct mesh_peer
7522 	 *
7523 	 * @peer: Peer address
7524 	 * @ies: Beacon IEs
7525 	 * @ie_len: Length of @ies
7526 	 *
7527 	 * Notification of new candidate mesh peer.
7528 	 */
7529 	struct mesh_peer {
7530 		const u8 *peer;
7531 		const u8 *ies;
7532 		size_t ie_len;
7533 	} mesh_peer;
7534 
7535 	/**
7536 	 * struct acs_selected_channels - Data for EVENT_ACS_CHANNEL_SELECTED
7537 	 * @pri_freq: Selected primary frequency
7538 	 * @sec_freq: Selected secondary frequency
7539 	 * @edmg_channel: Selected EDMG channel
7540 	 * @vht_seg0_center_ch: VHT mode Segment0 center channel
7541 	 *	The value is the index of the channel center frequency for
7542 	 *	20 MHz, 40 MHz, and 80 MHz channels. The value is the center
7543 	 *	frequency index of the primary 80 MHz segment for 160 MHz and
7544 	 *	80+80 MHz channels.
7545 	 * @vht_seg1_center_ch: VHT mode Segment1 center channel
7546 	 *	The value is zero for 20 MHz, 40 MHz, and 80 MHz channels. The
7547 	 *	value is the index of the channel center frequency for 160 MHz
7548 	 *	channels and the center frequency index of the secondary 80 MHz
7549 	 *	segment for 80+80 MHz channels.
7550 	 * @ch_width: Selected Channel width by driver. Driver may choose to
7551 	 *	change hostapd configured ACS channel width due driver internal
7552 	 *	channel restrictions.
7553 	 * @hw_mode: Selected band (used with hw_mode=any)
7554 	 * @puncture_bitmap: Indicate the puncturing channels
7555 	 * @link_id: Indicate the link id if operating as AP MLD; -1 otherwise
7556 	 */
7557 	struct acs_selected_channels {
7558 		unsigned int pri_freq;
7559 		unsigned int sec_freq;
7560 		u8 edmg_channel;
7561 		u8 vht_seg0_center_ch;
7562 		u8 vht_seg1_center_ch;
7563 		u16 ch_width;
7564 		enum hostapd_hw_mode hw_mode;
7565 		u16 puncture_bitmap;
7566 		int link_id;
7567 	} acs_selected_channels;
7568 
7569 	/**
7570 	 * struct p2p_lo_stop - Reason code for P2P Listen offload stop event
7571 	 * @reason_code: Reason for stopping offload
7572 	 *	P2P_LO_STOPPED_REASON_COMPLETE: Listen offload finished as
7573 	 *	scheduled.
7574 	 *	P2P_LO_STOPPED_REASON_RECV_STOP_CMD: Host requested offload to
7575 	 *	be stopped.
7576 	 *	P2P_LO_STOPPED_REASON_INVALID_PARAM: Invalid listen offload
7577 	 *	parameters.
7578 	 *	P2P_LO_STOPPED_REASON_NOT_SUPPORTED: Listen offload not
7579 	 *	supported by device.
7580 	 */
7581 	struct p2p_lo_stop {
7582 		enum {
7583 			P2P_LO_STOPPED_REASON_COMPLETE = 0,
7584 			P2P_LO_STOPPED_REASON_RECV_STOP_CMD,
7585 			P2P_LO_STOPPED_REASON_INVALID_PARAM,
7586 			P2P_LO_STOPPED_REASON_NOT_SUPPORTED,
7587 		} reason_code;
7588 	} p2p_lo_stop;
7589 
7590 	/* For EVENT_EXTERNAL_AUTH */
7591 	struct external_auth external_auth;
7592 
7593 	/**
7594 	 * struct sta_opmode - Station's operation mode change event
7595 	 * @addr: The station MAC address
7596 	 * @smps_mode: SMPS mode of the station
7597 	 * @chan_width: Channel width of the station
7598 	 * @rx_nss: RX_NSS of the station
7599 	 *
7600 	 * This is used as data with EVENT_STATION_OPMODE_CHANGED.
7601 	 */
7602 	struct sta_opmode {
7603 		const u8 *addr;
7604 		enum smps_mode smps_mode;
7605 		enum chan_width chan_width;
7606 		u8 rx_nss;
7607 	} sta_opmode;
7608 
7609 	/**
7610 	 * struct wds_sta_interface - Data for EVENT_WDS_STA_INTERFACE_STATUS.
7611 	 */
7612 	struct wds_sta_interface {
7613 		const u8 *sta_addr;
7614 		const char *ifname;
7615 		enum {
7616 			INTERFACE_ADDED,
7617 			INTERFACE_REMOVED
7618 		} istatus;
7619 	} wds_sta_interface;
7620 
7621 	/**
7622 	 * struct update_dh - Data for EVENT_UPDATE_DH
7623 	 */
7624 	struct update_dh {
7625 		const u8 *peer;
7626 		const u8 *ie;
7627 		size_t ie_len;
7628 		int assoc_link_id;
7629 		const u8 *link_addr;
7630 	} update_dh;
7631 
7632 	/**
7633 	 * struct unprot_beacon - Data for EVENT_UNPROT_BEACON
7634 	 */
7635 	struct unprot_beacon {
7636 		const u8 *sa;
7637 	} unprot_beacon;
7638 
7639 	/**
7640 	 * struct bss_color_collision - Data for EVENT_BSS_COLOR_COLLISION
7641 	 */
7642 	struct bss_color_collision {
7643 		u64 bitmap;
7644 		int link_id;
7645 	} bss_color_collision;
7646 
7647 	/**
7648 	 * struct pasn_auth - Data for EVENT_PASN_AUTH
7649 	 */
7650 	struct pasn_auth pasn_auth;
7651 
7652 	/**
7653 	 * struct port_authorized - Data for EVENT_PORT_AUTHORIZED
7654 	 * @td_bitmap: For STA mode, transition disable bitmap, if received in
7655 	 *	EAPOL-Key msg 3/4
7656 	 * @td_bitmap_len: For STA mode, length of td_bitmap
7657 	 * @sta_addr: For AP mode, the MAC address of the associated STA
7658 	 *
7659 	 * This event is used to indicate that the port is authorized and
7660 	 * open for normal data in STA and AP modes when 4-way handshake is
7661 	 * offloaded to the driver.
7662 	 */
7663 	struct port_authorized {
7664 		const u8 *td_bitmap;
7665 		size_t td_bitmap_len;
7666 		const u8 *sta_addr;
7667 	} port_authorized;
7668 
7669 	/**
7670 	 * struct tid_link_map_info - Data for EVENT_TID_LINK_MAP
7671 	 */
7672 	struct tid_link_map_info {
7673 		bool default_map;
7674 		u8 valid_links;
7675 		struct t2lm_mapping t2lmap[MAX_NUM_MLD_LINKS];
7676 	} t2l_map_info;
7677 
7678 	/**
7679 	 * struct reconfig_info - Data for EVENT_SETUP_LINK_RECONFIG
7680 	 */
7681 	struct reconfig_info {
7682 		u16 added_links;
7683 		u8 count;
7684 		const u8 *status_list;
7685 		const u8 *resp_ie; /* Starting from Group Key Data */
7686 		size_t resp_ie_len;
7687 	} reconfig_info;
7688 
7689 	struct nan_cluster_join_info {
7690 		const u8 *bssid;
7691 		bool new_cluster;
7692 	} nan_cluster_join_info;
7693 
7694 	struct nan_next_dw_info {
7695 		int freq;
7696 	} nan_next_dw_info;
7697 
7698 	/**
7699 	 * Data for EVENT_INCUMBT_SIG_INTF
7700 	 */
7701 	struct incumbt_sig_intf_event {
7702 		int freq;
7703 		enum chan_width chan_width;
7704 		int cf1;
7705 		int cf2;
7706 		u32 chan_bw_interference_bitmap;
7707 		int link_id;
7708 	} incumbt_sig_intf_event;
7709 
7710 	/**
7711 	 * struct nan_sched_update_done_info - Data for EVENT_NAN_SCHED_UPDATE_DONE
7712 	 * @success: Indicates whether the NAN schedule update was successful
7713 	 */
7714 	struct nan_sched_update_done_info {
7715 		bool success;
7716 	} nan_sched_update_done_info;
7717 
7718 	/**
7719 	 * struct nan_ulw_update_info - Data for EVENT_NAN_ULW_UPDATE
7720 	 * @ulw: Pointer to ULW blob data, containing one or more Unaligned
7721 	 *	Schedule attributes as defined in the Wi-Fi Aware spec v4.0,
7722 	 *	Table 109 (Unaligned Schedule attribute format), including
7723 	 *	attribute header for each attribute.
7724 	 * @ulw_len: ULW blob length in bytes
7725 	 */
7726 	struct nan_ulw_update_info {
7727 		const u8 *ulw;
7728 		size_t ulw_len;
7729 	} nan_ulw_update_info;
7730 
7731 	/**
7732 	 * struct nan_chan_evacuation_info - Data for EVENT_NAN_CHAN_EVACUATION
7733 	 * @freq: Control frequency of the evacuated channel in MHz
7734 	 */
7735 	struct nan_chan_evacuation_info {
7736 		int freq;
7737 	} nan_chan_evacuation_info;
7738 
7739 	/**
7740 	 * struct peer_measurement_result - Ranging measurement result for
7741 	 * EVENT_PEER_MEASUREMENT_RESULT
7742 	 */
7743 	struct peer_measurement_result {
7744 		u8 addr[ETH_ALEN];
7745 		u32 status;
7746 		u64 host_time;
7747 		u64 ap_tsf;
7748 		bool final;
7749 		u64 cookie;
7750 
7751 		/**
7752 		 * struct peer_measurement_ftm_result -
7753 		 * FTM-specific measurement results
7754 		 */
7755 		struct peer_measurement_ftm_result {
7756 			bool fail;
7757 			u32 fail_reason;
7758 			u32 burst_index;
7759 			u32 num_ftmr_attempts;
7760 			u32 num_ftmr_successes;
7761 			u32 busy_retry_time;
7762 			u32 num_bursts_exp;
7763 			u32 burst_duration;
7764 			u32 ftms_per_burst;
7765 			s32 rssi_avg;
7766 			s32 rssi_spread;
7767 			s64 rtt_avg;
7768 			u64 rtt_variance;
7769 			u64 rtt_spread;
7770 			s64 dist_avg;
7771 			u64 dist_variance;
7772 			u64 dist_spread;
7773 			const u8 *lci;
7774 			size_t lci_len;
7775 			const u8 *civicloc;
7776 			size_t civicloc_len;
7777 			/* Additional FTM parameters */
7778 			u32 burst_period;
7779 			u32 tx_ltf_repetition_count;
7780 			u32 rx_ltf_repetition_count;
7781 			u32 max_time_between_measurements;
7782 			u32 min_time_between_measurements;
7783 			u32 num_tx_spatial_streams;
7784 			u32 num_rx_spatial_streams;
7785 			u32 nominal_time;
7786 			u8 availability_window;
7787 			u32 band_width;
7788 			u32 preamble;
7789 			bool is_delayed_lmr;
7790 			/* Flag indicating if FTM data is present */
7791 			bool has_data;
7792 		} ftm;
7793 
7794 	} peer_measurement_result;
7795 
7796 	/**
7797 	 * struct peer_measurement_complete - Ranging session complete for
7798 	 * EVENT_PEER_MEASUREMENT_COMPLETE
7799 	 */
7800 	struct peer_measurement_complete {
7801 		u64 cookie;
7802 	} peer_measurement_complete;
7803 };
7804 
7805 /**
7806  * wpa_supplicant_event - Report a driver event for wpa_supplicant
7807  * @ctx: Context pointer (wpa_s); this is the ctx variable registered
7808  *	with struct wpa_driver_ops::init()
7809  * @event: event type (defined above)
7810  * @data: possible extra data for the event
7811  *
7812  * Driver wrapper code should call this function whenever an event is received
7813  * from the driver.
7814  */
7815 void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
7816 			  union wpa_event_data *data);
7817 
7818 /**
7819  * wpa_supplicant_event_global - Report a driver event for wpa_supplicant
7820  * @ctx: Context pointer (wpa_s); this is the ctx variable registered
7821  *	with struct wpa_driver_ops::init()
7822  * @event: event type (defined above)
7823  * @data: possible extra data for the event
7824  *
7825  * Same as wpa_supplicant_event(), but we search for the interface in
7826  * wpa_global.
7827  */
7828 void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
7829 				 union wpa_event_data *data);
7830 
7831 /*
7832  * The following inline functions are provided for convenience to simplify
7833  * event indication for some of the common events.
7834  */
7835 
drv_event_assoc(void * ctx,const u8 * addr,const u8 * req_ies,size_t req_ielen,const u8 * resp_ies,size_t resp_ielen,const u8 * link_addr,int assoc_link_id,int reassoc)7836 static inline void drv_event_assoc(void *ctx, const u8 *addr, const u8 *req_ies,
7837 				   size_t req_ielen, const u8 *resp_ies,
7838 				   size_t resp_ielen, const u8 *link_addr,
7839 				   int assoc_link_id, int reassoc)
7840 {
7841 	union wpa_event_data event;
7842 	os_memset(&event, 0, sizeof(event));
7843 	event.assoc_info.reassoc = reassoc;
7844 	event.assoc_info.req_ies = req_ies;
7845 	event.assoc_info.req_ies_len = req_ielen;
7846 	event.assoc_info.resp_ies = resp_ies;
7847 	event.assoc_info.resp_ies_len = resp_ielen;
7848 	event.assoc_info.addr = addr;
7849 	event.assoc_info.link_addr = link_addr;
7850 	event.assoc_info.assoc_link_id = assoc_link_id;
7851 	wpa_supplicant_event(ctx, EVENT_ASSOC, &event);
7852 }
7853 
drv_event_disassoc(void * ctx,const u8 * addr)7854 static inline void drv_event_disassoc(void *ctx, const u8 *addr)
7855 {
7856 	union wpa_event_data event;
7857 	os_memset(&event, 0, sizeof(event));
7858 	event.disassoc_info.addr = addr;
7859 	wpa_supplicant_event(ctx, EVENT_DISASSOC, &event);
7860 }
7861 
drv_event_eapol_rx(void * ctx,const u8 * src,const u8 * data,size_t data_len)7862 static inline void drv_event_eapol_rx(void *ctx, const u8 *src, const u8 *data,
7863 				      size_t data_len)
7864 {
7865 	union wpa_event_data event;
7866 	os_memset(&event, 0, sizeof(event));
7867 	event.eapol_rx.src = src;
7868 	event.eapol_rx.data = data;
7869 	event.eapol_rx.data_len = data_len;
7870 	event.eapol_rx.encrypted = FRAME_ENCRYPTION_UNKNOWN;
7871 	event.eapol_rx.link_id = -1;
7872 	wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event);
7873 }
7874 
drv_event_eapol_rx2(void * ctx,const u8 * src,const u8 * data,size_t data_len,enum frame_encryption encrypted,int link_id)7875 static inline void drv_event_eapol_rx2(void *ctx, const u8 *src, const u8 *data,
7876 				       size_t data_len,
7877 				       enum frame_encryption encrypted,
7878 				       int link_id)
7879 {
7880 	union wpa_event_data event;
7881 	os_memset(&event, 0, sizeof(event));
7882 	event.eapol_rx.src = src;
7883 	event.eapol_rx.data = data;
7884 	event.eapol_rx.data_len = data_len;
7885 	event.eapol_rx.encrypted = encrypted;
7886 	event.eapol_rx.link_id = link_id;
7887 	wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event);
7888 }
7889 
7890 /* driver_common.c */
7891 void wpa_scan_results_free(struct wpa_scan_results *res);
7892 
7893 /* Convert wpa_event_type to a string for logging */
7894 const char * event_to_string(enum wpa_event_type event);
7895 
7896 /* Convert chan_width to a string for logging and control interfaces */
7897 const char * channel_width_to_string(enum chan_width width);
7898 
7899 int channel_width_to_int(enum chan_width width);
7900 
7901 int ht_supported(const struct hostapd_hw_modes *mode);
7902 int vht_supported(const struct hostapd_hw_modes *mode);
7903 bool he_supported(const struct hostapd_hw_modes *hw_mode,
7904 		  enum ieee80211_op_mode op_mode);
7905 bool eht_supported(const struct hostapd_hw_modes *hw_mode,
7906 		   enum ieee80211_op_mode op_mode);
7907 
7908 struct wowlan_triggers *
7909 wpa_get_wowlan_triggers(const char *wowlan_triggers,
7910 			const struct wpa_driver_capa *capa);
7911 /* Convert driver flag to string */
7912 const char * driver_flag_to_string(u64 flag);
7913 const char * driver_flag2_to_string(u64 flag2);
7914 
7915 /* NULL terminated array of linked in driver wrappers */
7916 extern const struct wpa_driver_ops *const wpa_drivers[];
7917 
7918 
7919 /* Available drivers */
7920 
7921 #ifdef CONFIG_DRIVER_WEXT
7922 extern const struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */
7923 #endif /* CONFIG_DRIVER_WEXT */
7924 #ifdef CONFIG_DRIVER_NL80211
7925 /* driver_nl80211.c */
7926 extern const struct wpa_driver_ops wpa_driver_nl80211_ops;
7927 #endif /* CONFIG_DRIVER_NL80211 */
7928 #ifdef CONFIG_DRIVER_BSD
7929 extern const struct wpa_driver_ops wpa_driver_bsd_ops; /* driver_bsd.c */
7930 #endif /* CONFIG_DRIVER_BSD */
7931 #ifdef CONFIG_DRIVER_OPENBSD
7932 /* driver_openbsd.c */
7933 extern const struct wpa_driver_ops wpa_driver_openbsd_ops;
7934 #endif /* CONFIG_DRIVER_OPENBSD */
7935 #ifdef CONFIG_DRIVER_NDIS
7936 extern struct wpa_driver_ops wpa_driver_ndis_ops; /* driver_ndis.c */
7937 #endif /* CONFIG_DRIVER_NDIS */
7938 #ifdef CONFIG_DRIVER_WIRED
7939 extern const struct wpa_driver_ops wpa_driver_wired_ops; /* driver_wired.c */
7940 #endif /* CONFIG_DRIVER_WIRED */
7941 #ifdef CONFIG_DRIVER_MACSEC_QCA
7942 /* driver_macsec_qca.c */
7943 extern const struct wpa_driver_ops wpa_driver_macsec_qca_ops;
7944 #endif /* CONFIG_DRIVER_MACSEC_QCA */
7945 #ifdef CONFIG_DRIVER_MACSEC_LINUX
7946 /* driver_macsec_linux.c */
7947 extern const struct wpa_driver_ops wpa_driver_macsec_linux_ops;
7948 #endif /* CONFIG_DRIVER_MACSEC_LINUX */
7949 #ifdef CONFIG_DRIVER_ROBOSWITCH
7950 /* driver_roboswitch.c */
7951 extern const struct wpa_driver_ops wpa_driver_roboswitch_ops;
7952 #endif /* CONFIG_DRIVER_ROBOSWITCH */
7953 #ifdef CONFIG_DRIVER_NONE
7954 extern const struct wpa_driver_ops wpa_driver_none_ops; /* driver_none.c */
7955 #endif /* CONFIG_DRIVER_NONE */
7956 
7957 #endif /* DRIVER_H */
7958