Coverage Report

Created: 2026-03-19 06:13

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