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