blob: 4ddfe076f1673eb62087cd0192bfd07cb14ef96f [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
Dmitry Shmidt68d0e3e2013-10-28 17:59:21 -070044#define HOSTAPD_CHAN_VHT_10_70 0x00000800
45#define HOSTAPD_CHAN_VHT_30_50 0x00001000
46#define HOSTAPD_CHAN_VHT_50_30 0x00002000
47#define HOSTAPD_CHAN_VHT_70_10 0x00004000
48
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -080049#define HOSTAPD_CHAN_INDOOR_ONLY 0x00010000
50#define HOSTAPD_CHAN_GO_CONCURRENT 0x00020000
51
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -080052#define HOSTAPD_CHAN_VHT_10_150 0x00100000
53#define HOSTAPD_CHAN_VHT_30_130 0x00200000
54#define HOSTAPD_CHAN_VHT_50_110 0x00400000
55#define HOSTAPD_CHAN_VHT_70_90 0x00800000
56#define HOSTAPD_CHAN_VHT_90_70 0x01000000
57#define HOSTAPD_CHAN_VHT_110_50 0x02000000
58#define HOSTAPD_CHAN_VHT_130_30 0x04000000
59#define HOSTAPD_CHAN_VHT_150_10 0x08000000
60
Hai Shalom74f70d42019-02-11 14:42:39 -080061/* Allowed bandwidth mask */
62enum hostapd_chan_width_attr {
63 HOSTAPD_CHAN_WIDTH_10 = BIT(0),
64 HOSTAPD_CHAN_WIDTH_20 = BIT(1),
65 HOSTAPD_CHAN_WIDTH_40P = BIT(2),
66 HOSTAPD_CHAN_WIDTH_40M = BIT(3),
67 HOSTAPD_CHAN_WIDTH_80 = BIT(4),
68 HOSTAPD_CHAN_WIDTH_160 = BIT(5),
Sunil8cd6f4d2022-06-28 18:40:46 +000069 HOSTAPD_CHAN_WIDTH_320 = BIT(6),
Hai Shalom74f70d42019-02-11 14:42:39 -080070};
71
Dmitry Shmidt849734c2016-05-27 09:59:01 -070072/* Filter gratuitous ARP */
73#define WPA_DATA_FRAME_FILTER_FLAG_ARP BIT(0)
74/* Filter unsolicited Neighbor Advertisement */
75#define WPA_DATA_FRAME_FILTER_FLAG_NA BIT(1)
76/* Filter unicast IP packets encrypted using the GTK */
77#define WPA_DATA_FRAME_FILTER_FLAG_GTK BIT(2)
78
Dmitry Shmidtd2986c22017-10-23 14:22:09 -070079#define HOSTAPD_DFS_REGION_FCC 1
80#define HOSTAPD_DFS_REGION_ETSI 2
81#define HOSTAPD_DFS_REGION_JP 3
82
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -080083/**
84 * enum reg_change_initiator - Regulatory change initiator
85 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -080086enum reg_change_initiator {
87 REGDOM_SET_BY_CORE,
88 REGDOM_SET_BY_USER,
89 REGDOM_SET_BY_DRIVER,
90 REGDOM_SET_BY_COUNTRY_IE,
Dmitry Shmidt97672262014-02-03 13:02:54 -080091 REGDOM_BEACON_HINT,
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -080092};
93
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -080094/**
95 * enum reg_type - Regulatory change types
96 */
Dmitry Shmidt7dba0e52014-04-14 10:49:15 -070097enum reg_type {
98 REGDOM_TYPE_UNKNOWN,
99 REGDOM_TYPE_COUNTRY,
100 REGDOM_TYPE_WORLD,
101 REGDOM_TYPE_CUSTOM_WORLD,
102 REGDOM_TYPE_INTERSECTION,
103};
104
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700105/**
Hai Shalom81f62d82019-07-22 12:10:00 -0700106 * struct hostapd_wmm_rule - WMM regulatory rule
107 * @min_cwmin: Lower bound of CW_min value
108 * @min_cwmax: Lower bound of CW_max value
109 * @min_aifs: Lower bound of AIFS value
110 * @max_txop: Upper bound of TXOP, value in units of 32 usec
111 */
112struct hostapd_wmm_rule {
113 int min_cwmin;
114 int min_cwmax;
115 int min_aifs;
116 int max_txop;
117};
118
119/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700120 * struct hostapd_channel_data - Channel information
121 */
122struct hostapd_channel_data {
123 /**
124 * chan - Channel number (IEEE 802.11)
125 */
126 short chan;
127
128 /**
129 * freq - Frequency in MHz
130 */
Dmitry Shmidtd5e49232012-12-03 15:08:10 -0800131 int freq;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700132
133 /**
134 * flag - Channel flags (HOSTAPD_CHAN_*)
135 */
136 int flag;
137
138 /**
Hai Shalom74f70d42019-02-11 14:42:39 -0800139 * allowed_bw - Allowed channel width bitmask
140 *
141 * See enum hostapd_chan_width_attr.
142 */
143 u32 allowed_bw;
144
145 /**
Dmitry Shmidt68d0e3e2013-10-28 17:59:21 -0700146 * max_tx_power - Regulatory transmit power limit in dBm
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700147 */
148 u8 max_tx_power;
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -0700149
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800150 /**
151 * survey_list - Linked list of surveys (struct freq_survey)
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -0700152 */
153 struct dl_list survey_list;
154
155 /**
156 * min_nf - Minimum observed noise floor, in dBm, based on all
157 * surveyed channel data
158 */
159 s8 min_nf;
Dmitry Shmidt391c59f2013-09-03 12:16:28 -0700160
161#ifdef CONFIG_ACS
162 /**
163 * interference_factor - Computed interference factor on this
164 * channel (used internally in src/ap/acs.c; driver wrappers do not
165 * need to set this)
166 */
167 long double interference_factor;
168#endif /* CONFIG_ACS */
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -0700169
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800170 /**
171 * dfs_cac_ms - DFS CAC time in milliseconds
172 */
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -0700173 unsigned int dfs_cac_ms;
Hai Shalom81f62d82019-07-22 12:10:00 -0700174
175 /**
176 * wmm_rules_valid - Indicates wmm_rules state
177 */
178 int wmm_rules_valid;
179
180 /**
181 * wmm_rules - WMM regulatory rules
182 */
183 struct hostapd_wmm_rule wmm_rules[WMM_AC_NUM];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700184};
185
Hai Shalomfdcde762020-04-02 11:19:20 -0700186#define HE_MAC_CAPAB_0 0
Hai Shalom81f62d82019-07-22 12:10:00 -0700187#define HE_MAX_MAC_CAPAB_SIZE 6
188#define HE_MAX_PHY_CAPAB_SIZE 11
189#define HE_MAX_MCS_CAPAB_SIZE 12
190#define HE_MAX_PPET_CAPAB_SIZE 25
Dmitry Shmidtebd93af2017-02-21 13:40:44 -0800191
192/**
193 * struct he_capabilities - IEEE 802.11ax HE capabilities
194 */
195struct he_capabilities {
196 u8 he_supported;
Hai Shalom81f62d82019-07-22 12:10:00 -0700197 u8 phy_cap[HE_MAX_PHY_CAPAB_SIZE];
198 u8 mac_cap[HE_MAX_MAC_CAPAB_SIZE];
199 u8 mcs[HE_MAX_MCS_CAPAB_SIZE];
200 u8 ppet[HE_MAX_PPET_CAPAB_SIZE];
Hai Shalom899fcc72020-10-19 14:38:18 -0700201 u16 he_6ghz_capa;
Dmitry Shmidtebd93af2017-02-21 13:40:44 -0800202};
203
Sunil Ravia04bd252022-05-02 22:54:18 -0700204/* struct eht_capabilities - IEEE 802.11be EHT capabilities */
205struct eht_capabilities {
206 bool eht_supported;
207 u16 mac_cap;
208 u8 phy_cap[EHT_PHY_CAPAB_LEN];
209 u8 mcs[EHT_MCS_NSS_CAPAB_LEN];
210 u8 ppet[EHT_PPE_THRESH_CAPAB_LEN];
211};
212
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800213#define HOSTAPD_MODE_FLAG_HT_INFO_KNOWN BIT(0)
Dmitry Shmidtc2ebb4b2013-07-24 12:57:51 -0700214#define HOSTAPD_MODE_FLAG_VHT_INFO_KNOWN BIT(1)
Sunil Ravi77d572f2023-01-17 23:58:31 +0000215#define HOSTAPD_MODE_FLAG_HE_INFO_KNOWN BIT(2)
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800216
Hai Shalom81f62d82019-07-22 12:10:00 -0700217
218enum ieee80211_op_mode {
219 IEEE80211_MODE_INFRA = 0,
220 IEEE80211_MODE_IBSS = 1,
221 IEEE80211_MODE_AP = 2,
222 IEEE80211_MODE_MESH = 5,
223
224 /* only add new entries before IEEE80211_MODE_NUM */
225 IEEE80211_MODE_NUM
226};
227
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700228/**
Hai Shalomc3565922019-10-28 11:58:20 -0700229 * struct ieee80211_edmg_config - EDMG configuration
230 *
231 * This structure describes most essential parameters needed
232 * for IEEE 802.11ay EDMG configuration
233 *
234 * @channels: Bitmap that indicates the 2.16 GHz channel(s)
235 * that are allowed to be used for transmissions.
236 * Bit 0 indicates channel 1, bit 1 indicates channel 2, etc.
237 * Set to 0 to indicate EDMG not supported.
238 * @bw_config: Channel BW Configuration subfield encodes
239 * the allowed channel bandwidth configurations
240 */
241struct ieee80211_edmg_config {
242 u8 channels;
243 enum edmg_bw_config bw_config;
244};
245
246/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700247 * struct hostapd_hw_modes - Supported hardware mode information
248 */
249struct hostapd_hw_modes {
250 /**
251 * mode - Hardware mode
252 */
253 enum hostapd_hw_mode mode;
254
255 /**
256 * num_channels - Number of entries in the channels array
257 */
258 int num_channels;
259
260 /**
261 * channels - Array of supported channels
262 */
263 struct hostapd_channel_data *channels;
264
265 /**
266 * num_rates - Number of entries in the rates array
267 */
268 int num_rates;
269
270 /**
271 * rates - Array of supported rates in 100 kbps units
272 */
273 int *rates;
274
275 /**
276 * ht_capab - HT (IEEE 802.11n) capabilities
277 */
278 u16 ht_capab;
279
280 /**
281 * mcs_set - MCS (IEEE 802.11n) rate parameters
282 */
283 u8 mcs_set[16];
284
285 /**
286 * a_mpdu_params - A-MPDU (IEEE 802.11n) parameters
287 */
288 u8 a_mpdu_params;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800289
Dmitry Shmidt04949592012-07-19 12:16:46 -0700290 /**
291 * vht_capab - VHT (IEEE 802.11ac) capabilities
292 */
293 u32 vht_capab;
294
295 /**
296 * vht_mcs_set - VHT MCS (IEEE 802.11ac) rate parameters
297 */
298 u8 vht_mcs_set[8];
299
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800300 unsigned int flags; /* HOSTAPD_MODE_FLAG_* */
Dmitry Shmidtebd93af2017-02-21 13:40:44 -0800301
302 /**
303 * he_capab - HE (IEEE 802.11ax) capabilities
304 */
Hai Shalom81f62d82019-07-22 12:10:00 -0700305 struct he_capabilities he_capab[IEEE80211_MODE_NUM];
Hai Shalomc3565922019-10-28 11:58:20 -0700306
307 /**
308 * This structure describes the most essential parameters needed
309 * for IEEE 802.11ay EDMG configuration.
310 */
311 struct ieee80211_edmg_config edmg;
Sunil Ravia04bd252022-05-02 22:54:18 -0700312
313 /**
314 * eht_capab - EHT (IEEE 802.11be) capabilities
315 */
316 struct eht_capabilities eht_capab[IEEE80211_MODE_NUM];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700317};
318
319
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700320#define IEEE80211_CAP_ESS 0x0001
321#define IEEE80211_CAP_IBSS 0x0002
322#define IEEE80211_CAP_PRIVACY 0x0010
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800323#define IEEE80211_CAP_RRM 0x1000
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700324
Dmitry Shmidtf8623282013-02-20 14:34:59 -0800325/* DMG (60 GHz) IEEE 802.11ad */
326/* type - bits 0..1 */
327#define IEEE80211_CAP_DMG_MASK 0x0003
328#define IEEE80211_CAP_DMG_IBSS 0x0001 /* Tx by: STA */
329#define IEEE80211_CAP_DMG_PBSS 0x0002 /* Tx by: PCP */
330#define IEEE80211_CAP_DMG_AP 0x0003 /* Tx by: AP */
331
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700332#define WPA_SCAN_QUAL_INVALID BIT(0)
333#define WPA_SCAN_NOISE_INVALID BIT(1)
334#define WPA_SCAN_LEVEL_INVALID BIT(2)
335#define WPA_SCAN_LEVEL_DBM BIT(3)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700336#define WPA_SCAN_ASSOCIATED BIT(5)
337
338/**
339 * struct wpa_scan_res - Scan result for an BSS/IBSS
340 * @flags: information flags about the BSS/IBSS (WPA_SCAN_*)
341 * @bssid: BSSID
342 * @freq: frequency of the channel in MHz (e.g., 2412 = channel 1)
343 * @beacon_int: beacon interval in TUs (host byte order)
344 * @caps: capability information field in host byte order
345 * @qual: signal quality
346 * @noise: noise level
347 * @level: signal level
348 * @tsf: Timestamp
349 * @age: Age of the information in milliseconds (i.e., how many milliseconds
350 * ago the last Beacon or Probe Response frame was received)
Dmitry Shmidt7f656022015-02-25 14:36:37 -0800351 * @est_throughput: Estimated throughput in kbps (this is calculated during
352 * scan result processing if left zero by the driver wrapper)
353 * @snr: Signal-to-noise ratio in dB (calculated during scan result processing)
Dmitry Shmidt29333592017-01-09 12:27:11 -0800354 * @parent_tsf: Time when the Beacon/Probe Response frame was received in terms
355 * of TSF of the BSS specified by %tsf_bssid.
356 * @tsf_bssid: The BSS that %parent_tsf TSF time refers to.
Sunil Ravia04bd252022-05-02 22:54:18 -0700357 * @beacon_newer: Whether the Beacon frame data is known to be newer
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700358 * @ie_len: length of the following IE field in octets
359 * @beacon_ie_len: length of the following Beacon IE field in octets
360 *
361 * This structure is used as a generic format for scan results from the
362 * driver. Each driver interface implementation is responsible for converting
363 * the driver or OS specific scan results into this format.
364 *
365 * If the driver does not support reporting all IEs, the IE data structure is
366 * constructed of the IEs that are available. This field will also need to
367 * include SSID in IE format. All drivers are encouraged to be extended to
368 * report all IEs to make it easier to support future additions.
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800369 *
370 * This structure data is followed by ie_len octets of IEs from Probe Response
371 * frame (or if the driver does not indicate source of IEs, these may also be
372 * from Beacon frame). After the first set of IEs, another set of IEs may follow
373 * (with beacon_ie_len octets of data) if the driver provides both IE sets.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700374 */
375struct wpa_scan_res {
376 unsigned int flags;
377 u8 bssid[ETH_ALEN];
378 int freq;
379 u16 beacon_int;
380 u16 caps;
381 int qual;
382 int noise;
383 int level;
384 u64 tsf;
385 unsigned int age;
Dmitry Shmidt7f656022015-02-25 14:36:37 -0800386 unsigned int est_throughput;
387 int snr;
Dmitry Shmidt29333592017-01-09 12:27:11 -0800388 u64 parent_tsf;
389 u8 tsf_bssid[ETH_ALEN];
Sunil Ravia04bd252022-05-02 22:54:18 -0700390 bool beacon_newer;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700391 size_t ie_len;
392 size_t beacon_ie_len;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800393 /* Followed by ie_len + beacon_ie_len octets of IE data */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700394};
395
396/**
397 * struct wpa_scan_results - Scan results
398 * @res: Array of pointers to allocated variable length scan result entries
399 * @num: Number of entries in the scan result array
Dmitry Shmidtf8623282013-02-20 14:34:59 -0800400 * @fetch_time: Time when the results were fetched from the driver
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700401 */
402struct wpa_scan_results {
403 struct wpa_scan_res **res;
404 size_t num;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -0800405 struct os_reltime fetch_time;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700406};
407
408/**
409 * struct wpa_interface_info - Network interface information
410 * @next: Pointer to the next interface or NULL if this is the last one
411 * @ifname: Interface name that can be used with init() or init2()
412 * @desc: Human readable adapter description (e.g., vendor/model) or NULL if
413 * not available
414 * @drv_name: struct wpa_driver_ops::name (note: unlike other strings, this one
415 * is not an allocated copy, i.e., get_interfaces() caller will not free
416 * this)
417 */
418struct wpa_interface_info {
419 struct wpa_interface_info *next;
420 char *ifname;
421 char *desc;
422 const char *drv_name;
423};
424
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800425#define WPAS_MAX_SCAN_SSIDS 16
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700426
427/**
Dmitry Shmidtb97e4282016-02-08 10:16:07 -0800428 * struct wpa_driver_scan_ssid - SSIDs to scan for
429 * @ssid - specific SSID to scan for (ProbeReq)
430 * %NULL or zero-length SSID is used to indicate active scan
431 * with wildcard SSID.
432 * @ssid_len - Length of the SSID in octets
433 */
434struct wpa_driver_scan_ssid {
435 const u8 *ssid;
436 size_t ssid_len;
437};
438
439/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700440 * struct wpa_driver_scan_params - Scan parameters
441 * Data for struct wpa_driver_ops::scan2().
442 */
443struct wpa_driver_scan_params {
444 /**
445 * ssids - SSIDs to scan for
446 */
Dmitry Shmidtb97e4282016-02-08 10:16:07 -0800447 struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700448
449 /**
450 * num_ssids - Number of entries in ssids array
451 * Zero indicates a request for a passive scan.
452 */
453 size_t num_ssids;
454
455 /**
456 * extra_ies - Extra IE(s) to add into Probe Request or %NULL
457 */
458 const u8 *extra_ies;
459
460 /**
461 * extra_ies_len - Length of extra_ies in octets
462 */
463 size_t extra_ies_len;
464
465 /**
466 * freqs - Array of frequencies to scan or %NULL for all frequencies
467 *
468 * The frequency is set in MHz. The array is zero-terminated.
469 */
470 int *freqs;
471
472 /**
473 * filter_ssids - Filter for reporting SSIDs
474 *
475 * This optional parameter can be used to request the driver wrapper to
476 * filter scan results to include only the specified SSIDs. %NULL
477 * indicates that no filtering is to be done. This can be used to
478 * reduce memory needs for scan results in environments that have large
479 * number of APs with different SSIDs.
480 *
481 * The driver wrapper is allowed to take this allocated buffer into its
482 * own use by setting the pointer to %NULL. In that case, the driver
483 * wrapper is responsible for freeing the buffer with os_free() once it
484 * is not needed anymore.
485 */
486 struct wpa_driver_scan_filter {
Dmitry Shmidt9d9e6022015-04-23 10:34:55 -0700487 u8 ssid[SSID_MAX_LEN];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700488 size_t ssid_len;
489 } *filter_ssids;
490
491 /**
492 * num_filter_ssids - Number of entries in filter_ssids array
493 */
494 size_t num_filter_ssids;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800495
496 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -0700497 * filter_rssi - Filter by RSSI
498 *
499 * The driver may filter scan results in firmware to reduce host
500 * wakeups and thereby save power. Specify the RSSI threshold in s32
501 * dBm.
502 */
503 s32 filter_rssi;
504
505 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800506 * p2p_probe - Used to disable CCK (802.11b) rates for P2P probes
507 *
508 * When set, the driver is expected to remove rates 1, 2, 5.5, and 11
509 * Mbps from the support rates element(s) in the Probe Request frames
510 * and not to transmit the frames at any of those rates.
511 */
Dmitry Shmidt2271d3f2014-06-23 12:16:31 -0700512 unsigned int p2p_probe:1;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -0800513
514 /**
515 * only_new_results - Request driver to report only new results
516 *
517 * This is used to request the driver to report only BSSes that have
518 * been detected after this scan request has been started, i.e., to
519 * flush old cached BSS entries.
520 */
Dmitry Shmidt2271d3f2014-06-23 12:16:31 -0700521 unsigned int only_new_results:1;
522
523 /**
524 * low_priority - Requests driver to use a lower scan priority
525 *
526 * This is used to request the driver to use a lower scan priority
527 * if it supports such a thing.
528 */
529 unsigned int low_priority:1;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -0800530
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800531 /**
532 * mac_addr_rand - Requests driver to randomize MAC address
533 */
534 unsigned int mac_addr_rand:1;
535
536 /**
537 * mac_addr - MAC address used with randomization. The address cannot be
538 * a multicast one, i.e., bit 0 of byte 0 should not be set.
539 */
Hai Shalomc3565922019-10-28 11:58:20 -0700540 u8 *mac_addr;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800541
542 /**
543 * mac_addr_mask - MAC address mask used with randomization.
544 *
545 * Bits that are 0 in the mask should be randomized. Bits that are 1 in
546 * the mask should be taken as is from mac_addr. The mask should not
547 * allow the generation of a multicast address, i.e., bit 0 of byte 0
548 * must be set.
549 */
550 const u8 *mac_addr_mask;
551
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -0800552 /**
553 * sched_scan_plans - Scan plans for scheduled scan
554 *
555 * Each scan plan consists of the number of iterations to scan and the
556 * interval between scans. When a scan plan finishes (i.e., it was run
557 * for the specified number of iterations), the next scan plan is
558 * executed. The scan plans are executed in the order they appear in
559 * the array (lower index first). The last scan plan will run infinitely
560 * (until requested to stop), thus must not specify the number of
561 * iterations. All other scan plans must specify the number of
562 * iterations.
563 */
564 struct sched_scan_plan {
565 u32 interval; /* In seconds */
566 u32 iterations; /* Zero to run infinitely */
567 } *sched_scan_plans;
568
569 /**
570 * sched_scan_plans_num - Number of scan plans in sched_scan_plans array
571 */
572 unsigned int sched_scan_plans_num;
573
Dmitry Shmidt9c175262016-03-03 10:20:07 -0800574 /**
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700575 * sched_scan_start_delay - Delay to use before starting the first scan
576 *
577 * Delay (in seconds) before scheduling first scan plan cycle. The
578 * driver may ignore this parameter and start immediately (or at any
579 * other time), if this feature is not supported.
580 */
581 u32 sched_scan_start_delay;
582
583 /**
Dmitry Shmidt9c175262016-03-03 10:20:07 -0800584 * bssid - Specific BSSID to scan for
585 *
586 * This optional parameter can be used to replace the default wildcard
587 * BSSID with a specific BSSID to scan for if results are needed from
588 * only a single BSS.
589 */
590 const u8 *bssid;
591
Dmitry Shmidtabb90a32016-12-05 15:34:39 -0800592 /**
593 * scan_cookie - Unique identification representing the scan request
594 *
595 * This scan_cookie carries a unique identification representing the
596 * scan request if the host driver/kernel supports concurrent scan
597 * requests. This cookie is returned from the corresponding driver
598 * interface.
599 *
600 * Note: Unlike other parameters in this structure, scan_cookie is used
601 * only to return information instead of setting parameters for the
602 * scan.
603 */
604 u64 scan_cookie;
605
Dmitry Shmidt29333592017-01-09 12:27:11 -0800606 /**
607 * duration - Dwell time on each channel
608 *
609 * This optional parameter can be used to set the dwell time on each
610 * channel. In TUs.
611 */
612 u16 duration;
613
614 /**
615 * duration_mandatory - Whether the specified duration is mandatory
616 *
617 * If this is set, the duration specified by the %duration field is
618 * mandatory (and the driver should reject the scan request if it is
619 * unable to comply with the specified duration), otherwise it is the
620 * maximum duration and the actual duration may be shorter.
621 */
622 unsigned int duration_mandatory:1;
623
Dmitry Shmidtebd93af2017-02-21 13:40:44 -0800624 /**
625 * relative_rssi_set - Whether relative RSSI parameters are set
626 */
627 unsigned int relative_rssi_set:1;
628
629 /**
630 * relative_rssi - Relative RSSI for reporting better BSSs
631 *
632 * Amount of RSSI by which a BSS should be better than the current
633 * connected BSS to report the new BSS to user space.
634 */
635 s8 relative_rssi;
636
637 /**
638 * relative_adjust_band - Band to which RSSI should be adjusted
639 *
640 * The relative_adjust_rssi should be added to the band specified
641 * by relative_adjust_band.
642 */
643 enum set_band relative_adjust_band;
644
645 /**
646 * relative_adjust_rssi - RSSI to be added to relative_adjust_band
647 *
648 * An amount of relative_band_rssi should be added to the BSSs that
649 * belong to the band specified by relative_adjust_band while comparing
650 * with other bands for BSS reporting.
651 */
652 s8 relative_adjust_rssi;
653
Hai Shalomce48b4a2018-09-05 11:41:35 -0700654 /**
655 * oce_scan
656 *
657 * Enable the following OCE scan features: (WFA OCE TechSpec v1.0)
658 * - Accept broadcast Probe Response frame.
659 * - Probe Request frame deferral and suppression.
660 * - Max Channel Time - driver fills FILS request params IE with
661 * Maximum Channel Time.
662 * - Send 1st Probe Request frame in rate of minimum 5.5 Mbps.
663 */
664 unsigned int oce_scan:1;
665
Hai Shalomc1a21442022-02-04 13:43:00 -0800666 /**
667 * p2p_include_6ghz - Include 6 GHz channels for P2P full scan
668 *
669 */
670 unsigned int p2p_include_6ghz:1;
671
Sunil8cd6f4d2022-06-28 18:40:46 +0000672 /**
673 * non_coloc_6ghz - Force scanning of non-PSC 6 GHz channels
674 *
675 * If this is set, the driver should scan non-PSC channels from the
676 * scan request even if neighbor reports from 2.4/5 GHz APs did not
677 * report a co-located AP on these channels. The default is to scan
678 * non-PSC channels only if a co-located AP was reported on the channel.
679 */
680 unsigned int non_coloc_6ghz:1;
681
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -0800682 /*
683 * NOTE: Whenever adding new parameters here, please make sure
684 * wpa_scan_clone_params() and wpa_scan_free_params() get updated with
685 * matching changes.
686 */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700687};
688
689/**
690 * struct wpa_driver_auth_params - Authentication parameters
691 * Data for struct wpa_driver_ops::authenticate().
692 */
693struct wpa_driver_auth_params {
694 int freq;
695 const u8 *bssid;
696 const u8 *ssid;
697 size_t ssid_len;
698 int auth_alg;
699 const u8 *ie;
700 size_t ie_len;
701 const u8 *wep_key[4];
702 size_t wep_key_len[4];
703 int wep_tx_keyidx;
704 int local_state_change;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800705
706 /**
707 * p2p - Whether this connection is a P2P group
708 */
709 int p2p;
710
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800711 /**
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800712 * auth_data - Additional elements for Authentication frame
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800713 *
714 * This buffer starts with the Authentication transaction sequence
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800715 * number field. If no special handling of such elements is needed, this
716 * pointer is %NULL. This is used with SAE and FILS.
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800717 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800718 const u8 *auth_data;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800719
720 /**
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800721 * auth_data_len - Length of auth_data buffer in octets
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800722 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800723 size_t auth_data_len;
Sunil Ravi77d572f2023-01-17 23:58:31 +0000724
725 /**
726 * mld - Establish an MLD connection
727 */
728 bool mld;
729
730 /**
731 * mld_link_id - The link ID of the MLD AP to which we are associating
732 */
733 u8 mld_link_id;
734
735 /**
736 * The MLD AP address
737 */
738 const u8 *ap_mld_addr;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700739};
740
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800741/**
742 * enum wps_mode - WPS mode
743 */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700744enum wps_mode {
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800745 /**
746 * WPS_MODE_NONE - No WPS provisioning being used
747 */
748 WPS_MODE_NONE,
749
750 /**
751 * WPS_MODE_OPEN - WPS provisioning with AP that is in open mode
752 */
753 WPS_MODE_OPEN,
754
755 /**
756 * WPS_MODE_PRIVACY - WPS provisioning with AP that is using protection
757 */
758 WPS_MODE_PRIVACY
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700759};
760
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800761/**
762 * struct hostapd_freq_params - Channel parameters
763 */
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700764struct hostapd_freq_params {
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800765 /**
766 * mode - Mode/band (HOSTAPD_MODE_IEEE80211A, ..)
767 */
768 enum hostapd_hw_mode mode;
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700769
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800770 /**
771 * freq - Primary channel center frequency in MHz
772 */
773 int freq;
774
775 /**
776 * channel - Channel number
777 */
778 int channel;
779
780 /**
781 * ht_enabled - Whether HT is enabled
782 */
783 int ht_enabled;
784
785 /**
786 * sec_channel_offset - Secondary channel offset for HT40
787 *
788 * 0 = HT40 disabled,
789 * -1 = HT40 enabled, secondary channel below primary,
790 * 1 = HT40 enabled, secondary channel above primary
791 */
792 int sec_channel_offset;
793
794 /**
795 * vht_enabled - Whether VHT is enabled
796 */
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700797 int vht_enabled;
798
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800799 /**
Hai Shalom81f62d82019-07-22 12:10:00 -0700800 * he_enabled - Whether HE is enabled
801 */
802 int he_enabled;
803
804 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800805 * center_freq1 - Segment 0 center frequency in MHz
806 *
807 * Valid for both HT and VHT.
808 */
809 int center_freq1;
810
811 /**
812 * center_freq2 - Segment 1 center frequency in MHz
813 *
814 * Non-zero only for bandwidth 80 and an 80+80 channel
815 */
816 int center_freq2;
817
818 /**
819 * bandwidth - Channel bandwidth in MHz (20, 40, 80, 160)
820 */
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700821 int bandwidth;
Hai Shalomc3565922019-10-28 11:58:20 -0700822
823 /**
824 * This structure describes the most essential parameters needed
825 * for IEEE 802.11ay EDMG configuration.
826 */
827 struct ieee80211_edmg_config edmg;
Sunil Ravia04bd252022-05-02 22:54:18 -0700828
829 /**
830 * radar_background - Whether radar/CAC background is requested
831 */
832 bool radar_background;
833
834 /**
835 * eht_enabled - Whether EHT is enabled
836 */
837 bool eht_enabled;
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700838};
839
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700840/**
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700841 * struct wpa_driver_sta_auth_params - Authentication parameters
842 * Data for struct wpa_driver_ops::sta_auth().
843 */
844struct wpa_driver_sta_auth_params {
845
846 /**
847 * own_addr - Source address and BSSID for authentication frame
848 */
849 const u8 *own_addr;
850
851 /**
852 * addr - MAC address of the station to associate
853 */
854 const u8 *addr;
855
856 /**
857 * seq - authentication sequence number
858 */
859 u16 seq;
860
861 /**
862 * status - authentication response status code
863 */
864 u16 status;
865
866 /**
867 * ie - authentication frame ie buffer
868 */
869 const u8 *ie;
870
871 /**
872 * len - ie buffer length
873 */
874 size_t len;
875
876 /**
877 * fils_auth - Indicates whether FILS authentication is being performed
878 */
879 int fils_auth;
880
881 /**
882 * fils_anonce - ANonce (required for FILS)
883 */
884 u8 fils_anonce[WPA_NONCE_LEN];
885
886 /**
887 * fils_snonce - SNonce (required for FILS)
888 */
889 u8 fils_snonce[WPA_NONCE_LEN];
890
891 /**
892 * fils_kek - key for encryption (required for FILS)
893 */
894 u8 fils_kek[WPA_KEK_MAX_LEN];
895
896 /**
897 * fils_kek_len - Length of the fils_kek in octets (required for FILS)
898 */
899 size_t fils_kek_len;
900};
901
Sunil Ravi77d572f2023-01-17 23:58:31 +0000902struct wpa_driver_mld_params {
903 /**
904 * mld_addr - AP's MLD address
905 */
906 const u8 *mld_addr;
907
908 /**
909 * valid_links - The valid links including the association link
910 */
911 u16 valid_links;
912
913 /**
914 * assoc_link_id - The link on which the association is performed
915 */
916 u8 assoc_link_id;
917
918 /**
919 * mld_links - Link information
920 *
921 * Should include information on all the requested links for association
922 * including the link on which the association should take place.
923 * For the association link, the ies and ies_len should be NULL and
924 * 0 respectively.
925 */
926 struct {
927 int freq;
928 const u8 *bssid;
929 const u8 *ies;
930 size_t ies_len;
931 } mld_links[MAX_NUM_MLD_LINKS];
932};
933
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700934/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700935 * struct wpa_driver_associate_params - Association parameters
936 * Data for struct wpa_driver_ops::associate().
937 */
938struct wpa_driver_associate_params {
939 /**
940 * bssid - BSSID of the selected AP
941 * This can be %NULL, if ap_scan=2 mode is used and the driver is
942 * responsible for selecting with which BSS to associate. */
943 const u8 *bssid;
944
945 /**
Dmitry Shmidt96be6222014-02-13 10:16:51 -0800946 * bssid_hint - BSSID of a proposed AP
947 *
948 * This indicates which BSS has been found a suitable candidate for
949 * initial association for drivers that use driver/firmwate-based BSS
950 * selection. Unlike the @bssid parameter, @bssid_hint does not limit
951 * the driver from selecting other BSSes in the ESS.
952 */
953 const u8 *bssid_hint;
954
955 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700956 * ssid - The selected SSID
957 */
958 const u8 *ssid;
959
960 /**
961 * ssid_len - Length of the SSID (1..32)
962 */
963 size_t ssid_len;
964
965 /**
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700966 * freq - channel parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700967 */
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700968 struct hostapd_freq_params freq;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700969
970 /**
Dmitry Shmidt96be6222014-02-13 10:16:51 -0800971 * freq_hint - Frequency of the channel the proposed AP is using
972 *
973 * This provides a channel on which a suitable BSS has been found as a
974 * hint for the driver. Unlike the @freq parameter, @freq_hint does not
975 * limit the driver from selecting other channels for
976 * driver/firmware-based BSS selection.
977 */
978 int freq_hint;
979
980 /**
Dmitry Shmidt04949592012-07-19 12:16:46 -0700981 * bg_scan_period - Background scan period in seconds, 0 to disable
982 * background scan, or -1 to indicate no change to default driver
983 * configuration
984 */
985 int bg_scan_period;
986
987 /**
Dmitry Shmidt2ac5f602014-03-07 10:08:21 -0800988 * beacon_int - Beacon interval for IBSS or 0 to use driver default
989 */
990 int beacon_int;
991
992 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700993 * wpa_ie - WPA information element for (Re)Association Request
994 * WPA information element to be included in (Re)Association
995 * Request (including information element id and length). Use
996 * of this WPA IE is optional. If the driver generates the WPA
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700997 * IE, it can use pairwise_suite, group_suite, group_mgmt_suite, and
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700998 * key_mgmt_suite to select proper algorithms. In this case,
999 * the driver has to notify wpa_supplicant about the used WPA
1000 * IE by generating an event that the interface code will
1001 * convert into EVENT_ASSOCINFO data (see below).
1002 *
1003 * When using WPA2/IEEE 802.11i, wpa_ie is used for RSN IE
1004 * instead. The driver can determine which version is used by
1005 * looking at the first byte of the IE (0xdd for WPA, 0x30 for
1006 * WPA2/RSN).
1007 *
1008 * When using WPS, wpa_ie is used for WPS IE instead of WPA/RSN IE.
1009 */
1010 const u8 *wpa_ie;
1011
1012 /**
1013 * wpa_ie_len - length of the wpa_ie
1014 */
1015 size_t wpa_ie_len;
1016
1017 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001018 * wpa_proto - Bitfield of WPA_PROTO_* values to indicate WPA/WPA2
1019 */
1020 unsigned int wpa_proto;
1021
1022 /**
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001023 * pairwise_suite - Selected pairwise cipher suite (WPA_CIPHER_*)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001024 *
1025 * This is usually ignored if @wpa_ie is used.
1026 */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001027 unsigned int pairwise_suite;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001028
1029 /**
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001030 * group_suite - Selected group cipher suite (WPA_CIPHER_*)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001031 *
1032 * This is usually ignored if @wpa_ie is used.
1033 */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001034 unsigned int group_suite;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001035
1036 /**
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001037 * mgmt_group_suite - Selected group management cipher suite (WPA_CIPHER_*)
1038 *
1039 * This is usually ignored if @wpa_ie is used.
1040 */
1041 unsigned int mgmt_group_suite;
1042
1043 /**
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001044 * key_mgmt_suite - Selected key management suite (WPA_KEY_MGMT_*)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001045 *
1046 * This is usually ignored if @wpa_ie is used.
1047 */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001048 unsigned int key_mgmt_suite;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001049
1050 /**
Sunil Ravi89eba102022-09-13 21:04:37 -07001051 * allowed_key_mgmts - Bitfield of allowed key management suites
1052 * (WPA_KEY_MGMT_*) other than @key_mgmt_suite for the current
1053 * connection
1054 *
1055 * SME in the driver may choose key_mgmt from this list for the initial
1056 * connection or roaming. The driver which doesn't support this
1057 * ignores this parameter.
1058 */
1059 unsigned int allowed_key_mgmts;
1060
1061 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001062 * auth_alg - Allowed authentication algorithms
1063 * Bit field of WPA_AUTH_ALG_*
1064 */
1065 int auth_alg;
1066
1067 /**
1068 * mode - Operation mode (infra/ibss) IEEE80211_MODE_*
1069 */
1070 int mode;
1071
1072 /**
1073 * wep_key - WEP keys for static WEP configuration
1074 */
1075 const u8 *wep_key[4];
1076
1077 /**
1078 * wep_key_len - WEP key length for static WEP configuration
1079 */
1080 size_t wep_key_len[4];
1081
1082 /**
1083 * wep_tx_keyidx - WEP TX key index for static WEP configuration
1084 */
1085 int wep_tx_keyidx;
1086
1087 /**
1088 * mgmt_frame_protection - IEEE 802.11w management frame protection
1089 */
1090 enum mfp_options mgmt_frame_protection;
1091
1092 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001093 * passphrase - RSN passphrase for PSK
1094 *
1095 * This value is made available only for WPA/WPA2-Personal (PSK) and
Hai Shalom74f70d42019-02-11 14:42:39 -08001096 * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK. This
1097 * is the 8..63 character ASCII passphrase, if available. Please note
1098 * that this can be %NULL if passphrase was not used to generate the
1099 * PSK. In that case, the psk field must be used to fetch the PSK.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001100 */
1101 const char *passphrase;
1102
1103 /**
1104 * psk - RSN PSK (alternative for passphrase for PSK)
1105 *
1106 * This value is made available only for WPA/WPA2-Personal (PSK) and
Hai Shalom74f70d42019-02-11 14:42:39 -08001107 * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK. This
1108 * is the 32-octet (256-bit) PSK, if available. The driver wrapper
1109 * should be prepared to handle %NULL value as an error.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001110 */
1111 const u8 *psk;
1112
1113 /**
1114 * drop_unencrypted - Enable/disable unencrypted frame filtering
1115 *
1116 * Configure the driver to drop all non-EAPOL frames (both receive and
1117 * transmit paths). Unencrypted EAPOL frames (ethertype 0x888e) must
1118 * still be allowed for key negotiation.
1119 */
1120 int drop_unencrypted;
1121
1122 /**
1123 * prev_bssid - Previously used BSSID in this ESS
1124 *
1125 * When not %NULL, this is a request to use reassociation instead of
1126 * association.
1127 */
1128 const u8 *prev_bssid;
1129
1130 /**
1131 * wps - WPS mode
1132 *
1133 * If the driver needs to do special configuration for WPS association,
1134 * this variable provides more information on what type of association
Sunil Ravia04bd252022-05-02 22:54:18 -07001135 * is being requested. Most drivers should not need to use this.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001136 */
1137 enum wps_mode wps;
1138
1139 /**
1140 * p2p - Whether this connection is a P2P group
1141 */
1142 int p2p;
1143
1144 /**
1145 * uapsd - UAPSD parameters for the network
1146 * -1 = do not change defaults
1147 * AP mode: 1 = enabled, 0 = disabled
1148 * STA mode: bits 0..3 UAPSD enabled for VO,VI,BK,BE
1149 */
1150 int uapsd;
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08001151
1152 /**
1153 * fixed_bssid - Whether to force this BSSID in IBSS mode
1154 * 1 = Fix this BSSID and prevent merges.
1155 * 0 = Do not fix BSSID.
1156 */
1157 int fixed_bssid;
1158
1159 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08001160 * fixed_freq - Fix control channel in IBSS mode
1161 * 0 = don't fix control channel (default)
1162 * 1 = fix control channel; this prevents IBSS merging with another
1163 * channel
1164 */
1165 int fixed_freq;
1166
1167 /**
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08001168 * disable_ht - Disable HT (IEEE 802.11n) for this connection
1169 */
1170 int disable_ht;
1171
1172 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001173 * htcaps - HT Capabilities over-rides
1174 *
1175 * Only bits set in the mask will be used, and not all values are used
1176 * by the kernel anyway. Currently, MCS, MPDU and MSDU fields are used.
1177 *
1178 * Pointer to struct ieee80211_ht_capabilities.
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08001179 */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001180 const u8 *htcaps;
1181
1182 /**
1183 * htcaps_mask - HT Capabilities over-rides mask
1184 *
1185 * Pointer to struct ieee80211_ht_capabilities.
1186 */
1187 const u8 *htcaps_mask;
Dmitry Shmidt2f023192013-03-12 12:44:17 -07001188
1189#ifdef CONFIG_VHT_OVERRIDES
1190 /**
1191 * disable_vht - Disable VHT for this connection
1192 */
1193 int disable_vht;
1194
1195 /**
1196 * VHT capability overrides.
1197 */
1198 const struct ieee80211_vht_capabilities *vhtcaps;
1199 const struct ieee80211_vht_capabilities *vhtcaps_mask;
1200#endif /* CONFIG_VHT_OVERRIDES */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001201
Hai Shalomfdcde762020-04-02 11:19:20 -07001202#ifdef CONFIG_HE_OVERRIDES
1203 /**
1204 * disable_he - Disable HE for this connection
1205 */
1206 int disable_he;
1207#endif /* CONFIG_HE_OVERRIDES */
1208
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001209 /**
1210 * req_key_mgmt_offload - Request key management offload for connection
1211 *
1212 * Request key management offload for this connection if the device
1213 * supports it.
1214 */
1215 int req_key_mgmt_offload;
1216
1217 /**
Hai Shalomc3565922019-10-28 11:58:20 -07001218 * req_handshake_offload - Request EAPOL handshake offload
1219 *
1220 * Request EAPOL handshake offload for this connection if the device
1221 * supports it.
1222 */
1223 int req_handshake_offload;
1224
1225 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001226 * Flag for indicating whether this association includes support for
1227 * RRM (Radio Resource Measurements)
1228 */
1229 int rrm_used;
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08001230
1231 /**
1232 * pbss - If set, connect to a PCP in a PBSS. Otherwise, connect to an
1233 * AP as usual. Valid for DMG network only.
1234 */
1235 int pbss;
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08001236
1237 /**
1238 * fils_kek - KEK for FILS association frame protection (AES-SIV)
1239 */
1240 const u8 *fils_kek;
1241
1242 /**
1243 * fils_kek_len: Length of fils_kek in bytes
1244 */
1245 size_t fils_kek_len;
1246
1247 /**
1248 * fils_nonces - Nonces for FILS association frame protection
1249 * (AES-SIV AAD)
1250 */
1251 const u8 *fils_nonces;
1252
1253 /**
1254 * fils_nonces_len: Length of fils_nonce in bytes
1255 */
1256 size_t fils_nonces_len;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001257
1258 /**
1259 * fils_erp_username - Username part of keyName-NAI
1260 */
1261 const u8 *fils_erp_username;
1262
1263 /**
1264 * fils_erp_username_len - Length of fils_erp_username in bytes
1265 */
1266 size_t fils_erp_username_len;
1267
1268 /**
1269 * fils_erp_realm - Realm/domain name to use in FILS ERP
1270 */
1271 const u8 *fils_erp_realm;
1272
1273 /**
1274 * fils_erp_realm_len - Length of fils_erp_realm in bytes
1275 */
1276 size_t fils_erp_realm_len;
1277
1278 /**
1279 * fils_erp_next_seq_num - The next sequence number to use in FILS ERP
1280 * messages
1281 */
1282 u16 fils_erp_next_seq_num;
1283
1284 /**
1285 * fils_erp_rrk - Re-authentication root key (rRK) for the keyName-NAI
1286 * specified by fils_erp_username@fils_erp_realm.
1287 */
1288 const u8 *fils_erp_rrk;
1289
1290 /**
1291 * fils_erp_rrk_len - Length of fils_erp_rrk in bytes
1292 */
1293 size_t fils_erp_rrk_len;
Hai Shalom60840252021-02-19 19:02:11 -08001294
1295 /**
1296 * sae_pwe - SAE mechanism for PWE derivation
1297 * 0 = hunting-and-pecking loop only
1298 * 1 = hash-to-element only
1299 * 2 = both hunting-and-pecking loop and hash-to-element enabled
1300 */
Sunil Ravi77d572f2023-01-17 23:58:31 +00001301 enum sae_pwe sae_pwe;
1302
Winnie Chen4138eec2022-11-10 16:32:53 +08001303#if defined(CONFIG_DRIVER_NL80211_BRCM) || defined(CONFIG_DRIVER_NL80211_SYNA)
Vinayak Yadawade62409f2022-01-20 12:32:07 +05301304 /**
1305 * td_policy - Transition Disable Policy
1306 */
1307 u32 td_policy;
Winnie Chen4138eec2022-11-10 16:32:53 +08001308#endif /* CONFIG_DRIVER_NL80211_BRCM || CONFIG_DRIVER_NL80211_SYNA */
Sunil Ravi77d572f2023-01-17 23:58:31 +00001309
1310 /**
1311 * disable_eht - Disable EHT for this connection
1312 */
1313 int disable_eht;
1314
1315 /*
1316 * mld_params - MLD association parameters
1317 */
1318 struct wpa_driver_mld_params mld_params;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001319};
1320
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001321enum hide_ssid {
1322 NO_SSID_HIDING,
1323 HIDDEN_SSID_ZERO_LEN,
1324 HIDDEN_SSID_ZERO_CONTENTS
1325};
1326
Hai Shalom81f62d82019-07-22 12:10:00 -07001327enum ch_switch_state {
1328 CH_SW_STARTED,
1329 CH_SW_FINISHED
1330};
1331
Dmitry Shmidtb58836e2014-04-29 14:35:56 -07001332struct wowlan_triggers {
1333 u8 any;
1334 u8 disconnect;
1335 u8 magic_pkt;
1336 u8 gtk_rekey_failure;
1337 u8 eap_identity_req;
1338 u8 four_way_handshake;
1339 u8 rfkill_release;
1340};
1341
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001342struct wpa_driver_ap_params {
1343 /**
1344 * head - Beacon head from IEEE 802.11 header to IEs before TIM IE
1345 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08001346 u8 *head;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001347
1348 /**
1349 * head_len - Length of the head buffer in octets
1350 */
1351 size_t head_len;
1352
1353 /**
1354 * tail - Beacon tail following TIM IE
1355 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08001356 u8 *tail;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001357
1358 /**
1359 * tail_len - Length of the tail buffer in octets
1360 */
1361 size_t tail_len;
1362
1363 /**
1364 * dtim_period - DTIM period
1365 */
1366 int dtim_period;
1367
1368 /**
1369 * beacon_int - Beacon interval
1370 */
1371 int beacon_int;
1372
1373 /**
1374 * basic_rates: -1 terminated array of basic rates in 100 kbps
1375 *
1376 * This parameter can be used to set a specific basic rate set for the
1377 * BSS. If %NULL, default basic rate set is used.
1378 */
1379 int *basic_rates;
1380
1381 /**
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001382 * beacon_rate: Beacon frame data rate
1383 *
1384 * This parameter can be used to set a specific Beacon frame data rate
1385 * for the BSS. The interpretation of this value depends on the
Hai Shalom60840252021-02-19 19:02:11 -08001386 * rate_type (legacy: in 100 kbps units, HT: HT-MCS, VHT: VHT-MCS,
1387 * HE: HE-MCS). If beacon_rate == 0 and rate_type == 0
1388 * (BEACON_RATE_LEGACY), the default Beacon frame data rate is used.
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001389 */
1390 unsigned int beacon_rate;
1391
1392 /**
Hai Shalom60840252021-02-19 19:02:11 -08001393 * beacon_rate_type: Beacon data rate type (legacy/HT/VHT/HE)
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001394 */
1395 enum beacon_rate_type rate_type;
1396
1397 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001398 * proberesp - Probe Response template
1399 *
1400 * This is used by drivers that reply to Probe Requests internally in
1401 * AP mode and require the full Probe Response template.
1402 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08001403 u8 *proberesp;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001404
1405 /**
1406 * proberesp_len - Length of the proberesp buffer in octets
1407 */
1408 size_t proberesp_len;
1409
1410 /**
1411 * ssid - The SSID to use in Beacon/Probe Response frames
1412 */
1413 const u8 *ssid;
1414
1415 /**
1416 * ssid_len - Length of the SSID (1..32)
1417 */
1418 size_t ssid_len;
1419
1420 /**
1421 * hide_ssid - Whether to hide the SSID
1422 */
1423 enum hide_ssid hide_ssid;
1424
1425 /**
1426 * pairwise_ciphers - WPA_CIPHER_* bitfield
1427 */
1428 unsigned int pairwise_ciphers;
1429
1430 /**
1431 * group_cipher - WPA_CIPHER_*
1432 */
1433 unsigned int group_cipher;
1434
1435 /**
1436 * key_mgmt_suites - WPA_KEY_MGMT_* bitfield
1437 */
1438 unsigned int key_mgmt_suites;
1439
1440 /**
1441 * auth_algs - WPA_AUTH_ALG_* bitfield
1442 */
1443 unsigned int auth_algs;
1444
1445 /**
1446 * wpa_version - WPA_PROTO_* bitfield
1447 */
1448 unsigned int wpa_version;
1449
1450 /**
1451 * privacy - Whether privacy is used in the BSS
1452 */
1453 int privacy;
1454
1455 /**
1456 * beacon_ies - WPS/P2P IE(s) for Beacon frames
1457 *
1458 * This is used to add IEs like WPS IE and P2P IE by drivers that do
1459 * not use the full Beacon template.
1460 */
1461 const struct wpabuf *beacon_ies;
1462
1463 /**
1464 * proberesp_ies - P2P/WPS IE(s) for Probe Response frames
1465 *
1466 * This is used to add IEs like WPS IE and P2P IE by drivers that
1467 * reply to Probe Request frames internally.
1468 */
1469 const struct wpabuf *proberesp_ies;
1470
1471 /**
1472 * assocresp_ies - WPS IE(s) for (Re)Association Response frames
1473 *
1474 * This is used to add IEs like WPS IE by drivers that reply to
1475 * (Re)Association Request frames internally.
1476 */
1477 const struct wpabuf *assocresp_ies;
1478
1479 /**
1480 * isolate - Whether to isolate frames between associated stations
1481 *
1482 * If this is non-zero, the AP is requested to disable forwarding of
1483 * frames between associated stations.
1484 */
1485 int isolate;
1486
1487 /**
1488 * cts_protect - Whether CTS protection is enabled
1489 */
1490 int cts_protect;
1491
1492 /**
1493 * preamble - Whether short preamble is enabled
1494 */
1495 int preamble;
1496
1497 /**
1498 * short_slot_time - Whether short slot time is enabled
1499 *
1500 * 0 = short slot time disable, 1 = short slot time enabled, -1 = do
1501 * not set (e.g., when 802.11g mode is not in use)
1502 */
1503 int short_slot_time;
1504
1505 /**
1506 * ht_opmode - HT operation mode or -1 if HT not in use
1507 */
1508 int ht_opmode;
1509
1510 /**
1511 * interworking - Whether Interworking is enabled
1512 */
1513 int interworking;
1514
1515 /**
1516 * hessid - Homogeneous ESS identifier or %NULL if not set
1517 */
1518 const u8 *hessid;
1519
1520 /**
1521 * access_network_type - Access Network Type (0..15)
1522 *
1523 * This is used for filtering Probe Request frames when Interworking is
1524 * enabled.
1525 */
1526 u8 access_network_type;
Dmitry Shmidt04949592012-07-19 12:16:46 -07001527
1528 /**
1529 * ap_max_inactivity - Timeout in seconds to detect STA's inactivity
1530 *
1531 * This is used by driver which advertises this capability.
1532 */
1533 int ap_max_inactivity;
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07001534
1535 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08001536 * ctwindow - Client Traffic Window (in TUs)
1537 */
1538 u8 p2p_go_ctwindow;
1539
1540 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07001541 * disable_dgaf - Whether group-addressed frames are disabled
1542 */
1543 int disable_dgaf;
Dmitry Shmidtf21452a2014-02-26 10:55:25 -08001544
1545 /**
1546 * osen - Whether OSEN security is enabled
1547 */
1548 int osen;
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07001549
1550 /**
1551 * freq - Channel parameters for dynamic bandwidth changes
1552 */
1553 struct hostapd_freq_params *freq;
Dmitry Shmidt7f656022015-02-25 14:36:37 -08001554
1555 /**
1556 * reenable - Whether this is to re-enable beaconing
1557 */
1558 int reenable;
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08001559
1560 /**
1561 * pbss - Whether to start a PCP (in PBSS) instead of an AP in
1562 * infrastructure BSS. Valid only for DMG network.
1563 */
1564 int pbss;
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001565
1566 /**
1567 * multicast_to_unicast - Whether to use multicast_to_unicast
1568 *
1569 * If this is non-zero, the AP is requested to perform multicast to
1570 * unicast conversion for ARP, IPv4, and IPv6 frames (possibly within
1571 * 802.1Q). If enabled, such frames are to be sent to each station
1572 * separately, with the DA replaced by their own MAC address rather
1573 * than the group address.
1574 *
1575 * Note that this may break certain expectations of the receiver, such
1576 * as the ability to drop unicast IP packets received within multicast
1577 * L2 frames, or the ability to not send ICMP destination unreachable
1578 * messages for packets received in L2 multicast (which is required,
1579 * but the receiver can't tell the difference if this new option is
1580 * enabled.)
1581 *
1582 * This also doesn't implement the 802.11 DMS (directed multicast
1583 * service).
1584 */
1585 int multicast_to_unicast;
Hai Shalom74f70d42019-02-11 14:42:39 -08001586
1587 /**
1588 * ftm_responder - Whether FTM responder is enabled
1589 */
1590 int ftm_responder;
1591
1592 /**
1593 * lci - Binary data, the content of an LCI report IE with type 8 as
1594 * defined in IEEE Std 802.11-2016, 9.4.2.22.10
1595 */
1596 const struct wpabuf *lci;
1597
1598 /**
1599 * civic - Binary data, the content of a measurement report IE with
1600 * type 11 as defined in IEEE Std 802.11-2016, 9.4.2.22.13
1601 */
1602 const struct wpabuf *civic;
Hai Shalomc3565922019-10-28 11:58:20 -07001603
1604 /**
Hai Shalom60840252021-02-19 19:02:11 -08001605 * he_spr_ctrl - Spatial Reuse control field of SPR element
Hai Shalomc3565922019-10-28 11:58:20 -07001606 */
Hai Shalom60840252021-02-19 19:02:11 -08001607 u8 he_spr_ctrl;
1608
1609 /**
1610 * he_spr_non_srg_obss_pd_max_offset - Non-SRG Maximum TX power offset
1611 */
1612 u8 he_spr_non_srg_obss_pd_max_offset;
Hai Shalomc3565922019-10-28 11:58:20 -07001613
1614 /**
1615 * he_spr_srg_obss_pd_min_offset - Minimum TX power offset
1616 */
Hai Shalom60840252021-02-19 19:02:11 -08001617 u8 he_spr_srg_obss_pd_min_offset;
Hai Shalomc3565922019-10-28 11:58:20 -07001618
1619 /**
1620 * he_spr_srg_obss_pd_max_offset - Maximum TX power offset
1621 */
Hai Shalom60840252021-02-19 19:02:11 -08001622 u8 he_spr_srg_obss_pd_max_offset;
1623
1624 /**
1625 * he_spr_bss_color_bitmap - BSS color values used by members of the
1626 * SRG.
1627 */
1628 u8 he_spr_bss_color_bitmap[8];
1629
1630 /**
1631 * he_spr_partial_bssid_bitmap - Partial BSSID values used by members
1632 * of the SRG.
1633 */
1634 u8 he_spr_partial_bssid_bitmap[8];
Hai Shalomfdcde762020-04-02 11:19:20 -07001635
1636 /**
1637 * he_bss_color - Whether the BSS Color is disabled
1638 */
1639 int he_bss_color_disabled;
1640
1641 /**
1642 * he_bss_color_partial - The BSS Color AID equation
1643 */
1644 int he_bss_color_partial;
1645
1646 /**
1647 * he_bss_color - The BSS Color of the AP
1648 */
1649 int he_bss_color;
1650
1651 /**
1652 * twt_responder - Whether Target Wait Time responder is enabled
1653 */
1654 int twt_responder;
Hai Shalom60840252021-02-19 19:02:11 -08001655
1656 /**
1657 * sae_pwe - SAE mechanism for PWE derivation
1658 * 0 = hunting-and-pecking loop only
1659 * 1 = hash-to-element only
1660 * 2 = both hunting-and-pecking loop and hash-to-element enabled
1661 */
Sunil Ravi77d572f2023-01-17 23:58:31 +00001662 enum sae_pwe sae_pwe;
Hai Shalom60840252021-02-19 19:02:11 -08001663
1664 /**
1665 * FILS Discovery frame minimum interval in TUs
1666 */
1667 u32 fd_min_int;
1668
1669 /**
1670 * FILS Discovery frame maximum interval in TUs (0 = FD frame disabled)
1671 */
1672 u32 fd_max_int;
1673
1674 /**
1675 * FILS Discovery frame template data
1676 */
1677 u8 *fd_frame_tmpl;
1678
1679 /**
1680 * FILS Discovery frame template length
1681 */
1682 size_t fd_frame_tmpl_len;
1683
1684 /**
1685 * Unsolicited broadcast Probe Response interval in TUs
1686 */
1687 unsigned int unsol_bcast_probe_resp_interval;
1688
1689 /**
1690 * Unsolicited broadcast Probe Response template data
1691 */
1692 u8 *unsol_bcast_probe_resp_tmpl;
1693
1694 /**
1695 * Unsolicited broadcast Probe Response template length
1696 */
1697 size_t unsol_bcast_probe_resp_tmpl_len;
Sunil Ravi77d572f2023-01-17 23:58:31 +00001698
1699 /**
1700 * mbssid_tx_iface - Transmitting interface of the MBSSID set
1701 */
1702 const char *mbssid_tx_iface;
1703
1704 /**
1705 * mbssid_index - The index of this BSS in the MBSSID set
1706 */
1707 unsigned int mbssid_index;
1708
1709 /**
1710 * mbssid_elem - Buffer containing all MBSSID elements
1711 */
1712 u8 *mbssid_elem;
1713
1714 /**
1715 * mbssid_elem_len - Total length of all MBSSID elements
1716 */
1717 size_t mbssid_elem_len;
1718
1719 /**
1720 * mbssid_elem_count - The number of MBSSID elements
1721 */
1722 u8 mbssid_elem_count;
1723
1724 /**
1725 * mbssid_elem_offset - Offsets to elements in mbssid_elem.
1726 * Kernel will use these offsets to generate multiple BSSID beacons.
1727 */
1728 u8 **mbssid_elem_offset;
1729
1730 /**
1731 * ema - Enhanced MBSSID advertisements support.
1732 */
1733 bool ema;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001734};
1735
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001736struct wpa_driver_mesh_bss_params {
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001737#define WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS 0x00000001
1738#define WPA_DRIVER_MESH_CONF_FLAG_PEER_LINK_TIMEOUT 0x00000002
1739#define WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS 0x00000004
1740#define WPA_DRIVER_MESH_CONF_FLAG_HT_OP_MODE 0x00000008
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001741#define WPA_DRIVER_MESH_CONF_FLAG_RSSI_THRESHOLD 0x00000010
Hai Shalomc1a21442022-02-04 13:43:00 -08001742#define WPA_DRIVER_MESH_CONF_FLAG_FORWARDING 0x00000020
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001743 /*
1744 * TODO: Other mesh configuration parameters would go here.
1745 * See NL80211_MESHCONF_* for all the mesh config parameters.
1746 */
1747 unsigned int flags;
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001748 int auto_plinks;
Dmitry Shmidt2f74e362015-01-21 13:19:05 -08001749 int peer_link_timeout;
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001750 int max_peer_links;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001751 int rssi_threshold;
Hai Shalomc1a21442022-02-04 13:43:00 -08001752 int forwarding;
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001753 u16 ht_opmode;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001754};
1755
1756struct wpa_driver_mesh_join_params {
1757 const u8 *meshid;
1758 int meshid_len;
1759 const int *basic_rates;
1760 const u8 *ies;
1761 int ie_len;
Dmitry Shmidtff787d52015-01-12 13:01:47 -08001762 struct hostapd_freq_params freq;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001763 int beacon_int;
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07001764 int dtim_period;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001765 struct wpa_driver_mesh_bss_params conf;
1766#define WPA_DRIVER_MESH_FLAG_USER_MPM 0x00000001
1767#define WPA_DRIVER_MESH_FLAG_DRIVER_MPM 0x00000002
1768#define WPA_DRIVER_MESH_FLAG_SAE_AUTH 0x00000004
1769#define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008
1770 unsigned int flags;
Hai Shalom60840252021-02-19 19:02:11 -08001771 bool handle_dfs;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001772};
1773
Hai Shalomfdcde762020-04-02 11:19:20 -07001774struct wpa_driver_set_key_params {
1775 /**
1776 * ifname - Interface name (for multi-SSID/VLAN support) */
1777 const char *ifname;
1778
1779 /**
1780 * alg - Encryption algorithm
1781 *
1782 * (%WPA_ALG_NONE, %WPA_ALG_WEP, %WPA_ALG_TKIP, %WPA_ALG_CCMP,
Hai Shalom4fbc08f2020-05-18 12:37:00 -07001783 * %WPA_ALG_BIP_AES_CMAC_128, %WPA_ALG_GCMP, %WPA_ALG_GCMP_256,
1784 * %WPA_ALG_CCMP_256, %WPA_ALG_BIP_GMAC_128, %WPA_ALG_BIP_GMAC_256,
1785 * %WPA_ALG_BIP_CMAC_256);
Hai Shalomfdcde762020-04-02 11:19:20 -07001786 * %WPA_ALG_NONE clears the key. */
1787 enum wpa_alg alg;
1788
1789 /**
1790 * addr - Address of the peer STA
1791 *
1792 * (BSSID of the current AP when setting pairwise key in station mode),
1793 * ff:ff:ff:ff:ff:ff for broadcast keys, %NULL for default keys that
1794 * are used both for broadcast and unicast; when clearing keys, %NULL
1795 * is used to indicate that both the broadcast-only and default key of
1796 * the specified key index is to be cleared */
1797 const u8 *addr;
1798
1799 /**
1800 * key_idx - Key index
1801 *
1802 * (0..3), usually 0 for unicast keys; 4..5 for IGTK; 6..7 for BIGTK */
1803 int key_idx;
1804
1805 /**
1806 * set_tx - Configure this key as the default Tx key
1807 *
1808 * Only used when driver does not support separate unicast/individual
1809 * key */
1810 int set_tx;
1811
1812 /**
1813 * seq - Sequence number/packet number
1814 *
1815 * seq_len octets, the next packet number to be used for in replay
1816 * protection; configured for Rx keys (in most cases, this is only used
1817 * with broadcast keys and set to zero for unicast keys); %NULL if not
1818 * set */
1819 const u8 *seq;
1820
1821 /**
1822 * seq_len - Length of the seq, depends on the algorithm
1823 *
1824 * TKIP: 6 octets, CCMP/GCMP: 6 octets, IGTK: 6 octets */
1825 size_t seq_len;
1826
1827 /**
1828 * key - Key buffer
1829 *
1830 * TKIP: 16-byte temporal key, 8-byte Tx Mic key, 8-byte Rx Mic Key */
1831 const u8 *key;
1832
1833 /**
1834 * key_len - Length of the key buffer in octets
1835 *
1836 * WEP: 5 or 13, TKIP: 32, CCMP/GCMP: 16, IGTK: 16 */
1837 size_t key_len;
1838
1839 /**
1840 * vlan_id - VLAN index (0..4095) for VLAN offload cases */
1841 int vlan_id;
1842
1843 /**
1844 * key_flag - Additional key flags
1845 *
1846 * %KEY_FLAG_MODIFY
1847 * Set when an already installed key must be updated.
1848 * So far the only use-case is changing RX/TX status for
1849 * pairwise keys. Must not be set when deleting a key.
1850 * %KEY_FLAG_DEFAULT
1851 * Set when the key is also a default key. Must not be set when
1852 * deleting a key.
1853 * %KEY_FLAG_RX
1854 * The key is valid for RX. Must not be set when deleting a key.
1855 * %KEY_FLAG_TX
1856 * The key is valid for TX. Must not be set when deleting a key.
1857 * %KEY_FLAG_GROUP
1858 * The key is a broadcast or group key.
1859 * %KEY_FLAG_PAIRWISE
1860 * The key is a pairwise key.
1861 * %KEY_FLAG_PMK
1862 * The key is a Pairwise Master Key (PMK).
1863 *
1864 * Valid and pre-defined combinations are:
1865 * %KEY_FLAG_GROUP_RX_TX
1866 * WEP key not to be installed as default key.
1867 * %KEY_FLAG_GROUP_RX_TX_DEFAULT
1868 * Default WEP or WPA-NONE key.
1869 * %KEY_FLAG_GROUP_RX
1870 * GTK key valid for RX only.
1871 * %KEY_FLAG_GROUP_TX_DEFAULT
1872 * GTK key valid for TX only, immediately taking over TX.
1873 * %KEY_FLAG_PAIRWISE_RX_TX
1874 * Pairwise key immediately becoming the active pairwise key.
1875 * %KEY_FLAG_PAIRWISE_RX
1876 * Pairwise key not yet valid for TX. (Only usable when Extended
1877 * Key ID is supported by the driver.)
1878 * %KEY_FLAG_PAIRWISE_RX_TX_MODIFY
1879 * Enable TX for a pairwise key installed with
1880 * KEY_FLAG_PAIRWISE_RX.
1881 *
1882 * Not a valid standalone key type but pre-defined to be combined
1883 * with other key_flags:
1884 * %KEY_FLAG_RX_TX
1885 * RX/TX key. */
1886 enum key_flag key_flag;
Sunil Ravi77d572f2023-01-17 23:58:31 +00001887
1888 /**
1889 * link_id - MLO Link ID
1890 *
1891 * Set to a valid Link ID (0-14) when applicable, otherwise -1. */
1892 int link_id;
Hai Shalomfdcde762020-04-02 11:19:20 -07001893};
1894
Hai Shalom4fbc08f2020-05-18 12:37:00 -07001895enum wpa_driver_if_type {
1896 /**
1897 * WPA_IF_STATION - Station mode interface
1898 */
1899 WPA_IF_STATION,
1900
1901 /**
1902 * WPA_IF_AP_VLAN - AP mode VLAN interface
1903 *
1904 * This interface shares its address and Beacon frame with the main
1905 * BSS.
1906 */
1907 WPA_IF_AP_VLAN,
1908
1909 /**
1910 * WPA_IF_AP_BSS - AP mode BSS interface
1911 *
1912 * This interface has its own address and Beacon frame.
1913 */
1914 WPA_IF_AP_BSS,
1915
1916 /**
1917 * WPA_IF_P2P_GO - P2P Group Owner
1918 */
1919 WPA_IF_P2P_GO,
1920
1921 /**
1922 * WPA_IF_P2P_CLIENT - P2P Client
1923 */
1924 WPA_IF_P2P_CLIENT,
1925
1926 /**
1927 * WPA_IF_P2P_GROUP - P2P Group interface (will become either
1928 * WPA_IF_P2P_GO or WPA_IF_P2P_CLIENT, but the role is not yet known)
1929 */
1930 WPA_IF_P2P_GROUP,
1931
1932 /**
Sunil Ravia04bd252022-05-02 22:54:18 -07001933 * WPA_IF_P2P_DEVICE - P2P Device interface is used to identify the
Hai Shalom4fbc08f2020-05-18 12:37:00 -07001934 * abstracted P2P Device function in the driver
1935 */
1936 WPA_IF_P2P_DEVICE,
1937
1938 /*
1939 * WPA_IF_MESH - Mesh interface
1940 */
1941 WPA_IF_MESH,
1942
1943 /*
1944 * WPA_IF_TDLS - TDLS offchannel interface (used for pref freq only)
1945 */
1946 WPA_IF_TDLS,
1947
1948 /*
1949 * WPA_IF_IBSS - IBSS interface (used for pref freq only)
1950 */
1951 WPA_IF_IBSS,
1952
1953 /*
1954 * WPA_IF_NAN - NAN Device
1955 */
1956 WPA_IF_NAN,
1957
1958 /* keep last */
1959 WPA_IF_MAX
1960};
1961
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001962/**
1963 * struct wpa_driver_capa - Driver capability information
1964 */
1965struct wpa_driver_capa {
1966#define WPA_DRIVER_CAPA_KEY_MGMT_WPA 0x00000001
1967#define WPA_DRIVER_CAPA_KEY_MGMT_WPA2 0x00000002
1968#define WPA_DRIVER_CAPA_KEY_MGMT_WPA_PSK 0x00000004
1969#define WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK 0x00000008
1970#define WPA_DRIVER_CAPA_KEY_MGMT_WPA_NONE 0x00000010
1971#define WPA_DRIVER_CAPA_KEY_MGMT_FT 0x00000020
1972#define WPA_DRIVER_CAPA_KEY_MGMT_FT_PSK 0x00000040
Dmitry Shmidtd5e49232012-12-03 15:08:10 -08001973#define WPA_DRIVER_CAPA_KEY_MGMT_WAPI_PSK 0x00000080
Dmitry Shmidt807291d2015-01-27 13:40:23 -08001974#define WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B 0x00000100
1975#define WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B_192 0x00000200
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001976#define WPA_DRIVER_CAPA_KEY_MGMT_OWE 0x00000400
1977#define WPA_DRIVER_CAPA_KEY_MGMT_DPP 0x00000800
1978#define WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA256 0x00001000
1979#define WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA384 0x00002000
1980#define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA256 0x00004000
1981#define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA384 0x00008000
Hai Shalom74f70d42019-02-11 14:42:39 -08001982#define WPA_DRIVER_CAPA_KEY_MGMT_SAE 0x00010000
Tanmay Garga7fd80d2020-05-18 15:52:44 +05301983#define WPA_DRIVER_CAPA_KEY_MGMT_802_1X_SHA256 0x00020000
1984#define WPA_DRIVER_CAPA_KEY_MGMT_PSK_SHA256 0x00040000
1985#define WPA_DRIVER_CAPA_KEY_MGMT_TPK_HANDSHAKE 0x00080000
1986#define WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE 0x00100000
1987#define WPA_DRIVER_CAPA_KEY_MGMT_FT_802_1X_SHA384 0x00200000
1988#define WPA_DRIVER_CAPA_KEY_MGMT_CCKM 0x00400000
1989#define WPA_DRIVER_CAPA_KEY_MGMT_OSEN 0x00800000
Sunil Ravi89eba102022-09-13 21:04:37 -07001990#define WPA_DRIVER_CAPA_KEY_MGMT_SAE_EXT_KEY 0x01000000
1991#define WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE_EXT_KEY 0x02000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001992 /** Bitfield of supported key management suites */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001993 unsigned int key_mgmt;
Hai Shalom4fbc08f2020-05-18 12:37:00 -07001994 unsigned int key_mgmt_iftype[WPA_IF_MAX];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001995
1996#define WPA_DRIVER_CAPA_ENC_WEP40 0x00000001
1997#define WPA_DRIVER_CAPA_ENC_WEP104 0x00000002
1998#define WPA_DRIVER_CAPA_ENC_TKIP 0x00000004
1999#define WPA_DRIVER_CAPA_ENC_CCMP 0x00000008
Dmitry Shmidt04949592012-07-19 12:16:46 -07002000#define WPA_DRIVER_CAPA_ENC_WEP128 0x00000010
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07002001#define WPA_DRIVER_CAPA_ENC_GCMP 0x00000020
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08002002#define WPA_DRIVER_CAPA_ENC_GCMP_256 0x00000040
2003#define WPA_DRIVER_CAPA_ENC_CCMP_256 0x00000080
2004#define WPA_DRIVER_CAPA_ENC_BIP 0x00000100
2005#define WPA_DRIVER_CAPA_ENC_BIP_GMAC_128 0x00000200
2006#define WPA_DRIVER_CAPA_ENC_BIP_GMAC_256 0x00000400
2007#define WPA_DRIVER_CAPA_ENC_BIP_CMAC_256 0x00000800
Dmitry Shmidtf21452a2014-02-26 10:55:25 -08002008#define WPA_DRIVER_CAPA_ENC_GTK_NOT_USED 0x00001000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002009 /** Bitfield of supported cipher suites */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002010 unsigned int enc;
2011
2012#define WPA_DRIVER_AUTH_OPEN 0x00000001
2013#define WPA_DRIVER_AUTH_SHARED 0x00000002
2014#define WPA_DRIVER_AUTH_LEAP 0x00000004
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002015 /** Bitfield of supported IEEE 802.11 authentication algorithms */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002016 unsigned int auth;
2017
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002018/** Driver generated WPA/RSN IE */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002019#define WPA_DRIVER_FLAGS_DRIVER_IE 0x00000001
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002020/** Driver needs static WEP key setup after association command */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002021#define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC 0x00000002
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002022/** Driver takes care of all DFS operations */
Dmitry Shmidtd11f0192014-03-24 12:09:47 -07002023#define WPA_DRIVER_FLAGS_DFS_OFFLOAD 0x00000004
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002024/** Driver takes care of RSN 4-way handshake internally; PMK is configured with
Hai Shalomfdcde762020-04-02 11:19:20 -07002025 * struct wpa_driver_ops::set_key using key_flag = KEY_FLAG_PMK */
Hai Shalom74f70d42019-02-11 14:42:39 -08002026#define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X 0x00000008
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002027/** Driver is for a wired Ethernet interface */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002028#define WPA_DRIVER_FLAGS_WIRED 0x00000010
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002029/** Driver provides separate commands for authentication and association (SME in
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002030 * wpa_supplicant). */
2031#define WPA_DRIVER_FLAGS_SME 0x00000020
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002032/** Driver supports AP mode */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002033#define WPA_DRIVER_FLAGS_AP 0x00000040
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002034/** Driver needs static WEP key setup after association has been completed */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002035#define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE 0x00000080
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002036/** Driver supports dynamic HT 20/40 MHz channel changes during BSS lifetime */
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07002037#define WPA_DRIVER_FLAGS_HT_2040_COEX 0x00000100
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002038/** Driver supports concurrent P2P operations */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002039#define WPA_DRIVER_FLAGS_P2P_CONCURRENT 0x00000200
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002040/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002041 * Driver uses the initial interface as a dedicated management interface, i.e.,
2042 * it cannot be used for P2P group operations or non-P2P purposes.
2043 */
2044#define WPA_DRIVER_FLAGS_P2P_DEDICATED_INTERFACE 0x00000400
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002045/** This interface is P2P capable (P2P GO or P2P Client) */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002046#define WPA_DRIVER_FLAGS_P2P_CAPABLE 0x00000800
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002047/** Driver supports station and key removal when stopping an AP */
Dmitry Shmidta38abf92014-03-06 13:38:44 -08002048#define WPA_DRIVER_FLAGS_AP_TEARDOWN_SUPPORT 0x00001000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002049/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002050 * Driver uses the initial interface for P2P management interface and non-P2P
2051 * purposes (e.g., connect to infra AP), but this interface cannot be used for
2052 * P2P group operations.
2053 */
2054#define WPA_DRIVER_FLAGS_P2P_MGMT_AND_NON_P2P 0x00002000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002055/**
Hai Shalomc1a21442022-02-04 13:43:00 -08002056 * Driver is known to use valid error codes, i.e., when it indicates that
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002057 * something (e.g., association) fails, there was indeed a failure and the
2058 * operation does not end up getting completed successfully later.
2059 */
Hai Shalomc1a21442022-02-04 13:43:00 -08002060#define WPA_DRIVER_FLAGS_VALID_ERROR_CODES 0x00004000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002061/** Driver supports off-channel TX */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002062#define WPA_DRIVER_FLAGS_OFFCHANNEL_TX 0x00008000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002063/** Driver indicates TX status events for EAPOL Data frames */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002064#define WPA_DRIVER_FLAGS_EAPOL_TX_STATUS 0x00010000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002065/** Driver indicates TX status events for Deauth/Disassoc frames */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002066#define WPA_DRIVER_FLAGS_DEAUTH_TX_STATUS 0x00020000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002067/** Driver supports roaming (BSS selection) in firmware */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002068#define WPA_DRIVER_FLAGS_BSS_SELECTION 0x00040000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002069/** Driver supports operating as a TDLS peer */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002070#define WPA_DRIVER_FLAGS_TDLS_SUPPORT 0x00080000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002071/** Driver requires external TDLS setup/teardown/discovery */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002072#define WPA_DRIVER_FLAGS_TDLS_EXTERNAL_SETUP 0x00100000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002073/** Driver indicates support for Probe Response offloading in AP mode */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002074#define WPA_DRIVER_FLAGS_PROBE_RESP_OFFLOAD 0x00200000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002075/** Driver supports U-APSD in AP mode */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002076#define WPA_DRIVER_FLAGS_AP_UAPSD 0x00400000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002077/** Driver supports inactivity timer in AP mode */
Dmitry Shmidt04949592012-07-19 12:16:46 -07002078#define WPA_DRIVER_FLAGS_INACTIVITY_TIMER 0x00800000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002079/** Driver expects user space implementation of MLME in AP mode */
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07002080#define WPA_DRIVER_FLAGS_AP_MLME 0x01000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002081/** Driver supports SAE with user space SME */
Dmitry Shmidtd5e49232012-12-03 15:08:10 -08002082#define WPA_DRIVER_FLAGS_SAE 0x02000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002083/** Driver makes use of OBSS scan mechanism in wpa_supplicant */
Dmitry Shmidtd5e49232012-12-03 15:08:10 -08002084#define WPA_DRIVER_FLAGS_OBSS_SCAN 0x04000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002085/** Driver supports IBSS (Ad-hoc) mode */
Dmitry Shmidt700a1372013-03-15 14:14:44 -07002086#define WPA_DRIVER_FLAGS_IBSS 0x08000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002087/** Driver supports radar detection */
Dmitry Shmidtea69e842013-05-13 14:52:28 -07002088#define WPA_DRIVER_FLAGS_RADAR 0x10000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002089/** Driver supports a dedicated interface for P2P Device */
Dmitry Shmidt34af3062013-07-11 10:46:32 -07002090#define WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE 0x20000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002091/** Driver supports QoS Mapping */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08002092#define WPA_DRIVER_FLAGS_QOS_MAPPING 0x40000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002093/** Driver supports CSA in AP mode */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08002094#define WPA_DRIVER_FLAGS_AP_CSA 0x80000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002095/** Driver supports mesh */
2096#define WPA_DRIVER_FLAGS_MESH 0x0000000100000000ULL
2097/** Driver support ACS offload */
2098#define WPA_DRIVER_FLAGS_ACS_OFFLOAD 0x0000000200000000ULL
2099/** Driver supports key management offload */
2100#define WPA_DRIVER_FLAGS_KEY_MGMT_OFFLOAD 0x0000000400000000ULL
2101/** Driver supports TDLS channel switching */
2102#define WPA_DRIVER_FLAGS_TDLS_CHANNEL_SWITCH 0x0000000800000000ULL
Dmitry Shmidtff787d52015-01-12 13:01:47 -08002103/** Driver supports IBSS with HT datarates */
2104#define WPA_DRIVER_FLAGS_HT_IBSS 0x0000001000000000ULL
Dmitry Shmidt7f656022015-02-25 14:36:37 -08002105/** Driver supports IBSS with VHT datarates */
2106#define WPA_DRIVER_FLAGS_VHT_IBSS 0x0000002000000000ULL
Dmitry Shmidtb1e52102015-05-29 12:36:29 -07002107/** Driver supports automatic band selection */
2108#define WPA_DRIVER_FLAGS_SUPPORT_HW_MODE_ANY 0x0000004000000000ULL
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002109/** Driver supports simultaneous off-channel operations */
2110#define WPA_DRIVER_FLAGS_OFFCHANNEL_SIMULTANEOUS 0x0000008000000000ULL
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002111/** Driver supports full AP client state */
2112#define WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE 0x0000010000000000ULL
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07002113/** Driver supports P2P Listen offload */
2114#define WPA_DRIVER_FLAGS_P2P_LISTEN_OFFLOAD 0x0000020000000000ULL
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08002115/** Driver supports FILS */
2116#define WPA_DRIVER_FLAGS_SUPPORT_FILS 0x0000040000000000ULL
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08002117/** Driver supports Beacon frame TX rate configuration (legacy rates) */
2118#define WPA_DRIVER_FLAGS_BEACON_RATE_LEGACY 0x0000080000000000ULL
2119/** Driver supports Beacon frame TX rate configuration (HT rates) */
2120#define WPA_DRIVER_FLAGS_BEACON_RATE_HT 0x0000100000000000ULL
2121/** Driver supports Beacon frame TX rate configuration (VHT rates) */
2122#define WPA_DRIVER_FLAGS_BEACON_RATE_VHT 0x0000200000000000ULL
Dmitry Shmidtebd93af2017-02-21 13:40:44 -08002123/** Driver supports mgmt_tx with random TX address in non-connected state */
2124#define WPA_DRIVER_FLAGS_MGMT_TX_RANDOM_TA 0x0000400000000000ULL
2125/** Driver supports mgmt_tx with random TX addr in connected state */
2126#define WPA_DRIVER_FLAGS_MGMT_TX_RANDOM_TA_CONNECTED 0x0000800000000000ULL
2127/** Driver supports better BSS reporting with sched_scan in connected mode */
2128#define WPA_DRIVER_FLAGS_SCHED_SCAN_RELATIVE_RSSI 0x0001000000000000ULL
2129/** Driver supports HE capabilities */
2130#define WPA_DRIVER_FLAGS_HE_CAPABILITIES 0x0002000000000000ULL
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002131/** Driver supports FILS shared key offload */
2132#define WPA_DRIVER_FLAGS_FILS_SK_OFFLOAD 0x0004000000000000ULL
2133/** Driver supports all OCE STA specific mandatory features */
2134#define WPA_DRIVER_FLAGS_OCE_STA 0x0008000000000000ULL
2135/** Driver supports all OCE AP specific mandatory features */
2136#define WPA_DRIVER_FLAGS_OCE_AP 0x0010000000000000ULL
2137/**
2138 * Driver supports all OCE STA-CFON specific mandatory features only.
2139 * If a driver sets this bit but not the %WPA_DRIVER_FLAGS_OCE_AP, the
2140 * userspace shall assume that this driver may not support all OCE AP
2141 * functionality but can support only OCE STA-CFON functionality.
2142 */
2143#define WPA_DRIVER_FLAGS_OCE_STA_CFON 0x0020000000000000ULL
Roshan Pius3a1667e2018-07-03 15:17:14 -07002144/** Driver supports MFP-optional in the connect command */
2145#define WPA_DRIVER_FLAGS_MFP_OPTIONAL 0x0040000000000000ULL
Hai Shalom39ba6fc2019-01-22 12:40:38 -08002146/** Driver is a self-managed regulatory device */
2147#define WPA_DRIVER_FLAGS_SELF_MANAGED_REGULATORY 0x0080000000000000ULL
Hai Shalom74f70d42019-02-11 14:42:39 -08002148/** Driver supports FTM responder functionality */
2149#define WPA_DRIVER_FLAGS_FTM_RESPONDER 0x0100000000000000ULL
2150/** Driver support 4-way handshake offload for WPA-Personal */
2151#define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK 0x0200000000000000ULL
Hai Shalomb755a2a2020-04-23 21:49:02 -07002152/** Driver supports a separate control port TX for EAPOL frames */
Hai Shalomfdcde762020-04-02 11:19:20 -07002153#define WPA_DRIVER_FLAGS_CONTROL_PORT 0x0400000000000000ULL
2154/** Driver supports VLAN offload */
2155#define WPA_DRIVER_FLAGS_VLAN_OFFLOAD 0x0800000000000000ULL
2156/** Driver supports UPDATE_FT_IES command */
2157#define WPA_DRIVER_FLAGS_UPDATE_FT_IES 0x1000000000000000ULL
2158/** Driver can correctly rekey PTKs without Extended Key ID */
2159#define WPA_DRIVER_FLAGS_SAFE_PTK0_REKEYS 0x2000000000000000ULL
2160/** Driver supports Beacon protection */
2161#define WPA_DRIVER_FLAGS_BEACON_PROTECTION 0x4000000000000000ULL
2162/** Driver supports Extended Key ID */
2163#define WPA_DRIVER_FLAGS_EXTENDED_KEY_ID 0x8000000000000000ULL
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002164 u64 flags;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002165
Hai Shalomb755a2a2020-04-23 21:49:02 -07002166/** Driver supports a separate control port RX for EAPOL frames */
2167#define WPA_DRIVER_FLAGS2_CONTROL_PORT_RX 0x0000000000000001ULL
Hai Shalom899fcc72020-10-19 14:38:18 -07002168/** Driver supports TX status reports for EAPOL frames through control port */
2169#define WPA_DRIVER_FLAGS2_CONTROL_PORT_TX_STATUS 0x0000000000000002ULL
Sunil Ravi89eba102022-09-13 21:04:37 -07002170/** Driver supports secure LTF in AP mode */
2171#define WPA_DRIVER_FLAGS2_SEC_LTF_AP 0x0000000000000004ULL
2172/** Driver supports secure RTT measurement exchange in AP mode */
2173#define WPA_DRIVER_FLAGS2_SEC_RTT_AP 0x0000000000000008ULL
Hai Shalom60840252021-02-19 19:02:11 -08002174/**
2175 * Driver supports protection of range negotiation and measurement management
Sunil Ravi89eba102022-09-13 21:04:37 -07002176 * frames in AP mode
Hai Shalom60840252021-02-19 19:02:11 -08002177 */
Sunil Ravi89eba102022-09-13 21:04:37 -07002178#define WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_AP 0x0000000000000010ULL
Hai Shalom60840252021-02-19 19:02:11 -08002179/** Driver supports Beacon frame TX rate configuration (HE rates) */
2180#define WPA_DRIVER_FLAGS2_BEACON_RATE_HE 0x0000000000000020ULL
2181/** Driver supports Beacon protection only in client mode */
2182#define WPA_DRIVER_FLAGS2_BEACON_PROTECTION_CLIENT 0x0000000000000040ULL
2183/** Driver supports Operating Channel Validation */
2184#define WPA_DRIVER_FLAGS2_OCV 0x0000000000000080ULL
2185/** Driver expects user space implementation of SME in AP mode */
2186#define WPA_DRIVER_FLAGS2_AP_SME 0x0000000000000100ULL
Sunil Ravia04bd252022-05-02 22:54:18 -07002187/** Driver handles SA Query procedures in AP mode */
2188#define WPA_DRIVER_FLAGS2_SA_QUERY_OFFLOAD_AP 0x0000000000000200ULL
2189/** Driver supports background radar/CAC detection */
2190#define WPA_DRIVER_RADAR_BACKGROUND 0x0000000000000400ULL
Sunil Ravi89eba102022-09-13 21:04:37 -07002191/** Driver supports secure LTF in STA mode */
2192#define WPA_DRIVER_FLAGS2_SEC_LTF_STA 0x0000000000000800ULL
2193/** Driver supports secure RTT measurement exchange in STA mode */
2194#define WPA_DRIVER_FLAGS2_SEC_RTT_STA 0x0000000000001000ULL
2195/**
2196 * Driver supports protection of range negotiation and measurement management
2197 * frames in STA mode
2198 */
2199#define WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_STA 0x0000000000002000ULL
Sunil Ravi77d572f2023-01-17 23:58:31 +00002200/** Driver supports MLO in station/AP mode */
2201#define WPA_DRIVER_FLAGS2_MLO 0x0000000000004000ULL
Hai Shalomb755a2a2020-04-23 21:49:02 -07002202 u64 flags2;
2203
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002204#define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \
2205 (drv_flags & WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE)
2206
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002207 unsigned int wmm_ac_supported:1;
2208
2209 unsigned int mac_addr_rand_scan_supported:1;
2210 unsigned int mac_addr_rand_sched_scan_supported:1;
2211
2212 /** Maximum number of supported active probe SSIDs */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002213 int max_scan_ssids;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002214
2215 /** Maximum number of supported active probe SSIDs for sched_scan */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002216 int max_sched_scan_ssids;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002217
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08002218 /** Maximum number of supported scan plans for scheduled scan */
2219 unsigned int max_sched_scan_plans;
2220
2221 /** Maximum interval in a scan plan. In seconds */
2222 u32 max_sched_scan_plan_interval;
2223
2224 /** Maximum number of iterations in a single scan plan */
2225 u32 max_sched_scan_plan_iterations;
2226
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002227 /** Whether sched_scan (offloaded scanning) is supported */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002228 int sched_scan_supported;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002229
2230 /** Maximum number of supported match sets for sched_scan */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002231 int max_match_sets;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002232
2233 /**
2234 * max_remain_on_chan - Maximum remain-on-channel duration in msec
2235 */
2236 unsigned int max_remain_on_chan;
2237
2238 /**
2239 * max_stations - Maximum number of associated stations the driver
2240 * supports in AP mode
2241 */
2242 unsigned int max_stations;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002243
2244 /**
2245 * probe_resp_offloads - Bitmap of supported protocols by the driver
2246 * for Probe Response offloading.
2247 */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002248/** Driver Probe Response offloading support for WPS ver. 1 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002249#define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS 0x00000001
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002250/** Driver Probe Response offloading support for WPS ver. 2 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002251#define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS2 0x00000002
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002252/** Driver Probe Response offloading support for P2P */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002253#define WPA_DRIVER_PROBE_RESP_OFFLOAD_P2P 0x00000004
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002254/** Driver Probe Response offloading support for IEEE 802.11u (Interworking) */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002255#define WPA_DRIVER_PROBE_RESP_OFFLOAD_INTERWORKING 0x00000008
2256 unsigned int probe_resp_offloads;
Dmitry Shmidt444d5672013-04-01 13:08:44 -07002257
Dmitry Shmidt8bae4132013-06-06 11:25:10 -07002258 unsigned int max_acl_mac_addrs;
2259
Dmitry Shmidt444d5672013-04-01 13:08:44 -07002260 /**
Dmitry Shmidtc2ebb4b2013-07-24 12:57:51 -07002261 * Number of supported concurrent channels
2262 */
2263 unsigned int num_multichan_concurrent;
2264
2265 /**
Dmitry Shmidt444d5672013-04-01 13:08:44 -07002266 * extended_capa - extended capabilities in driver/device
2267 *
2268 * Must be allocated and freed by driver and the pointers must be
2269 * valid for the lifetime of the driver, i.e., freed in deinit()
2270 */
2271 const u8 *extended_capa, *extended_capa_mask;
2272 unsigned int extended_capa_len;
Dmitry Shmidtb58836e2014-04-29 14:35:56 -07002273
2274 struct wowlan_triggers wowlan_triggers;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002275
2276/** Driver adds the DS Params Set IE in Probe Request frames */
2277#define WPA_DRIVER_FLAGS_DS_PARAM_SET_IE_IN_PROBES 0x00000001
2278/** Driver adds the WFA TPC IE in Probe Request frames */
2279#define WPA_DRIVER_FLAGS_WFA_TPC_IE_IN_PROBES 0x00000002
2280/** Driver handles quiet period requests */
2281#define WPA_DRIVER_FLAGS_QUIET 0x00000004
2282/**
2283 * Driver is capable of inserting the current TX power value into the body of
2284 * transmitted frames.
2285 * Background: Some Action frames include a TPC Report IE. This IE contains a
2286 * TX power field, which has to be updated by lower layers. One such Action
2287 * frame is Link Measurement Report (part of RRM). Another is TPC Report (part
2288 * of spectrum management). Note that this insertion takes place at a fixed
2289 * offset, namely the 6th byte in the Action frame body.
2290 */
2291#define WPA_DRIVER_FLAGS_TX_POWER_INSERTION 0x00000008
Dmitry Shmidt849734c2016-05-27 09:59:01 -07002292/**
2293 * Driver supports RRM. With this support, the driver will accept to use RRM in
2294 * (Re)Association Request frames, without supporting quiet period.
2295 */
2296#define WPA_DRIVER_FLAGS_SUPPORT_RRM 0x00000010
2297
Dmitry Shmidt29333592017-01-09 12:27:11 -08002298/** Driver supports setting the scan dwell time */
2299#define WPA_DRIVER_FLAGS_SUPPORT_SET_SCAN_DWELL 0x00000020
2300/** Driver supports Beacon Report Measurement */
2301#define WPA_DRIVER_FLAGS_SUPPORT_BEACON_REPORT 0x00000040
2302
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002303 u32 rrm_flags;
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002304
2305 /* Driver concurrency capabilities */
2306 unsigned int conc_capab;
2307 /* Maximum number of concurrent channels on 2.4 GHz */
2308 unsigned int max_conc_chan_2_4;
2309 /* Maximum number of concurrent channels on 5 GHz */
2310 unsigned int max_conc_chan_5_0;
2311
2312 /* Maximum number of supported CSA counters */
2313 u16 max_csa_counters;
Sunil Ravi89eba102022-09-13 21:04:37 -07002314
2315 /* Maximum number of supported AKM suites in commands */
2316 unsigned int max_num_akms;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002317
2318 /* Maximum number of interfaces supported for MBSSID advertisement */
2319 unsigned int mbssid_max_interfaces;
2320 /* Maximum profile periodicity for enhanced MBSSID advertisement */
2321 unsigned int ema_max_periodicity;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002322};
2323
2324
2325struct hostapd_data;
2326
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002327#define STA_DRV_DATA_TX_MCS BIT(0)
2328#define STA_DRV_DATA_RX_MCS BIT(1)
2329#define STA_DRV_DATA_TX_VHT_MCS BIT(2)
2330#define STA_DRV_DATA_RX_VHT_MCS BIT(3)
2331#define STA_DRV_DATA_TX_VHT_NSS BIT(4)
2332#define STA_DRV_DATA_RX_VHT_NSS BIT(5)
2333#define STA_DRV_DATA_TX_SHORT_GI BIT(6)
2334#define STA_DRV_DATA_RX_SHORT_GI BIT(7)
Roshan Pius3a1667e2018-07-03 15:17:14 -07002335#define STA_DRV_DATA_LAST_ACK_RSSI BIT(8)
Hai Shalomc1a21442022-02-04 13:43:00 -08002336#define STA_DRV_DATA_CONN_TIME BIT(9)
Sunil Ravi77d572f2023-01-17 23:58:31 +00002337#define STA_DRV_DATA_TX_HE_MCS BIT(10)
2338#define STA_DRV_DATA_RX_HE_MCS BIT(11)
2339#define STA_DRV_DATA_TX_HE_NSS BIT(12)
2340#define STA_DRV_DATA_RX_HE_NSS BIT(13)
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002341
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002342struct hostap_sta_driver_data {
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002343 unsigned long rx_packets, tx_packets;
2344 unsigned long long rx_bytes, tx_bytes;
Hai Shalom81f62d82019-07-22 12:10:00 -07002345 unsigned long long rx_airtime, tx_airtime;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002346 unsigned long long beacons_count;
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002347 int bytes_64bit; /* whether 64-bit byte counters are supported */
Sunil Ravi77d572f2023-01-17 23:58:31 +00002348 unsigned long current_tx_rate; /* in kbps */
2349 unsigned long current_rx_rate; /* in kbps */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002350 unsigned long inactive_msec;
Hai Shalomc1a21442022-02-04 13:43:00 -08002351 unsigned long connected_sec;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002352 unsigned long flags; /* bitfield of STA_DRV_DATA_* */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002353 unsigned long num_ps_buf_frames;
2354 unsigned long tx_retry_failed;
2355 unsigned long tx_retry_count;
Roshan Pius3a1667e2018-07-03 15:17:14 -07002356 s8 last_ack_rssi;
Hai Shalom81f62d82019-07-22 12:10:00 -07002357 unsigned long backlog_packets;
2358 unsigned long backlog_bytes;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002359 unsigned long fcs_error_count;
2360 unsigned long beacon_loss_count;
2361 unsigned long expected_throughput;
2362 unsigned long rx_drop_misc;
2363 unsigned long rx_mpdus;
2364 int signal; /* dBm; or -WPA_INVALID_NOISE */
2365 u8 rx_hemcs;
2366 u8 tx_hemcs;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002367 u8 rx_vhtmcs;
2368 u8 tx_vhtmcs;
2369 u8 rx_mcs;
2370 u8 tx_mcs;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002371 u8 rx_he_nss;
2372 u8 tx_he_nss;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002373 u8 rx_vht_nss;
2374 u8 tx_vht_nss;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002375 s8 avg_signal; /* dBm */
2376 s8 avg_beacon_signal; /* dBm */
2377 s8 avg_ack_signal; /* dBm */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002378};
2379
2380struct hostapd_sta_add_params {
2381 const u8 *addr;
2382 u16 aid;
2383 u16 capability;
2384 const u8 *supp_rates;
2385 size_t supp_rates_len;
2386 u16 listen_interval;
2387 const struct ieee80211_ht_capabilities *ht_capabilities;
Dmitry Shmidta54fa5f2013-01-15 13:53:35 -08002388 const struct ieee80211_vht_capabilities *vht_capabilities;
Dmitry Shmidtbd14a572014-02-18 10:33:49 -08002389 int vht_opmode_enabled;
2390 u8 vht_opmode;
Hai Shalom81f62d82019-07-22 12:10:00 -07002391 const struct ieee80211_he_capabilities *he_capab;
2392 size_t he_capab_len;
Hai Shalom4fbc08f2020-05-18 12:37:00 -07002393 const struct ieee80211_he_6ghz_band_cap *he_6ghz_capab;
Sunil Ravia04bd252022-05-02 22:54:18 -07002394 const struct ieee80211_eht_capabilities *eht_capab;
2395 size_t eht_capab_len;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002396 u32 flags; /* bitmask of WPA_STA_* flags */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002397 u32 flags_mask; /* unset bits in flags */
2398#ifdef CONFIG_MESH
2399 enum mesh_plink_state plink_state;
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07002400 u16 peer_aid;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002401#endif /* CONFIG_MESH */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002402 int set; /* Set STA parameters instead of add */
2403 u8 qosinfo;
Dmitry Shmidtf8623282013-02-20 14:34:59 -08002404 const u8 *ext_capab;
2405 size_t ext_capab_len;
Dmitry Shmidt344abd32014-01-14 13:17:00 -08002406 const u8 *supp_channels;
2407 size_t supp_channels_len;
2408 const u8 *supp_oper_classes;
2409 size_t supp_oper_classes_len;
Dmitry Shmidt849734c2016-05-27 09:59:01 -07002410 int support_p2p_ps;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002411};
2412
Dmitry Shmidt8bae4132013-06-06 11:25:10 -07002413struct mac_address {
2414 u8 addr[ETH_ALEN];
2415};
2416
2417struct hostapd_acl_params {
2418 u8 acl_policy;
2419 unsigned int num_mac_acl;
2420 struct mac_address mac_acl[0];
2421};
2422
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002423struct wpa_init_params {
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002424 void *global_priv;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002425 const u8 *bssid;
2426 const char *ifname;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002427 const char *driver_params;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002428 int use_pae_group_addr;
2429 char **bridge;
2430 size_t num_bridge;
2431
2432 u8 *own_addr; /* buffer for writing own MAC address */
2433};
2434
2435
2436struct wpa_bss_params {
2437 /** Interface name (for multi-SSID/VLAN support) */
2438 const char *ifname;
2439 /** Whether IEEE 802.1X or WPA/WPA2 is enabled */
2440 int enabled;
2441
2442 int wpa;
2443 int ieee802_1x;
2444 int wpa_group;
2445 int wpa_pairwise;
2446 int wpa_key_mgmt;
2447 int rsn_preauth;
2448 enum mfp_options ieee80211w;
2449};
2450
2451#define WPA_STA_AUTHORIZED BIT(0)
2452#define WPA_STA_WMM BIT(1)
2453#define WPA_STA_SHORT_PREAMBLE BIT(2)
2454#define WPA_STA_MFP BIT(3)
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002455#define WPA_STA_TDLS_PEER BIT(4)
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002456#define WPA_STA_AUTHENTICATED BIT(5)
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002457#define WPA_STA_ASSOCIATED BIT(6)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002458
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002459enum tdls_oper {
2460 TDLS_DISCOVERY_REQ,
2461 TDLS_SETUP,
2462 TDLS_TEARDOWN,
2463 TDLS_ENABLE_LINK,
2464 TDLS_DISABLE_LINK,
2465 TDLS_ENABLE,
2466 TDLS_DISABLE
2467};
2468
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07002469enum wnm_oper {
2470 WNM_SLEEP_ENTER_CONFIRM,
2471 WNM_SLEEP_ENTER_FAIL,
2472 WNM_SLEEP_EXIT_CONFIRM,
2473 WNM_SLEEP_EXIT_FAIL,
2474 WNM_SLEEP_TFS_REQ_IE_ADD, /* STA requests driver to add TFS req IE */
2475 WNM_SLEEP_TFS_REQ_IE_NONE, /* STA requests empty TFS req IE */
2476 WNM_SLEEP_TFS_REQ_IE_SET, /* AP requests driver to set TFS req IE for
2477 * a STA */
2478 WNM_SLEEP_TFS_RESP_IE_ADD, /* AP requests driver to add TFS resp IE
2479 * for a STA */
2480 WNM_SLEEP_TFS_RESP_IE_NONE, /* AP requests empty TFS resp IE */
2481 WNM_SLEEP_TFS_RESP_IE_SET, /* AP requests driver to set TFS resp IE
2482 * for a STA */
2483 WNM_SLEEP_TFS_IE_DEL /* AP delete the TFS IE */
2484};
2485
Roshan Pius3a1667e2018-07-03 15:17:14 -07002486/* enum smps_mode - SMPS mode definitions */
2487enum smps_mode {
2488 SMPS_AUTOMATIC,
2489 SMPS_OFF,
2490 SMPS_DYNAMIC,
2491 SMPS_STATIC,
2492
2493 /* Keep last */
2494 SMPS_INVALID,
2495};
2496
Hai Shalom74f70d42019-02-11 14:42:39 -08002497#define WPA_INVALID_NOISE 9999
Dmitry Shmidt34af3062013-07-11 10:46:32 -07002498
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002499/**
2500 * struct wpa_signal_info - Information about channel signal quality
Hai Shalom74f70d42019-02-11 14:42:39 -08002501 * @frequency: control frequency
2502 * @above_threshold: true if the above threshold was crossed
2503 * (relevant for a CQM event)
Sunil Ravi77d572f2023-01-17 23:58:31 +00002504 * @data: STA information
Hai Shalom74f70d42019-02-11 14:42:39 -08002505 * @current_noise: %WPA_INVALID_NOISE if not supported
Hai Shalom74f70d42019-02-11 14:42:39 -08002506 * @chanwidth: channel width
2507 * @center_frq1: center frequency for the first segment
2508 * @center_frq2: center frequency for the second segment (if relevant)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002509 */
2510struct wpa_signal_info {
2511 u32 frequency;
2512 int above_threshold;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002513 struct hostap_sta_driver_data data;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002514 int current_noise;
Dmitry Shmidt34af3062013-07-11 10:46:32 -07002515 enum chan_width chanwidth;
2516 int center_frq1;
2517 int center_frq2;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002518};
2519
Sunil Ravi89eba102022-09-13 21:04:37 -07002520struct wpa_mlo_signal_info {
2521 u16 valid_links;
2522 struct wpa_signal_info links[MAX_NUM_MLD_LINKS];
2523};
2524
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002525/**
Hai Shalom74f70d42019-02-11 14:42:39 -08002526 * struct wpa_channel_info - Information about the current channel
2527 * @frequency: Center frequency of the primary 20 MHz channel
2528 * @chanwidth: Width of the current operating channel
2529 * @sec_channel: Location of the secondary 20 MHz channel (either +1 or -1).
2530 * This field is only filled in when using a 40 MHz channel.
2531 * @center_frq1: Center frequency of frequency segment 0
2532 * @center_frq2: Center frequency of frequency segment 1 (for 80+80 channels)
2533 * @seg1_idx: Frequency segment 1 index when using a 80+80 channel. This is
2534 * derived from center_frq2 for convenience.
2535 */
2536struct wpa_channel_info {
2537 u32 frequency;
2538 enum chan_width chanwidth;
2539 int sec_channel;
2540 int center_frq1;
2541 int center_frq2;
2542 u8 seg1_idx;
2543};
2544
2545/**
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002546 * struct beacon_data - Beacon data
2547 * @head: Head portion of Beacon frame (before TIM IE)
2548 * @tail: Tail portion of Beacon frame (after TIM IE)
2549 * @beacon_ies: Extra information element(s) to add into Beacon frames or %NULL
2550 * @proberesp_ies: Extra information element(s) to add into Probe Response
2551 * frames or %NULL
2552 * @assocresp_ies: Extra information element(s) to add into (Re)Association
2553 * Response frames or %NULL
2554 * @probe_resp: Probe Response frame template
2555 * @head_len: Length of @head
2556 * @tail_len: Length of @tail
2557 * @beacon_ies_len: Length of beacon_ies in octets
2558 * @proberesp_ies_len: Length of proberesp_ies in octets
2559 * @proberesp_ies_len: Length of proberesp_ies in octets
2560 * @probe_resp_len: Length of probe response template (@probe_resp)
2561 */
2562struct beacon_data {
2563 u8 *head, *tail;
2564 u8 *beacon_ies;
2565 u8 *proberesp_ies;
2566 u8 *assocresp_ies;
2567 u8 *probe_resp;
2568
2569 size_t head_len, tail_len;
2570 size_t beacon_ies_len;
2571 size_t proberesp_ies_len;
2572 size_t assocresp_ies_len;
2573 size_t probe_resp_len;
2574};
2575
2576/**
2577 * struct csa_settings - Settings for channel switch command
2578 * @cs_count: Count in Beacon frames (TBTT) to perform the switch
2579 * @block_tx: 1 - block transmission for CSA period
2580 * @freq_params: Next channel frequency parameter
2581 * @beacon_csa: Beacon/probe resp/asooc resp info for CSA period
2582 * @beacon_after: Next beacon/probe resp/asooc resp info
2583 * @counter_offset_beacon: Offset to the count field in beacon's tail
2584 * @counter_offset_presp: Offset to the count field in probe resp.
2585 */
2586struct csa_settings {
2587 u8 cs_count;
2588 u8 block_tx;
2589
2590 struct hostapd_freq_params freq_params;
2591 struct beacon_data beacon_csa;
2592 struct beacon_data beacon_after;
2593
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002594 u16 counter_offset_beacon[2];
2595 u16 counter_offset_presp[2];
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002596};
2597
Sunil Ravia04bd252022-05-02 22:54:18 -07002598/**
2599 * struct cca_settings - Settings for color switch command
2600 * @cca_count: Count in Beacon frames (TBTT) to perform the switch
2601 * @cca_color: The new color that we are switching to
2602 * @beacon_cca: Beacon/Probe Response/(Re)Association Response frame info for
2603 * color switch period
2604 * @beacon_after: Next Beacon/Probe Response/(Re)Association Response frame info
2605 * @counter_offset_beacon: Offset to the count field in Beacon frame tail
2606 * @counter_offset_presp: Offset to the count field in Probe Response frame
2607 */
2608struct cca_settings {
2609 u8 cca_count;
2610 u8 cca_color;
2611
2612 struct beacon_data beacon_cca;
2613 struct beacon_data beacon_after;
2614
2615 u16 counter_offset_beacon;
2616 u16 counter_offset_presp;
2617};
2618
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07002619/* TDLS peer capabilities for send_tdls_mgmt() */
2620enum tdls_peer_capability {
2621 TDLS_PEER_HT = BIT(0),
2622 TDLS_PEER_VHT = BIT(1),
2623 TDLS_PEER_WMM = BIT(2),
Hai Shalomc1a21442022-02-04 13:43:00 -08002624 TDLS_PEER_HE = BIT(3),
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07002625};
2626
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002627/* valid info in the wmm_params struct */
2628enum wmm_params_valid_info {
2629 WMM_PARAMS_UAPSD_QUEUES_INFO = BIT(0),
2630};
2631
2632/**
2633 * struct wmm_params - WMM parameterss configured for this association
2634 * @info_bitmap: Bitmap of valid wmm_params info; indicates what fields
2635 * of the struct contain valid information.
2636 * @uapsd_queues: Bitmap of ACs configured for uapsd (valid only if
2637 * %WMM_PARAMS_UAPSD_QUEUES_INFO is set)
2638 */
2639struct wmm_params {
2640 u8 info_bitmap;
2641 u8 uapsd_queues;
2642};
2643
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07002644#ifdef CONFIG_MACSEC
2645struct macsec_init_params {
Hai Shalome21d4e82020-04-29 16:34:06 -07002646 bool always_include_sci;
2647 bool use_es;
2648 bool use_scb;
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07002649};
2650#endif /* CONFIG_MACSEC */
2651
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002652enum drv_br_port_attr {
2653 DRV_BR_PORT_ATTR_PROXYARP,
2654 DRV_BR_PORT_ATTR_HAIRPIN_MODE,
2655};
2656
2657enum drv_br_net_param {
2658 DRV_BR_NET_PARAM_GARP_ACCEPT,
Dmitry Shmidt83474442015-04-15 13:47:09 -07002659 DRV_BR_MULTICAST_SNOOPING,
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002660};
2661
2662struct drv_acs_params {
2663 /* Selected mode (HOSTAPD_MODE_*) */
2664 enum hostapd_hw_mode hw_mode;
2665
2666 /* Indicates whether HT is enabled */
2667 int ht_enabled;
2668
2669 /* Indicates whether HT40 is enabled */
2670 int ht40_enabled;
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07002671
2672 /* Indicates whether VHT is enabled */
2673 int vht_enabled;
2674
2675 /* Configured ACS channel width */
2676 u16 ch_width;
2677
Ahmed ElArabawy0ff61c52019-12-26 12:38:39 -08002678 /* ACS frequency list info */
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002679 const int *freq_list;
Hai Shalomfdcde762020-04-02 11:19:20 -07002680
2681 /* Indicates whether EDMG is enabled */
2682 int edmg_enabled;
Sunil Ravia04bd252022-05-02 22:54:18 -07002683
2684 /* Indicates whether EHT is enabled */
2685 bool eht_enabled;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002686};
2687
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002688struct wpa_bss_trans_info {
2689 u8 mbo_transition_reason;
2690 u8 n_candidates;
2691 u8 *bssid;
2692};
2693
2694struct wpa_bss_candidate_info {
2695 u8 num;
2696 struct candidate_list {
2697 u8 bssid[ETH_ALEN];
2698 u8 is_accept;
2699 u32 reject_reason;
2700 } *candidates;
2701};
2702
2703struct wpa_pmkid_params {
2704 const u8 *bssid;
2705 const u8 *ssid;
2706 size_t ssid_len;
2707 const u8 *fils_cache_id;
2708 const u8 *pmkid;
2709 const u8 *pmk;
2710 size_t pmk_len;
Hai Shalomfdcde762020-04-02 11:19:20 -07002711 u32 pmk_lifetime;
2712 u8 pmk_reauth_threshold;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002713};
2714
2715/* Mask used to specify which connection parameters have to be updated */
2716enum wpa_drv_update_connect_params_mask {
2717 WPA_DRV_UPDATE_ASSOC_IES = BIT(0),
2718 WPA_DRV_UPDATE_FILS_ERP_INFO = BIT(1),
2719 WPA_DRV_UPDATE_AUTH_TYPE = BIT(2),
Winnie Chen4138eec2022-11-10 16:32:53 +08002720#if defined(CONFIG_DRIVER_NL80211_BRCM) || defined(CONFIG_DRIVER_NL80211_SYNA)
Vinayak Yadawade62409f2022-01-20 12:32:07 +05302721 WPA_DRV_UPDATE_TD_POLICY = BIT(3),
Winnie Chen4138eec2022-11-10 16:32:53 +08002722#endif /* CONFIG_DRIVER_NL80211_BRCM || CONFIG_DRIVER_NL80211_SYNA */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002723};
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07002724
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002725/**
Roshan Pius3a1667e2018-07-03 15:17:14 -07002726 * struct external_auth - External authentication trigger parameters
2727 *
2728 * These are used across the external authentication request and event
2729 * interfaces.
2730 * @action: Action type / trigger for external authentication. Only significant
2731 * for the event interface.
2732 * @bssid: BSSID of the peer with which the authentication has to happen. Used
2733 * by both the request and event interface.
2734 * @ssid: SSID of the AP. Used by both the request and event interface.
2735 * @ssid_len: SSID length in octets.
2736 * @key_mgmt_suite: AKM suite of the respective authentication. Optional for
2737 * the request interface.
2738 * @status: Status code, %WLAN_STATUS_SUCCESS for successful authentication,
2739 * use %WLAN_STATUS_UNSPECIFIED_FAILURE if wpa_supplicant cannot give
2740 * the real status code for failures. Used only for the request interface
2741 * from user space to the driver.
Hai Shalom5f92bc92019-04-18 11:54:11 -07002742 * @pmkid: Generated PMKID as part of external auth exchange (e.g., SAE).
Roshan Pius3a1667e2018-07-03 15:17:14 -07002743 */
2744struct external_auth {
2745 enum {
2746 EXT_AUTH_START,
2747 EXT_AUTH_ABORT,
2748 } action;
Hai Shalom5f92bc92019-04-18 11:54:11 -07002749 const u8 *bssid;
2750 const u8 *ssid;
Roshan Pius3a1667e2018-07-03 15:17:14 -07002751 size_t ssid_len;
2752 unsigned int key_mgmt_suite;
2753 u16 status;
Hai Shalom5f92bc92019-04-18 11:54:11 -07002754 const u8 *pmkid;
Roshan Pius3a1667e2018-07-03 15:17:14 -07002755};
2756
Sunil Ravi89eba102022-09-13 21:04:37 -07002757#define WPAS_MAX_PASN_PEERS 10
2758
2759enum pasn_status {
2760 PASN_STATUS_SUCCESS = 0,
2761 PASN_STATUS_FAILURE = 1,
2762};
2763
2764/**
2765 * struct pasn_peer - PASN peer parameters
2766 *
2767 * Used to process the PASN authentication event from the driver to
2768 * userspace and to send a response back.
2769 * @own_addr: Own MAC address specified by the driver to use for PASN
2770 * handshake.
2771 * @peer_addr: MAC address of the peer with which PASN authentication is to be
2772 * performed.
2773 * @network_id: Unique id for the network.
2774 * This identifier is used as a unique identifier for each network
2775 * block when using the control interface. Each network is allocated an
2776 * id when it is being created, either when reading the configuration
2777 * file or when a new network is added through the control interface.
2778 * @akmp: Authentication key management protocol type supported.
2779 * @cipher: Cipher suite.
2780 * @group: Finite cyclic group. Default group used is 19 (ECC).
2781 * @ltf_keyseed_required: Indicates whether LTF keyseed generation is required
2782 * @status: PASN response status, %PASN_STATUS_SUCCESS for successful
2783 * authentication, use %PASN_STATUS_FAILURE if PASN authentication
2784 * fails or if wpa_supplicant fails to set the security ranging context to
2785 * the driver
2786 */
2787struct pasn_peer {
2788 u8 own_addr[ETH_ALEN];
2789 u8 peer_addr[ETH_ALEN];
2790 int network_id;
2791 int akmp;
2792 int cipher;
2793 int group;
2794 bool ltf_keyseed_required;
2795 enum pasn_status status;
2796};
2797
2798/**
2799 * struct pasn_auth - PASN authentication trigger parameters
2800 *
2801 * These are used across the PASN authentication event from the driver to
2802 * userspace and to send a response to it.
2803 * @action: Action type. Only significant for the event interface.
2804 * @num_peers: The number of peers for which the PASN handshake is requested
2805 * for.
2806 * @peer: Holds the peer details.
2807 */
2808struct pasn_auth {
2809 enum {
2810 PASN_ACTION_AUTH,
2811 PASN_ACTION_DELETE_SECURE_RANGING_CONTEXT,
2812 } action;
2813 unsigned int num_peers;
2814 struct pasn_peer peer[WPAS_MAX_PASN_PEERS];
2815};
2816
2817/**
2818 * struct secure_ranging_params - Parameters required to set secure ranging
2819 * context for a peer.
2820 *
2821 * @action: Add or delete a security context to the driver.
2822 * @own_addr: Own MAC address used during key derivation.
2823 * @peer_addr: Address of the peer device.
2824 * @cipher: Cipher suite.
2825 * @tk_len: Length of temporal key.
2826 * @tk: Temporal key buffer.
2827 * @ltf_keyseed_len: Length of LTF keyseed.
2828 * @ltf_keyeed: LTF keyseed buffer.
2829 */
2830struct secure_ranging_params {
2831 u32 action;
2832 const u8 *own_addr;
2833 const u8 *peer_addr;
2834 u32 cipher;
2835 u8 tk_len;
2836 const u8 *tk;
2837 u8 ltf_keyseed_len;
2838 const u8 *ltf_keyseed;
2839};
2840
Hai Shalom60840252021-02-19 19:02:11 -08002841/* enum nested_attr - Used to specify if subcommand uses nested attributes */
2842enum nested_attr {
2843 NESTED_ATTR_NOT_USED = 0,
2844 NESTED_ATTR_USED = 1,
2845 NESTED_ATTR_UNSPECIFIED = 2,
2846};
2847
Sunil8cd6f4d2022-06-28 18:40:46 +00002848/* Preferred channel list information */
2849
2850/* GO role */
2851#define WEIGHTED_PCL_GO BIT(0)
2852/* P2P Client role */
2853#define WEIGHTED_PCL_CLI BIT(1)
2854/* Must be considered for operating channel */
2855#define WEIGHTED_PCL_MUST_CONSIDER BIT(2)
2856/* Should be excluded in GO negotiation */
2857#define WEIGHTED_PCL_EXCLUDE BIT(3)
2858
2859/* Preferred channel list with weight */
2860struct weighted_pcl {
2861 u32 freq; /* MHz */
2862 u8 weight;
2863 u32 flag; /* bitmap for WEIGHTED_PCL_* */
2864};
2865
Sunil Ravi89eba102022-09-13 21:04:37 -07002866struct driver_sta_mlo_info {
Sunil Ravi77d572f2023-01-17 23:58:31 +00002867 u16 req_links; /* bitmap of requested link IDs */
2868 u16 valid_links; /* bitmap of accepted link IDs */
2869 u8 assoc_link_id;
Sunil Ravi89eba102022-09-13 21:04:37 -07002870 u8 ap_mld_addr[ETH_ALEN];
2871 struct {
2872 u8 addr[ETH_ALEN];
2873 u8 bssid[ETH_ALEN];
2874 unsigned int freq;
2875 } links[MAX_NUM_MLD_LINKS];
2876};
2877
Roshan Pius3a1667e2018-07-03 15:17:14 -07002878/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002879 * struct wpa_driver_ops - Driver interface API definition
2880 *
2881 * This structure defines the API that each driver interface needs to implement
2882 * for core wpa_supplicant code. All driver specific functionality is captured
2883 * in this wrapper.
2884 */
2885struct wpa_driver_ops {
2886 /** Name of the driver interface */
2887 const char *name;
2888 /** One line description of the driver interface */
2889 const char *desc;
2890
2891 /**
2892 * get_bssid - Get the current BSSID
2893 * @priv: private driver interface data
2894 * @bssid: buffer for BSSID (ETH_ALEN = 6 bytes)
2895 *
2896 * Returns: 0 on success, -1 on failure
2897 *
2898 * Query kernel driver for the current BSSID and copy it to bssid.
2899 * Setting bssid to 00:00:00:00:00:00 is recommended if the STA is not
2900 * associated.
2901 */
2902 int (*get_bssid)(void *priv, u8 *bssid);
2903
2904 /**
2905 * get_ssid - Get the current SSID
2906 * @priv: private driver interface data
2907 * @ssid: buffer for SSID (at least 32 bytes)
2908 *
2909 * Returns: Length of the SSID on success, -1 on failure
2910 *
2911 * Query kernel driver for the current SSID and copy it to ssid.
2912 * Returning zero is recommended if the STA is not associated.
2913 *
2914 * Note: SSID is an array of octets, i.e., it is not nul terminated and
2915 * can, at least in theory, contain control characters (including nul)
2916 * and as such, should be processed as binary data, not a printable
2917 * string.
2918 */
2919 int (*get_ssid)(void *priv, u8 *ssid);
2920
2921 /**
2922 * set_key - Configure encryption key
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002923 * @priv: private driver interface data
Hai Shalomfdcde762020-04-02 11:19:20 -07002924 * @params: Key parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002925 * Returns: 0 on success, -1 on failure
2926 *
2927 * Configure the given key for the kernel driver. If the driver
2928 * supports separate individual keys (4 default keys + 1 individual),
2929 * addr can be used to determine whether the key is default or
2930 * individual. If only 4 keys are supported, the default key with key
2931 * index 0 is used as the individual key. STA must be configured to use
2932 * it as the default Tx key (set_tx is set) and accept Rx for all the
2933 * key indexes. In most cases, WPA uses only key indexes 1 and 2 for
2934 * broadcast keys, so key index 0 is available for this kind of
2935 * configuration.
2936 *
2937 * Please note that TKIP keys include separate TX and RX MIC keys and
2938 * some drivers may expect them in different order than wpa_supplicant
2939 * is using. If the TX/RX keys are swapped, all TKIP encrypted packets
2940 * will trigger Michael MIC errors. This can be fixed by changing the
Sunil Ravia04bd252022-05-02 22:54:18 -07002941 * order of MIC keys by swapping the bytes 16..23 and 24..31 of the key
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002942 * in driver_*.c set_key() implementation, see driver_ndis.c for an
2943 * example on how this can be done.
2944 */
Hai Shalomfdcde762020-04-02 11:19:20 -07002945 int (*set_key)(void *priv, struct wpa_driver_set_key_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002946
2947 /**
2948 * init - Initialize driver interface
2949 * @ctx: context to be used when calling wpa_supplicant functions,
2950 * e.g., wpa_supplicant_event()
2951 * @ifname: interface name, e.g., wlan0
2952 *
2953 * Returns: Pointer to private data, %NULL on failure
2954 *
2955 * Initialize driver interface, including event processing for kernel
2956 * driver events (e.g., associated, scan results, Michael MIC failure).
2957 * This function can allocate a private configuration data area for
2958 * @ctx, file descriptor, interface name, etc. information that may be
2959 * needed in future driver operations. If this is not used, non-NULL
2960 * value will need to be returned because %NULL is used to indicate
2961 * failure. The returned value will be used as 'void *priv' data for
2962 * all other driver_ops functions.
2963 *
2964 * The main event loop (eloop.c) of wpa_supplicant can be used to
2965 * register callback for read sockets (eloop_register_read_sock()).
2966 *
2967 * See below for more information about events and
2968 * wpa_supplicant_event() function.
2969 */
2970 void * (*init)(void *ctx, const char *ifname);
2971
2972 /**
2973 * deinit - Deinitialize driver interface
2974 * @priv: private driver interface data from init()
2975 *
2976 * Shut down driver interface and processing of driver events. Free
2977 * private data buffer if one was allocated in init() handler.
2978 */
2979 void (*deinit)(void *priv);
2980
2981 /**
2982 * set_param - Set driver configuration parameters
2983 * @priv: private driver interface data from init()
2984 * @param: driver specific configuration parameters
2985 *
2986 * Returns: 0 on success, -1 on failure
2987 *
2988 * Optional handler for notifying driver interface about configuration
2989 * parameters (driver_param).
2990 */
2991 int (*set_param)(void *priv, const char *param);
2992
2993 /**
2994 * set_countermeasures - Enable/disable TKIP countermeasures
2995 * @priv: private driver interface data
2996 * @enabled: 1 = countermeasures enabled, 0 = disabled
2997 *
2998 * Returns: 0 on success, -1 on failure
2999 *
3000 * Configure TKIP countermeasures. When these are enabled, the driver
3001 * should drop all received and queued frames that are using TKIP.
3002 */
3003 int (*set_countermeasures)(void *priv, int enabled);
3004
3005 /**
3006 * deauthenticate - Request driver to deauthenticate
3007 * @priv: private driver interface data
3008 * @addr: peer address (BSSID of the AP)
3009 * @reason_code: 16-bit reason code to be sent in the deauthentication
3010 * frame
3011 *
3012 * Returns: 0 on success, -1 on failure
3013 */
Hai Shalom81f62d82019-07-22 12:10:00 -07003014 int (*deauthenticate)(void *priv, const u8 *addr, u16 reason_code);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003015
3016 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003017 * associate - Request driver to associate
3018 * @priv: private driver interface data
3019 * @params: association parameters
3020 *
3021 * Returns: 0 on success, -1 on failure
3022 */
3023 int (*associate)(void *priv,
3024 struct wpa_driver_associate_params *params);
3025
3026 /**
3027 * add_pmkid - Add PMKSA cache entry to the driver
3028 * @priv: private driver interface data
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003029 * @params: PMKSA parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003030 *
3031 * Returns: 0 on success, -1 on failure
3032 *
3033 * This function is called when a new PMK is received, as a result of
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003034 * either normal authentication or RSN pre-authentication. The PMKSA
3035 * parameters are either a set of bssid, pmkid, and pmk; or a set of
3036 * ssid, fils_cache_id, pmkid, and pmk.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003037 *
3038 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
3039 * associate(), add_pmkid() can be used to add new PMKSA cache entries
3040 * in the driver. If the driver uses wpa_ie from wpa_supplicant, this
3041 * driver_ops function does not need to be implemented. Likewise, if
3042 * the driver does not support WPA, this function is not needed.
3043 */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003044 int (*add_pmkid)(void *priv, struct wpa_pmkid_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003045
3046 /**
3047 * remove_pmkid - Remove PMKSA cache entry to the driver
3048 * @priv: private driver interface data
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003049 * @params: PMKSA parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003050 *
3051 * Returns: 0 on success, -1 on failure
3052 *
3053 * This function is called when the supplicant drops a PMKSA cache
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003054 * entry for any reason. The PMKSA parameters are either a set of
3055 * bssid and pmkid; or a set of ssid, fils_cache_id, and pmkid.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003056 *
3057 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
3058 * associate(), remove_pmkid() can be used to synchronize PMKSA caches
3059 * between the driver and wpa_supplicant. If the driver uses wpa_ie
3060 * from wpa_supplicant, this driver_ops function does not need to be
3061 * implemented. Likewise, if the driver does not support WPA, this
3062 * function is not needed.
3063 */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003064 int (*remove_pmkid)(void *priv, struct wpa_pmkid_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003065
3066 /**
3067 * flush_pmkid - Flush PMKSA cache
3068 * @priv: private driver interface data
3069 *
3070 * Returns: 0 on success, -1 on failure
3071 *
3072 * This function is called when the supplicant drops all PMKSA cache
3073 * entries for any reason.
3074 *
3075 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
3076 * associate(), remove_pmkid() can be used to synchronize PMKSA caches
3077 * between the driver and wpa_supplicant. If the driver uses wpa_ie
3078 * from wpa_supplicant, this driver_ops function does not need to be
3079 * implemented. Likewise, if the driver does not support WPA, this
3080 * function is not needed.
3081 */
3082 int (*flush_pmkid)(void *priv);
3083
3084 /**
3085 * get_capa - Get driver capabilities
3086 * @priv: private driver interface data
3087 *
3088 * Returns: 0 on success, -1 on failure
3089 *
3090 * Get driver/firmware/hardware capabilities.
3091 */
3092 int (*get_capa)(void *priv, struct wpa_driver_capa *capa);
3093
3094 /**
3095 * poll - Poll driver for association information
3096 * @priv: private driver interface data
3097 *
Sunil Ravi77d572f2023-01-17 23:58:31 +00003098 * This is an optional callback that can be used when the driver does
3099 * not provide event mechanism for association events. This is called
3100 * when receiving WPA/RSN EAPOL-Key messages that require association
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003101 * information. The driver interface is supposed to generate associnfo
3102 * event before returning from this callback function. In addition, the
3103 * driver interface should generate an association event after having
3104 * sent out associnfo.
3105 */
3106 void (*poll)(void *priv);
3107
3108 /**
Dmitry Shmidte4663042016-04-04 10:07:49 -07003109 * get_ifindex - Get interface index
3110 * @priv: private driver interface data
3111 *
3112 * Returns: Interface index
3113 */
3114 unsigned int (*get_ifindex)(void *priv);
3115
3116 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003117 * get_ifname - Get interface name
3118 * @priv: private driver interface data
3119 *
3120 * Returns: Pointer to the interface name. This can differ from the
3121 * interface name used in init() call. Init() is called first.
3122 *
3123 * This optional function can be used to allow the driver interface to
3124 * replace the interface name with something else, e.g., based on an
3125 * interface mapping from a more descriptive name.
3126 */
3127 const char * (*get_ifname)(void *priv);
3128
3129 /**
3130 * get_mac_addr - Get own MAC address
3131 * @priv: private driver interface data
3132 *
3133 * Returns: Pointer to own MAC address or %NULL on failure
3134 *
3135 * This optional function can be used to get the own MAC address of the
3136 * device from the driver interface code. This is only needed if the
3137 * l2_packet implementation for the OS does not provide easy access to
3138 * a MAC address. */
3139 const u8 * (*get_mac_addr)(void *priv);
3140
3141 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003142 * set_operstate - Sets device operating state to DORMANT or UP
3143 * @priv: private driver interface data
3144 * @state: 0 = dormant, 1 = up
3145 * Returns: 0 on success, -1 on failure
3146 *
3147 * This is an optional function that can be used on operating systems
3148 * that support a concept of controlling network device state from user
3149 * space applications. This function, if set, gets called with
3150 * state = 1 when authentication has been completed and with state = 0
3151 * when connection is lost.
3152 */
3153 int (*set_operstate)(void *priv, int state);
3154
3155 /**
3156 * mlme_setprotection - MLME-SETPROTECTION.request primitive
3157 * @priv: Private driver interface data
3158 * @addr: Address of the station for which to set protection (may be
3159 * %NULL for group keys)
3160 * @protect_type: MLME_SETPROTECTION_PROTECT_TYPE_*
3161 * @key_type: MLME_SETPROTECTION_KEY_TYPE_*
3162 * Returns: 0 on success, -1 on failure
3163 *
3164 * This is an optional function that can be used to set the driver to
3165 * require protection for Tx and/or Rx frames. This uses the layer
3166 * interface defined in IEEE 802.11i-2004 clause 10.3.22.1
3167 * (MLME-SETPROTECTION.request). Many drivers do not use explicit
3168 * set protection operation; instead, they set protection implicitly
3169 * based on configured keys.
3170 */
3171 int (*mlme_setprotection)(void *priv, const u8 *addr, int protect_type,
3172 int key_type);
3173
3174 /**
3175 * get_hw_feature_data - Get hardware support data (channels and rates)
3176 * @priv: Private driver interface data
3177 * @num_modes: Variable for returning the number of returned modes
3178 * flags: Variable for returning hardware feature flags
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003179 * @dfs: Variable for returning DFS region (HOSTAPD_DFS_REGION_*)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003180 * Returns: Pointer to allocated hardware data on success or %NULL on
3181 * failure. Caller is responsible for freeing this.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003182 */
3183 struct hostapd_hw_modes * (*get_hw_feature_data)(void *priv,
3184 u16 *num_modes,
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003185 u16 *flags, u8 *dfs);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003186
3187 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003188 * send_mlme - Send management frame from MLME
3189 * @priv: Private driver interface data
3190 * @data: IEEE 802.11 management frame with IEEE 802.11 header
3191 * @data_len: Size of the management frame
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003192 * @noack: Do not wait for this frame to be acked (disable retries)
Dmitry Shmidta3dc3092015-06-23 11:21:28 -07003193 * @freq: Frequency (in MHz) to send the frame on, or 0 to let the
3194 * driver decide
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08003195 * @csa_offs: Array of CSA offsets or %NULL
3196 * @csa_offs_len: Number of elements in csa_offs
Hai Shalomfdcde762020-04-02 11:19:20 -07003197 * @no_encrypt: Do not encrypt frame even if appropriate key exists
3198 * (used only for testing purposes)
3199 * @wait: Time to wait off-channel for a response (in ms), or zero
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003200 * Returns: 0 on success, -1 on failure
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003201 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003202 int (*send_mlme)(void *priv, const u8 *data, size_t data_len,
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08003203 int noack, unsigned int freq, const u16 *csa_offs,
Hai Shalomfdcde762020-04-02 11:19:20 -07003204 size_t csa_offs_len, int no_encrypt,
3205 unsigned int wait);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003206
3207 /**
3208 * update_ft_ies - Update FT (IEEE 802.11r) IEs
3209 * @priv: Private driver interface data
3210 * @md: Mobility domain (2 octets) (also included inside ies)
3211 * @ies: FT IEs (MDIE, FTIE, ...) or %NULL to remove IEs
3212 * @ies_len: Length of FT IEs in bytes
3213 * Returns: 0 on success, -1 on failure
3214 *
3215 * The supplicant uses this callback to let the driver know that keying
3216 * material for FT is available and that the driver can use the
3217 * provided IEs in the next message in FT authentication sequence.
3218 *
3219 * This function is only needed for driver that support IEEE 802.11r
3220 * (Fast BSS Transition).
3221 */
3222 int (*update_ft_ies)(void *priv, const u8 *md, const u8 *ies,
3223 size_t ies_len);
3224
3225 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003226 * get_scan_results2 - Fetch the latest scan results
3227 * @priv: private driver interface data
3228 *
3229 * Returns: Allocated buffer of scan results (caller is responsible for
3230 * freeing the data structure) on success, NULL on failure
3231 */
3232 struct wpa_scan_results * (*get_scan_results2)(void *priv);
3233
3234 /**
3235 * set_country - Set country
3236 * @priv: Private driver interface data
3237 * @alpha2: country to which to switch to
3238 * Returns: 0 on success, -1 on failure
3239 *
3240 * This function is for drivers which support some form
3241 * of setting a regulatory domain.
3242 */
3243 int (*set_country)(void *priv, const char *alpha2);
3244
3245 /**
Dmitry Shmidtcce06662013-11-04 18:44:24 -08003246 * get_country - Get country
3247 * @priv: Private driver interface data
3248 * @alpha2: Buffer for returning country code (at least 3 octets)
3249 * Returns: 0 on success, -1 on failure
3250 */
3251 int (*get_country)(void *priv, char *alpha2);
3252
3253 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003254 * global_init - Global driver initialization
Dmitry Shmidte4663042016-04-04 10:07:49 -07003255 * @ctx: wpa_global pointer
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003256 * Returns: Pointer to private data (global), %NULL on failure
3257 *
3258 * This optional function is called to initialize the driver wrapper
3259 * for global data, i.e., data that applies to all interfaces. If this
3260 * function is implemented, global_deinit() will also need to be
3261 * implemented to free the private data. The driver will also likely
3262 * use init2() function instead of init() to get the pointer to global
3263 * data available to per-interface initializer.
3264 */
Dmitry Shmidte4663042016-04-04 10:07:49 -07003265 void * (*global_init)(void *ctx);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003266
3267 /**
3268 * global_deinit - Global driver deinitialization
3269 * @priv: private driver global data from global_init()
3270 *
3271 * Terminate any global driver related functionality and free the
3272 * global data structure.
3273 */
3274 void (*global_deinit)(void *priv);
3275
3276 /**
3277 * init2 - Initialize driver interface (with global data)
3278 * @ctx: context to be used when calling wpa_supplicant functions,
3279 * e.g., wpa_supplicant_event()
3280 * @ifname: interface name, e.g., wlan0
3281 * @global_priv: private driver global data from global_init()
3282 * Returns: Pointer to private data, %NULL on failure
3283 *
3284 * This function can be used instead of init() if the driver wrapper
3285 * uses global data.
3286 */
3287 void * (*init2)(void *ctx, const char *ifname, void *global_priv);
3288
3289 /**
3290 * get_interfaces - Get information about available interfaces
3291 * @global_priv: private driver global data from global_init()
3292 * Returns: Allocated buffer of interface information (caller is
3293 * responsible for freeing the data structure) on success, NULL on
3294 * failure
3295 */
3296 struct wpa_interface_info * (*get_interfaces)(void *global_priv);
3297
3298 /**
3299 * scan2 - Request the driver to initiate scan
3300 * @priv: private driver interface data
3301 * @params: Scan parameters
3302 *
3303 * Returns: 0 on success, -1 on failure
3304 *
3305 * Once the scan results are ready, the driver should report scan
3306 * results event for wpa_supplicant which will eventually request the
3307 * results with wpa_driver_get_scan_results2().
3308 */
3309 int (*scan2)(void *priv, struct wpa_driver_scan_params *params);
3310
3311 /**
3312 * authenticate - Request driver to authenticate
3313 * @priv: private driver interface data
3314 * @params: authentication parameters
3315 * Returns: 0 on success, -1 on failure
3316 *
3317 * This is an optional function that can be used with drivers that
3318 * support separate authentication and association steps, i.e., when
3319 * wpa_supplicant can act as the SME. If not implemented, associate()
3320 * function is expected to take care of IEEE 802.11 authentication,
3321 * too.
3322 */
3323 int (*authenticate)(void *priv,
3324 struct wpa_driver_auth_params *params);
3325
3326 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003327 * set_ap - Set Beacon and Probe Response information for AP mode
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003328 * @priv: Private driver interface data
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003329 * @params: Parameters to use in AP mode
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003330 *
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003331 * This function is used to configure Beacon template and/or extra IEs
3332 * to add for Beacon and Probe Response frames for the driver in
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003333 * AP mode. The driver is responsible for building the full Beacon
3334 * frame by concatenating the head part with TIM IE generated by the
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003335 * driver/firmware and finishing with the tail part. Depending on the
3336 * driver architectue, this can be done either by using the full
3337 * template or the set of additional IEs (e.g., WPS and P2P IE).
3338 * Similarly, Probe Response processing depends on the driver design.
3339 * If the driver (or firmware) takes care of replying to Probe Request
3340 * frames, the extra IEs provided here needs to be added to the Probe
3341 * Response frames.
3342 *
3343 * Returns: 0 on success, -1 on failure
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003344 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003345 int (*set_ap)(void *priv, struct wpa_driver_ap_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003346
3347 /**
Dmitry Shmidt8bae4132013-06-06 11:25:10 -07003348 * set_acl - Set ACL in AP mode
3349 * @priv: Private driver interface data
3350 * @params: Parameters to configure ACL
3351 * Returns: 0 on success, -1 on failure
3352 *
3353 * This is used only for the drivers which support MAC address ACL.
3354 */
3355 int (*set_acl)(void *priv, struct hostapd_acl_params *params);
3356
3357 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003358 * hapd_init - Initialize driver interface (hostapd only)
3359 * @hapd: Pointer to hostapd context
3360 * @params: Configuration for the driver wrapper
3361 * Returns: Pointer to private data, %NULL on failure
3362 *
3363 * This function is used instead of init() or init2() when the driver
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003364 * wrapper is used with hostapd.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003365 */
3366 void * (*hapd_init)(struct hostapd_data *hapd,
3367 struct wpa_init_params *params);
3368
3369 /**
3370 * hapd_deinit - Deinitialize driver interface (hostapd only)
3371 * @priv: Private driver interface data from hapd_init()
3372 */
3373 void (*hapd_deinit)(void *priv);
3374
3375 /**
3376 * set_ieee8021x - Enable/disable IEEE 802.1X support (AP only)
3377 * @priv: Private driver interface data
3378 * @params: BSS parameters
3379 * Returns: 0 on success, -1 on failure
3380 *
3381 * This is an optional function to configure the kernel driver to
3382 * enable/disable IEEE 802.1X support and set WPA/WPA2 parameters. This
3383 * can be left undefined (set to %NULL) if IEEE 802.1X support is
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003384 * always enabled and the driver uses set_ap() to set WPA/RSN IE
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003385 * for Beacon frames.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003386 *
3387 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003388 */
3389 int (*set_ieee8021x)(void *priv, struct wpa_bss_params *params);
3390
3391 /**
3392 * set_privacy - Enable/disable privacy (AP only)
3393 * @priv: Private driver interface data
3394 * @enabled: 1 = privacy enabled, 0 = disabled
3395 * Returns: 0 on success, -1 on failure
3396 *
3397 * This is an optional function to configure privacy field in the
3398 * kernel driver for Beacon frames. This can be left undefined (set to
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003399 * %NULL) if the driver uses the Beacon template from set_ap().
3400 *
3401 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003402 */
3403 int (*set_privacy)(void *priv, int enabled);
3404
3405 /**
3406 * get_seqnum - Fetch the current TSC/packet number (AP only)
3407 * @ifname: The interface name (main or virtual)
3408 * @priv: Private driver interface data
3409 * @addr: MAC address of the station or %NULL for group keys
3410 * @idx: Key index
3411 * @seq: Buffer for returning the latest used TSC/packet number
3412 * Returns: 0 on success, -1 on failure
3413 *
3414 * This function is used to fetch the last used TSC/packet number for
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07003415 * a TKIP, CCMP, GCMP, or BIP/IGTK key. It is mainly used with group
3416 * keys, so there is no strict requirement on implementing support for
3417 * unicast keys (i.e., addr != %NULL).
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003418 */
3419 int (*get_seqnum)(const char *ifname, void *priv, const u8 *addr,
3420 int idx, u8 *seq);
3421
3422 /**
3423 * flush - Flush all association stations (AP only)
3424 * @priv: Private driver interface data
3425 * Returns: 0 on success, -1 on failure
3426 *
3427 * This function requests the driver to disassociate all associated
3428 * stations. This function does not need to be implemented if the
3429 * driver does not process association frames internally.
3430 */
3431 int (*flush)(void *priv);
3432
3433 /**
3434 * set_generic_elem - Add IEs into Beacon/Probe Response frames (AP)
3435 * @priv: Private driver interface data
3436 * @elem: Information elements
3437 * @elem_len: Length of the elem buffer in octets
3438 * Returns: 0 on success, -1 on failure
3439 *
3440 * This is an optional function to add information elements in the
3441 * kernel driver for Beacon and Probe Response frames. This can be left
3442 * undefined (set to %NULL) if the driver uses the Beacon template from
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003443 * set_ap().
3444 *
3445 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003446 */
3447 int (*set_generic_elem)(void *priv, const u8 *elem, size_t elem_len);
3448
3449 /**
Jouni Malinen1e6c57f2012-09-05 17:07:03 +03003450 * read_sta_data - Fetch station data
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003451 * @priv: Private driver interface data
3452 * @data: Buffer for returning station information
3453 * @addr: MAC address of the station
3454 * Returns: 0 on success, -1 on failure
3455 */
3456 int (*read_sta_data)(void *priv, struct hostap_sta_driver_data *data,
3457 const u8 *addr);
3458
3459 /**
Hai Shalomfdcde762020-04-02 11:19:20 -07003460 * tx_control_port - Send a frame over the 802.1X controlled port
3461 * @priv: Private driver interface data
3462 * @dest: Destination MAC address
3463 * @proto: Ethertype in host byte order
3464 * @buf: Frame payload starting from IEEE 802.1X header
3465 * @len: Frame payload length
3466 * @no_encrypt: Do not encrypt frame
3467 *
3468 * Returns 0 on success, else an error
3469 *
3470 * This is like a normal Ethernet send except that the driver is aware
3471 * (by other means than the Ethertype) that this frame is special,
3472 * and more importantly it gains an ordering between the transmission of
3473 * the frame and other driver management operations such as key
3474 * installations. This can be used to work around known limitations in
3475 * IEEE 802.11 protocols such as race conditions between rekeying 4-way
3476 * handshake message 4/4 and a PTK being overwritten.
3477 *
3478 * This function is only used for a given interface if the driver
3479 * instance reports WPA_DRIVER_FLAGS_CONTROL_PORT capability. Otherwise,
3480 * API users will fall back to sending the frame via a normal socket.
3481 */
3482 int (*tx_control_port)(void *priv, const u8 *dest,
3483 u16 proto, const u8 *buf, size_t len,
3484 int no_encrypt);
3485
3486 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003487 * hapd_send_eapol - Send an EAPOL packet (AP only)
3488 * @priv: private driver interface data
3489 * @addr: Destination MAC address
3490 * @data: EAPOL packet starting with IEEE 802.1X header
3491 * @data_len: Length of the EAPOL packet in octets
3492 * @encrypt: Whether the frame should be encrypted
3493 * @own_addr: Source MAC address
3494 * @flags: WPA_STA_* flags for the destination station
3495 *
3496 * Returns: 0 on success, -1 on failure
3497 */
3498 int (*hapd_send_eapol)(void *priv, const u8 *addr, const u8 *data,
3499 size_t data_len, int encrypt,
3500 const u8 *own_addr, u32 flags);
3501
3502 /**
3503 * sta_deauth - Deauthenticate a station (AP only)
3504 * @priv: Private driver interface data
3505 * @own_addr: Source address and BSSID for the Deauthentication frame
3506 * @addr: MAC address of the station to deauthenticate
3507 * @reason: Reason code for the Deauthentiation frame
3508 * Returns: 0 on success, -1 on failure
3509 *
3510 * This function requests a specific station to be deauthenticated and
3511 * a Deauthentication frame to be sent to it.
3512 */
3513 int (*sta_deauth)(void *priv, const u8 *own_addr, const u8 *addr,
Hai Shalom81f62d82019-07-22 12:10:00 -07003514 u16 reason);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003515
3516 /**
3517 * sta_disassoc - Disassociate a station (AP only)
3518 * @priv: Private driver interface data
3519 * @own_addr: Source address and BSSID for the Disassociation frame
3520 * @addr: MAC address of the station to disassociate
3521 * @reason: Reason code for the Disassociation frame
3522 * Returns: 0 on success, -1 on failure
3523 *
3524 * This function requests a specific station to be disassociated and
3525 * a Disassociation frame to be sent to it.
3526 */
3527 int (*sta_disassoc)(void *priv, const u8 *own_addr, const u8 *addr,
Hai Shalom81f62d82019-07-22 12:10:00 -07003528 u16 reason);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003529
3530 /**
3531 * sta_remove - Remove a station entry (AP only)
3532 * @priv: Private driver interface data
3533 * @addr: MAC address of the station to be removed
3534 * Returns: 0 on success, -1 on failure
3535 */
3536 int (*sta_remove)(void *priv, const u8 *addr);
3537
3538 /**
3539 * hapd_get_ssid - Get the current SSID (AP only)
3540 * @priv: Private driver interface data
3541 * @buf: Buffer for returning the SSID
3542 * @len: Maximum length of the buffer
3543 * Returns: Length of the SSID on success, -1 on failure
3544 *
3545 * This function need not be implemented if the driver uses Beacon
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003546 * template from set_ap() and does not reply to Probe Request frames.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003547 */
3548 int (*hapd_get_ssid)(void *priv, u8 *buf, int len);
3549
3550 /**
3551 * hapd_set_ssid - Set SSID (AP only)
3552 * @priv: Private driver interface data
3553 * @buf: SSID
3554 * @len: Length of the SSID in octets
3555 * Returns: 0 on success, -1 on failure
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003556 *
3557 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003558 */
3559 int (*hapd_set_ssid)(void *priv, const u8 *buf, int len);
3560
3561 /**
3562 * hapd_set_countermeasures - Enable/disable TKIP countermeasures (AP)
3563 * @priv: Private driver interface data
3564 * @enabled: 1 = countermeasures enabled, 0 = disabled
3565 * Returns: 0 on success, -1 on failure
3566 *
3567 * This need not be implemented if the driver does not take care of
3568 * association processing.
3569 */
3570 int (*hapd_set_countermeasures)(void *priv, int enabled);
3571
3572 /**
3573 * sta_add - Add a station entry
3574 * @priv: Private driver interface data
3575 * @params: Station parameters
3576 * Returns: 0 on success, -1 on failure
3577 *
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08003578 * This function is used to add or set (params->set 1) a station
3579 * entry in the driver. Adding STA entries is used only if the driver
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003580 * does not take care of association processing.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003581 *
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08003582 * With drivers that don't support full AP client state, this function
3583 * is used to add a station entry to the driver once the station has
3584 * completed association.
3585 *
3586 * With TDLS, this function is used to add or set (params->set 1)
3587 * TDLS peer entries (even with drivers that do not support full AP
3588 * client state).
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003589 */
3590 int (*sta_add)(void *priv, struct hostapd_sta_add_params *params);
3591
3592 /**
3593 * get_inact_sec - Get station inactivity duration (AP only)
3594 * @priv: Private driver interface data
3595 * @addr: Station address
3596 * Returns: Number of seconds station has been inactive, -1 on failure
3597 */
3598 int (*get_inact_sec)(void *priv, const u8 *addr);
3599
3600 /**
3601 * sta_clear_stats - Clear station statistics (AP only)
3602 * @priv: Private driver interface data
3603 * @addr: Station address
3604 * Returns: 0 on success, -1 on failure
3605 */
3606 int (*sta_clear_stats)(void *priv, const u8 *addr);
3607
3608 /**
3609 * set_freq - Set channel/frequency (AP only)
3610 * @priv: Private driver interface data
3611 * @freq: Channel parameters
3612 * Returns: 0 on success, -1 on failure
3613 */
3614 int (*set_freq)(void *priv, struct hostapd_freq_params *freq);
3615
3616 /**
3617 * set_rts - Set RTS threshold
3618 * @priv: Private driver interface data
3619 * @rts: RTS threshold in octets
3620 * Returns: 0 on success, -1 on failure
3621 */
3622 int (*set_rts)(void *priv, int rts);
3623
3624 /**
3625 * set_frag - Set fragmentation threshold
3626 * @priv: Private driver interface data
3627 * @frag: Fragmentation threshold in octets
3628 * Returns: 0 on success, -1 on failure
3629 */
3630 int (*set_frag)(void *priv, int frag);
3631
3632 /**
3633 * sta_set_flags - Set station flags (AP only)
3634 * @priv: Private driver interface data
3635 * @addr: Station address
3636 * @total_flags: Bitmap of all WPA_STA_* flags currently set
3637 * @flags_or: Bitmap of WPA_STA_* flags to add
3638 * @flags_and: Bitmap of WPA_STA_* flags to us as a mask
3639 * Returns: 0 on success, -1 on failure
3640 */
3641 int (*sta_set_flags)(void *priv, const u8 *addr,
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08003642 unsigned int total_flags, unsigned int flags_or,
3643 unsigned int flags_and);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003644
3645 /**
Hai Shalom81f62d82019-07-22 12:10:00 -07003646 * sta_set_airtime_weight - Set station airtime weight (AP only)
3647 * @priv: Private driver interface data
3648 * @addr: Station address
3649 * @weight: New weight for station airtime assignment
3650 * Returns: 0 on success, -1 on failure
3651 */
3652 int (*sta_set_airtime_weight)(void *priv, const u8 *addr,
3653 unsigned int weight);
3654
3655 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003656 * set_tx_queue_params - Set TX queue parameters
3657 * @priv: Private driver interface data
3658 * @queue: Queue number (0 = VO, 1 = VI, 2 = BE, 3 = BK)
3659 * @aifs: AIFS
3660 * @cw_min: cwMin
3661 * @cw_max: cwMax
3662 * @burst_time: Maximum length for bursting in 0.1 msec units
3663 */
3664 int (*set_tx_queue_params)(void *priv, int queue, int aifs, int cw_min,
3665 int cw_max, int burst_time);
3666
3667 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003668 * if_add - Add a virtual interface
3669 * @priv: Private driver interface data
3670 * @type: Interface type
3671 * @ifname: Interface name for the new virtual interface
3672 * @addr: Local address to use for the interface or %NULL to use the
3673 * parent interface address
3674 * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces
3675 * @drv_priv: Pointer for overwriting the driver context or %NULL if
3676 * not allowed (applies only to %WPA_IF_AP_BSS type)
3677 * @force_ifname: Buffer for returning an interface name that the
3678 * driver ended up using if it differs from the requested ifname
3679 * @if_addr: Buffer for returning the allocated interface address
3680 * (this may differ from the requested addr if the driver cannot
3681 * change interface address)
3682 * @bridge: Bridge interface to use or %NULL if no bridge configured
Dmitry Shmidtcce06662013-11-04 18:44:24 -08003683 * @use_existing: Whether to allow existing interface to be used
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08003684 * @setup_ap: Whether to setup AP for %WPA_IF_AP_BSS interfaces
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003685 * Returns: 0 on success, -1 on failure
3686 */
3687 int (*if_add)(void *priv, enum wpa_driver_if_type type,
3688 const char *ifname, const u8 *addr, void *bss_ctx,
3689 void **drv_priv, char *force_ifname, u8 *if_addr,
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08003690 const char *bridge, int use_existing, int setup_ap);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003691
3692 /**
3693 * if_remove - Remove a virtual interface
3694 * @priv: Private driver interface data
3695 * @type: Interface type
3696 * @ifname: Interface name of the virtual interface to be removed
3697 * Returns: 0 on success, -1 on failure
3698 */
3699 int (*if_remove)(void *priv, enum wpa_driver_if_type type,
3700 const char *ifname);
3701
3702 /**
3703 * set_sta_vlan - Bind a station into a specific interface (AP only)
3704 * @priv: Private driver interface data
3705 * @ifname: Interface (main or virtual BSS or VLAN)
3706 * @addr: MAC address of the associated station
3707 * @vlan_id: VLAN ID
3708 * Returns: 0 on success, -1 on failure
3709 *
3710 * This function is used to bind a station to a specific virtual
3711 * interface. It is only used if when virtual interfaces are supported,
3712 * e.g., to assign stations to different VLAN interfaces based on
3713 * information from a RADIUS server. This allows separate broadcast
3714 * domains to be used with a single BSS.
3715 */
3716 int (*set_sta_vlan)(void *priv, const u8 *addr, const char *ifname,
3717 int vlan_id);
3718
3719 /**
3720 * commit - Optional commit changes handler (AP only)
3721 * @priv: driver private data
3722 * Returns: 0 on success, -1 on failure
3723 *
3724 * This optional handler function can be registered if the driver
3725 * interface implementation needs to commit changes (e.g., by setting
3726 * network interface up) at the end of initial configuration. If set,
3727 * this handler will be called after initial setup has been completed.
3728 */
3729 int (*commit)(void *priv);
3730
3731 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003732 * set_radius_acl_auth - Notification of RADIUS ACL change
3733 * @priv: Private driver interface data
3734 * @mac: MAC address of the station
3735 * @accepted: Whether the station was accepted
3736 * @session_timeout: Session timeout for the station
3737 * Returns: 0 on success, -1 on failure
3738 */
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07003739 int (*set_radius_acl_auth)(void *priv, const u8 *mac, int accepted,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003740 u32 session_timeout);
3741
3742 /**
3743 * set_radius_acl_expire - Notification of RADIUS ACL expiration
3744 * @priv: Private driver interface data
3745 * @mac: MAC address of the station
3746 * Returns: 0 on success, -1 on failure
3747 */
3748 int (*set_radius_acl_expire)(void *priv, const u8 *mac);
3749
3750 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003751 * set_ap_wps_ie - Add WPS IE(s) into Beacon/Probe Response frames (AP)
3752 * @priv: Private driver interface data
3753 * @beacon: WPS IE(s) for Beacon frames or %NULL to remove extra IE(s)
3754 * @proberesp: WPS IE(s) for Probe Response frames or %NULL to remove
3755 * extra IE(s)
3756 * @assocresp: WPS IE(s) for (Re)Association Response frames or %NULL
3757 * to remove extra IE(s)
3758 * Returns: 0 on success, -1 on failure
3759 *
3760 * This is an optional function to add WPS IE in the kernel driver for
3761 * Beacon and Probe Response frames. This can be left undefined (set
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003762 * to %NULL) if the driver uses the Beacon template from set_ap()
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003763 * and does not process Probe Request frames. If the driver takes care
3764 * of (Re)Association frame processing, the assocresp buffer includes
3765 * WPS IE(s) that need to be added to (Re)Association Response frames
3766 * whenever a (Re)Association Request frame indicated use of WPS.
3767 *
3768 * This will also be used to add P2P IE(s) into Beacon/Probe Response
3769 * frames when operating as a GO. The driver is responsible for adding
3770 * timing related attributes (e.g., NoA) in addition to the IEs
3771 * included here by appending them after these buffers. This call is
3772 * also used to provide Probe Response IEs for P2P Listen state
3773 * operations for drivers that generate the Probe Response frames
3774 * internally.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003775 *
3776 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003777 */
3778 int (*set_ap_wps_ie)(void *priv, const struct wpabuf *beacon,
3779 const struct wpabuf *proberesp,
3780 const struct wpabuf *assocresp);
3781
3782 /**
3783 * set_supp_port - Set IEEE 802.1X Supplicant Port status
3784 * @priv: Private driver interface data
3785 * @authorized: Whether the port is authorized
3786 * Returns: 0 on success, -1 on failure
3787 */
3788 int (*set_supp_port)(void *priv, int authorized);
3789
3790 /**
3791 * set_wds_sta - Bind a station into a 4-address WDS (AP only)
3792 * @priv: Private driver interface data
3793 * @addr: MAC address of the associated station
3794 * @aid: Association ID
3795 * @val: 1 = bind to 4-address WDS; 0 = unbind
3796 * @bridge_ifname: Bridge interface to use for the WDS station or %NULL
3797 * to indicate that bridge is not to be used
Dmitry Shmidtc2ebb4b2013-07-24 12:57:51 -07003798 * @ifname_wds: Buffer to return the interface name for the new WDS
3799 * station or %NULL to indicate name is not returned.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003800 * Returns: 0 on success, -1 on failure
3801 */
3802 int (*set_wds_sta)(void *priv, const u8 *addr, int aid, int val,
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07003803 const char *bridge_ifname, char *ifname_wds);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003804
3805 /**
3806 * send_action - Transmit an Action frame
3807 * @priv: Private driver interface data
3808 * @freq: Frequency (in MHz) of the channel
3809 * @wait: Time to wait off-channel for a response (in ms), or zero
3810 * @dst: Destination MAC address (Address 1)
3811 * @src: Source MAC address (Address 2)
3812 * @bssid: BSSID (Address 3)
3813 * @data: Frame body
3814 * @data_len: data length in octets
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003815 @ @no_cck: Whether CCK rates must not be used to transmit this frame
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003816 * Returns: 0 on success, -1 on failure
3817 *
3818 * This command can be used to request the driver to transmit an action
3819 * frame to the specified destination.
3820 *
3821 * If the %WPA_DRIVER_FLAGS_OFFCHANNEL_TX flag is set, the frame will
3822 * be transmitted on the given channel and the device will wait for a
3823 * response on that channel for the given wait time.
3824 *
3825 * If the flag is not set, the wait time will be ignored. In this case,
3826 * if a remain-on-channel duration is in progress, the frame must be
3827 * transmitted on that channel; alternatively the frame may be sent on
3828 * the current operational channel (if in associated state in station
3829 * mode or while operating as an AP.)
Dmitry Shmidtebd93af2017-02-21 13:40:44 -08003830 *
3831 * If @src differs from the device MAC address, use of a random
3832 * transmitter address is requested for this message exchange.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003833 */
3834 int (*send_action)(void *priv, unsigned int freq, unsigned int wait,
3835 const u8 *dst, const u8 *src, const u8 *bssid,
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003836 const u8 *data, size_t data_len, int no_cck);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003837
3838 /**
3839 * send_action_cancel_wait - Cancel action frame TX wait
3840 * @priv: Private driver interface data
3841 *
3842 * This command cancels the wait time associated with sending an action
3843 * frame. It is only available when %WPA_DRIVER_FLAGS_OFFCHANNEL_TX is
3844 * set in the driver flags.
3845 */
3846 void (*send_action_cancel_wait)(void *priv);
3847
3848 /**
3849 * remain_on_channel - Remain awake on a channel
3850 * @priv: Private driver interface data
3851 * @freq: Frequency (in MHz) of the channel
3852 * @duration: Duration in milliseconds
3853 * Returns: 0 on success, -1 on failure
3854 *
3855 * This command is used to request the driver to remain awake on the
3856 * specified channel for the specified duration and report received
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08003857 * Action frames with EVENT_RX_MGMT events. Optionally, received
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003858 * Probe Request frames may also be requested to be reported by calling
3859 * probe_req_report(). These will be reported with EVENT_RX_PROBE_REQ.
3860 *
3861 * The driver may not be at the requested channel when this function
3862 * returns, i.e., the return code is only indicating whether the
3863 * request was accepted. The caller will need to wait until the
3864 * EVENT_REMAIN_ON_CHANNEL event indicates that the driver has
3865 * completed the channel change. This may take some time due to other
3866 * need for the radio and the caller should be prepared to timing out
3867 * its wait since there are no guarantees on when this request can be
3868 * executed.
3869 */
3870 int (*remain_on_channel)(void *priv, unsigned int freq,
3871 unsigned int duration);
3872
3873 /**
3874 * cancel_remain_on_channel - Cancel remain-on-channel operation
3875 * @priv: Private driver interface data
3876 *
3877 * This command can be used to cancel a remain-on-channel operation
3878 * before its originally requested duration has passed. This could be
3879 * used, e.g., when remain_on_channel() is used to request extra time
3880 * to receive a response to an Action frame and the response is
3881 * received when there is still unneeded time remaining on the
3882 * remain-on-channel operation.
3883 */
3884 int (*cancel_remain_on_channel)(void *priv);
3885
3886 /**
3887 * probe_req_report - Request Probe Request frames to be indicated
3888 * @priv: Private driver interface data
3889 * @report: Whether to report received Probe Request frames
3890 * Returns: 0 on success, -1 on failure (or if not supported)
3891 *
3892 * This command can be used to request the driver to indicate when
3893 * Probe Request frames are received with EVENT_RX_PROBE_REQ events.
3894 * Since this operation may require extra resources, e.g., due to less
3895 * optimal hardware/firmware RX filtering, many drivers may disable
3896 * Probe Request reporting at least in station mode. This command is
3897 * used to notify the driver when the Probe Request frames need to be
3898 * reported, e.g., during remain-on-channel operations.
3899 */
3900 int (*probe_req_report)(void *priv, int report);
3901
3902 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003903 * deinit_ap - Deinitialize AP mode
3904 * @priv: Private driver interface data
3905 * Returns: 0 on success, -1 on failure (or if not supported)
3906 *
3907 * This optional function can be used to disable AP mode related
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07003908 * configuration. If the interface was not dynamically added,
3909 * change the driver mode to station mode to allow normal station
3910 * operations like scanning to be completed.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003911 */
3912 int (*deinit_ap)(void *priv);
3913
3914 /**
Dmitry Shmidt04949592012-07-19 12:16:46 -07003915 * deinit_p2p_cli - Deinitialize P2P client mode
3916 * @priv: Private driver interface data
3917 * Returns: 0 on success, -1 on failure (or if not supported)
3918 *
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07003919 * This optional function can be used to disable P2P client mode. If the
3920 * interface was not dynamically added, change the interface type back
3921 * to station mode.
Dmitry Shmidt04949592012-07-19 12:16:46 -07003922 */
3923 int (*deinit_p2p_cli)(void *priv);
3924
3925 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003926 * suspend - Notification on system suspend/hibernate event
3927 * @priv: Private driver interface data
3928 */
3929 void (*suspend)(void *priv);
3930
3931 /**
3932 * resume - Notification on system resume/thaw event
3933 * @priv: Private driver interface data
3934 */
3935 void (*resume)(void *priv);
3936
3937 /**
3938 * signal_monitor - Set signal monitoring parameters
3939 * @priv: Private driver interface data
3940 * @threshold: Threshold value for signal change events; 0 = disabled
3941 * @hysteresis: Minimum change in signal strength before indicating a
3942 * new event
3943 * Returns: 0 on success, -1 on failure (or if not supported)
3944 *
3945 * This function can be used to configure monitoring of signal strength
3946 * with the current AP. Whenever signal strength drops below the
3947 * %threshold value or increases above it, EVENT_SIGNAL_CHANGE event
3948 * should be generated assuming the signal strength has changed at
3949 * least %hysteresis from the previously indicated signal change event.
3950 */
3951 int (*signal_monitor)(void *priv, int threshold, int hysteresis);
3952
3953 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003954 * get_noa - Get current Notice of Absence attribute payload
3955 * @priv: Private driver interface data
3956 * @buf: Buffer for returning NoA
3957 * @buf_len: Buffer length in octets
3958 * Returns: Number of octets used in buf, 0 to indicate no NoA is being
3959 * advertized, or -1 on failure
3960 *
3961 * This function is used to fetch the current Notice of Absence
3962 * attribute value from GO.
3963 */
3964 int (*get_noa)(void *priv, u8 *buf, size_t buf_len);
3965
3966 /**
3967 * set_noa - Set Notice of Absence parameters for GO (testing)
3968 * @priv: Private driver interface data
3969 * @count: Count
3970 * @start: Start time in ms from next TBTT
3971 * @duration: Duration in ms
3972 * Returns: 0 on success or -1 on failure
3973 *
3974 * This function is used to set Notice of Absence parameters for GO. It
3975 * is used only for testing. To disable NoA, all parameters are set to
3976 * 0.
3977 */
3978 int (*set_noa)(void *priv, u8 count, int start, int duration);
3979
3980 /**
3981 * set_p2p_powersave - Set P2P power save options
3982 * @priv: Private driver interface data
3983 * @legacy_ps: 0 = disable, 1 = enable, 2 = maximum PS, -1 = no change
3984 * @opp_ps: 0 = disable, 1 = enable, -1 = no change
3985 * @ctwindow: 0.. = change (msec), -1 = no change
3986 * Returns: 0 on success or -1 on failure
3987 */
3988 int (*set_p2p_powersave)(void *priv, int legacy_ps, int opp_ps,
3989 int ctwindow);
3990
3991 /**
3992 * ampdu - Enable/disable aggregation
3993 * @priv: Private driver interface data
3994 * @ampdu: 1/0 = enable/disable A-MPDU aggregation
3995 * Returns: 0 on success or -1 on failure
3996 */
3997 int (*ampdu)(void *priv, int ampdu);
3998
3999 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004000 * get_radio_name - Get physical radio name for the device
4001 * @priv: Private driver interface data
4002 * Returns: Radio name or %NULL if not known
4003 *
4004 * The returned data must not be modified by the caller. It is assumed
4005 * that any interface that has the same radio name as another is
4006 * sharing the same physical radio. This information can be used to
4007 * share scan results etc. information between the virtual interfaces
4008 * to speed up various operations.
4009 */
4010 const char * (*get_radio_name)(void *priv);
4011
4012 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004013 * send_tdls_mgmt - for sending TDLS management packets
4014 * @priv: private driver interface data
4015 * @dst: Destination (peer) MAC address
4016 * @action_code: TDLS action code for the mssage
4017 * @dialog_token: Dialog Token to use in the message (if needed)
4018 * @status_code: Status Code or Reason Code to use (if needed)
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07004019 * @peer_capab: TDLS peer capability (TDLS_PEER_* bitfield)
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -07004020 * @initiator: Is the current end the TDLS link initiator
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004021 * @buf: TDLS IEs to add to the message
4022 * @len: Length of buf in octets
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004023 * Returns: 0 on success, negative (<0) on failure
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004024 *
4025 * This optional function can be used to send packet to driver which is
4026 * responsible for receiving and sending all TDLS packets.
4027 */
4028 int (*send_tdls_mgmt)(void *priv, const u8 *dst, u8 action_code,
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07004029 u8 dialog_token, u16 status_code, u32 peer_capab,
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -07004030 int initiator, const u8 *buf, size_t len);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004031
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004032 /**
4033 * tdls_oper - Ask the driver to perform high-level TDLS operations
4034 * @priv: Private driver interface data
4035 * @oper: TDLS high-level operation. See %enum tdls_oper
4036 * @peer: Destination (peer) MAC address
4037 * Returns: 0 on success, negative (<0) on failure
4038 *
4039 * This optional function can be used to send high-level TDLS commands
4040 * to the driver.
4041 */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004042 int (*tdls_oper)(void *priv, enum tdls_oper oper, const u8 *peer);
4043
4044 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07004045 * wnm_oper - Notify driver of the WNM frame reception
4046 * @priv: Private driver interface data
4047 * @oper: WNM operation. See %enum wnm_oper
4048 * @peer: Destination (peer) MAC address
4049 * @buf: Buffer for the driver to fill in (for getting IE)
4050 * @buf_len: Return the len of buf
4051 * Returns: 0 on success, negative (<0) on failure
4052 */
4053 int (*wnm_oper)(void *priv, enum wnm_oper oper, const u8 *peer,
4054 u8 *buf, u16 *buf_len);
4055
4056 /**
Dmitry Shmidt051af732013-10-22 13:52:46 -07004057 * set_qos_map - Set QoS Map
4058 * @priv: Private driver interface data
4059 * @qos_map_set: QoS Map
4060 * @qos_map_set_len: Length of QoS Map
4061 */
4062 int (*set_qos_map)(void *priv, const u8 *qos_map_set,
4063 u8 qos_map_set_len);
4064
4065 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004066 * br_add_ip_neigh - Add a neigh to the bridge ip neigh table
4067 * @priv: Private driver interface data
4068 * @version: IP version of the IP address, 4 or 6
4069 * @ipaddr: IP address for the neigh entry
4070 * @prefixlen: IP address prefix length
4071 * @addr: Corresponding MAC address
4072 * Returns: 0 on success, negative (<0) on failure
4073 */
4074 int (*br_add_ip_neigh)(void *priv, u8 version, const u8 *ipaddr,
4075 int prefixlen, const u8 *addr);
4076
4077 /**
4078 * br_delete_ip_neigh - Remove a neigh from the bridge ip neigh table
4079 * @priv: Private driver interface data
4080 * @version: IP version of the IP address, 4 or 6
4081 * @ipaddr: IP address for the neigh entry
4082 * Returns: 0 on success, negative (<0) on failure
4083 */
4084 int (*br_delete_ip_neigh)(void *priv, u8 version, const u8 *ipaddr);
4085
4086 /**
4087 * br_port_set_attr - Set a bridge port attribute
4088 * @attr: Bridge port attribute to set
4089 * @val: Value to be set
4090 * Returns: 0 on success, negative (<0) on failure
4091 */
4092 int (*br_port_set_attr)(void *priv, enum drv_br_port_attr attr,
4093 unsigned int val);
4094
4095 /**
4096 * br_port_set_attr - Set a bridge network parameter
4097 * @param: Bridge parameter to set
4098 * @val: Value to be set
4099 * Returns: 0 on success, negative (<0) on failure
4100 */
4101 int (*br_set_net_param)(void *priv, enum drv_br_net_param param,
4102 unsigned int val);
4103
4104 /**
Hai Shalomfdcde762020-04-02 11:19:20 -07004105 * get_wowlan - Get wake-on-wireless status
4106 * @priv: Private driver interface data
4107 */
4108 int (*get_wowlan)(void *priv);
4109
4110 /**
Dmitry Shmidtb58836e2014-04-29 14:35:56 -07004111 * set_wowlan - Set wake-on-wireless triggers
4112 * @priv: Private driver interface data
4113 * @triggers: wowlan triggers
4114 */
4115 int (*set_wowlan)(void *priv, const struct wowlan_triggers *triggers);
4116
4117 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004118 * signal_poll - Get current connection information
4119 * @priv: Private driver interface data
4120 * @signal_info: Connection info structure
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07004121 */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004122 int (*signal_poll)(void *priv, struct wpa_signal_info *signal_info);
Dmitry Shmidtbd567ad2011-05-09 14:17:09 -07004123
4124 /**
Sunil Ravi89eba102022-09-13 21:04:37 -07004125 * mlo_signal_poll - Get current MLO connection information
4126 * @priv: Private driver interface data
4127 * @mlo_signal_info: MLO connection info structure
4128 */
4129 int (*mlo_signal_poll)(void *priv,
4130 struct wpa_mlo_signal_info *mlo_signal_info);
4131
4132 /**
Hai Shalom74f70d42019-02-11 14:42:39 -08004133 * channel_info - Get parameters of the current operating channel
4134 * @priv: Private driver interface data
4135 * @channel_info: Channel info structure
4136 * Returns: 0 on success, negative (<0) on failure
4137 */
4138 int (*channel_info)(void *priv, struct wpa_channel_info *channel_info);
4139
4140 /**
Jouni Malinen75ecf522011-06-27 15:19:46 -07004141 * set_authmode - Set authentication algorithm(s) for static WEP
4142 * @priv: Private driver interface data
4143 * @authmode: 1=Open System, 2=Shared Key, 3=both
4144 * Returns: 0 on success, -1 on failure
4145 *
4146 * This function can be used to set authentication algorithms for AP
4147 * mode when static WEP is used. If the driver uses user space MLME/SME
4148 * implementation, there is no need to implement this function.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004149 *
4150 * DEPRECATED - use set_ap() instead
Jouni Malinen75ecf522011-06-27 15:19:46 -07004151 */
4152 int (*set_authmode)(void *priv, int authmode);
Dmitry Shmidt292b0c32013-11-22 12:54:42 -08004153
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004154#ifdef ANDROID
Jouni Malinen75ecf522011-06-27 15:19:46 -07004155 /**
Dmitry Shmidt292b0c32013-11-22 12:54:42 -08004156 * driver_cmd - Execute driver-specific command
4157 * @priv: Private driver interface data
4158 * @cmd: Command to execute
4159 * @buf: Return buffer
4160 * @buf_len: Buffer length
Dmitry Shmidtbd567ad2011-05-09 14:17:09 -07004161 * Returns: 0 on success, -1 on failure
4162 */
Dmitry Shmidt292b0c32013-11-22 12:54:42 -08004163 int (*driver_cmd)(void *priv, char *cmd, char *buf, size_t buf_len);
4164#endif /* ANDROID */
4165
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004166 /**
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004167 * vendor_cmd - Execute vendor specific command
4168 * @priv: Private driver interface data
4169 * @vendor_id: Vendor id
4170 * @subcmd: Vendor command id
Hai Shalom60840252021-02-19 19:02:11 -08004171 * @nested_attr_flag: Specifies if vendor subcommand uses nested
4172 * attributes or not
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004173 * @data: Vendor command parameters (%NULL if no parameters)
4174 * @data_len: Data length
4175 * @buf: Return buffer (%NULL to ignore reply)
4176 * Returns: 0 on success, negative (<0) on failure
4177 *
4178 * This function handles vendor specific commands that are passed to
4179 * the driver/device. The command is identified by vendor id and
Hai Shalom60840252021-02-19 19:02:11 -08004180 * command id. The nested_attr_flag specifies whether the subcommand
4181 * uses nested attributes or not. Parameters can be passed
4182 * as argument to the command in the data buffer. Reply (if any) will be
4183 * filled in the supplied return buffer.
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004184 *
4185 * The exact driver behavior is driver interface and vendor specific. As
4186 * an example, this will be converted to a vendor specific cfg80211
4187 * command in case of the nl80211 driver interface.
4188 */
4189 int (*vendor_cmd)(void *priv, unsigned int vendor_id,
4190 unsigned int subcmd, const u8 *data, size_t data_len,
Hai Shalom60840252021-02-19 19:02:11 -08004191 enum nested_attr nested_attr_flag,
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004192 struct wpabuf *buf);
4193
4194 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004195 * set_rekey_info - Set rekey information
4196 * @priv: Private driver interface data
4197 * @kek: Current KEK
Dmitry Shmidt807291d2015-01-27 13:40:23 -08004198 * @kek_len: KEK length in octets
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004199 * @kck: Current KCK
Dmitry Shmidt807291d2015-01-27 13:40:23 -08004200 * @kck_len: KCK length in octets
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004201 * @replay_ctr: Current EAPOL-Key Replay Counter
4202 *
4203 * This optional function can be used to provide information for the
4204 * driver/firmware to process EAPOL-Key frames in Group Key Handshake
4205 * while the host (including wpa_supplicant) is sleeping.
4206 */
Dmitry Shmidt807291d2015-01-27 13:40:23 -08004207 void (*set_rekey_info)(void *priv, const u8 *kek, size_t kek_len,
4208 const u8 *kck, size_t kck_len,
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004209 const u8 *replay_ctr);
4210
4211 /**
4212 * sta_assoc - Station association indication
4213 * @priv: Private driver interface data
4214 * @own_addr: Source address and BSSID for association frame
4215 * @addr: MAC address of the station to associate
4216 * @reassoc: flag to indicate re-association
4217 * @status: association response status code
4218 * @ie: assoc response ie buffer
4219 * @len: ie buffer length
4220 * Returns: 0 on success, -1 on failure
4221 *
4222 * This function indicates the driver to send (Re)Association
4223 * Response frame to the station.
4224 */
4225 int (*sta_assoc)(void *priv, const u8 *own_addr, const u8 *addr,
4226 int reassoc, u16 status, const u8 *ie, size_t len);
4227
4228 /**
4229 * sta_auth - Station authentication indication
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004230 * @priv: private driver interface data
4231 * @params: Station authentication parameters
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004232 *
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004233 * Returns: 0 on success, -1 on failure
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004234 */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004235 int (*sta_auth)(void *priv,
4236 struct wpa_driver_sta_auth_params *params);
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004237
4238 /**
4239 * add_tspec - Add traffic stream
4240 * @priv: Private driver interface data
4241 * @addr: MAC address of the station to associate
4242 * @tspec_ie: tspec ie buffer
4243 * @tspec_ielen: tspec ie length
4244 * Returns: 0 on success, -1 on failure
4245 *
4246 * This function adds the traffic steam for the station
4247 * and fills the medium_time in tspec_ie.
4248 */
4249 int (*add_tspec)(void *priv, const u8 *addr, u8 *tspec_ie,
4250 size_t tspec_ielen);
4251
4252 /**
4253 * add_sta_node - Add a station node in the driver
4254 * @priv: Private driver interface data
4255 * @addr: MAC address of the station to add
4256 * @auth_alg: authentication algorithm used by the station
4257 * Returns: 0 on success, -1 on failure
4258 *
4259 * This function adds the station node in the driver, when
4260 * the station gets added by FT-over-DS.
4261 */
4262 int (*add_sta_node)(void *priv, const u8 *addr, u16 auth_alg);
4263
4264 /**
4265 * sched_scan - Request the driver to initiate scheduled scan
4266 * @priv: Private driver interface data
4267 * @params: Scan parameters
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004268 * Returns: 0 on success, -1 on failure
4269 *
4270 * This operation should be used for scheduled scan offload to
4271 * the hardware. Every time scan results are available, the
4272 * driver should report scan results event for wpa_supplicant
4273 * which will eventually request the results with
4274 * wpa_driver_get_scan_results2(). This operation is optional
4275 * and if not provided or if it returns -1, we fall back to
4276 * normal host-scheduled scans.
4277 */
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08004278 int (*sched_scan)(void *priv, struct wpa_driver_scan_params *params);
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004279
4280 /**
4281 * stop_sched_scan - Request the driver to stop a scheduled scan
4282 * @priv: Private driver interface data
4283 * Returns: 0 on success, -1 on failure
4284 *
4285 * This should cause the scheduled scan to be stopped and
4286 * results should stop being sent. Must be supported if
4287 * sched_scan is supported.
4288 */
4289 int (*stop_sched_scan)(void *priv);
4290
4291 /**
4292 * poll_client - Probe (null data or such) the given station
4293 * @priv: Private driver interface data
4294 * @own_addr: MAC address of sending interface
4295 * @addr: MAC address of the station to probe
4296 * @qos: Indicates whether station is QoS station
4297 *
4298 * This function is used to verify whether an associated station is
4299 * still present. This function does not need to be implemented if the
4300 * driver provides such inactivity polling mechanism.
4301 */
4302 void (*poll_client)(void *priv, const u8 *own_addr,
4303 const u8 *addr, int qos);
Dmitry Shmidt04949592012-07-19 12:16:46 -07004304
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004305 /**
Dmitry Shmidt04949592012-07-19 12:16:46 -07004306 * radio_disable - Disable/enable radio
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004307 * @priv: Private driver interface data
Dmitry Shmidt04949592012-07-19 12:16:46 -07004308 * @disabled: 1=disable 0=enable radio
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004309 * Returns: 0 on success, -1 on failure
4310 *
Dmitry Shmidt04949592012-07-19 12:16:46 -07004311 * This optional command is for testing purposes. It can be used to
4312 * disable the radio on a testbed device to simulate out-of-radio-range
4313 * conditions.
4314 */
4315 int (*radio_disable)(void *priv, int disabled);
4316
4317 /**
4318 * switch_channel - Announce channel switch and migrate the GO to the
4319 * given frequency
4320 * @priv: Private driver interface data
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08004321 * @settings: Settings for CSA period and new channel
Dmitry Shmidt04949592012-07-19 12:16:46 -07004322 * Returns: 0 on success, -1 on failure
4323 *
4324 * This function is used to move the GO to the legacy STA channel to
4325 * avoid frequency conflict in single channel concurrency.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004326 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08004327 int (*switch_channel)(void *priv, struct csa_settings *settings);
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004328
4329 /**
Sunil Ravia04bd252022-05-02 22:54:18 -07004330 * switch_color - Announce color switch and migrate the BSS to the
4331 * given color
4332 * @priv: Private driver interface data
4333 * @settings: Settings for CCA period and new color
4334 * Returns: 0 on success, -1 on failure
4335 *
4336 * This function is used to move the BSS to its new color.
4337 */
4338 int (*switch_color)(void *priv, struct cca_settings *settings);
4339
4340 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004341 * add_tx_ts - Add traffic stream
4342 * @priv: Private driver interface data
4343 * @tsid: Traffic stream ID
4344 * @addr: Receiver address
4345 * @user_prio: User priority of the traffic stream
4346 * @admitted_time: Admitted time for this TS in units of
4347 * 32 microsecond periods (per second).
4348 * Returns: 0 on success, -1 on failure
4349 */
4350 int (*add_tx_ts)(void *priv, u8 tsid, const u8 *addr, u8 user_prio,
4351 u16 admitted_time);
4352
4353 /**
4354 * del_tx_ts - Delete traffic stream
4355 * @priv: Private driver interface data
4356 * @tsid: Traffic stream ID
4357 * @addr: Receiver address
4358 * Returns: 0 on success, -1 on failure
4359 */
4360 int (*del_tx_ts)(void *priv, u8 tsid, const u8 *addr);
4361
4362 /**
4363 * Enable channel-switching with TDLS peer
4364 * @priv: Private driver interface data
4365 * @addr: MAC address of the TDLS peer
4366 * @oper_class: Operating class of the switch channel
4367 * @params: Channel specification
4368 * Returns: 0 on success, -1 on failure
4369 *
4370 * The function indicates to driver that it can start switching to a
4371 * different channel with a specified TDLS peer. The switching is
4372 * assumed on until canceled with tdls_disable_channel_switch().
4373 */
4374 int (*tdls_enable_channel_switch)(
4375 void *priv, const u8 *addr, u8 oper_class,
4376 const struct hostapd_freq_params *params);
4377
4378 /**
4379 * Disable channel switching with TDLS peer
4380 * @priv: Private driver interface data
4381 * @addr: MAC address of the TDLS peer
4382 * Returns: 0 on success, -1 on failure
4383 *
4384 * This function indicates to the driver that it should stop switching
4385 * with a given TDLS peer.
4386 */
4387 int (*tdls_disable_channel_switch)(void *priv, const u8 *addr);
4388
4389 /**
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004390 * start_dfs_cac - Listen for radar interference on the channel
4391 * @priv: Private driver interface data
Dmitry Shmidt051af732013-10-22 13:52:46 -07004392 * @freq: Channel parameters
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004393 * Returns: 0 on success, -1 on failure
4394 */
Dmitry Shmidt051af732013-10-22 13:52:46 -07004395 int (*start_dfs_cac)(void *priv, struct hostapd_freq_params *freq);
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004396
4397 /**
4398 * stop_ap - Removes beacon from AP
4399 * @priv: Private driver interface data
4400 * Returns: 0 on success, -1 on failure (or if not supported)
4401 *
4402 * This optional function can be used to disable AP mode related
4403 * configuration. Unlike deinit_ap, it does not change to station
4404 * mode.
4405 */
4406 int (*stop_ap)(void *priv);
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07004407
4408 /**
4409 * get_survey - Retrieve survey data
4410 * @priv: Private driver interface data
4411 * @freq: If set, survey data for the specified frequency is only
4412 * being requested. If not set, all survey data is requested.
4413 * Returns: 0 on success, -1 on failure
4414 *
4415 * Use this to retrieve:
4416 *
4417 * - the observed channel noise floor
4418 * - the amount of time we have spent on the channel
4419 * - the amount of time during which we have spent on the channel that
4420 * the radio has determined the medium is busy and we cannot
4421 * transmit
4422 * - the amount of time we have spent receiving data
4423 * - the amount of time we have spent transmitting data
4424 *
4425 * This data can be used for spectrum heuristics. One example is
4426 * Automatic Channel Selection (ACS). The channel survey data is
4427 * kept on a linked list on the channel data, one entry is added
4428 * for each survey. The min_nf of the channel is updated for each
4429 * survey.
4430 */
4431 int (*get_survey)(void *priv, unsigned int freq);
Dmitry Shmidt56052862013-10-04 10:23:25 -07004432
4433 /**
4434 * status - Get driver interface status information
4435 * @priv: Private driver interface data
Hai Shalom74f70d42019-02-11 14:42:39 -08004436 * @buf: Buffer for printing the status information
Dmitry Shmidt56052862013-10-04 10:23:25 -07004437 * @buflen: Maximum length of the buffer
4438 * Returns: Length of written status information or -1 on failure
4439 */
4440 int (*status)(void *priv, char *buf, size_t buflen);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004441
Dmitry Shmidt661b4f72014-09-29 14:58:27 -07004442 /**
4443 * roaming - Set roaming policy for driver-based BSS selection
4444 * @priv: Private driver interface data
4445 * @allowed: Whether roaming within ESS is allowed
4446 * @bssid: Forced BSSID if roaming is disabled or %NULL if not set
4447 * Returns: Length of written status information or -1 on failure
4448 *
4449 * This optional callback can be used to update roaming policy from the
4450 * associate() command (bssid being set there indicates that the driver
4451 * should not roam before getting this roaming() call to allow roaming.
4452 * If the driver does not indicate WPA_DRIVER_FLAGS_BSS_SELECTION
4453 * capability, roaming policy is handled within wpa_supplicant and there
4454 * is no need to implement or react to this callback.
4455 */
4456 int (*roaming)(void *priv, int allowed, const u8 *bssid);
4457
4458 /**
Roshan Pius3a1667e2018-07-03 15:17:14 -07004459 * disable_fils - Enable/disable FILS feature
4460 * @priv: Private driver interface data
4461 * @disable: 0-enable and 1-disable FILS feature
4462 * Returns: 0 on success, -1 on failure
4463 *
4464 * This callback can be used to configure driver and below layers to
4465 * enable/disable all FILS features.
4466 */
4467 int (*disable_fils)(void *priv, int disable);
4468
4469 /**
Dmitry Shmidt661b4f72014-09-29 14:58:27 -07004470 * set_mac_addr - Set MAC address
4471 * @priv: Private driver interface data
4472 * @addr: MAC address to use or %NULL for setting back to permanent
4473 * Returns: 0 on success, -1 on failure
4474 */
4475 int (*set_mac_addr)(void *priv, const u8 *addr);
4476
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004477#ifdef CONFIG_MACSEC
4478 int (*macsec_init)(void *priv, struct macsec_init_params *params);
4479
4480 int (*macsec_deinit)(void *priv);
4481
4482 /**
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004483 * macsec_get_capability - Inform MKA of this driver's capability
4484 * @priv: Private driver interface data
4485 * @cap: Driver's capability
4486 * Returns: 0 on success, -1 on failure
4487 */
4488 int (*macsec_get_capability)(void *priv, enum macsec_cap *cap);
4489
4490 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004491 * enable_protect_frames - Set protect frames status
4492 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004493 * @enabled: true = protect frames enabled
4494 * false = protect frames disabled
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004495 * Returns: 0 on success, -1 on failure (or if not supported)
4496 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004497 int (*enable_protect_frames)(void *priv, bool enabled);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004498
4499 /**
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004500 * enable_encrypt - Set encryption status
4501 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004502 * @enabled: true = encrypt outgoing traffic
4503 * false = integrity-only protection on outgoing traffic
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004504 * Returns: 0 on success, -1 on failure (or if not supported)
4505 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004506 int (*enable_encrypt)(void *priv, bool enabled);
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004507
4508 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004509 * set_replay_protect - Set replay protect status and window size
4510 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004511 * @enabled: true = replay protect enabled
4512 * false = replay protect disabled
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004513 * @window: replay window size, valid only when replay protect enabled
4514 * Returns: 0 on success, -1 on failure (or if not supported)
4515 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004516 int (*set_replay_protect)(void *priv, bool enabled, u32 window);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004517
4518 /**
4519 * set_current_cipher_suite - Set current cipher suite
4520 * @priv: Private driver interface data
4521 * @cs: EUI64 identifier
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004522 * Returns: 0 on success, -1 on failure (or if not supported)
4523 */
Dmitry Shmidt7d175302016-09-06 13:11:34 -07004524 int (*set_current_cipher_suite)(void *priv, u64 cs);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004525
4526 /**
4527 * enable_controlled_port - Set controlled port status
4528 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004529 * @enabled: true = controlled port enabled
4530 * false = controlled port disabled
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004531 * Returns: 0 on success, -1 on failure (or if not supported)
4532 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004533 int (*enable_controlled_port)(void *priv, bool enabled);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004534
4535 /**
4536 * get_receive_lowest_pn - Get receive lowest pn
4537 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004538 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004539 * Returns: 0 on success, -1 on failure (or if not supported)
4540 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004541 int (*get_receive_lowest_pn)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004542
4543 /**
4544 * get_transmit_next_pn - Get transmit next pn
4545 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004546 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004547 * Returns: 0 on success, -1 on failure (or if not supported)
4548 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004549 int (*get_transmit_next_pn)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004550
4551 /**
4552 * set_transmit_next_pn - Set transmit next pn
4553 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004554 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004555 * Returns: 0 on success, -1 on failure (or if not supported)
4556 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004557 int (*set_transmit_next_pn)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004558
4559 /**
Hai Shalom74f70d42019-02-11 14:42:39 -08004560 * set_receive_lowest_pn - Set receive lowest PN
4561 * @priv: Private driver interface data
4562 * @sa: secure association
4563 * Returns: 0 on success, -1 on failure (or if not supported)
4564 */
4565 int (*set_receive_lowest_pn)(void *priv, struct receive_sa *sa);
4566
4567 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004568 * create_receive_sc - create secure channel for receiving
4569 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004570 * @sc: secure channel
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004571 * @conf_offset: confidentiality offset (0, 30, or 50)
4572 * @validation: frame validation policy (0 = Disabled, 1 = Checked,
4573 * 2 = Strict)
4574 * Returns: 0 on success, -1 on failure (or if not supported)
4575 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004576 int (*create_receive_sc)(void *priv, struct receive_sc *sc,
4577 unsigned int conf_offset,
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004578 int validation);
4579
4580 /**
4581 * delete_receive_sc - delete secure connection for receiving
4582 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004583 * @sc: secure channel
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004584 * Returns: 0 on success, -1 on failure
4585 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004586 int (*delete_receive_sc)(void *priv, struct receive_sc *sc);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004587
4588 /**
4589 * create_receive_sa - create secure association for receive
4590 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004591 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004592 * Returns: 0 on success, -1 on failure
4593 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004594 int (*create_receive_sa)(void *priv, struct receive_sa *sa);
4595
4596 /**
4597 * delete_receive_sa - Delete secure association for receive
4598 * @priv: Private driver interface data from init()
4599 * @sa: Secure association
4600 * Returns: 0 on success, -1 on failure
4601 */
4602 int (*delete_receive_sa)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004603
4604 /**
4605 * enable_receive_sa - enable the SA for receive
4606 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004607 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004608 * Returns: 0 on success, -1 on failure
4609 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004610 int (*enable_receive_sa)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004611
4612 /**
4613 * disable_receive_sa - disable SA for receive
4614 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004615 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004616 * Returns: 0 on success, -1 on failure
4617 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004618 int (*disable_receive_sa)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004619
4620 /**
4621 * create_transmit_sc - create secure connection for transmit
4622 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004623 * @sc: secure channel
4624 * @conf_offset: confidentiality offset (0, 30, or 50)
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004625 * Returns: 0 on success, -1 on failure
4626 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004627 int (*create_transmit_sc)(void *priv, struct transmit_sc *sc,
4628 unsigned int conf_offset);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004629
4630 /**
4631 * delete_transmit_sc - delete secure connection for transmit
4632 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004633 * @sc: secure channel
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004634 * Returns: 0 on success, -1 on failure
4635 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004636 int (*delete_transmit_sc)(void *priv, struct transmit_sc *sc);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004637
4638 /**
4639 * create_transmit_sa - create secure association for transmit
4640 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004641 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004642 * Returns: 0 on success, -1 on failure
4643 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004644 int (*create_transmit_sa)(void *priv, struct transmit_sa *sa);
4645
4646 /**
4647 * delete_transmit_sa - Delete secure association for transmit
4648 * @priv: Private driver interface data from init()
4649 * @sa: Secure association
4650 * Returns: 0 on success, -1 on failure
4651 */
4652 int (*delete_transmit_sa)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004653
4654 /**
4655 * enable_transmit_sa - enable SA for transmit
4656 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004657 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004658 * Returns: 0 on success, -1 on failure
4659 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004660 int (*enable_transmit_sa)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004661
4662 /**
4663 * disable_transmit_sa - disable SA for transmit
4664 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004665 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004666 * Returns: 0 on success, -1 on failure
4667 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004668 int (*disable_transmit_sa)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004669#endif /* CONFIG_MACSEC */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004670
4671 /**
4672 * init_mesh - Driver specific initialization for mesh
4673 * @priv: Private driver interface data
4674 * Returns: 0 on success, -1 on failure
4675 */
4676 int (*init_mesh)(void *priv);
4677
4678 /**
4679 * join_mesh - Join a mesh network
4680 * @priv: Private driver interface data
4681 * @params: Mesh configuration parameters
4682 * Returns: 0 on success, -1 on failure
4683 */
4684 int (*join_mesh)(void *priv,
4685 struct wpa_driver_mesh_join_params *params);
4686
4687 /**
4688 * leave_mesh - Leave a mesh network
4689 * @priv: Private driver interface data
4690 * Returns 0 on success, -1 on failure
4691 */
4692 int (*leave_mesh)(void *priv);
4693
4694 /**
Hai Shalom81f62d82019-07-22 12:10:00 -07004695 * probe_mesh_link - Inject a frame over direct mesh link to a given
4696 * peer skipping the next_hop lookup from mpath table.
4697 * @priv: Private driver interface data
4698 * @addr: Peer MAC address
4699 * @eth: Ethernet frame to be sent
4700 * @len: Ethernet frame lengtn in bytes
4701 * Returns 0 on success, -1 on failure
4702 */
4703 int (*probe_mesh_link)(void *priv, const u8 *addr, const u8 *eth,
4704 size_t len);
4705
4706 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004707 * do_acs - Automatically select channel
4708 * @priv: Private driver interface data
4709 * @params: Parameters for ACS
4710 * Returns 0 on success, -1 on failure
4711 *
4712 * This command can be used to offload ACS to the driver if the driver
4713 * indicates support for such offloading (WPA_DRIVER_FLAGS_ACS_OFFLOAD).
4714 */
4715 int (*do_acs)(void *priv, struct drv_acs_params *params);
Ravi Joshie6ccb162015-07-16 17:45:41 -07004716
4717 /**
Hai Shalom60840252021-02-19 19:02:11 -08004718 * set_band - Notify driver of band(s) selection
Ravi Joshie6ccb162015-07-16 17:45:41 -07004719 * @priv: Private driver interface data
Hai Shalom60840252021-02-19 19:02:11 -08004720 * @band_mask: The selected band(s) bit mask (from enum set_band)
Ravi Joshie6ccb162015-07-16 17:45:41 -07004721 * Returns 0 on success, -1 on failure
4722 */
Hai Shalom60840252021-02-19 19:02:11 -08004723 int (*set_band)(void *priv, u32 band_mask);
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08004724
4725 /**
4726 * get_pref_freq_list - Get preferred frequency list for an interface
4727 * @priv: Private driver interface data
4728 * @if_type: Interface type
4729 * @num: Number of channels
Sunil8cd6f4d2022-06-28 18:40:46 +00004730 * @freq_list: Weighted preferred channel list
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08004731 * Returns 0 on success, -1 on failure
4732 *
4733 * This command can be used to query the preferred frequency list from
Sunil8cd6f4d2022-06-28 18:40:46 +00004734 * the driver specific to a particular interface type. The freq_list
4735 * array needs to have room for *num entries. *num will be updated to
4736 * indicate the number of entries fetched from the driver.
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08004737 */
4738 int (*get_pref_freq_list)(void *priv, enum wpa_driver_if_type if_type,
Sunil8cd6f4d2022-06-28 18:40:46 +00004739 unsigned int *num,
4740 struct weighted_pcl *freq_list);
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08004741
4742 /**
4743 * set_prob_oper_freq - Indicate probable P2P operating channel
4744 * @priv: Private driver interface data
4745 * @freq: Channel frequency in MHz
4746 * Returns 0 on success, -1 on failure
4747 *
4748 * This command can be used to inform the driver of the operating
4749 * frequency that an ongoing P2P group formation is likely to come up
4750 * on. Local device is assuming P2P Client role.
4751 */
4752 int (*set_prob_oper_freq)(void *priv, unsigned int freq);
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08004753
4754 /**
4755 * abort_scan - Request the driver to abort an ongoing scan
4756 * @priv: Private driver interface data
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004757 * @scan_cookie: Cookie identifying the scan request. This is used only
4758 * when the vendor interface QCA_NL80211_VENDOR_SUBCMD_TRIGGER_SCAN
4759 * was used to trigger scan. Otherwise, 0 is used.
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08004760 * Returns 0 on success, -1 on failure
4761 */
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004762 int (*abort_scan)(void *priv, u64 scan_cookie);
Dmitry Shmidt849734c2016-05-27 09:59:01 -07004763
4764 /**
4765 * configure_data_frame_filters - Request to configure frame filters
4766 * @priv: Private driver interface data
4767 * @filter_flags: The type of frames to filter (bitfield of
4768 * WPA_DATA_FRAME_FILTER_FLAG_*)
4769 * Returns: 0 on success or -1 on failure
4770 */
4771 int (*configure_data_frame_filters)(void *priv, u32 filter_flags);
Dmitry Shmidtd5ab1b52016-06-21 12:38:41 -07004772
4773 /**
4774 * get_ext_capab - Get extended capabilities for the specified interface
4775 * @priv: Private driver interface data
4776 * @type: Interface type for which to get extended capabilities
4777 * @ext_capab: Extended capabilities fetched
4778 * @ext_capab_mask: Extended capabilities mask
4779 * @ext_capab_len: Length of the extended capabilities
4780 * Returns: 0 on success or -1 on failure
4781 */
4782 int (*get_ext_capab)(void *priv, enum wpa_driver_if_type type,
4783 const u8 **ext_capab, const u8 **ext_capab_mask,
4784 unsigned int *ext_capab_len);
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07004785
4786 /**
4787 * p2p_lo_start - Start offloading P2P listen to device
4788 * @priv: Private driver interface data
4789 * @freq: Listening frequency (MHz) for P2P listen
4790 * @period: Length of the listen operation in milliseconds
4791 * @interval: Interval for running the listen operation in milliseconds
4792 * @count: Number of times to run the listen operation
4793 * @device_types: Device primary and secondary types
4794 * @dev_types_len: Number of bytes for device_types
4795 * @ies: P2P IE and WSC IE for Probe Response frames
4796 * @ies_len: Length of ies in bytes
4797 * Returns: 0 on success or -1 on failure
4798 */
4799 int (*p2p_lo_start)(void *priv, unsigned int freq,
4800 unsigned int period, unsigned int interval,
4801 unsigned int count,
4802 const u8 *device_types, size_t dev_types_len,
4803 const u8 *ies, size_t ies_len);
4804
4805 /**
4806 * p2p_lo_stop - Stop P2P listen offload
4807 * @priv: Private driver interface data
4808 * Returns: 0 on success or -1 on failure
4809 */
4810 int (*p2p_lo_stop)(void *priv);
Dmitry Shmidt7f2c7532016-08-15 09:48:12 -07004811
4812 /**
4813 * set_default_scan_ies - Set default scan IEs
4814 * @priv: Private driver interface data
4815 * @ies: Scan default IEs buffer
4816 * @ies_len: Length of IEs in bytes
4817 * Returns: 0 on success or -1 on failure
4818 *
4819 * The driver can use these by default when there are no scan IEs coming
4820 * in the subsequent scan requests. Also in case of one or more of IEs
4821 * given in set_default_scan_ies() are missing in the subsequent scan
4822 * request, the driver should merge the missing scan IEs in the scan
4823 * request from the IEs set by set_default_scan_ies() in the Probe
4824 * Request frames sent.
4825 */
4826 int (*set_default_scan_ies)(void *priv, const u8 *ies, size_t ies_len);
4827
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004828 /**
4829 * set_tdls_mode - Set TDLS trigger mode to the host driver
4830 * @priv: Private driver interface data
4831 * @tdls_external_control: Represents if TDLS external trigger control
4832 * mode is enabled/disabled.
4833 *
4834 * This optional callback can be used to configure the TDLS external
4835 * trigger control mode to the host driver.
4836 */
4837 int (*set_tdls_mode)(void *priv, int tdls_external_control);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004838
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004839 /**
4840 * get_bss_transition_status - Get candidate BSS's transition status
4841 * @priv: Private driver interface data
4842 * @params: Candidate BSS list
4843 *
4844 * Get the accept or reject reason code for a list of BSS transition
4845 * candidates.
4846 */
4847 struct wpa_bss_candidate_info *
4848 (*get_bss_transition_status)(void *priv,
4849 struct wpa_bss_trans_info *params);
4850 /**
4851 * ignore_assoc_disallow - Configure driver to ignore assoc_disallow
4852 * @priv: Private driver interface data
4853 * @ignore_disallow: 0 to not ignore, 1 to ignore
4854 * Returns: 0 on success, -1 on failure
4855 */
4856 int (*ignore_assoc_disallow)(void *priv, int ignore_disallow);
4857
4858 /**
Hai Shalom899fcc72020-10-19 14:38:18 -07004859 * set_bssid_tmp_disallow - Set disallowed BSSIDs to the driver
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004860 * @priv: Private driver interface data
Hai Shalom899fcc72020-10-19 14:38:18 -07004861 * @num_bssid: Number of temporarily disallowed BSSIDs
4862 * @bssids: List of temporarily disallowed BSSIDs
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004863 */
Hai Shalom899fcc72020-10-19 14:38:18 -07004864 int (*set_bssid_tmp_disallow)(void *priv, unsigned int num_bssid,
4865 const u8 *bssid);
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004866
4867 /**
4868 * update_connect_params - Update the connection parameters
4869 * @priv: Private driver interface data
4870 * @params: Association parameters
4871 * @mask: Bit mask indicating which parameters in @params have to be
4872 * updated
4873 * Returns: 0 on success, -1 on failure
4874 *
4875 * Update the connection parameters when in connected state so that the
4876 * driver uses the updated parameters for subsequent roaming. This is
4877 * used only with drivers that implement internal BSS selection and
4878 * roaming.
4879 */
4880 int (*update_connect_params)(
4881 void *priv, struct wpa_driver_associate_params *params,
4882 enum wpa_drv_update_connect_params_mask mask);
Roshan Pius3a1667e2018-07-03 15:17:14 -07004883
4884 /**
4885 * send_external_auth_status - Indicate the status of external
4886 * authentication processing to the host driver.
4887 * @priv: Private driver interface data
4888 * @params: Status of authentication processing.
4889 * Returns: 0 on success, -1 on failure
4890 */
4891 int (*send_external_auth_status)(void *priv,
4892 struct external_auth *params);
Hai Shalom74f70d42019-02-11 14:42:39 -08004893
4894 /**
4895 * set_4addr_mode - Set 4-address mode
4896 * @priv: Private driver interface data
4897 * @bridge_ifname: Bridge interface name
4898 * @val: 0 - disable 4addr mode, 1 - enable 4addr mode
4899 * Returns: 0 on success, < 0 on failure
4900 */
4901 int (*set_4addr_mode)(void *priv, const char *bridge_ifname, int val);
Hai Shalom81f62d82019-07-22 12:10:00 -07004902
4903 /**
4904 * update_dh_ie - Update DH IE
4905 * @priv: Private driver interface data
4906 * @peer_mac: Peer MAC address
4907 * @reason_code: Reacon code
4908 * @ie: DH IE
4909 * @ie_len: DH IE length in bytes
4910 * Returns: 0 on success, -1 on failure
4911 *
4912 * This callback is used to let the driver know the DH processing result
4913 * and DH IE for a pending association.
4914 */
4915 int (*update_dh_ie)(void *priv, const u8 *peer_mac, u16 reason_code,
4916 const u8 *ie, size_t ie_len);
Hai Shalomb755a2a2020-04-23 21:49:02 -07004917
4918 /**
4919 * dpp_listen - Notify driver about start/stop of DPP listen
4920 * @priv: Private driver interface data
4921 * @enable: Whether listen state is enabled (or disabled)
4922 * Returns: 0 on success, -1 on failure
4923 *
4924 * This optional callback can be used to update RX frame filtering to
4925 * explicitly allow reception of broadcast Public Action frames.
4926 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004927 int (*dpp_listen)(void *priv, bool enable);
Hai Shalomc1a21442022-02-04 13:43:00 -08004928
Sunil Ravi89eba102022-09-13 21:04:37 -07004929 /**
4930 * set_secure_ranging_ctx - Add or delete secure ranging parameters of
4931 * the specified peer to the driver.
4932 * @priv: Private driver interface data
4933 * @params: Secure ranging parameters
4934 * Returns: 0 on success, -1 on failure
4935 *
4936 */
4937 int (*set_secure_ranging_ctx)(void *priv,
4938 struct secure_ranging_params *params);
4939
4940 /**
4941 * send_pasn_resp - Send PASN response for a set of peers to the
4942 * driver.
4943 * @priv: Private driver interface data
4944 * @params: Parameters holding peers and respective status.
4945 * Returns: 0 on success, -1 on failure
4946 */
4947 int (*send_pasn_resp)(void *priv, struct pasn_auth *params);
4948
4949 /**
4950 * get_sta_mlo_info - Get the current multi-link association info
4951 * @priv: Private driver interface data
4952 * @mlo: Pointer to fill multi-link association info
4953 * Returns: 0 on success, -1 on failure
4954 *
4955 * This callback is used to fetch multi-link of the current association.
4956 */
4957 int (*get_sta_mlo_info)(void *priv,
4958 struct driver_sta_mlo_info *mlo_info);
4959
Hai Shalomc1a21442022-02-04 13:43:00 -08004960#ifdef CONFIG_TESTING_OPTIONS
4961 int (*register_frame)(void *priv, u16 type,
4962 const u8 *match, size_t match_len,
4963 bool multicast);
4964#endif /* CONFIG_TESTING_OPTIONS */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004965};
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004966
4967/**
4968 * enum wpa_event_type - Event type for wpa_supplicant_event() calls
4969 */
4970enum wpa_event_type {
4971 /**
4972 * EVENT_ASSOC - Association completed
4973 *
4974 * This event needs to be delivered when the driver completes IEEE
4975 * 802.11 association or reassociation successfully.
4976 * wpa_driver_ops::get_bssid() is expected to provide the current BSSID
4977 * after this event has been generated. In addition, optional
4978 * EVENT_ASSOCINFO may be generated just before EVENT_ASSOC to provide
4979 * more information about the association. If the driver interface gets
4980 * both of these events at the same time, it can also include the
4981 * assoc_info data in EVENT_ASSOC call.
4982 */
4983 EVENT_ASSOC,
4984
4985 /**
4986 * EVENT_DISASSOC - Association lost
4987 *
4988 * This event should be called when association is lost either due to
4989 * receiving deauthenticate or disassociate frame from the AP or when
4990 * sending either of these frames to the current AP. If the driver
4991 * supports separate deauthentication event, EVENT_DISASSOC should only
4992 * be used for disassociation and EVENT_DEAUTH for deauthentication.
4993 * In AP mode, union wpa_event_data::disassoc_info is required.
4994 */
4995 EVENT_DISASSOC,
4996
4997 /**
4998 * EVENT_MICHAEL_MIC_FAILURE - Michael MIC (TKIP) detected
4999 *
5000 * This event must be delivered when a Michael MIC error is detected by
5001 * the local driver. Additional data for event processing is
5002 * provided with union wpa_event_data::michael_mic_failure. This
Sunil Ravia04bd252022-05-02 22:54:18 -07005003 * information is used to request new encryption key and to initiate
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005004 * TKIP countermeasures if needed.
5005 */
5006 EVENT_MICHAEL_MIC_FAILURE,
5007
5008 /**
5009 * EVENT_SCAN_RESULTS - Scan results available
5010 *
5011 * This event must be called whenever scan results are available to be
5012 * fetched with struct wpa_driver_ops::get_scan_results(). This event
5013 * is expected to be used some time after struct wpa_driver_ops::scan()
5014 * is called. If the driver provides an unsolicited event when the scan
5015 * has been completed, this event can be used to trigger
5016 * EVENT_SCAN_RESULTS call. If such event is not available from the
5017 * driver, the driver wrapper code is expected to use a registered
5018 * timeout to generate EVENT_SCAN_RESULTS call after the time that the
5019 * scan is expected to be completed. Optional information about
5020 * completed scan can be provided with union wpa_event_data::scan_info.
5021 */
5022 EVENT_SCAN_RESULTS,
5023
5024 /**
5025 * EVENT_ASSOCINFO - Report optional extra information for association
5026 *
5027 * This event can be used to report extra association information for
5028 * EVENT_ASSOC processing. This extra information includes IEs from
5029 * association frames and Beacon/Probe Response frames in union
5030 * wpa_event_data::assoc_info. EVENT_ASSOCINFO must be send just before
5031 * EVENT_ASSOC. Alternatively, the driver interface can include
5032 * assoc_info data in the EVENT_ASSOC call if it has all the
5033 * information available at the same point.
5034 */
5035 EVENT_ASSOCINFO,
5036
5037 /**
5038 * EVENT_INTERFACE_STATUS - Report interface status changes
5039 *
5040 * This optional event can be used to report changes in interface
5041 * status (interface added/removed) using union
5042 * wpa_event_data::interface_status. This can be used to trigger
5043 * wpa_supplicant to stop and re-start processing for the interface,
5044 * e.g., when a cardbus card is ejected/inserted.
5045 */
5046 EVENT_INTERFACE_STATUS,
5047
5048 /**
5049 * EVENT_PMKID_CANDIDATE - Report a candidate AP for pre-authentication
5050 *
5051 * This event can be used to inform wpa_supplicant about candidates for
5052 * RSN (WPA2) pre-authentication. If wpa_supplicant is not responsible
5053 * for scan request (ap_scan=2 mode), this event is required for
5054 * pre-authentication. If wpa_supplicant is performing scan request
5055 * (ap_scan=1), this event is optional since scan results can be used
5056 * to add pre-authentication candidates. union
5057 * wpa_event_data::pmkid_candidate is used to report the BSSID of the
5058 * candidate and priority of the candidate, e.g., based on the signal
5059 * strength, in order to try to pre-authenticate first with candidates
5060 * that are most likely targets for re-association.
5061 *
5062 * EVENT_PMKID_CANDIDATE can be called whenever the driver has updates
5063 * on the candidate list. In addition, it can be called for the current
5064 * AP and APs that have existing PMKSA cache entries. wpa_supplicant
5065 * will automatically skip pre-authentication in cases where a valid
5066 * PMKSA exists. When more than one candidate exists, this event should
5067 * be generated once for each candidate.
5068 *
5069 * Driver will be notified about successful pre-authentication with
5070 * struct wpa_driver_ops::add_pmkid() calls.
5071 */
5072 EVENT_PMKID_CANDIDATE,
5073
5074 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005075 * EVENT_TDLS - Request TDLS operation
5076 *
5077 * This event can be used to request a TDLS operation to be performed.
5078 */
5079 EVENT_TDLS,
5080
5081 /**
5082 * EVENT_FT_RESPONSE - Report FT (IEEE 802.11r) response IEs
5083 *
5084 * The driver is expected to report the received FT IEs from
5085 * FT authentication sequence from the AP. The FT IEs are included in
5086 * the extra information in union wpa_event_data::ft_ies.
5087 */
5088 EVENT_FT_RESPONSE,
5089
5090 /**
5091 * EVENT_IBSS_RSN_START - Request RSN authentication in IBSS
5092 *
5093 * The driver can use this event to inform wpa_supplicant about a STA
5094 * in an IBSS with which protected frames could be exchanged. This
5095 * event starts RSN authentication with the other STA to authenticate
5096 * the STA and set up encryption keys with it.
5097 */
5098 EVENT_IBSS_RSN_START,
5099
5100 /**
5101 * EVENT_AUTH - Authentication result
5102 *
5103 * This event should be called when authentication attempt has been
5104 * completed. This is only used if the driver supports separate
5105 * authentication step (struct wpa_driver_ops::authenticate).
5106 * Information about authentication result is included in
5107 * union wpa_event_data::auth.
5108 */
5109 EVENT_AUTH,
5110
5111 /**
5112 * EVENT_DEAUTH - Authentication lost
5113 *
5114 * This event should be called when authentication is lost either due
5115 * to receiving deauthenticate frame from the AP or when sending that
5116 * frame to the current AP.
5117 * In AP mode, union wpa_event_data::deauth_info is required.
5118 */
5119 EVENT_DEAUTH,
5120
5121 /**
5122 * EVENT_ASSOC_REJECT - Association rejected
5123 *
5124 * This event should be called when (re)association attempt has been
5125 * rejected by the AP. Information about the association response is
5126 * included in union wpa_event_data::assoc_reject.
5127 */
5128 EVENT_ASSOC_REJECT,
5129
5130 /**
5131 * EVENT_AUTH_TIMED_OUT - Authentication timed out
5132 */
5133 EVENT_AUTH_TIMED_OUT,
5134
5135 /**
5136 * EVENT_ASSOC_TIMED_OUT - Association timed out
5137 */
5138 EVENT_ASSOC_TIMED_OUT,
5139
5140 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005141 * EVENT_WPS_BUTTON_PUSHED - Report hardware push button press for WPS
5142 */
5143 EVENT_WPS_BUTTON_PUSHED,
5144
5145 /**
5146 * EVENT_TX_STATUS - Report TX status
5147 */
5148 EVENT_TX_STATUS,
5149
5150 /**
5151 * EVENT_RX_FROM_UNKNOWN - Report RX from unknown STA
5152 */
5153 EVENT_RX_FROM_UNKNOWN,
5154
5155 /**
5156 * EVENT_RX_MGMT - Report RX of a management frame
5157 */
5158 EVENT_RX_MGMT,
5159
5160 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005161 * EVENT_REMAIN_ON_CHANNEL - Remain-on-channel duration started
5162 *
5163 * This event is used to indicate when the driver has started the
5164 * requested remain-on-channel duration. Information about the
5165 * operation is included in union wpa_event_data::remain_on_channel.
5166 */
5167 EVENT_REMAIN_ON_CHANNEL,
5168
5169 /**
5170 * EVENT_CANCEL_REMAIN_ON_CHANNEL - Remain-on-channel timed out
5171 *
5172 * This event is used to indicate when the driver has completed
5173 * remain-on-channel duration, i.e., may noot be available on the
5174 * requested channel anymore. Information about the
5175 * operation is included in union wpa_event_data::remain_on_channel.
5176 */
5177 EVENT_CANCEL_REMAIN_ON_CHANNEL,
5178
5179 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005180 * EVENT_RX_PROBE_REQ - Indicate received Probe Request frame
5181 *
5182 * This event is used to indicate when a Probe Request frame has been
5183 * received. Information about the received frame is included in
5184 * union wpa_event_data::rx_probe_req. The driver is required to report
5185 * these events only after successfully completed probe_req_report()
5186 * commands to request the events (i.e., report parameter is non-zero)
5187 * in station mode. In AP mode, Probe Request frames should always be
5188 * reported.
5189 */
5190 EVENT_RX_PROBE_REQ,
5191
5192 /**
5193 * EVENT_NEW_STA - New wired device noticed
5194 *
5195 * This event is used to indicate that a new device has been detected
5196 * in a network that does not use association-like functionality (i.e.,
5197 * mainly wired Ethernet). This can be used to start EAPOL
5198 * authenticator when receiving a frame from a device. The address of
5199 * the device is included in union wpa_event_data::new_sta.
5200 */
5201 EVENT_NEW_STA,
5202
5203 /**
5204 * EVENT_EAPOL_RX - Report received EAPOL frame
5205 *
5206 * When in AP mode with hostapd, this event is required to be used to
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08005207 * deliver the receive EAPOL frames from the driver.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005208 */
5209 EVENT_EAPOL_RX,
5210
5211 /**
5212 * EVENT_SIGNAL_CHANGE - Indicate change in signal strength
5213 *
5214 * This event is used to indicate changes in the signal strength
5215 * observed in frames received from the current AP if signal strength
5216 * monitoring has been enabled with signal_monitor().
5217 */
5218 EVENT_SIGNAL_CHANGE,
5219
5220 /**
5221 * EVENT_INTERFACE_ENABLED - Notify that interface was enabled
5222 *
5223 * This event is used to indicate that the interface was enabled after
5224 * having been previously disabled, e.g., due to rfkill.
5225 */
5226 EVENT_INTERFACE_ENABLED,
5227
5228 /**
5229 * EVENT_INTERFACE_DISABLED - Notify that interface was disabled
5230 *
5231 * This event is used to indicate that the interface was disabled,
5232 * e.g., due to rfkill.
5233 */
5234 EVENT_INTERFACE_DISABLED,
5235
5236 /**
5237 * EVENT_CHANNEL_LIST_CHANGED - Channel list changed
5238 *
5239 * This event is used to indicate that the channel list has changed,
5240 * e.g., because of a regulatory domain change triggered by scan
5241 * results including an AP advertising a country code.
5242 */
5243 EVENT_CHANNEL_LIST_CHANGED,
5244
5245 /**
5246 * EVENT_INTERFACE_UNAVAILABLE - Notify that interface is unavailable
5247 *
5248 * This event is used to indicate that the driver cannot maintain this
5249 * interface in its operation mode anymore. The most likely use for
5250 * this is to indicate that AP mode operation is not available due to
5251 * operating channel would need to be changed to a DFS channel when
5252 * the driver does not support radar detection and another virtual
5253 * interfaces caused the operating channel to change. Other similar
5254 * resource conflicts could also trigger this for station mode
Dmitry Shmidtd30ac602014-06-30 09:54:22 -07005255 * interfaces. This event can be propagated when channel switching
5256 * fails.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005257 */
5258 EVENT_INTERFACE_UNAVAILABLE,
5259
5260 /**
5261 * EVENT_BEST_CHANNEL
5262 *
5263 * Driver generates this event whenever it detects a better channel
5264 * (e.g., based on RSSI or channel use). This information can be used
5265 * to improve channel selection for a new AP/P2P group.
5266 */
5267 EVENT_BEST_CHANNEL,
5268
5269 /**
5270 * EVENT_UNPROT_DEAUTH - Unprotected Deauthentication frame received
5271 *
5272 * This event should be called when a Deauthentication frame is dropped
5273 * due to it not being protected (MFP/IEEE 802.11w).
5274 * union wpa_event_data::unprot_deauth is required to provide more
5275 * details of the frame.
5276 */
5277 EVENT_UNPROT_DEAUTH,
5278
5279 /**
5280 * EVENT_UNPROT_DISASSOC - Unprotected Disassociation frame received
5281 *
5282 * This event should be called when a Disassociation frame is dropped
5283 * due to it not being protected (MFP/IEEE 802.11w).
5284 * union wpa_event_data::unprot_disassoc is required to provide more
5285 * details of the frame.
5286 */
5287 EVENT_UNPROT_DISASSOC,
5288
5289 /**
5290 * EVENT_STATION_LOW_ACK
5291 *
5292 * Driver generates this event whenever it detected that a particular
5293 * station was lost. Detection can be through massive transmission
5294 * failures for example.
5295 */
5296 EVENT_STATION_LOW_ACK,
5297
5298 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005299 * EVENT_IBSS_PEER_LOST - IBSS peer not reachable anymore
5300 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08005301 EVENT_IBSS_PEER_LOST,
5302
5303 /**
5304 * EVENT_DRIVER_GTK_REKEY - Device/driver did GTK rekey
5305 *
5306 * This event carries the new replay counter to notify wpa_supplicant
5307 * of the current EAPOL-Key Replay Counter in case the driver/firmware
5308 * completed Group Key Handshake while the host (including
5309 * wpa_supplicant was sleeping).
5310 */
5311 EVENT_DRIVER_GTK_REKEY,
5312
5313 /**
5314 * EVENT_SCHED_SCAN_STOPPED - Scheduled scan was stopped
5315 */
5316 EVENT_SCHED_SCAN_STOPPED,
5317
5318 /**
5319 * EVENT_DRIVER_CLIENT_POLL_OK - Station responded to poll
5320 *
5321 * This event indicates that the station responded to the poll
5322 * initiated with @poll_client.
5323 */
5324 EVENT_DRIVER_CLIENT_POLL_OK,
5325
5326 /**
5327 * EVENT_EAPOL_TX_STATUS - notify of EAPOL TX status
5328 */
Dmitry Shmidt04949592012-07-19 12:16:46 -07005329 EVENT_EAPOL_TX_STATUS,
5330
5331 /**
5332 * EVENT_CH_SWITCH - AP or GO decided to switch channels
5333 *
5334 * Described in wpa_event_data.ch_switch
5335 * */
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07005336 EVENT_CH_SWITCH,
5337
5338 /**
Hai Shalom81f62d82019-07-22 12:10:00 -07005339 * EVENT_CH_SWITCH_STARTED - AP or GO started to switch channels
5340 *
5341 * This is a pre-switch event indicating the shortly following switch
5342 * of operating channels.
5343 *
5344 * Described in wpa_event_data.ch_switch
5345 */
5346 EVENT_CH_SWITCH_STARTED,
5347 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07005348 * EVENT_WNM - Request WNM operation
5349 *
5350 * This event can be used to request a WNM operation to be performed.
5351 */
Dmitry Shmidtf8623282013-02-20 14:34:59 -08005352 EVENT_WNM,
5353
5354 /**
5355 * EVENT_CONNECT_FAILED_REASON - Connection failure reason in AP mode
5356 *
5357 * This event indicates that the driver reported a connection failure
5358 * with the specified client (for example, max client reached, etc.) in
5359 * AP mode.
5360 */
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005361 EVENT_CONNECT_FAILED_REASON,
5362
5363 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005364 * EVENT_DFS_RADAR_DETECTED - Notify of radar detection
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005365 *
5366 * A radar has been detected on the supplied frequency, hostapd should
5367 * react accordingly (e.g., change channel).
5368 */
5369 EVENT_DFS_RADAR_DETECTED,
5370
5371 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005372 * EVENT_DFS_CAC_FINISHED - Notify that channel availability check has been completed
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005373 *
5374 * After a successful CAC, the channel can be marked clear and used.
5375 */
5376 EVENT_DFS_CAC_FINISHED,
5377
5378 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005379 * EVENT_DFS_CAC_ABORTED - Notify that channel availability check has been aborted
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005380 *
5381 * The CAC was not successful, and the channel remains in the previous
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08005382 * state. This may happen due to a radar being detected or other
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005383 * external influences.
5384 */
5385 EVENT_DFS_CAC_ABORTED,
5386
5387 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005388 * EVENT_DFS_NOP_FINISHED - Notify that non-occupancy period is over
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005389 *
5390 * The channel which was previously unavailable is now available again.
5391 */
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07005392 EVENT_DFS_NOP_FINISHED,
5393
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08005394 /**
5395 * EVENT_SURVEY - Received survey data
5396 *
5397 * This event gets triggered when a driver query is issued for survey
5398 * data and the requested data becomes available. The returned data is
5399 * stored in struct survey_results. The results provide at most one
5400 * survey entry for each frequency and at minimum will provide one
5401 * survey entry for one frequency. The survey data can be os_malloc()'d
5402 * and then os_free()'d, so the event callback must only copy data.
5403 */
5404 EVENT_SURVEY,
5405
5406 /**
5407 * EVENT_SCAN_STARTED - Scan started
5408 *
5409 * This indicates that driver has started a scan operation either based
5410 * on a request from wpa_supplicant/hostapd or from another application.
5411 * EVENT_SCAN_RESULTS is used to indicate when the scan has been
5412 * completed (either successfully or by getting cancelled).
5413 */
Dmitry Shmidtcf32e602014-01-28 10:57:39 -08005414 EVENT_SCAN_STARTED,
5415
5416 /**
5417 * EVENT_AVOID_FREQUENCIES - Received avoid frequency range
5418 *
5419 * This event indicates a set of frequency ranges that should be avoided
5420 * to reduce issues due to interference or internal co-existence
5421 * information in the driver.
5422 */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08005423 EVENT_AVOID_FREQUENCIES,
5424
5425 /**
5426 * EVENT_NEW_PEER_CANDIDATE - new (unknown) mesh peer notification
5427 */
5428 EVENT_NEW_PEER_CANDIDATE,
5429
5430 /**
5431 * EVENT_ACS_CHANNEL_SELECTED - Received selected channels by ACS
5432 *
5433 * Indicates a pair of primary and secondary channels chosen by ACS
5434 * in device.
5435 */
5436 EVENT_ACS_CHANNEL_SELECTED,
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005437
5438 /**
5439 * EVENT_DFS_CAC_STARTED - Notify that channel availability check has
5440 * been started.
5441 *
5442 * This event indicates that channel availability check has been started
5443 * on a DFS frequency by a driver that supports DFS Offload.
5444 */
5445 EVENT_DFS_CAC_STARTED,
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07005446
5447 /**
5448 * EVENT_P2P_LO_STOP - Notify that P2P listen offload is stopped
5449 */
5450 EVENT_P2P_LO_STOP,
Paul Stewart092955c2017-02-06 09:13:09 -08005451
5452 /**
5453 * EVENT_BEACON_LOSS - Beacon loss detected
5454 *
5455 * This event indicates that no Beacon frames has been received from
5456 * the current AP. This may indicate that the AP is not anymore in
5457 * range.
5458 */
5459 EVENT_BEACON_LOSS,
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005460
5461 /**
5462 * EVENT_DFS_PRE_CAC_EXPIRED - Notify that channel availability check
5463 * done previously (Pre-CAC) on the channel has expired. This would
5464 * normally be on a non-ETSI DFS regulatory domain. DFS state of the
5465 * channel will be moved from available to usable. A new CAC has to be
5466 * performed before start operating on this channel.
5467 */
5468 EVENT_DFS_PRE_CAC_EXPIRED,
Roshan Pius3a1667e2018-07-03 15:17:14 -07005469
5470 /**
5471 * EVENT_EXTERNAL_AUTH - This event interface is used by host drivers
5472 * that do not define separate commands for authentication and
5473 * association (~WPA_DRIVER_FLAGS_SME) but offload the 802.11
5474 * authentication to wpa_supplicant. This event carries all the
5475 * necessary information from the host driver for the authentication to
5476 * happen.
5477 */
5478 EVENT_EXTERNAL_AUTH,
5479
5480 /**
5481 * EVENT_PORT_AUTHORIZED - Notification that a connection is authorized
5482 *
5483 * This event should be indicated when the driver completes the 4-way
5484 * handshake. This event should be preceded by an EVENT_ASSOC that
5485 * indicates the completion of IEEE 802.11 association.
5486 */
5487 EVENT_PORT_AUTHORIZED,
5488
5489 /**
5490 * EVENT_STATION_OPMODE_CHANGED - Notify STA's HT/VHT operation mode
5491 * change event.
5492 */
5493 EVENT_STATION_OPMODE_CHANGED,
5494
5495 /**
5496 * EVENT_INTERFACE_MAC_CHANGED - Notify that interface MAC changed
5497 *
5498 * This event is emitted when the MAC changes while the interface is
5499 * enabled. When an interface was disabled and becomes enabled, it
5500 * must be always assumed that the MAC possibly changed.
5501 */
5502 EVENT_INTERFACE_MAC_CHANGED,
5503
5504 /**
5505 * EVENT_WDS_STA_INTERFACE_STATUS - Notify WDS STA interface status
5506 *
5507 * This event is emitted when an interface is added/removed for WDS STA.
5508 */
5509 EVENT_WDS_STA_INTERFACE_STATUS,
Hai Shalom81f62d82019-07-22 12:10:00 -07005510
5511 /**
5512 * EVENT_UPDATE_DH - Notification of updated DH information
5513 */
5514 EVENT_UPDATE_DH,
Hai Shalomfdcde762020-04-02 11:19:20 -07005515
5516 /**
5517 * EVENT_UNPROT_BEACON - Unprotected Beacon frame received
5518 *
5519 * This event should be called when a Beacon frame is dropped due to it
5520 * not being protected correctly. union wpa_event_data::unprot_beacon
5521 * is required to provide more details of the frame.
5522 */
5523 EVENT_UNPROT_BEACON,
Hai Shalomc1a21442022-02-04 13:43:00 -08005524
5525 /**
5526 * EVENT_TX_WAIT_EXPIRE - TX wait timed out
5527 *
5528 * This event is used to indicate when the driver has completed
5529 * wait for a response frame based on a TX request that specified a
5530 * non-zero wait time and that has not been explicitly cancelled.
5531 */
5532 EVENT_TX_WAIT_EXPIRE,
Sunil Ravia04bd252022-05-02 22:54:18 -07005533
5534 /**
5535 * EVENT_BSS_COLOR_COLLISION - Notification of a BSS color collision
5536 */
5537 EVENT_BSS_COLOR_COLLISION,
5538
5539 /**
5540 * EVENT_CCA_STARTED_NOTIFY - Notification that CCA has started
5541 */
5542 EVENT_CCA_STARTED_NOTIFY,
5543
5544 /**
5545 * EVENT_CCA_ABORTED_NOTIFY - Notification that CCA has aborted
5546 */
5547 EVENT_CCA_ABORTED_NOTIFY,
5548
5549 /**
5550 * EVENT_CCA_NOTIFY - Notification that CCA has completed
5551 */
5552 EVENT_CCA_NOTIFY,
Sunil Ravi89eba102022-09-13 21:04:37 -07005553
5554 /**
5555 * EVENT_PASN_AUTH - This event is used by the driver that requests
5556 * PASN authentication and secure ranging context for multiple peers.
5557 */
5558 EVENT_PASN_AUTH,
5559
5560 /**
5561 * EVENT_LINK_CH_SWITCH - MLD AP link decided to switch channels
5562 *
5563 * Described in wpa_event_data.ch_switch.
5564 *
5565 */
5566 EVENT_LINK_CH_SWITCH,
5567
5568 /**
5569 * EVENT_LINK_CH_SWITCH_STARTED - MLD AP link started to switch channels
5570 *
5571 * This is a pre-switch event indicating the shortly following switch
5572 * of operating channels.
5573 *
5574 * Described in wpa_event_data.ch_switch.
5575 */
5576 EVENT_LINK_CH_SWITCH_STARTED,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005577};
5578
5579
5580/**
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07005581 * struct freq_survey - Channel survey info
5582 *
5583 * @ifidx: Interface index in which this survey was observed
5584 * @freq: Center of frequency of the surveyed channel
5585 * @nf: Channel noise floor in dBm
5586 * @channel_time: Amount of time in ms the radio spent on the channel
5587 * @channel_time_busy: Amount of time in ms the radio detected some signal
5588 * that indicated to the radio the channel was not clear
5589 * @channel_time_rx: Amount of time the radio spent receiving data
5590 * @channel_time_tx: Amount of time the radio spent transmitting data
5591 * @filled: bitmask indicating which fields have been reported, see
5592 * SURVEY_HAS_* defines.
5593 * @list: Internal list pointers
5594 */
5595struct freq_survey {
5596 u32 ifidx;
5597 unsigned int freq;
5598 s8 nf;
5599 u64 channel_time;
5600 u64 channel_time_busy;
5601 u64 channel_time_rx;
5602 u64 channel_time_tx;
5603 unsigned int filled;
5604 struct dl_list list;
5605};
5606
5607#define SURVEY_HAS_NF BIT(0)
5608#define SURVEY_HAS_CHAN_TIME BIT(1)
5609#define SURVEY_HAS_CHAN_TIME_BUSY BIT(2)
5610#define SURVEY_HAS_CHAN_TIME_RX BIT(3)
5611#define SURVEY_HAS_CHAN_TIME_TX BIT(4)
5612
Hai Shalom60840252021-02-19 19:02:11 -08005613/**
5614 * enum sta_connect_fail_reason_codes - STA connect failure reason code values
5615 * @STA_CONNECT_FAIL_REASON_UNSPECIFIED: No reason code specified for
5616 * connection failure.
5617 * @STA_CONNECT_FAIL_REASON_NO_BSS_FOUND: No Probe Response frame received
5618 * for unicast Probe Request frame.
5619 * @STA_CONNECT_FAIL_REASON_AUTH_TX_FAIL: STA failed to send auth request.
5620 * @STA_CONNECT_FAIL_REASON_AUTH_NO_ACK_RECEIVED: AP didn't send ACK for
5621 * auth request.
5622 * @STA_CONNECT_FAIL_REASON_AUTH_NO_RESP_RECEIVED: Auth response is not
5623 * received from AP.
5624 * @STA_CONNECT_FAIL_REASON_ASSOC_REQ_TX_FAIL: STA failed to send
5625 * Association Request frame.
5626 * @STA_CONNECT_FAIL_REASON_ASSOC_NO_ACK_RECEIVED: AP didn't send ACK for
5627 * Association Request frame.
5628 * @STA_CONNECT_FAIL_REASON_ASSOC_NO_RESP_RECEIVED: Association Response
5629 * frame is not received from AP.
5630 */
5631enum sta_connect_fail_reason_codes {
5632 STA_CONNECT_FAIL_REASON_UNSPECIFIED = 0,
5633 STA_CONNECT_FAIL_REASON_NO_BSS_FOUND = 1,
5634 STA_CONNECT_FAIL_REASON_AUTH_TX_FAIL = 2,
5635 STA_CONNECT_FAIL_REASON_AUTH_NO_ACK_RECEIVED = 3,
5636 STA_CONNECT_FAIL_REASON_AUTH_NO_RESP_RECEIVED = 4,
5637 STA_CONNECT_FAIL_REASON_ASSOC_REQ_TX_FAIL = 5,
5638 STA_CONNECT_FAIL_REASON_ASSOC_NO_ACK_RECEIVED = 6,
5639 STA_CONNECT_FAIL_REASON_ASSOC_NO_RESP_RECEIVED = 7,
5640};
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07005641
5642/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005643 * union wpa_event_data - Additional data for wpa_supplicant_event() calls
5644 */
5645union wpa_event_data {
5646 /**
5647 * struct assoc_info - Data for EVENT_ASSOC and EVENT_ASSOCINFO events
5648 *
5649 * This structure is optional for EVENT_ASSOC calls and required for
5650 * EVENT_ASSOCINFO calls. By using EVENT_ASSOC with this data, the
5651 * driver interface does not need to generate separate EVENT_ASSOCINFO
5652 * calls.
5653 */
5654 struct assoc_info {
5655 /**
5656 * reassoc - Flag to indicate association or reassociation
5657 */
5658 int reassoc;
5659
5660 /**
5661 * req_ies - (Re)Association Request IEs
5662 *
5663 * If the driver generates WPA/RSN IE, this event data must be
5664 * returned for WPA handshake to have needed information. If
5665 * wpa_supplicant-generated WPA/RSN IE is used, this
5666 * information event is optional.
5667 *
5668 * This should start with the first IE (fixed fields before IEs
5669 * are not included).
5670 */
5671 const u8 *req_ies;
5672
5673 /**
5674 * req_ies_len - Length of req_ies in bytes
5675 */
5676 size_t req_ies_len;
5677
5678 /**
5679 * resp_ies - (Re)Association Response IEs
5680 *
5681 * Optional association data from the driver. This data is not
5682 * required WPA, but may be useful for some protocols and as
5683 * such, should be reported if this is available to the driver
5684 * interface.
5685 *
5686 * This should start with the first IE (fixed fields before IEs
5687 * are not included).
5688 */
5689 const u8 *resp_ies;
5690
5691 /**
5692 * resp_ies_len - Length of resp_ies in bytes
5693 */
5694 size_t resp_ies_len;
5695
5696 /**
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08005697 * resp_frame - (Re)Association Response frame
5698 */
5699 const u8 *resp_frame;
5700
5701 /**
5702 * resp_frame_len - (Re)Association Response frame length
5703 */
5704 size_t resp_frame_len;
5705
5706 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005707 * beacon_ies - Beacon or Probe Response IEs
5708 *
5709 * Optional Beacon/ProbeResp data: IEs included in Beacon or
5710 * Probe Response frames from the current AP (i.e., the one
5711 * that the client just associated with). This information is
5712 * used to update WPA/RSN IE for the AP. If this field is not
5713 * set, the results from previous scan will be used. If no
5714 * data for the new AP is found, scan results will be requested
5715 * again (without scan request). At this point, the driver is
5716 * expected to provide WPA/RSN IE for the AP (if WPA/WPA2 is
5717 * used).
5718 *
5719 * This should start with the first IE (fixed fields before IEs
5720 * are not included).
5721 */
5722 const u8 *beacon_ies;
5723
5724 /**
5725 * beacon_ies_len - Length of beacon_ies */
5726 size_t beacon_ies_len;
5727
5728 /**
5729 * freq - Frequency of the operational channel in MHz
5730 */
5731 unsigned int freq;
5732
5733 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08005734 * wmm_params - WMM parameters used in this association.
5735 */
5736 struct wmm_params wmm_params;
5737
5738 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005739 * addr - Station address (for AP mode)
5740 */
5741 const u8 *addr;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08005742
5743 /**
5744 * The following is the key management offload information
5745 * @authorized
5746 * @key_replay_ctr
5747 * @key_replay_ctr_len
5748 * @ptk_kck
5749 * @ptk_kek_len
5750 * @ptk_kek
5751 * @ptk_kek_len
5752 */
5753
5754 /**
5755 * authorized - Status of key management offload,
5756 * 1 = successful
5757 */
5758 int authorized;
5759
5760 /**
5761 * key_replay_ctr - Key replay counter value last used
5762 * in a valid EAPOL-Key frame
5763 */
5764 const u8 *key_replay_ctr;
5765
5766 /**
5767 * key_replay_ctr_len - The length of key_replay_ctr
5768 */
5769 size_t key_replay_ctr_len;
5770
5771 /**
5772 * ptk_kck - The derived PTK KCK
5773 */
5774 const u8 *ptk_kck;
5775
5776 /**
5777 * ptk_kek_len - The length of ptk_kck
5778 */
5779 size_t ptk_kck_len;
5780
5781 /**
5782 * ptk_kek - The derived PTK KEK
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005783 * This is used in key management offload and also in FILS SK
5784 * offload.
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08005785 */
5786 const u8 *ptk_kek;
5787
5788 /**
5789 * ptk_kek_len - The length of ptk_kek
5790 */
5791 size_t ptk_kek_len;
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08005792
5793 /**
5794 * subnet_status - The subnet status:
5795 * 0 = unknown, 1 = unchanged, 2 = changed
5796 */
5797 u8 subnet_status;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005798
5799 /**
5800 * The following information is used in FILS SK offload
5801 * @fils_erp_next_seq_num
5802 * @fils_pmk
5803 * @fils_pmk_len
5804 * @fils_pmkid
5805 */
5806
5807 /**
5808 * fils_erp_next_seq_num - The next sequence number to use in
5809 * FILS ERP messages
5810 */
5811 u16 fils_erp_next_seq_num;
5812
5813 /**
5814 * fils_pmk - A new PMK if generated in case of FILS
5815 * authentication
5816 */
5817 const u8 *fils_pmk;
5818
5819 /**
5820 * fils_pmk_len - Length of fils_pmk
5821 */
5822 size_t fils_pmk_len;
5823
5824 /**
5825 * fils_pmkid - PMKID used or generated in FILS authentication
5826 */
5827 const u8 *fils_pmkid;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005828 } assoc_info;
5829
5830 /**
5831 * struct disassoc_info - Data for EVENT_DISASSOC events
5832 */
5833 struct disassoc_info {
5834 /**
5835 * addr - Station address (for AP mode)
5836 */
5837 const u8 *addr;
5838
5839 /**
5840 * reason_code - Reason Code (host byte order) used in
5841 * Deauthentication frame
5842 */
5843 u16 reason_code;
5844
5845 /**
5846 * ie - Optional IE(s) in Disassociation frame
5847 */
5848 const u8 *ie;
5849
5850 /**
5851 * ie_len - Length of ie buffer in octets
5852 */
5853 size_t ie_len;
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08005854
5855 /**
5856 * locally_generated - Whether the frame was locally generated
5857 */
5858 int locally_generated;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005859 } disassoc_info;
5860
5861 /**
5862 * struct deauth_info - Data for EVENT_DEAUTH events
5863 */
5864 struct deauth_info {
5865 /**
5866 * addr - Station address (for AP mode)
5867 */
5868 const u8 *addr;
5869
5870 /**
5871 * reason_code - Reason Code (host byte order) used in
5872 * Deauthentication frame
5873 */
5874 u16 reason_code;
5875
5876 /**
5877 * ie - Optional IE(s) in Deauthentication frame
5878 */
5879 const u8 *ie;
5880
5881 /**
5882 * ie_len - Length of ie buffer in octets
5883 */
5884 size_t ie_len;
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08005885
5886 /**
5887 * locally_generated - Whether the frame was locally generated
5888 */
5889 int locally_generated;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005890 } deauth_info;
5891
5892 /**
5893 * struct michael_mic_failure - Data for EVENT_MICHAEL_MIC_FAILURE
5894 */
5895 struct michael_mic_failure {
5896 int unicast;
5897 const u8 *src;
5898 } michael_mic_failure;
5899
5900 /**
5901 * struct interface_status - Data for EVENT_INTERFACE_STATUS
5902 */
5903 struct interface_status {
Dmitry Shmidte4663042016-04-04 10:07:49 -07005904 unsigned int ifindex;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005905 char ifname[100];
5906 enum {
5907 EVENT_INTERFACE_ADDED, EVENT_INTERFACE_REMOVED
5908 } ievent;
5909 } interface_status;
5910
5911 /**
5912 * struct pmkid_candidate - Data for EVENT_PMKID_CANDIDATE
5913 */
5914 struct pmkid_candidate {
5915 /** BSSID of the PMKID candidate */
5916 u8 bssid[ETH_ALEN];
5917 /** Smaller the index, higher the priority */
5918 int index;
5919 /** Whether RSN IE includes pre-authenticate flag */
5920 int preauth;
5921 } pmkid_candidate;
5922
5923 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005924 * struct tdls - Data for EVENT_TDLS
5925 */
5926 struct tdls {
5927 u8 peer[ETH_ALEN];
5928 enum {
5929 TDLS_REQUEST_SETUP,
Dmitry Shmidt4dd28dc2015-03-10 11:21:43 -07005930 TDLS_REQUEST_TEARDOWN,
5931 TDLS_REQUEST_DISCOVER,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005932 } oper;
5933 u16 reason_code; /* for teardown */
5934 } tdls;
5935
5936 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07005937 * struct wnm - Data for EVENT_WNM
5938 */
5939 struct wnm {
5940 u8 addr[ETH_ALEN];
5941 enum {
5942 WNM_OPER_SLEEP,
5943 } oper;
5944 enum {
5945 WNM_SLEEP_ENTER,
5946 WNM_SLEEP_EXIT
5947 } sleep_action;
5948 int sleep_intval;
5949 u16 reason_code;
5950 u8 *buf;
5951 u16 buf_len;
5952 } wnm;
5953
5954 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005955 * struct ft_ies - FT information elements (EVENT_FT_RESPONSE)
5956 *
5957 * During FT (IEEE 802.11r) authentication sequence, the driver is
5958 * expected to use this event to report received FT IEs (MDIE, FTIE,
5959 * RSN IE, TIE, possible resource request) to the supplicant. The FT
5960 * IEs for the next message will be delivered through the
5961 * struct wpa_driver_ops::update_ft_ies() callback.
5962 */
5963 struct ft_ies {
5964 const u8 *ies;
5965 size_t ies_len;
5966 int ft_action;
5967 u8 target_ap[ETH_ALEN];
5968 /** Optional IE(s), e.g., WMM TSPEC(s), for RIC-Request */
5969 const u8 *ric_ies;
5970 /** Length of ric_ies buffer in octets */
5971 size_t ric_ies_len;
5972 } ft_ies;
5973
5974 /**
5975 * struct ibss_rsn_start - Data for EVENT_IBSS_RSN_START
5976 */
5977 struct ibss_rsn_start {
5978 u8 peer[ETH_ALEN];
5979 } ibss_rsn_start;
5980
5981 /**
5982 * struct auth_info - Data for EVENT_AUTH events
5983 */
5984 struct auth_info {
5985 u8 peer[ETH_ALEN];
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08005986 u8 bssid[ETH_ALEN];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005987 u16 auth_type;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08005988 u16 auth_transaction;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005989 u16 status_code;
5990 const u8 *ies;
5991 size_t ies_len;
5992 } auth;
5993
5994 /**
5995 * struct assoc_reject - Data for EVENT_ASSOC_REJECT events
5996 */
5997 struct assoc_reject {
5998 /**
5999 * bssid - BSSID of the AP that rejected association
6000 */
6001 const u8 *bssid;
6002
6003 /**
6004 * resp_ies - (Re)Association Response IEs
6005 *
6006 * Optional association data from the driver. This data is not
6007 * required WPA, but may be useful for some protocols and as
6008 * such, should be reported if this is available to the driver
6009 * interface.
6010 *
6011 * This should start with the first IE (fixed fields before IEs
6012 * are not included).
6013 */
6014 const u8 *resp_ies;
6015
6016 /**
6017 * resp_ies_len - Length of resp_ies in bytes
6018 */
6019 size_t resp_ies_len;
6020
6021 /**
6022 * status_code - Status Code from (Re)association Response
6023 */
6024 u16 status_code;
Dmitry Shmidtd5ab1b52016-06-21 12:38:41 -07006025
6026 /**
6027 * timed_out - Whether failure is due to timeout (etc.) rather
6028 * than explicit rejection response from the AP.
6029 */
6030 int timed_out;
Dmitry Shmidtebd93af2017-02-21 13:40:44 -08006031
6032 /**
6033 * timeout_reason - Reason for the timeout
6034 */
6035 const char *timeout_reason;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07006036
6037 /**
6038 * fils_erp_next_seq_num - The next sequence number to use in
6039 * FILS ERP messages
6040 */
6041 u16 fils_erp_next_seq_num;
Hai Shalom60840252021-02-19 19:02:11 -08006042
6043 /**
6044 * reason_code - Connection failure reason code from the driver
6045 */
6046 enum sta_connect_fail_reason_codes reason_code;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006047 } assoc_reject;
6048
6049 struct timeout_event {
6050 u8 addr[ETH_ALEN];
6051 } timeout_event;
6052
6053 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006054 * struct tx_status - Data for EVENT_TX_STATUS events
6055 */
6056 struct tx_status {
6057 u16 type;
6058 u16 stype;
6059 const u8 *dst;
6060 const u8 *data;
6061 size_t data_len;
6062 int ack;
6063 } tx_status;
6064
6065 /**
6066 * struct rx_from_unknown - Data for EVENT_RX_FROM_UNKNOWN events
6067 */
6068 struct rx_from_unknown {
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006069 const u8 *bssid;
6070 const u8 *addr;
6071 int wds;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006072 } rx_from_unknown;
6073
6074 /**
6075 * struct rx_mgmt - Data for EVENT_RX_MGMT events
6076 */
6077 struct rx_mgmt {
6078 const u8 *frame;
6079 size_t frame_len;
6080 u32 datarate;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006081
6082 /**
Dmitry Shmidt98660862014-03-11 17:26:21 -07006083 * drv_priv - Pointer to store driver private BSS information
6084 *
6085 * If not set to NULL, this is used for comparison with
6086 * hostapd_data->drv_priv to determine which BSS should process
6087 * the frame.
6088 */
6089 void *drv_priv;
6090
6091 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006092 * freq - Frequency (in MHz) on which the frame was received
6093 */
6094 int freq;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08006095
6096 /**
6097 * ssi_signal - Signal strength in dBm (or 0 if not available)
6098 */
6099 int ssi_signal;
6100 } rx_mgmt;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006101
6102 /**
6103 * struct remain_on_channel - Data for EVENT_REMAIN_ON_CHANNEL events
6104 *
6105 * This is also used with EVENT_CANCEL_REMAIN_ON_CHANNEL events.
6106 */
6107 struct remain_on_channel {
6108 /**
6109 * freq - Channel frequency in MHz
6110 */
6111 unsigned int freq;
6112
6113 /**
6114 * duration - Duration to remain on the channel in milliseconds
6115 */
6116 unsigned int duration;
6117 } remain_on_channel;
6118
6119 /**
6120 * struct scan_info - Optional data for EVENT_SCAN_RESULTS events
6121 * @aborted: Whether the scan was aborted
6122 * @freqs: Scanned frequencies in MHz (%NULL = all channels scanned)
6123 * @num_freqs: Number of entries in freqs array
6124 * @ssids: Scanned SSIDs (%NULL or zero-length SSID indicates wildcard
6125 * SSID)
6126 * @num_ssids: Number of entries in ssids array
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08006127 * @external_scan: Whether the scan info is for an external scan
6128 * @nl_scan_event: 1 if the source of this scan event is a normal scan,
6129 * 0 if the source of the scan event is a vendor scan
Dmitry Shmidt29333592017-01-09 12:27:11 -08006130 * @scan_start_tsf: Time when the scan started in terms of TSF of the
6131 * BSS that the interface that requested the scan is connected to
6132 * (if available).
6133 * @scan_start_tsf_bssid: The BSSID according to which %scan_start_tsf
6134 * is set.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006135 */
6136 struct scan_info {
6137 int aborted;
6138 const int *freqs;
6139 size_t num_freqs;
6140 struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS];
6141 size_t num_ssids;
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08006142 int external_scan;
6143 int nl_scan_event;
Dmitry Shmidt29333592017-01-09 12:27:11 -08006144 u64 scan_start_tsf;
6145 u8 scan_start_tsf_bssid[ETH_ALEN];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006146 } scan_info;
6147
6148 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006149 * struct rx_probe_req - Data for EVENT_RX_PROBE_REQ events
6150 */
6151 struct rx_probe_req {
6152 /**
6153 * sa - Source address of the received Probe Request frame
6154 */
6155 const u8 *sa;
6156
6157 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006158 * da - Destination address of the received Probe Request frame
6159 * or %NULL if not available
6160 */
6161 const u8 *da;
6162
6163 /**
6164 * bssid - BSSID of the received Probe Request frame or %NULL
6165 * if not available
6166 */
6167 const u8 *bssid;
6168
6169 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006170 * ie - IEs from the Probe Request body
6171 */
6172 const u8 *ie;
6173
6174 /**
6175 * ie_len - Length of ie buffer in octets
6176 */
6177 size_t ie_len;
Dmitry Shmidt04949592012-07-19 12:16:46 -07006178
6179 /**
6180 * signal - signal strength in dBm (or 0 if not available)
6181 */
6182 int ssi_signal;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006183 } rx_probe_req;
6184
6185 /**
6186 * struct new_sta - Data for EVENT_NEW_STA events
6187 */
6188 struct new_sta {
6189 const u8 *addr;
6190 } new_sta;
6191
6192 /**
6193 * struct eapol_rx - Data for EVENT_EAPOL_RX events
6194 */
6195 struct eapol_rx {
6196 const u8 *src;
6197 const u8 *data;
6198 size_t data_len;
Sunil8cd6f4d2022-06-28 18:40:46 +00006199 enum frame_encryption encrypted;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006200 } eapol_rx;
6201
6202 /**
6203 * signal_change - Data for EVENT_SIGNAL_CHANGE events
6204 */
6205 struct wpa_signal_info signal_change;
6206
6207 /**
6208 * struct best_channel - Data for EVENT_BEST_CHANNEL events
6209 * @freq_24: Best 2.4 GHz band channel frequency in MHz
6210 * @freq_5: Best 5 GHz band channel frequency in MHz
6211 * @freq_overall: Best channel frequency in MHz
6212 *
6213 * 0 can be used to indicate no preference in either band.
6214 */
6215 struct best_channel {
6216 int freq_24;
6217 int freq_5;
6218 int freq_overall;
6219 } best_chan;
6220
6221 struct unprot_deauth {
6222 const u8 *sa;
6223 const u8 *da;
6224 u16 reason_code;
6225 } unprot_deauth;
6226
6227 struct unprot_disassoc {
6228 const u8 *sa;
6229 const u8 *da;
6230 u16 reason_code;
6231 } unprot_disassoc;
6232
6233 /**
6234 * struct low_ack - Data for EVENT_STATION_LOW_ACK events
6235 * @addr: station address
Paul Stewart092955c2017-02-06 09:13:09 -08006236 * @num_packets: Number of packets lost (consecutive packets not
6237 * acknowledged)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006238 */
6239 struct low_ack {
6240 u8 addr[ETH_ALEN];
Paul Stewart092955c2017-02-06 09:13:09 -08006241 u32 num_packets;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006242 } low_ack;
6243
6244 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006245 * struct ibss_peer_lost - Data for EVENT_IBSS_PEER_LOST
6246 */
6247 struct ibss_peer_lost {
6248 u8 peer[ETH_ALEN];
6249 } ibss_peer_lost;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006250
6251 /**
6252 * struct driver_gtk_rekey - Data for EVENT_DRIVER_GTK_REKEY
6253 */
6254 struct driver_gtk_rekey {
6255 const u8 *bssid;
6256 const u8 *replay_ctr;
6257 } driver_gtk_rekey;
6258
6259 /**
6260 * struct client_poll - Data for EVENT_DRIVER_CLIENT_POLL_OK events
6261 * @addr: station address
6262 */
6263 struct client_poll {
6264 u8 addr[ETH_ALEN];
6265 } client_poll;
6266
6267 /**
6268 * struct eapol_tx_status
6269 * @dst: Original destination
6270 * @data: Data starting with IEEE 802.1X header (!)
6271 * @data_len: Length of data
6272 * @ack: Indicates ack or lost frame
6273 *
6274 * This corresponds to hapd_send_eapol if the frame sent
6275 * there isn't just reported as EVENT_TX_STATUS.
6276 */
6277 struct eapol_tx_status {
6278 const u8 *dst;
6279 const u8 *data;
6280 int data_len;
6281 int ack;
6282 } eapol_tx_status;
Dmitry Shmidt04949592012-07-19 12:16:46 -07006283
6284 /**
6285 * struct ch_switch
6286 * @freq: Frequency of new channel in MHz
6287 * @ht_enabled: Whether this is an HT channel
6288 * @ch_offset: Secondary channel offset
Dmitry Shmidt04f534e2013-12-09 15:50:16 -08006289 * @ch_width: Channel width
6290 * @cf1: Center frequency 1
6291 * @cf2: Center frequency 2
Sunil Ravi89eba102022-09-13 21:04:37 -07006292 * @link_id: Link ID of the MLO link
Dmitry Shmidt04949592012-07-19 12:16:46 -07006293 */
6294 struct ch_switch {
6295 int freq;
6296 int ht_enabled;
6297 int ch_offset;
Dmitry Shmidt04f534e2013-12-09 15:50:16 -08006298 enum chan_width ch_width;
6299 int cf1;
6300 int cf2;
Sunil Ravi89eba102022-09-13 21:04:37 -07006301 int link_id;
Dmitry Shmidt04949592012-07-19 12:16:46 -07006302 } ch_switch;
Dmitry Shmidtf8623282013-02-20 14:34:59 -08006303
6304 /**
6305 * struct connect_failed - Data for EVENT_CONNECT_FAILED_REASON
6306 * @addr: Remote client address
6307 * @code: Reason code for connection failure
6308 */
6309 struct connect_failed_reason {
6310 u8 addr[ETH_ALEN];
6311 enum {
6312 MAX_CLIENT_REACHED,
6313 BLOCKED_CLIENT
6314 } code;
6315 } connect_failed_reason;
Dmitry Shmidtea69e842013-05-13 14:52:28 -07006316
6317 /**
6318 * struct dfs_event - Data for radar detected events
6319 * @freq: Frequency of the channel in MHz
6320 */
6321 struct dfs_event {
6322 int freq;
Dmitry Shmidt051af732013-10-22 13:52:46 -07006323 int ht_enabled;
6324 int chan_offset;
6325 enum chan_width chan_width;
6326 int cf1;
6327 int cf2;
Dmitry Shmidtea69e842013-05-13 14:52:28 -07006328 } dfs_event;
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07006329
6330 /**
6331 * survey_results - Survey result data for EVENT_SURVEY
6332 * @freq_filter: Requested frequency survey filter, 0 if request
6333 * was for all survey data
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006334 * @survey_list: Linked list of survey data (struct freq_survey)
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07006335 */
6336 struct survey_results {
6337 unsigned int freq_filter;
6338 struct dl_list survey_list; /* struct freq_survey */
6339 } survey_results;
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08006340
6341 /**
6342 * channel_list_changed - Data for EVENT_CHANNEL_LIST_CHANGED
6343 * @initiator: Initiator of the regulatory change
Dmitry Shmidt7dba0e52014-04-14 10:49:15 -07006344 * @type: Regulatory change type
6345 * @alpha2: Country code (or "" if not available)
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08006346 */
6347 struct channel_list_changed {
6348 enum reg_change_initiator initiator;
Dmitry Shmidt7dba0e52014-04-14 10:49:15 -07006349 enum reg_type type;
6350 char alpha2[3];
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08006351 } channel_list_changed;
Dmitry Shmidtcf32e602014-01-28 10:57:39 -08006352
6353 /**
6354 * freq_range - List of frequency ranges
6355 *
6356 * This is used as the data with EVENT_AVOID_FREQUENCIES.
6357 */
6358 struct wpa_freq_range_list freq_range;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006359
6360 /**
6361 * struct mesh_peer
6362 *
6363 * @peer: Peer address
6364 * @ies: Beacon IEs
6365 * @ie_len: Length of @ies
6366 *
6367 * Notification of new candidate mesh peer.
6368 */
6369 struct mesh_peer {
6370 const u8 *peer;
6371 const u8 *ies;
6372 size_t ie_len;
6373 } mesh_peer;
6374
6375 /**
6376 * struct acs_selected_channels - Data for EVENT_ACS_CHANNEL_SELECTED
Ahmed ElArabawy0ff61c52019-12-26 12:38:39 -08006377 * @pri_freq: Selected primary frequency
6378 * @sec_freq: Selected secondary frequency
Hai Shalomfdcde762020-04-02 11:19:20 -07006379 * @edmg_channel: Selected EDMG channel
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006380 * @vht_seg0_center_ch: VHT mode Segment0 center channel
Hai Shalomfdcde762020-04-02 11:19:20 -07006381 * The value is the index of the channel center frequency for
6382 * 20 MHz, 40 MHz, and 80 MHz channels. The value is the center
6383 * frequency index of the primary 80 MHz segment for 160 MHz and
6384 * 80+80 MHz channels.
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006385 * @vht_seg1_center_ch: VHT mode Segment1 center channel
Hai Shalomfdcde762020-04-02 11:19:20 -07006386 * The value is zero for 20 MHz, 40 MHz, and 80 MHz channels. The
6387 * value is the index of the channel center frequency for 160 MHz
6388 * channels and the center frequency index of the secondary 80 MHz
6389 * segment for 80+80 MHz channels.
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006390 * @ch_width: Selected Channel width by driver. Driver may choose to
6391 * change hostapd configured ACS channel width due driver internal
6392 * channel restrictions.
Dmitry Shmidtb1e52102015-05-29 12:36:29 -07006393 * hw_mode: Selected band (used with hw_mode=any)
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006394 */
6395 struct acs_selected_channels {
Ahmed ElArabawy0ff61c52019-12-26 12:38:39 -08006396 unsigned int pri_freq;
6397 unsigned int sec_freq;
Hai Shalomfdcde762020-04-02 11:19:20 -07006398 u8 edmg_channel;
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006399 u8 vht_seg0_center_ch;
6400 u8 vht_seg1_center_ch;
6401 u16 ch_width;
Dmitry Shmidtb1e52102015-05-29 12:36:29 -07006402 enum hostapd_hw_mode hw_mode;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006403 } acs_selected_channels;
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07006404
6405 /**
6406 * struct p2p_lo_stop - Reason code for P2P Listen offload stop event
6407 * @reason_code: Reason for stopping offload
6408 * P2P_LO_STOPPED_REASON_COMPLETE: Listen offload finished as
6409 * scheduled.
6410 * P2P_LO_STOPPED_REASON_RECV_STOP_CMD: Host requested offload to
6411 * be stopped.
6412 * P2P_LO_STOPPED_REASON_INVALID_PARAM: Invalid listen offload
6413 * parameters.
6414 * P2P_LO_STOPPED_REASON_NOT_SUPPORTED: Listen offload not
6415 * supported by device.
6416 */
6417 struct p2p_lo_stop {
6418 enum {
6419 P2P_LO_STOPPED_REASON_COMPLETE = 0,
6420 P2P_LO_STOPPED_REASON_RECV_STOP_CMD,
6421 P2P_LO_STOPPED_REASON_INVALID_PARAM,
6422 P2P_LO_STOPPED_REASON_NOT_SUPPORTED,
6423 } reason_code;
6424 } p2p_lo_stop;
Roshan Pius3a1667e2018-07-03 15:17:14 -07006425
6426 /* For EVENT_EXTERNAL_AUTH */
6427 struct external_auth external_auth;
6428
6429 /**
6430 * struct sta_opmode - Station's operation mode change event
6431 * @addr: The station MAC address
6432 * @smps_mode: SMPS mode of the station
6433 * @chan_width: Channel width of the station
6434 * @rx_nss: RX_NSS of the station
6435 *
6436 * This is used as data with EVENT_STATION_OPMODE_CHANGED.
6437 */
6438 struct sta_opmode {
6439 const u8 *addr;
6440 enum smps_mode smps_mode;
6441 enum chan_width chan_width;
6442 u8 rx_nss;
6443 } sta_opmode;
6444
6445 /**
6446 * struct wds_sta_interface - Data for EVENT_WDS_STA_INTERFACE_STATUS.
6447 */
6448 struct wds_sta_interface {
6449 const u8 *sta_addr;
6450 const char *ifname;
6451 enum {
6452 INTERFACE_ADDED,
6453 INTERFACE_REMOVED
6454 } istatus;
6455 } wds_sta_interface;
Hai Shalom81f62d82019-07-22 12:10:00 -07006456
6457 /**
6458 * struct update_dh - Data for EVENT_UPDATE_DH
6459 */
6460 struct update_dh {
6461 const u8 *peer;
6462 const u8 *ie;
6463 size_t ie_len;
6464 } update_dh;
Hai Shalomfdcde762020-04-02 11:19:20 -07006465
6466 /**
6467 * struct unprot_beacon - Data for EVENT_UNPROT_BEACON
6468 */
6469 struct unprot_beacon {
6470 const u8 *sa;
6471 } unprot_beacon;
Sunil Ravia04bd252022-05-02 22:54:18 -07006472
6473 /**
6474 * struct bss_color_collision - Data for EVENT_BSS_COLOR_COLLISION
6475 */
6476 struct bss_color_collision {
6477 u64 bitmap;
6478 } bss_color_collision;
Sunil Ravi89eba102022-09-13 21:04:37 -07006479
6480 /**
6481 * struct pasn_auth - Data for EVENT_PASN_AUTH
6482 */
6483 struct pasn_auth pasn_auth;
6484
Sunil Ravi77d572f2023-01-17 23:58:31 +00006485 /**
6486 * struct port_authorized - Data for EVENT_PORT_AUTHORIZED
6487 */
6488 struct port_authorized {
6489 const u8 *td_bitmap;
6490 size_t td_bitmap_len;
6491 } port_authorized;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006492};
6493
6494/**
6495 * wpa_supplicant_event - Report a driver event for wpa_supplicant
6496 * @ctx: Context pointer (wpa_s); this is the ctx variable registered
6497 * with struct wpa_driver_ops::init()
6498 * @event: event type (defined above)
6499 * @data: possible extra data for the event
6500 *
6501 * Driver wrapper code should call this function whenever an event is received
6502 * from the driver.
6503 */
6504void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
6505 union wpa_event_data *data);
6506
Dmitry Shmidte4663042016-04-04 10:07:49 -07006507/**
6508 * wpa_supplicant_event_global - Report a driver event for wpa_supplicant
6509 * @ctx: Context pointer (wpa_s); this is the ctx variable registered
6510 * with struct wpa_driver_ops::init()
6511 * @event: event type (defined above)
6512 * @data: possible extra data for the event
6513 *
6514 * Same as wpa_supplicant_event(), but we search for the interface in
6515 * wpa_global.
6516 */
6517void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
6518 union wpa_event_data *data);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006519
6520/*
6521 * The following inline functions are provided for convenience to simplify
6522 * event indication for some of the common events.
6523 */
6524
6525static inline void drv_event_assoc(void *ctx, const u8 *addr, const u8 *ie,
6526 size_t ielen, int reassoc)
6527{
6528 union wpa_event_data event;
6529 os_memset(&event, 0, sizeof(event));
6530 event.assoc_info.reassoc = reassoc;
6531 event.assoc_info.req_ies = ie;
6532 event.assoc_info.req_ies_len = ielen;
6533 event.assoc_info.addr = addr;
6534 wpa_supplicant_event(ctx, EVENT_ASSOC, &event);
6535}
6536
6537static inline void drv_event_disassoc(void *ctx, const u8 *addr)
6538{
6539 union wpa_event_data event;
6540 os_memset(&event, 0, sizeof(event));
6541 event.disassoc_info.addr = addr;
6542 wpa_supplicant_event(ctx, EVENT_DISASSOC, &event);
6543}
6544
6545static inline void drv_event_eapol_rx(void *ctx, const u8 *src, const u8 *data,
6546 size_t data_len)
6547{
6548 union wpa_event_data event;
6549 os_memset(&event, 0, sizeof(event));
6550 event.eapol_rx.src = src;
6551 event.eapol_rx.data = data;
6552 event.eapol_rx.data_len = data_len;
Sunil8cd6f4d2022-06-28 18:40:46 +00006553 event.eapol_rx.encrypted = FRAME_ENCRYPTION_UNKNOWN;
6554 wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event);
6555}
6556
6557static inline void drv_event_eapol_rx2(void *ctx, const u8 *src, const u8 *data,
6558 size_t data_len,
6559 enum frame_encryption encrypted)
6560{
6561 union wpa_event_data event;
6562 os_memset(&event, 0, sizeof(event));
6563 event.eapol_rx.src = src;
6564 event.eapol_rx.data = data;
6565 event.eapol_rx.data_len = data_len;
6566 event.eapol_rx.encrypted = encrypted;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006567 wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event);
6568}
6569
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006570/* driver_common.c */
6571void wpa_scan_results_free(struct wpa_scan_results *res);
6572
6573/* Convert wpa_event_type to a string for logging */
6574const char * event_to_string(enum wpa_event_type event);
6575
Dmitry Shmidt661b4f72014-09-29 14:58:27 -07006576/* Convert chan_width to a string for logging and control interfaces */
6577const char * channel_width_to_string(enum chan_width width);
6578
Hai Shalom74f70d42019-02-11 14:42:39 -08006579int channel_width_to_int(enum chan_width width);
6580
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006581int ht_supported(const struct hostapd_hw_modes *mode);
6582int vht_supported(const struct hostapd_hw_modes *mode);
Sunil Ravi77d572f2023-01-17 23:58:31 +00006583bool he_supported(const struct hostapd_hw_modes *hw_mode,
6584 enum ieee80211_op_mode op_mode);
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006585
6586struct wowlan_triggers *
6587wpa_get_wowlan_triggers(const char *wowlan_triggers,
6588 const struct wpa_driver_capa *capa);
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07006589/* Convert driver flag to string */
6590const char * driver_flag_to_string(u64 flag);
Hai Shalomb755a2a2020-04-23 21:49:02 -07006591const char * driver_flag2_to_string(u64 flag2);
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006592
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08006593/* NULL terminated array of linked in driver wrappers */
Dmitry Shmidt1d755d02015-04-28 10:34:29 -07006594extern const struct wpa_driver_ops *const wpa_drivers[];
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08006595
Dmitry Shmidt4ae50e62016-06-27 13:48:39 -07006596
6597/* Available drivers */
6598
6599#ifdef CONFIG_DRIVER_WEXT
6600extern const struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */
6601#endif /* CONFIG_DRIVER_WEXT */
6602#ifdef CONFIG_DRIVER_NL80211
6603/* driver_nl80211.c */
6604extern const struct wpa_driver_ops wpa_driver_nl80211_ops;
6605#endif /* CONFIG_DRIVER_NL80211 */
6606#ifdef CONFIG_DRIVER_HOSTAP
6607extern const struct wpa_driver_ops wpa_driver_hostap_ops; /* driver_hostap.c */
6608#endif /* CONFIG_DRIVER_HOSTAP */
6609#ifdef CONFIG_DRIVER_BSD
6610extern const struct wpa_driver_ops wpa_driver_bsd_ops; /* driver_bsd.c */
6611#endif /* CONFIG_DRIVER_BSD */
6612#ifdef CONFIG_DRIVER_OPENBSD
6613/* driver_openbsd.c */
6614extern const struct wpa_driver_ops wpa_driver_openbsd_ops;
6615#endif /* CONFIG_DRIVER_OPENBSD */
6616#ifdef CONFIG_DRIVER_NDIS
6617extern struct wpa_driver_ops wpa_driver_ndis_ops; /* driver_ndis.c */
6618#endif /* CONFIG_DRIVER_NDIS */
6619#ifdef CONFIG_DRIVER_WIRED
6620extern const struct wpa_driver_ops wpa_driver_wired_ops; /* driver_wired.c */
6621#endif /* CONFIG_DRIVER_WIRED */
6622#ifdef CONFIG_DRIVER_MACSEC_QCA
6623/* driver_macsec_qca.c */
6624extern const struct wpa_driver_ops wpa_driver_macsec_qca_ops;
6625#endif /* CONFIG_DRIVER_MACSEC_QCA */
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08006626#ifdef CONFIG_DRIVER_MACSEC_LINUX
6627/* driver_macsec_linux.c */
6628extern const struct wpa_driver_ops wpa_driver_macsec_linux_ops;
6629#endif /* CONFIG_DRIVER_MACSEC_LINUX */
Dmitry Shmidt4ae50e62016-06-27 13:48:39 -07006630#ifdef CONFIG_DRIVER_ROBOSWITCH
6631/* driver_roboswitch.c */
6632extern const struct wpa_driver_ops wpa_driver_roboswitch_ops;
6633#endif /* CONFIG_DRIVER_ROBOSWITCH */
6634#ifdef CONFIG_DRIVER_ATHEROS
6635/* driver_atheros.c */
6636extern const struct wpa_driver_ops wpa_driver_atheros_ops;
6637#endif /* CONFIG_DRIVER_ATHEROS */
6638#ifdef CONFIG_DRIVER_NONE
6639extern const struct wpa_driver_ops wpa_driver_none_ops; /* driver_none.c */
6640#endif /* CONFIG_DRIVER_NONE */
6641
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006642#endif /* DRIVER_H */