blob: a55e8e35777101feb25be22b62a494f9c71cb727 [file] [log] [blame]
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001/*
2 * Driver interface definition
Paul Stewart092955c2017-02-06 09:13:09 -08003 * Copyright (c) 2003-2017, Jouni Malinen <j@w1.fi>
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004 *
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08005 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007 *
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"
Dmitry Shmidt9d9e6022015-04-23 10:34:55 -070023#include "common/ieee802_11_defs.h"
Dmitry Shmidtd2986c22017-10-23 14:22:09 -070024#include "common/wpa_common.h"
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -080025#ifdef CONFIG_MACSEC
26#include "pae/ieee802_1x_kay.h"
27#endif /* CONFIG_MACSEC */
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -070028#include "utils/list.h"
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070029
30#define HOSTAPD_CHAN_DISABLED 0x00000001
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -080031#define HOSTAPD_CHAN_NO_IR 0x00000002
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070032#define HOSTAPD_CHAN_RADAR 0x00000008
33#define HOSTAPD_CHAN_HT40PLUS 0x00000010
34#define HOSTAPD_CHAN_HT40MINUS 0x00000020
35#define HOSTAPD_CHAN_HT40 0x00000040
Dmitry Shmidt391c59f2013-09-03 12:16:28 -070036#define HOSTAPD_CHAN_SURVEY_LIST_INITIALIZED 0x00000080
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070037
Dmitry Shmidtea69e842013-05-13 14:52:28 -070038#define HOSTAPD_CHAN_DFS_UNKNOWN 0x00000000
39#define HOSTAPD_CHAN_DFS_USABLE 0x00000100
40#define HOSTAPD_CHAN_DFS_UNAVAILABLE 0x00000200
41#define HOSTAPD_CHAN_DFS_AVAILABLE 0x00000300
42#define HOSTAPD_CHAN_DFS_MASK 0x00000300
43
Sunil Ravi036cec52023-03-29 11:35:17 -070044#define HOSTAPD_CHAN_VHT_80MHZ_SUBCHANNEL 0x00000800
45#define HOSTAPD_CHAN_VHT_160MHZ_SUBCHANNEL 0x00001000
Dmitry Shmidt68d0e3e2013-10-28 17:59:21 -070046
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -080047#define HOSTAPD_CHAN_INDOOR_ONLY 0x00010000
48#define HOSTAPD_CHAN_GO_CONCURRENT 0x00020000
49
Hai Shalom74f70d42019-02-11 14:42:39 -080050/* Allowed bandwidth mask */
51enum hostapd_chan_width_attr {
52 HOSTAPD_CHAN_WIDTH_10 = BIT(0),
53 HOSTAPD_CHAN_WIDTH_20 = BIT(1),
54 HOSTAPD_CHAN_WIDTH_40P = BIT(2),
55 HOSTAPD_CHAN_WIDTH_40M = BIT(3),
56 HOSTAPD_CHAN_WIDTH_80 = BIT(4),
57 HOSTAPD_CHAN_WIDTH_160 = BIT(5),
Sunil8cd6f4d2022-06-28 18:40:46 +000058 HOSTAPD_CHAN_WIDTH_320 = BIT(6),
Hai Shalom74f70d42019-02-11 14:42:39 -080059};
60
Dmitry Shmidt849734c2016-05-27 09:59:01 -070061/* Filter gratuitous ARP */
62#define WPA_DATA_FRAME_FILTER_FLAG_ARP BIT(0)
63/* Filter unsolicited Neighbor Advertisement */
64#define WPA_DATA_FRAME_FILTER_FLAG_NA BIT(1)
65/* Filter unicast IP packets encrypted using the GTK */
66#define WPA_DATA_FRAME_FILTER_FLAG_GTK BIT(2)
67
Dmitry Shmidtd2986c22017-10-23 14:22:09 -070068#define HOSTAPD_DFS_REGION_FCC 1
69#define HOSTAPD_DFS_REGION_ETSI 2
70#define HOSTAPD_DFS_REGION_JP 3
71
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -080072/**
73 * enum reg_change_initiator - Regulatory change initiator
74 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -080075enum reg_change_initiator {
76 REGDOM_SET_BY_CORE,
77 REGDOM_SET_BY_USER,
78 REGDOM_SET_BY_DRIVER,
79 REGDOM_SET_BY_COUNTRY_IE,
Dmitry Shmidt97672262014-02-03 13:02:54 -080080 REGDOM_BEACON_HINT,
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -080081};
82
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -080083/**
84 * enum reg_type - Regulatory change types
85 */
Dmitry Shmidt7dba0e52014-04-14 10:49:15 -070086enum reg_type {
87 REGDOM_TYPE_UNKNOWN,
88 REGDOM_TYPE_COUNTRY,
89 REGDOM_TYPE_WORLD,
90 REGDOM_TYPE_CUSTOM_WORLD,
91 REGDOM_TYPE_INTERSECTION,
92};
93
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070094/**
Hai Shalom81f62d82019-07-22 12:10:00 -070095 * struct hostapd_wmm_rule - WMM regulatory rule
96 * @min_cwmin: Lower bound of CW_min value
97 * @min_cwmax: Lower bound of CW_max value
98 * @min_aifs: Lower bound of AIFS value
99 * @max_txop: Upper bound of TXOP, value in units of 32 usec
100 */
101struct hostapd_wmm_rule {
102 int min_cwmin;
103 int min_cwmax;
104 int min_aifs;
105 int max_txop;
106};
107
108/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700109 * struct hostapd_channel_data - Channel information
110 */
111struct hostapd_channel_data {
112 /**
113 * chan - Channel number (IEEE 802.11)
114 */
115 short chan;
116
117 /**
118 * freq - Frequency in MHz
119 */
Dmitry Shmidtd5e49232012-12-03 15:08:10 -0800120 int freq;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700121
122 /**
123 * flag - Channel flags (HOSTAPD_CHAN_*)
124 */
125 int flag;
126
127 /**
Hai Shalom74f70d42019-02-11 14:42:39 -0800128 * allowed_bw - Allowed channel width bitmask
129 *
130 * See enum hostapd_chan_width_attr.
131 */
132 u32 allowed_bw;
133
134 /**
Dmitry Shmidt68d0e3e2013-10-28 17:59:21 -0700135 * max_tx_power - Regulatory transmit power limit in dBm
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700136 */
137 u8 max_tx_power;
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -0700138
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800139 /**
140 * survey_list - Linked list of surveys (struct freq_survey)
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -0700141 */
142 struct dl_list survey_list;
143
144 /**
145 * min_nf - Minimum observed noise floor, in dBm, based on all
146 * surveyed channel data
147 */
148 s8 min_nf;
Dmitry Shmidt391c59f2013-09-03 12:16:28 -0700149
150#ifdef CONFIG_ACS
151 /**
152 * interference_factor - Computed interference factor on this
153 * channel (used internally in src/ap/acs.c; driver wrappers do not
154 * need to set this)
155 */
156 long double interference_factor;
157#endif /* CONFIG_ACS */
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -0700158
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800159 /**
160 * dfs_cac_ms - DFS CAC time in milliseconds
161 */
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -0700162 unsigned int dfs_cac_ms;
Hai Shalom81f62d82019-07-22 12:10:00 -0700163
164 /**
165 * wmm_rules_valid - Indicates wmm_rules state
166 */
167 int wmm_rules_valid;
168
169 /**
170 * wmm_rules - WMM regulatory rules
171 */
172 struct hostapd_wmm_rule wmm_rules[WMM_AC_NUM];
Sunil Ravi036cec52023-03-29 11:35:17 -0700173
174 /**
175 * punct_bitmap - RU puncturing bitmap
176 */
177 u16 punct_bitmap;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700178};
179
Hai Shalomfdcde762020-04-02 11:19:20 -0700180#define HE_MAC_CAPAB_0 0
Hai Shalom81f62d82019-07-22 12:10:00 -0700181#define HE_MAX_MAC_CAPAB_SIZE 6
182#define HE_MAX_PHY_CAPAB_SIZE 11
183#define HE_MAX_MCS_CAPAB_SIZE 12
184#define HE_MAX_PPET_CAPAB_SIZE 25
Dmitry Shmidtebd93af2017-02-21 13:40:44 -0800185
186/**
187 * struct he_capabilities - IEEE 802.11ax HE capabilities
188 */
189struct he_capabilities {
190 u8 he_supported;
Hai Shalom81f62d82019-07-22 12:10:00 -0700191 u8 phy_cap[HE_MAX_PHY_CAPAB_SIZE];
192 u8 mac_cap[HE_MAX_MAC_CAPAB_SIZE];
193 u8 mcs[HE_MAX_MCS_CAPAB_SIZE];
194 u8 ppet[HE_MAX_PPET_CAPAB_SIZE];
Hai Shalom899fcc72020-10-19 14:38:18 -0700195 u16 he_6ghz_capa;
Dmitry Shmidtebd93af2017-02-21 13:40:44 -0800196};
197
Sunil Ravia04bd252022-05-02 22:54:18 -0700198/* struct eht_capabilities - IEEE 802.11be EHT capabilities */
199struct eht_capabilities {
200 bool eht_supported;
201 u16 mac_cap;
202 u8 phy_cap[EHT_PHY_CAPAB_LEN];
203 u8 mcs[EHT_MCS_NSS_CAPAB_LEN];
204 u8 ppet[EHT_PPE_THRESH_CAPAB_LEN];
205};
206
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800207#define HOSTAPD_MODE_FLAG_HT_INFO_KNOWN BIT(0)
Dmitry Shmidtc2ebb4b2013-07-24 12:57:51 -0700208#define HOSTAPD_MODE_FLAG_VHT_INFO_KNOWN BIT(1)
Sunil Ravi77d572f2023-01-17 23:58:31 +0000209#define HOSTAPD_MODE_FLAG_HE_INFO_KNOWN BIT(2)
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800210
Hai Shalom81f62d82019-07-22 12:10:00 -0700211
212enum ieee80211_op_mode {
213 IEEE80211_MODE_INFRA = 0,
214 IEEE80211_MODE_IBSS = 1,
215 IEEE80211_MODE_AP = 2,
216 IEEE80211_MODE_MESH = 5,
217
218 /* only add new entries before IEEE80211_MODE_NUM */
219 IEEE80211_MODE_NUM
220};
221
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700222/**
Hai Shalomc3565922019-10-28 11:58:20 -0700223 * struct ieee80211_edmg_config - EDMG configuration
224 *
225 * This structure describes most essential parameters needed
226 * for IEEE 802.11ay EDMG configuration
227 *
228 * @channels: Bitmap that indicates the 2.16 GHz channel(s)
229 * that are allowed to be used for transmissions.
230 * Bit 0 indicates channel 1, bit 1 indicates channel 2, etc.
231 * Set to 0 to indicate EDMG not supported.
232 * @bw_config: Channel BW Configuration subfield encodes
233 * the allowed channel bandwidth configurations
234 */
235struct ieee80211_edmg_config {
236 u8 channels;
237 enum edmg_bw_config bw_config;
238};
239
240/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700241 * struct hostapd_hw_modes - Supported hardware mode information
242 */
243struct hostapd_hw_modes {
244 /**
245 * mode - Hardware mode
246 */
247 enum hostapd_hw_mode mode;
248
249 /**
250 * num_channels - Number of entries in the channels array
251 */
252 int num_channels;
253
254 /**
255 * channels - Array of supported channels
256 */
257 struct hostapd_channel_data *channels;
258
259 /**
260 * num_rates - Number of entries in the rates array
261 */
262 int num_rates;
263
264 /**
265 * rates - Array of supported rates in 100 kbps units
266 */
267 int *rates;
268
269 /**
270 * ht_capab - HT (IEEE 802.11n) capabilities
271 */
272 u16 ht_capab;
273
274 /**
275 * mcs_set - MCS (IEEE 802.11n) rate parameters
276 */
277 u8 mcs_set[16];
278
279 /**
280 * a_mpdu_params - A-MPDU (IEEE 802.11n) parameters
281 */
282 u8 a_mpdu_params;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800283
Dmitry Shmidt04949592012-07-19 12:16:46 -0700284 /**
285 * vht_capab - VHT (IEEE 802.11ac) capabilities
286 */
287 u32 vht_capab;
288
289 /**
290 * vht_mcs_set - VHT MCS (IEEE 802.11ac) rate parameters
291 */
292 u8 vht_mcs_set[8];
293
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800294 unsigned int flags; /* HOSTAPD_MODE_FLAG_* */
Dmitry Shmidtebd93af2017-02-21 13:40:44 -0800295
296 /**
297 * he_capab - HE (IEEE 802.11ax) capabilities
298 */
Hai Shalom81f62d82019-07-22 12:10:00 -0700299 struct he_capabilities he_capab[IEEE80211_MODE_NUM];
Hai Shalomc3565922019-10-28 11:58:20 -0700300
301 /**
302 * This structure describes the most essential parameters needed
303 * for IEEE 802.11ay EDMG configuration.
304 */
305 struct ieee80211_edmg_config edmg;
Sunil Ravia04bd252022-05-02 22:54:18 -0700306
307 /**
308 * eht_capab - EHT (IEEE 802.11be) capabilities
309 */
310 struct eht_capabilities eht_capab[IEEE80211_MODE_NUM];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700311};
312
313
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700314#define IEEE80211_CAP_ESS 0x0001
315#define IEEE80211_CAP_IBSS 0x0002
316#define IEEE80211_CAP_PRIVACY 0x0010
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800317#define IEEE80211_CAP_RRM 0x1000
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700318
Dmitry Shmidtf8623282013-02-20 14:34:59 -0800319/* DMG (60 GHz) IEEE 802.11ad */
320/* type - bits 0..1 */
321#define IEEE80211_CAP_DMG_MASK 0x0003
322#define IEEE80211_CAP_DMG_IBSS 0x0001 /* Tx by: STA */
323#define IEEE80211_CAP_DMG_PBSS 0x0002 /* Tx by: PCP */
324#define IEEE80211_CAP_DMG_AP 0x0003 /* Tx by: AP */
325
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700326#define WPA_SCAN_QUAL_INVALID BIT(0)
327#define WPA_SCAN_NOISE_INVALID BIT(1)
328#define WPA_SCAN_LEVEL_INVALID BIT(2)
329#define WPA_SCAN_LEVEL_DBM BIT(3)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700330#define WPA_SCAN_ASSOCIATED BIT(5)
331
332/**
333 * struct wpa_scan_res - Scan result for an BSS/IBSS
334 * @flags: information flags about the BSS/IBSS (WPA_SCAN_*)
335 * @bssid: BSSID
336 * @freq: frequency of the channel in MHz (e.g., 2412 = channel 1)
Sunil Ravi2a14cf12023-11-21 00:54:38 +0000337 * @max_cw: the max channel width of the connection (calculated during scan
338 * result processing)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700339 * @beacon_int: beacon interval in TUs (host byte order)
340 * @caps: capability information field in host byte order
341 * @qual: signal quality
342 * @noise: noise level
343 * @level: signal level
344 * @tsf: Timestamp
345 * @age: Age of the information in milliseconds (i.e., how many milliseconds
346 * ago the last Beacon or Probe Response frame was received)
Dmitry Shmidt7f656022015-02-25 14:36:37 -0800347 * @est_throughput: Estimated throughput in kbps (this is calculated during
348 * scan result processing if left zero by the driver wrapper)
349 * @snr: Signal-to-noise ratio in dB (calculated during scan result processing)
Dmitry Shmidt29333592017-01-09 12:27:11 -0800350 * @parent_tsf: Time when the Beacon/Probe Response frame was received in terms
351 * of TSF of the BSS specified by %tsf_bssid.
352 * @tsf_bssid: The BSS that %parent_tsf TSF time refers to.
Sunil Ravia04bd252022-05-02 22:54:18 -0700353 * @beacon_newer: Whether the Beacon frame data is known to be newer
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700354 * @ie_len: length of the following IE field in octets
355 * @beacon_ie_len: length of the following Beacon IE field in octets
356 *
357 * This structure is used as a generic format for scan results from the
358 * driver. Each driver interface implementation is responsible for converting
359 * the driver or OS specific scan results into this format.
360 *
361 * If the driver does not support reporting all IEs, the IE data structure is
362 * constructed of the IEs that are available. This field will also need to
363 * include SSID in IE format. All drivers are encouraged to be extended to
364 * report all IEs to make it easier to support future additions.
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800365 *
366 * This structure data is followed by ie_len octets of IEs from Probe Response
367 * frame (or if the driver does not indicate source of IEs, these may also be
368 * from Beacon frame). After the first set of IEs, another set of IEs may follow
369 * (with beacon_ie_len octets of data) if the driver provides both IE sets.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700370 */
371struct wpa_scan_res {
372 unsigned int flags;
373 u8 bssid[ETH_ALEN];
374 int freq;
Sunil Ravi2a14cf12023-11-21 00:54:38 +0000375 enum chan_width max_cw;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700376 u16 beacon_int;
377 u16 caps;
378 int qual;
379 int noise;
380 int level;
381 u64 tsf;
382 unsigned int age;
Dmitry Shmidt7f656022015-02-25 14:36:37 -0800383 unsigned int est_throughput;
384 int snr;
Dmitry Shmidt29333592017-01-09 12:27:11 -0800385 u64 parent_tsf;
386 u8 tsf_bssid[ETH_ALEN];
Sunil Ravia04bd252022-05-02 22:54:18 -0700387 bool beacon_newer;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700388 size_t ie_len;
389 size_t beacon_ie_len;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800390 /* Followed by ie_len + beacon_ie_len octets of IE data */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700391};
392
393/**
394 * struct wpa_scan_results - Scan results
395 * @res: Array of pointers to allocated variable length scan result entries
396 * @num: Number of entries in the scan result array
Dmitry Shmidtf8623282013-02-20 14:34:59 -0800397 * @fetch_time: Time when the results were fetched from the driver
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700398 */
399struct wpa_scan_results {
400 struct wpa_scan_res **res;
401 size_t num;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -0800402 struct os_reltime fetch_time;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700403};
404
405/**
406 * struct wpa_interface_info - Network interface information
407 * @next: Pointer to the next interface or NULL if this is the last one
408 * @ifname: Interface name that can be used with init() or init2()
409 * @desc: Human readable adapter description (e.g., vendor/model) or NULL if
410 * not available
411 * @drv_name: struct wpa_driver_ops::name (note: unlike other strings, this one
412 * is not an allocated copy, i.e., get_interfaces() caller will not free
413 * this)
414 */
415struct wpa_interface_info {
416 struct wpa_interface_info *next;
417 char *ifname;
418 char *desc;
419 const char *drv_name;
420};
421
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800422#define WPAS_MAX_SCAN_SSIDS 16
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700423
424/**
Dmitry Shmidtb97e4282016-02-08 10:16:07 -0800425 * struct wpa_driver_scan_ssid - SSIDs to scan for
426 * @ssid - specific SSID to scan for (ProbeReq)
427 * %NULL or zero-length SSID is used to indicate active scan
428 * with wildcard SSID.
429 * @ssid_len - Length of the SSID in octets
430 */
431struct wpa_driver_scan_ssid {
432 const u8 *ssid;
433 size_t ssid_len;
434};
435
Sunil Ravi640215c2023-06-28 23:08:09 +0000436struct t2lm_mapping {
437 /**
438 * downlink - Bitmap of TIDs mapped with a link in downlink direction
439 */
440 u8 downlink;
441
442 /**
443 * uplink - Bitmap of TIDs mapped with a link in uplink direction
444 */
445 u8 uplink;
446};
447
Dmitry Shmidtb97e4282016-02-08 10:16:07 -0800448/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700449 * struct wpa_driver_scan_params - Scan parameters
450 * Data for struct wpa_driver_ops::scan2().
451 */
452struct wpa_driver_scan_params {
453 /**
454 * ssids - SSIDs to scan for
455 */
Dmitry Shmidtb97e4282016-02-08 10:16:07 -0800456 struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700457
458 /**
459 * num_ssids - Number of entries in ssids array
460 * Zero indicates a request for a passive scan.
461 */
462 size_t num_ssids;
463
464 /**
465 * extra_ies - Extra IE(s) to add into Probe Request or %NULL
466 */
467 const u8 *extra_ies;
468
469 /**
470 * extra_ies_len - Length of extra_ies in octets
471 */
472 size_t extra_ies_len;
473
474 /**
475 * freqs - Array of frequencies to scan or %NULL for all frequencies
476 *
477 * The frequency is set in MHz. The array is zero-terminated.
478 */
479 int *freqs;
480
481 /**
482 * filter_ssids - Filter for reporting SSIDs
483 *
484 * This optional parameter can be used to request the driver wrapper to
485 * filter scan results to include only the specified SSIDs. %NULL
486 * indicates that no filtering is to be done. This can be used to
487 * reduce memory needs for scan results in environments that have large
488 * number of APs with different SSIDs.
489 *
490 * The driver wrapper is allowed to take this allocated buffer into its
491 * own use by setting the pointer to %NULL. In that case, the driver
492 * wrapper is responsible for freeing the buffer with os_free() once it
493 * is not needed anymore.
494 */
495 struct wpa_driver_scan_filter {
Dmitry Shmidt9d9e6022015-04-23 10:34:55 -0700496 u8 ssid[SSID_MAX_LEN];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700497 size_t ssid_len;
498 } *filter_ssids;
499
500 /**
501 * num_filter_ssids - Number of entries in filter_ssids array
502 */
503 size_t num_filter_ssids;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800504
505 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -0700506 * filter_rssi - Filter by RSSI
507 *
508 * The driver may filter scan results in firmware to reduce host
509 * wakeups and thereby save power. Specify the RSSI threshold in s32
510 * dBm.
511 */
512 s32 filter_rssi;
513
514 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800515 * p2p_probe - Used to disable CCK (802.11b) rates for P2P probes
516 *
517 * When set, the driver is expected to remove rates 1, 2, 5.5, and 11
518 * Mbps from the support rates element(s) in the Probe Request frames
519 * and not to transmit the frames at any of those rates.
520 */
Dmitry Shmidt2271d3f2014-06-23 12:16:31 -0700521 unsigned int p2p_probe:1;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -0800522
523 /**
524 * only_new_results - Request driver to report only new results
525 *
526 * This is used to request the driver to report only BSSes that have
527 * been detected after this scan request has been started, i.e., to
528 * flush old cached BSS entries.
529 */
Dmitry Shmidt2271d3f2014-06-23 12:16:31 -0700530 unsigned int only_new_results:1;
531
532 /**
533 * low_priority - Requests driver to use a lower scan priority
534 *
535 * This is used to request the driver to use a lower scan priority
536 * if it supports such a thing.
537 */
538 unsigned int low_priority:1;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -0800539
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800540 /**
541 * mac_addr_rand - Requests driver to randomize MAC address
542 */
543 unsigned int mac_addr_rand:1;
544
545 /**
546 * mac_addr - MAC address used with randomization. The address cannot be
547 * a multicast one, i.e., bit 0 of byte 0 should not be set.
548 */
Hai Shalomc3565922019-10-28 11:58:20 -0700549 u8 *mac_addr;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800550
551 /**
552 * mac_addr_mask - MAC address mask used with randomization.
553 *
554 * Bits that are 0 in the mask should be randomized. Bits that are 1 in
555 * the mask should be taken as is from mac_addr. The mask should not
556 * allow the generation of a multicast address, i.e., bit 0 of byte 0
557 * must be set.
558 */
559 const u8 *mac_addr_mask;
560
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -0800561 /**
562 * sched_scan_plans - Scan plans for scheduled scan
563 *
564 * Each scan plan consists of the number of iterations to scan and the
565 * interval between scans. When a scan plan finishes (i.e., it was run
566 * for the specified number of iterations), the next scan plan is
567 * executed. The scan plans are executed in the order they appear in
568 * the array (lower index first). The last scan plan will run infinitely
569 * (until requested to stop), thus must not specify the number of
570 * iterations. All other scan plans must specify the number of
571 * iterations.
572 */
573 struct sched_scan_plan {
574 u32 interval; /* In seconds */
575 u32 iterations; /* Zero to run infinitely */
576 } *sched_scan_plans;
577
578 /**
579 * sched_scan_plans_num - Number of scan plans in sched_scan_plans array
580 */
581 unsigned int sched_scan_plans_num;
582
Dmitry Shmidt9c175262016-03-03 10:20:07 -0800583 /**
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700584 * sched_scan_start_delay - Delay to use before starting the first scan
585 *
586 * Delay (in seconds) before scheduling first scan plan cycle. The
587 * driver may ignore this parameter and start immediately (or at any
588 * other time), if this feature is not supported.
589 */
590 u32 sched_scan_start_delay;
591
592 /**
Dmitry Shmidt9c175262016-03-03 10:20:07 -0800593 * bssid - Specific BSSID to scan for
594 *
595 * This optional parameter can be used to replace the default wildcard
596 * BSSID with a specific BSSID to scan for if results are needed from
597 * only a single BSS.
598 */
599 const u8 *bssid;
600
Dmitry Shmidtabb90a32016-12-05 15:34:39 -0800601 /**
602 * scan_cookie - Unique identification representing the scan request
603 *
604 * This scan_cookie carries a unique identification representing the
605 * scan request if the host driver/kernel supports concurrent scan
606 * requests. This cookie is returned from the corresponding driver
607 * interface.
608 *
609 * Note: Unlike other parameters in this structure, scan_cookie is used
610 * only to return information instead of setting parameters for the
611 * scan.
612 */
613 u64 scan_cookie;
614
Dmitry Shmidt29333592017-01-09 12:27:11 -0800615 /**
616 * duration - Dwell time on each channel
617 *
618 * This optional parameter can be used to set the dwell time on each
619 * channel. In TUs.
620 */
621 u16 duration;
622
623 /**
624 * duration_mandatory - Whether the specified duration is mandatory
625 *
626 * If this is set, the duration specified by the %duration field is
627 * mandatory (and the driver should reject the scan request if it is
628 * unable to comply with the specified duration), otherwise it is the
629 * maximum duration and the actual duration may be shorter.
630 */
631 unsigned int duration_mandatory:1;
632
Dmitry Shmidtebd93af2017-02-21 13:40:44 -0800633 /**
634 * relative_rssi_set - Whether relative RSSI parameters are set
635 */
636 unsigned int relative_rssi_set:1;
637
638 /**
639 * relative_rssi - Relative RSSI for reporting better BSSs
640 *
641 * Amount of RSSI by which a BSS should be better than the current
642 * connected BSS to report the new BSS to user space.
643 */
644 s8 relative_rssi;
645
646 /**
647 * relative_adjust_band - Band to which RSSI should be adjusted
648 *
649 * The relative_adjust_rssi should be added to the band specified
650 * by relative_adjust_band.
651 */
652 enum set_band relative_adjust_band;
653
654 /**
655 * relative_adjust_rssi - RSSI to be added to relative_adjust_band
656 *
657 * An amount of relative_band_rssi should be added to the BSSs that
658 * belong to the band specified by relative_adjust_band while comparing
659 * with other bands for BSS reporting.
660 */
661 s8 relative_adjust_rssi;
662
Hai Shalomce48b4a2018-09-05 11:41:35 -0700663 /**
664 * oce_scan
665 *
666 * Enable the following OCE scan features: (WFA OCE TechSpec v1.0)
667 * - Accept broadcast Probe Response frame.
668 * - Probe Request frame deferral and suppression.
669 * - Max Channel Time - driver fills FILS request params IE with
670 * Maximum Channel Time.
671 * - Send 1st Probe Request frame in rate of minimum 5.5 Mbps.
672 */
673 unsigned int oce_scan:1;
674
Hai Shalomc1a21442022-02-04 13:43:00 -0800675 /**
676 * p2p_include_6ghz - Include 6 GHz channels for P2P full scan
677 *
678 */
679 unsigned int p2p_include_6ghz:1;
680
Sunil8cd6f4d2022-06-28 18:40:46 +0000681 /**
682 * non_coloc_6ghz - Force scanning of non-PSC 6 GHz channels
683 *
684 * If this is set, the driver should scan non-PSC channels from the
685 * scan request even if neighbor reports from 2.4/5 GHz APs did not
686 * report a co-located AP on these channels. The default is to scan
687 * non-PSC channels only if a co-located AP was reported on the channel.
688 */
689 unsigned int non_coloc_6ghz:1;
690
Sunil Ravi2a14cf12023-11-21 00:54:38 +0000691 /**
692 * min_probe_req_content - Minimize probe request content to only have
693 * minimal requirement elements, e.g., supported rates etc., and no
694 * additional elements other then those provided by user space.
695 */
696 unsigned int min_probe_req_content:1;
697
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -0800698 /*
699 * NOTE: Whenever adding new parameters here, please make sure
700 * wpa_scan_clone_params() and wpa_scan_free_params() get updated with
701 * matching changes.
702 */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700703};
704
705/**
706 * struct wpa_driver_auth_params - Authentication parameters
707 * Data for struct wpa_driver_ops::authenticate().
708 */
709struct wpa_driver_auth_params {
710 int freq;
711 const u8 *bssid;
712 const u8 *ssid;
713 size_t ssid_len;
714 int auth_alg;
715 const u8 *ie;
716 size_t ie_len;
717 const u8 *wep_key[4];
718 size_t wep_key_len[4];
719 int wep_tx_keyidx;
720 int local_state_change;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800721
722 /**
723 * p2p - Whether this connection is a P2P group
724 */
725 int p2p;
726
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800727 /**
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800728 * auth_data - Additional elements for Authentication frame
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800729 *
730 * This buffer starts with the Authentication transaction sequence
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800731 * number field. If no special handling of such elements is needed, this
732 * pointer is %NULL. This is used with SAE and FILS.
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800733 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800734 const u8 *auth_data;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800735
736 /**
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800737 * auth_data_len - Length of auth_data buffer in octets
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800738 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800739 size_t auth_data_len;
Sunil Ravi77d572f2023-01-17 23:58:31 +0000740
741 /**
742 * mld - Establish an MLD connection
743 */
744 bool mld;
745
746 /**
747 * mld_link_id - The link ID of the MLD AP to which we are associating
748 */
749 u8 mld_link_id;
750
751 /**
752 * The MLD AP address
753 */
754 const u8 *ap_mld_addr;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700755};
756
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800757/**
758 * enum wps_mode - WPS mode
759 */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700760enum wps_mode {
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800761 /**
762 * WPS_MODE_NONE - No WPS provisioning being used
763 */
764 WPS_MODE_NONE,
765
766 /**
767 * WPS_MODE_OPEN - WPS provisioning with AP that is in open mode
768 */
769 WPS_MODE_OPEN,
770
771 /**
772 * WPS_MODE_PRIVACY - WPS provisioning with AP that is using protection
773 */
774 WPS_MODE_PRIVACY
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700775};
776
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800777/**
778 * struct hostapd_freq_params - Channel parameters
779 */
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700780struct hostapd_freq_params {
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800781 /**
782 * mode - Mode/band (HOSTAPD_MODE_IEEE80211A, ..)
783 */
784 enum hostapd_hw_mode mode;
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700785
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800786 /**
787 * freq - Primary channel center frequency in MHz
788 */
789 int freq;
790
791 /**
792 * channel - Channel number
793 */
794 int channel;
795
796 /**
797 * ht_enabled - Whether HT is enabled
798 */
799 int ht_enabled;
800
801 /**
802 * sec_channel_offset - Secondary channel offset for HT40
803 *
804 * 0 = HT40 disabled,
805 * -1 = HT40 enabled, secondary channel below primary,
806 * 1 = HT40 enabled, secondary channel above primary
807 */
808 int sec_channel_offset;
809
810 /**
811 * vht_enabled - Whether VHT is enabled
812 */
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700813 int vht_enabled;
814
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800815 /**
Hai Shalom81f62d82019-07-22 12:10:00 -0700816 * he_enabled - Whether HE is enabled
817 */
818 int he_enabled;
819
820 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800821 * center_freq1 - Segment 0 center frequency in MHz
822 *
823 * Valid for both HT and VHT.
824 */
825 int center_freq1;
826
827 /**
828 * center_freq2 - Segment 1 center frequency in MHz
829 *
830 * Non-zero only for bandwidth 80 and an 80+80 channel
831 */
832 int center_freq2;
833
834 /**
835 * bandwidth - Channel bandwidth in MHz (20, 40, 80, 160)
836 */
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700837 int bandwidth;
Hai Shalomc3565922019-10-28 11:58:20 -0700838
839 /**
840 * This structure describes the most essential parameters needed
841 * for IEEE 802.11ay EDMG configuration.
842 */
843 struct ieee80211_edmg_config edmg;
Sunil Ravia04bd252022-05-02 22:54:18 -0700844
845 /**
846 * radar_background - Whether radar/CAC background is requested
847 */
848 bool radar_background;
849
850 /**
851 * eht_enabled - Whether EHT is enabled
852 */
853 bool eht_enabled;
Sunil Ravi2a14cf12023-11-21 00:54:38 +0000854
855 /**
856 * link_id: If >=0 indicates the link of the AP MLD to configure
857 */
858 int link_id;
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700859};
860
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700861/**
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700862 * struct wpa_driver_sta_auth_params - Authentication parameters
863 * Data for struct wpa_driver_ops::sta_auth().
864 */
865struct wpa_driver_sta_auth_params {
866
867 /**
868 * own_addr - Source address and BSSID for authentication frame
869 */
870 const u8 *own_addr;
871
872 /**
873 * addr - MAC address of the station to associate
874 */
875 const u8 *addr;
876
877 /**
878 * seq - authentication sequence number
879 */
880 u16 seq;
881
882 /**
883 * status - authentication response status code
884 */
885 u16 status;
886
887 /**
888 * ie - authentication frame ie buffer
889 */
890 const u8 *ie;
891
892 /**
893 * len - ie buffer length
894 */
895 size_t len;
896
897 /**
898 * fils_auth - Indicates whether FILS authentication is being performed
899 */
900 int fils_auth;
901
902 /**
903 * fils_anonce - ANonce (required for FILS)
904 */
905 u8 fils_anonce[WPA_NONCE_LEN];
906
907 /**
908 * fils_snonce - SNonce (required for FILS)
909 */
910 u8 fils_snonce[WPA_NONCE_LEN];
911
912 /**
913 * fils_kek - key for encryption (required for FILS)
914 */
915 u8 fils_kek[WPA_KEK_MAX_LEN];
916
917 /**
918 * fils_kek_len - Length of the fils_kek in octets (required for FILS)
919 */
920 size_t fils_kek_len;
921};
922
Sunil Ravi77d572f2023-01-17 23:58:31 +0000923struct wpa_driver_mld_params {
924 /**
925 * mld_addr - AP's MLD address
926 */
927 const u8 *mld_addr;
928
929 /**
930 * valid_links - The valid links including the association link
931 */
932 u16 valid_links;
933
934 /**
935 * assoc_link_id - The link on which the association is performed
936 */
937 u8 assoc_link_id;
938
939 /**
940 * mld_links - Link information
941 *
942 * Should include information on all the requested links for association
943 * including the link on which the association should take place.
944 * For the association link, the ies and ies_len should be NULL and
945 * 0 respectively.
946 */
947 struct {
948 int freq;
949 const u8 *bssid;
950 const u8 *ies;
951 size_t ies_len;
Sunil Ravib0ac25f2024-07-12 01:42:03 +0000952 int error;
953 bool disabled;
Sunil Ravi77d572f2023-01-17 23:58:31 +0000954 } mld_links[MAX_NUM_MLD_LINKS];
955};
956
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700957/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700958 * struct wpa_driver_associate_params - Association parameters
959 * Data for struct wpa_driver_ops::associate().
960 */
961struct wpa_driver_associate_params {
962 /**
963 * bssid - BSSID of the selected AP
964 * This can be %NULL, if ap_scan=2 mode is used and the driver is
965 * responsible for selecting with which BSS to associate. */
966 const u8 *bssid;
967
968 /**
Dmitry Shmidt96be6222014-02-13 10:16:51 -0800969 * bssid_hint - BSSID of a proposed AP
970 *
971 * This indicates which BSS has been found a suitable candidate for
972 * initial association for drivers that use driver/firmwate-based BSS
973 * selection. Unlike the @bssid parameter, @bssid_hint does not limit
974 * the driver from selecting other BSSes in the ESS.
975 */
976 const u8 *bssid_hint;
977
978 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700979 * ssid - The selected SSID
980 */
981 const u8 *ssid;
982
983 /**
984 * ssid_len - Length of the SSID (1..32)
985 */
986 size_t ssid_len;
987
988 /**
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700989 * freq - channel parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700990 */
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700991 struct hostapd_freq_params freq;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700992
993 /**
Dmitry Shmidt96be6222014-02-13 10:16:51 -0800994 * freq_hint - Frequency of the channel the proposed AP is using
995 *
996 * This provides a channel on which a suitable BSS has been found as a
997 * hint for the driver. Unlike the @freq parameter, @freq_hint does not
998 * limit the driver from selecting other channels for
999 * driver/firmware-based BSS selection.
1000 */
1001 int freq_hint;
1002
1003 /**
Dmitry Shmidt04949592012-07-19 12:16:46 -07001004 * bg_scan_period - Background scan period in seconds, 0 to disable
1005 * background scan, or -1 to indicate no change to default driver
1006 * configuration
1007 */
1008 int bg_scan_period;
1009
1010 /**
Dmitry Shmidt2ac5f602014-03-07 10:08:21 -08001011 * beacon_int - Beacon interval for IBSS or 0 to use driver default
1012 */
1013 int beacon_int;
1014
1015 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001016 * wpa_ie - WPA information element for (Re)Association Request
1017 * WPA information element to be included in (Re)Association
1018 * Request (including information element id and length). Use
1019 * of this WPA IE is optional. If the driver generates the WPA
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001020 * IE, it can use pairwise_suite, group_suite, group_mgmt_suite, and
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001021 * key_mgmt_suite to select proper algorithms. In this case,
1022 * the driver has to notify wpa_supplicant about the used WPA
1023 * IE by generating an event that the interface code will
1024 * convert into EVENT_ASSOCINFO data (see below).
1025 *
1026 * When using WPA2/IEEE 802.11i, wpa_ie is used for RSN IE
1027 * instead. The driver can determine which version is used by
1028 * looking at the first byte of the IE (0xdd for WPA, 0x30 for
1029 * WPA2/RSN).
1030 *
1031 * When using WPS, wpa_ie is used for WPS IE instead of WPA/RSN IE.
1032 */
1033 const u8 *wpa_ie;
1034
1035 /**
1036 * wpa_ie_len - length of the wpa_ie
1037 */
1038 size_t wpa_ie_len;
1039
1040 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001041 * wpa_proto - Bitfield of WPA_PROTO_* values to indicate WPA/WPA2
1042 */
1043 unsigned int wpa_proto;
1044
1045 /**
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001046 * pairwise_suite - Selected pairwise cipher suite (WPA_CIPHER_*)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001047 *
1048 * This is usually ignored if @wpa_ie is used.
1049 */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001050 unsigned int pairwise_suite;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001051
1052 /**
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001053 * group_suite - Selected group cipher suite (WPA_CIPHER_*)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001054 *
1055 * This is usually ignored if @wpa_ie is used.
1056 */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001057 unsigned int group_suite;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001058
1059 /**
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001060 * mgmt_group_suite - Selected group management cipher suite (WPA_CIPHER_*)
1061 *
1062 * This is usually ignored if @wpa_ie is used.
1063 */
1064 unsigned int mgmt_group_suite;
1065
1066 /**
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001067 * key_mgmt_suite - Selected key management suite (WPA_KEY_MGMT_*)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001068 *
1069 * This is usually ignored if @wpa_ie is used.
1070 */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001071 unsigned int key_mgmt_suite;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001072
1073 /**
Sunil Ravi89eba102022-09-13 21:04:37 -07001074 * allowed_key_mgmts - Bitfield of allowed key management suites
1075 * (WPA_KEY_MGMT_*) other than @key_mgmt_suite for the current
1076 * connection
1077 *
1078 * SME in the driver may choose key_mgmt from this list for the initial
1079 * connection or roaming. The driver which doesn't support this
1080 * ignores this parameter.
1081 */
1082 unsigned int allowed_key_mgmts;
1083
1084 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001085 * auth_alg - Allowed authentication algorithms
1086 * Bit field of WPA_AUTH_ALG_*
1087 */
1088 int auth_alg;
1089
1090 /**
1091 * mode - Operation mode (infra/ibss) IEEE80211_MODE_*
1092 */
1093 int mode;
1094
1095 /**
1096 * wep_key - WEP keys for static WEP configuration
1097 */
1098 const u8 *wep_key[4];
1099
1100 /**
1101 * wep_key_len - WEP key length for static WEP configuration
1102 */
1103 size_t wep_key_len[4];
1104
1105 /**
1106 * wep_tx_keyidx - WEP TX key index for static WEP configuration
1107 */
1108 int wep_tx_keyidx;
1109
1110 /**
1111 * mgmt_frame_protection - IEEE 802.11w management frame protection
1112 */
1113 enum mfp_options mgmt_frame_protection;
1114
1115 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001116 * passphrase - RSN passphrase for PSK
1117 *
1118 * This value is made available only for WPA/WPA2-Personal (PSK) and
Hai Shalom74f70d42019-02-11 14:42:39 -08001119 * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK. This
1120 * is the 8..63 character ASCII passphrase, if available. Please note
1121 * that this can be %NULL if passphrase was not used to generate the
1122 * PSK. In that case, the psk field must be used to fetch the PSK.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001123 */
1124 const char *passphrase;
1125
1126 /**
1127 * psk - RSN PSK (alternative for passphrase for PSK)
1128 *
1129 * This value is made available only for WPA/WPA2-Personal (PSK) and
Hai Shalom74f70d42019-02-11 14:42:39 -08001130 * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK. This
1131 * is the 32-octet (256-bit) PSK, if available. The driver wrapper
1132 * should be prepared to handle %NULL value as an error.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001133 */
1134 const u8 *psk;
1135
1136 /**
Sunil Ravi2a14cf12023-11-21 00:54:38 +00001137 * sae_password - Password for SAE authentication
1138 *
1139 * This value is made available only for WPA3-Personal (SAE) and only
1140 * for drivers that set WPA_DRIVER_FLAGS2_SAE_OFFLOAD.
1141 */
1142 const char *sae_password;
1143
1144 /**
1145 * sae_password_id - Password Identifier for SAE authentication
1146 *
1147 * This value is made available only for WPA3-Personal (SAE) and only
1148 * for drivers that set WPA_DRIVER_FLAGS2_SAE_OFFLOAD. If %NULL, SAE
1149 * password identifier is not used.
1150 */
1151 const char *sae_password_id;
1152
1153 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001154 * drop_unencrypted - Enable/disable unencrypted frame filtering
1155 *
1156 * Configure the driver to drop all non-EAPOL frames (both receive and
1157 * transmit paths). Unencrypted EAPOL frames (ethertype 0x888e) must
1158 * still be allowed for key negotiation.
1159 */
1160 int drop_unencrypted;
1161
1162 /**
1163 * prev_bssid - Previously used BSSID in this ESS
1164 *
1165 * When not %NULL, this is a request to use reassociation instead of
1166 * association.
1167 */
1168 const u8 *prev_bssid;
1169
1170 /**
1171 * wps - WPS mode
1172 *
1173 * If the driver needs to do special configuration for WPS association,
1174 * this variable provides more information on what type of association
Sunil Ravia04bd252022-05-02 22:54:18 -07001175 * is being requested. Most drivers should not need to use this.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001176 */
1177 enum wps_mode wps;
1178
1179 /**
1180 * p2p - Whether this connection is a P2P group
1181 */
1182 int p2p;
1183
1184 /**
1185 * uapsd - UAPSD parameters for the network
1186 * -1 = do not change defaults
1187 * AP mode: 1 = enabled, 0 = disabled
1188 * STA mode: bits 0..3 UAPSD enabled for VO,VI,BK,BE
1189 */
1190 int uapsd;
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08001191
1192 /**
1193 * fixed_bssid - Whether to force this BSSID in IBSS mode
1194 * 1 = Fix this BSSID and prevent merges.
1195 * 0 = Do not fix BSSID.
1196 */
1197 int fixed_bssid;
1198
1199 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08001200 * fixed_freq - Fix control channel in IBSS mode
1201 * 0 = don't fix control channel (default)
1202 * 1 = fix control channel; this prevents IBSS merging with another
1203 * channel
1204 */
1205 int fixed_freq;
1206
1207 /**
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08001208 * disable_ht - Disable HT (IEEE 802.11n) for this connection
1209 */
1210 int disable_ht;
1211
1212 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001213 * htcaps - HT Capabilities over-rides
1214 *
1215 * Only bits set in the mask will be used, and not all values are used
1216 * by the kernel anyway. Currently, MCS, MPDU and MSDU fields are used.
1217 *
1218 * Pointer to struct ieee80211_ht_capabilities.
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08001219 */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001220 const u8 *htcaps;
1221
1222 /**
1223 * htcaps_mask - HT Capabilities over-rides mask
1224 *
1225 * Pointer to struct ieee80211_ht_capabilities.
1226 */
1227 const u8 *htcaps_mask;
Dmitry Shmidt2f023192013-03-12 12:44:17 -07001228
1229#ifdef CONFIG_VHT_OVERRIDES
1230 /**
1231 * disable_vht - Disable VHT for this connection
1232 */
1233 int disable_vht;
1234
1235 /**
1236 * VHT capability overrides.
1237 */
1238 const struct ieee80211_vht_capabilities *vhtcaps;
1239 const struct ieee80211_vht_capabilities *vhtcaps_mask;
1240#endif /* CONFIG_VHT_OVERRIDES */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001241
Hai Shalomfdcde762020-04-02 11:19:20 -07001242#ifdef CONFIG_HE_OVERRIDES
1243 /**
1244 * disable_he - Disable HE for this connection
1245 */
1246 int disable_he;
1247#endif /* CONFIG_HE_OVERRIDES */
1248
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001249 /**
1250 * req_key_mgmt_offload - Request key management offload for connection
1251 *
1252 * Request key management offload for this connection if the device
1253 * supports it.
1254 */
1255 int req_key_mgmt_offload;
1256
1257 /**
Hai Shalomc3565922019-10-28 11:58:20 -07001258 * req_handshake_offload - Request EAPOL handshake offload
1259 *
1260 * Request EAPOL handshake offload for this connection if the device
1261 * supports it.
1262 */
1263 int req_handshake_offload;
1264
1265 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001266 * Flag for indicating whether this association includes support for
1267 * RRM (Radio Resource Measurements)
1268 */
1269 int rrm_used;
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08001270
1271 /**
1272 * pbss - If set, connect to a PCP in a PBSS. Otherwise, connect to an
1273 * AP as usual. Valid for DMG network only.
1274 */
1275 int pbss;
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08001276
1277 /**
1278 * fils_kek - KEK for FILS association frame protection (AES-SIV)
1279 */
1280 const u8 *fils_kek;
1281
1282 /**
1283 * fils_kek_len: Length of fils_kek in bytes
1284 */
1285 size_t fils_kek_len;
1286
1287 /**
1288 * fils_nonces - Nonces for FILS association frame protection
1289 * (AES-SIV AAD)
1290 */
1291 const u8 *fils_nonces;
1292
1293 /**
1294 * fils_nonces_len: Length of fils_nonce in bytes
1295 */
1296 size_t fils_nonces_len;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001297
1298 /**
1299 * fils_erp_username - Username part of keyName-NAI
1300 */
1301 const u8 *fils_erp_username;
1302
1303 /**
1304 * fils_erp_username_len - Length of fils_erp_username in bytes
1305 */
1306 size_t fils_erp_username_len;
1307
1308 /**
1309 * fils_erp_realm - Realm/domain name to use in FILS ERP
1310 */
1311 const u8 *fils_erp_realm;
1312
1313 /**
1314 * fils_erp_realm_len - Length of fils_erp_realm in bytes
1315 */
1316 size_t fils_erp_realm_len;
1317
1318 /**
1319 * fils_erp_next_seq_num - The next sequence number to use in FILS ERP
1320 * messages
1321 */
1322 u16 fils_erp_next_seq_num;
1323
1324 /**
1325 * fils_erp_rrk - Re-authentication root key (rRK) for the keyName-NAI
1326 * specified by fils_erp_username@fils_erp_realm.
1327 */
1328 const u8 *fils_erp_rrk;
1329
1330 /**
1331 * fils_erp_rrk_len - Length of fils_erp_rrk in bytes
1332 */
1333 size_t fils_erp_rrk_len;
Hai Shalom60840252021-02-19 19:02:11 -08001334
1335 /**
1336 * sae_pwe - SAE mechanism for PWE derivation
1337 * 0 = hunting-and-pecking loop only
1338 * 1 = hash-to-element only
1339 * 2 = both hunting-and-pecking loop and hash-to-element enabled
1340 */
Sunil Ravi77d572f2023-01-17 23:58:31 +00001341 enum sae_pwe sae_pwe;
1342
Winnie Chen4138eec2022-11-10 16:32:53 +08001343#if defined(CONFIG_DRIVER_NL80211_BRCM) || defined(CONFIG_DRIVER_NL80211_SYNA)
Vinayak Yadawade62409f2022-01-20 12:32:07 +05301344 /**
1345 * td_policy - Transition Disable Policy
1346 */
1347 u32 td_policy;
Winnie Chen4138eec2022-11-10 16:32:53 +08001348#endif /* CONFIG_DRIVER_NL80211_BRCM || CONFIG_DRIVER_NL80211_SYNA */
Sunil Ravi77d572f2023-01-17 23:58:31 +00001349
1350 /**
1351 * disable_eht - Disable EHT for this connection
1352 */
1353 int disable_eht;
1354
1355 /*
1356 * mld_params - MLD association parameters
1357 */
1358 struct wpa_driver_mld_params mld_params;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001359};
1360
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001361enum hide_ssid {
1362 NO_SSID_HIDING,
1363 HIDDEN_SSID_ZERO_LEN,
1364 HIDDEN_SSID_ZERO_CONTENTS
1365};
1366
Hai Shalom81f62d82019-07-22 12:10:00 -07001367enum ch_switch_state {
1368 CH_SW_STARTED,
1369 CH_SW_FINISHED
1370};
1371
Dmitry Shmidtb58836e2014-04-29 14:35:56 -07001372struct wowlan_triggers {
1373 u8 any;
1374 u8 disconnect;
1375 u8 magic_pkt;
1376 u8 gtk_rekey_failure;
1377 u8 eap_identity_req;
1378 u8 four_way_handshake;
1379 u8 rfkill_release;
1380};
1381
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001382struct wpa_driver_ap_params {
1383 /**
1384 * head - Beacon head from IEEE 802.11 header to IEs before TIM IE
1385 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08001386 u8 *head;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001387
1388 /**
1389 * head_len - Length of the head buffer in octets
1390 */
1391 size_t head_len;
1392
1393 /**
1394 * tail - Beacon tail following TIM IE
1395 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08001396 u8 *tail;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001397
1398 /**
1399 * tail_len - Length of the tail buffer in octets
1400 */
1401 size_t tail_len;
1402
1403 /**
1404 * dtim_period - DTIM period
1405 */
1406 int dtim_period;
1407
1408 /**
1409 * beacon_int - Beacon interval
1410 */
1411 int beacon_int;
1412
1413 /**
1414 * basic_rates: -1 terminated array of basic rates in 100 kbps
1415 *
1416 * This parameter can be used to set a specific basic rate set for the
1417 * BSS. If %NULL, default basic rate set is used.
1418 */
1419 int *basic_rates;
1420
1421 /**
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001422 * beacon_rate: Beacon frame data rate
1423 *
1424 * This parameter can be used to set a specific Beacon frame data rate
1425 * for the BSS. The interpretation of this value depends on the
Hai Shalom60840252021-02-19 19:02:11 -08001426 * rate_type (legacy: in 100 kbps units, HT: HT-MCS, VHT: VHT-MCS,
1427 * HE: HE-MCS). If beacon_rate == 0 and rate_type == 0
1428 * (BEACON_RATE_LEGACY), the default Beacon frame data rate is used.
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001429 */
1430 unsigned int beacon_rate;
1431
1432 /**
Hai Shalom60840252021-02-19 19:02:11 -08001433 * beacon_rate_type: Beacon data rate type (legacy/HT/VHT/HE)
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001434 */
1435 enum beacon_rate_type rate_type;
1436
1437 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001438 * proberesp - Probe Response template
1439 *
1440 * This is used by drivers that reply to Probe Requests internally in
1441 * AP mode and require the full Probe Response template.
1442 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08001443 u8 *proberesp;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001444
1445 /**
1446 * proberesp_len - Length of the proberesp buffer in octets
1447 */
1448 size_t proberesp_len;
1449
1450 /**
1451 * ssid - The SSID to use in Beacon/Probe Response frames
1452 */
1453 const u8 *ssid;
1454
1455 /**
1456 * ssid_len - Length of the SSID (1..32)
1457 */
1458 size_t ssid_len;
1459
1460 /**
1461 * hide_ssid - Whether to hide the SSID
1462 */
1463 enum hide_ssid hide_ssid;
1464
1465 /**
1466 * pairwise_ciphers - WPA_CIPHER_* bitfield
1467 */
1468 unsigned int pairwise_ciphers;
1469
1470 /**
1471 * group_cipher - WPA_CIPHER_*
1472 */
1473 unsigned int group_cipher;
1474
1475 /**
1476 * key_mgmt_suites - WPA_KEY_MGMT_* bitfield
1477 */
1478 unsigned int key_mgmt_suites;
1479
1480 /**
1481 * auth_algs - WPA_AUTH_ALG_* bitfield
1482 */
1483 unsigned int auth_algs;
1484
1485 /**
1486 * wpa_version - WPA_PROTO_* bitfield
1487 */
1488 unsigned int wpa_version;
1489
1490 /**
1491 * privacy - Whether privacy is used in the BSS
1492 */
1493 int privacy;
1494
1495 /**
1496 * beacon_ies - WPS/P2P IE(s) for Beacon frames
1497 *
1498 * This is used to add IEs like WPS IE and P2P IE by drivers that do
1499 * not use the full Beacon template.
1500 */
1501 const struct wpabuf *beacon_ies;
1502
1503 /**
1504 * proberesp_ies - P2P/WPS IE(s) for Probe Response frames
1505 *
1506 * This is used to add IEs like WPS IE and P2P IE by drivers that
1507 * reply to Probe Request frames internally.
1508 */
1509 const struct wpabuf *proberesp_ies;
1510
1511 /**
1512 * assocresp_ies - WPS IE(s) for (Re)Association Response frames
1513 *
1514 * This is used to add IEs like WPS IE by drivers that reply to
1515 * (Re)Association Request frames internally.
1516 */
1517 const struct wpabuf *assocresp_ies;
1518
1519 /**
1520 * isolate - Whether to isolate frames between associated stations
1521 *
1522 * If this is non-zero, the AP is requested to disable forwarding of
1523 * frames between associated stations.
1524 */
1525 int isolate;
1526
1527 /**
1528 * cts_protect - Whether CTS protection is enabled
1529 */
1530 int cts_protect;
1531
1532 /**
1533 * preamble - Whether short preamble is enabled
1534 */
1535 int preamble;
1536
1537 /**
1538 * short_slot_time - Whether short slot time is enabled
1539 *
1540 * 0 = short slot time disable, 1 = short slot time enabled, -1 = do
1541 * not set (e.g., when 802.11g mode is not in use)
1542 */
1543 int short_slot_time;
1544
1545 /**
1546 * ht_opmode - HT operation mode or -1 if HT not in use
1547 */
1548 int ht_opmode;
1549
1550 /**
1551 * interworking - Whether Interworking is enabled
1552 */
1553 int interworking;
1554
1555 /**
1556 * hessid - Homogeneous ESS identifier or %NULL if not set
1557 */
1558 const u8 *hessid;
1559
1560 /**
1561 * access_network_type - Access Network Type (0..15)
1562 *
1563 * This is used for filtering Probe Request frames when Interworking is
1564 * enabled.
1565 */
1566 u8 access_network_type;
Dmitry Shmidt04949592012-07-19 12:16:46 -07001567
1568 /**
1569 * ap_max_inactivity - Timeout in seconds to detect STA's inactivity
1570 *
1571 * This is used by driver which advertises this capability.
1572 */
1573 int ap_max_inactivity;
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07001574
1575 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08001576 * ctwindow - Client Traffic Window (in TUs)
1577 */
1578 u8 p2p_go_ctwindow;
1579
1580 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07001581 * disable_dgaf - Whether group-addressed frames are disabled
1582 */
1583 int disable_dgaf;
Dmitry Shmidtf21452a2014-02-26 10:55:25 -08001584
1585 /**
1586 * osen - Whether OSEN security is enabled
1587 */
1588 int osen;
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07001589
1590 /**
1591 * freq - Channel parameters for dynamic bandwidth changes
1592 */
1593 struct hostapd_freq_params *freq;
Dmitry Shmidt7f656022015-02-25 14:36:37 -08001594
1595 /**
1596 * reenable - Whether this is to re-enable beaconing
1597 */
1598 int reenable;
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08001599
1600 /**
1601 * pbss - Whether to start a PCP (in PBSS) instead of an AP in
1602 * infrastructure BSS. Valid only for DMG network.
1603 */
1604 int pbss;
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001605
1606 /**
1607 * multicast_to_unicast - Whether to use multicast_to_unicast
1608 *
1609 * If this is non-zero, the AP is requested to perform multicast to
1610 * unicast conversion for ARP, IPv4, and IPv6 frames (possibly within
1611 * 802.1Q). If enabled, such frames are to be sent to each station
1612 * separately, with the DA replaced by their own MAC address rather
1613 * than the group address.
1614 *
1615 * Note that this may break certain expectations of the receiver, such
1616 * as the ability to drop unicast IP packets received within multicast
1617 * L2 frames, or the ability to not send ICMP destination unreachable
1618 * messages for packets received in L2 multicast (which is required,
1619 * but the receiver can't tell the difference if this new option is
1620 * enabled.)
1621 *
1622 * This also doesn't implement the 802.11 DMS (directed multicast
1623 * service).
1624 */
1625 int multicast_to_unicast;
Hai Shalom74f70d42019-02-11 14:42:39 -08001626
1627 /**
1628 * ftm_responder - Whether FTM responder is enabled
1629 */
1630 int ftm_responder;
1631
1632 /**
1633 * lci - Binary data, the content of an LCI report IE with type 8 as
1634 * defined in IEEE Std 802.11-2016, 9.4.2.22.10
1635 */
1636 const struct wpabuf *lci;
1637
1638 /**
1639 * civic - Binary data, the content of a measurement report IE with
1640 * type 11 as defined in IEEE Std 802.11-2016, 9.4.2.22.13
1641 */
1642 const struct wpabuf *civic;
Hai Shalomc3565922019-10-28 11:58:20 -07001643
1644 /**
Hai Shalom60840252021-02-19 19:02:11 -08001645 * he_spr_ctrl - Spatial Reuse control field of SPR element
Hai Shalomc3565922019-10-28 11:58:20 -07001646 */
Hai Shalom60840252021-02-19 19:02:11 -08001647 u8 he_spr_ctrl;
1648
1649 /**
1650 * he_spr_non_srg_obss_pd_max_offset - Non-SRG Maximum TX power offset
1651 */
1652 u8 he_spr_non_srg_obss_pd_max_offset;
Hai Shalomc3565922019-10-28 11:58:20 -07001653
1654 /**
1655 * he_spr_srg_obss_pd_min_offset - Minimum TX power offset
1656 */
Hai Shalom60840252021-02-19 19:02:11 -08001657 u8 he_spr_srg_obss_pd_min_offset;
Hai Shalomc3565922019-10-28 11:58:20 -07001658
1659 /**
1660 * he_spr_srg_obss_pd_max_offset - Maximum TX power offset
1661 */
Hai Shalom60840252021-02-19 19:02:11 -08001662 u8 he_spr_srg_obss_pd_max_offset;
1663
1664 /**
1665 * he_spr_bss_color_bitmap - BSS color values used by members of the
1666 * SRG.
1667 */
1668 u8 he_spr_bss_color_bitmap[8];
1669
1670 /**
1671 * he_spr_partial_bssid_bitmap - Partial BSSID values used by members
1672 * of the SRG.
1673 */
1674 u8 he_spr_partial_bssid_bitmap[8];
Hai Shalomfdcde762020-04-02 11:19:20 -07001675
1676 /**
1677 * he_bss_color - Whether the BSS Color is disabled
1678 */
1679 int he_bss_color_disabled;
1680
1681 /**
1682 * he_bss_color_partial - The BSS Color AID equation
1683 */
1684 int he_bss_color_partial;
1685
1686 /**
1687 * he_bss_color - The BSS Color of the AP
1688 */
1689 int he_bss_color;
1690
1691 /**
1692 * twt_responder - Whether Target Wait Time responder is enabled
1693 */
1694 int twt_responder;
Hai Shalom60840252021-02-19 19:02:11 -08001695
1696 /**
1697 * sae_pwe - SAE mechanism for PWE derivation
1698 * 0 = hunting-and-pecking loop only
1699 * 1 = hash-to-element only
1700 * 2 = both hunting-and-pecking loop and hash-to-element enabled
1701 */
Sunil Ravi77d572f2023-01-17 23:58:31 +00001702 enum sae_pwe sae_pwe;
Hai Shalom60840252021-02-19 19:02:11 -08001703
1704 /**
1705 * FILS Discovery frame minimum interval in TUs
1706 */
1707 u32 fd_min_int;
1708
1709 /**
1710 * FILS Discovery frame maximum interval in TUs (0 = FD frame disabled)
1711 */
1712 u32 fd_max_int;
1713
1714 /**
1715 * FILS Discovery frame template data
1716 */
1717 u8 *fd_frame_tmpl;
1718
1719 /**
1720 * FILS Discovery frame template length
1721 */
1722 size_t fd_frame_tmpl_len;
1723
1724 /**
1725 * Unsolicited broadcast Probe Response interval in TUs
1726 */
1727 unsigned int unsol_bcast_probe_resp_interval;
1728
1729 /**
1730 * Unsolicited broadcast Probe Response template data
1731 */
1732 u8 *unsol_bcast_probe_resp_tmpl;
1733
1734 /**
1735 * Unsolicited broadcast Probe Response template length
1736 */
1737 size_t unsol_bcast_probe_resp_tmpl_len;
Sunil Ravi77d572f2023-01-17 23:58:31 +00001738
1739 /**
1740 * mbssid_tx_iface - Transmitting interface of the MBSSID set
1741 */
1742 const char *mbssid_tx_iface;
1743
1744 /**
1745 * mbssid_index - The index of this BSS in the MBSSID set
1746 */
1747 unsigned int mbssid_index;
1748
1749 /**
1750 * mbssid_elem - Buffer containing all MBSSID elements
1751 */
1752 u8 *mbssid_elem;
1753
1754 /**
1755 * mbssid_elem_len - Total length of all MBSSID elements
1756 */
1757 size_t mbssid_elem_len;
1758
1759 /**
1760 * mbssid_elem_count - The number of MBSSID elements
1761 */
1762 u8 mbssid_elem_count;
1763
1764 /**
1765 * mbssid_elem_offset - Offsets to elements in mbssid_elem.
1766 * Kernel will use these offsets to generate multiple BSSID beacons.
1767 */
1768 u8 **mbssid_elem_offset;
1769
1770 /**
1771 * ema - Enhanced MBSSID advertisements support.
1772 */
1773 bool ema;
Sunil Ravi036cec52023-03-29 11:35:17 -07001774
1775 /**
1776 * punct_bitmap - Preamble puncturing bitmap
1777 * Each bit corresponds to a 20 MHz subchannel, the lowest bit for the
1778 * channel with the lowest frequency. A bit set to 1 indicates that the
1779 * subchannel is punctured, otherwise active.
1780 */
1781 u16 punct_bitmap;
Sunil Ravi640215c2023-06-28 23:08:09 +00001782
1783 /**
1784 * rnr_elem - This buffer contains all of reduced neighbor report (RNR)
1785 * elements
1786 */
1787 u8 *rnr_elem;
1788
1789 /**
1790 * rnr_elem_len - Length of rnr_elem buffer
1791 */
1792 size_t rnr_elem_len;
1793
1794 /**
1795 * rnr_elem_count - Number of RNR elements
1796 */
1797 unsigned int rnr_elem_count;
1798
1799 /**
1800 * rnr_elem_offset - The offsets to the elements in rnr_elem.
1801 * The driver will use these to include RNR elements in EMA beacons.
1802 */
1803 u8 **rnr_elem_offset;
1804
1805 /**
1806 * allowed_freqs - List of allowed 20 MHz channel center frequencies in
1807 * MHz for AP operation. Drivers which support this parameter will
1808 * generate a new list based on this provided list by filtering out
1809 * channels that cannot be used at that time due to regulatory or other
1810 * constraints. The resulting list is used as the list of all allowed
1811 * channels whenever performing operations like ACS and DFS.
1812 */
1813 int *allowed_freqs;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00001814
1815 /*
1816 * mld_ap - Whether operating as an AP MLD
1817 */
1818 bool mld_ap;
1819
1820 /**
1821 * mld_link_id - Link id for MLD BSS's
1822 */
1823 u8 mld_link_id;
1824
1825 /**
1826 * psk - PSK passed to the driver for 4-way handshake offload
1827 */
1828 u8 psk[PMK_LEN];
1829
1830 /**
1831 * psk_len - PSK length in bytes (0 = not set)
1832 */
1833 size_t psk_len;
1834
1835 /**
1836 * sae_password - SAE password for SAE offload
1837 */
1838 const char *sae_password;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001839};
1840
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001841struct wpa_driver_mesh_bss_params {
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001842#define WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS 0x00000001
1843#define WPA_DRIVER_MESH_CONF_FLAG_PEER_LINK_TIMEOUT 0x00000002
1844#define WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS 0x00000004
1845#define WPA_DRIVER_MESH_CONF_FLAG_HT_OP_MODE 0x00000008
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001846#define WPA_DRIVER_MESH_CONF_FLAG_RSSI_THRESHOLD 0x00000010
Hai Shalomc1a21442022-02-04 13:43:00 -08001847#define WPA_DRIVER_MESH_CONF_FLAG_FORWARDING 0x00000020
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001848 /*
1849 * TODO: Other mesh configuration parameters would go here.
1850 * See NL80211_MESHCONF_* for all the mesh config parameters.
1851 */
1852 unsigned int flags;
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001853 int auto_plinks;
Dmitry Shmidt2f74e362015-01-21 13:19:05 -08001854 int peer_link_timeout;
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001855 int max_peer_links;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001856 int rssi_threshold;
Hai Shalomc1a21442022-02-04 13:43:00 -08001857 int forwarding;
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001858 u16 ht_opmode;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001859};
1860
1861struct wpa_driver_mesh_join_params {
1862 const u8 *meshid;
1863 int meshid_len;
1864 const int *basic_rates;
1865 const u8 *ies;
1866 int ie_len;
Dmitry Shmidtff787d52015-01-12 13:01:47 -08001867 struct hostapd_freq_params freq;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001868 int beacon_int;
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07001869 int dtim_period;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001870 struct wpa_driver_mesh_bss_params conf;
1871#define WPA_DRIVER_MESH_FLAG_USER_MPM 0x00000001
1872#define WPA_DRIVER_MESH_FLAG_DRIVER_MPM 0x00000002
1873#define WPA_DRIVER_MESH_FLAG_SAE_AUTH 0x00000004
1874#define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008
1875 unsigned int flags;
Hai Shalom60840252021-02-19 19:02:11 -08001876 bool handle_dfs;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001877};
1878
Hai Shalomfdcde762020-04-02 11:19:20 -07001879struct wpa_driver_set_key_params {
1880 /**
1881 * ifname - Interface name (for multi-SSID/VLAN support) */
1882 const char *ifname;
1883
1884 /**
1885 * alg - Encryption algorithm
1886 *
1887 * (%WPA_ALG_NONE, %WPA_ALG_WEP, %WPA_ALG_TKIP, %WPA_ALG_CCMP,
Hai Shalom4fbc08f2020-05-18 12:37:00 -07001888 * %WPA_ALG_BIP_AES_CMAC_128, %WPA_ALG_GCMP, %WPA_ALG_GCMP_256,
1889 * %WPA_ALG_CCMP_256, %WPA_ALG_BIP_GMAC_128, %WPA_ALG_BIP_GMAC_256,
1890 * %WPA_ALG_BIP_CMAC_256);
Hai Shalomfdcde762020-04-02 11:19:20 -07001891 * %WPA_ALG_NONE clears the key. */
1892 enum wpa_alg alg;
1893
1894 /**
1895 * addr - Address of the peer STA
1896 *
1897 * (BSSID of the current AP when setting pairwise key in station mode),
1898 * ff:ff:ff:ff:ff:ff for broadcast keys, %NULL for default keys that
1899 * are used both for broadcast and unicast; when clearing keys, %NULL
1900 * is used to indicate that both the broadcast-only and default key of
1901 * the specified key index is to be cleared */
1902 const u8 *addr;
1903
1904 /**
1905 * key_idx - Key index
1906 *
1907 * (0..3), usually 0 for unicast keys; 4..5 for IGTK; 6..7 for BIGTK */
1908 int key_idx;
1909
1910 /**
1911 * set_tx - Configure this key as the default Tx key
1912 *
1913 * Only used when driver does not support separate unicast/individual
1914 * key */
1915 int set_tx;
1916
1917 /**
1918 * seq - Sequence number/packet number
1919 *
1920 * seq_len octets, the next packet number to be used for in replay
1921 * protection; configured for Rx keys (in most cases, this is only used
1922 * with broadcast keys and set to zero for unicast keys); %NULL if not
1923 * set */
1924 const u8 *seq;
1925
1926 /**
1927 * seq_len - Length of the seq, depends on the algorithm
1928 *
1929 * TKIP: 6 octets, CCMP/GCMP: 6 octets, IGTK: 6 octets */
1930 size_t seq_len;
1931
1932 /**
1933 * key - Key buffer
1934 *
1935 * TKIP: 16-byte temporal key, 8-byte Tx Mic key, 8-byte Rx Mic Key */
1936 const u8 *key;
1937
1938 /**
1939 * key_len - Length of the key buffer in octets
1940 *
1941 * WEP: 5 or 13, TKIP: 32, CCMP/GCMP: 16, IGTK: 16 */
1942 size_t key_len;
1943
1944 /**
1945 * vlan_id - VLAN index (0..4095) for VLAN offload cases */
1946 int vlan_id;
1947
1948 /**
1949 * key_flag - Additional key flags
1950 *
1951 * %KEY_FLAG_MODIFY
1952 * Set when an already installed key must be updated.
1953 * So far the only use-case is changing RX/TX status for
1954 * pairwise keys. Must not be set when deleting a key.
1955 * %KEY_FLAG_DEFAULT
1956 * Set when the key is also a default key. Must not be set when
1957 * deleting a key.
1958 * %KEY_FLAG_RX
1959 * The key is valid for RX. Must not be set when deleting a key.
1960 * %KEY_FLAG_TX
1961 * The key is valid for TX. Must not be set when deleting a key.
1962 * %KEY_FLAG_GROUP
1963 * The key is a broadcast or group key.
1964 * %KEY_FLAG_PAIRWISE
1965 * The key is a pairwise key.
1966 * %KEY_FLAG_PMK
1967 * The key is a Pairwise Master Key (PMK).
1968 *
1969 * Valid and pre-defined combinations are:
1970 * %KEY_FLAG_GROUP_RX_TX
1971 * WEP key not to be installed as default key.
1972 * %KEY_FLAG_GROUP_RX_TX_DEFAULT
1973 * Default WEP or WPA-NONE key.
1974 * %KEY_FLAG_GROUP_RX
1975 * GTK key valid for RX only.
1976 * %KEY_FLAG_GROUP_TX_DEFAULT
1977 * GTK key valid for TX only, immediately taking over TX.
1978 * %KEY_FLAG_PAIRWISE_RX_TX
1979 * Pairwise key immediately becoming the active pairwise key.
1980 * %KEY_FLAG_PAIRWISE_RX
1981 * Pairwise key not yet valid for TX. (Only usable when Extended
1982 * Key ID is supported by the driver.)
1983 * %KEY_FLAG_PAIRWISE_RX_TX_MODIFY
1984 * Enable TX for a pairwise key installed with
1985 * KEY_FLAG_PAIRWISE_RX.
1986 *
1987 * Not a valid standalone key type but pre-defined to be combined
1988 * with other key_flags:
1989 * %KEY_FLAG_RX_TX
1990 * RX/TX key. */
1991 enum key_flag key_flag;
Sunil Ravi77d572f2023-01-17 23:58:31 +00001992
1993 /**
1994 * link_id - MLO Link ID
1995 *
1996 * Set to a valid Link ID (0-14) when applicable, otherwise -1. */
1997 int link_id;
Hai Shalomfdcde762020-04-02 11:19:20 -07001998};
1999
Hai Shalom4fbc08f2020-05-18 12:37:00 -07002000enum wpa_driver_if_type {
2001 /**
2002 * WPA_IF_STATION - Station mode interface
2003 */
2004 WPA_IF_STATION,
2005
2006 /**
2007 * WPA_IF_AP_VLAN - AP mode VLAN interface
2008 *
2009 * This interface shares its address and Beacon frame with the main
2010 * BSS.
2011 */
2012 WPA_IF_AP_VLAN,
2013
2014 /**
2015 * WPA_IF_AP_BSS - AP mode BSS interface
2016 *
2017 * This interface has its own address and Beacon frame.
2018 */
2019 WPA_IF_AP_BSS,
2020
2021 /**
2022 * WPA_IF_P2P_GO - P2P Group Owner
2023 */
2024 WPA_IF_P2P_GO,
2025
2026 /**
2027 * WPA_IF_P2P_CLIENT - P2P Client
2028 */
2029 WPA_IF_P2P_CLIENT,
2030
2031 /**
2032 * WPA_IF_P2P_GROUP - P2P Group interface (will become either
2033 * WPA_IF_P2P_GO or WPA_IF_P2P_CLIENT, but the role is not yet known)
2034 */
2035 WPA_IF_P2P_GROUP,
2036
2037 /**
Sunil Ravia04bd252022-05-02 22:54:18 -07002038 * WPA_IF_P2P_DEVICE - P2P Device interface is used to identify the
Hai Shalom4fbc08f2020-05-18 12:37:00 -07002039 * abstracted P2P Device function in the driver
2040 */
2041 WPA_IF_P2P_DEVICE,
2042
2043 /*
2044 * WPA_IF_MESH - Mesh interface
2045 */
2046 WPA_IF_MESH,
2047
2048 /*
2049 * WPA_IF_TDLS - TDLS offchannel interface (used for pref freq only)
2050 */
2051 WPA_IF_TDLS,
2052
2053 /*
2054 * WPA_IF_IBSS - IBSS interface (used for pref freq only)
2055 */
2056 WPA_IF_IBSS,
2057
2058 /*
2059 * WPA_IF_NAN - NAN Device
2060 */
2061 WPA_IF_NAN,
2062
2063 /* keep last */
2064 WPA_IF_MAX
2065};
2066
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002067/**
2068 * struct wpa_driver_capa - Driver capability information
2069 */
2070struct wpa_driver_capa {
2071#define WPA_DRIVER_CAPA_KEY_MGMT_WPA 0x00000001
2072#define WPA_DRIVER_CAPA_KEY_MGMT_WPA2 0x00000002
2073#define WPA_DRIVER_CAPA_KEY_MGMT_WPA_PSK 0x00000004
2074#define WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK 0x00000008
2075#define WPA_DRIVER_CAPA_KEY_MGMT_WPA_NONE 0x00000010
2076#define WPA_DRIVER_CAPA_KEY_MGMT_FT 0x00000020
2077#define WPA_DRIVER_CAPA_KEY_MGMT_FT_PSK 0x00000040
Dmitry Shmidtd5e49232012-12-03 15:08:10 -08002078#define WPA_DRIVER_CAPA_KEY_MGMT_WAPI_PSK 0x00000080
Dmitry Shmidt807291d2015-01-27 13:40:23 -08002079#define WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B 0x00000100
2080#define WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B_192 0x00000200
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002081#define WPA_DRIVER_CAPA_KEY_MGMT_OWE 0x00000400
2082#define WPA_DRIVER_CAPA_KEY_MGMT_DPP 0x00000800
2083#define WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA256 0x00001000
2084#define WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA384 0x00002000
2085#define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA256 0x00004000
2086#define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA384 0x00008000
Hai Shalom74f70d42019-02-11 14:42:39 -08002087#define WPA_DRIVER_CAPA_KEY_MGMT_SAE 0x00010000
Tanmay Garga7fd80d2020-05-18 15:52:44 +05302088#define WPA_DRIVER_CAPA_KEY_MGMT_802_1X_SHA256 0x00020000
2089#define WPA_DRIVER_CAPA_KEY_MGMT_PSK_SHA256 0x00040000
2090#define WPA_DRIVER_CAPA_KEY_MGMT_TPK_HANDSHAKE 0x00080000
2091#define WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE 0x00100000
2092#define WPA_DRIVER_CAPA_KEY_MGMT_FT_802_1X_SHA384 0x00200000
2093#define WPA_DRIVER_CAPA_KEY_MGMT_CCKM 0x00400000
2094#define WPA_DRIVER_CAPA_KEY_MGMT_OSEN 0x00800000
Sunil Ravi89eba102022-09-13 21:04:37 -07002095#define WPA_DRIVER_CAPA_KEY_MGMT_SAE_EXT_KEY 0x01000000
2096#define WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE_EXT_KEY 0x02000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002097 /** Bitfield of supported key management suites */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002098 unsigned int key_mgmt;
Hai Shalom4fbc08f2020-05-18 12:37:00 -07002099 unsigned int key_mgmt_iftype[WPA_IF_MAX];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002100
2101#define WPA_DRIVER_CAPA_ENC_WEP40 0x00000001
2102#define WPA_DRIVER_CAPA_ENC_WEP104 0x00000002
2103#define WPA_DRIVER_CAPA_ENC_TKIP 0x00000004
2104#define WPA_DRIVER_CAPA_ENC_CCMP 0x00000008
Dmitry Shmidt04949592012-07-19 12:16:46 -07002105#define WPA_DRIVER_CAPA_ENC_WEP128 0x00000010
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07002106#define WPA_DRIVER_CAPA_ENC_GCMP 0x00000020
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08002107#define WPA_DRIVER_CAPA_ENC_GCMP_256 0x00000040
2108#define WPA_DRIVER_CAPA_ENC_CCMP_256 0x00000080
2109#define WPA_DRIVER_CAPA_ENC_BIP 0x00000100
2110#define WPA_DRIVER_CAPA_ENC_BIP_GMAC_128 0x00000200
2111#define WPA_DRIVER_CAPA_ENC_BIP_GMAC_256 0x00000400
2112#define WPA_DRIVER_CAPA_ENC_BIP_CMAC_256 0x00000800
Dmitry Shmidtf21452a2014-02-26 10:55:25 -08002113#define WPA_DRIVER_CAPA_ENC_GTK_NOT_USED 0x00001000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002114 /** Bitfield of supported cipher suites */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002115 unsigned int enc;
2116
2117#define WPA_DRIVER_AUTH_OPEN 0x00000001
2118#define WPA_DRIVER_AUTH_SHARED 0x00000002
2119#define WPA_DRIVER_AUTH_LEAP 0x00000004
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002120 /** Bitfield of supported IEEE 802.11 authentication algorithms */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002121 unsigned int auth;
2122
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002123/** Driver generated WPA/RSN IE */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002124#define WPA_DRIVER_FLAGS_DRIVER_IE 0x00000001
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002125/** Driver needs static WEP key setup after association command */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002126#define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC 0x00000002
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002127/** Driver takes care of all DFS operations */
Dmitry Shmidtd11f0192014-03-24 12:09:47 -07002128#define WPA_DRIVER_FLAGS_DFS_OFFLOAD 0x00000004
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002129/** Driver takes care of RSN 4-way handshake internally; PMK is configured with
Hai Shalomfdcde762020-04-02 11:19:20 -07002130 * struct wpa_driver_ops::set_key using key_flag = KEY_FLAG_PMK */
Hai Shalom74f70d42019-02-11 14:42:39 -08002131#define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X 0x00000008
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002132/** Driver is for a wired Ethernet interface */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002133#define WPA_DRIVER_FLAGS_WIRED 0x00000010
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002134/** Driver provides separate commands for authentication and association (SME in
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002135 * wpa_supplicant). */
2136#define WPA_DRIVER_FLAGS_SME 0x00000020
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002137/** Driver supports AP mode */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002138#define WPA_DRIVER_FLAGS_AP 0x00000040
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002139/** Driver needs static WEP key setup after association has been completed */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002140#define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE 0x00000080
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002141/** Driver supports dynamic HT 20/40 MHz channel changes during BSS lifetime */
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07002142#define WPA_DRIVER_FLAGS_HT_2040_COEX 0x00000100
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002143/** Driver supports concurrent P2P operations */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002144#define WPA_DRIVER_FLAGS_P2P_CONCURRENT 0x00000200
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002145/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002146 * Driver uses the initial interface as a dedicated management interface, i.e.,
2147 * it cannot be used for P2P group operations or non-P2P purposes.
2148 */
2149#define WPA_DRIVER_FLAGS_P2P_DEDICATED_INTERFACE 0x00000400
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002150/** This interface is P2P capable (P2P GO or P2P Client) */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002151#define WPA_DRIVER_FLAGS_P2P_CAPABLE 0x00000800
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002152/** Driver supports station and key removal when stopping an AP */
Dmitry Shmidta38abf92014-03-06 13:38:44 -08002153#define WPA_DRIVER_FLAGS_AP_TEARDOWN_SUPPORT 0x00001000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002154/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002155 * Driver uses the initial interface for P2P management interface and non-P2P
2156 * purposes (e.g., connect to infra AP), but this interface cannot be used for
2157 * P2P group operations.
2158 */
2159#define WPA_DRIVER_FLAGS_P2P_MGMT_AND_NON_P2P 0x00002000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002160/**
Hai Shalomc1a21442022-02-04 13:43:00 -08002161 * Driver is known to use valid error codes, i.e., when it indicates that
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002162 * something (e.g., association) fails, there was indeed a failure and the
2163 * operation does not end up getting completed successfully later.
2164 */
Hai Shalomc1a21442022-02-04 13:43:00 -08002165#define WPA_DRIVER_FLAGS_VALID_ERROR_CODES 0x00004000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002166/** Driver supports off-channel TX */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002167#define WPA_DRIVER_FLAGS_OFFCHANNEL_TX 0x00008000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002168/** Driver indicates TX status events for EAPOL Data frames */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002169#define WPA_DRIVER_FLAGS_EAPOL_TX_STATUS 0x00010000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002170/** Driver indicates TX status events for Deauth/Disassoc frames */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002171#define WPA_DRIVER_FLAGS_DEAUTH_TX_STATUS 0x00020000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002172/** Driver supports roaming (BSS selection) in firmware */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002173#define WPA_DRIVER_FLAGS_BSS_SELECTION 0x00040000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002174/** Driver supports operating as a TDLS peer */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002175#define WPA_DRIVER_FLAGS_TDLS_SUPPORT 0x00080000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002176/** Driver requires external TDLS setup/teardown/discovery */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002177#define WPA_DRIVER_FLAGS_TDLS_EXTERNAL_SETUP 0x00100000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002178/** Driver indicates support for Probe Response offloading in AP mode */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002179#define WPA_DRIVER_FLAGS_PROBE_RESP_OFFLOAD 0x00200000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002180/** Driver supports U-APSD in AP mode */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002181#define WPA_DRIVER_FLAGS_AP_UAPSD 0x00400000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002182/** Driver supports inactivity timer in AP mode */
Dmitry Shmidt04949592012-07-19 12:16:46 -07002183#define WPA_DRIVER_FLAGS_INACTIVITY_TIMER 0x00800000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002184/** Driver expects user space implementation of MLME in AP mode */
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07002185#define WPA_DRIVER_FLAGS_AP_MLME 0x01000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002186/** Driver supports SAE with user space SME */
Dmitry Shmidtd5e49232012-12-03 15:08:10 -08002187#define WPA_DRIVER_FLAGS_SAE 0x02000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002188/** Driver makes use of OBSS scan mechanism in wpa_supplicant */
Dmitry Shmidtd5e49232012-12-03 15:08:10 -08002189#define WPA_DRIVER_FLAGS_OBSS_SCAN 0x04000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002190/** Driver supports IBSS (Ad-hoc) mode */
Dmitry Shmidt700a1372013-03-15 14:14:44 -07002191#define WPA_DRIVER_FLAGS_IBSS 0x08000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002192/** Driver supports radar detection */
Dmitry Shmidtea69e842013-05-13 14:52:28 -07002193#define WPA_DRIVER_FLAGS_RADAR 0x10000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002194/** Driver supports a dedicated interface for P2P Device */
Dmitry Shmidt34af3062013-07-11 10:46:32 -07002195#define WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE 0x20000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002196/** Driver supports QoS Mapping */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08002197#define WPA_DRIVER_FLAGS_QOS_MAPPING 0x40000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002198/** Driver supports CSA in AP mode */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08002199#define WPA_DRIVER_FLAGS_AP_CSA 0x80000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002200/** Driver supports mesh */
2201#define WPA_DRIVER_FLAGS_MESH 0x0000000100000000ULL
2202/** Driver support ACS offload */
2203#define WPA_DRIVER_FLAGS_ACS_OFFLOAD 0x0000000200000000ULL
2204/** Driver supports key management offload */
2205#define WPA_DRIVER_FLAGS_KEY_MGMT_OFFLOAD 0x0000000400000000ULL
2206/** Driver supports TDLS channel switching */
2207#define WPA_DRIVER_FLAGS_TDLS_CHANNEL_SWITCH 0x0000000800000000ULL
Dmitry Shmidtff787d52015-01-12 13:01:47 -08002208/** Driver supports IBSS with HT datarates */
2209#define WPA_DRIVER_FLAGS_HT_IBSS 0x0000001000000000ULL
Dmitry Shmidt7f656022015-02-25 14:36:37 -08002210/** Driver supports IBSS with VHT datarates */
2211#define WPA_DRIVER_FLAGS_VHT_IBSS 0x0000002000000000ULL
Dmitry Shmidtb1e52102015-05-29 12:36:29 -07002212/** Driver supports automatic band selection */
2213#define WPA_DRIVER_FLAGS_SUPPORT_HW_MODE_ANY 0x0000004000000000ULL
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002214/** Driver supports simultaneous off-channel operations */
2215#define WPA_DRIVER_FLAGS_OFFCHANNEL_SIMULTANEOUS 0x0000008000000000ULL
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002216/** Driver supports full AP client state */
2217#define WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE 0x0000010000000000ULL
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07002218/** Driver supports P2P Listen offload */
2219#define WPA_DRIVER_FLAGS_P2P_LISTEN_OFFLOAD 0x0000020000000000ULL
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08002220/** Driver supports FILS */
2221#define WPA_DRIVER_FLAGS_SUPPORT_FILS 0x0000040000000000ULL
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08002222/** Driver supports Beacon frame TX rate configuration (legacy rates) */
2223#define WPA_DRIVER_FLAGS_BEACON_RATE_LEGACY 0x0000080000000000ULL
2224/** Driver supports Beacon frame TX rate configuration (HT rates) */
2225#define WPA_DRIVER_FLAGS_BEACON_RATE_HT 0x0000100000000000ULL
2226/** Driver supports Beacon frame TX rate configuration (VHT rates) */
2227#define WPA_DRIVER_FLAGS_BEACON_RATE_VHT 0x0000200000000000ULL
Dmitry Shmidtebd93af2017-02-21 13:40:44 -08002228/** Driver supports mgmt_tx with random TX address in non-connected state */
2229#define WPA_DRIVER_FLAGS_MGMT_TX_RANDOM_TA 0x0000400000000000ULL
2230/** Driver supports mgmt_tx with random TX addr in connected state */
2231#define WPA_DRIVER_FLAGS_MGMT_TX_RANDOM_TA_CONNECTED 0x0000800000000000ULL
2232/** Driver supports better BSS reporting with sched_scan in connected mode */
2233#define WPA_DRIVER_FLAGS_SCHED_SCAN_RELATIVE_RSSI 0x0001000000000000ULL
2234/** Driver supports HE capabilities */
2235#define WPA_DRIVER_FLAGS_HE_CAPABILITIES 0x0002000000000000ULL
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002236/** Driver supports FILS shared key offload */
2237#define WPA_DRIVER_FLAGS_FILS_SK_OFFLOAD 0x0004000000000000ULL
2238/** Driver supports all OCE STA specific mandatory features */
2239#define WPA_DRIVER_FLAGS_OCE_STA 0x0008000000000000ULL
2240/** Driver supports all OCE AP specific mandatory features */
2241#define WPA_DRIVER_FLAGS_OCE_AP 0x0010000000000000ULL
2242/**
2243 * Driver supports all OCE STA-CFON specific mandatory features only.
2244 * If a driver sets this bit but not the %WPA_DRIVER_FLAGS_OCE_AP, the
2245 * userspace shall assume that this driver may not support all OCE AP
2246 * functionality but can support only OCE STA-CFON functionality.
2247 */
2248#define WPA_DRIVER_FLAGS_OCE_STA_CFON 0x0020000000000000ULL
Roshan Pius3a1667e2018-07-03 15:17:14 -07002249/** Driver supports MFP-optional in the connect command */
2250#define WPA_DRIVER_FLAGS_MFP_OPTIONAL 0x0040000000000000ULL
Hai Shalom39ba6fc2019-01-22 12:40:38 -08002251/** Driver is a self-managed regulatory device */
2252#define WPA_DRIVER_FLAGS_SELF_MANAGED_REGULATORY 0x0080000000000000ULL
Hai Shalom74f70d42019-02-11 14:42:39 -08002253/** Driver supports FTM responder functionality */
2254#define WPA_DRIVER_FLAGS_FTM_RESPONDER 0x0100000000000000ULL
2255/** Driver support 4-way handshake offload for WPA-Personal */
2256#define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK 0x0200000000000000ULL
Hai Shalomb755a2a2020-04-23 21:49:02 -07002257/** Driver supports a separate control port TX for EAPOL frames */
Hai Shalomfdcde762020-04-02 11:19:20 -07002258#define WPA_DRIVER_FLAGS_CONTROL_PORT 0x0400000000000000ULL
2259/** Driver supports VLAN offload */
2260#define WPA_DRIVER_FLAGS_VLAN_OFFLOAD 0x0800000000000000ULL
2261/** Driver supports UPDATE_FT_IES command */
2262#define WPA_DRIVER_FLAGS_UPDATE_FT_IES 0x1000000000000000ULL
2263/** Driver can correctly rekey PTKs without Extended Key ID */
2264#define WPA_DRIVER_FLAGS_SAFE_PTK0_REKEYS 0x2000000000000000ULL
2265/** Driver supports Beacon protection */
2266#define WPA_DRIVER_FLAGS_BEACON_PROTECTION 0x4000000000000000ULL
2267/** Driver supports Extended Key ID */
2268#define WPA_DRIVER_FLAGS_EXTENDED_KEY_ID 0x8000000000000000ULL
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002269 u64 flags;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002270
Hai Shalomb755a2a2020-04-23 21:49:02 -07002271/** Driver supports a separate control port RX for EAPOL frames */
2272#define WPA_DRIVER_FLAGS2_CONTROL_PORT_RX 0x0000000000000001ULL
Hai Shalom899fcc72020-10-19 14:38:18 -07002273/** Driver supports TX status reports for EAPOL frames through control port */
2274#define WPA_DRIVER_FLAGS2_CONTROL_PORT_TX_STATUS 0x0000000000000002ULL
Sunil Ravi89eba102022-09-13 21:04:37 -07002275/** Driver supports secure LTF in AP mode */
2276#define WPA_DRIVER_FLAGS2_SEC_LTF_AP 0x0000000000000004ULL
2277/** Driver supports secure RTT measurement exchange in AP mode */
2278#define WPA_DRIVER_FLAGS2_SEC_RTT_AP 0x0000000000000008ULL
Hai Shalom60840252021-02-19 19:02:11 -08002279/**
2280 * Driver supports protection of range negotiation and measurement management
Sunil Ravi89eba102022-09-13 21:04:37 -07002281 * frames in AP mode
Hai Shalom60840252021-02-19 19:02:11 -08002282 */
Sunil Ravi89eba102022-09-13 21:04:37 -07002283#define WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_AP 0x0000000000000010ULL
Hai Shalom60840252021-02-19 19:02:11 -08002284/** Driver supports Beacon frame TX rate configuration (HE rates) */
2285#define WPA_DRIVER_FLAGS2_BEACON_RATE_HE 0x0000000000000020ULL
2286/** Driver supports Beacon protection only in client mode */
2287#define WPA_DRIVER_FLAGS2_BEACON_PROTECTION_CLIENT 0x0000000000000040ULL
2288/** Driver supports Operating Channel Validation */
2289#define WPA_DRIVER_FLAGS2_OCV 0x0000000000000080ULL
2290/** Driver expects user space implementation of SME in AP mode */
2291#define WPA_DRIVER_FLAGS2_AP_SME 0x0000000000000100ULL
Sunil Ravia04bd252022-05-02 22:54:18 -07002292/** Driver handles SA Query procedures in AP mode */
2293#define WPA_DRIVER_FLAGS2_SA_QUERY_OFFLOAD_AP 0x0000000000000200ULL
2294/** Driver supports background radar/CAC detection */
Sunil Ravi2a14cf12023-11-21 00:54:38 +00002295#define WPA_DRIVER_FLAGS2_RADAR_BACKGROUND 0x0000000000000400ULL
Sunil Ravi89eba102022-09-13 21:04:37 -07002296/** Driver supports secure LTF in STA mode */
2297#define WPA_DRIVER_FLAGS2_SEC_LTF_STA 0x0000000000000800ULL
2298/** Driver supports secure RTT measurement exchange in STA mode */
2299#define WPA_DRIVER_FLAGS2_SEC_RTT_STA 0x0000000000001000ULL
2300/**
2301 * Driver supports protection of range negotiation and measurement management
2302 * frames in STA mode
2303 */
2304#define WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_STA 0x0000000000002000ULL
Sunil Ravi77d572f2023-01-17 23:58:31 +00002305/** Driver supports MLO in station/AP mode */
2306#define WPA_DRIVER_FLAGS2_MLO 0x0000000000004000ULL
Sunil Ravi2a14cf12023-11-21 00:54:38 +00002307/** Driver supports minimal scan request probe content */
2308#define WPA_DRIVER_FLAGS2_SCAN_MIN_PREQ 0x0000000000008000ULL
2309/** Driver supports SAE authentication offload in STA mode */
2310#define WPA_DRIVER_FLAGS2_SAE_OFFLOAD_STA 0x0000000000010000ULL
2311/** Driver support AP_PSK authentication offload */
2312#define WPA_DRIVER_FLAGS2_4WAY_HANDSHAKE_AP_PSK 0x0000000000020000ULL
2313/** Driver supports OWE STA offload */
2314#define WPA_DRIVER_FLAGS2_OWE_OFFLOAD_STA 0x0000000000040000ULL
2315/** Driver supports OWE AP offload */
2316#define WPA_DRIVER_FLAGS2_OWE_OFFLOAD_AP 0x0000000000080000ULL
2317/** Driver support AP SAE authentication offload */
2318#define WPA_DRIVER_FLAGS2_SAE_OFFLOAD_AP 0x0000000000100000ULL
Hai Shalomb755a2a2020-04-23 21:49:02 -07002319 u64 flags2;
2320
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002321#define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \
2322 (drv_flags & WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE)
2323
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002324 unsigned int wmm_ac_supported:1;
2325
2326 unsigned int mac_addr_rand_scan_supported:1;
2327 unsigned int mac_addr_rand_sched_scan_supported:1;
2328
2329 /** Maximum number of supported active probe SSIDs */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002330 int max_scan_ssids;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002331
2332 /** Maximum number of supported active probe SSIDs for sched_scan */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002333 int max_sched_scan_ssids;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002334
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08002335 /** Maximum number of supported scan plans for scheduled scan */
2336 unsigned int max_sched_scan_plans;
2337
2338 /** Maximum interval in a scan plan. In seconds */
2339 u32 max_sched_scan_plan_interval;
2340
2341 /** Maximum number of iterations in a single scan plan */
2342 u32 max_sched_scan_plan_iterations;
2343
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002344 /** Whether sched_scan (offloaded scanning) is supported */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002345 int sched_scan_supported;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002346
2347 /** Maximum number of supported match sets for sched_scan */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002348 int max_match_sets;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002349
2350 /**
2351 * max_remain_on_chan - Maximum remain-on-channel duration in msec
2352 */
2353 unsigned int max_remain_on_chan;
2354
2355 /**
2356 * max_stations - Maximum number of associated stations the driver
2357 * supports in AP mode
2358 */
2359 unsigned int max_stations;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002360
2361 /**
2362 * probe_resp_offloads - Bitmap of supported protocols by the driver
2363 * for Probe Response offloading.
2364 */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002365/** Driver Probe Response offloading support for WPS ver. 1 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002366#define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS 0x00000001
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002367/** Driver Probe Response offloading support for WPS ver. 2 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002368#define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS2 0x00000002
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002369/** Driver Probe Response offloading support for P2P */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002370#define WPA_DRIVER_PROBE_RESP_OFFLOAD_P2P 0x00000004
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002371/** Driver Probe Response offloading support for IEEE 802.11u (Interworking) */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002372#define WPA_DRIVER_PROBE_RESP_OFFLOAD_INTERWORKING 0x00000008
2373 unsigned int probe_resp_offloads;
Dmitry Shmidt444d5672013-04-01 13:08:44 -07002374
Dmitry Shmidt8bae4132013-06-06 11:25:10 -07002375 unsigned int max_acl_mac_addrs;
2376
Dmitry Shmidt444d5672013-04-01 13:08:44 -07002377 /**
Dmitry Shmidtc2ebb4b2013-07-24 12:57:51 -07002378 * Number of supported concurrent channels
2379 */
2380 unsigned int num_multichan_concurrent;
2381
2382 /**
Dmitry Shmidt444d5672013-04-01 13:08:44 -07002383 * extended_capa - extended capabilities in driver/device
2384 *
2385 * Must be allocated and freed by driver and the pointers must be
2386 * valid for the lifetime of the driver, i.e., freed in deinit()
2387 */
2388 const u8 *extended_capa, *extended_capa_mask;
2389 unsigned int extended_capa_len;
Dmitry Shmidtb58836e2014-04-29 14:35:56 -07002390
2391 struct wowlan_triggers wowlan_triggers;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002392
2393/** Driver adds the DS Params Set IE in Probe Request frames */
2394#define WPA_DRIVER_FLAGS_DS_PARAM_SET_IE_IN_PROBES 0x00000001
2395/** Driver adds the WFA TPC IE in Probe Request frames */
2396#define WPA_DRIVER_FLAGS_WFA_TPC_IE_IN_PROBES 0x00000002
2397/** Driver handles quiet period requests */
2398#define WPA_DRIVER_FLAGS_QUIET 0x00000004
2399/**
2400 * Driver is capable of inserting the current TX power value into the body of
2401 * transmitted frames.
2402 * Background: Some Action frames include a TPC Report IE. This IE contains a
2403 * TX power field, which has to be updated by lower layers. One such Action
2404 * frame is Link Measurement Report (part of RRM). Another is TPC Report (part
2405 * of spectrum management). Note that this insertion takes place at a fixed
2406 * offset, namely the 6th byte in the Action frame body.
2407 */
2408#define WPA_DRIVER_FLAGS_TX_POWER_INSERTION 0x00000008
Dmitry Shmidt849734c2016-05-27 09:59:01 -07002409/**
2410 * Driver supports RRM. With this support, the driver will accept to use RRM in
2411 * (Re)Association Request frames, without supporting quiet period.
2412 */
2413#define WPA_DRIVER_FLAGS_SUPPORT_RRM 0x00000010
2414
Dmitry Shmidt29333592017-01-09 12:27:11 -08002415/** Driver supports setting the scan dwell time */
2416#define WPA_DRIVER_FLAGS_SUPPORT_SET_SCAN_DWELL 0x00000020
2417/** Driver supports Beacon Report Measurement */
2418#define WPA_DRIVER_FLAGS_SUPPORT_BEACON_REPORT 0x00000040
2419
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002420 u32 rrm_flags;
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002421
2422 /* Driver concurrency capabilities */
2423 unsigned int conc_capab;
2424 /* Maximum number of concurrent channels on 2.4 GHz */
2425 unsigned int max_conc_chan_2_4;
2426 /* Maximum number of concurrent channels on 5 GHz */
2427 unsigned int max_conc_chan_5_0;
2428
2429 /* Maximum number of supported CSA counters */
2430 u16 max_csa_counters;
Sunil Ravi89eba102022-09-13 21:04:37 -07002431
2432 /* Maximum number of supported AKM suites in commands */
2433 unsigned int max_num_akms;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002434
2435 /* Maximum number of interfaces supported for MBSSID advertisement */
2436 unsigned int mbssid_max_interfaces;
2437 /* Maximum profile periodicity for enhanced MBSSID advertisement */
2438 unsigned int ema_max_periodicity;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002439};
2440
2441
2442struct hostapd_data;
2443
Sunil Ravi036cec52023-03-29 11:35:17 -07002444enum guard_interval {
2445 GUARD_INTERVAL_0_4 = 1,
2446 GUARD_INTERVAL_0_8 = 2,
2447 GUARD_INTERVAL_1_6 = 3,
2448 GUARD_INTERVAL_3_2 = 4,
2449};
2450
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002451#define STA_DRV_DATA_TX_MCS BIT(0)
2452#define STA_DRV_DATA_RX_MCS BIT(1)
2453#define STA_DRV_DATA_TX_VHT_MCS BIT(2)
2454#define STA_DRV_DATA_RX_VHT_MCS BIT(3)
2455#define STA_DRV_DATA_TX_VHT_NSS BIT(4)
2456#define STA_DRV_DATA_RX_VHT_NSS BIT(5)
2457#define STA_DRV_DATA_TX_SHORT_GI BIT(6)
2458#define STA_DRV_DATA_RX_SHORT_GI BIT(7)
Roshan Pius3a1667e2018-07-03 15:17:14 -07002459#define STA_DRV_DATA_LAST_ACK_RSSI BIT(8)
Hai Shalomc1a21442022-02-04 13:43:00 -08002460#define STA_DRV_DATA_CONN_TIME BIT(9)
Sunil Ravi77d572f2023-01-17 23:58:31 +00002461#define STA_DRV_DATA_TX_HE_MCS BIT(10)
2462#define STA_DRV_DATA_RX_HE_MCS BIT(11)
2463#define STA_DRV_DATA_TX_HE_NSS BIT(12)
2464#define STA_DRV_DATA_RX_HE_NSS BIT(13)
Sunil Ravi036cec52023-03-29 11:35:17 -07002465#define STA_DRV_DATA_TX_HE_DCM BIT(14)
2466#define STA_DRV_DATA_RX_HE_DCM BIT(15)
2467#define STA_DRV_DATA_TX_HE_GI BIT(16)
2468#define STA_DRV_DATA_RX_HE_GI BIT(17)
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002469
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002470struct hostap_sta_driver_data {
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002471 unsigned long rx_packets, tx_packets;
2472 unsigned long long rx_bytes, tx_bytes;
Hai Shalom81f62d82019-07-22 12:10:00 -07002473 unsigned long long rx_airtime, tx_airtime;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002474 unsigned long long beacons_count;
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002475 int bytes_64bit; /* whether 64-bit byte counters are supported */
Sunil Ravi77d572f2023-01-17 23:58:31 +00002476 unsigned long current_tx_rate; /* in kbps */
2477 unsigned long current_rx_rate; /* in kbps */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002478 unsigned long inactive_msec;
Hai Shalomc1a21442022-02-04 13:43:00 -08002479 unsigned long connected_sec;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002480 unsigned long flags; /* bitfield of STA_DRV_DATA_* */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002481 unsigned long num_ps_buf_frames;
2482 unsigned long tx_retry_failed;
2483 unsigned long tx_retry_count;
Roshan Pius3a1667e2018-07-03 15:17:14 -07002484 s8 last_ack_rssi;
Hai Shalom81f62d82019-07-22 12:10:00 -07002485 unsigned long backlog_packets;
2486 unsigned long backlog_bytes;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002487 unsigned long fcs_error_count;
2488 unsigned long beacon_loss_count;
2489 unsigned long expected_throughput;
2490 unsigned long rx_drop_misc;
2491 unsigned long rx_mpdus;
2492 int signal; /* dBm; or -WPA_INVALID_NOISE */
2493 u8 rx_hemcs;
2494 u8 tx_hemcs;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002495 u8 rx_vhtmcs;
2496 u8 tx_vhtmcs;
2497 u8 rx_mcs;
2498 u8 tx_mcs;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002499 u8 rx_he_nss;
2500 u8 tx_he_nss;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002501 u8 rx_vht_nss;
2502 u8 tx_vht_nss;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002503 s8 avg_signal; /* dBm */
2504 s8 avg_beacon_signal; /* dBm */
2505 s8 avg_ack_signal; /* dBm */
Sunil Ravi036cec52023-03-29 11:35:17 -07002506 enum guard_interval rx_guard_interval, tx_guard_interval;
2507 u8 rx_dcm, tx_dcm;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002508};
2509
2510struct hostapd_sta_add_params {
2511 const u8 *addr;
2512 u16 aid;
2513 u16 capability;
2514 const u8 *supp_rates;
2515 size_t supp_rates_len;
2516 u16 listen_interval;
2517 const struct ieee80211_ht_capabilities *ht_capabilities;
Dmitry Shmidta54fa5f2013-01-15 13:53:35 -08002518 const struct ieee80211_vht_capabilities *vht_capabilities;
Dmitry Shmidtbd14a572014-02-18 10:33:49 -08002519 int vht_opmode_enabled;
2520 u8 vht_opmode;
Hai Shalom81f62d82019-07-22 12:10:00 -07002521 const struct ieee80211_he_capabilities *he_capab;
2522 size_t he_capab_len;
Hai Shalom4fbc08f2020-05-18 12:37:00 -07002523 const struct ieee80211_he_6ghz_band_cap *he_6ghz_capab;
Sunil Ravia04bd252022-05-02 22:54:18 -07002524 const struct ieee80211_eht_capabilities *eht_capab;
2525 size_t eht_capab_len;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002526 u32 flags; /* bitmask of WPA_STA_* flags */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002527 u32 flags_mask; /* unset bits in flags */
2528#ifdef CONFIG_MESH
2529 enum mesh_plink_state plink_state;
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07002530 u16 peer_aid;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002531#endif /* CONFIG_MESH */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002532 int set; /* Set STA parameters instead of add */
2533 u8 qosinfo;
Dmitry Shmidtf8623282013-02-20 14:34:59 -08002534 const u8 *ext_capab;
2535 size_t ext_capab_len;
Dmitry Shmidt344abd32014-01-14 13:17:00 -08002536 const u8 *supp_channels;
2537 size_t supp_channels_len;
2538 const u8 *supp_oper_classes;
2539 size_t supp_oper_classes_len;
Dmitry Shmidt849734c2016-05-27 09:59:01 -07002540 int support_p2p_ps;
Sunil Ravi036cec52023-03-29 11:35:17 -07002541
2542 bool mld_link_sta;
2543 s8 mld_link_id;
2544 const u8 *mld_link_addr;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002545};
2546
Dmitry Shmidt8bae4132013-06-06 11:25:10 -07002547struct mac_address {
2548 u8 addr[ETH_ALEN];
2549};
2550
2551struct hostapd_acl_params {
2552 u8 acl_policy;
2553 unsigned int num_mac_acl;
2554 struct mac_address mac_acl[0];
2555};
2556
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002557struct wpa_init_params {
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002558 void *global_priv;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002559 const u8 *bssid;
2560 const char *ifname;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002561 const char *driver_params;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002562 int use_pae_group_addr;
2563 char **bridge;
2564 size_t num_bridge;
2565
2566 u8 *own_addr; /* buffer for writing own MAC address */
2567};
2568
2569
2570struct wpa_bss_params {
2571 /** Interface name (for multi-SSID/VLAN support) */
2572 const char *ifname;
2573 /** Whether IEEE 802.1X or WPA/WPA2 is enabled */
2574 int enabled;
2575
2576 int wpa;
2577 int ieee802_1x;
2578 int wpa_group;
2579 int wpa_pairwise;
2580 int wpa_key_mgmt;
2581 int rsn_preauth;
2582 enum mfp_options ieee80211w;
2583};
2584
2585#define WPA_STA_AUTHORIZED BIT(0)
2586#define WPA_STA_WMM BIT(1)
2587#define WPA_STA_SHORT_PREAMBLE BIT(2)
2588#define WPA_STA_MFP BIT(3)
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002589#define WPA_STA_TDLS_PEER BIT(4)
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002590#define WPA_STA_AUTHENTICATED BIT(5)
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002591#define WPA_STA_ASSOCIATED BIT(6)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002592
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002593enum tdls_oper {
2594 TDLS_DISCOVERY_REQ,
2595 TDLS_SETUP,
2596 TDLS_TEARDOWN,
2597 TDLS_ENABLE_LINK,
2598 TDLS_DISABLE_LINK,
2599 TDLS_ENABLE,
2600 TDLS_DISABLE
2601};
2602
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07002603enum wnm_oper {
2604 WNM_SLEEP_ENTER_CONFIRM,
2605 WNM_SLEEP_ENTER_FAIL,
2606 WNM_SLEEP_EXIT_CONFIRM,
2607 WNM_SLEEP_EXIT_FAIL,
2608 WNM_SLEEP_TFS_REQ_IE_ADD, /* STA requests driver to add TFS req IE */
2609 WNM_SLEEP_TFS_REQ_IE_NONE, /* STA requests empty TFS req IE */
2610 WNM_SLEEP_TFS_REQ_IE_SET, /* AP requests driver to set TFS req IE for
2611 * a STA */
2612 WNM_SLEEP_TFS_RESP_IE_ADD, /* AP requests driver to add TFS resp IE
2613 * for a STA */
2614 WNM_SLEEP_TFS_RESP_IE_NONE, /* AP requests empty TFS resp IE */
2615 WNM_SLEEP_TFS_RESP_IE_SET, /* AP requests driver to set TFS resp IE
2616 * for a STA */
2617 WNM_SLEEP_TFS_IE_DEL /* AP delete the TFS IE */
2618};
2619
Roshan Pius3a1667e2018-07-03 15:17:14 -07002620/* enum smps_mode - SMPS mode definitions */
2621enum smps_mode {
2622 SMPS_AUTOMATIC,
2623 SMPS_OFF,
2624 SMPS_DYNAMIC,
2625 SMPS_STATIC,
2626
2627 /* Keep last */
2628 SMPS_INVALID,
2629};
2630
Hai Shalom74f70d42019-02-11 14:42:39 -08002631#define WPA_INVALID_NOISE 9999
Dmitry Shmidt34af3062013-07-11 10:46:32 -07002632
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002633/**
2634 * struct wpa_signal_info - Information about channel signal quality
Hai Shalom74f70d42019-02-11 14:42:39 -08002635 * @frequency: control frequency
2636 * @above_threshold: true if the above threshold was crossed
2637 * (relevant for a CQM event)
Sunil Ravi77d572f2023-01-17 23:58:31 +00002638 * @data: STA information
Hai Shalom74f70d42019-02-11 14:42:39 -08002639 * @current_noise: %WPA_INVALID_NOISE if not supported
Hai Shalom74f70d42019-02-11 14:42:39 -08002640 * @chanwidth: channel width
2641 * @center_frq1: center frequency for the first segment
2642 * @center_frq2: center frequency for the second segment (if relevant)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002643 */
2644struct wpa_signal_info {
2645 u32 frequency;
2646 int above_threshold;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002647 struct hostap_sta_driver_data data;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002648 int current_noise;
Dmitry Shmidt34af3062013-07-11 10:46:32 -07002649 enum chan_width chanwidth;
2650 int center_frq1;
2651 int center_frq2;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002652};
2653
Sunil Ravi89eba102022-09-13 21:04:37 -07002654struct wpa_mlo_signal_info {
2655 u16 valid_links;
2656 struct wpa_signal_info links[MAX_NUM_MLD_LINKS];
2657};
2658
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002659/**
Hai Shalom74f70d42019-02-11 14:42:39 -08002660 * struct wpa_channel_info - Information about the current channel
2661 * @frequency: Center frequency of the primary 20 MHz channel
2662 * @chanwidth: Width of the current operating channel
2663 * @sec_channel: Location of the secondary 20 MHz channel (either +1 or -1).
2664 * This field is only filled in when using a 40 MHz channel.
2665 * @center_frq1: Center frequency of frequency segment 0
2666 * @center_frq2: Center frequency of frequency segment 1 (for 80+80 channels)
2667 * @seg1_idx: Frequency segment 1 index when using a 80+80 channel. This is
2668 * derived from center_frq2 for convenience.
2669 */
2670struct wpa_channel_info {
2671 u32 frequency;
2672 enum chan_width chanwidth;
2673 int sec_channel;
2674 int center_frq1;
2675 int center_frq2;
2676 u8 seg1_idx;
2677};
2678
2679/**
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002680 * struct beacon_data - Beacon data
2681 * @head: Head portion of Beacon frame (before TIM IE)
2682 * @tail: Tail portion of Beacon frame (after TIM IE)
2683 * @beacon_ies: Extra information element(s) to add into Beacon frames or %NULL
2684 * @proberesp_ies: Extra information element(s) to add into Probe Response
2685 * frames or %NULL
2686 * @assocresp_ies: Extra information element(s) to add into (Re)Association
2687 * Response frames or %NULL
2688 * @probe_resp: Probe Response frame template
2689 * @head_len: Length of @head
2690 * @tail_len: Length of @tail
2691 * @beacon_ies_len: Length of beacon_ies in octets
2692 * @proberesp_ies_len: Length of proberesp_ies in octets
2693 * @proberesp_ies_len: Length of proberesp_ies in octets
2694 * @probe_resp_len: Length of probe response template (@probe_resp)
2695 */
2696struct beacon_data {
2697 u8 *head, *tail;
2698 u8 *beacon_ies;
2699 u8 *proberesp_ies;
2700 u8 *assocresp_ies;
2701 u8 *probe_resp;
2702
2703 size_t head_len, tail_len;
2704 size_t beacon_ies_len;
2705 size_t proberesp_ies_len;
2706 size_t assocresp_ies_len;
2707 size_t probe_resp_len;
2708};
2709
2710/**
2711 * struct csa_settings - Settings for channel switch command
2712 * @cs_count: Count in Beacon frames (TBTT) to perform the switch
2713 * @block_tx: 1 - block transmission for CSA period
2714 * @freq_params: Next channel frequency parameter
2715 * @beacon_csa: Beacon/probe resp/asooc resp info for CSA period
2716 * @beacon_after: Next beacon/probe resp/asooc resp info
2717 * @counter_offset_beacon: Offset to the count field in beacon's tail
2718 * @counter_offset_presp: Offset to the count field in probe resp.
Sunil Ravi036cec52023-03-29 11:35:17 -07002719 * @punct_bitmap - Preamble puncturing bitmap
Sunil Ravib0ac25f2024-07-12 01:42:03 +00002720 * @link_id: Link ID to determine the link for MLD; -1 for non-MLD
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002721 */
2722struct csa_settings {
2723 u8 cs_count;
2724 u8 block_tx;
2725
2726 struct hostapd_freq_params freq_params;
2727 struct beacon_data beacon_csa;
2728 struct beacon_data beacon_after;
2729
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002730 u16 counter_offset_beacon[2];
2731 u16 counter_offset_presp[2];
Sunil Ravi036cec52023-03-29 11:35:17 -07002732
2733 u16 punct_bitmap;
Sunil Ravib0ac25f2024-07-12 01:42:03 +00002734 int link_id;
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002735};
2736
Sunil Ravia04bd252022-05-02 22:54:18 -07002737/**
2738 * struct cca_settings - Settings for color switch command
2739 * @cca_count: Count in Beacon frames (TBTT) to perform the switch
2740 * @cca_color: The new color that we are switching to
2741 * @beacon_cca: Beacon/Probe Response/(Re)Association Response frame info for
2742 * color switch period
2743 * @beacon_after: Next Beacon/Probe Response/(Re)Association Response frame info
2744 * @counter_offset_beacon: Offset to the count field in Beacon frame tail
2745 * @counter_offset_presp: Offset to the count field in Probe Response frame
2746 */
2747struct cca_settings {
2748 u8 cca_count;
2749 u8 cca_color;
2750
2751 struct beacon_data beacon_cca;
2752 struct beacon_data beacon_after;
2753
2754 u16 counter_offset_beacon;
2755 u16 counter_offset_presp;
2756};
2757
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07002758/* TDLS peer capabilities for send_tdls_mgmt() */
2759enum tdls_peer_capability {
2760 TDLS_PEER_HT = BIT(0),
2761 TDLS_PEER_VHT = BIT(1),
2762 TDLS_PEER_WMM = BIT(2),
Hai Shalomc1a21442022-02-04 13:43:00 -08002763 TDLS_PEER_HE = BIT(3),
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07002764};
2765
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002766/* valid info in the wmm_params struct */
2767enum wmm_params_valid_info {
2768 WMM_PARAMS_UAPSD_QUEUES_INFO = BIT(0),
2769};
2770
2771/**
2772 * struct wmm_params - WMM parameterss configured for this association
2773 * @info_bitmap: Bitmap of valid wmm_params info; indicates what fields
2774 * of the struct contain valid information.
2775 * @uapsd_queues: Bitmap of ACs configured for uapsd (valid only if
2776 * %WMM_PARAMS_UAPSD_QUEUES_INFO is set)
2777 */
2778struct wmm_params {
2779 u8 info_bitmap;
2780 u8 uapsd_queues;
2781};
2782
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07002783#ifdef CONFIG_MACSEC
2784struct macsec_init_params {
Hai Shalome21d4e82020-04-29 16:34:06 -07002785 bool always_include_sci;
2786 bool use_es;
2787 bool use_scb;
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07002788};
2789#endif /* CONFIG_MACSEC */
2790
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002791enum drv_br_port_attr {
2792 DRV_BR_PORT_ATTR_PROXYARP,
2793 DRV_BR_PORT_ATTR_HAIRPIN_MODE,
Sunil Ravi036cec52023-03-29 11:35:17 -07002794 DRV_BR_PORT_ATTR_MCAST2UCAST,
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002795};
2796
2797enum drv_br_net_param {
2798 DRV_BR_NET_PARAM_GARP_ACCEPT,
Dmitry Shmidt83474442015-04-15 13:47:09 -07002799 DRV_BR_MULTICAST_SNOOPING,
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002800};
2801
2802struct drv_acs_params {
2803 /* Selected mode (HOSTAPD_MODE_*) */
2804 enum hostapd_hw_mode hw_mode;
2805
2806 /* Indicates whether HT is enabled */
2807 int ht_enabled;
2808
2809 /* Indicates whether HT40 is enabled */
2810 int ht40_enabled;
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07002811
2812 /* Indicates whether VHT is enabled */
2813 int vht_enabled;
2814
2815 /* Configured ACS channel width */
2816 u16 ch_width;
2817
Ahmed ElArabawy0ff61c52019-12-26 12:38:39 -08002818 /* ACS frequency list info */
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002819 const int *freq_list;
Hai Shalomfdcde762020-04-02 11:19:20 -07002820
2821 /* Indicates whether EDMG is enabled */
2822 int edmg_enabled;
Sunil Ravia04bd252022-05-02 22:54:18 -07002823
2824 /* Indicates whether EHT is enabled */
2825 bool eht_enabled;
Sunil Ravib0ac25f2024-07-12 01:42:03 +00002826
2827 /* Indicates the link if MLO case; -1 otherwise */
2828 int link_id;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002829};
2830
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002831struct wpa_bss_trans_info {
2832 u8 mbo_transition_reason;
2833 u8 n_candidates;
2834 u8 *bssid;
2835};
2836
2837struct wpa_bss_candidate_info {
2838 u8 num;
2839 struct candidate_list {
2840 u8 bssid[ETH_ALEN];
2841 u8 is_accept;
2842 u32 reject_reason;
2843 } *candidates;
2844};
2845
2846struct wpa_pmkid_params {
2847 const u8 *bssid;
2848 const u8 *ssid;
2849 size_t ssid_len;
2850 const u8 *fils_cache_id;
2851 const u8 *pmkid;
2852 const u8 *pmk;
2853 size_t pmk_len;
Hai Shalomfdcde762020-04-02 11:19:20 -07002854 u32 pmk_lifetime;
2855 u8 pmk_reauth_threshold;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002856};
2857
2858/* Mask used to specify which connection parameters have to be updated */
2859enum wpa_drv_update_connect_params_mask {
2860 WPA_DRV_UPDATE_ASSOC_IES = BIT(0),
2861 WPA_DRV_UPDATE_FILS_ERP_INFO = BIT(1),
2862 WPA_DRV_UPDATE_AUTH_TYPE = BIT(2),
Winnie Chen4138eec2022-11-10 16:32:53 +08002863#if defined(CONFIG_DRIVER_NL80211_BRCM) || defined(CONFIG_DRIVER_NL80211_SYNA)
Vinayak Yadawade62409f2022-01-20 12:32:07 +05302864 WPA_DRV_UPDATE_TD_POLICY = BIT(3),
Winnie Chen4138eec2022-11-10 16:32:53 +08002865#endif /* CONFIG_DRIVER_NL80211_BRCM || CONFIG_DRIVER_NL80211_SYNA */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002866};
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07002867
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002868/**
Roshan Pius3a1667e2018-07-03 15:17:14 -07002869 * struct external_auth - External authentication trigger parameters
2870 *
2871 * These are used across the external authentication request and event
2872 * interfaces.
2873 * @action: Action type / trigger for external authentication. Only significant
2874 * for the event interface.
2875 * @bssid: BSSID of the peer with which the authentication has to happen. Used
2876 * by both the request and event interface.
2877 * @ssid: SSID of the AP. Used by both the request and event interface.
2878 * @ssid_len: SSID length in octets.
2879 * @key_mgmt_suite: AKM suite of the respective authentication. Optional for
2880 * the request interface.
2881 * @status: Status code, %WLAN_STATUS_SUCCESS for successful authentication,
2882 * use %WLAN_STATUS_UNSPECIFIED_FAILURE if wpa_supplicant cannot give
2883 * the real status code for failures. Used only for the request interface
2884 * from user space to the driver.
Hai Shalom5f92bc92019-04-18 11:54:11 -07002885 * @pmkid: Generated PMKID as part of external auth exchange (e.g., SAE).
Sunil Ravi036cec52023-03-29 11:35:17 -07002886 * @mld_addr: AP's MLD address or %NULL if MLO is not used
Roshan Pius3a1667e2018-07-03 15:17:14 -07002887 */
2888struct external_auth {
2889 enum {
2890 EXT_AUTH_START,
2891 EXT_AUTH_ABORT,
2892 } action;
Hai Shalom5f92bc92019-04-18 11:54:11 -07002893 const u8 *bssid;
2894 const u8 *ssid;
Roshan Pius3a1667e2018-07-03 15:17:14 -07002895 size_t ssid_len;
2896 unsigned int key_mgmt_suite;
2897 u16 status;
Hai Shalom5f92bc92019-04-18 11:54:11 -07002898 const u8 *pmkid;
Sunil Ravi036cec52023-03-29 11:35:17 -07002899 const u8 *mld_addr;
Roshan Pius3a1667e2018-07-03 15:17:14 -07002900};
2901
Sunil Ravi89eba102022-09-13 21:04:37 -07002902#define WPAS_MAX_PASN_PEERS 10
2903
2904enum pasn_status {
2905 PASN_STATUS_SUCCESS = 0,
2906 PASN_STATUS_FAILURE = 1,
2907};
2908
2909/**
2910 * struct pasn_peer - PASN peer parameters
2911 *
2912 * Used to process the PASN authentication event from the driver to
2913 * userspace and to send a response back.
2914 * @own_addr: Own MAC address specified by the driver to use for PASN
2915 * handshake.
2916 * @peer_addr: MAC address of the peer with which PASN authentication is to be
2917 * performed.
2918 * @network_id: Unique id for the network.
2919 * This identifier is used as a unique identifier for each network
2920 * block when using the control interface. Each network is allocated an
2921 * id when it is being created, either when reading the configuration
2922 * file or when a new network is added through the control interface.
2923 * @akmp: Authentication key management protocol type supported.
2924 * @cipher: Cipher suite.
2925 * @group: Finite cyclic group. Default group used is 19 (ECC).
2926 * @ltf_keyseed_required: Indicates whether LTF keyseed generation is required
2927 * @status: PASN response status, %PASN_STATUS_SUCCESS for successful
2928 * authentication, use %PASN_STATUS_FAILURE if PASN authentication
2929 * fails or if wpa_supplicant fails to set the security ranging context to
2930 * the driver
2931 */
2932struct pasn_peer {
2933 u8 own_addr[ETH_ALEN];
2934 u8 peer_addr[ETH_ALEN];
2935 int network_id;
2936 int akmp;
2937 int cipher;
2938 int group;
2939 bool ltf_keyseed_required;
2940 enum pasn_status status;
2941};
2942
2943/**
2944 * struct pasn_auth - PASN authentication trigger parameters
2945 *
2946 * These are used across the PASN authentication event from the driver to
2947 * userspace and to send a response to it.
2948 * @action: Action type. Only significant for the event interface.
2949 * @num_peers: The number of peers for which the PASN handshake is requested
2950 * for.
2951 * @peer: Holds the peer details.
2952 */
2953struct pasn_auth {
2954 enum {
2955 PASN_ACTION_AUTH,
2956 PASN_ACTION_DELETE_SECURE_RANGING_CONTEXT,
2957 } action;
2958 unsigned int num_peers;
2959 struct pasn_peer peer[WPAS_MAX_PASN_PEERS];
2960};
2961
2962/**
2963 * struct secure_ranging_params - Parameters required to set secure ranging
2964 * context for a peer.
2965 *
2966 * @action: Add or delete a security context to the driver.
2967 * @own_addr: Own MAC address used during key derivation.
2968 * @peer_addr: Address of the peer device.
2969 * @cipher: Cipher suite.
2970 * @tk_len: Length of temporal key.
2971 * @tk: Temporal key buffer.
2972 * @ltf_keyseed_len: Length of LTF keyseed.
2973 * @ltf_keyeed: LTF keyseed buffer.
2974 */
2975struct secure_ranging_params {
2976 u32 action;
2977 const u8 *own_addr;
2978 const u8 *peer_addr;
2979 u32 cipher;
2980 u8 tk_len;
2981 const u8 *tk;
2982 u8 ltf_keyseed_len;
2983 const u8 *ltf_keyseed;
2984};
2985
Hai Shalom60840252021-02-19 19:02:11 -08002986/* enum nested_attr - Used to specify if subcommand uses nested attributes */
2987enum nested_attr {
2988 NESTED_ATTR_NOT_USED = 0,
2989 NESTED_ATTR_USED = 1,
2990 NESTED_ATTR_UNSPECIFIED = 2,
2991};
2992
Sunil8cd6f4d2022-06-28 18:40:46 +00002993/* Preferred channel list information */
2994
2995/* GO role */
2996#define WEIGHTED_PCL_GO BIT(0)
2997/* P2P Client role */
2998#define WEIGHTED_PCL_CLI BIT(1)
2999/* Must be considered for operating channel */
3000#define WEIGHTED_PCL_MUST_CONSIDER BIT(2)
3001/* Should be excluded in GO negotiation */
3002#define WEIGHTED_PCL_EXCLUDE BIT(3)
3003
3004/* Preferred channel list with weight */
3005struct weighted_pcl {
3006 u32 freq; /* MHz */
3007 u8 weight;
3008 u32 flag; /* bitmap for WEIGHTED_PCL_* */
3009};
3010
Sunil Ravi89eba102022-09-13 21:04:37 -07003011struct driver_sta_mlo_info {
Sunil Ravi640215c2023-06-28 23:08:09 +00003012 bool default_map;
Sunil Ravi77d572f2023-01-17 23:58:31 +00003013 u16 req_links; /* bitmap of requested link IDs */
3014 u16 valid_links; /* bitmap of accepted link IDs */
3015 u8 assoc_link_id;
Sunil Ravi89eba102022-09-13 21:04:37 -07003016 u8 ap_mld_addr[ETH_ALEN];
3017 struct {
3018 u8 addr[ETH_ALEN];
3019 u8 bssid[ETH_ALEN];
3020 unsigned int freq;
Sunil Ravi640215c2023-06-28 23:08:09 +00003021 struct t2lm_mapping t2lmap;
Sunil Ravi89eba102022-09-13 21:04:37 -07003022 } links[MAX_NUM_MLD_LINKS];
3023};
3024
Roshan Pius3a1667e2018-07-03 15:17:14 -07003025/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003026 * struct wpa_driver_ops - Driver interface API definition
3027 *
3028 * This structure defines the API that each driver interface needs to implement
3029 * for core wpa_supplicant code. All driver specific functionality is captured
3030 * in this wrapper.
3031 */
3032struct wpa_driver_ops {
3033 /** Name of the driver interface */
3034 const char *name;
3035 /** One line description of the driver interface */
3036 const char *desc;
3037
3038 /**
3039 * get_bssid - Get the current BSSID
3040 * @priv: private driver interface data
3041 * @bssid: buffer for BSSID (ETH_ALEN = 6 bytes)
3042 *
3043 * Returns: 0 on success, -1 on failure
3044 *
3045 * Query kernel driver for the current BSSID and copy it to bssid.
3046 * Setting bssid to 00:00:00:00:00:00 is recommended if the STA is not
3047 * associated.
3048 */
3049 int (*get_bssid)(void *priv, u8 *bssid);
3050
3051 /**
3052 * get_ssid - Get the current SSID
3053 * @priv: private driver interface data
3054 * @ssid: buffer for SSID (at least 32 bytes)
3055 *
3056 * Returns: Length of the SSID on success, -1 on failure
3057 *
3058 * Query kernel driver for the current SSID and copy it to ssid.
3059 * Returning zero is recommended if the STA is not associated.
3060 *
3061 * Note: SSID is an array of octets, i.e., it is not nul terminated and
3062 * can, at least in theory, contain control characters (including nul)
3063 * and as such, should be processed as binary data, not a printable
3064 * string.
3065 */
3066 int (*get_ssid)(void *priv, u8 *ssid);
3067
3068 /**
3069 * set_key - Configure encryption key
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003070 * @priv: private driver interface data
Hai Shalomfdcde762020-04-02 11:19:20 -07003071 * @params: Key parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003072 * Returns: 0 on success, -1 on failure
3073 *
3074 * Configure the given key for the kernel driver. If the driver
3075 * supports separate individual keys (4 default keys + 1 individual),
3076 * addr can be used to determine whether the key is default or
3077 * individual. If only 4 keys are supported, the default key with key
3078 * index 0 is used as the individual key. STA must be configured to use
3079 * it as the default Tx key (set_tx is set) and accept Rx for all the
3080 * key indexes. In most cases, WPA uses only key indexes 1 and 2 for
3081 * broadcast keys, so key index 0 is available for this kind of
3082 * configuration.
3083 *
3084 * Please note that TKIP keys include separate TX and RX MIC keys and
3085 * some drivers may expect them in different order than wpa_supplicant
3086 * is using. If the TX/RX keys are swapped, all TKIP encrypted packets
3087 * will trigger Michael MIC errors. This can be fixed by changing the
Sunil Ravia04bd252022-05-02 22:54:18 -07003088 * order of MIC keys by swapping the bytes 16..23 and 24..31 of the key
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003089 * in driver_*.c set_key() implementation, see driver_ndis.c for an
3090 * example on how this can be done.
3091 */
Hai Shalomfdcde762020-04-02 11:19:20 -07003092 int (*set_key)(void *priv, struct wpa_driver_set_key_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003093
3094 /**
3095 * init - Initialize driver interface
3096 * @ctx: context to be used when calling wpa_supplicant functions,
3097 * e.g., wpa_supplicant_event()
3098 * @ifname: interface name, e.g., wlan0
3099 *
3100 * Returns: Pointer to private data, %NULL on failure
3101 *
3102 * Initialize driver interface, including event processing for kernel
3103 * driver events (e.g., associated, scan results, Michael MIC failure).
3104 * This function can allocate a private configuration data area for
3105 * @ctx, file descriptor, interface name, etc. information that may be
3106 * needed in future driver operations. If this is not used, non-NULL
3107 * value will need to be returned because %NULL is used to indicate
3108 * failure. The returned value will be used as 'void *priv' data for
3109 * all other driver_ops functions.
3110 *
3111 * The main event loop (eloop.c) of wpa_supplicant can be used to
3112 * register callback for read sockets (eloop_register_read_sock()).
3113 *
3114 * See below for more information about events and
3115 * wpa_supplicant_event() function.
3116 */
3117 void * (*init)(void *ctx, const char *ifname);
3118
3119 /**
3120 * deinit - Deinitialize driver interface
3121 * @priv: private driver interface data from init()
3122 *
3123 * Shut down driver interface and processing of driver events. Free
3124 * private data buffer if one was allocated in init() handler.
3125 */
3126 void (*deinit)(void *priv);
3127
3128 /**
3129 * set_param - Set driver configuration parameters
3130 * @priv: private driver interface data from init()
3131 * @param: driver specific configuration parameters
3132 *
3133 * Returns: 0 on success, -1 on failure
3134 *
3135 * Optional handler for notifying driver interface about configuration
3136 * parameters (driver_param).
3137 */
3138 int (*set_param)(void *priv, const char *param);
3139
3140 /**
3141 * set_countermeasures - Enable/disable TKIP countermeasures
3142 * @priv: private driver interface data
3143 * @enabled: 1 = countermeasures enabled, 0 = disabled
3144 *
3145 * Returns: 0 on success, -1 on failure
3146 *
3147 * Configure TKIP countermeasures. When these are enabled, the driver
3148 * should drop all received and queued frames that are using TKIP.
3149 */
3150 int (*set_countermeasures)(void *priv, int enabled);
3151
3152 /**
3153 * deauthenticate - Request driver to deauthenticate
3154 * @priv: private driver interface data
3155 * @addr: peer address (BSSID of the AP)
3156 * @reason_code: 16-bit reason code to be sent in the deauthentication
3157 * frame
3158 *
3159 * Returns: 0 on success, -1 on failure
3160 */
Hai Shalom81f62d82019-07-22 12:10:00 -07003161 int (*deauthenticate)(void *priv, const u8 *addr, u16 reason_code);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003162
3163 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003164 * associate - Request driver to associate
3165 * @priv: private driver interface data
3166 * @params: association parameters
3167 *
3168 * Returns: 0 on success, -1 on failure
3169 */
3170 int (*associate)(void *priv,
3171 struct wpa_driver_associate_params *params);
3172
3173 /**
3174 * add_pmkid - Add PMKSA cache entry to the driver
3175 * @priv: private driver interface data
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003176 * @params: PMKSA parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003177 *
3178 * Returns: 0 on success, -1 on failure
3179 *
3180 * This function is called when a new PMK is received, as a result of
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003181 * either normal authentication or RSN pre-authentication. The PMKSA
3182 * parameters are either a set of bssid, pmkid, and pmk; or a set of
3183 * ssid, fils_cache_id, pmkid, and pmk.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003184 *
3185 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
3186 * associate(), add_pmkid() can be used to add new PMKSA cache entries
3187 * in the driver. If the driver uses wpa_ie from wpa_supplicant, this
3188 * driver_ops function does not need to be implemented. Likewise, if
3189 * the driver does not support WPA, this function is not needed.
3190 */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003191 int (*add_pmkid)(void *priv, struct wpa_pmkid_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003192
3193 /**
3194 * remove_pmkid - Remove PMKSA cache entry to the driver
3195 * @priv: private driver interface data
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003196 * @params: PMKSA parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003197 *
3198 * Returns: 0 on success, -1 on failure
3199 *
3200 * This function is called when the supplicant drops a PMKSA cache
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003201 * entry for any reason. The PMKSA parameters are either a set of
3202 * bssid and pmkid; or a set of ssid, fils_cache_id, and pmkid.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003203 *
3204 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
3205 * associate(), remove_pmkid() can be used to synchronize PMKSA caches
3206 * between the driver and wpa_supplicant. If the driver uses wpa_ie
3207 * from wpa_supplicant, this driver_ops function does not need to be
3208 * implemented. Likewise, if the driver does not support WPA, this
3209 * function is not needed.
3210 */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003211 int (*remove_pmkid)(void *priv, struct wpa_pmkid_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003212
3213 /**
3214 * flush_pmkid - Flush PMKSA cache
3215 * @priv: private driver interface data
3216 *
3217 * Returns: 0 on success, -1 on failure
3218 *
3219 * This function is called when the supplicant drops all PMKSA cache
3220 * entries for any reason.
3221 *
3222 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
3223 * associate(), remove_pmkid() can be used to synchronize PMKSA caches
3224 * between the driver and wpa_supplicant. If the driver uses wpa_ie
3225 * from wpa_supplicant, this driver_ops function does not need to be
3226 * implemented. Likewise, if the driver does not support WPA, this
3227 * function is not needed.
3228 */
3229 int (*flush_pmkid)(void *priv);
3230
3231 /**
3232 * get_capa - Get driver capabilities
3233 * @priv: private driver interface data
3234 *
3235 * Returns: 0 on success, -1 on failure
3236 *
3237 * Get driver/firmware/hardware capabilities.
3238 */
3239 int (*get_capa)(void *priv, struct wpa_driver_capa *capa);
3240
3241 /**
3242 * poll - Poll driver for association information
3243 * @priv: private driver interface data
3244 *
Sunil Ravi77d572f2023-01-17 23:58:31 +00003245 * This is an optional callback that can be used when the driver does
3246 * not provide event mechanism for association events. This is called
3247 * when receiving WPA/RSN EAPOL-Key messages that require association
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003248 * information. The driver interface is supposed to generate associnfo
3249 * event before returning from this callback function. In addition, the
3250 * driver interface should generate an association event after having
3251 * sent out associnfo.
3252 */
3253 void (*poll)(void *priv);
3254
3255 /**
Dmitry Shmidte4663042016-04-04 10:07:49 -07003256 * get_ifindex - Get interface index
3257 * @priv: private driver interface data
3258 *
3259 * Returns: Interface index
3260 */
3261 unsigned int (*get_ifindex)(void *priv);
3262
3263 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003264 * get_ifname - Get interface name
3265 * @priv: private driver interface data
3266 *
3267 * Returns: Pointer to the interface name. This can differ from the
3268 * interface name used in init() call. Init() is called first.
3269 *
3270 * This optional function can be used to allow the driver interface to
3271 * replace the interface name with something else, e.g., based on an
3272 * interface mapping from a more descriptive name.
3273 */
3274 const char * (*get_ifname)(void *priv);
3275
3276 /**
3277 * get_mac_addr - Get own MAC address
3278 * @priv: private driver interface data
3279 *
3280 * Returns: Pointer to own MAC address or %NULL on failure
3281 *
3282 * This optional function can be used to get the own MAC address of the
3283 * device from the driver interface code. This is only needed if the
3284 * l2_packet implementation for the OS does not provide easy access to
3285 * a MAC address. */
3286 const u8 * (*get_mac_addr)(void *priv);
3287
3288 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003289 * set_operstate - Sets device operating state to DORMANT or UP
3290 * @priv: private driver interface data
3291 * @state: 0 = dormant, 1 = up
3292 * Returns: 0 on success, -1 on failure
3293 *
3294 * This is an optional function that can be used on operating systems
3295 * that support a concept of controlling network device state from user
3296 * space applications. This function, if set, gets called with
3297 * state = 1 when authentication has been completed and with state = 0
3298 * when connection is lost.
3299 */
3300 int (*set_operstate)(void *priv, int state);
3301
3302 /**
3303 * mlme_setprotection - MLME-SETPROTECTION.request primitive
3304 * @priv: Private driver interface data
3305 * @addr: Address of the station for which to set protection (may be
3306 * %NULL for group keys)
3307 * @protect_type: MLME_SETPROTECTION_PROTECT_TYPE_*
3308 * @key_type: MLME_SETPROTECTION_KEY_TYPE_*
3309 * Returns: 0 on success, -1 on failure
3310 *
3311 * This is an optional function that can be used to set the driver to
3312 * require protection for Tx and/or Rx frames. This uses the layer
3313 * interface defined in IEEE 802.11i-2004 clause 10.3.22.1
3314 * (MLME-SETPROTECTION.request). Many drivers do not use explicit
3315 * set protection operation; instead, they set protection implicitly
3316 * based on configured keys.
3317 */
3318 int (*mlme_setprotection)(void *priv, const u8 *addr, int protect_type,
3319 int key_type);
3320
3321 /**
3322 * get_hw_feature_data - Get hardware support data (channels and rates)
3323 * @priv: Private driver interface data
3324 * @num_modes: Variable for returning the number of returned modes
3325 * flags: Variable for returning hardware feature flags
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003326 * @dfs: Variable for returning DFS region (HOSTAPD_DFS_REGION_*)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003327 * Returns: Pointer to allocated hardware data on success or %NULL on
3328 * failure. Caller is responsible for freeing this.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003329 */
3330 struct hostapd_hw_modes * (*get_hw_feature_data)(void *priv,
3331 u16 *num_modes,
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003332 u16 *flags, u8 *dfs);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003333
3334 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003335 * send_mlme - Send management frame from MLME
3336 * @priv: Private driver interface data
3337 * @data: IEEE 802.11 management frame with IEEE 802.11 header
3338 * @data_len: Size of the management frame
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003339 * @noack: Do not wait for this frame to be acked (disable retries)
Dmitry Shmidta3dc3092015-06-23 11:21:28 -07003340 * @freq: Frequency (in MHz) to send the frame on, or 0 to let the
3341 * driver decide
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08003342 * @csa_offs: Array of CSA offsets or %NULL
3343 * @csa_offs_len: Number of elements in csa_offs
Hai Shalomfdcde762020-04-02 11:19:20 -07003344 * @no_encrypt: Do not encrypt frame even if appropriate key exists
3345 * (used only for testing purposes)
3346 * @wait: Time to wait off-channel for a response (in ms), or zero
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003347 * @link_id: Link ID to use for TX, or -1 if not set
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003348 * Returns: 0 on success, -1 on failure
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003349 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003350 int (*send_mlme)(void *priv, const u8 *data, size_t data_len,
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08003351 int noack, unsigned int freq, const u16 *csa_offs,
Hai Shalomfdcde762020-04-02 11:19:20 -07003352 size_t csa_offs_len, int no_encrypt,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003353 unsigned int wait, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003354
3355 /**
3356 * update_ft_ies - Update FT (IEEE 802.11r) IEs
3357 * @priv: Private driver interface data
3358 * @md: Mobility domain (2 octets) (also included inside ies)
3359 * @ies: FT IEs (MDIE, FTIE, ...) or %NULL to remove IEs
3360 * @ies_len: Length of FT IEs in bytes
3361 * Returns: 0 on success, -1 on failure
3362 *
3363 * The supplicant uses this callback to let the driver know that keying
3364 * material for FT is available and that the driver can use the
3365 * provided IEs in the next message in FT authentication sequence.
3366 *
3367 * This function is only needed for driver that support IEEE 802.11r
3368 * (Fast BSS Transition).
3369 */
3370 int (*update_ft_ies)(void *priv, const u8 *md, const u8 *ies,
3371 size_t ies_len);
3372
3373 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003374 * get_scan_results2 - Fetch the latest scan results
3375 * @priv: private driver interface data
3376 *
3377 * Returns: Allocated buffer of scan results (caller is responsible for
3378 * freeing the data structure) on success, NULL on failure
3379 */
3380 struct wpa_scan_results * (*get_scan_results2)(void *priv);
3381
3382 /**
3383 * set_country - Set country
3384 * @priv: Private driver interface data
3385 * @alpha2: country to which to switch to
3386 * Returns: 0 on success, -1 on failure
3387 *
3388 * This function is for drivers which support some form
3389 * of setting a regulatory domain.
3390 */
3391 int (*set_country)(void *priv, const char *alpha2);
3392
3393 /**
Dmitry Shmidtcce06662013-11-04 18:44:24 -08003394 * get_country - Get country
3395 * @priv: Private driver interface data
3396 * @alpha2: Buffer for returning country code (at least 3 octets)
3397 * Returns: 0 on success, -1 on failure
3398 */
3399 int (*get_country)(void *priv, char *alpha2);
3400
3401 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003402 * global_init - Global driver initialization
Dmitry Shmidte4663042016-04-04 10:07:49 -07003403 * @ctx: wpa_global pointer
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003404 * Returns: Pointer to private data (global), %NULL on failure
3405 *
3406 * This optional function is called to initialize the driver wrapper
3407 * for global data, i.e., data that applies to all interfaces. If this
3408 * function is implemented, global_deinit() will also need to be
3409 * implemented to free the private data. The driver will also likely
3410 * use init2() function instead of init() to get the pointer to global
3411 * data available to per-interface initializer.
3412 */
Dmitry Shmidte4663042016-04-04 10:07:49 -07003413 void * (*global_init)(void *ctx);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003414
3415 /**
3416 * global_deinit - Global driver deinitialization
3417 * @priv: private driver global data from global_init()
3418 *
3419 * Terminate any global driver related functionality and free the
3420 * global data structure.
3421 */
3422 void (*global_deinit)(void *priv);
3423
3424 /**
3425 * init2 - Initialize driver interface (with global data)
3426 * @ctx: context to be used when calling wpa_supplicant functions,
3427 * e.g., wpa_supplicant_event()
3428 * @ifname: interface name, e.g., wlan0
3429 * @global_priv: private driver global data from global_init()
3430 * Returns: Pointer to private data, %NULL on failure
3431 *
3432 * This function can be used instead of init() if the driver wrapper
3433 * uses global data.
3434 */
3435 void * (*init2)(void *ctx, const char *ifname, void *global_priv);
3436
3437 /**
3438 * get_interfaces - Get information about available interfaces
3439 * @global_priv: private driver global data from global_init()
3440 * Returns: Allocated buffer of interface information (caller is
3441 * responsible for freeing the data structure) on success, NULL on
3442 * failure
3443 */
3444 struct wpa_interface_info * (*get_interfaces)(void *global_priv);
3445
3446 /**
3447 * scan2 - Request the driver to initiate scan
3448 * @priv: private driver interface data
3449 * @params: Scan parameters
3450 *
3451 * Returns: 0 on success, -1 on failure
3452 *
3453 * Once the scan results are ready, the driver should report scan
3454 * results event for wpa_supplicant which will eventually request the
3455 * results with wpa_driver_get_scan_results2().
3456 */
3457 int (*scan2)(void *priv, struct wpa_driver_scan_params *params);
3458
3459 /**
3460 * authenticate - Request driver to authenticate
3461 * @priv: private driver interface data
3462 * @params: authentication parameters
3463 * Returns: 0 on success, -1 on failure
3464 *
3465 * This is an optional function that can be used with drivers that
3466 * support separate authentication and association steps, i.e., when
3467 * wpa_supplicant can act as the SME. If not implemented, associate()
3468 * function is expected to take care of IEEE 802.11 authentication,
3469 * too.
3470 */
3471 int (*authenticate)(void *priv,
3472 struct wpa_driver_auth_params *params);
3473
3474 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003475 * set_ap - Set Beacon and Probe Response information for AP mode
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003476 * @priv: Private driver interface data
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003477 * @params: Parameters to use in AP mode
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003478 *
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003479 * This function is used to configure Beacon template and/or extra IEs
3480 * to add for Beacon and Probe Response frames for the driver in
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003481 * AP mode. The driver is responsible for building the full Beacon
3482 * frame by concatenating the head part with TIM IE generated by the
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003483 * driver/firmware and finishing with the tail part. Depending on the
3484 * driver architectue, this can be done either by using the full
3485 * template or the set of additional IEs (e.g., WPS and P2P IE).
3486 * Similarly, Probe Response processing depends on the driver design.
3487 * If the driver (or firmware) takes care of replying to Probe Request
3488 * frames, the extra IEs provided here needs to be added to the Probe
3489 * Response frames.
3490 *
3491 * Returns: 0 on success, -1 on failure
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003492 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003493 int (*set_ap)(void *priv, struct wpa_driver_ap_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003494
3495 /**
Dmitry Shmidt8bae4132013-06-06 11:25:10 -07003496 * set_acl - Set ACL in AP mode
3497 * @priv: Private driver interface data
3498 * @params: Parameters to configure ACL
3499 * Returns: 0 on success, -1 on failure
3500 *
3501 * This is used only for the drivers which support MAC address ACL.
3502 */
3503 int (*set_acl)(void *priv, struct hostapd_acl_params *params);
3504
3505 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003506 * hapd_init - Initialize driver interface (hostapd only)
3507 * @hapd: Pointer to hostapd context
3508 * @params: Configuration for the driver wrapper
3509 * Returns: Pointer to private data, %NULL on failure
3510 *
3511 * This function is used instead of init() or init2() when the driver
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003512 * wrapper is used with hostapd.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003513 */
3514 void * (*hapd_init)(struct hostapd_data *hapd,
3515 struct wpa_init_params *params);
3516
3517 /**
3518 * hapd_deinit - Deinitialize driver interface (hostapd only)
3519 * @priv: Private driver interface data from hapd_init()
3520 */
3521 void (*hapd_deinit)(void *priv);
3522
3523 /**
3524 * set_ieee8021x - Enable/disable IEEE 802.1X support (AP only)
3525 * @priv: Private driver interface data
3526 * @params: BSS parameters
3527 * Returns: 0 on success, -1 on failure
3528 *
3529 * This is an optional function to configure the kernel driver to
3530 * enable/disable IEEE 802.1X support and set WPA/WPA2 parameters. This
3531 * can be left undefined (set to %NULL) if IEEE 802.1X support is
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003532 * always enabled and the driver uses set_ap() to set WPA/RSN IE
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003533 * for Beacon frames.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003534 *
3535 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003536 */
3537 int (*set_ieee8021x)(void *priv, struct wpa_bss_params *params);
3538
3539 /**
3540 * set_privacy - Enable/disable privacy (AP only)
3541 * @priv: Private driver interface data
3542 * @enabled: 1 = privacy enabled, 0 = disabled
3543 * Returns: 0 on success, -1 on failure
3544 *
3545 * This is an optional function to configure privacy field in the
3546 * kernel driver for Beacon frames. This can be left undefined (set to
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003547 * %NULL) if the driver uses the Beacon template from set_ap().
3548 *
3549 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003550 */
3551 int (*set_privacy)(void *priv, int enabled);
3552
3553 /**
3554 * get_seqnum - Fetch the current TSC/packet number (AP only)
3555 * @ifname: The interface name (main or virtual)
3556 * @priv: Private driver interface data
3557 * @addr: MAC address of the station or %NULL for group keys
3558 * @idx: Key index
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003559 * @link_id: Link ID for a group key, or -1 if not set
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003560 * @seq: Buffer for returning the latest used TSC/packet number
3561 * Returns: 0 on success, -1 on failure
3562 *
3563 * This function is used to fetch the last used TSC/packet number for
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07003564 * a TKIP, CCMP, GCMP, or BIP/IGTK key. It is mainly used with group
3565 * keys, so there is no strict requirement on implementing support for
3566 * unicast keys (i.e., addr != %NULL).
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003567 */
3568 int (*get_seqnum)(const char *ifname, void *priv, const u8 *addr,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003569 int idx, int link_id, u8 *seq);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003570
3571 /**
3572 * flush - Flush all association stations (AP only)
3573 * @priv: Private driver interface data
3574 * Returns: 0 on success, -1 on failure
3575 *
3576 * This function requests the driver to disassociate all associated
3577 * stations. This function does not need to be implemented if the
3578 * driver does not process association frames internally.
3579 */
3580 int (*flush)(void *priv);
3581
3582 /**
3583 * set_generic_elem - Add IEs into Beacon/Probe Response frames (AP)
3584 * @priv: Private driver interface data
3585 * @elem: Information elements
3586 * @elem_len: Length of the elem buffer in octets
3587 * Returns: 0 on success, -1 on failure
3588 *
3589 * This is an optional function to add information elements in the
3590 * kernel driver for Beacon and Probe Response frames. This can be left
3591 * undefined (set to %NULL) if the driver uses the Beacon template from
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003592 * set_ap().
3593 *
3594 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003595 */
3596 int (*set_generic_elem)(void *priv, const u8 *elem, size_t elem_len);
3597
3598 /**
Jouni Malinen1e6c57f2012-09-05 17:07:03 +03003599 * read_sta_data - Fetch station data
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003600 * @priv: Private driver interface data
3601 * @data: Buffer for returning station information
3602 * @addr: MAC address of the station
3603 * Returns: 0 on success, -1 on failure
3604 */
3605 int (*read_sta_data)(void *priv, struct hostap_sta_driver_data *data,
3606 const u8 *addr);
3607
3608 /**
Hai Shalomfdcde762020-04-02 11:19:20 -07003609 * tx_control_port - Send a frame over the 802.1X controlled port
3610 * @priv: Private driver interface data
3611 * @dest: Destination MAC address
3612 * @proto: Ethertype in host byte order
3613 * @buf: Frame payload starting from IEEE 802.1X header
3614 * @len: Frame payload length
3615 * @no_encrypt: Do not encrypt frame
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003616 * @link_id: Link ID to use for TX, or -1 if not set
Hai Shalomfdcde762020-04-02 11:19:20 -07003617 *
3618 * Returns 0 on success, else an error
3619 *
3620 * This is like a normal Ethernet send except that the driver is aware
3621 * (by other means than the Ethertype) that this frame is special,
3622 * and more importantly it gains an ordering between the transmission of
3623 * the frame and other driver management operations such as key
3624 * installations. This can be used to work around known limitations in
3625 * IEEE 802.11 protocols such as race conditions between rekeying 4-way
3626 * handshake message 4/4 and a PTK being overwritten.
3627 *
3628 * This function is only used for a given interface if the driver
3629 * instance reports WPA_DRIVER_FLAGS_CONTROL_PORT capability. Otherwise,
3630 * API users will fall back to sending the frame via a normal socket.
3631 */
3632 int (*tx_control_port)(void *priv, const u8 *dest,
3633 u16 proto, const u8 *buf, size_t len,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003634 int no_encrypt, int link_id);
Hai Shalomfdcde762020-04-02 11:19:20 -07003635
3636 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003637 * hapd_send_eapol - Send an EAPOL packet (AP only)
3638 * @priv: private driver interface data
3639 * @addr: Destination MAC address
3640 * @data: EAPOL packet starting with IEEE 802.1X header
3641 * @data_len: Length of the EAPOL packet in octets
3642 * @encrypt: Whether the frame should be encrypted
3643 * @own_addr: Source MAC address
3644 * @flags: WPA_STA_* flags for the destination station
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003645 * @link_id: Link ID to use for TX, or -1 if not set
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003646 *
3647 * Returns: 0 on success, -1 on failure
3648 */
3649 int (*hapd_send_eapol)(void *priv, const u8 *addr, const u8 *data,
3650 size_t data_len, int encrypt,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003651 const u8 *own_addr, u32 flags, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003652
3653 /**
3654 * sta_deauth - Deauthenticate a station (AP only)
3655 * @priv: Private driver interface data
3656 * @own_addr: Source address and BSSID for the Deauthentication frame
3657 * @addr: MAC address of the station to deauthenticate
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003658 * @reason: Reason code for the Deauthentication frame
3659 * @link_id: Link ID to use for Deauthentication frame, or -1 if not set
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003660 * Returns: 0 on success, -1 on failure
3661 *
3662 * This function requests a specific station to be deauthenticated and
3663 * a Deauthentication frame to be sent to it.
3664 */
3665 int (*sta_deauth)(void *priv, const u8 *own_addr, const u8 *addr,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003666 u16 reason, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003667
3668 /**
3669 * sta_disassoc - Disassociate a station (AP only)
3670 * @priv: Private driver interface data
3671 * @own_addr: Source address and BSSID for the Disassociation frame
3672 * @addr: MAC address of the station to disassociate
3673 * @reason: Reason code for the Disassociation frame
3674 * Returns: 0 on success, -1 on failure
3675 *
3676 * This function requests a specific station to be disassociated and
3677 * a Disassociation frame to be sent to it.
3678 */
3679 int (*sta_disassoc)(void *priv, const u8 *own_addr, const u8 *addr,
Hai Shalom81f62d82019-07-22 12:10:00 -07003680 u16 reason);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003681
3682 /**
3683 * sta_remove - Remove a station entry (AP only)
3684 * @priv: Private driver interface data
3685 * @addr: MAC address of the station to be removed
3686 * Returns: 0 on success, -1 on failure
3687 */
3688 int (*sta_remove)(void *priv, const u8 *addr);
3689
3690 /**
3691 * hapd_get_ssid - Get the current SSID (AP only)
3692 * @priv: Private driver interface data
3693 * @buf: Buffer for returning the SSID
3694 * @len: Maximum length of the buffer
3695 * Returns: Length of the SSID on success, -1 on failure
3696 *
3697 * This function need not be implemented if the driver uses Beacon
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003698 * template from set_ap() and does not reply to Probe Request frames.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003699 */
3700 int (*hapd_get_ssid)(void *priv, u8 *buf, int len);
3701
3702 /**
3703 * hapd_set_ssid - Set SSID (AP only)
3704 * @priv: Private driver interface data
3705 * @buf: SSID
3706 * @len: Length of the SSID in octets
3707 * Returns: 0 on success, -1 on failure
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003708 *
3709 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003710 */
3711 int (*hapd_set_ssid)(void *priv, const u8 *buf, int len);
3712
3713 /**
3714 * hapd_set_countermeasures - Enable/disable TKIP countermeasures (AP)
3715 * @priv: Private driver interface data
3716 * @enabled: 1 = countermeasures enabled, 0 = disabled
3717 * Returns: 0 on success, -1 on failure
3718 *
3719 * This need not be implemented if the driver does not take care of
3720 * association processing.
3721 */
3722 int (*hapd_set_countermeasures)(void *priv, int enabled);
3723
3724 /**
3725 * sta_add - Add a station entry
3726 * @priv: Private driver interface data
3727 * @params: Station parameters
3728 * Returns: 0 on success, -1 on failure
3729 *
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08003730 * This function is used to add or set (params->set 1) a station
3731 * entry in the driver. Adding STA entries is used only if the driver
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003732 * does not take care of association processing.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003733 *
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08003734 * With drivers that don't support full AP client state, this function
3735 * is used to add a station entry to the driver once the station has
3736 * completed association.
3737 *
3738 * With TDLS, this function is used to add or set (params->set 1)
3739 * TDLS peer entries (even with drivers that do not support full AP
3740 * client state).
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003741 */
3742 int (*sta_add)(void *priv, struct hostapd_sta_add_params *params);
3743
3744 /**
3745 * get_inact_sec - Get station inactivity duration (AP only)
3746 * @priv: Private driver interface data
3747 * @addr: Station address
3748 * Returns: Number of seconds station has been inactive, -1 on failure
3749 */
3750 int (*get_inact_sec)(void *priv, const u8 *addr);
3751
3752 /**
3753 * sta_clear_stats - Clear station statistics (AP only)
3754 * @priv: Private driver interface data
3755 * @addr: Station address
3756 * Returns: 0 on success, -1 on failure
3757 */
3758 int (*sta_clear_stats)(void *priv, const u8 *addr);
3759
3760 /**
3761 * set_freq - Set channel/frequency (AP only)
3762 * @priv: Private driver interface data
3763 * @freq: Channel parameters
3764 * Returns: 0 on success, -1 on failure
3765 */
3766 int (*set_freq)(void *priv, struct hostapd_freq_params *freq);
3767
3768 /**
3769 * set_rts - Set RTS threshold
3770 * @priv: Private driver interface data
3771 * @rts: RTS threshold in octets
3772 * Returns: 0 on success, -1 on failure
3773 */
3774 int (*set_rts)(void *priv, int rts);
3775
3776 /**
3777 * set_frag - Set fragmentation threshold
3778 * @priv: Private driver interface data
3779 * @frag: Fragmentation threshold in octets
3780 * Returns: 0 on success, -1 on failure
3781 */
3782 int (*set_frag)(void *priv, int frag);
3783
3784 /**
3785 * sta_set_flags - Set station flags (AP only)
3786 * @priv: Private driver interface data
3787 * @addr: Station address
3788 * @total_flags: Bitmap of all WPA_STA_* flags currently set
3789 * @flags_or: Bitmap of WPA_STA_* flags to add
3790 * @flags_and: Bitmap of WPA_STA_* flags to us as a mask
3791 * Returns: 0 on success, -1 on failure
3792 */
3793 int (*sta_set_flags)(void *priv, const u8 *addr,
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08003794 unsigned int total_flags, unsigned int flags_or,
3795 unsigned int flags_and);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003796
3797 /**
Hai Shalom81f62d82019-07-22 12:10:00 -07003798 * sta_set_airtime_weight - Set station airtime weight (AP only)
3799 * @priv: Private driver interface data
3800 * @addr: Station address
3801 * @weight: New weight for station airtime assignment
3802 * Returns: 0 on success, -1 on failure
3803 */
3804 int (*sta_set_airtime_weight)(void *priv, const u8 *addr,
3805 unsigned int weight);
3806
3807 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003808 * set_tx_queue_params - Set TX queue parameters
3809 * @priv: Private driver interface data
3810 * @queue: Queue number (0 = VO, 1 = VI, 2 = BE, 3 = BK)
3811 * @aifs: AIFS
3812 * @cw_min: cwMin
3813 * @cw_max: cwMax
3814 * @burst_time: Maximum length for bursting in 0.1 msec units
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003815 * @link_id: Link ID to use, or -1 for non MLD.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003816 */
3817 int (*set_tx_queue_params)(void *priv, int queue, int aifs, int cw_min,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003818 int cw_max, int burst_time, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003819
3820 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003821 * if_add - Add a virtual interface
3822 * @priv: Private driver interface data
3823 * @type: Interface type
3824 * @ifname: Interface name for the new virtual interface
3825 * @addr: Local address to use for the interface or %NULL to use the
3826 * parent interface address
3827 * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces
3828 * @drv_priv: Pointer for overwriting the driver context or %NULL if
3829 * not allowed (applies only to %WPA_IF_AP_BSS type)
3830 * @force_ifname: Buffer for returning an interface name that the
3831 * driver ended up using if it differs from the requested ifname
3832 * @if_addr: Buffer for returning the allocated interface address
3833 * (this may differ from the requested addr if the driver cannot
3834 * change interface address)
3835 * @bridge: Bridge interface to use or %NULL if no bridge configured
Dmitry Shmidtcce06662013-11-04 18:44:24 -08003836 * @use_existing: Whether to allow existing interface to be used
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08003837 * @setup_ap: Whether to setup AP for %WPA_IF_AP_BSS interfaces
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003838 * Returns: 0 on success, -1 on failure
3839 */
3840 int (*if_add)(void *priv, enum wpa_driver_if_type type,
3841 const char *ifname, const u8 *addr, void *bss_ctx,
3842 void **drv_priv, char *force_ifname, u8 *if_addr,
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08003843 const char *bridge, int use_existing, int setup_ap);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003844
3845 /**
3846 * if_remove - Remove a virtual interface
3847 * @priv: Private driver interface data
3848 * @type: Interface type
3849 * @ifname: Interface name of the virtual interface to be removed
3850 * Returns: 0 on success, -1 on failure
3851 */
3852 int (*if_remove)(void *priv, enum wpa_driver_if_type type,
3853 const char *ifname);
3854
3855 /**
3856 * set_sta_vlan - Bind a station into a specific interface (AP only)
3857 * @priv: Private driver interface data
3858 * @ifname: Interface (main or virtual BSS or VLAN)
3859 * @addr: MAC address of the associated station
3860 * @vlan_id: VLAN ID
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003861 * @link_id: The link ID or -1 for non-MLO
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003862 * Returns: 0 on success, -1 on failure
3863 *
3864 * This function is used to bind a station to a specific virtual
3865 * interface. It is only used if when virtual interfaces are supported,
3866 * e.g., to assign stations to different VLAN interfaces based on
3867 * information from a RADIUS server. This allows separate broadcast
3868 * domains to be used with a single BSS.
3869 */
3870 int (*set_sta_vlan)(void *priv, const u8 *addr, const char *ifname,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003871 int vlan_id, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003872
3873 /**
3874 * commit - Optional commit changes handler (AP only)
3875 * @priv: driver private data
3876 * Returns: 0 on success, -1 on failure
3877 *
3878 * This optional handler function can be registered if the driver
3879 * interface implementation needs to commit changes (e.g., by setting
3880 * network interface up) at the end of initial configuration. If set,
3881 * this handler will be called after initial setup has been completed.
3882 */
3883 int (*commit)(void *priv);
3884
3885 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003886 * set_radius_acl_auth - Notification of RADIUS ACL change
3887 * @priv: Private driver interface data
3888 * @mac: MAC address of the station
3889 * @accepted: Whether the station was accepted
3890 * @session_timeout: Session timeout for the station
3891 * Returns: 0 on success, -1 on failure
3892 */
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07003893 int (*set_radius_acl_auth)(void *priv, const u8 *mac, int accepted,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003894 u32 session_timeout);
3895
3896 /**
3897 * set_radius_acl_expire - Notification of RADIUS ACL expiration
3898 * @priv: Private driver interface data
3899 * @mac: MAC address of the station
3900 * Returns: 0 on success, -1 on failure
3901 */
3902 int (*set_radius_acl_expire)(void *priv, const u8 *mac);
3903
3904 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003905 * set_ap_wps_ie - Add WPS IE(s) into Beacon/Probe Response frames (AP)
3906 * @priv: Private driver interface data
3907 * @beacon: WPS IE(s) for Beacon frames or %NULL to remove extra IE(s)
3908 * @proberesp: WPS IE(s) for Probe Response frames or %NULL to remove
3909 * extra IE(s)
3910 * @assocresp: WPS IE(s) for (Re)Association Response frames or %NULL
3911 * to remove extra IE(s)
3912 * Returns: 0 on success, -1 on failure
3913 *
3914 * This is an optional function to add WPS IE in the kernel driver for
3915 * Beacon and Probe Response frames. This can be left undefined (set
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003916 * to %NULL) if the driver uses the Beacon template from set_ap()
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003917 * and does not process Probe Request frames. If the driver takes care
3918 * of (Re)Association frame processing, the assocresp buffer includes
3919 * WPS IE(s) that need to be added to (Re)Association Response frames
3920 * whenever a (Re)Association Request frame indicated use of WPS.
3921 *
3922 * This will also be used to add P2P IE(s) into Beacon/Probe Response
3923 * frames when operating as a GO. The driver is responsible for adding
3924 * timing related attributes (e.g., NoA) in addition to the IEs
3925 * included here by appending them after these buffers. This call is
3926 * also used to provide Probe Response IEs for P2P Listen state
3927 * operations for drivers that generate the Probe Response frames
3928 * internally.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003929 *
3930 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003931 */
3932 int (*set_ap_wps_ie)(void *priv, const struct wpabuf *beacon,
3933 const struct wpabuf *proberesp,
3934 const struct wpabuf *assocresp);
3935
3936 /**
3937 * set_supp_port - Set IEEE 802.1X Supplicant Port status
3938 * @priv: Private driver interface data
3939 * @authorized: Whether the port is authorized
3940 * Returns: 0 on success, -1 on failure
3941 */
3942 int (*set_supp_port)(void *priv, int authorized);
3943
3944 /**
3945 * set_wds_sta - Bind a station into a 4-address WDS (AP only)
3946 * @priv: Private driver interface data
3947 * @addr: MAC address of the associated station
3948 * @aid: Association ID
3949 * @val: 1 = bind to 4-address WDS; 0 = unbind
3950 * @bridge_ifname: Bridge interface to use for the WDS station or %NULL
3951 * to indicate that bridge is not to be used
Dmitry Shmidtc2ebb4b2013-07-24 12:57:51 -07003952 * @ifname_wds: Buffer to return the interface name for the new WDS
3953 * station or %NULL to indicate name is not returned.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003954 * Returns: 0 on success, -1 on failure
3955 */
3956 int (*set_wds_sta)(void *priv, const u8 *addr, int aid, int val,
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07003957 const char *bridge_ifname, char *ifname_wds);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003958
3959 /**
3960 * send_action - Transmit an Action frame
3961 * @priv: Private driver interface data
3962 * @freq: Frequency (in MHz) of the channel
3963 * @wait: Time to wait off-channel for a response (in ms), or zero
3964 * @dst: Destination MAC address (Address 1)
3965 * @src: Source MAC address (Address 2)
3966 * @bssid: BSSID (Address 3)
3967 * @data: Frame body
3968 * @data_len: data length in octets
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003969 @ @no_cck: Whether CCK rates must not be used to transmit this frame
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003970 * Returns: 0 on success, -1 on failure
3971 *
3972 * This command can be used to request the driver to transmit an action
3973 * frame to the specified destination.
3974 *
3975 * If the %WPA_DRIVER_FLAGS_OFFCHANNEL_TX flag is set, the frame will
3976 * be transmitted on the given channel and the device will wait for a
3977 * response on that channel for the given wait time.
3978 *
3979 * If the flag is not set, the wait time will be ignored. In this case,
3980 * if a remain-on-channel duration is in progress, the frame must be
3981 * transmitted on that channel; alternatively the frame may be sent on
3982 * the current operational channel (if in associated state in station
3983 * mode or while operating as an AP.)
Dmitry Shmidtebd93af2017-02-21 13:40:44 -08003984 *
3985 * If @src differs from the device MAC address, use of a random
3986 * transmitter address is requested for this message exchange.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003987 */
3988 int (*send_action)(void *priv, unsigned int freq, unsigned int wait,
3989 const u8 *dst, const u8 *src, const u8 *bssid,
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003990 const u8 *data, size_t data_len, int no_cck);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003991
3992 /**
3993 * send_action_cancel_wait - Cancel action frame TX wait
3994 * @priv: Private driver interface data
3995 *
3996 * This command cancels the wait time associated with sending an action
3997 * frame. It is only available when %WPA_DRIVER_FLAGS_OFFCHANNEL_TX is
3998 * set in the driver flags.
3999 */
4000 void (*send_action_cancel_wait)(void *priv);
4001
4002 /**
4003 * remain_on_channel - Remain awake on a channel
4004 * @priv: Private driver interface data
4005 * @freq: Frequency (in MHz) of the channel
4006 * @duration: Duration in milliseconds
4007 * Returns: 0 on success, -1 on failure
4008 *
4009 * This command is used to request the driver to remain awake on the
4010 * specified channel for the specified duration and report received
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08004011 * Action frames with EVENT_RX_MGMT events. Optionally, received
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004012 * Probe Request frames may also be requested to be reported by calling
4013 * probe_req_report(). These will be reported with EVENT_RX_PROBE_REQ.
4014 *
4015 * The driver may not be at the requested channel when this function
4016 * returns, i.e., the return code is only indicating whether the
4017 * request was accepted. The caller will need to wait until the
4018 * EVENT_REMAIN_ON_CHANNEL event indicates that the driver has
4019 * completed the channel change. This may take some time due to other
4020 * need for the radio and the caller should be prepared to timing out
4021 * its wait since there are no guarantees on when this request can be
4022 * executed.
4023 */
4024 int (*remain_on_channel)(void *priv, unsigned int freq,
4025 unsigned int duration);
4026
4027 /**
4028 * cancel_remain_on_channel - Cancel remain-on-channel operation
4029 * @priv: Private driver interface data
4030 *
4031 * This command can be used to cancel a remain-on-channel operation
4032 * before its originally requested duration has passed. This could be
4033 * used, e.g., when remain_on_channel() is used to request extra time
4034 * to receive a response to an Action frame and the response is
4035 * received when there is still unneeded time remaining on the
4036 * remain-on-channel operation.
4037 */
4038 int (*cancel_remain_on_channel)(void *priv);
4039
4040 /**
4041 * probe_req_report - Request Probe Request frames to be indicated
4042 * @priv: Private driver interface data
4043 * @report: Whether to report received Probe Request frames
4044 * Returns: 0 on success, -1 on failure (or if not supported)
4045 *
4046 * This command can be used to request the driver to indicate when
4047 * Probe Request frames are received with EVENT_RX_PROBE_REQ events.
4048 * Since this operation may require extra resources, e.g., due to less
4049 * optimal hardware/firmware RX filtering, many drivers may disable
4050 * Probe Request reporting at least in station mode. This command is
4051 * used to notify the driver when the Probe Request frames need to be
4052 * reported, e.g., during remain-on-channel operations.
4053 */
4054 int (*probe_req_report)(void *priv, int report);
4055
4056 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004057 * deinit_ap - Deinitialize AP mode
4058 * @priv: Private driver interface data
4059 * Returns: 0 on success, -1 on failure (or if not supported)
4060 *
4061 * This optional function can be used to disable AP mode related
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07004062 * configuration. If the interface was not dynamically added,
4063 * change the driver mode to station mode to allow normal station
4064 * operations like scanning to be completed.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004065 */
4066 int (*deinit_ap)(void *priv);
4067
4068 /**
Dmitry Shmidt04949592012-07-19 12:16:46 -07004069 * deinit_p2p_cli - Deinitialize P2P client mode
4070 * @priv: Private driver interface data
4071 * Returns: 0 on success, -1 on failure (or if not supported)
4072 *
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07004073 * This optional function can be used to disable P2P client mode. If the
4074 * interface was not dynamically added, change the interface type back
4075 * to station mode.
Dmitry Shmidt04949592012-07-19 12:16:46 -07004076 */
4077 int (*deinit_p2p_cli)(void *priv);
4078
4079 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004080 * suspend - Notification on system suspend/hibernate event
4081 * @priv: Private driver interface data
4082 */
4083 void (*suspend)(void *priv);
4084
4085 /**
4086 * resume - Notification on system resume/thaw event
4087 * @priv: Private driver interface data
4088 */
4089 void (*resume)(void *priv);
4090
4091 /**
4092 * signal_monitor - Set signal monitoring parameters
4093 * @priv: Private driver interface data
4094 * @threshold: Threshold value for signal change events; 0 = disabled
4095 * @hysteresis: Minimum change in signal strength before indicating a
4096 * new event
4097 * Returns: 0 on success, -1 on failure (or if not supported)
4098 *
4099 * This function can be used to configure monitoring of signal strength
4100 * with the current AP. Whenever signal strength drops below the
4101 * %threshold value or increases above it, EVENT_SIGNAL_CHANGE event
4102 * should be generated assuming the signal strength has changed at
4103 * least %hysteresis from the previously indicated signal change event.
4104 */
4105 int (*signal_monitor)(void *priv, int threshold, int hysteresis);
4106
4107 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004108 * get_noa - Get current Notice of Absence attribute payload
4109 * @priv: Private driver interface data
4110 * @buf: Buffer for returning NoA
4111 * @buf_len: Buffer length in octets
4112 * Returns: Number of octets used in buf, 0 to indicate no NoA is being
4113 * advertized, or -1 on failure
4114 *
4115 * This function is used to fetch the current Notice of Absence
4116 * attribute value from GO.
4117 */
4118 int (*get_noa)(void *priv, u8 *buf, size_t buf_len);
4119
4120 /**
4121 * set_noa - Set Notice of Absence parameters for GO (testing)
4122 * @priv: Private driver interface data
4123 * @count: Count
4124 * @start: Start time in ms from next TBTT
4125 * @duration: Duration in ms
4126 * Returns: 0 on success or -1 on failure
4127 *
4128 * This function is used to set Notice of Absence parameters for GO. It
4129 * is used only for testing. To disable NoA, all parameters are set to
4130 * 0.
4131 */
4132 int (*set_noa)(void *priv, u8 count, int start, int duration);
4133
4134 /**
4135 * set_p2p_powersave - Set P2P power save options
4136 * @priv: Private driver interface data
4137 * @legacy_ps: 0 = disable, 1 = enable, 2 = maximum PS, -1 = no change
4138 * @opp_ps: 0 = disable, 1 = enable, -1 = no change
4139 * @ctwindow: 0.. = change (msec), -1 = no change
4140 * Returns: 0 on success or -1 on failure
4141 */
4142 int (*set_p2p_powersave)(void *priv, int legacy_ps, int opp_ps,
4143 int ctwindow);
4144
4145 /**
4146 * ampdu - Enable/disable aggregation
4147 * @priv: Private driver interface data
4148 * @ampdu: 1/0 = enable/disable A-MPDU aggregation
4149 * Returns: 0 on success or -1 on failure
4150 */
4151 int (*ampdu)(void *priv, int ampdu);
4152
4153 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004154 * get_radio_name - Get physical radio name for the device
4155 * @priv: Private driver interface data
4156 * Returns: Radio name or %NULL if not known
4157 *
4158 * The returned data must not be modified by the caller. It is assumed
4159 * that any interface that has the same radio name as another is
4160 * sharing the same physical radio. This information can be used to
4161 * share scan results etc. information between the virtual interfaces
4162 * to speed up various operations.
4163 */
4164 const char * (*get_radio_name)(void *priv);
4165
4166 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004167 * send_tdls_mgmt - for sending TDLS management packets
4168 * @priv: private driver interface data
4169 * @dst: Destination (peer) MAC address
4170 * @action_code: TDLS action code for the mssage
4171 * @dialog_token: Dialog Token to use in the message (if needed)
4172 * @status_code: Status Code or Reason Code to use (if needed)
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07004173 * @peer_capab: TDLS peer capability (TDLS_PEER_* bitfield)
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -07004174 * @initiator: Is the current end the TDLS link initiator
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004175 * @buf: TDLS IEs to add to the message
4176 * @len: Length of buf in octets
Sunil Ravi2a14cf12023-11-21 00:54:38 +00004177 * @link_id: If >= 0 indicates the link of the AP MLD to specify the
4178 * operating channel on which to send a TDLS Discovery Response frame.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004179 * Returns: 0 on success, negative (<0) on failure
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004180 *
4181 * This optional function can be used to send packet to driver which is
4182 * responsible for receiving and sending all TDLS packets.
4183 */
4184 int (*send_tdls_mgmt)(void *priv, const u8 *dst, u8 action_code,
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07004185 u8 dialog_token, u16 status_code, u32 peer_capab,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00004186 int initiator, const u8 *buf, size_t len,
4187 int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004188
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004189 /**
4190 * tdls_oper - Ask the driver to perform high-level TDLS operations
4191 * @priv: Private driver interface data
4192 * @oper: TDLS high-level operation. See %enum tdls_oper
4193 * @peer: Destination (peer) MAC address
4194 * Returns: 0 on success, negative (<0) on failure
4195 *
4196 * This optional function can be used to send high-level TDLS commands
4197 * to the driver.
4198 */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004199 int (*tdls_oper)(void *priv, enum tdls_oper oper, const u8 *peer);
4200
4201 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07004202 * wnm_oper - Notify driver of the WNM frame reception
4203 * @priv: Private driver interface data
4204 * @oper: WNM operation. See %enum wnm_oper
4205 * @peer: Destination (peer) MAC address
4206 * @buf: Buffer for the driver to fill in (for getting IE)
4207 * @buf_len: Return the len of buf
4208 * Returns: 0 on success, negative (<0) on failure
4209 */
4210 int (*wnm_oper)(void *priv, enum wnm_oper oper, const u8 *peer,
4211 u8 *buf, u16 *buf_len);
4212
4213 /**
Dmitry Shmidt051af732013-10-22 13:52:46 -07004214 * set_qos_map - Set QoS Map
4215 * @priv: Private driver interface data
4216 * @qos_map_set: QoS Map
4217 * @qos_map_set_len: Length of QoS Map
4218 */
4219 int (*set_qos_map)(void *priv, const u8 *qos_map_set,
4220 u8 qos_map_set_len);
4221
4222 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004223 * br_add_ip_neigh - Add a neigh to the bridge ip neigh table
4224 * @priv: Private driver interface data
4225 * @version: IP version of the IP address, 4 or 6
4226 * @ipaddr: IP address for the neigh entry
4227 * @prefixlen: IP address prefix length
4228 * @addr: Corresponding MAC address
4229 * Returns: 0 on success, negative (<0) on failure
4230 */
4231 int (*br_add_ip_neigh)(void *priv, u8 version, const u8 *ipaddr,
4232 int prefixlen, const u8 *addr);
4233
4234 /**
4235 * br_delete_ip_neigh - Remove a neigh from the bridge ip neigh table
4236 * @priv: Private driver interface data
4237 * @version: IP version of the IP address, 4 or 6
4238 * @ipaddr: IP address for the neigh entry
4239 * Returns: 0 on success, negative (<0) on failure
4240 */
4241 int (*br_delete_ip_neigh)(void *priv, u8 version, const u8 *ipaddr);
4242
4243 /**
4244 * br_port_set_attr - Set a bridge port attribute
4245 * @attr: Bridge port attribute to set
4246 * @val: Value to be set
4247 * Returns: 0 on success, negative (<0) on failure
4248 */
4249 int (*br_port_set_attr)(void *priv, enum drv_br_port_attr attr,
4250 unsigned int val);
4251
4252 /**
4253 * br_port_set_attr - Set a bridge network parameter
4254 * @param: Bridge parameter to set
4255 * @val: Value to be set
4256 * Returns: 0 on success, negative (<0) on failure
4257 */
4258 int (*br_set_net_param)(void *priv, enum drv_br_net_param param,
4259 unsigned int val);
4260
4261 /**
Hai Shalomfdcde762020-04-02 11:19:20 -07004262 * get_wowlan - Get wake-on-wireless status
4263 * @priv: Private driver interface data
4264 */
4265 int (*get_wowlan)(void *priv);
4266
4267 /**
Dmitry Shmidtb58836e2014-04-29 14:35:56 -07004268 * set_wowlan - Set wake-on-wireless triggers
4269 * @priv: Private driver interface data
4270 * @triggers: wowlan triggers
4271 */
4272 int (*set_wowlan)(void *priv, const struct wowlan_triggers *triggers);
4273
4274 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004275 * signal_poll - Get current connection information
4276 * @priv: Private driver interface data
4277 * @signal_info: Connection info structure
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07004278 */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004279 int (*signal_poll)(void *priv, struct wpa_signal_info *signal_info);
Dmitry Shmidtbd567ad2011-05-09 14:17:09 -07004280
4281 /**
Sunil Ravi89eba102022-09-13 21:04:37 -07004282 * mlo_signal_poll - Get current MLO connection information
4283 * @priv: Private driver interface data
4284 * @mlo_signal_info: MLO connection info structure
4285 */
4286 int (*mlo_signal_poll)(void *priv,
4287 struct wpa_mlo_signal_info *mlo_signal_info);
4288
4289 /**
Hai Shalom74f70d42019-02-11 14:42:39 -08004290 * channel_info - Get parameters of the current operating channel
4291 * @priv: Private driver interface data
4292 * @channel_info: Channel info structure
4293 * Returns: 0 on success, negative (<0) on failure
4294 */
4295 int (*channel_info)(void *priv, struct wpa_channel_info *channel_info);
4296
4297 /**
Jouni Malinen75ecf522011-06-27 15:19:46 -07004298 * set_authmode - Set authentication algorithm(s) for static WEP
4299 * @priv: Private driver interface data
4300 * @authmode: 1=Open System, 2=Shared Key, 3=both
4301 * Returns: 0 on success, -1 on failure
4302 *
4303 * This function can be used to set authentication algorithms for AP
4304 * mode when static WEP is used. If the driver uses user space MLME/SME
4305 * implementation, there is no need to implement this function.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004306 *
4307 * DEPRECATED - use set_ap() instead
Jouni Malinen75ecf522011-06-27 15:19:46 -07004308 */
4309 int (*set_authmode)(void *priv, int authmode);
Dmitry Shmidt292b0c32013-11-22 12:54:42 -08004310
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004311#ifdef ANDROID
Jouni Malinen75ecf522011-06-27 15:19:46 -07004312 /**
Dmitry Shmidt292b0c32013-11-22 12:54:42 -08004313 * driver_cmd - Execute driver-specific command
4314 * @priv: Private driver interface data
4315 * @cmd: Command to execute
4316 * @buf: Return buffer
4317 * @buf_len: Buffer length
Dmitry Shmidtbd567ad2011-05-09 14:17:09 -07004318 * Returns: 0 on success, -1 on failure
4319 */
Dmitry Shmidt292b0c32013-11-22 12:54:42 -08004320 int (*driver_cmd)(void *priv, char *cmd, char *buf, size_t buf_len);
4321#endif /* ANDROID */
4322
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004323 /**
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004324 * vendor_cmd - Execute vendor specific command
4325 * @priv: Private driver interface data
4326 * @vendor_id: Vendor id
4327 * @subcmd: Vendor command id
Hai Shalom60840252021-02-19 19:02:11 -08004328 * @nested_attr_flag: Specifies if vendor subcommand uses nested
4329 * attributes or not
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004330 * @data: Vendor command parameters (%NULL if no parameters)
4331 * @data_len: Data length
4332 * @buf: Return buffer (%NULL to ignore reply)
4333 * Returns: 0 on success, negative (<0) on failure
4334 *
4335 * This function handles vendor specific commands that are passed to
4336 * the driver/device. The command is identified by vendor id and
Hai Shalom60840252021-02-19 19:02:11 -08004337 * command id. The nested_attr_flag specifies whether the subcommand
4338 * uses nested attributes or not. Parameters can be passed
4339 * as argument to the command in the data buffer. Reply (if any) will be
4340 * filled in the supplied return buffer.
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004341 *
4342 * The exact driver behavior is driver interface and vendor specific. As
4343 * an example, this will be converted to a vendor specific cfg80211
4344 * command in case of the nl80211 driver interface.
4345 */
4346 int (*vendor_cmd)(void *priv, unsigned int vendor_id,
4347 unsigned int subcmd, const u8 *data, size_t data_len,
Hai Shalom60840252021-02-19 19:02:11 -08004348 enum nested_attr nested_attr_flag,
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004349 struct wpabuf *buf);
4350
4351 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004352 * set_rekey_info - Set rekey information
4353 * @priv: Private driver interface data
4354 * @kek: Current KEK
Dmitry Shmidt807291d2015-01-27 13:40:23 -08004355 * @kek_len: KEK length in octets
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004356 * @kck: Current KCK
Dmitry Shmidt807291d2015-01-27 13:40:23 -08004357 * @kck_len: KCK length in octets
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004358 * @replay_ctr: Current EAPOL-Key Replay Counter
4359 *
4360 * This optional function can be used to provide information for the
4361 * driver/firmware to process EAPOL-Key frames in Group Key Handshake
4362 * while the host (including wpa_supplicant) is sleeping.
4363 */
Dmitry Shmidt807291d2015-01-27 13:40:23 -08004364 void (*set_rekey_info)(void *priv, const u8 *kek, size_t kek_len,
4365 const u8 *kck, size_t kck_len,
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004366 const u8 *replay_ctr);
4367
4368 /**
4369 * sta_assoc - Station association indication
4370 * @priv: Private driver interface data
4371 * @own_addr: Source address and BSSID for association frame
4372 * @addr: MAC address of the station to associate
4373 * @reassoc: flag to indicate re-association
4374 * @status: association response status code
4375 * @ie: assoc response ie buffer
4376 * @len: ie buffer length
4377 * Returns: 0 on success, -1 on failure
4378 *
4379 * This function indicates the driver to send (Re)Association
4380 * Response frame to the station.
4381 */
4382 int (*sta_assoc)(void *priv, const u8 *own_addr, const u8 *addr,
4383 int reassoc, u16 status, const u8 *ie, size_t len);
4384
4385 /**
4386 * sta_auth - Station authentication indication
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004387 * @priv: private driver interface data
4388 * @params: Station authentication parameters
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004389 *
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004390 * Returns: 0 on success, -1 on failure
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004391 */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004392 int (*sta_auth)(void *priv,
4393 struct wpa_driver_sta_auth_params *params);
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004394
4395 /**
4396 * add_tspec - Add traffic stream
4397 * @priv: Private driver interface data
4398 * @addr: MAC address of the station to associate
4399 * @tspec_ie: tspec ie buffer
4400 * @tspec_ielen: tspec ie length
4401 * Returns: 0 on success, -1 on failure
4402 *
4403 * This function adds the traffic steam for the station
4404 * and fills the medium_time in tspec_ie.
4405 */
4406 int (*add_tspec)(void *priv, const u8 *addr, u8 *tspec_ie,
4407 size_t tspec_ielen);
4408
4409 /**
4410 * add_sta_node - Add a station node in the driver
4411 * @priv: Private driver interface data
4412 * @addr: MAC address of the station to add
4413 * @auth_alg: authentication algorithm used by the station
4414 * Returns: 0 on success, -1 on failure
4415 *
4416 * This function adds the station node in the driver, when
4417 * the station gets added by FT-over-DS.
4418 */
4419 int (*add_sta_node)(void *priv, const u8 *addr, u16 auth_alg);
4420
4421 /**
4422 * sched_scan - Request the driver to initiate scheduled scan
4423 * @priv: Private driver interface data
4424 * @params: Scan parameters
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004425 * Returns: 0 on success, -1 on failure
4426 *
4427 * This operation should be used for scheduled scan offload to
4428 * the hardware. Every time scan results are available, the
4429 * driver should report scan results event for wpa_supplicant
4430 * which will eventually request the results with
4431 * wpa_driver_get_scan_results2(). This operation is optional
4432 * and if not provided or if it returns -1, we fall back to
4433 * normal host-scheduled scans.
4434 */
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08004435 int (*sched_scan)(void *priv, struct wpa_driver_scan_params *params);
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004436
4437 /**
4438 * stop_sched_scan - Request the driver to stop a scheduled scan
4439 * @priv: Private driver interface data
4440 * Returns: 0 on success, -1 on failure
4441 *
4442 * This should cause the scheduled scan to be stopped and
4443 * results should stop being sent. Must be supported if
4444 * sched_scan is supported.
4445 */
4446 int (*stop_sched_scan)(void *priv);
4447
4448 /**
4449 * poll_client - Probe (null data or such) the given station
4450 * @priv: Private driver interface data
4451 * @own_addr: MAC address of sending interface
4452 * @addr: MAC address of the station to probe
4453 * @qos: Indicates whether station is QoS station
4454 *
4455 * This function is used to verify whether an associated station is
4456 * still present. This function does not need to be implemented if the
4457 * driver provides such inactivity polling mechanism.
4458 */
4459 void (*poll_client)(void *priv, const u8 *own_addr,
4460 const u8 *addr, int qos);
Dmitry Shmidt04949592012-07-19 12:16:46 -07004461
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004462 /**
Dmitry Shmidt04949592012-07-19 12:16:46 -07004463 * radio_disable - Disable/enable radio
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004464 * @priv: Private driver interface data
Dmitry Shmidt04949592012-07-19 12:16:46 -07004465 * @disabled: 1=disable 0=enable radio
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004466 * Returns: 0 on success, -1 on failure
4467 *
Dmitry Shmidt04949592012-07-19 12:16:46 -07004468 * This optional command is for testing purposes. It can be used to
4469 * disable the radio on a testbed device to simulate out-of-radio-range
4470 * conditions.
4471 */
4472 int (*radio_disable)(void *priv, int disabled);
4473
4474 /**
4475 * switch_channel - Announce channel switch and migrate the GO to the
4476 * given frequency
4477 * @priv: Private driver interface data
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08004478 * @settings: Settings for CSA period and new channel
Dmitry Shmidt04949592012-07-19 12:16:46 -07004479 * Returns: 0 on success, -1 on failure
4480 *
4481 * This function is used to move the GO to the legacy STA channel to
4482 * avoid frequency conflict in single channel concurrency.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004483 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08004484 int (*switch_channel)(void *priv, struct csa_settings *settings);
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004485
4486 /**
Sunil Ravia04bd252022-05-02 22:54:18 -07004487 * switch_color - Announce color switch and migrate the BSS to the
4488 * given color
4489 * @priv: Private driver interface data
4490 * @settings: Settings for CCA period and new color
4491 * Returns: 0 on success, -1 on failure
4492 *
4493 * This function is used to move the BSS to its new color.
4494 */
4495 int (*switch_color)(void *priv, struct cca_settings *settings);
4496
4497 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004498 * add_tx_ts - Add traffic stream
4499 * @priv: Private driver interface data
4500 * @tsid: Traffic stream ID
4501 * @addr: Receiver address
4502 * @user_prio: User priority of the traffic stream
4503 * @admitted_time: Admitted time for this TS in units of
4504 * 32 microsecond periods (per second).
4505 * Returns: 0 on success, -1 on failure
4506 */
4507 int (*add_tx_ts)(void *priv, u8 tsid, const u8 *addr, u8 user_prio,
4508 u16 admitted_time);
4509
4510 /**
4511 * del_tx_ts - Delete traffic stream
4512 * @priv: Private driver interface data
4513 * @tsid: Traffic stream ID
4514 * @addr: Receiver address
4515 * Returns: 0 on success, -1 on failure
4516 */
4517 int (*del_tx_ts)(void *priv, u8 tsid, const u8 *addr);
4518
4519 /**
4520 * Enable channel-switching with TDLS peer
4521 * @priv: Private driver interface data
4522 * @addr: MAC address of the TDLS peer
4523 * @oper_class: Operating class of the switch channel
4524 * @params: Channel specification
4525 * Returns: 0 on success, -1 on failure
4526 *
4527 * The function indicates to driver that it can start switching to a
4528 * different channel with a specified TDLS peer. The switching is
4529 * assumed on until canceled with tdls_disable_channel_switch().
4530 */
4531 int (*tdls_enable_channel_switch)(
4532 void *priv, const u8 *addr, u8 oper_class,
4533 const struct hostapd_freq_params *params);
4534
4535 /**
4536 * Disable channel switching with TDLS peer
4537 * @priv: Private driver interface data
4538 * @addr: MAC address of the TDLS peer
4539 * Returns: 0 on success, -1 on failure
4540 *
4541 * This function indicates to the driver that it should stop switching
4542 * with a given TDLS peer.
4543 */
4544 int (*tdls_disable_channel_switch)(void *priv, const u8 *addr);
4545
4546 /**
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004547 * start_dfs_cac - Listen for radar interference on the channel
4548 * @priv: Private driver interface data
Dmitry Shmidt051af732013-10-22 13:52:46 -07004549 * @freq: Channel parameters
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004550 * Returns: 0 on success, -1 on failure
4551 */
Dmitry Shmidt051af732013-10-22 13:52:46 -07004552 int (*start_dfs_cac)(void *priv, struct hostapd_freq_params *freq);
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004553
4554 /**
4555 * stop_ap - Removes beacon from AP
4556 * @priv: Private driver interface data
4557 * Returns: 0 on success, -1 on failure (or if not supported)
4558 *
4559 * This optional function can be used to disable AP mode related
4560 * configuration. Unlike deinit_ap, it does not change to station
4561 * mode.
4562 */
Sunil Ravi88611412024-06-28 17:34:56 +00004563 int (*stop_ap)(void *priv);
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07004564
4565 /**
4566 * get_survey - Retrieve survey data
4567 * @priv: Private driver interface data
4568 * @freq: If set, survey data for the specified frequency is only
4569 * being requested. If not set, all survey data is requested.
4570 * Returns: 0 on success, -1 on failure
4571 *
4572 * Use this to retrieve:
4573 *
4574 * - the observed channel noise floor
4575 * - the amount of time we have spent on the channel
4576 * - the amount of time during which we have spent on the channel that
4577 * the radio has determined the medium is busy and we cannot
4578 * transmit
4579 * - the amount of time we have spent receiving data
4580 * - the amount of time we have spent transmitting data
4581 *
4582 * This data can be used for spectrum heuristics. One example is
4583 * Automatic Channel Selection (ACS). The channel survey data is
4584 * kept on a linked list on the channel data, one entry is added
4585 * for each survey. The min_nf of the channel is updated for each
4586 * survey.
4587 */
4588 int (*get_survey)(void *priv, unsigned int freq);
Dmitry Shmidt56052862013-10-04 10:23:25 -07004589
4590 /**
4591 * status - Get driver interface status information
4592 * @priv: Private driver interface data
Hai Shalom74f70d42019-02-11 14:42:39 -08004593 * @buf: Buffer for printing the status information
Dmitry Shmidt56052862013-10-04 10:23:25 -07004594 * @buflen: Maximum length of the buffer
4595 * Returns: Length of written status information or -1 on failure
4596 */
4597 int (*status)(void *priv, char *buf, size_t buflen);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004598
Dmitry Shmidt661b4f72014-09-29 14:58:27 -07004599 /**
4600 * roaming - Set roaming policy for driver-based BSS selection
4601 * @priv: Private driver interface data
4602 * @allowed: Whether roaming within ESS is allowed
4603 * @bssid: Forced BSSID if roaming is disabled or %NULL if not set
4604 * Returns: Length of written status information or -1 on failure
4605 *
4606 * This optional callback can be used to update roaming policy from the
4607 * associate() command (bssid being set there indicates that the driver
4608 * should not roam before getting this roaming() call to allow roaming.
4609 * If the driver does not indicate WPA_DRIVER_FLAGS_BSS_SELECTION
4610 * capability, roaming policy is handled within wpa_supplicant and there
4611 * is no need to implement or react to this callback.
4612 */
4613 int (*roaming)(void *priv, int allowed, const u8 *bssid);
4614
4615 /**
Roshan Pius3a1667e2018-07-03 15:17:14 -07004616 * disable_fils - Enable/disable FILS feature
4617 * @priv: Private driver interface data
4618 * @disable: 0-enable and 1-disable FILS feature
4619 * Returns: 0 on success, -1 on failure
4620 *
4621 * This callback can be used to configure driver and below layers to
4622 * enable/disable all FILS features.
4623 */
4624 int (*disable_fils)(void *priv, int disable);
4625
4626 /**
Dmitry Shmidt661b4f72014-09-29 14:58:27 -07004627 * set_mac_addr - Set MAC address
4628 * @priv: Private driver interface data
4629 * @addr: MAC address to use or %NULL for setting back to permanent
4630 * Returns: 0 on success, -1 on failure
4631 */
4632 int (*set_mac_addr)(void *priv, const u8 *addr);
4633
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004634#ifdef CONFIG_MACSEC
4635 int (*macsec_init)(void *priv, struct macsec_init_params *params);
4636
4637 int (*macsec_deinit)(void *priv);
4638
4639 /**
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004640 * macsec_get_capability - Inform MKA of this driver's capability
4641 * @priv: Private driver interface data
4642 * @cap: Driver's capability
4643 * Returns: 0 on success, -1 on failure
4644 */
4645 int (*macsec_get_capability)(void *priv, enum macsec_cap *cap);
4646
4647 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004648 * enable_protect_frames - Set protect frames status
4649 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004650 * @enabled: true = protect frames enabled
4651 * false = protect frames disabled
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004652 * Returns: 0 on success, -1 on failure (or if not supported)
4653 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004654 int (*enable_protect_frames)(void *priv, bool enabled);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004655
4656 /**
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004657 * enable_encrypt - Set encryption status
4658 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004659 * @enabled: true = encrypt outgoing traffic
4660 * false = integrity-only protection on outgoing traffic
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004661 * Returns: 0 on success, -1 on failure (or if not supported)
4662 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004663 int (*enable_encrypt)(void *priv, bool enabled);
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004664
4665 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004666 * set_replay_protect - Set replay protect status and window size
4667 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004668 * @enabled: true = replay protect enabled
4669 * false = replay protect disabled
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004670 * @window: replay window size, valid only when replay protect enabled
4671 * Returns: 0 on success, -1 on failure (or if not supported)
4672 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004673 int (*set_replay_protect)(void *priv, bool enabled, u32 window);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004674
4675 /**
Sunil Ravi036cec52023-03-29 11:35:17 -07004676 * set_offload - Set MACsec hardware offload
4677 * @priv: Private driver interface data
4678 * @offload: 0 = MACSEC_OFFLOAD_OFF
4679 * 1 = MACSEC_OFFLOAD_PHY
4680 * 2 = MACSEC_OFFLOAD_MAC
4681 * Returns: 0 on success, -1 on failure (or if not supported)
4682 */
4683 int (*set_offload)(void *priv, u8 offload);
4684
4685 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004686 * set_current_cipher_suite - Set current cipher suite
4687 * @priv: Private driver interface data
4688 * @cs: EUI64 identifier
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004689 * Returns: 0 on success, -1 on failure (or if not supported)
4690 */
Dmitry Shmidt7d175302016-09-06 13:11:34 -07004691 int (*set_current_cipher_suite)(void *priv, u64 cs);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004692
4693 /**
4694 * enable_controlled_port - Set controlled port status
4695 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004696 * @enabled: true = controlled port enabled
4697 * false = controlled port disabled
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004698 * Returns: 0 on success, -1 on failure (or if not supported)
4699 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004700 int (*enable_controlled_port)(void *priv, bool enabled);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004701
4702 /**
4703 * get_receive_lowest_pn - Get receive lowest pn
4704 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004705 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004706 * Returns: 0 on success, -1 on failure (or if not supported)
4707 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004708 int (*get_receive_lowest_pn)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004709
4710 /**
4711 * get_transmit_next_pn - Get transmit next pn
4712 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004713 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004714 * Returns: 0 on success, -1 on failure (or if not supported)
4715 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004716 int (*get_transmit_next_pn)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004717
4718 /**
4719 * set_transmit_next_pn - Set transmit next pn
4720 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004721 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004722 * Returns: 0 on success, -1 on failure (or if not supported)
4723 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004724 int (*set_transmit_next_pn)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004725
4726 /**
Hai Shalom74f70d42019-02-11 14:42:39 -08004727 * set_receive_lowest_pn - Set receive lowest PN
4728 * @priv: Private driver interface data
4729 * @sa: secure association
4730 * Returns: 0 on success, -1 on failure (or if not supported)
4731 */
4732 int (*set_receive_lowest_pn)(void *priv, struct receive_sa *sa);
4733
4734 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004735 * create_receive_sc - create secure channel for receiving
4736 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004737 * @sc: secure channel
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004738 * @conf_offset: confidentiality offset (0, 30, or 50)
4739 * @validation: frame validation policy (0 = Disabled, 1 = Checked,
4740 * 2 = Strict)
4741 * Returns: 0 on success, -1 on failure (or if not supported)
4742 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004743 int (*create_receive_sc)(void *priv, struct receive_sc *sc,
4744 unsigned int conf_offset,
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004745 int validation);
4746
4747 /**
4748 * delete_receive_sc - delete secure connection for receiving
4749 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004750 * @sc: secure channel
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004751 * Returns: 0 on success, -1 on failure
4752 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004753 int (*delete_receive_sc)(void *priv, struct receive_sc *sc);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004754
4755 /**
4756 * create_receive_sa - create secure association for receive
4757 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004758 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004759 * Returns: 0 on success, -1 on failure
4760 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004761 int (*create_receive_sa)(void *priv, struct receive_sa *sa);
4762
4763 /**
4764 * delete_receive_sa - Delete secure association for receive
4765 * @priv: Private driver interface data from init()
4766 * @sa: Secure association
4767 * Returns: 0 on success, -1 on failure
4768 */
4769 int (*delete_receive_sa)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004770
4771 /**
4772 * enable_receive_sa - enable the SA for receive
4773 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004774 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004775 * Returns: 0 on success, -1 on failure
4776 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004777 int (*enable_receive_sa)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004778
4779 /**
4780 * disable_receive_sa - disable SA for receive
4781 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004782 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004783 * Returns: 0 on success, -1 on failure
4784 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004785 int (*disable_receive_sa)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004786
4787 /**
4788 * create_transmit_sc - create secure connection for transmit
4789 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004790 * @sc: secure channel
4791 * @conf_offset: confidentiality offset (0, 30, or 50)
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004792 * Returns: 0 on success, -1 on failure
4793 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004794 int (*create_transmit_sc)(void *priv, struct transmit_sc *sc,
4795 unsigned int conf_offset);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004796
4797 /**
4798 * delete_transmit_sc - delete secure connection for transmit
4799 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004800 * @sc: secure channel
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004801 * Returns: 0 on success, -1 on failure
4802 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004803 int (*delete_transmit_sc)(void *priv, struct transmit_sc *sc);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004804
4805 /**
4806 * create_transmit_sa - create secure association for transmit
4807 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004808 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004809 * Returns: 0 on success, -1 on failure
4810 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004811 int (*create_transmit_sa)(void *priv, struct transmit_sa *sa);
4812
4813 /**
4814 * delete_transmit_sa - Delete secure association for transmit
4815 * @priv: Private driver interface data from init()
4816 * @sa: Secure association
4817 * Returns: 0 on success, -1 on failure
4818 */
4819 int (*delete_transmit_sa)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004820
4821 /**
4822 * enable_transmit_sa - enable SA for transmit
4823 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004824 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004825 * Returns: 0 on success, -1 on failure
4826 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004827 int (*enable_transmit_sa)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004828
4829 /**
4830 * disable_transmit_sa - disable SA for transmit
4831 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004832 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004833 * Returns: 0 on success, -1 on failure
4834 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004835 int (*disable_transmit_sa)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004836#endif /* CONFIG_MACSEC */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004837
4838 /**
4839 * init_mesh - Driver specific initialization for mesh
4840 * @priv: Private driver interface data
4841 * Returns: 0 on success, -1 on failure
4842 */
4843 int (*init_mesh)(void *priv);
4844
4845 /**
4846 * join_mesh - Join a mesh network
4847 * @priv: Private driver interface data
4848 * @params: Mesh configuration parameters
4849 * Returns: 0 on success, -1 on failure
4850 */
4851 int (*join_mesh)(void *priv,
4852 struct wpa_driver_mesh_join_params *params);
4853
4854 /**
4855 * leave_mesh - Leave a mesh network
4856 * @priv: Private driver interface data
4857 * Returns 0 on success, -1 on failure
4858 */
4859 int (*leave_mesh)(void *priv);
4860
4861 /**
Hai Shalom81f62d82019-07-22 12:10:00 -07004862 * probe_mesh_link - Inject a frame over direct mesh link to a given
4863 * peer skipping the next_hop lookup from mpath table.
4864 * @priv: Private driver interface data
4865 * @addr: Peer MAC address
4866 * @eth: Ethernet frame to be sent
4867 * @len: Ethernet frame lengtn in bytes
4868 * Returns 0 on success, -1 on failure
4869 */
4870 int (*probe_mesh_link)(void *priv, const u8 *addr, const u8 *eth,
4871 size_t len);
4872
4873 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004874 * do_acs - Automatically select channel
4875 * @priv: Private driver interface data
4876 * @params: Parameters for ACS
4877 * Returns 0 on success, -1 on failure
4878 *
4879 * This command can be used to offload ACS to the driver if the driver
4880 * indicates support for such offloading (WPA_DRIVER_FLAGS_ACS_OFFLOAD).
4881 */
4882 int (*do_acs)(void *priv, struct drv_acs_params *params);
Ravi Joshie6ccb162015-07-16 17:45:41 -07004883
4884 /**
Hai Shalom60840252021-02-19 19:02:11 -08004885 * set_band - Notify driver of band(s) selection
Ravi Joshie6ccb162015-07-16 17:45:41 -07004886 * @priv: Private driver interface data
Hai Shalom60840252021-02-19 19:02:11 -08004887 * @band_mask: The selected band(s) bit mask (from enum set_band)
Ravi Joshie6ccb162015-07-16 17:45:41 -07004888 * Returns 0 on success, -1 on failure
4889 */
Hai Shalom60840252021-02-19 19:02:11 -08004890 int (*set_band)(void *priv, u32 band_mask);
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08004891
4892 /**
4893 * get_pref_freq_list - Get preferred frequency list for an interface
4894 * @priv: Private driver interface data
4895 * @if_type: Interface type
4896 * @num: Number of channels
Sunil8cd6f4d2022-06-28 18:40:46 +00004897 * @freq_list: Weighted preferred channel list
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08004898 * Returns 0 on success, -1 on failure
4899 *
4900 * This command can be used to query the preferred frequency list from
Sunil8cd6f4d2022-06-28 18:40:46 +00004901 * the driver specific to a particular interface type. The freq_list
4902 * array needs to have room for *num entries. *num will be updated to
4903 * indicate the number of entries fetched from the driver.
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08004904 */
4905 int (*get_pref_freq_list)(void *priv, enum wpa_driver_if_type if_type,
Sunil8cd6f4d2022-06-28 18:40:46 +00004906 unsigned int *num,
4907 struct weighted_pcl *freq_list);
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08004908
4909 /**
4910 * set_prob_oper_freq - Indicate probable P2P operating channel
4911 * @priv: Private driver interface data
4912 * @freq: Channel frequency in MHz
4913 * Returns 0 on success, -1 on failure
4914 *
4915 * This command can be used to inform the driver of the operating
4916 * frequency that an ongoing P2P group formation is likely to come up
4917 * on. Local device is assuming P2P Client role.
4918 */
4919 int (*set_prob_oper_freq)(void *priv, unsigned int freq);
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08004920
4921 /**
4922 * abort_scan - Request the driver to abort an ongoing scan
4923 * @priv: Private driver interface data
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004924 * @scan_cookie: Cookie identifying the scan request. This is used only
4925 * when the vendor interface QCA_NL80211_VENDOR_SUBCMD_TRIGGER_SCAN
4926 * was used to trigger scan. Otherwise, 0 is used.
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08004927 * Returns 0 on success, -1 on failure
4928 */
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004929 int (*abort_scan)(void *priv, u64 scan_cookie);
Dmitry Shmidt849734c2016-05-27 09:59:01 -07004930
4931 /**
4932 * configure_data_frame_filters - Request to configure frame filters
4933 * @priv: Private driver interface data
4934 * @filter_flags: The type of frames to filter (bitfield of
4935 * WPA_DATA_FRAME_FILTER_FLAG_*)
4936 * Returns: 0 on success or -1 on failure
4937 */
4938 int (*configure_data_frame_filters)(void *priv, u32 filter_flags);
Dmitry Shmidtd5ab1b52016-06-21 12:38:41 -07004939
4940 /**
4941 * get_ext_capab - Get extended capabilities for the specified interface
4942 * @priv: Private driver interface data
4943 * @type: Interface type for which to get extended capabilities
4944 * @ext_capab: Extended capabilities fetched
4945 * @ext_capab_mask: Extended capabilities mask
4946 * @ext_capab_len: Length of the extended capabilities
4947 * Returns: 0 on success or -1 on failure
4948 */
4949 int (*get_ext_capab)(void *priv, enum wpa_driver_if_type type,
4950 const u8 **ext_capab, const u8 **ext_capab_mask,
4951 unsigned int *ext_capab_len);
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07004952
4953 /**
Sunil Ravi2a14cf12023-11-21 00:54:38 +00004954 * get_mld_capab - Get MLD capabilities for the specified interface
4955 * @priv: Private driver interface data
4956 * @type: Interface type for which to get MLD capabilities
4957 * @eml_capa: EML capabilities
4958 * @mld_capa_and_ops: MLD Capabilities and Operations
4959 * Returns: 0 on success or -1 on failure
4960 */
4961 int (*get_mld_capab)(void *priv, enum wpa_driver_if_type type,
4962 u16 *eml_capa, u16 *mld_capa_and_ops);
4963
4964 /**
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07004965 * p2p_lo_start - Start offloading P2P listen to device
4966 * @priv: Private driver interface data
4967 * @freq: Listening frequency (MHz) for P2P listen
4968 * @period: Length of the listen operation in milliseconds
4969 * @interval: Interval for running the listen operation in milliseconds
4970 * @count: Number of times to run the listen operation
4971 * @device_types: Device primary and secondary types
4972 * @dev_types_len: Number of bytes for device_types
4973 * @ies: P2P IE and WSC IE for Probe Response frames
4974 * @ies_len: Length of ies in bytes
4975 * Returns: 0 on success or -1 on failure
4976 */
4977 int (*p2p_lo_start)(void *priv, unsigned int freq,
4978 unsigned int period, unsigned int interval,
4979 unsigned int count,
4980 const u8 *device_types, size_t dev_types_len,
4981 const u8 *ies, size_t ies_len);
4982
4983 /**
4984 * p2p_lo_stop - Stop P2P listen offload
4985 * @priv: Private driver interface data
4986 * Returns: 0 on success or -1 on failure
4987 */
4988 int (*p2p_lo_stop)(void *priv);
Dmitry Shmidt7f2c7532016-08-15 09:48:12 -07004989
4990 /**
4991 * set_default_scan_ies - Set default scan IEs
4992 * @priv: Private driver interface data
4993 * @ies: Scan default IEs buffer
4994 * @ies_len: Length of IEs in bytes
4995 * Returns: 0 on success or -1 on failure
4996 *
4997 * The driver can use these by default when there are no scan IEs coming
4998 * in the subsequent scan requests. Also in case of one or more of IEs
4999 * given in set_default_scan_ies() are missing in the subsequent scan
5000 * request, the driver should merge the missing scan IEs in the scan
5001 * request from the IEs set by set_default_scan_ies() in the Probe
5002 * Request frames sent.
5003 */
5004 int (*set_default_scan_ies)(void *priv, const u8 *ies, size_t ies_len);
5005
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08005006 /**
5007 * set_tdls_mode - Set TDLS trigger mode to the host driver
5008 * @priv: Private driver interface data
5009 * @tdls_external_control: Represents if TDLS external trigger control
5010 * mode is enabled/disabled.
5011 *
5012 * This optional callback can be used to configure the TDLS external
5013 * trigger control mode to the host driver.
5014 */
5015 int (*set_tdls_mode)(void *priv, int tdls_external_control);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005016
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005017 /**
5018 * get_bss_transition_status - Get candidate BSS's transition status
5019 * @priv: Private driver interface data
5020 * @params: Candidate BSS list
5021 *
5022 * Get the accept or reject reason code for a list of BSS transition
5023 * candidates.
5024 */
5025 struct wpa_bss_candidate_info *
5026 (*get_bss_transition_status)(void *priv,
5027 struct wpa_bss_trans_info *params);
5028 /**
5029 * ignore_assoc_disallow - Configure driver to ignore assoc_disallow
5030 * @priv: Private driver interface data
5031 * @ignore_disallow: 0 to not ignore, 1 to ignore
5032 * Returns: 0 on success, -1 on failure
5033 */
5034 int (*ignore_assoc_disallow)(void *priv, int ignore_disallow);
5035
5036 /**
Hai Shalom899fcc72020-10-19 14:38:18 -07005037 * set_bssid_tmp_disallow - Set disallowed BSSIDs to the driver
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005038 * @priv: Private driver interface data
Hai Shalom899fcc72020-10-19 14:38:18 -07005039 * @num_bssid: Number of temporarily disallowed BSSIDs
5040 * @bssids: List of temporarily disallowed BSSIDs
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005041 */
Hai Shalom899fcc72020-10-19 14:38:18 -07005042 int (*set_bssid_tmp_disallow)(void *priv, unsigned int num_bssid,
5043 const u8 *bssid);
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005044
5045 /**
5046 * update_connect_params - Update the connection parameters
5047 * @priv: Private driver interface data
5048 * @params: Association parameters
5049 * @mask: Bit mask indicating which parameters in @params have to be
5050 * updated
5051 * Returns: 0 on success, -1 on failure
5052 *
5053 * Update the connection parameters when in connected state so that the
5054 * driver uses the updated parameters for subsequent roaming. This is
5055 * used only with drivers that implement internal BSS selection and
5056 * roaming.
5057 */
5058 int (*update_connect_params)(
5059 void *priv, struct wpa_driver_associate_params *params,
5060 enum wpa_drv_update_connect_params_mask mask);
Roshan Pius3a1667e2018-07-03 15:17:14 -07005061
5062 /**
5063 * send_external_auth_status - Indicate the status of external
5064 * authentication processing to the host driver.
5065 * @priv: Private driver interface data
5066 * @params: Status of authentication processing.
5067 * Returns: 0 on success, -1 on failure
5068 */
5069 int (*send_external_auth_status)(void *priv,
5070 struct external_auth *params);
Hai Shalom74f70d42019-02-11 14:42:39 -08005071
5072 /**
5073 * set_4addr_mode - Set 4-address mode
5074 * @priv: Private driver interface data
5075 * @bridge_ifname: Bridge interface name
5076 * @val: 0 - disable 4addr mode, 1 - enable 4addr mode
5077 * Returns: 0 on success, < 0 on failure
5078 */
5079 int (*set_4addr_mode)(void *priv, const char *bridge_ifname, int val);
Hai Shalom81f62d82019-07-22 12:10:00 -07005080
5081 /**
5082 * update_dh_ie - Update DH IE
5083 * @priv: Private driver interface data
5084 * @peer_mac: Peer MAC address
5085 * @reason_code: Reacon code
5086 * @ie: DH IE
5087 * @ie_len: DH IE length in bytes
5088 * Returns: 0 on success, -1 on failure
5089 *
5090 * This callback is used to let the driver know the DH processing result
5091 * and DH IE for a pending association.
5092 */
5093 int (*update_dh_ie)(void *priv, const u8 *peer_mac, u16 reason_code,
5094 const u8 *ie, size_t ie_len);
Hai Shalomb755a2a2020-04-23 21:49:02 -07005095
5096 /**
5097 * dpp_listen - Notify driver about start/stop of DPP listen
5098 * @priv: Private driver interface data
5099 * @enable: Whether listen state is enabled (or disabled)
5100 * Returns: 0 on success, -1 on failure
5101 *
5102 * This optional callback can be used to update RX frame filtering to
5103 * explicitly allow reception of broadcast Public Action frames.
5104 */
Hai Shalome21d4e82020-04-29 16:34:06 -07005105 int (*dpp_listen)(void *priv, bool enable);
Hai Shalomc1a21442022-02-04 13:43:00 -08005106
Sunil Ravi89eba102022-09-13 21:04:37 -07005107 /**
5108 * set_secure_ranging_ctx - Add or delete secure ranging parameters of
5109 * the specified peer to the driver.
5110 * @priv: Private driver interface data
5111 * @params: Secure ranging parameters
5112 * Returns: 0 on success, -1 on failure
5113 *
5114 */
5115 int (*set_secure_ranging_ctx)(void *priv,
5116 struct secure_ranging_params *params);
5117
5118 /**
5119 * send_pasn_resp - Send PASN response for a set of peers to the
5120 * driver.
5121 * @priv: Private driver interface data
5122 * @params: Parameters holding peers and respective status.
5123 * Returns: 0 on success, -1 on failure
5124 */
5125 int (*send_pasn_resp)(void *priv, struct pasn_auth *params);
5126
5127 /**
5128 * get_sta_mlo_info - Get the current multi-link association info
5129 * @priv: Private driver interface data
5130 * @mlo: Pointer to fill multi-link association info
5131 * Returns: 0 on success, -1 on failure
5132 *
5133 * This callback is used to fetch multi-link of the current association.
5134 */
5135 int (*get_sta_mlo_info)(void *priv,
5136 struct driver_sta_mlo_info *mlo_info);
5137
Sunil Ravi036cec52023-03-29 11:35:17 -07005138 /**
5139 * link_add - Add a link to the AP MLD interface
5140 * @priv: Private driver interface data
5141 * @link_id: The link ID
5142 * @addr: The MAC address to use for the link
5143 * Returns: 0 on success, negative value on failure
5144 */
Sunil Ravi88611412024-06-28 17:34:56 +00005145 int (*link_add)(void *priv, u8 link_id, const u8 *addr);
Sunil Ravi036cec52023-03-29 11:35:17 -07005146
Hai Shalomc1a21442022-02-04 13:43:00 -08005147#ifdef CONFIG_TESTING_OPTIONS
5148 int (*register_frame)(void *priv, u16 type,
5149 const u8 *match, size_t match_len,
5150 bool multicast);
5151#endif /* CONFIG_TESTING_OPTIONS */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005152};
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005153
5154/**
5155 * enum wpa_event_type - Event type for wpa_supplicant_event() calls
5156 */
5157enum wpa_event_type {
5158 /**
5159 * EVENT_ASSOC - Association completed
5160 *
5161 * This event needs to be delivered when the driver completes IEEE
5162 * 802.11 association or reassociation successfully.
5163 * wpa_driver_ops::get_bssid() is expected to provide the current BSSID
5164 * after this event has been generated. In addition, optional
5165 * EVENT_ASSOCINFO may be generated just before EVENT_ASSOC to provide
5166 * more information about the association. If the driver interface gets
5167 * both of these events at the same time, it can also include the
5168 * assoc_info data in EVENT_ASSOC call.
5169 */
5170 EVENT_ASSOC,
5171
5172 /**
5173 * EVENT_DISASSOC - Association lost
5174 *
5175 * This event should be called when association is lost either due to
5176 * receiving deauthenticate or disassociate frame from the AP or when
5177 * sending either of these frames to the current AP. If the driver
5178 * supports separate deauthentication event, EVENT_DISASSOC should only
5179 * be used for disassociation and EVENT_DEAUTH for deauthentication.
5180 * In AP mode, union wpa_event_data::disassoc_info is required.
5181 */
5182 EVENT_DISASSOC,
5183
5184 /**
5185 * EVENT_MICHAEL_MIC_FAILURE - Michael MIC (TKIP) detected
5186 *
5187 * This event must be delivered when a Michael MIC error is detected by
5188 * the local driver. Additional data for event processing is
5189 * provided with union wpa_event_data::michael_mic_failure. This
Sunil Ravia04bd252022-05-02 22:54:18 -07005190 * information is used to request new encryption key and to initiate
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005191 * TKIP countermeasures if needed.
5192 */
5193 EVENT_MICHAEL_MIC_FAILURE,
5194
5195 /**
5196 * EVENT_SCAN_RESULTS - Scan results available
5197 *
5198 * This event must be called whenever scan results are available to be
5199 * fetched with struct wpa_driver_ops::get_scan_results(). This event
5200 * is expected to be used some time after struct wpa_driver_ops::scan()
5201 * is called. If the driver provides an unsolicited event when the scan
5202 * has been completed, this event can be used to trigger
5203 * EVENT_SCAN_RESULTS call. If such event is not available from the
5204 * driver, the driver wrapper code is expected to use a registered
5205 * timeout to generate EVENT_SCAN_RESULTS call after the time that the
5206 * scan is expected to be completed. Optional information about
5207 * completed scan can be provided with union wpa_event_data::scan_info.
5208 */
5209 EVENT_SCAN_RESULTS,
5210
5211 /**
5212 * EVENT_ASSOCINFO - Report optional extra information for association
5213 *
5214 * This event can be used to report extra association information for
5215 * EVENT_ASSOC processing. This extra information includes IEs from
5216 * association frames and Beacon/Probe Response frames in union
5217 * wpa_event_data::assoc_info. EVENT_ASSOCINFO must be send just before
5218 * EVENT_ASSOC. Alternatively, the driver interface can include
5219 * assoc_info data in the EVENT_ASSOC call if it has all the
5220 * information available at the same point.
5221 */
5222 EVENT_ASSOCINFO,
5223
5224 /**
5225 * EVENT_INTERFACE_STATUS - Report interface status changes
5226 *
5227 * This optional event can be used to report changes in interface
5228 * status (interface added/removed) using union
5229 * wpa_event_data::interface_status. This can be used to trigger
5230 * wpa_supplicant to stop and re-start processing for the interface,
5231 * e.g., when a cardbus card is ejected/inserted.
5232 */
5233 EVENT_INTERFACE_STATUS,
5234
5235 /**
5236 * EVENT_PMKID_CANDIDATE - Report a candidate AP for pre-authentication
5237 *
5238 * This event can be used to inform wpa_supplicant about candidates for
5239 * RSN (WPA2) pre-authentication. If wpa_supplicant is not responsible
5240 * for scan request (ap_scan=2 mode), this event is required for
5241 * pre-authentication. If wpa_supplicant is performing scan request
5242 * (ap_scan=1), this event is optional since scan results can be used
5243 * to add pre-authentication candidates. union
5244 * wpa_event_data::pmkid_candidate is used to report the BSSID of the
5245 * candidate and priority of the candidate, e.g., based on the signal
5246 * strength, in order to try to pre-authenticate first with candidates
5247 * that are most likely targets for re-association.
5248 *
5249 * EVENT_PMKID_CANDIDATE can be called whenever the driver has updates
5250 * on the candidate list. In addition, it can be called for the current
5251 * AP and APs that have existing PMKSA cache entries. wpa_supplicant
5252 * will automatically skip pre-authentication in cases where a valid
5253 * PMKSA exists. When more than one candidate exists, this event should
5254 * be generated once for each candidate.
5255 *
5256 * Driver will be notified about successful pre-authentication with
5257 * struct wpa_driver_ops::add_pmkid() calls.
5258 */
5259 EVENT_PMKID_CANDIDATE,
5260
5261 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005262 * EVENT_TDLS - Request TDLS operation
5263 *
5264 * This event can be used to request a TDLS operation to be performed.
5265 */
5266 EVENT_TDLS,
5267
5268 /**
5269 * EVENT_FT_RESPONSE - Report FT (IEEE 802.11r) response IEs
5270 *
5271 * The driver is expected to report the received FT IEs from
5272 * FT authentication sequence from the AP. The FT IEs are included in
5273 * the extra information in union wpa_event_data::ft_ies.
5274 */
5275 EVENT_FT_RESPONSE,
5276
5277 /**
5278 * EVENT_IBSS_RSN_START - Request RSN authentication in IBSS
5279 *
5280 * The driver can use this event to inform wpa_supplicant about a STA
5281 * in an IBSS with which protected frames could be exchanged. This
5282 * event starts RSN authentication with the other STA to authenticate
5283 * the STA and set up encryption keys with it.
5284 */
5285 EVENT_IBSS_RSN_START,
5286
5287 /**
5288 * EVENT_AUTH - Authentication result
5289 *
5290 * This event should be called when authentication attempt has been
5291 * completed. This is only used if the driver supports separate
5292 * authentication step (struct wpa_driver_ops::authenticate).
5293 * Information about authentication result is included in
5294 * union wpa_event_data::auth.
5295 */
5296 EVENT_AUTH,
5297
5298 /**
5299 * EVENT_DEAUTH - Authentication lost
5300 *
5301 * This event should be called when authentication is lost either due
5302 * to receiving deauthenticate frame from the AP or when sending that
5303 * frame to the current AP.
5304 * In AP mode, union wpa_event_data::deauth_info is required.
5305 */
5306 EVENT_DEAUTH,
5307
5308 /**
5309 * EVENT_ASSOC_REJECT - Association rejected
5310 *
5311 * This event should be called when (re)association attempt has been
5312 * rejected by the AP. Information about the association response is
5313 * included in union wpa_event_data::assoc_reject.
5314 */
5315 EVENT_ASSOC_REJECT,
5316
5317 /**
5318 * EVENT_AUTH_TIMED_OUT - Authentication timed out
5319 */
5320 EVENT_AUTH_TIMED_OUT,
5321
5322 /**
5323 * EVENT_ASSOC_TIMED_OUT - Association timed out
5324 */
5325 EVENT_ASSOC_TIMED_OUT,
5326
5327 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005328 * EVENT_WPS_BUTTON_PUSHED - Report hardware push button press for WPS
5329 */
5330 EVENT_WPS_BUTTON_PUSHED,
5331
5332 /**
5333 * EVENT_TX_STATUS - Report TX status
5334 */
5335 EVENT_TX_STATUS,
5336
5337 /**
5338 * EVENT_RX_FROM_UNKNOWN - Report RX from unknown STA
5339 */
5340 EVENT_RX_FROM_UNKNOWN,
5341
5342 /**
5343 * EVENT_RX_MGMT - Report RX of a management frame
5344 */
5345 EVENT_RX_MGMT,
5346
5347 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005348 * EVENT_REMAIN_ON_CHANNEL - Remain-on-channel duration started
5349 *
5350 * This event is used to indicate when the driver has started the
5351 * requested remain-on-channel duration. Information about the
5352 * operation is included in union wpa_event_data::remain_on_channel.
5353 */
5354 EVENT_REMAIN_ON_CHANNEL,
5355
5356 /**
5357 * EVENT_CANCEL_REMAIN_ON_CHANNEL - Remain-on-channel timed out
5358 *
5359 * This event is used to indicate when the driver has completed
5360 * remain-on-channel duration, i.e., may noot be available on the
5361 * requested channel anymore. Information about the
5362 * operation is included in union wpa_event_data::remain_on_channel.
5363 */
5364 EVENT_CANCEL_REMAIN_ON_CHANNEL,
5365
5366 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005367 * EVENT_RX_PROBE_REQ - Indicate received Probe Request frame
5368 *
5369 * This event is used to indicate when a Probe Request frame has been
5370 * received. Information about the received frame is included in
5371 * union wpa_event_data::rx_probe_req. The driver is required to report
5372 * these events only after successfully completed probe_req_report()
5373 * commands to request the events (i.e., report parameter is non-zero)
5374 * in station mode. In AP mode, Probe Request frames should always be
5375 * reported.
5376 */
5377 EVENT_RX_PROBE_REQ,
5378
5379 /**
5380 * EVENT_NEW_STA - New wired device noticed
5381 *
5382 * This event is used to indicate that a new device has been detected
5383 * in a network that does not use association-like functionality (i.e.,
5384 * mainly wired Ethernet). This can be used to start EAPOL
5385 * authenticator when receiving a frame from a device. The address of
5386 * the device is included in union wpa_event_data::new_sta.
5387 */
5388 EVENT_NEW_STA,
5389
5390 /**
5391 * EVENT_EAPOL_RX - Report received EAPOL frame
5392 *
5393 * When in AP mode with hostapd, this event is required to be used to
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08005394 * deliver the receive EAPOL frames from the driver.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005395 */
5396 EVENT_EAPOL_RX,
5397
5398 /**
5399 * EVENT_SIGNAL_CHANGE - Indicate change in signal strength
5400 *
5401 * This event is used to indicate changes in the signal strength
5402 * observed in frames received from the current AP if signal strength
5403 * monitoring has been enabled with signal_monitor().
5404 */
5405 EVENT_SIGNAL_CHANGE,
5406
5407 /**
5408 * EVENT_INTERFACE_ENABLED - Notify that interface was enabled
5409 *
5410 * This event is used to indicate that the interface was enabled after
5411 * having been previously disabled, e.g., due to rfkill.
5412 */
5413 EVENT_INTERFACE_ENABLED,
5414
5415 /**
5416 * EVENT_INTERFACE_DISABLED - Notify that interface was disabled
5417 *
5418 * This event is used to indicate that the interface was disabled,
5419 * e.g., due to rfkill.
5420 */
5421 EVENT_INTERFACE_DISABLED,
5422
5423 /**
5424 * EVENT_CHANNEL_LIST_CHANGED - Channel list changed
5425 *
5426 * This event is used to indicate that the channel list has changed,
5427 * e.g., because of a regulatory domain change triggered by scan
5428 * results including an AP advertising a country code.
5429 */
5430 EVENT_CHANNEL_LIST_CHANGED,
5431
5432 /**
5433 * EVENT_INTERFACE_UNAVAILABLE - Notify that interface is unavailable
5434 *
5435 * This event is used to indicate that the driver cannot maintain this
5436 * interface in its operation mode anymore. The most likely use for
5437 * this is to indicate that AP mode operation is not available due to
5438 * operating channel would need to be changed to a DFS channel when
5439 * the driver does not support radar detection and another virtual
5440 * interfaces caused the operating channel to change. Other similar
5441 * resource conflicts could also trigger this for station mode
Dmitry Shmidtd30ac602014-06-30 09:54:22 -07005442 * interfaces. This event can be propagated when channel switching
5443 * fails.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005444 */
5445 EVENT_INTERFACE_UNAVAILABLE,
5446
5447 /**
5448 * EVENT_BEST_CHANNEL
5449 *
5450 * Driver generates this event whenever it detects a better channel
5451 * (e.g., based on RSSI or channel use). This information can be used
5452 * to improve channel selection for a new AP/P2P group.
5453 */
5454 EVENT_BEST_CHANNEL,
5455
5456 /**
5457 * EVENT_UNPROT_DEAUTH - Unprotected Deauthentication frame received
5458 *
5459 * This event should be called when a Deauthentication frame is dropped
5460 * due to it not being protected (MFP/IEEE 802.11w).
5461 * union wpa_event_data::unprot_deauth is required to provide more
5462 * details of the frame.
5463 */
5464 EVENT_UNPROT_DEAUTH,
5465
5466 /**
5467 * EVENT_UNPROT_DISASSOC - Unprotected Disassociation frame received
5468 *
5469 * This event should be called when a Disassociation frame is dropped
5470 * due to it not being protected (MFP/IEEE 802.11w).
5471 * union wpa_event_data::unprot_disassoc is required to provide more
5472 * details of the frame.
5473 */
5474 EVENT_UNPROT_DISASSOC,
5475
5476 /**
5477 * EVENT_STATION_LOW_ACK
5478 *
5479 * Driver generates this event whenever it detected that a particular
5480 * station was lost. Detection can be through massive transmission
5481 * failures for example.
5482 */
5483 EVENT_STATION_LOW_ACK,
5484
5485 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005486 * EVENT_IBSS_PEER_LOST - IBSS peer not reachable anymore
5487 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08005488 EVENT_IBSS_PEER_LOST,
5489
5490 /**
5491 * EVENT_DRIVER_GTK_REKEY - Device/driver did GTK rekey
5492 *
5493 * This event carries the new replay counter to notify wpa_supplicant
5494 * of the current EAPOL-Key Replay Counter in case the driver/firmware
5495 * completed Group Key Handshake while the host (including
5496 * wpa_supplicant was sleeping).
5497 */
5498 EVENT_DRIVER_GTK_REKEY,
5499
5500 /**
5501 * EVENT_SCHED_SCAN_STOPPED - Scheduled scan was stopped
5502 */
5503 EVENT_SCHED_SCAN_STOPPED,
5504
5505 /**
5506 * EVENT_DRIVER_CLIENT_POLL_OK - Station responded to poll
5507 *
5508 * This event indicates that the station responded to the poll
5509 * initiated with @poll_client.
5510 */
5511 EVENT_DRIVER_CLIENT_POLL_OK,
5512
5513 /**
5514 * EVENT_EAPOL_TX_STATUS - notify of EAPOL TX status
5515 */
Dmitry Shmidt04949592012-07-19 12:16:46 -07005516 EVENT_EAPOL_TX_STATUS,
5517
5518 /**
5519 * EVENT_CH_SWITCH - AP or GO decided to switch channels
5520 *
5521 * Described in wpa_event_data.ch_switch
5522 * */
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07005523 EVENT_CH_SWITCH,
5524
5525 /**
Hai Shalom81f62d82019-07-22 12:10:00 -07005526 * EVENT_CH_SWITCH_STARTED - AP or GO started to switch channels
5527 *
5528 * This is a pre-switch event indicating the shortly following switch
5529 * of operating channels.
5530 *
5531 * Described in wpa_event_data.ch_switch
5532 */
5533 EVENT_CH_SWITCH_STARTED,
5534 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07005535 * EVENT_WNM - Request WNM operation
5536 *
5537 * This event can be used to request a WNM operation to be performed.
5538 */
Dmitry Shmidtf8623282013-02-20 14:34:59 -08005539 EVENT_WNM,
5540
5541 /**
5542 * EVENT_CONNECT_FAILED_REASON - Connection failure reason in AP mode
5543 *
5544 * This event indicates that the driver reported a connection failure
5545 * with the specified client (for example, max client reached, etc.) in
5546 * AP mode.
5547 */
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005548 EVENT_CONNECT_FAILED_REASON,
5549
5550 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005551 * EVENT_DFS_RADAR_DETECTED - Notify of radar detection
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005552 *
5553 * A radar has been detected on the supplied frequency, hostapd should
5554 * react accordingly (e.g., change channel).
5555 */
5556 EVENT_DFS_RADAR_DETECTED,
5557
5558 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005559 * EVENT_DFS_CAC_FINISHED - Notify that channel availability check has been completed
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005560 *
5561 * After a successful CAC, the channel can be marked clear and used.
5562 */
5563 EVENT_DFS_CAC_FINISHED,
5564
5565 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005566 * EVENT_DFS_CAC_ABORTED - Notify that channel availability check has been aborted
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005567 *
5568 * The CAC was not successful, and the channel remains in the previous
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08005569 * state. This may happen due to a radar being detected or other
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005570 * external influences.
5571 */
5572 EVENT_DFS_CAC_ABORTED,
5573
5574 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005575 * EVENT_DFS_NOP_FINISHED - Notify that non-occupancy period is over
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005576 *
5577 * The channel which was previously unavailable is now available again.
5578 */
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07005579 EVENT_DFS_NOP_FINISHED,
5580
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08005581 /**
5582 * EVENT_SURVEY - Received survey data
5583 *
5584 * This event gets triggered when a driver query is issued for survey
5585 * data and the requested data becomes available. The returned data is
5586 * stored in struct survey_results. The results provide at most one
5587 * survey entry for each frequency and at minimum will provide one
5588 * survey entry for one frequency. The survey data can be os_malloc()'d
5589 * and then os_free()'d, so the event callback must only copy data.
5590 */
5591 EVENT_SURVEY,
5592
5593 /**
5594 * EVENT_SCAN_STARTED - Scan started
5595 *
5596 * This indicates that driver has started a scan operation either based
5597 * on a request from wpa_supplicant/hostapd or from another application.
5598 * EVENT_SCAN_RESULTS is used to indicate when the scan has been
5599 * completed (either successfully or by getting cancelled).
5600 */
Dmitry Shmidtcf32e602014-01-28 10:57:39 -08005601 EVENT_SCAN_STARTED,
5602
5603 /**
5604 * EVENT_AVOID_FREQUENCIES - Received avoid frequency range
5605 *
5606 * This event indicates a set of frequency ranges that should be avoided
5607 * to reduce issues due to interference or internal co-existence
5608 * information in the driver.
5609 */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08005610 EVENT_AVOID_FREQUENCIES,
5611
5612 /**
5613 * EVENT_NEW_PEER_CANDIDATE - new (unknown) mesh peer notification
5614 */
5615 EVENT_NEW_PEER_CANDIDATE,
5616
5617 /**
5618 * EVENT_ACS_CHANNEL_SELECTED - Received selected channels by ACS
5619 *
5620 * Indicates a pair of primary and secondary channels chosen by ACS
5621 * in device.
5622 */
5623 EVENT_ACS_CHANNEL_SELECTED,
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005624
5625 /**
5626 * EVENT_DFS_CAC_STARTED - Notify that channel availability check has
5627 * been started.
5628 *
5629 * This event indicates that channel availability check has been started
5630 * on a DFS frequency by a driver that supports DFS Offload.
5631 */
5632 EVENT_DFS_CAC_STARTED,
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07005633
5634 /**
5635 * EVENT_P2P_LO_STOP - Notify that P2P listen offload is stopped
5636 */
5637 EVENT_P2P_LO_STOP,
Paul Stewart092955c2017-02-06 09:13:09 -08005638
5639 /**
5640 * EVENT_BEACON_LOSS - Beacon loss detected
5641 *
5642 * This event indicates that no Beacon frames has been received from
5643 * the current AP. This may indicate that the AP is not anymore in
5644 * range.
5645 */
5646 EVENT_BEACON_LOSS,
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005647
5648 /**
5649 * EVENT_DFS_PRE_CAC_EXPIRED - Notify that channel availability check
5650 * done previously (Pre-CAC) on the channel has expired. This would
5651 * normally be on a non-ETSI DFS regulatory domain. DFS state of the
5652 * channel will be moved from available to usable. A new CAC has to be
5653 * performed before start operating on this channel.
5654 */
5655 EVENT_DFS_PRE_CAC_EXPIRED,
Roshan Pius3a1667e2018-07-03 15:17:14 -07005656
5657 /**
5658 * EVENT_EXTERNAL_AUTH - This event interface is used by host drivers
5659 * that do not define separate commands for authentication and
5660 * association (~WPA_DRIVER_FLAGS_SME) but offload the 802.11
5661 * authentication to wpa_supplicant. This event carries all the
5662 * necessary information from the host driver for the authentication to
5663 * happen.
5664 */
5665 EVENT_EXTERNAL_AUTH,
5666
5667 /**
5668 * EVENT_PORT_AUTHORIZED - Notification that a connection is authorized
5669 *
5670 * This event should be indicated when the driver completes the 4-way
5671 * handshake. This event should be preceded by an EVENT_ASSOC that
5672 * indicates the completion of IEEE 802.11 association.
5673 */
5674 EVENT_PORT_AUTHORIZED,
5675
5676 /**
5677 * EVENT_STATION_OPMODE_CHANGED - Notify STA's HT/VHT operation mode
5678 * change event.
5679 */
5680 EVENT_STATION_OPMODE_CHANGED,
5681
5682 /**
5683 * EVENT_INTERFACE_MAC_CHANGED - Notify that interface MAC changed
5684 *
5685 * This event is emitted when the MAC changes while the interface is
5686 * enabled. When an interface was disabled and becomes enabled, it
5687 * must be always assumed that the MAC possibly changed.
5688 */
5689 EVENT_INTERFACE_MAC_CHANGED,
5690
5691 /**
5692 * EVENT_WDS_STA_INTERFACE_STATUS - Notify WDS STA interface status
5693 *
5694 * This event is emitted when an interface is added/removed for WDS STA.
5695 */
5696 EVENT_WDS_STA_INTERFACE_STATUS,
Hai Shalom81f62d82019-07-22 12:10:00 -07005697
5698 /**
5699 * EVENT_UPDATE_DH - Notification of updated DH information
5700 */
5701 EVENT_UPDATE_DH,
Hai Shalomfdcde762020-04-02 11:19:20 -07005702
5703 /**
5704 * EVENT_UNPROT_BEACON - Unprotected Beacon frame received
5705 *
5706 * This event should be called when a Beacon frame is dropped due to it
5707 * not being protected correctly. union wpa_event_data::unprot_beacon
5708 * is required to provide more details of the frame.
5709 */
5710 EVENT_UNPROT_BEACON,
Hai Shalomc1a21442022-02-04 13:43:00 -08005711
5712 /**
5713 * EVENT_TX_WAIT_EXPIRE - TX wait timed out
5714 *
5715 * This event is used to indicate when the driver has completed
5716 * wait for a response frame based on a TX request that specified a
5717 * non-zero wait time and that has not been explicitly cancelled.
5718 */
5719 EVENT_TX_WAIT_EXPIRE,
Sunil Ravia04bd252022-05-02 22:54:18 -07005720
5721 /**
5722 * EVENT_BSS_COLOR_COLLISION - Notification of a BSS color collision
5723 */
5724 EVENT_BSS_COLOR_COLLISION,
5725
5726 /**
5727 * EVENT_CCA_STARTED_NOTIFY - Notification that CCA has started
5728 */
5729 EVENT_CCA_STARTED_NOTIFY,
5730
5731 /**
5732 * EVENT_CCA_ABORTED_NOTIFY - Notification that CCA has aborted
5733 */
5734 EVENT_CCA_ABORTED_NOTIFY,
5735
5736 /**
5737 * EVENT_CCA_NOTIFY - Notification that CCA has completed
5738 */
5739 EVENT_CCA_NOTIFY,
Sunil Ravi89eba102022-09-13 21:04:37 -07005740
5741 /**
5742 * EVENT_PASN_AUTH - This event is used by the driver that requests
5743 * PASN authentication and secure ranging context for multiple peers.
5744 */
5745 EVENT_PASN_AUTH,
5746
5747 /**
5748 * EVENT_LINK_CH_SWITCH - MLD AP link decided to switch channels
5749 *
5750 * Described in wpa_event_data.ch_switch.
5751 *
5752 */
5753 EVENT_LINK_CH_SWITCH,
5754
5755 /**
5756 * EVENT_LINK_CH_SWITCH_STARTED - MLD AP link started to switch channels
5757 *
5758 * This is a pre-switch event indicating the shortly following switch
5759 * of operating channels.
5760 *
5761 * Described in wpa_event_data.ch_switch.
5762 */
5763 EVENT_LINK_CH_SWITCH_STARTED,
Sunil Ravi640215c2023-06-28 23:08:09 +00005764
5765 /**
5766 * EVENT_TID_LINK_MAP - MLD event to set TID-to-link mapping
5767 *
5768 * This event is used by the driver to indicate the received TID-to-link
5769 * mapping response from the associated AP MLD.
5770 *
5771 * Described in wpa_event_data.t2l_map_info.
5772 */
5773 EVENT_TID_LINK_MAP,
5774
5775 /**
5776 * EVENT_LINK_RECONFIG - Notification that AP links removed
5777 */
5778 EVENT_LINK_RECONFIG,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005779};
5780
5781
5782/**
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07005783 * struct freq_survey - Channel survey info
5784 *
5785 * @ifidx: Interface index in which this survey was observed
5786 * @freq: Center of frequency of the surveyed channel
5787 * @nf: Channel noise floor in dBm
5788 * @channel_time: Amount of time in ms the radio spent on the channel
5789 * @channel_time_busy: Amount of time in ms the radio detected some signal
5790 * that indicated to the radio the channel was not clear
5791 * @channel_time_rx: Amount of time the radio spent receiving data
5792 * @channel_time_tx: Amount of time the radio spent transmitting data
5793 * @filled: bitmask indicating which fields have been reported, see
5794 * SURVEY_HAS_* defines.
5795 * @list: Internal list pointers
5796 */
5797struct freq_survey {
5798 u32 ifidx;
5799 unsigned int freq;
5800 s8 nf;
5801 u64 channel_time;
5802 u64 channel_time_busy;
5803 u64 channel_time_rx;
5804 u64 channel_time_tx;
5805 unsigned int filled;
5806 struct dl_list list;
5807};
5808
5809#define SURVEY_HAS_NF BIT(0)
5810#define SURVEY_HAS_CHAN_TIME BIT(1)
5811#define SURVEY_HAS_CHAN_TIME_BUSY BIT(2)
5812#define SURVEY_HAS_CHAN_TIME_RX BIT(3)
5813#define SURVEY_HAS_CHAN_TIME_TX BIT(4)
5814
Hai Shalom60840252021-02-19 19:02:11 -08005815/**
5816 * enum sta_connect_fail_reason_codes - STA connect failure reason code values
5817 * @STA_CONNECT_FAIL_REASON_UNSPECIFIED: No reason code specified for
5818 * connection failure.
5819 * @STA_CONNECT_FAIL_REASON_NO_BSS_FOUND: No Probe Response frame received
5820 * for unicast Probe Request frame.
5821 * @STA_CONNECT_FAIL_REASON_AUTH_TX_FAIL: STA failed to send auth request.
5822 * @STA_CONNECT_FAIL_REASON_AUTH_NO_ACK_RECEIVED: AP didn't send ACK for
5823 * auth request.
5824 * @STA_CONNECT_FAIL_REASON_AUTH_NO_RESP_RECEIVED: Auth response is not
5825 * received from AP.
5826 * @STA_CONNECT_FAIL_REASON_ASSOC_REQ_TX_FAIL: STA failed to send
5827 * Association Request frame.
5828 * @STA_CONNECT_FAIL_REASON_ASSOC_NO_ACK_RECEIVED: AP didn't send ACK for
5829 * Association Request frame.
5830 * @STA_CONNECT_FAIL_REASON_ASSOC_NO_RESP_RECEIVED: Association Response
5831 * frame is not received from AP.
5832 */
5833enum sta_connect_fail_reason_codes {
5834 STA_CONNECT_FAIL_REASON_UNSPECIFIED = 0,
5835 STA_CONNECT_FAIL_REASON_NO_BSS_FOUND = 1,
5836 STA_CONNECT_FAIL_REASON_AUTH_TX_FAIL = 2,
5837 STA_CONNECT_FAIL_REASON_AUTH_NO_ACK_RECEIVED = 3,
5838 STA_CONNECT_FAIL_REASON_AUTH_NO_RESP_RECEIVED = 4,
5839 STA_CONNECT_FAIL_REASON_ASSOC_REQ_TX_FAIL = 5,
5840 STA_CONNECT_FAIL_REASON_ASSOC_NO_ACK_RECEIVED = 6,
5841 STA_CONNECT_FAIL_REASON_ASSOC_NO_RESP_RECEIVED = 7,
5842};
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07005843
5844/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005845 * union wpa_event_data - Additional data for wpa_supplicant_event() calls
5846 */
5847union wpa_event_data {
5848 /**
5849 * struct assoc_info - Data for EVENT_ASSOC and EVENT_ASSOCINFO events
5850 *
5851 * This structure is optional for EVENT_ASSOC calls and required for
5852 * EVENT_ASSOCINFO calls. By using EVENT_ASSOC with this data, the
5853 * driver interface does not need to generate separate EVENT_ASSOCINFO
5854 * calls.
5855 */
5856 struct assoc_info {
5857 /**
5858 * reassoc - Flag to indicate association or reassociation
5859 */
5860 int reassoc;
5861
5862 /**
5863 * req_ies - (Re)Association Request IEs
5864 *
5865 * If the driver generates WPA/RSN IE, this event data must be
5866 * returned for WPA handshake to have needed information. If
5867 * wpa_supplicant-generated WPA/RSN IE is used, this
5868 * information event is optional.
5869 *
5870 * This should start with the first IE (fixed fields before IEs
5871 * are not included).
5872 */
5873 const u8 *req_ies;
5874
5875 /**
5876 * req_ies_len - Length of req_ies in bytes
5877 */
5878 size_t req_ies_len;
5879
5880 /**
5881 * resp_ies - (Re)Association Response IEs
5882 *
5883 * Optional association data from the driver. This data is not
5884 * required WPA, but may be useful for some protocols and as
5885 * such, should be reported if this is available to the driver
5886 * interface.
5887 *
5888 * This should start with the first IE (fixed fields before IEs
5889 * are not included).
5890 */
5891 const u8 *resp_ies;
5892
5893 /**
5894 * resp_ies_len - Length of resp_ies in bytes
5895 */
5896 size_t resp_ies_len;
5897
5898 /**
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08005899 * resp_frame - (Re)Association Response frame
5900 */
5901 const u8 *resp_frame;
5902
5903 /**
5904 * resp_frame_len - (Re)Association Response frame length
5905 */
5906 size_t resp_frame_len;
5907
5908 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005909 * beacon_ies - Beacon or Probe Response IEs
5910 *
5911 * Optional Beacon/ProbeResp data: IEs included in Beacon or
5912 * Probe Response frames from the current AP (i.e., the one
5913 * that the client just associated with). This information is
5914 * used to update WPA/RSN IE for the AP. If this field is not
5915 * set, the results from previous scan will be used. If no
5916 * data for the new AP is found, scan results will be requested
5917 * again (without scan request). At this point, the driver is
5918 * expected to provide WPA/RSN IE for the AP (if WPA/WPA2 is
5919 * used).
5920 *
5921 * This should start with the first IE (fixed fields before IEs
5922 * are not included).
5923 */
5924 const u8 *beacon_ies;
5925
5926 /**
5927 * beacon_ies_len - Length of beacon_ies */
5928 size_t beacon_ies_len;
5929
5930 /**
5931 * freq - Frequency of the operational channel in MHz
5932 */
5933 unsigned int freq;
5934
5935 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08005936 * wmm_params - WMM parameters used in this association.
5937 */
5938 struct wmm_params wmm_params;
5939
5940 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005941 * addr - Station address (for AP mode)
5942 */
5943 const u8 *addr;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08005944
5945 /**
5946 * The following is the key management offload information
5947 * @authorized
5948 * @key_replay_ctr
5949 * @key_replay_ctr_len
5950 * @ptk_kck
5951 * @ptk_kek_len
5952 * @ptk_kek
5953 * @ptk_kek_len
5954 */
5955
5956 /**
5957 * authorized - Status of key management offload,
5958 * 1 = successful
5959 */
5960 int authorized;
5961
5962 /**
5963 * key_replay_ctr - Key replay counter value last used
5964 * in a valid EAPOL-Key frame
5965 */
5966 const u8 *key_replay_ctr;
5967
5968 /**
5969 * key_replay_ctr_len - The length of key_replay_ctr
5970 */
5971 size_t key_replay_ctr_len;
5972
5973 /**
5974 * ptk_kck - The derived PTK KCK
5975 */
5976 const u8 *ptk_kck;
5977
5978 /**
5979 * ptk_kek_len - The length of ptk_kck
5980 */
5981 size_t ptk_kck_len;
5982
5983 /**
5984 * ptk_kek - The derived PTK KEK
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005985 * This is used in key management offload and also in FILS SK
5986 * offload.
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08005987 */
5988 const u8 *ptk_kek;
5989
5990 /**
5991 * ptk_kek_len - The length of ptk_kek
5992 */
5993 size_t ptk_kek_len;
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08005994
5995 /**
5996 * subnet_status - The subnet status:
5997 * 0 = unknown, 1 = unchanged, 2 = changed
5998 */
5999 u8 subnet_status;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07006000
6001 /**
6002 * The following information is used in FILS SK offload
6003 * @fils_erp_next_seq_num
6004 * @fils_pmk
6005 * @fils_pmk_len
6006 * @fils_pmkid
6007 */
6008
6009 /**
6010 * fils_erp_next_seq_num - The next sequence number to use in
6011 * FILS ERP messages
6012 */
6013 u16 fils_erp_next_seq_num;
6014
6015 /**
6016 * fils_pmk - A new PMK if generated in case of FILS
6017 * authentication
6018 */
6019 const u8 *fils_pmk;
6020
6021 /**
6022 * fils_pmk_len - Length of fils_pmk
6023 */
6024 size_t fils_pmk_len;
6025
6026 /**
6027 * fils_pmkid - PMKID used or generated in FILS authentication
6028 */
6029 const u8 *fils_pmkid;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006030
6031 /**
6032 * link_addr - Link address of the STA
6033 */
6034 const u8 *link_addr;
6035
6036 /**
6037 * assoc_link_id - Association link id of the MLO association or
6038 * -1 if MLO is not used
6039 */
6040 int assoc_link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006041 } assoc_info;
6042
6043 /**
6044 * struct disassoc_info - Data for EVENT_DISASSOC events
6045 */
6046 struct disassoc_info {
6047 /**
6048 * addr - Station address (for AP mode)
6049 */
6050 const u8 *addr;
6051
6052 /**
6053 * reason_code - Reason Code (host byte order) used in
6054 * Deauthentication frame
6055 */
6056 u16 reason_code;
6057
6058 /**
6059 * ie - Optional IE(s) in Disassociation frame
6060 */
6061 const u8 *ie;
6062
6063 /**
6064 * ie_len - Length of ie buffer in octets
6065 */
6066 size_t ie_len;
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08006067
6068 /**
6069 * locally_generated - Whether the frame was locally generated
6070 */
6071 int locally_generated;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006072 } disassoc_info;
6073
6074 /**
6075 * struct deauth_info - Data for EVENT_DEAUTH events
6076 */
6077 struct deauth_info {
6078 /**
6079 * addr - Station address (for AP mode)
6080 */
6081 const u8 *addr;
6082
6083 /**
6084 * reason_code - Reason Code (host byte order) used in
6085 * Deauthentication frame
6086 */
6087 u16 reason_code;
6088
6089 /**
6090 * ie - Optional IE(s) in Deauthentication frame
6091 */
6092 const u8 *ie;
6093
6094 /**
6095 * ie_len - Length of ie buffer in octets
6096 */
6097 size_t ie_len;
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08006098
6099 /**
6100 * locally_generated - Whether the frame was locally generated
6101 */
6102 int locally_generated;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006103 } deauth_info;
6104
6105 /**
6106 * struct michael_mic_failure - Data for EVENT_MICHAEL_MIC_FAILURE
6107 */
6108 struct michael_mic_failure {
6109 int unicast;
6110 const u8 *src;
6111 } michael_mic_failure;
6112
6113 /**
6114 * struct interface_status - Data for EVENT_INTERFACE_STATUS
6115 */
6116 struct interface_status {
Dmitry Shmidte4663042016-04-04 10:07:49 -07006117 unsigned int ifindex;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006118 char ifname[100];
6119 enum {
6120 EVENT_INTERFACE_ADDED, EVENT_INTERFACE_REMOVED
6121 } ievent;
6122 } interface_status;
6123
6124 /**
6125 * struct pmkid_candidate - Data for EVENT_PMKID_CANDIDATE
6126 */
6127 struct pmkid_candidate {
6128 /** BSSID of the PMKID candidate */
6129 u8 bssid[ETH_ALEN];
6130 /** Smaller the index, higher the priority */
6131 int index;
6132 /** Whether RSN IE includes pre-authenticate flag */
6133 int preauth;
6134 } pmkid_candidate;
6135
6136 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006137 * struct tdls - Data for EVENT_TDLS
6138 */
6139 struct tdls {
6140 u8 peer[ETH_ALEN];
6141 enum {
6142 TDLS_REQUEST_SETUP,
Dmitry Shmidt4dd28dc2015-03-10 11:21:43 -07006143 TDLS_REQUEST_TEARDOWN,
6144 TDLS_REQUEST_DISCOVER,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006145 } oper;
6146 u16 reason_code; /* for teardown */
6147 } tdls;
6148
6149 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07006150 * struct wnm - Data for EVENT_WNM
6151 */
6152 struct wnm {
6153 u8 addr[ETH_ALEN];
6154 enum {
6155 WNM_OPER_SLEEP,
6156 } oper;
6157 enum {
6158 WNM_SLEEP_ENTER,
6159 WNM_SLEEP_EXIT
6160 } sleep_action;
6161 int sleep_intval;
6162 u16 reason_code;
6163 u8 *buf;
6164 u16 buf_len;
6165 } wnm;
6166
6167 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006168 * struct ft_ies - FT information elements (EVENT_FT_RESPONSE)
6169 *
6170 * During FT (IEEE 802.11r) authentication sequence, the driver is
6171 * expected to use this event to report received FT IEs (MDIE, FTIE,
6172 * RSN IE, TIE, possible resource request) to the supplicant. The FT
6173 * IEs for the next message will be delivered through the
6174 * struct wpa_driver_ops::update_ft_ies() callback.
6175 */
6176 struct ft_ies {
6177 const u8 *ies;
6178 size_t ies_len;
6179 int ft_action;
6180 u8 target_ap[ETH_ALEN];
6181 /** Optional IE(s), e.g., WMM TSPEC(s), for RIC-Request */
6182 const u8 *ric_ies;
6183 /** Length of ric_ies buffer in octets */
6184 size_t ric_ies_len;
6185 } ft_ies;
6186
6187 /**
6188 * struct ibss_rsn_start - Data for EVENT_IBSS_RSN_START
6189 */
6190 struct ibss_rsn_start {
6191 u8 peer[ETH_ALEN];
6192 } ibss_rsn_start;
6193
6194 /**
6195 * struct auth_info - Data for EVENT_AUTH events
6196 */
6197 struct auth_info {
6198 u8 peer[ETH_ALEN];
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006199 u8 bssid[ETH_ALEN];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006200 u16 auth_type;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006201 u16 auth_transaction;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006202 u16 status_code;
6203 const u8 *ies;
6204 size_t ies_len;
6205 } auth;
6206
6207 /**
6208 * struct assoc_reject - Data for EVENT_ASSOC_REJECT events
6209 */
6210 struct assoc_reject {
6211 /**
6212 * bssid - BSSID of the AP that rejected association
6213 */
6214 const u8 *bssid;
6215
6216 /**
6217 * resp_ies - (Re)Association Response IEs
6218 *
6219 * Optional association data from the driver. This data is not
6220 * required WPA, but may be useful for some protocols and as
6221 * such, should be reported if this is available to the driver
6222 * interface.
6223 *
6224 * This should start with the first IE (fixed fields before IEs
6225 * are not included).
6226 */
6227 const u8 *resp_ies;
6228
6229 /**
6230 * resp_ies_len - Length of resp_ies in bytes
6231 */
6232 size_t resp_ies_len;
6233
6234 /**
6235 * status_code - Status Code from (Re)association Response
6236 */
6237 u16 status_code;
Dmitry Shmidtd5ab1b52016-06-21 12:38:41 -07006238
6239 /**
6240 * timed_out - Whether failure is due to timeout (etc.) rather
6241 * than explicit rejection response from the AP.
6242 */
6243 int timed_out;
Dmitry Shmidtebd93af2017-02-21 13:40:44 -08006244
6245 /**
6246 * timeout_reason - Reason for the timeout
6247 */
6248 const char *timeout_reason;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07006249
6250 /**
6251 * fils_erp_next_seq_num - The next sequence number to use in
6252 * FILS ERP messages
6253 */
6254 u16 fils_erp_next_seq_num;
Hai Shalom60840252021-02-19 19:02:11 -08006255
6256 /**
6257 * reason_code - Connection failure reason code from the driver
6258 */
6259 enum sta_connect_fail_reason_codes reason_code;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006260 } assoc_reject;
6261
6262 struct timeout_event {
6263 u8 addr[ETH_ALEN];
6264 } timeout_event;
6265
6266 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006267 * struct tx_status - Data for EVENT_TX_STATUS events
6268 */
6269 struct tx_status {
6270 u16 type;
6271 u16 stype;
6272 const u8 *dst;
6273 const u8 *data;
6274 size_t data_len;
6275 int ack;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006276 int link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006277 } tx_status;
6278
6279 /**
6280 * struct rx_from_unknown - Data for EVENT_RX_FROM_UNKNOWN events
6281 */
6282 struct rx_from_unknown {
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006283 const u8 *bssid;
6284 const u8 *addr;
6285 int wds;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006286 } rx_from_unknown;
6287
6288 /**
6289 * struct rx_mgmt - Data for EVENT_RX_MGMT events
6290 */
6291 struct rx_mgmt {
6292 const u8 *frame;
6293 size_t frame_len;
6294 u32 datarate;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006295
6296 /**
Dmitry Shmidt98660862014-03-11 17:26:21 -07006297 * drv_priv - Pointer to store driver private BSS information
6298 *
6299 * If not set to NULL, this is used for comparison with
6300 * hostapd_data->drv_priv to determine which BSS should process
6301 * the frame.
6302 */
6303 void *drv_priv;
6304
6305 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006306 * freq - Frequency (in MHz) on which the frame was received
6307 */
6308 int freq;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08006309
6310 /**
6311 * ssi_signal - Signal strength in dBm (or 0 if not available)
6312 */
6313 int ssi_signal;
Sunil Ravi036cec52023-03-29 11:35:17 -07006314
6315 /**
6316 * link_id - MLO link on which the frame was received or -1 for
6317 * non MLD.
6318 */
6319 int link_id;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08006320 } rx_mgmt;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006321
6322 /**
6323 * struct remain_on_channel - Data for EVENT_REMAIN_ON_CHANNEL events
6324 *
6325 * This is also used with EVENT_CANCEL_REMAIN_ON_CHANNEL events.
6326 */
6327 struct remain_on_channel {
6328 /**
6329 * freq - Channel frequency in MHz
6330 */
6331 unsigned int freq;
6332
6333 /**
6334 * duration - Duration to remain on the channel in milliseconds
6335 */
6336 unsigned int duration;
6337 } remain_on_channel;
6338
6339 /**
6340 * struct scan_info - Optional data for EVENT_SCAN_RESULTS events
6341 * @aborted: Whether the scan was aborted
6342 * @freqs: Scanned frequencies in MHz (%NULL = all channels scanned)
6343 * @num_freqs: Number of entries in freqs array
6344 * @ssids: Scanned SSIDs (%NULL or zero-length SSID indicates wildcard
6345 * SSID)
6346 * @num_ssids: Number of entries in ssids array
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08006347 * @external_scan: Whether the scan info is for an external scan
6348 * @nl_scan_event: 1 if the source of this scan event is a normal scan,
6349 * 0 if the source of the scan event is a vendor scan
Dmitry Shmidt29333592017-01-09 12:27:11 -08006350 * @scan_start_tsf: Time when the scan started in terms of TSF of the
6351 * BSS that the interface that requested the scan is connected to
6352 * (if available).
6353 * @scan_start_tsf_bssid: The BSSID according to which %scan_start_tsf
6354 * is set.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006355 */
6356 struct scan_info {
6357 int aborted;
6358 const int *freqs;
6359 size_t num_freqs;
6360 struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS];
6361 size_t num_ssids;
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08006362 int external_scan;
6363 int nl_scan_event;
Dmitry Shmidt29333592017-01-09 12:27:11 -08006364 u64 scan_start_tsf;
6365 u8 scan_start_tsf_bssid[ETH_ALEN];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006366 } scan_info;
6367
6368 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006369 * struct rx_probe_req - Data for EVENT_RX_PROBE_REQ events
6370 */
6371 struct rx_probe_req {
6372 /**
6373 * sa - Source address of the received Probe Request frame
6374 */
6375 const u8 *sa;
6376
6377 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006378 * da - Destination address of the received Probe Request frame
6379 * or %NULL if not available
6380 */
6381 const u8 *da;
6382
6383 /**
6384 * bssid - BSSID of the received Probe Request frame or %NULL
6385 * if not available
6386 */
6387 const u8 *bssid;
6388
6389 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006390 * ie - IEs from the Probe Request body
6391 */
6392 const u8 *ie;
6393
6394 /**
6395 * ie_len - Length of ie buffer in octets
6396 */
6397 size_t ie_len;
Dmitry Shmidt04949592012-07-19 12:16:46 -07006398
6399 /**
6400 * signal - signal strength in dBm (or 0 if not available)
6401 */
6402 int ssi_signal;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006403 } rx_probe_req;
6404
6405 /**
6406 * struct new_sta - Data for EVENT_NEW_STA events
6407 */
6408 struct new_sta {
6409 const u8 *addr;
6410 } new_sta;
6411
6412 /**
6413 * struct eapol_rx - Data for EVENT_EAPOL_RX events
6414 */
6415 struct eapol_rx {
6416 const u8 *src;
6417 const u8 *data;
6418 size_t data_len;
Sunil8cd6f4d2022-06-28 18:40:46 +00006419 enum frame_encryption encrypted;
Sunil Ravi036cec52023-03-29 11:35:17 -07006420 int link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006421 } eapol_rx;
6422
6423 /**
6424 * signal_change - Data for EVENT_SIGNAL_CHANGE events
6425 */
6426 struct wpa_signal_info signal_change;
6427
6428 /**
6429 * struct best_channel - Data for EVENT_BEST_CHANNEL events
6430 * @freq_24: Best 2.4 GHz band channel frequency in MHz
6431 * @freq_5: Best 5 GHz band channel frequency in MHz
6432 * @freq_overall: Best channel frequency in MHz
6433 *
6434 * 0 can be used to indicate no preference in either band.
6435 */
6436 struct best_channel {
6437 int freq_24;
6438 int freq_5;
6439 int freq_overall;
6440 } best_chan;
6441
6442 struct unprot_deauth {
6443 const u8 *sa;
6444 const u8 *da;
6445 u16 reason_code;
6446 } unprot_deauth;
6447
6448 struct unprot_disassoc {
6449 const u8 *sa;
6450 const u8 *da;
6451 u16 reason_code;
6452 } unprot_disassoc;
6453
6454 /**
6455 * struct low_ack - Data for EVENT_STATION_LOW_ACK events
6456 * @addr: station address
Paul Stewart092955c2017-02-06 09:13:09 -08006457 * @num_packets: Number of packets lost (consecutive packets not
6458 * acknowledged)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006459 */
6460 struct low_ack {
6461 u8 addr[ETH_ALEN];
Paul Stewart092955c2017-02-06 09:13:09 -08006462 u32 num_packets;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006463 } low_ack;
6464
6465 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006466 * struct ibss_peer_lost - Data for EVENT_IBSS_PEER_LOST
6467 */
6468 struct ibss_peer_lost {
6469 u8 peer[ETH_ALEN];
6470 } ibss_peer_lost;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006471
6472 /**
6473 * struct driver_gtk_rekey - Data for EVENT_DRIVER_GTK_REKEY
6474 */
6475 struct driver_gtk_rekey {
6476 const u8 *bssid;
6477 const u8 *replay_ctr;
6478 } driver_gtk_rekey;
6479
6480 /**
6481 * struct client_poll - Data for EVENT_DRIVER_CLIENT_POLL_OK events
6482 * @addr: station address
6483 */
6484 struct client_poll {
6485 u8 addr[ETH_ALEN];
6486 } client_poll;
6487
6488 /**
6489 * struct eapol_tx_status
6490 * @dst: Original destination
6491 * @data: Data starting with IEEE 802.1X header (!)
6492 * @data_len: Length of data
6493 * @ack: Indicates ack or lost frame
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006494 * @link_id: MLD link id used to transmit the frame or -1 for non MLO
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006495 *
6496 * This corresponds to hapd_send_eapol if the frame sent
6497 * there isn't just reported as EVENT_TX_STATUS.
6498 */
6499 struct eapol_tx_status {
6500 const u8 *dst;
6501 const u8 *data;
6502 int data_len;
6503 int ack;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006504 int link_id;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006505 } eapol_tx_status;
Dmitry Shmidt04949592012-07-19 12:16:46 -07006506
6507 /**
6508 * struct ch_switch
6509 * @freq: Frequency of new channel in MHz
6510 * @ht_enabled: Whether this is an HT channel
6511 * @ch_offset: Secondary channel offset
Dmitry Shmidt04f534e2013-12-09 15:50:16 -08006512 * @ch_width: Channel width
6513 * @cf1: Center frequency 1
6514 * @cf2: Center frequency 2
Sunil Ravi89eba102022-09-13 21:04:37 -07006515 * @link_id: Link ID of the MLO link
Sunil Ravi036cec52023-03-29 11:35:17 -07006516 * @punct_bitmap: Puncturing bitmap
Dmitry Shmidt04949592012-07-19 12:16:46 -07006517 */
6518 struct ch_switch {
6519 int freq;
6520 int ht_enabled;
6521 int ch_offset;
Dmitry Shmidt04f534e2013-12-09 15:50:16 -08006522 enum chan_width ch_width;
6523 int cf1;
6524 int cf2;
Sunil Ravi89eba102022-09-13 21:04:37 -07006525 int link_id;
Sunil Ravi036cec52023-03-29 11:35:17 -07006526 u16 punct_bitmap;
Dmitry Shmidt04949592012-07-19 12:16:46 -07006527 } ch_switch;
Dmitry Shmidtf8623282013-02-20 14:34:59 -08006528
6529 /**
6530 * struct connect_failed - Data for EVENT_CONNECT_FAILED_REASON
6531 * @addr: Remote client address
6532 * @code: Reason code for connection failure
6533 */
6534 struct connect_failed_reason {
6535 u8 addr[ETH_ALEN];
6536 enum {
6537 MAX_CLIENT_REACHED,
6538 BLOCKED_CLIENT
6539 } code;
6540 } connect_failed_reason;
Dmitry Shmidtea69e842013-05-13 14:52:28 -07006541
6542 /**
6543 * struct dfs_event - Data for radar detected events
6544 * @freq: Frequency of the channel in MHz
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006545 * @link_id: If >= 0, Link ID of the MLO link
Dmitry Shmidtea69e842013-05-13 14:52:28 -07006546 */
6547 struct dfs_event {
6548 int freq;
Dmitry Shmidt051af732013-10-22 13:52:46 -07006549 int ht_enabled;
6550 int chan_offset;
6551 enum chan_width chan_width;
6552 int cf1;
6553 int cf2;
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006554 int link_id;
Dmitry Shmidtea69e842013-05-13 14:52:28 -07006555 } dfs_event;
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07006556
6557 /**
6558 * survey_results - Survey result data for EVENT_SURVEY
6559 * @freq_filter: Requested frequency survey filter, 0 if request
6560 * was for all survey data
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006561 * @survey_list: Linked list of survey data (struct freq_survey)
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07006562 */
6563 struct survey_results {
6564 unsigned int freq_filter;
6565 struct dl_list survey_list; /* struct freq_survey */
6566 } survey_results;
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08006567
6568 /**
6569 * channel_list_changed - Data for EVENT_CHANNEL_LIST_CHANGED
6570 * @initiator: Initiator of the regulatory change
Dmitry Shmidt7dba0e52014-04-14 10:49:15 -07006571 * @type: Regulatory change type
6572 * @alpha2: Country code (or "" if not available)
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006573 * @beacon_hint_before: Data for frequency attributes before beacon hint
6574 * event if initiator == REGDOM_BEACON_HINT
6575 * @beacon_hint_after: Data for frequency attributes after beacon hint
6576 * event if initiator == REGDOM_BEACON_HINT
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08006577 */
6578 struct channel_list_changed {
6579 enum reg_change_initiator initiator;
Dmitry Shmidt7dba0e52014-04-14 10:49:15 -07006580 enum reg_type type;
6581 char alpha2[3];
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006582 struct frequency_attrs {
6583 unsigned int freq;
6584 unsigned int max_tx_power;
6585 bool disabled;
6586 bool no_ir;
6587 bool radar;
6588 } beacon_hint_before, beacon_hint_after;
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08006589 } channel_list_changed;
Dmitry Shmidtcf32e602014-01-28 10:57:39 -08006590
6591 /**
6592 * freq_range - List of frequency ranges
6593 *
6594 * This is used as the data with EVENT_AVOID_FREQUENCIES.
6595 */
6596 struct wpa_freq_range_list freq_range;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006597
6598 /**
6599 * struct mesh_peer
6600 *
6601 * @peer: Peer address
6602 * @ies: Beacon IEs
6603 * @ie_len: Length of @ies
6604 *
6605 * Notification of new candidate mesh peer.
6606 */
6607 struct mesh_peer {
6608 const u8 *peer;
6609 const u8 *ies;
6610 size_t ie_len;
6611 } mesh_peer;
6612
6613 /**
6614 * struct acs_selected_channels - Data for EVENT_ACS_CHANNEL_SELECTED
Ahmed ElArabawy0ff61c52019-12-26 12:38:39 -08006615 * @pri_freq: Selected primary frequency
6616 * @sec_freq: Selected secondary frequency
Hai Shalomfdcde762020-04-02 11:19:20 -07006617 * @edmg_channel: Selected EDMG channel
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006618 * @vht_seg0_center_ch: VHT mode Segment0 center channel
Hai Shalomfdcde762020-04-02 11:19:20 -07006619 * The value is the index of the channel center frequency for
6620 * 20 MHz, 40 MHz, and 80 MHz channels. The value is the center
6621 * frequency index of the primary 80 MHz segment for 160 MHz and
6622 * 80+80 MHz channels.
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006623 * @vht_seg1_center_ch: VHT mode Segment1 center channel
Hai Shalomfdcde762020-04-02 11:19:20 -07006624 * The value is zero for 20 MHz, 40 MHz, and 80 MHz channels. The
6625 * value is the index of the channel center frequency for 160 MHz
6626 * channels and the center frequency index of the secondary 80 MHz
6627 * segment for 80+80 MHz channels.
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006628 * @ch_width: Selected Channel width by driver. Driver may choose to
6629 * change hostapd configured ACS channel width due driver internal
6630 * channel restrictions.
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006631 * @hw_mode: Selected band (used with hw_mode=any)
6632 * @puncture_bitmap: Indicate the puncturing channels
6633 * @link_id: Indicate the link id if operating as AP MLD; -1 otherwise
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006634 */
6635 struct acs_selected_channels {
Ahmed ElArabawy0ff61c52019-12-26 12:38:39 -08006636 unsigned int pri_freq;
6637 unsigned int sec_freq;
Hai Shalomfdcde762020-04-02 11:19:20 -07006638 u8 edmg_channel;
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006639 u8 vht_seg0_center_ch;
6640 u8 vht_seg1_center_ch;
6641 u16 ch_width;
Dmitry Shmidtb1e52102015-05-29 12:36:29 -07006642 enum hostapd_hw_mode hw_mode;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006643 u16 puncture_bitmap;
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006644 int link_id;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006645 } acs_selected_channels;
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07006646
6647 /**
6648 * struct p2p_lo_stop - Reason code for P2P Listen offload stop event
6649 * @reason_code: Reason for stopping offload
6650 * P2P_LO_STOPPED_REASON_COMPLETE: Listen offload finished as
6651 * scheduled.
6652 * P2P_LO_STOPPED_REASON_RECV_STOP_CMD: Host requested offload to
6653 * be stopped.
6654 * P2P_LO_STOPPED_REASON_INVALID_PARAM: Invalid listen offload
6655 * parameters.
6656 * P2P_LO_STOPPED_REASON_NOT_SUPPORTED: Listen offload not
6657 * supported by device.
6658 */
6659 struct p2p_lo_stop {
6660 enum {
6661 P2P_LO_STOPPED_REASON_COMPLETE = 0,
6662 P2P_LO_STOPPED_REASON_RECV_STOP_CMD,
6663 P2P_LO_STOPPED_REASON_INVALID_PARAM,
6664 P2P_LO_STOPPED_REASON_NOT_SUPPORTED,
6665 } reason_code;
6666 } p2p_lo_stop;
Roshan Pius3a1667e2018-07-03 15:17:14 -07006667
6668 /* For EVENT_EXTERNAL_AUTH */
6669 struct external_auth external_auth;
6670
6671 /**
6672 * struct sta_opmode - Station's operation mode change event
6673 * @addr: The station MAC address
6674 * @smps_mode: SMPS mode of the station
6675 * @chan_width: Channel width of the station
6676 * @rx_nss: RX_NSS of the station
6677 *
6678 * This is used as data with EVENT_STATION_OPMODE_CHANGED.
6679 */
6680 struct sta_opmode {
6681 const u8 *addr;
6682 enum smps_mode smps_mode;
6683 enum chan_width chan_width;
6684 u8 rx_nss;
6685 } sta_opmode;
6686
6687 /**
6688 * struct wds_sta_interface - Data for EVENT_WDS_STA_INTERFACE_STATUS.
6689 */
6690 struct wds_sta_interface {
6691 const u8 *sta_addr;
6692 const char *ifname;
6693 enum {
6694 INTERFACE_ADDED,
6695 INTERFACE_REMOVED
6696 } istatus;
6697 } wds_sta_interface;
Hai Shalom81f62d82019-07-22 12:10:00 -07006698
6699 /**
6700 * struct update_dh - Data for EVENT_UPDATE_DH
6701 */
6702 struct update_dh {
6703 const u8 *peer;
6704 const u8 *ie;
6705 size_t ie_len;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006706 int assoc_link_id;
6707 const u8 *link_addr;
Hai Shalom81f62d82019-07-22 12:10:00 -07006708 } update_dh;
Hai Shalomfdcde762020-04-02 11:19:20 -07006709
6710 /**
6711 * struct unprot_beacon - Data for EVENT_UNPROT_BEACON
6712 */
6713 struct unprot_beacon {
6714 const u8 *sa;
6715 } unprot_beacon;
Sunil Ravia04bd252022-05-02 22:54:18 -07006716
6717 /**
6718 * struct bss_color_collision - Data for EVENT_BSS_COLOR_COLLISION
6719 */
6720 struct bss_color_collision {
6721 u64 bitmap;
6722 } bss_color_collision;
Sunil Ravi89eba102022-09-13 21:04:37 -07006723
6724 /**
6725 * struct pasn_auth - Data for EVENT_PASN_AUTH
6726 */
6727 struct pasn_auth pasn_auth;
6728
Sunil Ravi77d572f2023-01-17 23:58:31 +00006729 /**
6730 * struct port_authorized - Data for EVENT_PORT_AUTHORIZED
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006731 * @td_bitmap: For STA mode, transition disable bitmap, if received in
6732 * EAPOL-Key msg 3/4
6733 * @td_bitmap_len: For STA mode, length of td_bitmap
6734 * @sta_addr: For AP mode, the MAC address of the associated STA
6735 *
6736 * This event is used to indicate that the port is authorized and
6737 * open for normal data in STA and AP modes when 4-way handshake is
6738 * offloaded to the driver.
Sunil Ravi77d572f2023-01-17 23:58:31 +00006739 */
6740 struct port_authorized {
6741 const u8 *td_bitmap;
6742 size_t td_bitmap_len;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006743 const u8 *sta_addr;
Sunil Ravi77d572f2023-01-17 23:58:31 +00006744 } port_authorized;
Sunil Ravi640215c2023-06-28 23:08:09 +00006745
6746 /**
6747 * struct tid_link_map_info - Data for EVENT_TID_LINK_MAP
6748 */
6749 struct tid_link_map_info {
6750 bool default_map;
6751 u8 valid_links;
6752 struct t2lm_mapping t2lmap[MAX_NUM_MLD_LINKS];
6753 } t2l_map_info;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006754};
6755
6756/**
6757 * wpa_supplicant_event - Report a driver event for wpa_supplicant
6758 * @ctx: Context pointer (wpa_s); this is the ctx variable registered
6759 * with struct wpa_driver_ops::init()
6760 * @event: event type (defined above)
6761 * @data: possible extra data for the event
6762 *
6763 * Driver wrapper code should call this function whenever an event is received
6764 * from the driver.
6765 */
6766void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
6767 union wpa_event_data *data);
6768
Dmitry Shmidte4663042016-04-04 10:07:49 -07006769/**
6770 * wpa_supplicant_event_global - Report a driver event for wpa_supplicant
6771 * @ctx: Context pointer (wpa_s); this is the ctx variable registered
6772 * with struct wpa_driver_ops::init()
6773 * @event: event type (defined above)
6774 * @data: possible extra data for the event
6775 *
6776 * Same as wpa_supplicant_event(), but we search for the interface in
6777 * wpa_global.
6778 */
6779void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
6780 union wpa_event_data *data);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006781
6782/*
6783 * The following inline functions are provided for convenience to simplify
6784 * event indication for some of the common events.
6785 */
6786
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006787static inline void drv_event_assoc(void *ctx, const u8 *addr, const u8 *req_ies,
6788 size_t req_ielen, const u8 *resp_ies,
6789 size_t resp_ielen, const u8 *link_addr,
6790 int assoc_link_id, int reassoc)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006791{
6792 union wpa_event_data event;
6793 os_memset(&event, 0, sizeof(event));
6794 event.assoc_info.reassoc = reassoc;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006795 event.assoc_info.req_ies = req_ies;
6796 event.assoc_info.req_ies_len = req_ielen;
6797 event.assoc_info.resp_ies = resp_ies;
6798 event.assoc_info.resp_ies_len = resp_ielen;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006799 event.assoc_info.addr = addr;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006800 event.assoc_info.link_addr = link_addr;
6801 event.assoc_info.assoc_link_id = assoc_link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006802 wpa_supplicant_event(ctx, EVENT_ASSOC, &event);
6803}
6804
6805static inline void drv_event_disassoc(void *ctx, const u8 *addr)
6806{
6807 union wpa_event_data event;
6808 os_memset(&event, 0, sizeof(event));
6809 event.disassoc_info.addr = addr;
6810 wpa_supplicant_event(ctx, EVENT_DISASSOC, &event);
6811}
6812
6813static inline void drv_event_eapol_rx(void *ctx, const u8 *src, const u8 *data,
6814 size_t data_len)
6815{
6816 union wpa_event_data event;
6817 os_memset(&event, 0, sizeof(event));
6818 event.eapol_rx.src = src;
6819 event.eapol_rx.data = data;
6820 event.eapol_rx.data_len = data_len;
Sunil8cd6f4d2022-06-28 18:40:46 +00006821 event.eapol_rx.encrypted = FRAME_ENCRYPTION_UNKNOWN;
Sunil Ravi036cec52023-03-29 11:35:17 -07006822 event.eapol_rx.link_id = -1;
Sunil8cd6f4d2022-06-28 18:40:46 +00006823 wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event);
6824}
6825
6826static inline void drv_event_eapol_rx2(void *ctx, const u8 *src, const u8 *data,
Sunil Ravi036cec52023-03-29 11:35:17 -07006827 size_t data_len,
6828 enum frame_encryption encrypted,
6829 int link_id)
Sunil8cd6f4d2022-06-28 18:40:46 +00006830{
6831 union wpa_event_data event;
6832 os_memset(&event, 0, sizeof(event));
6833 event.eapol_rx.src = src;
6834 event.eapol_rx.data = data;
6835 event.eapol_rx.data_len = data_len;
6836 event.eapol_rx.encrypted = encrypted;
Sunil Ravi036cec52023-03-29 11:35:17 -07006837 event.eapol_rx.link_id = link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006838 wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event);
6839}
6840
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006841/* driver_common.c */
6842void wpa_scan_results_free(struct wpa_scan_results *res);
6843
6844/* Convert wpa_event_type to a string for logging */
6845const char * event_to_string(enum wpa_event_type event);
6846
Dmitry Shmidt661b4f72014-09-29 14:58:27 -07006847/* Convert chan_width to a string for logging and control interfaces */
6848const char * channel_width_to_string(enum chan_width width);
6849
Hai Shalom74f70d42019-02-11 14:42:39 -08006850int channel_width_to_int(enum chan_width width);
6851
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006852int ht_supported(const struct hostapd_hw_modes *mode);
6853int vht_supported(const struct hostapd_hw_modes *mode);
Sunil Ravi77d572f2023-01-17 23:58:31 +00006854bool he_supported(const struct hostapd_hw_modes *hw_mode,
6855 enum ieee80211_op_mode op_mode);
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006856
6857struct wowlan_triggers *
6858wpa_get_wowlan_triggers(const char *wowlan_triggers,
6859 const struct wpa_driver_capa *capa);
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07006860/* Convert driver flag to string */
6861const char * driver_flag_to_string(u64 flag);
Hai Shalomb755a2a2020-04-23 21:49:02 -07006862const char * driver_flag2_to_string(u64 flag2);
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006863
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08006864/* NULL terminated array of linked in driver wrappers */
Dmitry Shmidt1d755d02015-04-28 10:34:29 -07006865extern const struct wpa_driver_ops *const wpa_drivers[];
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08006866
Dmitry Shmidt4ae50e62016-06-27 13:48:39 -07006867
6868/* Available drivers */
6869
6870#ifdef CONFIG_DRIVER_WEXT
6871extern const struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */
6872#endif /* CONFIG_DRIVER_WEXT */
6873#ifdef CONFIG_DRIVER_NL80211
6874/* driver_nl80211.c */
6875extern const struct wpa_driver_ops wpa_driver_nl80211_ops;
6876#endif /* CONFIG_DRIVER_NL80211 */
6877#ifdef CONFIG_DRIVER_HOSTAP
6878extern const struct wpa_driver_ops wpa_driver_hostap_ops; /* driver_hostap.c */
6879#endif /* CONFIG_DRIVER_HOSTAP */
6880#ifdef CONFIG_DRIVER_BSD
6881extern const struct wpa_driver_ops wpa_driver_bsd_ops; /* driver_bsd.c */
6882#endif /* CONFIG_DRIVER_BSD */
6883#ifdef CONFIG_DRIVER_OPENBSD
6884/* driver_openbsd.c */
6885extern const struct wpa_driver_ops wpa_driver_openbsd_ops;
6886#endif /* CONFIG_DRIVER_OPENBSD */
6887#ifdef CONFIG_DRIVER_NDIS
6888extern struct wpa_driver_ops wpa_driver_ndis_ops; /* driver_ndis.c */
6889#endif /* CONFIG_DRIVER_NDIS */
6890#ifdef CONFIG_DRIVER_WIRED
6891extern const struct wpa_driver_ops wpa_driver_wired_ops; /* driver_wired.c */
6892#endif /* CONFIG_DRIVER_WIRED */
6893#ifdef CONFIG_DRIVER_MACSEC_QCA
6894/* driver_macsec_qca.c */
6895extern const struct wpa_driver_ops wpa_driver_macsec_qca_ops;
6896#endif /* CONFIG_DRIVER_MACSEC_QCA */
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08006897#ifdef CONFIG_DRIVER_MACSEC_LINUX
6898/* driver_macsec_linux.c */
6899extern const struct wpa_driver_ops wpa_driver_macsec_linux_ops;
6900#endif /* CONFIG_DRIVER_MACSEC_LINUX */
Dmitry Shmidt4ae50e62016-06-27 13:48:39 -07006901#ifdef CONFIG_DRIVER_ROBOSWITCH
6902/* driver_roboswitch.c */
6903extern const struct wpa_driver_ops wpa_driver_roboswitch_ops;
6904#endif /* CONFIG_DRIVER_ROBOSWITCH */
6905#ifdef CONFIG_DRIVER_ATHEROS
6906/* driver_atheros.c */
6907extern const struct wpa_driver_ops wpa_driver_atheros_ops;
6908#endif /* CONFIG_DRIVER_ATHEROS */
6909#ifdef CONFIG_DRIVER_NONE
6910extern const struct wpa_driver_ops wpa_driver_none_ops; /* driver_none.c */
6911#endif /* CONFIG_DRIVER_NONE */
6912
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006913#endif /* DRIVER_H */