blob: 8be40123bda0e4519ab042f15b1730204d3cb9ee [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
Sunil Ravi99c035e2024-07-12 01:42:03 +000046#define HOSTAPD_CHAN_EHT_320MHZ_SUBCHANNEL 0x00002000
Dmitry Shmidt68d0e3e2013-10-28 17:59:21 -070047
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -080048#define HOSTAPD_CHAN_INDOOR_ONLY 0x00010000
49#define HOSTAPD_CHAN_GO_CONCURRENT 0x00020000
50
Hai Shalom74f70d42019-02-11 14:42:39 -080051/* Allowed bandwidth mask */
52enum hostapd_chan_width_attr {
53 HOSTAPD_CHAN_WIDTH_10 = BIT(0),
54 HOSTAPD_CHAN_WIDTH_20 = BIT(1),
55 HOSTAPD_CHAN_WIDTH_40P = BIT(2),
56 HOSTAPD_CHAN_WIDTH_40M = BIT(3),
57 HOSTAPD_CHAN_WIDTH_80 = BIT(4),
58 HOSTAPD_CHAN_WIDTH_160 = BIT(5),
Sunil8cd6f4d2022-06-28 18:40:46 +000059 HOSTAPD_CHAN_WIDTH_320 = BIT(6),
Hai Shalom74f70d42019-02-11 14:42:39 -080060};
61
Dmitry Shmidt849734c2016-05-27 09:59:01 -070062/* Filter gratuitous ARP */
63#define WPA_DATA_FRAME_FILTER_FLAG_ARP BIT(0)
64/* Filter unsolicited Neighbor Advertisement */
65#define WPA_DATA_FRAME_FILTER_FLAG_NA BIT(1)
66/* Filter unicast IP packets encrypted using the GTK */
67#define WPA_DATA_FRAME_FILTER_FLAG_GTK BIT(2)
68
Dmitry Shmidtd2986c22017-10-23 14:22:09 -070069#define HOSTAPD_DFS_REGION_FCC 1
70#define HOSTAPD_DFS_REGION_ETSI 2
71#define HOSTAPD_DFS_REGION_JP 3
72
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -080073/**
74 * enum reg_change_initiator - Regulatory change initiator
75 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -080076enum reg_change_initiator {
77 REGDOM_SET_BY_CORE,
78 REGDOM_SET_BY_USER,
79 REGDOM_SET_BY_DRIVER,
80 REGDOM_SET_BY_COUNTRY_IE,
Dmitry Shmidt97672262014-02-03 13:02:54 -080081 REGDOM_BEACON_HINT,
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -080082};
83
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -080084/**
85 * enum reg_type - Regulatory change types
86 */
Dmitry Shmidt7dba0e52014-04-14 10:49:15 -070087enum reg_type {
88 REGDOM_TYPE_UNKNOWN,
89 REGDOM_TYPE_COUNTRY,
90 REGDOM_TYPE_WORLD,
91 REGDOM_TYPE_CUSTOM_WORLD,
92 REGDOM_TYPE_INTERSECTION,
93};
94
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070095/**
Hai Shalom81f62d82019-07-22 12:10:00 -070096 * struct hostapd_wmm_rule - WMM regulatory rule
97 * @min_cwmin: Lower bound of CW_min value
98 * @min_cwmax: Lower bound of CW_max value
99 * @min_aifs: Lower bound of AIFS value
100 * @max_txop: Upper bound of TXOP, value in units of 32 usec
101 */
102struct hostapd_wmm_rule {
103 int min_cwmin;
104 int min_cwmax;
105 int min_aifs;
106 int max_txop;
107};
108
109/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700110 * struct hostapd_channel_data - Channel information
111 */
112struct hostapd_channel_data {
113 /**
114 * chan - Channel number (IEEE 802.11)
115 */
116 short chan;
117
118 /**
119 * freq - Frequency in MHz
120 */
Dmitry Shmidtd5e49232012-12-03 15:08:10 -0800121 int freq;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700122
123 /**
124 * flag - Channel flags (HOSTAPD_CHAN_*)
125 */
126 int flag;
127
128 /**
Hai Shalom74f70d42019-02-11 14:42:39 -0800129 * allowed_bw - Allowed channel width bitmask
130 *
131 * See enum hostapd_chan_width_attr.
132 */
133 u32 allowed_bw;
134
135 /**
Dmitry Shmidt68d0e3e2013-10-28 17:59:21 -0700136 * max_tx_power - Regulatory transmit power limit in dBm
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700137 */
138 u8 max_tx_power;
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -0700139
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800140 /**
141 * survey_list - Linked list of surveys (struct freq_survey)
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -0700142 */
143 struct dl_list survey_list;
144
145 /**
146 * min_nf - Minimum observed noise floor, in dBm, based on all
147 * surveyed channel data
148 */
149 s8 min_nf;
Dmitry Shmidt391c59f2013-09-03 12:16:28 -0700150
151#ifdef CONFIG_ACS
152 /**
153 * interference_factor - Computed interference factor on this
154 * channel (used internally in src/ap/acs.c; driver wrappers do not
155 * need to set this)
156 */
157 long double interference_factor;
158#endif /* CONFIG_ACS */
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -0700159
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800160 /**
161 * dfs_cac_ms - DFS CAC time in milliseconds
162 */
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -0700163 unsigned int dfs_cac_ms;
Hai Shalom81f62d82019-07-22 12:10:00 -0700164
165 /**
166 * wmm_rules_valid - Indicates wmm_rules state
167 */
168 int wmm_rules_valid;
169
170 /**
171 * wmm_rules - WMM regulatory rules
172 */
173 struct hostapd_wmm_rule wmm_rules[WMM_AC_NUM];
Sunil Ravi036cec52023-03-29 11:35:17 -0700174
175 /**
176 * punct_bitmap - RU puncturing bitmap
177 */
178 u16 punct_bitmap;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700179};
180
Hai Shalomfdcde762020-04-02 11:19:20 -0700181#define HE_MAC_CAPAB_0 0
Hai Shalom81f62d82019-07-22 12:10:00 -0700182#define HE_MAX_MAC_CAPAB_SIZE 6
183#define HE_MAX_PHY_CAPAB_SIZE 11
184#define HE_MAX_MCS_CAPAB_SIZE 12
185#define HE_MAX_PPET_CAPAB_SIZE 25
Dmitry Shmidtebd93af2017-02-21 13:40:44 -0800186
187/**
188 * struct he_capabilities - IEEE 802.11ax HE capabilities
189 */
190struct he_capabilities {
191 u8 he_supported;
Hai Shalom81f62d82019-07-22 12:10:00 -0700192 u8 phy_cap[HE_MAX_PHY_CAPAB_SIZE];
193 u8 mac_cap[HE_MAX_MAC_CAPAB_SIZE];
194 u8 mcs[HE_MAX_MCS_CAPAB_SIZE];
195 u8 ppet[HE_MAX_PPET_CAPAB_SIZE];
Hai Shalom899fcc72020-10-19 14:38:18 -0700196 u16 he_6ghz_capa;
Dmitry Shmidtebd93af2017-02-21 13:40:44 -0800197};
198
Sunil Ravia04bd252022-05-02 22:54:18 -0700199/* struct eht_capabilities - IEEE 802.11be EHT capabilities */
200struct eht_capabilities {
201 bool eht_supported;
202 u16 mac_cap;
203 u8 phy_cap[EHT_PHY_CAPAB_LEN];
204 u8 mcs[EHT_MCS_NSS_CAPAB_LEN];
205 u8 ppet[EHT_PPE_THRESH_CAPAB_LEN];
206};
207
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800208#define HOSTAPD_MODE_FLAG_HT_INFO_KNOWN BIT(0)
Dmitry Shmidtc2ebb4b2013-07-24 12:57:51 -0700209#define HOSTAPD_MODE_FLAG_VHT_INFO_KNOWN BIT(1)
Sunil Ravi77d572f2023-01-17 23:58:31 +0000210#define HOSTAPD_MODE_FLAG_HE_INFO_KNOWN BIT(2)
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800211
Hai Shalom81f62d82019-07-22 12:10:00 -0700212
213enum ieee80211_op_mode {
214 IEEE80211_MODE_INFRA = 0,
215 IEEE80211_MODE_IBSS = 1,
216 IEEE80211_MODE_AP = 2,
217 IEEE80211_MODE_MESH = 5,
218
219 /* only add new entries before IEEE80211_MODE_NUM */
220 IEEE80211_MODE_NUM
221};
222
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700223/**
Hai Shalomc3565922019-10-28 11:58:20 -0700224 * struct ieee80211_edmg_config - EDMG configuration
225 *
226 * This structure describes most essential parameters needed
227 * for IEEE 802.11ay EDMG configuration
228 *
229 * @channels: Bitmap that indicates the 2.16 GHz channel(s)
230 * that are allowed to be used for transmissions.
231 * Bit 0 indicates channel 1, bit 1 indicates channel 2, etc.
232 * Set to 0 to indicate EDMG not supported.
233 * @bw_config: Channel BW Configuration subfield encodes
234 * the allowed channel bandwidth configurations
235 */
236struct ieee80211_edmg_config {
237 u8 channels;
238 enum edmg_bw_config bw_config;
239};
240
241/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700242 * struct hostapd_hw_modes - Supported hardware mode information
243 */
244struct hostapd_hw_modes {
245 /**
246 * mode - Hardware mode
247 */
248 enum hostapd_hw_mode mode;
249
250 /**
Sunil Ravi99c035e2024-07-12 01:42:03 +0000251 * is_6ghz - Whether the mode information is for the 6 GHz band
252 */
253 bool is_6ghz;
254
255 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700256 * num_channels - Number of entries in the channels array
257 */
258 int num_channels;
259
260 /**
261 * channels - Array of supported channels
262 */
263 struct hostapd_channel_data *channels;
264
265 /**
266 * num_rates - Number of entries in the rates array
267 */
268 int num_rates;
269
270 /**
271 * rates - Array of supported rates in 100 kbps units
272 */
273 int *rates;
274
275 /**
276 * ht_capab - HT (IEEE 802.11n) capabilities
277 */
278 u16 ht_capab;
279
280 /**
281 * mcs_set - MCS (IEEE 802.11n) rate parameters
282 */
283 u8 mcs_set[16];
284
285 /**
286 * a_mpdu_params - A-MPDU (IEEE 802.11n) parameters
287 */
288 u8 a_mpdu_params;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800289
Dmitry Shmidt04949592012-07-19 12:16:46 -0700290 /**
291 * vht_capab - VHT (IEEE 802.11ac) capabilities
292 */
293 u32 vht_capab;
294
295 /**
296 * vht_mcs_set - VHT MCS (IEEE 802.11ac) rate parameters
297 */
298 u8 vht_mcs_set[8];
299
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800300 unsigned int flags; /* HOSTAPD_MODE_FLAG_* */
Dmitry Shmidtebd93af2017-02-21 13:40:44 -0800301
302 /**
303 * he_capab - HE (IEEE 802.11ax) capabilities
304 */
Hai Shalom81f62d82019-07-22 12:10:00 -0700305 struct he_capabilities he_capab[IEEE80211_MODE_NUM];
Hai Shalomc3565922019-10-28 11:58:20 -0700306
307 /**
308 * This structure describes the most essential parameters needed
309 * for IEEE 802.11ay EDMG configuration.
310 */
311 struct ieee80211_edmg_config edmg;
Sunil Ravia04bd252022-05-02 22:54:18 -0700312
313 /**
314 * eht_capab - EHT (IEEE 802.11be) capabilities
315 */
316 struct eht_capabilities eht_capab[IEEE80211_MODE_NUM];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700317};
318
319
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700320#define IEEE80211_CAP_ESS 0x0001
321#define IEEE80211_CAP_IBSS 0x0002
322#define IEEE80211_CAP_PRIVACY 0x0010
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800323#define IEEE80211_CAP_RRM 0x1000
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700324
Dmitry Shmidtf8623282013-02-20 14:34:59 -0800325/* DMG (60 GHz) IEEE 802.11ad */
326/* type - bits 0..1 */
327#define IEEE80211_CAP_DMG_MASK 0x0003
328#define IEEE80211_CAP_DMG_IBSS 0x0001 /* Tx by: STA */
329#define IEEE80211_CAP_DMG_PBSS 0x0002 /* Tx by: PCP */
330#define IEEE80211_CAP_DMG_AP 0x0003 /* Tx by: AP */
331
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700332#define WPA_SCAN_QUAL_INVALID BIT(0)
333#define WPA_SCAN_NOISE_INVALID BIT(1)
334#define WPA_SCAN_LEVEL_INVALID BIT(2)
335#define WPA_SCAN_LEVEL_DBM BIT(3)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700336#define WPA_SCAN_ASSOCIATED BIT(5)
337
338/**
339 * struct wpa_scan_res - Scan result for an BSS/IBSS
340 * @flags: information flags about the BSS/IBSS (WPA_SCAN_*)
341 * @bssid: BSSID
342 * @freq: frequency of the channel in MHz (e.g., 2412 = channel 1)
Sunil Ravi2a14cf12023-11-21 00:54:38 +0000343 * @max_cw: the max channel width of the connection (calculated during scan
344 * result processing)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700345 * @beacon_int: beacon interval in TUs (host byte order)
346 * @caps: capability information field in host byte order
347 * @qual: signal quality
348 * @noise: noise level
349 * @level: signal level
350 * @tsf: Timestamp
351 * @age: Age of the information in milliseconds (i.e., how many milliseconds
352 * ago the last Beacon or Probe Response frame was received)
Dmitry Shmidt7f656022015-02-25 14:36:37 -0800353 * @est_throughput: Estimated throughput in kbps (this is calculated during
354 * scan result processing if left zero by the driver wrapper)
355 * @snr: Signal-to-noise ratio in dB (calculated during scan result processing)
Dmitry Shmidt29333592017-01-09 12:27:11 -0800356 * @parent_tsf: Time when the Beacon/Probe Response frame was received in terms
357 * of TSF of the BSS specified by %tsf_bssid.
358 * @tsf_bssid: The BSS that %parent_tsf TSF time refers to.
Sunil Ravia04bd252022-05-02 22:54:18 -0700359 * @beacon_newer: Whether the Beacon frame data is known to be newer
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700360 * @ie_len: length of the following IE field in octets
361 * @beacon_ie_len: length of the following Beacon IE field in octets
362 *
363 * This structure is used as a generic format for scan results from the
364 * driver. Each driver interface implementation is responsible for converting
365 * the driver or OS specific scan results into this format.
366 *
367 * If the driver does not support reporting all IEs, the IE data structure is
368 * constructed of the IEs that are available. This field will also need to
369 * include SSID in IE format. All drivers are encouraged to be extended to
370 * report all IEs to make it easier to support future additions.
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800371 *
372 * This structure data is followed by ie_len octets of IEs from Probe Response
373 * frame (or if the driver does not indicate source of IEs, these may also be
374 * from Beacon frame). After the first set of IEs, another set of IEs may follow
375 * (with beacon_ie_len octets of data) if the driver provides both IE sets.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700376 */
377struct wpa_scan_res {
378 unsigned int flags;
379 u8 bssid[ETH_ALEN];
380 int freq;
Sunil Ravi2a14cf12023-11-21 00:54:38 +0000381 enum chan_width max_cw;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700382 u16 beacon_int;
383 u16 caps;
384 int qual;
385 int noise;
386 int level;
387 u64 tsf;
388 unsigned int age;
Dmitry Shmidt7f656022015-02-25 14:36:37 -0800389 unsigned int est_throughput;
390 int snr;
Dmitry Shmidt29333592017-01-09 12:27:11 -0800391 u64 parent_tsf;
392 u8 tsf_bssid[ETH_ALEN];
Sunil Ravia04bd252022-05-02 22:54:18 -0700393 bool beacon_newer;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700394 size_t ie_len;
395 size_t beacon_ie_len;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800396 /* Followed by ie_len + beacon_ie_len octets of IE data */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700397};
398
399/**
400 * struct wpa_scan_results - Scan results
401 * @res: Array of pointers to allocated variable length scan result entries
402 * @num: Number of entries in the scan result array
Dmitry Shmidtf8623282013-02-20 14:34:59 -0800403 * @fetch_time: Time when the results were fetched from the driver
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700404 */
405struct wpa_scan_results {
406 struct wpa_scan_res **res;
407 size_t num;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -0800408 struct os_reltime fetch_time;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700409};
410
411/**
412 * struct wpa_interface_info - Network interface information
413 * @next: Pointer to the next interface or NULL if this is the last one
414 * @ifname: Interface name that can be used with init() or init2()
415 * @desc: Human readable adapter description (e.g., vendor/model) or NULL if
416 * not available
417 * @drv_name: struct wpa_driver_ops::name (note: unlike other strings, this one
418 * is not an allocated copy, i.e., get_interfaces() caller will not free
419 * this)
420 */
421struct wpa_interface_info {
422 struct wpa_interface_info *next;
423 char *ifname;
424 char *desc;
425 const char *drv_name;
426};
427
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800428#define WPAS_MAX_SCAN_SSIDS 16
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700429
430/**
Dmitry Shmidtb97e4282016-02-08 10:16:07 -0800431 * struct wpa_driver_scan_ssid - SSIDs to scan for
432 * @ssid - specific SSID to scan for (ProbeReq)
433 * %NULL or zero-length SSID is used to indicate active scan
434 * with wildcard SSID.
435 * @ssid_len - Length of the SSID in octets
436 */
437struct wpa_driver_scan_ssid {
438 const u8 *ssid;
439 size_t ssid_len;
440};
441
Sunil Ravi640215c2023-06-28 23:08:09 +0000442struct t2lm_mapping {
443 /**
444 * downlink - Bitmap of TIDs mapped with a link in downlink direction
445 */
446 u8 downlink;
447
448 /**
449 * uplink - Bitmap of TIDs mapped with a link in uplink direction
450 */
451 u8 uplink;
452};
453
Dmitry Shmidtb97e4282016-02-08 10:16:07 -0800454/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700455 * struct wpa_driver_scan_params - Scan parameters
456 * Data for struct wpa_driver_ops::scan2().
457 */
458struct wpa_driver_scan_params {
459 /**
460 * ssids - SSIDs to scan for
461 */
Dmitry Shmidtb97e4282016-02-08 10:16:07 -0800462 struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700463
464 /**
465 * num_ssids - Number of entries in ssids array
466 * Zero indicates a request for a passive scan.
467 */
468 size_t num_ssids;
469
470 /**
471 * extra_ies - Extra IE(s) to add into Probe Request or %NULL
472 */
473 const u8 *extra_ies;
474
475 /**
476 * extra_ies_len - Length of extra_ies in octets
477 */
478 size_t extra_ies_len;
479
480 /**
481 * freqs - Array of frequencies to scan or %NULL for all frequencies
482 *
483 * The frequency is set in MHz. The array is zero-terminated.
484 */
485 int *freqs;
486
487 /**
488 * filter_ssids - Filter for reporting SSIDs
489 *
490 * This optional parameter can be used to request the driver wrapper to
491 * filter scan results to include only the specified SSIDs. %NULL
492 * indicates that no filtering is to be done. This can be used to
493 * reduce memory needs for scan results in environments that have large
494 * number of APs with different SSIDs.
495 *
496 * The driver wrapper is allowed to take this allocated buffer into its
497 * own use by setting the pointer to %NULL. In that case, the driver
498 * wrapper is responsible for freeing the buffer with os_free() once it
499 * is not needed anymore.
500 */
501 struct wpa_driver_scan_filter {
Dmitry Shmidt9d9e6022015-04-23 10:34:55 -0700502 u8 ssid[SSID_MAX_LEN];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700503 size_t ssid_len;
504 } *filter_ssids;
505
506 /**
507 * num_filter_ssids - Number of entries in filter_ssids array
508 */
509 size_t num_filter_ssids;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800510
511 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -0700512 * filter_rssi - Filter by RSSI
513 *
514 * The driver may filter scan results in firmware to reduce host
515 * wakeups and thereby save power. Specify the RSSI threshold in s32
516 * dBm.
517 */
518 s32 filter_rssi;
519
520 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800521 * p2p_probe - Used to disable CCK (802.11b) rates for P2P probes
522 *
523 * When set, the driver is expected to remove rates 1, 2, 5.5, and 11
524 * Mbps from the support rates element(s) in the Probe Request frames
525 * and not to transmit the frames at any of those rates.
526 */
Dmitry Shmidt2271d3f2014-06-23 12:16:31 -0700527 unsigned int p2p_probe:1;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -0800528
529 /**
530 * only_new_results - Request driver to report only new results
531 *
532 * This is used to request the driver to report only BSSes that have
533 * been detected after this scan request has been started, i.e., to
534 * flush old cached BSS entries.
535 */
Dmitry Shmidt2271d3f2014-06-23 12:16:31 -0700536 unsigned int only_new_results:1;
537
538 /**
539 * low_priority - Requests driver to use a lower scan priority
540 *
541 * This is used to request the driver to use a lower scan priority
542 * if it supports such a thing.
543 */
544 unsigned int low_priority:1;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -0800545
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800546 /**
547 * mac_addr_rand - Requests driver to randomize MAC address
548 */
549 unsigned int mac_addr_rand:1;
550
551 /**
552 * mac_addr - MAC address used with randomization. The address cannot be
553 * a multicast one, i.e., bit 0 of byte 0 should not be set.
554 */
Hai Shalomc3565922019-10-28 11:58:20 -0700555 u8 *mac_addr;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800556
557 /**
558 * mac_addr_mask - MAC address mask used with randomization.
559 *
560 * Bits that are 0 in the mask should be randomized. Bits that are 1 in
561 * the mask should be taken as is from mac_addr. The mask should not
562 * allow the generation of a multicast address, i.e., bit 0 of byte 0
563 * must be set.
564 */
565 const u8 *mac_addr_mask;
566
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -0800567 /**
568 * sched_scan_plans - Scan plans for scheduled scan
569 *
570 * Each scan plan consists of the number of iterations to scan and the
571 * interval between scans. When a scan plan finishes (i.e., it was run
572 * for the specified number of iterations), the next scan plan is
573 * executed. The scan plans are executed in the order they appear in
574 * the array (lower index first). The last scan plan will run infinitely
575 * (until requested to stop), thus must not specify the number of
576 * iterations. All other scan plans must specify the number of
577 * iterations.
578 */
579 struct sched_scan_plan {
580 u32 interval; /* In seconds */
581 u32 iterations; /* Zero to run infinitely */
582 } *sched_scan_plans;
583
584 /**
585 * sched_scan_plans_num - Number of scan plans in sched_scan_plans array
586 */
587 unsigned int sched_scan_plans_num;
588
Dmitry Shmidt9c175262016-03-03 10:20:07 -0800589 /**
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700590 * sched_scan_start_delay - Delay to use before starting the first scan
591 *
592 * Delay (in seconds) before scheduling first scan plan cycle. The
593 * driver may ignore this parameter and start immediately (or at any
594 * other time), if this feature is not supported.
595 */
596 u32 sched_scan_start_delay;
597
598 /**
Dmitry Shmidt9c175262016-03-03 10:20:07 -0800599 * bssid - Specific BSSID to scan for
600 *
601 * This optional parameter can be used to replace the default wildcard
602 * BSSID with a specific BSSID to scan for if results are needed from
603 * only a single BSS.
604 */
605 const u8 *bssid;
606
Dmitry Shmidtabb90a32016-12-05 15:34:39 -0800607 /**
608 * scan_cookie - Unique identification representing the scan request
609 *
610 * This scan_cookie carries a unique identification representing the
611 * scan request if the host driver/kernel supports concurrent scan
612 * requests. This cookie is returned from the corresponding driver
613 * interface.
614 *
615 * Note: Unlike other parameters in this structure, scan_cookie is used
616 * only to return information instead of setting parameters for the
617 * scan.
618 */
619 u64 scan_cookie;
620
Dmitry Shmidt29333592017-01-09 12:27:11 -0800621 /**
622 * duration - Dwell time on each channel
623 *
624 * This optional parameter can be used to set the dwell time on each
625 * channel. In TUs.
626 */
627 u16 duration;
628
629 /**
630 * duration_mandatory - Whether the specified duration is mandatory
631 *
632 * If this is set, the duration specified by the %duration field is
633 * mandatory (and the driver should reject the scan request if it is
634 * unable to comply with the specified duration), otherwise it is the
635 * maximum duration and the actual duration may be shorter.
636 */
637 unsigned int duration_mandatory:1;
638
Dmitry Shmidtebd93af2017-02-21 13:40:44 -0800639 /**
640 * relative_rssi_set - Whether relative RSSI parameters are set
641 */
642 unsigned int relative_rssi_set:1;
643
644 /**
645 * relative_rssi - Relative RSSI for reporting better BSSs
646 *
647 * Amount of RSSI by which a BSS should be better than the current
648 * connected BSS to report the new BSS to user space.
649 */
650 s8 relative_rssi;
651
652 /**
653 * relative_adjust_band - Band to which RSSI should be adjusted
654 *
655 * The relative_adjust_rssi should be added to the band specified
656 * by relative_adjust_band.
657 */
658 enum set_band relative_adjust_band;
659
660 /**
661 * relative_adjust_rssi - RSSI to be added to relative_adjust_band
662 *
663 * An amount of relative_band_rssi should be added to the BSSs that
664 * belong to the band specified by relative_adjust_band while comparing
665 * with other bands for BSS reporting.
666 */
667 s8 relative_adjust_rssi;
668
Hai Shalomce48b4a2018-09-05 11:41:35 -0700669 /**
670 * oce_scan
671 *
672 * Enable the following OCE scan features: (WFA OCE TechSpec v1.0)
673 * - Accept broadcast Probe Response frame.
674 * - Probe Request frame deferral and suppression.
675 * - Max Channel Time - driver fills FILS request params IE with
676 * Maximum Channel Time.
677 * - Send 1st Probe Request frame in rate of minimum 5.5 Mbps.
678 */
679 unsigned int oce_scan:1;
680
Hai Shalomc1a21442022-02-04 13:43:00 -0800681 /**
682 * p2p_include_6ghz - Include 6 GHz channels for P2P full scan
683 *
684 */
685 unsigned int p2p_include_6ghz:1;
686
Sunil8cd6f4d2022-06-28 18:40:46 +0000687 /**
688 * non_coloc_6ghz - Force scanning of non-PSC 6 GHz channels
689 *
690 * If this is set, the driver should scan non-PSC channels from the
691 * scan request even if neighbor reports from 2.4/5 GHz APs did not
692 * report a co-located AP on these channels. The default is to scan
693 * non-PSC channels only if a co-located AP was reported on the channel.
694 */
695 unsigned int non_coloc_6ghz:1;
696
Sunil Ravi2a14cf12023-11-21 00:54:38 +0000697 /**
698 * min_probe_req_content - Minimize probe request content to only have
699 * minimal requirement elements, e.g., supported rates etc., and no
700 * additional elements other then those provided by user space.
701 */
702 unsigned int min_probe_req_content:1;
703
Sunil Ravi99c035e2024-07-12 01:42:03 +0000704 /**
705 * link_id - Specify the link that is requesting the scan on an MLD
706 *
707 * This is set when operating as an AP MLD and doing an OBSS scan.
708 * -1 indicates that no particular link ID is set.
709 */
710 s8 link_id;
711
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -0800712 /*
713 * NOTE: Whenever adding new parameters here, please make sure
714 * wpa_scan_clone_params() and wpa_scan_free_params() get updated with
715 * matching changes.
716 */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700717};
718
719/**
720 * struct wpa_driver_auth_params - Authentication parameters
721 * Data for struct wpa_driver_ops::authenticate().
722 */
723struct wpa_driver_auth_params {
724 int freq;
725 const u8 *bssid;
726 const u8 *ssid;
727 size_t ssid_len;
728 int auth_alg;
729 const u8 *ie;
730 size_t ie_len;
731 const u8 *wep_key[4];
732 size_t wep_key_len[4];
733 int wep_tx_keyidx;
734 int local_state_change;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800735
736 /**
737 * p2p - Whether this connection is a P2P group
738 */
739 int p2p;
740
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800741 /**
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800742 * auth_data - Additional elements for Authentication frame
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800743 *
744 * This buffer starts with the Authentication transaction sequence
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800745 * number field. If no special handling of such elements is needed, this
746 * pointer is %NULL. This is used with SAE and FILS.
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800747 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800748 const u8 *auth_data;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800749
750 /**
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800751 * auth_data_len - Length of auth_data buffer in octets
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800752 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800753 size_t auth_data_len;
Sunil Ravi77d572f2023-01-17 23:58:31 +0000754
755 /**
756 * mld - Establish an MLD connection
757 */
758 bool mld;
759
760 /**
761 * mld_link_id - The link ID of the MLD AP to which we are associating
762 */
763 u8 mld_link_id;
764
765 /**
766 * The MLD AP address
767 */
768 const u8 *ap_mld_addr;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700769};
770
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800771/**
772 * enum wps_mode - WPS mode
773 */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700774enum wps_mode {
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800775 /**
776 * WPS_MODE_NONE - No WPS provisioning being used
777 */
778 WPS_MODE_NONE,
779
780 /**
781 * WPS_MODE_OPEN - WPS provisioning with AP that is in open mode
782 */
783 WPS_MODE_OPEN,
784
785 /**
786 * WPS_MODE_PRIVACY - WPS provisioning with AP that is using protection
787 */
788 WPS_MODE_PRIVACY
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700789};
790
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800791/**
792 * struct hostapd_freq_params - Channel parameters
793 */
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700794struct hostapd_freq_params {
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800795 /**
796 * mode - Mode/band (HOSTAPD_MODE_IEEE80211A, ..)
797 */
798 enum hostapd_hw_mode mode;
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700799
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800800 /**
801 * freq - Primary channel center frequency in MHz
802 */
803 int freq;
804
805 /**
806 * channel - Channel number
807 */
808 int channel;
809
810 /**
811 * ht_enabled - Whether HT is enabled
812 */
813 int ht_enabled;
814
815 /**
816 * sec_channel_offset - Secondary channel offset for HT40
817 *
818 * 0 = HT40 disabled,
819 * -1 = HT40 enabled, secondary channel below primary,
820 * 1 = HT40 enabled, secondary channel above primary
821 */
822 int sec_channel_offset;
823
824 /**
825 * vht_enabled - Whether VHT is enabled
826 */
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700827 int vht_enabled;
828
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800829 /**
Hai Shalom81f62d82019-07-22 12:10:00 -0700830 * he_enabled - Whether HE is enabled
831 */
832 int he_enabled;
833
834 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800835 * center_freq1 - Segment 0 center frequency in MHz
836 *
837 * Valid for both HT and VHT.
838 */
839 int center_freq1;
840
841 /**
842 * center_freq2 - Segment 1 center frequency in MHz
843 *
844 * Non-zero only for bandwidth 80 and an 80+80 channel
845 */
846 int center_freq2;
847
848 /**
849 * bandwidth - Channel bandwidth in MHz (20, 40, 80, 160)
850 */
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700851 int bandwidth;
Hai Shalomc3565922019-10-28 11:58:20 -0700852
853 /**
854 * This structure describes the most essential parameters needed
855 * for IEEE 802.11ay EDMG configuration.
856 */
857 struct ieee80211_edmg_config edmg;
Sunil Ravia04bd252022-05-02 22:54:18 -0700858
859 /**
860 * radar_background - Whether radar/CAC background is requested
861 */
862 bool radar_background;
863
864 /**
865 * eht_enabled - Whether EHT is enabled
866 */
867 bool eht_enabled;
Sunil Ravi2a14cf12023-11-21 00:54:38 +0000868
869 /**
870 * link_id: If >=0 indicates the link of the AP MLD to configure
871 */
872 int link_id;
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700873};
874
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700875/**
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700876 * struct wpa_driver_sta_auth_params - Authentication parameters
877 * Data for struct wpa_driver_ops::sta_auth().
878 */
879struct wpa_driver_sta_auth_params {
880
881 /**
882 * own_addr - Source address and BSSID for authentication frame
883 */
884 const u8 *own_addr;
885
886 /**
887 * addr - MAC address of the station to associate
888 */
889 const u8 *addr;
890
891 /**
892 * seq - authentication sequence number
893 */
894 u16 seq;
895
896 /**
897 * status - authentication response status code
898 */
899 u16 status;
900
901 /**
902 * ie - authentication frame ie buffer
903 */
904 const u8 *ie;
905
906 /**
907 * len - ie buffer length
908 */
909 size_t len;
910
911 /**
912 * fils_auth - Indicates whether FILS authentication is being performed
913 */
914 int fils_auth;
915
916 /**
917 * fils_anonce - ANonce (required for FILS)
918 */
919 u8 fils_anonce[WPA_NONCE_LEN];
920
921 /**
922 * fils_snonce - SNonce (required for FILS)
923 */
924 u8 fils_snonce[WPA_NONCE_LEN];
925
926 /**
927 * fils_kek - key for encryption (required for FILS)
928 */
929 u8 fils_kek[WPA_KEK_MAX_LEN];
930
931 /**
932 * fils_kek_len - Length of the fils_kek in octets (required for FILS)
933 */
934 size_t fils_kek_len;
935};
936
Sunil Ravi77d572f2023-01-17 23:58:31 +0000937struct wpa_driver_mld_params {
938 /**
939 * mld_addr - AP's MLD address
940 */
941 const u8 *mld_addr;
942
943 /**
944 * valid_links - The valid links including the association link
945 */
946 u16 valid_links;
947
948 /**
949 * assoc_link_id - The link on which the association is performed
950 */
951 u8 assoc_link_id;
952
953 /**
954 * mld_links - Link information
955 *
956 * Should include information on all the requested links for association
957 * including the link on which the association should take place.
958 * For the association link, the ies and ies_len should be NULL and
959 * 0 respectively.
960 */
961 struct {
962 int freq;
963 const u8 *bssid;
964 const u8 *ies;
965 size_t ies_len;
Sunil Ravib0ac25f2024-07-12 01:42:03 +0000966 int error;
967 bool disabled;
Sunil Ravi77d572f2023-01-17 23:58:31 +0000968 } mld_links[MAX_NUM_MLD_LINKS];
969};
970
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700971/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700972 * struct wpa_driver_associate_params - Association parameters
973 * Data for struct wpa_driver_ops::associate().
974 */
975struct wpa_driver_associate_params {
976 /**
977 * bssid - BSSID of the selected AP
978 * This can be %NULL, if ap_scan=2 mode is used and the driver is
979 * responsible for selecting with which BSS to associate. */
980 const u8 *bssid;
981
982 /**
Dmitry Shmidt96be6222014-02-13 10:16:51 -0800983 * bssid_hint - BSSID of a proposed AP
984 *
985 * This indicates which BSS has been found a suitable candidate for
986 * initial association for drivers that use driver/firmwate-based BSS
987 * selection. Unlike the @bssid parameter, @bssid_hint does not limit
988 * the driver from selecting other BSSes in the ESS.
989 */
990 const u8 *bssid_hint;
991
992 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700993 * ssid - The selected SSID
994 */
995 const u8 *ssid;
996
997 /**
998 * ssid_len - Length of the SSID (1..32)
999 */
1000 size_t ssid_len;
1001
1002 /**
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -07001003 * freq - channel parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001004 */
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -07001005 struct hostapd_freq_params freq;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001006
1007 /**
Dmitry Shmidt96be6222014-02-13 10:16:51 -08001008 * freq_hint - Frequency of the channel the proposed AP is using
1009 *
1010 * This provides a channel on which a suitable BSS has been found as a
1011 * hint for the driver. Unlike the @freq parameter, @freq_hint does not
1012 * limit the driver from selecting other channels for
1013 * driver/firmware-based BSS selection.
1014 */
1015 int freq_hint;
1016
1017 /**
Dmitry Shmidt04949592012-07-19 12:16:46 -07001018 * bg_scan_period - Background scan period in seconds, 0 to disable
1019 * background scan, or -1 to indicate no change to default driver
1020 * configuration
1021 */
1022 int bg_scan_period;
1023
1024 /**
Dmitry Shmidt2ac5f602014-03-07 10:08:21 -08001025 * beacon_int - Beacon interval for IBSS or 0 to use driver default
1026 */
1027 int beacon_int;
1028
1029 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001030 * wpa_ie - WPA information element for (Re)Association Request
1031 * WPA information element to be included in (Re)Association
1032 * Request (including information element id and length). Use
1033 * of this WPA IE is optional. If the driver generates the WPA
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001034 * IE, it can use pairwise_suite, group_suite, group_mgmt_suite, and
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001035 * key_mgmt_suite to select proper algorithms. In this case,
1036 * the driver has to notify wpa_supplicant about the used WPA
1037 * IE by generating an event that the interface code will
1038 * convert into EVENT_ASSOCINFO data (see below).
1039 *
1040 * When using WPA2/IEEE 802.11i, wpa_ie is used for RSN IE
1041 * instead. The driver can determine which version is used by
1042 * looking at the first byte of the IE (0xdd for WPA, 0x30 for
1043 * WPA2/RSN).
1044 *
1045 * When using WPS, wpa_ie is used for WPS IE instead of WPA/RSN IE.
1046 */
1047 const u8 *wpa_ie;
1048
1049 /**
1050 * wpa_ie_len - length of the wpa_ie
1051 */
1052 size_t wpa_ie_len;
1053
1054 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001055 * wpa_proto - Bitfield of WPA_PROTO_* values to indicate WPA/WPA2
1056 */
1057 unsigned int wpa_proto;
1058
1059 /**
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001060 * pairwise_suite - Selected pairwise cipher suite (WPA_CIPHER_*)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001061 *
1062 * This is usually ignored if @wpa_ie is used.
1063 */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001064 unsigned int pairwise_suite;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001065
1066 /**
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001067 * group_suite - Selected group cipher suite (WPA_CIPHER_*)
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 group_suite;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001072
1073 /**
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001074 * mgmt_group_suite - Selected group management cipher suite (WPA_CIPHER_*)
1075 *
1076 * This is usually ignored if @wpa_ie is used.
1077 */
1078 unsigned int mgmt_group_suite;
1079
1080 /**
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001081 * key_mgmt_suite - Selected key management suite (WPA_KEY_MGMT_*)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001082 *
1083 * This is usually ignored if @wpa_ie is used.
1084 */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001085 unsigned int key_mgmt_suite;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001086
1087 /**
Sunil Ravi89eba102022-09-13 21:04:37 -07001088 * allowed_key_mgmts - Bitfield of allowed key management suites
1089 * (WPA_KEY_MGMT_*) other than @key_mgmt_suite for the current
1090 * connection
1091 *
1092 * SME in the driver may choose key_mgmt from this list for the initial
1093 * connection or roaming. The driver which doesn't support this
1094 * ignores this parameter.
1095 */
1096 unsigned int allowed_key_mgmts;
1097
1098 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001099 * auth_alg - Allowed authentication algorithms
1100 * Bit field of WPA_AUTH_ALG_*
1101 */
1102 int auth_alg;
1103
1104 /**
1105 * mode - Operation mode (infra/ibss) IEEE80211_MODE_*
1106 */
1107 int mode;
1108
1109 /**
1110 * wep_key - WEP keys for static WEP configuration
1111 */
1112 const u8 *wep_key[4];
1113
1114 /**
1115 * wep_key_len - WEP key length for static WEP configuration
1116 */
1117 size_t wep_key_len[4];
1118
1119 /**
1120 * wep_tx_keyidx - WEP TX key index for static WEP configuration
1121 */
1122 int wep_tx_keyidx;
1123
1124 /**
1125 * mgmt_frame_protection - IEEE 802.11w management frame protection
1126 */
1127 enum mfp_options mgmt_frame_protection;
1128
1129 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001130 * passphrase - RSN passphrase for PSK
1131 *
1132 * This value is made available only for WPA/WPA2-Personal (PSK) and
Hai Shalom74f70d42019-02-11 14:42:39 -08001133 * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK. This
1134 * is the 8..63 character ASCII passphrase, if available. Please note
1135 * that this can be %NULL if passphrase was not used to generate the
1136 * PSK. In that case, the psk field must be used to fetch the PSK.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001137 */
1138 const char *passphrase;
1139
1140 /**
1141 * psk - RSN PSK (alternative for passphrase for PSK)
1142 *
1143 * This value is made available only for WPA/WPA2-Personal (PSK) and
Hai Shalom74f70d42019-02-11 14:42:39 -08001144 * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK. This
1145 * is the 32-octet (256-bit) PSK, if available. The driver wrapper
1146 * should be prepared to handle %NULL value as an error.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001147 */
1148 const u8 *psk;
1149
1150 /**
Sunil Ravi2a14cf12023-11-21 00:54:38 +00001151 * sae_password - Password for SAE authentication
1152 *
1153 * This value is made available only for WPA3-Personal (SAE) and only
1154 * for drivers that set WPA_DRIVER_FLAGS2_SAE_OFFLOAD.
1155 */
1156 const char *sae_password;
1157
1158 /**
1159 * sae_password_id - Password Identifier for SAE authentication
1160 *
1161 * This value is made available only for WPA3-Personal (SAE) and only
1162 * for drivers that set WPA_DRIVER_FLAGS2_SAE_OFFLOAD. If %NULL, SAE
1163 * password identifier is not used.
1164 */
1165 const char *sae_password_id;
1166
1167 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001168 * drop_unencrypted - Enable/disable unencrypted frame filtering
1169 *
1170 * Configure the driver to drop all non-EAPOL frames (both receive and
1171 * transmit paths). Unencrypted EAPOL frames (ethertype 0x888e) must
1172 * still be allowed for key negotiation.
1173 */
1174 int drop_unencrypted;
1175
1176 /**
1177 * prev_bssid - Previously used BSSID in this ESS
1178 *
1179 * When not %NULL, this is a request to use reassociation instead of
1180 * association.
1181 */
1182 const u8 *prev_bssid;
1183
1184 /**
1185 * wps - WPS mode
1186 *
1187 * If the driver needs to do special configuration for WPS association,
1188 * this variable provides more information on what type of association
Sunil Ravia04bd252022-05-02 22:54:18 -07001189 * is being requested. Most drivers should not need to use this.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001190 */
1191 enum wps_mode wps;
1192
1193 /**
1194 * p2p - Whether this connection is a P2P group
1195 */
1196 int p2p;
1197
1198 /**
1199 * uapsd - UAPSD parameters for the network
1200 * -1 = do not change defaults
1201 * AP mode: 1 = enabled, 0 = disabled
1202 * STA mode: bits 0..3 UAPSD enabled for VO,VI,BK,BE
1203 */
1204 int uapsd;
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08001205
1206 /**
1207 * fixed_bssid - Whether to force this BSSID in IBSS mode
1208 * 1 = Fix this BSSID and prevent merges.
1209 * 0 = Do not fix BSSID.
1210 */
1211 int fixed_bssid;
1212
1213 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08001214 * fixed_freq - Fix control channel in IBSS mode
1215 * 0 = don't fix control channel (default)
1216 * 1 = fix control channel; this prevents IBSS merging with another
1217 * channel
1218 */
1219 int fixed_freq;
1220
1221 /**
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08001222 * disable_ht - Disable HT (IEEE 802.11n) for this connection
1223 */
1224 int disable_ht;
1225
1226 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001227 * htcaps - HT Capabilities over-rides
1228 *
1229 * Only bits set in the mask will be used, and not all values are used
1230 * by the kernel anyway. Currently, MCS, MPDU and MSDU fields are used.
1231 *
1232 * Pointer to struct ieee80211_ht_capabilities.
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08001233 */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001234 const u8 *htcaps;
1235
1236 /**
1237 * htcaps_mask - HT Capabilities over-rides mask
1238 *
1239 * Pointer to struct ieee80211_ht_capabilities.
1240 */
1241 const u8 *htcaps_mask;
Dmitry Shmidt2f023192013-03-12 12:44:17 -07001242
1243#ifdef CONFIG_VHT_OVERRIDES
1244 /**
1245 * disable_vht - Disable VHT for this connection
1246 */
1247 int disable_vht;
1248
1249 /**
1250 * VHT capability overrides.
1251 */
1252 const struct ieee80211_vht_capabilities *vhtcaps;
1253 const struct ieee80211_vht_capabilities *vhtcaps_mask;
1254#endif /* CONFIG_VHT_OVERRIDES */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001255
Hai Shalomfdcde762020-04-02 11:19:20 -07001256#ifdef CONFIG_HE_OVERRIDES
1257 /**
1258 * disable_he - Disable HE for this connection
1259 */
1260 int disable_he;
1261#endif /* CONFIG_HE_OVERRIDES */
1262
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001263 /**
1264 * req_key_mgmt_offload - Request key management offload for connection
1265 *
1266 * Request key management offload for this connection if the device
1267 * supports it.
1268 */
1269 int req_key_mgmt_offload;
1270
1271 /**
Hai Shalomc3565922019-10-28 11:58:20 -07001272 * req_handshake_offload - Request EAPOL handshake offload
1273 *
1274 * Request EAPOL handshake offload for this connection if the device
1275 * supports it.
1276 */
1277 int req_handshake_offload;
1278
1279 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001280 * Flag for indicating whether this association includes support for
1281 * RRM (Radio Resource Measurements)
1282 */
1283 int rrm_used;
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08001284
1285 /**
1286 * pbss - If set, connect to a PCP in a PBSS. Otherwise, connect to an
1287 * AP as usual. Valid for DMG network only.
1288 */
1289 int pbss;
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08001290
1291 /**
1292 * fils_kek - KEK for FILS association frame protection (AES-SIV)
1293 */
1294 const u8 *fils_kek;
1295
1296 /**
1297 * fils_kek_len: Length of fils_kek in bytes
1298 */
1299 size_t fils_kek_len;
1300
1301 /**
1302 * fils_nonces - Nonces for FILS association frame protection
1303 * (AES-SIV AAD)
1304 */
1305 const u8 *fils_nonces;
1306
1307 /**
1308 * fils_nonces_len: Length of fils_nonce in bytes
1309 */
1310 size_t fils_nonces_len;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001311
1312 /**
1313 * fils_erp_username - Username part of keyName-NAI
1314 */
1315 const u8 *fils_erp_username;
1316
1317 /**
1318 * fils_erp_username_len - Length of fils_erp_username in bytes
1319 */
1320 size_t fils_erp_username_len;
1321
1322 /**
1323 * fils_erp_realm - Realm/domain name to use in FILS ERP
1324 */
1325 const u8 *fils_erp_realm;
1326
1327 /**
1328 * fils_erp_realm_len - Length of fils_erp_realm in bytes
1329 */
1330 size_t fils_erp_realm_len;
1331
1332 /**
1333 * fils_erp_next_seq_num - The next sequence number to use in FILS ERP
1334 * messages
1335 */
1336 u16 fils_erp_next_seq_num;
1337
1338 /**
1339 * fils_erp_rrk - Re-authentication root key (rRK) for the keyName-NAI
1340 * specified by fils_erp_username@fils_erp_realm.
1341 */
1342 const u8 *fils_erp_rrk;
1343
1344 /**
1345 * fils_erp_rrk_len - Length of fils_erp_rrk in bytes
1346 */
1347 size_t fils_erp_rrk_len;
Hai Shalom60840252021-02-19 19:02:11 -08001348
1349 /**
1350 * sae_pwe - SAE mechanism for PWE derivation
1351 * 0 = hunting-and-pecking loop only
1352 * 1 = hash-to-element only
1353 * 2 = both hunting-and-pecking loop and hash-to-element enabled
1354 */
Sunil Ravi77d572f2023-01-17 23:58:31 +00001355 enum sae_pwe sae_pwe;
1356
Winnie Chen4138eec2022-11-10 16:32:53 +08001357#if defined(CONFIG_DRIVER_NL80211_BRCM) || defined(CONFIG_DRIVER_NL80211_SYNA)
Vinayak Yadawade62409f2022-01-20 12:32:07 +05301358 /**
1359 * td_policy - Transition Disable Policy
1360 */
1361 u32 td_policy;
Winnie Chen4138eec2022-11-10 16:32:53 +08001362#endif /* CONFIG_DRIVER_NL80211_BRCM || CONFIG_DRIVER_NL80211_SYNA */
Sunil Ravi77d572f2023-01-17 23:58:31 +00001363
1364 /**
1365 * disable_eht - Disable EHT for this connection
1366 */
1367 int disable_eht;
1368
1369 /*
1370 * mld_params - MLD association parameters
1371 */
1372 struct wpa_driver_mld_params mld_params;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001373};
1374
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001375enum hide_ssid {
1376 NO_SSID_HIDING,
1377 HIDDEN_SSID_ZERO_LEN,
1378 HIDDEN_SSID_ZERO_CONTENTS
1379};
1380
Hai Shalom81f62d82019-07-22 12:10:00 -07001381enum ch_switch_state {
1382 CH_SW_STARTED,
1383 CH_SW_FINISHED
1384};
1385
Dmitry Shmidtb58836e2014-04-29 14:35:56 -07001386struct wowlan_triggers {
1387 u8 any;
1388 u8 disconnect;
1389 u8 magic_pkt;
1390 u8 gtk_rekey_failure;
1391 u8 eap_identity_req;
1392 u8 four_way_handshake;
1393 u8 rfkill_release;
1394};
1395
Sunil Ravi7f769292024-07-23 22:21:32 +00001396struct unsol_bcast_probe_resp {
1397 /**
1398 * Unsolicited broadcast Probe Response interval in TUs
1399 */
1400 unsigned int unsol_bcast_probe_resp_interval;
1401
1402 /**
1403 * Unsolicited broadcast Probe Response template data
1404 */
1405 u8 *unsol_bcast_probe_resp_tmpl;
1406
1407 /**
1408 * Unsolicited broadcast Probe Response template length
1409 */
1410 size_t unsol_bcast_probe_resp_tmpl_len;
1411};
1412
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001413struct wpa_driver_ap_params {
1414 /**
1415 * head - Beacon head from IEEE 802.11 header to IEs before TIM IE
1416 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08001417 u8 *head;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001418
1419 /**
1420 * head_len - Length of the head buffer in octets
1421 */
1422 size_t head_len;
1423
1424 /**
1425 * tail - Beacon tail following TIM IE
1426 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08001427 u8 *tail;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001428
1429 /**
1430 * tail_len - Length of the tail buffer in octets
1431 */
1432 size_t tail_len;
1433
1434 /**
1435 * dtim_period - DTIM period
1436 */
1437 int dtim_period;
1438
1439 /**
1440 * beacon_int - Beacon interval
1441 */
1442 int beacon_int;
1443
1444 /**
1445 * basic_rates: -1 terminated array of basic rates in 100 kbps
1446 *
1447 * This parameter can be used to set a specific basic rate set for the
1448 * BSS. If %NULL, default basic rate set is used.
1449 */
1450 int *basic_rates;
1451
1452 /**
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001453 * beacon_rate: Beacon frame data rate
1454 *
1455 * This parameter can be used to set a specific Beacon frame data rate
1456 * for the BSS. The interpretation of this value depends on the
Hai Shalom60840252021-02-19 19:02:11 -08001457 * rate_type (legacy: in 100 kbps units, HT: HT-MCS, VHT: VHT-MCS,
1458 * HE: HE-MCS). If beacon_rate == 0 and rate_type == 0
1459 * (BEACON_RATE_LEGACY), the default Beacon frame data rate is used.
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001460 */
1461 unsigned int beacon_rate;
1462
1463 /**
Hai Shalom60840252021-02-19 19:02:11 -08001464 * beacon_rate_type: Beacon data rate type (legacy/HT/VHT/HE)
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001465 */
1466 enum beacon_rate_type rate_type;
1467
1468 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001469 * proberesp - Probe Response template
1470 *
1471 * This is used by drivers that reply to Probe Requests internally in
1472 * AP mode and require the full Probe Response template.
1473 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08001474 u8 *proberesp;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001475
1476 /**
1477 * proberesp_len - Length of the proberesp buffer in octets
1478 */
1479 size_t proberesp_len;
1480
1481 /**
1482 * ssid - The SSID to use in Beacon/Probe Response frames
1483 */
1484 const u8 *ssid;
1485
1486 /**
1487 * ssid_len - Length of the SSID (1..32)
1488 */
1489 size_t ssid_len;
1490
1491 /**
1492 * hide_ssid - Whether to hide the SSID
1493 */
1494 enum hide_ssid hide_ssid;
1495
1496 /**
1497 * pairwise_ciphers - WPA_CIPHER_* bitfield
1498 */
1499 unsigned int pairwise_ciphers;
1500
1501 /**
1502 * group_cipher - WPA_CIPHER_*
1503 */
1504 unsigned int group_cipher;
1505
1506 /**
1507 * key_mgmt_suites - WPA_KEY_MGMT_* bitfield
1508 */
1509 unsigned int key_mgmt_suites;
1510
1511 /**
1512 * auth_algs - WPA_AUTH_ALG_* bitfield
1513 */
1514 unsigned int auth_algs;
1515
1516 /**
1517 * wpa_version - WPA_PROTO_* bitfield
1518 */
1519 unsigned int wpa_version;
1520
1521 /**
1522 * privacy - Whether privacy is used in the BSS
1523 */
1524 int privacy;
1525
1526 /**
1527 * beacon_ies - WPS/P2P IE(s) for Beacon frames
1528 *
1529 * This is used to add IEs like WPS IE and P2P IE by drivers that do
1530 * not use the full Beacon template.
1531 */
1532 const struct wpabuf *beacon_ies;
1533
1534 /**
1535 * proberesp_ies - P2P/WPS IE(s) for Probe Response frames
1536 *
1537 * This is used to add IEs like WPS IE and P2P IE by drivers that
1538 * reply to Probe Request frames internally.
1539 */
1540 const struct wpabuf *proberesp_ies;
1541
1542 /**
1543 * assocresp_ies - WPS IE(s) for (Re)Association Response frames
1544 *
1545 * This is used to add IEs like WPS IE by drivers that reply to
1546 * (Re)Association Request frames internally.
1547 */
1548 const struct wpabuf *assocresp_ies;
1549
1550 /**
1551 * isolate - Whether to isolate frames between associated stations
1552 *
1553 * If this is non-zero, the AP is requested to disable forwarding of
1554 * frames between associated stations.
1555 */
1556 int isolate;
1557
1558 /**
1559 * cts_protect - Whether CTS protection is enabled
1560 */
1561 int cts_protect;
1562
1563 /**
1564 * preamble - Whether short preamble is enabled
1565 */
1566 int preamble;
1567
1568 /**
1569 * short_slot_time - Whether short slot time is enabled
1570 *
1571 * 0 = short slot time disable, 1 = short slot time enabled, -1 = do
1572 * not set (e.g., when 802.11g mode is not in use)
1573 */
1574 int short_slot_time;
1575
1576 /**
1577 * ht_opmode - HT operation mode or -1 if HT not in use
1578 */
1579 int ht_opmode;
1580
1581 /**
1582 * interworking - Whether Interworking is enabled
1583 */
1584 int interworking;
1585
1586 /**
1587 * hessid - Homogeneous ESS identifier or %NULL if not set
1588 */
1589 const u8 *hessid;
1590
1591 /**
1592 * access_network_type - Access Network Type (0..15)
1593 *
1594 * This is used for filtering Probe Request frames when Interworking is
1595 * enabled.
1596 */
1597 u8 access_network_type;
Dmitry Shmidt04949592012-07-19 12:16:46 -07001598
1599 /**
1600 * ap_max_inactivity - Timeout in seconds to detect STA's inactivity
1601 *
1602 * This is used by driver which advertises this capability.
1603 */
1604 int ap_max_inactivity;
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07001605
1606 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08001607 * ctwindow - Client Traffic Window (in TUs)
1608 */
1609 u8 p2p_go_ctwindow;
1610
1611 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07001612 * disable_dgaf - Whether group-addressed frames are disabled
1613 */
1614 int disable_dgaf;
Dmitry Shmidtf21452a2014-02-26 10:55:25 -08001615
1616 /**
1617 * osen - Whether OSEN security is enabled
1618 */
1619 int osen;
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07001620
1621 /**
1622 * freq - Channel parameters for dynamic bandwidth changes
1623 */
1624 struct hostapd_freq_params *freq;
Dmitry Shmidt7f656022015-02-25 14:36:37 -08001625
1626 /**
1627 * reenable - Whether this is to re-enable beaconing
1628 */
1629 int reenable;
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08001630
1631 /**
1632 * pbss - Whether to start a PCP (in PBSS) instead of an AP in
1633 * infrastructure BSS. Valid only for DMG network.
1634 */
1635 int pbss;
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001636
1637 /**
1638 * multicast_to_unicast - Whether to use multicast_to_unicast
1639 *
1640 * If this is non-zero, the AP is requested to perform multicast to
1641 * unicast conversion for ARP, IPv4, and IPv6 frames (possibly within
1642 * 802.1Q). If enabled, such frames are to be sent to each station
1643 * separately, with the DA replaced by their own MAC address rather
1644 * than the group address.
1645 *
1646 * Note that this may break certain expectations of the receiver, such
1647 * as the ability to drop unicast IP packets received within multicast
1648 * L2 frames, or the ability to not send ICMP destination unreachable
1649 * messages for packets received in L2 multicast (which is required,
1650 * but the receiver can't tell the difference if this new option is
1651 * enabled.)
1652 *
1653 * This also doesn't implement the 802.11 DMS (directed multicast
1654 * service).
1655 */
1656 int multicast_to_unicast;
Hai Shalom74f70d42019-02-11 14:42:39 -08001657
1658 /**
1659 * ftm_responder - Whether FTM responder is enabled
1660 */
1661 int ftm_responder;
1662
1663 /**
1664 * lci - Binary data, the content of an LCI report IE with type 8 as
1665 * defined in IEEE Std 802.11-2016, 9.4.2.22.10
1666 */
1667 const struct wpabuf *lci;
1668
1669 /**
1670 * civic - Binary data, the content of a measurement report IE with
1671 * type 11 as defined in IEEE Std 802.11-2016, 9.4.2.22.13
1672 */
1673 const struct wpabuf *civic;
Hai Shalomc3565922019-10-28 11:58:20 -07001674
1675 /**
Hai Shalom60840252021-02-19 19:02:11 -08001676 * he_spr_ctrl - Spatial Reuse control field of SPR element
Hai Shalomc3565922019-10-28 11:58:20 -07001677 */
Hai Shalom60840252021-02-19 19:02:11 -08001678 u8 he_spr_ctrl;
1679
1680 /**
1681 * he_spr_non_srg_obss_pd_max_offset - Non-SRG Maximum TX power offset
1682 */
1683 u8 he_spr_non_srg_obss_pd_max_offset;
Hai Shalomc3565922019-10-28 11:58:20 -07001684
1685 /**
1686 * he_spr_srg_obss_pd_min_offset - Minimum TX power offset
1687 */
Hai Shalom60840252021-02-19 19:02:11 -08001688 u8 he_spr_srg_obss_pd_min_offset;
Hai Shalomc3565922019-10-28 11:58:20 -07001689
1690 /**
1691 * he_spr_srg_obss_pd_max_offset - Maximum TX power offset
1692 */
Hai Shalom60840252021-02-19 19:02:11 -08001693 u8 he_spr_srg_obss_pd_max_offset;
1694
1695 /**
1696 * he_spr_bss_color_bitmap - BSS color values used by members of the
1697 * SRG.
1698 */
1699 u8 he_spr_bss_color_bitmap[8];
1700
1701 /**
1702 * he_spr_partial_bssid_bitmap - Partial BSSID values used by members
1703 * of the SRG.
1704 */
1705 u8 he_spr_partial_bssid_bitmap[8];
Hai Shalomfdcde762020-04-02 11:19:20 -07001706
1707 /**
1708 * he_bss_color - Whether the BSS Color is disabled
1709 */
1710 int he_bss_color_disabled;
1711
1712 /**
1713 * he_bss_color_partial - The BSS Color AID equation
1714 */
1715 int he_bss_color_partial;
1716
1717 /**
1718 * he_bss_color - The BSS Color of the AP
1719 */
1720 int he_bss_color;
1721
1722 /**
1723 * twt_responder - Whether Target Wait Time responder is enabled
1724 */
1725 int twt_responder;
Hai Shalom60840252021-02-19 19:02:11 -08001726
1727 /**
1728 * sae_pwe - SAE mechanism for PWE derivation
1729 * 0 = hunting-and-pecking loop only
1730 * 1 = hash-to-element only
1731 * 2 = both hunting-and-pecking loop and hash-to-element enabled
1732 */
Sunil Ravi77d572f2023-01-17 23:58:31 +00001733 enum sae_pwe sae_pwe;
Hai Shalom60840252021-02-19 19:02:11 -08001734
1735 /**
1736 * FILS Discovery frame minimum interval in TUs
1737 */
1738 u32 fd_min_int;
1739
1740 /**
1741 * FILS Discovery frame maximum interval in TUs (0 = FD frame disabled)
1742 */
1743 u32 fd_max_int;
1744
1745 /**
1746 * FILS Discovery frame template data
1747 */
1748 u8 *fd_frame_tmpl;
1749
1750 /**
1751 * FILS Discovery frame template length
1752 */
1753 size_t fd_frame_tmpl_len;
1754
1755 /**
Sunil Ravi77d572f2023-01-17 23:58:31 +00001756 * mbssid_tx_iface - Transmitting interface of the MBSSID set
1757 */
1758 const char *mbssid_tx_iface;
1759
1760 /**
1761 * mbssid_index - The index of this BSS in the MBSSID set
1762 */
1763 unsigned int mbssid_index;
1764
1765 /**
1766 * mbssid_elem - Buffer containing all MBSSID elements
1767 */
1768 u8 *mbssid_elem;
1769
1770 /**
1771 * mbssid_elem_len - Total length of all MBSSID elements
1772 */
1773 size_t mbssid_elem_len;
1774
1775 /**
1776 * mbssid_elem_count - The number of MBSSID elements
1777 */
1778 u8 mbssid_elem_count;
1779
1780 /**
1781 * mbssid_elem_offset - Offsets to elements in mbssid_elem.
1782 * Kernel will use these offsets to generate multiple BSSID beacons.
1783 */
1784 u8 **mbssid_elem_offset;
1785
1786 /**
1787 * ema - Enhanced MBSSID advertisements support.
1788 */
1789 bool ema;
Sunil Ravi036cec52023-03-29 11:35:17 -07001790
1791 /**
1792 * punct_bitmap - Preamble puncturing bitmap
1793 * Each bit corresponds to a 20 MHz subchannel, the lowest bit for the
1794 * channel with the lowest frequency. A bit set to 1 indicates that the
1795 * subchannel is punctured, otherwise active.
1796 */
1797 u16 punct_bitmap;
Sunil Ravi640215c2023-06-28 23:08:09 +00001798
1799 /**
1800 * rnr_elem - This buffer contains all of reduced neighbor report (RNR)
1801 * elements
1802 */
1803 u8 *rnr_elem;
1804
1805 /**
1806 * rnr_elem_len - Length of rnr_elem buffer
1807 */
1808 size_t rnr_elem_len;
1809
1810 /**
1811 * rnr_elem_count - Number of RNR elements
1812 */
1813 unsigned int rnr_elem_count;
1814
1815 /**
1816 * rnr_elem_offset - The offsets to the elements in rnr_elem.
1817 * The driver will use these to include RNR elements in EMA beacons.
1818 */
1819 u8 **rnr_elem_offset;
1820
Sunil Ravi7f769292024-07-23 22:21:32 +00001821 /* Unsolicited broadcast Probe Response data */
1822 struct unsol_bcast_probe_resp ubpr;
1823
Sunil Ravi640215c2023-06-28 23:08:09 +00001824 /**
1825 * allowed_freqs - List of allowed 20 MHz channel center frequencies in
1826 * MHz for AP operation. Drivers which support this parameter will
1827 * generate a new list based on this provided list by filtering out
1828 * channels that cannot be used at that time due to regulatory or other
1829 * constraints. The resulting list is used as the list of all allowed
1830 * channels whenever performing operations like ACS and DFS.
1831 */
1832 int *allowed_freqs;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00001833
1834 /*
1835 * mld_ap - Whether operating as an AP MLD
1836 */
1837 bool mld_ap;
1838
1839 /**
1840 * mld_link_id - Link id for MLD BSS's
1841 */
1842 u8 mld_link_id;
1843
1844 /**
1845 * psk - PSK passed to the driver for 4-way handshake offload
1846 */
1847 u8 psk[PMK_LEN];
1848
1849 /**
1850 * psk_len - PSK length in bytes (0 = not set)
1851 */
1852 size_t psk_len;
1853
1854 /**
1855 * sae_password - SAE password for SAE offload
1856 */
1857 const char *sae_password;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001858};
1859
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001860struct wpa_driver_mesh_bss_params {
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001861#define WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS 0x00000001
1862#define WPA_DRIVER_MESH_CONF_FLAG_PEER_LINK_TIMEOUT 0x00000002
1863#define WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS 0x00000004
1864#define WPA_DRIVER_MESH_CONF_FLAG_HT_OP_MODE 0x00000008
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001865#define WPA_DRIVER_MESH_CONF_FLAG_RSSI_THRESHOLD 0x00000010
Hai Shalomc1a21442022-02-04 13:43:00 -08001866#define WPA_DRIVER_MESH_CONF_FLAG_FORWARDING 0x00000020
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001867 /*
1868 * TODO: Other mesh configuration parameters would go here.
1869 * See NL80211_MESHCONF_* for all the mesh config parameters.
1870 */
1871 unsigned int flags;
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001872 int auto_plinks;
Dmitry Shmidt2f74e362015-01-21 13:19:05 -08001873 int peer_link_timeout;
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001874 int max_peer_links;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001875 int rssi_threshold;
Hai Shalomc1a21442022-02-04 13:43:00 -08001876 int forwarding;
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001877 u16 ht_opmode;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001878};
1879
1880struct wpa_driver_mesh_join_params {
1881 const u8 *meshid;
1882 int meshid_len;
1883 const int *basic_rates;
1884 const u8 *ies;
1885 int ie_len;
Dmitry Shmidtff787d52015-01-12 13:01:47 -08001886 struct hostapd_freq_params freq;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001887 int beacon_int;
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07001888 int dtim_period;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001889 struct wpa_driver_mesh_bss_params conf;
1890#define WPA_DRIVER_MESH_FLAG_USER_MPM 0x00000001
1891#define WPA_DRIVER_MESH_FLAG_DRIVER_MPM 0x00000002
1892#define WPA_DRIVER_MESH_FLAG_SAE_AUTH 0x00000004
1893#define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008
1894 unsigned int flags;
Hai Shalom60840252021-02-19 19:02:11 -08001895 bool handle_dfs;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001896};
1897
Hai Shalomfdcde762020-04-02 11:19:20 -07001898struct wpa_driver_set_key_params {
1899 /**
1900 * ifname - Interface name (for multi-SSID/VLAN support) */
1901 const char *ifname;
1902
1903 /**
1904 * alg - Encryption algorithm
1905 *
1906 * (%WPA_ALG_NONE, %WPA_ALG_WEP, %WPA_ALG_TKIP, %WPA_ALG_CCMP,
Hai Shalom4fbc08f2020-05-18 12:37:00 -07001907 * %WPA_ALG_BIP_AES_CMAC_128, %WPA_ALG_GCMP, %WPA_ALG_GCMP_256,
1908 * %WPA_ALG_CCMP_256, %WPA_ALG_BIP_GMAC_128, %WPA_ALG_BIP_GMAC_256,
1909 * %WPA_ALG_BIP_CMAC_256);
Hai Shalomfdcde762020-04-02 11:19:20 -07001910 * %WPA_ALG_NONE clears the key. */
1911 enum wpa_alg alg;
1912
1913 /**
1914 * addr - Address of the peer STA
1915 *
1916 * (BSSID of the current AP when setting pairwise key in station mode),
1917 * ff:ff:ff:ff:ff:ff for broadcast keys, %NULL for default keys that
1918 * are used both for broadcast and unicast; when clearing keys, %NULL
1919 * is used to indicate that both the broadcast-only and default key of
1920 * the specified key index is to be cleared */
1921 const u8 *addr;
1922
1923 /**
1924 * key_idx - Key index
1925 *
1926 * (0..3), usually 0 for unicast keys; 4..5 for IGTK; 6..7 for BIGTK */
1927 int key_idx;
1928
1929 /**
1930 * set_tx - Configure this key as the default Tx key
1931 *
1932 * Only used when driver does not support separate unicast/individual
1933 * key */
1934 int set_tx;
1935
1936 /**
1937 * seq - Sequence number/packet number
1938 *
1939 * seq_len octets, the next packet number to be used for in replay
1940 * protection; configured for Rx keys (in most cases, this is only used
1941 * with broadcast keys and set to zero for unicast keys); %NULL if not
1942 * set */
1943 const u8 *seq;
1944
1945 /**
1946 * seq_len - Length of the seq, depends on the algorithm
1947 *
1948 * TKIP: 6 octets, CCMP/GCMP: 6 octets, IGTK: 6 octets */
1949 size_t seq_len;
1950
1951 /**
1952 * key - Key buffer
1953 *
1954 * TKIP: 16-byte temporal key, 8-byte Tx Mic key, 8-byte Rx Mic Key */
1955 const u8 *key;
1956
1957 /**
1958 * key_len - Length of the key buffer in octets
1959 *
1960 * WEP: 5 or 13, TKIP: 32, CCMP/GCMP: 16, IGTK: 16 */
1961 size_t key_len;
1962
1963 /**
1964 * vlan_id - VLAN index (0..4095) for VLAN offload cases */
1965 int vlan_id;
1966
1967 /**
1968 * key_flag - Additional key flags
1969 *
1970 * %KEY_FLAG_MODIFY
1971 * Set when an already installed key must be updated.
1972 * So far the only use-case is changing RX/TX status for
1973 * pairwise keys. Must not be set when deleting a key.
1974 * %KEY_FLAG_DEFAULT
1975 * Set when the key is also a default key. Must not be set when
1976 * deleting a key.
1977 * %KEY_FLAG_RX
1978 * The key is valid for RX. Must not be set when deleting a key.
1979 * %KEY_FLAG_TX
1980 * The key is valid for TX. Must not be set when deleting a key.
1981 * %KEY_FLAG_GROUP
1982 * The key is a broadcast or group key.
1983 * %KEY_FLAG_PAIRWISE
1984 * The key is a pairwise key.
1985 * %KEY_FLAG_PMK
1986 * The key is a Pairwise Master Key (PMK).
1987 *
1988 * Valid and pre-defined combinations are:
1989 * %KEY_FLAG_GROUP_RX_TX
1990 * WEP key not to be installed as default key.
1991 * %KEY_FLAG_GROUP_RX_TX_DEFAULT
1992 * Default WEP or WPA-NONE key.
1993 * %KEY_FLAG_GROUP_RX
1994 * GTK key valid for RX only.
1995 * %KEY_FLAG_GROUP_TX_DEFAULT
1996 * GTK key valid for TX only, immediately taking over TX.
1997 * %KEY_FLAG_PAIRWISE_RX_TX
1998 * Pairwise key immediately becoming the active pairwise key.
1999 * %KEY_FLAG_PAIRWISE_RX
2000 * Pairwise key not yet valid for TX. (Only usable when Extended
2001 * Key ID is supported by the driver.)
2002 * %KEY_FLAG_PAIRWISE_RX_TX_MODIFY
2003 * Enable TX for a pairwise key installed with
2004 * KEY_FLAG_PAIRWISE_RX.
2005 *
2006 * Not a valid standalone key type but pre-defined to be combined
2007 * with other key_flags:
2008 * %KEY_FLAG_RX_TX
2009 * RX/TX key. */
2010 enum key_flag key_flag;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002011
2012 /**
2013 * link_id - MLO Link ID
2014 *
2015 * Set to a valid Link ID (0-14) when applicable, otherwise -1. */
2016 int link_id;
Hai Shalomfdcde762020-04-02 11:19:20 -07002017};
2018
Hai Shalom4fbc08f2020-05-18 12:37:00 -07002019enum wpa_driver_if_type {
2020 /**
2021 * WPA_IF_STATION - Station mode interface
2022 */
2023 WPA_IF_STATION,
2024
2025 /**
2026 * WPA_IF_AP_VLAN - AP mode VLAN interface
2027 *
2028 * This interface shares its address and Beacon frame with the main
2029 * BSS.
2030 */
2031 WPA_IF_AP_VLAN,
2032
2033 /**
2034 * WPA_IF_AP_BSS - AP mode BSS interface
2035 *
2036 * This interface has its own address and Beacon frame.
2037 */
2038 WPA_IF_AP_BSS,
2039
2040 /**
2041 * WPA_IF_P2P_GO - P2P Group Owner
2042 */
2043 WPA_IF_P2P_GO,
2044
2045 /**
2046 * WPA_IF_P2P_CLIENT - P2P Client
2047 */
2048 WPA_IF_P2P_CLIENT,
2049
2050 /**
2051 * WPA_IF_P2P_GROUP - P2P Group interface (will become either
2052 * WPA_IF_P2P_GO or WPA_IF_P2P_CLIENT, but the role is not yet known)
2053 */
2054 WPA_IF_P2P_GROUP,
2055
2056 /**
Sunil Ravia04bd252022-05-02 22:54:18 -07002057 * WPA_IF_P2P_DEVICE - P2P Device interface is used to identify the
Hai Shalom4fbc08f2020-05-18 12:37:00 -07002058 * abstracted P2P Device function in the driver
2059 */
2060 WPA_IF_P2P_DEVICE,
2061
2062 /*
2063 * WPA_IF_MESH - Mesh interface
2064 */
2065 WPA_IF_MESH,
2066
2067 /*
2068 * WPA_IF_TDLS - TDLS offchannel interface (used for pref freq only)
2069 */
2070 WPA_IF_TDLS,
2071
2072 /*
2073 * WPA_IF_IBSS - IBSS interface (used for pref freq only)
2074 */
2075 WPA_IF_IBSS,
2076
2077 /*
2078 * WPA_IF_NAN - NAN Device
2079 */
2080 WPA_IF_NAN,
2081
2082 /* keep last */
2083 WPA_IF_MAX
2084};
2085
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002086/**
2087 * struct wpa_driver_capa - Driver capability information
2088 */
2089struct wpa_driver_capa {
2090#define WPA_DRIVER_CAPA_KEY_MGMT_WPA 0x00000001
2091#define WPA_DRIVER_CAPA_KEY_MGMT_WPA2 0x00000002
2092#define WPA_DRIVER_CAPA_KEY_MGMT_WPA_PSK 0x00000004
2093#define WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK 0x00000008
2094#define WPA_DRIVER_CAPA_KEY_MGMT_WPA_NONE 0x00000010
2095#define WPA_DRIVER_CAPA_KEY_MGMT_FT 0x00000020
2096#define WPA_DRIVER_CAPA_KEY_MGMT_FT_PSK 0x00000040
Dmitry Shmidtd5e49232012-12-03 15:08:10 -08002097#define WPA_DRIVER_CAPA_KEY_MGMT_WAPI_PSK 0x00000080
Dmitry Shmidt807291d2015-01-27 13:40:23 -08002098#define WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B 0x00000100
2099#define WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B_192 0x00000200
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002100#define WPA_DRIVER_CAPA_KEY_MGMT_OWE 0x00000400
2101#define WPA_DRIVER_CAPA_KEY_MGMT_DPP 0x00000800
2102#define WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA256 0x00001000
2103#define WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA384 0x00002000
2104#define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA256 0x00004000
2105#define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA384 0x00008000
Hai Shalom74f70d42019-02-11 14:42:39 -08002106#define WPA_DRIVER_CAPA_KEY_MGMT_SAE 0x00010000
Tanmay Garga7fd80d2020-05-18 15:52:44 +05302107#define WPA_DRIVER_CAPA_KEY_MGMT_802_1X_SHA256 0x00020000
2108#define WPA_DRIVER_CAPA_KEY_MGMT_PSK_SHA256 0x00040000
2109#define WPA_DRIVER_CAPA_KEY_MGMT_TPK_HANDSHAKE 0x00080000
2110#define WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE 0x00100000
2111#define WPA_DRIVER_CAPA_KEY_MGMT_FT_802_1X_SHA384 0x00200000
2112#define WPA_DRIVER_CAPA_KEY_MGMT_CCKM 0x00400000
2113#define WPA_DRIVER_CAPA_KEY_MGMT_OSEN 0x00800000
Sunil Ravi89eba102022-09-13 21:04:37 -07002114#define WPA_DRIVER_CAPA_KEY_MGMT_SAE_EXT_KEY 0x01000000
2115#define WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE_EXT_KEY 0x02000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002116 /** Bitfield of supported key management suites */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002117 unsigned int key_mgmt;
Hai Shalom4fbc08f2020-05-18 12:37:00 -07002118 unsigned int key_mgmt_iftype[WPA_IF_MAX];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002119
2120#define WPA_DRIVER_CAPA_ENC_WEP40 0x00000001
2121#define WPA_DRIVER_CAPA_ENC_WEP104 0x00000002
2122#define WPA_DRIVER_CAPA_ENC_TKIP 0x00000004
2123#define WPA_DRIVER_CAPA_ENC_CCMP 0x00000008
Dmitry Shmidt04949592012-07-19 12:16:46 -07002124#define WPA_DRIVER_CAPA_ENC_WEP128 0x00000010
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07002125#define WPA_DRIVER_CAPA_ENC_GCMP 0x00000020
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08002126#define WPA_DRIVER_CAPA_ENC_GCMP_256 0x00000040
2127#define WPA_DRIVER_CAPA_ENC_CCMP_256 0x00000080
2128#define WPA_DRIVER_CAPA_ENC_BIP 0x00000100
2129#define WPA_DRIVER_CAPA_ENC_BIP_GMAC_128 0x00000200
2130#define WPA_DRIVER_CAPA_ENC_BIP_GMAC_256 0x00000400
2131#define WPA_DRIVER_CAPA_ENC_BIP_CMAC_256 0x00000800
Dmitry Shmidtf21452a2014-02-26 10:55:25 -08002132#define WPA_DRIVER_CAPA_ENC_GTK_NOT_USED 0x00001000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002133 /** Bitfield of supported cipher suites */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002134 unsigned int enc;
2135
2136#define WPA_DRIVER_AUTH_OPEN 0x00000001
2137#define WPA_DRIVER_AUTH_SHARED 0x00000002
2138#define WPA_DRIVER_AUTH_LEAP 0x00000004
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002139 /** Bitfield of supported IEEE 802.11 authentication algorithms */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002140 unsigned int auth;
2141
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002142/** Driver generated WPA/RSN IE */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002143#define WPA_DRIVER_FLAGS_DRIVER_IE 0x00000001
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002144/** Driver needs static WEP key setup after association command */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002145#define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC 0x00000002
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002146/** Driver takes care of all DFS operations */
Dmitry Shmidtd11f0192014-03-24 12:09:47 -07002147#define WPA_DRIVER_FLAGS_DFS_OFFLOAD 0x00000004
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002148/** Driver takes care of RSN 4-way handshake internally; PMK is configured with
Hai Shalomfdcde762020-04-02 11:19:20 -07002149 * struct wpa_driver_ops::set_key using key_flag = KEY_FLAG_PMK */
Hai Shalom74f70d42019-02-11 14:42:39 -08002150#define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X 0x00000008
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002151/** Driver is for a wired Ethernet interface */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002152#define WPA_DRIVER_FLAGS_WIRED 0x00000010
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002153/** Driver provides separate commands for authentication and association (SME in
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002154 * wpa_supplicant). */
2155#define WPA_DRIVER_FLAGS_SME 0x00000020
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002156/** Driver supports AP mode */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002157#define WPA_DRIVER_FLAGS_AP 0x00000040
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002158/** Driver needs static WEP key setup after association has been completed */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002159#define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE 0x00000080
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002160/** Driver supports dynamic HT 20/40 MHz channel changes during BSS lifetime */
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07002161#define WPA_DRIVER_FLAGS_HT_2040_COEX 0x00000100
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002162/** Driver supports concurrent P2P operations */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002163#define WPA_DRIVER_FLAGS_P2P_CONCURRENT 0x00000200
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002164/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002165 * Driver uses the initial interface as a dedicated management interface, i.e.,
2166 * it cannot be used for P2P group operations or non-P2P purposes.
2167 */
2168#define WPA_DRIVER_FLAGS_P2P_DEDICATED_INTERFACE 0x00000400
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002169/** This interface is P2P capable (P2P GO or P2P Client) */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002170#define WPA_DRIVER_FLAGS_P2P_CAPABLE 0x00000800
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002171/** Driver supports station and key removal when stopping an AP */
Dmitry Shmidta38abf92014-03-06 13:38:44 -08002172#define WPA_DRIVER_FLAGS_AP_TEARDOWN_SUPPORT 0x00001000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002173/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002174 * Driver uses the initial interface for P2P management interface and non-P2P
2175 * purposes (e.g., connect to infra AP), but this interface cannot be used for
2176 * P2P group operations.
2177 */
2178#define WPA_DRIVER_FLAGS_P2P_MGMT_AND_NON_P2P 0x00002000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002179/**
Hai Shalomc1a21442022-02-04 13:43:00 -08002180 * Driver is known to use valid error codes, i.e., when it indicates that
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002181 * something (e.g., association) fails, there was indeed a failure and the
2182 * operation does not end up getting completed successfully later.
2183 */
Hai Shalomc1a21442022-02-04 13:43:00 -08002184#define WPA_DRIVER_FLAGS_VALID_ERROR_CODES 0x00004000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002185/** Driver supports off-channel TX */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002186#define WPA_DRIVER_FLAGS_OFFCHANNEL_TX 0x00008000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002187/** Driver indicates TX status events for EAPOL Data frames */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002188#define WPA_DRIVER_FLAGS_EAPOL_TX_STATUS 0x00010000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002189/** Driver indicates TX status events for Deauth/Disassoc frames */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002190#define WPA_DRIVER_FLAGS_DEAUTH_TX_STATUS 0x00020000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002191/** Driver supports roaming (BSS selection) in firmware */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002192#define WPA_DRIVER_FLAGS_BSS_SELECTION 0x00040000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002193/** Driver supports operating as a TDLS peer */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002194#define WPA_DRIVER_FLAGS_TDLS_SUPPORT 0x00080000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002195/** Driver requires external TDLS setup/teardown/discovery */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002196#define WPA_DRIVER_FLAGS_TDLS_EXTERNAL_SETUP 0x00100000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002197/** Driver indicates support for Probe Response offloading in AP mode */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002198#define WPA_DRIVER_FLAGS_PROBE_RESP_OFFLOAD 0x00200000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002199/** Driver supports U-APSD in AP mode */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002200#define WPA_DRIVER_FLAGS_AP_UAPSD 0x00400000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002201/** Driver supports inactivity timer in AP mode */
Dmitry Shmidt04949592012-07-19 12:16:46 -07002202#define WPA_DRIVER_FLAGS_INACTIVITY_TIMER 0x00800000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002203/** Driver expects user space implementation of MLME in AP mode */
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07002204#define WPA_DRIVER_FLAGS_AP_MLME 0x01000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002205/** Driver supports SAE with user space SME */
Dmitry Shmidtd5e49232012-12-03 15:08:10 -08002206#define WPA_DRIVER_FLAGS_SAE 0x02000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002207/** Driver makes use of OBSS scan mechanism in wpa_supplicant */
Dmitry Shmidtd5e49232012-12-03 15:08:10 -08002208#define WPA_DRIVER_FLAGS_OBSS_SCAN 0x04000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002209/** Driver supports IBSS (Ad-hoc) mode */
Dmitry Shmidt700a1372013-03-15 14:14:44 -07002210#define WPA_DRIVER_FLAGS_IBSS 0x08000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002211/** Driver supports radar detection */
Dmitry Shmidtea69e842013-05-13 14:52:28 -07002212#define WPA_DRIVER_FLAGS_RADAR 0x10000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002213/** Driver supports a dedicated interface for P2P Device */
Dmitry Shmidt34af3062013-07-11 10:46:32 -07002214#define WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE 0x20000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002215/** Driver supports QoS Mapping */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08002216#define WPA_DRIVER_FLAGS_QOS_MAPPING 0x40000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002217/** Driver supports CSA in AP mode */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08002218#define WPA_DRIVER_FLAGS_AP_CSA 0x80000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002219/** Driver supports mesh */
2220#define WPA_DRIVER_FLAGS_MESH 0x0000000100000000ULL
2221/** Driver support ACS offload */
2222#define WPA_DRIVER_FLAGS_ACS_OFFLOAD 0x0000000200000000ULL
2223/** Driver supports key management offload */
2224#define WPA_DRIVER_FLAGS_KEY_MGMT_OFFLOAD 0x0000000400000000ULL
2225/** Driver supports TDLS channel switching */
2226#define WPA_DRIVER_FLAGS_TDLS_CHANNEL_SWITCH 0x0000000800000000ULL
Dmitry Shmidtff787d52015-01-12 13:01:47 -08002227/** Driver supports IBSS with HT datarates */
2228#define WPA_DRIVER_FLAGS_HT_IBSS 0x0000001000000000ULL
Dmitry Shmidt7f656022015-02-25 14:36:37 -08002229/** Driver supports IBSS with VHT datarates */
2230#define WPA_DRIVER_FLAGS_VHT_IBSS 0x0000002000000000ULL
Dmitry Shmidtb1e52102015-05-29 12:36:29 -07002231/** Driver supports automatic band selection */
2232#define WPA_DRIVER_FLAGS_SUPPORT_HW_MODE_ANY 0x0000004000000000ULL
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002233/** Driver supports simultaneous off-channel operations */
2234#define WPA_DRIVER_FLAGS_OFFCHANNEL_SIMULTANEOUS 0x0000008000000000ULL
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002235/** Driver supports full AP client state */
2236#define WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE 0x0000010000000000ULL
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07002237/** Driver supports P2P Listen offload */
2238#define WPA_DRIVER_FLAGS_P2P_LISTEN_OFFLOAD 0x0000020000000000ULL
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08002239/** Driver supports FILS */
2240#define WPA_DRIVER_FLAGS_SUPPORT_FILS 0x0000040000000000ULL
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08002241/** Driver supports Beacon frame TX rate configuration (legacy rates) */
2242#define WPA_DRIVER_FLAGS_BEACON_RATE_LEGACY 0x0000080000000000ULL
2243/** Driver supports Beacon frame TX rate configuration (HT rates) */
2244#define WPA_DRIVER_FLAGS_BEACON_RATE_HT 0x0000100000000000ULL
2245/** Driver supports Beacon frame TX rate configuration (VHT rates) */
2246#define WPA_DRIVER_FLAGS_BEACON_RATE_VHT 0x0000200000000000ULL
Dmitry Shmidtebd93af2017-02-21 13:40:44 -08002247/** Driver supports mgmt_tx with random TX address in non-connected state */
2248#define WPA_DRIVER_FLAGS_MGMT_TX_RANDOM_TA 0x0000400000000000ULL
2249/** Driver supports mgmt_tx with random TX addr in connected state */
2250#define WPA_DRIVER_FLAGS_MGMT_TX_RANDOM_TA_CONNECTED 0x0000800000000000ULL
2251/** Driver supports better BSS reporting with sched_scan in connected mode */
2252#define WPA_DRIVER_FLAGS_SCHED_SCAN_RELATIVE_RSSI 0x0001000000000000ULL
2253/** Driver supports HE capabilities */
2254#define WPA_DRIVER_FLAGS_HE_CAPABILITIES 0x0002000000000000ULL
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002255/** Driver supports FILS shared key offload */
2256#define WPA_DRIVER_FLAGS_FILS_SK_OFFLOAD 0x0004000000000000ULL
2257/** Driver supports all OCE STA specific mandatory features */
2258#define WPA_DRIVER_FLAGS_OCE_STA 0x0008000000000000ULL
2259/** Driver supports all OCE AP specific mandatory features */
2260#define WPA_DRIVER_FLAGS_OCE_AP 0x0010000000000000ULL
2261/**
2262 * Driver supports all OCE STA-CFON specific mandatory features only.
2263 * If a driver sets this bit but not the %WPA_DRIVER_FLAGS_OCE_AP, the
2264 * userspace shall assume that this driver may not support all OCE AP
2265 * functionality but can support only OCE STA-CFON functionality.
2266 */
2267#define WPA_DRIVER_FLAGS_OCE_STA_CFON 0x0020000000000000ULL
Roshan Pius3a1667e2018-07-03 15:17:14 -07002268/** Driver supports MFP-optional in the connect command */
2269#define WPA_DRIVER_FLAGS_MFP_OPTIONAL 0x0040000000000000ULL
Hai Shalom39ba6fc2019-01-22 12:40:38 -08002270/** Driver is a self-managed regulatory device */
2271#define WPA_DRIVER_FLAGS_SELF_MANAGED_REGULATORY 0x0080000000000000ULL
Hai Shalom74f70d42019-02-11 14:42:39 -08002272/** Driver supports FTM responder functionality */
2273#define WPA_DRIVER_FLAGS_FTM_RESPONDER 0x0100000000000000ULL
2274/** Driver support 4-way handshake offload for WPA-Personal */
2275#define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK 0x0200000000000000ULL
Hai Shalomb755a2a2020-04-23 21:49:02 -07002276/** Driver supports a separate control port TX for EAPOL frames */
Hai Shalomfdcde762020-04-02 11:19:20 -07002277#define WPA_DRIVER_FLAGS_CONTROL_PORT 0x0400000000000000ULL
2278/** Driver supports VLAN offload */
2279#define WPA_DRIVER_FLAGS_VLAN_OFFLOAD 0x0800000000000000ULL
2280/** Driver supports UPDATE_FT_IES command */
2281#define WPA_DRIVER_FLAGS_UPDATE_FT_IES 0x1000000000000000ULL
2282/** Driver can correctly rekey PTKs without Extended Key ID */
2283#define WPA_DRIVER_FLAGS_SAFE_PTK0_REKEYS 0x2000000000000000ULL
2284/** Driver supports Beacon protection */
2285#define WPA_DRIVER_FLAGS_BEACON_PROTECTION 0x4000000000000000ULL
2286/** Driver supports Extended Key ID */
2287#define WPA_DRIVER_FLAGS_EXTENDED_KEY_ID 0x8000000000000000ULL
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002288 u64 flags;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002289
Hai Shalomb755a2a2020-04-23 21:49:02 -07002290/** Driver supports a separate control port RX for EAPOL frames */
2291#define WPA_DRIVER_FLAGS2_CONTROL_PORT_RX 0x0000000000000001ULL
Hai Shalom899fcc72020-10-19 14:38:18 -07002292/** Driver supports TX status reports for EAPOL frames through control port */
2293#define WPA_DRIVER_FLAGS2_CONTROL_PORT_TX_STATUS 0x0000000000000002ULL
Sunil Ravi89eba102022-09-13 21:04:37 -07002294/** Driver supports secure LTF in AP mode */
2295#define WPA_DRIVER_FLAGS2_SEC_LTF_AP 0x0000000000000004ULL
2296/** Driver supports secure RTT measurement exchange in AP mode */
2297#define WPA_DRIVER_FLAGS2_SEC_RTT_AP 0x0000000000000008ULL
Hai Shalom60840252021-02-19 19:02:11 -08002298/**
2299 * Driver supports protection of range negotiation and measurement management
Sunil Ravi89eba102022-09-13 21:04:37 -07002300 * frames in AP mode
Hai Shalom60840252021-02-19 19:02:11 -08002301 */
Sunil Ravi89eba102022-09-13 21:04:37 -07002302#define WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_AP 0x0000000000000010ULL
Hai Shalom60840252021-02-19 19:02:11 -08002303/** Driver supports Beacon frame TX rate configuration (HE rates) */
2304#define WPA_DRIVER_FLAGS2_BEACON_RATE_HE 0x0000000000000020ULL
2305/** Driver supports Beacon protection only in client mode */
2306#define WPA_DRIVER_FLAGS2_BEACON_PROTECTION_CLIENT 0x0000000000000040ULL
2307/** Driver supports Operating Channel Validation */
2308#define WPA_DRIVER_FLAGS2_OCV 0x0000000000000080ULL
2309/** Driver expects user space implementation of SME in AP mode */
2310#define WPA_DRIVER_FLAGS2_AP_SME 0x0000000000000100ULL
Sunil Ravia04bd252022-05-02 22:54:18 -07002311/** Driver handles SA Query procedures in AP mode */
2312#define WPA_DRIVER_FLAGS2_SA_QUERY_OFFLOAD_AP 0x0000000000000200ULL
2313/** Driver supports background radar/CAC detection */
Sunil Ravi2a14cf12023-11-21 00:54:38 +00002314#define WPA_DRIVER_FLAGS2_RADAR_BACKGROUND 0x0000000000000400ULL
Sunil Ravi89eba102022-09-13 21:04:37 -07002315/** Driver supports secure LTF in STA mode */
2316#define WPA_DRIVER_FLAGS2_SEC_LTF_STA 0x0000000000000800ULL
2317/** Driver supports secure RTT measurement exchange in STA mode */
2318#define WPA_DRIVER_FLAGS2_SEC_RTT_STA 0x0000000000001000ULL
2319/**
2320 * Driver supports protection of range negotiation and measurement management
2321 * frames in STA mode
2322 */
2323#define WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_STA 0x0000000000002000ULL
Sunil Ravi77d572f2023-01-17 23:58:31 +00002324/** Driver supports MLO in station/AP mode */
2325#define WPA_DRIVER_FLAGS2_MLO 0x0000000000004000ULL
Sunil Ravi2a14cf12023-11-21 00:54:38 +00002326/** Driver supports minimal scan request probe content */
2327#define WPA_DRIVER_FLAGS2_SCAN_MIN_PREQ 0x0000000000008000ULL
2328/** Driver supports SAE authentication offload in STA mode */
2329#define WPA_DRIVER_FLAGS2_SAE_OFFLOAD_STA 0x0000000000010000ULL
2330/** Driver support AP_PSK authentication offload */
2331#define WPA_DRIVER_FLAGS2_4WAY_HANDSHAKE_AP_PSK 0x0000000000020000ULL
2332/** Driver supports OWE STA offload */
2333#define WPA_DRIVER_FLAGS2_OWE_OFFLOAD_STA 0x0000000000040000ULL
2334/** Driver supports OWE AP offload */
2335#define WPA_DRIVER_FLAGS2_OWE_OFFLOAD_AP 0x0000000000080000ULL
2336/** Driver support AP SAE authentication offload */
2337#define WPA_DRIVER_FLAGS2_SAE_OFFLOAD_AP 0x0000000000100000ULL
Sunil Ravi7f769292024-07-23 22:21:32 +00002338/** Driver supports TWT responder in HT and VHT modes */
2339#define WPA_DRIVER_FLAGS2_HT_VHT_TWT_RESPONDER 0x0000000000200000ULL
2340/** Driver supports RSN override elements */
2341#define WPA_DRIVER_FLAGS2_RSN_OVERRIDE_STA 0x0000000000400000ULL
Hai Shalomb755a2a2020-04-23 21:49:02 -07002342 u64 flags2;
2343
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002344#define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \
2345 (drv_flags & WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE)
2346
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002347 unsigned int wmm_ac_supported:1;
2348
2349 unsigned int mac_addr_rand_scan_supported:1;
2350 unsigned int mac_addr_rand_sched_scan_supported:1;
2351
2352 /** Maximum number of supported active probe SSIDs */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002353 int max_scan_ssids;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002354
2355 /** Maximum number of supported active probe SSIDs for sched_scan */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002356 int max_sched_scan_ssids;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002357
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08002358 /** Maximum number of supported scan plans for scheduled scan */
2359 unsigned int max_sched_scan_plans;
2360
2361 /** Maximum interval in a scan plan. In seconds */
2362 u32 max_sched_scan_plan_interval;
2363
2364 /** Maximum number of iterations in a single scan plan */
2365 u32 max_sched_scan_plan_iterations;
2366
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002367 /** Whether sched_scan (offloaded scanning) is supported */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002368 int sched_scan_supported;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002369
2370 /** Maximum number of supported match sets for sched_scan */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002371 int max_match_sets;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002372
2373 /**
2374 * max_remain_on_chan - Maximum remain-on-channel duration in msec
2375 */
2376 unsigned int max_remain_on_chan;
2377
2378 /**
2379 * max_stations - Maximum number of associated stations the driver
2380 * supports in AP mode
2381 */
2382 unsigned int max_stations;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002383
2384 /**
2385 * probe_resp_offloads - Bitmap of supported protocols by the driver
2386 * for Probe Response offloading.
2387 */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002388/** Driver Probe Response offloading support for WPS ver. 1 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002389#define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS 0x00000001
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002390/** Driver Probe Response offloading support for WPS ver. 2 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002391#define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS2 0x00000002
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002392/** Driver Probe Response offloading support for P2P */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002393#define WPA_DRIVER_PROBE_RESP_OFFLOAD_P2P 0x00000004
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002394/** Driver Probe Response offloading support for IEEE 802.11u (Interworking) */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002395#define WPA_DRIVER_PROBE_RESP_OFFLOAD_INTERWORKING 0x00000008
2396 unsigned int probe_resp_offloads;
Dmitry Shmidt444d5672013-04-01 13:08:44 -07002397
Dmitry Shmidt8bae4132013-06-06 11:25:10 -07002398 unsigned int max_acl_mac_addrs;
2399
Dmitry Shmidt444d5672013-04-01 13:08:44 -07002400 /**
Dmitry Shmidtc2ebb4b2013-07-24 12:57:51 -07002401 * Number of supported concurrent channels
2402 */
2403 unsigned int num_multichan_concurrent;
2404
2405 /**
Dmitry Shmidt444d5672013-04-01 13:08:44 -07002406 * extended_capa - extended capabilities in driver/device
2407 *
2408 * Must be allocated and freed by driver and the pointers must be
2409 * valid for the lifetime of the driver, i.e., freed in deinit()
2410 */
2411 const u8 *extended_capa, *extended_capa_mask;
2412 unsigned int extended_capa_len;
Dmitry Shmidtb58836e2014-04-29 14:35:56 -07002413
2414 struct wowlan_triggers wowlan_triggers;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002415
2416/** Driver adds the DS Params Set IE in Probe Request frames */
2417#define WPA_DRIVER_FLAGS_DS_PARAM_SET_IE_IN_PROBES 0x00000001
2418/** Driver adds the WFA TPC IE in Probe Request frames */
2419#define WPA_DRIVER_FLAGS_WFA_TPC_IE_IN_PROBES 0x00000002
2420/** Driver handles quiet period requests */
2421#define WPA_DRIVER_FLAGS_QUIET 0x00000004
2422/**
2423 * Driver is capable of inserting the current TX power value into the body of
2424 * transmitted frames.
2425 * Background: Some Action frames include a TPC Report IE. This IE contains a
2426 * TX power field, which has to be updated by lower layers. One such Action
2427 * frame is Link Measurement Report (part of RRM). Another is TPC Report (part
2428 * of spectrum management). Note that this insertion takes place at a fixed
2429 * offset, namely the 6th byte in the Action frame body.
2430 */
2431#define WPA_DRIVER_FLAGS_TX_POWER_INSERTION 0x00000008
Dmitry Shmidt849734c2016-05-27 09:59:01 -07002432/**
2433 * Driver supports RRM. With this support, the driver will accept to use RRM in
2434 * (Re)Association Request frames, without supporting quiet period.
2435 */
2436#define WPA_DRIVER_FLAGS_SUPPORT_RRM 0x00000010
2437
Dmitry Shmidt29333592017-01-09 12:27:11 -08002438/** Driver supports setting the scan dwell time */
2439#define WPA_DRIVER_FLAGS_SUPPORT_SET_SCAN_DWELL 0x00000020
2440/** Driver supports Beacon Report Measurement */
2441#define WPA_DRIVER_FLAGS_SUPPORT_BEACON_REPORT 0x00000040
2442
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002443 u32 rrm_flags;
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002444
2445 /* Driver concurrency capabilities */
2446 unsigned int conc_capab;
2447 /* Maximum number of concurrent channels on 2.4 GHz */
2448 unsigned int max_conc_chan_2_4;
2449 /* Maximum number of concurrent channels on 5 GHz */
2450 unsigned int max_conc_chan_5_0;
2451
2452 /* Maximum number of supported CSA counters */
2453 u16 max_csa_counters;
Sunil Ravi89eba102022-09-13 21:04:37 -07002454
2455 /* Maximum number of supported AKM suites in commands */
2456 unsigned int max_num_akms;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002457
2458 /* Maximum number of interfaces supported for MBSSID advertisement */
2459 unsigned int mbssid_max_interfaces;
2460 /* Maximum profile periodicity for enhanced MBSSID advertisement */
2461 unsigned int ema_max_periodicity;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002462};
2463
2464
2465struct hostapd_data;
2466
Sunil Ravi036cec52023-03-29 11:35:17 -07002467enum guard_interval {
2468 GUARD_INTERVAL_0_4 = 1,
2469 GUARD_INTERVAL_0_8 = 2,
2470 GUARD_INTERVAL_1_6 = 3,
2471 GUARD_INTERVAL_3_2 = 4,
2472};
2473
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002474#define STA_DRV_DATA_TX_MCS BIT(0)
2475#define STA_DRV_DATA_RX_MCS BIT(1)
2476#define STA_DRV_DATA_TX_VHT_MCS BIT(2)
2477#define STA_DRV_DATA_RX_VHT_MCS BIT(3)
2478#define STA_DRV_DATA_TX_VHT_NSS BIT(4)
2479#define STA_DRV_DATA_RX_VHT_NSS BIT(5)
2480#define STA_DRV_DATA_TX_SHORT_GI BIT(6)
2481#define STA_DRV_DATA_RX_SHORT_GI BIT(7)
Roshan Pius3a1667e2018-07-03 15:17:14 -07002482#define STA_DRV_DATA_LAST_ACK_RSSI BIT(8)
Hai Shalomc1a21442022-02-04 13:43:00 -08002483#define STA_DRV_DATA_CONN_TIME BIT(9)
Sunil Ravi77d572f2023-01-17 23:58:31 +00002484#define STA_DRV_DATA_TX_HE_MCS BIT(10)
2485#define STA_DRV_DATA_RX_HE_MCS BIT(11)
2486#define STA_DRV_DATA_TX_HE_NSS BIT(12)
2487#define STA_DRV_DATA_RX_HE_NSS BIT(13)
Sunil Ravi036cec52023-03-29 11:35:17 -07002488#define STA_DRV_DATA_TX_HE_DCM BIT(14)
2489#define STA_DRV_DATA_RX_HE_DCM BIT(15)
2490#define STA_DRV_DATA_TX_HE_GI BIT(16)
2491#define STA_DRV_DATA_RX_HE_GI BIT(17)
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002492
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002493struct hostap_sta_driver_data {
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002494 unsigned long rx_packets, tx_packets;
2495 unsigned long long rx_bytes, tx_bytes;
Hai Shalom81f62d82019-07-22 12:10:00 -07002496 unsigned long long rx_airtime, tx_airtime;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002497 unsigned long long beacons_count;
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002498 int bytes_64bit; /* whether 64-bit byte counters are supported */
Sunil Ravi77d572f2023-01-17 23:58:31 +00002499 unsigned long current_tx_rate; /* in kbps */
2500 unsigned long current_rx_rate; /* in kbps */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002501 unsigned long inactive_msec;
Hai Shalomc1a21442022-02-04 13:43:00 -08002502 unsigned long connected_sec;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002503 unsigned long flags; /* bitfield of STA_DRV_DATA_* */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002504 unsigned long num_ps_buf_frames;
2505 unsigned long tx_retry_failed;
2506 unsigned long tx_retry_count;
Roshan Pius3a1667e2018-07-03 15:17:14 -07002507 s8 last_ack_rssi;
Hai Shalom81f62d82019-07-22 12:10:00 -07002508 unsigned long backlog_packets;
2509 unsigned long backlog_bytes;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002510 unsigned long fcs_error_count;
2511 unsigned long beacon_loss_count;
2512 unsigned long expected_throughput;
2513 unsigned long rx_drop_misc;
2514 unsigned long rx_mpdus;
2515 int signal; /* dBm; or -WPA_INVALID_NOISE */
2516 u8 rx_hemcs;
2517 u8 tx_hemcs;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002518 u8 rx_vhtmcs;
2519 u8 tx_vhtmcs;
2520 u8 rx_mcs;
2521 u8 tx_mcs;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002522 u8 rx_he_nss;
2523 u8 tx_he_nss;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002524 u8 rx_vht_nss;
2525 u8 tx_vht_nss;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002526 s8 avg_signal; /* dBm */
2527 s8 avg_beacon_signal; /* dBm */
2528 s8 avg_ack_signal; /* dBm */
Sunil Ravi036cec52023-03-29 11:35:17 -07002529 enum guard_interval rx_guard_interval, tx_guard_interval;
2530 u8 rx_dcm, tx_dcm;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002531};
2532
2533struct hostapd_sta_add_params {
2534 const u8 *addr;
2535 u16 aid;
2536 u16 capability;
2537 const u8 *supp_rates;
2538 size_t supp_rates_len;
2539 u16 listen_interval;
2540 const struct ieee80211_ht_capabilities *ht_capabilities;
Dmitry Shmidta54fa5f2013-01-15 13:53:35 -08002541 const struct ieee80211_vht_capabilities *vht_capabilities;
Dmitry Shmidtbd14a572014-02-18 10:33:49 -08002542 int vht_opmode_enabled;
2543 u8 vht_opmode;
Hai Shalom81f62d82019-07-22 12:10:00 -07002544 const struct ieee80211_he_capabilities *he_capab;
2545 size_t he_capab_len;
Hai Shalom4fbc08f2020-05-18 12:37:00 -07002546 const struct ieee80211_he_6ghz_band_cap *he_6ghz_capab;
Sunil Ravia04bd252022-05-02 22:54:18 -07002547 const struct ieee80211_eht_capabilities *eht_capab;
2548 size_t eht_capab_len;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002549 u32 flags; /* bitmask of WPA_STA_* flags */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002550 u32 flags_mask; /* unset bits in flags */
2551#ifdef CONFIG_MESH
2552 enum mesh_plink_state plink_state;
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07002553 u16 peer_aid;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002554#endif /* CONFIG_MESH */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002555 int set; /* Set STA parameters instead of add */
2556 u8 qosinfo;
Dmitry Shmidtf8623282013-02-20 14:34:59 -08002557 const u8 *ext_capab;
2558 size_t ext_capab_len;
Dmitry Shmidt344abd32014-01-14 13:17:00 -08002559 const u8 *supp_channels;
2560 size_t supp_channels_len;
2561 const u8 *supp_oper_classes;
2562 size_t supp_oper_classes_len;
Dmitry Shmidt849734c2016-05-27 09:59:01 -07002563 int support_p2p_ps;
Sunil Ravi036cec52023-03-29 11:35:17 -07002564
2565 bool mld_link_sta;
2566 s8 mld_link_id;
2567 const u8 *mld_link_addr;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002568};
2569
Dmitry Shmidt8bae4132013-06-06 11:25:10 -07002570struct mac_address {
2571 u8 addr[ETH_ALEN];
2572};
2573
2574struct hostapd_acl_params {
2575 u8 acl_policy;
2576 unsigned int num_mac_acl;
2577 struct mac_address mac_acl[0];
2578};
2579
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002580struct wpa_init_params {
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002581 void *global_priv;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002582 const u8 *bssid;
2583 const char *ifname;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002584 const char *driver_params;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002585 int use_pae_group_addr;
2586 char **bridge;
2587 size_t num_bridge;
2588
2589 u8 *own_addr; /* buffer for writing own MAC address */
2590};
2591
2592
2593struct wpa_bss_params {
2594 /** Interface name (for multi-SSID/VLAN support) */
2595 const char *ifname;
2596 /** Whether IEEE 802.1X or WPA/WPA2 is enabled */
2597 int enabled;
2598
2599 int wpa;
2600 int ieee802_1x;
2601 int wpa_group;
2602 int wpa_pairwise;
2603 int wpa_key_mgmt;
2604 int rsn_preauth;
2605 enum mfp_options ieee80211w;
2606};
2607
2608#define WPA_STA_AUTHORIZED BIT(0)
2609#define WPA_STA_WMM BIT(1)
2610#define WPA_STA_SHORT_PREAMBLE BIT(2)
2611#define WPA_STA_MFP BIT(3)
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002612#define WPA_STA_TDLS_PEER BIT(4)
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002613#define WPA_STA_AUTHENTICATED BIT(5)
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002614#define WPA_STA_ASSOCIATED BIT(6)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002615
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002616enum tdls_oper {
2617 TDLS_DISCOVERY_REQ,
2618 TDLS_SETUP,
2619 TDLS_TEARDOWN,
2620 TDLS_ENABLE_LINK,
2621 TDLS_DISABLE_LINK,
2622 TDLS_ENABLE,
2623 TDLS_DISABLE
2624};
2625
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07002626enum wnm_oper {
2627 WNM_SLEEP_ENTER_CONFIRM,
2628 WNM_SLEEP_ENTER_FAIL,
2629 WNM_SLEEP_EXIT_CONFIRM,
2630 WNM_SLEEP_EXIT_FAIL,
2631 WNM_SLEEP_TFS_REQ_IE_ADD, /* STA requests driver to add TFS req IE */
2632 WNM_SLEEP_TFS_REQ_IE_NONE, /* STA requests empty TFS req IE */
2633 WNM_SLEEP_TFS_REQ_IE_SET, /* AP requests driver to set TFS req IE for
2634 * a STA */
2635 WNM_SLEEP_TFS_RESP_IE_ADD, /* AP requests driver to add TFS resp IE
2636 * for a STA */
2637 WNM_SLEEP_TFS_RESP_IE_NONE, /* AP requests empty TFS resp IE */
2638 WNM_SLEEP_TFS_RESP_IE_SET, /* AP requests driver to set TFS resp IE
2639 * for a STA */
2640 WNM_SLEEP_TFS_IE_DEL /* AP delete the TFS IE */
2641};
2642
Roshan Pius3a1667e2018-07-03 15:17:14 -07002643/* enum smps_mode - SMPS mode definitions */
2644enum smps_mode {
2645 SMPS_AUTOMATIC,
2646 SMPS_OFF,
2647 SMPS_DYNAMIC,
2648 SMPS_STATIC,
2649
2650 /* Keep last */
2651 SMPS_INVALID,
2652};
2653
Hai Shalom74f70d42019-02-11 14:42:39 -08002654#define WPA_INVALID_NOISE 9999
Dmitry Shmidt34af3062013-07-11 10:46:32 -07002655
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002656/**
2657 * struct wpa_signal_info - Information about channel signal quality
Hai Shalom74f70d42019-02-11 14:42:39 -08002658 * @frequency: control frequency
2659 * @above_threshold: true if the above threshold was crossed
2660 * (relevant for a CQM event)
Sunil Ravi77d572f2023-01-17 23:58:31 +00002661 * @data: STA information
Hai Shalom74f70d42019-02-11 14:42:39 -08002662 * @current_noise: %WPA_INVALID_NOISE if not supported
Hai Shalom74f70d42019-02-11 14:42:39 -08002663 * @chanwidth: channel width
2664 * @center_frq1: center frequency for the first segment
2665 * @center_frq2: center frequency for the second segment (if relevant)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002666 */
2667struct wpa_signal_info {
2668 u32 frequency;
2669 int above_threshold;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002670 struct hostap_sta_driver_data data;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002671 int current_noise;
Dmitry Shmidt34af3062013-07-11 10:46:32 -07002672 enum chan_width chanwidth;
2673 int center_frq1;
2674 int center_frq2;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002675};
2676
Sunil Ravi89eba102022-09-13 21:04:37 -07002677struct wpa_mlo_signal_info {
2678 u16 valid_links;
2679 struct wpa_signal_info links[MAX_NUM_MLD_LINKS];
2680};
2681
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002682/**
Hai Shalom74f70d42019-02-11 14:42:39 -08002683 * struct wpa_channel_info - Information about the current channel
2684 * @frequency: Center frequency of the primary 20 MHz channel
2685 * @chanwidth: Width of the current operating channel
2686 * @sec_channel: Location of the secondary 20 MHz channel (either +1 or -1).
2687 * This field is only filled in when using a 40 MHz channel.
2688 * @center_frq1: Center frequency of frequency segment 0
2689 * @center_frq2: Center frequency of frequency segment 1 (for 80+80 channels)
2690 * @seg1_idx: Frequency segment 1 index when using a 80+80 channel. This is
2691 * derived from center_frq2 for convenience.
2692 */
2693struct wpa_channel_info {
2694 u32 frequency;
2695 enum chan_width chanwidth;
2696 int sec_channel;
2697 int center_frq1;
2698 int center_frq2;
2699 u8 seg1_idx;
2700};
2701
2702/**
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002703 * struct beacon_data - Beacon data
2704 * @head: Head portion of Beacon frame (before TIM IE)
2705 * @tail: Tail portion of Beacon frame (after TIM IE)
2706 * @beacon_ies: Extra information element(s) to add into Beacon frames or %NULL
2707 * @proberesp_ies: Extra information element(s) to add into Probe Response
2708 * frames or %NULL
2709 * @assocresp_ies: Extra information element(s) to add into (Re)Association
2710 * Response frames or %NULL
2711 * @probe_resp: Probe Response frame template
2712 * @head_len: Length of @head
2713 * @tail_len: Length of @tail
2714 * @beacon_ies_len: Length of beacon_ies in octets
2715 * @proberesp_ies_len: Length of proberesp_ies in octets
2716 * @proberesp_ies_len: Length of proberesp_ies in octets
2717 * @probe_resp_len: Length of probe response template (@probe_resp)
2718 */
2719struct beacon_data {
2720 u8 *head, *tail;
2721 u8 *beacon_ies;
2722 u8 *proberesp_ies;
2723 u8 *assocresp_ies;
2724 u8 *probe_resp;
2725
2726 size_t head_len, tail_len;
2727 size_t beacon_ies_len;
2728 size_t proberesp_ies_len;
2729 size_t assocresp_ies_len;
2730 size_t probe_resp_len;
2731};
2732
2733/**
2734 * struct csa_settings - Settings for channel switch command
2735 * @cs_count: Count in Beacon frames (TBTT) to perform the switch
2736 * @block_tx: 1 - block transmission for CSA period
2737 * @freq_params: Next channel frequency parameter
2738 * @beacon_csa: Beacon/probe resp/asooc resp info for CSA period
2739 * @beacon_after: Next beacon/probe resp/asooc resp info
2740 * @counter_offset_beacon: Offset to the count field in beacon's tail
2741 * @counter_offset_presp: Offset to the count field in probe resp.
Sunil Ravi036cec52023-03-29 11:35:17 -07002742 * @punct_bitmap - Preamble puncturing bitmap
Sunil Ravib0ac25f2024-07-12 01:42:03 +00002743 * @link_id: Link ID to determine the link for MLD; -1 for non-MLD
Sunil Ravi7f769292024-07-23 22:21:32 +00002744 * @ubpr: Unsolicited broadcast Probe Response frame data
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002745 */
2746struct csa_settings {
2747 u8 cs_count;
2748 u8 block_tx;
2749
2750 struct hostapd_freq_params freq_params;
2751 struct beacon_data beacon_csa;
2752 struct beacon_data beacon_after;
2753
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002754 u16 counter_offset_beacon[2];
2755 u16 counter_offset_presp[2];
Sunil Ravi036cec52023-03-29 11:35:17 -07002756
2757 u16 punct_bitmap;
Sunil Ravib0ac25f2024-07-12 01:42:03 +00002758 int link_id;
Sunil Ravi7f769292024-07-23 22:21:32 +00002759
2760 struct unsol_bcast_probe_resp ubpr;
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002761};
2762
Sunil Ravia04bd252022-05-02 22:54:18 -07002763/**
2764 * struct cca_settings - Settings for color switch command
2765 * @cca_count: Count in Beacon frames (TBTT) to perform the switch
2766 * @cca_color: The new color that we are switching to
2767 * @beacon_cca: Beacon/Probe Response/(Re)Association Response frame info for
2768 * color switch period
2769 * @beacon_after: Next Beacon/Probe Response/(Re)Association Response frame info
2770 * @counter_offset_beacon: Offset to the count field in Beacon frame tail
2771 * @counter_offset_presp: Offset to the count field in Probe Response frame
Sunil Ravi7f769292024-07-23 22:21:32 +00002772 * @ubpr: Unsolicited broadcast Probe Response frame data
2773 * @link_id: If >= 0 indicates the link of the AP MLD to configure
Sunil Ravia04bd252022-05-02 22:54:18 -07002774 */
2775struct cca_settings {
2776 u8 cca_count;
2777 u8 cca_color;
2778
2779 struct beacon_data beacon_cca;
2780 struct beacon_data beacon_after;
2781
2782 u16 counter_offset_beacon;
2783 u16 counter_offset_presp;
Sunil Ravi7f769292024-07-23 22:21:32 +00002784
2785 struct unsol_bcast_probe_resp ubpr;
2786
2787 int link_id;
Sunil Ravia04bd252022-05-02 22:54:18 -07002788};
2789
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07002790/* TDLS peer capabilities for send_tdls_mgmt() */
2791enum tdls_peer_capability {
2792 TDLS_PEER_HT = BIT(0),
2793 TDLS_PEER_VHT = BIT(1),
2794 TDLS_PEER_WMM = BIT(2),
Hai Shalomc1a21442022-02-04 13:43:00 -08002795 TDLS_PEER_HE = BIT(3),
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07002796};
2797
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002798/* valid info in the wmm_params struct */
2799enum wmm_params_valid_info {
2800 WMM_PARAMS_UAPSD_QUEUES_INFO = BIT(0),
2801};
2802
2803/**
2804 * struct wmm_params - WMM parameterss configured for this association
2805 * @info_bitmap: Bitmap of valid wmm_params info; indicates what fields
2806 * of the struct contain valid information.
2807 * @uapsd_queues: Bitmap of ACs configured for uapsd (valid only if
2808 * %WMM_PARAMS_UAPSD_QUEUES_INFO is set)
2809 */
2810struct wmm_params {
2811 u8 info_bitmap;
2812 u8 uapsd_queues;
2813};
2814
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07002815#ifdef CONFIG_MACSEC
2816struct macsec_init_params {
Hai Shalome21d4e82020-04-29 16:34:06 -07002817 bool always_include_sci;
2818 bool use_es;
2819 bool use_scb;
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07002820};
2821#endif /* CONFIG_MACSEC */
2822
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002823enum drv_br_port_attr {
2824 DRV_BR_PORT_ATTR_PROXYARP,
2825 DRV_BR_PORT_ATTR_HAIRPIN_MODE,
Sunil Ravi036cec52023-03-29 11:35:17 -07002826 DRV_BR_PORT_ATTR_MCAST2UCAST,
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002827};
2828
2829enum drv_br_net_param {
2830 DRV_BR_NET_PARAM_GARP_ACCEPT,
Dmitry Shmidt83474442015-04-15 13:47:09 -07002831 DRV_BR_MULTICAST_SNOOPING,
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002832};
2833
2834struct drv_acs_params {
2835 /* Selected mode (HOSTAPD_MODE_*) */
2836 enum hostapd_hw_mode hw_mode;
2837
2838 /* Indicates whether HT is enabled */
2839 int ht_enabled;
2840
2841 /* Indicates whether HT40 is enabled */
2842 int ht40_enabled;
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07002843
2844 /* Indicates whether VHT is enabled */
2845 int vht_enabled;
2846
2847 /* Configured ACS channel width */
2848 u16 ch_width;
2849
Ahmed ElArabawy0ff61c52019-12-26 12:38:39 -08002850 /* ACS frequency list info */
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002851 const int *freq_list;
Hai Shalomfdcde762020-04-02 11:19:20 -07002852
2853 /* Indicates whether EDMG is enabled */
2854 int edmg_enabled;
Sunil Ravia04bd252022-05-02 22:54:18 -07002855
2856 /* Indicates whether EHT is enabled */
2857 bool eht_enabled;
Sunil Ravib0ac25f2024-07-12 01:42:03 +00002858
2859 /* Indicates the link if MLO case; -1 otherwise */
2860 int link_id;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002861};
2862
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002863struct wpa_bss_trans_info {
2864 u8 mbo_transition_reason;
2865 u8 n_candidates;
2866 u8 *bssid;
2867};
2868
2869struct wpa_bss_candidate_info {
2870 u8 num;
2871 struct candidate_list {
2872 u8 bssid[ETH_ALEN];
2873 u8 is_accept;
2874 u32 reject_reason;
2875 } *candidates;
2876};
2877
2878struct wpa_pmkid_params {
2879 const u8 *bssid;
2880 const u8 *ssid;
2881 size_t ssid_len;
2882 const u8 *fils_cache_id;
2883 const u8 *pmkid;
2884 const u8 *pmk;
2885 size_t pmk_len;
Hai Shalomfdcde762020-04-02 11:19:20 -07002886 u32 pmk_lifetime;
2887 u8 pmk_reauth_threshold;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002888};
2889
2890/* Mask used to specify which connection parameters have to be updated */
2891enum wpa_drv_update_connect_params_mask {
2892 WPA_DRV_UPDATE_ASSOC_IES = BIT(0),
2893 WPA_DRV_UPDATE_FILS_ERP_INFO = BIT(1),
2894 WPA_DRV_UPDATE_AUTH_TYPE = BIT(2),
Winnie Chen4138eec2022-11-10 16:32:53 +08002895#if defined(CONFIG_DRIVER_NL80211_BRCM) || defined(CONFIG_DRIVER_NL80211_SYNA)
Vinayak Yadawade62409f2022-01-20 12:32:07 +05302896 WPA_DRV_UPDATE_TD_POLICY = BIT(3),
Winnie Chen4138eec2022-11-10 16:32:53 +08002897#endif /* CONFIG_DRIVER_NL80211_BRCM || CONFIG_DRIVER_NL80211_SYNA */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002898};
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07002899
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002900/**
Roshan Pius3a1667e2018-07-03 15:17:14 -07002901 * struct external_auth - External authentication trigger parameters
2902 *
2903 * These are used across the external authentication request and event
2904 * interfaces.
2905 * @action: Action type / trigger for external authentication. Only significant
2906 * for the event interface.
2907 * @bssid: BSSID of the peer with which the authentication has to happen. Used
2908 * by both the request and event interface.
2909 * @ssid: SSID of the AP. Used by both the request and event interface.
2910 * @ssid_len: SSID length in octets.
2911 * @key_mgmt_suite: AKM suite of the respective authentication. Optional for
2912 * the request interface.
2913 * @status: Status code, %WLAN_STATUS_SUCCESS for successful authentication,
2914 * use %WLAN_STATUS_UNSPECIFIED_FAILURE if wpa_supplicant cannot give
2915 * the real status code for failures. Used only for the request interface
2916 * from user space to the driver.
Hai Shalom5f92bc92019-04-18 11:54:11 -07002917 * @pmkid: Generated PMKID as part of external auth exchange (e.g., SAE).
Sunil Ravi036cec52023-03-29 11:35:17 -07002918 * @mld_addr: AP's MLD address or %NULL if MLO is not used
Roshan Pius3a1667e2018-07-03 15:17:14 -07002919 */
2920struct external_auth {
2921 enum {
2922 EXT_AUTH_START,
2923 EXT_AUTH_ABORT,
2924 } action;
Hai Shalom5f92bc92019-04-18 11:54:11 -07002925 const u8 *bssid;
2926 const u8 *ssid;
Roshan Pius3a1667e2018-07-03 15:17:14 -07002927 size_t ssid_len;
2928 unsigned int key_mgmt_suite;
2929 u16 status;
Hai Shalom5f92bc92019-04-18 11:54:11 -07002930 const u8 *pmkid;
Sunil Ravi036cec52023-03-29 11:35:17 -07002931 const u8 *mld_addr;
Roshan Pius3a1667e2018-07-03 15:17:14 -07002932};
2933
Sunil Ravi89eba102022-09-13 21:04:37 -07002934#define WPAS_MAX_PASN_PEERS 10
2935
2936enum pasn_status {
2937 PASN_STATUS_SUCCESS = 0,
2938 PASN_STATUS_FAILURE = 1,
2939};
2940
2941/**
2942 * struct pasn_peer - PASN peer parameters
2943 *
2944 * Used to process the PASN authentication event from the driver to
2945 * userspace and to send a response back.
2946 * @own_addr: Own MAC address specified by the driver to use for PASN
2947 * handshake.
2948 * @peer_addr: MAC address of the peer with which PASN authentication is to be
2949 * performed.
2950 * @network_id: Unique id for the network.
2951 * This identifier is used as a unique identifier for each network
2952 * block when using the control interface. Each network is allocated an
2953 * id when it is being created, either when reading the configuration
2954 * file or when a new network is added through the control interface.
2955 * @akmp: Authentication key management protocol type supported.
2956 * @cipher: Cipher suite.
2957 * @group: Finite cyclic group. Default group used is 19 (ECC).
2958 * @ltf_keyseed_required: Indicates whether LTF keyseed generation is required
2959 * @status: PASN response status, %PASN_STATUS_SUCCESS for successful
2960 * authentication, use %PASN_STATUS_FAILURE if PASN authentication
2961 * fails or if wpa_supplicant fails to set the security ranging context to
2962 * the driver
2963 */
2964struct pasn_peer {
2965 u8 own_addr[ETH_ALEN];
2966 u8 peer_addr[ETH_ALEN];
2967 int network_id;
2968 int akmp;
2969 int cipher;
2970 int group;
2971 bool ltf_keyseed_required;
2972 enum pasn_status status;
2973};
2974
2975/**
2976 * struct pasn_auth - PASN authentication trigger parameters
2977 *
2978 * These are used across the PASN authentication event from the driver to
2979 * userspace and to send a response to it.
2980 * @action: Action type. Only significant for the event interface.
2981 * @num_peers: The number of peers for which the PASN handshake is requested
2982 * for.
2983 * @peer: Holds the peer details.
2984 */
2985struct pasn_auth {
2986 enum {
2987 PASN_ACTION_AUTH,
2988 PASN_ACTION_DELETE_SECURE_RANGING_CONTEXT,
2989 } action;
2990 unsigned int num_peers;
2991 struct pasn_peer peer[WPAS_MAX_PASN_PEERS];
2992};
2993
2994/**
2995 * struct secure_ranging_params - Parameters required to set secure ranging
2996 * context for a peer.
2997 *
2998 * @action: Add or delete a security context to the driver.
2999 * @own_addr: Own MAC address used during key derivation.
3000 * @peer_addr: Address of the peer device.
3001 * @cipher: Cipher suite.
3002 * @tk_len: Length of temporal key.
3003 * @tk: Temporal key buffer.
3004 * @ltf_keyseed_len: Length of LTF keyseed.
3005 * @ltf_keyeed: LTF keyseed buffer.
3006 */
3007struct secure_ranging_params {
3008 u32 action;
3009 const u8 *own_addr;
3010 const u8 *peer_addr;
3011 u32 cipher;
3012 u8 tk_len;
3013 const u8 *tk;
3014 u8 ltf_keyseed_len;
3015 const u8 *ltf_keyseed;
3016};
3017
Hai Shalom60840252021-02-19 19:02:11 -08003018/* enum nested_attr - Used to specify if subcommand uses nested attributes */
3019enum nested_attr {
3020 NESTED_ATTR_NOT_USED = 0,
3021 NESTED_ATTR_USED = 1,
3022 NESTED_ATTR_UNSPECIFIED = 2,
3023};
3024
Sunil8cd6f4d2022-06-28 18:40:46 +00003025/* Preferred channel list information */
3026
3027/* GO role */
3028#define WEIGHTED_PCL_GO BIT(0)
3029/* P2P Client role */
3030#define WEIGHTED_PCL_CLI BIT(1)
3031/* Must be considered for operating channel */
3032#define WEIGHTED_PCL_MUST_CONSIDER BIT(2)
3033/* Should be excluded in GO negotiation */
3034#define WEIGHTED_PCL_EXCLUDE BIT(3)
3035
3036/* Preferred channel list with weight */
3037struct weighted_pcl {
3038 u32 freq; /* MHz */
3039 u8 weight;
3040 u32 flag; /* bitmap for WEIGHTED_PCL_* */
3041};
3042
Sunil Ravi89eba102022-09-13 21:04:37 -07003043struct driver_sta_mlo_info {
Sunil Ravi640215c2023-06-28 23:08:09 +00003044 bool default_map;
Sunil Ravi77d572f2023-01-17 23:58:31 +00003045 u16 req_links; /* bitmap of requested link IDs */
3046 u16 valid_links; /* bitmap of accepted link IDs */
3047 u8 assoc_link_id;
Sunil Ravi89eba102022-09-13 21:04:37 -07003048 u8 ap_mld_addr[ETH_ALEN];
3049 struct {
3050 u8 addr[ETH_ALEN];
3051 u8 bssid[ETH_ALEN];
3052 unsigned int freq;
Sunil Ravi640215c2023-06-28 23:08:09 +00003053 struct t2lm_mapping t2lmap;
Sunil Ravi89eba102022-09-13 21:04:37 -07003054 } links[MAX_NUM_MLD_LINKS];
3055};
3056
Roshan Pius3a1667e2018-07-03 15:17:14 -07003057/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003058 * struct wpa_driver_ops - Driver interface API definition
3059 *
3060 * This structure defines the API that each driver interface needs to implement
3061 * for core wpa_supplicant code. All driver specific functionality is captured
3062 * in this wrapper.
3063 */
3064struct wpa_driver_ops {
3065 /** Name of the driver interface */
3066 const char *name;
3067 /** One line description of the driver interface */
3068 const char *desc;
3069
3070 /**
3071 * get_bssid - Get the current BSSID
3072 * @priv: private driver interface data
3073 * @bssid: buffer for BSSID (ETH_ALEN = 6 bytes)
3074 *
3075 * Returns: 0 on success, -1 on failure
3076 *
3077 * Query kernel driver for the current BSSID and copy it to bssid.
3078 * Setting bssid to 00:00:00:00:00:00 is recommended if the STA is not
3079 * associated.
3080 */
3081 int (*get_bssid)(void *priv, u8 *bssid);
3082
3083 /**
3084 * get_ssid - Get the current SSID
3085 * @priv: private driver interface data
3086 * @ssid: buffer for SSID (at least 32 bytes)
3087 *
3088 * Returns: Length of the SSID on success, -1 on failure
3089 *
3090 * Query kernel driver for the current SSID and copy it to ssid.
3091 * Returning zero is recommended if the STA is not associated.
3092 *
3093 * Note: SSID is an array of octets, i.e., it is not nul terminated and
3094 * can, at least in theory, contain control characters (including nul)
3095 * and as such, should be processed as binary data, not a printable
3096 * string.
3097 */
3098 int (*get_ssid)(void *priv, u8 *ssid);
3099
3100 /**
3101 * set_key - Configure encryption key
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003102 * @priv: private driver interface data
Hai Shalomfdcde762020-04-02 11:19:20 -07003103 * @params: Key parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003104 * Returns: 0 on success, -1 on failure
3105 *
3106 * Configure the given key for the kernel driver. If the driver
3107 * supports separate individual keys (4 default keys + 1 individual),
3108 * addr can be used to determine whether the key is default or
3109 * individual. If only 4 keys are supported, the default key with key
3110 * index 0 is used as the individual key. STA must be configured to use
3111 * it as the default Tx key (set_tx is set) and accept Rx for all the
3112 * key indexes. In most cases, WPA uses only key indexes 1 and 2 for
3113 * broadcast keys, so key index 0 is available for this kind of
3114 * configuration.
3115 *
3116 * Please note that TKIP keys include separate TX and RX MIC keys and
3117 * some drivers may expect them in different order than wpa_supplicant
3118 * is using. If the TX/RX keys are swapped, all TKIP encrypted packets
3119 * will trigger Michael MIC errors. This can be fixed by changing the
Sunil Ravia04bd252022-05-02 22:54:18 -07003120 * order of MIC keys by swapping the bytes 16..23 and 24..31 of the key
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003121 * in driver_*.c set_key() implementation, see driver_ndis.c for an
3122 * example on how this can be done.
3123 */
Hai Shalomfdcde762020-04-02 11:19:20 -07003124 int (*set_key)(void *priv, struct wpa_driver_set_key_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003125
3126 /**
3127 * init - Initialize driver interface
3128 * @ctx: context to be used when calling wpa_supplicant functions,
3129 * e.g., wpa_supplicant_event()
3130 * @ifname: interface name, e.g., wlan0
3131 *
3132 * Returns: Pointer to private data, %NULL on failure
3133 *
3134 * Initialize driver interface, including event processing for kernel
3135 * driver events (e.g., associated, scan results, Michael MIC failure).
3136 * This function can allocate a private configuration data area for
3137 * @ctx, file descriptor, interface name, etc. information that may be
3138 * needed in future driver operations. If this is not used, non-NULL
3139 * value will need to be returned because %NULL is used to indicate
3140 * failure. The returned value will be used as 'void *priv' data for
3141 * all other driver_ops functions.
3142 *
3143 * The main event loop (eloop.c) of wpa_supplicant can be used to
3144 * register callback for read sockets (eloop_register_read_sock()).
3145 *
3146 * See below for more information about events and
3147 * wpa_supplicant_event() function.
3148 */
3149 void * (*init)(void *ctx, const char *ifname);
3150
3151 /**
3152 * deinit - Deinitialize driver interface
3153 * @priv: private driver interface data from init()
3154 *
3155 * Shut down driver interface and processing of driver events. Free
3156 * private data buffer if one was allocated in init() handler.
3157 */
3158 void (*deinit)(void *priv);
3159
3160 /**
3161 * set_param - Set driver configuration parameters
3162 * @priv: private driver interface data from init()
3163 * @param: driver specific configuration parameters
3164 *
3165 * Returns: 0 on success, -1 on failure
3166 *
3167 * Optional handler for notifying driver interface about configuration
3168 * parameters (driver_param).
3169 */
3170 int (*set_param)(void *priv, const char *param);
3171
3172 /**
3173 * set_countermeasures - Enable/disable TKIP countermeasures
3174 * @priv: private driver interface data
3175 * @enabled: 1 = countermeasures enabled, 0 = disabled
3176 *
3177 * Returns: 0 on success, -1 on failure
3178 *
3179 * Configure TKIP countermeasures. When these are enabled, the driver
3180 * should drop all received and queued frames that are using TKIP.
3181 */
3182 int (*set_countermeasures)(void *priv, int enabled);
3183
3184 /**
3185 * deauthenticate - Request driver to deauthenticate
3186 * @priv: private driver interface data
3187 * @addr: peer address (BSSID of the AP)
3188 * @reason_code: 16-bit reason code to be sent in the deauthentication
3189 * frame
3190 *
3191 * Returns: 0 on success, -1 on failure
3192 */
Hai Shalom81f62d82019-07-22 12:10:00 -07003193 int (*deauthenticate)(void *priv, const u8 *addr, u16 reason_code);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003194
3195 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003196 * associate - Request driver to associate
3197 * @priv: private driver interface data
3198 * @params: association parameters
3199 *
3200 * Returns: 0 on success, -1 on failure
3201 */
3202 int (*associate)(void *priv,
3203 struct wpa_driver_associate_params *params);
3204
3205 /**
3206 * add_pmkid - Add PMKSA cache entry to the driver
3207 * @priv: private driver interface data
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003208 * @params: PMKSA parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003209 *
3210 * Returns: 0 on success, -1 on failure
3211 *
3212 * This function is called when a new PMK is received, as a result of
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003213 * either normal authentication or RSN pre-authentication. The PMKSA
3214 * parameters are either a set of bssid, pmkid, and pmk; or a set of
3215 * ssid, fils_cache_id, pmkid, and pmk.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003216 *
3217 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
3218 * associate(), add_pmkid() can be used to add new PMKSA cache entries
3219 * in the driver. If the driver uses wpa_ie from wpa_supplicant, this
3220 * driver_ops function does not need to be implemented. Likewise, if
3221 * the driver does not support WPA, this function is not needed.
3222 */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003223 int (*add_pmkid)(void *priv, struct wpa_pmkid_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003224
3225 /**
3226 * remove_pmkid - Remove PMKSA cache entry to the driver
3227 * @priv: private driver interface data
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003228 * @params: PMKSA parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003229 *
3230 * Returns: 0 on success, -1 on failure
3231 *
3232 * This function is called when the supplicant drops a PMKSA cache
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003233 * entry for any reason. The PMKSA parameters are either a set of
3234 * bssid and pmkid; or a set of ssid, fils_cache_id, and pmkid.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003235 *
3236 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
3237 * associate(), remove_pmkid() can be used to synchronize PMKSA caches
3238 * between the driver and wpa_supplicant. If the driver uses wpa_ie
3239 * from wpa_supplicant, this driver_ops function does not need to be
3240 * implemented. Likewise, if the driver does not support WPA, this
3241 * function is not needed.
3242 */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003243 int (*remove_pmkid)(void *priv, struct wpa_pmkid_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003244
3245 /**
3246 * flush_pmkid - Flush PMKSA cache
3247 * @priv: private driver interface data
3248 *
3249 * Returns: 0 on success, -1 on failure
3250 *
3251 * This function is called when the supplicant drops all PMKSA cache
3252 * entries for any reason.
3253 *
3254 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
3255 * associate(), remove_pmkid() can be used to synchronize PMKSA caches
3256 * between the driver and wpa_supplicant. If the driver uses wpa_ie
3257 * from wpa_supplicant, this driver_ops function does not need to be
3258 * implemented. Likewise, if the driver does not support WPA, this
3259 * function is not needed.
3260 */
3261 int (*flush_pmkid)(void *priv);
3262
3263 /**
3264 * get_capa - Get driver capabilities
3265 * @priv: private driver interface data
3266 *
3267 * Returns: 0 on success, -1 on failure
3268 *
3269 * Get driver/firmware/hardware capabilities.
3270 */
3271 int (*get_capa)(void *priv, struct wpa_driver_capa *capa);
3272
3273 /**
3274 * poll - Poll driver for association information
3275 * @priv: private driver interface data
3276 *
Sunil Ravi77d572f2023-01-17 23:58:31 +00003277 * This is an optional callback that can be used when the driver does
3278 * not provide event mechanism for association events. This is called
3279 * when receiving WPA/RSN EAPOL-Key messages that require association
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003280 * information. The driver interface is supposed to generate associnfo
3281 * event before returning from this callback function. In addition, the
3282 * driver interface should generate an association event after having
3283 * sent out associnfo.
3284 */
3285 void (*poll)(void *priv);
3286
3287 /**
Dmitry Shmidte4663042016-04-04 10:07:49 -07003288 * get_ifindex - Get interface index
3289 * @priv: private driver interface data
3290 *
3291 * Returns: Interface index
3292 */
3293 unsigned int (*get_ifindex)(void *priv);
3294
3295 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003296 * get_ifname - Get interface name
3297 * @priv: private driver interface data
3298 *
3299 * Returns: Pointer to the interface name. This can differ from the
3300 * interface name used in init() call. Init() is called first.
3301 *
3302 * This optional function can be used to allow the driver interface to
3303 * replace the interface name with something else, e.g., based on an
3304 * interface mapping from a more descriptive name.
3305 */
3306 const char * (*get_ifname)(void *priv);
3307
3308 /**
3309 * get_mac_addr - Get own MAC address
3310 * @priv: private driver interface data
3311 *
3312 * Returns: Pointer to own MAC address or %NULL on failure
3313 *
3314 * This optional function can be used to get the own MAC address of the
3315 * device from the driver interface code. This is only needed if the
3316 * l2_packet implementation for the OS does not provide easy access to
3317 * a MAC address. */
3318 const u8 * (*get_mac_addr)(void *priv);
3319
3320 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003321 * set_operstate - Sets device operating state to DORMANT or UP
3322 * @priv: private driver interface data
3323 * @state: 0 = dormant, 1 = up
3324 * Returns: 0 on success, -1 on failure
3325 *
3326 * This is an optional function that can be used on operating systems
3327 * that support a concept of controlling network device state from user
3328 * space applications. This function, if set, gets called with
3329 * state = 1 when authentication has been completed and with state = 0
3330 * when connection is lost.
3331 */
3332 int (*set_operstate)(void *priv, int state);
3333
3334 /**
3335 * mlme_setprotection - MLME-SETPROTECTION.request primitive
3336 * @priv: Private driver interface data
3337 * @addr: Address of the station for which to set protection (may be
3338 * %NULL for group keys)
3339 * @protect_type: MLME_SETPROTECTION_PROTECT_TYPE_*
3340 * @key_type: MLME_SETPROTECTION_KEY_TYPE_*
3341 * Returns: 0 on success, -1 on failure
3342 *
3343 * This is an optional function that can be used to set the driver to
3344 * require protection for Tx and/or Rx frames. This uses the layer
3345 * interface defined in IEEE 802.11i-2004 clause 10.3.22.1
3346 * (MLME-SETPROTECTION.request). Many drivers do not use explicit
3347 * set protection operation; instead, they set protection implicitly
3348 * based on configured keys.
3349 */
3350 int (*mlme_setprotection)(void *priv, const u8 *addr, int protect_type,
3351 int key_type);
3352
3353 /**
3354 * get_hw_feature_data - Get hardware support data (channels and rates)
3355 * @priv: Private driver interface data
3356 * @num_modes: Variable for returning the number of returned modes
3357 * flags: Variable for returning hardware feature flags
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003358 * @dfs: Variable for returning DFS region (HOSTAPD_DFS_REGION_*)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003359 * Returns: Pointer to allocated hardware data on success or %NULL on
3360 * failure. Caller is responsible for freeing this.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003361 */
3362 struct hostapd_hw_modes * (*get_hw_feature_data)(void *priv,
3363 u16 *num_modes,
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003364 u16 *flags, u8 *dfs);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003365
3366 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003367 * send_mlme - Send management frame from MLME
3368 * @priv: Private driver interface data
3369 * @data: IEEE 802.11 management frame with IEEE 802.11 header
3370 * @data_len: Size of the management frame
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003371 * @noack: Do not wait for this frame to be acked (disable retries)
Dmitry Shmidta3dc3092015-06-23 11:21:28 -07003372 * @freq: Frequency (in MHz) to send the frame on, or 0 to let the
3373 * driver decide
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08003374 * @csa_offs: Array of CSA offsets or %NULL
3375 * @csa_offs_len: Number of elements in csa_offs
Hai Shalomfdcde762020-04-02 11:19:20 -07003376 * @no_encrypt: Do not encrypt frame even if appropriate key exists
3377 * (used only for testing purposes)
3378 * @wait: Time to wait off-channel for a response (in ms), or zero
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003379 * @link_id: Link ID to use for TX, or -1 if not set
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003380 * Returns: 0 on success, -1 on failure
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003381 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003382 int (*send_mlme)(void *priv, const u8 *data, size_t data_len,
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08003383 int noack, unsigned int freq, const u16 *csa_offs,
Hai Shalomfdcde762020-04-02 11:19:20 -07003384 size_t csa_offs_len, int no_encrypt,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003385 unsigned int wait, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003386
3387 /**
3388 * update_ft_ies - Update FT (IEEE 802.11r) IEs
3389 * @priv: Private driver interface data
3390 * @md: Mobility domain (2 octets) (also included inside ies)
3391 * @ies: FT IEs (MDIE, FTIE, ...) or %NULL to remove IEs
3392 * @ies_len: Length of FT IEs in bytes
3393 * Returns: 0 on success, -1 on failure
3394 *
3395 * The supplicant uses this callback to let the driver know that keying
3396 * material for FT is available and that the driver can use the
3397 * provided IEs in the next message in FT authentication sequence.
3398 *
3399 * This function is only needed for driver that support IEEE 802.11r
3400 * (Fast BSS Transition).
3401 */
3402 int (*update_ft_ies)(void *priv, const u8 *md, const u8 *ies,
3403 size_t ies_len);
3404
3405 /**
Sunil Ravi99c035e2024-07-12 01:42:03 +00003406 * get_scan_results - Fetch the latest scan results
3407 * @priv: Private driver interface data
3408 * @bssid: Return results only for the specified BSSID, %NULL for all
3409 *
3410 * Returns: Allocated buffer of scan results (caller is responsible for
3411 * freeing the data structure) on success, NULL on failure
3412 */
3413 struct wpa_scan_results * (*get_scan_results)(void *priv,
3414 const u8 *bssid);
3415
3416 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003417 * get_scan_results2 - Fetch the latest scan results
3418 * @priv: private driver interface data
3419 *
3420 * Returns: Allocated buffer of scan results (caller is responsible for
3421 * freeing the data structure) on success, NULL on failure
3422 */
3423 struct wpa_scan_results * (*get_scan_results2)(void *priv);
3424
3425 /**
3426 * set_country - Set country
3427 * @priv: Private driver interface data
3428 * @alpha2: country to which to switch to
3429 * Returns: 0 on success, -1 on failure
3430 *
3431 * This function is for drivers which support some form
3432 * of setting a regulatory domain.
3433 */
3434 int (*set_country)(void *priv, const char *alpha2);
3435
3436 /**
Dmitry Shmidtcce06662013-11-04 18:44:24 -08003437 * get_country - Get country
3438 * @priv: Private driver interface data
3439 * @alpha2: Buffer for returning country code (at least 3 octets)
3440 * Returns: 0 on success, -1 on failure
3441 */
3442 int (*get_country)(void *priv, char *alpha2);
3443
3444 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003445 * global_init - Global driver initialization
Dmitry Shmidte4663042016-04-04 10:07:49 -07003446 * @ctx: wpa_global pointer
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003447 * Returns: Pointer to private data (global), %NULL on failure
3448 *
3449 * This optional function is called to initialize the driver wrapper
3450 * for global data, i.e., data that applies to all interfaces. If this
3451 * function is implemented, global_deinit() will also need to be
3452 * implemented to free the private data. The driver will also likely
3453 * use init2() function instead of init() to get the pointer to global
3454 * data available to per-interface initializer.
3455 */
Dmitry Shmidte4663042016-04-04 10:07:49 -07003456 void * (*global_init)(void *ctx);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003457
3458 /**
3459 * global_deinit - Global driver deinitialization
3460 * @priv: private driver global data from global_init()
3461 *
3462 * Terminate any global driver related functionality and free the
3463 * global data structure.
3464 */
3465 void (*global_deinit)(void *priv);
3466
3467 /**
3468 * init2 - Initialize driver interface (with global data)
3469 * @ctx: context to be used when calling wpa_supplicant functions,
3470 * e.g., wpa_supplicant_event()
3471 * @ifname: interface name, e.g., wlan0
3472 * @global_priv: private driver global data from global_init()
3473 * Returns: Pointer to private data, %NULL on failure
3474 *
3475 * This function can be used instead of init() if the driver wrapper
3476 * uses global data.
3477 */
3478 void * (*init2)(void *ctx, const char *ifname, void *global_priv);
3479
3480 /**
3481 * get_interfaces - Get information about available interfaces
3482 * @global_priv: private driver global data from global_init()
3483 * Returns: Allocated buffer of interface information (caller is
3484 * responsible for freeing the data structure) on success, NULL on
3485 * failure
3486 */
3487 struct wpa_interface_info * (*get_interfaces)(void *global_priv);
3488
3489 /**
3490 * scan2 - Request the driver to initiate scan
3491 * @priv: private driver interface data
3492 * @params: Scan parameters
3493 *
3494 * Returns: 0 on success, -1 on failure
3495 *
3496 * Once the scan results are ready, the driver should report scan
3497 * results event for wpa_supplicant which will eventually request the
3498 * results with wpa_driver_get_scan_results2().
3499 */
3500 int (*scan2)(void *priv, struct wpa_driver_scan_params *params);
3501
3502 /**
3503 * authenticate - Request driver to authenticate
3504 * @priv: private driver interface data
3505 * @params: authentication parameters
3506 * Returns: 0 on success, -1 on failure
3507 *
3508 * This is an optional function that can be used with drivers that
3509 * support separate authentication and association steps, i.e., when
3510 * wpa_supplicant can act as the SME. If not implemented, associate()
3511 * function is expected to take care of IEEE 802.11 authentication,
3512 * too.
3513 */
3514 int (*authenticate)(void *priv,
3515 struct wpa_driver_auth_params *params);
3516
3517 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003518 * set_ap - Set Beacon and Probe Response information for AP mode
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003519 * @priv: Private driver interface data
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003520 * @params: Parameters to use in AP mode
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003521 *
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003522 * This function is used to configure Beacon template and/or extra IEs
3523 * to add for Beacon and Probe Response frames for the driver in
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003524 * AP mode. The driver is responsible for building the full Beacon
3525 * frame by concatenating the head part with TIM IE generated by the
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003526 * driver/firmware and finishing with the tail part. Depending on the
3527 * driver architectue, this can be done either by using the full
3528 * template or the set of additional IEs (e.g., WPS and P2P IE).
3529 * Similarly, Probe Response processing depends on the driver design.
3530 * If the driver (or firmware) takes care of replying to Probe Request
3531 * frames, the extra IEs provided here needs to be added to the Probe
3532 * Response frames.
3533 *
3534 * Returns: 0 on success, -1 on failure
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003535 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003536 int (*set_ap)(void *priv, struct wpa_driver_ap_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003537
3538 /**
Dmitry Shmidt8bae4132013-06-06 11:25:10 -07003539 * set_acl - Set ACL in AP mode
3540 * @priv: Private driver interface data
3541 * @params: Parameters to configure ACL
3542 * Returns: 0 on success, -1 on failure
3543 *
3544 * This is used only for the drivers which support MAC address ACL.
3545 */
3546 int (*set_acl)(void *priv, struct hostapd_acl_params *params);
3547
3548 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003549 * hapd_init - Initialize driver interface (hostapd only)
3550 * @hapd: Pointer to hostapd context
3551 * @params: Configuration for the driver wrapper
3552 * Returns: Pointer to private data, %NULL on failure
3553 *
3554 * This function is used instead of init() or init2() when the driver
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003555 * wrapper is used with hostapd.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003556 */
3557 void * (*hapd_init)(struct hostapd_data *hapd,
3558 struct wpa_init_params *params);
3559
3560 /**
3561 * hapd_deinit - Deinitialize driver interface (hostapd only)
3562 * @priv: Private driver interface data from hapd_init()
3563 */
3564 void (*hapd_deinit)(void *priv);
3565
3566 /**
3567 * set_ieee8021x - Enable/disable IEEE 802.1X support (AP only)
3568 * @priv: Private driver interface data
3569 * @params: BSS parameters
3570 * Returns: 0 on success, -1 on failure
3571 *
3572 * This is an optional function to configure the kernel driver to
3573 * enable/disable IEEE 802.1X support and set WPA/WPA2 parameters. This
3574 * can be left undefined (set to %NULL) if IEEE 802.1X support is
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003575 * always enabled and the driver uses set_ap() to set WPA/RSN IE
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003576 * for Beacon frames.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003577 *
3578 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003579 */
3580 int (*set_ieee8021x)(void *priv, struct wpa_bss_params *params);
3581
3582 /**
3583 * set_privacy - Enable/disable privacy (AP only)
3584 * @priv: Private driver interface data
3585 * @enabled: 1 = privacy enabled, 0 = disabled
3586 * Returns: 0 on success, -1 on failure
3587 *
3588 * This is an optional function to configure privacy field in the
3589 * kernel driver for Beacon frames. This can be left undefined (set to
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003590 * %NULL) if the driver uses the Beacon template from set_ap().
3591 *
3592 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003593 */
3594 int (*set_privacy)(void *priv, int enabled);
3595
3596 /**
3597 * get_seqnum - Fetch the current TSC/packet number (AP only)
3598 * @ifname: The interface name (main or virtual)
3599 * @priv: Private driver interface data
3600 * @addr: MAC address of the station or %NULL for group keys
3601 * @idx: Key index
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003602 * @link_id: Link ID for a group key, or -1 if not set
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003603 * @seq: Buffer for returning the latest used TSC/packet number
3604 * Returns: 0 on success, -1 on failure
3605 *
3606 * This function is used to fetch the last used TSC/packet number for
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07003607 * a TKIP, CCMP, GCMP, or BIP/IGTK key. It is mainly used with group
3608 * keys, so there is no strict requirement on implementing support for
3609 * unicast keys (i.e., addr != %NULL).
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003610 */
3611 int (*get_seqnum)(const char *ifname, void *priv, const u8 *addr,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003612 int idx, int link_id, u8 *seq);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003613
3614 /**
3615 * flush - Flush all association stations (AP only)
3616 * @priv: Private driver interface data
Sunil Ravi7f769292024-07-23 22:21:32 +00003617 * @link_id: In case of MLO, valid link ID on which all associated
3618 * stations will be flushed, -1 otherwise.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003619 * Returns: 0 on success, -1 on failure
3620 *
3621 * This function requests the driver to disassociate all associated
3622 * stations. This function does not need to be implemented if the
3623 * driver does not process association frames internally.
3624 */
Sunil Ravi7f769292024-07-23 22:21:32 +00003625 int (*flush)(void *priv, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003626
3627 /**
3628 * set_generic_elem - Add IEs into Beacon/Probe Response frames (AP)
3629 * @priv: Private driver interface data
3630 * @elem: Information elements
3631 * @elem_len: Length of the elem buffer in octets
3632 * Returns: 0 on success, -1 on failure
3633 *
3634 * This is an optional function to add information elements in the
3635 * kernel driver for Beacon and Probe Response frames. This can be left
3636 * undefined (set to %NULL) if the driver uses the Beacon template from
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003637 * set_ap().
3638 *
3639 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003640 */
3641 int (*set_generic_elem)(void *priv, const u8 *elem, size_t elem_len);
3642
3643 /**
Jouni Malinen1e6c57f2012-09-05 17:07:03 +03003644 * read_sta_data - Fetch station data
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003645 * @priv: Private driver interface data
3646 * @data: Buffer for returning station information
3647 * @addr: MAC address of the station
3648 * Returns: 0 on success, -1 on failure
3649 */
3650 int (*read_sta_data)(void *priv, struct hostap_sta_driver_data *data,
3651 const u8 *addr);
3652
3653 /**
Hai Shalomfdcde762020-04-02 11:19:20 -07003654 * tx_control_port - Send a frame over the 802.1X controlled port
3655 * @priv: Private driver interface data
3656 * @dest: Destination MAC address
3657 * @proto: Ethertype in host byte order
3658 * @buf: Frame payload starting from IEEE 802.1X header
3659 * @len: Frame payload length
3660 * @no_encrypt: Do not encrypt frame
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003661 * @link_id: Link ID to use for TX, or -1 if not set
Hai Shalomfdcde762020-04-02 11:19:20 -07003662 *
3663 * Returns 0 on success, else an error
3664 *
3665 * This is like a normal Ethernet send except that the driver is aware
3666 * (by other means than the Ethertype) that this frame is special,
3667 * and more importantly it gains an ordering between the transmission of
3668 * the frame and other driver management operations such as key
3669 * installations. This can be used to work around known limitations in
3670 * IEEE 802.11 protocols such as race conditions between rekeying 4-way
3671 * handshake message 4/4 and a PTK being overwritten.
3672 *
3673 * This function is only used for a given interface if the driver
3674 * instance reports WPA_DRIVER_FLAGS_CONTROL_PORT capability. Otherwise,
3675 * API users will fall back to sending the frame via a normal socket.
3676 */
3677 int (*tx_control_port)(void *priv, const u8 *dest,
3678 u16 proto, const u8 *buf, size_t len,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003679 int no_encrypt, int link_id);
Hai Shalomfdcde762020-04-02 11:19:20 -07003680
3681 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003682 * hapd_send_eapol - Send an EAPOL packet (AP only)
3683 * @priv: private driver interface data
3684 * @addr: Destination MAC address
3685 * @data: EAPOL packet starting with IEEE 802.1X header
3686 * @data_len: Length of the EAPOL packet in octets
3687 * @encrypt: Whether the frame should be encrypted
3688 * @own_addr: Source MAC address
3689 * @flags: WPA_STA_* flags for the destination station
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003690 * @link_id: Link ID to use for TX, or -1 if not set
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003691 *
3692 * Returns: 0 on success, -1 on failure
3693 */
3694 int (*hapd_send_eapol)(void *priv, const u8 *addr, const u8 *data,
3695 size_t data_len, int encrypt,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003696 const u8 *own_addr, u32 flags, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003697
3698 /**
3699 * sta_deauth - Deauthenticate a station (AP only)
3700 * @priv: Private driver interface data
3701 * @own_addr: Source address and BSSID for the Deauthentication frame
3702 * @addr: MAC address of the station to deauthenticate
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003703 * @reason: Reason code for the Deauthentication frame
3704 * @link_id: Link ID to use for Deauthentication frame, or -1 if not set
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003705 * Returns: 0 on success, -1 on failure
3706 *
3707 * This function requests a specific station to be deauthenticated and
3708 * a Deauthentication frame to be sent to it.
3709 */
3710 int (*sta_deauth)(void *priv, const u8 *own_addr, const u8 *addr,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003711 u16 reason, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003712
3713 /**
3714 * sta_disassoc - Disassociate a station (AP only)
3715 * @priv: Private driver interface data
3716 * @own_addr: Source address and BSSID for the Disassociation frame
3717 * @addr: MAC address of the station to disassociate
3718 * @reason: Reason code for the Disassociation frame
3719 * Returns: 0 on success, -1 on failure
3720 *
3721 * This function requests a specific station to be disassociated and
3722 * a Disassociation frame to be sent to it.
3723 */
3724 int (*sta_disassoc)(void *priv, const u8 *own_addr, const u8 *addr,
Hai Shalom81f62d82019-07-22 12:10:00 -07003725 u16 reason);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003726
3727 /**
3728 * sta_remove - Remove a station entry (AP only)
3729 * @priv: Private driver interface data
3730 * @addr: MAC address of the station to be removed
3731 * Returns: 0 on success, -1 on failure
3732 */
3733 int (*sta_remove)(void *priv, const u8 *addr);
3734
3735 /**
3736 * hapd_get_ssid - Get the current SSID (AP only)
3737 * @priv: Private driver interface data
3738 * @buf: Buffer for returning the SSID
3739 * @len: Maximum length of the buffer
3740 * Returns: Length of the SSID on success, -1 on failure
3741 *
3742 * This function need not be implemented if the driver uses Beacon
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003743 * template from set_ap() and does not reply to Probe Request frames.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003744 */
3745 int (*hapd_get_ssid)(void *priv, u8 *buf, int len);
3746
3747 /**
3748 * hapd_set_ssid - Set SSID (AP only)
3749 * @priv: Private driver interface data
3750 * @buf: SSID
3751 * @len: Length of the SSID in octets
3752 * Returns: 0 on success, -1 on failure
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003753 *
3754 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003755 */
3756 int (*hapd_set_ssid)(void *priv, const u8 *buf, int len);
3757
3758 /**
3759 * hapd_set_countermeasures - Enable/disable TKIP countermeasures (AP)
3760 * @priv: Private driver interface data
3761 * @enabled: 1 = countermeasures enabled, 0 = disabled
3762 * Returns: 0 on success, -1 on failure
3763 *
3764 * This need not be implemented if the driver does not take care of
3765 * association processing.
3766 */
3767 int (*hapd_set_countermeasures)(void *priv, int enabled);
3768
3769 /**
3770 * sta_add - Add a station entry
3771 * @priv: Private driver interface data
3772 * @params: Station parameters
3773 * Returns: 0 on success, -1 on failure
3774 *
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08003775 * This function is used to add or set (params->set 1) a station
3776 * entry in the driver. Adding STA entries is used only if the driver
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003777 * does not take care of association processing.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003778 *
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08003779 * With drivers that don't support full AP client state, this function
3780 * is used to add a station entry to the driver once the station has
3781 * completed association.
3782 *
3783 * With TDLS, this function is used to add or set (params->set 1)
3784 * TDLS peer entries (even with drivers that do not support full AP
3785 * client state).
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003786 */
3787 int (*sta_add)(void *priv, struct hostapd_sta_add_params *params);
3788
3789 /**
3790 * get_inact_sec - Get station inactivity duration (AP only)
3791 * @priv: Private driver interface data
3792 * @addr: Station address
3793 * Returns: Number of seconds station has been inactive, -1 on failure
3794 */
3795 int (*get_inact_sec)(void *priv, const u8 *addr);
3796
3797 /**
3798 * sta_clear_stats - Clear station statistics (AP only)
3799 * @priv: Private driver interface data
3800 * @addr: Station address
3801 * Returns: 0 on success, -1 on failure
3802 */
3803 int (*sta_clear_stats)(void *priv, const u8 *addr);
3804
3805 /**
3806 * set_freq - Set channel/frequency (AP only)
3807 * @priv: Private driver interface data
3808 * @freq: Channel parameters
3809 * Returns: 0 on success, -1 on failure
3810 */
3811 int (*set_freq)(void *priv, struct hostapd_freq_params *freq);
3812
3813 /**
3814 * set_rts - Set RTS threshold
3815 * @priv: Private driver interface data
3816 * @rts: RTS threshold in octets
3817 * Returns: 0 on success, -1 on failure
3818 */
3819 int (*set_rts)(void *priv, int rts);
3820
3821 /**
3822 * set_frag - Set fragmentation threshold
3823 * @priv: Private driver interface data
3824 * @frag: Fragmentation threshold in octets
3825 * Returns: 0 on success, -1 on failure
3826 */
3827 int (*set_frag)(void *priv, int frag);
3828
3829 /**
3830 * sta_set_flags - Set station flags (AP only)
3831 * @priv: Private driver interface data
3832 * @addr: Station address
3833 * @total_flags: Bitmap of all WPA_STA_* flags currently set
3834 * @flags_or: Bitmap of WPA_STA_* flags to add
3835 * @flags_and: Bitmap of WPA_STA_* flags to us as a mask
3836 * Returns: 0 on success, -1 on failure
3837 */
3838 int (*sta_set_flags)(void *priv, const u8 *addr,
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08003839 unsigned int total_flags, unsigned int flags_or,
3840 unsigned int flags_and);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003841
3842 /**
Hai Shalom81f62d82019-07-22 12:10:00 -07003843 * sta_set_airtime_weight - Set station airtime weight (AP only)
3844 * @priv: Private driver interface data
3845 * @addr: Station address
3846 * @weight: New weight for station airtime assignment
3847 * Returns: 0 on success, -1 on failure
3848 */
3849 int (*sta_set_airtime_weight)(void *priv, const u8 *addr,
3850 unsigned int weight);
3851
3852 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003853 * set_tx_queue_params - Set TX queue parameters
3854 * @priv: Private driver interface data
3855 * @queue: Queue number (0 = VO, 1 = VI, 2 = BE, 3 = BK)
3856 * @aifs: AIFS
3857 * @cw_min: cwMin
3858 * @cw_max: cwMax
3859 * @burst_time: Maximum length for bursting in 0.1 msec units
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003860 * @link_id: Link ID to use, or -1 for non MLD.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003861 */
3862 int (*set_tx_queue_params)(void *priv, int queue, int aifs, int cw_min,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003863 int cw_max, int burst_time, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003864
3865 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003866 * if_add - Add a virtual interface
3867 * @priv: Private driver interface data
3868 * @type: Interface type
3869 * @ifname: Interface name for the new virtual interface
3870 * @addr: Local address to use for the interface or %NULL to use the
3871 * parent interface address
3872 * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces
3873 * @drv_priv: Pointer for overwriting the driver context or %NULL if
3874 * not allowed (applies only to %WPA_IF_AP_BSS type)
3875 * @force_ifname: Buffer for returning an interface name that the
3876 * driver ended up using if it differs from the requested ifname
3877 * @if_addr: Buffer for returning the allocated interface address
3878 * (this may differ from the requested addr if the driver cannot
3879 * change interface address)
3880 * @bridge: Bridge interface to use or %NULL if no bridge configured
Dmitry Shmidtcce06662013-11-04 18:44:24 -08003881 * @use_existing: Whether to allow existing interface to be used
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08003882 * @setup_ap: Whether to setup AP for %WPA_IF_AP_BSS interfaces
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003883 * Returns: 0 on success, -1 on failure
3884 */
3885 int (*if_add)(void *priv, enum wpa_driver_if_type type,
3886 const char *ifname, const u8 *addr, void *bss_ctx,
3887 void **drv_priv, char *force_ifname, u8 *if_addr,
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08003888 const char *bridge, int use_existing, int setup_ap);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003889
3890 /**
3891 * if_remove - Remove a virtual interface
3892 * @priv: Private driver interface data
3893 * @type: Interface type
3894 * @ifname: Interface name of the virtual interface to be removed
3895 * Returns: 0 on success, -1 on failure
3896 */
3897 int (*if_remove)(void *priv, enum wpa_driver_if_type type,
3898 const char *ifname);
3899
3900 /**
3901 * set_sta_vlan - Bind a station into a specific interface (AP only)
3902 * @priv: Private driver interface data
3903 * @ifname: Interface (main or virtual BSS or VLAN)
3904 * @addr: MAC address of the associated station
3905 * @vlan_id: VLAN ID
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003906 * @link_id: The link ID or -1 for non-MLO
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003907 * Returns: 0 on success, -1 on failure
3908 *
3909 * This function is used to bind a station to a specific virtual
3910 * interface. It is only used if when virtual interfaces are supported,
3911 * e.g., to assign stations to different VLAN interfaces based on
3912 * information from a RADIUS server. This allows separate broadcast
3913 * domains to be used with a single BSS.
3914 */
3915 int (*set_sta_vlan)(void *priv, const u8 *addr, const char *ifname,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003916 int vlan_id, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003917
3918 /**
3919 * commit - Optional commit changes handler (AP only)
3920 * @priv: driver private data
3921 * Returns: 0 on success, -1 on failure
3922 *
3923 * This optional handler function can be registered if the driver
3924 * interface implementation needs to commit changes (e.g., by setting
3925 * network interface up) at the end of initial configuration. If set,
3926 * this handler will be called after initial setup has been completed.
3927 */
3928 int (*commit)(void *priv);
3929
3930 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003931 * set_radius_acl_auth - Notification of RADIUS ACL change
3932 * @priv: Private driver interface data
3933 * @mac: MAC address of the station
3934 * @accepted: Whether the station was accepted
3935 * @session_timeout: Session timeout for the station
3936 * Returns: 0 on success, -1 on failure
3937 */
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07003938 int (*set_radius_acl_auth)(void *priv, const u8 *mac, int accepted,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003939 u32 session_timeout);
3940
3941 /**
3942 * set_radius_acl_expire - Notification of RADIUS ACL expiration
3943 * @priv: Private driver interface data
3944 * @mac: MAC address of the station
3945 * Returns: 0 on success, -1 on failure
3946 */
3947 int (*set_radius_acl_expire)(void *priv, const u8 *mac);
3948
3949 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003950 * set_ap_wps_ie - Add WPS IE(s) into Beacon/Probe Response frames (AP)
3951 * @priv: Private driver interface data
3952 * @beacon: WPS IE(s) for Beacon frames or %NULL to remove extra IE(s)
3953 * @proberesp: WPS IE(s) for Probe Response frames or %NULL to remove
3954 * extra IE(s)
3955 * @assocresp: WPS IE(s) for (Re)Association Response frames or %NULL
3956 * to remove extra IE(s)
3957 * Returns: 0 on success, -1 on failure
3958 *
3959 * This is an optional function to add WPS IE in the kernel driver for
3960 * Beacon and Probe Response frames. This can be left undefined (set
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003961 * to %NULL) if the driver uses the Beacon template from set_ap()
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003962 * and does not process Probe Request frames. If the driver takes care
3963 * of (Re)Association frame processing, the assocresp buffer includes
3964 * WPS IE(s) that need to be added to (Re)Association Response frames
3965 * whenever a (Re)Association Request frame indicated use of WPS.
3966 *
3967 * This will also be used to add P2P IE(s) into Beacon/Probe Response
3968 * frames when operating as a GO. The driver is responsible for adding
3969 * timing related attributes (e.g., NoA) in addition to the IEs
3970 * included here by appending them after these buffers. This call is
3971 * also used to provide Probe Response IEs for P2P Listen state
3972 * operations for drivers that generate the Probe Response frames
3973 * internally.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003974 *
3975 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003976 */
3977 int (*set_ap_wps_ie)(void *priv, const struct wpabuf *beacon,
3978 const struct wpabuf *proberesp,
3979 const struct wpabuf *assocresp);
3980
3981 /**
3982 * set_supp_port - Set IEEE 802.1X Supplicant Port status
3983 * @priv: Private driver interface data
3984 * @authorized: Whether the port is authorized
3985 * Returns: 0 on success, -1 on failure
3986 */
3987 int (*set_supp_port)(void *priv, int authorized);
3988
3989 /**
3990 * set_wds_sta - Bind a station into a 4-address WDS (AP only)
3991 * @priv: Private driver interface data
3992 * @addr: MAC address of the associated station
3993 * @aid: Association ID
3994 * @val: 1 = bind to 4-address WDS; 0 = unbind
3995 * @bridge_ifname: Bridge interface to use for the WDS station or %NULL
3996 * to indicate that bridge is not to be used
Dmitry Shmidtc2ebb4b2013-07-24 12:57:51 -07003997 * @ifname_wds: Buffer to return the interface name for the new WDS
3998 * station or %NULL to indicate name is not returned.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003999 * Returns: 0 on success, -1 on failure
4000 */
4001 int (*set_wds_sta)(void *priv, const u8 *addr, int aid, int val,
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07004002 const char *bridge_ifname, char *ifname_wds);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004003
4004 /**
4005 * send_action - Transmit an Action frame
4006 * @priv: Private driver interface data
4007 * @freq: Frequency (in MHz) of the channel
4008 * @wait: Time to wait off-channel for a response (in ms), or zero
4009 * @dst: Destination MAC address (Address 1)
4010 * @src: Source MAC address (Address 2)
4011 * @bssid: BSSID (Address 3)
4012 * @data: Frame body
4013 * @data_len: data length in octets
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004014 @ @no_cck: Whether CCK rates must not be used to transmit this frame
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004015 * Returns: 0 on success, -1 on failure
4016 *
4017 * This command can be used to request the driver to transmit an action
4018 * frame to the specified destination.
4019 *
4020 * If the %WPA_DRIVER_FLAGS_OFFCHANNEL_TX flag is set, the frame will
4021 * be transmitted on the given channel and the device will wait for a
4022 * response on that channel for the given wait time.
4023 *
4024 * If the flag is not set, the wait time will be ignored. In this case,
4025 * if a remain-on-channel duration is in progress, the frame must be
4026 * transmitted on that channel; alternatively the frame may be sent on
4027 * the current operational channel (if in associated state in station
4028 * mode or while operating as an AP.)
Dmitry Shmidtebd93af2017-02-21 13:40:44 -08004029 *
4030 * If @src differs from the device MAC address, use of a random
4031 * transmitter address is requested for this message exchange.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004032 */
4033 int (*send_action)(void *priv, unsigned int freq, unsigned int wait,
4034 const u8 *dst, const u8 *src, const u8 *bssid,
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004035 const u8 *data, size_t data_len, int no_cck);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004036
4037 /**
4038 * send_action_cancel_wait - Cancel action frame TX wait
4039 * @priv: Private driver interface data
4040 *
4041 * This command cancels the wait time associated with sending an action
4042 * frame. It is only available when %WPA_DRIVER_FLAGS_OFFCHANNEL_TX is
4043 * set in the driver flags.
4044 */
4045 void (*send_action_cancel_wait)(void *priv);
4046
4047 /**
4048 * remain_on_channel - Remain awake on a channel
4049 * @priv: Private driver interface data
4050 * @freq: Frequency (in MHz) of the channel
4051 * @duration: Duration in milliseconds
4052 * Returns: 0 on success, -1 on failure
4053 *
4054 * This command is used to request the driver to remain awake on the
4055 * specified channel for the specified duration and report received
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08004056 * Action frames with EVENT_RX_MGMT events. Optionally, received
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004057 * Probe Request frames may also be requested to be reported by calling
4058 * probe_req_report(). These will be reported with EVENT_RX_PROBE_REQ.
4059 *
4060 * The driver may not be at the requested channel when this function
4061 * returns, i.e., the return code is only indicating whether the
4062 * request was accepted. The caller will need to wait until the
4063 * EVENT_REMAIN_ON_CHANNEL event indicates that the driver has
4064 * completed the channel change. This may take some time due to other
4065 * need for the radio and the caller should be prepared to timing out
4066 * its wait since there are no guarantees on when this request can be
4067 * executed.
4068 */
4069 int (*remain_on_channel)(void *priv, unsigned int freq,
4070 unsigned int duration);
4071
4072 /**
4073 * cancel_remain_on_channel - Cancel remain-on-channel operation
4074 * @priv: Private driver interface data
4075 *
4076 * This command can be used to cancel a remain-on-channel operation
4077 * before its originally requested duration has passed. This could be
4078 * used, e.g., when remain_on_channel() is used to request extra time
4079 * to receive a response to an Action frame and the response is
4080 * received when there is still unneeded time remaining on the
4081 * remain-on-channel operation.
4082 */
4083 int (*cancel_remain_on_channel)(void *priv);
4084
4085 /**
4086 * probe_req_report - Request Probe Request frames to be indicated
4087 * @priv: Private driver interface data
4088 * @report: Whether to report received Probe Request frames
4089 * Returns: 0 on success, -1 on failure (or if not supported)
4090 *
4091 * This command can be used to request the driver to indicate when
4092 * Probe Request frames are received with EVENT_RX_PROBE_REQ events.
4093 * Since this operation may require extra resources, e.g., due to less
4094 * optimal hardware/firmware RX filtering, many drivers may disable
4095 * Probe Request reporting at least in station mode. This command is
4096 * used to notify the driver when the Probe Request frames need to be
4097 * reported, e.g., during remain-on-channel operations.
4098 */
4099 int (*probe_req_report)(void *priv, int report);
4100
4101 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004102 * deinit_ap - Deinitialize AP mode
4103 * @priv: Private driver interface data
4104 * Returns: 0 on success, -1 on failure (or if not supported)
4105 *
4106 * This optional function can be used to disable AP mode related
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07004107 * configuration. If the interface was not dynamically added,
4108 * change the driver mode to station mode to allow normal station
4109 * operations like scanning to be completed.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004110 */
4111 int (*deinit_ap)(void *priv);
4112
4113 /**
Dmitry Shmidt04949592012-07-19 12:16:46 -07004114 * deinit_p2p_cli - Deinitialize P2P client mode
4115 * @priv: Private driver interface data
4116 * Returns: 0 on success, -1 on failure (or if not supported)
4117 *
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07004118 * This optional function can be used to disable P2P client mode. If the
4119 * interface was not dynamically added, change the interface type back
4120 * to station mode.
Dmitry Shmidt04949592012-07-19 12:16:46 -07004121 */
4122 int (*deinit_p2p_cli)(void *priv);
4123
4124 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004125 * suspend - Notification on system suspend/hibernate event
4126 * @priv: Private driver interface data
4127 */
4128 void (*suspend)(void *priv);
4129
4130 /**
4131 * resume - Notification on system resume/thaw event
4132 * @priv: Private driver interface data
4133 */
4134 void (*resume)(void *priv);
4135
4136 /**
4137 * signal_monitor - Set signal monitoring parameters
4138 * @priv: Private driver interface data
4139 * @threshold: Threshold value for signal change events; 0 = disabled
4140 * @hysteresis: Minimum change in signal strength before indicating a
4141 * new event
4142 * Returns: 0 on success, -1 on failure (or if not supported)
4143 *
4144 * This function can be used to configure monitoring of signal strength
4145 * with the current AP. Whenever signal strength drops below the
4146 * %threshold value or increases above it, EVENT_SIGNAL_CHANGE event
4147 * should be generated assuming the signal strength has changed at
4148 * least %hysteresis from the previously indicated signal change event.
4149 */
4150 int (*signal_monitor)(void *priv, int threshold, int hysteresis);
4151
4152 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004153 * get_noa - Get current Notice of Absence attribute payload
4154 * @priv: Private driver interface data
4155 * @buf: Buffer for returning NoA
4156 * @buf_len: Buffer length in octets
4157 * Returns: Number of octets used in buf, 0 to indicate no NoA is being
4158 * advertized, or -1 on failure
4159 *
4160 * This function is used to fetch the current Notice of Absence
4161 * attribute value from GO.
4162 */
4163 int (*get_noa)(void *priv, u8 *buf, size_t buf_len);
4164
4165 /**
4166 * set_noa - Set Notice of Absence parameters for GO (testing)
4167 * @priv: Private driver interface data
4168 * @count: Count
4169 * @start: Start time in ms from next TBTT
4170 * @duration: Duration in ms
4171 * Returns: 0 on success or -1 on failure
4172 *
4173 * This function is used to set Notice of Absence parameters for GO. It
4174 * is used only for testing. To disable NoA, all parameters are set to
4175 * 0.
4176 */
4177 int (*set_noa)(void *priv, u8 count, int start, int duration);
4178
4179 /**
4180 * set_p2p_powersave - Set P2P power save options
4181 * @priv: Private driver interface data
4182 * @legacy_ps: 0 = disable, 1 = enable, 2 = maximum PS, -1 = no change
4183 * @opp_ps: 0 = disable, 1 = enable, -1 = no change
4184 * @ctwindow: 0.. = change (msec), -1 = no change
4185 * Returns: 0 on success or -1 on failure
4186 */
4187 int (*set_p2p_powersave)(void *priv, int legacy_ps, int opp_ps,
4188 int ctwindow);
4189
4190 /**
4191 * ampdu - Enable/disable aggregation
4192 * @priv: Private driver interface data
4193 * @ampdu: 1/0 = enable/disable A-MPDU aggregation
4194 * Returns: 0 on success or -1 on failure
4195 */
4196 int (*ampdu)(void *priv, int ampdu);
4197
4198 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004199 * get_radio_name - Get physical radio name for the device
4200 * @priv: Private driver interface data
4201 * Returns: Radio name or %NULL if not known
4202 *
4203 * The returned data must not be modified by the caller. It is assumed
4204 * that any interface that has the same radio name as another is
4205 * sharing the same physical radio. This information can be used to
4206 * share scan results etc. information between the virtual interfaces
4207 * to speed up various operations.
4208 */
4209 const char * (*get_radio_name)(void *priv);
4210
4211 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004212 * send_tdls_mgmt - for sending TDLS management packets
4213 * @priv: private driver interface data
4214 * @dst: Destination (peer) MAC address
4215 * @action_code: TDLS action code for the mssage
4216 * @dialog_token: Dialog Token to use in the message (if needed)
4217 * @status_code: Status Code or Reason Code to use (if needed)
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07004218 * @peer_capab: TDLS peer capability (TDLS_PEER_* bitfield)
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -07004219 * @initiator: Is the current end the TDLS link initiator
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004220 * @buf: TDLS IEs to add to the message
4221 * @len: Length of buf in octets
Sunil Ravi2a14cf12023-11-21 00:54:38 +00004222 * @link_id: If >= 0 indicates the link of the AP MLD to specify the
4223 * operating channel on which to send a TDLS Discovery Response frame.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004224 * Returns: 0 on success, negative (<0) on failure
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004225 *
4226 * This optional function can be used to send packet to driver which is
4227 * responsible for receiving and sending all TDLS packets.
4228 */
4229 int (*send_tdls_mgmt)(void *priv, const u8 *dst, u8 action_code,
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07004230 u8 dialog_token, u16 status_code, u32 peer_capab,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00004231 int initiator, const u8 *buf, size_t len,
4232 int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004233
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004234 /**
4235 * tdls_oper - Ask the driver to perform high-level TDLS operations
4236 * @priv: Private driver interface data
4237 * @oper: TDLS high-level operation. See %enum tdls_oper
4238 * @peer: Destination (peer) MAC address
4239 * Returns: 0 on success, negative (<0) on failure
4240 *
4241 * This optional function can be used to send high-level TDLS commands
4242 * to the driver.
4243 */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004244 int (*tdls_oper)(void *priv, enum tdls_oper oper, const u8 *peer);
4245
4246 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07004247 * wnm_oper - Notify driver of the WNM frame reception
4248 * @priv: Private driver interface data
4249 * @oper: WNM operation. See %enum wnm_oper
4250 * @peer: Destination (peer) MAC address
4251 * @buf: Buffer for the driver to fill in (for getting IE)
4252 * @buf_len: Return the len of buf
4253 * Returns: 0 on success, negative (<0) on failure
4254 */
4255 int (*wnm_oper)(void *priv, enum wnm_oper oper, const u8 *peer,
4256 u8 *buf, u16 *buf_len);
4257
4258 /**
Dmitry Shmidt051af732013-10-22 13:52:46 -07004259 * set_qos_map - Set QoS Map
4260 * @priv: Private driver interface data
4261 * @qos_map_set: QoS Map
4262 * @qos_map_set_len: Length of QoS Map
4263 */
4264 int (*set_qos_map)(void *priv, const u8 *qos_map_set,
4265 u8 qos_map_set_len);
4266
4267 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004268 * br_add_ip_neigh - Add a neigh to the bridge ip neigh table
4269 * @priv: Private driver interface data
4270 * @version: IP version of the IP address, 4 or 6
4271 * @ipaddr: IP address for the neigh entry
4272 * @prefixlen: IP address prefix length
4273 * @addr: Corresponding MAC address
4274 * Returns: 0 on success, negative (<0) on failure
4275 */
4276 int (*br_add_ip_neigh)(void *priv, u8 version, const u8 *ipaddr,
4277 int prefixlen, const u8 *addr);
4278
4279 /**
4280 * br_delete_ip_neigh - Remove a neigh from the bridge ip neigh table
4281 * @priv: Private driver interface data
4282 * @version: IP version of the IP address, 4 or 6
4283 * @ipaddr: IP address for the neigh entry
4284 * Returns: 0 on success, negative (<0) on failure
4285 */
4286 int (*br_delete_ip_neigh)(void *priv, u8 version, const u8 *ipaddr);
4287
4288 /**
4289 * br_port_set_attr - Set a bridge port attribute
4290 * @attr: Bridge port attribute to set
4291 * @val: Value to be set
4292 * Returns: 0 on success, negative (<0) on failure
4293 */
4294 int (*br_port_set_attr)(void *priv, enum drv_br_port_attr attr,
4295 unsigned int val);
4296
4297 /**
4298 * br_port_set_attr - Set a bridge network parameter
4299 * @param: Bridge parameter to set
4300 * @val: Value to be set
4301 * Returns: 0 on success, negative (<0) on failure
4302 */
4303 int (*br_set_net_param)(void *priv, enum drv_br_net_param param,
4304 unsigned int val);
4305
4306 /**
Hai Shalomfdcde762020-04-02 11:19:20 -07004307 * get_wowlan - Get wake-on-wireless status
4308 * @priv: Private driver interface data
4309 */
4310 int (*get_wowlan)(void *priv);
4311
4312 /**
Dmitry Shmidtb58836e2014-04-29 14:35:56 -07004313 * set_wowlan - Set wake-on-wireless triggers
4314 * @priv: Private driver interface data
4315 * @triggers: wowlan triggers
4316 */
4317 int (*set_wowlan)(void *priv, const struct wowlan_triggers *triggers);
4318
4319 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004320 * signal_poll - Get current connection information
4321 * @priv: Private driver interface data
4322 * @signal_info: Connection info structure
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07004323 */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004324 int (*signal_poll)(void *priv, struct wpa_signal_info *signal_info);
Dmitry Shmidtbd567ad2011-05-09 14:17:09 -07004325
4326 /**
Sunil Ravi89eba102022-09-13 21:04:37 -07004327 * mlo_signal_poll - Get current MLO connection information
4328 * @priv: Private driver interface data
4329 * @mlo_signal_info: MLO connection info structure
4330 */
4331 int (*mlo_signal_poll)(void *priv,
4332 struct wpa_mlo_signal_info *mlo_signal_info);
4333
4334 /**
Hai Shalom74f70d42019-02-11 14:42:39 -08004335 * channel_info - Get parameters of the current operating channel
4336 * @priv: Private driver interface data
4337 * @channel_info: Channel info structure
4338 * Returns: 0 on success, negative (<0) on failure
4339 */
4340 int (*channel_info)(void *priv, struct wpa_channel_info *channel_info);
4341
4342 /**
Jouni Malinen75ecf522011-06-27 15:19:46 -07004343 * set_authmode - Set authentication algorithm(s) for static WEP
4344 * @priv: Private driver interface data
4345 * @authmode: 1=Open System, 2=Shared Key, 3=both
4346 * Returns: 0 on success, -1 on failure
4347 *
4348 * This function can be used to set authentication algorithms for AP
4349 * mode when static WEP is used. If the driver uses user space MLME/SME
4350 * implementation, there is no need to implement this function.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004351 *
4352 * DEPRECATED - use set_ap() instead
Jouni Malinen75ecf522011-06-27 15:19:46 -07004353 */
4354 int (*set_authmode)(void *priv, int authmode);
Dmitry Shmidt292b0c32013-11-22 12:54:42 -08004355
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004356#ifdef ANDROID
Jouni Malinen75ecf522011-06-27 15:19:46 -07004357 /**
Dmitry Shmidt292b0c32013-11-22 12:54:42 -08004358 * driver_cmd - Execute driver-specific command
4359 * @priv: Private driver interface data
4360 * @cmd: Command to execute
4361 * @buf: Return buffer
4362 * @buf_len: Buffer length
Dmitry Shmidtbd567ad2011-05-09 14:17:09 -07004363 * Returns: 0 on success, -1 on failure
4364 */
Dmitry Shmidt292b0c32013-11-22 12:54:42 -08004365 int (*driver_cmd)(void *priv, char *cmd, char *buf, size_t buf_len);
4366#endif /* ANDROID */
4367
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004368 /**
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004369 * vendor_cmd - Execute vendor specific command
4370 * @priv: Private driver interface data
4371 * @vendor_id: Vendor id
4372 * @subcmd: Vendor command id
Hai Shalom60840252021-02-19 19:02:11 -08004373 * @nested_attr_flag: Specifies if vendor subcommand uses nested
4374 * attributes or not
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004375 * @data: Vendor command parameters (%NULL if no parameters)
4376 * @data_len: Data length
4377 * @buf: Return buffer (%NULL to ignore reply)
4378 * Returns: 0 on success, negative (<0) on failure
4379 *
4380 * This function handles vendor specific commands that are passed to
4381 * the driver/device. The command is identified by vendor id and
Hai Shalom60840252021-02-19 19:02:11 -08004382 * command id. The nested_attr_flag specifies whether the subcommand
4383 * uses nested attributes or not. Parameters can be passed
4384 * as argument to the command in the data buffer. Reply (if any) will be
4385 * filled in the supplied return buffer.
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004386 *
4387 * The exact driver behavior is driver interface and vendor specific. As
4388 * an example, this will be converted to a vendor specific cfg80211
4389 * command in case of the nl80211 driver interface.
4390 */
4391 int (*vendor_cmd)(void *priv, unsigned int vendor_id,
4392 unsigned int subcmd, const u8 *data, size_t data_len,
Hai Shalom60840252021-02-19 19:02:11 -08004393 enum nested_attr nested_attr_flag,
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004394 struct wpabuf *buf);
4395
4396 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004397 * set_rekey_info - Set rekey information
4398 * @priv: Private driver interface data
4399 * @kek: Current KEK
Dmitry Shmidt807291d2015-01-27 13:40:23 -08004400 * @kek_len: KEK length in octets
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004401 * @kck: Current KCK
Dmitry Shmidt807291d2015-01-27 13:40:23 -08004402 * @kck_len: KCK length in octets
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004403 * @replay_ctr: Current EAPOL-Key Replay Counter
4404 *
4405 * This optional function can be used to provide information for the
4406 * driver/firmware to process EAPOL-Key frames in Group Key Handshake
4407 * while the host (including wpa_supplicant) is sleeping.
4408 */
Dmitry Shmidt807291d2015-01-27 13:40:23 -08004409 void (*set_rekey_info)(void *priv, const u8 *kek, size_t kek_len,
4410 const u8 *kck, size_t kck_len,
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004411 const u8 *replay_ctr);
4412
4413 /**
4414 * sta_assoc - Station association indication
4415 * @priv: Private driver interface data
4416 * @own_addr: Source address and BSSID for association frame
4417 * @addr: MAC address of the station to associate
4418 * @reassoc: flag to indicate re-association
4419 * @status: association response status code
4420 * @ie: assoc response ie buffer
4421 * @len: ie buffer length
4422 * Returns: 0 on success, -1 on failure
4423 *
4424 * This function indicates the driver to send (Re)Association
4425 * Response frame to the station.
4426 */
4427 int (*sta_assoc)(void *priv, const u8 *own_addr, const u8 *addr,
4428 int reassoc, u16 status, const u8 *ie, size_t len);
4429
4430 /**
4431 * sta_auth - Station authentication indication
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004432 * @priv: private driver interface data
4433 * @params: Station authentication parameters
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004434 *
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004435 * Returns: 0 on success, -1 on failure
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004436 */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004437 int (*sta_auth)(void *priv,
4438 struct wpa_driver_sta_auth_params *params);
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004439
4440 /**
4441 * add_tspec - Add traffic stream
4442 * @priv: Private driver interface data
4443 * @addr: MAC address of the station to associate
4444 * @tspec_ie: tspec ie buffer
4445 * @tspec_ielen: tspec ie length
4446 * Returns: 0 on success, -1 on failure
4447 *
4448 * This function adds the traffic steam for the station
4449 * and fills the medium_time in tspec_ie.
4450 */
4451 int (*add_tspec)(void *priv, const u8 *addr, u8 *tspec_ie,
4452 size_t tspec_ielen);
4453
4454 /**
4455 * add_sta_node - Add a station node in the driver
4456 * @priv: Private driver interface data
4457 * @addr: MAC address of the station to add
4458 * @auth_alg: authentication algorithm used by the station
4459 * Returns: 0 on success, -1 on failure
4460 *
4461 * This function adds the station node in the driver, when
4462 * the station gets added by FT-over-DS.
4463 */
4464 int (*add_sta_node)(void *priv, const u8 *addr, u16 auth_alg);
4465
4466 /**
4467 * sched_scan - Request the driver to initiate scheduled scan
4468 * @priv: Private driver interface data
4469 * @params: Scan parameters
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004470 * Returns: 0 on success, -1 on failure
4471 *
4472 * This operation should be used for scheduled scan offload to
4473 * the hardware. Every time scan results are available, the
4474 * driver should report scan results event for wpa_supplicant
4475 * which will eventually request the results with
4476 * wpa_driver_get_scan_results2(). This operation is optional
4477 * and if not provided or if it returns -1, we fall back to
4478 * normal host-scheduled scans.
4479 */
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08004480 int (*sched_scan)(void *priv, struct wpa_driver_scan_params *params);
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004481
4482 /**
4483 * stop_sched_scan - Request the driver to stop a scheduled scan
4484 * @priv: Private driver interface data
4485 * Returns: 0 on success, -1 on failure
4486 *
4487 * This should cause the scheduled scan to be stopped and
4488 * results should stop being sent. Must be supported if
4489 * sched_scan is supported.
4490 */
4491 int (*stop_sched_scan)(void *priv);
4492
4493 /**
4494 * poll_client - Probe (null data or such) the given station
4495 * @priv: Private driver interface data
4496 * @own_addr: MAC address of sending interface
4497 * @addr: MAC address of the station to probe
4498 * @qos: Indicates whether station is QoS station
4499 *
4500 * This function is used to verify whether an associated station is
4501 * still present. This function does not need to be implemented if the
4502 * driver provides such inactivity polling mechanism.
4503 */
4504 void (*poll_client)(void *priv, const u8 *own_addr,
4505 const u8 *addr, int qos);
Dmitry Shmidt04949592012-07-19 12:16:46 -07004506
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004507 /**
Dmitry Shmidt04949592012-07-19 12:16:46 -07004508 * radio_disable - Disable/enable radio
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004509 * @priv: Private driver interface data
Dmitry Shmidt04949592012-07-19 12:16:46 -07004510 * @disabled: 1=disable 0=enable radio
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004511 * Returns: 0 on success, -1 on failure
4512 *
Dmitry Shmidt04949592012-07-19 12:16:46 -07004513 * This optional command is for testing purposes. It can be used to
4514 * disable the radio on a testbed device to simulate out-of-radio-range
4515 * conditions.
4516 */
4517 int (*radio_disable)(void *priv, int disabled);
4518
4519 /**
4520 * switch_channel - Announce channel switch and migrate the GO to the
4521 * given frequency
4522 * @priv: Private driver interface data
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08004523 * @settings: Settings for CSA period and new channel
Dmitry Shmidt04949592012-07-19 12:16:46 -07004524 * Returns: 0 on success, -1 on failure
4525 *
4526 * This function is used to move the GO to the legacy STA channel to
4527 * avoid frequency conflict in single channel concurrency.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004528 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08004529 int (*switch_channel)(void *priv, struct csa_settings *settings);
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004530
4531 /**
Sunil Ravia04bd252022-05-02 22:54:18 -07004532 * switch_color - Announce color switch and migrate the BSS to the
4533 * given color
4534 * @priv: Private driver interface data
4535 * @settings: Settings for CCA period and new color
4536 * Returns: 0 on success, -1 on failure
4537 *
4538 * This function is used to move the BSS to its new color.
4539 */
4540 int (*switch_color)(void *priv, struct cca_settings *settings);
4541
4542 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004543 * add_tx_ts - Add traffic stream
4544 * @priv: Private driver interface data
4545 * @tsid: Traffic stream ID
4546 * @addr: Receiver address
4547 * @user_prio: User priority of the traffic stream
4548 * @admitted_time: Admitted time for this TS in units of
4549 * 32 microsecond periods (per second).
4550 * Returns: 0 on success, -1 on failure
4551 */
4552 int (*add_tx_ts)(void *priv, u8 tsid, const u8 *addr, u8 user_prio,
4553 u16 admitted_time);
4554
4555 /**
4556 * del_tx_ts - Delete traffic stream
4557 * @priv: Private driver interface data
4558 * @tsid: Traffic stream ID
4559 * @addr: Receiver address
4560 * Returns: 0 on success, -1 on failure
4561 */
4562 int (*del_tx_ts)(void *priv, u8 tsid, const u8 *addr);
4563
4564 /**
4565 * Enable channel-switching with TDLS peer
4566 * @priv: Private driver interface data
4567 * @addr: MAC address of the TDLS peer
4568 * @oper_class: Operating class of the switch channel
4569 * @params: Channel specification
4570 * Returns: 0 on success, -1 on failure
4571 *
4572 * The function indicates to driver that it can start switching to a
4573 * different channel with a specified TDLS peer. The switching is
4574 * assumed on until canceled with tdls_disable_channel_switch().
4575 */
4576 int (*tdls_enable_channel_switch)(
4577 void *priv, const u8 *addr, u8 oper_class,
4578 const struct hostapd_freq_params *params);
4579
4580 /**
4581 * Disable channel switching with TDLS peer
4582 * @priv: Private driver interface data
4583 * @addr: MAC address of the TDLS peer
4584 * Returns: 0 on success, -1 on failure
4585 *
4586 * This function indicates to the driver that it should stop switching
4587 * with a given TDLS peer.
4588 */
4589 int (*tdls_disable_channel_switch)(void *priv, const u8 *addr);
4590
4591 /**
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004592 * start_dfs_cac - Listen for radar interference on the channel
4593 * @priv: Private driver interface data
Dmitry Shmidt051af732013-10-22 13:52:46 -07004594 * @freq: Channel parameters
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004595 * Returns: 0 on success, -1 on failure
4596 */
Dmitry Shmidt051af732013-10-22 13:52:46 -07004597 int (*start_dfs_cac)(void *priv, struct hostapd_freq_params *freq);
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004598
4599 /**
4600 * stop_ap - Removes beacon from AP
4601 * @priv: Private driver interface data
Sunil Ravi99c035e2024-07-12 01:42:03 +00004602 * @link_id: Link ID of the specified link; -1 for non-MLD
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004603 * Returns: 0 on success, -1 on failure (or if not supported)
4604 *
4605 * This optional function can be used to disable AP mode related
4606 * configuration. Unlike deinit_ap, it does not change to station
4607 * mode.
4608 */
Sunil Ravi99c035e2024-07-12 01:42:03 +00004609 int (*stop_ap)(void *priv, int link_id);
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07004610
4611 /**
4612 * get_survey - Retrieve survey data
4613 * @priv: Private driver interface data
4614 * @freq: If set, survey data for the specified frequency is only
4615 * being requested. If not set, all survey data is requested.
4616 * Returns: 0 on success, -1 on failure
4617 *
4618 * Use this to retrieve:
4619 *
4620 * - the observed channel noise floor
4621 * - the amount of time we have spent on the channel
4622 * - the amount of time during which we have spent on the channel that
4623 * the radio has determined the medium is busy and we cannot
4624 * transmit
4625 * - the amount of time we have spent receiving data
4626 * - the amount of time we have spent transmitting data
4627 *
4628 * This data can be used for spectrum heuristics. One example is
4629 * Automatic Channel Selection (ACS). The channel survey data is
4630 * kept on a linked list on the channel data, one entry is added
4631 * for each survey. The min_nf of the channel is updated for each
4632 * survey.
4633 */
4634 int (*get_survey)(void *priv, unsigned int freq);
Dmitry Shmidt56052862013-10-04 10:23:25 -07004635
4636 /**
4637 * status - Get driver interface status information
4638 * @priv: Private driver interface data
Hai Shalom74f70d42019-02-11 14:42:39 -08004639 * @buf: Buffer for printing the status information
Dmitry Shmidt56052862013-10-04 10:23:25 -07004640 * @buflen: Maximum length of the buffer
4641 * Returns: Length of written status information or -1 on failure
4642 */
4643 int (*status)(void *priv, char *buf, size_t buflen);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004644
Dmitry Shmidt661b4f72014-09-29 14:58:27 -07004645 /**
4646 * roaming - Set roaming policy for driver-based BSS selection
4647 * @priv: Private driver interface data
4648 * @allowed: Whether roaming within ESS is allowed
4649 * @bssid: Forced BSSID if roaming is disabled or %NULL if not set
4650 * Returns: Length of written status information or -1 on failure
4651 *
4652 * This optional callback can be used to update roaming policy from the
4653 * associate() command (bssid being set there indicates that the driver
4654 * should not roam before getting this roaming() call to allow roaming.
4655 * If the driver does not indicate WPA_DRIVER_FLAGS_BSS_SELECTION
4656 * capability, roaming policy is handled within wpa_supplicant and there
4657 * is no need to implement or react to this callback.
4658 */
4659 int (*roaming)(void *priv, int allowed, const u8 *bssid);
4660
4661 /**
Roshan Pius3a1667e2018-07-03 15:17:14 -07004662 * disable_fils - Enable/disable FILS feature
4663 * @priv: Private driver interface data
4664 * @disable: 0-enable and 1-disable FILS feature
4665 * Returns: 0 on success, -1 on failure
4666 *
4667 * This callback can be used to configure driver and below layers to
4668 * enable/disable all FILS features.
4669 */
4670 int (*disable_fils)(void *priv, int disable);
4671
4672 /**
Dmitry Shmidt661b4f72014-09-29 14:58:27 -07004673 * set_mac_addr - Set MAC address
4674 * @priv: Private driver interface data
4675 * @addr: MAC address to use or %NULL for setting back to permanent
4676 * Returns: 0 on success, -1 on failure
4677 */
4678 int (*set_mac_addr)(void *priv, const u8 *addr);
4679
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004680#ifdef CONFIG_MACSEC
4681 int (*macsec_init)(void *priv, struct macsec_init_params *params);
4682
4683 int (*macsec_deinit)(void *priv);
4684
4685 /**
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004686 * macsec_get_capability - Inform MKA of this driver's capability
4687 * @priv: Private driver interface data
4688 * @cap: Driver's capability
4689 * Returns: 0 on success, -1 on failure
4690 */
4691 int (*macsec_get_capability)(void *priv, enum macsec_cap *cap);
4692
4693 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004694 * enable_protect_frames - Set protect frames status
4695 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004696 * @enabled: true = protect frames enabled
4697 * false = protect frames 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_protect_frames)(void *priv, bool enabled);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004701
4702 /**
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004703 * enable_encrypt - Set encryption status
4704 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004705 * @enabled: true = encrypt outgoing traffic
4706 * false = integrity-only protection on outgoing traffic
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004707 * Returns: 0 on success, -1 on failure (or if not supported)
4708 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004709 int (*enable_encrypt)(void *priv, bool enabled);
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004710
4711 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004712 * set_replay_protect - Set replay protect status and window size
4713 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004714 * @enabled: true = replay protect enabled
4715 * false = replay protect disabled
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004716 * @window: replay window size, valid only when replay protect enabled
4717 * Returns: 0 on success, -1 on failure (or if not supported)
4718 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004719 int (*set_replay_protect)(void *priv, bool enabled, u32 window);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004720
4721 /**
Sunil Ravi036cec52023-03-29 11:35:17 -07004722 * set_offload - Set MACsec hardware offload
4723 * @priv: Private driver interface data
4724 * @offload: 0 = MACSEC_OFFLOAD_OFF
4725 * 1 = MACSEC_OFFLOAD_PHY
4726 * 2 = MACSEC_OFFLOAD_MAC
4727 * Returns: 0 on success, -1 on failure (or if not supported)
4728 */
4729 int (*set_offload)(void *priv, u8 offload);
4730
4731 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004732 * set_current_cipher_suite - Set current cipher suite
4733 * @priv: Private driver interface data
4734 * @cs: EUI64 identifier
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004735 * Returns: 0 on success, -1 on failure (or if not supported)
4736 */
Dmitry Shmidt7d175302016-09-06 13:11:34 -07004737 int (*set_current_cipher_suite)(void *priv, u64 cs);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004738
4739 /**
4740 * enable_controlled_port - Set controlled port status
4741 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004742 * @enabled: true = controlled port enabled
4743 * false = controlled port disabled
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004744 * Returns: 0 on success, -1 on failure (or if not supported)
4745 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004746 int (*enable_controlled_port)(void *priv, bool enabled);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004747
4748 /**
4749 * get_receive_lowest_pn - Get receive lowest pn
4750 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004751 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004752 * Returns: 0 on success, -1 on failure (or if not supported)
4753 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004754 int (*get_receive_lowest_pn)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004755
4756 /**
4757 * get_transmit_next_pn - Get transmit next pn
4758 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004759 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004760 * Returns: 0 on success, -1 on failure (or if not supported)
4761 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004762 int (*get_transmit_next_pn)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004763
4764 /**
4765 * set_transmit_next_pn - Set transmit next pn
4766 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004767 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004768 * Returns: 0 on success, -1 on failure (or if not supported)
4769 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004770 int (*set_transmit_next_pn)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004771
4772 /**
Hai Shalom74f70d42019-02-11 14:42:39 -08004773 * set_receive_lowest_pn - Set receive lowest PN
4774 * @priv: Private driver interface data
4775 * @sa: secure association
4776 * Returns: 0 on success, -1 on failure (or if not supported)
4777 */
4778 int (*set_receive_lowest_pn)(void *priv, struct receive_sa *sa);
4779
4780 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004781 * create_receive_sc - create secure channel for receiving
4782 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004783 * @sc: secure channel
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004784 * @conf_offset: confidentiality offset (0, 30, or 50)
4785 * @validation: frame validation policy (0 = Disabled, 1 = Checked,
4786 * 2 = Strict)
4787 * Returns: 0 on success, -1 on failure (or if not supported)
4788 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004789 int (*create_receive_sc)(void *priv, struct receive_sc *sc,
4790 unsigned int conf_offset,
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004791 int validation);
4792
4793 /**
4794 * delete_receive_sc - delete secure connection for receiving
4795 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004796 * @sc: secure channel
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004797 * Returns: 0 on success, -1 on failure
4798 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004799 int (*delete_receive_sc)(void *priv, struct receive_sc *sc);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004800
4801 /**
4802 * create_receive_sa - create secure association for receive
4803 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004804 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004805 * Returns: 0 on success, -1 on failure
4806 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004807 int (*create_receive_sa)(void *priv, struct receive_sa *sa);
4808
4809 /**
4810 * delete_receive_sa - Delete secure association for receive
4811 * @priv: Private driver interface data from init()
4812 * @sa: Secure association
4813 * Returns: 0 on success, -1 on failure
4814 */
4815 int (*delete_receive_sa)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004816
4817 /**
4818 * enable_receive_sa - enable the SA for receive
4819 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004820 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004821 * Returns: 0 on success, -1 on failure
4822 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004823 int (*enable_receive_sa)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004824
4825 /**
4826 * disable_receive_sa - disable SA for receive
4827 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004828 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004829 * Returns: 0 on success, -1 on failure
4830 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004831 int (*disable_receive_sa)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004832
4833 /**
4834 * create_transmit_sc - create secure connection for transmit
4835 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004836 * @sc: secure channel
4837 * @conf_offset: confidentiality offset (0, 30, or 50)
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004838 * Returns: 0 on success, -1 on failure
4839 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004840 int (*create_transmit_sc)(void *priv, struct transmit_sc *sc,
4841 unsigned int conf_offset);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004842
4843 /**
4844 * delete_transmit_sc - delete secure connection for transmit
4845 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004846 * @sc: secure channel
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004847 * Returns: 0 on success, -1 on failure
4848 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004849 int (*delete_transmit_sc)(void *priv, struct transmit_sc *sc);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004850
4851 /**
4852 * create_transmit_sa - create secure association for transmit
4853 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004854 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004855 * Returns: 0 on success, -1 on failure
4856 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004857 int (*create_transmit_sa)(void *priv, struct transmit_sa *sa);
4858
4859 /**
4860 * delete_transmit_sa - Delete secure association for transmit
4861 * @priv: Private driver interface data from init()
4862 * @sa: Secure association
4863 * Returns: 0 on success, -1 on failure
4864 */
4865 int (*delete_transmit_sa)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004866
4867 /**
4868 * enable_transmit_sa - enable SA for transmit
4869 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004870 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004871 * Returns: 0 on success, -1 on failure
4872 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004873 int (*enable_transmit_sa)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004874
4875 /**
4876 * disable_transmit_sa - disable SA for transmit
4877 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004878 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004879 * Returns: 0 on success, -1 on failure
4880 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004881 int (*disable_transmit_sa)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004882#endif /* CONFIG_MACSEC */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004883
4884 /**
4885 * init_mesh - Driver specific initialization for mesh
4886 * @priv: Private driver interface data
4887 * Returns: 0 on success, -1 on failure
4888 */
4889 int (*init_mesh)(void *priv);
4890
4891 /**
4892 * join_mesh - Join a mesh network
4893 * @priv: Private driver interface data
4894 * @params: Mesh configuration parameters
4895 * Returns: 0 on success, -1 on failure
4896 */
4897 int (*join_mesh)(void *priv,
4898 struct wpa_driver_mesh_join_params *params);
4899
4900 /**
4901 * leave_mesh - Leave a mesh network
4902 * @priv: Private driver interface data
4903 * Returns 0 on success, -1 on failure
4904 */
4905 int (*leave_mesh)(void *priv);
4906
4907 /**
Hai Shalom81f62d82019-07-22 12:10:00 -07004908 * probe_mesh_link - Inject a frame over direct mesh link to a given
4909 * peer skipping the next_hop lookup from mpath table.
4910 * @priv: Private driver interface data
4911 * @addr: Peer MAC address
4912 * @eth: Ethernet frame to be sent
4913 * @len: Ethernet frame lengtn in bytes
4914 * Returns 0 on success, -1 on failure
4915 */
4916 int (*probe_mesh_link)(void *priv, const u8 *addr, const u8 *eth,
4917 size_t len);
4918
4919 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004920 * do_acs - Automatically select channel
4921 * @priv: Private driver interface data
4922 * @params: Parameters for ACS
4923 * Returns 0 on success, -1 on failure
4924 *
4925 * This command can be used to offload ACS to the driver if the driver
4926 * indicates support for such offloading (WPA_DRIVER_FLAGS_ACS_OFFLOAD).
4927 */
4928 int (*do_acs)(void *priv, struct drv_acs_params *params);
Ravi Joshie6ccb162015-07-16 17:45:41 -07004929
4930 /**
Hai Shalom60840252021-02-19 19:02:11 -08004931 * set_band - Notify driver of band(s) selection
Ravi Joshie6ccb162015-07-16 17:45:41 -07004932 * @priv: Private driver interface data
Hai Shalom60840252021-02-19 19:02:11 -08004933 * @band_mask: The selected band(s) bit mask (from enum set_band)
Ravi Joshie6ccb162015-07-16 17:45:41 -07004934 * Returns 0 on success, -1 on failure
4935 */
Hai Shalom60840252021-02-19 19:02:11 -08004936 int (*set_band)(void *priv, u32 band_mask);
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08004937
4938 /**
4939 * get_pref_freq_list - Get preferred frequency list for an interface
4940 * @priv: Private driver interface data
4941 * @if_type: Interface type
4942 * @num: Number of channels
Sunil8cd6f4d2022-06-28 18:40:46 +00004943 * @freq_list: Weighted preferred channel list
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08004944 * Returns 0 on success, -1 on failure
4945 *
4946 * This command can be used to query the preferred frequency list from
Sunil8cd6f4d2022-06-28 18:40:46 +00004947 * the driver specific to a particular interface type. The freq_list
4948 * array needs to have room for *num entries. *num will be updated to
4949 * indicate the number of entries fetched from the driver.
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08004950 */
4951 int (*get_pref_freq_list)(void *priv, enum wpa_driver_if_type if_type,
Sunil8cd6f4d2022-06-28 18:40:46 +00004952 unsigned int *num,
4953 struct weighted_pcl *freq_list);
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08004954
4955 /**
4956 * set_prob_oper_freq - Indicate probable P2P operating channel
4957 * @priv: Private driver interface data
4958 * @freq: Channel frequency in MHz
4959 * Returns 0 on success, -1 on failure
4960 *
4961 * This command can be used to inform the driver of the operating
4962 * frequency that an ongoing P2P group formation is likely to come up
4963 * on. Local device is assuming P2P Client role.
4964 */
4965 int (*set_prob_oper_freq)(void *priv, unsigned int freq);
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08004966
4967 /**
4968 * abort_scan - Request the driver to abort an ongoing scan
4969 * @priv: Private driver interface data
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004970 * @scan_cookie: Cookie identifying the scan request. This is used only
4971 * when the vendor interface QCA_NL80211_VENDOR_SUBCMD_TRIGGER_SCAN
4972 * was used to trigger scan. Otherwise, 0 is used.
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08004973 * Returns 0 on success, -1 on failure
4974 */
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004975 int (*abort_scan)(void *priv, u64 scan_cookie);
Dmitry Shmidt849734c2016-05-27 09:59:01 -07004976
4977 /**
4978 * configure_data_frame_filters - Request to configure frame filters
4979 * @priv: Private driver interface data
4980 * @filter_flags: The type of frames to filter (bitfield of
4981 * WPA_DATA_FRAME_FILTER_FLAG_*)
4982 * Returns: 0 on success or -1 on failure
4983 */
4984 int (*configure_data_frame_filters)(void *priv, u32 filter_flags);
Dmitry Shmidtd5ab1b52016-06-21 12:38:41 -07004985
4986 /**
4987 * get_ext_capab - Get extended capabilities for the specified interface
4988 * @priv: Private driver interface data
4989 * @type: Interface type for which to get extended capabilities
4990 * @ext_capab: Extended capabilities fetched
4991 * @ext_capab_mask: Extended capabilities mask
4992 * @ext_capab_len: Length of the extended capabilities
4993 * Returns: 0 on success or -1 on failure
4994 */
4995 int (*get_ext_capab)(void *priv, enum wpa_driver_if_type type,
4996 const u8 **ext_capab, const u8 **ext_capab_mask,
4997 unsigned int *ext_capab_len);
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07004998
4999 /**
Sunil Ravi2a14cf12023-11-21 00:54:38 +00005000 * get_mld_capab - Get MLD capabilities for the specified interface
5001 * @priv: Private driver interface data
5002 * @type: Interface type for which to get MLD capabilities
5003 * @eml_capa: EML capabilities
5004 * @mld_capa_and_ops: MLD Capabilities and Operations
5005 * Returns: 0 on success or -1 on failure
5006 */
5007 int (*get_mld_capab)(void *priv, enum wpa_driver_if_type type,
5008 u16 *eml_capa, u16 *mld_capa_and_ops);
5009
5010 /**
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07005011 * p2p_lo_start - Start offloading P2P listen to device
5012 * @priv: Private driver interface data
5013 * @freq: Listening frequency (MHz) for P2P listen
5014 * @period: Length of the listen operation in milliseconds
5015 * @interval: Interval for running the listen operation in milliseconds
5016 * @count: Number of times to run the listen operation
5017 * @device_types: Device primary and secondary types
5018 * @dev_types_len: Number of bytes for device_types
5019 * @ies: P2P IE and WSC IE for Probe Response frames
5020 * @ies_len: Length of ies in bytes
5021 * Returns: 0 on success or -1 on failure
5022 */
5023 int (*p2p_lo_start)(void *priv, unsigned int freq,
5024 unsigned int period, unsigned int interval,
5025 unsigned int count,
5026 const u8 *device_types, size_t dev_types_len,
5027 const u8 *ies, size_t ies_len);
5028
5029 /**
5030 * p2p_lo_stop - Stop P2P listen offload
5031 * @priv: Private driver interface data
5032 * Returns: 0 on success or -1 on failure
5033 */
5034 int (*p2p_lo_stop)(void *priv);
Dmitry Shmidt7f2c7532016-08-15 09:48:12 -07005035
5036 /**
5037 * set_default_scan_ies - Set default scan IEs
5038 * @priv: Private driver interface data
5039 * @ies: Scan default IEs buffer
5040 * @ies_len: Length of IEs in bytes
5041 * Returns: 0 on success or -1 on failure
5042 *
5043 * The driver can use these by default when there are no scan IEs coming
5044 * in the subsequent scan requests. Also in case of one or more of IEs
5045 * given in set_default_scan_ies() are missing in the subsequent scan
5046 * request, the driver should merge the missing scan IEs in the scan
5047 * request from the IEs set by set_default_scan_ies() in the Probe
5048 * Request frames sent.
5049 */
5050 int (*set_default_scan_ies)(void *priv, const u8 *ies, size_t ies_len);
5051
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08005052 /**
5053 * set_tdls_mode - Set TDLS trigger mode to the host driver
5054 * @priv: Private driver interface data
5055 * @tdls_external_control: Represents if TDLS external trigger control
5056 * mode is enabled/disabled.
5057 *
5058 * This optional callback can be used to configure the TDLS external
5059 * trigger control mode to the host driver.
5060 */
5061 int (*set_tdls_mode)(void *priv, int tdls_external_control);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005062
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005063 /**
5064 * get_bss_transition_status - Get candidate BSS's transition status
5065 * @priv: Private driver interface data
5066 * @params: Candidate BSS list
5067 *
5068 * Get the accept or reject reason code for a list of BSS transition
5069 * candidates.
5070 */
5071 struct wpa_bss_candidate_info *
5072 (*get_bss_transition_status)(void *priv,
5073 struct wpa_bss_trans_info *params);
5074 /**
5075 * ignore_assoc_disallow - Configure driver to ignore assoc_disallow
5076 * @priv: Private driver interface data
5077 * @ignore_disallow: 0 to not ignore, 1 to ignore
5078 * Returns: 0 on success, -1 on failure
5079 */
5080 int (*ignore_assoc_disallow)(void *priv, int ignore_disallow);
5081
5082 /**
Hai Shalom899fcc72020-10-19 14:38:18 -07005083 * set_bssid_tmp_disallow - Set disallowed BSSIDs to the driver
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005084 * @priv: Private driver interface data
Hai Shalom899fcc72020-10-19 14:38:18 -07005085 * @num_bssid: Number of temporarily disallowed BSSIDs
5086 * @bssids: List of temporarily disallowed BSSIDs
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005087 */
Hai Shalom899fcc72020-10-19 14:38:18 -07005088 int (*set_bssid_tmp_disallow)(void *priv, unsigned int num_bssid,
5089 const u8 *bssid);
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005090
5091 /**
5092 * update_connect_params - Update the connection parameters
5093 * @priv: Private driver interface data
5094 * @params: Association parameters
5095 * @mask: Bit mask indicating which parameters in @params have to be
5096 * updated
5097 * Returns: 0 on success, -1 on failure
5098 *
5099 * Update the connection parameters when in connected state so that the
5100 * driver uses the updated parameters for subsequent roaming. This is
5101 * used only with drivers that implement internal BSS selection and
5102 * roaming.
5103 */
5104 int (*update_connect_params)(
5105 void *priv, struct wpa_driver_associate_params *params,
5106 enum wpa_drv_update_connect_params_mask mask);
Roshan Pius3a1667e2018-07-03 15:17:14 -07005107
5108 /**
5109 * send_external_auth_status - Indicate the status of external
5110 * authentication processing to the host driver.
5111 * @priv: Private driver interface data
5112 * @params: Status of authentication processing.
5113 * Returns: 0 on success, -1 on failure
5114 */
5115 int (*send_external_auth_status)(void *priv,
5116 struct external_auth *params);
Hai Shalom74f70d42019-02-11 14:42:39 -08005117
5118 /**
5119 * set_4addr_mode - Set 4-address mode
5120 * @priv: Private driver interface data
5121 * @bridge_ifname: Bridge interface name
5122 * @val: 0 - disable 4addr mode, 1 - enable 4addr mode
5123 * Returns: 0 on success, < 0 on failure
5124 */
5125 int (*set_4addr_mode)(void *priv, const char *bridge_ifname, int val);
Hai Shalom81f62d82019-07-22 12:10:00 -07005126
5127 /**
5128 * update_dh_ie - Update DH IE
5129 * @priv: Private driver interface data
5130 * @peer_mac: Peer MAC address
5131 * @reason_code: Reacon code
5132 * @ie: DH IE
5133 * @ie_len: DH IE length in bytes
5134 * Returns: 0 on success, -1 on failure
5135 *
5136 * This callback is used to let the driver know the DH processing result
5137 * and DH IE for a pending association.
5138 */
5139 int (*update_dh_ie)(void *priv, const u8 *peer_mac, u16 reason_code,
5140 const u8 *ie, size_t ie_len);
Hai Shalomb755a2a2020-04-23 21:49:02 -07005141
5142 /**
5143 * dpp_listen - Notify driver about start/stop of DPP listen
5144 * @priv: Private driver interface data
5145 * @enable: Whether listen state is enabled (or disabled)
5146 * Returns: 0 on success, -1 on failure
5147 *
5148 * This optional callback can be used to update RX frame filtering to
5149 * explicitly allow reception of broadcast Public Action frames.
5150 */
Hai Shalome21d4e82020-04-29 16:34:06 -07005151 int (*dpp_listen)(void *priv, bool enable);
Hai Shalomc1a21442022-02-04 13:43:00 -08005152
Sunil Ravi89eba102022-09-13 21:04:37 -07005153 /**
5154 * set_secure_ranging_ctx - Add or delete secure ranging parameters of
5155 * the specified peer to the driver.
5156 * @priv: Private driver interface data
5157 * @params: Secure ranging parameters
5158 * Returns: 0 on success, -1 on failure
5159 *
5160 */
5161 int (*set_secure_ranging_ctx)(void *priv,
5162 struct secure_ranging_params *params);
5163
5164 /**
5165 * send_pasn_resp - Send PASN response for a set of peers to the
5166 * driver.
5167 * @priv: Private driver interface data
5168 * @params: Parameters holding peers and respective status.
5169 * Returns: 0 on success, -1 on failure
5170 */
5171 int (*send_pasn_resp)(void *priv, struct pasn_auth *params);
5172
5173 /**
5174 * get_sta_mlo_info - Get the current multi-link association info
5175 * @priv: Private driver interface data
5176 * @mlo: Pointer to fill multi-link association info
5177 * Returns: 0 on success, -1 on failure
5178 *
5179 * This callback is used to fetch multi-link of the current association.
5180 */
5181 int (*get_sta_mlo_info)(void *priv,
5182 struct driver_sta_mlo_info *mlo_info);
5183
Sunil Ravi036cec52023-03-29 11:35:17 -07005184 /**
5185 * link_add - Add a link to the AP MLD interface
5186 * @priv: Private driver interface data
5187 * @link_id: The link ID
5188 * @addr: The MAC address to use for the link
Sunil Ravi99c035e2024-07-12 01:42:03 +00005189 * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces
Sunil Ravi036cec52023-03-29 11:35:17 -07005190 * Returns: 0 on success, negative value on failure
5191 */
Sunil Ravi99c035e2024-07-12 01:42:03 +00005192 int (*link_add)(void *priv, u8 link_id, const u8 *addr, void *bss_ctx);
5193
5194 /**
5195 * link_remove - Remove a link from the AP MLD interface
5196 * @priv: Private driver interface data
5197 * @type: Interface type
5198 * @ifname: Interface name of the virtual interface from where the link
5199 * is to be removed.
5200 * @link_id: Valid link ID to remove
5201 * Returns: 0 on success, -1 on failure
5202 */
5203 int (*link_remove)(void *priv, enum wpa_driver_if_type type,
5204 const char *ifname, u8 link_id);
5205
5206 /**
5207 * is_drv_shared - Check whether the driver interface is shared
5208 * @priv: Private driver interface data from init()
5209 * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces
5210 *
5211 * Checks whether the driver interface is being used by other partner
5212 * BSS(s) or not. This is used to decide whether the driver interface
5213 * needs to be deinitilized when one interface is getting deinitialized.
5214 *
5215 * Returns: true if it is being used or else false.
5216 */
5217 bool (*is_drv_shared)(void *priv, void *bss_ctx);
5218
5219 /**
5220 * link_sta_remove - Remove a link STA from an MLD STA
5221 * @priv: Private driver interface data
5222 * @link_id: The link ID which the link STA is using
5223 * @addr: The MLD MAC address of the MLD STA
5224 * Returns: 0 on success, negative value on failure
5225 */
5226 int (*link_sta_remove)(void *priv, u8 link_id, const u8 *addr);
Sunil Ravi036cec52023-03-29 11:35:17 -07005227
Hai Shalomc1a21442022-02-04 13:43:00 -08005228#ifdef CONFIG_TESTING_OPTIONS
5229 int (*register_frame)(void *priv, u16 type,
5230 const u8 *match, size_t match_len,
5231 bool multicast);
5232#endif /* CONFIG_TESTING_OPTIONS */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005233};
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005234
5235/**
5236 * enum wpa_event_type - Event type for wpa_supplicant_event() calls
5237 */
5238enum wpa_event_type {
5239 /**
5240 * EVENT_ASSOC - Association completed
5241 *
5242 * This event needs to be delivered when the driver completes IEEE
5243 * 802.11 association or reassociation successfully.
5244 * wpa_driver_ops::get_bssid() is expected to provide the current BSSID
5245 * after this event has been generated. In addition, optional
5246 * EVENT_ASSOCINFO may be generated just before EVENT_ASSOC to provide
5247 * more information about the association. If the driver interface gets
5248 * both of these events at the same time, it can also include the
5249 * assoc_info data in EVENT_ASSOC call.
5250 */
5251 EVENT_ASSOC,
5252
5253 /**
5254 * EVENT_DISASSOC - Association lost
5255 *
5256 * This event should be called when association is lost either due to
5257 * receiving deauthenticate or disassociate frame from the AP or when
5258 * sending either of these frames to the current AP. If the driver
5259 * supports separate deauthentication event, EVENT_DISASSOC should only
5260 * be used for disassociation and EVENT_DEAUTH for deauthentication.
5261 * In AP mode, union wpa_event_data::disassoc_info is required.
5262 */
5263 EVENT_DISASSOC,
5264
5265 /**
5266 * EVENT_MICHAEL_MIC_FAILURE - Michael MIC (TKIP) detected
5267 *
5268 * This event must be delivered when a Michael MIC error is detected by
5269 * the local driver. Additional data for event processing is
5270 * provided with union wpa_event_data::michael_mic_failure. This
Sunil Ravia04bd252022-05-02 22:54:18 -07005271 * information is used to request new encryption key and to initiate
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005272 * TKIP countermeasures if needed.
5273 */
5274 EVENT_MICHAEL_MIC_FAILURE,
5275
5276 /**
5277 * EVENT_SCAN_RESULTS - Scan results available
5278 *
5279 * This event must be called whenever scan results are available to be
5280 * fetched with struct wpa_driver_ops::get_scan_results(). This event
5281 * is expected to be used some time after struct wpa_driver_ops::scan()
5282 * is called. If the driver provides an unsolicited event when the scan
5283 * has been completed, this event can be used to trigger
5284 * EVENT_SCAN_RESULTS call. If such event is not available from the
5285 * driver, the driver wrapper code is expected to use a registered
5286 * timeout to generate EVENT_SCAN_RESULTS call after the time that the
5287 * scan is expected to be completed. Optional information about
5288 * completed scan can be provided with union wpa_event_data::scan_info.
5289 */
5290 EVENT_SCAN_RESULTS,
5291
5292 /**
5293 * EVENT_ASSOCINFO - Report optional extra information for association
5294 *
5295 * This event can be used to report extra association information for
5296 * EVENT_ASSOC processing. This extra information includes IEs from
5297 * association frames and Beacon/Probe Response frames in union
5298 * wpa_event_data::assoc_info. EVENT_ASSOCINFO must be send just before
5299 * EVENT_ASSOC. Alternatively, the driver interface can include
5300 * assoc_info data in the EVENT_ASSOC call if it has all the
5301 * information available at the same point.
5302 */
5303 EVENT_ASSOCINFO,
5304
5305 /**
5306 * EVENT_INTERFACE_STATUS - Report interface status changes
5307 *
5308 * This optional event can be used to report changes in interface
5309 * status (interface added/removed) using union
5310 * wpa_event_data::interface_status. This can be used to trigger
5311 * wpa_supplicant to stop and re-start processing for the interface,
5312 * e.g., when a cardbus card is ejected/inserted.
5313 */
5314 EVENT_INTERFACE_STATUS,
5315
5316 /**
5317 * EVENT_PMKID_CANDIDATE - Report a candidate AP for pre-authentication
5318 *
5319 * This event can be used to inform wpa_supplicant about candidates for
5320 * RSN (WPA2) pre-authentication. If wpa_supplicant is not responsible
5321 * for scan request (ap_scan=2 mode), this event is required for
5322 * pre-authentication. If wpa_supplicant is performing scan request
5323 * (ap_scan=1), this event is optional since scan results can be used
5324 * to add pre-authentication candidates. union
5325 * wpa_event_data::pmkid_candidate is used to report the BSSID of the
5326 * candidate and priority of the candidate, e.g., based on the signal
5327 * strength, in order to try to pre-authenticate first with candidates
5328 * that are most likely targets for re-association.
5329 *
5330 * EVENT_PMKID_CANDIDATE can be called whenever the driver has updates
5331 * on the candidate list. In addition, it can be called for the current
5332 * AP and APs that have existing PMKSA cache entries. wpa_supplicant
5333 * will automatically skip pre-authentication in cases where a valid
5334 * PMKSA exists. When more than one candidate exists, this event should
5335 * be generated once for each candidate.
5336 *
5337 * Driver will be notified about successful pre-authentication with
5338 * struct wpa_driver_ops::add_pmkid() calls.
5339 */
5340 EVENT_PMKID_CANDIDATE,
5341
5342 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005343 * EVENT_TDLS - Request TDLS operation
5344 *
5345 * This event can be used to request a TDLS operation to be performed.
5346 */
5347 EVENT_TDLS,
5348
5349 /**
5350 * EVENT_FT_RESPONSE - Report FT (IEEE 802.11r) response IEs
5351 *
5352 * The driver is expected to report the received FT IEs from
5353 * FT authentication sequence from the AP. The FT IEs are included in
5354 * the extra information in union wpa_event_data::ft_ies.
5355 */
5356 EVENT_FT_RESPONSE,
5357
5358 /**
5359 * EVENT_IBSS_RSN_START - Request RSN authentication in IBSS
5360 *
5361 * The driver can use this event to inform wpa_supplicant about a STA
5362 * in an IBSS with which protected frames could be exchanged. This
5363 * event starts RSN authentication with the other STA to authenticate
5364 * the STA and set up encryption keys with it.
5365 */
5366 EVENT_IBSS_RSN_START,
5367
5368 /**
5369 * EVENT_AUTH - Authentication result
5370 *
5371 * This event should be called when authentication attempt has been
5372 * completed. This is only used if the driver supports separate
5373 * authentication step (struct wpa_driver_ops::authenticate).
5374 * Information about authentication result is included in
5375 * union wpa_event_data::auth.
5376 */
5377 EVENT_AUTH,
5378
5379 /**
5380 * EVENT_DEAUTH - Authentication lost
5381 *
5382 * This event should be called when authentication is lost either due
5383 * to receiving deauthenticate frame from the AP or when sending that
5384 * frame to the current AP.
5385 * In AP mode, union wpa_event_data::deauth_info is required.
5386 */
5387 EVENT_DEAUTH,
5388
5389 /**
5390 * EVENT_ASSOC_REJECT - Association rejected
5391 *
5392 * This event should be called when (re)association attempt has been
5393 * rejected by the AP. Information about the association response is
5394 * included in union wpa_event_data::assoc_reject.
5395 */
5396 EVENT_ASSOC_REJECT,
5397
5398 /**
5399 * EVENT_AUTH_TIMED_OUT - Authentication timed out
5400 */
5401 EVENT_AUTH_TIMED_OUT,
5402
5403 /**
5404 * EVENT_ASSOC_TIMED_OUT - Association timed out
5405 */
5406 EVENT_ASSOC_TIMED_OUT,
5407
5408 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005409 * EVENT_WPS_BUTTON_PUSHED - Report hardware push button press for WPS
5410 */
5411 EVENT_WPS_BUTTON_PUSHED,
5412
5413 /**
5414 * EVENT_TX_STATUS - Report TX status
5415 */
5416 EVENT_TX_STATUS,
5417
5418 /**
5419 * EVENT_RX_FROM_UNKNOWN - Report RX from unknown STA
5420 */
5421 EVENT_RX_FROM_UNKNOWN,
5422
5423 /**
5424 * EVENT_RX_MGMT - Report RX of a management frame
5425 */
5426 EVENT_RX_MGMT,
5427
5428 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005429 * EVENT_REMAIN_ON_CHANNEL - Remain-on-channel duration started
5430 *
5431 * This event is used to indicate when the driver has started the
5432 * requested remain-on-channel duration. Information about the
5433 * operation is included in union wpa_event_data::remain_on_channel.
5434 */
5435 EVENT_REMAIN_ON_CHANNEL,
5436
5437 /**
5438 * EVENT_CANCEL_REMAIN_ON_CHANNEL - Remain-on-channel timed out
5439 *
5440 * This event is used to indicate when the driver has completed
5441 * remain-on-channel duration, i.e., may noot be available on the
5442 * requested channel anymore. Information about the
5443 * operation is included in union wpa_event_data::remain_on_channel.
5444 */
5445 EVENT_CANCEL_REMAIN_ON_CHANNEL,
5446
5447 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005448 * EVENT_RX_PROBE_REQ - Indicate received Probe Request frame
5449 *
5450 * This event is used to indicate when a Probe Request frame has been
5451 * received. Information about the received frame is included in
5452 * union wpa_event_data::rx_probe_req. The driver is required to report
5453 * these events only after successfully completed probe_req_report()
5454 * commands to request the events (i.e., report parameter is non-zero)
5455 * in station mode. In AP mode, Probe Request frames should always be
5456 * reported.
5457 */
5458 EVENT_RX_PROBE_REQ,
5459
5460 /**
5461 * EVENT_NEW_STA - New wired device noticed
5462 *
5463 * This event is used to indicate that a new device has been detected
5464 * in a network that does not use association-like functionality (i.e.,
5465 * mainly wired Ethernet). This can be used to start EAPOL
5466 * authenticator when receiving a frame from a device. The address of
5467 * the device is included in union wpa_event_data::new_sta.
5468 */
5469 EVENT_NEW_STA,
5470
5471 /**
5472 * EVENT_EAPOL_RX - Report received EAPOL frame
5473 *
5474 * When in AP mode with hostapd, this event is required to be used to
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08005475 * deliver the receive EAPOL frames from the driver.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005476 */
5477 EVENT_EAPOL_RX,
5478
5479 /**
5480 * EVENT_SIGNAL_CHANGE - Indicate change in signal strength
5481 *
5482 * This event is used to indicate changes in the signal strength
5483 * observed in frames received from the current AP if signal strength
5484 * monitoring has been enabled with signal_monitor().
5485 */
5486 EVENT_SIGNAL_CHANGE,
5487
5488 /**
5489 * EVENT_INTERFACE_ENABLED - Notify that interface was enabled
5490 *
5491 * This event is used to indicate that the interface was enabled after
5492 * having been previously disabled, e.g., due to rfkill.
5493 */
5494 EVENT_INTERFACE_ENABLED,
5495
5496 /**
5497 * EVENT_INTERFACE_DISABLED - Notify that interface was disabled
5498 *
5499 * This event is used to indicate that the interface was disabled,
5500 * e.g., due to rfkill.
5501 */
5502 EVENT_INTERFACE_DISABLED,
5503
5504 /**
5505 * EVENT_CHANNEL_LIST_CHANGED - Channel list changed
5506 *
5507 * This event is used to indicate that the channel list has changed,
5508 * e.g., because of a regulatory domain change triggered by scan
5509 * results including an AP advertising a country code.
5510 */
5511 EVENT_CHANNEL_LIST_CHANGED,
5512
5513 /**
5514 * EVENT_INTERFACE_UNAVAILABLE - Notify that interface is unavailable
5515 *
5516 * This event is used to indicate that the driver cannot maintain this
5517 * interface in its operation mode anymore. The most likely use for
5518 * this is to indicate that AP mode operation is not available due to
5519 * operating channel would need to be changed to a DFS channel when
5520 * the driver does not support radar detection and another virtual
5521 * interfaces caused the operating channel to change. Other similar
5522 * resource conflicts could also trigger this for station mode
Dmitry Shmidtd30ac602014-06-30 09:54:22 -07005523 * interfaces. This event can be propagated when channel switching
5524 * fails.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005525 */
5526 EVENT_INTERFACE_UNAVAILABLE,
5527
5528 /**
5529 * EVENT_BEST_CHANNEL
5530 *
5531 * Driver generates this event whenever it detects a better channel
5532 * (e.g., based on RSSI or channel use). This information can be used
5533 * to improve channel selection for a new AP/P2P group.
5534 */
5535 EVENT_BEST_CHANNEL,
5536
5537 /**
5538 * EVENT_UNPROT_DEAUTH - Unprotected Deauthentication frame received
5539 *
5540 * This event should be called when a Deauthentication frame is dropped
5541 * due to it not being protected (MFP/IEEE 802.11w).
5542 * union wpa_event_data::unprot_deauth is required to provide more
5543 * details of the frame.
5544 */
5545 EVENT_UNPROT_DEAUTH,
5546
5547 /**
5548 * EVENT_UNPROT_DISASSOC - Unprotected Disassociation frame received
5549 *
5550 * This event should be called when a Disassociation frame is dropped
5551 * due to it not being protected (MFP/IEEE 802.11w).
5552 * union wpa_event_data::unprot_disassoc is required to provide more
5553 * details of the frame.
5554 */
5555 EVENT_UNPROT_DISASSOC,
5556
5557 /**
5558 * EVENT_STATION_LOW_ACK
5559 *
5560 * Driver generates this event whenever it detected that a particular
5561 * station was lost. Detection can be through massive transmission
5562 * failures for example.
5563 */
5564 EVENT_STATION_LOW_ACK,
5565
5566 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005567 * EVENT_IBSS_PEER_LOST - IBSS peer not reachable anymore
5568 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08005569 EVENT_IBSS_PEER_LOST,
5570
5571 /**
5572 * EVENT_DRIVER_GTK_REKEY - Device/driver did GTK rekey
5573 *
5574 * This event carries the new replay counter to notify wpa_supplicant
5575 * of the current EAPOL-Key Replay Counter in case the driver/firmware
5576 * completed Group Key Handshake while the host (including
5577 * wpa_supplicant was sleeping).
5578 */
5579 EVENT_DRIVER_GTK_REKEY,
5580
5581 /**
5582 * EVENT_SCHED_SCAN_STOPPED - Scheduled scan was stopped
5583 */
5584 EVENT_SCHED_SCAN_STOPPED,
5585
5586 /**
5587 * EVENT_DRIVER_CLIENT_POLL_OK - Station responded to poll
5588 *
5589 * This event indicates that the station responded to the poll
5590 * initiated with @poll_client.
5591 */
5592 EVENT_DRIVER_CLIENT_POLL_OK,
5593
5594 /**
5595 * EVENT_EAPOL_TX_STATUS - notify of EAPOL TX status
5596 */
Dmitry Shmidt04949592012-07-19 12:16:46 -07005597 EVENT_EAPOL_TX_STATUS,
5598
5599 /**
5600 * EVENT_CH_SWITCH - AP or GO decided to switch channels
5601 *
5602 * Described in wpa_event_data.ch_switch
5603 * */
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07005604 EVENT_CH_SWITCH,
5605
5606 /**
Hai Shalom81f62d82019-07-22 12:10:00 -07005607 * EVENT_CH_SWITCH_STARTED - AP or GO started to switch channels
5608 *
5609 * This is a pre-switch event indicating the shortly following switch
5610 * of operating channels.
5611 *
5612 * Described in wpa_event_data.ch_switch
5613 */
5614 EVENT_CH_SWITCH_STARTED,
5615 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07005616 * EVENT_WNM - Request WNM operation
5617 *
5618 * This event can be used to request a WNM operation to be performed.
5619 */
Dmitry Shmidtf8623282013-02-20 14:34:59 -08005620 EVENT_WNM,
5621
5622 /**
5623 * EVENT_CONNECT_FAILED_REASON - Connection failure reason in AP mode
5624 *
5625 * This event indicates that the driver reported a connection failure
5626 * with the specified client (for example, max client reached, etc.) in
5627 * AP mode.
5628 */
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005629 EVENT_CONNECT_FAILED_REASON,
5630
5631 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005632 * EVENT_DFS_RADAR_DETECTED - Notify of radar detection
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005633 *
5634 * A radar has been detected on the supplied frequency, hostapd should
5635 * react accordingly (e.g., change channel).
5636 */
5637 EVENT_DFS_RADAR_DETECTED,
5638
5639 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005640 * EVENT_DFS_CAC_FINISHED - Notify that channel availability check has been completed
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005641 *
5642 * After a successful CAC, the channel can be marked clear and used.
5643 */
5644 EVENT_DFS_CAC_FINISHED,
5645
5646 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005647 * EVENT_DFS_CAC_ABORTED - Notify that channel availability check has been aborted
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005648 *
5649 * The CAC was not successful, and the channel remains in the previous
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08005650 * state. This may happen due to a radar being detected or other
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005651 * external influences.
5652 */
5653 EVENT_DFS_CAC_ABORTED,
5654
5655 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005656 * EVENT_DFS_NOP_FINISHED - Notify that non-occupancy period is over
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005657 *
5658 * The channel which was previously unavailable is now available again.
5659 */
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07005660 EVENT_DFS_NOP_FINISHED,
5661
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08005662 /**
5663 * EVENT_SURVEY - Received survey data
5664 *
5665 * This event gets triggered when a driver query is issued for survey
5666 * data and the requested data becomes available. The returned data is
5667 * stored in struct survey_results. The results provide at most one
5668 * survey entry for each frequency and at minimum will provide one
5669 * survey entry for one frequency. The survey data can be os_malloc()'d
5670 * and then os_free()'d, so the event callback must only copy data.
5671 */
5672 EVENT_SURVEY,
5673
5674 /**
5675 * EVENT_SCAN_STARTED - Scan started
5676 *
5677 * This indicates that driver has started a scan operation either based
5678 * on a request from wpa_supplicant/hostapd or from another application.
5679 * EVENT_SCAN_RESULTS is used to indicate when the scan has been
5680 * completed (either successfully or by getting cancelled).
5681 */
Dmitry Shmidtcf32e602014-01-28 10:57:39 -08005682 EVENT_SCAN_STARTED,
5683
5684 /**
5685 * EVENT_AVOID_FREQUENCIES - Received avoid frequency range
5686 *
5687 * This event indicates a set of frequency ranges that should be avoided
5688 * to reduce issues due to interference or internal co-existence
5689 * information in the driver.
5690 */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08005691 EVENT_AVOID_FREQUENCIES,
5692
5693 /**
5694 * EVENT_NEW_PEER_CANDIDATE - new (unknown) mesh peer notification
5695 */
5696 EVENT_NEW_PEER_CANDIDATE,
5697
5698 /**
5699 * EVENT_ACS_CHANNEL_SELECTED - Received selected channels by ACS
5700 *
5701 * Indicates a pair of primary and secondary channels chosen by ACS
5702 * in device.
5703 */
5704 EVENT_ACS_CHANNEL_SELECTED,
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005705
5706 /**
5707 * EVENT_DFS_CAC_STARTED - Notify that channel availability check has
5708 * been started.
5709 *
5710 * This event indicates that channel availability check has been started
5711 * on a DFS frequency by a driver that supports DFS Offload.
5712 */
5713 EVENT_DFS_CAC_STARTED,
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07005714
5715 /**
5716 * EVENT_P2P_LO_STOP - Notify that P2P listen offload is stopped
5717 */
5718 EVENT_P2P_LO_STOP,
Paul Stewart092955c2017-02-06 09:13:09 -08005719
5720 /**
5721 * EVENT_BEACON_LOSS - Beacon loss detected
5722 *
5723 * This event indicates that no Beacon frames has been received from
5724 * the current AP. This may indicate that the AP is not anymore in
5725 * range.
5726 */
5727 EVENT_BEACON_LOSS,
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005728
5729 /**
5730 * EVENT_DFS_PRE_CAC_EXPIRED - Notify that channel availability check
5731 * done previously (Pre-CAC) on the channel has expired. This would
5732 * normally be on a non-ETSI DFS regulatory domain. DFS state of the
5733 * channel will be moved from available to usable. A new CAC has to be
5734 * performed before start operating on this channel.
5735 */
5736 EVENT_DFS_PRE_CAC_EXPIRED,
Roshan Pius3a1667e2018-07-03 15:17:14 -07005737
5738 /**
5739 * EVENT_EXTERNAL_AUTH - This event interface is used by host drivers
5740 * that do not define separate commands for authentication and
5741 * association (~WPA_DRIVER_FLAGS_SME) but offload the 802.11
5742 * authentication to wpa_supplicant. This event carries all the
5743 * necessary information from the host driver for the authentication to
5744 * happen.
5745 */
5746 EVENT_EXTERNAL_AUTH,
5747
5748 /**
5749 * EVENT_PORT_AUTHORIZED - Notification that a connection is authorized
5750 *
5751 * This event should be indicated when the driver completes the 4-way
5752 * handshake. This event should be preceded by an EVENT_ASSOC that
5753 * indicates the completion of IEEE 802.11 association.
5754 */
5755 EVENT_PORT_AUTHORIZED,
5756
5757 /**
5758 * EVENT_STATION_OPMODE_CHANGED - Notify STA's HT/VHT operation mode
5759 * change event.
5760 */
5761 EVENT_STATION_OPMODE_CHANGED,
5762
5763 /**
5764 * EVENT_INTERFACE_MAC_CHANGED - Notify that interface MAC changed
5765 *
5766 * This event is emitted when the MAC changes while the interface is
5767 * enabled. When an interface was disabled and becomes enabled, it
5768 * must be always assumed that the MAC possibly changed.
5769 */
5770 EVENT_INTERFACE_MAC_CHANGED,
5771
5772 /**
5773 * EVENT_WDS_STA_INTERFACE_STATUS - Notify WDS STA interface status
5774 *
5775 * This event is emitted when an interface is added/removed for WDS STA.
5776 */
5777 EVENT_WDS_STA_INTERFACE_STATUS,
Hai Shalom81f62d82019-07-22 12:10:00 -07005778
5779 /**
5780 * EVENT_UPDATE_DH - Notification of updated DH information
5781 */
5782 EVENT_UPDATE_DH,
Hai Shalomfdcde762020-04-02 11:19:20 -07005783
5784 /**
5785 * EVENT_UNPROT_BEACON - Unprotected Beacon frame received
5786 *
5787 * This event should be called when a Beacon frame is dropped due to it
5788 * not being protected correctly. union wpa_event_data::unprot_beacon
5789 * is required to provide more details of the frame.
5790 */
5791 EVENT_UNPROT_BEACON,
Hai Shalomc1a21442022-02-04 13:43:00 -08005792
5793 /**
5794 * EVENT_TX_WAIT_EXPIRE - TX wait timed out
5795 *
5796 * This event is used to indicate when the driver has completed
5797 * wait for a response frame based on a TX request that specified a
5798 * non-zero wait time and that has not been explicitly cancelled.
5799 */
5800 EVENT_TX_WAIT_EXPIRE,
Sunil Ravia04bd252022-05-02 22:54:18 -07005801
5802 /**
5803 * EVENT_BSS_COLOR_COLLISION - Notification of a BSS color collision
5804 */
5805 EVENT_BSS_COLOR_COLLISION,
5806
5807 /**
5808 * EVENT_CCA_STARTED_NOTIFY - Notification that CCA has started
5809 */
5810 EVENT_CCA_STARTED_NOTIFY,
5811
5812 /**
5813 * EVENT_CCA_ABORTED_NOTIFY - Notification that CCA has aborted
5814 */
5815 EVENT_CCA_ABORTED_NOTIFY,
5816
5817 /**
5818 * EVENT_CCA_NOTIFY - Notification that CCA has completed
5819 */
5820 EVENT_CCA_NOTIFY,
Sunil Ravi89eba102022-09-13 21:04:37 -07005821
5822 /**
5823 * EVENT_PASN_AUTH - This event is used by the driver that requests
5824 * PASN authentication and secure ranging context for multiple peers.
5825 */
5826 EVENT_PASN_AUTH,
5827
5828 /**
5829 * EVENT_LINK_CH_SWITCH - MLD AP link decided to switch channels
5830 *
5831 * Described in wpa_event_data.ch_switch.
5832 *
5833 */
5834 EVENT_LINK_CH_SWITCH,
5835
5836 /**
5837 * EVENT_LINK_CH_SWITCH_STARTED - MLD AP link started to switch channels
5838 *
5839 * This is a pre-switch event indicating the shortly following switch
5840 * of operating channels.
5841 *
5842 * Described in wpa_event_data.ch_switch.
5843 */
5844 EVENT_LINK_CH_SWITCH_STARTED,
Sunil Ravi640215c2023-06-28 23:08:09 +00005845
5846 /**
5847 * EVENT_TID_LINK_MAP - MLD event to set TID-to-link mapping
5848 *
5849 * This event is used by the driver to indicate the received TID-to-link
5850 * mapping response from the associated AP MLD.
5851 *
5852 * Described in wpa_event_data.t2l_map_info.
5853 */
5854 EVENT_TID_LINK_MAP,
5855
5856 /**
5857 * EVENT_LINK_RECONFIG - Notification that AP links removed
5858 */
5859 EVENT_LINK_RECONFIG,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005860};
5861
5862
5863/**
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07005864 * struct freq_survey - Channel survey info
5865 *
5866 * @ifidx: Interface index in which this survey was observed
5867 * @freq: Center of frequency of the surveyed channel
5868 * @nf: Channel noise floor in dBm
5869 * @channel_time: Amount of time in ms the radio spent on the channel
5870 * @channel_time_busy: Amount of time in ms the radio detected some signal
5871 * that indicated to the radio the channel was not clear
5872 * @channel_time_rx: Amount of time the radio spent receiving data
5873 * @channel_time_tx: Amount of time the radio spent transmitting data
5874 * @filled: bitmask indicating which fields have been reported, see
5875 * SURVEY_HAS_* defines.
5876 * @list: Internal list pointers
5877 */
5878struct freq_survey {
5879 u32 ifidx;
5880 unsigned int freq;
5881 s8 nf;
5882 u64 channel_time;
5883 u64 channel_time_busy;
5884 u64 channel_time_rx;
5885 u64 channel_time_tx;
5886 unsigned int filled;
5887 struct dl_list list;
5888};
5889
5890#define SURVEY_HAS_NF BIT(0)
5891#define SURVEY_HAS_CHAN_TIME BIT(1)
5892#define SURVEY_HAS_CHAN_TIME_BUSY BIT(2)
5893#define SURVEY_HAS_CHAN_TIME_RX BIT(3)
5894#define SURVEY_HAS_CHAN_TIME_TX BIT(4)
5895
Hai Shalom60840252021-02-19 19:02:11 -08005896/**
5897 * enum sta_connect_fail_reason_codes - STA connect failure reason code values
5898 * @STA_CONNECT_FAIL_REASON_UNSPECIFIED: No reason code specified for
5899 * connection failure.
5900 * @STA_CONNECT_FAIL_REASON_NO_BSS_FOUND: No Probe Response frame received
5901 * for unicast Probe Request frame.
5902 * @STA_CONNECT_FAIL_REASON_AUTH_TX_FAIL: STA failed to send auth request.
5903 * @STA_CONNECT_FAIL_REASON_AUTH_NO_ACK_RECEIVED: AP didn't send ACK for
5904 * auth request.
5905 * @STA_CONNECT_FAIL_REASON_AUTH_NO_RESP_RECEIVED: Auth response is not
5906 * received from AP.
5907 * @STA_CONNECT_FAIL_REASON_ASSOC_REQ_TX_FAIL: STA failed to send
5908 * Association Request frame.
5909 * @STA_CONNECT_FAIL_REASON_ASSOC_NO_ACK_RECEIVED: AP didn't send ACK for
5910 * Association Request frame.
5911 * @STA_CONNECT_FAIL_REASON_ASSOC_NO_RESP_RECEIVED: Association Response
5912 * frame is not received from AP.
5913 */
5914enum sta_connect_fail_reason_codes {
5915 STA_CONNECT_FAIL_REASON_UNSPECIFIED = 0,
5916 STA_CONNECT_FAIL_REASON_NO_BSS_FOUND = 1,
5917 STA_CONNECT_FAIL_REASON_AUTH_TX_FAIL = 2,
5918 STA_CONNECT_FAIL_REASON_AUTH_NO_ACK_RECEIVED = 3,
5919 STA_CONNECT_FAIL_REASON_AUTH_NO_RESP_RECEIVED = 4,
5920 STA_CONNECT_FAIL_REASON_ASSOC_REQ_TX_FAIL = 5,
5921 STA_CONNECT_FAIL_REASON_ASSOC_NO_ACK_RECEIVED = 6,
5922 STA_CONNECT_FAIL_REASON_ASSOC_NO_RESP_RECEIVED = 7,
5923};
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07005924
5925/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005926 * union wpa_event_data - Additional data for wpa_supplicant_event() calls
5927 */
5928union wpa_event_data {
5929 /**
5930 * struct assoc_info - Data for EVENT_ASSOC and EVENT_ASSOCINFO events
5931 *
5932 * This structure is optional for EVENT_ASSOC calls and required for
5933 * EVENT_ASSOCINFO calls. By using EVENT_ASSOC with this data, the
5934 * driver interface does not need to generate separate EVENT_ASSOCINFO
5935 * calls.
5936 */
5937 struct assoc_info {
5938 /**
5939 * reassoc - Flag to indicate association or reassociation
5940 */
5941 int reassoc;
5942
5943 /**
5944 * req_ies - (Re)Association Request IEs
5945 *
5946 * If the driver generates WPA/RSN IE, this event data must be
5947 * returned for WPA handshake to have needed information. If
5948 * wpa_supplicant-generated WPA/RSN IE is used, this
5949 * information event is optional.
5950 *
5951 * This should start with the first IE (fixed fields before IEs
5952 * are not included).
5953 */
5954 const u8 *req_ies;
5955
5956 /**
5957 * req_ies_len - Length of req_ies in bytes
5958 */
5959 size_t req_ies_len;
5960
5961 /**
5962 * resp_ies - (Re)Association Response IEs
5963 *
5964 * Optional association data from the driver. This data is not
5965 * required WPA, but may be useful for some protocols and as
5966 * such, should be reported if this is available to the driver
5967 * interface.
5968 *
5969 * This should start with the first IE (fixed fields before IEs
5970 * are not included).
5971 */
5972 const u8 *resp_ies;
5973
5974 /**
5975 * resp_ies_len - Length of resp_ies in bytes
5976 */
5977 size_t resp_ies_len;
5978
5979 /**
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08005980 * resp_frame - (Re)Association Response frame
5981 */
5982 const u8 *resp_frame;
5983
5984 /**
5985 * resp_frame_len - (Re)Association Response frame length
5986 */
5987 size_t resp_frame_len;
5988
5989 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005990 * beacon_ies - Beacon or Probe Response IEs
5991 *
5992 * Optional Beacon/ProbeResp data: IEs included in Beacon or
5993 * Probe Response frames from the current AP (i.e., the one
5994 * that the client just associated with). This information is
5995 * used to update WPA/RSN IE for the AP. If this field is not
5996 * set, the results from previous scan will be used. If no
5997 * data for the new AP is found, scan results will be requested
5998 * again (without scan request). At this point, the driver is
5999 * expected to provide WPA/RSN IE for the AP (if WPA/WPA2 is
6000 * used).
6001 *
6002 * This should start with the first IE (fixed fields before IEs
6003 * are not included).
6004 */
6005 const u8 *beacon_ies;
6006
6007 /**
6008 * beacon_ies_len - Length of beacon_ies */
6009 size_t beacon_ies_len;
6010
6011 /**
6012 * freq - Frequency of the operational channel in MHz
6013 */
6014 unsigned int freq;
6015
6016 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006017 * wmm_params - WMM parameters used in this association.
6018 */
6019 struct wmm_params wmm_params;
6020
6021 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006022 * addr - Station address (for AP mode)
6023 */
6024 const u8 *addr;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006025
6026 /**
6027 * The following is the key management offload information
6028 * @authorized
6029 * @key_replay_ctr
6030 * @key_replay_ctr_len
6031 * @ptk_kck
6032 * @ptk_kek_len
6033 * @ptk_kek
6034 * @ptk_kek_len
6035 */
6036
6037 /**
6038 * authorized - Status of key management offload,
6039 * 1 = successful
6040 */
6041 int authorized;
6042
6043 /**
6044 * key_replay_ctr - Key replay counter value last used
6045 * in a valid EAPOL-Key frame
6046 */
6047 const u8 *key_replay_ctr;
6048
6049 /**
6050 * key_replay_ctr_len - The length of key_replay_ctr
6051 */
6052 size_t key_replay_ctr_len;
6053
6054 /**
6055 * ptk_kck - The derived PTK KCK
6056 */
6057 const u8 *ptk_kck;
6058
6059 /**
6060 * ptk_kek_len - The length of ptk_kck
6061 */
6062 size_t ptk_kck_len;
6063
6064 /**
6065 * ptk_kek - The derived PTK KEK
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07006066 * This is used in key management offload and also in FILS SK
6067 * offload.
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006068 */
6069 const u8 *ptk_kek;
6070
6071 /**
6072 * ptk_kek_len - The length of ptk_kek
6073 */
6074 size_t ptk_kek_len;
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08006075
6076 /**
6077 * subnet_status - The subnet status:
6078 * 0 = unknown, 1 = unchanged, 2 = changed
6079 */
6080 u8 subnet_status;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07006081
6082 /**
6083 * The following information is used in FILS SK offload
6084 * @fils_erp_next_seq_num
6085 * @fils_pmk
6086 * @fils_pmk_len
6087 * @fils_pmkid
6088 */
6089
6090 /**
6091 * fils_erp_next_seq_num - The next sequence number to use in
6092 * FILS ERP messages
6093 */
6094 u16 fils_erp_next_seq_num;
6095
6096 /**
6097 * fils_pmk - A new PMK if generated in case of FILS
6098 * authentication
6099 */
6100 const u8 *fils_pmk;
6101
6102 /**
6103 * fils_pmk_len - Length of fils_pmk
6104 */
6105 size_t fils_pmk_len;
6106
6107 /**
6108 * fils_pmkid - PMKID used or generated in FILS authentication
6109 */
6110 const u8 *fils_pmkid;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006111
6112 /**
6113 * link_addr - Link address of the STA
6114 */
6115 const u8 *link_addr;
6116
6117 /**
6118 * assoc_link_id - Association link id of the MLO association or
6119 * -1 if MLO is not used
6120 */
6121 int assoc_link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006122 } assoc_info;
6123
6124 /**
6125 * struct disassoc_info - Data for EVENT_DISASSOC events
6126 */
6127 struct disassoc_info {
6128 /**
6129 * addr - Station address (for AP mode)
6130 */
6131 const u8 *addr;
6132
6133 /**
6134 * reason_code - Reason Code (host byte order) used in
6135 * Deauthentication frame
6136 */
6137 u16 reason_code;
6138
6139 /**
6140 * ie - Optional IE(s) in Disassociation frame
6141 */
6142 const u8 *ie;
6143
6144 /**
6145 * ie_len - Length of ie buffer in octets
6146 */
6147 size_t ie_len;
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08006148
6149 /**
6150 * locally_generated - Whether the frame was locally generated
6151 */
6152 int locally_generated;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006153 } disassoc_info;
6154
6155 /**
6156 * struct deauth_info - Data for EVENT_DEAUTH events
6157 */
6158 struct deauth_info {
6159 /**
6160 * addr - Station address (for AP mode)
6161 */
6162 const u8 *addr;
6163
6164 /**
6165 * reason_code - Reason Code (host byte order) used in
6166 * Deauthentication frame
6167 */
6168 u16 reason_code;
6169
6170 /**
6171 * ie - Optional IE(s) in Deauthentication frame
6172 */
6173 const u8 *ie;
6174
6175 /**
6176 * ie_len - Length of ie buffer in octets
6177 */
6178 size_t ie_len;
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08006179
6180 /**
6181 * locally_generated - Whether the frame was locally generated
6182 */
6183 int locally_generated;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006184 } deauth_info;
6185
6186 /**
6187 * struct michael_mic_failure - Data for EVENT_MICHAEL_MIC_FAILURE
6188 */
6189 struct michael_mic_failure {
6190 int unicast;
6191 const u8 *src;
6192 } michael_mic_failure;
6193
6194 /**
6195 * struct interface_status - Data for EVENT_INTERFACE_STATUS
6196 */
6197 struct interface_status {
Dmitry Shmidte4663042016-04-04 10:07:49 -07006198 unsigned int ifindex;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006199 char ifname[100];
6200 enum {
6201 EVENT_INTERFACE_ADDED, EVENT_INTERFACE_REMOVED
6202 } ievent;
6203 } interface_status;
6204
6205 /**
6206 * struct pmkid_candidate - Data for EVENT_PMKID_CANDIDATE
6207 */
6208 struct pmkid_candidate {
6209 /** BSSID of the PMKID candidate */
6210 u8 bssid[ETH_ALEN];
6211 /** Smaller the index, higher the priority */
6212 int index;
6213 /** Whether RSN IE includes pre-authenticate flag */
6214 int preauth;
6215 } pmkid_candidate;
6216
6217 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006218 * struct tdls - Data for EVENT_TDLS
6219 */
6220 struct tdls {
6221 u8 peer[ETH_ALEN];
6222 enum {
6223 TDLS_REQUEST_SETUP,
Dmitry Shmidt4dd28dc2015-03-10 11:21:43 -07006224 TDLS_REQUEST_TEARDOWN,
6225 TDLS_REQUEST_DISCOVER,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006226 } oper;
6227 u16 reason_code; /* for teardown */
6228 } tdls;
6229
6230 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07006231 * struct wnm - Data for EVENT_WNM
6232 */
6233 struct wnm {
6234 u8 addr[ETH_ALEN];
6235 enum {
6236 WNM_OPER_SLEEP,
6237 } oper;
6238 enum {
6239 WNM_SLEEP_ENTER,
6240 WNM_SLEEP_EXIT
6241 } sleep_action;
6242 int sleep_intval;
6243 u16 reason_code;
6244 u8 *buf;
6245 u16 buf_len;
6246 } wnm;
6247
6248 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006249 * struct ft_ies - FT information elements (EVENT_FT_RESPONSE)
6250 *
6251 * During FT (IEEE 802.11r) authentication sequence, the driver is
6252 * expected to use this event to report received FT IEs (MDIE, FTIE,
6253 * RSN IE, TIE, possible resource request) to the supplicant. The FT
6254 * IEs for the next message will be delivered through the
6255 * struct wpa_driver_ops::update_ft_ies() callback.
6256 */
6257 struct ft_ies {
6258 const u8 *ies;
6259 size_t ies_len;
6260 int ft_action;
6261 u8 target_ap[ETH_ALEN];
6262 /** Optional IE(s), e.g., WMM TSPEC(s), for RIC-Request */
6263 const u8 *ric_ies;
6264 /** Length of ric_ies buffer in octets */
6265 size_t ric_ies_len;
6266 } ft_ies;
6267
6268 /**
6269 * struct ibss_rsn_start - Data for EVENT_IBSS_RSN_START
6270 */
6271 struct ibss_rsn_start {
6272 u8 peer[ETH_ALEN];
6273 } ibss_rsn_start;
6274
6275 /**
6276 * struct auth_info - Data for EVENT_AUTH events
6277 */
6278 struct auth_info {
6279 u8 peer[ETH_ALEN];
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006280 u8 bssid[ETH_ALEN];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006281 u16 auth_type;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006282 u16 auth_transaction;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006283 u16 status_code;
6284 const u8 *ies;
6285 size_t ies_len;
6286 } auth;
6287
6288 /**
6289 * struct assoc_reject - Data for EVENT_ASSOC_REJECT events
6290 */
6291 struct assoc_reject {
6292 /**
6293 * bssid - BSSID of the AP that rejected association
6294 */
6295 const u8 *bssid;
6296
6297 /**
6298 * resp_ies - (Re)Association Response IEs
6299 *
6300 * Optional association data from the driver. This data is not
6301 * required WPA, but may be useful for some protocols and as
6302 * such, should be reported if this is available to the driver
6303 * interface.
6304 *
6305 * This should start with the first IE (fixed fields before IEs
6306 * are not included).
6307 */
6308 const u8 *resp_ies;
6309
6310 /**
6311 * resp_ies_len - Length of resp_ies in bytes
6312 */
6313 size_t resp_ies_len;
6314
6315 /**
6316 * status_code - Status Code from (Re)association Response
6317 */
6318 u16 status_code;
Dmitry Shmidtd5ab1b52016-06-21 12:38:41 -07006319
6320 /**
6321 * timed_out - Whether failure is due to timeout (etc.) rather
6322 * than explicit rejection response from the AP.
6323 */
6324 int timed_out;
Dmitry Shmidtebd93af2017-02-21 13:40:44 -08006325
6326 /**
6327 * timeout_reason - Reason for the timeout
6328 */
6329 const char *timeout_reason;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07006330
6331 /**
6332 * fils_erp_next_seq_num - The next sequence number to use in
6333 * FILS ERP messages
6334 */
6335 u16 fils_erp_next_seq_num;
Hai Shalom60840252021-02-19 19:02:11 -08006336
6337 /**
6338 * reason_code - Connection failure reason code from the driver
6339 */
6340 enum sta_connect_fail_reason_codes reason_code;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006341 } assoc_reject;
6342
6343 struct timeout_event {
6344 u8 addr[ETH_ALEN];
6345 } timeout_event;
6346
6347 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006348 * struct tx_status - Data for EVENT_TX_STATUS events
6349 */
6350 struct tx_status {
6351 u16 type;
6352 u16 stype;
6353 const u8 *dst;
6354 const u8 *data;
6355 size_t data_len;
6356 int ack;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006357 int link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006358 } tx_status;
6359
6360 /**
6361 * struct rx_from_unknown - Data for EVENT_RX_FROM_UNKNOWN events
6362 */
6363 struct rx_from_unknown {
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006364 const u8 *bssid;
6365 const u8 *addr;
6366 int wds;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006367 } rx_from_unknown;
6368
6369 /**
6370 * struct rx_mgmt - Data for EVENT_RX_MGMT events
6371 */
6372 struct rx_mgmt {
6373 const u8 *frame;
6374 size_t frame_len;
6375 u32 datarate;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006376
6377 /**
Dmitry Shmidt98660862014-03-11 17:26:21 -07006378 * drv_priv - Pointer to store driver private BSS information
6379 *
6380 * If not set to NULL, this is used for comparison with
6381 * hostapd_data->drv_priv to determine which BSS should process
6382 * the frame.
6383 */
6384 void *drv_priv;
6385
6386 /**
Sunil Ravi7f769292024-07-23 22:21:32 +00006387 * ctx - Pointer to store ctx of private BSS information
6388 *
6389 * If not set to NULL, this is used for forwarding the packet
6390 * to right link BSS of ML BSS.
6391 */
6392 void *ctx;
6393
6394 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006395 * freq - Frequency (in MHz) on which the frame was received
6396 */
6397 int freq;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08006398
6399 /**
6400 * ssi_signal - Signal strength in dBm (or 0 if not available)
6401 */
6402 int ssi_signal;
Sunil Ravi036cec52023-03-29 11:35:17 -07006403
6404 /**
6405 * link_id - MLO link on which the frame was received or -1 for
6406 * non MLD.
6407 */
6408 int link_id;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08006409 } rx_mgmt;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006410
6411 /**
6412 * struct remain_on_channel - Data for EVENT_REMAIN_ON_CHANNEL events
6413 *
6414 * This is also used with EVENT_CANCEL_REMAIN_ON_CHANNEL events.
6415 */
6416 struct remain_on_channel {
6417 /**
6418 * freq - Channel frequency in MHz
6419 */
6420 unsigned int freq;
6421
6422 /**
6423 * duration - Duration to remain on the channel in milliseconds
6424 */
6425 unsigned int duration;
6426 } remain_on_channel;
6427
6428 /**
6429 * struct scan_info - Optional data for EVENT_SCAN_RESULTS events
6430 * @aborted: Whether the scan was aborted
6431 * @freqs: Scanned frequencies in MHz (%NULL = all channels scanned)
6432 * @num_freqs: Number of entries in freqs array
6433 * @ssids: Scanned SSIDs (%NULL or zero-length SSID indicates wildcard
6434 * SSID)
6435 * @num_ssids: Number of entries in ssids array
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08006436 * @external_scan: Whether the scan info is for an external scan
6437 * @nl_scan_event: 1 if the source of this scan event is a normal scan,
6438 * 0 if the source of the scan event is a vendor scan
Dmitry Shmidt29333592017-01-09 12:27:11 -08006439 * @scan_start_tsf: Time when the scan started in terms of TSF of the
6440 * BSS that the interface that requested the scan is connected to
6441 * (if available).
6442 * @scan_start_tsf_bssid: The BSSID according to which %scan_start_tsf
6443 * is set.
Sunil Ravi99c035e2024-07-12 01:42:03 +00006444 * @scan_cookie: Unique identification representing the corresponding
6445 * scan request. 0 if no unique identification is available.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006446 */
6447 struct scan_info {
6448 int aborted;
6449 const int *freqs;
6450 size_t num_freqs;
6451 struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS];
6452 size_t num_ssids;
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08006453 int external_scan;
6454 int nl_scan_event;
Dmitry Shmidt29333592017-01-09 12:27:11 -08006455 u64 scan_start_tsf;
6456 u8 scan_start_tsf_bssid[ETH_ALEN];
Sunil Ravi99c035e2024-07-12 01:42:03 +00006457 u64 scan_cookie;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006458 } scan_info;
6459
6460 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006461 * struct rx_probe_req - Data for EVENT_RX_PROBE_REQ events
6462 */
6463 struct rx_probe_req {
6464 /**
6465 * sa - Source address of the received Probe Request frame
6466 */
6467 const u8 *sa;
6468
6469 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006470 * da - Destination address of the received Probe Request frame
6471 * or %NULL if not available
6472 */
6473 const u8 *da;
6474
6475 /**
6476 * bssid - BSSID of the received Probe Request frame or %NULL
6477 * if not available
6478 */
6479 const u8 *bssid;
6480
6481 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006482 * ie - IEs from the Probe Request body
6483 */
6484 const u8 *ie;
6485
6486 /**
6487 * ie_len - Length of ie buffer in octets
6488 */
6489 size_t ie_len;
Dmitry Shmidt04949592012-07-19 12:16:46 -07006490
6491 /**
6492 * signal - signal strength in dBm (or 0 if not available)
6493 */
6494 int ssi_signal;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006495 } rx_probe_req;
6496
6497 /**
6498 * struct new_sta - Data for EVENT_NEW_STA events
6499 */
6500 struct new_sta {
6501 const u8 *addr;
6502 } new_sta;
6503
6504 /**
6505 * struct eapol_rx - Data for EVENT_EAPOL_RX events
6506 */
6507 struct eapol_rx {
6508 const u8 *src;
6509 const u8 *data;
6510 size_t data_len;
Sunil8cd6f4d2022-06-28 18:40:46 +00006511 enum frame_encryption encrypted;
Sunil Ravi036cec52023-03-29 11:35:17 -07006512 int link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006513 } eapol_rx;
6514
6515 /**
6516 * signal_change - Data for EVENT_SIGNAL_CHANGE events
6517 */
6518 struct wpa_signal_info signal_change;
6519
6520 /**
6521 * struct best_channel - Data for EVENT_BEST_CHANNEL events
6522 * @freq_24: Best 2.4 GHz band channel frequency in MHz
6523 * @freq_5: Best 5 GHz band channel frequency in MHz
6524 * @freq_overall: Best channel frequency in MHz
6525 *
6526 * 0 can be used to indicate no preference in either band.
6527 */
6528 struct best_channel {
6529 int freq_24;
6530 int freq_5;
6531 int freq_overall;
6532 } best_chan;
6533
6534 struct unprot_deauth {
6535 const u8 *sa;
6536 const u8 *da;
6537 u16 reason_code;
6538 } unprot_deauth;
6539
6540 struct unprot_disassoc {
6541 const u8 *sa;
6542 const u8 *da;
6543 u16 reason_code;
6544 } unprot_disassoc;
6545
6546 /**
6547 * struct low_ack - Data for EVENT_STATION_LOW_ACK events
6548 * @addr: station address
Paul Stewart092955c2017-02-06 09:13:09 -08006549 * @num_packets: Number of packets lost (consecutive packets not
6550 * acknowledged)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006551 */
6552 struct low_ack {
6553 u8 addr[ETH_ALEN];
Paul Stewart092955c2017-02-06 09:13:09 -08006554 u32 num_packets;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006555 } low_ack;
6556
6557 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006558 * struct ibss_peer_lost - Data for EVENT_IBSS_PEER_LOST
6559 */
6560 struct ibss_peer_lost {
6561 u8 peer[ETH_ALEN];
6562 } ibss_peer_lost;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006563
6564 /**
6565 * struct driver_gtk_rekey - Data for EVENT_DRIVER_GTK_REKEY
6566 */
6567 struct driver_gtk_rekey {
6568 const u8 *bssid;
6569 const u8 *replay_ctr;
6570 } driver_gtk_rekey;
6571
6572 /**
6573 * struct client_poll - Data for EVENT_DRIVER_CLIENT_POLL_OK events
6574 * @addr: station address
6575 */
6576 struct client_poll {
6577 u8 addr[ETH_ALEN];
6578 } client_poll;
6579
6580 /**
6581 * struct eapol_tx_status
6582 * @dst: Original destination
6583 * @data: Data starting with IEEE 802.1X header (!)
6584 * @data_len: Length of data
6585 * @ack: Indicates ack or lost frame
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006586 * @link_id: MLD link id used to transmit the frame or -1 for non MLO
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006587 *
6588 * This corresponds to hapd_send_eapol if the frame sent
6589 * there isn't just reported as EVENT_TX_STATUS.
6590 */
6591 struct eapol_tx_status {
6592 const u8 *dst;
6593 const u8 *data;
6594 int data_len;
6595 int ack;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006596 int link_id;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006597 } eapol_tx_status;
Dmitry Shmidt04949592012-07-19 12:16:46 -07006598
6599 /**
6600 * struct ch_switch
6601 * @freq: Frequency of new channel in MHz
6602 * @ht_enabled: Whether this is an HT channel
6603 * @ch_offset: Secondary channel offset
Dmitry Shmidt04f534e2013-12-09 15:50:16 -08006604 * @ch_width: Channel width
6605 * @cf1: Center frequency 1
6606 * @cf2: Center frequency 2
Sunil Ravi89eba102022-09-13 21:04:37 -07006607 * @link_id: Link ID of the MLO link
Sunil Ravi036cec52023-03-29 11:35:17 -07006608 * @punct_bitmap: Puncturing bitmap
Dmitry Shmidt04949592012-07-19 12:16:46 -07006609 */
6610 struct ch_switch {
6611 int freq;
6612 int ht_enabled;
6613 int ch_offset;
Dmitry Shmidt04f534e2013-12-09 15:50:16 -08006614 enum chan_width ch_width;
6615 int cf1;
6616 int cf2;
Sunil Ravi89eba102022-09-13 21:04:37 -07006617 int link_id;
Sunil Ravi036cec52023-03-29 11:35:17 -07006618 u16 punct_bitmap;
Dmitry Shmidt04949592012-07-19 12:16:46 -07006619 } ch_switch;
Dmitry Shmidtf8623282013-02-20 14:34:59 -08006620
6621 /**
6622 * struct connect_failed - Data for EVENT_CONNECT_FAILED_REASON
6623 * @addr: Remote client address
6624 * @code: Reason code for connection failure
6625 */
6626 struct connect_failed_reason {
6627 u8 addr[ETH_ALEN];
6628 enum {
6629 MAX_CLIENT_REACHED,
6630 BLOCKED_CLIENT
6631 } code;
6632 } connect_failed_reason;
Dmitry Shmidtea69e842013-05-13 14:52:28 -07006633
6634 /**
6635 * struct dfs_event - Data for radar detected events
6636 * @freq: Frequency of the channel in MHz
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006637 * @link_id: If >= 0, Link ID of the MLO link
Dmitry Shmidtea69e842013-05-13 14:52:28 -07006638 */
6639 struct dfs_event {
6640 int freq;
Dmitry Shmidt051af732013-10-22 13:52:46 -07006641 int ht_enabled;
6642 int chan_offset;
6643 enum chan_width chan_width;
6644 int cf1;
6645 int cf2;
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006646 int link_id;
Dmitry Shmidtea69e842013-05-13 14:52:28 -07006647 } dfs_event;
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07006648
6649 /**
6650 * survey_results - Survey result data for EVENT_SURVEY
6651 * @freq_filter: Requested frequency survey filter, 0 if request
6652 * was for all survey data
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006653 * @survey_list: Linked list of survey data (struct freq_survey)
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07006654 */
6655 struct survey_results {
6656 unsigned int freq_filter;
6657 struct dl_list survey_list; /* struct freq_survey */
6658 } survey_results;
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08006659
6660 /**
6661 * channel_list_changed - Data for EVENT_CHANNEL_LIST_CHANGED
6662 * @initiator: Initiator of the regulatory change
Dmitry Shmidt7dba0e52014-04-14 10:49:15 -07006663 * @type: Regulatory change type
6664 * @alpha2: Country code (or "" if not available)
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006665 * @beacon_hint_before: Data for frequency attributes before beacon hint
6666 * event if initiator == REGDOM_BEACON_HINT
6667 * @beacon_hint_after: Data for frequency attributes after beacon hint
6668 * event if initiator == REGDOM_BEACON_HINT
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08006669 */
6670 struct channel_list_changed {
6671 enum reg_change_initiator initiator;
Dmitry Shmidt7dba0e52014-04-14 10:49:15 -07006672 enum reg_type type;
6673 char alpha2[3];
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006674 struct frequency_attrs {
6675 unsigned int freq;
6676 unsigned int max_tx_power;
6677 bool disabled;
6678 bool no_ir;
6679 bool radar;
6680 } beacon_hint_before, beacon_hint_after;
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08006681 } channel_list_changed;
Dmitry Shmidtcf32e602014-01-28 10:57:39 -08006682
6683 /**
6684 * freq_range - List of frequency ranges
6685 *
6686 * This is used as the data with EVENT_AVOID_FREQUENCIES.
6687 */
6688 struct wpa_freq_range_list freq_range;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006689
6690 /**
6691 * struct mesh_peer
6692 *
6693 * @peer: Peer address
6694 * @ies: Beacon IEs
6695 * @ie_len: Length of @ies
6696 *
6697 * Notification of new candidate mesh peer.
6698 */
6699 struct mesh_peer {
6700 const u8 *peer;
6701 const u8 *ies;
6702 size_t ie_len;
6703 } mesh_peer;
6704
6705 /**
6706 * struct acs_selected_channels - Data for EVENT_ACS_CHANNEL_SELECTED
Ahmed ElArabawy0ff61c52019-12-26 12:38:39 -08006707 * @pri_freq: Selected primary frequency
6708 * @sec_freq: Selected secondary frequency
Hai Shalomfdcde762020-04-02 11:19:20 -07006709 * @edmg_channel: Selected EDMG channel
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006710 * @vht_seg0_center_ch: VHT mode Segment0 center channel
Hai Shalomfdcde762020-04-02 11:19:20 -07006711 * The value is the index of the channel center frequency for
6712 * 20 MHz, 40 MHz, and 80 MHz channels. The value is the center
6713 * frequency index of the primary 80 MHz segment for 160 MHz and
6714 * 80+80 MHz channels.
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006715 * @vht_seg1_center_ch: VHT mode Segment1 center channel
Hai Shalomfdcde762020-04-02 11:19:20 -07006716 * The value is zero for 20 MHz, 40 MHz, and 80 MHz channels. The
6717 * value is the index of the channel center frequency for 160 MHz
6718 * channels and the center frequency index of the secondary 80 MHz
6719 * segment for 80+80 MHz channels.
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006720 * @ch_width: Selected Channel width by driver. Driver may choose to
6721 * change hostapd configured ACS channel width due driver internal
6722 * channel restrictions.
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006723 * @hw_mode: Selected band (used with hw_mode=any)
6724 * @puncture_bitmap: Indicate the puncturing channels
6725 * @link_id: Indicate the link id if operating as AP MLD; -1 otherwise
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006726 */
6727 struct acs_selected_channels {
Ahmed ElArabawy0ff61c52019-12-26 12:38:39 -08006728 unsigned int pri_freq;
6729 unsigned int sec_freq;
Hai Shalomfdcde762020-04-02 11:19:20 -07006730 u8 edmg_channel;
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006731 u8 vht_seg0_center_ch;
6732 u8 vht_seg1_center_ch;
6733 u16 ch_width;
Dmitry Shmidtb1e52102015-05-29 12:36:29 -07006734 enum hostapd_hw_mode hw_mode;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006735 u16 puncture_bitmap;
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006736 int link_id;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006737 } acs_selected_channels;
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07006738
6739 /**
6740 * struct p2p_lo_stop - Reason code for P2P Listen offload stop event
6741 * @reason_code: Reason for stopping offload
6742 * P2P_LO_STOPPED_REASON_COMPLETE: Listen offload finished as
6743 * scheduled.
6744 * P2P_LO_STOPPED_REASON_RECV_STOP_CMD: Host requested offload to
6745 * be stopped.
6746 * P2P_LO_STOPPED_REASON_INVALID_PARAM: Invalid listen offload
6747 * parameters.
6748 * P2P_LO_STOPPED_REASON_NOT_SUPPORTED: Listen offload not
6749 * supported by device.
6750 */
6751 struct p2p_lo_stop {
6752 enum {
6753 P2P_LO_STOPPED_REASON_COMPLETE = 0,
6754 P2P_LO_STOPPED_REASON_RECV_STOP_CMD,
6755 P2P_LO_STOPPED_REASON_INVALID_PARAM,
6756 P2P_LO_STOPPED_REASON_NOT_SUPPORTED,
6757 } reason_code;
6758 } p2p_lo_stop;
Roshan Pius3a1667e2018-07-03 15:17:14 -07006759
6760 /* For EVENT_EXTERNAL_AUTH */
6761 struct external_auth external_auth;
6762
6763 /**
6764 * struct sta_opmode - Station's operation mode change event
6765 * @addr: The station MAC address
6766 * @smps_mode: SMPS mode of the station
6767 * @chan_width: Channel width of the station
6768 * @rx_nss: RX_NSS of the station
6769 *
6770 * This is used as data with EVENT_STATION_OPMODE_CHANGED.
6771 */
6772 struct sta_opmode {
6773 const u8 *addr;
6774 enum smps_mode smps_mode;
6775 enum chan_width chan_width;
6776 u8 rx_nss;
6777 } sta_opmode;
6778
6779 /**
6780 * struct wds_sta_interface - Data for EVENT_WDS_STA_INTERFACE_STATUS.
6781 */
6782 struct wds_sta_interface {
6783 const u8 *sta_addr;
6784 const char *ifname;
6785 enum {
6786 INTERFACE_ADDED,
6787 INTERFACE_REMOVED
6788 } istatus;
6789 } wds_sta_interface;
Hai Shalom81f62d82019-07-22 12:10:00 -07006790
6791 /**
6792 * struct update_dh - Data for EVENT_UPDATE_DH
6793 */
6794 struct update_dh {
6795 const u8 *peer;
6796 const u8 *ie;
6797 size_t ie_len;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006798 int assoc_link_id;
6799 const u8 *link_addr;
Hai Shalom81f62d82019-07-22 12:10:00 -07006800 } update_dh;
Hai Shalomfdcde762020-04-02 11:19:20 -07006801
6802 /**
6803 * struct unprot_beacon - Data for EVENT_UNPROT_BEACON
6804 */
6805 struct unprot_beacon {
6806 const u8 *sa;
6807 } unprot_beacon;
Sunil Ravia04bd252022-05-02 22:54:18 -07006808
6809 /**
6810 * struct bss_color_collision - Data for EVENT_BSS_COLOR_COLLISION
6811 */
6812 struct bss_color_collision {
6813 u64 bitmap;
Sunil Ravi7f769292024-07-23 22:21:32 +00006814 int link_id;
Sunil Ravia04bd252022-05-02 22:54:18 -07006815 } bss_color_collision;
Sunil Ravi89eba102022-09-13 21:04:37 -07006816
6817 /**
6818 * struct pasn_auth - Data for EVENT_PASN_AUTH
6819 */
6820 struct pasn_auth pasn_auth;
6821
Sunil Ravi77d572f2023-01-17 23:58:31 +00006822 /**
6823 * struct port_authorized - Data for EVENT_PORT_AUTHORIZED
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006824 * @td_bitmap: For STA mode, transition disable bitmap, if received in
6825 * EAPOL-Key msg 3/4
6826 * @td_bitmap_len: For STA mode, length of td_bitmap
6827 * @sta_addr: For AP mode, the MAC address of the associated STA
6828 *
6829 * This event is used to indicate that the port is authorized and
6830 * open for normal data in STA and AP modes when 4-way handshake is
6831 * offloaded to the driver.
Sunil Ravi77d572f2023-01-17 23:58:31 +00006832 */
6833 struct port_authorized {
6834 const u8 *td_bitmap;
6835 size_t td_bitmap_len;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006836 const u8 *sta_addr;
Sunil Ravi77d572f2023-01-17 23:58:31 +00006837 } port_authorized;
Sunil Ravi640215c2023-06-28 23:08:09 +00006838
6839 /**
6840 * struct tid_link_map_info - Data for EVENT_TID_LINK_MAP
6841 */
6842 struct tid_link_map_info {
6843 bool default_map;
6844 u8 valid_links;
6845 struct t2lm_mapping t2lmap[MAX_NUM_MLD_LINKS];
6846 } t2l_map_info;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006847};
6848
6849/**
6850 * wpa_supplicant_event - Report a driver event for wpa_supplicant
6851 * @ctx: Context pointer (wpa_s); this is the ctx variable registered
6852 * with struct wpa_driver_ops::init()
6853 * @event: event type (defined above)
6854 * @data: possible extra data for the event
6855 *
6856 * Driver wrapper code should call this function whenever an event is received
6857 * from the driver.
6858 */
6859void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
6860 union wpa_event_data *data);
6861
Dmitry Shmidte4663042016-04-04 10:07:49 -07006862/**
6863 * wpa_supplicant_event_global - Report a driver event for wpa_supplicant
6864 * @ctx: Context pointer (wpa_s); this is the ctx variable registered
6865 * with struct wpa_driver_ops::init()
6866 * @event: event type (defined above)
6867 * @data: possible extra data for the event
6868 *
6869 * Same as wpa_supplicant_event(), but we search for the interface in
6870 * wpa_global.
6871 */
6872void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
6873 union wpa_event_data *data);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006874
6875/*
6876 * The following inline functions are provided for convenience to simplify
6877 * event indication for some of the common events.
6878 */
6879
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006880static inline void drv_event_assoc(void *ctx, const u8 *addr, const u8 *req_ies,
6881 size_t req_ielen, const u8 *resp_ies,
6882 size_t resp_ielen, const u8 *link_addr,
6883 int assoc_link_id, int reassoc)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006884{
6885 union wpa_event_data event;
6886 os_memset(&event, 0, sizeof(event));
6887 event.assoc_info.reassoc = reassoc;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006888 event.assoc_info.req_ies = req_ies;
6889 event.assoc_info.req_ies_len = req_ielen;
6890 event.assoc_info.resp_ies = resp_ies;
6891 event.assoc_info.resp_ies_len = resp_ielen;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006892 event.assoc_info.addr = addr;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006893 event.assoc_info.link_addr = link_addr;
6894 event.assoc_info.assoc_link_id = assoc_link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006895 wpa_supplicant_event(ctx, EVENT_ASSOC, &event);
6896}
6897
6898static inline void drv_event_disassoc(void *ctx, const u8 *addr)
6899{
6900 union wpa_event_data event;
6901 os_memset(&event, 0, sizeof(event));
6902 event.disassoc_info.addr = addr;
6903 wpa_supplicant_event(ctx, EVENT_DISASSOC, &event);
6904}
6905
6906static inline void drv_event_eapol_rx(void *ctx, const u8 *src, const u8 *data,
6907 size_t data_len)
6908{
6909 union wpa_event_data event;
6910 os_memset(&event, 0, sizeof(event));
6911 event.eapol_rx.src = src;
6912 event.eapol_rx.data = data;
6913 event.eapol_rx.data_len = data_len;
Sunil8cd6f4d2022-06-28 18:40:46 +00006914 event.eapol_rx.encrypted = FRAME_ENCRYPTION_UNKNOWN;
Sunil Ravi036cec52023-03-29 11:35:17 -07006915 event.eapol_rx.link_id = -1;
Sunil8cd6f4d2022-06-28 18:40:46 +00006916 wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event);
6917}
6918
6919static inline void drv_event_eapol_rx2(void *ctx, const u8 *src, const u8 *data,
Sunil Ravi036cec52023-03-29 11:35:17 -07006920 size_t data_len,
6921 enum frame_encryption encrypted,
6922 int link_id)
Sunil8cd6f4d2022-06-28 18:40:46 +00006923{
6924 union wpa_event_data event;
6925 os_memset(&event, 0, sizeof(event));
6926 event.eapol_rx.src = src;
6927 event.eapol_rx.data = data;
6928 event.eapol_rx.data_len = data_len;
6929 event.eapol_rx.encrypted = encrypted;
Sunil Ravi036cec52023-03-29 11:35:17 -07006930 event.eapol_rx.link_id = link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006931 wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event);
6932}
6933
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006934/* driver_common.c */
6935void wpa_scan_results_free(struct wpa_scan_results *res);
6936
6937/* Convert wpa_event_type to a string for logging */
6938const char * event_to_string(enum wpa_event_type event);
6939
Dmitry Shmidt661b4f72014-09-29 14:58:27 -07006940/* Convert chan_width to a string for logging and control interfaces */
6941const char * channel_width_to_string(enum chan_width width);
6942
Hai Shalom74f70d42019-02-11 14:42:39 -08006943int channel_width_to_int(enum chan_width width);
6944
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006945int ht_supported(const struct hostapd_hw_modes *mode);
6946int vht_supported(const struct hostapd_hw_modes *mode);
Sunil Ravi77d572f2023-01-17 23:58:31 +00006947bool he_supported(const struct hostapd_hw_modes *hw_mode,
6948 enum ieee80211_op_mode op_mode);
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006949
6950struct wowlan_triggers *
6951wpa_get_wowlan_triggers(const char *wowlan_triggers,
6952 const struct wpa_driver_capa *capa);
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07006953/* Convert driver flag to string */
6954const char * driver_flag_to_string(u64 flag);
Hai Shalomb755a2a2020-04-23 21:49:02 -07006955const char * driver_flag2_to_string(u64 flag2);
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006956
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08006957/* NULL terminated array of linked in driver wrappers */
Dmitry Shmidt1d755d02015-04-28 10:34:29 -07006958extern const struct wpa_driver_ops *const wpa_drivers[];
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08006959
Dmitry Shmidt4ae50e62016-06-27 13:48:39 -07006960
6961/* Available drivers */
6962
6963#ifdef CONFIG_DRIVER_WEXT
6964extern const struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */
6965#endif /* CONFIG_DRIVER_WEXT */
6966#ifdef CONFIG_DRIVER_NL80211
6967/* driver_nl80211.c */
6968extern const struct wpa_driver_ops wpa_driver_nl80211_ops;
6969#endif /* CONFIG_DRIVER_NL80211 */
6970#ifdef CONFIG_DRIVER_HOSTAP
6971extern const struct wpa_driver_ops wpa_driver_hostap_ops; /* driver_hostap.c */
6972#endif /* CONFIG_DRIVER_HOSTAP */
6973#ifdef CONFIG_DRIVER_BSD
6974extern const struct wpa_driver_ops wpa_driver_bsd_ops; /* driver_bsd.c */
6975#endif /* CONFIG_DRIVER_BSD */
6976#ifdef CONFIG_DRIVER_OPENBSD
6977/* driver_openbsd.c */
6978extern const struct wpa_driver_ops wpa_driver_openbsd_ops;
6979#endif /* CONFIG_DRIVER_OPENBSD */
6980#ifdef CONFIG_DRIVER_NDIS
6981extern struct wpa_driver_ops wpa_driver_ndis_ops; /* driver_ndis.c */
6982#endif /* CONFIG_DRIVER_NDIS */
6983#ifdef CONFIG_DRIVER_WIRED
6984extern const struct wpa_driver_ops wpa_driver_wired_ops; /* driver_wired.c */
6985#endif /* CONFIG_DRIVER_WIRED */
6986#ifdef CONFIG_DRIVER_MACSEC_QCA
6987/* driver_macsec_qca.c */
6988extern const struct wpa_driver_ops wpa_driver_macsec_qca_ops;
6989#endif /* CONFIG_DRIVER_MACSEC_QCA */
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08006990#ifdef CONFIG_DRIVER_MACSEC_LINUX
6991/* driver_macsec_linux.c */
6992extern const struct wpa_driver_ops wpa_driver_macsec_linux_ops;
6993#endif /* CONFIG_DRIVER_MACSEC_LINUX */
Dmitry Shmidt4ae50e62016-06-27 13:48:39 -07006994#ifdef CONFIG_DRIVER_ROBOSWITCH
6995/* driver_roboswitch.c */
6996extern const struct wpa_driver_ops wpa_driver_roboswitch_ops;
6997#endif /* CONFIG_DRIVER_ROBOSWITCH */
6998#ifdef CONFIG_DRIVER_ATHEROS
6999/* driver_atheros.c */
7000extern const struct wpa_driver_ops wpa_driver_atheros_ops;
7001#endif /* CONFIG_DRIVER_ATHEROS */
7002#ifdef CONFIG_DRIVER_NONE
7003extern const struct wpa_driver_ops wpa_driver_none_ops; /* driver_none.c */
7004#endif /* CONFIG_DRIVER_NONE */
7005
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007006#endif /* DRIVER_H */