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