blob: 1477eccfb6fa594b3d25b5ec708a6e029c3156ee [file] [log] [blame]
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001/*
2 * Driver interface definition
Paul Stewart092955c2017-02-06 09:13:09 -08003 * Copyright (c) 2003-2017, Jouni Malinen <j@w1.fi>
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004 *
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08005 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007 *
8 * This file defines a driver interface used by both %wpa_supplicant and
9 * hostapd. The first part of the file defines data structures used in various
10 * driver operations. This is followed by the struct wpa_driver_ops that each
11 * driver wrapper will beed to define with callback functions for requesting
12 * driver operations. After this, there are definitions for driver event
13 * reporting with wpa_supplicant_event() and some convenience helper functions
14 * that can be used to report events.
15 */
16
17#ifndef DRIVER_H
18#define DRIVER_H
19
20#define WPA_SUPPLICANT_DRIVER_VERSION 4
21
22#include "common/defs.h"
Dmitry Shmidt9d9e6022015-04-23 10:34:55 -070023#include "common/ieee802_11_defs.h"
Dmitry Shmidtd2986c22017-10-23 14:22:09 -070024#include "common/wpa_common.h"
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -080025#ifdef CONFIG_MACSEC
26#include "pae/ieee802_1x_kay.h"
27#endif /* CONFIG_MACSEC */
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -070028#include "utils/list.h"
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070029
30#define HOSTAPD_CHAN_DISABLED 0x00000001
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -080031#define HOSTAPD_CHAN_NO_IR 0x00000002
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070032#define HOSTAPD_CHAN_RADAR 0x00000008
33#define HOSTAPD_CHAN_HT40PLUS 0x00000010
34#define HOSTAPD_CHAN_HT40MINUS 0x00000020
35#define HOSTAPD_CHAN_HT40 0x00000040
Dmitry Shmidt391c59f2013-09-03 12:16:28 -070036#define HOSTAPD_CHAN_SURVEY_LIST_INITIALIZED 0x00000080
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070037
Dmitry Shmidtea69e842013-05-13 14:52:28 -070038#define HOSTAPD_CHAN_DFS_UNKNOWN 0x00000000
39#define HOSTAPD_CHAN_DFS_USABLE 0x00000100
40#define HOSTAPD_CHAN_DFS_UNAVAILABLE 0x00000200
41#define HOSTAPD_CHAN_DFS_AVAILABLE 0x00000300
42#define HOSTAPD_CHAN_DFS_MASK 0x00000300
43
Sunil Ravi036cec52023-03-29 11:35:17 -070044#define HOSTAPD_CHAN_VHT_80MHZ_SUBCHANNEL 0x00000800
45#define HOSTAPD_CHAN_VHT_160MHZ_SUBCHANNEL 0x00001000
Dmitry Shmidt68d0e3e2013-10-28 17:59:21 -070046
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -080047#define HOSTAPD_CHAN_INDOOR_ONLY 0x00010000
48#define HOSTAPD_CHAN_GO_CONCURRENT 0x00020000
49
Hai Shalom74f70d42019-02-11 14:42:39 -080050/* Allowed bandwidth mask */
51enum hostapd_chan_width_attr {
52 HOSTAPD_CHAN_WIDTH_10 = BIT(0),
53 HOSTAPD_CHAN_WIDTH_20 = BIT(1),
54 HOSTAPD_CHAN_WIDTH_40P = BIT(2),
55 HOSTAPD_CHAN_WIDTH_40M = BIT(3),
56 HOSTAPD_CHAN_WIDTH_80 = BIT(4),
57 HOSTAPD_CHAN_WIDTH_160 = BIT(5),
Sunil8cd6f4d2022-06-28 18:40:46 +000058 HOSTAPD_CHAN_WIDTH_320 = BIT(6),
Hai Shalom74f70d42019-02-11 14:42:39 -080059};
60
Dmitry Shmidt849734c2016-05-27 09:59:01 -070061/* Filter gratuitous ARP */
62#define WPA_DATA_FRAME_FILTER_FLAG_ARP BIT(0)
63/* Filter unsolicited Neighbor Advertisement */
64#define WPA_DATA_FRAME_FILTER_FLAG_NA BIT(1)
65/* Filter unicast IP packets encrypted using the GTK */
66#define WPA_DATA_FRAME_FILTER_FLAG_GTK BIT(2)
67
Dmitry Shmidtd2986c22017-10-23 14:22:09 -070068#define HOSTAPD_DFS_REGION_FCC 1
69#define HOSTAPD_DFS_REGION_ETSI 2
70#define HOSTAPD_DFS_REGION_JP 3
71
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -080072/**
73 * enum reg_change_initiator - Regulatory change initiator
74 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -080075enum reg_change_initiator {
76 REGDOM_SET_BY_CORE,
77 REGDOM_SET_BY_USER,
78 REGDOM_SET_BY_DRIVER,
79 REGDOM_SET_BY_COUNTRY_IE,
Dmitry Shmidt97672262014-02-03 13:02:54 -080080 REGDOM_BEACON_HINT,
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -080081};
82
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -080083/**
84 * enum reg_type - Regulatory change types
85 */
Dmitry Shmidt7dba0e52014-04-14 10:49:15 -070086enum reg_type {
87 REGDOM_TYPE_UNKNOWN,
88 REGDOM_TYPE_COUNTRY,
89 REGDOM_TYPE_WORLD,
90 REGDOM_TYPE_CUSTOM_WORLD,
91 REGDOM_TYPE_INTERSECTION,
92};
93
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070094/**
Hai Shalom81f62d82019-07-22 12:10:00 -070095 * struct hostapd_wmm_rule - WMM regulatory rule
96 * @min_cwmin: Lower bound of CW_min value
97 * @min_cwmax: Lower bound of CW_max value
98 * @min_aifs: Lower bound of AIFS value
99 * @max_txop: Upper bound of TXOP, value in units of 32 usec
100 */
101struct hostapd_wmm_rule {
102 int min_cwmin;
103 int min_cwmax;
104 int min_aifs;
105 int max_txop;
106};
107
108/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700109 * struct hostapd_channel_data - Channel information
110 */
111struct hostapd_channel_data {
112 /**
113 * chan - Channel number (IEEE 802.11)
114 */
115 short chan;
116
117 /**
118 * freq - Frequency in MHz
119 */
Dmitry Shmidtd5e49232012-12-03 15:08:10 -0800120 int freq;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700121
122 /**
123 * flag - Channel flags (HOSTAPD_CHAN_*)
124 */
125 int flag;
126
127 /**
Hai Shalom74f70d42019-02-11 14:42:39 -0800128 * allowed_bw - Allowed channel width bitmask
129 *
130 * See enum hostapd_chan_width_attr.
131 */
132 u32 allowed_bw;
133
134 /**
Dmitry Shmidt68d0e3e2013-10-28 17:59:21 -0700135 * max_tx_power - Regulatory transmit power limit in dBm
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700136 */
137 u8 max_tx_power;
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -0700138
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800139 /**
140 * survey_list - Linked list of surveys (struct freq_survey)
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -0700141 */
142 struct dl_list survey_list;
143
144 /**
145 * min_nf - Minimum observed noise floor, in dBm, based on all
146 * surveyed channel data
147 */
148 s8 min_nf;
Dmitry Shmidt391c59f2013-09-03 12:16:28 -0700149
150#ifdef CONFIG_ACS
151 /**
152 * interference_factor - Computed interference factor on this
153 * channel (used internally in src/ap/acs.c; driver wrappers do not
154 * need to set this)
155 */
156 long double interference_factor;
157#endif /* CONFIG_ACS */
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -0700158
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800159 /**
160 * dfs_cac_ms - DFS CAC time in milliseconds
161 */
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -0700162 unsigned int dfs_cac_ms;
Hai Shalom81f62d82019-07-22 12:10:00 -0700163
164 /**
165 * wmm_rules_valid - Indicates wmm_rules state
166 */
167 int wmm_rules_valid;
168
169 /**
170 * wmm_rules - WMM regulatory rules
171 */
172 struct hostapd_wmm_rule wmm_rules[WMM_AC_NUM];
Sunil Ravi036cec52023-03-29 11:35:17 -0700173
174 /**
175 * punct_bitmap - RU puncturing bitmap
176 */
177 u16 punct_bitmap;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700178};
179
Hai Shalomfdcde762020-04-02 11:19:20 -0700180#define HE_MAC_CAPAB_0 0
Hai Shalom81f62d82019-07-22 12:10:00 -0700181#define HE_MAX_MAC_CAPAB_SIZE 6
182#define HE_MAX_PHY_CAPAB_SIZE 11
183#define HE_MAX_MCS_CAPAB_SIZE 12
184#define HE_MAX_PPET_CAPAB_SIZE 25
Dmitry Shmidtebd93af2017-02-21 13:40:44 -0800185
186/**
187 * struct he_capabilities - IEEE 802.11ax HE capabilities
188 */
189struct he_capabilities {
190 u8 he_supported;
Hai Shalom81f62d82019-07-22 12:10:00 -0700191 u8 phy_cap[HE_MAX_PHY_CAPAB_SIZE];
192 u8 mac_cap[HE_MAX_MAC_CAPAB_SIZE];
193 u8 mcs[HE_MAX_MCS_CAPAB_SIZE];
194 u8 ppet[HE_MAX_PPET_CAPAB_SIZE];
Hai Shalom899fcc72020-10-19 14:38:18 -0700195 u16 he_6ghz_capa;
Dmitry Shmidtebd93af2017-02-21 13:40:44 -0800196};
197
Sunil Ravia04bd252022-05-02 22:54:18 -0700198/* struct eht_capabilities - IEEE 802.11be EHT capabilities */
199struct eht_capabilities {
200 bool eht_supported;
201 u16 mac_cap;
202 u8 phy_cap[EHT_PHY_CAPAB_LEN];
203 u8 mcs[EHT_MCS_NSS_CAPAB_LEN];
204 u8 ppet[EHT_PPE_THRESH_CAPAB_LEN];
205};
206
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800207#define HOSTAPD_MODE_FLAG_HT_INFO_KNOWN BIT(0)
Dmitry Shmidtc2ebb4b2013-07-24 12:57:51 -0700208#define HOSTAPD_MODE_FLAG_VHT_INFO_KNOWN BIT(1)
Sunil Ravi77d572f2023-01-17 23:58:31 +0000209#define HOSTAPD_MODE_FLAG_HE_INFO_KNOWN BIT(2)
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800210
Hai Shalom81f62d82019-07-22 12:10:00 -0700211
212enum ieee80211_op_mode {
213 IEEE80211_MODE_INFRA = 0,
214 IEEE80211_MODE_IBSS = 1,
215 IEEE80211_MODE_AP = 2,
216 IEEE80211_MODE_MESH = 5,
217
218 /* only add new entries before IEEE80211_MODE_NUM */
219 IEEE80211_MODE_NUM
220};
221
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700222/**
Hai Shalomc3565922019-10-28 11:58:20 -0700223 * struct ieee80211_edmg_config - EDMG configuration
224 *
225 * This structure describes most essential parameters needed
226 * for IEEE 802.11ay EDMG configuration
227 *
228 * @channels: Bitmap that indicates the 2.16 GHz channel(s)
229 * that are allowed to be used for transmissions.
230 * Bit 0 indicates channel 1, bit 1 indicates channel 2, etc.
231 * Set to 0 to indicate EDMG not supported.
232 * @bw_config: Channel BW Configuration subfield encodes
233 * the allowed channel bandwidth configurations
234 */
235struct ieee80211_edmg_config {
236 u8 channels;
237 enum edmg_bw_config bw_config;
238};
239
240/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700241 * struct hostapd_hw_modes - Supported hardware mode information
242 */
243struct hostapd_hw_modes {
244 /**
245 * mode - Hardware mode
246 */
247 enum hostapd_hw_mode mode;
248
249 /**
250 * num_channels - Number of entries in the channels array
251 */
252 int num_channels;
253
254 /**
255 * channels - Array of supported channels
256 */
257 struct hostapd_channel_data *channels;
258
259 /**
260 * num_rates - Number of entries in the rates array
261 */
262 int num_rates;
263
264 /**
265 * rates - Array of supported rates in 100 kbps units
266 */
267 int *rates;
268
269 /**
270 * ht_capab - HT (IEEE 802.11n) capabilities
271 */
272 u16 ht_capab;
273
274 /**
275 * mcs_set - MCS (IEEE 802.11n) rate parameters
276 */
277 u8 mcs_set[16];
278
279 /**
280 * a_mpdu_params - A-MPDU (IEEE 802.11n) parameters
281 */
282 u8 a_mpdu_params;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800283
Dmitry Shmidt04949592012-07-19 12:16:46 -0700284 /**
285 * vht_capab - VHT (IEEE 802.11ac) capabilities
286 */
287 u32 vht_capab;
288
289 /**
290 * vht_mcs_set - VHT MCS (IEEE 802.11ac) rate parameters
291 */
292 u8 vht_mcs_set[8];
293
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800294 unsigned int flags; /* HOSTAPD_MODE_FLAG_* */
Dmitry Shmidtebd93af2017-02-21 13:40:44 -0800295
296 /**
297 * he_capab - HE (IEEE 802.11ax) capabilities
298 */
Hai Shalom81f62d82019-07-22 12:10:00 -0700299 struct he_capabilities he_capab[IEEE80211_MODE_NUM];
Hai Shalomc3565922019-10-28 11:58:20 -0700300
301 /**
302 * This structure describes the most essential parameters needed
303 * for IEEE 802.11ay EDMG configuration.
304 */
305 struct ieee80211_edmg_config edmg;
Sunil Ravia04bd252022-05-02 22:54:18 -0700306
307 /**
308 * eht_capab - EHT (IEEE 802.11be) capabilities
309 */
310 struct eht_capabilities eht_capab[IEEE80211_MODE_NUM];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700311};
312
313
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700314#define IEEE80211_CAP_ESS 0x0001
315#define IEEE80211_CAP_IBSS 0x0002
316#define IEEE80211_CAP_PRIVACY 0x0010
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800317#define IEEE80211_CAP_RRM 0x1000
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700318
Dmitry Shmidtf8623282013-02-20 14:34:59 -0800319/* DMG (60 GHz) IEEE 802.11ad */
320/* type - bits 0..1 */
321#define IEEE80211_CAP_DMG_MASK 0x0003
322#define IEEE80211_CAP_DMG_IBSS 0x0001 /* Tx by: STA */
323#define IEEE80211_CAP_DMG_PBSS 0x0002 /* Tx by: PCP */
324#define IEEE80211_CAP_DMG_AP 0x0003 /* Tx by: AP */
325
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700326#define WPA_SCAN_QUAL_INVALID BIT(0)
327#define WPA_SCAN_NOISE_INVALID BIT(1)
328#define WPA_SCAN_LEVEL_INVALID BIT(2)
329#define WPA_SCAN_LEVEL_DBM BIT(3)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700330#define WPA_SCAN_ASSOCIATED BIT(5)
331
332/**
333 * struct wpa_scan_res - Scan result for an BSS/IBSS
334 * @flags: information flags about the BSS/IBSS (WPA_SCAN_*)
335 * @bssid: BSSID
336 * @freq: frequency of the channel in MHz (e.g., 2412 = channel 1)
337 * @beacon_int: beacon interval in TUs (host byte order)
338 * @caps: capability information field in host byte order
339 * @qual: signal quality
340 * @noise: noise level
341 * @level: signal level
342 * @tsf: Timestamp
343 * @age: Age of the information in milliseconds (i.e., how many milliseconds
344 * ago the last Beacon or Probe Response frame was received)
Dmitry Shmidt7f656022015-02-25 14:36:37 -0800345 * @est_throughput: Estimated throughput in kbps (this is calculated during
346 * scan result processing if left zero by the driver wrapper)
347 * @snr: Signal-to-noise ratio in dB (calculated during scan result processing)
Dmitry Shmidt29333592017-01-09 12:27:11 -0800348 * @parent_tsf: Time when the Beacon/Probe Response frame was received in terms
349 * of TSF of the BSS specified by %tsf_bssid.
350 * @tsf_bssid: The BSS that %parent_tsf TSF time refers to.
Sunil Ravia04bd252022-05-02 22:54:18 -0700351 * @beacon_newer: Whether the Beacon frame data is known to be newer
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700352 * @ie_len: length of the following IE field in octets
353 * @beacon_ie_len: length of the following Beacon IE field in octets
354 *
355 * This structure is used as a generic format for scan results from the
356 * driver. Each driver interface implementation is responsible for converting
357 * the driver or OS specific scan results into this format.
358 *
359 * If the driver does not support reporting all IEs, the IE data structure is
360 * constructed of the IEs that are available. This field will also need to
361 * include SSID in IE format. All drivers are encouraged to be extended to
362 * report all IEs to make it easier to support future additions.
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800363 *
364 * This structure data is followed by ie_len octets of IEs from Probe Response
365 * frame (or if the driver does not indicate source of IEs, these may also be
366 * from Beacon frame). After the first set of IEs, another set of IEs may follow
367 * (with beacon_ie_len octets of data) if the driver provides both IE sets.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700368 */
369struct wpa_scan_res {
370 unsigned int flags;
371 u8 bssid[ETH_ALEN];
372 int freq;
373 u16 beacon_int;
374 u16 caps;
375 int qual;
376 int noise;
377 int level;
378 u64 tsf;
379 unsigned int age;
Dmitry Shmidt7f656022015-02-25 14:36:37 -0800380 unsigned int est_throughput;
381 int snr;
Dmitry Shmidt29333592017-01-09 12:27:11 -0800382 u64 parent_tsf;
383 u8 tsf_bssid[ETH_ALEN];
Sunil Ravia04bd252022-05-02 22:54:18 -0700384 bool beacon_newer;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700385 size_t ie_len;
386 size_t beacon_ie_len;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800387 /* Followed by ie_len + beacon_ie_len octets of IE data */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700388};
389
390/**
391 * struct wpa_scan_results - Scan results
392 * @res: Array of pointers to allocated variable length scan result entries
393 * @num: Number of entries in the scan result array
Dmitry Shmidtf8623282013-02-20 14:34:59 -0800394 * @fetch_time: Time when the results were fetched from the driver
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700395 */
396struct wpa_scan_results {
397 struct wpa_scan_res **res;
398 size_t num;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -0800399 struct os_reltime fetch_time;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700400};
401
402/**
403 * struct wpa_interface_info - Network interface information
404 * @next: Pointer to the next interface or NULL if this is the last one
405 * @ifname: Interface name that can be used with init() or init2()
406 * @desc: Human readable adapter description (e.g., vendor/model) or NULL if
407 * not available
408 * @drv_name: struct wpa_driver_ops::name (note: unlike other strings, this one
409 * is not an allocated copy, i.e., get_interfaces() caller will not free
410 * this)
411 */
412struct wpa_interface_info {
413 struct wpa_interface_info *next;
414 char *ifname;
415 char *desc;
416 const char *drv_name;
417};
418
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800419#define WPAS_MAX_SCAN_SSIDS 16
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700420
421/**
Dmitry Shmidtb97e4282016-02-08 10:16:07 -0800422 * struct wpa_driver_scan_ssid - SSIDs to scan for
423 * @ssid - specific SSID to scan for (ProbeReq)
424 * %NULL or zero-length SSID is used to indicate active scan
425 * with wildcard SSID.
426 * @ssid_len - Length of the SSID in octets
427 */
428struct wpa_driver_scan_ssid {
429 const u8 *ssid;
430 size_t ssid_len;
431};
432
433/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700434 * struct wpa_driver_scan_params - Scan parameters
435 * Data for struct wpa_driver_ops::scan2().
436 */
437struct wpa_driver_scan_params {
438 /**
439 * ssids - SSIDs to scan for
440 */
Dmitry Shmidtb97e4282016-02-08 10:16:07 -0800441 struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700442
443 /**
444 * num_ssids - Number of entries in ssids array
445 * Zero indicates a request for a passive scan.
446 */
447 size_t num_ssids;
448
449 /**
450 * extra_ies - Extra IE(s) to add into Probe Request or %NULL
451 */
452 const u8 *extra_ies;
453
454 /**
455 * extra_ies_len - Length of extra_ies in octets
456 */
457 size_t extra_ies_len;
458
459 /**
460 * freqs - Array of frequencies to scan or %NULL for all frequencies
461 *
462 * The frequency is set in MHz. The array is zero-terminated.
463 */
464 int *freqs;
465
466 /**
467 * filter_ssids - Filter for reporting SSIDs
468 *
469 * This optional parameter can be used to request the driver wrapper to
470 * filter scan results to include only the specified SSIDs. %NULL
471 * indicates that no filtering is to be done. This can be used to
472 * reduce memory needs for scan results in environments that have large
473 * number of APs with different SSIDs.
474 *
475 * The driver wrapper is allowed to take this allocated buffer into its
476 * own use by setting the pointer to %NULL. In that case, the driver
477 * wrapper is responsible for freeing the buffer with os_free() once it
478 * is not needed anymore.
479 */
480 struct wpa_driver_scan_filter {
Dmitry Shmidt9d9e6022015-04-23 10:34:55 -0700481 u8 ssid[SSID_MAX_LEN];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700482 size_t ssid_len;
483 } *filter_ssids;
484
485 /**
486 * num_filter_ssids - Number of entries in filter_ssids array
487 */
488 size_t num_filter_ssids;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800489
490 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -0700491 * filter_rssi - Filter by RSSI
492 *
493 * The driver may filter scan results in firmware to reduce host
494 * wakeups and thereby save power. Specify the RSSI threshold in s32
495 * dBm.
496 */
497 s32 filter_rssi;
498
499 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800500 * p2p_probe - Used to disable CCK (802.11b) rates for P2P probes
501 *
502 * When set, the driver is expected to remove rates 1, 2, 5.5, and 11
503 * Mbps from the support rates element(s) in the Probe Request frames
504 * and not to transmit the frames at any of those rates.
505 */
Dmitry Shmidt2271d3f2014-06-23 12:16:31 -0700506 unsigned int p2p_probe:1;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -0800507
508 /**
509 * only_new_results - Request driver to report only new results
510 *
511 * This is used to request the driver to report only BSSes that have
512 * been detected after this scan request has been started, i.e., to
513 * flush old cached BSS entries.
514 */
Dmitry Shmidt2271d3f2014-06-23 12:16:31 -0700515 unsigned int only_new_results:1;
516
517 /**
518 * low_priority - Requests driver to use a lower scan priority
519 *
520 * This is used to request the driver to use a lower scan priority
521 * if it supports such a thing.
522 */
523 unsigned int low_priority:1;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -0800524
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800525 /**
526 * mac_addr_rand - Requests driver to randomize MAC address
527 */
528 unsigned int mac_addr_rand:1;
529
530 /**
531 * mac_addr - MAC address used with randomization. The address cannot be
532 * a multicast one, i.e., bit 0 of byte 0 should not be set.
533 */
Hai Shalomc3565922019-10-28 11:58:20 -0700534 u8 *mac_addr;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800535
536 /**
537 * mac_addr_mask - MAC address mask used with randomization.
538 *
539 * Bits that are 0 in the mask should be randomized. Bits that are 1 in
540 * the mask should be taken as is from mac_addr. The mask should not
541 * allow the generation of a multicast address, i.e., bit 0 of byte 0
542 * must be set.
543 */
544 const u8 *mac_addr_mask;
545
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -0800546 /**
547 * sched_scan_plans - Scan plans for scheduled scan
548 *
549 * Each scan plan consists of the number of iterations to scan and the
550 * interval between scans. When a scan plan finishes (i.e., it was run
551 * for the specified number of iterations), the next scan plan is
552 * executed. The scan plans are executed in the order they appear in
553 * the array (lower index first). The last scan plan will run infinitely
554 * (until requested to stop), thus must not specify the number of
555 * iterations. All other scan plans must specify the number of
556 * iterations.
557 */
558 struct sched_scan_plan {
559 u32 interval; /* In seconds */
560 u32 iterations; /* Zero to run infinitely */
561 } *sched_scan_plans;
562
563 /**
564 * sched_scan_plans_num - Number of scan plans in sched_scan_plans array
565 */
566 unsigned int sched_scan_plans_num;
567
Dmitry Shmidt9c175262016-03-03 10:20:07 -0800568 /**
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700569 * sched_scan_start_delay - Delay to use before starting the first scan
570 *
571 * Delay (in seconds) before scheduling first scan plan cycle. The
572 * driver may ignore this parameter and start immediately (or at any
573 * other time), if this feature is not supported.
574 */
575 u32 sched_scan_start_delay;
576
577 /**
Dmitry Shmidt9c175262016-03-03 10:20:07 -0800578 * bssid - Specific BSSID to scan for
579 *
580 * This optional parameter can be used to replace the default wildcard
581 * BSSID with a specific BSSID to scan for if results are needed from
582 * only a single BSS.
583 */
584 const u8 *bssid;
585
Dmitry Shmidtabb90a32016-12-05 15:34:39 -0800586 /**
587 * scan_cookie - Unique identification representing the scan request
588 *
589 * This scan_cookie carries a unique identification representing the
590 * scan request if the host driver/kernel supports concurrent scan
591 * requests. This cookie is returned from the corresponding driver
592 * interface.
593 *
594 * Note: Unlike other parameters in this structure, scan_cookie is used
595 * only to return information instead of setting parameters for the
596 * scan.
597 */
598 u64 scan_cookie;
599
Dmitry Shmidt29333592017-01-09 12:27:11 -0800600 /**
601 * duration - Dwell time on each channel
602 *
603 * This optional parameter can be used to set the dwell time on each
604 * channel. In TUs.
605 */
606 u16 duration;
607
608 /**
609 * duration_mandatory - Whether the specified duration is mandatory
610 *
611 * If this is set, the duration specified by the %duration field is
612 * mandatory (and the driver should reject the scan request if it is
613 * unable to comply with the specified duration), otherwise it is the
614 * maximum duration and the actual duration may be shorter.
615 */
616 unsigned int duration_mandatory:1;
617
Dmitry Shmidtebd93af2017-02-21 13:40:44 -0800618 /**
619 * relative_rssi_set - Whether relative RSSI parameters are set
620 */
621 unsigned int relative_rssi_set:1;
622
623 /**
624 * relative_rssi - Relative RSSI for reporting better BSSs
625 *
626 * Amount of RSSI by which a BSS should be better than the current
627 * connected BSS to report the new BSS to user space.
628 */
629 s8 relative_rssi;
630
631 /**
632 * relative_adjust_band - Band to which RSSI should be adjusted
633 *
634 * The relative_adjust_rssi should be added to the band specified
635 * by relative_adjust_band.
636 */
637 enum set_band relative_adjust_band;
638
639 /**
640 * relative_adjust_rssi - RSSI to be added to relative_adjust_band
641 *
642 * An amount of relative_band_rssi should be added to the BSSs that
643 * belong to the band specified by relative_adjust_band while comparing
644 * with other bands for BSS reporting.
645 */
646 s8 relative_adjust_rssi;
647
Hai Shalomce48b4a2018-09-05 11:41:35 -0700648 /**
649 * oce_scan
650 *
651 * Enable the following OCE scan features: (WFA OCE TechSpec v1.0)
652 * - Accept broadcast Probe Response frame.
653 * - Probe Request frame deferral and suppression.
654 * - Max Channel Time - driver fills FILS request params IE with
655 * Maximum Channel Time.
656 * - Send 1st Probe Request frame in rate of minimum 5.5 Mbps.
657 */
658 unsigned int oce_scan:1;
659
Hai Shalomc1a21442022-02-04 13:43:00 -0800660 /**
661 * p2p_include_6ghz - Include 6 GHz channels for P2P full scan
662 *
663 */
664 unsigned int p2p_include_6ghz:1;
665
Sunil8cd6f4d2022-06-28 18:40:46 +0000666 /**
667 * non_coloc_6ghz - Force scanning of non-PSC 6 GHz channels
668 *
669 * If this is set, the driver should scan non-PSC channels from the
670 * scan request even if neighbor reports from 2.4/5 GHz APs did not
671 * report a co-located AP on these channels. The default is to scan
672 * non-PSC channels only if a co-located AP was reported on the channel.
673 */
674 unsigned int non_coloc_6ghz:1;
675
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -0800676 /*
677 * NOTE: Whenever adding new parameters here, please make sure
678 * wpa_scan_clone_params() and wpa_scan_free_params() get updated with
679 * matching changes.
680 */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700681};
682
683/**
684 * struct wpa_driver_auth_params - Authentication parameters
685 * Data for struct wpa_driver_ops::authenticate().
686 */
687struct wpa_driver_auth_params {
688 int freq;
689 const u8 *bssid;
690 const u8 *ssid;
691 size_t ssid_len;
692 int auth_alg;
693 const u8 *ie;
694 size_t ie_len;
695 const u8 *wep_key[4];
696 size_t wep_key_len[4];
697 int wep_tx_keyidx;
698 int local_state_change;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800699
700 /**
701 * p2p - Whether this connection is a P2P group
702 */
703 int p2p;
704
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800705 /**
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800706 * auth_data - Additional elements for Authentication frame
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800707 *
708 * This buffer starts with the Authentication transaction sequence
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800709 * number field. If no special handling of such elements is needed, this
710 * pointer is %NULL. This is used with SAE and FILS.
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800711 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800712 const u8 *auth_data;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800713
714 /**
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800715 * auth_data_len - Length of auth_data buffer in octets
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800716 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800717 size_t auth_data_len;
Sunil Ravi77d572f2023-01-17 23:58:31 +0000718
719 /**
720 * mld - Establish an MLD connection
721 */
722 bool mld;
723
724 /**
725 * mld_link_id - The link ID of the MLD AP to which we are associating
726 */
727 u8 mld_link_id;
728
729 /**
730 * The MLD AP address
731 */
732 const u8 *ap_mld_addr;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700733};
734
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800735/**
736 * enum wps_mode - WPS mode
737 */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700738enum wps_mode {
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800739 /**
740 * WPS_MODE_NONE - No WPS provisioning being used
741 */
742 WPS_MODE_NONE,
743
744 /**
745 * WPS_MODE_OPEN - WPS provisioning with AP that is in open mode
746 */
747 WPS_MODE_OPEN,
748
749 /**
750 * WPS_MODE_PRIVACY - WPS provisioning with AP that is using protection
751 */
752 WPS_MODE_PRIVACY
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700753};
754
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800755/**
756 * struct hostapd_freq_params - Channel parameters
757 */
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700758struct hostapd_freq_params {
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800759 /**
760 * mode - Mode/band (HOSTAPD_MODE_IEEE80211A, ..)
761 */
762 enum hostapd_hw_mode mode;
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700763
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800764 /**
765 * freq - Primary channel center frequency in MHz
766 */
767 int freq;
768
769 /**
770 * channel - Channel number
771 */
772 int channel;
773
774 /**
775 * ht_enabled - Whether HT is enabled
776 */
777 int ht_enabled;
778
779 /**
780 * sec_channel_offset - Secondary channel offset for HT40
781 *
782 * 0 = HT40 disabled,
783 * -1 = HT40 enabled, secondary channel below primary,
784 * 1 = HT40 enabled, secondary channel above primary
785 */
786 int sec_channel_offset;
787
788 /**
789 * vht_enabled - Whether VHT is enabled
790 */
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700791 int vht_enabled;
792
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800793 /**
Hai Shalom81f62d82019-07-22 12:10:00 -0700794 * he_enabled - Whether HE is enabled
795 */
796 int he_enabled;
797
798 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800799 * center_freq1 - Segment 0 center frequency in MHz
800 *
801 * Valid for both HT and VHT.
802 */
803 int center_freq1;
804
805 /**
806 * center_freq2 - Segment 1 center frequency in MHz
807 *
808 * Non-zero only for bandwidth 80 and an 80+80 channel
809 */
810 int center_freq2;
811
812 /**
813 * bandwidth - Channel bandwidth in MHz (20, 40, 80, 160)
814 */
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700815 int bandwidth;
Hai Shalomc3565922019-10-28 11:58:20 -0700816
817 /**
818 * This structure describes the most essential parameters needed
819 * for IEEE 802.11ay EDMG configuration.
820 */
821 struct ieee80211_edmg_config edmg;
Sunil Ravia04bd252022-05-02 22:54:18 -0700822
823 /**
824 * radar_background - Whether radar/CAC background is requested
825 */
826 bool radar_background;
827
828 /**
829 * eht_enabled - Whether EHT is enabled
830 */
831 bool eht_enabled;
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700832};
833
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700834/**
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700835 * struct wpa_driver_sta_auth_params - Authentication parameters
836 * Data for struct wpa_driver_ops::sta_auth().
837 */
838struct wpa_driver_sta_auth_params {
839
840 /**
841 * own_addr - Source address and BSSID for authentication frame
842 */
843 const u8 *own_addr;
844
845 /**
846 * addr - MAC address of the station to associate
847 */
848 const u8 *addr;
849
850 /**
851 * seq - authentication sequence number
852 */
853 u16 seq;
854
855 /**
856 * status - authentication response status code
857 */
858 u16 status;
859
860 /**
861 * ie - authentication frame ie buffer
862 */
863 const u8 *ie;
864
865 /**
866 * len - ie buffer length
867 */
868 size_t len;
869
870 /**
871 * fils_auth - Indicates whether FILS authentication is being performed
872 */
873 int fils_auth;
874
875 /**
876 * fils_anonce - ANonce (required for FILS)
877 */
878 u8 fils_anonce[WPA_NONCE_LEN];
879
880 /**
881 * fils_snonce - SNonce (required for FILS)
882 */
883 u8 fils_snonce[WPA_NONCE_LEN];
884
885 /**
886 * fils_kek - key for encryption (required for FILS)
887 */
888 u8 fils_kek[WPA_KEK_MAX_LEN];
889
890 /**
891 * fils_kek_len - Length of the fils_kek in octets (required for FILS)
892 */
893 size_t fils_kek_len;
894};
895
Sunil Ravi77d572f2023-01-17 23:58:31 +0000896struct wpa_driver_mld_params {
897 /**
898 * mld_addr - AP's MLD address
899 */
900 const u8 *mld_addr;
901
902 /**
903 * valid_links - The valid links including the association link
904 */
905 u16 valid_links;
906
907 /**
908 * assoc_link_id - The link on which the association is performed
909 */
910 u8 assoc_link_id;
911
912 /**
913 * mld_links - Link information
914 *
915 * Should include information on all the requested links for association
916 * including the link on which the association should take place.
917 * For the association link, the ies and ies_len should be NULL and
918 * 0 respectively.
919 */
920 struct {
921 int freq;
922 const u8 *bssid;
923 const u8 *ies;
924 size_t ies_len;
925 } mld_links[MAX_NUM_MLD_LINKS];
926};
927
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700928/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700929 * struct wpa_driver_associate_params - Association parameters
930 * Data for struct wpa_driver_ops::associate().
931 */
932struct wpa_driver_associate_params {
933 /**
934 * bssid - BSSID of the selected AP
935 * This can be %NULL, if ap_scan=2 mode is used and the driver is
936 * responsible for selecting with which BSS to associate. */
937 const u8 *bssid;
938
939 /**
Dmitry Shmidt96be6222014-02-13 10:16:51 -0800940 * bssid_hint - BSSID of a proposed AP
941 *
942 * This indicates which BSS has been found a suitable candidate for
943 * initial association for drivers that use driver/firmwate-based BSS
944 * selection. Unlike the @bssid parameter, @bssid_hint does not limit
945 * the driver from selecting other BSSes in the ESS.
946 */
947 const u8 *bssid_hint;
948
949 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700950 * ssid - The selected SSID
951 */
952 const u8 *ssid;
953
954 /**
955 * ssid_len - Length of the SSID (1..32)
956 */
957 size_t ssid_len;
958
959 /**
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700960 * freq - channel parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700961 */
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700962 struct hostapd_freq_params freq;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700963
964 /**
Dmitry Shmidt96be6222014-02-13 10:16:51 -0800965 * freq_hint - Frequency of the channel the proposed AP is using
966 *
967 * This provides a channel on which a suitable BSS has been found as a
968 * hint for the driver. Unlike the @freq parameter, @freq_hint does not
969 * limit the driver from selecting other channels for
970 * driver/firmware-based BSS selection.
971 */
972 int freq_hint;
973
974 /**
Dmitry Shmidt04949592012-07-19 12:16:46 -0700975 * bg_scan_period - Background scan period in seconds, 0 to disable
976 * background scan, or -1 to indicate no change to default driver
977 * configuration
978 */
979 int bg_scan_period;
980
981 /**
Dmitry Shmidt2ac5f602014-03-07 10:08:21 -0800982 * beacon_int - Beacon interval for IBSS or 0 to use driver default
983 */
984 int beacon_int;
985
986 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700987 * wpa_ie - WPA information element for (Re)Association Request
988 * WPA information element to be included in (Re)Association
989 * Request (including information element id and length). Use
990 * of this WPA IE is optional. If the driver generates the WPA
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700991 * IE, it can use pairwise_suite, group_suite, group_mgmt_suite, and
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700992 * key_mgmt_suite to select proper algorithms. In this case,
993 * the driver has to notify wpa_supplicant about the used WPA
994 * IE by generating an event that the interface code will
995 * convert into EVENT_ASSOCINFO data (see below).
996 *
997 * When using WPA2/IEEE 802.11i, wpa_ie is used for RSN IE
998 * instead. The driver can determine which version is used by
999 * looking at the first byte of the IE (0xdd for WPA, 0x30 for
1000 * WPA2/RSN).
1001 *
1002 * When using WPS, wpa_ie is used for WPS IE instead of WPA/RSN IE.
1003 */
1004 const u8 *wpa_ie;
1005
1006 /**
1007 * wpa_ie_len - length of the wpa_ie
1008 */
1009 size_t wpa_ie_len;
1010
1011 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001012 * wpa_proto - Bitfield of WPA_PROTO_* values to indicate WPA/WPA2
1013 */
1014 unsigned int wpa_proto;
1015
1016 /**
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001017 * pairwise_suite - Selected pairwise cipher suite (WPA_CIPHER_*)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001018 *
1019 * This is usually ignored if @wpa_ie is used.
1020 */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001021 unsigned int pairwise_suite;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001022
1023 /**
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001024 * group_suite - Selected group cipher suite (WPA_CIPHER_*)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001025 *
1026 * This is usually ignored if @wpa_ie is used.
1027 */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001028 unsigned int group_suite;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001029
1030 /**
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001031 * mgmt_group_suite - Selected group management cipher suite (WPA_CIPHER_*)
1032 *
1033 * This is usually ignored if @wpa_ie is used.
1034 */
1035 unsigned int mgmt_group_suite;
1036
1037 /**
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001038 * key_mgmt_suite - Selected key management suite (WPA_KEY_MGMT_*)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001039 *
1040 * This is usually ignored if @wpa_ie is used.
1041 */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001042 unsigned int key_mgmt_suite;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001043
1044 /**
Sunil Ravi89eba102022-09-13 21:04:37 -07001045 * allowed_key_mgmts - Bitfield of allowed key management suites
1046 * (WPA_KEY_MGMT_*) other than @key_mgmt_suite for the current
1047 * connection
1048 *
1049 * SME in the driver may choose key_mgmt from this list for the initial
1050 * connection or roaming. The driver which doesn't support this
1051 * ignores this parameter.
1052 */
1053 unsigned int allowed_key_mgmts;
1054
1055 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001056 * auth_alg - Allowed authentication algorithms
1057 * Bit field of WPA_AUTH_ALG_*
1058 */
1059 int auth_alg;
1060
1061 /**
1062 * mode - Operation mode (infra/ibss) IEEE80211_MODE_*
1063 */
1064 int mode;
1065
1066 /**
1067 * wep_key - WEP keys for static WEP configuration
1068 */
1069 const u8 *wep_key[4];
1070
1071 /**
1072 * wep_key_len - WEP key length for static WEP configuration
1073 */
1074 size_t wep_key_len[4];
1075
1076 /**
1077 * wep_tx_keyidx - WEP TX key index for static WEP configuration
1078 */
1079 int wep_tx_keyidx;
1080
1081 /**
1082 * mgmt_frame_protection - IEEE 802.11w management frame protection
1083 */
1084 enum mfp_options mgmt_frame_protection;
1085
1086 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001087 * passphrase - RSN passphrase for PSK
1088 *
1089 * This value is made available only for WPA/WPA2-Personal (PSK) and
Hai Shalom74f70d42019-02-11 14:42:39 -08001090 * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK. This
1091 * is the 8..63 character ASCII passphrase, if available. Please note
1092 * that this can be %NULL if passphrase was not used to generate the
1093 * PSK. In that case, the psk field must be used to fetch the PSK.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001094 */
1095 const char *passphrase;
1096
1097 /**
1098 * psk - RSN PSK (alternative for passphrase for PSK)
1099 *
1100 * This value is made available only for WPA/WPA2-Personal (PSK) and
Hai Shalom74f70d42019-02-11 14:42:39 -08001101 * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK. This
1102 * is the 32-octet (256-bit) PSK, if available. The driver wrapper
1103 * should be prepared to handle %NULL value as an error.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001104 */
1105 const u8 *psk;
1106
1107 /**
1108 * drop_unencrypted - Enable/disable unencrypted frame filtering
1109 *
1110 * Configure the driver to drop all non-EAPOL frames (both receive and
1111 * transmit paths). Unencrypted EAPOL frames (ethertype 0x888e) must
1112 * still be allowed for key negotiation.
1113 */
1114 int drop_unencrypted;
1115
1116 /**
1117 * prev_bssid - Previously used BSSID in this ESS
1118 *
1119 * When not %NULL, this is a request to use reassociation instead of
1120 * association.
1121 */
1122 const u8 *prev_bssid;
1123
1124 /**
1125 * wps - WPS mode
1126 *
1127 * If the driver needs to do special configuration for WPS association,
1128 * this variable provides more information on what type of association
Sunil Ravia04bd252022-05-02 22:54:18 -07001129 * is being requested. Most drivers should not need to use this.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001130 */
1131 enum wps_mode wps;
1132
1133 /**
1134 * p2p - Whether this connection is a P2P group
1135 */
1136 int p2p;
1137
1138 /**
1139 * uapsd - UAPSD parameters for the network
1140 * -1 = do not change defaults
1141 * AP mode: 1 = enabled, 0 = disabled
1142 * STA mode: bits 0..3 UAPSD enabled for VO,VI,BK,BE
1143 */
1144 int uapsd;
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08001145
1146 /**
1147 * fixed_bssid - Whether to force this BSSID in IBSS mode
1148 * 1 = Fix this BSSID and prevent merges.
1149 * 0 = Do not fix BSSID.
1150 */
1151 int fixed_bssid;
1152
1153 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08001154 * fixed_freq - Fix control channel in IBSS mode
1155 * 0 = don't fix control channel (default)
1156 * 1 = fix control channel; this prevents IBSS merging with another
1157 * channel
1158 */
1159 int fixed_freq;
1160
1161 /**
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08001162 * disable_ht - Disable HT (IEEE 802.11n) for this connection
1163 */
1164 int disable_ht;
1165
1166 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001167 * htcaps - HT Capabilities over-rides
1168 *
1169 * Only bits set in the mask will be used, and not all values are used
1170 * by the kernel anyway. Currently, MCS, MPDU and MSDU fields are used.
1171 *
1172 * Pointer to struct ieee80211_ht_capabilities.
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08001173 */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001174 const u8 *htcaps;
1175
1176 /**
1177 * htcaps_mask - HT Capabilities over-rides mask
1178 *
1179 * Pointer to struct ieee80211_ht_capabilities.
1180 */
1181 const u8 *htcaps_mask;
Dmitry Shmidt2f023192013-03-12 12:44:17 -07001182
1183#ifdef CONFIG_VHT_OVERRIDES
1184 /**
1185 * disable_vht - Disable VHT for this connection
1186 */
1187 int disable_vht;
1188
1189 /**
1190 * VHT capability overrides.
1191 */
1192 const struct ieee80211_vht_capabilities *vhtcaps;
1193 const struct ieee80211_vht_capabilities *vhtcaps_mask;
1194#endif /* CONFIG_VHT_OVERRIDES */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001195
Hai Shalomfdcde762020-04-02 11:19:20 -07001196#ifdef CONFIG_HE_OVERRIDES
1197 /**
1198 * disable_he - Disable HE for this connection
1199 */
1200 int disable_he;
1201#endif /* CONFIG_HE_OVERRIDES */
1202
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001203 /**
1204 * req_key_mgmt_offload - Request key management offload for connection
1205 *
1206 * Request key management offload for this connection if the device
1207 * supports it.
1208 */
1209 int req_key_mgmt_offload;
1210
1211 /**
Hai Shalomc3565922019-10-28 11:58:20 -07001212 * req_handshake_offload - Request EAPOL handshake offload
1213 *
1214 * Request EAPOL handshake offload for this connection if the device
1215 * supports it.
1216 */
1217 int req_handshake_offload;
1218
1219 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001220 * Flag for indicating whether this association includes support for
1221 * RRM (Radio Resource Measurements)
1222 */
1223 int rrm_used;
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08001224
1225 /**
1226 * pbss - If set, connect to a PCP in a PBSS. Otherwise, connect to an
1227 * AP as usual. Valid for DMG network only.
1228 */
1229 int pbss;
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08001230
1231 /**
1232 * fils_kek - KEK for FILS association frame protection (AES-SIV)
1233 */
1234 const u8 *fils_kek;
1235
1236 /**
1237 * fils_kek_len: Length of fils_kek in bytes
1238 */
1239 size_t fils_kek_len;
1240
1241 /**
1242 * fils_nonces - Nonces for FILS association frame protection
1243 * (AES-SIV AAD)
1244 */
1245 const u8 *fils_nonces;
1246
1247 /**
1248 * fils_nonces_len: Length of fils_nonce in bytes
1249 */
1250 size_t fils_nonces_len;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001251
1252 /**
1253 * fils_erp_username - Username part of keyName-NAI
1254 */
1255 const u8 *fils_erp_username;
1256
1257 /**
1258 * fils_erp_username_len - Length of fils_erp_username in bytes
1259 */
1260 size_t fils_erp_username_len;
1261
1262 /**
1263 * fils_erp_realm - Realm/domain name to use in FILS ERP
1264 */
1265 const u8 *fils_erp_realm;
1266
1267 /**
1268 * fils_erp_realm_len - Length of fils_erp_realm in bytes
1269 */
1270 size_t fils_erp_realm_len;
1271
1272 /**
1273 * fils_erp_next_seq_num - The next sequence number to use in FILS ERP
1274 * messages
1275 */
1276 u16 fils_erp_next_seq_num;
1277
1278 /**
1279 * fils_erp_rrk - Re-authentication root key (rRK) for the keyName-NAI
1280 * specified by fils_erp_username@fils_erp_realm.
1281 */
1282 const u8 *fils_erp_rrk;
1283
1284 /**
1285 * fils_erp_rrk_len - Length of fils_erp_rrk in bytes
1286 */
1287 size_t fils_erp_rrk_len;
Hai Shalom60840252021-02-19 19:02:11 -08001288
1289 /**
1290 * sae_pwe - SAE mechanism for PWE derivation
1291 * 0 = hunting-and-pecking loop only
1292 * 1 = hash-to-element only
1293 * 2 = both hunting-and-pecking loop and hash-to-element enabled
1294 */
Sunil Ravi77d572f2023-01-17 23:58:31 +00001295 enum sae_pwe sae_pwe;
1296
Winnie Chen4138eec2022-11-10 16:32:53 +08001297#if defined(CONFIG_DRIVER_NL80211_BRCM) || defined(CONFIG_DRIVER_NL80211_SYNA)
Vinayak Yadawade62409f2022-01-20 12:32:07 +05301298 /**
1299 * td_policy - Transition Disable Policy
1300 */
1301 u32 td_policy;
Winnie Chen4138eec2022-11-10 16:32:53 +08001302#endif /* CONFIG_DRIVER_NL80211_BRCM || CONFIG_DRIVER_NL80211_SYNA */
Sunil Ravi77d572f2023-01-17 23:58:31 +00001303
1304 /**
1305 * disable_eht - Disable EHT for this connection
1306 */
1307 int disable_eht;
1308
1309 /*
1310 * mld_params - MLD association parameters
1311 */
1312 struct wpa_driver_mld_params mld_params;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001313};
1314
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001315enum hide_ssid {
1316 NO_SSID_HIDING,
1317 HIDDEN_SSID_ZERO_LEN,
1318 HIDDEN_SSID_ZERO_CONTENTS
1319};
1320
Hai Shalom81f62d82019-07-22 12:10:00 -07001321enum ch_switch_state {
1322 CH_SW_STARTED,
1323 CH_SW_FINISHED
1324};
1325
Dmitry Shmidtb58836e2014-04-29 14:35:56 -07001326struct wowlan_triggers {
1327 u8 any;
1328 u8 disconnect;
1329 u8 magic_pkt;
1330 u8 gtk_rekey_failure;
1331 u8 eap_identity_req;
1332 u8 four_way_handshake;
1333 u8 rfkill_release;
1334};
1335
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001336struct wpa_driver_ap_params {
1337 /**
1338 * head - Beacon head from IEEE 802.11 header to IEs before TIM IE
1339 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08001340 u8 *head;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001341
1342 /**
1343 * head_len - Length of the head buffer in octets
1344 */
1345 size_t head_len;
1346
1347 /**
1348 * tail - Beacon tail following TIM IE
1349 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08001350 u8 *tail;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001351
1352 /**
1353 * tail_len - Length of the tail buffer in octets
1354 */
1355 size_t tail_len;
1356
1357 /**
1358 * dtim_period - DTIM period
1359 */
1360 int dtim_period;
1361
1362 /**
1363 * beacon_int - Beacon interval
1364 */
1365 int beacon_int;
1366
1367 /**
1368 * basic_rates: -1 terminated array of basic rates in 100 kbps
1369 *
1370 * This parameter can be used to set a specific basic rate set for the
1371 * BSS. If %NULL, default basic rate set is used.
1372 */
1373 int *basic_rates;
1374
1375 /**
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001376 * beacon_rate: Beacon frame data rate
1377 *
1378 * This parameter can be used to set a specific Beacon frame data rate
1379 * for the BSS. The interpretation of this value depends on the
Hai Shalom60840252021-02-19 19:02:11 -08001380 * rate_type (legacy: in 100 kbps units, HT: HT-MCS, VHT: VHT-MCS,
1381 * HE: HE-MCS). If beacon_rate == 0 and rate_type == 0
1382 * (BEACON_RATE_LEGACY), the default Beacon frame data rate is used.
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001383 */
1384 unsigned int beacon_rate;
1385
1386 /**
Hai Shalom60840252021-02-19 19:02:11 -08001387 * beacon_rate_type: Beacon data rate type (legacy/HT/VHT/HE)
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001388 */
1389 enum beacon_rate_type rate_type;
1390
1391 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001392 * proberesp - Probe Response template
1393 *
1394 * This is used by drivers that reply to Probe Requests internally in
1395 * AP mode and require the full Probe Response template.
1396 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08001397 u8 *proberesp;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001398
1399 /**
1400 * proberesp_len - Length of the proberesp buffer in octets
1401 */
1402 size_t proberesp_len;
1403
1404 /**
1405 * ssid - The SSID to use in Beacon/Probe Response frames
1406 */
1407 const u8 *ssid;
1408
1409 /**
1410 * ssid_len - Length of the SSID (1..32)
1411 */
1412 size_t ssid_len;
1413
1414 /**
1415 * hide_ssid - Whether to hide the SSID
1416 */
1417 enum hide_ssid hide_ssid;
1418
1419 /**
1420 * pairwise_ciphers - WPA_CIPHER_* bitfield
1421 */
1422 unsigned int pairwise_ciphers;
1423
1424 /**
1425 * group_cipher - WPA_CIPHER_*
1426 */
1427 unsigned int group_cipher;
1428
1429 /**
1430 * key_mgmt_suites - WPA_KEY_MGMT_* bitfield
1431 */
1432 unsigned int key_mgmt_suites;
1433
1434 /**
1435 * auth_algs - WPA_AUTH_ALG_* bitfield
1436 */
1437 unsigned int auth_algs;
1438
1439 /**
1440 * wpa_version - WPA_PROTO_* bitfield
1441 */
1442 unsigned int wpa_version;
1443
1444 /**
1445 * privacy - Whether privacy is used in the BSS
1446 */
1447 int privacy;
1448
1449 /**
1450 * beacon_ies - WPS/P2P IE(s) for Beacon frames
1451 *
1452 * This is used to add IEs like WPS IE and P2P IE by drivers that do
1453 * not use the full Beacon template.
1454 */
1455 const struct wpabuf *beacon_ies;
1456
1457 /**
1458 * proberesp_ies - P2P/WPS IE(s) for Probe Response frames
1459 *
1460 * This is used to add IEs like WPS IE and P2P IE by drivers that
1461 * reply to Probe Request frames internally.
1462 */
1463 const struct wpabuf *proberesp_ies;
1464
1465 /**
1466 * assocresp_ies - WPS IE(s) for (Re)Association Response frames
1467 *
1468 * This is used to add IEs like WPS IE by drivers that reply to
1469 * (Re)Association Request frames internally.
1470 */
1471 const struct wpabuf *assocresp_ies;
1472
1473 /**
1474 * isolate - Whether to isolate frames between associated stations
1475 *
1476 * If this is non-zero, the AP is requested to disable forwarding of
1477 * frames between associated stations.
1478 */
1479 int isolate;
1480
1481 /**
1482 * cts_protect - Whether CTS protection is enabled
1483 */
1484 int cts_protect;
1485
1486 /**
1487 * preamble - Whether short preamble is enabled
1488 */
1489 int preamble;
1490
1491 /**
1492 * short_slot_time - Whether short slot time is enabled
1493 *
1494 * 0 = short slot time disable, 1 = short slot time enabled, -1 = do
1495 * not set (e.g., when 802.11g mode is not in use)
1496 */
1497 int short_slot_time;
1498
1499 /**
1500 * ht_opmode - HT operation mode or -1 if HT not in use
1501 */
1502 int ht_opmode;
1503
1504 /**
1505 * interworking - Whether Interworking is enabled
1506 */
1507 int interworking;
1508
1509 /**
1510 * hessid - Homogeneous ESS identifier or %NULL if not set
1511 */
1512 const u8 *hessid;
1513
1514 /**
1515 * access_network_type - Access Network Type (0..15)
1516 *
1517 * This is used for filtering Probe Request frames when Interworking is
1518 * enabled.
1519 */
1520 u8 access_network_type;
Dmitry Shmidt04949592012-07-19 12:16:46 -07001521
1522 /**
1523 * ap_max_inactivity - Timeout in seconds to detect STA's inactivity
1524 *
1525 * This is used by driver which advertises this capability.
1526 */
1527 int ap_max_inactivity;
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07001528
1529 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08001530 * ctwindow - Client Traffic Window (in TUs)
1531 */
1532 u8 p2p_go_ctwindow;
1533
1534 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07001535 * disable_dgaf - Whether group-addressed frames are disabled
1536 */
1537 int disable_dgaf;
Dmitry Shmidtf21452a2014-02-26 10:55:25 -08001538
1539 /**
1540 * osen - Whether OSEN security is enabled
1541 */
1542 int osen;
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07001543
1544 /**
1545 * freq - Channel parameters for dynamic bandwidth changes
1546 */
1547 struct hostapd_freq_params *freq;
Dmitry Shmidt7f656022015-02-25 14:36:37 -08001548
1549 /**
1550 * reenable - Whether this is to re-enable beaconing
1551 */
1552 int reenable;
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08001553
1554 /**
1555 * pbss - Whether to start a PCP (in PBSS) instead of an AP in
1556 * infrastructure BSS. Valid only for DMG network.
1557 */
1558 int pbss;
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001559
1560 /**
1561 * multicast_to_unicast - Whether to use multicast_to_unicast
1562 *
1563 * If this is non-zero, the AP is requested to perform multicast to
1564 * unicast conversion for ARP, IPv4, and IPv6 frames (possibly within
1565 * 802.1Q). If enabled, such frames are to be sent to each station
1566 * separately, with the DA replaced by their own MAC address rather
1567 * than the group address.
1568 *
1569 * Note that this may break certain expectations of the receiver, such
1570 * as the ability to drop unicast IP packets received within multicast
1571 * L2 frames, or the ability to not send ICMP destination unreachable
1572 * messages for packets received in L2 multicast (which is required,
1573 * but the receiver can't tell the difference if this new option is
1574 * enabled.)
1575 *
1576 * This also doesn't implement the 802.11 DMS (directed multicast
1577 * service).
1578 */
1579 int multicast_to_unicast;
Hai Shalom74f70d42019-02-11 14:42:39 -08001580
1581 /**
1582 * ftm_responder - Whether FTM responder is enabled
1583 */
1584 int ftm_responder;
1585
1586 /**
1587 * lci - Binary data, the content of an LCI report IE with type 8 as
1588 * defined in IEEE Std 802.11-2016, 9.4.2.22.10
1589 */
1590 const struct wpabuf *lci;
1591
1592 /**
1593 * civic - Binary data, the content of a measurement report IE with
1594 * type 11 as defined in IEEE Std 802.11-2016, 9.4.2.22.13
1595 */
1596 const struct wpabuf *civic;
Hai Shalomc3565922019-10-28 11:58:20 -07001597
1598 /**
Hai Shalom60840252021-02-19 19:02:11 -08001599 * he_spr_ctrl - Spatial Reuse control field of SPR element
Hai Shalomc3565922019-10-28 11:58:20 -07001600 */
Hai Shalom60840252021-02-19 19:02:11 -08001601 u8 he_spr_ctrl;
1602
1603 /**
1604 * he_spr_non_srg_obss_pd_max_offset - Non-SRG Maximum TX power offset
1605 */
1606 u8 he_spr_non_srg_obss_pd_max_offset;
Hai Shalomc3565922019-10-28 11:58:20 -07001607
1608 /**
1609 * he_spr_srg_obss_pd_min_offset - Minimum TX power offset
1610 */
Hai Shalom60840252021-02-19 19:02:11 -08001611 u8 he_spr_srg_obss_pd_min_offset;
Hai Shalomc3565922019-10-28 11:58:20 -07001612
1613 /**
1614 * he_spr_srg_obss_pd_max_offset - Maximum TX power offset
1615 */
Hai Shalom60840252021-02-19 19:02:11 -08001616 u8 he_spr_srg_obss_pd_max_offset;
1617
1618 /**
1619 * he_spr_bss_color_bitmap - BSS color values used by members of the
1620 * SRG.
1621 */
1622 u8 he_spr_bss_color_bitmap[8];
1623
1624 /**
1625 * he_spr_partial_bssid_bitmap - Partial BSSID values used by members
1626 * of the SRG.
1627 */
1628 u8 he_spr_partial_bssid_bitmap[8];
Hai Shalomfdcde762020-04-02 11:19:20 -07001629
1630 /**
1631 * he_bss_color - Whether the BSS Color is disabled
1632 */
1633 int he_bss_color_disabled;
1634
1635 /**
1636 * he_bss_color_partial - The BSS Color AID equation
1637 */
1638 int he_bss_color_partial;
1639
1640 /**
1641 * he_bss_color - The BSS Color of the AP
1642 */
1643 int he_bss_color;
1644
1645 /**
1646 * twt_responder - Whether Target Wait Time responder is enabled
1647 */
1648 int twt_responder;
Hai Shalom60840252021-02-19 19:02:11 -08001649
1650 /**
1651 * sae_pwe - SAE mechanism for PWE derivation
1652 * 0 = hunting-and-pecking loop only
1653 * 1 = hash-to-element only
1654 * 2 = both hunting-and-pecking loop and hash-to-element enabled
1655 */
Sunil Ravi77d572f2023-01-17 23:58:31 +00001656 enum sae_pwe sae_pwe;
Hai Shalom60840252021-02-19 19:02:11 -08001657
1658 /**
1659 * FILS Discovery frame minimum interval in TUs
1660 */
1661 u32 fd_min_int;
1662
1663 /**
1664 * FILS Discovery frame maximum interval in TUs (0 = FD frame disabled)
1665 */
1666 u32 fd_max_int;
1667
1668 /**
1669 * FILS Discovery frame template data
1670 */
1671 u8 *fd_frame_tmpl;
1672
1673 /**
1674 * FILS Discovery frame template length
1675 */
1676 size_t fd_frame_tmpl_len;
1677
1678 /**
1679 * Unsolicited broadcast Probe Response interval in TUs
1680 */
1681 unsigned int unsol_bcast_probe_resp_interval;
1682
1683 /**
1684 * Unsolicited broadcast Probe Response template data
1685 */
1686 u8 *unsol_bcast_probe_resp_tmpl;
1687
1688 /**
1689 * Unsolicited broadcast Probe Response template length
1690 */
1691 size_t unsol_bcast_probe_resp_tmpl_len;
Sunil Ravi77d572f2023-01-17 23:58:31 +00001692
1693 /**
1694 * mbssid_tx_iface - Transmitting interface of the MBSSID set
1695 */
1696 const char *mbssid_tx_iface;
1697
1698 /**
1699 * mbssid_index - The index of this BSS in the MBSSID set
1700 */
1701 unsigned int mbssid_index;
1702
1703 /**
1704 * mbssid_elem - Buffer containing all MBSSID elements
1705 */
1706 u8 *mbssid_elem;
1707
1708 /**
1709 * mbssid_elem_len - Total length of all MBSSID elements
1710 */
1711 size_t mbssid_elem_len;
1712
1713 /**
1714 * mbssid_elem_count - The number of MBSSID elements
1715 */
1716 u8 mbssid_elem_count;
1717
1718 /**
1719 * mbssid_elem_offset - Offsets to elements in mbssid_elem.
1720 * Kernel will use these offsets to generate multiple BSSID beacons.
1721 */
1722 u8 **mbssid_elem_offset;
1723
1724 /**
1725 * ema - Enhanced MBSSID advertisements support.
1726 */
1727 bool ema;
Sunil Ravi036cec52023-03-29 11:35:17 -07001728
1729 /**
1730 * punct_bitmap - Preamble puncturing bitmap
1731 * Each bit corresponds to a 20 MHz subchannel, the lowest bit for the
1732 * channel with the lowest frequency. A bit set to 1 indicates that the
1733 * subchannel is punctured, otherwise active.
1734 */
1735 u16 punct_bitmap;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001736};
1737
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001738struct wpa_driver_mesh_bss_params {
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001739#define WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS 0x00000001
1740#define WPA_DRIVER_MESH_CONF_FLAG_PEER_LINK_TIMEOUT 0x00000002
1741#define WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS 0x00000004
1742#define WPA_DRIVER_MESH_CONF_FLAG_HT_OP_MODE 0x00000008
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001743#define WPA_DRIVER_MESH_CONF_FLAG_RSSI_THRESHOLD 0x00000010
Hai Shalomc1a21442022-02-04 13:43:00 -08001744#define WPA_DRIVER_MESH_CONF_FLAG_FORWARDING 0x00000020
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001745 /*
1746 * TODO: Other mesh configuration parameters would go here.
1747 * See NL80211_MESHCONF_* for all the mesh config parameters.
1748 */
1749 unsigned int flags;
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001750 int auto_plinks;
Dmitry Shmidt2f74e362015-01-21 13:19:05 -08001751 int peer_link_timeout;
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001752 int max_peer_links;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001753 int rssi_threshold;
Hai Shalomc1a21442022-02-04 13:43:00 -08001754 int forwarding;
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001755 u16 ht_opmode;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001756};
1757
1758struct wpa_driver_mesh_join_params {
1759 const u8 *meshid;
1760 int meshid_len;
1761 const int *basic_rates;
1762 const u8 *ies;
1763 int ie_len;
Dmitry Shmidtff787d52015-01-12 13:01:47 -08001764 struct hostapd_freq_params freq;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001765 int beacon_int;
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07001766 int dtim_period;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001767 struct wpa_driver_mesh_bss_params conf;
1768#define WPA_DRIVER_MESH_FLAG_USER_MPM 0x00000001
1769#define WPA_DRIVER_MESH_FLAG_DRIVER_MPM 0x00000002
1770#define WPA_DRIVER_MESH_FLAG_SAE_AUTH 0x00000004
1771#define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008
1772 unsigned int flags;
Hai Shalom60840252021-02-19 19:02:11 -08001773 bool handle_dfs;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001774};
1775
Hai Shalomfdcde762020-04-02 11:19:20 -07001776struct wpa_driver_set_key_params {
1777 /**
1778 * ifname - Interface name (for multi-SSID/VLAN support) */
1779 const char *ifname;
1780
1781 /**
1782 * alg - Encryption algorithm
1783 *
1784 * (%WPA_ALG_NONE, %WPA_ALG_WEP, %WPA_ALG_TKIP, %WPA_ALG_CCMP,
Hai Shalom4fbc08f2020-05-18 12:37:00 -07001785 * %WPA_ALG_BIP_AES_CMAC_128, %WPA_ALG_GCMP, %WPA_ALG_GCMP_256,
1786 * %WPA_ALG_CCMP_256, %WPA_ALG_BIP_GMAC_128, %WPA_ALG_BIP_GMAC_256,
1787 * %WPA_ALG_BIP_CMAC_256);
Hai Shalomfdcde762020-04-02 11:19:20 -07001788 * %WPA_ALG_NONE clears the key. */
1789 enum wpa_alg alg;
1790
1791 /**
1792 * addr - Address of the peer STA
1793 *
1794 * (BSSID of the current AP when setting pairwise key in station mode),
1795 * ff:ff:ff:ff:ff:ff for broadcast keys, %NULL for default keys that
1796 * are used both for broadcast and unicast; when clearing keys, %NULL
1797 * is used to indicate that both the broadcast-only and default key of
1798 * the specified key index is to be cleared */
1799 const u8 *addr;
1800
1801 /**
1802 * key_idx - Key index
1803 *
1804 * (0..3), usually 0 for unicast keys; 4..5 for IGTK; 6..7 for BIGTK */
1805 int key_idx;
1806
1807 /**
1808 * set_tx - Configure this key as the default Tx key
1809 *
1810 * Only used when driver does not support separate unicast/individual
1811 * key */
1812 int set_tx;
1813
1814 /**
1815 * seq - Sequence number/packet number
1816 *
1817 * seq_len octets, the next packet number to be used for in replay
1818 * protection; configured for Rx keys (in most cases, this is only used
1819 * with broadcast keys and set to zero for unicast keys); %NULL if not
1820 * set */
1821 const u8 *seq;
1822
1823 /**
1824 * seq_len - Length of the seq, depends on the algorithm
1825 *
1826 * TKIP: 6 octets, CCMP/GCMP: 6 octets, IGTK: 6 octets */
1827 size_t seq_len;
1828
1829 /**
1830 * key - Key buffer
1831 *
1832 * TKIP: 16-byte temporal key, 8-byte Tx Mic key, 8-byte Rx Mic Key */
1833 const u8 *key;
1834
1835 /**
1836 * key_len - Length of the key buffer in octets
1837 *
1838 * WEP: 5 or 13, TKIP: 32, CCMP/GCMP: 16, IGTK: 16 */
1839 size_t key_len;
1840
1841 /**
1842 * vlan_id - VLAN index (0..4095) for VLAN offload cases */
1843 int vlan_id;
1844
1845 /**
1846 * key_flag - Additional key flags
1847 *
1848 * %KEY_FLAG_MODIFY
1849 * Set when an already installed key must be updated.
1850 * So far the only use-case is changing RX/TX status for
1851 * pairwise keys. Must not be set when deleting a key.
1852 * %KEY_FLAG_DEFAULT
1853 * Set when the key is also a default key. Must not be set when
1854 * deleting a key.
1855 * %KEY_FLAG_RX
1856 * The key is valid for RX. Must not be set when deleting a key.
1857 * %KEY_FLAG_TX
1858 * The key is valid for TX. Must not be set when deleting a key.
1859 * %KEY_FLAG_GROUP
1860 * The key is a broadcast or group key.
1861 * %KEY_FLAG_PAIRWISE
1862 * The key is a pairwise key.
1863 * %KEY_FLAG_PMK
1864 * The key is a Pairwise Master Key (PMK).
1865 *
1866 * Valid and pre-defined combinations are:
1867 * %KEY_FLAG_GROUP_RX_TX
1868 * WEP key not to be installed as default key.
1869 * %KEY_FLAG_GROUP_RX_TX_DEFAULT
1870 * Default WEP or WPA-NONE key.
1871 * %KEY_FLAG_GROUP_RX
1872 * GTK key valid for RX only.
1873 * %KEY_FLAG_GROUP_TX_DEFAULT
1874 * GTK key valid for TX only, immediately taking over TX.
1875 * %KEY_FLAG_PAIRWISE_RX_TX
1876 * Pairwise key immediately becoming the active pairwise key.
1877 * %KEY_FLAG_PAIRWISE_RX
1878 * Pairwise key not yet valid for TX. (Only usable when Extended
1879 * Key ID is supported by the driver.)
1880 * %KEY_FLAG_PAIRWISE_RX_TX_MODIFY
1881 * Enable TX for a pairwise key installed with
1882 * KEY_FLAG_PAIRWISE_RX.
1883 *
1884 * Not a valid standalone key type but pre-defined to be combined
1885 * with other key_flags:
1886 * %KEY_FLAG_RX_TX
1887 * RX/TX key. */
1888 enum key_flag key_flag;
Sunil Ravi77d572f2023-01-17 23:58:31 +00001889
1890 /**
1891 * link_id - MLO Link ID
1892 *
1893 * Set to a valid Link ID (0-14) when applicable, otherwise -1. */
1894 int link_id;
Hai Shalomfdcde762020-04-02 11:19:20 -07001895};
1896
Hai Shalom4fbc08f2020-05-18 12:37:00 -07001897enum wpa_driver_if_type {
1898 /**
1899 * WPA_IF_STATION - Station mode interface
1900 */
1901 WPA_IF_STATION,
1902
1903 /**
1904 * WPA_IF_AP_VLAN - AP mode VLAN interface
1905 *
1906 * This interface shares its address and Beacon frame with the main
1907 * BSS.
1908 */
1909 WPA_IF_AP_VLAN,
1910
1911 /**
1912 * WPA_IF_AP_BSS - AP mode BSS interface
1913 *
1914 * This interface has its own address and Beacon frame.
1915 */
1916 WPA_IF_AP_BSS,
1917
1918 /**
1919 * WPA_IF_P2P_GO - P2P Group Owner
1920 */
1921 WPA_IF_P2P_GO,
1922
1923 /**
1924 * WPA_IF_P2P_CLIENT - P2P Client
1925 */
1926 WPA_IF_P2P_CLIENT,
1927
1928 /**
1929 * WPA_IF_P2P_GROUP - P2P Group interface (will become either
1930 * WPA_IF_P2P_GO or WPA_IF_P2P_CLIENT, but the role is not yet known)
1931 */
1932 WPA_IF_P2P_GROUP,
1933
1934 /**
Sunil Ravia04bd252022-05-02 22:54:18 -07001935 * WPA_IF_P2P_DEVICE - P2P Device interface is used to identify the
Hai Shalom4fbc08f2020-05-18 12:37:00 -07001936 * abstracted P2P Device function in the driver
1937 */
1938 WPA_IF_P2P_DEVICE,
1939
1940 /*
1941 * WPA_IF_MESH - Mesh interface
1942 */
1943 WPA_IF_MESH,
1944
1945 /*
1946 * WPA_IF_TDLS - TDLS offchannel interface (used for pref freq only)
1947 */
1948 WPA_IF_TDLS,
1949
1950 /*
1951 * WPA_IF_IBSS - IBSS interface (used for pref freq only)
1952 */
1953 WPA_IF_IBSS,
1954
1955 /*
1956 * WPA_IF_NAN - NAN Device
1957 */
1958 WPA_IF_NAN,
1959
1960 /* keep last */
1961 WPA_IF_MAX
1962};
1963
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001964/**
1965 * struct wpa_driver_capa - Driver capability information
1966 */
1967struct wpa_driver_capa {
1968#define WPA_DRIVER_CAPA_KEY_MGMT_WPA 0x00000001
1969#define WPA_DRIVER_CAPA_KEY_MGMT_WPA2 0x00000002
1970#define WPA_DRIVER_CAPA_KEY_MGMT_WPA_PSK 0x00000004
1971#define WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK 0x00000008
1972#define WPA_DRIVER_CAPA_KEY_MGMT_WPA_NONE 0x00000010
1973#define WPA_DRIVER_CAPA_KEY_MGMT_FT 0x00000020
1974#define WPA_DRIVER_CAPA_KEY_MGMT_FT_PSK 0x00000040
Dmitry Shmidtd5e49232012-12-03 15:08:10 -08001975#define WPA_DRIVER_CAPA_KEY_MGMT_WAPI_PSK 0x00000080
Dmitry Shmidt807291d2015-01-27 13:40:23 -08001976#define WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B 0x00000100
1977#define WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B_192 0x00000200
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001978#define WPA_DRIVER_CAPA_KEY_MGMT_OWE 0x00000400
1979#define WPA_DRIVER_CAPA_KEY_MGMT_DPP 0x00000800
1980#define WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA256 0x00001000
1981#define WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA384 0x00002000
1982#define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA256 0x00004000
1983#define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA384 0x00008000
Hai Shalom74f70d42019-02-11 14:42:39 -08001984#define WPA_DRIVER_CAPA_KEY_MGMT_SAE 0x00010000
Tanmay Garga7fd80d2020-05-18 15:52:44 +05301985#define WPA_DRIVER_CAPA_KEY_MGMT_802_1X_SHA256 0x00020000
1986#define WPA_DRIVER_CAPA_KEY_MGMT_PSK_SHA256 0x00040000
1987#define WPA_DRIVER_CAPA_KEY_MGMT_TPK_HANDSHAKE 0x00080000
1988#define WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE 0x00100000
1989#define WPA_DRIVER_CAPA_KEY_MGMT_FT_802_1X_SHA384 0x00200000
1990#define WPA_DRIVER_CAPA_KEY_MGMT_CCKM 0x00400000
1991#define WPA_DRIVER_CAPA_KEY_MGMT_OSEN 0x00800000
Sunil Ravi89eba102022-09-13 21:04:37 -07001992#define WPA_DRIVER_CAPA_KEY_MGMT_SAE_EXT_KEY 0x01000000
1993#define WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE_EXT_KEY 0x02000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001994 /** Bitfield of supported key management suites */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001995 unsigned int key_mgmt;
Hai Shalom4fbc08f2020-05-18 12:37:00 -07001996 unsigned int key_mgmt_iftype[WPA_IF_MAX];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001997
1998#define WPA_DRIVER_CAPA_ENC_WEP40 0x00000001
1999#define WPA_DRIVER_CAPA_ENC_WEP104 0x00000002
2000#define WPA_DRIVER_CAPA_ENC_TKIP 0x00000004
2001#define WPA_DRIVER_CAPA_ENC_CCMP 0x00000008
Dmitry Shmidt04949592012-07-19 12:16:46 -07002002#define WPA_DRIVER_CAPA_ENC_WEP128 0x00000010
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07002003#define WPA_DRIVER_CAPA_ENC_GCMP 0x00000020
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08002004#define WPA_DRIVER_CAPA_ENC_GCMP_256 0x00000040
2005#define WPA_DRIVER_CAPA_ENC_CCMP_256 0x00000080
2006#define WPA_DRIVER_CAPA_ENC_BIP 0x00000100
2007#define WPA_DRIVER_CAPA_ENC_BIP_GMAC_128 0x00000200
2008#define WPA_DRIVER_CAPA_ENC_BIP_GMAC_256 0x00000400
2009#define WPA_DRIVER_CAPA_ENC_BIP_CMAC_256 0x00000800
Dmitry Shmidtf21452a2014-02-26 10:55:25 -08002010#define WPA_DRIVER_CAPA_ENC_GTK_NOT_USED 0x00001000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002011 /** Bitfield of supported cipher suites */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002012 unsigned int enc;
2013
2014#define WPA_DRIVER_AUTH_OPEN 0x00000001
2015#define WPA_DRIVER_AUTH_SHARED 0x00000002
2016#define WPA_DRIVER_AUTH_LEAP 0x00000004
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002017 /** Bitfield of supported IEEE 802.11 authentication algorithms */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002018 unsigned int auth;
2019
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002020/** Driver generated WPA/RSN IE */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002021#define WPA_DRIVER_FLAGS_DRIVER_IE 0x00000001
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002022/** Driver needs static WEP key setup after association command */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002023#define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC 0x00000002
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002024/** Driver takes care of all DFS operations */
Dmitry Shmidtd11f0192014-03-24 12:09:47 -07002025#define WPA_DRIVER_FLAGS_DFS_OFFLOAD 0x00000004
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002026/** Driver takes care of RSN 4-way handshake internally; PMK is configured with
Hai Shalomfdcde762020-04-02 11:19:20 -07002027 * struct wpa_driver_ops::set_key using key_flag = KEY_FLAG_PMK */
Hai Shalom74f70d42019-02-11 14:42:39 -08002028#define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X 0x00000008
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002029/** Driver is for a wired Ethernet interface */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002030#define WPA_DRIVER_FLAGS_WIRED 0x00000010
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002031/** Driver provides separate commands for authentication and association (SME in
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002032 * wpa_supplicant). */
2033#define WPA_DRIVER_FLAGS_SME 0x00000020
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002034/** Driver supports AP mode */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002035#define WPA_DRIVER_FLAGS_AP 0x00000040
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002036/** Driver needs static WEP key setup after association has been completed */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002037#define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE 0x00000080
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002038/** Driver supports dynamic HT 20/40 MHz channel changes during BSS lifetime */
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07002039#define WPA_DRIVER_FLAGS_HT_2040_COEX 0x00000100
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002040/** Driver supports concurrent P2P operations */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002041#define WPA_DRIVER_FLAGS_P2P_CONCURRENT 0x00000200
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002042/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002043 * Driver uses the initial interface as a dedicated management interface, i.e.,
2044 * it cannot be used for P2P group operations or non-P2P purposes.
2045 */
2046#define WPA_DRIVER_FLAGS_P2P_DEDICATED_INTERFACE 0x00000400
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002047/** This interface is P2P capable (P2P GO or P2P Client) */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002048#define WPA_DRIVER_FLAGS_P2P_CAPABLE 0x00000800
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002049/** Driver supports station and key removal when stopping an AP */
Dmitry Shmidta38abf92014-03-06 13:38:44 -08002050#define WPA_DRIVER_FLAGS_AP_TEARDOWN_SUPPORT 0x00001000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002051/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002052 * Driver uses the initial interface for P2P management interface and non-P2P
2053 * purposes (e.g., connect to infra AP), but this interface cannot be used for
2054 * P2P group operations.
2055 */
2056#define WPA_DRIVER_FLAGS_P2P_MGMT_AND_NON_P2P 0x00002000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002057/**
Hai Shalomc1a21442022-02-04 13:43:00 -08002058 * Driver is known to use valid error codes, i.e., when it indicates that
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002059 * something (e.g., association) fails, there was indeed a failure and the
2060 * operation does not end up getting completed successfully later.
2061 */
Hai Shalomc1a21442022-02-04 13:43:00 -08002062#define WPA_DRIVER_FLAGS_VALID_ERROR_CODES 0x00004000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002063/** Driver supports off-channel TX */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002064#define WPA_DRIVER_FLAGS_OFFCHANNEL_TX 0x00008000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002065/** Driver indicates TX status events for EAPOL Data frames */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002066#define WPA_DRIVER_FLAGS_EAPOL_TX_STATUS 0x00010000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002067/** Driver indicates TX status events for Deauth/Disassoc frames */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002068#define WPA_DRIVER_FLAGS_DEAUTH_TX_STATUS 0x00020000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002069/** Driver supports roaming (BSS selection) in firmware */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002070#define WPA_DRIVER_FLAGS_BSS_SELECTION 0x00040000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002071/** Driver supports operating as a TDLS peer */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002072#define WPA_DRIVER_FLAGS_TDLS_SUPPORT 0x00080000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002073/** Driver requires external TDLS setup/teardown/discovery */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002074#define WPA_DRIVER_FLAGS_TDLS_EXTERNAL_SETUP 0x00100000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002075/** Driver indicates support for Probe Response offloading in AP mode */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002076#define WPA_DRIVER_FLAGS_PROBE_RESP_OFFLOAD 0x00200000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002077/** Driver supports U-APSD in AP mode */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002078#define WPA_DRIVER_FLAGS_AP_UAPSD 0x00400000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002079/** Driver supports inactivity timer in AP mode */
Dmitry Shmidt04949592012-07-19 12:16:46 -07002080#define WPA_DRIVER_FLAGS_INACTIVITY_TIMER 0x00800000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002081/** Driver expects user space implementation of MLME in AP mode */
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07002082#define WPA_DRIVER_FLAGS_AP_MLME 0x01000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002083/** Driver supports SAE with user space SME */
Dmitry Shmidtd5e49232012-12-03 15:08:10 -08002084#define WPA_DRIVER_FLAGS_SAE 0x02000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002085/** Driver makes use of OBSS scan mechanism in wpa_supplicant */
Dmitry Shmidtd5e49232012-12-03 15:08:10 -08002086#define WPA_DRIVER_FLAGS_OBSS_SCAN 0x04000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002087/** Driver supports IBSS (Ad-hoc) mode */
Dmitry Shmidt700a1372013-03-15 14:14:44 -07002088#define WPA_DRIVER_FLAGS_IBSS 0x08000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002089/** Driver supports radar detection */
Dmitry Shmidtea69e842013-05-13 14:52:28 -07002090#define WPA_DRIVER_FLAGS_RADAR 0x10000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002091/** Driver supports a dedicated interface for P2P Device */
Dmitry Shmidt34af3062013-07-11 10:46:32 -07002092#define WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE 0x20000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002093/** Driver supports QoS Mapping */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08002094#define WPA_DRIVER_FLAGS_QOS_MAPPING 0x40000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002095/** Driver supports CSA in AP mode */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08002096#define WPA_DRIVER_FLAGS_AP_CSA 0x80000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002097/** Driver supports mesh */
2098#define WPA_DRIVER_FLAGS_MESH 0x0000000100000000ULL
2099/** Driver support ACS offload */
2100#define WPA_DRIVER_FLAGS_ACS_OFFLOAD 0x0000000200000000ULL
2101/** Driver supports key management offload */
2102#define WPA_DRIVER_FLAGS_KEY_MGMT_OFFLOAD 0x0000000400000000ULL
2103/** Driver supports TDLS channel switching */
2104#define WPA_DRIVER_FLAGS_TDLS_CHANNEL_SWITCH 0x0000000800000000ULL
Dmitry Shmidtff787d52015-01-12 13:01:47 -08002105/** Driver supports IBSS with HT datarates */
2106#define WPA_DRIVER_FLAGS_HT_IBSS 0x0000001000000000ULL
Dmitry Shmidt7f656022015-02-25 14:36:37 -08002107/** Driver supports IBSS with VHT datarates */
2108#define WPA_DRIVER_FLAGS_VHT_IBSS 0x0000002000000000ULL
Dmitry Shmidtb1e52102015-05-29 12:36:29 -07002109/** Driver supports automatic band selection */
2110#define WPA_DRIVER_FLAGS_SUPPORT_HW_MODE_ANY 0x0000004000000000ULL
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002111/** Driver supports simultaneous off-channel operations */
2112#define WPA_DRIVER_FLAGS_OFFCHANNEL_SIMULTANEOUS 0x0000008000000000ULL
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002113/** Driver supports full AP client state */
2114#define WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE 0x0000010000000000ULL
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07002115/** Driver supports P2P Listen offload */
2116#define WPA_DRIVER_FLAGS_P2P_LISTEN_OFFLOAD 0x0000020000000000ULL
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08002117/** Driver supports FILS */
2118#define WPA_DRIVER_FLAGS_SUPPORT_FILS 0x0000040000000000ULL
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08002119/** Driver supports Beacon frame TX rate configuration (legacy rates) */
2120#define WPA_DRIVER_FLAGS_BEACON_RATE_LEGACY 0x0000080000000000ULL
2121/** Driver supports Beacon frame TX rate configuration (HT rates) */
2122#define WPA_DRIVER_FLAGS_BEACON_RATE_HT 0x0000100000000000ULL
2123/** Driver supports Beacon frame TX rate configuration (VHT rates) */
2124#define WPA_DRIVER_FLAGS_BEACON_RATE_VHT 0x0000200000000000ULL
Dmitry Shmidtebd93af2017-02-21 13:40:44 -08002125/** Driver supports mgmt_tx with random TX address in non-connected state */
2126#define WPA_DRIVER_FLAGS_MGMT_TX_RANDOM_TA 0x0000400000000000ULL
2127/** Driver supports mgmt_tx with random TX addr in connected state */
2128#define WPA_DRIVER_FLAGS_MGMT_TX_RANDOM_TA_CONNECTED 0x0000800000000000ULL
2129/** Driver supports better BSS reporting with sched_scan in connected mode */
2130#define WPA_DRIVER_FLAGS_SCHED_SCAN_RELATIVE_RSSI 0x0001000000000000ULL
2131/** Driver supports HE capabilities */
2132#define WPA_DRIVER_FLAGS_HE_CAPABILITIES 0x0002000000000000ULL
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002133/** Driver supports FILS shared key offload */
2134#define WPA_DRIVER_FLAGS_FILS_SK_OFFLOAD 0x0004000000000000ULL
2135/** Driver supports all OCE STA specific mandatory features */
2136#define WPA_DRIVER_FLAGS_OCE_STA 0x0008000000000000ULL
2137/** Driver supports all OCE AP specific mandatory features */
2138#define WPA_DRIVER_FLAGS_OCE_AP 0x0010000000000000ULL
2139/**
2140 * Driver supports all OCE STA-CFON specific mandatory features only.
2141 * If a driver sets this bit but not the %WPA_DRIVER_FLAGS_OCE_AP, the
2142 * userspace shall assume that this driver may not support all OCE AP
2143 * functionality but can support only OCE STA-CFON functionality.
2144 */
2145#define WPA_DRIVER_FLAGS_OCE_STA_CFON 0x0020000000000000ULL
Roshan Pius3a1667e2018-07-03 15:17:14 -07002146/** Driver supports MFP-optional in the connect command */
2147#define WPA_DRIVER_FLAGS_MFP_OPTIONAL 0x0040000000000000ULL
Hai Shalom39ba6fc2019-01-22 12:40:38 -08002148/** Driver is a self-managed regulatory device */
2149#define WPA_DRIVER_FLAGS_SELF_MANAGED_REGULATORY 0x0080000000000000ULL
Hai Shalom74f70d42019-02-11 14:42:39 -08002150/** Driver supports FTM responder functionality */
2151#define WPA_DRIVER_FLAGS_FTM_RESPONDER 0x0100000000000000ULL
2152/** Driver support 4-way handshake offload for WPA-Personal */
2153#define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK 0x0200000000000000ULL
Hai Shalomb755a2a2020-04-23 21:49:02 -07002154/** Driver supports a separate control port TX for EAPOL frames */
Hai Shalomfdcde762020-04-02 11:19:20 -07002155#define WPA_DRIVER_FLAGS_CONTROL_PORT 0x0400000000000000ULL
2156/** Driver supports VLAN offload */
2157#define WPA_DRIVER_FLAGS_VLAN_OFFLOAD 0x0800000000000000ULL
2158/** Driver supports UPDATE_FT_IES command */
2159#define WPA_DRIVER_FLAGS_UPDATE_FT_IES 0x1000000000000000ULL
2160/** Driver can correctly rekey PTKs without Extended Key ID */
2161#define WPA_DRIVER_FLAGS_SAFE_PTK0_REKEYS 0x2000000000000000ULL
2162/** Driver supports Beacon protection */
2163#define WPA_DRIVER_FLAGS_BEACON_PROTECTION 0x4000000000000000ULL
2164/** Driver supports Extended Key ID */
2165#define WPA_DRIVER_FLAGS_EXTENDED_KEY_ID 0x8000000000000000ULL
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002166 u64 flags;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002167
Hai Shalomb755a2a2020-04-23 21:49:02 -07002168/** Driver supports a separate control port RX for EAPOL frames */
2169#define WPA_DRIVER_FLAGS2_CONTROL_PORT_RX 0x0000000000000001ULL
Hai Shalom899fcc72020-10-19 14:38:18 -07002170/** Driver supports TX status reports for EAPOL frames through control port */
2171#define WPA_DRIVER_FLAGS2_CONTROL_PORT_TX_STATUS 0x0000000000000002ULL
Sunil Ravi89eba102022-09-13 21:04:37 -07002172/** Driver supports secure LTF in AP mode */
2173#define WPA_DRIVER_FLAGS2_SEC_LTF_AP 0x0000000000000004ULL
2174/** Driver supports secure RTT measurement exchange in AP mode */
2175#define WPA_DRIVER_FLAGS2_SEC_RTT_AP 0x0000000000000008ULL
Hai Shalom60840252021-02-19 19:02:11 -08002176/**
2177 * Driver supports protection of range negotiation and measurement management
Sunil Ravi89eba102022-09-13 21:04:37 -07002178 * frames in AP mode
Hai Shalom60840252021-02-19 19:02:11 -08002179 */
Sunil Ravi89eba102022-09-13 21:04:37 -07002180#define WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_AP 0x0000000000000010ULL
Hai Shalom60840252021-02-19 19:02:11 -08002181/** Driver supports Beacon frame TX rate configuration (HE rates) */
2182#define WPA_DRIVER_FLAGS2_BEACON_RATE_HE 0x0000000000000020ULL
2183/** Driver supports Beacon protection only in client mode */
2184#define WPA_DRIVER_FLAGS2_BEACON_PROTECTION_CLIENT 0x0000000000000040ULL
2185/** Driver supports Operating Channel Validation */
2186#define WPA_DRIVER_FLAGS2_OCV 0x0000000000000080ULL
2187/** Driver expects user space implementation of SME in AP mode */
2188#define WPA_DRIVER_FLAGS2_AP_SME 0x0000000000000100ULL
Sunil Ravia04bd252022-05-02 22:54:18 -07002189/** Driver handles SA Query procedures in AP mode */
2190#define WPA_DRIVER_FLAGS2_SA_QUERY_OFFLOAD_AP 0x0000000000000200ULL
2191/** Driver supports background radar/CAC detection */
2192#define WPA_DRIVER_RADAR_BACKGROUND 0x0000000000000400ULL
Sunil Ravi89eba102022-09-13 21:04:37 -07002193/** Driver supports secure LTF in STA mode */
2194#define WPA_DRIVER_FLAGS2_SEC_LTF_STA 0x0000000000000800ULL
2195/** Driver supports secure RTT measurement exchange in STA mode */
2196#define WPA_DRIVER_FLAGS2_SEC_RTT_STA 0x0000000000001000ULL
2197/**
2198 * Driver supports protection of range negotiation and measurement management
2199 * frames in STA mode
2200 */
2201#define WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_STA 0x0000000000002000ULL
Sunil Ravi77d572f2023-01-17 23:58:31 +00002202/** Driver supports MLO in station/AP mode */
2203#define WPA_DRIVER_FLAGS2_MLO 0x0000000000004000ULL
Hai Shalomb755a2a2020-04-23 21:49:02 -07002204 u64 flags2;
2205
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002206#define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \
2207 (drv_flags & WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE)
2208
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002209 unsigned int wmm_ac_supported:1;
2210
2211 unsigned int mac_addr_rand_scan_supported:1;
2212 unsigned int mac_addr_rand_sched_scan_supported:1;
2213
2214 /** Maximum number of supported active probe SSIDs */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002215 int max_scan_ssids;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002216
2217 /** Maximum number of supported active probe SSIDs for sched_scan */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002218 int max_sched_scan_ssids;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002219
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08002220 /** Maximum number of supported scan plans for scheduled scan */
2221 unsigned int max_sched_scan_plans;
2222
2223 /** Maximum interval in a scan plan. In seconds */
2224 u32 max_sched_scan_plan_interval;
2225
2226 /** Maximum number of iterations in a single scan plan */
2227 u32 max_sched_scan_plan_iterations;
2228
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002229 /** Whether sched_scan (offloaded scanning) is supported */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002230 int sched_scan_supported;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002231
2232 /** Maximum number of supported match sets for sched_scan */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002233 int max_match_sets;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002234
2235 /**
2236 * max_remain_on_chan - Maximum remain-on-channel duration in msec
2237 */
2238 unsigned int max_remain_on_chan;
2239
2240 /**
2241 * max_stations - Maximum number of associated stations the driver
2242 * supports in AP mode
2243 */
2244 unsigned int max_stations;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002245
2246 /**
2247 * probe_resp_offloads - Bitmap of supported protocols by the driver
2248 * for Probe Response offloading.
2249 */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002250/** Driver Probe Response offloading support for WPS ver. 1 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002251#define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS 0x00000001
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002252/** Driver Probe Response offloading support for WPS ver. 2 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002253#define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS2 0x00000002
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002254/** Driver Probe Response offloading support for P2P */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002255#define WPA_DRIVER_PROBE_RESP_OFFLOAD_P2P 0x00000004
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002256/** Driver Probe Response offloading support for IEEE 802.11u (Interworking) */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002257#define WPA_DRIVER_PROBE_RESP_OFFLOAD_INTERWORKING 0x00000008
2258 unsigned int probe_resp_offloads;
Dmitry Shmidt444d5672013-04-01 13:08:44 -07002259
Dmitry Shmidt8bae4132013-06-06 11:25:10 -07002260 unsigned int max_acl_mac_addrs;
2261
Dmitry Shmidt444d5672013-04-01 13:08:44 -07002262 /**
Dmitry Shmidtc2ebb4b2013-07-24 12:57:51 -07002263 * Number of supported concurrent channels
2264 */
2265 unsigned int num_multichan_concurrent;
2266
2267 /**
Dmitry Shmidt444d5672013-04-01 13:08:44 -07002268 * extended_capa - extended capabilities in driver/device
2269 *
2270 * Must be allocated and freed by driver and the pointers must be
2271 * valid for the lifetime of the driver, i.e., freed in deinit()
2272 */
2273 const u8 *extended_capa, *extended_capa_mask;
2274 unsigned int extended_capa_len;
Dmitry Shmidtb58836e2014-04-29 14:35:56 -07002275
2276 struct wowlan_triggers wowlan_triggers;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002277
2278/** Driver adds the DS Params Set IE in Probe Request frames */
2279#define WPA_DRIVER_FLAGS_DS_PARAM_SET_IE_IN_PROBES 0x00000001
2280/** Driver adds the WFA TPC IE in Probe Request frames */
2281#define WPA_DRIVER_FLAGS_WFA_TPC_IE_IN_PROBES 0x00000002
2282/** Driver handles quiet period requests */
2283#define WPA_DRIVER_FLAGS_QUIET 0x00000004
2284/**
2285 * Driver is capable of inserting the current TX power value into the body of
2286 * transmitted frames.
2287 * Background: Some Action frames include a TPC Report IE. This IE contains a
2288 * TX power field, which has to be updated by lower layers. One such Action
2289 * frame is Link Measurement Report (part of RRM). Another is TPC Report (part
2290 * of spectrum management). Note that this insertion takes place at a fixed
2291 * offset, namely the 6th byte in the Action frame body.
2292 */
2293#define WPA_DRIVER_FLAGS_TX_POWER_INSERTION 0x00000008
Dmitry Shmidt849734c2016-05-27 09:59:01 -07002294/**
2295 * Driver supports RRM. With this support, the driver will accept to use RRM in
2296 * (Re)Association Request frames, without supporting quiet period.
2297 */
2298#define WPA_DRIVER_FLAGS_SUPPORT_RRM 0x00000010
2299
Dmitry Shmidt29333592017-01-09 12:27:11 -08002300/** Driver supports setting the scan dwell time */
2301#define WPA_DRIVER_FLAGS_SUPPORT_SET_SCAN_DWELL 0x00000020
2302/** Driver supports Beacon Report Measurement */
2303#define WPA_DRIVER_FLAGS_SUPPORT_BEACON_REPORT 0x00000040
2304
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002305 u32 rrm_flags;
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002306
2307 /* Driver concurrency capabilities */
2308 unsigned int conc_capab;
2309 /* Maximum number of concurrent channels on 2.4 GHz */
2310 unsigned int max_conc_chan_2_4;
2311 /* Maximum number of concurrent channels on 5 GHz */
2312 unsigned int max_conc_chan_5_0;
2313
2314 /* Maximum number of supported CSA counters */
2315 u16 max_csa_counters;
Sunil Ravi89eba102022-09-13 21:04:37 -07002316
2317 /* Maximum number of supported AKM suites in commands */
2318 unsigned int max_num_akms;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002319
2320 /* Maximum number of interfaces supported for MBSSID advertisement */
2321 unsigned int mbssid_max_interfaces;
2322 /* Maximum profile periodicity for enhanced MBSSID advertisement */
2323 unsigned int ema_max_periodicity;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002324};
2325
2326
2327struct hostapd_data;
2328
Sunil Ravi036cec52023-03-29 11:35:17 -07002329enum guard_interval {
2330 GUARD_INTERVAL_0_4 = 1,
2331 GUARD_INTERVAL_0_8 = 2,
2332 GUARD_INTERVAL_1_6 = 3,
2333 GUARD_INTERVAL_3_2 = 4,
2334};
2335
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002336#define STA_DRV_DATA_TX_MCS BIT(0)
2337#define STA_DRV_DATA_RX_MCS BIT(1)
2338#define STA_DRV_DATA_TX_VHT_MCS BIT(2)
2339#define STA_DRV_DATA_RX_VHT_MCS BIT(3)
2340#define STA_DRV_DATA_TX_VHT_NSS BIT(4)
2341#define STA_DRV_DATA_RX_VHT_NSS BIT(5)
2342#define STA_DRV_DATA_TX_SHORT_GI BIT(6)
2343#define STA_DRV_DATA_RX_SHORT_GI BIT(7)
Roshan Pius3a1667e2018-07-03 15:17:14 -07002344#define STA_DRV_DATA_LAST_ACK_RSSI BIT(8)
Hai Shalomc1a21442022-02-04 13:43:00 -08002345#define STA_DRV_DATA_CONN_TIME BIT(9)
Sunil Ravi77d572f2023-01-17 23:58:31 +00002346#define STA_DRV_DATA_TX_HE_MCS BIT(10)
2347#define STA_DRV_DATA_RX_HE_MCS BIT(11)
2348#define STA_DRV_DATA_TX_HE_NSS BIT(12)
2349#define STA_DRV_DATA_RX_HE_NSS BIT(13)
Sunil Ravi036cec52023-03-29 11:35:17 -07002350#define STA_DRV_DATA_TX_HE_DCM BIT(14)
2351#define STA_DRV_DATA_RX_HE_DCM BIT(15)
2352#define STA_DRV_DATA_TX_HE_GI BIT(16)
2353#define STA_DRV_DATA_RX_HE_GI BIT(17)
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002354
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002355struct hostap_sta_driver_data {
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002356 unsigned long rx_packets, tx_packets;
2357 unsigned long long rx_bytes, tx_bytes;
Hai Shalom81f62d82019-07-22 12:10:00 -07002358 unsigned long long rx_airtime, tx_airtime;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002359 unsigned long long beacons_count;
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002360 int bytes_64bit; /* whether 64-bit byte counters are supported */
Sunil Ravi77d572f2023-01-17 23:58:31 +00002361 unsigned long current_tx_rate; /* in kbps */
2362 unsigned long current_rx_rate; /* in kbps */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002363 unsigned long inactive_msec;
Hai Shalomc1a21442022-02-04 13:43:00 -08002364 unsigned long connected_sec;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002365 unsigned long flags; /* bitfield of STA_DRV_DATA_* */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002366 unsigned long num_ps_buf_frames;
2367 unsigned long tx_retry_failed;
2368 unsigned long tx_retry_count;
Roshan Pius3a1667e2018-07-03 15:17:14 -07002369 s8 last_ack_rssi;
Hai Shalom81f62d82019-07-22 12:10:00 -07002370 unsigned long backlog_packets;
2371 unsigned long backlog_bytes;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002372 unsigned long fcs_error_count;
2373 unsigned long beacon_loss_count;
2374 unsigned long expected_throughput;
2375 unsigned long rx_drop_misc;
2376 unsigned long rx_mpdus;
2377 int signal; /* dBm; or -WPA_INVALID_NOISE */
2378 u8 rx_hemcs;
2379 u8 tx_hemcs;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002380 u8 rx_vhtmcs;
2381 u8 tx_vhtmcs;
2382 u8 rx_mcs;
2383 u8 tx_mcs;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002384 u8 rx_he_nss;
2385 u8 tx_he_nss;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002386 u8 rx_vht_nss;
2387 u8 tx_vht_nss;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002388 s8 avg_signal; /* dBm */
2389 s8 avg_beacon_signal; /* dBm */
2390 s8 avg_ack_signal; /* dBm */
Sunil Ravi036cec52023-03-29 11:35:17 -07002391 enum guard_interval rx_guard_interval, tx_guard_interval;
2392 u8 rx_dcm, tx_dcm;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002393};
2394
2395struct hostapd_sta_add_params {
2396 const u8 *addr;
2397 u16 aid;
2398 u16 capability;
2399 const u8 *supp_rates;
2400 size_t supp_rates_len;
2401 u16 listen_interval;
2402 const struct ieee80211_ht_capabilities *ht_capabilities;
Dmitry Shmidta54fa5f2013-01-15 13:53:35 -08002403 const struct ieee80211_vht_capabilities *vht_capabilities;
Dmitry Shmidtbd14a572014-02-18 10:33:49 -08002404 int vht_opmode_enabled;
2405 u8 vht_opmode;
Hai Shalom81f62d82019-07-22 12:10:00 -07002406 const struct ieee80211_he_capabilities *he_capab;
2407 size_t he_capab_len;
Hai Shalom4fbc08f2020-05-18 12:37:00 -07002408 const struct ieee80211_he_6ghz_band_cap *he_6ghz_capab;
Sunil Ravia04bd252022-05-02 22:54:18 -07002409 const struct ieee80211_eht_capabilities *eht_capab;
2410 size_t eht_capab_len;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002411 u32 flags; /* bitmask of WPA_STA_* flags */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002412 u32 flags_mask; /* unset bits in flags */
2413#ifdef CONFIG_MESH
2414 enum mesh_plink_state plink_state;
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07002415 u16 peer_aid;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002416#endif /* CONFIG_MESH */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002417 int set; /* Set STA parameters instead of add */
2418 u8 qosinfo;
Dmitry Shmidtf8623282013-02-20 14:34:59 -08002419 const u8 *ext_capab;
2420 size_t ext_capab_len;
Dmitry Shmidt344abd32014-01-14 13:17:00 -08002421 const u8 *supp_channels;
2422 size_t supp_channels_len;
2423 const u8 *supp_oper_classes;
2424 size_t supp_oper_classes_len;
Dmitry Shmidt849734c2016-05-27 09:59:01 -07002425 int support_p2p_ps;
Sunil Ravi036cec52023-03-29 11:35:17 -07002426
2427 bool mld_link_sta;
2428 s8 mld_link_id;
2429 const u8 *mld_link_addr;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002430};
2431
Dmitry Shmidt8bae4132013-06-06 11:25:10 -07002432struct mac_address {
2433 u8 addr[ETH_ALEN];
2434};
2435
2436struct hostapd_acl_params {
2437 u8 acl_policy;
2438 unsigned int num_mac_acl;
2439 struct mac_address mac_acl[0];
2440};
2441
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002442struct wpa_init_params {
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002443 void *global_priv;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002444 const u8 *bssid;
2445 const char *ifname;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002446 const char *driver_params;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002447 int use_pae_group_addr;
2448 char **bridge;
2449 size_t num_bridge;
2450
2451 u8 *own_addr; /* buffer for writing own MAC address */
2452};
2453
2454
2455struct wpa_bss_params {
2456 /** Interface name (for multi-SSID/VLAN support) */
2457 const char *ifname;
2458 /** Whether IEEE 802.1X or WPA/WPA2 is enabled */
2459 int enabled;
2460
2461 int wpa;
2462 int ieee802_1x;
2463 int wpa_group;
2464 int wpa_pairwise;
2465 int wpa_key_mgmt;
2466 int rsn_preauth;
2467 enum mfp_options ieee80211w;
2468};
2469
2470#define WPA_STA_AUTHORIZED BIT(0)
2471#define WPA_STA_WMM BIT(1)
2472#define WPA_STA_SHORT_PREAMBLE BIT(2)
2473#define WPA_STA_MFP BIT(3)
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002474#define WPA_STA_TDLS_PEER BIT(4)
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002475#define WPA_STA_AUTHENTICATED BIT(5)
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002476#define WPA_STA_ASSOCIATED BIT(6)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002477
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002478enum tdls_oper {
2479 TDLS_DISCOVERY_REQ,
2480 TDLS_SETUP,
2481 TDLS_TEARDOWN,
2482 TDLS_ENABLE_LINK,
2483 TDLS_DISABLE_LINK,
2484 TDLS_ENABLE,
2485 TDLS_DISABLE
2486};
2487
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07002488enum wnm_oper {
2489 WNM_SLEEP_ENTER_CONFIRM,
2490 WNM_SLEEP_ENTER_FAIL,
2491 WNM_SLEEP_EXIT_CONFIRM,
2492 WNM_SLEEP_EXIT_FAIL,
2493 WNM_SLEEP_TFS_REQ_IE_ADD, /* STA requests driver to add TFS req IE */
2494 WNM_SLEEP_TFS_REQ_IE_NONE, /* STA requests empty TFS req IE */
2495 WNM_SLEEP_TFS_REQ_IE_SET, /* AP requests driver to set TFS req IE for
2496 * a STA */
2497 WNM_SLEEP_TFS_RESP_IE_ADD, /* AP requests driver to add TFS resp IE
2498 * for a STA */
2499 WNM_SLEEP_TFS_RESP_IE_NONE, /* AP requests empty TFS resp IE */
2500 WNM_SLEEP_TFS_RESP_IE_SET, /* AP requests driver to set TFS resp IE
2501 * for a STA */
2502 WNM_SLEEP_TFS_IE_DEL /* AP delete the TFS IE */
2503};
2504
Roshan Pius3a1667e2018-07-03 15:17:14 -07002505/* enum smps_mode - SMPS mode definitions */
2506enum smps_mode {
2507 SMPS_AUTOMATIC,
2508 SMPS_OFF,
2509 SMPS_DYNAMIC,
2510 SMPS_STATIC,
2511
2512 /* Keep last */
2513 SMPS_INVALID,
2514};
2515
Hai Shalom74f70d42019-02-11 14:42:39 -08002516#define WPA_INVALID_NOISE 9999
Dmitry Shmidt34af3062013-07-11 10:46:32 -07002517
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002518/**
2519 * struct wpa_signal_info - Information about channel signal quality
Hai Shalom74f70d42019-02-11 14:42:39 -08002520 * @frequency: control frequency
2521 * @above_threshold: true if the above threshold was crossed
2522 * (relevant for a CQM event)
Sunil Ravi77d572f2023-01-17 23:58:31 +00002523 * @data: STA information
Hai Shalom74f70d42019-02-11 14:42:39 -08002524 * @current_noise: %WPA_INVALID_NOISE if not supported
Hai Shalom74f70d42019-02-11 14:42:39 -08002525 * @chanwidth: channel width
2526 * @center_frq1: center frequency for the first segment
2527 * @center_frq2: center frequency for the second segment (if relevant)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002528 */
2529struct wpa_signal_info {
2530 u32 frequency;
2531 int above_threshold;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002532 struct hostap_sta_driver_data data;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002533 int current_noise;
Dmitry Shmidt34af3062013-07-11 10:46:32 -07002534 enum chan_width chanwidth;
2535 int center_frq1;
2536 int center_frq2;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002537};
2538
Sunil Ravi89eba102022-09-13 21:04:37 -07002539struct wpa_mlo_signal_info {
2540 u16 valid_links;
2541 struct wpa_signal_info links[MAX_NUM_MLD_LINKS];
2542};
2543
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002544/**
Hai Shalom74f70d42019-02-11 14:42:39 -08002545 * struct wpa_channel_info - Information about the current channel
2546 * @frequency: Center frequency of the primary 20 MHz channel
2547 * @chanwidth: Width of the current operating channel
2548 * @sec_channel: Location of the secondary 20 MHz channel (either +1 or -1).
2549 * This field is only filled in when using a 40 MHz channel.
2550 * @center_frq1: Center frequency of frequency segment 0
2551 * @center_frq2: Center frequency of frequency segment 1 (for 80+80 channels)
2552 * @seg1_idx: Frequency segment 1 index when using a 80+80 channel. This is
2553 * derived from center_frq2 for convenience.
2554 */
2555struct wpa_channel_info {
2556 u32 frequency;
2557 enum chan_width chanwidth;
2558 int sec_channel;
2559 int center_frq1;
2560 int center_frq2;
2561 u8 seg1_idx;
2562};
2563
2564/**
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002565 * struct beacon_data - Beacon data
2566 * @head: Head portion of Beacon frame (before TIM IE)
2567 * @tail: Tail portion of Beacon frame (after TIM IE)
2568 * @beacon_ies: Extra information element(s) to add into Beacon frames or %NULL
2569 * @proberesp_ies: Extra information element(s) to add into Probe Response
2570 * frames or %NULL
2571 * @assocresp_ies: Extra information element(s) to add into (Re)Association
2572 * Response frames or %NULL
2573 * @probe_resp: Probe Response frame template
2574 * @head_len: Length of @head
2575 * @tail_len: Length of @tail
2576 * @beacon_ies_len: Length of beacon_ies in octets
2577 * @proberesp_ies_len: Length of proberesp_ies in octets
2578 * @proberesp_ies_len: Length of proberesp_ies in octets
2579 * @probe_resp_len: Length of probe response template (@probe_resp)
2580 */
2581struct beacon_data {
2582 u8 *head, *tail;
2583 u8 *beacon_ies;
2584 u8 *proberesp_ies;
2585 u8 *assocresp_ies;
2586 u8 *probe_resp;
2587
2588 size_t head_len, tail_len;
2589 size_t beacon_ies_len;
2590 size_t proberesp_ies_len;
2591 size_t assocresp_ies_len;
2592 size_t probe_resp_len;
2593};
2594
2595/**
2596 * struct csa_settings - Settings for channel switch command
2597 * @cs_count: Count in Beacon frames (TBTT) to perform the switch
2598 * @block_tx: 1 - block transmission for CSA period
2599 * @freq_params: Next channel frequency parameter
2600 * @beacon_csa: Beacon/probe resp/asooc resp info for CSA period
2601 * @beacon_after: Next beacon/probe resp/asooc resp info
2602 * @counter_offset_beacon: Offset to the count field in beacon's tail
2603 * @counter_offset_presp: Offset to the count field in probe resp.
Sunil Ravi036cec52023-03-29 11:35:17 -07002604 * @punct_bitmap - Preamble puncturing bitmap
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002605 */
2606struct csa_settings {
2607 u8 cs_count;
2608 u8 block_tx;
2609
2610 struct hostapd_freq_params freq_params;
2611 struct beacon_data beacon_csa;
2612 struct beacon_data beacon_after;
2613
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002614 u16 counter_offset_beacon[2];
2615 u16 counter_offset_presp[2];
Sunil Ravi036cec52023-03-29 11:35:17 -07002616
2617 u16 punct_bitmap;
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002618};
2619
Sunil Ravia04bd252022-05-02 22:54:18 -07002620/**
2621 * struct cca_settings - Settings for color switch command
2622 * @cca_count: Count in Beacon frames (TBTT) to perform the switch
2623 * @cca_color: The new color that we are switching to
2624 * @beacon_cca: Beacon/Probe Response/(Re)Association Response frame info for
2625 * color switch period
2626 * @beacon_after: Next Beacon/Probe Response/(Re)Association Response frame info
2627 * @counter_offset_beacon: Offset to the count field in Beacon frame tail
2628 * @counter_offset_presp: Offset to the count field in Probe Response frame
2629 */
2630struct cca_settings {
2631 u8 cca_count;
2632 u8 cca_color;
2633
2634 struct beacon_data beacon_cca;
2635 struct beacon_data beacon_after;
2636
2637 u16 counter_offset_beacon;
2638 u16 counter_offset_presp;
2639};
2640
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07002641/* TDLS peer capabilities for send_tdls_mgmt() */
2642enum tdls_peer_capability {
2643 TDLS_PEER_HT = BIT(0),
2644 TDLS_PEER_VHT = BIT(1),
2645 TDLS_PEER_WMM = BIT(2),
Hai Shalomc1a21442022-02-04 13:43:00 -08002646 TDLS_PEER_HE = BIT(3),
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07002647};
2648
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002649/* valid info in the wmm_params struct */
2650enum wmm_params_valid_info {
2651 WMM_PARAMS_UAPSD_QUEUES_INFO = BIT(0),
2652};
2653
2654/**
2655 * struct wmm_params - WMM parameterss configured for this association
2656 * @info_bitmap: Bitmap of valid wmm_params info; indicates what fields
2657 * of the struct contain valid information.
2658 * @uapsd_queues: Bitmap of ACs configured for uapsd (valid only if
2659 * %WMM_PARAMS_UAPSD_QUEUES_INFO is set)
2660 */
2661struct wmm_params {
2662 u8 info_bitmap;
2663 u8 uapsd_queues;
2664};
2665
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07002666#ifdef CONFIG_MACSEC
2667struct macsec_init_params {
Hai Shalome21d4e82020-04-29 16:34:06 -07002668 bool always_include_sci;
2669 bool use_es;
2670 bool use_scb;
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07002671};
2672#endif /* CONFIG_MACSEC */
2673
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002674enum drv_br_port_attr {
2675 DRV_BR_PORT_ATTR_PROXYARP,
2676 DRV_BR_PORT_ATTR_HAIRPIN_MODE,
Sunil Ravi036cec52023-03-29 11:35:17 -07002677 DRV_BR_PORT_ATTR_MCAST2UCAST,
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002678};
2679
2680enum drv_br_net_param {
2681 DRV_BR_NET_PARAM_GARP_ACCEPT,
Dmitry Shmidt83474442015-04-15 13:47:09 -07002682 DRV_BR_MULTICAST_SNOOPING,
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002683};
2684
2685struct drv_acs_params {
2686 /* Selected mode (HOSTAPD_MODE_*) */
2687 enum hostapd_hw_mode hw_mode;
2688
2689 /* Indicates whether HT is enabled */
2690 int ht_enabled;
2691
2692 /* Indicates whether HT40 is enabled */
2693 int ht40_enabled;
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07002694
2695 /* Indicates whether VHT is enabled */
2696 int vht_enabled;
2697
2698 /* Configured ACS channel width */
2699 u16 ch_width;
2700
Ahmed ElArabawy0ff61c52019-12-26 12:38:39 -08002701 /* ACS frequency list info */
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002702 const int *freq_list;
Hai Shalomfdcde762020-04-02 11:19:20 -07002703
2704 /* Indicates whether EDMG is enabled */
2705 int edmg_enabled;
Sunil Ravia04bd252022-05-02 22:54:18 -07002706
2707 /* Indicates whether EHT is enabled */
2708 bool eht_enabled;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002709};
2710
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002711struct wpa_bss_trans_info {
2712 u8 mbo_transition_reason;
2713 u8 n_candidates;
2714 u8 *bssid;
2715};
2716
2717struct wpa_bss_candidate_info {
2718 u8 num;
2719 struct candidate_list {
2720 u8 bssid[ETH_ALEN];
2721 u8 is_accept;
2722 u32 reject_reason;
2723 } *candidates;
2724};
2725
2726struct wpa_pmkid_params {
2727 const u8 *bssid;
2728 const u8 *ssid;
2729 size_t ssid_len;
2730 const u8 *fils_cache_id;
2731 const u8 *pmkid;
2732 const u8 *pmk;
2733 size_t pmk_len;
Hai Shalomfdcde762020-04-02 11:19:20 -07002734 u32 pmk_lifetime;
2735 u8 pmk_reauth_threshold;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002736};
2737
2738/* Mask used to specify which connection parameters have to be updated */
2739enum wpa_drv_update_connect_params_mask {
2740 WPA_DRV_UPDATE_ASSOC_IES = BIT(0),
2741 WPA_DRV_UPDATE_FILS_ERP_INFO = BIT(1),
2742 WPA_DRV_UPDATE_AUTH_TYPE = BIT(2),
Winnie Chen4138eec2022-11-10 16:32:53 +08002743#if defined(CONFIG_DRIVER_NL80211_BRCM) || defined(CONFIG_DRIVER_NL80211_SYNA)
Vinayak Yadawade62409f2022-01-20 12:32:07 +05302744 WPA_DRV_UPDATE_TD_POLICY = BIT(3),
Winnie Chen4138eec2022-11-10 16:32:53 +08002745#endif /* CONFIG_DRIVER_NL80211_BRCM || CONFIG_DRIVER_NL80211_SYNA */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002746};
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07002747
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002748/**
Roshan Pius3a1667e2018-07-03 15:17:14 -07002749 * struct external_auth - External authentication trigger parameters
2750 *
2751 * These are used across the external authentication request and event
2752 * interfaces.
2753 * @action: Action type / trigger for external authentication. Only significant
2754 * for the event interface.
2755 * @bssid: BSSID of the peer with which the authentication has to happen. Used
2756 * by both the request and event interface.
2757 * @ssid: SSID of the AP. Used by both the request and event interface.
2758 * @ssid_len: SSID length in octets.
2759 * @key_mgmt_suite: AKM suite of the respective authentication. Optional for
2760 * the request interface.
2761 * @status: Status code, %WLAN_STATUS_SUCCESS for successful authentication,
2762 * use %WLAN_STATUS_UNSPECIFIED_FAILURE if wpa_supplicant cannot give
2763 * the real status code for failures. Used only for the request interface
2764 * from user space to the driver.
Hai Shalom5f92bc92019-04-18 11:54:11 -07002765 * @pmkid: Generated PMKID as part of external auth exchange (e.g., SAE).
Sunil Ravi036cec52023-03-29 11:35:17 -07002766 * @mld_addr: AP's MLD address or %NULL if MLO is not used
Roshan Pius3a1667e2018-07-03 15:17:14 -07002767 */
2768struct external_auth {
2769 enum {
2770 EXT_AUTH_START,
2771 EXT_AUTH_ABORT,
2772 } action;
Hai Shalom5f92bc92019-04-18 11:54:11 -07002773 const u8 *bssid;
2774 const u8 *ssid;
Roshan Pius3a1667e2018-07-03 15:17:14 -07002775 size_t ssid_len;
2776 unsigned int key_mgmt_suite;
2777 u16 status;
Hai Shalom5f92bc92019-04-18 11:54:11 -07002778 const u8 *pmkid;
Sunil Ravi036cec52023-03-29 11:35:17 -07002779 const u8 *mld_addr;
Roshan Pius3a1667e2018-07-03 15:17:14 -07002780};
2781
Sunil Ravi89eba102022-09-13 21:04:37 -07002782#define WPAS_MAX_PASN_PEERS 10
2783
2784enum pasn_status {
2785 PASN_STATUS_SUCCESS = 0,
2786 PASN_STATUS_FAILURE = 1,
2787};
2788
2789/**
2790 * struct pasn_peer - PASN peer parameters
2791 *
2792 * Used to process the PASN authentication event from the driver to
2793 * userspace and to send a response back.
2794 * @own_addr: Own MAC address specified by the driver to use for PASN
2795 * handshake.
2796 * @peer_addr: MAC address of the peer with which PASN authentication is to be
2797 * performed.
2798 * @network_id: Unique id for the network.
2799 * This identifier is used as a unique identifier for each network
2800 * block when using the control interface. Each network is allocated an
2801 * id when it is being created, either when reading the configuration
2802 * file or when a new network is added through the control interface.
2803 * @akmp: Authentication key management protocol type supported.
2804 * @cipher: Cipher suite.
2805 * @group: Finite cyclic group. Default group used is 19 (ECC).
2806 * @ltf_keyseed_required: Indicates whether LTF keyseed generation is required
2807 * @status: PASN response status, %PASN_STATUS_SUCCESS for successful
2808 * authentication, use %PASN_STATUS_FAILURE if PASN authentication
2809 * fails or if wpa_supplicant fails to set the security ranging context to
2810 * the driver
2811 */
2812struct pasn_peer {
2813 u8 own_addr[ETH_ALEN];
2814 u8 peer_addr[ETH_ALEN];
2815 int network_id;
2816 int akmp;
2817 int cipher;
2818 int group;
2819 bool ltf_keyseed_required;
2820 enum pasn_status status;
2821};
2822
2823/**
2824 * struct pasn_auth - PASN authentication trigger parameters
2825 *
2826 * These are used across the PASN authentication event from the driver to
2827 * userspace and to send a response to it.
2828 * @action: Action type. Only significant for the event interface.
2829 * @num_peers: The number of peers for which the PASN handshake is requested
2830 * for.
2831 * @peer: Holds the peer details.
2832 */
2833struct pasn_auth {
2834 enum {
2835 PASN_ACTION_AUTH,
2836 PASN_ACTION_DELETE_SECURE_RANGING_CONTEXT,
2837 } action;
2838 unsigned int num_peers;
2839 struct pasn_peer peer[WPAS_MAX_PASN_PEERS];
2840};
2841
2842/**
2843 * struct secure_ranging_params - Parameters required to set secure ranging
2844 * context for a peer.
2845 *
2846 * @action: Add or delete a security context to the driver.
2847 * @own_addr: Own MAC address used during key derivation.
2848 * @peer_addr: Address of the peer device.
2849 * @cipher: Cipher suite.
2850 * @tk_len: Length of temporal key.
2851 * @tk: Temporal key buffer.
2852 * @ltf_keyseed_len: Length of LTF keyseed.
2853 * @ltf_keyeed: LTF keyseed buffer.
2854 */
2855struct secure_ranging_params {
2856 u32 action;
2857 const u8 *own_addr;
2858 const u8 *peer_addr;
2859 u32 cipher;
2860 u8 tk_len;
2861 const u8 *tk;
2862 u8 ltf_keyseed_len;
2863 const u8 *ltf_keyseed;
2864};
2865
Hai Shalom60840252021-02-19 19:02:11 -08002866/* enum nested_attr - Used to specify if subcommand uses nested attributes */
2867enum nested_attr {
2868 NESTED_ATTR_NOT_USED = 0,
2869 NESTED_ATTR_USED = 1,
2870 NESTED_ATTR_UNSPECIFIED = 2,
2871};
2872
Sunil8cd6f4d2022-06-28 18:40:46 +00002873/* Preferred channel list information */
2874
2875/* GO role */
2876#define WEIGHTED_PCL_GO BIT(0)
2877/* P2P Client role */
2878#define WEIGHTED_PCL_CLI BIT(1)
2879/* Must be considered for operating channel */
2880#define WEIGHTED_PCL_MUST_CONSIDER BIT(2)
2881/* Should be excluded in GO negotiation */
2882#define WEIGHTED_PCL_EXCLUDE BIT(3)
2883
2884/* Preferred channel list with weight */
2885struct weighted_pcl {
2886 u32 freq; /* MHz */
2887 u8 weight;
2888 u32 flag; /* bitmap for WEIGHTED_PCL_* */
2889};
2890
Sunil Ravi89eba102022-09-13 21:04:37 -07002891struct driver_sta_mlo_info {
Sunil Ravi77d572f2023-01-17 23:58:31 +00002892 u16 req_links; /* bitmap of requested link IDs */
2893 u16 valid_links; /* bitmap of accepted link IDs */
2894 u8 assoc_link_id;
Sunil Ravi89eba102022-09-13 21:04:37 -07002895 u8 ap_mld_addr[ETH_ALEN];
2896 struct {
2897 u8 addr[ETH_ALEN];
2898 u8 bssid[ETH_ALEN];
2899 unsigned int freq;
2900 } links[MAX_NUM_MLD_LINKS];
2901};
2902
Roshan Pius3a1667e2018-07-03 15:17:14 -07002903/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002904 * struct wpa_driver_ops - Driver interface API definition
2905 *
2906 * This structure defines the API that each driver interface needs to implement
2907 * for core wpa_supplicant code. All driver specific functionality is captured
2908 * in this wrapper.
2909 */
2910struct wpa_driver_ops {
2911 /** Name of the driver interface */
2912 const char *name;
2913 /** One line description of the driver interface */
2914 const char *desc;
2915
2916 /**
2917 * get_bssid - Get the current BSSID
2918 * @priv: private driver interface data
2919 * @bssid: buffer for BSSID (ETH_ALEN = 6 bytes)
2920 *
2921 * Returns: 0 on success, -1 on failure
2922 *
2923 * Query kernel driver for the current BSSID and copy it to bssid.
2924 * Setting bssid to 00:00:00:00:00:00 is recommended if the STA is not
2925 * associated.
2926 */
2927 int (*get_bssid)(void *priv, u8 *bssid);
2928
2929 /**
2930 * get_ssid - Get the current SSID
2931 * @priv: private driver interface data
2932 * @ssid: buffer for SSID (at least 32 bytes)
2933 *
2934 * Returns: Length of the SSID on success, -1 on failure
2935 *
2936 * Query kernel driver for the current SSID and copy it to ssid.
2937 * Returning zero is recommended if the STA is not associated.
2938 *
2939 * Note: SSID is an array of octets, i.e., it is not nul terminated and
2940 * can, at least in theory, contain control characters (including nul)
2941 * and as such, should be processed as binary data, not a printable
2942 * string.
2943 */
2944 int (*get_ssid)(void *priv, u8 *ssid);
2945
2946 /**
2947 * set_key - Configure encryption key
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002948 * @priv: private driver interface data
Hai Shalomfdcde762020-04-02 11:19:20 -07002949 * @params: Key parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002950 * Returns: 0 on success, -1 on failure
2951 *
2952 * Configure the given key for the kernel driver. If the driver
2953 * supports separate individual keys (4 default keys + 1 individual),
2954 * addr can be used to determine whether the key is default or
2955 * individual. If only 4 keys are supported, the default key with key
2956 * index 0 is used as the individual key. STA must be configured to use
2957 * it as the default Tx key (set_tx is set) and accept Rx for all the
2958 * key indexes. In most cases, WPA uses only key indexes 1 and 2 for
2959 * broadcast keys, so key index 0 is available for this kind of
2960 * configuration.
2961 *
2962 * Please note that TKIP keys include separate TX and RX MIC keys and
2963 * some drivers may expect them in different order than wpa_supplicant
2964 * is using. If the TX/RX keys are swapped, all TKIP encrypted packets
2965 * will trigger Michael MIC errors. This can be fixed by changing the
Sunil Ravia04bd252022-05-02 22:54:18 -07002966 * order of MIC keys by swapping the bytes 16..23 and 24..31 of the key
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002967 * in driver_*.c set_key() implementation, see driver_ndis.c for an
2968 * example on how this can be done.
2969 */
Hai Shalomfdcde762020-04-02 11:19:20 -07002970 int (*set_key)(void *priv, struct wpa_driver_set_key_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002971
2972 /**
2973 * init - Initialize driver interface
2974 * @ctx: context to be used when calling wpa_supplicant functions,
2975 * e.g., wpa_supplicant_event()
2976 * @ifname: interface name, e.g., wlan0
2977 *
2978 * Returns: Pointer to private data, %NULL on failure
2979 *
2980 * Initialize driver interface, including event processing for kernel
2981 * driver events (e.g., associated, scan results, Michael MIC failure).
2982 * This function can allocate a private configuration data area for
2983 * @ctx, file descriptor, interface name, etc. information that may be
2984 * needed in future driver operations. If this is not used, non-NULL
2985 * value will need to be returned because %NULL is used to indicate
2986 * failure. The returned value will be used as 'void *priv' data for
2987 * all other driver_ops functions.
2988 *
2989 * The main event loop (eloop.c) of wpa_supplicant can be used to
2990 * register callback for read sockets (eloop_register_read_sock()).
2991 *
2992 * See below for more information about events and
2993 * wpa_supplicant_event() function.
2994 */
2995 void * (*init)(void *ctx, const char *ifname);
2996
2997 /**
2998 * deinit - Deinitialize driver interface
2999 * @priv: private driver interface data from init()
3000 *
3001 * Shut down driver interface and processing of driver events. Free
3002 * private data buffer if one was allocated in init() handler.
3003 */
3004 void (*deinit)(void *priv);
3005
3006 /**
3007 * set_param - Set driver configuration parameters
3008 * @priv: private driver interface data from init()
3009 * @param: driver specific configuration parameters
3010 *
3011 * Returns: 0 on success, -1 on failure
3012 *
3013 * Optional handler for notifying driver interface about configuration
3014 * parameters (driver_param).
3015 */
3016 int (*set_param)(void *priv, const char *param);
3017
3018 /**
3019 * set_countermeasures - Enable/disable TKIP countermeasures
3020 * @priv: private driver interface data
3021 * @enabled: 1 = countermeasures enabled, 0 = disabled
3022 *
3023 * Returns: 0 on success, -1 on failure
3024 *
3025 * Configure TKIP countermeasures. When these are enabled, the driver
3026 * should drop all received and queued frames that are using TKIP.
3027 */
3028 int (*set_countermeasures)(void *priv, int enabled);
3029
3030 /**
3031 * deauthenticate - Request driver to deauthenticate
3032 * @priv: private driver interface data
3033 * @addr: peer address (BSSID of the AP)
3034 * @reason_code: 16-bit reason code to be sent in the deauthentication
3035 * frame
3036 *
3037 * Returns: 0 on success, -1 on failure
3038 */
Hai Shalom81f62d82019-07-22 12:10:00 -07003039 int (*deauthenticate)(void *priv, const u8 *addr, u16 reason_code);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003040
3041 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003042 * associate - Request driver to associate
3043 * @priv: private driver interface data
3044 * @params: association parameters
3045 *
3046 * Returns: 0 on success, -1 on failure
3047 */
3048 int (*associate)(void *priv,
3049 struct wpa_driver_associate_params *params);
3050
3051 /**
3052 * add_pmkid - Add PMKSA cache entry to the driver
3053 * @priv: private driver interface data
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003054 * @params: PMKSA parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003055 *
3056 * Returns: 0 on success, -1 on failure
3057 *
3058 * This function is called when a new PMK is received, as a result of
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003059 * either normal authentication or RSN pre-authentication. The PMKSA
3060 * parameters are either a set of bssid, pmkid, and pmk; or a set of
3061 * ssid, fils_cache_id, pmkid, and pmk.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003062 *
3063 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
3064 * associate(), add_pmkid() can be used to add new PMKSA cache entries
3065 * in the driver. If the driver uses wpa_ie from wpa_supplicant, this
3066 * driver_ops function does not need to be implemented. Likewise, if
3067 * the driver does not support WPA, this function is not needed.
3068 */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003069 int (*add_pmkid)(void *priv, struct wpa_pmkid_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003070
3071 /**
3072 * remove_pmkid - Remove PMKSA cache entry to the driver
3073 * @priv: private driver interface data
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003074 * @params: PMKSA parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003075 *
3076 * Returns: 0 on success, -1 on failure
3077 *
3078 * This function is called when the supplicant drops a PMKSA cache
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003079 * entry for any reason. The PMKSA parameters are either a set of
3080 * bssid and pmkid; or a set of ssid, fils_cache_id, and pmkid.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003081 *
3082 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
3083 * associate(), remove_pmkid() can be used to synchronize PMKSA caches
3084 * between the driver and wpa_supplicant. If the driver uses wpa_ie
3085 * from wpa_supplicant, this driver_ops function does not need to be
3086 * implemented. Likewise, if the driver does not support WPA, this
3087 * function is not needed.
3088 */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003089 int (*remove_pmkid)(void *priv, struct wpa_pmkid_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003090
3091 /**
3092 * flush_pmkid - Flush PMKSA cache
3093 * @priv: private driver interface data
3094 *
3095 * Returns: 0 on success, -1 on failure
3096 *
3097 * This function is called when the supplicant drops all PMKSA cache
3098 * entries for any reason.
3099 *
3100 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
3101 * associate(), remove_pmkid() can be used to synchronize PMKSA caches
3102 * between the driver and wpa_supplicant. If the driver uses wpa_ie
3103 * from wpa_supplicant, this driver_ops function does not need to be
3104 * implemented. Likewise, if the driver does not support WPA, this
3105 * function is not needed.
3106 */
3107 int (*flush_pmkid)(void *priv);
3108
3109 /**
3110 * get_capa - Get driver capabilities
3111 * @priv: private driver interface data
3112 *
3113 * Returns: 0 on success, -1 on failure
3114 *
3115 * Get driver/firmware/hardware capabilities.
3116 */
3117 int (*get_capa)(void *priv, struct wpa_driver_capa *capa);
3118
3119 /**
3120 * poll - Poll driver for association information
3121 * @priv: private driver interface data
3122 *
Sunil Ravi77d572f2023-01-17 23:58:31 +00003123 * This is an optional callback that can be used when the driver does
3124 * not provide event mechanism for association events. This is called
3125 * when receiving WPA/RSN EAPOL-Key messages that require association
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003126 * information. The driver interface is supposed to generate associnfo
3127 * event before returning from this callback function. In addition, the
3128 * driver interface should generate an association event after having
3129 * sent out associnfo.
3130 */
3131 void (*poll)(void *priv);
3132
3133 /**
Dmitry Shmidte4663042016-04-04 10:07:49 -07003134 * get_ifindex - Get interface index
3135 * @priv: private driver interface data
3136 *
3137 * Returns: Interface index
3138 */
3139 unsigned int (*get_ifindex)(void *priv);
3140
3141 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003142 * get_ifname - Get interface name
3143 * @priv: private driver interface data
3144 *
3145 * Returns: Pointer to the interface name. This can differ from the
3146 * interface name used in init() call. Init() is called first.
3147 *
3148 * This optional function can be used to allow the driver interface to
3149 * replace the interface name with something else, e.g., based on an
3150 * interface mapping from a more descriptive name.
3151 */
3152 const char * (*get_ifname)(void *priv);
3153
3154 /**
3155 * get_mac_addr - Get own MAC address
3156 * @priv: private driver interface data
3157 *
3158 * Returns: Pointer to own MAC address or %NULL on failure
3159 *
3160 * This optional function can be used to get the own MAC address of the
3161 * device from the driver interface code. This is only needed if the
3162 * l2_packet implementation for the OS does not provide easy access to
3163 * a MAC address. */
3164 const u8 * (*get_mac_addr)(void *priv);
3165
3166 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003167 * set_operstate - Sets device operating state to DORMANT or UP
3168 * @priv: private driver interface data
3169 * @state: 0 = dormant, 1 = up
3170 * Returns: 0 on success, -1 on failure
3171 *
3172 * This is an optional function that can be used on operating systems
3173 * that support a concept of controlling network device state from user
3174 * space applications. This function, if set, gets called with
3175 * state = 1 when authentication has been completed and with state = 0
3176 * when connection is lost.
3177 */
3178 int (*set_operstate)(void *priv, int state);
3179
3180 /**
3181 * mlme_setprotection - MLME-SETPROTECTION.request primitive
3182 * @priv: Private driver interface data
3183 * @addr: Address of the station for which to set protection (may be
3184 * %NULL for group keys)
3185 * @protect_type: MLME_SETPROTECTION_PROTECT_TYPE_*
3186 * @key_type: MLME_SETPROTECTION_KEY_TYPE_*
3187 * Returns: 0 on success, -1 on failure
3188 *
3189 * This is an optional function that can be used to set the driver to
3190 * require protection for Tx and/or Rx frames. This uses the layer
3191 * interface defined in IEEE 802.11i-2004 clause 10.3.22.1
3192 * (MLME-SETPROTECTION.request). Many drivers do not use explicit
3193 * set protection operation; instead, they set protection implicitly
3194 * based on configured keys.
3195 */
3196 int (*mlme_setprotection)(void *priv, const u8 *addr, int protect_type,
3197 int key_type);
3198
3199 /**
3200 * get_hw_feature_data - Get hardware support data (channels and rates)
3201 * @priv: Private driver interface data
3202 * @num_modes: Variable for returning the number of returned modes
3203 * flags: Variable for returning hardware feature flags
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003204 * @dfs: Variable for returning DFS region (HOSTAPD_DFS_REGION_*)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003205 * Returns: Pointer to allocated hardware data on success or %NULL on
3206 * failure. Caller is responsible for freeing this.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003207 */
3208 struct hostapd_hw_modes * (*get_hw_feature_data)(void *priv,
3209 u16 *num_modes,
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003210 u16 *flags, u8 *dfs);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003211
3212 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003213 * send_mlme - Send management frame from MLME
3214 * @priv: Private driver interface data
3215 * @data: IEEE 802.11 management frame with IEEE 802.11 header
3216 * @data_len: Size of the management frame
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003217 * @noack: Do not wait for this frame to be acked (disable retries)
Dmitry Shmidta3dc3092015-06-23 11:21:28 -07003218 * @freq: Frequency (in MHz) to send the frame on, or 0 to let the
3219 * driver decide
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08003220 * @csa_offs: Array of CSA offsets or %NULL
3221 * @csa_offs_len: Number of elements in csa_offs
Hai Shalomfdcde762020-04-02 11:19:20 -07003222 * @no_encrypt: Do not encrypt frame even if appropriate key exists
3223 * (used only for testing purposes)
3224 * @wait: Time to wait off-channel for a response (in ms), or zero
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003225 * Returns: 0 on success, -1 on failure
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003226 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003227 int (*send_mlme)(void *priv, const u8 *data, size_t data_len,
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08003228 int noack, unsigned int freq, const u16 *csa_offs,
Hai Shalomfdcde762020-04-02 11:19:20 -07003229 size_t csa_offs_len, int no_encrypt,
3230 unsigned int wait);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003231
3232 /**
3233 * update_ft_ies - Update FT (IEEE 802.11r) IEs
3234 * @priv: Private driver interface data
3235 * @md: Mobility domain (2 octets) (also included inside ies)
3236 * @ies: FT IEs (MDIE, FTIE, ...) or %NULL to remove IEs
3237 * @ies_len: Length of FT IEs in bytes
3238 * Returns: 0 on success, -1 on failure
3239 *
3240 * The supplicant uses this callback to let the driver know that keying
3241 * material for FT is available and that the driver can use the
3242 * provided IEs in the next message in FT authentication sequence.
3243 *
3244 * This function is only needed for driver that support IEEE 802.11r
3245 * (Fast BSS Transition).
3246 */
3247 int (*update_ft_ies)(void *priv, const u8 *md, const u8 *ies,
3248 size_t ies_len);
3249
3250 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003251 * get_scan_results2 - Fetch the latest scan results
3252 * @priv: private driver interface data
3253 *
3254 * Returns: Allocated buffer of scan results (caller is responsible for
3255 * freeing the data structure) on success, NULL on failure
3256 */
3257 struct wpa_scan_results * (*get_scan_results2)(void *priv);
3258
3259 /**
3260 * set_country - Set country
3261 * @priv: Private driver interface data
3262 * @alpha2: country to which to switch to
3263 * Returns: 0 on success, -1 on failure
3264 *
3265 * This function is for drivers which support some form
3266 * of setting a regulatory domain.
3267 */
3268 int (*set_country)(void *priv, const char *alpha2);
3269
3270 /**
Dmitry Shmidtcce06662013-11-04 18:44:24 -08003271 * get_country - Get country
3272 * @priv: Private driver interface data
3273 * @alpha2: Buffer for returning country code (at least 3 octets)
3274 * Returns: 0 on success, -1 on failure
3275 */
3276 int (*get_country)(void *priv, char *alpha2);
3277
3278 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003279 * global_init - Global driver initialization
Dmitry Shmidte4663042016-04-04 10:07:49 -07003280 * @ctx: wpa_global pointer
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003281 * Returns: Pointer to private data (global), %NULL on failure
3282 *
3283 * This optional function is called to initialize the driver wrapper
3284 * for global data, i.e., data that applies to all interfaces. If this
3285 * function is implemented, global_deinit() will also need to be
3286 * implemented to free the private data. The driver will also likely
3287 * use init2() function instead of init() to get the pointer to global
3288 * data available to per-interface initializer.
3289 */
Dmitry Shmidte4663042016-04-04 10:07:49 -07003290 void * (*global_init)(void *ctx);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003291
3292 /**
3293 * global_deinit - Global driver deinitialization
3294 * @priv: private driver global data from global_init()
3295 *
3296 * Terminate any global driver related functionality and free the
3297 * global data structure.
3298 */
3299 void (*global_deinit)(void *priv);
3300
3301 /**
3302 * init2 - Initialize driver interface (with global data)
3303 * @ctx: context to be used when calling wpa_supplicant functions,
3304 * e.g., wpa_supplicant_event()
3305 * @ifname: interface name, e.g., wlan0
3306 * @global_priv: private driver global data from global_init()
3307 * Returns: Pointer to private data, %NULL on failure
3308 *
3309 * This function can be used instead of init() if the driver wrapper
3310 * uses global data.
3311 */
3312 void * (*init2)(void *ctx, const char *ifname, void *global_priv);
3313
3314 /**
3315 * get_interfaces - Get information about available interfaces
3316 * @global_priv: private driver global data from global_init()
3317 * Returns: Allocated buffer of interface information (caller is
3318 * responsible for freeing the data structure) on success, NULL on
3319 * failure
3320 */
3321 struct wpa_interface_info * (*get_interfaces)(void *global_priv);
3322
3323 /**
3324 * scan2 - Request the driver to initiate scan
3325 * @priv: private driver interface data
3326 * @params: Scan parameters
3327 *
3328 * Returns: 0 on success, -1 on failure
3329 *
3330 * Once the scan results are ready, the driver should report scan
3331 * results event for wpa_supplicant which will eventually request the
3332 * results with wpa_driver_get_scan_results2().
3333 */
3334 int (*scan2)(void *priv, struct wpa_driver_scan_params *params);
3335
3336 /**
3337 * authenticate - Request driver to authenticate
3338 * @priv: private driver interface data
3339 * @params: authentication parameters
3340 * Returns: 0 on success, -1 on failure
3341 *
3342 * This is an optional function that can be used with drivers that
3343 * support separate authentication and association steps, i.e., when
3344 * wpa_supplicant can act as the SME. If not implemented, associate()
3345 * function is expected to take care of IEEE 802.11 authentication,
3346 * too.
3347 */
3348 int (*authenticate)(void *priv,
3349 struct wpa_driver_auth_params *params);
3350
3351 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003352 * set_ap - Set Beacon and Probe Response information for AP mode
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003353 * @priv: Private driver interface data
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003354 * @params: Parameters to use in AP mode
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003355 *
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003356 * This function is used to configure Beacon template and/or extra IEs
3357 * to add for Beacon and Probe Response frames for the driver in
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003358 * AP mode. The driver is responsible for building the full Beacon
3359 * frame by concatenating the head part with TIM IE generated by the
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003360 * driver/firmware and finishing with the tail part. Depending on the
3361 * driver architectue, this can be done either by using the full
3362 * template or the set of additional IEs (e.g., WPS and P2P IE).
3363 * Similarly, Probe Response processing depends on the driver design.
3364 * If the driver (or firmware) takes care of replying to Probe Request
3365 * frames, the extra IEs provided here needs to be added to the Probe
3366 * Response frames.
3367 *
3368 * Returns: 0 on success, -1 on failure
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003369 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003370 int (*set_ap)(void *priv, struct wpa_driver_ap_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003371
3372 /**
Dmitry Shmidt8bae4132013-06-06 11:25:10 -07003373 * set_acl - Set ACL in AP mode
3374 * @priv: Private driver interface data
3375 * @params: Parameters to configure ACL
3376 * Returns: 0 on success, -1 on failure
3377 *
3378 * This is used only for the drivers which support MAC address ACL.
3379 */
3380 int (*set_acl)(void *priv, struct hostapd_acl_params *params);
3381
3382 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003383 * hapd_init - Initialize driver interface (hostapd only)
3384 * @hapd: Pointer to hostapd context
3385 * @params: Configuration for the driver wrapper
3386 * Returns: Pointer to private data, %NULL on failure
3387 *
3388 * This function is used instead of init() or init2() when the driver
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003389 * wrapper is used with hostapd.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003390 */
3391 void * (*hapd_init)(struct hostapd_data *hapd,
3392 struct wpa_init_params *params);
3393
3394 /**
3395 * hapd_deinit - Deinitialize driver interface (hostapd only)
3396 * @priv: Private driver interface data from hapd_init()
3397 */
3398 void (*hapd_deinit)(void *priv);
3399
3400 /**
3401 * set_ieee8021x - Enable/disable IEEE 802.1X support (AP only)
3402 * @priv: Private driver interface data
3403 * @params: BSS parameters
3404 * Returns: 0 on success, -1 on failure
3405 *
3406 * This is an optional function to configure the kernel driver to
3407 * enable/disable IEEE 802.1X support and set WPA/WPA2 parameters. This
3408 * can be left undefined (set to %NULL) if IEEE 802.1X support is
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003409 * always enabled and the driver uses set_ap() to set WPA/RSN IE
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003410 * for Beacon frames.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003411 *
3412 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003413 */
3414 int (*set_ieee8021x)(void *priv, struct wpa_bss_params *params);
3415
3416 /**
3417 * set_privacy - Enable/disable privacy (AP only)
3418 * @priv: Private driver interface data
3419 * @enabled: 1 = privacy enabled, 0 = disabled
3420 * Returns: 0 on success, -1 on failure
3421 *
3422 * This is an optional function to configure privacy field in the
3423 * kernel driver for Beacon frames. This can be left undefined (set to
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003424 * %NULL) if the driver uses the Beacon template from set_ap().
3425 *
3426 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003427 */
3428 int (*set_privacy)(void *priv, int enabled);
3429
3430 /**
3431 * get_seqnum - Fetch the current TSC/packet number (AP only)
3432 * @ifname: The interface name (main or virtual)
3433 * @priv: Private driver interface data
3434 * @addr: MAC address of the station or %NULL for group keys
3435 * @idx: Key index
3436 * @seq: Buffer for returning the latest used TSC/packet number
3437 * Returns: 0 on success, -1 on failure
3438 *
3439 * This function is used to fetch the last used TSC/packet number for
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07003440 * a TKIP, CCMP, GCMP, or BIP/IGTK key. It is mainly used with group
3441 * keys, so there is no strict requirement on implementing support for
3442 * unicast keys (i.e., addr != %NULL).
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003443 */
3444 int (*get_seqnum)(const char *ifname, void *priv, const u8 *addr,
3445 int idx, u8 *seq);
3446
3447 /**
3448 * flush - Flush all association stations (AP only)
3449 * @priv: Private driver interface data
3450 * Returns: 0 on success, -1 on failure
3451 *
3452 * This function requests the driver to disassociate all associated
3453 * stations. This function does not need to be implemented if the
3454 * driver does not process association frames internally.
3455 */
3456 int (*flush)(void *priv);
3457
3458 /**
3459 * set_generic_elem - Add IEs into Beacon/Probe Response frames (AP)
3460 * @priv: Private driver interface data
3461 * @elem: Information elements
3462 * @elem_len: Length of the elem buffer in octets
3463 * Returns: 0 on success, -1 on failure
3464 *
3465 * This is an optional function to add information elements in the
3466 * kernel driver for Beacon and Probe Response frames. This can be left
3467 * undefined (set to %NULL) if the driver uses the Beacon template from
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003468 * set_ap().
3469 *
3470 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003471 */
3472 int (*set_generic_elem)(void *priv, const u8 *elem, size_t elem_len);
3473
3474 /**
Jouni Malinen1e6c57f2012-09-05 17:07:03 +03003475 * read_sta_data - Fetch station data
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003476 * @priv: Private driver interface data
3477 * @data: Buffer for returning station information
3478 * @addr: MAC address of the station
3479 * Returns: 0 on success, -1 on failure
3480 */
3481 int (*read_sta_data)(void *priv, struct hostap_sta_driver_data *data,
3482 const u8 *addr);
3483
3484 /**
Hai Shalomfdcde762020-04-02 11:19:20 -07003485 * tx_control_port - Send a frame over the 802.1X controlled port
3486 * @priv: Private driver interface data
3487 * @dest: Destination MAC address
3488 * @proto: Ethertype in host byte order
3489 * @buf: Frame payload starting from IEEE 802.1X header
3490 * @len: Frame payload length
3491 * @no_encrypt: Do not encrypt frame
3492 *
3493 * Returns 0 on success, else an error
3494 *
3495 * This is like a normal Ethernet send except that the driver is aware
3496 * (by other means than the Ethertype) that this frame is special,
3497 * and more importantly it gains an ordering between the transmission of
3498 * the frame and other driver management operations such as key
3499 * installations. This can be used to work around known limitations in
3500 * IEEE 802.11 protocols such as race conditions between rekeying 4-way
3501 * handshake message 4/4 and a PTK being overwritten.
3502 *
3503 * This function is only used for a given interface if the driver
3504 * instance reports WPA_DRIVER_FLAGS_CONTROL_PORT capability. Otherwise,
3505 * API users will fall back to sending the frame via a normal socket.
3506 */
3507 int (*tx_control_port)(void *priv, const u8 *dest,
3508 u16 proto, const u8 *buf, size_t len,
3509 int no_encrypt);
3510
3511 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003512 * hapd_send_eapol - Send an EAPOL packet (AP only)
3513 * @priv: private driver interface data
3514 * @addr: Destination MAC address
3515 * @data: EAPOL packet starting with IEEE 802.1X header
3516 * @data_len: Length of the EAPOL packet in octets
3517 * @encrypt: Whether the frame should be encrypted
3518 * @own_addr: Source MAC address
3519 * @flags: WPA_STA_* flags for the destination station
3520 *
3521 * Returns: 0 on success, -1 on failure
3522 */
3523 int (*hapd_send_eapol)(void *priv, const u8 *addr, const u8 *data,
3524 size_t data_len, int encrypt,
3525 const u8 *own_addr, u32 flags);
3526
3527 /**
3528 * sta_deauth - Deauthenticate a station (AP only)
3529 * @priv: Private driver interface data
3530 * @own_addr: Source address and BSSID for the Deauthentication frame
3531 * @addr: MAC address of the station to deauthenticate
3532 * @reason: Reason code for the Deauthentiation frame
3533 * Returns: 0 on success, -1 on failure
3534 *
3535 * This function requests a specific station to be deauthenticated and
3536 * a Deauthentication frame to be sent to it.
3537 */
3538 int (*sta_deauth)(void *priv, const u8 *own_addr, const u8 *addr,
Hai Shalom81f62d82019-07-22 12:10:00 -07003539 u16 reason);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003540
3541 /**
3542 * sta_disassoc - Disassociate a station (AP only)
3543 * @priv: Private driver interface data
3544 * @own_addr: Source address and BSSID for the Disassociation frame
3545 * @addr: MAC address of the station to disassociate
3546 * @reason: Reason code for the Disassociation frame
3547 * Returns: 0 on success, -1 on failure
3548 *
3549 * This function requests a specific station to be disassociated and
3550 * a Disassociation frame to be sent to it.
3551 */
3552 int (*sta_disassoc)(void *priv, const u8 *own_addr, const u8 *addr,
Hai Shalom81f62d82019-07-22 12:10:00 -07003553 u16 reason);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003554
3555 /**
3556 * sta_remove - Remove a station entry (AP only)
3557 * @priv: Private driver interface data
3558 * @addr: MAC address of the station to be removed
3559 * Returns: 0 on success, -1 on failure
3560 */
3561 int (*sta_remove)(void *priv, const u8 *addr);
3562
3563 /**
3564 * hapd_get_ssid - Get the current SSID (AP only)
3565 * @priv: Private driver interface data
3566 * @buf: Buffer for returning the SSID
3567 * @len: Maximum length of the buffer
3568 * Returns: Length of the SSID on success, -1 on failure
3569 *
3570 * This function need not be implemented if the driver uses Beacon
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003571 * template from set_ap() and does not reply to Probe Request frames.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003572 */
3573 int (*hapd_get_ssid)(void *priv, u8 *buf, int len);
3574
3575 /**
3576 * hapd_set_ssid - Set SSID (AP only)
3577 * @priv: Private driver interface data
3578 * @buf: SSID
3579 * @len: Length of the SSID in octets
3580 * Returns: 0 on success, -1 on failure
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003581 *
3582 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003583 */
3584 int (*hapd_set_ssid)(void *priv, const u8 *buf, int len);
3585
3586 /**
3587 * hapd_set_countermeasures - Enable/disable TKIP countermeasures (AP)
3588 * @priv: Private driver interface data
3589 * @enabled: 1 = countermeasures enabled, 0 = disabled
3590 * Returns: 0 on success, -1 on failure
3591 *
3592 * This need not be implemented if the driver does not take care of
3593 * association processing.
3594 */
3595 int (*hapd_set_countermeasures)(void *priv, int enabled);
3596
3597 /**
3598 * sta_add - Add a station entry
3599 * @priv: Private driver interface data
3600 * @params: Station parameters
3601 * Returns: 0 on success, -1 on failure
3602 *
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08003603 * This function is used to add or set (params->set 1) a station
3604 * entry in the driver. Adding STA entries is used only if the driver
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003605 * does not take care of association processing.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003606 *
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08003607 * With drivers that don't support full AP client state, this function
3608 * is used to add a station entry to the driver once the station has
3609 * completed association.
3610 *
3611 * With TDLS, this function is used to add or set (params->set 1)
3612 * TDLS peer entries (even with drivers that do not support full AP
3613 * client state).
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003614 */
3615 int (*sta_add)(void *priv, struct hostapd_sta_add_params *params);
3616
3617 /**
3618 * get_inact_sec - Get station inactivity duration (AP only)
3619 * @priv: Private driver interface data
3620 * @addr: Station address
3621 * Returns: Number of seconds station has been inactive, -1 on failure
3622 */
3623 int (*get_inact_sec)(void *priv, const u8 *addr);
3624
3625 /**
3626 * sta_clear_stats - Clear station statistics (AP only)
3627 * @priv: Private driver interface data
3628 * @addr: Station address
3629 * Returns: 0 on success, -1 on failure
3630 */
3631 int (*sta_clear_stats)(void *priv, const u8 *addr);
3632
3633 /**
3634 * set_freq - Set channel/frequency (AP only)
3635 * @priv: Private driver interface data
3636 * @freq: Channel parameters
3637 * Returns: 0 on success, -1 on failure
3638 */
3639 int (*set_freq)(void *priv, struct hostapd_freq_params *freq);
3640
3641 /**
3642 * set_rts - Set RTS threshold
3643 * @priv: Private driver interface data
3644 * @rts: RTS threshold in octets
3645 * Returns: 0 on success, -1 on failure
3646 */
3647 int (*set_rts)(void *priv, int rts);
3648
3649 /**
3650 * set_frag - Set fragmentation threshold
3651 * @priv: Private driver interface data
3652 * @frag: Fragmentation threshold in octets
3653 * Returns: 0 on success, -1 on failure
3654 */
3655 int (*set_frag)(void *priv, int frag);
3656
3657 /**
3658 * sta_set_flags - Set station flags (AP only)
3659 * @priv: Private driver interface data
3660 * @addr: Station address
3661 * @total_flags: Bitmap of all WPA_STA_* flags currently set
3662 * @flags_or: Bitmap of WPA_STA_* flags to add
3663 * @flags_and: Bitmap of WPA_STA_* flags to us as a mask
3664 * Returns: 0 on success, -1 on failure
3665 */
3666 int (*sta_set_flags)(void *priv, const u8 *addr,
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08003667 unsigned int total_flags, unsigned int flags_or,
3668 unsigned int flags_and);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003669
3670 /**
Hai Shalom81f62d82019-07-22 12:10:00 -07003671 * sta_set_airtime_weight - Set station airtime weight (AP only)
3672 * @priv: Private driver interface data
3673 * @addr: Station address
3674 * @weight: New weight for station airtime assignment
3675 * Returns: 0 on success, -1 on failure
3676 */
3677 int (*sta_set_airtime_weight)(void *priv, const u8 *addr,
3678 unsigned int weight);
3679
3680 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003681 * set_tx_queue_params - Set TX queue parameters
3682 * @priv: Private driver interface data
3683 * @queue: Queue number (0 = VO, 1 = VI, 2 = BE, 3 = BK)
3684 * @aifs: AIFS
3685 * @cw_min: cwMin
3686 * @cw_max: cwMax
3687 * @burst_time: Maximum length for bursting in 0.1 msec units
3688 */
3689 int (*set_tx_queue_params)(void *priv, int queue, int aifs, int cw_min,
3690 int cw_max, int burst_time);
3691
3692 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003693 * if_add - Add a virtual interface
3694 * @priv: Private driver interface data
3695 * @type: Interface type
3696 * @ifname: Interface name for the new virtual interface
3697 * @addr: Local address to use for the interface or %NULL to use the
3698 * parent interface address
3699 * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces
3700 * @drv_priv: Pointer for overwriting the driver context or %NULL if
3701 * not allowed (applies only to %WPA_IF_AP_BSS type)
3702 * @force_ifname: Buffer for returning an interface name that the
3703 * driver ended up using if it differs from the requested ifname
3704 * @if_addr: Buffer for returning the allocated interface address
3705 * (this may differ from the requested addr if the driver cannot
3706 * change interface address)
3707 * @bridge: Bridge interface to use or %NULL if no bridge configured
Dmitry Shmidtcce06662013-11-04 18:44:24 -08003708 * @use_existing: Whether to allow existing interface to be used
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08003709 * @setup_ap: Whether to setup AP for %WPA_IF_AP_BSS interfaces
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003710 * Returns: 0 on success, -1 on failure
3711 */
3712 int (*if_add)(void *priv, enum wpa_driver_if_type type,
3713 const char *ifname, const u8 *addr, void *bss_ctx,
3714 void **drv_priv, char *force_ifname, u8 *if_addr,
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08003715 const char *bridge, int use_existing, int setup_ap);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003716
3717 /**
3718 * if_remove - Remove a virtual interface
3719 * @priv: Private driver interface data
3720 * @type: Interface type
3721 * @ifname: Interface name of the virtual interface to be removed
3722 * Returns: 0 on success, -1 on failure
3723 */
3724 int (*if_remove)(void *priv, enum wpa_driver_if_type type,
3725 const char *ifname);
3726
3727 /**
3728 * set_sta_vlan - Bind a station into a specific interface (AP only)
3729 * @priv: Private driver interface data
3730 * @ifname: Interface (main or virtual BSS or VLAN)
3731 * @addr: MAC address of the associated station
3732 * @vlan_id: VLAN ID
3733 * Returns: 0 on success, -1 on failure
3734 *
3735 * This function is used to bind a station to a specific virtual
3736 * interface. It is only used if when virtual interfaces are supported,
3737 * e.g., to assign stations to different VLAN interfaces based on
3738 * information from a RADIUS server. This allows separate broadcast
3739 * domains to be used with a single BSS.
3740 */
3741 int (*set_sta_vlan)(void *priv, const u8 *addr, const char *ifname,
3742 int vlan_id);
3743
3744 /**
3745 * commit - Optional commit changes handler (AP only)
3746 * @priv: driver private data
3747 * Returns: 0 on success, -1 on failure
3748 *
3749 * This optional handler function can be registered if the driver
3750 * interface implementation needs to commit changes (e.g., by setting
3751 * network interface up) at the end of initial configuration. If set,
3752 * this handler will be called after initial setup has been completed.
3753 */
3754 int (*commit)(void *priv);
3755
3756 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003757 * set_radius_acl_auth - Notification of RADIUS ACL change
3758 * @priv: Private driver interface data
3759 * @mac: MAC address of the station
3760 * @accepted: Whether the station was accepted
3761 * @session_timeout: Session timeout for the station
3762 * Returns: 0 on success, -1 on failure
3763 */
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07003764 int (*set_radius_acl_auth)(void *priv, const u8 *mac, int accepted,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003765 u32 session_timeout);
3766
3767 /**
3768 * set_radius_acl_expire - Notification of RADIUS ACL expiration
3769 * @priv: Private driver interface data
3770 * @mac: MAC address of the station
3771 * Returns: 0 on success, -1 on failure
3772 */
3773 int (*set_radius_acl_expire)(void *priv, const u8 *mac);
3774
3775 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003776 * set_ap_wps_ie - Add WPS IE(s) into Beacon/Probe Response frames (AP)
3777 * @priv: Private driver interface data
3778 * @beacon: WPS IE(s) for Beacon frames or %NULL to remove extra IE(s)
3779 * @proberesp: WPS IE(s) for Probe Response frames or %NULL to remove
3780 * extra IE(s)
3781 * @assocresp: WPS IE(s) for (Re)Association Response frames or %NULL
3782 * to remove extra IE(s)
3783 * Returns: 0 on success, -1 on failure
3784 *
3785 * This is an optional function to add WPS IE in the kernel driver for
3786 * Beacon and Probe Response frames. This can be left undefined (set
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003787 * to %NULL) if the driver uses the Beacon template from set_ap()
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003788 * and does not process Probe Request frames. If the driver takes care
3789 * of (Re)Association frame processing, the assocresp buffer includes
3790 * WPS IE(s) that need to be added to (Re)Association Response frames
3791 * whenever a (Re)Association Request frame indicated use of WPS.
3792 *
3793 * This will also be used to add P2P IE(s) into Beacon/Probe Response
3794 * frames when operating as a GO. The driver is responsible for adding
3795 * timing related attributes (e.g., NoA) in addition to the IEs
3796 * included here by appending them after these buffers. This call is
3797 * also used to provide Probe Response IEs for P2P Listen state
3798 * operations for drivers that generate the Probe Response frames
3799 * internally.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003800 *
3801 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003802 */
3803 int (*set_ap_wps_ie)(void *priv, const struct wpabuf *beacon,
3804 const struct wpabuf *proberesp,
3805 const struct wpabuf *assocresp);
3806
3807 /**
3808 * set_supp_port - Set IEEE 802.1X Supplicant Port status
3809 * @priv: Private driver interface data
3810 * @authorized: Whether the port is authorized
3811 * Returns: 0 on success, -1 on failure
3812 */
3813 int (*set_supp_port)(void *priv, int authorized);
3814
3815 /**
3816 * set_wds_sta - Bind a station into a 4-address WDS (AP only)
3817 * @priv: Private driver interface data
3818 * @addr: MAC address of the associated station
3819 * @aid: Association ID
3820 * @val: 1 = bind to 4-address WDS; 0 = unbind
3821 * @bridge_ifname: Bridge interface to use for the WDS station or %NULL
3822 * to indicate that bridge is not to be used
Dmitry Shmidtc2ebb4b2013-07-24 12:57:51 -07003823 * @ifname_wds: Buffer to return the interface name for the new WDS
3824 * station or %NULL to indicate name is not returned.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003825 * Returns: 0 on success, -1 on failure
3826 */
3827 int (*set_wds_sta)(void *priv, const u8 *addr, int aid, int val,
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07003828 const char *bridge_ifname, char *ifname_wds);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003829
3830 /**
3831 * send_action - Transmit an Action frame
3832 * @priv: Private driver interface data
3833 * @freq: Frequency (in MHz) of the channel
3834 * @wait: Time to wait off-channel for a response (in ms), or zero
3835 * @dst: Destination MAC address (Address 1)
3836 * @src: Source MAC address (Address 2)
3837 * @bssid: BSSID (Address 3)
3838 * @data: Frame body
3839 * @data_len: data length in octets
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003840 @ @no_cck: Whether CCK rates must not be used to transmit this frame
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003841 * Returns: 0 on success, -1 on failure
3842 *
3843 * This command can be used to request the driver to transmit an action
3844 * frame to the specified destination.
3845 *
3846 * If the %WPA_DRIVER_FLAGS_OFFCHANNEL_TX flag is set, the frame will
3847 * be transmitted on the given channel and the device will wait for a
3848 * response on that channel for the given wait time.
3849 *
3850 * If the flag is not set, the wait time will be ignored. In this case,
3851 * if a remain-on-channel duration is in progress, the frame must be
3852 * transmitted on that channel; alternatively the frame may be sent on
3853 * the current operational channel (if in associated state in station
3854 * mode or while operating as an AP.)
Dmitry Shmidtebd93af2017-02-21 13:40:44 -08003855 *
3856 * If @src differs from the device MAC address, use of a random
3857 * transmitter address is requested for this message exchange.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003858 */
3859 int (*send_action)(void *priv, unsigned int freq, unsigned int wait,
3860 const u8 *dst, const u8 *src, const u8 *bssid,
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003861 const u8 *data, size_t data_len, int no_cck);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003862
3863 /**
3864 * send_action_cancel_wait - Cancel action frame TX wait
3865 * @priv: Private driver interface data
3866 *
3867 * This command cancels the wait time associated with sending an action
3868 * frame. It is only available when %WPA_DRIVER_FLAGS_OFFCHANNEL_TX is
3869 * set in the driver flags.
3870 */
3871 void (*send_action_cancel_wait)(void *priv);
3872
3873 /**
3874 * remain_on_channel - Remain awake on a channel
3875 * @priv: Private driver interface data
3876 * @freq: Frequency (in MHz) of the channel
3877 * @duration: Duration in milliseconds
3878 * Returns: 0 on success, -1 on failure
3879 *
3880 * This command is used to request the driver to remain awake on the
3881 * specified channel for the specified duration and report received
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08003882 * Action frames with EVENT_RX_MGMT events. Optionally, received
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003883 * Probe Request frames may also be requested to be reported by calling
3884 * probe_req_report(). These will be reported with EVENT_RX_PROBE_REQ.
3885 *
3886 * The driver may not be at the requested channel when this function
3887 * returns, i.e., the return code is only indicating whether the
3888 * request was accepted. The caller will need to wait until the
3889 * EVENT_REMAIN_ON_CHANNEL event indicates that the driver has
3890 * completed the channel change. This may take some time due to other
3891 * need for the radio and the caller should be prepared to timing out
3892 * its wait since there are no guarantees on when this request can be
3893 * executed.
3894 */
3895 int (*remain_on_channel)(void *priv, unsigned int freq,
3896 unsigned int duration);
3897
3898 /**
3899 * cancel_remain_on_channel - Cancel remain-on-channel operation
3900 * @priv: Private driver interface data
3901 *
3902 * This command can be used to cancel a remain-on-channel operation
3903 * before its originally requested duration has passed. This could be
3904 * used, e.g., when remain_on_channel() is used to request extra time
3905 * to receive a response to an Action frame and the response is
3906 * received when there is still unneeded time remaining on the
3907 * remain-on-channel operation.
3908 */
3909 int (*cancel_remain_on_channel)(void *priv);
3910
3911 /**
3912 * probe_req_report - Request Probe Request frames to be indicated
3913 * @priv: Private driver interface data
3914 * @report: Whether to report received Probe Request frames
3915 * Returns: 0 on success, -1 on failure (or if not supported)
3916 *
3917 * This command can be used to request the driver to indicate when
3918 * Probe Request frames are received with EVENT_RX_PROBE_REQ events.
3919 * Since this operation may require extra resources, e.g., due to less
3920 * optimal hardware/firmware RX filtering, many drivers may disable
3921 * Probe Request reporting at least in station mode. This command is
3922 * used to notify the driver when the Probe Request frames need to be
3923 * reported, e.g., during remain-on-channel operations.
3924 */
3925 int (*probe_req_report)(void *priv, int report);
3926
3927 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003928 * deinit_ap - Deinitialize AP mode
3929 * @priv: Private driver interface data
3930 * Returns: 0 on success, -1 on failure (or if not supported)
3931 *
3932 * This optional function can be used to disable AP mode related
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07003933 * configuration. If the interface was not dynamically added,
3934 * change the driver mode to station mode to allow normal station
3935 * operations like scanning to be completed.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003936 */
3937 int (*deinit_ap)(void *priv);
3938
3939 /**
Dmitry Shmidt04949592012-07-19 12:16:46 -07003940 * deinit_p2p_cli - Deinitialize P2P client mode
3941 * @priv: Private driver interface data
3942 * Returns: 0 on success, -1 on failure (or if not supported)
3943 *
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07003944 * This optional function can be used to disable P2P client mode. If the
3945 * interface was not dynamically added, change the interface type back
3946 * to station mode.
Dmitry Shmidt04949592012-07-19 12:16:46 -07003947 */
3948 int (*deinit_p2p_cli)(void *priv);
3949
3950 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003951 * suspend - Notification on system suspend/hibernate event
3952 * @priv: Private driver interface data
3953 */
3954 void (*suspend)(void *priv);
3955
3956 /**
3957 * resume - Notification on system resume/thaw event
3958 * @priv: Private driver interface data
3959 */
3960 void (*resume)(void *priv);
3961
3962 /**
3963 * signal_monitor - Set signal monitoring parameters
3964 * @priv: Private driver interface data
3965 * @threshold: Threshold value for signal change events; 0 = disabled
3966 * @hysteresis: Minimum change in signal strength before indicating a
3967 * new event
3968 * Returns: 0 on success, -1 on failure (or if not supported)
3969 *
3970 * This function can be used to configure monitoring of signal strength
3971 * with the current AP. Whenever signal strength drops below the
3972 * %threshold value or increases above it, EVENT_SIGNAL_CHANGE event
3973 * should be generated assuming the signal strength has changed at
3974 * least %hysteresis from the previously indicated signal change event.
3975 */
3976 int (*signal_monitor)(void *priv, int threshold, int hysteresis);
3977
3978 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003979 * get_noa - Get current Notice of Absence attribute payload
3980 * @priv: Private driver interface data
3981 * @buf: Buffer for returning NoA
3982 * @buf_len: Buffer length in octets
3983 * Returns: Number of octets used in buf, 0 to indicate no NoA is being
3984 * advertized, or -1 on failure
3985 *
3986 * This function is used to fetch the current Notice of Absence
3987 * attribute value from GO.
3988 */
3989 int (*get_noa)(void *priv, u8 *buf, size_t buf_len);
3990
3991 /**
3992 * set_noa - Set Notice of Absence parameters for GO (testing)
3993 * @priv: Private driver interface data
3994 * @count: Count
3995 * @start: Start time in ms from next TBTT
3996 * @duration: Duration in ms
3997 * Returns: 0 on success or -1 on failure
3998 *
3999 * This function is used to set Notice of Absence parameters for GO. It
4000 * is used only for testing. To disable NoA, all parameters are set to
4001 * 0.
4002 */
4003 int (*set_noa)(void *priv, u8 count, int start, int duration);
4004
4005 /**
4006 * set_p2p_powersave - Set P2P power save options
4007 * @priv: Private driver interface data
4008 * @legacy_ps: 0 = disable, 1 = enable, 2 = maximum PS, -1 = no change
4009 * @opp_ps: 0 = disable, 1 = enable, -1 = no change
4010 * @ctwindow: 0.. = change (msec), -1 = no change
4011 * Returns: 0 on success or -1 on failure
4012 */
4013 int (*set_p2p_powersave)(void *priv, int legacy_ps, int opp_ps,
4014 int ctwindow);
4015
4016 /**
4017 * ampdu - Enable/disable aggregation
4018 * @priv: Private driver interface data
4019 * @ampdu: 1/0 = enable/disable A-MPDU aggregation
4020 * Returns: 0 on success or -1 on failure
4021 */
4022 int (*ampdu)(void *priv, int ampdu);
4023
4024 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004025 * get_radio_name - Get physical radio name for the device
4026 * @priv: Private driver interface data
4027 * Returns: Radio name or %NULL if not known
4028 *
4029 * The returned data must not be modified by the caller. It is assumed
4030 * that any interface that has the same radio name as another is
4031 * sharing the same physical radio. This information can be used to
4032 * share scan results etc. information between the virtual interfaces
4033 * to speed up various operations.
4034 */
4035 const char * (*get_radio_name)(void *priv);
4036
4037 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004038 * send_tdls_mgmt - for sending TDLS management packets
4039 * @priv: private driver interface data
4040 * @dst: Destination (peer) MAC address
4041 * @action_code: TDLS action code for the mssage
4042 * @dialog_token: Dialog Token to use in the message (if needed)
4043 * @status_code: Status Code or Reason Code to use (if needed)
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07004044 * @peer_capab: TDLS peer capability (TDLS_PEER_* bitfield)
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -07004045 * @initiator: Is the current end the TDLS link initiator
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004046 * @buf: TDLS IEs to add to the message
4047 * @len: Length of buf in octets
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004048 * Returns: 0 on success, negative (<0) on failure
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004049 *
4050 * This optional function can be used to send packet to driver which is
4051 * responsible for receiving and sending all TDLS packets.
4052 */
4053 int (*send_tdls_mgmt)(void *priv, const u8 *dst, u8 action_code,
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07004054 u8 dialog_token, u16 status_code, u32 peer_capab,
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -07004055 int initiator, const u8 *buf, size_t len);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004056
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004057 /**
4058 * tdls_oper - Ask the driver to perform high-level TDLS operations
4059 * @priv: Private driver interface data
4060 * @oper: TDLS high-level operation. See %enum tdls_oper
4061 * @peer: Destination (peer) MAC address
4062 * Returns: 0 on success, negative (<0) on failure
4063 *
4064 * This optional function can be used to send high-level TDLS commands
4065 * to the driver.
4066 */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004067 int (*tdls_oper)(void *priv, enum tdls_oper oper, const u8 *peer);
4068
4069 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07004070 * wnm_oper - Notify driver of the WNM frame reception
4071 * @priv: Private driver interface data
4072 * @oper: WNM operation. See %enum wnm_oper
4073 * @peer: Destination (peer) MAC address
4074 * @buf: Buffer for the driver to fill in (for getting IE)
4075 * @buf_len: Return the len of buf
4076 * Returns: 0 on success, negative (<0) on failure
4077 */
4078 int (*wnm_oper)(void *priv, enum wnm_oper oper, const u8 *peer,
4079 u8 *buf, u16 *buf_len);
4080
4081 /**
Dmitry Shmidt051af732013-10-22 13:52:46 -07004082 * set_qos_map - Set QoS Map
4083 * @priv: Private driver interface data
4084 * @qos_map_set: QoS Map
4085 * @qos_map_set_len: Length of QoS Map
4086 */
4087 int (*set_qos_map)(void *priv, const u8 *qos_map_set,
4088 u8 qos_map_set_len);
4089
4090 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004091 * br_add_ip_neigh - Add a neigh to the bridge ip neigh table
4092 * @priv: Private driver interface data
4093 * @version: IP version of the IP address, 4 or 6
4094 * @ipaddr: IP address for the neigh entry
4095 * @prefixlen: IP address prefix length
4096 * @addr: Corresponding MAC address
4097 * Returns: 0 on success, negative (<0) on failure
4098 */
4099 int (*br_add_ip_neigh)(void *priv, u8 version, const u8 *ipaddr,
4100 int prefixlen, const u8 *addr);
4101
4102 /**
4103 * br_delete_ip_neigh - Remove a neigh from the bridge ip neigh table
4104 * @priv: Private driver interface data
4105 * @version: IP version of the IP address, 4 or 6
4106 * @ipaddr: IP address for the neigh entry
4107 * Returns: 0 on success, negative (<0) on failure
4108 */
4109 int (*br_delete_ip_neigh)(void *priv, u8 version, const u8 *ipaddr);
4110
4111 /**
4112 * br_port_set_attr - Set a bridge port attribute
4113 * @attr: Bridge port attribute to set
4114 * @val: Value to be set
4115 * Returns: 0 on success, negative (<0) on failure
4116 */
4117 int (*br_port_set_attr)(void *priv, enum drv_br_port_attr attr,
4118 unsigned int val);
4119
4120 /**
4121 * br_port_set_attr - Set a bridge network parameter
4122 * @param: Bridge parameter to set
4123 * @val: Value to be set
4124 * Returns: 0 on success, negative (<0) on failure
4125 */
4126 int (*br_set_net_param)(void *priv, enum drv_br_net_param param,
4127 unsigned int val);
4128
4129 /**
Hai Shalomfdcde762020-04-02 11:19:20 -07004130 * get_wowlan - Get wake-on-wireless status
4131 * @priv: Private driver interface data
4132 */
4133 int (*get_wowlan)(void *priv);
4134
4135 /**
Dmitry Shmidtb58836e2014-04-29 14:35:56 -07004136 * set_wowlan - Set wake-on-wireless triggers
4137 * @priv: Private driver interface data
4138 * @triggers: wowlan triggers
4139 */
4140 int (*set_wowlan)(void *priv, const struct wowlan_triggers *triggers);
4141
4142 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004143 * signal_poll - Get current connection information
4144 * @priv: Private driver interface data
4145 * @signal_info: Connection info structure
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07004146 */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004147 int (*signal_poll)(void *priv, struct wpa_signal_info *signal_info);
Dmitry Shmidtbd567ad2011-05-09 14:17:09 -07004148
4149 /**
Sunil Ravi89eba102022-09-13 21:04:37 -07004150 * mlo_signal_poll - Get current MLO connection information
4151 * @priv: Private driver interface data
4152 * @mlo_signal_info: MLO connection info structure
4153 */
4154 int (*mlo_signal_poll)(void *priv,
4155 struct wpa_mlo_signal_info *mlo_signal_info);
4156
4157 /**
Hai Shalom74f70d42019-02-11 14:42:39 -08004158 * channel_info - Get parameters of the current operating channel
4159 * @priv: Private driver interface data
4160 * @channel_info: Channel info structure
4161 * Returns: 0 on success, negative (<0) on failure
4162 */
4163 int (*channel_info)(void *priv, struct wpa_channel_info *channel_info);
4164
4165 /**
Jouni Malinen75ecf522011-06-27 15:19:46 -07004166 * set_authmode - Set authentication algorithm(s) for static WEP
4167 * @priv: Private driver interface data
4168 * @authmode: 1=Open System, 2=Shared Key, 3=both
4169 * Returns: 0 on success, -1 on failure
4170 *
4171 * This function can be used to set authentication algorithms for AP
4172 * mode when static WEP is used. If the driver uses user space MLME/SME
4173 * implementation, there is no need to implement this function.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004174 *
4175 * DEPRECATED - use set_ap() instead
Jouni Malinen75ecf522011-06-27 15:19:46 -07004176 */
4177 int (*set_authmode)(void *priv, int authmode);
Dmitry Shmidt292b0c32013-11-22 12:54:42 -08004178
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004179#ifdef ANDROID
Jouni Malinen75ecf522011-06-27 15:19:46 -07004180 /**
Dmitry Shmidt292b0c32013-11-22 12:54:42 -08004181 * driver_cmd - Execute driver-specific command
4182 * @priv: Private driver interface data
4183 * @cmd: Command to execute
4184 * @buf: Return buffer
4185 * @buf_len: Buffer length
Dmitry Shmidtbd567ad2011-05-09 14:17:09 -07004186 * Returns: 0 on success, -1 on failure
4187 */
Dmitry Shmidt292b0c32013-11-22 12:54:42 -08004188 int (*driver_cmd)(void *priv, char *cmd, char *buf, size_t buf_len);
4189#endif /* ANDROID */
4190
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004191 /**
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004192 * vendor_cmd - Execute vendor specific command
4193 * @priv: Private driver interface data
4194 * @vendor_id: Vendor id
4195 * @subcmd: Vendor command id
Hai Shalom60840252021-02-19 19:02:11 -08004196 * @nested_attr_flag: Specifies if vendor subcommand uses nested
4197 * attributes or not
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004198 * @data: Vendor command parameters (%NULL if no parameters)
4199 * @data_len: Data length
4200 * @buf: Return buffer (%NULL to ignore reply)
4201 * Returns: 0 on success, negative (<0) on failure
4202 *
4203 * This function handles vendor specific commands that are passed to
4204 * the driver/device. The command is identified by vendor id and
Hai Shalom60840252021-02-19 19:02:11 -08004205 * command id. The nested_attr_flag specifies whether the subcommand
4206 * uses nested attributes or not. Parameters can be passed
4207 * as argument to the command in the data buffer. Reply (if any) will be
4208 * filled in the supplied return buffer.
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004209 *
4210 * The exact driver behavior is driver interface and vendor specific. As
4211 * an example, this will be converted to a vendor specific cfg80211
4212 * command in case of the nl80211 driver interface.
4213 */
4214 int (*vendor_cmd)(void *priv, unsigned int vendor_id,
4215 unsigned int subcmd, const u8 *data, size_t data_len,
Hai Shalom60840252021-02-19 19:02:11 -08004216 enum nested_attr nested_attr_flag,
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004217 struct wpabuf *buf);
4218
4219 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004220 * set_rekey_info - Set rekey information
4221 * @priv: Private driver interface data
4222 * @kek: Current KEK
Dmitry Shmidt807291d2015-01-27 13:40:23 -08004223 * @kek_len: KEK length in octets
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004224 * @kck: Current KCK
Dmitry Shmidt807291d2015-01-27 13:40:23 -08004225 * @kck_len: KCK length in octets
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004226 * @replay_ctr: Current EAPOL-Key Replay Counter
4227 *
4228 * This optional function can be used to provide information for the
4229 * driver/firmware to process EAPOL-Key frames in Group Key Handshake
4230 * while the host (including wpa_supplicant) is sleeping.
4231 */
Dmitry Shmidt807291d2015-01-27 13:40:23 -08004232 void (*set_rekey_info)(void *priv, const u8 *kek, size_t kek_len,
4233 const u8 *kck, size_t kck_len,
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004234 const u8 *replay_ctr);
4235
4236 /**
4237 * sta_assoc - Station association indication
4238 * @priv: Private driver interface data
4239 * @own_addr: Source address and BSSID for association frame
4240 * @addr: MAC address of the station to associate
4241 * @reassoc: flag to indicate re-association
4242 * @status: association response status code
4243 * @ie: assoc response ie buffer
4244 * @len: ie buffer length
4245 * Returns: 0 on success, -1 on failure
4246 *
4247 * This function indicates the driver to send (Re)Association
4248 * Response frame to the station.
4249 */
4250 int (*sta_assoc)(void *priv, const u8 *own_addr, const u8 *addr,
4251 int reassoc, u16 status, const u8 *ie, size_t len);
4252
4253 /**
4254 * sta_auth - Station authentication indication
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004255 * @priv: private driver interface data
4256 * @params: Station authentication parameters
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004257 *
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004258 * Returns: 0 on success, -1 on failure
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004259 */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004260 int (*sta_auth)(void *priv,
4261 struct wpa_driver_sta_auth_params *params);
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004262
4263 /**
4264 * add_tspec - Add traffic stream
4265 * @priv: Private driver interface data
4266 * @addr: MAC address of the station to associate
4267 * @tspec_ie: tspec ie buffer
4268 * @tspec_ielen: tspec ie length
4269 * Returns: 0 on success, -1 on failure
4270 *
4271 * This function adds the traffic steam for the station
4272 * and fills the medium_time in tspec_ie.
4273 */
4274 int (*add_tspec)(void *priv, const u8 *addr, u8 *tspec_ie,
4275 size_t tspec_ielen);
4276
4277 /**
4278 * add_sta_node - Add a station node in the driver
4279 * @priv: Private driver interface data
4280 * @addr: MAC address of the station to add
4281 * @auth_alg: authentication algorithm used by the station
4282 * Returns: 0 on success, -1 on failure
4283 *
4284 * This function adds the station node in the driver, when
4285 * the station gets added by FT-over-DS.
4286 */
4287 int (*add_sta_node)(void *priv, const u8 *addr, u16 auth_alg);
4288
4289 /**
4290 * sched_scan - Request the driver to initiate scheduled scan
4291 * @priv: Private driver interface data
4292 * @params: Scan parameters
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004293 * Returns: 0 on success, -1 on failure
4294 *
4295 * This operation should be used for scheduled scan offload to
4296 * the hardware. Every time scan results are available, the
4297 * driver should report scan results event for wpa_supplicant
4298 * which will eventually request the results with
4299 * wpa_driver_get_scan_results2(). This operation is optional
4300 * and if not provided or if it returns -1, we fall back to
4301 * normal host-scheduled scans.
4302 */
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08004303 int (*sched_scan)(void *priv, struct wpa_driver_scan_params *params);
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004304
4305 /**
4306 * stop_sched_scan - Request the driver to stop a scheduled scan
4307 * @priv: Private driver interface data
4308 * Returns: 0 on success, -1 on failure
4309 *
4310 * This should cause the scheduled scan to be stopped and
4311 * results should stop being sent. Must be supported if
4312 * sched_scan is supported.
4313 */
4314 int (*stop_sched_scan)(void *priv);
4315
4316 /**
4317 * poll_client - Probe (null data or such) the given station
4318 * @priv: Private driver interface data
4319 * @own_addr: MAC address of sending interface
4320 * @addr: MAC address of the station to probe
4321 * @qos: Indicates whether station is QoS station
4322 *
4323 * This function is used to verify whether an associated station is
4324 * still present. This function does not need to be implemented if the
4325 * driver provides such inactivity polling mechanism.
4326 */
4327 void (*poll_client)(void *priv, const u8 *own_addr,
4328 const u8 *addr, int qos);
Dmitry Shmidt04949592012-07-19 12:16:46 -07004329
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004330 /**
Dmitry Shmidt04949592012-07-19 12:16:46 -07004331 * radio_disable - Disable/enable radio
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004332 * @priv: Private driver interface data
Dmitry Shmidt04949592012-07-19 12:16:46 -07004333 * @disabled: 1=disable 0=enable radio
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004334 * Returns: 0 on success, -1 on failure
4335 *
Dmitry Shmidt04949592012-07-19 12:16:46 -07004336 * This optional command is for testing purposes. It can be used to
4337 * disable the radio on a testbed device to simulate out-of-radio-range
4338 * conditions.
4339 */
4340 int (*radio_disable)(void *priv, int disabled);
4341
4342 /**
4343 * switch_channel - Announce channel switch and migrate the GO to the
4344 * given frequency
4345 * @priv: Private driver interface data
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08004346 * @settings: Settings for CSA period and new channel
Dmitry Shmidt04949592012-07-19 12:16:46 -07004347 * Returns: 0 on success, -1 on failure
4348 *
4349 * This function is used to move the GO to the legacy STA channel to
4350 * avoid frequency conflict in single channel concurrency.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004351 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08004352 int (*switch_channel)(void *priv, struct csa_settings *settings);
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004353
4354 /**
Sunil Ravia04bd252022-05-02 22:54:18 -07004355 * switch_color - Announce color switch and migrate the BSS to the
4356 * given color
4357 * @priv: Private driver interface data
4358 * @settings: Settings for CCA period and new color
4359 * Returns: 0 on success, -1 on failure
4360 *
4361 * This function is used to move the BSS to its new color.
4362 */
4363 int (*switch_color)(void *priv, struct cca_settings *settings);
4364
4365 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004366 * add_tx_ts - Add traffic stream
4367 * @priv: Private driver interface data
4368 * @tsid: Traffic stream ID
4369 * @addr: Receiver address
4370 * @user_prio: User priority of the traffic stream
4371 * @admitted_time: Admitted time for this TS in units of
4372 * 32 microsecond periods (per second).
4373 * Returns: 0 on success, -1 on failure
4374 */
4375 int (*add_tx_ts)(void *priv, u8 tsid, const u8 *addr, u8 user_prio,
4376 u16 admitted_time);
4377
4378 /**
4379 * del_tx_ts - Delete traffic stream
4380 * @priv: Private driver interface data
4381 * @tsid: Traffic stream ID
4382 * @addr: Receiver address
4383 * Returns: 0 on success, -1 on failure
4384 */
4385 int (*del_tx_ts)(void *priv, u8 tsid, const u8 *addr);
4386
4387 /**
4388 * Enable channel-switching with TDLS peer
4389 * @priv: Private driver interface data
4390 * @addr: MAC address of the TDLS peer
4391 * @oper_class: Operating class of the switch channel
4392 * @params: Channel specification
4393 * Returns: 0 on success, -1 on failure
4394 *
4395 * The function indicates to driver that it can start switching to a
4396 * different channel with a specified TDLS peer. The switching is
4397 * assumed on until canceled with tdls_disable_channel_switch().
4398 */
4399 int (*tdls_enable_channel_switch)(
4400 void *priv, const u8 *addr, u8 oper_class,
4401 const struct hostapd_freq_params *params);
4402
4403 /**
4404 * Disable channel switching with TDLS peer
4405 * @priv: Private driver interface data
4406 * @addr: MAC address of the TDLS peer
4407 * Returns: 0 on success, -1 on failure
4408 *
4409 * This function indicates to the driver that it should stop switching
4410 * with a given TDLS peer.
4411 */
4412 int (*tdls_disable_channel_switch)(void *priv, const u8 *addr);
4413
4414 /**
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004415 * start_dfs_cac - Listen for radar interference on the channel
4416 * @priv: Private driver interface data
Dmitry Shmidt051af732013-10-22 13:52:46 -07004417 * @freq: Channel parameters
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004418 * Returns: 0 on success, -1 on failure
4419 */
Dmitry Shmidt051af732013-10-22 13:52:46 -07004420 int (*start_dfs_cac)(void *priv, struct hostapd_freq_params *freq);
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004421
4422 /**
4423 * stop_ap - Removes beacon from AP
4424 * @priv: Private driver interface data
4425 * Returns: 0 on success, -1 on failure (or if not supported)
4426 *
4427 * This optional function can be used to disable AP mode related
4428 * configuration. Unlike deinit_ap, it does not change to station
4429 * mode.
4430 */
4431 int (*stop_ap)(void *priv);
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07004432
4433 /**
4434 * get_survey - Retrieve survey data
4435 * @priv: Private driver interface data
4436 * @freq: If set, survey data for the specified frequency is only
4437 * being requested. If not set, all survey data is requested.
4438 * Returns: 0 on success, -1 on failure
4439 *
4440 * Use this to retrieve:
4441 *
4442 * - the observed channel noise floor
4443 * - the amount of time we have spent on the channel
4444 * - the amount of time during which we have spent on the channel that
4445 * the radio has determined the medium is busy and we cannot
4446 * transmit
4447 * - the amount of time we have spent receiving data
4448 * - the amount of time we have spent transmitting data
4449 *
4450 * This data can be used for spectrum heuristics. One example is
4451 * Automatic Channel Selection (ACS). The channel survey data is
4452 * kept on a linked list on the channel data, one entry is added
4453 * for each survey. The min_nf of the channel is updated for each
4454 * survey.
4455 */
4456 int (*get_survey)(void *priv, unsigned int freq);
Dmitry Shmidt56052862013-10-04 10:23:25 -07004457
4458 /**
4459 * status - Get driver interface status information
4460 * @priv: Private driver interface data
Hai Shalom74f70d42019-02-11 14:42:39 -08004461 * @buf: Buffer for printing the status information
Dmitry Shmidt56052862013-10-04 10:23:25 -07004462 * @buflen: Maximum length of the buffer
4463 * Returns: Length of written status information or -1 on failure
4464 */
4465 int (*status)(void *priv, char *buf, size_t buflen);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004466
Dmitry Shmidt661b4f72014-09-29 14:58:27 -07004467 /**
4468 * roaming - Set roaming policy for driver-based BSS selection
4469 * @priv: Private driver interface data
4470 * @allowed: Whether roaming within ESS is allowed
4471 * @bssid: Forced BSSID if roaming is disabled or %NULL if not set
4472 * Returns: Length of written status information or -1 on failure
4473 *
4474 * This optional callback can be used to update roaming policy from the
4475 * associate() command (bssid being set there indicates that the driver
4476 * should not roam before getting this roaming() call to allow roaming.
4477 * If the driver does not indicate WPA_DRIVER_FLAGS_BSS_SELECTION
4478 * capability, roaming policy is handled within wpa_supplicant and there
4479 * is no need to implement or react to this callback.
4480 */
4481 int (*roaming)(void *priv, int allowed, const u8 *bssid);
4482
4483 /**
Roshan Pius3a1667e2018-07-03 15:17:14 -07004484 * disable_fils - Enable/disable FILS feature
4485 * @priv: Private driver interface data
4486 * @disable: 0-enable and 1-disable FILS feature
4487 * Returns: 0 on success, -1 on failure
4488 *
4489 * This callback can be used to configure driver and below layers to
4490 * enable/disable all FILS features.
4491 */
4492 int (*disable_fils)(void *priv, int disable);
4493
4494 /**
Dmitry Shmidt661b4f72014-09-29 14:58:27 -07004495 * set_mac_addr - Set MAC address
4496 * @priv: Private driver interface data
4497 * @addr: MAC address to use or %NULL for setting back to permanent
4498 * Returns: 0 on success, -1 on failure
4499 */
4500 int (*set_mac_addr)(void *priv, const u8 *addr);
4501
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004502#ifdef CONFIG_MACSEC
4503 int (*macsec_init)(void *priv, struct macsec_init_params *params);
4504
4505 int (*macsec_deinit)(void *priv);
4506
4507 /**
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004508 * macsec_get_capability - Inform MKA of this driver's capability
4509 * @priv: Private driver interface data
4510 * @cap: Driver's capability
4511 * Returns: 0 on success, -1 on failure
4512 */
4513 int (*macsec_get_capability)(void *priv, enum macsec_cap *cap);
4514
4515 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004516 * enable_protect_frames - Set protect frames status
4517 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004518 * @enabled: true = protect frames enabled
4519 * false = protect frames disabled
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004520 * Returns: 0 on success, -1 on failure (or if not supported)
4521 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004522 int (*enable_protect_frames)(void *priv, bool enabled);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004523
4524 /**
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004525 * enable_encrypt - Set encryption status
4526 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004527 * @enabled: true = encrypt outgoing traffic
4528 * false = integrity-only protection on outgoing traffic
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004529 * Returns: 0 on success, -1 on failure (or if not supported)
4530 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004531 int (*enable_encrypt)(void *priv, bool enabled);
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004532
4533 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004534 * set_replay_protect - Set replay protect status and window size
4535 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004536 * @enabled: true = replay protect enabled
4537 * false = replay protect disabled
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004538 * @window: replay window size, valid only when replay protect enabled
4539 * Returns: 0 on success, -1 on failure (or if not supported)
4540 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004541 int (*set_replay_protect)(void *priv, bool enabled, u32 window);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004542
4543 /**
Sunil Ravi036cec52023-03-29 11:35:17 -07004544 * set_offload - Set MACsec hardware offload
4545 * @priv: Private driver interface data
4546 * @offload: 0 = MACSEC_OFFLOAD_OFF
4547 * 1 = MACSEC_OFFLOAD_PHY
4548 * 2 = MACSEC_OFFLOAD_MAC
4549 * Returns: 0 on success, -1 on failure (or if not supported)
4550 */
4551 int (*set_offload)(void *priv, u8 offload);
4552
4553 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004554 * set_current_cipher_suite - Set current cipher suite
4555 * @priv: Private driver interface data
4556 * @cs: EUI64 identifier
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004557 * Returns: 0 on success, -1 on failure (or if not supported)
4558 */
Dmitry Shmidt7d175302016-09-06 13:11:34 -07004559 int (*set_current_cipher_suite)(void *priv, u64 cs);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004560
4561 /**
4562 * enable_controlled_port - Set controlled port status
4563 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004564 * @enabled: true = controlled port enabled
4565 * false = controlled port disabled
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004566 * Returns: 0 on success, -1 on failure (or if not supported)
4567 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004568 int (*enable_controlled_port)(void *priv, bool enabled);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004569
4570 /**
4571 * get_receive_lowest_pn - Get receive lowest pn
4572 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004573 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004574 * Returns: 0 on success, -1 on failure (or if not supported)
4575 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004576 int (*get_receive_lowest_pn)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004577
4578 /**
4579 * get_transmit_next_pn - Get transmit next pn
4580 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004581 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004582 * Returns: 0 on success, -1 on failure (or if not supported)
4583 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004584 int (*get_transmit_next_pn)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004585
4586 /**
4587 * set_transmit_next_pn - Set transmit next pn
4588 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004589 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004590 * Returns: 0 on success, -1 on failure (or if not supported)
4591 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004592 int (*set_transmit_next_pn)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004593
4594 /**
Hai Shalom74f70d42019-02-11 14:42:39 -08004595 * set_receive_lowest_pn - Set receive lowest PN
4596 * @priv: Private driver interface data
4597 * @sa: secure association
4598 * Returns: 0 on success, -1 on failure (or if not supported)
4599 */
4600 int (*set_receive_lowest_pn)(void *priv, struct receive_sa *sa);
4601
4602 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004603 * create_receive_sc - create secure channel for receiving
4604 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004605 * @sc: secure channel
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004606 * @conf_offset: confidentiality offset (0, 30, or 50)
4607 * @validation: frame validation policy (0 = Disabled, 1 = Checked,
4608 * 2 = Strict)
4609 * Returns: 0 on success, -1 on failure (or if not supported)
4610 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004611 int (*create_receive_sc)(void *priv, struct receive_sc *sc,
4612 unsigned int conf_offset,
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004613 int validation);
4614
4615 /**
4616 * delete_receive_sc - delete secure connection for receiving
4617 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004618 * @sc: secure channel
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004619 * Returns: 0 on success, -1 on failure
4620 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004621 int (*delete_receive_sc)(void *priv, struct receive_sc *sc);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004622
4623 /**
4624 * create_receive_sa - create secure association for receive
4625 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004626 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004627 * Returns: 0 on success, -1 on failure
4628 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004629 int (*create_receive_sa)(void *priv, struct receive_sa *sa);
4630
4631 /**
4632 * delete_receive_sa - Delete secure association for receive
4633 * @priv: Private driver interface data from init()
4634 * @sa: Secure association
4635 * Returns: 0 on success, -1 on failure
4636 */
4637 int (*delete_receive_sa)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004638
4639 /**
4640 * enable_receive_sa - enable the SA for receive
4641 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004642 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004643 * Returns: 0 on success, -1 on failure
4644 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004645 int (*enable_receive_sa)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004646
4647 /**
4648 * disable_receive_sa - disable SA for receive
4649 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004650 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004651 * Returns: 0 on success, -1 on failure
4652 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004653 int (*disable_receive_sa)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004654
4655 /**
4656 * create_transmit_sc - create secure connection for transmit
4657 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004658 * @sc: secure channel
4659 * @conf_offset: confidentiality offset (0, 30, or 50)
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004660 * Returns: 0 on success, -1 on failure
4661 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004662 int (*create_transmit_sc)(void *priv, struct transmit_sc *sc,
4663 unsigned int conf_offset);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004664
4665 /**
4666 * delete_transmit_sc - delete secure connection for transmit
4667 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004668 * @sc: secure channel
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004669 * Returns: 0 on success, -1 on failure
4670 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004671 int (*delete_transmit_sc)(void *priv, struct transmit_sc *sc);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004672
4673 /**
4674 * create_transmit_sa - create secure association for transmit
4675 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004676 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004677 * Returns: 0 on success, -1 on failure
4678 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004679 int (*create_transmit_sa)(void *priv, struct transmit_sa *sa);
4680
4681 /**
4682 * delete_transmit_sa - Delete secure association for transmit
4683 * @priv: Private driver interface data from init()
4684 * @sa: Secure association
4685 * Returns: 0 on success, -1 on failure
4686 */
4687 int (*delete_transmit_sa)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004688
4689 /**
4690 * enable_transmit_sa - enable SA for transmit
4691 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004692 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004693 * Returns: 0 on success, -1 on failure
4694 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004695 int (*enable_transmit_sa)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004696
4697 /**
4698 * disable_transmit_sa - disable SA for transmit
4699 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004700 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004701 * Returns: 0 on success, -1 on failure
4702 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004703 int (*disable_transmit_sa)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004704#endif /* CONFIG_MACSEC */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004705
4706 /**
4707 * init_mesh - Driver specific initialization for mesh
4708 * @priv: Private driver interface data
4709 * Returns: 0 on success, -1 on failure
4710 */
4711 int (*init_mesh)(void *priv);
4712
4713 /**
4714 * join_mesh - Join a mesh network
4715 * @priv: Private driver interface data
4716 * @params: Mesh configuration parameters
4717 * Returns: 0 on success, -1 on failure
4718 */
4719 int (*join_mesh)(void *priv,
4720 struct wpa_driver_mesh_join_params *params);
4721
4722 /**
4723 * leave_mesh - Leave a mesh network
4724 * @priv: Private driver interface data
4725 * Returns 0 on success, -1 on failure
4726 */
4727 int (*leave_mesh)(void *priv);
4728
4729 /**
Hai Shalom81f62d82019-07-22 12:10:00 -07004730 * probe_mesh_link - Inject a frame over direct mesh link to a given
4731 * peer skipping the next_hop lookup from mpath table.
4732 * @priv: Private driver interface data
4733 * @addr: Peer MAC address
4734 * @eth: Ethernet frame to be sent
4735 * @len: Ethernet frame lengtn in bytes
4736 * Returns 0 on success, -1 on failure
4737 */
4738 int (*probe_mesh_link)(void *priv, const u8 *addr, const u8 *eth,
4739 size_t len);
4740
4741 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004742 * do_acs - Automatically select channel
4743 * @priv: Private driver interface data
4744 * @params: Parameters for ACS
4745 * Returns 0 on success, -1 on failure
4746 *
4747 * This command can be used to offload ACS to the driver if the driver
4748 * indicates support for such offloading (WPA_DRIVER_FLAGS_ACS_OFFLOAD).
4749 */
4750 int (*do_acs)(void *priv, struct drv_acs_params *params);
Ravi Joshie6ccb162015-07-16 17:45:41 -07004751
4752 /**
Hai Shalom60840252021-02-19 19:02:11 -08004753 * set_band - Notify driver of band(s) selection
Ravi Joshie6ccb162015-07-16 17:45:41 -07004754 * @priv: Private driver interface data
Hai Shalom60840252021-02-19 19:02:11 -08004755 * @band_mask: The selected band(s) bit mask (from enum set_band)
Ravi Joshie6ccb162015-07-16 17:45:41 -07004756 * Returns 0 on success, -1 on failure
4757 */
Hai Shalom60840252021-02-19 19:02:11 -08004758 int (*set_band)(void *priv, u32 band_mask);
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08004759
4760 /**
4761 * get_pref_freq_list - Get preferred frequency list for an interface
4762 * @priv: Private driver interface data
4763 * @if_type: Interface type
4764 * @num: Number of channels
Sunil8cd6f4d2022-06-28 18:40:46 +00004765 * @freq_list: Weighted preferred channel list
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08004766 * Returns 0 on success, -1 on failure
4767 *
4768 * This command can be used to query the preferred frequency list from
Sunil8cd6f4d2022-06-28 18:40:46 +00004769 * the driver specific to a particular interface type. The freq_list
4770 * array needs to have room for *num entries. *num will be updated to
4771 * indicate the number of entries fetched from the driver.
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08004772 */
4773 int (*get_pref_freq_list)(void *priv, enum wpa_driver_if_type if_type,
Sunil8cd6f4d2022-06-28 18:40:46 +00004774 unsigned int *num,
4775 struct weighted_pcl *freq_list);
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08004776
4777 /**
4778 * set_prob_oper_freq - Indicate probable P2P operating channel
4779 * @priv: Private driver interface data
4780 * @freq: Channel frequency in MHz
4781 * Returns 0 on success, -1 on failure
4782 *
4783 * This command can be used to inform the driver of the operating
4784 * frequency that an ongoing P2P group formation is likely to come up
4785 * on. Local device is assuming P2P Client role.
4786 */
4787 int (*set_prob_oper_freq)(void *priv, unsigned int freq);
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08004788
4789 /**
4790 * abort_scan - Request the driver to abort an ongoing scan
4791 * @priv: Private driver interface data
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004792 * @scan_cookie: Cookie identifying the scan request. This is used only
4793 * when the vendor interface QCA_NL80211_VENDOR_SUBCMD_TRIGGER_SCAN
4794 * was used to trigger scan. Otherwise, 0 is used.
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08004795 * Returns 0 on success, -1 on failure
4796 */
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004797 int (*abort_scan)(void *priv, u64 scan_cookie);
Dmitry Shmidt849734c2016-05-27 09:59:01 -07004798
4799 /**
4800 * configure_data_frame_filters - Request to configure frame filters
4801 * @priv: Private driver interface data
4802 * @filter_flags: The type of frames to filter (bitfield of
4803 * WPA_DATA_FRAME_FILTER_FLAG_*)
4804 * Returns: 0 on success or -1 on failure
4805 */
4806 int (*configure_data_frame_filters)(void *priv, u32 filter_flags);
Dmitry Shmidtd5ab1b52016-06-21 12:38:41 -07004807
4808 /**
4809 * get_ext_capab - Get extended capabilities for the specified interface
4810 * @priv: Private driver interface data
4811 * @type: Interface type for which to get extended capabilities
4812 * @ext_capab: Extended capabilities fetched
4813 * @ext_capab_mask: Extended capabilities mask
4814 * @ext_capab_len: Length of the extended capabilities
4815 * Returns: 0 on success or -1 on failure
4816 */
4817 int (*get_ext_capab)(void *priv, enum wpa_driver_if_type type,
4818 const u8 **ext_capab, const u8 **ext_capab_mask,
4819 unsigned int *ext_capab_len);
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07004820
4821 /**
4822 * p2p_lo_start - Start offloading P2P listen to device
4823 * @priv: Private driver interface data
4824 * @freq: Listening frequency (MHz) for P2P listen
4825 * @period: Length of the listen operation in milliseconds
4826 * @interval: Interval for running the listen operation in milliseconds
4827 * @count: Number of times to run the listen operation
4828 * @device_types: Device primary and secondary types
4829 * @dev_types_len: Number of bytes for device_types
4830 * @ies: P2P IE and WSC IE for Probe Response frames
4831 * @ies_len: Length of ies in bytes
4832 * Returns: 0 on success or -1 on failure
4833 */
4834 int (*p2p_lo_start)(void *priv, unsigned int freq,
4835 unsigned int period, unsigned int interval,
4836 unsigned int count,
4837 const u8 *device_types, size_t dev_types_len,
4838 const u8 *ies, size_t ies_len);
4839
4840 /**
4841 * p2p_lo_stop - Stop P2P listen offload
4842 * @priv: Private driver interface data
4843 * Returns: 0 on success or -1 on failure
4844 */
4845 int (*p2p_lo_stop)(void *priv);
Dmitry Shmidt7f2c7532016-08-15 09:48:12 -07004846
4847 /**
4848 * set_default_scan_ies - Set default scan IEs
4849 * @priv: Private driver interface data
4850 * @ies: Scan default IEs buffer
4851 * @ies_len: Length of IEs in bytes
4852 * Returns: 0 on success or -1 on failure
4853 *
4854 * The driver can use these by default when there are no scan IEs coming
4855 * in the subsequent scan requests. Also in case of one or more of IEs
4856 * given in set_default_scan_ies() are missing in the subsequent scan
4857 * request, the driver should merge the missing scan IEs in the scan
4858 * request from the IEs set by set_default_scan_ies() in the Probe
4859 * Request frames sent.
4860 */
4861 int (*set_default_scan_ies)(void *priv, const u8 *ies, size_t ies_len);
4862
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004863 /**
4864 * set_tdls_mode - Set TDLS trigger mode to the host driver
4865 * @priv: Private driver interface data
4866 * @tdls_external_control: Represents if TDLS external trigger control
4867 * mode is enabled/disabled.
4868 *
4869 * This optional callback can be used to configure the TDLS external
4870 * trigger control mode to the host driver.
4871 */
4872 int (*set_tdls_mode)(void *priv, int tdls_external_control);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004873
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004874 /**
4875 * get_bss_transition_status - Get candidate BSS's transition status
4876 * @priv: Private driver interface data
4877 * @params: Candidate BSS list
4878 *
4879 * Get the accept or reject reason code for a list of BSS transition
4880 * candidates.
4881 */
4882 struct wpa_bss_candidate_info *
4883 (*get_bss_transition_status)(void *priv,
4884 struct wpa_bss_trans_info *params);
4885 /**
4886 * ignore_assoc_disallow - Configure driver to ignore assoc_disallow
4887 * @priv: Private driver interface data
4888 * @ignore_disallow: 0 to not ignore, 1 to ignore
4889 * Returns: 0 on success, -1 on failure
4890 */
4891 int (*ignore_assoc_disallow)(void *priv, int ignore_disallow);
4892
4893 /**
Hai Shalom899fcc72020-10-19 14:38:18 -07004894 * set_bssid_tmp_disallow - Set disallowed BSSIDs to the driver
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004895 * @priv: Private driver interface data
Hai Shalom899fcc72020-10-19 14:38:18 -07004896 * @num_bssid: Number of temporarily disallowed BSSIDs
4897 * @bssids: List of temporarily disallowed BSSIDs
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004898 */
Hai Shalom899fcc72020-10-19 14:38:18 -07004899 int (*set_bssid_tmp_disallow)(void *priv, unsigned int num_bssid,
4900 const u8 *bssid);
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004901
4902 /**
4903 * update_connect_params - Update the connection parameters
4904 * @priv: Private driver interface data
4905 * @params: Association parameters
4906 * @mask: Bit mask indicating which parameters in @params have to be
4907 * updated
4908 * Returns: 0 on success, -1 on failure
4909 *
4910 * Update the connection parameters when in connected state so that the
4911 * driver uses the updated parameters for subsequent roaming. This is
4912 * used only with drivers that implement internal BSS selection and
4913 * roaming.
4914 */
4915 int (*update_connect_params)(
4916 void *priv, struct wpa_driver_associate_params *params,
4917 enum wpa_drv_update_connect_params_mask mask);
Roshan Pius3a1667e2018-07-03 15:17:14 -07004918
4919 /**
4920 * send_external_auth_status - Indicate the status of external
4921 * authentication processing to the host driver.
4922 * @priv: Private driver interface data
4923 * @params: Status of authentication processing.
4924 * Returns: 0 on success, -1 on failure
4925 */
4926 int (*send_external_auth_status)(void *priv,
4927 struct external_auth *params);
Hai Shalom74f70d42019-02-11 14:42:39 -08004928
4929 /**
4930 * set_4addr_mode - Set 4-address mode
4931 * @priv: Private driver interface data
4932 * @bridge_ifname: Bridge interface name
4933 * @val: 0 - disable 4addr mode, 1 - enable 4addr mode
4934 * Returns: 0 on success, < 0 on failure
4935 */
4936 int (*set_4addr_mode)(void *priv, const char *bridge_ifname, int val);
Hai Shalom81f62d82019-07-22 12:10:00 -07004937
4938 /**
4939 * update_dh_ie - Update DH IE
4940 * @priv: Private driver interface data
4941 * @peer_mac: Peer MAC address
4942 * @reason_code: Reacon code
4943 * @ie: DH IE
4944 * @ie_len: DH IE length in bytes
4945 * Returns: 0 on success, -1 on failure
4946 *
4947 * This callback is used to let the driver know the DH processing result
4948 * and DH IE for a pending association.
4949 */
4950 int (*update_dh_ie)(void *priv, const u8 *peer_mac, u16 reason_code,
4951 const u8 *ie, size_t ie_len);
Hai Shalomb755a2a2020-04-23 21:49:02 -07004952
4953 /**
4954 * dpp_listen - Notify driver about start/stop of DPP listen
4955 * @priv: Private driver interface data
4956 * @enable: Whether listen state is enabled (or disabled)
4957 * Returns: 0 on success, -1 on failure
4958 *
4959 * This optional callback can be used to update RX frame filtering to
4960 * explicitly allow reception of broadcast Public Action frames.
4961 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004962 int (*dpp_listen)(void *priv, bool enable);
Hai Shalomc1a21442022-02-04 13:43:00 -08004963
Sunil Ravi89eba102022-09-13 21:04:37 -07004964 /**
4965 * set_secure_ranging_ctx - Add or delete secure ranging parameters of
4966 * the specified peer to the driver.
4967 * @priv: Private driver interface data
4968 * @params: Secure ranging parameters
4969 * Returns: 0 on success, -1 on failure
4970 *
4971 */
4972 int (*set_secure_ranging_ctx)(void *priv,
4973 struct secure_ranging_params *params);
4974
4975 /**
4976 * send_pasn_resp - Send PASN response for a set of peers to the
4977 * driver.
4978 * @priv: Private driver interface data
4979 * @params: Parameters holding peers and respective status.
4980 * Returns: 0 on success, -1 on failure
4981 */
4982 int (*send_pasn_resp)(void *priv, struct pasn_auth *params);
4983
4984 /**
4985 * get_sta_mlo_info - Get the current multi-link association info
4986 * @priv: Private driver interface data
4987 * @mlo: Pointer to fill multi-link association info
4988 * Returns: 0 on success, -1 on failure
4989 *
4990 * This callback is used to fetch multi-link of the current association.
4991 */
4992 int (*get_sta_mlo_info)(void *priv,
4993 struct driver_sta_mlo_info *mlo_info);
4994
Sunil Ravi036cec52023-03-29 11:35:17 -07004995 /**
4996 * link_add - Add a link to the AP MLD interface
4997 * @priv: Private driver interface data
4998 * @link_id: The link ID
4999 * @addr: The MAC address to use for the link
5000 * Returns: 0 on success, negative value on failure
5001 */
5002 int (*link_add)(void *priv, u8 link_id, const u8 *addr);
5003
Hai Shalomc1a21442022-02-04 13:43:00 -08005004#ifdef CONFIG_TESTING_OPTIONS
5005 int (*register_frame)(void *priv, u16 type,
5006 const u8 *match, size_t match_len,
5007 bool multicast);
5008#endif /* CONFIG_TESTING_OPTIONS */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005009};
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005010
5011/**
5012 * enum wpa_event_type - Event type for wpa_supplicant_event() calls
5013 */
5014enum wpa_event_type {
5015 /**
5016 * EVENT_ASSOC - Association completed
5017 *
5018 * This event needs to be delivered when the driver completes IEEE
5019 * 802.11 association or reassociation successfully.
5020 * wpa_driver_ops::get_bssid() is expected to provide the current BSSID
5021 * after this event has been generated. In addition, optional
5022 * EVENT_ASSOCINFO may be generated just before EVENT_ASSOC to provide
5023 * more information about the association. If the driver interface gets
5024 * both of these events at the same time, it can also include the
5025 * assoc_info data in EVENT_ASSOC call.
5026 */
5027 EVENT_ASSOC,
5028
5029 /**
5030 * EVENT_DISASSOC - Association lost
5031 *
5032 * This event should be called when association is lost either due to
5033 * receiving deauthenticate or disassociate frame from the AP or when
5034 * sending either of these frames to the current AP. If the driver
5035 * supports separate deauthentication event, EVENT_DISASSOC should only
5036 * be used for disassociation and EVENT_DEAUTH for deauthentication.
5037 * In AP mode, union wpa_event_data::disassoc_info is required.
5038 */
5039 EVENT_DISASSOC,
5040
5041 /**
5042 * EVENT_MICHAEL_MIC_FAILURE - Michael MIC (TKIP) detected
5043 *
5044 * This event must be delivered when a Michael MIC error is detected by
5045 * the local driver. Additional data for event processing is
5046 * provided with union wpa_event_data::michael_mic_failure. This
Sunil Ravia04bd252022-05-02 22:54:18 -07005047 * information is used to request new encryption key and to initiate
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005048 * TKIP countermeasures if needed.
5049 */
5050 EVENT_MICHAEL_MIC_FAILURE,
5051
5052 /**
5053 * EVENT_SCAN_RESULTS - Scan results available
5054 *
5055 * This event must be called whenever scan results are available to be
5056 * fetched with struct wpa_driver_ops::get_scan_results(). This event
5057 * is expected to be used some time after struct wpa_driver_ops::scan()
5058 * is called. If the driver provides an unsolicited event when the scan
5059 * has been completed, this event can be used to trigger
5060 * EVENT_SCAN_RESULTS call. If such event is not available from the
5061 * driver, the driver wrapper code is expected to use a registered
5062 * timeout to generate EVENT_SCAN_RESULTS call after the time that the
5063 * scan is expected to be completed. Optional information about
5064 * completed scan can be provided with union wpa_event_data::scan_info.
5065 */
5066 EVENT_SCAN_RESULTS,
5067
5068 /**
5069 * EVENT_ASSOCINFO - Report optional extra information for association
5070 *
5071 * This event can be used to report extra association information for
5072 * EVENT_ASSOC processing. This extra information includes IEs from
5073 * association frames and Beacon/Probe Response frames in union
5074 * wpa_event_data::assoc_info. EVENT_ASSOCINFO must be send just before
5075 * EVENT_ASSOC. Alternatively, the driver interface can include
5076 * assoc_info data in the EVENT_ASSOC call if it has all the
5077 * information available at the same point.
5078 */
5079 EVENT_ASSOCINFO,
5080
5081 /**
5082 * EVENT_INTERFACE_STATUS - Report interface status changes
5083 *
5084 * This optional event can be used to report changes in interface
5085 * status (interface added/removed) using union
5086 * wpa_event_data::interface_status. This can be used to trigger
5087 * wpa_supplicant to stop and re-start processing for the interface,
5088 * e.g., when a cardbus card is ejected/inserted.
5089 */
5090 EVENT_INTERFACE_STATUS,
5091
5092 /**
5093 * EVENT_PMKID_CANDIDATE - Report a candidate AP for pre-authentication
5094 *
5095 * This event can be used to inform wpa_supplicant about candidates for
5096 * RSN (WPA2) pre-authentication. If wpa_supplicant is not responsible
5097 * for scan request (ap_scan=2 mode), this event is required for
5098 * pre-authentication. If wpa_supplicant is performing scan request
5099 * (ap_scan=1), this event is optional since scan results can be used
5100 * to add pre-authentication candidates. union
5101 * wpa_event_data::pmkid_candidate is used to report the BSSID of the
5102 * candidate and priority of the candidate, e.g., based on the signal
5103 * strength, in order to try to pre-authenticate first with candidates
5104 * that are most likely targets for re-association.
5105 *
5106 * EVENT_PMKID_CANDIDATE can be called whenever the driver has updates
5107 * on the candidate list. In addition, it can be called for the current
5108 * AP and APs that have existing PMKSA cache entries. wpa_supplicant
5109 * will automatically skip pre-authentication in cases where a valid
5110 * PMKSA exists. When more than one candidate exists, this event should
5111 * be generated once for each candidate.
5112 *
5113 * Driver will be notified about successful pre-authentication with
5114 * struct wpa_driver_ops::add_pmkid() calls.
5115 */
5116 EVENT_PMKID_CANDIDATE,
5117
5118 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005119 * EVENT_TDLS - Request TDLS operation
5120 *
5121 * This event can be used to request a TDLS operation to be performed.
5122 */
5123 EVENT_TDLS,
5124
5125 /**
5126 * EVENT_FT_RESPONSE - Report FT (IEEE 802.11r) response IEs
5127 *
5128 * The driver is expected to report the received FT IEs from
5129 * FT authentication sequence from the AP. The FT IEs are included in
5130 * the extra information in union wpa_event_data::ft_ies.
5131 */
5132 EVENT_FT_RESPONSE,
5133
5134 /**
5135 * EVENT_IBSS_RSN_START - Request RSN authentication in IBSS
5136 *
5137 * The driver can use this event to inform wpa_supplicant about a STA
5138 * in an IBSS with which protected frames could be exchanged. This
5139 * event starts RSN authentication with the other STA to authenticate
5140 * the STA and set up encryption keys with it.
5141 */
5142 EVENT_IBSS_RSN_START,
5143
5144 /**
5145 * EVENT_AUTH - Authentication result
5146 *
5147 * This event should be called when authentication attempt has been
5148 * completed. This is only used if the driver supports separate
5149 * authentication step (struct wpa_driver_ops::authenticate).
5150 * Information about authentication result is included in
5151 * union wpa_event_data::auth.
5152 */
5153 EVENT_AUTH,
5154
5155 /**
5156 * EVENT_DEAUTH - Authentication lost
5157 *
5158 * This event should be called when authentication is lost either due
5159 * to receiving deauthenticate frame from the AP or when sending that
5160 * frame to the current AP.
5161 * In AP mode, union wpa_event_data::deauth_info is required.
5162 */
5163 EVENT_DEAUTH,
5164
5165 /**
5166 * EVENT_ASSOC_REJECT - Association rejected
5167 *
5168 * This event should be called when (re)association attempt has been
5169 * rejected by the AP. Information about the association response is
5170 * included in union wpa_event_data::assoc_reject.
5171 */
5172 EVENT_ASSOC_REJECT,
5173
5174 /**
5175 * EVENT_AUTH_TIMED_OUT - Authentication timed out
5176 */
5177 EVENT_AUTH_TIMED_OUT,
5178
5179 /**
5180 * EVENT_ASSOC_TIMED_OUT - Association timed out
5181 */
5182 EVENT_ASSOC_TIMED_OUT,
5183
5184 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005185 * EVENT_WPS_BUTTON_PUSHED - Report hardware push button press for WPS
5186 */
5187 EVENT_WPS_BUTTON_PUSHED,
5188
5189 /**
5190 * EVENT_TX_STATUS - Report TX status
5191 */
5192 EVENT_TX_STATUS,
5193
5194 /**
5195 * EVENT_RX_FROM_UNKNOWN - Report RX from unknown STA
5196 */
5197 EVENT_RX_FROM_UNKNOWN,
5198
5199 /**
5200 * EVENT_RX_MGMT - Report RX of a management frame
5201 */
5202 EVENT_RX_MGMT,
5203
5204 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005205 * EVENT_REMAIN_ON_CHANNEL - Remain-on-channel duration started
5206 *
5207 * This event is used to indicate when the driver has started the
5208 * requested remain-on-channel duration. Information about the
5209 * operation is included in union wpa_event_data::remain_on_channel.
5210 */
5211 EVENT_REMAIN_ON_CHANNEL,
5212
5213 /**
5214 * EVENT_CANCEL_REMAIN_ON_CHANNEL - Remain-on-channel timed out
5215 *
5216 * This event is used to indicate when the driver has completed
5217 * remain-on-channel duration, i.e., may noot be available on the
5218 * requested channel anymore. Information about the
5219 * operation is included in union wpa_event_data::remain_on_channel.
5220 */
5221 EVENT_CANCEL_REMAIN_ON_CHANNEL,
5222
5223 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005224 * EVENT_RX_PROBE_REQ - Indicate received Probe Request frame
5225 *
5226 * This event is used to indicate when a Probe Request frame has been
5227 * received. Information about the received frame is included in
5228 * union wpa_event_data::rx_probe_req. The driver is required to report
5229 * these events only after successfully completed probe_req_report()
5230 * commands to request the events (i.e., report parameter is non-zero)
5231 * in station mode. In AP mode, Probe Request frames should always be
5232 * reported.
5233 */
5234 EVENT_RX_PROBE_REQ,
5235
5236 /**
5237 * EVENT_NEW_STA - New wired device noticed
5238 *
5239 * This event is used to indicate that a new device has been detected
5240 * in a network that does not use association-like functionality (i.e.,
5241 * mainly wired Ethernet). This can be used to start EAPOL
5242 * authenticator when receiving a frame from a device. The address of
5243 * the device is included in union wpa_event_data::new_sta.
5244 */
5245 EVENT_NEW_STA,
5246
5247 /**
5248 * EVENT_EAPOL_RX - Report received EAPOL frame
5249 *
5250 * When in AP mode with hostapd, this event is required to be used to
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08005251 * deliver the receive EAPOL frames from the driver.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005252 */
5253 EVENT_EAPOL_RX,
5254
5255 /**
5256 * EVENT_SIGNAL_CHANGE - Indicate change in signal strength
5257 *
5258 * This event is used to indicate changes in the signal strength
5259 * observed in frames received from the current AP if signal strength
5260 * monitoring has been enabled with signal_monitor().
5261 */
5262 EVENT_SIGNAL_CHANGE,
5263
5264 /**
5265 * EVENT_INTERFACE_ENABLED - Notify that interface was enabled
5266 *
5267 * This event is used to indicate that the interface was enabled after
5268 * having been previously disabled, e.g., due to rfkill.
5269 */
5270 EVENT_INTERFACE_ENABLED,
5271
5272 /**
5273 * EVENT_INTERFACE_DISABLED - Notify that interface was disabled
5274 *
5275 * This event is used to indicate that the interface was disabled,
5276 * e.g., due to rfkill.
5277 */
5278 EVENT_INTERFACE_DISABLED,
5279
5280 /**
5281 * EVENT_CHANNEL_LIST_CHANGED - Channel list changed
5282 *
5283 * This event is used to indicate that the channel list has changed,
5284 * e.g., because of a regulatory domain change triggered by scan
5285 * results including an AP advertising a country code.
5286 */
5287 EVENT_CHANNEL_LIST_CHANGED,
5288
5289 /**
5290 * EVENT_INTERFACE_UNAVAILABLE - Notify that interface is unavailable
5291 *
5292 * This event is used to indicate that the driver cannot maintain this
5293 * interface in its operation mode anymore. The most likely use for
5294 * this is to indicate that AP mode operation is not available due to
5295 * operating channel would need to be changed to a DFS channel when
5296 * the driver does not support radar detection and another virtual
5297 * interfaces caused the operating channel to change. Other similar
5298 * resource conflicts could also trigger this for station mode
Dmitry Shmidtd30ac602014-06-30 09:54:22 -07005299 * interfaces. This event can be propagated when channel switching
5300 * fails.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005301 */
5302 EVENT_INTERFACE_UNAVAILABLE,
5303
5304 /**
5305 * EVENT_BEST_CHANNEL
5306 *
5307 * Driver generates this event whenever it detects a better channel
5308 * (e.g., based on RSSI or channel use). This information can be used
5309 * to improve channel selection for a new AP/P2P group.
5310 */
5311 EVENT_BEST_CHANNEL,
5312
5313 /**
5314 * EVENT_UNPROT_DEAUTH - Unprotected Deauthentication frame received
5315 *
5316 * This event should be called when a Deauthentication frame is dropped
5317 * due to it not being protected (MFP/IEEE 802.11w).
5318 * union wpa_event_data::unprot_deauth is required to provide more
5319 * details of the frame.
5320 */
5321 EVENT_UNPROT_DEAUTH,
5322
5323 /**
5324 * EVENT_UNPROT_DISASSOC - Unprotected Disassociation frame received
5325 *
5326 * This event should be called when a Disassociation frame is dropped
5327 * due to it not being protected (MFP/IEEE 802.11w).
5328 * union wpa_event_data::unprot_disassoc is required to provide more
5329 * details of the frame.
5330 */
5331 EVENT_UNPROT_DISASSOC,
5332
5333 /**
5334 * EVENT_STATION_LOW_ACK
5335 *
5336 * Driver generates this event whenever it detected that a particular
5337 * station was lost. Detection can be through massive transmission
5338 * failures for example.
5339 */
5340 EVENT_STATION_LOW_ACK,
5341
5342 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005343 * EVENT_IBSS_PEER_LOST - IBSS peer not reachable anymore
5344 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08005345 EVENT_IBSS_PEER_LOST,
5346
5347 /**
5348 * EVENT_DRIVER_GTK_REKEY - Device/driver did GTK rekey
5349 *
5350 * This event carries the new replay counter to notify wpa_supplicant
5351 * of the current EAPOL-Key Replay Counter in case the driver/firmware
5352 * completed Group Key Handshake while the host (including
5353 * wpa_supplicant was sleeping).
5354 */
5355 EVENT_DRIVER_GTK_REKEY,
5356
5357 /**
5358 * EVENT_SCHED_SCAN_STOPPED - Scheduled scan was stopped
5359 */
5360 EVENT_SCHED_SCAN_STOPPED,
5361
5362 /**
5363 * EVENT_DRIVER_CLIENT_POLL_OK - Station responded to poll
5364 *
5365 * This event indicates that the station responded to the poll
5366 * initiated with @poll_client.
5367 */
5368 EVENT_DRIVER_CLIENT_POLL_OK,
5369
5370 /**
5371 * EVENT_EAPOL_TX_STATUS - notify of EAPOL TX status
5372 */
Dmitry Shmidt04949592012-07-19 12:16:46 -07005373 EVENT_EAPOL_TX_STATUS,
5374
5375 /**
5376 * EVENT_CH_SWITCH - AP or GO decided to switch channels
5377 *
5378 * Described in wpa_event_data.ch_switch
5379 * */
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07005380 EVENT_CH_SWITCH,
5381
5382 /**
Hai Shalom81f62d82019-07-22 12:10:00 -07005383 * EVENT_CH_SWITCH_STARTED - AP or GO started to switch channels
5384 *
5385 * This is a pre-switch event indicating the shortly following switch
5386 * of operating channels.
5387 *
5388 * Described in wpa_event_data.ch_switch
5389 */
5390 EVENT_CH_SWITCH_STARTED,
5391 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07005392 * EVENT_WNM - Request WNM operation
5393 *
5394 * This event can be used to request a WNM operation to be performed.
5395 */
Dmitry Shmidtf8623282013-02-20 14:34:59 -08005396 EVENT_WNM,
5397
5398 /**
5399 * EVENT_CONNECT_FAILED_REASON - Connection failure reason in AP mode
5400 *
5401 * This event indicates that the driver reported a connection failure
5402 * with the specified client (for example, max client reached, etc.) in
5403 * AP mode.
5404 */
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005405 EVENT_CONNECT_FAILED_REASON,
5406
5407 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005408 * EVENT_DFS_RADAR_DETECTED - Notify of radar detection
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005409 *
5410 * A radar has been detected on the supplied frequency, hostapd should
5411 * react accordingly (e.g., change channel).
5412 */
5413 EVENT_DFS_RADAR_DETECTED,
5414
5415 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005416 * EVENT_DFS_CAC_FINISHED - Notify that channel availability check has been completed
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005417 *
5418 * After a successful CAC, the channel can be marked clear and used.
5419 */
5420 EVENT_DFS_CAC_FINISHED,
5421
5422 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005423 * EVENT_DFS_CAC_ABORTED - Notify that channel availability check has been aborted
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005424 *
5425 * The CAC was not successful, and the channel remains in the previous
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08005426 * state. This may happen due to a radar being detected or other
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005427 * external influences.
5428 */
5429 EVENT_DFS_CAC_ABORTED,
5430
5431 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005432 * EVENT_DFS_NOP_FINISHED - Notify that non-occupancy period is over
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005433 *
5434 * The channel which was previously unavailable is now available again.
5435 */
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07005436 EVENT_DFS_NOP_FINISHED,
5437
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08005438 /**
5439 * EVENT_SURVEY - Received survey data
5440 *
5441 * This event gets triggered when a driver query is issued for survey
5442 * data and the requested data becomes available. The returned data is
5443 * stored in struct survey_results. The results provide at most one
5444 * survey entry for each frequency and at minimum will provide one
5445 * survey entry for one frequency. The survey data can be os_malloc()'d
5446 * and then os_free()'d, so the event callback must only copy data.
5447 */
5448 EVENT_SURVEY,
5449
5450 /**
5451 * EVENT_SCAN_STARTED - Scan started
5452 *
5453 * This indicates that driver has started a scan operation either based
5454 * on a request from wpa_supplicant/hostapd or from another application.
5455 * EVENT_SCAN_RESULTS is used to indicate when the scan has been
5456 * completed (either successfully or by getting cancelled).
5457 */
Dmitry Shmidtcf32e602014-01-28 10:57:39 -08005458 EVENT_SCAN_STARTED,
5459
5460 /**
5461 * EVENT_AVOID_FREQUENCIES - Received avoid frequency range
5462 *
5463 * This event indicates a set of frequency ranges that should be avoided
5464 * to reduce issues due to interference or internal co-existence
5465 * information in the driver.
5466 */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08005467 EVENT_AVOID_FREQUENCIES,
5468
5469 /**
5470 * EVENT_NEW_PEER_CANDIDATE - new (unknown) mesh peer notification
5471 */
5472 EVENT_NEW_PEER_CANDIDATE,
5473
5474 /**
5475 * EVENT_ACS_CHANNEL_SELECTED - Received selected channels by ACS
5476 *
5477 * Indicates a pair of primary and secondary channels chosen by ACS
5478 * in device.
5479 */
5480 EVENT_ACS_CHANNEL_SELECTED,
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005481
5482 /**
5483 * EVENT_DFS_CAC_STARTED - Notify that channel availability check has
5484 * been started.
5485 *
5486 * This event indicates that channel availability check has been started
5487 * on a DFS frequency by a driver that supports DFS Offload.
5488 */
5489 EVENT_DFS_CAC_STARTED,
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07005490
5491 /**
5492 * EVENT_P2P_LO_STOP - Notify that P2P listen offload is stopped
5493 */
5494 EVENT_P2P_LO_STOP,
Paul Stewart092955c2017-02-06 09:13:09 -08005495
5496 /**
5497 * EVENT_BEACON_LOSS - Beacon loss detected
5498 *
5499 * This event indicates that no Beacon frames has been received from
5500 * the current AP. This may indicate that the AP is not anymore in
5501 * range.
5502 */
5503 EVENT_BEACON_LOSS,
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005504
5505 /**
5506 * EVENT_DFS_PRE_CAC_EXPIRED - Notify that channel availability check
5507 * done previously (Pre-CAC) on the channel has expired. This would
5508 * normally be on a non-ETSI DFS regulatory domain. DFS state of the
5509 * channel will be moved from available to usable. A new CAC has to be
5510 * performed before start operating on this channel.
5511 */
5512 EVENT_DFS_PRE_CAC_EXPIRED,
Roshan Pius3a1667e2018-07-03 15:17:14 -07005513
5514 /**
5515 * EVENT_EXTERNAL_AUTH - This event interface is used by host drivers
5516 * that do not define separate commands for authentication and
5517 * association (~WPA_DRIVER_FLAGS_SME) but offload the 802.11
5518 * authentication to wpa_supplicant. This event carries all the
5519 * necessary information from the host driver for the authentication to
5520 * happen.
5521 */
5522 EVENT_EXTERNAL_AUTH,
5523
5524 /**
5525 * EVENT_PORT_AUTHORIZED - Notification that a connection is authorized
5526 *
5527 * This event should be indicated when the driver completes the 4-way
5528 * handshake. This event should be preceded by an EVENT_ASSOC that
5529 * indicates the completion of IEEE 802.11 association.
5530 */
5531 EVENT_PORT_AUTHORIZED,
5532
5533 /**
5534 * EVENT_STATION_OPMODE_CHANGED - Notify STA's HT/VHT operation mode
5535 * change event.
5536 */
5537 EVENT_STATION_OPMODE_CHANGED,
5538
5539 /**
5540 * EVENT_INTERFACE_MAC_CHANGED - Notify that interface MAC changed
5541 *
5542 * This event is emitted when the MAC changes while the interface is
5543 * enabled. When an interface was disabled and becomes enabled, it
5544 * must be always assumed that the MAC possibly changed.
5545 */
5546 EVENT_INTERFACE_MAC_CHANGED,
5547
5548 /**
5549 * EVENT_WDS_STA_INTERFACE_STATUS - Notify WDS STA interface status
5550 *
5551 * This event is emitted when an interface is added/removed for WDS STA.
5552 */
5553 EVENT_WDS_STA_INTERFACE_STATUS,
Hai Shalom81f62d82019-07-22 12:10:00 -07005554
5555 /**
5556 * EVENT_UPDATE_DH - Notification of updated DH information
5557 */
5558 EVENT_UPDATE_DH,
Hai Shalomfdcde762020-04-02 11:19:20 -07005559
5560 /**
5561 * EVENT_UNPROT_BEACON - Unprotected Beacon frame received
5562 *
5563 * This event should be called when a Beacon frame is dropped due to it
5564 * not being protected correctly. union wpa_event_data::unprot_beacon
5565 * is required to provide more details of the frame.
5566 */
5567 EVENT_UNPROT_BEACON,
Hai Shalomc1a21442022-02-04 13:43:00 -08005568
5569 /**
5570 * EVENT_TX_WAIT_EXPIRE - TX wait timed out
5571 *
5572 * This event is used to indicate when the driver has completed
5573 * wait for a response frame based on a TX request that specified a
5574 * non-zero wait time and that has not been explicitly cancelled.
5575 */
5576 EVENT_TX_WAIT_EXPIRE,
Sunil Ravia04bd252022-05-02 22:54:18 -07005577
5578 /**
5579 * EVENT_BSS_COLOR_COLLISION - Notification of a BSS color collision
5580 */
5581 EVENT_BSS_COLOR_COLLISION,
5582
5583 /**
5584 * EVENT_CCA_STARTED_NOTIFY - Notification that CCA has started
5585 */
5586 EVENT_CCA_STARTED_NOTIFY,
5587
5588 /**
5589 * EVENT_CCA_ABORTED_NOTIFY - Notification that CCA has aborted
5590 */
5591 EVENT_CCA_ABORTED_NOTIFY,
5592
5593 /**
5594 * EVENT_CCA_NOTIFY - Notification that CCA has completed
5595 */
5596 EVENT_CCA_NOTIFY,
Sunil Ravi89eba102022-09-13 21:04:37 -07005597
5598 /**
5599 * EVENT_PASN_AUTH - This event is used by the driver that requests
5600 * PASN authentication and secure ranging context for multiple peers.
5601 */
5602 EVENT_PASN_AUTH,
5603
5604 /**
5605 * EVENT_LINK_CH_SWITCH - MLD AP link decided to switch channels
5606 *
5607 * Described in wpa_event_data.ch_switch.
5608 *
5609 */
5610 EVENT_LINK_CH_SWITCH,
5611
5612 /**
5613 * EVENT_LINK_CH_SWITCH_STARTED - MLD AP link started to switch channels
5614 *
5615 * This is a pre-switch event indicating the shortly following switch
5616 * of operating channels.
5617 *
5618 * Described in wpa_event_data.ch_switch.
5619 */
5620 EVENT_LINK_CH_SWITCH_STARTED,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005621};
5622
5623
5624/**
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07005625 * struct freq_survey - Channel survey info
5626 *
5627 * @ifidx: Interface index in which this survey was observed
5628 * @freq: Center of frequency of the surveyed channel
5629 * @nf: Channel noise floor in dBm
5630 * @channel_time: Amount of time in ms the radio spent on the channel
5631 * @channel_time_busy: Amount of time in ms the radio detected some signal
5632 * that indicated to the radio the channel was not clear
5633 * @channel_time_rx: Amount of time the radio spent receiving data
5634 * @channel_time_tx: Amount of time the radio spent transmitting data
5635 * @filled: bitmask indicating which fields have been reported, see
5636 * SURVEY_HAS_* defines.
5637 * @list: Internal list pointers
5638 */
5639struct freq_survey {
5640 u32 ifidx;
5641 unsigned int freq;
5642 s8 nf;
5643 u64 channel_time;
5644 u64 channel_time_busy;
5645 u64 channel_time_rx;
5646 u64 channel_time_tx;
5647 unsigned int filled;
5648 struct dl_list list;
5649};
5650
5651#define SURVEY_HAS_NF BIT(0)
5652#define SURVEY_HAS_CHAN_TIME BIT(1)
5653#define SURVEY_HAS_CHAN_TIME_BUSY BIT(2)
5654#define SURVEY_HAS_CHAN_TIME_RX BIT(3)
5655#define SURVEY_HAS_CHAN_TIME_TX BIT(4)
5656
Hai Shalom60840252021-02-19 19:02:11 -08005657/**
5658 * enum sta_connect_fail_reason_codes - STA connect failure reason code values
5659 * @STA_CONNECT_FAIL_REASON_UNSPECIFIED: No reason code specified for
5660 * connection failure.
5661 * @STA_CONNECT_FAIL_REASON_NO_BSS_FOUND: No Probe Response frame received
5662 * for unicast Probe Request frame.
5663 * @STA_CONNECT_FAIL_REASON_AUTH_TX_FAIL: STA failed to send auth request.
5664 * @STA_CONNECT_FAIL_REASON_AUTH_NO_ACK_RECEIVED: AP didn't send ACK for
5665 * auth request.
5666 * @STA_CONNECT_FAIL_REASON_AUTH_NO_RESP_RECEIVED: Auth response is not
5667 * received from AP.
5668 * @STA_CONNECT_FAIL_REASON_ASSOC_REQ_TX_FAIL: STA failed to send
5669 * Association Request frame.
5670 * @STA_CONNECT_FAIL_REASON_ASSOC_NO_ACK_RECEIVED: AP didn't send ACK for
5671 * Association Request frame.
5672 * @STA_CONNECT_FAIL_REASON_ASSOC_NO_RESP_RECEIVED: Association Response
5673 * frame is not received from AP.
5674 */
5675enum sta_connect_fail_reason_codes {
5676 STA_CONNECT_FAIL_REASON_UNSPECIFIED = 0,
5677 STA_CONNECT_FAIL_REASON_NO_BSS_FOUND = 1,
5678 STA_CONNECT_FAIL_REASON_AUTH_TX_FAIL = 2,
5679 STA_CONNECT_FAIL_REASON_AUTH_NO_ACK_RECEIVED = 3,
5680 STA_CONNECT_FAIL_REASON_AUTH_NO_RESP_RECEIVED = 4,
5681 STA_CONNECT_FAIL_REASON_ASSOC_REQ_TX_FAIL = 5,
5682 STA_CONNECT_FAIL_REASON_ASSOC_NO_ACK_RECEIVED = 6,
5683 STA_CONNECT_FAIL_REASON_ASSOC_NO_RESP_RECEIVED = 7,
5684};
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07005685
5686/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005687 * union wpa_event_data - Additional data for wpa_supplicant_event() calls
5688 */
5689union wpa_event_data {
5690 /**
5691 * struct assoc_info - Data for EVENT_ASSOC and EVENT_ASSOCINFO events
5692 *
5693 * This structure is optional for EVENT_ASSOC calls and required for
5694 * EVENT_ASSOCINFO calls. By using EVENT_ASSOC with this data, the
5695 * driver interface does not need to generate separate EVENT_ASSOCINFO
5696 * calls.
5697 */
5698 struct assoc_info {
5699 /**
5700 * reassoc - Flag to indicate association or reassociation
5701 */
5702 int reassoc;
5703
5704 /**
5705 * req_ies - (Re)Association Request IEs
5706 *
5707 * If the driver generates WPA/RSN IE, this event data must be
5708 * returned for WPA handshake to have needed information. If
5709 * wpa_supplicant-generated WPA/RSN IE is used, this
5710 * information event is optional.
5711 *
5712 * This should start with the first IE (fixed fields before IEs
5713 * are not included).
5714 */
5715 const u8 *req_ies;
5716
5717 /**
5718 * req_ies_len - Length of req_ies in bytes
5719 */
5720 size_t req_ies_len;
5721
5722 /**
5723 * resp_ies - (Re)Association Response IEs
5724 *
5725 * Optional association data from the driver. This data is not
5726 * required WPA, but may be useful for some protocols and as
5727 * such, should be reported if this is available to the driver
5728 * interface.
5729 *
5730 * This should start with the first IE (fixed fields before IEs
5731 * are not included).
5732 */
5733 const u8 *resp_ies;
5734
5735 /**
5736 * resp_ies_len - Length of resp_ies in bytes
5737 */
5738 size_t resp_ies_len;
5739
5740 /**
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08005741 * resp_frame - (Re)Association Response frame
5742 */
5743 const u8 *resp_frame;
5744
5745 /**
5746 * resp_frame_len - (Re)Association Response frame length
5747 */
5748 size_t resp_frame_len;
5749
5750 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005751 * beacon_ies - Beacon or Probe Response IEs
5752 *
5753 * Optional Beacon/ProbeResp data: IEs included in Beacon or
5754 * Probe Response frames from the current AP (i.e., the one
5755 * that the client just associated with). This information is
5756 * used to update WPA/RSN IE for the AP. If this field is not
5757 * set, the results from previous scan will be used. If no
5758 * data for the new AP is found, scan results will be requested
5759 * again (without scan request). At this point, the driver is
5760 * expected to provide WPA/RSN IE for the AP (if WPA/WPA2 is
5761 * used).
5762 *
5763 * This should start with the first IE (fixed fields before IEs
5764 * are not included).
5765 */
5766 const u8 *beacon_ies;
5767
5768 /**
5769 * beacon_ies_len - Length of beacon_ies */
5770 size_t beacon_ies_len;
5771
5772 /**
5773 * freq - Frequency of the operational channel in MHz
5774 */
5775 unsigned int freq;
5776
5777 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08005778 * wmm_params - WMM parameters used in this association.
5779 */
5780 struct wmm_params wmm_params;
5781
5782 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005783 * addr - Station address (for AP mode)
5784 */
5785 const u8 *addr;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08005786
5787 /**
5788 * The following is the key management offload information
5789 * @authorized
5790 * @key_replay_ctr
5791 * @key_replay_ctr_len
5792 * @ptk_kck
5793 * @ptk_kek_len
5794 * @ptk_kek
5795 * @ptk_kek_len
5796 */
5797
5798 /**
5799 * authorized - Status of key management offload,
5800 * 1 = successful
5801 */
5802 int authorized;
5803
5804 /**
5805 * key_replay_ctr - Key replay counter value last used
5806 * in a valid EAPOL-Key frame
5807 */
5808 const u8 *key_replay_ctr;
5809
5810 /**
5811 * key_replay_ctr_len - The length of key_replay_ctr
5812 */
5813 size_t key_replay_ctr_len;
5814
5815 /**
5816 * ptk_kck - The derived PTK KCK
5817 */
5818 const u8 *ptk_kck;
5819
5820 /**
5821 * ptk_kek_len - The length of ptk_kck
5822 */
5823 size_t ptk_kck_len;
5824
5825 /**
5826 * ptk_kek - The derived PTK KEK
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005827 * This is used in key management offload and also in FILS SK
5828 * offload.
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08005829 */
5830 const u8 *ptk_kek;
5831
5832 /**
5833 * ptk_kek_len - The length of ptk_kek
5834 */
5835 size_t ptk_kek_len;
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08005836
5837 /**
5838 * subnet_status - The subnet status:
5839 * 0 = unknown, 1 = unchanged, 2 = changed
5840 */
5841 u8 subnet_status;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005842
5843 /**
5844 * The following information is used in FILS SK offload
5845 * @fils_erp_next_seq_num
5846 * @fils_pmk
5847 * @fils_pmk_len
5848 * @fils_pmkid
5849 */
5850
5851 /**
5852 * fils_erp_next_seq_num - The next sequence number to use in
5853 * FILS ERP messages
5854 */
5855 u16 fils_erp_next_seq_num;
5856
5857 /**
5858 * fils_pmk - A new PMK if generated in case of FILS
5859 * authentication
5860 */
5861 const u8 *fils_pmk;
5862
5863 /**
5864 * fils_pmk_len - Length of fils_pmk
5865 */
5866 size_t fils_pmk_len;
5867
5868 /**
5869 * fils_pmkid - PMKID used or generated in FILS authentication
5870 */
5871 const u8 *fils_pmkid;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005872 } assoc_info;
5873
5874 /**
5875 * struct disassoc_info - Data for EVENT_DISASSOC events
5876 */
5877 struct disassoc_info {
5878 /**
5879 * addr - Station address (for AP mode)
5880 */
5881 const u8 *addr;
5882
5883 /**
5884 * reason_code - Reason Code (host byte order) used in
5885 * Deauthentication frame
5886 */
5887 u16 reason_code;
5888
5889 /**
5890 * ie - Optional IE(s) in Disassociation frame
5891 */
5892 const u8 *ie;
5893
5894 /**
5895 * ie_len - Length of ie buffer in octets
5896 */
5897 size_t ie_len;
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08005898
5899 /**
5900 * locally_generated - Whether the frame was locally generated
5901 */
5902 int locally_generated;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005903 } disassoc_info;
5904
5905 /**
5906 * struct deauth_info - Data for EVENT_DEAUTH events
5907 */
5908 struct deauth_info {
5909 /**
5910 * addr - Station address (for AP mode)
5911 */
5912 const u8 *addr;
5913
5914 /**
5915 * reason_code - Reason Code (host byte order) used in
5916 * Deauthentication frame
5917 */
5918 u16 reason_code;
5919
5920 /**
5921 * ie - Optional IE(s) in Deauthentication frame
5922 */
5923 const u8 *ie;
5924
5925 /**
5926 * ie_len - Length of ie buffer in octets
5927 */
5928 size_t ie_len;
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08005929
5930 /**
5931 * locally_generated - Whether the frame was locally generated
5932 */
5933 int locally_generated;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005934 } deauth_info;
5935
5936 /**
5937 * struct michael_mic_failure - Data for EVENT_MICHAEL_MIC_FAILURE
5938 */
5939 struct michael_mic_failure {
5940 int unicast;
5941 const u8 *src;
5942 } michael_mic_failure;
5943
5944 /**
5945 * struct interface_status - Data for EVENT_INTERFACE_STATUS
5946 */
5947 struct interface_status {
Dmitry Shmidte4663042016-04-04 10:07:49 -07005948 unsigned int ifindex;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005949 char ifname[100];
5950 enum {
5951 EVENT_INTERFACE_ADDED, EVENT_INTERFACE_REMOVED
5952 } ievent;
5953 } interface_status;
5954
5955 /**
5956 * struct pmkid_candidate - Data for EVENT_PMKID_CANDIDATE
5957 */
5958 struct pmkid_candidate {
5959 /** BSSID of the PMKID candidate */
5960 u8 bssid[ETH_ALEN];
5961 /** Smaller the index, higher the priority */
5962 int index;
5963 /** Whether RSN IE includes pre-authenticate flag */
5964 int preauth;
5965 } pmkid_candidate;
5966
5967 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005968 * struct tdls - Data for EVENT_TDLS
5969 */
5970 struct tdls {
5971 u8 peer[ETH_ALEN];
5972 enum {
5973 TDLS_REQUEST_SETUP,
Dmitry Shmidt4dd28dc2015-03-10 11:21:43 -07005974 TDLS_REQUEST_TEARDOWN,
5975 TDLS_REQUEST_DISCOVER,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005976 } oper;
5977 u16 reason_code; /* for teardown */
5978 } tdls;
5979
5980 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07005981 * struct wnm - Data for EVENT_WNM
5982 */
5983 struct wnm {
5984 u8 addr[ETH_ALEN];
5985 enum {
5986 WNM_OPER_SLEEP,
5987 } oper;
5988 enum {
5989 WNM_SLEEP_ENTER,
5990 WNM_SLEEP_EXIT
5991 } sleep_action;
5992 int sleep_intval;
5993 u16 reason_code;
5994 u8 *buf;
5995 u16 buf_len;
5996 } wnm;
5997
5998 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005999 * struct ft_ies - FT information elements (EVENT_FT_RESPONSE)
6000 *
6001 * During FT (IEEE 802.11r) authentication sequence, the driver is
6002 * expected to use this event to report received FT IEs (MDIE, FTIE,
6003 * RSN IE, TIE, possible resource request) to the supplicant. The FT
6004 * IEs for the next message will be delivered through the
6005 * struct wpa_driver_ops::update_ft_ies() callback.
6006 */
6007 struct ft_ies {
6008 const u8 *ies;
6009 size_t ies_len;
6010 int ft_action;
6011 u8 target_ap[ETH_ALEN];
6012 /** Optional IE(s), e.g., WMM TSPEC(s), for RIC-Request */
6013 const u8 *ric_ies;
6014 /** Length of ric_ies buffer in octets */
6015 size_t ric_ies_len;
6016 } ft_ies;
6017
6018 /**
6019 * struct ibss_rsn_start - Data for EVENT_IBSS_RSN_START
6020 */
6021 struct ibss_rsn_start {
6022 u8 peer[ETH_ALEN];
6023 } ibss_rsn_start;
6024
6025 /**
6026 * struct auth_info - Data for EVENT_AUTH events
6027 */
6028 struct auth_info {
6029 u8 peer[ETH_ALEN];
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006030 u8 bssid[ETH_ALEN];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006031 u16 auth_type;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006032 u16 auth_transaction;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006033 u16 status_code;
6034 const u8 *ies;
6035 size_t ies_len;
6036 } auth;
6037
6038 /**
6039 * struct assoc_reject - Data for EVENT_ASSOC_REJECT events
6040 */
6041 struct assoc_reject {
6042 /**
6043 * bssid - BSSID of the AP that rejected association
6044 */
6045 const u8 *bssid;
6046
6047 /**
6048 * resp_ies - (Re)Association Response IEs
6049 *
6050 * Optional association data from the driver. This data is not
6051 * required WPA, but may be useful for some protocols and as
6052 * such, should be reported if this is available to the driver
6053 * interface.
6054 *
6055 * This should start with the first IE (fixed fields before IEs
6056 * are not included).
6057 */
6058 const u8 *resp_ies;
6059
6060 /**
6061 * resp_ies_len - Length of resp_ies in bytes
6062 */
6063 size_t resp_ies_len;
6064
6065 /**
6066 * status_code - Status Code from (Re)association Response
6067 */
6068 u16 status_code;
Dmitry Shmidtd5ab1b52016-06-21 12:38:41 -07006069
6070 /**
6071 * timed_out - Whether failure is due to timeout (etc.) rather
6072 * than explicit rejection response from the AP.
6073 */
6074 int timed_out;
Dmitry Shmidtebd93af2017-02-21 13:40:44 -08006075
6076 /**
6077 * timeout_reason - Reason for the timeout
6078 */
6079 const char *timeout_reason;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07006080
6081 /**
6082 * fils_erp_next_seq_num - The next sequence number to use in
6083 * FILS ERP messages
6084 */
6085 u16 fils_erp_next_seq_num;
Hai Shalom60840252021-02-19 19:02:11 -08006086
6087 /**
6088 * reason_code - Connection failure reason code from the driver
6089 */
6090 enum sta_connect_fail_reason_codes reason_code;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006091 } assoc_reject;
6092
6093 struct timeout_event {
6094 u8 addr[ETH_ALEN];
6095 } timeout_event;
6096
6097 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006098 * struct tx_status - Data for EVENT_TX_STATUS events
6099 */
6100 struct tx_status {
6101 u16 type;
6102 u16 stype;
6103 const u8 *dst;
6104 const u8 *data;
6105 size_t data_len;
6106 int ack;
6107 } tx_status;
6108
6109 /**
6110 * struct rx_from_unknown - Data for EVENT_RX_FROM_UNKNOWN events
6111 */
6112 struct rx_from_unknown {
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006113 const u8 *bssid;
6114 const u8 *addr;
6115 int wds;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006116 } rx_from_unknown;
6117
6118 /**
6119 * struct rx_mgmt - Data for EVENT_RX_MGMT events
6120 */
6121 struct rx_mgmt {
6122 const u8 *frame;
6123 size_t frame_len;
6124 u32 datarate;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006125
6126 /**
Dmitry Shmidt98660862014-03-11 17:26:21 -07006127 * drv_priv - Pointer to store driver private BSS information
6128 *
6129 * If not set to NULL, this is used for comparison with
6130 * hostapd_data->drv_priv to determine which BSS should process
6131 * the frame.
6132 */
6133 void *drv_priv;
6134
6135 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006136 * freq - Frequency (in MHz) on which the frame was received
6137 */
6138 int freq;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08006139
6140 /**
6141 * ssi_signal - Signal strength in dBm (or 0 if not available)
6142 */
6143 int ssi_signal;
Sunil Ravi036cec52023-03-29 11:35:17 -07006144
6145 /**
6146 * link_id - MLO link on which the frame was received or -1 for
6147 * non MLD.
6148 */
6149 int link_id;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08006150 } rx_mgmt;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006151
6152 /**
6153 * struct remain_on_channel - Data for EVENT_REMAIN_ON_CHANNEL events
6154 *
6155 * This is also used with EVENT_CANCEL_REMAIN_ON_CHANNEL events.
6156 */
6157 struct remain_on_channel {
6158 /**
6159 * freq - Channel frequency in MHz
6160 */
6161 unsigned int freq;
6162
6163 /**
6164 * duration - Duration to remain on the channel in milliseconds
6165 */
6166 unsigned int duration;
6167 } remain_on_channel;
6168
6169 /**
6170 * struct scan_info - Optional data for EVENT_SCAN_RESULTS events
6171 * @aborted: Whether the scan was aborted
6172 * @freqs: Scanned frequencies in MHz (%NULL = all channels scanned)
6173 * @num_freqs: Number of entries in freqs array
6174 * @ssids: Scanned SSIDs (%NULL or zero-length SSID indicates wildcard
6175 * SSID)
6176 * @num_ssids: Number of entries in ssids array
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08006177 * @external_scan: Whether the scan info is for an external scan
6178 * @nl_scan_event: 1 if the source of this scan event is a normal scan,
6179 * 0 if the source of the scan event is a vendor scan
Dmitry Shmidt29333592017-01-09 12:27:11 -08006180 * @scan_start_tsf: Time when the scan started in terms of TSF of the
6181 * BSS that the interface that requested the scan is connected to
6182 * (if available).
6183 * @scan_start_tsf_bssid: The BSSID according to which %scan_start_tsf
6184 * is set.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006185 */
6186 struct scan_info {
6187 int aborted;
6188 const int *freqs;
6189 size_t num_freqs;
6190 struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS];
6191 size_t num_ssids;
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08006192 int external_scan;
6193 int nl_scan_event;
Dmitry Shmidt29333592017-01-09 12:27:11 -08006194 u64 scan_start_tsf;
6195 u8 scan_start_tsf_bssid[ETH_ALEN];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006196 } scan_info;
6197
6198 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006199 * struct rx_probe_req - Data for EVENT_RX_PROBE_REQ events
6200 */
6201 struct rx_probe_req {
6202 /**
6203 * sa - Source address of the received Probe Request frame
6204 */
6205 const u8 *sa;
6206
6207 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006208 * da - Destination address of the received Probe Request frame
6209 * or %NULL if not available
6210 */
6211 const u8 *da;
6212
6213 /**
6214 * bssid - BSSID of the received Probe Request frame or %NULL
6215 * if not available
6216 */
6217 const u8 *bssid;
6218
6219 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006220 * ie - IEs from the Probe Request body
6221 */
6222 const u8 *ie;
6223
6224 /**
6225 * ie_len - Length of ie buffer in octets
6226 */
6227 size_t ie_len;
Dmitry Shmidt04949592012-07-19 12:16:46 -07006228
6229 /**
6230 * signal - signal strength in dBm (or 0 if not available)
6231 */
6232 int ssi_signal;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006233 } rx_probe_req;
6234
6235 /**
6236 * struct new_sta - Data for EVENT_NEW_STA events
6237 */
6238 struct new_sta {
6239 const u8 *addr;
6240 } new_sta;
6241
6242 /**
6243 * struct eapol_rx - Data for EVENT_EAPOL_RX events
6244 */
6245 struct eapol_rx {
6246 const u8 *src;
6247 const u8 *data;
6248 size_t data_len;
Sunil8cd6f4d2022-06-28 18:40:46 +00006249 enum frame_encryption encrypted;
Sunil Ravi036cec52023-03-29 11:35:17 -07006250 int link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006251 } eapol_rx;
6252
6253 /**
6254 * signal_change - Data for EVENT_SIGNAL_CHANGE events
6255 */
6256 struct wpa_signal_info signal_change;
6257
6258 /**
6259 * struct best_channel - Data for EVENT_BEST_CHANNEL events
6260 * @freq_24: Best 2.4 GHz band channel frequency in MHz
6261 * @freq_5: Best 5 GHz band channel frequency in MHz
6262 * @freq_overall: Best channel frequency in MHz
6263 *
6264 * 0 can be used to indicate no preference in either band.
6265 */
6266 struct best_channel {
6267 int freq_24;
6268 int freq_5;
6269 int freq_overall;
6270 } best_chan;
6271
6272 struct unprot_deauth {
6273 const u8 *sa;
6274 const u8 *da;
6275 u16 reason_code;
6276 } unprot_deauth;
6277
6278 struct unprot_disassoc {
6279 const u8 *sa;
6280 const u8 *da;
6281 u16 reason_code;
6282 } unprot_disassoc;
6283
6284 /**
6285 * struct low_ack - Data for EVENT_STATION_LOW_ACK events
6286 * @addr: station address
Paul Stewart092955c2017-02-06 09:13:09 -08006287 * @num_packets: Number of packets lost (consecutive packets not
6288 * acknowledged)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006289 */
6290 struct low_ack {
6291 u8 addr[ETH_ALEN];
Paul Stewart092955c2017-02-06 09:13:09 -08006292 u32 num_packets;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006293 } low_ack;
6294
6295 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006296 * struct ibss_peer_lost - Data for EVENT_IBSS_PEER_LOST
6297 */
6298 struct ibss_peer_lost {
6299 u8 peer[ETH_ALEN];
6300 } ibss_peer_lost;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006301
6302 /**
6303 * struct driver_gtk_rekey - Data for EVENT_DRIVER_GTK_REKEY
6304 */
6305 struct driver_gtk_rekey {
6306 const u8 *bssid;
6307 const u8 *replay_ctr;
6308 } driver_gtk_rekey;
6309
6310 /**
6311 * struct client_poll - Data for EVENT_DRIVER_CLIENT_POLL_OK events
6312 * @addr: station address
6313 */
6314 struct client_poll {
6315 u8 addr[ETH_ALEN];
6316 } client_poll;
6317
6318 /**
6319 * struct eapol_tx_status
6320 * @dst: Original destination
6321 * @data: Data starting with IEEE 802.1X header (!)
6322 * @data_len: Length of data
6323 * @ack: Indicates ack or lost frame
6324 *
6325 * This corresponds to hapd_send_eapol if the frame sent
6326 * there isn't just reported as EVENT_TX_STATUS.
6327 */
6328 struct eapol_tx_status {
6329 const u8 *dst;
6330 const u8 *data;
6331 int data_len;
6332 int ack;
6333 } eapol_tx_status;
Dmitry Shmidt04949592012-07-19 12:16:46 -07006334
6335 /**
6336 * struct ch_switch
6337 * @freq: Frequency of new channel in MHz
6338 * @ht_enabled: Whether this is an HT channel
6339 * @ch_offset: Secondary channel offset
Dmitry Shmidt04f534e2013-12-09 15:50:16 -08006340 * @ch_width: Channel width
6341 * @cf1: Center frequency 1
6342 * @cf2: Center frequency 2
Sunil Ravi89eba102022-09-13 21:04:37 -07006343 * @link_id: Link ID of the MLO link
Sunil Ravi036cec52023-03-29 11:35:17 -07006344 * @punct_bitmap: Puncturing bitmap
Dmitry Shmidt04949592012-07-19 12:16:46 -07006345 */
6346 struct ch_switch {
6347 int freq;
6348 int ht_enabled;
6349 int ch_offset;
Dmitry Shmidt04f534e2013-12-09 15:50:16 -08006350 enum chan_width ch_width;
6351 int cf1;
6352 int cf2;
Sunil Ravi89eba102022-09-13 21:04:37 -07006353 int link_id;
Sunil Ravi036cec52023-03-29 11:35:17 -07006354 u16 punct_bitmap;
Dmitry Shmidt04949592012-07-19 12:16:46 -07006355 } ch_switch;
Dmitry Shmidtf8623282013-02-20 14:34:59 -08006356
6357 /**
6358 * struct connect_failed - Data for EVENT_CONNECT_FAILED_REASON
6359 * @addr: Remote client address
6360 * @code: Reason code for connection failure
6361 */
6362 struct connect_failed_reason {
6363 u8 addr[ETH_ALEN];
6364 enum {
6365 MAX_CLIENT_REACHED,
6366 BLOCKED_CLIENT
6367 } code;
6368 } connect_failed_reason;
Dmitry Shmidtea69e842013-05-13 14:52:28 -07006369
6370 /**
6371 * struct dfs_event - Data for radar detected events
6372 * @freq: Frequency of the channel in MHz
6373 */
6374 struct dfs_event {
6375 int freq;
Dmitry Shmidt051af732013-10-22 13:52:46 -07006376 int ht_enabled;
6377 int chan_offset;
6378 enum chan_width chan_width;
6379 int cf1;
6380 int cf2;
Dmitry Shmidtea69e842013-05-13 14:52:28 -07006381 } dfs_event;
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07006382
6383 /**
6384 * survey_results - Survey result data for EVENT_SURVEY
6385 * @freq_filter: Requested frequency survey filter, 0 if request
6386 * was for all survey data
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006387 * @survey_list: Linked list of survey data (struct freq_survey)
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07006388 */
6389 struct survey_results {
6390 unsigned int freq_filter;
6391 struct dl_list survey_list; /* struct freq_survey */
6392 } survey_results;
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08006393
6394 /**
6395 * channel_list_changed - Data for EVENT_CHANNEL_LIST_CHANGED
6396 * @initiator: Initiator of the regulatory change
Dmitry Shmidt7dba0e52014-04-14 10:49:15 -07006397 * @type: Regulatory change type
6398 * @alpha2: Country code (or "" if not available)
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08006399 */
6400 struct channel_list_changed {
6401 enum reg_change_initiator initiator;
Dmitry Shmidt7dba0e52014-04-14 10:49:15 -07006402 enum reg_type type;
6403 char alpha2[3];
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08006404 } channel_list_changed;
Dmitry Shmidtcf32e602014-01-28 10:57:39 -08006405
6406 /**
6407 * freq_range - List of frequency ranges
6408 *
6409 * This is used as the data with EVENT_AVOID_FREQUENCIES.
6410 */
6411 struct wpa_freq_range_list freq_range;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006412
6413 /**
6414 * struct mesh_peer
6415 *
6416 * @peer: Peer address
6417 * @ies: Beacon IEs
6418 * @ie_len: Length of @ies
6419 *
6420 * Notification of new candidate mesh peer.
6421 */
6422 struct mesh_peer {
6423 const u8 *peer;
6424 const u8 *ies;
6425 size_t ie_len;
6426 } mesh_peer;
6427
6428 /**
6429 * struct acs_selected_channels - Data for EVENT_ACS_CHANNEL_SELECTED
Ahmed ElArabawy0ff61c52019-12-26 12:38:39 -08006430 * @pri_freq: Selected primary frequency
6431 * @sec_freq: Selected secondary frequency
Hai Shalomfdcde762020-04-02 11:19:20 -07006432 * @edmg_channel: Selected EDMG channel
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006433 * @vht_seg0_center_ch: VHT mode Segment0 center channel
Hai Shalomfdcde762020-04-02 11:19:20 -07006434 * The value is the index of the channel center frequency for
6435 * 20 MHz, 40 MHz, and 80 MHz channels. The value is the center
6436 * frequency index of the primary 80 MHz segment for 160 MHz and
6437 * 80+80 MHz channels.
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006438 * @vht_seg1_center_ch: VHT mode Segment1 center channel
Hai Shalomfdcde762020-04-02 11:19:20 -07006439 * The value is zero for 20 MHz, 40 MHz, and 80 MHz channels. The
6440 * value is the index of the channel center frequency for 160 MHz
6441 * channels and the center frequency index of the secondary 80 MHz
6442 * segment for 80+80 MHz channels.
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006443 * @ch_width: Selected Channel width by driver. Driver may choose to
6444 * change hostapd configured ACS channel width due driver internal
6445 * channel restrictions.
Dmitry Shmidtb1e52102015-05-29 12:36:29 -07006446 * hw_mode: Selected band (used with hw_mode=any)
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006447 */
6448 struct acs_selected_channels {
Ahmed ElArabawy0ff61c52019-12-26 12:38:39 -08006449 unsigned int pri_freq;
6450 unsigned int sec_freq;
Hai Shalomfdcde762020-04-02 11:19:20 -07006451 u8 edmg_channel;
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006452 u8 vht_seg0_center_ch;
6453 u8 vht_seg1_center_ch;
6454 u16 ch_width;
Dmitry Shmidtb1e52102015-05-29 12:36:29 -07006455 enum hostapd_hw_mode hw_mode;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006456 } acs_selected_channels;
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07006457
6458 /**
6459 * struct p2p_lo_stop - Reason code for P2P Listen offload stop event
6460 * @reason_code: Reason for stopping offload
6461 * P2P_LO_STOPPED_REASON_COMPLETE: Listen offload finished as
6462 * scheduled.
6463 * P2P_LO_STOPPED_REASON_RECV_STOP_CMD: Host requested offload to
6464 * be stopped.
6465 * P2P_LO_STOPPED_REASON_INVALID_PARAM: Invalid listen offload
6466 * parameters.
6467 * P2P_LO_STOPPED_REASON_NOT_SUPPORTED: Listen offload not
6468 * supported by device.
6469 */
6470 struct p2p_lo_stop {
6471 enum {
6472 P2P_LO_STOPPED_REASON_COMPLETE = 0,
6473 P2P_LO_STOPPED_REASON_RECV_STOP_CMD,
6474 P2P_LO_STOPPED_REASON_INVALID_PARAM,
6475 P2P_LO_STOPPED_REASON_NOT_SUPPORTED,
6476 } reason_code;
6477 } p2p_lo_stop;
Roshan Pius3a1667e2018-07-03 15:17:14 -07006478
6479 /* For EVENT_EXTERNAL_AUTH */
6480 struct external_auth external_auth;
6481
6482 /**
6483 * struct sta_opmode - Station's operation mode change event
6484 * @addr: The station MAC address
6485 * @smps_mode: SMPS mode of the station
6486 * @chan_width: Channel width of the station
6487 * @rx_nss: RX_NSS of the station
6488 *
6489 * This is used as data with EVENT_STATION_OPMODE_CHANGED.
6490 */
6491 struct sta_opmode {
6492 const u8 *addr;
6493 enum smps_mode smps_mode;
6494 enum chan_width chan_width;
6495 u8 rx_nss;
6496 } sta_opmode;
6497
6498 /**
6499 * struct wds_sta_interface - Data for EVENT_WDS_STA_INTERFACE_STATUS.
6500 */
6501 struct wds_sta_interface {
6502 const u8 *sta_addr;
6503 const char *ifname;
6504 enum {
6505 INTERFACE_ADDED,
6506 INTERFACE_REMOVED
6507 } istatus;
6508 } wds_sta_interface;
Hai Shalom81f62d82019-07-22 12:10:00 -07006509
6510 /**
6511 * struct update_dh - Data for EVENT_UPDATE_DH
6512 */
6513 struct update_dh {
6514 const u8 *peer;
6515 const u8 *ie;
6516 size_t ie_len;
6517 } update_dh;
Hai Shalomfdcde762020-04-02 11:19:20 -07006518
6519 /**
6520 * struct unprot_beacon - Data for EVENT_UNPROT_BEACON
6521 */
6522 struct unprot_beacon {
6523 const u8 *sa;
6524 } unprot_beacon;
Sunil Ravia04bd252022-05-02 22:54:18 -07006525
6526 /**
6527 * struct bss_color_collision - Data for EVENT_BSS_COLOR_COLLISION
6528 */
6529 struct bss_color_collision {
6530 u64 bitmap;
6531 } bss_color_collision;
Sunil Ravi89eba102022-09-13 21:04:37 -07006532
6533 /**
6534 * struct pasn_auth - Data for EVENT_PASN_AUTH
6535 */
6536 struct pasn_auth pasn_auth;
6537
Sunil Ravi77d572f2023-01-17 23:58:31 +00006538 /**
6539 * struct port_authorized - Data for EVENT_PORT_AUTHORIZED
6540 */
6541 struct port_authorized {
6542 const u8 *td_bitmap;
6543 size_t td_bitmap_len;
6544 } port_authorized;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006545};
6546
6547/**
6548 * wpa_supplicant_event - Report a driver event for wpa_supplicant
6549 * @ctx: Context pointer (wpa_s); this is the ctx variable registered
6550 * with struct wpa_driver_ops::init()
6551 * @event: event type (defined above)
6552 * @data: possible extra data for the event
6553 *
6554 * Driver wrapper code should call this function whenever an event is received
6555 * from the driver.
6556 */
6557void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
6558 union wpa_event_data *data);
6559
Dmitry Shmidte4663042016-04-04 10:07:49 -07006560/**
6561 * wpa_supplicant_event_global - Report a driver event for wpa_supplicant
6562 * @ctx: Context pointer (wpa_s); this is the ctx variable registered
6563 * with struct wpa_driver_ops::init()
6564 * @event: event type (defined above)
6565 * @data: possible extra data for the event
6566 *
6567 * Same as wpa_supplicant_event(), but we search for the interface in
6568 * wpa_global.
6569 */
6570void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
6571 union wpa_event_data *data);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006572
6573/*
6574 * The following inline functions are provided for convenience to simplify
6575 * event indication for some of the common events.
6576 */
6577
6578static inline void drv_event_assoc(void *ctx, const u8 *addr, const u8 *ie,
6579 size_t ielen, int reassoc)
6580{
6581 union wpa_event_data event;
6582 os_memset(&event, 0, sizeof(event));
6583 event.assoc_info.reassoc = reassoc;
6584 event.assoc_info.req_ies = ie;
6585 event.assoc_info.req_ies_len = ielen;
6586 event.assoc_info.addr = addr;
6587 wpa_supplicant_event(ctx, EVENT_ASSOC, &event);
6588}
6589
6590static inline void drv_event_disassoc(void *ctx, const u8 *addr)
6591{
6592 union wpa_event_data event;
6593 os_memset(&event, 0, sizeof(event));
6594 event.disassoc_info.addr = addr;
6595 wpa_supplicant_event(ctx, EVENT_DISASSOC, &event);
6596}
6597
6598static inline void drv_event_eapol_rx(void *ctx, const u8 *src, const u8 *data,
6599 size_t data_len)
6600{
6601 union wpa_event_data event;
6602 os_memset(&event, 0, sizeof(event));
6603 event.eapol_rx.src = src;
6604 event.eapol_rx.data = data;
6605 event.eapol_rx.data_len = data_len;
Sunil8cd6f4d2022-06-28 18:40:46 +00006606 event.eapol_rx.encrypted = FRAME_ENCRYPTION_UNKNOWN;
Sunil Ravi036cec52023-03-29 11:35:17 -07006607 event.eapol_rx.link_id = -1;
Sunil8cd6f4d2022-06-28 18:40:46 +00006608 wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event);
6609}
6610
6611static inline void drv_event_eapol_rx2(void *ctx, const u8 *src, const u8 *data,
Sunil Ravi036cec52023-03-29 11:35:17 -07006612 size_t data_len,
6613 enum frame_encryption encrypted,
6614 int link_id)
Sunil8cd6f4d2022-06-28 18:40:46 +00006615{
6616 union wpa_event_data event;
6617 os_memset(&event, 0, sizeof(event));
6618 event.eapol_rx.src = src;
6619 event.eapol_rx.data = data;
6620 event.eapol_rx.data_len = data_len;
6621 event.eapol_rx.encrypted = encrypted;
Sunil Ravi036cec52023-03-29 11:35:17 -07006622 event.eapol_rx.link_id = link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006623 wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event);
6624}
6625
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006626/* driver_common.c */
6627void wpa_scan_results_free(struct wpa_scan_results *res);
6628
6629/* Convert wpa_event_type to a string for logging */
6630const char * event_to_string(enum wpa_event_type event);
6631
Dmitry Shmidt661b4f72014-09-29 14:58:27 -07006632/* Convert chan_width to a string for logging and control interfaces */
6633const char * channel_width_to_string(enum chan_width width);
6634
Hai Shalom74f70d42019-02-11 14:42:39 -08006635int channel_width_to_int(enum chan_width width);
6636
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006637int ht_supported(const struct hostapd_hw_modes *mode);
6638int vht_supported(const struct hostapd_hw_modes *mode);
Sunil Ravi77d572f2023-01-17 23:58:31 +00006639bool he_supported(const struct hostapd_hw_modes *hw_mode,
6640 enum ieee80211_op_mode op_mode);
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006641
6642struct wowlan_triggers *
6643wpa_get_wowlan_triggers(const char *wowlan_triggers,
6644 const struct wpa_driver_capa *capa);
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07006645/* Convert driver flag to string */
6646const char * driver_flag_to_string(u64 flag);
Hai Shalomb755a2a2020-04-23 21:49:02 -07006647const char * driver_flag2_to_string(u64 flag2);
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006648
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08006649/* NULL terminated array of linked in driver wrappers */
Dmitry Shmidt1d755d02015-04-28 10:34:29 -07006650extern const struct wpa_driver_ops *const wpa_drivers[];
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08006651
Dmitry Shmidt4ae50e62016-06-27 13:48:39 -07006652
6653/* Available drivers */
6654
6655#ifdef CONFIG_DRIVER_WEXT
6656extern const struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */
6657#endif /* CONFIG_DRIVER_WEXT */
6658#ifdef CONFIG_DRIVER_NL80211
6659/* driver_nl80211.c */
6660extern const struct wpa_driver_ops wpa_driver_nl80211_ops;
6661#endif /* CONFIG_DRIVER_NL80211 */
6662#ifdef CONFIG_DRIVER_HOSTAP
6663extern const struct wpa_driver_ops wpa_driver_hostap_ops; /* driver_hostap.c */
6664#endif /* CONFIG_DRIVER_HOSTAP */
6665#ifdef CONFIG_DRIVER_BSD
6666extern const struct wpa_driver_ops wpa_driver_bsd_ops; /* driver_bsd.c */
6667#endif /* CONFIG_DRIVER_BSD */
6668#ifdef CONFIG_DRIVER_OPENBSD
6669/* driver_openbsd.c */
6670extern const struct wpa_driver_ops wpa_driver_openbsd_ops;
6671#endif /* CONFIG_DRIVER_OPENBSD */
6672#ifdef CONFIG_DRIVER_NDIS
6673extern struct wpa_driver_ops wpa_driver_ndis_ops; /* driver_ndis.c */
6674#endif /* CONFIG_DRIVER_NDIS */
6675#ifdef CONFIG_DRIVER_WIRED
6676extern const struct wpa_driver_ops wpa_driver_wired_ops; /* driver_wired.c */
6677#endif /* CONFIG_DRIVER_WIRED */
6678#ifdef CONFIG_DRIVER_MACSEC_QCA
6679/* driver_macsec_qca.c */
6680extern const struct wpa_driver_ops wpa_driver_macsec_qca_ops;
6681#endif /* CONFIG_DRIVER_MACSEC_QCA */
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08006682#ifdef CONFIG_DRIVER_MACSEC_LINUX
6683/* driver_macsec_linux.c */
6684extern const struct wpa_driver_ops wpa_driver_macsec_linux_ops;
6685#endif /* CONFIG_DRIVER_MACSEC_LINUX */
Dmitry Shmidt4ae50e62016-06-27 13:48:39 -07006686#ifdef CONFIG_DRIVER_ROBOSWITCH
6687/* driver_roboswitch.c */
6688extern const struct wpa_driver_ops wpa_driver_roboswitch_ops;
6689#endif /* CONFIG_DRIVER_ROBOSWITCH */
6690#ifdef CONFIG_DRIVER_ATHEROS
6691/* driver_atheros.c */
6692extern const struct wpa_driver_ops wpa_driver_atheros_ops;
6693#endif /* CONFIG_DRIVER_ATHEROS */
6694#ifdef CONFIG_DRIVER_NONE
6695extern const struct wpa_driver_ops wpa_driver_none_ops; /* driver_none.c */
6696#endif /* CONFIG_DRIVER_NONE */
6697
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006698#endif /* DRIVER_H */