blob: 069e741e1bff31c2cf1a444c73101066e1075533 [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
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001396struct wpa_driver_ap_params {
1397 /**
1398 * head - Beacon head from IEEE 802.11 header to IEs before TIM IE
1399 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08001400 u8 *head;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001401
1402 /**
1403 * head_len - Length of the head buffer in octets
1404 */
1405 size_t head_len;
1406
1407 /**
1408 * tail - Beacon tail following TIM IE
1409 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08001410 u8 *tail;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001411
1412 /**
1413 * tail_len - Length of the tail buffer in octets
1414 */
1415 size_t tail_len;
1416
1417 /**
1418 * dtim_period - DTIM period
1419 */
1420 int dtim_period;
1421
1422 /**
1423 * beacon_int - Beacon interval
1424 */
1425 int beacon_int;
1426
1427 /**
1428 * basic_rates: -1 terminated array of basic rates in 100 kbps
1429 *
1430 * This parameter can be used to set a specific basic rate set for the
1431 * BSS. If %NULL, default basic rate set is used.
1432 */
1433 int *basic_rates;
1434
1435 /**
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001436 * beacon_rate: Beacon frame data rate
1437 *
1438 * This parameter can be used to set a specific Beacon frame data rate
1439 * for the BSS. The interpretation of this value depends on the
Hai Shalom60840252021-02-19 19:02:11 -08001440 * rate_type (legacy: in 100 kbps units, HT: HT-MCS, VHT: VHT-MCS,
1441 * HE: HE-MCS). If beacon_rate == 0 and rate_type == 0
1442 * (BEACON_RATE_LEGACY), the default Beacon frame data rate is used.
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001443 */
1444 unsigned int beacon_rate;
1445
1446 /**
Hai Shalom60840252021-02-19 19:02:11 -08001447 * beacon_rate_type: Beacon data rate type (legacy/HT/VHT/HE)
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001448 */
1449 enum beacon_rate_type rate_type;
1450
1451 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001452 * proberesp - Probe Response template
1453 *
1454 * This is used by drivers that reply to Probe Requests internally in
1455 * AP mode and require the full Probe Response template.
1456 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08001457 u8 *proberesp;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001458
1459 /**
1460 * proberesp_len - Length of the proberesp buffer in octets
1461 */
1462 size_t proberesp_len;
1463
1464 /**
1465 * ssid - The SSID to use in Beacon/Probe Response frames
1466 */
1467 const u8 *ssid;
1468
1469 /**
1470 * ssid_len - Length of the SSID (1..32)
1471 */
1472 size_t ssid_len;
1473
1474 /**
1475 * hide_ssid - Whether to hide the SSID
1476 */
1477 enum hide_ssid hide_ssid;
1478
1479 /**
1480 * pairwise_ciphers - WPA_CIPHER_* bitfield
1481 */
1482 unsigned int pairwise_ciphers;
1483
1484 /**
1485 * group_cipher - WPA_CIPHER_*
1486 */
1487 unsigned int group_cipher;
1488
1489 /**
1490 * key_mgmt_suites - WPA_KEY_MGMT_* bitfield
1491 */
1492 unsigned int key_mgmt_suites;
1493
1494 /**
1495 * auth_algs - WPA_AUTH_ALG_* bitfield
1496 */
1497 unsigned int auth_algs;
1498
1499 /**
1500 * wpa_version - WPA_PROTO_* bitfield
1501 */
1502 unsigned int wpa_version;
1503
1504 /**
1505 * privacy - Whether privacy is used in the BSS
1506 */
1507 int privacy;
1508
1509 /**
1510 * beacon_ies - WPS/P2P IE(s) for Beacon frames
1511 *
1512 * This is used to add IEs like WPS IE and P2P IE by drivers that do
1513 * not use the full Beacon template.
1514 */
1515 const struct wpabuf *beacon_ies;
1516
1517 /**
1518 * proberesp_ies - P2P/WPS IE(s) for Probe Response frames
1519 *
1520 * This is used to add IEs like WPS IE and P2P IE by drivers that
1521 * reply to Probe Request frames internally.
1522 */
1523 const struct wpabuf *proberesp_ies;
1524
1525 /**
1526 * assocresp_ies - WPS IE(s) for (Re)Association Response frames
1527 *
1528 * This is used to add IEs like WPS IE by drivers that reply to
1529 * (Re)Association Request frames internally.
1530 */
1531 const struct wpabuf *assocresp_ies;
1532
1533 /**
1534 * isolate - Whether to isolate frames between associated stations
1535 *
1536 * If this is non-zero, the AP is requested to disable forwarding of
1537 * frames between associated stations.
1538 */
1539 int isolate;
1540
1541 /**
1542 * cts_protect - Whether CTS protection is enabled
1543 */
1544 int cts_protect;
1545
1546 /**
1547 * preamble - Whether short preamble is enabled
1548 */
1549 int preamble;
1550
1551 /**
1552 * short_slot_time - Whether short slot time is enabled
1553 *
1554 * 0 = short slot time disable, 1 = short slot time enabled, -1 = do
1555 * not set (e.g., when 802.11g mode is not in use)
1556 */
1557 int short_slot_time;
1558
1559 /**
1560 * ht_opmode - HT operation mode or -1 if HT not in use
1561 */
1562 int ht_opmode;
1563
1564 /**
1565 * interworking - Whether Interworking is enabled
1566 */
1567 int interworking;
1568
1569 /**
1570 * hessid - Homogeneous ESS identifier or %NULL if not set
1571 */
1572 const u8 *hessid;
1573
1574 /**
1575 * access_network_type - Access Network Type (0..15)
1576 *
1577 * This is used for filtering Probe Request frames when Interworking is
1578 * enabled.
1579 */
1580 u8 access_network_type;
Dmitry Shmidt04949592012-07-19 12:16:46 -07001581
1582 /**
1583 * ap_max_inactivity - Timeout in seconds to detect STA's inactivity
1584 *
1585 * This is used by driver which advertises this capability.
1586 */
1587 int ap_max_inactivity;
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07001588
1589 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08001590 * ctwindow - Client Traffic Window (in TUs)
1591 */
1592 u8 p2p_go_ctwindow;
1593
1594 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07001595 * disable_dgaf - Whether group-addressed frames are disabled
1596 */
1597 int disable_dgaf;
Dmitry Shmidtf21452a2014-02-26 10:55:25 -08001598
1599 /**
1600 * osen - Whether OSEN security is enabled
1601 */
1602 int osen;
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07001603
1604 /**
1605 * freq - Channel parameters for dynamic bandwidth changes
1606 */
1607 struct hostapd_freq_params *freq;
Dmitry Shmidt7f656022015-02-25 14:36:37 -08001608
1609 /**
1610 * reenable - Whether this is to re-enable beaconing
1611 */
1612 int reenable;
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08001613
1614 /**
1615 * pbss - Whether to start a PCP (in PBSS) instead of an AP in
1616 * infrastructure BSS. Valid only for DMG network.
1617 */
1618 int pbss;
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001619
1620 /**
1621 * multicast_to_unicast - Whether to use multicast_to_unicast
1622 *
1623 * If this is non-zero, the AP is requested to perform multicast to
1624 * unicast conversion for ARP, IPv4, and IPv6 frames (possibly within
1625 * 802.1Q). If enabled, such frames are to be sent to each station
1626 * separately, with the DA replaced by their own MAC address rather
1627 * than the group address.
1628 *
1629 * Note that this may break certain expectations of the receiver, such
1630 * as the ability to drop unicast IP packets received within multicast
1631 * L2 frames, or the ability to not send ICMP destination unreachable
1632 * messages for packets received in L2 multicast (which is required,
1633 * but the receiver can't tell the difference if this new option is
1634 * enabled.)
1635 *
1636 * This also doesn't implement the 802.11 DMS (directed multicast
1637 * service).
1638 */
1639 int multicast_to_unicast;
Hai Shalom74f70d42019-02-11 14:42:39 -08001640
1641 /**
1642 * ftm_responder - Whether FTM responder is enabled
1643 */
1644 int ftm_responder;
1645
1646 /**
1647 * lci - Binary data, the content of an LCI report IE with type 8 as
1648 * defined in IEEE Std 802.11-2016, 9.4.2.22.10
1649 */
1650 const struct wpabuf *lci;
1651
1652 /**
1653 * civic - Binary data, the content of a measurement report IE with
1654 * type 11 as defined in IEEE Std 802.11-2016, 9.4.2.22.13
1655 */
1656 const struct wpabuf *civic;
Hai Shalomc3565922019-10-28 11:58:20 -07001657
1658 /**
Hai Shalom60840252021-02-19 19:02:11 -08001659 * he_spr_ctrl - Spatial Reuse control field of SPR element
Hai Shalomc3565922019-10-28 11:58:20 -07001660 */
Hai Shalom60840252021-02-19 19:02:11 -08001661 u8 he_spr_ctrl;
1662
1663 /**
1664 * he_spr_non_srg_obss_pd_max_offset - Non-SRG Maximum TX power offset
1665 */
1666 u8 he_spr_non_srg_obss_pd_max_offset;
Hai Shalomc3565922019-10-28 11:58:20 -07001667
1668 /**
1669 * he_spr_srg_obss_pd_min_offset - Minimum TX power offset
1670 */
Hai Shalom60840252021-02-19 19:02:11 -08001671 u8 he_spr_srg_obss_pd_min_offset;
Hai Shalomc3565922019-10-28 11:58:20 -07001672
1673 /**
1674 * he_spr_srg_obss_pd_max_offset - Maximum TX power offset
1675 */
Hai Shalom60840252021-02-19 19:02:11 -08001676 u8 he_spr_srg_obss_pd_max_offset;
1677
1678 /**
1679 * he_spr_bss_color_bitmap - BSS color values used by members of the
1680 * SRG.
1681 */
1682 u8 he_spr_bss_color_bitmap[8];
1683
1684 /**
1685 * he_spr_partial_bssid_bitmap - Partial BSSID values used by members
1686 * of the SRG.
1687 */
1688 u8 he_spr_partial_bssid_bitmap[8];
Hai Shalomfdcde762020-04-02 11:19:20 -07001689
1690 /**
1691 * he_bss_color - Whether the BSS Color is disabled
1692 */
1693 int he_bss_color_disabled;
1694
1695 /**
1696 * he_bss_color_partial - The BSS Color AID equation
1697 */
1698 int he_bss_color_partial;
1699
1700 /**
1701 * he_bss_color - The BSS Color of the AP
1702 */
1703 int he_bss_color;
1704
1705 /**
1706 * twt_responder - Whether Target Wait Time responder is enabled
1707 */
1708 int twt_responder;
Hai Shalom60840252021-02-19 19:02:11 -08001709
1710 /**
1711 * sae_pwe - SAE mechanism for PWE derivation
1712 * 0 = hunting-and-pecking loop only
1713 * 1 = hash-to-element only
1714 * 2 = both hunting-and-pecking loop and hash-to-element enabled
1715 */
Sunil Ravi77d572f2023-01-17 23:58:31 +00001716 enum sae_pwe sae_pwe;
Hai Shalom60840252021-02-19 19:02:11 -08001717
1718 /**
1719 * FILS Discovery frame minimum interval in TUs
1720 */
1721 u32 fd_min_int;
1722
1723 /**
1724 * FILS Discovery frame maximum interval in TUs (0 = FD frame disabled)
1725 */
1726 u32 fd_max_int;
1727
1728 /**
1729 * FILS Discovery frame template data
1730 */
1731 u8 *fd_frame_tmpl;
1732
1733 /**
1734 * FILS Discovery frame template length
1735 */
1736 size_t fd_frame_tmpl_len;
1737
1738 /**
1739 * Unsolicited broadcast Probe Response interval in TUs
1740 */
1741 unsigned int unsol_bcast_probe_resp_interval;
1742
1743 /**
1744 * Unsolicited broadcast Probe Response template data
1745 */
1746 u8 *unsol_bcast_probe_resp_tmpl;
1747
1748 /**
1749 * Unsolicited broadcast Probe Response template length
1750 */
1751 size_t unsol_bcast_probe_resp_tmpl_len;
Sunil Ravi77d572f2023-01-17 23:58:31 +00001752
1753 /**
1754 * mbssid_tx_iface - Transmitting interface of the MBSSID set
1755 */
1756 const char *mbssid_tx_iface;
1757
1758 /**
1759 * mbssid_index - The index of this BSS in the MBSSID set
1760 */
1761 unsigned int mbssid_index;
1762
1763 /**
1764 * mbssid_elem - Buffer containing all MBSSID elements
1765 */
1766 u8 *mbssid_elem;
1767
1768 /**
1769 * mbssid_elem_len - Total length of all MBSSID elements
1770 */
1771 size_t mbssid_elem_len;
1772
1773 /**
1774 * mbssid_elem_count - The number of MBSSID elements
1775 */
1776 u8 mbssid_elem_count;
1777
1778 /**
1779 * mbssid_elem_offset - Offsets to elements in mbssid_elem.
1780 * Kernel will use these offsets to generate multiple BSSID beacons.
1781 */
1782 u8 **mbssid_elem_offset;
1783
1784 /**
1785 * ema - Enhanced MBSSID advertisements support.
1786 */
1787 bool ema;
Sunil Ravi036cec52023-03-29 11:35:17 -07001788
1789 /**
1790 * punct_bitmap - Preamble puncturing bitmap
1791 * Each bit corresponds to a 20 MHz subchannel, the lowest bit for the
1792 * channel with the lowest frequency. A bit set to 1 indicates that the
1793 * subchannel is punctured, otherwise active.
1794 */
1795 u16 punct_bitmap;
Sunil Ravi640215c2023-06-28 23:08:09 +00001796
1797 /**
1798 * rnr_elem - This buffer contains all of reduced neighbor report (RNR)
1799 * elements
1800 */
1801 u8 *rnr_elem;
1802
1803 /**
1804 * rnr_elem_len - Length of rnr_elem buffer
1805 */
1806 size_t rnr_elem_len;
1807
1808 /**
1809 * rnr_elem_count - Number of RNR elements
1810 */
1811 unsigned int rnr_elem_count;
1812
1813 /**
1814 * rnr_elem_offset - The offsets to the elements in rnr_elem.
1815 * The driver will use these to include RNR elements in EMA beacons.
1816 */
1817 u8 **rnr_elem_offset;
1818
1819 /**
1820 * allowed_freqs - List of allowed 20 MHz channel center frequencies in
1821 * MHz for AP operation. Drivers which support this parameter will
1822 * generate a new list based on this provided list by filtering out
1823 * channels that cannot be used at that time due to regulatory or other
1824 * constraints. The resulting list is used as the list of all allowed
1825 * channels whenever performing operations like ACS and DFS.
1826 */
1827 int *allowed_freqs;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00001828
1829 /*
1830 * mld_ap - Whether operating as an AP MLD
1831 */
1832 bool mld_ap;
1833
1834 /**
1835 * mld_link_id - Link id for MLD BSS's
1836 */
1837 u8 mld_link_id;
1838
1839 /**
1840 * psk - PSK passed to the driver for 4-way handshake offload
1841 */
1842 u8 psk[PMK_LEN];
1843
1844 /**
1845 * psk_len - PSK length in bytes (0 = not set)
1846 */
1847 size_t psk_len;
1848
1849 /**
1850 * sae_password - SAE password for SAE offload
1851 */
1852 const char *sae_password;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001853};
1854
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001855struct wpa_driver_mesh_bss_params {
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001856#define WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS 0x00000001
1857#define WPA_DRIVER_MESH_CONF_FLAG_PEER_LINK_TIMEOUT 0x00000002
1858#define WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS 0x00000004
1859#define WPA_DRIVER_MESH_CONF_FLAG_HT_OP_MODE 0x00000008
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001860#define WPA_DRIVER_MESH_CONF_FLAG_RSSI_THRESHOLD 0x00000010
Hai Shalomc1a21442022-02-04 13:43:00 -08001861#define WPA_DRIVER_MESH_CONF_FLAG_FORWARDING 0x00000020
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001862 /*
1863 * TODO: Other mesh configuration parameters would go here.
1864 * See NL80211_MESHCONF_* for all the mesh config parameters.
1865 */
1866 unsigned int flags;
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001867 int auto_plinks;
Dmitry Shmidt2f74e362015-01-21 13:19:05 -08001868 int peer_link_timeout;
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001869 int max_peer_links;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001870 int rssi_threshold;
Hai Shalomc1a21442022-02-04 13:43:00 -08001871 int forwarding;
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001872 u16 ht_opmode;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001873};
1874
1875struct wpa_driver_mesh_join_params {
1876 const u8 *meshid;
1877 int meshid_len;
1878 const int *basic_rates;
1879 const u8 *ies;
1880 int ie_len;
Dmitry Shmidtff787d52015-01-12 13:01:47 -08001881 struct hostapd_freq_params freq;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001882 int beacon_int;
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07001883 int dtim_period;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001884 struct wpa_driver_mesh_bss_params conf;
1885#define WPA_DRIVER_MESH_FLAG_USER_MPM 0x00000001
1886#define WPA_DRIVER_MESH_FLAG_DRIVER_MPM 0x00000002
1887#define WPA_DRIVER_MESH_FLAG_SAE_AUTH 0x00000004
1888#define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008
1889 unsigned int flags;
Hai Shalom60840252021-02-19 19:02:11 -08001890 bool handle_dfs;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001891};
1892
Hai Shalomfdcde762020-04-02 11:19:20 -07001893struct wpa_driver_set_key_params {
1894 /**
1895 * ifname - Interface name (for multi-SSID/VLAN support) */
1896 const char *ifname;
1897
1898 /**
1899 * alg - Encryption algorithm
1900 *
1901 * (%WPA_ALG_NONE, %WPA_ALG_WEP, %WPA_ALG_TKIP, %WPA_ALG_CCMP,
Hai Shalom4fbc08f2020-05-18 12:37:00 -07001902 * %WPA_ALG_BIP_AES_CMAC_128, %WPA_ALG_GCMP, %WPA_ALG_GCMP_256,
1903 * %WPA_ALG_CCMP_256, %WPA_ALG_BIP_GMAC_128, %WPA_ALG_BIP_GMAC_256,
1904 * %WPA_ALG_BIP_CMAC_256);
Hai Shalomfdcde762020-04-02 11:19:20 -07001905 * %WPA_ALG_NONE clears the key. */
1906 enum wpa_alg alg;
1907
1908 /**
1909 * addr - Address of the peer STA
1910 *
1911 * (BSSID of the current AP when setting pairwise key in station mode),
1912 * ff:ff:ff:ff:ff:ff for broadcast keys, %NULL for default keys that
1913 * are used both for broadcast and unicast; when clearing keys, %NULL
1914 * is used to indicate that both the broadcast-only and default key of
1915 * the specified key index is to be cleared */
1916 const u8 *addr;
1917
1918 /**
1919 * key_idx - Key index
1920 *
1921 * (0..3), usually 0 for unicast keys; 4..5 for IGTK; 6..7 for BIGTK */
1922 int key_idx;
1923
1924 /**
1925 * set_tx - Configure this key as the default Tx key
1926 *
1927 * Only used when driver does not support separate unicast/individual
1928 * key */
1929 int set_tx;
1930
1931 /**
1932 * seq - Sequence number/packet number
1933 *
1934 * seq_len octets, the next packet number to be used for in replay
1935 * protection; configured for Rx keys (in most cases, this is only used
1936 * with broadcast keys and set to zero for unicast keys); %NULL if not
1937 * set */
1938 const u8 *seq;
1939
1940 /**
1941 * seq_len - Length of the seq, depends on the algorithm
1942 *
1943 * TKIP: 6 octets, CCMP/GCMP: 6 octets, IGTK: 6 octets */
1944 size_t seq_len;
1945
1946 /**
1947 * key - Key buffer
1948 *
1949 * TKIP: 16-byte temporal key, 8-byte Tx Mic key, 8-byte Rx Mic Key */
1950 const u8 *key;
1951
1952 /**
1953 * key_len - Length of the key buffer in octets
1954 *
1955 * WEP: 5 or 13, TKIP: 32, CCMP/GCMP: 16, IGTK: 16 */
1956 size_t key_len;
1957
1958 /**
1959 * vlan_id - VLAN index (0..4095) for VLAN offload cases */
1960 int vlan_id;
1961
1962 /**
1963 * key_flag - Additional key flags
1964 *
1965 * %KEY_FLAG_MODIFY
1966 * Set when an already installed key must be updated.
1967 * So far the only use-case is changing RX/TX status for
1968 * pairwise keys. Must not be set when deleting a key.
1969 * %KEY_FLAG_DEFAULT
1970 * Set when the key is also a default key. Must not be set when
1971 * deleting a key.
1972 * %KEY_FLAG_RX
1973 * The key is valid for RX. Must not be set when deleting a key.
1974 * %KEY_FLAG_TX
1975 * The key is valid for TX. Must not be set when deleting a key.
1976 * %KEY_FLAG_GROUP
1977 * The key is a broadcast or group key.
1978 * %KEY_FLAG_PAIRWISE
1979 * The key is a pairwise key.
1980 * %KEY_FLAG_PMK
1981 * The key is a Pairwise Master Key (PMK).
1982 *
1983 * Valid and pre-defined combinations are:
1984 * %KEY_FLAG_GROUP_RX_TX
1985 * WEP key not to be installed as default key.
1986 * %KEY_FLAG_GROUP_RX_TX_DEFAULT
1987 * Default WEP or WPA-NONE key.
1988 * %KEY_FLAG_GROUP_RX
1989 * GTK key valid for RX only.
1990 * %KEY_FLAG_GROUP_TX_DEFAULT
1991 * GTK key valid for TX only, immediately taking over TX.
1992 * %KEY_FLAG_PAIRWISE_RX_TX
1993 * Pairwise key immediately becoming the active pairwise key.
1994 * %KEY_FLAG_PAIRWISE_RX
1995 * Pairwise key not yet valid for TX. (Only usable when Extended
1996 * Key ID is supported by the driver.)
1997 * %KEY_FLAG_PAIRWISE_RX_TX_MODIFY
1998 * Enable TX for a pairwise key installed with
1999 * KEY_FLAG_PAIRWISE_RX.
2000 *
2001 * Not a valid standalone key type but pre-defined to be combined
2002 * with other key_flags:
2003 * %KEY_FLAG_RX_TX
2004 * RX/TX key. */
2005 enum key_flag key_flag;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002006
2007 /**
2008 * link_id - MLO Link ID
2009 *
2010 * Set to a valid Link ID (0-14) when applicable, otherwise -1. */
2011 int link_id;
Hai Shalomfdcde762020-04-02 11:19:20 -07002012};
2013
Hai Shalom4fbc08f2020-05-18 12:37:00 -07002014enum wpa_driver_if_type {
2015 /**
2016 * WPA_IF_STATION - Station mode interface
2017 */
2018 WPA_IF_STATION,
2019
2020 /**
2021 * WPA_IF_AP_VLAN - AP mode VLAN interface
2022 *
2023 * This interface shares its address and Beacon frame with the main
2024 * BSS.
2025 */
2026 WPA_IF_AP_VLAN,
2027
2028 /**
2029 * WPA_IF_AP_BSS - AP mode BSS interface
2030 *
2031 * This interface has its own address and Beacon frame.
2032 */
2033 WPA_IF_AP_BSS,
2034
2035 /**
2036 * WPA_IF_P2P_GO - P2P Group Owner
2037 */
2038 WPA_IF_P2P_GO,
2039
2040 /**
2041 * WPA_IF_P2P_CLIENT - P2P Client
2042 */
2043 WPA_IF_P2P_CLIENT,
2044
2045 /**
2046 * WPA_IF_P2P_GROUP - P2P Group interface (will become either
2047 * WPA_IF_P2P_GO or WPA_IF_P2P_CLIENT, but the role is not yet known)
2048 */
2049 WPA_IF_P2P_GROUP,
2050
2051 /**
Sunil Ravia04bd252022-05-02 22:54:18 -07002052 * WPA_IF_P2P_DEVICE - P2P Device interface is used to identify the
Hai Shalom4fbc08f2020-05-18 12:37:00 -07002053 * abstracted P2P Device function in the driver
2054 */
2055 WPA_IF_P2P_DEVICE,
2056
2057 /*
2058 * WPA_IF_MESH - Mesh interface
2059 */
2060 WPA_IF_MESH,
2061
2062 /*
2063 * WPA_IF_TDLS - TDLS offchannel interface (used for pref freq only)
2064 */
2065 WPA_IF_TDLS,
2066
2067 /*
2068 * WPA_IF_IBSS - IBSS interface (used for pref freq only)
2069 */
2070 WPA_IF_IBSS,
2071
2072 /*
2073 * WPA_IF_NAN - NAN Device
2074 */
2075 WPA_IF_NAN,
2076
2077 /* keep last */
2078 WPA_IF_MAX
2079};
2080
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002081/**
2082 * struct wpa_driver_capa - Driver capability information
2083 */
2084struct wpa_driver_capa {
2085#define WPA_DRIVER_CAPA_KEY_MGMT_WPA 0x00000001
2086#define WPA_DRIVER_CAPA_KEY_MGMT_WPA2 0x00000002
2087#define WPA_DRIVER_CAPA_KEY_MGMT_WPA_PSK 0x00000004
2088#define WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK 0x00000008
2089#define WPA_DRIVER_CAPA_KEY_MGMT_WPA_NONE 0x00000010
2090#define WPA_DRIVER_CAPA_KEY_MGMT_FT 0x00000020
2091#define WPA_DRIVER_CAPA_KEY_MGMT_FT_PSK 0x00000040
Dmitry Shmidtd5e49232012-12-03 15:08:10 -08002092#define WPA_DRIVER_CAPA_KEY_MGMT_WAPI_PSK 0x00000080
Dmitry Shmidt807291d2015-01-27 13:40:23 -08002093#define WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B 0x00000100
2094#define WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B_192 0x00000200
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002095#define WPA_DRIVER_CAPA_KEY_MGMT_OWE 0x00000400
2096#define WPA_DRIVER_CAPA_KEY_MGMT_DPP 0x00000800
2097#define WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA256 0x00001000
2098#define WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA384 0x00002000
2099#define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA256 0x00004000
2100#define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA384 0x00008000
Hai Shalom74f70d42019-02-11 14:42:39 -08002101#define WPA_DRIVER_CAPA_KEY_MGMT_SAE 0x00010000
Tanmay Garga7fd80d2020-05-18 15:52:44 +05302102#define WPA_DRIVER_CAPA_KEY_MGMT_802_1X_SHA256 0x00020000
2103#define WPA_DRIVER_CAPA_KEY_MGMT_PSK_SHA256 0x00040000
2104#define WPA_DRIVER_CAPA_KEY_MGMT_TPK_HANDSHAKE 0x00080000
2105#define WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE 0x00100000
2106#define WPA_DRIVER_CAPA_KEY_MGMT_FT_802_1X_SHA384 0x00200000
2107#define WPA_DRIVER_CAPA_KEY_MGMT_CCKM 0x00400000
2108#define WPA_DRIVER_CAPA_KEY_MGMT_OSEN 0x00800000
Sunil Ravi89eba102022-09-13 21:04:37 -07002109#define WPA_DRIVER_CAPA_KEY_MGMT_SAE_EXT_KEY 0x01000000
2110#define WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE_EXT_KEY 0x02000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002111 /** Bitfield of supported key management suites */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002112 unsigned int key_mgmt;
Hai Shalom4fbc08f2020-05-18 12:37:00 -07002113 unsigned int key_mgmt_iftype[WPA_IF_MAX];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002114
2115#define WPA_DRIVER_CAPA_ENC_WEP40 0x00000001
2116#define WPA_DRIVER_CAPA_ENC_WEP104 0x00000002
2117#define WPA_DRIVER_CAPA_ENC_TKIP 0x00000004
2118#define WPA_DRIVER_CAPA_ENC_CCMP 0x00000008
Dmitry Shmidt04949592012-07-19 12:16:46 -07002119#define WPA_DRIVER_CAPA_ENC_WEP128 0x00000010
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07002120#define WPA_DRIVER_CAPA_ENC_GCMP 0x00000020
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08002121#define WPA_DRIVER_CAPA_ENC_GCMP_256 0x00000040
2122#define WPA_DRIVER_CAPA_ENC_CCMP_256 0x00000080
2123#define WPA_DRIVER_CAPA_ENC_BIP 0x00000100
2124#define WPA_DRIVER_CAPA_ENC_BIP_GMAC_128 0x00000200
2125#define WPA_DRIVER_CAPA_ENC_BIP_GMAC_256 0x00000400
2126#define WPA_DRIVER_CAPA_ENC_BIP_CMAC_256 0x00000800
Dmitry Shmidtf21452a2014-02-26 10:55:25 -08002127#define WPA_DRIVER_CAPA_ENC_GTK_NOT_USED 0x00001000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002128 /** Bitfield of supported cipher suites */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002129 unsigned int enc;
2130
2131#define WPA_DRIVER_AUTH_OPEN 0x00000001
2132#define WPA_DRIVER_AUTH_SHARED 0x00000002
2133#define WPA_DRIVER_AUTH_LEAP 0x00000004
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002134 /** Bitfield of supported IEEE 802.11 authentication algorithms */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002135 unsigned int auth;
2136
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002137/** Driver generated WPA/RSN IE */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002138#define WPA_DRIVER_FLAGS_DRIVER_IE 0x00000001
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002139/** Driver needs static WEP key setup after association command */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002140#define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC 0x00000002
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002141/** Driver takes care of all DFS operations */
Dmitry Shmidtd11f0192014-03-24 12:09:47 -07002142#define WPA_DRIVER_FLAGS_DFS_OFFLOAD 0x00000004
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002143/** Driver takes care of RSN 4-way handshake internally; PMK is configured with
Hai Shalomfdcde762020-04-02 11:19:20 -07002144 * struct wpa_driver_ops::set_key using key_flag = KEY_FLAG_PMK */
Hai Shalom74f70d42019-02-11 14:42:39 -08002145#define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X 0x00000008
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002146/** Driver is for a wired Ethernet interface */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002147#define WPA_DRIVER_FLAGS_WIRED 0x00000010
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002148/** Driver provides separate commands for authentication and association (SME in
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002149 * wpa_supplicant). */
2150#define WPA_DRIVER_FLAGS_SME 0x00000020
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002151/** Driver supports AP mode */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002152#define WPA_DRIVER_FLAGS_AP 0x00000040
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002153/** Driver needs static WEP key setup after association has been completed */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002154#define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE 0x00000080
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002155/** Driver supports dynamic HT 20/40 MHz channel changes during BSS lifetime */
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07002156#define WPA_DRIVER_FLAGS_HT_2040_COEX 0x00000100
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002157/** Driver supports concurrent P2P operations */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002158#define WPA_DRIVER_FLAGS_P2P_CONCURRENT 0x00000200
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002159/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002160 * Driver uses the initial interface as a dedicated management interface, i.e.,
2161 * it cannot be used for P2P group operations or non-P2P purposes.
2162 */
2163#define WPA_DRIVER_FLAGS_P2P_DEDICATED_INTERFACE 0x00000400
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002164/** This interface is P2P capable (P2P GO or P2P Client) */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002165#define WPA_DRIVER_FLAGS_P2P_CAPABLE 0x00000800
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002166/** Driver supports station and key removal when stopping an AP */
Dmitry Shmidta38abf92014-03-06 13:38:44 -08002167#define WPA_DRIVER_FLAGS_AP_TEARDOWN_SUPPORT 0x00001000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002168/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002169 * Driver uses the initial interface for P2P management interface and non-P2P
2170 * purposes (e.g., connect to infra AP), but this interface cannot be used for
2171 * P2P group operations.
2172 */
2173#define WPA_DRIVER_FLAGS_P2P_MGMT_AND_NON_P2P 0x00002000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002174/**
Hai Shalomc1a21442022-02-04 13:43:00 -08002175 * Driver is known to use valid error codes, i.e., when it indicates that
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002176 * something (e.g., association) fails, there was indeed a failure and the
2177 * operation does not end up getting completed successfully later.
2178 */
Hai Shalomc1a21442022-02-04 13:43:00 -08002179#define WPA_DRIVER_FLAGS_VALID_ERROR_CODES 0x00004000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002180/** Driver supports off-channel TX */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002181#define WPA_DRIVER_FLAGS_OFFCHANNEL_TX 0x00008000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002182/** Driver indicates TX status events for EAPOL Data frames */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002183#define WPA_DRIVER_FLAGS_EAPOL_TX_STATUS 0x00010000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002184/** Driver indicates TX status events for Deauth/Disassoc frames */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002185#define WPA_DRIVER_FLAGS_DEAUTH_TX_STATUS 0x00020000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002186/** Driver supports roaming (BSS selection) in firmware */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002187#define WPA_DRIVER_FLAGS_BSS_SELECTION 0x00040000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002188/** Driver supports operating as a TDLS peer */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002189#define WPA_DRIVER_FLAGS_TDLS_SUPPORT 0x00080000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002190/** Driver requires external TDLS setup/teardown/discovery */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002191#define WPA_DRIVER_FLAGS_TDLS_EXTERNAL_SETUP 0x00100000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002192/** Driver indicates support for Probe Response offloading in AP mode */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002193#define WPA_DRIVER_FLAGS_PROBE_RESP_OFFLOAD 0x00200000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002194/** Driver supports U-APSD in AP mode */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002195#define WPA_DRIVER_FLAGS_AP_UAPSD 0x00400000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002196/** Driver supports inactivity timer in AP mode */
Dmitry Shmidt04949592012-07-19 12:16:46 -07002197#define WPA_DRIVER_FLAGS_INACTIVITY_TIMER 0x00800000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002198/** Driver expects user space implementation of MLME in AP mode */
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07002199#define WPA_DRIVER_FLAGS_AP_MLME 0x01000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002200/** Driver supports SAE with user space SME */
Dmitry Shmidtd5e49232012-12-03 15:08:10 -08002201#define WPA_DRIVER_FLAGS_SAE 0x02000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002202/** Driver makes use of OBSS scan mechanism in wpa_supplicant */
Dmitry Shmidtd5e49232012-12-03 15:08:10 -08002203#define WPA_DRIVER_FLAGS_OBSS_SCAN 0x04000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002204/** Driver supports IBSS (Ad-hoc) mode */
Dmitry Shmidt700a1372013-03-15 14:14:44 -07002205#define WPA_DRIVER_FLAGS_IBSS 0x08000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002206/** Driver supports radar detection */
Dmitry Shmidtea69e842013-05-13 14:52:28 -07002207#define WPA_DRIVER_FLAGS_RADAR 0x10000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002208/** Driver supports a dedicated interface for P2P Device */
Dmitry Shmidt34af3062013-07-11 10:46:32 -07002209#define WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE 0x20000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002210/** Driver supports QoS Mapping */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08002211#define WPA_DRIVER_FLAGS_QOS_MAPPING 0x40000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002212/** Driver supports CSA in AP mode */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08002213#define WPA_DRIVER_FLAGS_AP_CSA 0x80000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002214/** Driver supports mesh */
2215#define WPA_DRIVER_FLAGS_MESH 0x0000000100000000ULL
2216/** Driver support ACS offload */
2217#define WPA_DRIVER_FLAGS_ACS_OFFLOAD 0x0000000200000000ULL
2218/** Driver supports key management offload */
2219#define WPA_DRIVER_FLAGS_KEY_MGMT_OFFLOAD 0x0000000400000000ULL
2220/** Driver supports TDLS channel switching */
2221#define WPA_DRIVER_FLAGS_TDLS_CHANNEL_SWITCH 0x0000000800000000ULL
Dmitry Shmidtff787d52015-01-12 13:01:47 -08002222/** Driver supports IBSS with HT datarates */
2223#define WPA_DRIVER_FLAGS_HT_IBSS 0x0000001000000000ULL
Dmitry Shmidt7f656022015-02-25 14:36:37 -08002224/** Driver supports IBSS with VHT datarates */
2225#define WPA_DRIVER_FLAGS_VHT_IBSS 0x0000002000000000ULL
Dmitry Shmidtb1e52102015-05-29 12:36:29 -07002226/** Driver supports automatic band selection */
2227#define WPA_DRIVER_FLAGS_SUPPORT_HW_MODE_ANY 0x0000004000000000ULL
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002228/** Driver supports simultaneous off-channel operations */
2229#define WPA_DRIVER_FLAGS_OFFCHANNEL_SIMULTANEOUS 0x0000008000000000ULL
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002230/** Driver supports full AP client state */
2231#define WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE 0x0000010000000000ULL
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07002232/** Driver supports P2P Listen offload */
2233#define WPA_DRIVER_FLAGS_P2P_LISTEN_OFFLOAD 0x0000020000000000ULL
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08002234/** Driver supports FILS */
2235#define WPA_DRIVER_FLAGS_SUPPORT_FILS 0x0000040000000000ULL
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08002236/** Driver supports Beacon frame TX rate configuration (legacy rates) */
2237#define WPA_DRIVER_FLAGS_BEACON_RATE_LEGACY 0x0000080000000000ULL
2238/** Driver supports Beacon frame TX rate configuration (HT rates) */
2239#define WPA_DRIVER_FLAGS_BEACON_RATE_HT 0x0000100000000000ULL
2240/** Driver supports Beacon frame TX rate configuration (VHT rates) */
2241#define WPA_DRIVER_FLAGS_BEACON_RATE_VHT 0x0000200000000000ULL
Dmitry Shmidtebd93af2017-02-21 13:40:44 -08002242/** Driver supports mgmt_tx with random TX address in non-connected state */
2243#define WPA_DRIVER_FLAGS_MGMT_TX_RANDOM_TA 0x0000400000000000ULL
2244/** Driver supports mgmt_tx with random TX addr in connected state */
2245#define WPA_DRIVER_FLAGS_MGMT_TX_RANDOM_TA_CONNECTED 0x0000800000000000ULL
2246/** Driver supports better BSS reporting with sched_scan in connected mode */
2247#define WPA_DRIVER_FLAGS_SCHED_SCAN_RELATIVE_RSSI 0x0001000000000000ULL
2248/** Driver supports HE capabilities */
2249#define WPA_DRIVER_FLAGS_HE_CAPABILITIES 0x0002000000000000ULL
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002250/** Driver supports FILS shared key offload */
2251#define WPA_DRIVER_FLAGS_FILS_SK_OFFLOAD 0x0004000000000000ULL
2252/** Driver supports all OCE STA specific mandatory features */
2253#define WPA_DRIVER_FLAGS_OCE_STA 0x0008000000000000ULL
2254/** Driver supports all OCE AP specific mandatory features */
2255#define WPA_DRIVER_FLAGS_OCE_AP 0x0010000000000000ULL
2256/**
2257 * Driver supports all OCE STA-CFON specific mandatory features only.
2258 * If a driver sets this bit but not the %WPA_DRIVER_FLAGS_OCE_AP, the
2259 * userspace shall assume that this driver may not support all OCE AP
2260 * functionality but can support only OCE STA-CFON functionality.
2261 */
2262#define WPA_DRIVER_FLAGS_OCE_STA_CFON 0x0020000000000000ULL
Roshan Pius3a1667e2018-07-03 15:17:14 -07002263/** Driver supports MFP-optional in the connect command */
2264#define WPA_DRIVER_FLAGS_MFP_OPTIONAL 0x0040000000000000ULL
Hai Shalom39ba6fc2019-01-22 12:40:38 -08002265/** Driver is a self-managed regulatory device */
2266#define WPA_DRIVER_FLAGS_SELF_MANAGED_REGULATORY 0x0080000000000000ULL
Hai Shalom74f70d42019-02-11 14:42:39 -08002267/** Driver supports FTM responder functionality */
2268#define WPA_DRIVER_FLAGS_FTM_RESPONDER 0x0100000000000000ULL
2269/** Driver support 4-way handshake offload for WPA-Personal */
2270#define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK 0x0200000000000000ULL
Hai Shalomb755a2a2020-04-23 21:49:02 -07002271/** Driver supports a separate control port TX for EAPOL frames */
Hai Shalomfdcde762020-04-02 11:19:20 -07002272#define WPA_DRIVER_FLAGS_CONTROL_PORT 0x0400000000000000ULL
2273/** Driver supports VLAN offload */
2274#define WPA_DRIVER_FLAGS_VLAN_OFFLOAD 0x0800000000000000ULL
2275/** Driver supports UPDATE_FT_IES command */
2276#define WPA_DRIVER_FLAGS_UPDATE_FT_IES 0x1000000000000000ULL
2277/** Driver can correctly rekey PTKs without Extended Key ID */
2278#define WPA_DRIVER_FLAGS_SAFE_PTK0_REKEYS 0x2000000000000000ULL
2279/** Driver supports Beacon protection */
2280#define WPA_DRIVER_FLAGS_BEACON_PROTECTION 0x4000000000000000ULL
2281/** Driver supports Extended Key ID */
2282#define WPA_DRIVER_FLAGS_EXTENDED_KEY_ID 0x8000000000000000ULL
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002283 u64 flags;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002284
Hai Shalomb755a2a2020-04-23 21:49:02 -07002285/** Driver supports a separate control port RX for EAPOL frames */
2286#define WPA_DRIVER_FLAGS2_CONTROL_PORT_RX 0x0000000000000001ULL
Hai Shalom899fcc72020-10-19 14:38:18 -07002287/** Driver supports TX status reports for EAPOL frames through control port */
2288#define WPA_DRIVER_FLAGS2_CONTROL_PORT_TX_STATUS 0x0000000000000002ULL
Sunil Ravi89eba102022-09-13 21:04:37 -07002289/** Driver supports secure LTF in AP mode */
2290#define WPA_DRIVER_FLAGS2_SEC_LTF_AP 0x0000000000000004ULL
2291/** Driver supports secure RTT measurement exchange in AP mode */
2292#define WPA_DRIVER_FLAGS2_SEC_RTT_AP 0x0000000000000008ULL
Hai Shalom60840252021-02-19 19:02:11 -08002293/**
2294 * Driver supports protection of range negotiation and measurement management
Sunil Ravi89eba102022-09-13 21:04:37 -07002295 * frames in AP mode
Hai Shalom60840252021-02-19 19:02:11 -08002296 */
Sunil Ravi89eba102022-09-13 21:04:37 -07002297#define WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_AP 0x0000000000000010ULL
Hai Shalom60840252021-02-19 19:02:11 -08002298/** Driver supports Beacon frame TX rate configuration (HE rates) */
2299#define WPA_DRIVER_FLAGS2_BEACON_RATE_HE 0x0000000000000020ULL
2300/** Driver supports Beacon protection only in client mode */
2301#define WPA_DRIVER_FLAGS2_BEACON_PROTECTION_CLIENT 0x0000000000000040ULL
2302/** Driver supports Operating Channel Validation */
2303#define WPA_DRIVER_FLAGS2_OCV 0x0000000000000080ULL
2304/** Driver expects user space implementation of SME in AP mode */
2305#define WPA_DRIVER_FLAGS2_AP_SME 0x0000000000000100ULL
Sunil Ravia04bd252022-05-02 22:54:18 -07002306/** Driver handles SA Query procedures in AP mode */
2307#define WPA_DRIVER_FLAGS2_SA_QUERY_OFFLOAD_AP 0x0000000000000200ULL
2308/** Driver supports background radar/CAC detection */
Sunil Ravi2a14cf12023-11-21 00:54:38 +00002309#define WPA_DRIVER_FLAGS2_RADAR_BACKGROUND 0x0000000000000400ULL
Sunil Ravi89eba102022-09-13 21:04:37 -07002310/** Driver supports secure LTF in STA mode */
2311#define WPA_DRIVER_FLAGS2_SEC_LTF_STA 0x0000000000000800ULL
2312/** Driver supports secure RTT measurement exchange in STA mode */
2313#define WPA_DRIVER_FLAGS2_SEC_RTT_STA 0x0000000000001000ULL
2314/**
2315 * Driver supports protection of range negotiation and measurement management
2316 * frames in STA mode
2317 */
2318#define WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_STA 0x0000000000002000ULL
Sunil Ravi77d572f2023-01-17 23:58:31 +00002319/** Driver supports MLO in station/AP mode */
2320#define WPA_DRIVER_FLAGS2_MLO 0x0000000000004000ULL
Sunil Ravi2a14cf12023-11-21 00:54:38 +00002321/** Driver supports minimal scan request probe content */
2322#define WPA_DRIVER_FLAGS2_SCAN_MIN_PREQ 0x0000000000008000ULL
2323/** Driver supports SAE authentication offload in STA mode */
2324#define WPA_DRIVER_FLAGS2_SAE_OFFLOAD_STA 0x0000000000010000ULL
2325/** Driver support AP_PSK authentication offload */
2326#define WPA_DRIVER_FLAGS2_4WAY_HANDSHAKE_AP_PSK 0x0000000000020000ULL
2327/** Driver supports OWE STA offload */
2328#define WPA_DRIVER_FLAGS2_OWE_OFFLOAD_STA 0x0000000000040000ULL
2329/** Driver supports OWE AP offload */
2330#define WPA_DRIVER_FLAGS2_OWE_OFFLOAD_AP 0x0000000000080000ULL
2331/** Driver support AP SAE authentication offload */
2332#define WPA_DRIVER_FLAGS2_SAE_OFFLOAD_AP 0x0000000000100000ULL
Hai Shalomb755a2a2020-04-23 21:49:02 -07002333 u64 flags2;
2334
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002335#define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \
2336 (drv_flags & WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE)
2337
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002338 unsigned int wmm_ac_supported:1;
2339
2340 unsigned int mac_addr_rand_scan_supported:1;
2341 unsigned int mac_addr_rand_sched_scan_supported:1;
2342
2343 /** Maximum number of supported active probe SSIDs */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002344 int max_scan_ssids;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002345
2346 /** Maximum number of supported active probe SSIDs for sched_scan */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002347 int max_sched_scan_ssids;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002348
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08002349 /** Maximum number of supported scan plans for scheduled scan */
2350 unsigned int max_sched_scan_plans;
2351
2352 /** Maximum interval in a scan plan. In seconds */
2353 u32 max_sched_scan_plan_interval;
2354
2355 /** Maximum number of iterations in a single scan plan */
2356 u32 max_sched_scan_plan_iterations;
2357
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002358 /** Whether sched_scan (offloaded scanning) is supported */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002359 int sched_scan_supported;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002360
2361 /** Maximum number of supported match sets for sched_scan */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002362 int max_match_sets;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002363
2364 /**
2365 * max_remain_on_chan - Maximum remain-on-channel duration in msec
2366 */
2367 unsigned int max_remain_on_chan;
2368
2369 /**
2370 * max_stations - Maximum number of associated stations the driver
2371 * supports in AP mode
2372 */
2373 unsigned int max_stations;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002374
2375 /**
2376 * probe_resp_offloads - Bitmap of supported protocols by the driver
2377 * for Probe Response offloading.
2378 */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002379/** Driver Probe Response offloading support for WPS ver. 1 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002380#define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS 0x00000001
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002381/** Driver Probe Response offloading support for WPS ver. 2 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002382#define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS2 0x00000002
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002383/** Driver Probe Response offloading support for P2P */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002384#define WPA_DRIVER_PROBE_RESP_OFFLOAD_P2P 0x00000004
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002385/** Driver Probe Response offloading support for IEEE 802.11u (Interworking) */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002386#define WPA_DRIVER_PROBE_RESP_OFFLOAD_INTERWORKING 0x00000008
2387 unsigned int probe_resp_offloads;
Dmitry Shmidt444d5672013-04-01 13:08:44 -07002388
Dmitry Shmidt8bae4132013-06-06 11:25:10 -07002389 unsigned int max_acl_mac_addrs;
2390
Dmitry Shmidt444d5672013-04-01 13:08:44 -07002391 /**
Dmitry Shmidtc2ebb4b2013-07-24 12:57:51 -07002392 * Number of supported concurrent channels
2393 */
2394 unsigned int num_multichan_concurrent;
2395
2396 /**
Dmitry Shmidt444d5672013-04-01 13:08:44 -07002397 * extended_capa - extended capabilities in driver/device
2398 *
2399 * Must be allocated and freed by driver and the pointers must be
2400 * valid for the lifetime of the driver, i.e., freed in deinit()
2401 */
2402 const u8 *extended_capa, *extended_capa_mask;
2403 unsigned int extended_capa_len;
Dmitry Shmidtb58836e2014-04-29 14:35:56 -07002404
2405 struct wowlan_triggers wowlan_triggers;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002406
2407/** Driver adds the DS Params Set IE in Probe Request frames */
2408#define WPA_DRIVER_FLAGS_DS_PARAM_SET_IE_IN_PROBES 0x00000001
2409/** Driver adds the WFA TPC IE in Probe Request frames */
2410#define WPA_DRIVER_FLAGS_WFA_TPC_IE_IN_PROBES 0x00000002
2411/** Driver handles quiet period requests */
2412#define WPA_DRIVER_FLAGS_QUIET 0x00000004
2413/**
2414 * Driver is capable of inserting the current TX power value into the body of
2415 * transmitted frames.
2416 * Background: Some Action frames include a TPC Report IE. This IE contains a
2417 * TX power field, which has to be updated by lower layers. One such Action
2418 * frame is Link Measurement Report (part of RRM). Another is TPC Report (part
2419 * of spectrum management). Note that this insertion takes place at a fixed
2420 * offset, namely the 6th byte in the Action frame body.
2421 */
2422#define WPA_DRIVER_FLAGS_TX_POWER_INSERTION 0x00000008
Dmitry Shmidt849734c2016-05-27 09:59:01 -07002423/**
2424 * Driver supports RRM. With this support, the driver will accept to use RRM in
2425 * (Re)Association Request frames, without supporting quiet period.
2426 */
2427#define WPA_DRIVER_FLAGS_SUPPORT_RRM 0x00000010
2428
Dmitry Shmidt29333592017-01-09 12:27:11 -08002429/** Driver supports setting the scan dwell time */
2430#define WPA_DRIVER_FLAGS_SUPPORT_SET_SCAN_DWELL 0x00000020
2431/** Driver supports Beacon Report Measurement */
2432#define WPA_DRIVER_FLAGS_SUPPORT_BEACON_REPORT 0x00000040
2433
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002434 u32 rrm_flags;
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002435
2436 /* Driver concurrency capabilities */
2437 unsigned int conc_capab;
2438 /* Maximum number of concurrent channels on 2.4 GHz */
2439 unsigned int max_conc_chan_2_4;
2440 /* Maximum number of concurrent channels on 5 GHz */
2441 unsigned int max_conc_chan_5_0;
2442
2443 /* Maximum number of supported CSA counters */
2444 u16 max_csa_counters;
Sunil Ravi89eba102022-09-13 21:04:37 -07002445
2446 /* Maximum number of supported AKM suites in commands */
2447 unsigned int max_num_akms;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002448
2449 /* Maximum number of interfaces supported for MBSSID advertisement */
2450 unsigned int mbssid_max_interfaces;
2451 /* Maximum profile periodicity for enhanced MBSSID advertisement */
2452 unsigned int ema_max_periodicity;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002453};
2454
2455
2456struct hostapd_data;
2457
Sunil Ravi036cec52023-03-29 11:35:17 -07002458enum guard_interval {
2459 GUARD_INTERVAL_0_4 = 1,
2460 GUARD_INTERVAL_0_8 = 2,
2461 GUARD_INTERVAL_1_6 = 3,
2462 GUARD_INTERVAL_3_2 = 4,
2463};
2464
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002465#define STA_DRV_DATA_TX_MCS BIT(0)
2466#define STA_DRV_DATA_RX_MCS BIT(1)
2467#define STA_DRV_DATA_TX_VHT_MCS BIT(2)
2468#define STA_DRV_DATA_RX_VHT_MCS BIT(3)
2469#define STA_DRV_DATA_TX_VHT_NSS BIT(4)
2470#define STA_DRV_DATA_RX_VHT_NSS BIT(5)
2471#define STA_DRV_DATA_TX_SHORT_GI BIT(6)
2472#define STA_DRV_DATA_RX_SHORT_GI BIT(7)
Roshan Pius3a1667e2018-07-03 15:17:14 -07002473#define STA_DRV_DATA_LAST_ACK_RSSI BIT(8)
Hai Shalomc1a21442022-02-04 13:43:00 -08002474#define STA_DRV_DATA_CONN_TIME BIT(9)
Sunil Ravi77d572f2023-01-17 23:58:31 +00002475#define STA_DRV_DATA_TX_HE_MCS BIT(10)
2476#define STA_DRV_DATA_RX_HE_MCS BIT(11)
2477#define STA_DRV_DATA_TX_HE_NSS BIT(12)
2478#define STA_DRV_DATA_RX_HE_NSS BIT(13)
Sunil Ravi036cec52023-03-29 11:35:17 -07002479#define STA_DRV_DATA_TX_HE_DCM BIT(14)
2480#define STA_DRV_DATA_RX_HE_DCM BIT(15)
2481#define STA_DRV_DATA_TX_HE_GI BIT(16)
2482#define STA_DRV_DATA_RX_HE_GI BIT(17)
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002483
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002484struct hostap_sta_driver_data {
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002485 unsigned long rx_packets, tx_packets;
2486 unsigned long long rx_bytes, tx_bytes;
Hai Shalom81f62d82019-07-22 12:10:00 -07002487 unsigned long long rx_airtime, tx_airtime;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002488 unsigned long long beacons_count;
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002489 int bytes_64bit; /* whether 64-bit byte counters are supported */
Sunil Ravi77d572f2023-01-17 23:58:31 +00002490 unsigned long current_tx_rate; /* in kbps */
2491 unsigned long current_rx_rate; /* in kbps */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002492 unsigned long inactive_msec;
Hai Shalomc1a21442022-02-04 13:43:00 -08002493 unsigned long connected_sec;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002494 unsigned long flags; /* bitfield of STA_DRV_DATA_* */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002495 unsigned long num_ps_buf_frames;
2496 unsigned long tx_retry_failed;
2497 unsigned long tx_retry_count;
Roshan Pius3a1667e2018-07-03 15:17:14 -07002498 s8 last_ack_rssi;
Hai Shalom81f62d82019-07-22 12:10:00 -07002499 unsigned long backlog_packets;
2500 unsigned long backlog_bytes;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002501 unsigned long fcs_error_count;
2502 unsigned long beacon_loss_count;
2503 unsigned long expected_throughput;
2504 unsigned long rx_drop_misc;
2505 unsigned long rx_mpdus;
2506 int signal; /* dBm; or -WPA_INVALID_NOISE */
2507 u8 rx_hemcs;
2508 u8 tx_hemcs;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002509 u8 rx_vhtmcs;
2510 u8 tx_vhtmcs;
2511 u8 rx_mcs;
2512 u8 tx_mcs;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002513 u8 rx_he_nss;
2514 u8 tx_he_nss;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002515 u8 rx_vht_nss;
2516 u8 tx_vht_nss;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002517 s8 avg_signal; /* dBm */
2518 s8 avg_beacon_signal; /* dBm */
2519 s8 avg_ack_signal; /* dBm */
Sunil Ravi036cec52023-03-29 11:35:17 -07002520 enum guard_interval rx_guard_interval, tx_guard_interval;
2521 u8 rx_dcm, tx_dcm;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002522};
2523
2524struct hostapd_sta_add_params {
2525 const u8 *addr;
2526 u16 aid;
2527 u16 capability;
2528 const u8 *supp_rates;
2529 size_t supp_rates_len;
2530 u16 listen_interval;
2531 const struct ieee80211_ht_capabilities *ht_capabilities;
Dmitry Shmidta54fa5f2013-01-15 13:53:35 -08002532 const struct ieee80211_vht_capabilities *vht_capabilities;
Dmitry Shmidtbd14a572014-02-18 10:33:49 -08002533 int vht_opmode_enabled;
2534 u8 vht_opmode;
Hai Shalom81f62d82019-07-22 12:10:00 -07002535 const struct ieee80211_he_capabilities *he_capab;
2536 size_t he_capab_len;
Hai Shalom4fbc08f2020-05-18 12:37:00 -07002537 const struct ieee80211_he_6ghz_band_cap *he_6ghz_capab;
Sunil Ravia04bd252022-05-02 22:54:18 -07002538 const struct ieee80211_eht_capabilities *eht_capab;
2539 size_t eht_capab_len;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002540 u32 flags; /* bitmask of WPA_STA_* flags */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002541 u32 flags_mask; /* unset bits in flags */
2542#ifdef CONFIG_MESH
2543 enum mesh_plink_state plink_state;
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07002544 u16 peer_aid;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002545#endif /* CONFIG_MESH */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002546 int set; /* Set STA parameters instead of add */
2547 u8 qosinfo;
Dmitry Shmidtf8623282013-02-20 14:34:59 -08002548 const u8 *ext_capab;
2549 size_t ext_capab_len;
Dmitry Shmidt344abd32014-01-14 13:17:00 -08002550 const u8 *supp_channels;
2551 size_t supp_channels_len;
2552 const u8 *supp_oper_classes;
2553 size_t supp_oper_classes_len;
Dmitry Shmidt849734c2016-05-27 09:59:01 -07002554 int support_p2p_ps;
Sunil Ravi036cec52023-03-29 11:35:17 -07002555
2556 bool mld_link_sta;
2557 s8 mld_link_id;
2558 const u8 *mld_link_addr;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002559};
2560
Dmitry Shmidt8bae4132013-06-06 11:25:10 -07002561struct mac_address {
2562 u8 addr[ETH_ALEN];
2563};
2564
2565struct hostapd_acl_params {
2566 u8 acl_policy;
2567 unsigned int num_mac_acl;
2568 struct mac_address mac_acl[0];
2569};
2570
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002571struct wpa_init_params {
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002572 void *global_priv;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002573 const u8 *bssid;
2574 const char *ifname;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002575 const char *driver_params;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002576 int use_pae_group_addr;
2577 char **bridge;
2578 size_t num_bridge;
2579
2580 u8 *own_addr; /* buffer for writing own MAC address */
2581};
2582
2583
2584struct wpa_bss_params {
2585 /** Interface name (for multi-SSID/VLAN support) */
2586 const char *ifname;
2587 /** Whether IEEE 802.1X or WPA/WPA2 is enabled */
2588 int enabled;
2589
2590 int wpa;
2591 int ieee802_1x;
2592 int wpa_group;
2593 int wpa_pairwise;
2594 int wpa_key_mgmt;
2595 int rsn_preauth;
2596 enum mfp_options ieee80211w;
2597};
2598
2599#define WPA_STA_AUTHORIZED BIT(0)
2600#define WPA_STA_WMM BIT(1)
2601#define WPA_STA_SHORT_PREAMBLE BIT(2)
2602#define WPA_STA_MFP BIT(3)
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002603#define WPA_STA_TDLS_PEER BIT(4)
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002604#define WPA_STA_AUTHENTICATED BIT(5)
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002605#define WPA_STA_ASSOCIATED BIT(6)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002606
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002607enum tdls_oper {
2608 TDLS_DISCOVERY_REQ,
2609 TDLS_SETUP,
2610 TDLS_TEARDOWN,
2611 TDLS_ENABLE_LINK,
2612 TDLS_DISABLE_LINK,
2613 TDLS_ENABLE,
2614 TDLS_DISABLE
2615};
2616
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07002617enum wnm_oper {
2618 WNM_SLEEP_ENTER_CONFIRM,
2619 WNM_SLEEP_ENTER_FAIL,
2620 WNM_SLEEP_EXIT_CONFIRM,
2621 WNM_SLEEP_EXIT_FAIL,
2622 WNM_SLEEP_TFS_REQ_IE_ADD, /* STA requests driver to add TFS req IE */
2623 WNM_SLEEP_TFS_REQ_IE_NONE, /* STA requests empty TFS req IE */
2624 WNM_SLEEP_TFS_REQ_IE_SET, /* AP requests driver to set TFS req IE for
2625 * a STA */
2626 WNM_SLEEP_TFS_RESP_IE_ADD, /* AP requests driver to add TFS resp IE
2627 * for a STA */
2628 WNM_SLEEP_TFS_RESP_IE_NONE, /* AP requests empty TFS resp IE */
2629 WNM_SLEEP_TFS_RESP_IE_SET, /* AP requests driver to set TFS resp IE
2630 * for a STA */
2631 WNM_SLEEP_TFS_IE_DEL /* AP delete the TFS IE */
2632};
2633
Roshan Pius3a1667e2018-07-03 15:17:14 -07002634/* enum smps_mode - SMPS mode definitions */
2635enum smps_mode {
2636 SMPS_AUTOMATIC,
2637 SMPS_OFF,
2638 SMPS_DYNAMIC,
2639 SMPS_STATIC,
2640
2641 /* Keep last */
2642 SMPS_INVALID,
2643};
2644
Hai Shalom74f70d42019-02-11 14:42:39 -08002645#define WPA_INVALID_NOISE 9999
Dmitry Shmidt34af3062013-07-11 10:46:32 -07002646
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002647/**
2648 * struct wpa_signal_info - Information about channel signal quality
Hai Shalom74f70d42019-02-11 14:42:39 -08002649 * @frequency: control frequency
2650 * @above_threshold: true if the above threshold was crossed
2651 * (relevant for a CQM event)
Sunil Ravi77d572f2023-01-17 23:58:31 +00002652 * @data: STA information
Hai Shalom74f70d42019-02-11 14:42:39 -08002653 * @current_noise: %WPA_INVALID_NOISE if not supported
Hai Shalom74f70d42019-02-11 14:42:39 -08002654 * @chanwidth: channel width
2655 * @center_frq1: center frequency for the first segment
2656 * @center_frq2: center frequency for the second segment (if relevant)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002657 */
2658struct wpa_signal_info {
2659 u32 frequency;
2660 int above_threshold;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002661 struct hostap_sta_driver_data data;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002662 int current_noise;
Dmitry Shmidt34af3062013-07-11 10:46:32 -07002663 enum chan_width chanwidth;
2664 int center_frq1;
2665 int center_frq2;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002666};
2667
Sunil Ravi89eba102022-09-13 21:04:37 -07002668struct wpa_mlo_signal_info {
2669 u16 valid_links;
2670 struct wpa_signal_info links[MAX_NUM_MLD_LINKS];
2671};
2672
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002673/**
Hai Shalom74f70d42019-02-11 14:42:39 -08002674 * struct wpa_channel_info - Information about the current channel
2675 * @frequency: Center frequency of the primary 20 MHz channel
2676 * @chanwidth: Width of the current operating channel
2677 * @sec_channel: Location of the secondary 20 MHz channel (either +1 or -1).
2678 * This field is only filled in when using a 40 MHz channel.
2679 * @center_frq1: Center frequency of frequency segment 0
2680 * @center_frq2: Center frequency of frequency segment 1 (for 80+80 channels)
2681 * @seg1_idx: Frequency segment 1 index when using a 80+80 channel. This is
2682 * derived from center_frq2 for convenience.
2683 */
2684struct wpa_channel_info {
2685 u32 frequency;
2686 enum chan_width chanwidth;
2687 int sec_channel;
2688 int center_frq1;
2689 int center_frq2;
2690 u8 seg1_idx;
2691};
2692
2693/**
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002694 * struct beacon_data - Beacon data
2695 * @head: Head portion of Beacon frame (before TIM IE)
2696 * @tail: Tail portion of Beacon frame (after TIM IE)
2697 * @beacon_ies: Extra information element(s) to add into Beacon frames or %NULL
2698 * @proberesp_ies: Extra information element(s) to add into Probe Response
2699 * frames or %NULL
2700 * @assocresp_ies: Extra information element(s) to add into (Re)Association
2701 * Response frames or %NULL
2702 * @probe_resp: Probe Response frame template
2703 * @head_len: Length of @head
2704 * @tail_len: Length of @tail
2705 * @beacon_ies_len: Length of beacon_ies in octets
2706 * @proberesp_ies_len: Length of proberesp_ies in octets
2707 * @proberesp_ies_len: Length of proberesp_ies in octets
2708 * @probe_resp_len: Length of probe response template (@probe_resp)
2709 */
2710struct beacon_data {
2711 u8 *head, *tail;
2712 u8 *beacon_ies;
2713 u8 *proberesp_ies;
2714 u8 *assocresp_ies;
2715 u8 *probe_resp;
2716
2717 size_t head_len, tail_len;
2718 size_t beacon_ies_len;
2719 size_t proberesp_ies_len;
2720 size_t assocresp_ies_len;
2721 size_t probe_resp_len;
2722};
2723
2724/**
2725 * struct csa_settings - Settings for channel switch command
2726 * @cs_count: Count in Beacon frames (TBTT) to perform the switch
2727 * @block_tx: 1 - block transmission for CSA period
2728 * @freq_params: Next channel frequency parameter
2729 * @beacon_csa: Beacon/probe resp/asooc resp info for CSA period
2730 * @beacon_after: Next beacon/probe resp/asooc resp info
2731 * @counter_offset_beacon: Offset to the count field in beacon's tail
2732 * @counter_offset_presp: Offset to the count field in probe resp.
Sunil Ravi036cec52023-03-29 11:35:17 -07002733 * @punct_bitmap - Preamble puncturing bitmap
Sunil Ravib0ac25f2024-07-12 01:42:03 +00002734 * @link_id: Link ID to determine the link for MLD; -1 for non-MLD
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002735 */
2736struct csa_settings {
2737 u8 cs_count;
2738 u8 block_tx;
2739
2740 struct hostapd_freq_params freq_params;
2741 struct beacon_data beacon_csa;
2742 struct beacon_data beacon_after;
2743
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002744 u16 counter_offset_beacon[2];
2745 u16 counter_offset_presp[2];
Sunil Ravi036cec52023-03-29 11:35:17 -07002746
2747 u16 punct_bitmap;
Sunil Ravib0ac25f2024-07-12 01:42:03 +00002748 int link_id;
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002749};
2750
Sunil Ravia04bd252022-05-02 22:54:18 -07002751/**
2752 * struct cca_settings - Settings for color switch command
2753 * @cca_count: Count in Beacon frames (TBTT) to perform the switch
2754 * @cca_color: The new color that we are switching to
2755 * @beacon_cca: Beacon/Probe Response/(Re)Association Response frame info for
2756 * color switch period
2757 * @beacon_after: Next Beacon/Probe Response/(Re)Association Response frame info
2758 * @counter_offset_beacon: Offset to the count field in Beacon frame tail
2759 * @counter_offset_presp: Offset to the count field in Probe Response frame
2760 */
2761struct cca_settings {
2762 u8 cca_count;
2763 u8 cca_color;
2764
2765 struct beacon_data beacon_cca;
2766 struct beacon_data beacon_after;
2767
2768 u16 counter_offset_beacon;
2769 u16 counter_offset_presp;
2770};
2771
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07002772/* TDLS peer capabilities for send_tdls_mgmt() */
2773enum tdls_peer_capability {
2774 TDLS_PEER_HT = BIT(0),
2775 TDLS_PEER_VHT = BIT(1),
2776 TDLS_PEER_WMM = BIT(2),
Hai Shalomc1a21442022-02-04 13:43:00 -08002777 TDLS_PEER_HE = BIT(3),
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07002778};
2779
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002780/* valid info in the wmm_params struct */
2781enum wmm_params_valid_info {
2782 WMM_PARAMS_UAPSD_QUEUES_INFO = BIT(0),
2783};
2784
2785/**
2786 * struct wmm_params - WMM parameterss configured for this association
2787 * @info_bitmap: Bitmap of valid wmm_params info; indicates what fields
2788 * of the struct contain valid information.
2789 * @uapsd_queues: Bitmap of ACs configured for uapsd (valid only if
2790 * %WMM_PARAMS_UAPSD_QUEUES_INFO is set)
2791 */
2792struct wmm_params {
2793 u8 info_bitmap;
2794 u8 uapsd_queues;
2795};
2796
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07002797#ifdef CONFIG_MACSEC
2798struct macsec_init_params {
Hai Shalome21d4e82020-04-29 16:34:06 -07002799 bool always_include_sci;
2800 bool use_es;
2801 bool use_scb;
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07002802};
2803#endif /* CONFIG_MACSEC */
2804
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002805enum drv_br_port_attr {
2806 DRV_BR_PORT_ATTR_PROXYARP,
2807 DRV_BR_PORT_ATTR_HAIRPIN_MODE,
Sunil Ravi036cec52023-03-29 11:35:17 -07002808 DRV_BR_PORT_ATTR_MCAST2UCAST,
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002809};
2810
2811enum drv_br_net_param {
2812 DRV_BR_NET_PARAM_GARP_ACCEPT,
Dmitry Shmidt83474442015-04-15 13:47:09 -07002813 DRV_BR_MULTICAST_SNOOPING,
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002814};
2815
2816struct drv_acs_params {
2817 /* Selected mode (HOSTAPD_MODE_*) */
2818 enum hostapd_hw_mode hw_mode;
2819
2820 /* Indicates whether HT is enabled */
2821 int ht_enabled;
2822
2823 /* Indicates whether HT40 is enabled */
2824 int ht40_enabled;
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07002825
2826 /* Indicates whether VHT is enabled */
2827 int vht_enabled;
2828
2829 /* Configured ACS channel width */
2830 u16 ch_width;
2831
Ahmed ElArabawy0ff61c52019-12-26 12:38:39 -08002832 /* ACS frequency list info */
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002833 const int *freq_list;
Hai Shalomfdcde762020-04-02 11:19:20 -07002834
2835 /* Indicates whether EDMG is enabled */
2836 int edmg_enabled;
Sunil Ravia04bd252022-05-02 22:54:18 -07002837
2838 /* Indicates whether EHT is enabled */
2839 bool eht_enabled;
Sunil Ravib0ac25f2024-07-12 01:42:03 +00002840
2841 /* Indicates the link if MLO case; -1 otherwise */
2842 int link_id;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002843};
2844
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002845struct wpa_bss_trans_info {
2846 u8 mbo_transition_reason;
2847 u8 n_candidates;
2848 u8 *bssid;
2849};
2850
2851struct wpa_bss_candidate_info {
2852 u8 num;
2853 struct candidate_list {
2854 u8 bssid[ETH_ALEN];
2855 u8 is_accept;
2856 u32 reject_reason;
2857 } *candidates;
2858};
2859
2860struct wpa_pmkid_params {
2861 const u8 *bssid;
2862 const u8 *ssid;
2863 size_t ssid_len;
2864 const u8 *fils_cache_id;
2865 const u8 *pmkid;
2866 const u8 *pmk;
2867 size_t pmk_len;
Hai Shalomfdcde762020-04-02 11:19:20 -07002868 u32 pmk_lifetime;
2869 u8 pmk_reauth_threshold;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002870};
2871
2872/* Mask used to specify which connection parameters have to be updated */
2873enum wpa_drv_update_connect_params_mask {
2874 WPA_DRV_UPDATE_ASSOC_IES = BIT(0),
2875 WPA_DRV_UPDATE_FILS_ERP_INFO = BIT(1),
2876 WPA_DRV_UPDATE_AUTH_TYPE = BIT(2),
Winnie Chen4138eec2022-11-10 16:32:53 +08002877#if defined(CONFIG_DRIVER_NL80211_BRCM) || defined(CONFIG_DRIVER_NL80211_SYNA)
Vinayak Yadawade62409f2022-01-20 12:32:07 +05302878 WPA_DRV_UPDATE_TD_POLICY = BIT(3),
Winnie Chen4138eec2022-11-10 16:32:53 +08002879#endif /* CONFIG_DRIVER_NL80211_BRCM || CONFIG_DRIVER_NL80211_SYNA */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002880};
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07002881
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002882/**
Roshan Pius3a1667e2018-07-03 15:17:14 -07002883 * struct external_auth - External authentication trigger parameters
2884 *
2885 * These are used across the external authentication request and event
2886 * interfaces.
2887 * @action: Action type / trigger for external authentication. Only significant
2888 * for the event interface.
2889 * @bssid: BSSID of the peer with which the authentication has to happen. Used
2890 * by both the request and event interface.
2891 * @ssid: SSID of the AP. Used by both the request and event interface.
2892 * @ssid_len: SSID length in octets.
2893 * @key_mgmt_suite: AKM suite of the respective authentication. Optional for
2894 * the request interface.
2895 * @status: Status code, %WLAN_STATUS_SUCCESS for successful authentication,
2896 * use %WLAN_STATUS_UNSPECIFIED_FAILURE if wpa_supplicant cannot give
2897 * the real status code for failures. Used only for the request interface
2898 * from user space to the driver.
Hai Shalom5f92bc92019-04-18 11:54:11 -07002899 * @pmkid: Generated PMKID as part of external auth exchange (e.g., SAE).
Sunil Ravi036cec52023-03-29 11:35:17 -07002900 * @mld_addr: AP's MLD address or %NULL if MLO is not used
Roshan Pius3a1667e2018-07-03 15:17:14 -07002901 */
2902struct external_auth {
2903 enum {
2904 EXT_AUTH_START,
2905 EXT_AUTH_ABORT,
2906 } action;
Hai Shalom5f92bc92019-04-18 11:54:11 -07002907 const u8 *bssid;
2908 const u8 *ssid;
Roshan Pius3a1667e2018-07-03 15:17:14 -07002909 size_t ssid_len;
2910 unsigned int key_mgmt_suite;
2911 u16 status;
Hai Shalom5f92bc92019-04-18 11:54:11 -07002912 const u8 *pmkid;
Sunil Ravi036cec52023-03-29 11:35:17 -07002913 const u8 *mld_addr;
Roshan Pius3a1667e2018-07-03 15:17:14 -07002914};
2915
Sunil Ravi89eba102022-09-13 21:04:37 -07002916#define WPAS_MAX_PASN_PEERS 10
2917
2918enum pasn_status {
2919 PASN_STATUS_SUCCESS = 0,
2920 PASN_STATUS_FAILURE = 1,
2921};
2922
2923/**
2924 * struct pasn_peer - PASN peer parameters
2925 *
2926 * Used to process the PASN authentication event from the driver to
2927 * userspace and to send a response back.
2928 * @own_addr: Own MAC address specified by the driver to use for PASN
2929 * handshake.
2930 * @peer_addr: MAC address of the peer with which PASN authentication is to be
2931 * performed.
2932 * @network_id: Unique id for the network.
2933 * This identifier is used as a unique identifier for each network
2934 * block when using the control interface. Each network is allocated an
2935 * id when it is being created, either when reading the configuration
2936 * file or when a new network is added through the control interface.
2937 * @akmp: Authentication key management protocol type supported.
2938 * @cipher: Cipher suite.
2939 * @group: Finite cyclic group. Default group used is 19 (ECC).
2940 * @ltf_keyseed_required: Indicates whether LTF keyseed generation is required
2941 * @status: PASN response status, %PASN_STATUS_SUCCESS for successful
2942 * authentication, use %PASN_STATUS_FAILURE if PASN authentication
2943 * fails or if wpa_supplicant fails to set the security ranging context to
2944 * the driver
2945 */
2946struct pasn_peer {
2947 u8 own_addr[ETH_ALEN];
2948 u8 peer_addr[ETH_ALEN];
2949 int network_id;
2950 int akmp;
2951 int cipher;
2952 int group;
2953 bool ltf_keyseed_required;
2954 enum pasn_status status;
2955};
2956
2957/**
2958 * struct pasn_auth - PASN authentication trigger parameters
2959 *
2960 * These are used across the PASN authentication event from the driver to
2961 * userspace and to send a response to it.
2962 * @action: Action type. Only significant for the event interface.
2963 * @num_peers: The number of peers for which the PASN handshake is requested
2964 * for.
2965 * @peer: Holds the peer details.
2966 */
2967struct pasn_auth {
2968 enum {
2969 PASN_ACTION_AUTH,
2970 PASN_ACTION_DELETE_SECURE_RANGING_CONTEXT,
2971 } action;
2972 unsigned int num_peers;
2973 struct pasn_peer peer[WPAS_MAX_PASN_PEERS];
2974};
2975
2976/**
2977 * struct secure_ranging_params - Parameters required to set secure ranging
2978 * context for a peer.
2979 *
2980 * @action: Add or delete a security context to the driver.
2981 * @own_addr: Own MAC address used during key derivation.
2982 * @peer_addr: Address of the peer device.
2983 * @cipher: Cipher suite.
2984 * @tk_len: Length of temporal key.
2985 * @tk: Temporal key buffer.
2986 * @ltf_keyseed_len: Length of LTF keyseed.
2987 * @ltf_keyeed: LTF keyseed buffer.
2988 */
2989struct secure_ranging_params {
2990 u32 action;
2991 const u8 *own_addr;
2992 const u8 *peer_addr;
2993 u32 cipher;
2994 u8 tk_len;
2995 const u8 *tk;
2996 u8 ltf_keyseed_len;
2997 const u8 *ltf_keyseed;
2998};
2999
Hai Shalom60840252021-02-19 19:02:11 -08003000/* enum nested_attr - Used to specify if subcommand uses nested attributes */
3001enum nested_attr {
3002 NESTED_ATTR_NOT_USED = 0,
3003 NESTED_ATTR_USED = 1,
3004 NESTED_ATTR_UNSPECIFIED = 2,
3005};
3006
Sunil8cd6f4d2022-06-28 18:40:46 +00003007/* Preferred channel list information */
3008
3009/* GO role */
3010#define WEIGHTED_PCL_GO BIT(0)
3011/* P2P Client role */
3012#define WEIGHTED_PCL_CLI BIT(1)
3013/* Must be considered for operating channel */
3014#define WEIGHTED_PCL_MUST_CONSIDER BIT(2)
3015/* Should be excluded in GO negotiation */
3016#define WEIGHTED_PCL_EXCLUDE BIT(3)
3017
3018/* Preferred channel list with weight */
3019struct weighted_pcl {
3020 u32 freq; /* MHz */
3021 u8 weight;
3022 u32 flag; /* bitmap for WEIGHTED_PCL_* */
3023};
3024
Sunil Ravi89eba102022-09-13 21:04:37 -07003025struct driver_sta_mlo_info {
Sunil Ravi640215c2023-06-28 23:08:09 +00003026 bool default_map;
Sunil Ravi77d572f2023-01-17 23:58:31 +00003027 u16 req_links; /* bitmap of requested link IDs */
3028 u16 valid_links; /* bitmap of accepted link IDs */
3029 u8 assoc_link_id;
Sunil Ravi89eba102022-09-13 21:04:37 -07003030 u8 ap_mld_addr[ETH_ALEN];
3031 struct {
3032 u8 addr[ETH_ALEN];
3033 u8 bssid[ETH_ALEN];
3034 unsigned int freq;
Sunil Ravi640215c2023-06-28 23:08:09 +00003035 struct t2lm_mapping t2lmap;
Sunil Ravi89eba102022-09-13 21:04:37 -07003036 } links[MAX_NUM_MLD_LINKS];
3037};
3038
Roshan Pius3a1667e2018-07-03 15:17:14 -07003039/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003040 * struct wpa_driver_ops - Driver interface API definition
3041 *
3042 * This structure defines the API that each driver interface needs to implement
3043 * for core wpa_supplicant code. All driver specific functionality is captured
3044 * in this wrapper.
3045 */
3046struct wpa_driver_ops {
3047 /** Name of the driver interface */
3048 const char *name;
3049 /** One line description of the driver interface */
3050 const char *desc;
3051
3052 /**
3053 * get_bssid - Get the current BSSID
3054 * @priv: private driver interface data
3055 * @bssid: buffer for BSSID (ETH_ALEN = 6 bytes)
3056 *
3057 * Returns: 0 on success, -1 on failure
3058 *
3059 * Query kernel driver for the current BSSID and copy it to bssid.
3060 * Setting bssid to 00:00:00:00:00:00 is recommended if the STA is not
3061 * associated.
3062 */
3063 int (*get_bssid)(void *priv, u8 *bssid);
3064
3065 /**
3066 * get_ssid - Get the current SSID
3067 * @priv: private driver interface data
3068 * @ssid: buffer for SSID (at least 32 bytes)
3069 *
3070 * Returns: Length of the SSID on success, -1 on failure
3071 *
3072 * Query kernel driver for the current SSID and copy it to ssid.
3073 * Returning zero is recommended if the STA is not associated.
3074 *
3075 * Note: SSID is an array of octets, i.e., it is not nul terminated and
3076 * can, at least in theory, contain control characters (including nul)
3077 * and as such, should be processed as binary data, not a printable
3078 * string.
3079 */
3080 int (*get_ssid)(void *priv, u8 *ssid);
3081
3082 /**
3083 * set_key - Configure encryption key
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003084 * @priv: private driver interface data
Hai Shalomfdcde762020-04-02 11:19:20 -07003085 * @params: Key parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003086 * Returns: 0 on success, -1 on failure
3087 *
3088 * Configure the given key for the kernel driver. If the driver
3089 * supports separate individual keys (4 default keys + 1 individual),
3090 * addr can be used to determine whether the key is default or
3091 * individual. If only 4 keys are supported, the default key with key
3092 * index 0 is used as the individual key. STA must be configured to use
3093 * it as the default Tx key (set_tx is set) and accept Rx for all the
3094 * key indexes. In most cases, WPA uses only key indexes 1 and 2 for
3095 * broadcast keys, so key index 0 is available for this kind of
3096 * configuration.
3097 *
3098 * Please note that TKIP keys include separate TX and RX MIC keys and
3099 * some drivers may expect them in different order than wpa_supplicant
3100 * is using. If the TX/RX keys are swapped, all TKIP encrypted packets
3101 * will trigger Michael MIC errors. This can be fixed by changing the
Sunil Ravia04bd252022-05-02 22:54:18 -07003102 * order of MIC keys by swapping the bytes 16..23 and 24..31 of the key
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003103 * in driver_*.c set_key() implementation, see driver_ndis.c for an
3104 * example on how this can be done.
3105 */
Hai Shalomfdcde762020-04-02 11:19:20 -07003106 int (*set_key)(void *priv, struct wpa_driver_set_key_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003107
3108 /**
3109 * init - Initialize driver interface
3110 * @ctx: context to be used when calling wpa_supplicant functions,
3111 * e.g., wpa_supplicant_event()
3112 * @ifname: interface name, e.g., wlan0
3113 *
3114 * Returns: Pointer to private data, %NULL on failure
3115 *
3116 * Initialize driver interface, including event processing for kernel
3117 * driver events (e.g., associated, scan results, Michael MIC failure).
3118 * This function can allocate a private configuration data area for
3119 * @ctx, file descriptor, interface name, etc. information that may be
3120 * needed in future driver operations. If this is not used, non-NULL
3121 * value will need to be returned because %NULL is used to indicate
3122 * failure. The returned value will be used as 'void *priv' data for
3123 * all other driver_ops functions.
3124 *
3125 * The main event loop (eloop.c) of wpa_supplicant can be used to
3126 * register callback for read sockets (eloop_register_read_sock()).
3127 *
3128 * See below for more information about events and
3129 * wpa_supplicant_event() function.
3130 */
3131 void * (*init)(void *ctx, const char *ifname);
3132
3133 /**
3134 * deinit - Deinitialize driver interface
3135 * @priv: private driver interface data from init()
3136 *
3137 * Shut down driver interface and processing of driver events. Free
3138 * private data buffer if one was allocated in init() handler.
3139 */
3140 void (*deinit)(void *priv);
3141
3142 /**
3143 * set_param - Set driver configuration parameters
3144 * @priv: private driver interface data from init()
3145 * @param: driver specific configuration parameters
3146 *
3147 * Returns: 0 on success, -1 on failure
3148 *
3149 * Optional handler for notifying driver interface about configuration
3150 * parameters (driver_param).
3151 */
3152 int (*set_param)(void *priv, const char *param);
3153
3154 /**
3155 * set_countermeasures - Enable/disable TKIP countermeasures
3156 * @priv: private driver interface data
3157 * @enabled: 1 = countermeasures enabled, 0 = disabled
3158 *
3159 * Returns: 0 on success, -1 on failure
3160 *
3161 * Configure TKIP countermeasures. When these are enabled, the driver
3162 * should drop all received and queued frames that are using TKIP.
3163 */
3164 int (*set_countermeasures)(void *priv, int enabled);
3165
3166 /**
3167 * deauthenticate - Request driver to deauthenticate
3168 * @priv: private driver interface data
3169 * @addr: peer address (BSSID of the AP)
3170 * @reason_code: 16-bit reason code to be sent in the deauthentication
3171 * frame
3172 *
3173 * Returns: 0 on success, -1 on failure
3174 */
Hai Shalom81f62d82019-07-22 12:10:00 -07003175 int (*deauthenticate)(void *priv, const u8 *addr, u16 reason_code);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003176
3177 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003178 * associate - Request driver to associate
3179 * @priv: private driver interface data
3180 * @params: association parameters
3181 *
3182 * Returns: 0 on success, -1 on failure
3183 */
3184 int (*associate)(void *priv,
3185 struct wpa_driver_associate_params *params);
3186
3187 /**
3188 * add_pmkid - Add PMKSA cache entry to the driver
3189 * @priv: private driver interface data
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003190 * @params: PMKSA parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003191 *
3192 * Returns: 0 on success, -1 on failure
3193 *
3194 * This function is called when a new PMK is received, as a result of
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003195 * either normal authentication or RSN pre-authentication. The PMKSA
3196 * parameters are either a set of bssid, pmkid, and pmk; or a set of
3197 * ssid, fils_cache_id, pmkid, and pmk.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003198 *
3199 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
3200 * associate(), add_pmkid() can be used to add new PMKSA cache entries
3201 * in the driver. If the driver uses wpa_ie from wpa_supplicant, this
3202 * driver_ops function does not need to be implemented. Likewise, if
3203 * the driver does not support WPA, this function is not needed.
3204 */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003205 int (*add_pmkid)(void *priv, struct wpa_pmkid_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003206
3207 /**
3208 * remove_pmkid - Remove PMKSA cache entry to the driver
3209 * @priv: private driver interface data
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003210 * @params: PMKSA parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003211 *
3212 * Returns: 0 on success, -1 on failure
3213 *
3214 * This function is called when the supplicant drops a PMKSA cache
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003215 * entry for any reason. The PMKSA parameters are either a set of
3216 * bssid and pmkid; or a set of ssid, fils_cache_id, and pmkid.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003217 *
3218 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
3219 * associate(), remove_pmkid() can be used to synchronize PMKSA caches
3220 * between the driver and wpa_supplicant. If the driver uses wpa_ie
3221 * from wpa_supplicant, this driver_ops function does not need to be
3222 * implemented. Likewise, if the driver does not support WPA, this
3223 * function is not needed.
3224 */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003225 int (*remove_pmkid)(void *priv, struct wpa_pmkid_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003226
3227 /**
3228 * flush_pmkid - Flush PMKSA cache
3229 * @priv: private driver interface data
3230 *
3231 * Returns: 0 on success, -1 on failure
3232 *
3233 * This function is called when the supplicant drops all PMKSA cache
3234 * entries for any reason.
3235 *
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 */
3243 int (*flush_pmkid)(void *priv);
3244
3245 /**
3246 * get_capa - Get driver capabilities
3247 * @priv: private driver interface data
3248 *
3249 * Returns: 0 on success, -1 on failure
3250 *
3251 * Get driver/firmware/hardware capabilities.
3252 */
3253 int (*get_capa)(void *priv, struct wpa_driver_capa *capa);
3254
3255 /**
3256 * poll - Poll driver for association information
3257 * @priv: private driver interface data
3258 *
Sunil Ravi77d572f2023-01-17 23:58:31 +00003259 * This is an optional callback that can be used when the driver does
3260 * not provide event mechanism for association events. This is called
3261 * when receiving WPA/RSN EAPOL-Key messages that require association
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003262 * information. The driver interface is supposed to generate associnfo
3263 * event before returning from this callback function. In addition, the
3264 * driver interface should generate an association event after having
3265 * sent out associnfo.
3266 */
3267 void (*poll)(void *priv);
3268
3269 /**
Dmitry Shmidte4663042016-04-04 10:07:49 -07003270 * get_ifindex - Get interface index
3271 * @priv: private driver interface data
3272 *
3273 * Returns: Interface index
3274 */
3275 unsigned int (*get_ifindex)(void *priv);
3276
3277 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003278 * get_ifname - Get interface name
3279 * @priv: private driver interface data
3280 *
3281 * Returns: Pointer to the interface name. This can differ from the
3282 * interface name used in init() call. Init() is called first.
3283 *
3284 * This optional function can be used to allow the driver interface to
3285 * replace the interface name with something else, e.g., based on an
3286 * interface mapping from a more descriptive name.
3287 */
3288 const char * (*get_ifname)(void *priv);
3289
3290 /**
3291 * get_mac_addr - Get own MAC address
3292 * @priv: private driver interface data
3293 *
3294 * Returns: Pointer to own MAC address or %NULL on failure
3295 *
3296 * This optional function can be used to get the own MAC address of the
3297 * device from the driver interface code. This is only needed if the
3298 * l2_packet implementation for the OS does not provide easy access to
3299 * a MAC address. */
3300 const u8 * (*get_mac_addr)(void *priv);
3301
3302 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003303 * set_operstate - Sets device operating state to DORMANT or UP
3304 * @priv: private driver interface data
3305 * @state: 0 = dormant, 1 = up
3306 * Returns: 0 on success, -1 on failure
3307 *
3308 * This is an optional function that can be used on operating systems
3309 * that support a concept of controlling network device state from user
3310 * space applications. This function, if set, gets called with
3311 * state = 1 when authentication has been completed and with state = 0
3312 * when connection is lost.
3313 */
3314 int (*set_operstate)(void *priv, int state);
3315
3316 /**
3317 * mlme_setprotection - MLME-SETPROTECTION.request primitive
3318 * @priv: Private driver interface data
3319 * @addr: Address of the station for which to set protection (may be
3320 * %NULL for group keys)
3321 * @protect_type: MLME_SETPROTECTION_PROTECT_TYPE_*
3322 * @key_type: MLME_SETPROTECTION_KEY_TYPE_*
3323 * Returns: 0 on success, -1 on failure
3324 *
3325 * This is an optional function that can be used to set the driver to
3326 * require protection for Tx and/or Rx frames. This uses the layer
3327 * interface defined in IEEE 802.11i-2004 clause 10.3.22.1
3328 * (MLME-SETPROTECTION.request). Many drivers do not use explicit
3329 * set protection operation; instead, they set protection implicitly
3330 * based on configured keys.
3331 */
3332 int (*mlme_setprotection)(void *priv, const u8 *addr, int protect_type,
3333 int key_type);
3334
3335 /**
3336 * get_hw_feature_data - Get hardware support data (channels and rates)
3337 * @priv: Private driver interface data
3338 * @num_modes: Variable for returning the number of returned modes
3339 * flags: Variable for returning hardware feature flags
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003340 * @dfs: Variable for returning DFS region (HOSTAPD_DFS_REGION_*)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003341 * Returns: Pointer to allocated hardware data on success or %NULL on
3342 * failure. Caller is responsible for freeing this.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003343 */
3344 struct hostapd_hw_modes * (*get_hw_feature_data)(void *priv,
3345 u16 *num_modes,
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003346 u16 *flags, u8 *dfs);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003347
3348 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003349 * send_mlme - Send management frame from MLME
3350 * @priv: Private driver interface data
3351 * @data: IEEE 802.11 management frame with IEEE 802.11 header
3352 * @data_len: Size of the management frame
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003353 * @noack: Do not wait for this frame to be acked (disable retries)
Dmitry Shmidta3dc3092015-06-23 11:21:28 -07003354 * @freq: Frequency (in MHz) to send the frame on, or 0 to let the
3355 * driver decide
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08003356 * @csa_offs: Array of CSA offsets or %NULL
3357 * @csa_offs_len: Number of elements in csa_offs
Hai Shalomfdcde762020-04-02 11:19:20 -07003358 * @no_encrypt: Do not encrypt frame even if appropriate key exists
3359 * (used only for testing purposes)
3360 * @wait: Time to wait off-channel for a response (in ms), or zero
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003361 * @link_id: Link ID to use for TX, or -1 if not set
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003362 * Returns: 0 on success, -1 on failure
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003363 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003364 int (*send_mlme)(void *priv, const u8 *data, size_t data_len,
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08003365 int noack, unsigned int freq, const u16 *csa_offs,
Hai Shalomfdcde762020-04-02 11:19:20 -07003366 size_t csa_offs_len, int no_encrypt,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003367 unsigned int wait, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003368
3369 /**
3370 * update_ft_ies - Update FT (IEEE 802.11r) IEs
3371 * @priv: Private driver interface data
3372 * @md: Mobility domain (2 octets) (also included inside ies)
3373 * @ies: FT IEs (MDIE, FTIE, ...) or %NULL to remove IEs
3374 * @ies_len: Length of FT IEs in bytes
3375 * Returns: 0 on success, -1 on failure
3376 *
3377 * The supplicant uses this callback to let the driver know that keying
3378 * material for FT is available and that the driver can use the
3379 * provided IEs in the next message in FT authentication sequence.
3380 *
3381 * This function is only needed for driver that support IEEE 802.11r
3382 * (Fast BSS Transition).
3383 */
3384 int (*update_ft_ies)(void *priv, const u8 *md, const u8 *ies,
3385 size_t ies_len);
3386
3387 /**
Sunil Ravi99c035e2024-07-12 01:42:03 +00003388 * get_scan_results - Fetch the latest scan results
3389 * @priv: Private driver interface data
3390 * @bssid: Return results only for the specified BSSID, %NULL for all
3391 *
3392 * Returns: Allocated buffer of scan results (caller is responsible for
3393 * freeing the data structure) on success, NULL on failure
3394 */
3395 struct wpa_scan_results * (*get_scan_results)(void *priv,
3396 const u8 *bssid);
3397
3398 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003399 * get_scan_results2 - Fetch the latest scan results
3400 * @priv: private driver interface data
3401 *
3402 * Returns: Allocated buffer of scan results (caller is responsible for
3403 * freeing the data structure) on success, NULL on failure
3404 */
3405 struct wpa_scan_results * (*get_scan_results2)(void *priv);
3406
3407 /**
3408 * set_country - Set country
3409 * @priv: Private driver interface data
3410 * @alpha2: country to which to switch to
3411 * Returns: 0 on success, -1 on failure
3412 *
3413 * This function is for drivers which support some form
3414 * of setting a regulatory domain.
3415 */
3416 int (*set_country)(void *priv, const char *alpha2);
3417
3418 /**
Dmitry Shmidtcce06662013-11-04 18:44:24 -08003419 * get_country - Get country
3420 * @priv: Private driver interface data
3421 * @alpha2: Buffer for returning country code (at least 3 octets)
3422 * Returns: 0 on success, -1 on failure
3423 */
3424 int (*get_country)(void *priv, char *alpha2);
3425
3426 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003427 * global_init - Global driver initialization
Dmitry Shmidte4663042016-04-04 10:07:49 -07003428 * @ctx: wpa_global pointer
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003429 * Returns: Pointer to private data (global), %NULL on failure
3430 *
3431 * This optional function is called to initialize the driver wrapper
3432 * for global data, i.e., data that applies to all interfaces. If this
3433 * function is implemented, global_deinit() will also need to be
3434 * implemented to free the private data. The driver will also likely
3435 * use init2() function instead of init() to get the pointer to global
3436 * data available to per-interface initializer.
3437 */
Dmitry Shmidte4663042016-04-04 10:07:49 -07003438 void * (*global_init)(void *ctx);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003439
3440 /**
3441 * global_deinit - Global driver deinitialization
3442 * @priv: private driver global data from global_init()
3443 *
3444 * Terminate any global driver related functionality and free the
3445 * global data structure.
3446 */
3447 void (*global_deinit)(void *priv);
3448
3449 /**
3450 * init2 - Initialize driver interface (with global data)
3451 * @ctx: context to be used when calling wpa_supplicant functions,
3452 * e.g., wpa_supplicant_event()
3453 * @ifname: interface name, e.g., wlan0
3454 * @global_priv: private driver global data from global_init()
3455 * Returns: Pointer to private data, %NULL on failure
3456 *
3457 * This function can be used instead of init() if the driver wrapper
3458 * uses global data.
3459 */
3460 void * (*init2)(void *ctx, const char *ifname, void *global_priv);
3461
3462 /**
3463 * get_interfaces - Get information about available interfaces
3464 * @global_priv: private driver global data from global_init()
3465 * Returns: Allocated buffer of interface information (caller is
3466 * responsible for freeing the data structure) on success, NULL on
3467 * failure
3468 */
3469 struct wpa_interface_info * (*get_interfaces)(void *global_priv);
3470
3471 /**
3472 * scan2 - Request the driver to initiate scan
3473 * @priv: private driver interface data
3474 * @params: Scan parameters
3475 *
3476 * Returns: 0 on success, -1 on failure
3477 *
3478 * Once the scan results are ready, the driver should report scan
3479 * results event for wpa_supplicant which will eventually request the
3480 * results with wpa_driver_get_scan_results2().
3481 */
3482 int (*scan2)(void *priv, struct wpa_driver_scan_params *params);
3483
3484 /**
3485 * authenticate - Request driver to authenticate
3486 * @priv: private driver interface data
3487 * @params: authentication parameters
3488 * Returns: 0 on success, -1 on failure
3489 *
3490 * This is an optional function that can be used with drivers that
3491 * support separate authentication and association steps, i.e., when
3492 * wpa_supplicant can act as the SME. If not implemented, associate()
3493 * function is expected to take care of IEEE 802.11 authentication,
3494 * too.
3495 */
3496 int (*authenticate)(void *priv,
3497 struct wpa_driver_auth_params *params);
3498
3499 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003500 * set_ap - Set Beacon and Probe Response information for AP mode
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003501 * @priv: Private driver interface data
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003502 * @params: Parameters to use in AP mode
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003503 *
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003504 * This function is used to configure Beacon template and/or extra IEs
3505 * to add for Beacon and Probe Response frames for the driver in
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003506 * AP mode. The driver is responsible for building the full Beacon
3507 * frame by concatenating the head part with TIM IE generated by the
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003508 * driver/firmware and finishing with the tail part. Depending on the
3509 * driver architectue, this can be done either by using the full
3510 * template or the set of additional IEs (e.g., WPS and P2P IE).
3511 * Similarly, Probe Response processing depends on the driver design.
3512 * If the driver (or firmware) takes care of replying to Probe Request
3513 * frames, the extra IEs provided here needs to be added to the Probe
3514 * Response frames.
3515 *
3516 * Returns: 0 on success, -1 on failure
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003517 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003518 int (*set_ap)(void *priv, struct wpa_driver_ap_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003519
3520 /**
Dmitry Shmidt8bae4132013-06-06 11:25:10 -07003521 * set_acl - Set ACL in AP mode
3522 * @priv: Private driver interface data
3523 * @params: Parameters to configure ACL
3524 * Returns: 0 on success, -1 on failure
3525 *
3526 * This is used only for the drivers which support MAC address ACL.
3527 */
3528 int (*set_acl)(void *priv, struct hostapd_acl_params *params);
3529
3530 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003531 * hapd_init - Initialize driver interface (hostapd only)
3532 * @hapd: Pointer to hostapd context
3533 * @params: Configuration for the driver wrapper
3534 * Returns: Pointer to private data, %NULL on failure
3535 *
3536 * This function is used instead of init() or init2() when the driver
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003537 * wrapper is used with hostapd.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003538 */
3539 void * (*hapd_init)(struct hostapd_data *hapd,
3540 struct wpa_init_params *params);
3541
3542 /**
3543 * hapd_deinit - Deinitialize driver interface (hostapd only)
3544 * @priv: Private driver interface data from hapd_init()
3545 */
3546 void (*hapd_deinit)(void *priv);
3547
3548 /**
3549 * set_ieee8021x - Enable/disable IEEE 802.1X support (AP only)
3550 * @priv: Private driver interface data
3551 * @params: BSS parameters
3552 * Returns: 0 on success, -1 on failure
3553 *
3554 * This is an optional function to configure the kernel driver to
3555 * enable/disable IEEE 802.1X support and set WPA/WPA2 parameters. This
3556 * can be left undefined (set to %NULL) if IEEE 802.1X support is
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003557 * always enabled and the driver uses set_ap() to set WPA/RSN IE
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003558 * for Beacon frames.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003559 *
3560 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003561 */
3562 int (*set_ieee8021x)(void *priv, struct wpa_bss_params *params);
3563
3564 /**
3565 * set_privacy - Enable/disable privacy (AP only)
3566 * @priv: Private driver interface data
3567 * @enabled: 1 = privacy enabled, 0 = disabled
3568 * Returns: 0 on success, -1 on failure
3569 *
3570 * This is an optional function to configure privacy field in the
3571 * kernel driver for Beacon frames. This can be left undefined (set to
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003572 * %NULL) if the driver uses the Beacon template from set_ap().
3573 *
3574 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003575 */
3576 int (*set_privacy)(void *priv, int enabled);
3577
3578 /**
3579 * get_seqnum - Fetch the current TSC/packet number (AP only)
3580 * @ifname: The interface name (main or virtual)
3581 * @priv: Private driver interface data
3582 * @addr: MAC address of the station or %NULL for group keys
3583 * @idx: Key index
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003584 * @link_id: Link ID for a group key, or -1 if not set
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003585 * @seq: Buffer for returning the latest used TSC/packet number
3586 * Returns: 0 on success, -1 on failure
3587 *
3588 * This function is used to fetch the last used TSC/packet number for
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07003589 * a TKIP, CCMP, GCMP, or BIP/IGTK key. It is mainly used with group
3590 * keys, so there is no strict requirement on implementing support for
3591 * unicast keys (i.e., addr != %NULL).
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003592 */
3593 int (*get_seqnum)(const char *ifname, void *priv, const u8 *addr,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003594 int idx, int link_id, u8 *seq);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003595
3596 /**
3597 * flush - Flush all association stations (AP only)
3598 * @priv: Private driver interface data
3599 * Returns: 0 on success, -1 on failure
3600 *
3601 * This function requests the driver to disassociate all associated
3602 * stations. This function does not need to be implemented if the
3603 * driver does not process association frames internally.
3604 */
3605 int (*flush)(void *priv);
3606
3607 /**
3608 * set_generic_elem - Add IEs into Beacon/Probe Response frames (AP)
3609 * @priv: Private driver interface data
3610 * @elem: Information elements
3611 * @elem_len: Length of the elem buffer in octets
3612 * Returns: 0 on success, -1 on failure
3613 *
3614 * This is an optional function to add information elements in the
3615 * kernel driver for Beacon and Probe Response frames. This can be left
3616 * undefined (set to %NULL) if the driver uses the Beacon template from
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003617 * set_ap().
3618 *
3619 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003620 */
3621 int (*set_generic_elem)(void *priv, const u8 *elem, size_t elem_len);
3622
3623 /**
Jouni Malinen1e6c57f2012-09-05 17:07:03 +03003624 * read_sta_data - Fetch station data
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003625 * @priv: Private driver interface data
3626 * @data: Buffer for returning station information
3627 * @addr: MAC address of the station
3628 * Returns: 0 on success, -1 on failure
3629 */
3630 int (*read_sta_data)(void *priv, struct hostap_sta_driver_data *data,
3631 const u8 *addr);
3632
3633 /**
Hai Shalomfdcde762020-04-02 11:19:20 -07003634 * tx_control_port - Send a frame over the 802.1X controlled port
3635 * @priv: Private driver interface data
3636 * @dest: Destination MAC address
3637 * @proto: Ethertype in host byte order
3638 * @buf: Frame payload starting from IEEE 802.1X header
3639 * @len: Frame payload length
3640 * @no_encrypt: Do not encrypt frame
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003641 * @link_id: Link ID to use for TX, or -1 if not set
Hai Shalomfdcde762020-04-02 11:19:20 -07003642 *
3643 * Returns 0 on success, else an error
3644 *
3645 * This is like a normal Ethernet send except that the driver is aware
3646 * (by other means than the Ethertype) that this frame is special,
3647 * and more importantly it gains an ordering between the transmission of
3648 * the frame and other driver management operations such as key
3649 * installations. This can be used to work around known limitations in
3650 * IEEE 802.11 protocols such as race conditions between rekeying 4-way
3651 * handshake message 4/4 and a PTK being overwritten.
3652 *
3653 * This function is only used for a given interface if the driver
3654 * instance reports WPA_DRIVER_FLAGS_CONTROL_PORT capability. Otherwise,
3655 * API users will fall back to sending the frame via a normal socket.
3656 */
3657 int (*tx_control_port)(void *priv, const u8 *dest,
3658 u16 proto, const u8 *buf, size_t len,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003659 int no_encrypt, int link_id);
Hai Shalomfdcde762020-04-02 11:19:20 -07003660
3661 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003662 * hapd_send_eapol - Send an EAPOL packet (AP only)
3663 * @priv: private driver interface data
3664 * @addr: Destination MAC address
3665 * @data: EAPOL packet starting with IEEE 802.1X header
3666 * @data_len: Length of the EAPOL packet in octets
3667 * @encrypt: Whether the frame should be encrypted
3668 * @own_addr: Source MAC address
3669 * @flags: WPA_STA_* flags for the destination station
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003670 * @link_id: Link ID to use for TX, or -1 if not set
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003671 *
3672 * Returns: 0 on success, -1 on failure
3673 */
3674 int (*hapd_send_eapol)(void *priv, const u8 *addr, const u8 *data,
3675 size_t data_len, int encrypt,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003676 const u8 *own_addr, u32 flags, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003677
3678 /**
3679 * sta_deauth - Deauthenticate a station (AP only)
3680 * @priv: Private driver interface data
3681 * @own_addr: Source address and BSSID for the Deauthentication frame
3682 * @addr: MAC address of the station to deauthenticate
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003683 * @reason: Reason code for the Deauthentication frame
3684 * @link_id: Link ID to use for Deauthentication frame, or -1 if not set
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003685 * Returns: 0 on success, -1 on failure
3686 *
3687 * This function requests a specific station to be deauthenticated and
3688 * a Deauthentication frame to be sent to it.
3689 */
3690 int (*sta_deauth)(void *priv, const u8 *own_addr, const u8 *addr,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003691 u16 reason, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003692
3693 /**
3694 * sta_disassoc - Disassociate a station (AP only)
3695 * @priv: Private driver interface data
3696 * @own_addr: Source address and BSSID for the Disassociation frame
3697 * @addr: MAC address of the station to disassociate
3698 * @reason: Reason code for the Disassociation frame
3699 * Returns: 0 on success, -1 on failure
3700 *
3701 * This function requests a specific station to be disassociated and
3702 * a Disassociation frame to be sent to it.
3703 */
3704 int (*sta_disassoc)(void *priv, const u8 *own_addr, const u8 *addr,
Hai Shalom81f62d82019-07-22 12:10:00 -07003705 u16 reason);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003706
3707 /**
3708 * sta_remove - Remove a station entry (AP only)
3709 * @priv: Private driver interface data
3710 * @addr: MAC address of the station to be removed
3711 * Returns: 0 on success, -1 on failure
3712 */
3713 int (*sta_remove)(void *priv, const u8 *addr);
3714
3715 /**
3716 * hapd_get_ssid - Get the current SSID (AP only)
3717 * @priv: Private driver interface data
3718 * @buf: Buffer for returning the SSID
3719 * @len: Maximum length of the buffer
3720 * Returns: Length of the SSID on success, -1 on failure
3721 *
3722 * This function need not be implemented if the driver uses Beacon
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003723 * template from set_ap() and does not reply to Probe Request frames.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003724 */
3725 int (*hapd_get_ssid)(void *priv, u8 *buf, int len);
3726
3727 /**
3728 * hapd_set_ssid - Set SSID (AP only)
3729 * @priv: Private driver interface data
3730 * @buf: SSID
3731 * @len: Length of the SSID in octets
3732 * Returns: 0 on success, -1 on failure
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003733 *
3734 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003735 */
3736 int (*hapd_set_ssid)(void *priv, const u8 *buf, int len);
3737
3738 /**
3739 * hapd_set_countermeasures - Enable/disable TKIP countermeasures (AP)
3740 * @priv: Private driver interface data
3741 * @enabled: 1 = countermeasures enabled, 0 = disabled
3742 * Returns: 0 on success, -1 on failure
3743 *
3744 * This need not be implemented if the driver does not take care of
3745 * association processing.
3746 */
3747 int (*hapd_set_countermeasures)(void *priv, int enabled);
3748
3749 /**
3750 * sta_add - Add a station entry
3751 * @priv: Private driver interface data
3752 * @params: Station parameters
3753 * Returns: 0 on success, -1 on failure
3754 *
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08003755 * This function is used to add or set (params->set 1) a station
3756 * entry in the driver. Adding STA entries is used only if the driver
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003757 * does not take care of association processing.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003758 *
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08003759 * With drivers that don't support full AP client state, this function
3760 * is used to add a station entry to the driver once the station has
3761 * completed association.
3762 *
3763 * With TDLS, this function is used to add or set (params->set 1)
3764 * TDLS peer entries (even with drivers that do not support full AP
3765 * client state).
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003766 */
3767 int (*sta_add)(void *priv, struct hostapd_sta_add_params *params);
3768
3769 /**
3770 * get_inact_sec - Get station inactivity duration (AP only)
3771 * @priv: Private driver interface data
3772 * @addr: Station address
3773 * Returns: Number of seconds station has been inactive, -1 on failure
3774 */
3775 int (*get_inact_sec)(void *priv, const u8 *addr);
3776
3777 /**
3778 * sta_clear_stats - Clear station statistics (AP only)
3779 * @priv: Private driver interface data
3780 * @addr: Station address
3781 * Returns: 0 on success, -1 on failure
3782 */
3783 int (*sta_clear_stats)(void *priv, const u8 *addr);
3784
3785 /**
3786 * set_freq - Set channel/frequency (AP only)
3787 * @priv: Private driver interface data
3788 * @freq: Channel parameters
3789 * Returns: 0 on success, -1 on failure
3790 */
3791 int (*set_freq)(void *priv, struct hostapd_freq_params *freq);
3792
3793 /**
3794 * set_rts - Set RTS threshold
3795 * @priv: Private driver interface data
3796 * @rts: RTS threshold in octets
3797 * Returns: 0 on success, -1 on failure
3798 */
3799 int (*set_rts)(void *priv, int rts);
3800
3801 /**
3802 * set_frag - Set fragmentation threshold
3803 * @priv: Private driver interface data
3804 * @frag: Fragmentation threshold in octets
3805 * Returns: 0 on success, -1 on failure
3806 */
3807 int (*set_frag)(void *priv, int frag);
3808
3809 /**
3810 * sta_set_flags - Set station flags (AP only)
3811 * @priv: Private driver interface data
3812 * @addr: Station address
3813 * @total_flags: Bitmap of all WPA_STA_* flags currently set
3814 * @flags_or: Bitmap of WPA_STA_* flags to add
3815 * @flags_and: Bitmap of WPA_STA_* flags to us as a mask
3816 * Returns: 0 on success, -1 on failure
3817 */
3818 int (*sta_set_flags)(void *priv, const u8 *addr,
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08003819 unsigned int total_flags, unsigned int flags_or,
3820 unsigned int flags_and);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003821
3822 /**
Hai Shalom81f62d82019-07-22 12:10:00 -07003823 * sta_set_airtime_weight - Set station airtime weight (AP only)
3824 * @priv: Private driver interface data
3825 * @addr: Station address
3826 * @weight: New weight for station airtime assignment
3827 * Returns: 0 on success, -1 on failure
3828 */
3829 int (*sta_set_airtime_weight)(void *priv, const u8 *addr,
3830 unsigned int weight);
3831
3832 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003833 * set_tx_queue_params - Set TX queue parameters
3834 * @priv: Private driver interface data
3835 * @queue: Queue number (0 = VO, 1 = VI, 2 = BE, 3 = BK)
3836 * @aifs: AIFS
3837 * @cw_min: cwMin
3838 * @cw_max: cwMax
3839 * @burst_time: Maximum length for bursting in 0.1 msec units
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003840 * @link_id: Link ID to use, or -1 for non MLD.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003841 */
3842 int (*set_tx_queue_params)(void *priv, int queue, int aifs, int cw_min,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003843 int cw_max, int burst_time, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003844
3845 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003846 * if_add - Add a virtual interface
3847 * @priv: Private driver interface data
3848 * @type: Interface type
3849 * @ifname: Interface name for the new virtual interface
3850 * @addr: Local address to use for the interface or %NULL to use the
3851 * parent interface address
3852 * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces
3853 * @drv_priv: Pointer for overwriting the driver context or %NULL if
3854 * not allowed (applies only to %WPA_IF_AP_BSS type)
3855 * @force_ifname: Buffer for returning an interface name that the
3856 * driver ended up using if it differs from the requested ifname
3857 * @if_addr: Buffer for returning the allocated interface address
3858 * (this may differ from the requested addr if the driver cannot
3859 * change interface address)
3860 * @bridge: Bridge interface to use or %NULL if no bridge configured
Dmitry Shmidtcce06662013-11-04 18:44:24 -08003861 * @use_existing: Whether to allow existing interface to be used
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08003862 * @setup_ap: Whether to setup AP for %WPA_IF_AP_BSS interfaces
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003863 * Returns: 0 on success, -1 on failure
3864 */
3865 int (*if_add)(void *priv, enum wpa_driver_if_type type,
3866 const char *ifname, const u8 *addr, void *bss_ctx,
3867 void **drv_priv, char *force_ifname, u8 *if_addr,
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08003868 const char *bridge, int use_existing, int setup_ap);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003869
3870 /**
3871 * if_remove - Remove a virtual interface
3872 * @priv: Private driver interface data
3873 * @type: Interface type
3874 * @ifname: Interface name of the virtual interface to be removed
3875 * Returns: 0 on success, -1 on failure
3876 */
3877 int (*if_remove)(void *priv, enum wpa_driver_if_type type,
3878 const char *ifname);
3879
3880 /**
3881 * set_sta_vlan - Bind a station into a specific interface (AP only)
3882 * @priv: Private driver interface data
3883 * @ifname: Interface (main or virtual BSS or VLAN)
3884 * @addr: MAC address of the associated station
3885 * @vlan_id: VLAN ID
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003886 * @link_id: The link ID or -1 for non-MLO
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003887 * Returns: 0 on success, -1 on failure
3888 *
3889 * This function is used to bind a station to a specific virtual
3890 * interface. It is only used if when virtual interfaces are supported,
3891 * e.g., to assign stations to different VLAN interfaces based on
3892 * information from a RADIUS server. This allows separate broadcast
3893 * domains to be used with a single BSS.
3894 */
3895 int (*set_sta_vlan)(void *priv, const u8 *addr, const char *ifname,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003896 int vlan_id, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003897
3898 /**
3899 * commit - Optional commit changes handler (AP only)
3900 * @priv: driver private data
3901 * Returns: 0 on success, -1 on failure
3902 *
3903 * This optional handler function can be registered if the driver
3904 * interface implementation needs to commit changes (e.g., by setting
3905 * network interface up) at the end of initial configuration. If set,
3906 * this handler will be called after initial setup has been completed.
3907 */
3908 int (*commit)(void *priv);
3909
3910 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003911 * set_radius_acl_auth - Notification of RADIUS ACL change
3912 * @priv: Private driver interface data
3913 * @mac: MAC address of the station
3914 * @accepted: Whether the station was accepted
3915 * @session_timeout: Session timeout for the station
3916 * Returns: 0 on success, -1 on failure
3917 */
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07003918 int (*set_radius_acl_auth)(void *priv, const u8 *mac, int accepted,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003919 u32 session_timeout);
3920
3921 /**
3922 * set_radius_acl_expire - Notification of RADIUS ACL expiration
3923 * @priv: Private driver interface data
3924 * @mac: MAC address of the station
3925 * Returns: 0 on success, -1 on failure
3926 */
3927 int (*set_radius_acl_expire)(void *priv, const u8 *mac);
3928
3929 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003930 * set_ap_wps_ie - Add WPS IE(s) into Beacon/Probe Response frames (AP)
3931 * @priv: Private driver interface data
3932 * @beacon: WPS IE(s) for Beacon frames or %NULL to remove extra IE(s)
3933 * @proberesp: WPS IE(s) for Probe Response frames or %NULL to remove
3934 * extra IE(s)
3935 * @assocresp: WPS IE(s) for (Re)Association Response frames or %NULL
3936 * to remove extra IE(s)
3937 * Returns: 0 on success, -1 on failure
3938 *
3939 * This is an optional function to add WPS IE in the kernel driver for
3940 * Beacon and Probe Response frames. This can be left undefined (set
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003941 * to %NULL) if the driver uses the Beacon template from set_ap()
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003942 * and does not process Probe Request frames. If the driver takes care
3943 * of (Re)Association frame processing, the assocresp buffer includes
3944 * WPS IE(s) that need to be added to (Re)Association Response frames
3945 * whenever a (Re)Association Request frame indicated use of WPS.
3946 *
3947 * This will also be used to add P2P IE(s) into Beacon/Probe Response
3948 * frames when operating as a GO. The driver is responsible for adding
3949 * timing related attributes (e.g., NoA) in addition to the IEs
3950 * included here by appending them after these buffers. This call is
3951 * also used to provide Probe Response IEs for P2P Listen state
3952 * operations for drivers that generate the Probe Response frames
3953 * internally.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003954 *
3955 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003956 */
3957 int (*set_ap_wps_ie)(void *priv, const struct wpabuf *beacon,
3958 const struct wpabuf *proberesp,
3959 const struct wpabuf *assocresp);
3960
3961 /**
3962 * set_supp_port - Set IEEE 802.1X Supplicant Port status
3963 * @priv: Private driver interface data
3964 * @authorized: Whether the port is authorized
3965 * Returns: 0 on success, -1 on failure
3966 */
3967 int (*set_supp_port)(void *priv, int authorized);
3968
3969 /**
3970 * set_wds_sta - Bind a station into a 4-address WDS (AP only)
3971 * @priv: Private driver interface data
3972 * @addr: MAC address of the associated station
3973 * @aid: Association ID
3974 * @val: 1 = bind to 4-address WDS; 0 = unbind
3975 * @bridge_ifname: Bridge interface to use for the WDS station or %NULL
3976 * to indicate that bridge is not to be used
Dmitry Shmidtc2ebb4b2013-07-24 12:57:51 -07003977 * @ifname_wds: Buffer to return the interface name for the new WDS
3978 * station or %NULL to indicate name is not returned.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003979 * Returns: 0 on success, -1 on failure
3980 */
3981 int (*set_wds_sta)(void *priv, const u8 *addr, int aid, int val,
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07003982 const char *bridge_ifname, char *ifname_wds);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003983
3984 /**
3985 * send_action - Transmit an Action frame
3986 * @priv: Private driver interface data
3987 * @freq: Frequency (in MHz) of the channel
3988 * @wait: Time to wait off-channel for a response (in ms), or zero
3989 * @dst: Destination MAC address (Address 1)
3990 * @src: Source MAC address (Address 2)
3991 * @bssid: BSSID (Address 3)
3992 * @data: Frame body
3993 * @data_len: data length in octets
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003994 @ @no_cck: Whether CCK rates must not be used to transmit this frame
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003995 * Returns: 0 on success, -1 on failure
3996 *
3997 * This command can be used to request the driver to transmit an action
3998 * frame to the specified destination.
3999 *
4000 * If the %WPA_DRIVER_FLAGS_OFFCHANNEL_TX flag is set, the frame will
4001 * be transmitted on the given channel and the device will wait for a
4002 * response on that channel for the given wait time.
4003 *
4004 * If the flag is not set, the wait time will be ignored. In this case,
4005 * if a remain-on-channel duration is in progress, the frame must be
4006 * transmitted on that channel; alternatively the frame may be sent on
4007 * the current operational channel (if in associated state in station
4008 * mode or while operating as an AP.)
Dmitry Shmidtebd93af2017-02-21 13:40:44 -08004009 *
4010 * If @src differs from the device MAC address, use of a random
4011 * transmitter address is requested for this message exchange.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004012 */
4013 int (*send_action)(void *priv, unsigned int freq, unsigned int wait,
4014 const u8 *dst, const u8 *src, const u8 *bssid,
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004015 const u8 *data, size_t data_len, int no_cck);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004016
4017 /**
4018 * send_action_cancel_wait - Cancel action frame TX wait
4019 * @priv: Private driver interface data
4020 *
4021 * This command cancels the wait time associated with sending an action
4022 * frame. It is only available when %WPA_DRIVER_FLAGS_OFFCHANNEL_TX is
4023 * set in the driver flags.
4024 */
4025 void (*send_action_cancel_wait)(void *priv);
4026
4027 /**
4028 * remain_on_channel - Remain awake on a channel
4029 * @priv: Private driver interface data
4030 * @freq: Frequency (in MHz) of the channel
4031 * @duration: Duration in milliseconds
4032 * Returns: 0 on success, -1 on failure
4033 *
4034 * This command is used to request the driver to remain awake on the
4035 * specified channel for the specified duration and report received
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08004036 * Action frames with EVENT_RX_MGMT events. Optionally, received
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004037 * Probe Request frames may also be requested to be reported by calling
4038 * probe_req_report(). These will be reported with EVENT_RX_PROBE_REQ.
4039 *
4040 * The driver may not be at the requested channel when this function
4041 * returns, i.e., the return code is only indicating whether the
4042 * request was accepted. The caller will need to wait until the
4043 * EVENT_REMAIN_ON_CHANNEL event indicates that the driver has
4044 * completed the channel change. This may take some time due to other
4045 * need for the radio and the caller should be prepared to timing out
4046 * its wait since there are no guarantees on when this request can be
4047 * executed.
4048 */
4049 int (*remain_on_channel)(void *priv, unsigned int freq,
4050 unsigned int duration);
4051
4052 /**
4053 * cancel_remain_on_channel - Cancel remain-on-channel operation
4054 * @priv: Private driver interface data
4055 *
4056 * This command can be used to cancel a remain-on-channel operation
4057 * before its originally requested duration has passed. This could be
4058 * used, e.g., when remain_on_channel() is used to request extra time
4059 * to receive a response to an Action frame and the response is
4060 * received when there is still unneeded time remaining on the
4061 * remain-on-channel operation.
4062 */
4063 int (*cancel_remain_on_channel)(void *priv);
4064
4065 /**
4066 * probe_req_report - Request Probe Request frames to be indicated
4067 * @priv: Private driver interface data
4068 * @report: Whether to report received Probe Request frames
4069 * Returns: 0 on success, -1 on failure (or if not supported)
4070 *
4071 * This command can be used to request the driver to indicate when
4072 * Probe Request frames are received with EVENT_RX_PROBE_REQ events.
4073 * Since this operation may require extra resources, e.g., due to less
4074 * optimal hardware/firmware RX filtering, many drivers may disable
4075 * Probe Request reporting at least in station mode. This command is
4076 * used to notify the driver when the Probe Request frames need to be
4077 * reported, e.g., during remain-on-channel operations.
4078 */
4079 int (*probe_req_report)(void *priv, int report);
4080
4081 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004082 * deinit_ap - Deinitialize AP mode
4083 * @priv: Private driver interface data
4084 * Returns: 0 on success, -1 on failure (or if not supported)
4085 *
4086 * This optional function can be used to disable AP mode related
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07004087 * configuration. If the interface was not dynamically added,
4088 * change the driver mode to station mode to allow normal station
4089 * operations like scanning to be completed.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004090 */
4091 int (*deinit_ap)(void *priv);
4092
4093 /**
Dmitry Shmidt04949592012-07-19 12:16:46 -07004094 * deinit_p2p_cli - Deinitialize P2P client mode
4095 * @priv: Private driver interface data
4096 * Returns: 0 on success, -1 on failure (or if not supported)
4097 *
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07004098 * This optional function can be used to disable P2P client mode. If the
4099 * interface was not dynamically added, change the interface type back
4100 * to station mode.
Dmitry Shmidt04949592012-07-19 12:16:46 -07004101 */
4102 int (*deinit_p2p_cli)(void *priv);
4103
4104 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004105 * suspend - Notification on system suspend/hibernate event
4106 * @priv: Private driver interface data
4107 */
4108 void (*suspend)(void *priv);
4109
4110 /**
4111 * resume - Notification on system resume/thaw event
4112 * @priv: Private driver interface data
4113 */
4114 void (*resume)(void *priv);
4115
4116 /**
4117 * signal_monitor - Set signal monitoring parameters
4118 * @priv: Private driver interface data
4119 * @threshold: Threshold value for signal change events; 0 = disabled
4120 * @hysteresis: Minimum change in signal strength before indicating a
4121 * new event
4122 * Returns: 0 on success, -1 on failure (or if not supported)
4123 *
4124 * This function can be used to configure monitoring of signal strength
4125 * with the current AP. Whenever signal strength drops below the
4126 * %threshold value or increases above it, EVENT_SIGNAL_CHANGE event
4127 * should be generated assuming the signal strength has changed at
4128 * least %hysteresis from the previously indicated signal change event.
4129 */
4130 int (*signal_monitor)(void *priv, int threshold, int hysteresis);
4131
4132 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004133 * get_noa - Get current Notice of Absence attribute payload
4134 * @priv: Private driver interface data
4135 * @buf: Buffer for returning NoA
4136 * @buf_len: Buffer length in octets
4137 * Returns: Number of octets used in buf, 0 to indicate no NoA is being
4138 * advertized, or -1 on failure
4139 *
4140 * This function is used to fetch the current Notice of Absence
4141 * attribute value from GO.
4142 */
4143 int (*get_noa)(void *priv, u8 *buf, size_t buf_len);
4144
4145 /**
4146 * set_noa - Set Notice of Absence parameters for GO (testing)
4147 * @priv: Private driver interface data
4148 * @count: Count
4149 * @start: Start time in ms from next TBTT
4150 * @duration: Duration in ms
4151 * Returns: 0 on success or -1 on failure
4152 *
4153 * This function is used to set Notice of Absence parameters for GO. It
4154 * is used only for testing. To disable NoA, all parameters are set to
4155 * 0.
4156 */
4157 int (*set_noa)(void *priv, u8 count, int start, int duration);
4158
4159 /**
4160 * set_p2p_powersave - Set P2P power save options
4161 * @priv: Private driver interface data
4162 * @legacy_ps: 0 = disable, 1 = enable, 2 = maximum PS, -1 = no change
4163 * @opp_ps: 0 = disable, 1 = enable, -1 = no change
4164 * @ctwindow: 0.. = change (msec), -1 = no change
4165 * Returns: 0 on success or -1 on failure
4166 */
4167 int (*set_p2p_powersave)(void *priv, int legacy_ps, int opp_ps,
4168 int ctwindow);
4169
4170 /**
4171 * ampdu - Enable/disable aggregation
4172 * @priv: Private driver interface data
4173 * @ampdu: 1/0 = enable/disable A-MPDU aggregation
4174 * Returns: 0 on success or -1 on failure
4175 */
4176 int (*ampdu)(void *priv, int ampdu);
4177
4178 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004179 * get_radio_name - Get physical radio name for the device
4180 * @priv: Private driver interface data
4181 * Returns: Radio name or %NULL if not known
4182 *
4183 * The returned data must not be modified by the caller. It is assumed
4184 * that any interface that has the same radio name as another is
4185 * sharing the same physical radio. This information can be used to
4186 * share scan results etc. information between the virtual interfaces
4187 * to speed up various operations.
4188 */
4189 const char * (*get_radio_name)(void *priv);
4190
4191 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004192 * send_tdls_mgmt - for sending TDLS management packets
4193 * @priv: private driver interface data
4194 * @dst: Destination (peer) MAC address
4195 * @action_code: TDLS action code for the mssage
4196 * @dialog_token: Dialog Token to use in the message (if needed)
4197 * @status_code: Status Code or Reason Code to use (if needed)
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07004198 * @peer_capab: TDLS peer capability (TDLS_PEER_* bitfield)
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -07004199 * @initiator: Is the current end the TDLS link initiator
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004200 * @buf: TDLS IEs to add to the message
4201 * @len: Length of buf in octets
Sunil Ravi2a14cf12023-11-21 00:54:38 +00004202 * @link_id: If >= 0 indicates the link of the AP MLD to specify the
4203 * operating channel on which to send a TDLS Discovery Response frame.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004204 * Returns: 0 on success, negative (<0) on failure
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004205 *
4206 * This optional function can be used to send packet to driver which is
4207 * responsible for receiving and sending all TDLS packets.
4208 */
4209 int (*send_tdls_mgmt)(void *priv, const u8 *dst, u8 action_code,
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07004210 u8 dialog_token, u16 status_code, u32 peer_capab,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00004211 int initiator, const u8 *buf, size_t len,
4212 int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004213
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004214 /**
4215 * tdls_oper - Ask the driver to perform high-level TDLS operations
4216 * @priv: Private driver interface data
4217 * @oper: TDLS high-level operation. See %enum tdls_oper
4218 * @peer: Destination (peer) MAC address
4219 * Returns: 0 on success, negative (<0) on failure
4220 *
4221 * This optional function can be used to send high-level TDLS commands
4222 * to the driver.
4223 */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004224 int (*tdls_oper)(void *priv, enum tdls_oper oper, const u8 *peer);
4225
4226 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07004227 * wnm_oper - Notify driver of the WNM frame reception
4228 * @priv: Private driver interface data
4229 * @oper: WNM operation. See %enum wnm_oper
4230 * @peer: Destination (peer) MAC address
4231 * @buf: Buffer for the driver to fill in (for getting IE)
4232 * @buf_len: Return the len of buf
4233 * Returns: 0 on success, negative (<0) on failure
4234 */
4235 int (*wnm_oper)(void *priv, enum wnm_oper oper, const u8 *peer,
4236 u8 *buf, u16 *buf_len);
4237
4238 /**
Dmitry Shmidt051af732013-10-22 13:52:46 -07004239 * set_qos_map - Set QoS Map
4240 * @priv: Private driver interface data
4241 * @qos_map_set: QoS Map
4242 * @qos_map_set_len: Length of QoS Map
4243 */
4244 int (*set_qos_map)(void *priv, const u8 *qos_map_set,
4245 u8 qos_map_set_len);
4246
4247 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004248 * br_add_ip_neigh - Add a neigh to the bridge ip neigh table
4249 * @priv: Private driver interface data
4250 * @version: IP version of the IP address, 4 or 6
4251 * @ipaddr: IP address for the neigh entry
4252 * @prefixlen: IP address prefix length
4253 * @addr: Corresponding MAC address
4254 * Returns: 0 on success, negative (<0) on failure
4255 */
4256 int (*br_add_ip_neigh)(void *priv, u8 version, const u8 *ipaddr,
4257 int prefixlen, const u8 *addr);
4258
4259 /**
4260 * br_delete_ip_neigh - Remove a neigh from the bridge ip neigh table
4261 * @priv: Private driver interface data
4262 * @version: IP version of the IP address, 4 or 6
4263 * @ipaddr: IP address for the neigh entry
4264 * Returns: 0 on success, negative (<0) on failure
4265 */
4266 int (*br_delete_ip_neigh)(void *priv, u8 version, const u8 *ipaddr);
4267
4268 /**
4269 * br_port_set_attr - Set a bridge port attribute
4270 * @attr: Bridge port attribute to set
4271 * @val: Value to be set
4272 * Returns: 0 on success, negative (<0) on failure
4273 */
4274 int (*br_port_set_attr)(void *priv, enum drv_br_port_attr attr,
4275 unsigned int val);
4276
4277 /**
4278 * br_port_set_attr - Set a bridge network parameter
4279 * @param: Bridge parameter to set
4280 * @val: Value to be set
4281 * Returns: 0 on success, negative (<0) on failure
4282 */
4283 int (*br_set_net_param)(void *priv, enum drv_br_net_param param,
4284 unsigned int val);
4285
4286 /**
Hai Shalomfdcde762020-04-02 11:19:20 -07004287 * get_wowlan - Get wake-on-wireless status
4288 * @priv: Private driver interface data
4289 */
4290 int (*get_wowlan)(void *priv);
4291
4292 /**
Dmitry Shmidtb58836e2014-04-29 14:35:56 -07004293 * set_wowlan - Set wake-on-wireless triggers
4294 * @priv: Private driver interface data
4295 * @triggers: wowlan triggers
4296 */
4297 int (*set_wowlan)(void *priv, const struct wowlan_triggers *triggers);
4298
4299 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004300 * signal_poll - Get current connection information
4301 * @priv: Private driver interface data
4302 * @signal_info: Connection info structure
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07004303 */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004304 int (*signal_poll)(void *priv, struct wpa_signal_info *signal_info);
Dmitry Shmidtbd567ad2011-05-09 14:17:09 -07004305
4306 /**
Sunil Ravi89eba102022-09-13 21:04:37 -07004307 * mlo_signal_poll - Get current MLO connection information
4308 * @priv: Private driver interface data
4309 * @mlo_signal_info: MLO connection info structure
4310 */
4311 int (*mlo_signal_poll)(void *priv,
4312 struct wpa_mlo_signal_info *mlo_signal_info);
4313
4314 /**
Hai Shalom74f70d42019-02-11 14:42:39 -08004315 * channel_info - Get parameters of the current operating channel
4316 * @priv: Private driver interface data
4317 * @channel_info: Channel info structure
4318 * Returns: 0 on success, negative (<0) on failure
4319 */
4320 int (*channel_info)(void *priv, struct wpa_channel_info *channel_info);
4321
4322 /**
Jouni Malinen75ecf522011-06-27 15:19:46 -07004323 * set_authmode - Set authentication algorithm(s) for static WEP
4324 * @priv: Private driver interface data
4325 * @authmode: 1=Open System, 2=Shared Key, 3=both
4326 * Returns: 0 on success, -1 on failure
4327 *
4328 * This function can be used to set authentication algorithms for AP
4329 * mode when static WEP is used. If the driver uses user space MLME/SME
4330 * implementation, there is no need to implement this function.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004331 *
4332 * DEPRECATED - use set_ap() instead
Jouni Malinen75ecf522011-06-27 15:19:46 -07004333 */
4334 int (*set_authmode)(void *priv, int authmode);
Dmitry Shmidt292b0c32013-11-22 12:54:42 -08004335
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004336#ifdef ANDROID
Jouni Malinen75ecf522011-06-27 15:19:46 -07004337 /**
Dmitry Shmidt292b0c32013-11-22 12:54:42 -08004338 * driver_cmd - Execute driver-specific command
4339 * @priv: Private driver interface data
4340 * @cmd: Command to execute
4341 * @buf: Return buffer
4342 * @buf_len: Buffer length
Dmitry Shmidtbd567ad2011-05-09 14:17:09 -07004343 * Returns: 0 on success, -1 on failure
4344 */
Dmitry Shmidt292b0c32013-11-22 12:54:42 -08004345 int (*driver_cmd)(void *priv, char *cmd, char *buf, size_t buf_len);
4346#endif /* ANDROID */
4347
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004348 /**
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004349 * vendor_cmd - Execute vendor specific command
4350 * @priv: Private driver interface data
4351 * @vendor_id: Vendor id
4352 * @subcmd: Vendor command id
Hai Shalom60840252021-02-19 19:02:11 -08004353 * @nested_attr_flag: Specifies if vendor subcommand uses nested
4354 * attributes or not
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004355 * @data: Vendor command parameters (%NULL if no parameters)
4356 * @data_len: Data length
4357 * @buf: Return buffer (%NULL to ignore reply)
4358 * Returns: 0 on success, negative (<0) on failure
4359 *
4360 * This function handles vendor specific commands that are passed to
4361 * the driver/device. The command is identified by vendor id and
Hai Shalom60840252021-02-19 19:02:11 -08004362 * command id. The nested_attr_flag specifies whether the subcommand
4363 * uses nested attributes or not. Parameters can be passed
4364 * as argument to the command in the data buffer. Reply (if any) will be
4365 * filled in the supplied return buffer.
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004366 *
4367 * The exact driver behavior is driver interface and vendor specific. As
4368 * an example, this will be converted to a vendor specific cfg80211
4369 * command in case of the nl80211 driver interface.
4370 */
4371 int (*vendor_cmd)(void *priv, unsigned int vendor_id,
4372 unsigned int subcmd, const u8 *data, size_t data_len,
Hai Shalom60840252021-02-19 19:02:11 -08004373 enum nested_attr nested_attr_flag,
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004374 struct wpabuf *buf);
4375
4376 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004377 * set_rekey_info - Set rekey information
4378 * @priv: Private driver interface data
4379 * @kek: Current KEK
Dmitry Shmidt807291d2015-01-27 13:40:23 -08004380 * @kek_len: KEK length in octets
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004381 * @kck: Current KCK
Dmitry Shmidt807291d2015-01-27 13:40:23 -08004382 * @kck_len: KCK length in octets
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004383 * @replay_ctr: Current EAPOL-Key Replay Counter
4384 *
4385 * This optional function can be used to provide information for the
4386 * driver/firmware to process EAPOL-Key frames in Group Key Handshake
4387 * while the host (including wpa_supplicant) is sleeping.
4388 */
Dmitry Shmidt807291d2015-01-27 13:40:23 -08004389 void (*set_rekey_info)(void *priv, const u8 *kek, size_t kek_len,
4390 const u8 *kck, size_t kck_len,
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004391 const u8 *replay_ctr);
4392
4393 /**
4394 * sta_assoc - Station association indication
4395 * @priv: Private driver interface data
4396 * @own_addr: Source address and BSSID for association frame
4397 * @addr: MAC address of the station to associate
4398 * @reassoc: flag to indicate re-association
4399 * @status: association response status code
4400 * @ie: assoc response ie buffer
4401 * @len: ie buffer length
4402 * Returns: 0 on success, -1 on failure
4403 *
4404 * This function indicates the driver to send (Re)Association
4405 * Response frame to the station.
4406 */
4407 int (*sta_assoc)(void *priv, const u8 *own_addr, const u8 *addr,
4408 int reassoc, u16 status, const u8 *ie, size_t len);
4409
4410 /**
4411 * sta_auth - Station authentication indication
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004412 * @priv: private driver interface data
4413 * @params: Station authentication parameters
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004414 *
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004415 * Returns: 0 on success, -1 on failure
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004416 */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004417 int (*sta_auth)(void *priv,
4418 struct wpa_driver_sta_auth_params *params);
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004419
4420 /**
4421 * add_tspec - Add traffic stream
4422 * @priv: Private driver interface data
4423 * @addr: MAC address of the station to associate
4424 * @tspec_ie: tspec ie buffer
4425 * @tspec_ielen: tspec ie length
4426 * Returns: 0 on success, -1 on failure
4427 *
4428 * This function adds the traffic steam for the station
4429 * and fills the medium_time in tspec_ie.
4430 */
4431 int (*add_tspec)(void *priv, const u8 *addr, u8 *tspec_ie,
4432 size_t tspec_ielen);
4433
4434 /**
4435 * add_sta_node - Add a station node in the driver
4436 * @priv: Private driver interface data
4437 * @addr: MAC address of the station to add
4438 * @auth_alg: authentication algorithm used by the station
4439 * Returns: 0 on success, -1 on failure
4440 *
4441 * This function adds the station node in the driver, when
4442 * the station gets added by FT-over-DS.
4443 */
4444 int (*add_sta_node)(void *priv, const u8 *addr, u16 auth_alg);
4445
4446 /**
4447 * sched_scan - Request the driver to initiate scheduled scan
4448 * @priv: Private driver interface data
4449 * @params: Scan parameters
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004450 * Returns: 0 on success, -1 on failure
4451 *
4452 * This operation should be used for scheduled scan offload to
4453 * the hardware. Every time scan results are available, the
4454 * driver should report scan results event for wpa_supplicant
4455 * which will eventually request the results with
4456 * wpa_driver_get_scan_results2(). This operation is optional
4457 * and if not provided or if it returns -1, we fall back to
4458 * normal host-scheduled scans.
4459 */
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08004460 int (*sched_scan)(void *priv, struct wpa_driver_scan_params *params);
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004461
4462 /**
4463 * stop_sched_scan - Request the driver to stop a scheduled scan
4464 * @priv: Private driver interface data
4465 * Returns: 0 on success, -1 on failure
4466 *
4467 * This should cause the scheduled scan to be stopped and
4468 * results should stop being sent. Must be supported if
4469 * sched_scan is supported.
4470 */
4471 int (*stop_sched_scan)(void *priv);
4472
4473 /**
4474 * poll_client - Probe (null data or such) the given station
4475 * @priv: Private driver interface data
4476 * @own_addr: MAC address of sending interface
4477 * @addr: MAC address of the station to probe
4478 * @qos: Indicates whether station is QoS station
4479 *
4480 * This function is used to verify whether an associated station is
4481 * still present. This function does not need to be implemented if the
4482 * driver provides such inactivity polling mechanism.
4483 */
4484 void (*poll_client)(void *priv, const u8 *own_addr,
4485 const u8 *addr, int qos);
Dmitry Shmidt04949592012-07-19 12:16:46 -07004486
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004487 /**
Dmitry Shmidt04949592012-07-19 12:16:46 -07004488 * radio_disable - Disable/enable radio
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004489 * @priv: Private driver interface data
Dmitry Shmidt04949592012-07-19 12:16:46 -07004490 * @disabled: 1=disable 0=enable radio
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004491 * Returns: 0 on success, -1 on failure
4492 *
Dmitry Shmidt04949592012-07-19 12:16:46 -07004493 * This optional command is for testing purposes. It can be used to
4494 * disable the radio on a testbed device to simulate out-of-radio-range
4495 * conditions.
4496 */
4497 int (*radio_disable)(void *priv, int disabled);
4498
4499 /**
4500 * switch_channel - Announce channel switch and migrate the GO to the
4501 * given frequency
4502 * @priv: Private driver interface data
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08004503 * @settings: Settings for CSA period and new channel
Dmitry Shmidt04949592012-07-19 12:16:46 -07004504 * Returns: 0 on success, -1 on failure
4505 *
4506 * This function is used to move the GO to the legacy STA channel to
4507 * avoid frequency conflict in single channel concurrency.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004508 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08004509 int (*switch_channel)(void *priv, struct csa_settings *settings);
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004510
4511 /**
Sunil Ravia04bd252022-05-02 22:54:18 -07004512 * switch_color - Announce color switch and migrate the BSS to the
4513 * given color
4514 * @priv: Private driver interface data
4515 * @settings: Settings for CCA period and new color
4516 * Returns: 0 on success, -1 on failure
4517 *
4518 * This function is used to move the BSS to its new color.
4519 */
4520 int (*switch_color)(void *priv, struct cca_settings *settings);
4521
4522 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004523 * add_tx_ts - Add traffic stream
4524 * @priv: Private driver interface data
4525 * @tsid: Traffic stream ID
4526 * @addr: Receiver address
4527 * @user_prio: User priority of the traffic stream
4528 * @admitted_time: Admitted time for this TS in units of
4529 * 32 microsecond periods (per second).
4530 * Returns: 0 on success, -1 on failure
4531 */
4532 int (*add_tx_ts)(void *priv, u8 tsid, const u8 *addr, u8 user_prio,
4533 u16 admitted_time);
4534
4535 /**
4536 * del_tx_ts - Delete traffic stream
4537 * @priv: Private driver interface data
4538 * @tsid: Traffic stream ID
4539 * @addr: Receiver address
4540 * Returns: 0 on success, -1 on failure
4541 */
4542 int (*del_tx_ts)(void *priv, u8 tsid, const u8 *addr);
4543
4544 /**
4545 * Enable channel-switching with TDLS peer
4546 * @priv: Private driver interface data
4547 * @addr: MAC address of the TDLS peer
4548 * @oper_class: Operating class of the switch channel
4549 * @params: Channel specification
4550 * Returns: 0 on success, -1 on failure
4551 *
4552 * The function indicates to driver that it can start switching to a
4553 * different channel with a specified TDLS peer. The switching is
4554 * assumed on until canceled with tdls_disable_channel_switch().
4555 */
4556 int (*tdls_enable_channel_switch)(
4557 void *priv, const u8 *addr, u8 oper_class,
4558 const struct hostapd_freq_params *params);
4559
4560 /**
4561 * Disable channel switching with TDLS peer
4562 * @priv: Private driver interface data
4563 * @addr: MAC address of the TDLS peer
4564 * Returns: 0 on success, -1 on failure
4565 *
4566 * This function indicates to the driver that it should stop switching
4567 * with a given TDLS peer.
4568 */
4569 int (*tdls_disable_channel_switch)(void *priv, const u8 *addr);
4570
4571 /**
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004572 * start_dfs_cac - Listen for radar interference on the channel
4573 * @priv: Private driver interface data
Dmitry Shmidt051af732013-10-22 13:52:46 -07004574 * @freq: Channel parameters
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004575 * Returns: 0 on success, -1 on failure
4576 */
Dmitry Shmidt051af732013-10-22 13:52:46 -07004577 int (*start_dfs_cac)(void *priv, struct hostapd_freq_params *freq);
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004578
4579 /**
4580 * stop_ap - Removes beacon from AP
4581 * @priv: Private driver interface data
Sunil Ravi99c035e2024-07-12 01:42:03 +00004582 * @link_id: Link ID of the specified link; -1 for non-MLD
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004583 * Returns: 0 on success, -1 on failure (or if not supported)
4584 *
4585 * This optional function can be used to disable AP mode related
4586 * configuration. Unlike deinit_ap, it does not change to station
4587 * mode.
4588 */
Sunil Ravi99c035e2024-07-12 01:42:03 +00004589 int (*stop_ap)(void *priv, int link_id);
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07004590
4591 /**
4592 * get_survey - Retrieve survey data
4593 * @priv: Private driver interface data
4594 * @freq: If set, survey data for the specified frequency is only
4595 * being requested. If not set, all survey data is requested.
4596 * Returns: 0 on success, -1 on failure
4597 *
4598 * Use this to retrieve:
4599 *
4600 * - the observed channel noise floor
4601 * - the amount of time we have spent on the channel
4602 * - the amount of time during which we have spent on the channel that
4603 * the radio has determined the medium is busy and we cannot
4604 * transmit
4605 * - the amount of time we have spent receiving data
4606 * - the amount of time we have spent transmitting data
4607 *
4608 * This data can be used for spectrum heuristics. One example is
4609 * Automatic Channel Selection (ACS). The channel survey data is
4610 * kept on a linked list on the channel data, one entry is added
4611 * for each survey. The min_nf of the channel is updated for each
4612 * survey.
4613 */
4614 int (*get_survey)(void *priv, unsigned int freq);
Dmitry Shmidt56052862013-10-04 10:23:25 -07004615
4616 /**
4617 * status - Get driver interface status information
4618 * @priv: Private driver interface data
Hai Shalom74f70d42019-02-11 14:42:39 -08004619 * @buf: Buffer for printing the status information
Dmitry Shmidt56052862013-10-04 10:23:25 -07004620 * @buflen: Maximum length of the buffer
4621 * Returns: Length of written status information or -1 on failure
4622 */
4623 int (*status)(void *priv, char *buf, size_t buflen);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004624
Dmitry Shmidt661b4f72014-09-29 14:58:27 -07004625 /**
4626 * roaming - Set roaming policy for driver-based BSS selection
4627 * @priv: Private driver interface data
4628 * @allowed: Whether roaming within ESS is allowed
4629 * @bssid: Forced BSSID if roaming is disabled or %NULL if not set
4630 * Returns: Length of written status information or -1 on failure
4631 *
4632 * This optional callback can be used to update roaming policy from the
4633 * associate() command (bssid being set there indicates that the driver
4634 * should not roam before getting this roaming() call to allow roaming.
4635 * If the driver does not indicate WPA_DRIVER_FLAGS_BSS_SELECTION
4636 * capability, roaming policy is handled within wpa_supplicant and there
4637 * is no need to implement or react to this callback.
4638 */
4639 int (*roaming)(void *priv, int allowed, const u8 *bssid);
4640
4641 /**
Roshan Pius3a1667e2018-07-03 15:17:14 -07004642 * disable_fils - Enable/disable FILS feature
4643 * @priv: Private driver interface data
4644 * @disable: 0-enable and 1-disable FILS feature
4645 * Returns: 0 on success, -1 on failure
4646 *
4647 * This callback can be used to configure driver and below layers to
4648 * enable/disable all FILS features.
4649 */
4650 int (*disable_fils)(void *priv, int disable);
4651
4652 /**
Dmitry Shmidt661b4f72014-09-29 14:58:27 -07004653 * set_mac_addr - Set MAC address
4654 * @priv: Private driver interface data
4655 * @addr: MAC address to use or %NULL for setting back to permanent
4656 * Returns: 0 on success, -1 on failure
4657 */
4658 int (*set_mac_addr)(void *priv, const u8 *addr);
4659
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004660#ifdef CONFIG_MACSEC
4661 int (*macsec_init)(void *priv, struct macsec_init_params *params);
4662
4663 int (*macsec_deinit)(void *priv);
4664
4665 /**
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004666 * macsec_get_capability - Inform MKA of this driver's capability
4667 * @priv: Private driver interface data
4668 * @cap: Driver's capability
4669 * Returns: 0 on success, -1 on failure
4670 */
4671 int (*macsec_get_capability)(void *priv, enum macsec_cap *cap);
4672
4673 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004674 * enable_protect_frames - Set protect frames status
4675 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004676 * @enabled: true = protect frames enabled
4677 * false = protect frames disabled
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004678 * Returns: 0 on success, -1 on failure (or if not supported)
4679 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004680 int (*enable_protect_frames)(void *priv, bool enabled);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004681
4682 /**
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004683 * enable_encrypt - Set encryption status
4684 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004685 * @enabled: true = encrypt outgoing traffic
4686 * false = integrity-only protection on outgoing traffic
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004687 * Returns: 0 on success, -1 on failure (or if not supported)
4688 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004689 int (*enable_encrypt)(void *priv, bool enabled);
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004690
4691 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004692 * set_replay_protect - Set replay protect status and window size
4693 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004694 * @enabled: true = replay protect enabled
4695 * false = replay protect disabled
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004696 * @window: replay window size, valid only when replay protect enabled
4697 * Returns: 0 on success, -1 on failure (or if not supported)
4698 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004699 int (*set_replay_protect)(void *priv, bool enabled, u32 window);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004700
4701 /**
Sunil Ravi036cec52023-03-29 11:35:17 -07004702 * set_offload - Set MACsec hardware offload
4703 * @priv: Private driver interface data
4704 * @offload: 0 = MACSEC_OFFLOAD_OFF
4705 * 1 = MACSEC_OFFLOAD_PHY
4706 * 2 = MACSEC_OFFLOAD_MAC
4707 * Returns: 0 on success, -1 on failure (or if not supported)
4708 */
4709 int (*set_offload)(void *priv, u8 offload);
4710
4711 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004712 * set_current_cipher_suite - Set current cipher suite
4713 * @priv: Private driver interface data
4714 * @cs: EUI64 identifier
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004715 * Returns: 0 on success, -1 on failure (or if not supported)
4716 */
Dmitry Shmidt7d175302016-09-06 13:11:34 -07004717 int (*set_current_cipher_suite)(void *priv, u64 cs);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004718
4719 /**
4720 * enable_controlled_port - Set controlled port status
4721 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004722 * @enabled: true = controlled port enabled
4723 * false = controlled port disabled
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004724 * Returns: 0 on success, -1 on failure (or if not supported)
4725 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004726 int (*enable_controlled_port)(void *priv, bool enabled);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004727
4728 /**
4729 * get_receive_lowest_pn - Get receive lowest pn
4730 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004731 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004732 * Returns: 0 on success, -1 on failure (or if not supported)
4733 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004734 int (*get_receive_lowest_pn)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004735
4736 /**
4737 * get_transmit_next_pn - Get transmit next pn
4738 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004739 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004740 * Returns: 0 on success, -1 on failure (or if not supported)
4741 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004742 int (*get_transmit_next_pn)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004743
4744 /**
4745 * set_transmit_next_pn - Set transmit next pn
4746 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004747 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004748 * Returns: 0 on success, -1 on failure (or if not supported)
4749 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004750 int (*set_transmit_next_pn)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004751
4752 /**
Hai Shalom74f70d42019-02-11 14:42:39 -08004753 * set_receive_lowest_pn - Set receive lowest PN
4754 * @priv: Private driver interface data
4755 * @sa: secure association
4756 * Returns: 0 on success, -1 on failure (or if not supported)
4757 */
4758 int (*set_receive_lowest_pn)(void *priv, struct receive_sa *sa);
4759
4760 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004761 * create_receive_sc - create secure channel for receiving
4762 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004763 * @sc: secure channel
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004764 * @conf_offset: confidentiality offset (0, 30, or 50)
4765 * @validation: frame validation policy (0 = Disabled, 1 = Checked,
4766 * 2 = Strict)
4767 * Returns: 0 on success, -1 on failure (or if not supported)
4768 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004769 int (*create_receive_sc)(void *priv, struct receive_sc *sc,
4770 unsigned int conf_offset,
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004771 int validation);
4772
4773 /**
4774 * delete_receive_sc - delete secure connection for receiving
4775 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004776 * @sc: secure channel
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004777 * Returns: 0 on success, -1 on failure
4778 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004779 int (*delete_receive_sc)(void *priv, struct receive_sc *sc);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004780
4781 /**
4782 * create_receive_sa - create secure association for receive
4783 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004784 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004785 * Returns: 0 on success, -1 on failure
4786 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004787 int (*create_receive_sa)(void *priv, struct receive_sa *sa);
4788
4789 /**
4790 * delete_receive_sa - Delete secure association for receive
4791 * @priv: Private driver interface data from init()
4792 * @sa: Secure association
4793 * Returns: 0 on success, -1 on failure
4794 */
4795 int (*delete_receive_sa)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004796
4797 /**
4798 * enable_receive_sa - enable the SA for receive
4799 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004800 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004801 * Returns: 0 on success, -1 on failure
4802 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004803 int (*enable_receive_sa)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004804
4805 /**
4806 * disable_receive_sa - disable SA for receive
4807 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004808 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004809 * Returns: 0 on success, -1 on failure
4810 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004811 int (*disable_receive_sa)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004812
4813 /**
4814 * create_transmit_sc - create secure connection for transmit
4815 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004816 * @sc: secure channel
4817 * @conf_offset: confidentiality offset (0, 30, or 50)
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004818 * Returns: 0 on success, -1 on failure
4819 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004820 int (*create_transmit_sc)(void *priv, struct transmit_sc *sc,
4821 unsigned int conf_offset);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004822
4823 /**
4824 * delete_transmit_sc - delete secure connection for transmit
4825 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004826 * @sc: secure channel
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004827 * Returns: 0 on success, -1 on failure
4828 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004829 int (*delete_transmit_sc)(void *priv, struct transmit_sc *sc);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004830
4831 /**
4832 * create_transmit_sa - create secure association for transmit
4833 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004834 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004835 * Returns: 0 on success, -1 on failure
4836 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004837 int (*create_transmit_sa)(void *priv, struct transmit_sa *sa);
4838
4839 /**
4840 * delete_transmit_sa - Delete secure association for transmit
4841 * @priv: Private driver interface data from init()
4842 * @sa: Secure association
4843 * Returns: 0 on success, -1 on failure
4844 */
4845 int (*delete_transmit_sa)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004846
4847 /**
4848 * enable_transmit_sa - enable SA for transmit
4849 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004850 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004851 * Returns: 0 on success, -1 on failure
4852 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004853 int (*enable_transmit_sa)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004854
4855 /**
4856 * disable_transmit_sa - disable SA for transmit
4857 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004858 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004859 * Returns: 0 on success, -1 on failure
4860 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004861 int (*disable_transmit_sa)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004862#endif /* CONFIG_MACSEC */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004863
4864 /**
4865 * init_mesh - Driver specific initialization for mesh
4866 * @priv: Private driver interface data
4867 * Returns: 0 on success, -1 on failure
4868 */
4869 int (*init_mesh)(void *priv);
4870
4871 /**
4872 * join_mesh - Join a mesh network
4873 * @priv: Private driver interface data
4874 * @params: Mesh configuration parameters
4875 * Returns: 0 on success, -1 on failure
4876 */
4877 int (*join_mesh)(void *priv,
4878 struct wpa_driver_mesh_join_params *params);
4879
4880 /**
4881 * leave_mesh - Leave a mesh network
4882 * @priv: Private driver interface data
4883 * Returns 0 on success, -1 on failure
4884 */
4885 int (*leave_mesh)(void *priv);
4886
4887 /**
Hai Shalom81f62d82019-07-22 12:10:00 -07004888 * probe_mesh_link - Inject a frame over direct mesh link to a given
4889 * peer skipping the next_hop lookup from mpath table.
4890 * @priv: Private driver interface data
4891 * @addr: Peer MAC address
4892 * @eth: Ethernet frame to be sent
4893 * @len: Ethernet frame lengtn in bytes
4894 * Returns 0 on success, -1 on failure
4895 */
4896 int (*probe_mesh_link)(void *priv, const u8 *addr, const u8 *eth,
4897 size_t len);
4898
4899 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004900 * do_acs - Automatically select channel
4901 * @priv: Private driver interface data
4902 * @params: Parameters for ACS
4903 * Returns 0 on success, -1 on failure
4904 *
4905 * This command can be used to offload ACS to the driver if the driver
4906 * indicates support for such offloading (WPA_DRIVER_FLAGS_ACS_OFFLOAD).
4907 */
4908 int (*do_acs)(void *priv, struct drv_acs_params *params);
Ravi Joshie6ccb162015-07-16 17:45:41 -07004909
4910 /**
Hai Shalom60840252021-02-19 19:02:11 -08004911 * set_band - Notify driver of band(s) selection
Ravi Joshie6ccb162015-07-16 17:45:41 -07004912 * @priv: Private driver interface data
Hai Shalom60840252021-02-19 19:02:11 -08004913 * @band_mask: The selected band(s) bit mask (from enum set_band)
Ravi Joshie6ccb162015-07-16 17:45:41 -07004914 * Returns 0 on success, -1 on failure
4915 */
Hai Shalom60840252021-02-19 19:02:11 -08004916 int (*set_band)(void *priv, u32 band_mask);
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08004917
4918 /**
4919 * get_pref_freq_list - Get preferred frequency list for an interface
4920 * @priv: Private driver interface data
4921 * @if_type: Interface type
4922 * @num: Number of channels
Sunil8cd6f4d2022-06-28 18:40:46 +00004923 * @freq_list: Weighted preferred channel list
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08004924 * Returns 0 on success, -1 on failure
4925 *
4926 * This command can be used to query the preferred frequency list from
Sunil8cd6f4d2022-06-28 18:40:46 +00004927 * the driver specific to a particular interface type. The freq_list
4928 * array needs to have room for *num entries. *num will be updated to
4929 * indicate the number of entries fetched from the driver.
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08004930 */
4931 int (*get_pref_freq_list)(void *priv, enum wpa_driver_if_type if_type,
Sunil8cd6f4d2022-06-28 18:40:46 +00004932 unsigned int *num,
4933 struct weighted_pcl *freq_list);
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08004934
4935 /**
4936 * set_prob_oper_freq - Indicate probable P2P operating channel
4937 * @priv: Private driver interface data
4938 * @freq: Channel frequency in MHz
4939 * Returns 0 on success, -1 on failure
4940 *
4941 * This command can be used to inform the driver of the operating
4942 * frequency that an ongoing P2P group formation is likely to come up
4943 * on. Local device is assuming P2P Client role.
4944 */
4945 int (*set_prob_oper_freq)(void *priv, unsigned int freq);
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08004946
4947 /**
4948 * abort_scan - Request the driver to abort an ongoing scan
4949 * @priv: Private driver interface data
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004950 * @scan_cookie: Cookie identifying the scan request. This is used only
4951 * when the vendor interface QCA_NL80211_VENDOR_SUBCMD_TRIGGER_SCAN
4952 * was used to trigger scan. Otherwise, 0 is used.
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08004953 * Returns 0 on success, -1 on failure
4954 */
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004955 int (*abort_scan)(void *priv, u64 scan_cookie);
Dmitry Shmidt849734c2016-05-27 09:59:01 -07004956
4957 /**
4958 * configure_data_frame_filters - Request to configure frame filters
4959 * @priv: Private driver interface data
4960 * @filter_flags: The type of frames to filter (bitfield of
4961 * WPA_DATA_FRAME_FILTER_FLAG_*)
4962 * Returns: 0 on success or -1 on failure
4963 */
4964 int (*configure_data_frame_filters)(void *priv, u32 filter_flags);
Dmitry Shmidtd5ab1b52016-06-21 12:38:41 -07004965
4966 /**
4967 * get_ext_capab - Get extended capabilities for the specified interface
4968 * @priv: Private driver interface data
4969 * @type: Interface type for which to get extended capabilities
4970 * @ext_capab: Extended capabilities fetched
4971 * @ext_capab_mask: Extended capabilities mask
4972 * @ext_capab_len: Length of the extended capabilities
4973 * Returns: 0 on success or -1 on failure
4974 */
4975 int (*get_ext_capab)(void *priv, enum wpa_driver_if_type type,
4976 const u8 **ext_capab, const u8 **ext_capab_mask,
4977 unsigned int *ext_capab_len);
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07004978
4979 /**
Sunil Ravi2a14cf12023-11-21 00:54:38 +00004980 * get_mld_capab - Get MLD capabilities for the specified interface
4981 * @priv: Private driver interface data
4982 * @type: Interface type for which to get MLD capabilities
4983 * @eml_capa: EML capabilities
4984 * @mld_capa_and_ops: MLD Capabilities and Operations
4985 * Returns: 0 on success or -1 on failure
4986 */
4987 int (*get_mld_capab)(void *priv, enum wpa_driver_if_type type,
4988 u16 *eml_capa, u16 *mld_capa_and_ops);
4989
4990 /**
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07004991 * p2p_lo_start - Start offloading P2P listen to device
4992 * @priv: Private driver interface data
4993 * @freq: Listening frequency (MHz) for P2P listen
4994 * @period: Length of the listen operation in milliseconds
4995 * @interval: Interval for running the listen operation in milliseconds
4996 * @count: Number of times to run the listen operation
4997 * @device_types: Device primary and secondary types
4998 * @dev_types_len: Number of bytes for device_types
4999 * @ies: P2P IE and WSC IE for Probe Response frames
5000 * @ies_len: Length of ies in bytes
5001 * Returns: 0 on success or -1 on failure
5002 */
5003 int (*p2p_lo_start)(void *priv, unsigned int freq,
5004 unsigned int period, unsigned int interval,
5005 unsigned int count,
5006 const u8 *device_types, size_t dev_types_len,
5007 const u8 *ies, size_t ies_len);
5008
5009 /**
5010 * p2p_lo_stop - Stop P2P listen offload
5011 * @priv: Private driver interface data
5012 * Returns: 0 on success or -1 on failure
5013 */
5014 int (*p2p_lo_stop)(void *priv);
Dmitry Shmidt7f2c7532016-08-15 09:48:12 -07005015
5016 /**
5017 * set_default_scan_ies - Set default scan IEs
5018 * @priv: Private driver interface data
5019 * @ies: Scan default IEs buffer
5020 * @ies_len: Length of IEs in bytes
5021 * Returns: 0 on success or -1 on failure
5022 *
5023 * The driver can use these by default when there are no scan IEs coming
5024 * in the subsequent scan requests. Also in case of one or more of IEs
5025 * given in set_default_scan_ies() are missing in the subsequent scan
5026 * request, the driver should merge the missing scan IEs in the scan
5027 * request from the IEs set by set_default_scan_ies() in the Probe
5028 * Request frames sent.
5029 */
5030 int (*set_default_scan_ies)(void *priv, const u8 *ies, size_t ies_len);
5031
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08005032 /**
5033 * set_tdls_mode - Set TDLS trigger mode to the host driver
5034 * @priv: Private driver interface data
5035 * @tdls_external_control: Represents if TDLS external trigger control
5036 * mode is enabled/disabled.
5037 *
5038 * This optional callback can be used to configure the TDLS external
5039 * trigger control mode to the host driver.
5040 */
5041 int (*set_tdls_mode)(void *priv, int tdls_external_control);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005042
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005043 /**
5044 * get_bss_transition_status - Get candidate BSS's transition status
5045 * @priv: Private driver interface data
5046 * @params: Candidate BSS list
5047 *
5048 * Get the accept or reject reason code for a list of BSS transition
5049 * candidates.
5050 */
5051 struct wpa_bss_candidate_info *
5052 (*get_bss_transition_status)(void *priv,
5053 struct wpa_bss_trans_info *params);
5054 /**
5055 * ignore_assoc_disallow - Configure driver to ignore assoc_disallow
5056 * @priv: Private driver interface data
5057 * @ignore_disallow: 0 to not ignore, 1 to ignore
5058 * Returns: 0 on success, -1 on failure
5059 */
5060 int (*ignore_assoc_disallow)(void *priv, int ignore_disallow);
5061
5062 /**
Hai Shalom899fcc72020-10-19 14:38:18 -07005063 * set_bssid_tmp_disallow - Set disallowed BSSIDs to the driver
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005064 * @priv: Private driver interface data
Hai Shalom899fcc72020-10-19 14:38:18 -07005065 * @num_bssid: Number of temporarily disallowed BSSIDs
5066 * @bssids: List of temporarily disallowed BSSIDs
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005067 */
Hai Shalom899fcc72020-10-19 14:38:18 -07005068 int (*set_bssid_tmp_disallow)(void *priv, unsigned int num_bssid,
5069 const u8 *bssid);
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005070
5071 /**
5072 * update_connect_params - Update the connection parameters
5073 * @priv: Private driver interface data
5074 * @params: Association parameters
5075 * @mask: Bit mask indicating which parameters in @params have to be
5076 * updated
5077 * Returns: 0 on success, -1 on failure
5078 *
5079 * Update the connection parameters when in connected state so that the
5080 * driver uses the updated parameters for subsequent roaming. This is
5081 * used only with drivers that implement internal BSS selection and
5082 * roaming.
5083 */
5084 int (*update_connect_params)(
5085 void *priv, struct wpa_driver_associate_params *params,
5086 enum wpa_drv_update_connect_params_mask mask);
Roshan Pius3a1667e2018-07-03 15:17:14 -07005087
5088 /**
5089 * send_external_auth_status - Indicate the status of external
5090 * authentication processing to the host driver.
5091 * @priv: Private driver interface data
5092 * @params: Status of authentication processing.
5093 * Returns: 0 on success, -1 on failure
5094 */
5095 int (*send_external_auth_status)(void *priv,
5096 struct external_auth *params);
Hai Shalom74f70d42019-02-11 14:42:39 -08005097
5098 /**
5099 * set_4addr_mode - Set 4-address mode
5100 * @priv: Private driver interface data
5101 * @bridge_ifname: Bridge interface name
5102 * @val: 0 - disable 4addr mode, 1 - enable 4addr mode
5103 * Returns: 0 on success, < 0 on failure
5104 */
5105 int (*set_4addr_mode)(void *priv, const char *bridge_ifname, int val);
Hai Shalom81f62d82019-07-22 12:10:00 -07005106
5107 /**
5108 * update_dh_ie - Update DH IE
5109 * @priv: Private driver interface data
5110 * @peer_mac: Peer MAC address
5111 * @reason_code: Reacon code
5112 * @ie: DH IE
5113 * @ie_len: DH IE length in bytes
5114 * Returns: 0 on success, -1 on failure
5115 *
5116 * This callback is used to let the driver know the DH processing result
5117 * and DH IE for a pending association.
5118 */
5119 int (*update_dh_ie)(void *priv, const u8 *peer_mac, u16 reason_code,
5120 const u8 *ie, size_t ie_len);
Hai Shalomb755a2a2020-04-23 21:49:02 -07005121
5122 /**
5123 * dpp_listen - Notify driver about start/stop of DPP listen
5124 * @priv: Private driver interface data
5125 * @enable: Whether listen state is enabled (or disabled)
5126 * Returns: 0 on success, -1 on failure
5127 *
5128 * This optional callback can be used to update RX frame filtering to
5129 * explicitly allow reception of broadcast Public Action frames.
5130 */
Hai Shalome21d4e82020-04-29 16:34:06 -07005131 int (*dpp_listen)(void *priv, bool enable);
Hai Shalomc1a21442022-02-04 13:43:00 -08005132
Sunil Ravi89eba102022-09-13 21:04:37 -07005133 /**
5134 * set_secure_ranging_ctx - Add or delete secure ranging parameters of
5135 * the specified peer to the driver.
5136 * @priv: Private driver interface data
5137 * @params: Secure ranging parameters
5138 * Returns: 0 on success, -1 on failure
5139 *
5140 */
5141 int (*set_secure_ranging_ctx)(void *priv,
5142 struct secure_ranging_params *params);
5143
5144 /**
5145 * send_pasn_resp - Send PASN response for a set of peers to the
5146 * driver.
5147 * @priv: Private driver interface data
5148 * @params: Parameters holding peers and respective status.
5149 * Returns: 0 on success, -1 on failure
5150 */
5151 int (*send_pasn_resp)(void *priv, struct pasn_auth *params);
5152
5153 /**
5154 * get_sta_mlo_info - Get the current multi-link association info
5155 * @priv: Private driver interface data
5156 * @mlo: Pointer to fill multi-link association info
5157 * Returns: 0 on success, -1 on failure
5158 *
5159 * This callback is used to fetch multi-link of the current association.
5160 */
5161 int (*get_sta_mlo_info)(void *priv,
5162 struct driver_sta_mlo_info *mlo_info);
5163
Sunil Ravi036cec52023-03-29 11:35:17 -07005164 /**
5165 * link_add - Add a link to the AP MLD interface
5166 * @priv: Private driver interface data
5167 * @link_id: The link ID
5168 * @addr: The MAC address to use for the link
Sunil Ravi99c035e2024-07-12 01:42:03 +00005169 * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces
Sunil Ravi036cec52023-03-29 11:35:17 -07005170 * Returns: 0 on success, negative value on failure
5171 */
Sunil Ravi99c035e2024-07-12 01:42:03 +00005172 int (*link_add)(void *priv, u8 link_id, const u8 *addr, void *bss_ctx);
5173
5174 /**
5175 * link_remove - Remove a link from the AP MLD interface
5176 * @priv: Private driver interface data
5177 * @type: Interface type
5178 * @ifname: Interface name of the virtual interface from where the link
5179 * is to be removed.
5180 * @link_id: Valid link ID to remove
5181 * Returns: 0 on success, -1 on failure
5182 */
5183 int (*link_remove)(void *priv, enum wpa_driver_if_type type,
5184 const char *ifname, u8 link_id);
5185
5186 /**
5187 * is_drv_shared - Check whether the driver interface is shared
5188 * @priv: Private driver interface data from init()
5189 * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces
5190 *
5191 * Checks whether the driver interface is being used by other partner
5192 * BSS(s) or not. This is used to decide whether the driver interface
5193 * needs to be deinitilized when one interface is getting deinitialized.
5194 *
5195 * Returns: true if it is being used or else false.
5196 */
5197 bool (*is_drv_shared)(void *priv, void *bss_ctx);
5198
5199 /**
5200 * link_sta_remove - Remove a link STA from an MLD STA
5201 * @priv: Private driver interface data
5202 * @link_id: The link ID which the link STA is using
5203 * @addr: The MLD MAC address of the MLD STA
5204 * Returns: 0 on success, negative value on failure
5205 */
5206 int (*link_sta_remove)(void *priv, u8 link_id, const u8 *addr);
Sunil Ravi036cec52023-03-29 11:35:17 -07005207
Hai Shalomc1a21442022-02-04 13:43:00 -08005208#ifdef CONFIG_TESTING_OPTIONS
5209 int (*register_frame)(void *priv, u16 type,
5210 const u8 *match, size_t match_len,
5211 bool multicast);
5212#endif /* CONFIG_TESTING_OPTIONS */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005213};
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005214
5215/**
5216 * enum wpa_event_type - Event type for wpa_supplicant_event() calls
5217 */
5218enum wpa_event_type {
5219 /**
5220 * EVENT_ASSOC - Association completed
5221 *
5222 * This event needs to be delivered when the driver completes IEEE
5223 * 802.11 association or reassociation successfully.
5224 * wpa_driver_ops::get_bssid() is expected to provide the current BSSID
5225 * after this event has been generated. In addition, optional
5226 * EVENT_ASSOCINFO may be generated just before EVENT_ASSOC to provide
5227 * more information about the association. If the driver interface gets
5228 * both of these events at the same time, it can also include the
5229 * assoc_info data in EVENT_ASSOC call.
5230 */
5231 EVENT_ASSOC,
5232
5233 /**
5234 * EVENT_DISASSOC - Association lost
5235 *
5236 * This event should be called when association is lost either due to
5237 * receiving deauthenticate or disassociate frame from the AP or when
5238 * sending either of these frames to the current AP. If the driver
5239 * supports separate deauthentication event, EVENT_DISASSOC should only
5240 * be used for disassociation and EVENT_DEAUTH for deauthentication.
5241 * In AP mode, union wpa_event_data::disassoc_info is required.
5242 */
5243 EVENT_DISASSOC,
5244
5245 /**
5246 * EVENT_MICHAEL_MIC_FAILURE - Michael MIC (TKIP) detected
5247 *
5248 * This event must be delivered when a Michael MIC error is detected by
5249 * the local driver. Additional data for event processing is
5250 * provided with union wpa_event_data::michael_mic_failure. This
Sunil Ravia04bd252022-05-02 22:54:18 -07005251 * information is used to request new encryption key and to initiate
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005252 * TKIP countermeasures if needed.
5253 */
5254 EVENT_MICHAEL_MIC_FAILURE,
5255
5256 /**
5257 * EVENT_SCAN_RESULTS - Scan results available
5258 *
5259 * This event must be called whenever scan results are available to be
5260 * fetched with struct wpa_driver_ops::get_scan_results(). This event
5261 * is expected to be used some time after struct wpa_driver_ops::scan()
5262 * is called. If the driver provides an unsolicited event when the scan
5263 * has been completed, this event can be used to trigger
5264 * EVENT_SCAN_RESULTS call. If such event is not available from the
5265 * driver, the driver wrapper code is expected to use a registered
5266 * timeout to generate EVENT_SCAN_RESULTS call after the time that the
5267 * scan is expected to be completed. Optional information about
5268 * completed scan can be provided with union wpa_event_data::scan_info.
5269 */
5270 EVENT_SCAN_RESULTS,
5271
5272 /**
5273 * EVENT_ASSOCINFO - Report optional extra information for association
5274 *
5275 * This event can be used to report extra association information for
5276 * EVENT_ASSOC processing. This extra information includes IEs from
5277 * association frames and Beacon/Probe Response frames in union
5278 * wpa_event_data::assoc_info. EVENT_ASSOCINFO must be send just before
5279 * EVENT_ASSOC. Alternatively, the driver interface can include
5280 * assoc_info data in the EVENT_ASSOC call if it has all the
5281 * information available at the same point.
5282 */
5283 EVENT_ASSOCINFO,
5284
5285 /**
5286 * EVENT_INTERFACE_STATUS - Report interface status changes
5287 *
5288 * This optional event can be used to report changes in interface
5289 * status (interface added/removed) using union
5290 * wpa_event_data::interface_status. This can be used to trigger
5291 * wpa_supplicant to stop and re-start processing for the interface,
5292 * e.g., when a cardbus card is ejected/inserted.
5293 */
5294 EVENT_INTERFACE_STATUS,
5295
5296 /**
5297 * EVENT_PMKID_CANDIDATE - Report a candidate AP for pre-authentication
5298 *
5299 * This event can be used to inform wpa_supplicant about candidates for
5300 * RSN (WPA2) pre-authentication. If wpa_supplicant is not responsible
5301 * for scan request (ap_scan=2 mode), this event is required for
5302 * pre-authentication. If wpa_supplicant is performing scan request
5303 * (ap_scan=1), this event is optional since scan results can be used
5304 * to add pre-authentication candidates. union
5305 * wpa_event_data::pmkid_candidate is used to report the BSSID of the
5306 * candidate and priority of the candidate, e.g., based on the signal
5307 * strength, in order to try to pre-authenticate first with candidates
5308 * that are most likely targets for re-association.
5309 *
5310 * EVENT_PMKID_CANDIDATE can be called whenever the driver has updates
5311 * on the candidate list. In addition, it can be called for the current
5312 * AP and APs that have existing PMKSA cache entries. wpa_supplicant
5313 * will automatically skip pre-authentication in cases where a valid
5314 * PMKSA exists. When more than one candidate exists, this event should
5315 * be generated once for each candidate.
5316 *
5317 * Driver will be notified about successful pre-authentication with
5318 * struct wpa_driver_ops::add_pmkid() calls.
5319 */
5320 EVENT_PMKID_CANDIDATE,
5321
5322 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005323 * EVENT_TDLS - Request TDLS operation
5324 *
5325 * This event can be used to request a TDLS operation to be performed.
5326 */
5327 EVENT_TDLS,
5328
5329 /**
5330 * EVENT_FT_RESPONSE - Report FT (IEEE 802.11r) response IEs
5331 *
5332 * The driver is expected to report the received FT IEs from
5333 * FT authentication sequence from the AP. The FT IEs are included in
5334 * the extra information in union wpa_event_data::ft_ies.
5335 */
5336 EVENT_FT_RESPONSE,
5337
5338 /**
5339 * EVENT_IBSS_RSN_START - Request RSN authentication in IBSS
5340 *
5341 * The driver can use this event to inform wpa_supplicant about a STA
5342 * in an IBSS with which protected frames could be exchanged. This
5343 * event starts RSN authentication with the other STA to authenticate
5344 * the STA and set up encryption keys with it.
5345 */
5346 EVENT_IBSS_RSN_START,
5347
5348 /**
5349 * EVENT_AUTH - Authentication result
5350 *
5351 * This event should be called when authentication attempt has been
5352 * completed. This is only used if the driver supports separate
5353 * authentication step (struct wpa_driver_ops::authenticate).
5354 * Information about authentication result is included in
5355 * union wpa_event_data::auth.
5356 */
5357 EVENT_AUTH,
5358
5359 /**
5360 * EVENT_DEAUTH - Authentication lost
5361 *
5362 * This event should be called when authentication is lost either due
5363 * to receiving deauthenticate frame from the AP or when sending that
5364 * frame to the current AP.
5365 * In AP mode, union wpa_event_data::deauth_info is required.
5366 */
5367 EVENT_DEAUTH,
5368
5369 /**
5370 * EVENT_ASSOC_REJECT - Association rejected
5371 *
5372 * This event should be called when (re)association attempt has been
5373 * rejected by the AP. Information about the association response is
5374 * included in union wpa_event_data::assoc_reject.
5375 */
5376 EVENT_ASSOC_REJECT,
5377
5378 /**
5379 * EVENT_AUTH_TIMED_OUT - Authentication timed out
5380 */
5381 EVENT_AUTH_TIMED_OUT,
5382
5383 /**
5384 * EVENT_ASSOC_TIMED_OUT - Association timed out
5385 */
5386 EVENT_ASSOC_TIMED_OUT,
5387
5388 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005389 * EVENT_WPS_BUTTON_PUSHED - Report hardware push button press for WPS
5390 */
5391 EVENT_WPS_BUTTON_PUSHED,
5392
5393 /**
5394 * EVENT_TX_STATUS - Report TX status
5395 */
5396 EVENT_TX_STATUS,
5397
5398 /**
5399 * EVENT_RX_FROM_UNKNOWN - Report RX from unknown STA
5400 */
5401 EVENT_RX_FROM_UNKNOWN,
5402
5403 /**
5404 * EVENT_RX_MGMT - Report RX of a management frame
5405 */
5406 EVENT_RX_MGMT,
5407
5408 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005409 * EVENT_REMAIN_ON_CHANNEL - Remain-on-channel duration started
5410 *
5411 * This event is used to indicate when the driver has started the
5412 * requested remain-on-channel duration. Information about the
5413 * operation is included in union wpa_event_data::remain_on_channel.
5414 */
5415 EVENT_REMAIN_ON_CHANNEL,
5416
5417 /**
5418 * EVENT_CANCEL_REMAIN_ON_CHANNEL - Remain-on-channel timed out
5419 *
5420 * This event is used to indicate when the driver has completed
5421 * remain-on-channel duration, i.e., may noot be available on the
5422 * requested channel anymore. Information about the
5423 * operation is included in union wpa_event_data::remain_on_channel.
5424 */
5425 EVENT_CANCEL_REMAIN_ON_CHANNEL,
5426
5427 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005428 * EVENT_RX_PROBE_REQ - Indicate received Probe Request frame
5429 *
5430 * This event is used to indicate when a Probe Request frame has been
5431 * received. Information about the received frame is included in
5432 * union wpa_event_data::rx_probe_req. The driver is required to report
5433 * these events only after successfully completed probe_req_report()
5434 * commands to request the events (i.e., report parameter is non-zero)
5435 * in station mode. In AP mode, Probe Request frames should always be
5436 * reported.
5437 */
5438 EVENT_RX_PROBE_REQ,
5439
5440 /**
5441 * EVENT_NEW_STA - New wired device noticed
5442 *
5443 * This event is used to indicate that a new device has been detected
5444 * in a network that does not use association-like functionality (i.e.,
5445 * mainly wired Ethernet). This can be used to start EAPOL
5446 * authenticator when receiving a frame from a device. The address of
5447 * the device is included in union wpa_event_data::new_sta.
5448 */
5449 EVENT_NEW_STA,
5450
5451 /**
5452 * EVENT_EAPOL_RX - Report received EAPOL frame
5453 *
5454 * When in AP mode with hostapd, this event is required to be used to
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08005455 * deliver the receive EAPOL frames from the driver.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005456 */
5457 EVENT_EAPOL_RX,
5458
5459 /**
5460 * EVENT_SIGNAL_CHANGE - Indicate change in signal strength
5461 *
5462 * This event is used to indicate changes in the signal strength
5463 * observed in frames received from the current AP if signal strength
5464 * monitoring has been enabled with signal_monitor().
5465 */
5466 EVENT_SIGNAL_CHANGE,
5467
5468 /**
5469 * EVENT_INTERFACE_ENABLED - Notify that interface was enabled
5470 *
5471 * This event is used to indicate that the interface was enabled after
5472 * having been previously disabled, e.g., due to rfkill.
5473 */
5474 EVENT_INTERFACE_ENABLED,
5475
5476 /**
5477 * EVENT_INTERFACE_DISABLED - Notify that interface was disabled
5478 *
5479 * This event is used to indicate that the interface was disabled,
5480 * e.g., due to rfkill.
5481 */
5482 EVENT_INTERFACE_DISABLED,
5483
5484 /**
5485 * EVENT_CHANNEL_LIST_CHANGED - Channel list changed
5486 *
5487 * This event is used to indicate that the channel list has changed,
5488 * e.g., because of a regulatory domain change triggered by scan
5489 * results including an AP advertising a country code.
5490 */
5491 EVENT_CHANNEL_LIST_CHANGED,
5492
5493 /**
5494 * EVENT_INTERFACE_UNAVAILABLE - Notify that interface is unavailable
5495 *
5496 * This event is used to indicate that the driver cannot maintain this
5497 * interface in its operation mode anymore. The most likely use for
5498 * this is to indicate that AP mode operation is not available due to
5499 * operating channel would need to be changed to a DFS channel when
5500 * the driver does not support radar detection and another virtual
5501 * interfaces caused the operating channel to change. Other similar
5502 * resource conflicts could also trigger this for station mode
Dmitry Shmidtd30ac602014-06-30 09:54:22 -07005503 * interfaces. This event can be propagated when channel switching
5504 * fails.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005505 */
5506 EVENT_INTERFACE_UNAVAILABLE,
5507
5508 /**
5509 * EVENT_BEST_CHANNEL
5510 *
5511 * Driver generates this event whenever it detects a better channel
5512 * (e.g., based on RSSI or channel use). This information can be used
5513 * to improve channel selection for a new AP/P2P group.
5514 */
5515 EVENT_BEST_CHANNEL,
5516
5517 /**
5518 * EVENT_UNPROT_DEAUTH - Unprotected Deauthentication frame received
5519 *
5520 * This event should be called when a Deauthentication frame is dropped
5521 * due to it not being protected (MFP/IEEE 802.11w).
5522 * union wpa_event_data::unprot_deauth is required to provide more
5523 * details of the frame.
5524 */
5525 EVENT_UNPROT_DEAUTH,
5526
5527 /**
5528 * EVENT_UNPROT_DISASSOC - Unprotected Disassociation frame received
5529 *
5530 * This event should be called when a Disassociation frame is dropped
5531 * due to it not being protected (MFP/IEEE 802.11w).
5532 * union wpa_event_data::unprot_disassoc is required to provide more
5533 * details of the frame.
5534 */
5535 EVENT_UNPROT_DISASSOC,
5536
5537 /**
5538 * EVENT_STATION_LOW_ACK
5539 *
5540 * Driver generates this event whenever it detected that a particular
5541 * station was lost. Detection can be through massive transmission
5542 * failures for example.
5543 */
5544 EVENT_STATION_LOW_ACK,
5545
5546 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005547 * EVENT_IBSS_PEER_LOST - IBSS peer not reachable anymore
5548 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08005549 EVENT_IBSS_PEER_LOST,
5550
5551 /**
5552 * EVENT_DRIVER_GTK_REKEY - Device/driver did GTK rekey
5553 *
5554 * This event carries the new replay counter to notify wpa_supplicant
5555 * of the current EAPOL-Key Replay Counter in case the driver/firmware
5556 * completed Group Key Handshake while the host (including
5557 * wpa_supplicant was sleeping).
5558 */
5559 EVENT_DRIVER_GTK_REKEY,
5560
5561 /**
5562 * EVENT_SCHED_SCAN_STOPPED - Scheduled scan was stopped
5563 */
5564 EVENT_SCHED_SCAN_STOPPED,
5565
5566 /**
5567 * EVENT_DRIVER_CLIENT_POLL_OK - Station responded to poll
5568 *
5569 * This event indicates that the station responded to the poll
5570 * initiated with @poll_client.
5571 */
5572 EVENT_DRIVER_CLIENT_POLL_OK,
5573
5574 /**
5575 * EVENT_EAPOL_TX_STATUS - notify of EAPOL TX status
5576 */
Dmitry Shmidt04949592012-07-19 12:16:46 -07005577 EVENT_EAPOL_TX_STATUS,
5578
5579 /**
5580 * EVENT_CH_SWITCH - AP or GO decided to switch channels
5581 *
5582 * Described in wpa_event_data.ch_switch
5583 * */
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07005584 EVENT_CH_SWITCH,
5585
5586 /**
Hai Shalom81f62d82019-07-22 12:10:00 -07005587 * EVENT_CH_SWITCH_STARTED - AP or GO started to switch channels
5588 *
5589 * This is a pre-switch event indicating the shortly following switch
5590 * of operating channels.
5591 *
5592 * Described in wpa_event_data.ch_switch
5593 */
5594 EVENT_CH_SWITCH_STARTED,
5595 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07005596 * EVENT_WNM - Request WNM operation
5597 *
5598 * This event can be used to request a WNM operation to be performed.
5599 */
Dmitry Shmidtf8623282013-02-20 14:34:59 -08005600 EVENT_WNM,
5601
5602 /**
5603 * EVENT_CONNECT_FAILED_REASON - Connection failure reason in AP mode
5604 *
5605 * This event indicates that the driver reported a connection failure
5606 * with the specified client (for example, max client reached, etc.) in
5607 * AP mode.
5608 */
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005609 EVENT_CONNECT_FAILED_REASON,
5610
5611 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005612 * EVENT_DFS_RADAR_DETECTED - Notify of radar detection
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005613 *
5614 * A radar has been detected on the supplied frequency, hostapd should
5615 * react accordingly (e.g., change channel).
5616 */
5617 EVENT_DFS_RADAR_DETECTED,
5618
5619 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005620 * EVENT_DFS_CAC_FINISHED - Notify that channel availability check has been completed
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005621 *
5622 * After a successful CAC, the channel can be marked clear and used.
5623 */
5624 EVENT_DFS_CAC_FINISHED,
5625
5626 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005627 * EVENT_DFS_CAC_ABORTED - Notify that channel availability check has been aborted
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005628 *
5629 * The CAC was not successful, and the channel remains in the previous
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08005630 * state. This may happen due to a radar being detected or other
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005631 * external influences.
5632 */
5633 EVENT_DFS_CAC_ABORTED,
5634
5635 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005636 * EVENT_DFS_NOP_FINISHED - Notify that non-occupancy period is over
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005637 *
5638 * The channel which was previously unavailable is now available again.
5639 */
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07005640 EVENT_DFS_NOP_FINISHED,
5641
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08005642 /**
5643 * EVENT_SURVEY - Received survey data
5644 *
5645 * This event gets triggered when a driver query is issued for survey
5646 * data and the requested data becomes available. The returned data is
5647 * stored in struct survey_results. The results provide at most one
5648 * survey entry for each frequency and at minimum will provide one
5649 * survey entry for one frequency. The survey data can be os_malloc()'d
5650 * and then os_free()'d, so the event callback must only copy data.
5651 */
5652 EVENT_SURVEY,
5653
5654 /**
5655 * EVENT_SCAN_STARTED - Scan started
5656 *
5657 * This indicates that driver has started a scan operation either based
5658 * on a request from wpa_supplicant/hostapd or from another application.
5659 * EVENT_SCAN_RESULTS is used to indicate when the scan has been
5660 * completed (either successfully or by getting cancelled).
5661 */
Dmitry Shmidtcf32e602014-01-28 10:57:39 -08005662 EVENT_SCAN_STARTED,
5663
5664 /**
5665 * EVENT_AVOID_FREQUENCIES - Received avoid frequency range
5666 *
5667 * This event indicates a set of frequency ranges that should be avoided
5668 * to reduce issues due to interference or internal co-existence
5669 * information in the driver.
5670 */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08005671 EVENT_AVOID_FREQUENCIES,
5672
5673 /**
5674 * EVENT_NEW_PEER_CANDIDATE - new (unknown) mesh peer notification
5675 */
5676 EVENT_NEW_PEER_CANDIDATE,
5677
5678 /**
5679 * EVENT_ACS_CHANNEL_SELECTED - Received selected channels by ACS
5680 *
5681 * Indicates a pair of primary and secondary channels chosen by ACS
5682 * in device.
5683 */
5684 EVENT_ACS_CHANNEL_SELECTED,
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005685
5686 /**
5687 * EVENT_DFS_CAC_STARTED - Notify that channel availability check has
5688 * been started.
5689 *
5690 * This event indicates that channel availability check has been started
5691 * on a DFS frequency by a driver that supports DFS Offload.
5692 */
5693 EVENT_DFS_CAC_STARTED,
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07005694
5695 /**
5696 * EVENT_P2P_LO_STOP - Notify that P2P listen offload is stopped
5697 */
5698 EVENT_P2P_LO_STOP,
Paul Stewart092955c2017-02-06 09:13:09 -08005699
5700 /**
5701 * EVENT_BEACON_LOSS - Beacon loss detected
5702 *
5703 * This event indicates that no Beacon frames has been received from
5704 * the current AP. This may indicate that the AP is not anymore in
5705 * range.
5706 */
5707 EVENT_BEACON_LOSS,
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005708
5709 /**
5710 * EVENT_DFS_PRE_CAC_EXPIRED - Notify that channel availability check
5711 * done previously (Pre-CAC) on the channel has expired. This would
5712 * normally be on a non-ETSI DFS regulatory domain. DFS state of the
5713 * channel will be moved from available to usable. A new CAC has to be
5714 * performed before start operating on this channel.
5715 */
5716 EVENT_DFS_PRE_CAC_EXPIRED,
Roshan Pius3a1667e2018-07-03 15:17:14 -07005717
5718 /**
5719 * EVENT_EXTERNAL_AUTH - This event interface is used by host drivers
5720 * that do not define separate commands for authentication and
5721 * association (~WPA_DRIVER_FLAGS_SME) but offload the 802.11
5722 * authentication to wpa_supplicant. This event carries all the
5723 * necessary information from the host driver for the authentication to
5724 * happen.
5725 */
5726 EVENT_EXTERNAL_AUTH,
5727
5728 /**
5729 * EVENT_PORT_AUTHORIZED - Notification that a connection is authorized
5730 *
5731 * This event should be indicated when the driver completes the 4-way
5732 * handshake. This event should be preceded by an EVENT_ASSOC that
5733 * indicates the completion of IEEE 802.11 association.
5734 */
5735 EVENT_PORT_AUTHORIZED,
5736
5737 /**
5738 * EVENT_STATION_OPMODE_CHANGED - Notify STA's HT/VHT operation mode
5739 * change event.
5740 */
5741 EVENT_STATION_OPMODE_CHANGED,
5742
5743 /**
5744 * EVENT_INTERFACE_MAC_CHANGED - Notify that interface MAC changed
5745 *
5746 * This event is emitted when the MAC changes while the interface is
5747 * enabled. When an interface was disabled and becomes enabled, it
5748 * must be always assumed that the MAC possibly changed.
5749 */
5750 EVENT_INTERFACE_MAC_CHANGED,
5751
5752 /**
5753 * EVENT_WDS_STA_INTERFACE_STATUS - Notify WDS STA interface status
5754 *
5755 * This event is emitted when an interface is added/removed for WDS STA.
5756 */
5757 EVENT_WDS_STA_INTERFACE_STATUS,
Hai Shalom81f62d82019-07-22 12:10:00 -07005758
5759 /**
5760 * EVENT_UPDATE_DH - Notification of updated DH information
5761 */
5762 EVENT_UPDATE_DH,
Hai Shalomfdcde762020-04-02 11:19:20 -07005763
5764 /**
5765 * EVENT_UNPROT_BEACON - Unprotected Beacon frame received
5766 *
5767 * This event should be called when a Beacon frame is dropped due to it
5768 * not being protected correctly. union wpa_event_data::unprot_beacon
5769 * is required to provide more details of the frame.
5770 */
5771 EVENT_UNPROT_BEACON,
Hai Shalomc1a21442022-02-04 13:43:00 -08005772
5773 /**
5774 * EVENT_TX_WAIT_EXPIRE - TX wait timed out
5775 *
5776 * This event is used to indicate when the driver has completed
5777 * wait for a response frame based on a TX request that specified a
5778 * non-zero wait time and that has not been explicitly cancelled.
5779 */
5780 EVENT_TX_WAIT_EXPIRE,
Sunil Ravia04bd252022-05-02 22:54:18 -07005781
5782 /**
5783 * EVENT_BSS_COLOR_COLLISION - Notification of a BSS color collision
5784 */
5785 EVENT_BSS_COLOR_COLLISION,
5786
5787 /**
5788 * EVENT_CCA_STARTED_NOTIFY - Notification that CCA has started
5789 */
5790 EVENT_CCA_STARTED_NOTIFY,
5791
5792 /**
5793 * EVENT_CCA_ABORTED_NOTIFY - Notification that CCA has aborted
5794 */
5795 EVENT_CCA_ABORTED_NOTIFY,
5796
5797 /**
5798 * EVENT_CCA_NOTIFY - Notification that CCA has completed
5799 */
5800 EVENT_CCA_NOTIFY,
Sunil Ravi89eba102022-09-13 21:04:37 -07005801
5802 /**
5803 * EVENT_PASN_AUTH - This event is used by the driver that requests
5804 * PASN authentication and secure ranging context for multiple peers.
5805 */
5806 EVENT_PASN_AUTH,
5807
5808 /**
5809 * EVENT_LINK_CH_SWITCH - MLD AP link decided to switch channels
5810 *
5811 * Described in wpa_event_data.ch_switch.
5812 *
5813 */
5814 EVENT_LINK_CH_SWITCH,
5815
5816 /**
5817 * EVENT_LINK_CH_SWITCH_STARTED - MLD AP link started to switch channels
5818 *
5819 * This is a pre-switch event indicating the shortly following switch
5820 * of operating channels.
5821 *
5822 * Described in wpa_event_data.ch_switch.
5823 */
5824 EVENT_LINK_CH_SWITCH_STARTED,
Sunil Ravi640215c2023-06-28 23:08:09 +00005825
5826 /**
5827 * EVENT_TID_LINK_MAP - MLD event to set TID-to-link mapping
5828 *
5829 * This event is used by the driver to indicate the received TID-to-link
5830 * mapping response from the associated AP MLD.
5831 *
5832 * Described in wpa_event_data.t2l_map_info.
5833 */
5834 EVENT_TID_LINK_MAP,
5835
5836 /**
5837 * EVENT_LINK_RECONFIG - Notification that AP links removed
5838 */
5839 EVENT_LINK_RECONFIG,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005840};
5841
5842
5843/**
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07005844 * struct freq_survey - Channel survey info
5845 *
5846 * @ifidx: Interface index in which this survey was observed
5847 * @freq: Center of frequency of the surveyed channel
5848 * @nf: Channel noise floor in dBm
5849 * @channel_time: Amount of time in ms the radio spent on the channel
5850 * @channel_time_busy: Amount of time in ms the radio detected some signal
5851 * that indicated to the radio the channel was not clear
5852 * @channel_time_rx: Amount of time the radio spent receiving data
5853 * @channel_time_tx: Amount of time the radio spent transmitting data
5854 * @filled: bitmask indicating which fields have been reported, see
5855 * SURVEY_HAS_* defines.
5856 * @list: Internal list pointers
5857 */
5858struct freq_survey {
5859 u32 ifidx;
5860 unsigned int freq;
5861 s8 nf;
5862 u64 channel_time;
5863 u64 channel_time_busy;
5864 u64 channel_time_rx;
5865 u64 channel_time_tx;
5866 unsigned int filled;
5867 struct dl_list list;
5868};
5869
5870#define SURVEY_HAS_NF BIT(0)
5871#define SURVEY_HAS_CHAN_TIME BIT(1)
5872#define SURVEY_HAS_CHAN_TIME_BUSY BIT(2)
5873#define SURVEY_HAS_CHAN_TIME_RX BIT(3)
5874#define SURVEY_HAS_CHAN_TIME_TX BIT(4)
5875
Hai Shalom60840252021-02-19 19:02:11 -08005876/**
5877 * enum sta_connect_fail_reason_codes - STA connect failure reason code values
5878 * @STA_CONNECT_FAIL_REASON_UNSPECIFIED: No reason code specified for
5879 * connection failure.
5880 * @STA_CONNECT_FAIL_REASON_NO_BSS_FOUND: No Probe Response frame received
5881 * for unicast Probe Request frame.
5882 * @STA_CONNECT_FAIL_REASON_AUTH_TX_FAIL: STA failed to send auth request.
5883 * @STA_CONNECT_FAIL_REASON_AUTH_NO_ACK_RECEIVED: AP didn't send ACK for
5884 * auth request.
5885 * @STA_CONNECT_FAIL_REASON_AUTH_NO_RESP_RECEIVED: Auth response is not
5886 * received from AP.
5887 * @STA_CONNECT_FAIL_REASON_ASSOC_REQ_TX_FAIL: STA failed to send
5888 * Association Request frame.
5889 * @STA_CONNECT_FAIL_REASON_ASSOC_NO_ACK_RECEIVED: AP didn't send ACK for
5890 * Association Request frame.
5891 * @STA_CONNECT_FAIL_REASON_ASSOC_NO_RESP_RECEIVED: Association Response
5892 * frame is not received from AP.
5893 */
5894enum sta_connect_fail_reason_codes {
5895 STA_CONNECT_FAIL_REASON_UNSPECIFIED = 0,
5896 STA_CONNECT_FAIL_REASON_NO_BSS_FOUND = 1,
5897 STA_CONNECT_FAIL_REASON_AUTH_TX_FAIL = 2,
5898 STA_CONNECT_FAIL_REASON_AUTH_NO_ACK_RECEIVED = 3,
5899 STA_CONNECT_FAIL_REASON_AUTH_NO_RESP_RECEIVED = 4,
5900 STA_CONNECT_FAIL_REASON_ASSOC_REQ_TX_FAIL = 5,
5901 STA_CONNECT_FAIL_REASON_ASSOC_NO_ACK_RECEIVED = 6,
5902 STA_CONNECT_FAIL_REASON_ASSOC_NO_RESP_RECEIVED = 7,
5903};
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07005904
5905/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005906 * union wpa_event_data - Additional data for wpa_supplicant_event() calls
5907 */
5908union wpa_event_data {
5909 /**
5910 * struct assoc_info - Data for EVENT_ASSOC and EVENT_ASSOCINFO events
5911 *
5912 * This structure is optional for EVENT_ASSOC calls and required for
5913 * EVENT_ASSOCINFO calls. By using EVENT_ASSOC with this data, the
5914 * driver interface does not need to generate separate EVENT_ASSOCINFO
5915 * calls.
5916 */
5917 struct assoc_info {
5918 /**
5919 * reassoc - Flag to indicate association or reassociation
5920 */
5921 int reassoc;
5922
5923 /**
5924 * req_ies - (Re)Association Request IEs
5925 *
5926 * If the driver generates WPA/RSN IE, this event data must be
5927 * returned for WPA handshake to have needed information. If
5928 * wpa_supplicant-generated WPA/RSN IE is used, this
5929 * information event is optional.
5930 *
5931 * This should start with the first IE (fixed fields before IEs
5932 * are not included).
5933 */
5934 const u8 *req_ies;
5935
5936 /**
5937 * req_ies_len - Length of req_ies in bytes
5938 */
5939 size_t req_ies_len;
5940
5941 /**
5942 * resp_ies - (Re)Association Response IEs
5943 *
5944 * Optional association data from the driver. This data is not
5945 * required WPA, but may be useful for some protocols and as
5946 * such, should be reported if this is available to the driver
5947 * interface.
5948 *
5949 * This should start with the first IE (fixed fields before IEs
5950 * are not included).
5951 */
5952 const u8 *resp_ies;
5953
5954 /**
5955 * resp_ies_len - Length of resp_ies in bytes
5956 */
5957 size_t resp_ies_len;
5958
5959 /**
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08005960 * resp_frame - (Re)Association Response frame
5961 */
5962 const u8 *resp_frame;
5963
5964 /**
5965 * resp_frame_len - (Re)Association Response frame length
5966 */
5967 size_t resp_frame_len;
5968
5969 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005970 * beacon_ies - Beacon or Probe Response IEs
5971 *
5972 * Optional Beacon/ProbeResp data: IEs included in Beacon or
5973 * Probe Response frames from the current AP (i.e., the one
5974 * that the client just associated with). This information is
5975 * used to update WPA/RSN IE for the AP. If this field is not
5976 * set, the results from previous scan will be used. If no
5977 * data for the new AP is found, scan results will be requested
5978 * again (without scan request). At this point, the driver is
5979 * expected to provide WPA/RSN IE for the AP (if WPA/WPA2 is
5980 * used).
5981 *
5982 * This should start with the first IE (fixed fields before IEs
5983 * are not included).
5984 */
5985 const u8 *beacon_ies;
5986
5987 /**
5988 * beacon_ies_len - Length of beacon_ies */
5989 size_t beacon_ies_len;
5990
5991 /**
5992 * freq - Frequency of the operational channel in MHz
5993 */
5994 unsigned int freq;
5995
5996 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08005997 * wmm_params - WMM parameters used in this association.
5998 */
5999 struct wmm_params wmm_params;
6000
6001 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006002 * addr - Station address (for AP mode)
6003 */
6004 const u8 *addr;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006005
6006 /**
6007 * The following is the key management offload information
6008 * @authorized
6009 * @key_replay_ctr
6010 * @key_replay_ctr_len
6011 * @ptk_kck
6012 * @ptk_kek_len
6013 * @ptk_kek
6014 * @ptk_kek_len
6015 */
6016
6017 /**
6018 * authorized - Status of key management offload,
6019 * 1 = successful
6020 */
6021 int authorized;
6022
6023 /**
6024 * key_replay_ctr - Key replay counter value last used
6025 * in a valid EAPOL-Key frame
6026 */
6027 const u8 *key_replay_ctr;
6028
6029 /**
6030 * key_replay_ctr_len - The length of key_replay_ctr
6031 */
6032 size_t key_replay_ctr_len;
6033
6034 /**
6035 * ptk_kck - The derived PTK KCK
6036 */
6037 const u8 *ptk_kck;
6038
6039 /**
6040 * ptk_kek_len - The length of ptk_kck
6041 */
6042 size_t ptk_kck_len;
6043
6044 /**
6045 * ptk_kek - The derived PTK KEK
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07006046 * This is used in key management offload and also in FILS SK
6047 * offload.
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006048 */
6049 const u8 *ptk_kek;
6050
6051 /**
6052 * ptk_kek_len - The length of ptk_kek
6053 */
6054 size_t ptk_kek_len;
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08006055
6056 /**
6057 * subnet_status - The subnet status:
6058 * 0 = unknown, 1 = unchanged, 2 = changed
6059 */
6060 u8 subnet_status;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07006061
6062 /**
6063 * The following information is used in FILS SK offload
6064 * @fils_erp_next_seq_num
6065 * @fils_pmk
6066 * @fils_pmk_len
6067 * @fils_pmkid
6068 */
6069
6070 /**
6071 * fils_erp_next_seq_num - The next sequence number to use in
6072 * FILS ERP messages
6073 */
6074 u16 fils_erp_next_seq_num;
6075
6076 /**
6077 * fils_pmk - A new PMK if generated in case of FILS
6078 * authentication
6079 */
6080 const u8 *fils_pmk;
6081
6082 /**
6083 * fils_pmk_len - Length of fils_pmk
6084 */
6085 size_t fils_pmk_len;
6086
6087 /**
6088 * fils_pmkid - PMKID used or generated in FILS authentication
6089 */
6090 const u8 *fils_pmkid;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006091
6092 /**
6093 * link_addr - Link address of the STA
6094 */
6095 const u8 *link_addr;
6096
6097 /**
6098 * assoc_link_id - Association link id of the MLO association or
6099 * -1 if MLO is not used
6100 */
6101 int assoc_link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006102 } assoc_info;
6103
6104 /**
6105 * struct disassoc_info - Data for EVENT_DISASSOC events
6106 */
6107 struct disassoc_info {
6108 /**
6109 * addr - Station address (for AP mode)
6110 */
6111 const u8 *addr;
6112
6113 /**
6114 * reason_code - Reason Code (host byte order) used in
6115 * Deauthentication frame
6116 */
6117 u16 reason_code;
6118
6119 /**
6120 * ie - Optional IE(s) in Disassociation frame
6121 */
6122 const u8 *ie;
6123
6124 /**
6125 * ie_len - Length of ie buffer in octets
6126 */
6127 size_t ie_len;
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08006128
6129 /**
6130 * locally_generated - Whether the frame was locally generated
6131 */
6132 int locally_generated;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006133 } disassoc_info;
6134
6135 /**
6136 * struct deauth_info - Data for EVENT_DEAUTH events
6137 */
6138 struct deauth_info {
6139 /**
6140 * addr - Station address (for AP mode)
6141 */
6142 const u8 *addr;
6143
6144 /**
6145 * reason_code - Reason Code (host byte order) used in
6146 * Deauthentication frame
6147 */
6148 u16 reason_code;
6149
6150 /**
6151 * ie - Optional IE(s) in Deauthentication frame
6152 */
6153 const u8 *ie;
6154
6155 /**
6156 * ie_len - Length of ie buffer in octets
6157 */
6158 size_t ie_len;
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08006159
6160 /**
6161 * locally_generated - Whether the frame was locally generated
6162 */
6163 int locally_generated;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006164 } deauth_info;
6165
6166 /**
6167 * struct michael_mic_failure - Data for EVENT_MICHAEL_MIC_FAILURE
6168 */
6169 struct michael_mic_failure {
6170 int unicast;
6171 const u8 *src;
6172 } michael_mic_failure;
6173
6174 /**
6175 * struct interface_status - Data for EVENT_INTERFACE_STATUS
6176 */
6177 struct interface_status {
Dmitry Shmidte4663042016-04-04 10:07:49 -07006178 unsigned int ifindex;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006179 char ifname[100];
6180 enum {
6181 EVENT_INTERFACE_ADDED, EVENT_INTERFACE_REMOVED
6182 } ievent;
6183 } interface_status;
6184
6185 /**
6186 * struct pmkid_candidate - Data for EVENT_PMKID_CANDIDATE
6187 */
6188 struct pmkid_candidate {
6189 /** BSSID of the PMKID candidate */
6190 u8 bssid[ETH_ALEN];
6191 /** Smaller the index, higher the priority */
6192 int index;
6193 /** Whether RSN IE includes pre-authenticate flag */
6194 int preauth;
6195 } pmkid_candidate;
6196
6197 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006198 * struct tdls - Data for EVENT_TDLS
6199 */
6200 struct tdls {
6201 u8 peer[ETH_ALEN];
6202 enum {
6203 TDLS_REQUEST_SETUP,
Dmitry Shmidt4dd28dc2015-03-10 11:21:43 -07006204 TDLS_REQUEST_TEARDOWN,
6205 TDLS_REQUEST_DISCOVER,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006206 } oper;
6207 u16 reason_code; /* for teardown */
6208 } tdls;
6209
6210 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07006211 * struct wnm - Data for EVENT_WNM
6212 */
6213 struct wnm {
6214 u8 addr[ETH_ALEN];
6215 enum {
6216 WNM_OPER_SLEEP,
6217 } oper;
6218 enum {
6219 WNM_SLEEP_ENTER,
6220 WNM_SLEEP_EXIT
6221 } sleep_action;
6222 int sleep_intval;
6223 u16 reason_code;
6224 u8 *buf;
6225 u16 buf_len;
6226 } wnm;
6227
6228 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006229 * struct ft_ies - FT information elements (EVENT_FT_RESPONSE)
6230 *
6231 * During FT (IEEE 802.11r) authentication sequence, the driver is
6232 * expected to use this event to report received FT IEs (MDIE, FTIE,
6233 * RSN IE, TIE, possible resource request) to the supplicant. The FT
6234 * IEs for the next message will be delivered through the
6235 * struct wpa_driver_ops::update_ft_ies() callback.
6236 */
6237 struct ft_ies {
6238 const u8 *ies;
6239 size_t ies_len;
6240 int ft_action;
6241 u8 target_ap[ETH_ALEN];
6242 /** Optional IE(s), e.g., WMM TSPEC(s), for RIC-Request */
6243 const u8 *ric_ies;
6244 /** Length of ric_ies buffer in octets */
6245 size_t ric_ies_len;
6246 } ft_ies;
6247
6248 /**
6249 * struct ibss_rsn_start - Data for EVENT_IBSS_RSN_START
6250 */
6251 struct ibss_rsn_start {
6252 u8 peer[ETH_ALEN];
6253 } ibss_rsn_start;
6254
6255 /**
6256 * struct auth_info - Data for EVENT_AUTH events
6257 */
6258 struct auth_info {
6259 u8 peer[ETH_ALEN];
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006260 u8 bssid[ETH_ALEN];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006261 u16 auth_type;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006262 u16 auth_transaction;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006263 u16 status_code;
6264 const u8 *ies;
6265 size_t ies_len;
6266 } auth;
6267
6268 /**
6269 * struct assoc_reject - Data for EVENT_ASSOC_REJECT events
6270 */
6271 struct assoc_reject {
6272 /**
6273 * bssid - BSSID of the AP that rejected association
6274 */
6275 const u8 *bssid;
6276
6277 /**
6278 * resp_ies - (Re)Association Response IEs
6279 *
6280 * Optional association data from the driver. This data is not
6281 * required WPA, but may be useful for some protocols and as
6282 * such, should be reported if this is available to the driver
6283 * interface.
6284 *
6285 * This should start with the first IE (fixed fields before IEs
6286 * are not included).
6287 */
6288 const u8 *resp_ies;
6289
6290 /**
6291 * resp_ies_len - Length of resp_ies in bytes
6292 */
6293 size_t resp_ies_len;
6294
6295 /**
6296 * status_code - Status Code from (Re)association Response
6297 */
6298 u16 status_code;
Dmitry Shmidtd5ab1b52016-06-21 12:38:41 -07006299
6300 /**
6301 * timed_out - Whether failure is due to timeout (etc.) rather
6302 * than explicit rejection response from the AP.
6303 */
6304 int timed_out;
Dmitry Shmidtebd93af2017-02-21 13:40:44 -08006305
6306 /**
6307 * timeout_reason - Reason for the timeout
6308 */
6309 const char *timeout_reason;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07006310
6311 /**
6312 * fils_erp_next_seq_num - The next sequence number to use in
6313 * FILS ERP messages
6314 */
6315 u16 fils_erp_next_seq_num;
Hai Shalom60840252021-02-19 19:02:11 -08006316
6317 /**
6318 * reason_code - Connection failure reason code from the driver
6319 */
6320 enum sta_connect_fail_reason_codes reason_code;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006321 } assoc_reject;
6322
6323 struct timeout_event {
6324 u8 addr[ETH_ALEN];
6325 } timeout_event;
6326
6327 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006328 * struct tx_status - Data for EVENT_TX_STATUS events
6329 */
6330 struct tx_status {
6331 u16 type;
6332 u16 stype;
6333 const u8 *dst;
6334 const u8 *data;
6335 size_t data_len;
6336 int ack;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006337 int link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006338 } tx_status;
6339
6340 /**
6341 * struct rx_from_unknown - Data for EVENT_RX_FROM_UNKNOWN events
6342 */
6343 struct rx_from_unknown {
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006344 const u8 *bssid;
6345 const u8 *addr;
6346 int wds;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006347 } rx_from_unknown;
6348
6349 /**
6350 * struct rx_mgmt - Data for EVENT_RX_MGMT events
6351 */
6352 struct rx_mgmt {
6353 const u8 *frame;
6354 size_t frame_len;
6355 u32 datarate;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006356
6357 /**
Dmitry Shmidt98660862014-03-11 17:26:21 -07006358 * drv_priv - Pointer to store driver private BSS information
6359 *
6360 * If not set to NULL, this is used for comparison with
6361 * hostapd_data->drv_priv to determine which BSS should process
6362 * the frame.
6363 */
6364 void *drv_priv;
6365
6366 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006367 * freq - Frequency (in MHz) on which the frame was received
6368 */
6369 int freq;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08006370
6371 /**
6372 * ssi_signal - Signal strength in dBm (or 0 if not available)
6373 */
6374 int ssi_signal;
Sunil Ravi036cec52023-03-29 11:35:17 -07006375
6376 /**
6377 * link_id - MLO link on which the frame was received or -1 for
6378 * non MLD.
6379 */
6380 int link_id;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08006381 } rx_mgmt;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006382
6383 /**
6384 * struct remain_on_channel - Data for EVENT_REMAIN_ON_CHANNEL events
6385 *
6386 * This is also used with EVENT_CANCEL_REMAIN_ON_CHANNEL events.
6387 */
6388 struct remain_on_channel {
6389 /**
6390 * freq - Channel frequency in MHz
6391 */
6392 unsigned int freq;
6393
6394 /**
6395 * duration - Duration to remain on the channel in milliseconds
6396 */
6397 unsigned int duration;
6398 } remain_on_channel;
6399
6400 /**
6401 * struct scan_info - Optional data for EVENT_SCAN_RESULTS events
6402 * @aborted: Whether the scan was aborted
6403 * @freqs: Scanned frequencies in MHz (%NULL = all channels scanned)
6404 * @num_freqs: Number of entries in freqs array
6405 * @ssids: Scanned SSIDs (%NULL or zero-length SSID indicates wildcard
6406 * SSID)
6407 * @num_ssids: Number of entries in ssids array
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08006408 * @external_scan: Whether the scan info is for an external scan
6409 * @nl_scan_event: 1 if the source of this scan event is a normal scan,
6410 * 0 if the source of the scan event is a vendor scan
Dmitry Shmidt29333592017-01-09 12:27:11 -08006411 * @scan_start_tsf: Time when the scan started in terms of TSF of the
6412 * BSS that the interface that requested the scan is connected to
6413 * (if available).
6414 * @scan_start_tsf_bssid: The BSSID according to which %scan_start_tsf
6415 * is set.
Sunil Ravi99c035e2024-07-12 01:42:03 +00006416 * @scan_cookie: Unique identification representing the corresponding
6417 * scan request. 0 if no unique identification is available.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006418 */
6419 struct scan_info {
6420 int aborted;
6421 const int *freqs;
6422 size_t num_freqs;
6423 struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS];
6424 size_t num_ssids;
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08006425 int external_scan;
6426 int nl_scan_event;
Dmitry Shmidt29333592017-01-09 12:27:11 -08006427 u64 scan_start_tsf;
6428 u8 scan_start_tsf_bssid[ETH_ALEN];
Sunil Ravi99c035e2024-07-12 01:42:03 +00006429 u64 scan_cookie;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006430 } scan_info;
6431
6432 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006433 * struct rx_probe_req - Data for EVENT_RX_PROBE_REQ events
6434 */
6435 struct rx_probe_req {
6436 /**
6437 * sa - Source address of the received Probe Request frame
6438 */
6439 const u8 *sa;
6440
6441 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006442 * da - Destination address of the received Probe Request frame
6443 * or %NULL if not available
6444 */
6445 const u8 *da;
6446
6447 /**
6448 * bssid - BSSID of the received Probe Request frame or %NULL
6449 * if not available
6450 */
6451 const u8 *bssid;
6452
6453 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006454 * ie - IEs from the Probe Request body
6455 */
6456 const u8 *ie;
6457
6458 /**
6459 * ie_len - Length of ie buffer in octets
6460 */
6461 size_t ie_len;
Dmitry Shmidt04949592012-07-19 12:16:46 -07006462
6463 /**
6464 * signal - signal strength in dBm (or 0 if not available)
6465 */
6466 int ssi_signal;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006467 } rx_probe_req;
6468
6469 /**
6470 * struct new_sta - Data for EVENT_NEW_STA events
6471 */
6472 struct new_sta {
6473 const u8 *addr;
6474 } new_sta;
6475
6476 /**
6477 * struct eapol_rx - Data for EVENT_EAPOL_RX events
6478 */
6479 struct eapol_rx {
6480 const u8 *src;
6481 const u8 *data;
6482 size_t data_len;
Sunil8cd6f4d2022-06-28 18:40:46 +00006483 enum frame_encryption encrypted;
Sunil Ravi036cec52023-03-29 11:35:17 -07006484 int link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006485 } eapol_rx;
6486
6487 /**
6488 * signal_change - Data for EVENT_SIGNAL_CHANGE events
6489 */
6490 struct wpa_signal_info signal_change;
6491
6492 /**
6493 * struct best_channel - Data for EVENT_BEST_CHANNEL events
6494 * @freq_24: Best 2.4 GHz band channel frequency in MHz
6495 * @freq_5: Best 5 GHz band channel frequency in MHz
6496 * @freq_overall: Best channel frequency in MHz
6497 *
6498 * 0 can be used to indicate no preference in either band.
6499 */
6500 struct best_channel {
6501 int freq_24;
6502 int freq_5;
6503 int freq_overall;
6504 } best_chan;
6505
6506 struct unprot_deauth {
6507 const u8 *sa;
6508 const u8 *da;
6509 u16 reason_code;
6510 } unprot_deauth;
6511
6512 struct unprot_disassoc {
6513 const u8 *sa;
6514 const u8 *da;
6515 u16 reason_code;
6516 } unprot_disassoc;
6517
6518 /**
6519 * struct low_ack - Data for EVENT_STATION_LOW_ACK events
6520 * @addr: station address
Paul Stewart092955c2017-02-06 09:13:09 -08006521 * @num_packets: Number of packets lost (consecutive packets not
6522 * acknowledged)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006523 */
6524 struct low_ack {
6525 u8 addr[ETH_ALEN];
Paul Stewart092955c2017-02-06 09:13:09 -08006526 u32 num_packets;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006527 } low_ack;
6528
6529 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006530 * struct ibss_peer_lost - Data for EVENT_IBSS_PEER_LOST
6531 */
6532 struct ibss_peer_lost {
6533 u8 peer[ETH_ALEN];
6534 } ibss_peer_lost;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006535
6536 /**
6537 * struct driver_gtk_rekey - Data for EVENT_DRIVER_GTK_REKEY
6538 */
6539 struct driver_gtk_rekey {
6540 const u8 *bssid;
6541 const u8 *replay_ctr;
6542 } driver_gtk_rekey;
6543
6544 /**
6545 * struct client_poll - Data for EVENT_DRIVER_CLIENT_POLL_OK events
6546 * @addr: station address
6547 */
6548 struct client_poll {
6549 u8 addr[ETH_ALEN];
6550 } client_poll;
6551
6552 /**
6553 * struct eapol_tx_status
6554 * @dst: Original destination
6555 * @data: Data starting with IEEE 802.1X header (!)
6556 * @data_len: Length of data
6557 * @ack: Indicates ack or lost frame
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006558 * @link_id: MLD link id used to transmit the frame or -1 for non MLO
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006559 *
6560 * This corresponds to hapd_send_eapol if the frame sent
6561 * there isn't just reported as EVENT_TX_STATUS.
6562 */
6563 struct eapol_tx_status {
6564 const u8 *dst;
6565 const u8 *data;
6566 int data_len;
6567 int ack;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006568 int link_id;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006569 } eapol_tx_status;
Dmitry Shmidt04949592012-07-19 12:16:46 -07006570
6571 /**
6572 * struct ch_switch
6573 * @freq: Frequency of new channel in MHz
6574 * @ht_enabled: Whether this is an HT channel
6575 * @ch_offset: Secondary channel offset
Dmitry Shmidt04f534e2013-12-09 15:50:16 -08006576 * @ch_width: Channel width
6577 * @cf1: Center frequency 1
6578 * @cf2: Center frequency 2
Sunil Ravi89eba102022-09-13 21:04:37 -07006579 * @link_id: Link ID of the MLO link
Sunil Ravi036cec52023-03-29 11:35:17 -07006580 * @punct_bitmap: Puncturing bitmap
Dmitry Shmidt04949592012-07-19 12:16:46 -07006581 */
6582 struct ch_switch {
6583 int freq;
6584 int ht_enabled;
6585 int ch_offset;
Dmitry Shmidt04f534e2013-12-09 15:50:16 -08006586 enum chan_width ch_width;
6587 int cf1;
6588 int cf2;
Sunil Ravi89eba102022-09-13 21:04:37 -07006589 int link_id;
Sunil Ravi036cec52023-03-29 11:35:17 -07006590 u16 punct_bitmap;
Dmitry Shmidt04949592012-07-19 12:16:46 -07006591 } ch_switch;
Dmitry Shmidtf8623282013-02-20 14:34:59 -08006592
6593 /**
6594 * struct connect_failed - Data for EVENT_CONNECT_FAILED_REASON
6595 * @addr: Remote client address
6596 * @code: Reason code for connection failure
6597 */
6598 struct connect_failed_reason {
6599 u8 addr[ETH_ALEN];
6600 enum {
6601 MAX_CLIENT_REACHED,
6602 BLOCKED_CLIENT
6603 } code;
6604 } connect_failed_reason;
Dmitry Shmidtea69e842013-05-13 14:52:28 -07006605
6606 /**
6607 * struct dfs_event - Data for radar detected events
6608 * @freq: Frequency of the channel in MHz
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006609 * @link_id: If >= 0, Link ID of the MLO link
Dmitry Shmidtea69e842013-05-13 14:52:28 -07006610 */
6611 struct dfs_event {
6612 int freq;
Dmitry Shmidt051af732013-10-22 13:52:46 -07006613 int ht_enabled;
6614 int chan_offset;
6615 enum chan_width chan_width;
6616 int cf1;
6617 int cf2;
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006618 int link_id;
Dmitry Shmidtea69e842013-05-13 14:52:28 -07006619 } dfs_event;
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07006620
6621 /**
6622 * survey_results - Survey result data for EVENT_SURVEY
6623 * @freq_filter: Requested frequency survey filter, 0 if request
6624 * was for all survey data
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006625 * @survey_list: Linked list of survey data (struct freq_survey)
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07006626 */
6627 struct survey_results {
6628 unsigned int freq_filter;
6629 struct dl_list survey_list; /* struct freq_survey */
6630 } survey_results;
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08006631
6632 /**
6633 * channel_list_changed - Data for EVENT_CHANNEL_LIST_CHANGED
6634 * @initiator: Initiator of the regulatory change
Dmitry Shmidt7dba0e52014-04-14 10:49:15 -07006635 * @type: Regulatory change type
6636 * @alpha2: Country code (or "" if not available)
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006637 * @beacon_hint_before: Data for frequency attributes before beacon hint
6638 * event if initiator == REGDOM_BEACON_HINT
6639 * @beacon_hint_after: Data for frequency attributes after beacon hint
6640 * event if initiator == REGDOM_BEACON_HINT
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08006641 */
6642 struct channel_list_changed {
6643 enum reg_change_initiator initiator;
Dmitry Shmidt7dba0e52014-04-14 10:49:15 -07006644 enum reg_type type;
6645 char alpha2[3];
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006646 struct frequency_attrs {
6647 unsigned int freq;
6648 unsigned int max_tx_power;
6649 bool disabled;
6650 bool no_ir;
6651 bool radar;
6652 } beacon_hint_before, beacon_hint_after;
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08006653 } channel_list_changed;
Dmitry Shmidtcf32e602014-01-28 10:57:39 -08006654
6655 /**
6656 * freq_range - List of frequency ranges
6657 *
6658 * This is used as the data with EVENT_AVOID_FREQUENCIES.
6659 */
6660 struct wpa_freq_range_list freq_range;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006661
6662 /**
6663 * struct mesh_peer
6664 *
6665 * @peer: Peer address
6666 * @ies: Beacon IEs
6667 * @ie_len: Length of @ies
6668 *
6669 * Notification of new candidate mesh peer.
6670 */
6671 struct mesh_peer {
6672 const u8 *peer;
6673 const u8 *ies;
6674 size_t ie_len;
6675 } mesh_peer;
6676
6677 /**
6678 * struct acs_selected_channels - Data for EVENT_ACS_CHANNEL_SELECTED
Ahmed ElArabawy0ff61c52019-12-26 12:38:39 -08006679 * @pri_freq: Selected primary frequency
6680 * @sec_freq: Selected secondary frequency
Hai Shalomfdcde762020-04-02 11:19:20 -07006681 * @edmg_channel: Selected EDMG channel
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006682 * @vht_seg0_center_ch: VHT mode Segment0 center channel
Hai Shalomfdcde762020-04-02 11:19:20 -07006683 * The value is the index of the channel center frequency for
6684 * 20 MHz, 40 MHz, and 80 MHz channels. The value is the center
6685 * frequency index of the primary 80 MHz segment for 160 MHz and
6686 * 80+80 MHz channels.
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006687 * @vht_seg1_center_ch: VHT mode Segment1 center channel
Hai Shalomfdcde762020-04-02 11:19:20 -07006688 * The value is zero for 20 MHz, 40 MHz, and 80 MHz channels. The
6689 * value is the index of the channel center frequency for 160 MHz
6690 * channels and the center frequency index of the secondary 80 MHz
6691 * segment for 80+80 MHz channels.
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006692 * @ch_width: Selected Channel width by driver. Driver may choose to
6693 * change hostapd configured ACS channel width due driver internal
6694 * channel restrictions.
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006695 * @hw_mode: Selected band (used with hw_mode=any)
6696 * @puncture_bitmap: Indicate the puncturing channels
6697 * @link_id: Indicate the link id if operating as AP MLD; -1 otherwise
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006698 */
6699 struct acs_selected_channels {
Ahmed ElArabawy0ff61c52019-12-26 12:38:39 -08006700 unsigned int pri_freq;
6701 unsigned int sec_freq;
Hai Shalomfdcde762020-04-02 11:19:20 -07006702 u8 edmg_channel;
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006703 u8 vht_seg0_center_ch;
6704 u8 vht_seg1_center_ch;
6705 u16 ch_width;
Dmitry Shmidtb1e52102015-05-29 12:36:29 -07006706 enum hostapd_hw_mode hw_mode;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006707 u16 puncture_bitmap;
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006708 int link_id;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006709 } acs_selected_channels;
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07006710
6711 /**
6712 * struct p2p_lo_stop - Reason code for P2P Listen offload stop event
6713 * @reason_code: Reason for stopping offload
6714 * P2P_LO_STOPPED_REASON_COMPLETE: Listen offload finished as
6715 * scheduled.
6716 * P2P_LO_STOPPED_REASON_RECV_STOP_CMD: Host requested offload to
6717 * be stopped.
6718 * P2P_LO_STOPPED_REASON_INVALID_PARAM: Invalid listen offload
6719 * parameters.
6720 * P2P_LO_STOPPED_REASON_NOT_SUPPORTED: Listen offload not
6721 * supported by device.
6722 */
6723 struct p2p_lo_stop {
6724 enum {
6725 P2P_LO_STOPPED_REASON_COMPLETE = 0,
6726 P2P_LO_STOPPED_REASON_RECV_STOP_CMD,
6727 P2P_LO_STOPPED_REASON_INVALID_PARAM,
6728 P2P_LO_STOPPED_REASON_NOT_SUPPORTED,
6729 } reason_code;
6730 } p2p_lo_stop;
Roshan Pius3a1667e2018-07-03 15:17:14 -07006731
6732 /* For EVENT_EXTERNAL_AUTH */
6733 struct external_auth external_auth;
6734
6735 /**
6736 * struct sta_opmode - Station's operation mode change event
6737 * @addr: The station MAC address
6738 * @smps_mode: SMPS mode of the station
6739 * @chan_width: Channel width of the station
6740 * @rx_nss: RX_NSS of the station
6741 *
6742 * This is used as data with EVENT_STATION_OPMODE_CHANGED.
6743 */
6744 struct sta_opmode {
6745 const u8 *addr;
6746 enum smps_mode smps_mode;
6747 enum chan_width chan_width;
6748 u8 rx_nss;
6749 } sta_opmode;
6750
6751 /**
6752 * struct wds_sta_interface - Data for EVENT_WDS_STA_INTERFACE_STATUS.
6753 */
6754 struct wds_sta_interface {
6755 const u8 *sta_addr;
6756 const char *ifname;
6757 enum {
6758 INTERFACE_ADDED,
6759 INTERFACE_REMOVED
6760 } istatus;
6761 } wds_sta_interface;
Hai Shalom81f62d82019-07-22 12:10:00 -07006762
6763 /**
6764 * struct update_dh - Data for EVENT_UPDATE_DH
6765 */
6766 struct update_dh {
6767 const u8 *peer;
6768 const u8 *ie;
6769 size_t ie_len;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006770 int assoc_link_id;
6771 const u8 *link_addr;
Hai Shalom81f62d82019-07-22 12:10:00 -07006772 } update_dh;
Hai Shalomfdcde762020-04-02 11:19:20 -07006773
6774 /**
6775 * struct unprot_beacon - Data for EVENT_UNPROT_BEACON
6776 */
6777 struct unprot_beacon {
6778 const u8 *sa;
6779 } unprot_beacon;
Sunil Ravia04bd252022-05-02 22:54:18 -07006780
6781 /**
6782 * struct bss_color_collision - Data for EVENT_BSS_COLOR_COLLISION
6783 */
6784 struct bss_color_collision {
6785 u64 bitmap;
6786 } bss_color_collision;
Sunil Ravi89eba102022-09-13 21:04:37 -07006787
6788 /**
6789 * struct pasn_auth - Data for EVENT_PASN_AUTH
6790 */
6791 struct pasn_auth pasn_auth;
6792
Sunil Ravi77d572f2023-01-17 23:58:31 +00006793 /**
6794 * struct port_authorized - Data for EVENT_PORT_AUTHORIZED
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006795 * @td_bitmap: For STA mode, transition disable bitmap, if received in
6796 * EAPOL-Key msg 3/4
6797 * @td_bitmap_len: For STA mode, length of td_bitmap
6798 * @sta_addr: For AP mode, the MAC address of the associated STA
6799 *
6800 * This event is used to indicate that the port is authorized and
6801 * open for normal data in STA and AP modes when 4-way handshake is
6802 * offloaded to the driver.
Sunil Ravi77d572f2023-01-17 23:58:31 +00006803 */
6804 struct port_authorized {
6805 const u8 *td_bitmap;
6806 size_t td_bitmap_len;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006807 const u8 *sta_addr;
Sunil Ravi77d572f2023-01-17 23:58:31 +00006808 } port_authorized;
Sunil Ravi640215c2023-06-28 23:08:09 +00006809
6810 /**
6811 * struct tid_link_map_info - Data for EVENT_TID_LINK_MAP
6812 */
6813 struct tid_link_map_info {
6814 bool default_map;
6815 u8 valid_links;
6816 struct t2lm_mapping t2lmap[MAX_NUM_MLD_LINKS];
6817 } t2l_map_info;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006818};
6819
6820/**
6821 * wpa_supplicant_event - Report a driver event for wpa_supplicant
6822 * @ctx: Context pointer (wpa_s); this is the ctx variable registered
6823 * with struct wpa_driver_ops::init()
6824 * @event: event type (defined above)
6825 * @data: possible extra data for the event
6826 *
6827 * Driver wrapper code should call this function whenever an event is received
6828 * from the driver.
6829 */
6830void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
6831 union wpa_event_data *data);
6832
Dmitry Shmidte4663042016-04-04 10:07:49 -07006833/**
6834 * wpa_supplicant_event_global - Report a driver event for wpa_supplicant
6835 * @ctx: Context pointer (wpa_s); this is the ctx variable registered
6836 * with struct wpa_driver_ops::init()
6837 * @event: event type (defined above)
6838 * @data: possible extra data for the event
6839 *
6840 * Same as wpa_supplicant_event(), but we search for the interface in
6841 * wpa_global.
6842 */
6843void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
6844 union wpa_event_data *data);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006845
6846/*
6847 * The following inline functions are provided for convenience to simplify
6848 * event indication for some of the common events.
6849 */
6850
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006851static inline void drv_event_assoc(void *ctx, const u8 *addr, const u8 *req_ies,
6852 size_t req_ielen, const u8 *resp_ies,
6853 size_t resp_ielen, const u8 *link_addr,
6854 int assoc_link_id, int reassoc)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006855{
6856 union wpa_event_data event;
6857 os_memset(&event, 0, sizeof(event));
6858 event.assoc_info.reassoc = reassoc;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006859 event.assoc_info.req_ies = req_ies;
6860 event.assoc_info.req_ies_len = req_ielen;
6861 event.assoc_info.resp_ies = resp_ies;
6862 event.assoc_info.resp_ies_len = resp_ielen;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006863 event.assoc_info.addr = addr;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006864 event.assoc_info.link_addr = link_addr;
6865 event.assoc_info.assoc_link_id = assoc_link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006866 wpa_supplicant_event(ctx, EVENT_ASSOC, &event);
6867}
6868
6869static inline void drv_event_disassoc(void *ctx, const u8 *addr)
6870{
6871 union wpa_event_data event;
6872 os_memset(&event, 0, sizeof(event));
6873 event.disassoc_info.addr = addr;
6874 wpa_supplicant_event(ctx, EVENT_DISASSOC, &event);
6875}
6876
6877static inline void drv_event_eapol_rx(void *ctx, const u8 *src, const u8 *data,
6878 size_t data_len)
6879{
6880 union wpa_event_data event;
6881 os_memset(&event, 0, sizeof(event));
6882 event.eapol_rx.src = src;
6883 event.eapol_rx.data = data;
6884 event.eapol_rx.data_len = data_len;
Sunil8cd6f4d2022-06-28 18:40:46 +00006885 event.eapol_rx.encrypted = FRAME_ENCRYPTION_UNKNOWN;
Sunil Ravi036cec52023-03-29 11:35:17 -07006886 event.eapol_rx.link_id = -1;
Sunil8cd6f4d2022-06-28 18:40:46 +00006887 wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event);
6888}
6889
6890static inline void drv_event_eapol_rx2(void *ctx, const u8 *src, const u8 *data,
Sunil Ravi036cec52023-03-29 11:35:17 -07006891 size_t data_len,
6892 enum frame_encryption encrypted,
6893 int link_id)
Sunil8cd6f4d2022-06-28 18:40:46 +00006894{
6895 union wpa_event_data event;
6896 os_memset(&event, 0, sizeof(event));
6897 event.eapol_rx.src = src;
6898 event.eapol_rx.data = data;
6899 event.eapol_rx.data_len = data_len;
6900 event.eapol_rx.encrypted = encrypted;
Sunil Ravi036cec52023-03-29 11:35:17 -07006901 event.eapol_rx.link_id = link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006902 wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event);
6903}
6904
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006905/* driver_common.c */
6906void wpa_scan_results_free(struct wpa_scan_results *res);
6907
6908/* Convert wpa_event_type to a string for logging */
6909const char * event_to_string(enum wpa_event_type event);
6910
Dmitry Shmidt661b4f72014-09-29 14:58:27 -07006911/* Convert chan_width to a string for logging and control interfaces */
6912const char * channel_width_to_string(enum chan_width width);
6913
Hai Shalom74f70d42019-02-11 14:42:39 -08006914int channel_width_to_int(enum chan_width width);
6915
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006916int ht_supported(const struct hostapd_hw_modes *mode);
6917int vht_supported(const struct hostapd_hw_modes *mode);
Sunil Ravi77d572f2023-01-17 23:58:31 +00006918bool he_supported(const struct hostapd_hw_modes *hw_mode,
6919 enum ieee80211_op_mode op_mode);
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006920
6921struct wowlan_triggers *
6922wpa_get_wowlan_triggers(const char *wowlan_triggers,
6923 const struct wpa_driver_capa *capa);
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07006924/* Convert driver flag to string */
6925const char * driver_flag_to_string(u64 flag);
Hai Shalomb755a2a2020-04-23 21:49:02 -07006926const char * driver_flag2_to_string(u64 flag2);
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006927
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08006928/* NULL terminated array of linked in driver wrappers */
Dmitry Shmidt1d755d02015-04-28 10:34:29 -07006929extern const struct wpa_driver_ops *const wpa_drivers[];
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08006930
Dmitry Shmidt4ae50e62016-06-27 13:48:39 -07006931
6932/* Available drivers */
6933
6934#ifdef CONFIG_DRIVER_WEXT
6935extern const struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */
6936#endif /* CONFIG_DRIVER_WEXT */
6937#ifdef CONFIG_DRIVER_NL80211
6938/* driver_nl80211.c */
6939extern const struct wpa_driver_ops wpa_driver_nl80211_ops;
6940#endif /* CONFIG_DRIVER_NL80211 */
6941#ifdef CONFIG_DRIVER_HOSTAP
6942extern const struct wpa_driver_ops wpa_driver_hostap_ops; /* driver_hostap.c */
6943#endif /* CONFIG_DRIVER_HOSTAP */
6944#ifdef CONFIG_DRIVER_BSD
6945extern const struct wpa_driver_ops wpa_driver_bsd_ops; /* driver_bsd.c */
6946#endif /* CONFIG_DRIVER_BSD */
6947#ifdef CONFIG_DRIVER_OPENBSD
6948/* driver_openbsd.c */
6949extern const struct wpa_driver_ops wpa_driver_openbsd_ops;
6950#endif /* CONFIG_DRIVER_OPENBSD */
6951#ifdef CONFIG_DRIVER_NDIS
6952extern struct wpa_driver_ops wpa_driver_ndis_ops; /* driver_ndis.c */
6953#endif /* CONFIG_DRIVER_NDIS */
6954#ifdef CONFIG_DRIVER_WIRED
6955extern const struct wpa_driver_ops wpa_driver_wired_ops; /* driver_wired.c */
6956#endif /* CONFIG_DRIVER_WIRED */
6957#ifdef CONFIG_DRIVER_MACSEC_QCA
6958/* driver_macsec_qca.c */
6959extern const struct wpa_driver_ops wpa_driver_macsec_qca_ops;
6960#endif /* CONFIG_DRIVER_MACSEC_QCA */
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08006961#ifdef CONFIG_DRIVER_MACSEC_LINUX
6962/* driver_macsec_linux.c */
6963extern const struct wpa_driver_ops wpa_driver_macsec_linux_ops;
6964#endif /* CONFIG_DRIVER_MACSEC_LINUX */
Dmitry Shmidt4ae50e62016-06-27 13:48:39 -07006965#ifdef CONFIG_DRIVER_ROBOSWITCH
6966/* driver_roboswitch.c */
6967extern const struct wpa_driver_ops wpa_driver_roboswitch_ops;
6968#endif /* CONFIG_DRIVER_ROBOSWITCH */
6969#ifdef CONFIG_DRIVER_ATHEROS
6970/* driver_atheros.c */
6971extern const struct wpa_driver_ops wpa_driver_atheros_ops;
6972#endif /* CONFIG_DRIVER_ATHEROS */
6973#ifdef CONFIG_DRIVER_NONE
6974extern const struct wpa_driver_ops wpa_driver_none_ops; /* driver_none.c */
6975#endif /* CONFIG_DRIVER_NONE */
6976
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006977#endif /* DRIVER_H */