blob: 765ea59c44165f35fb363bd8db58e7b4d6cf9550 [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"
Sunil Ravic0f5d412024-09-11 22:12:49 +000025#include "common/nan.h"
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -080026#ifdef CONFIG_MACSEC
27#include "pae/ieee802_1x_kay.h"
28#endif /* CONFIG_MACSEC */
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -070029#include "utils/list.h"
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070030
Sunil Ravic0f5d412024-09-11 22:12:49 +000031struct nan_subscribe_params;
32struct nan_publish_params;
33
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070034#define HOSTAPD_CHAN_DISABLED 0x00000001
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -080035#define HOSTAPD_CHAN_NO_IR 0x00000002
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070036#define HOSTAPD_CHAN_RADAR 0x00000008
37#define HOSTAPD_CHAN_HT40PLUS 0x00000010
38#define HOSTAPD_CHAN_HT40MINUS 0x00000020
39#define HOSTAPD_CHAN_HT40 0x00000040
Dmitry Shmidt391c59f2013-09-03 12:16:28 -070040#define HOSTAPD_CHAN_SURVEY_LIST_INITIALIZED 0x00000080
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070041
Dmitry Shmidtea69e842013-05-13 14:52:28 -070042#define HOSTAPD_CHAN_DFS_UNKNOWN 0x00000000
43#define HOSTAPD_CHAN_DFS_USABLE 0x00000100
44#define HOSTAPD_CHAN_DFS_UNAVAILABLE 0x00000200
45#define HOSTAPD_CHAN_DFS_AVAILABLE 0x00000300
46#define HOSTAPD_CHAN_DFS_MASK 0x00000300
47
Sunil Ravi036cec52023-03-29 11:35:17 -070048#define HOSTAPD_CHAN_VHT_80MHZ_SUBCHANNEL 0x00000800
49#define HOSTAPD_CHAN_VHT_160MHZ_SUBCHANNEL 0x00001000
Sunil Ravi99c035e2024-07-12 01:42:03 +000050#define HOSTAPD_CHAN_EHT_320MHZ_SUBCHANNEL 0x00002000
Dmitry Shmidt68d0e3e2013-10-28 17:59:21 -070051
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -080052#define HOSTAPD_CHAN_INDOOR_ONLY 0x00010000
53#define HOSTAPD_CHAN_GO_CONCURRENT 0x00020000
54
Hai Shalom74f70d42019-02-11 14:42:39 -080055/* Allowed bandwidth mask */
56enum hostapd_chan_width_attr {
57 HOSTAPD_CHAN_WIDTH_10 = BIT(0),
58 HOSTAPD_CHAN_WIDTH_20 = BIT(1),
59 HOSTAPD_CHAN_WIDTH_40P = BIT(2),
60 HOSTAPD_CHAN_WIDTH_40M = BIT(3),
61 HOSTAPD_CHAN_WIDTH_80 = BIT(4),
62 HOSTAPD_CHAN_WIDTH_160 = BIT(5),
Sunil8cd6f4d2022-06-28 18:40:46 +000063 HOSTAPD_CHAN_WIDTH_320 = BIT(6),
Hai Shalom74f70d42019-02-11 14:42:39 -080064};
65
Dmitry Shmidt849734c2016-05-27 09:59:01 -070066/* Filter gratuitous ARP */
67#define WPA_DATA_FRAME_FILTER_FLAG_ARP BIT(0)
68/* Filter unsolicited Neighbor Advertisement */
69#define WPA_DATA_FRAME_FILTER_FLAG_NA BIT(1)
70/* Filter unicast IP packets encrypted using the GTK */
71#define WPA_DATA_FRAME_FILTER_FLAG_GTK BIT(2)
72
Dmitry Shmidtd2986c22017-10-23 14:22:09 -070073#define HOSTAPD_DFS_REGION_FCC 1
74#define HOSTAPD_DFS_REGION_ETSI 2
75#define HOSTAPD_DFS_REGION_JP 3
76
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -080077/**
78 * enum reg_change_initiator - Regulatory change initiator
79 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -080080enum reg_change_initiator {
81 REGDOM_SET_BY_CORE,
82 REGDOM_SET_BY_USER,
83 REGDOM_SET_BY_DRIVER,
84 REGDOM_SET_BY_COUNTRY_IE,
Dmitry Shmidt97672262014-02-03 13:02:54 -080085 REGDOM_BEACON_HINT,
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -080086};
87
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -080088/**
89 * enum reg_type - Regulatory change types
90 */
Dmitry Shmidt7dba0e52014-04-14 10:49:15 -070091enum reg_type {
92 REGDOM_TYPE_UNKNOWN,
93 REGDOM_TYPE_COUNTRY,
94 REGDOM_TYPE_WORLD,
95 REGDOM_TYPE_CUSTOM_WORLD,
96 REGDOM_TYPE_INTERSECTION,
97};
98
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070099/**
Hai Shalom81f62d82019-07-22 12:10:00 -0700100 * struct hostapd_wmm_rule - WMM regulatory rule
101 * @min_cwmin: Lower bound of CW_min value
102 * @min_cwmax: Lower bound of CW_max value
103 * @min_aifs: Lower bound of AIFS value
104 * @max_txop: Upper bound of TXOP, value in units of 32 usec
105 */
106struct hostapd_wmm_rule {
107 int min_cwmin;
108 int min_cwmax;
109 int min_aifs;
110 int max_txop;
111};
112
113/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700114 * struct hostapd_channel_data - Channel information
115 */
116struct hostapd_channel_data {
117 /**
118 * chan - Channel number (IEEE 802.11)
119 */
120 short chan;
121
122 /**
123 * freq - Frequency in MHz
124 */
Dmitry Shmidtd5e49232012-12-03 15:08:10 -0800125 int freq;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700126
127 /**
128 * flag - Channel flags (HOSTAPD_CHAN_*)
129 */
130 int flag;
131
132 /**
Hai Shalom74f70d42019-02-11 14:42:39 -0800133 * allowed_bw - Allowed channel width bitmask
134 *
135 * See enum hostapd_chan_width_attr.
136 */
137 u32 allowed_bw;
138
139 /**
Dmitry Shmidt68d0e3e2013-10-28 17:59:21 -0700140 * max_tx_power - Regulatory transmit power limit in dBm
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700141 */
142 u8 max_tx_power;
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -0700143
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800144 /**
145 * survey_list - Linked list of surveys (struct freq_survey)
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -0700146 */
147 struct dl_list survey_list;
148
149 /**
150 * min_nf - Minimum observed noise floor, in dBm, based on all
151 * surveyed channel data
152 */
153 s8 min_nf;
Dmitry Shmidt391c59f2013-09-03 12:16:28 -0700154
155#ifdef CONFIG_ACS
156 /**
157 * interference_factor - Computed interference factor on this
158 * channel (used internally in src/ap/acs.c; driver wrappers do not
159 * need to set this)
160 */
161 long double interference_factor;
162#endif /* CONFIG_ACS */
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -0700163
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800164 /**
165 * dfs_cac_ms - DFS CAC time in milliseconds
166 */
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -0700167 unsigned int dfs_cac_ms;
Hai Shalom81f62d82019-07-22 12:10:00 -0700168
169 /**
170 * wmm_rules_valid - Indicates wmm_rules state
171 */
172 int wmm_rules_valid;
173
174 /**
175 * wmm_rules - WMM regulatory rules
176 */
177 struct hostapd_wmm_rule wmm_rules[WMM_AC_NUM];
Sunil Ravi036cec52023-03-29 11:35:17 -0700178
179 /**
180 * punct_bitmap - RU puncturing bitmap
181 */
182 u16 punct_bitmap;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700183};
184
Hai Shalomfdcde762020-04-02 11:19:20 -0700185#define HE_MAC_CAPAB_0 0
Hai Shalom81f62d82019-07-22 12:10:00 -0700186#define HE_MAX_MAC_CAPAB_SIZE 6
187#define HE_MAX_PHY_CAPAB_SIZE 11
188#define HE_MAX_MCS_CAPAB_SIZE 12
189#define HE_MAX_PPET_CAPAB_SIZE 25
Dmitry Shmidtebd93af2017-02-21 13:40:44 -0800190
191/**
192 * struct he_capabilities - IEEE 802.11ax HE capabilities
193 */
194struct he_capabilities {
195 u8 he_supported;
Hai Shalom81f62d82019-07-22 12:10:00 -0700196 u8 phy_cap[HE_MAX_PHY_CAPAB_SIZE];
197 u8 mac_cap[HE_MAX_MAC_CAPAB_SIZE];
198 u8 mcs[HE_MAX_MCS_CAPAB_SIZE];
199 u8 ppet[HE_MAX_PPET_CAPAB_SIZE];
Hai Shalom899fcc72020-10-19 14:38:18 -0700200 u16 he_6ghz_capa;
Dmitry Shmidtebd93af2017-02-21 13:40:44 -0800201};
202
Sunil Ravia04bd252022-05-02 22:54:18 -0700203/* struct eht_capabilities - IEEE 802.11be EHT capabilities */
204struct eht_capabilities {
205 bool eht_supported;
206 u16 mac_cap;
207 u8 phy_cap[EHT_PHY_CAPAB_LEN];
208 u8 mcs[EHT_MCS_NSS_CAPAB_LEN];
209 u8 ppet[EHT_PPE_THRESH_CAPAB_LEN];
210};
211
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800212#define HOSTAPD_MODE_FLAG_HT_INFO_KNOWN BIT(0)
Dmitry Shmidtc2ebb4b2013-07-24 12:57:51 -0700213#define HOSTAPD_MODE_FLAG_VHT_INFO_KNOWN BIT(1)
Sunil Ravi77d572f2023-01-17 23:58:31 +0000214#define HOSTAPD_MODE_FLAG_HE_INFO_KNOWN BIT(2)
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800215
Hai Shalom81f62d82019-07-22 12:10:00 -0700216
217enum ieee80211_op_mode {
218 IEEE80211_MODE_INFRA = 0,
219 IEEE80211_MODE_IBSS = 1,
220 IEEE80211_MODE_AP = 2,
221 IEEE80211_MODE_MESH = 5,
222
223 /* only add new entries before IEEE80211_MODE_NUM */
224 IEEE80211_MODE_NUM
225};
226
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700227/**
Hai Shalomc3565922019-10-28 11:58:20 -0700228 * struct ieee80211_edmg_config - EDMG configuration
229 *
230 * This structure describes most essential parameters needed
231 * for IEEE 802.11ay EDMG configuration
232 *
233 * @channels: Bitmap that indicates the 2.16 GHz channel(s)
234 * that are allowed to be used for transmissions.
235 * Bit 0 indicates channel 1, bit 1 indicates channel 2, etc.
236 * Set to 0 to indicate EDMG not supported.
237 * @bw_config: Channel BW Configuration subfield encodes
238 * the allowed channel bandwidth configurations
239 */
240struct ieee80211_edmg_config {
241 u8 channels;
242 enum edmg_bw_config bw_config;
243};
244
245/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700246 * struct hostapd_hw_modes - Supported hardware mode information
247 */
248struct hostapd_hw_modes {
249 /**
250 * mode - Hardware mode
251 */
252 enum hostapd_hw_mode mode;
253
254 /**
Sunil Ravi99c035e2024-07-12 01:42:03 +0000255 * is_6ghz - Whether the mode information is for the 6 GHz band
256 */
257 bool is_6ghz;
258
259 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700260 * num_channels - Number of entries in the channels array
261 */
262 int num_channels;
263
264 /**
265 * channels - Array of supported channels
266 */
267 struct hostapd_channel_data *channels;
268
269 /**
270 * num_rates - Number of entries in the rates array
271 */
272 int num_rates;
273
274 /**
275 * rates - Array of supported rates in 100 kbps units
276 */
277 int *rates;
278
279 /**
280 * ht_capab - HT (IEEE 802.11n) capabilities
281 */
282 u16 ht_capab;
283
284 /**
285 * mcs_set - MCS (IEEE 802.11n) rate parameters
286 */
287 u8 mcs_set[16];
288
289 /**
290 * a_mpdu_params - A-MPDU (IEEE 802.11n) parameters
291 */
292 u8 a_mpdu_params;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800293
Dmitry Shmidt04949592012-07-19 12:16:46 -0700294 /**
295 * vht_capab - VHT (IEEE 802.11ac) capabilities
296 */
297 u32 vht_capab;
298
299 /**
300 * vht_mcs_set - VHT MCS (IEEE 802.11ac) rate parameters
301 */
302 u8 vht_mcs_set[8];
303
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800304 unsigned int flags; /* HOSTAPD_MODE_FLAG_* */
Dmitry Shmidtebd93af2017-02-21 13:40:44 -0800305
306 /**
307 * he_capab - HE (IEEE 802.11ax) capabilities
308 */
Hai Shalom81f62d82019-07-22 12:10:00 -0700309 struct he_capabilities he_capab[IEEE80211_MODE_NUM];
Hai Shalomc3565922019-10-28 11:58:20 -0700310
311 /**
312 * This structure describes the most essential parameters needed
313 * for IEEE 802.11ay EDMG configuration.
314 */
315 struct ieee80211_edmg_config edmg;
Sunil Ravia04bd252022-05-02 22:54:18 -0700316
317 /**
318 * eht_capab - EHT (IEEE 802.11be) capabilities
319 */
320 struct eht_capabilities eht_capab[IEEE80211_MODE_NUM];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700321};
322
323
Sunil Ravic0f5d412024-09-11 22:12:49 +0000324/**
325 * struct hostapd_multi_hw_info: Supported multiple underlying hardware info
326 */
327struct hostapd_multi_hw_info {
328 /**
329 * hw_idx - Hardware index
330 */
331 u8 hw_idx;
332
333 /**
334 * start_freq - Frequency range start in MHz
335 */
336 int start_freq;
337
338 /**
339 * end_freq - Frequency range end in MHz
340 */
341 int end_freq;
342};
343
344
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700345#define IEEE80211_CAP_ESS 0x0001
346#define IEEE80211_CAP_IBSS 0x0002
347#define IEEE80211_CAP_PRIVACY 0x0010
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800348#define IEEE80211_CAP_RRM 0x1000
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700349
Dmitry Shmidtf8623282013-02-20 14:34:59 -0800350/* DMG (60 GHz) IEEE 802.11ad */
351/* type - bits 0..1 */
352#define IEEE80211_CAP_DMG_MASK 0x0003
353#define IEEE80211_CAP_DMG_IBSS 0x0001 /* Tx by: STA */
354#define IEEE80211_CAP_DMG_PBSS 0x0002 /* Tx by: PCP */
355#define IEEE80211_CAP_DMG_AP 0x0003 /* Tx by: AP */
356
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700357#define WPA_SCAN_QUAL_INVALID BIT(0)
358#define WPA_SCAN_NOISE_INVALID BIT(1)
359#define WPA_SCAN_LEVEL_INVALID BIT(2)
360#define WPA_SCAN_LEVEL_DBM BIT(3)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700361#define WPA_SCAN_ASSOCIATED BIT(5)
362
363/**
364 * struct wpa_scan_res - Scan result for an BSS/IBSS
365 * @flags: information flags about the BSS/IBSS (WPA_SCAN_*)
366 * @bssid: BSSID
367 * @freq: frequency of the channel in MHz (e.g., 2412 = channel 1)
Sunil Ravi2a14cf12023-11-21 00:54:38 +0000368 * @max_cw: the max channel width of the connection (calculated during scan
369 * result processing)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700370 * @beacon_int: beacon interval in TUs (host byte order)
371 * @caps: capability information field in host byte order
372 * @qual: signal quality
373 * @noise: noise level
374 * @level: signal level
375 * @tsf: Timestamp
376 * @age: Age of the information in milliseconds (i.e., how many milliseconds
377 * ago the last Beacon or Probe Response frame was received)
Dmitry Shmidt7f656022015-02-25 14:36:37 -0800378 * @est_throughput: Estimated throughput in kbps (this is calculated during
379 * scan result processing if left zero by the driver wrapper)
380 * @snr: Signal-to-noise ratio in dB (calculated during scan result processing)
Dmitry Shmidt29333592017-01-09 12:27:11 -0800381 * @parent_tsf: Time when the Beacon/Probe Response frame was received in terms
382 * of TSF of the BSS specified by %tsf_bssid.
383 * @tsf_bssid: The BSS that %parent_tsf TSF time refers to.
Sunil Ravia04bd252022-05-02 22:54:18 -0700384 * @beacon_newer: Whether the Beacon frame data is known to be newer
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700385 * @ie_len: length of the following IE field in octets
386 * @beacon_ie_len: length of the following Beacon IE field in octets
387 *
388 * This structure is used as a generic format for scan results from the
389 * driver. Each driver interface implementation is responsible for converting
390 * the driver or OS specific scan results into this format.
391 *
392 * If the driver does not support reporting all IEs, the IE data structure is
393 * constructed of the IEs that are available. This field will also need to
394 * include SSID in IE format. All drivers are encouraged to be extended to
395 * report all IEs to make it easier to support future additions.
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800396 *
397 * This structure data is followed by ie_len octets of IEs from Probe Response
398 * frame (or if the driver does not indicate source of IEs, these may also be
399 * from Beacon frame). After the first set of IEs, another set of IEs may follow
400 * (with beacon_ie_len octets of data) if the driver provides both IE sets.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700401 */
402struct wpa_scan_res {
403 unsigned int flags;
404 u8 bssid[ETH_ALEN];
405 int freq;
Sunil Ravi2a14cf12023-11-21 00:54:38 +0000406 enum chan_width max_cw;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700407 u16 beacon_int;
408 u16 caps;
409 int qual;
410 int noise;
411 int level;
412 u64 tsf;
413 unsigned int age;
Dmitry Shmidt7f656022015-02-25 14:36:37 -0800414 unsigned int est_throughput;
415 int snr;
Dmitry Shmidt29333592017-01-09 12:27:11 -0800416 u64 parent_tsf;
417 u8 tsf_bssid[ETH_ALEN];
Sunil Ravia04bd252022-05-02 22:54:18 -0700418 bool beacon_newer;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700419 size_t ie_len;
420 size_t beacon_ie_len;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800421 /* Followed by ie_len + beacon_ie_len octets of IE data */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700422};
423
424/**
425 * struct wpa_scan_results - Scan results
426 * @res: Array of pointers to allocated variable length scan result entries
427 * @num: Number of entries in the scan result array
Dmitry Shmidtf8623282013-02-20 14:34:59 -0800428 * @fetch_time: Time when the results were fetched from the driver
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700429 */
430struct wpa_scan_results {
431 struct wpa_scan_res **res;
432 size_t num;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -0800433 struct os_reltime fetch_time;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700434};
435
436/**
437 * struct wpa_interface_info - Network interface information
438 * @next: Pointer to the next interface or NULL if this is the last one
439 * @ifname: Interface name that can be used with init() or init2()
440 * @desc: Human readable adapter description (e.g., vendor/model) or NULL if
441 * not available
442 * @drv_name: struct wpa_driver_ops::name (note: unlike other strings, this one
443 * is not an allocated copy, i.e., get_interfaces() caller will not free
444 * this)
445 */
446struct wpa_interface_info {
447 struct wpa_interface_info *next;
448 char *ifname;
449 char *desc;
450 const char *drv_name;
451};
452
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800453#define WPAS_MAX_SCAN_SSIDS 16
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700454
455/**
Dmitry Shmidtb97e4282016-02-08 10:16:07 -0800456 * struct wpa_driver_scan_ssid - SSIDs to scan for
457 * @ssid - specific SSID to scan for (ProbeReq)
458 * %NULL or zero-length SSID is used to indicate active scan
459 * with wildcard SSID.
460 * @ssid_len - Length of the SSID in octets
461 */
462struct wpa_driver_scan_ssid {
463 const u8 *ssid;
464 size_t ssid_len;
465};
466
Sunil Ravi640215c2023-06-28 23:08:09 +0000467struct t2lm_mapping {
468 /**
469 * downlink - Bitmap of TIDs mapped with a link in downlink direction
470 */
471 u8 downlink;
472
473 /**
474 * uplink - Bitmap of TIDs mapped with a link in uplink direction
475 */
476 u8 uplink;
477};
478
Dmitry Shmidtb97e4282016-02-08 10:16:07 -0800479/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700480 * struct wpa_driver_scan_params - Scan parameters
481 * Data for struct wpa_driver_ops::scan2().
482 */
483struct wpa_driver_scan_params {
484 /**
485 * ssids - SSIDs to scan for
486 */
Dmitry Shmidtb97e4282016-02-08 10:16:07 -0800487 struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700488
489 /**
490 * num_ssids - Number of entries in ssids array
491 * Zero indicates a request for a passive scan.
492 */
493 size_t num_ssids;
494
495 /**
496 * extra_ies - Extra IE(s) to add into Probe Request or %NULL
497 */
498 const u8 *extra_ies;
499
500 /**
501 * extra_ies_len - Length of extra_ies in octets
502 */
503 size_t extra_ies_len;
504
505 /**
506 * freqs - Array of frequencies to scan or %NULL for all frequencies
507 *
508 * The frequency is set in MHz. The array is zero-terminated.
509 */
510 int *freqs;
511
512 /**
513 * filter_ssids - Filter for reporting SSIDs
514 *
515 * This optional parameter can be used to request the driver wrapper to
516 * filter scan results to include only the specified SSIDs. %NULL
517 * indicates that no filtering is to be done. This can be used to
518 * reduce memory needs for scan results in environments that have large
519 * number of APs with different SSIDs.
520 *
521 * The driver wrapper is allowed to take this allocated buffer into its
522 * own use by setting the pointer to %NULL. In that case, the driver
523 * wrapper is responsible for freeing the buffer with os_free() once it
524 * is not needed anymore.
525 */
526 struct wpa_driver_scan_filter {
Dmitry Shmidt9d9e6022015-04-23 10:34:55 -0700527 u8 ssid[SSID_MAX_LEN];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700528 size_t ssid_len;
529 } *filter_ssids;
530
531 /**
532 * num_filter_ssids - Number of entries in filter_ssids array
533 */
534 size_t num_filter_ssids;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800535
536 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -0700537 * filter_rssi - Filter by RSSI
538 *
539 * The driver may filter scan results in firmware to reduce host
540 * wakeups and thereby save power. Specify the RSSI threshold in s32
541 * dBm.
542 */
543 s32 filter_rssi;
544
545 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800546 * p2p_probe - Used to disable CCK (802.11b) rates for P2P probes
547 *
548 * When set, the driver is expected to remove rates 1, 2, 5.5, and 11
549 * Mbps from the support rates element(s) in the Probe Request frames
550 * and not to transmit the frames at any of those rates.
551 */
Dmitry Shmidt2271d3f2014-06-23 12:16:31 -0700552 unsigned int p2p_probe:1;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -0800553
554 /**
555 * only_new_results - Request driver to report only new results
556 *
557 * This is used to request the driver to report only BSSes that have
558 * been detected after this scan request has been started, i.e., to
559 * flush old cached BSS entries.
560 */
Dmitry Shmidt2271d3f2014-06-23 12:16:31 -0700561 unsigned int only_new_results:1;
562
563 /**
564 * low_priority - Requests driver to use a lower scan priority
565 *
566 * This is used to request the driver to use a lower scan priority
567 * if it supports such a thing.
568 */
569 unsigned int low_priority:1;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -0800570
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800571 /**
572 * mac_addr_rand - Requests driver to randomize MAC address
573 */
574 unsigned int mac_addr_rand:1;
575
576 /**
577 * mac_addr - MAC address used with randomization. The address cannot be
578 * a multicast one, i.e., bit 0 of byte 0 should not be set.
579 */
Hai Shalomc3565922019-10-28 11:58:20 -0700580 u8 *mac_addr;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800581
582 /**
583 * mac_addr_mask - MAC address mask used with randomization.
584 *
585 * Bits that are 0 in the mask should be randomized. Bits that are 1 in
586 * the mask should be taken as is from mac_addr. The mask should not
587 * allow the generation of a multicast address, i.e., bit 0 of byte 0
588 * must be set.
589 */
590 const u8 *mac_addr_mask;
591
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -0800592 /**
593 * sched_scan_plans - Scan plans for scheduled scan
594 *
595 * Each scan plan consists of the number of iterations to scan and the
596 * interval between scans. When a scan plan finishes (i.e., it was run
597 * for the specified number of iterations), the next scan plan is
598 * executed. The scan plans are executed in the order they appear in
599 * the array (lower index first). The last scan plan will run infinitely
600 * (until requested to stop), thus must not specify the number of
601 * iterations. All other scan plans must specify the number of
602 * iterations.
603 */
604 struct sched_scan_plan {
605 u32 interval; /* In seconds */
606 u32 iterations; /* Zero to run infinitely */
607 } *sched_scan_plans;
608
609 /**
610 * sched_scan_plans_num - Number of scan plans in sched_scan_plans array
611 */
612 unsigned int sched_scan_plans_num;
613
Dmitry Shmidt9c175262016-03-03 10:20:07 -0800614 /**
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700615 * sched_scan_start_delay - Delay to use before starting the first scan
616 *
617 * Delay (in seconds) before scheduling first scan plan cycle. The
618 * driver may ignore this parameter and start immediately (or at any
619 * other time), if this feature is not supported.
620 */
621 u32 sched_scan_start_delay;
622
623 /**
Dmitry Shmidt9c175262016-03-03 10:20:07 -0800624 * bssid - Specific BSSID to scan for
625 *
626 * This optional parameter can be used to replace the default wildcard
627 * BSSID with a specific BSSID to scan for if results are needed from
628 * only a single BSS.
629 */
630 const u8 *bssid;
631
Dmitry Shmidtabb90a32016-12-05 15:34:39 -0800632 /**
633 * scan_cookie - Unique identification representing the scan request
634 *
635 * This scan_cookie carries a unique identification representing the
636 * scan request if the host driver/kernel supports concurrent scan
637 * requests. This cookie is returned from the corresponding driver
638 * interface.
639 *
640 * Note: Unlike other parameters in this structure, scan_cookie is used
641 * only to return information instead of setting parameters for the
642 * scan.
643 */
644 u64 scan_cookie;
645
Dmitry Shmidt29333592017-01-09 12:27:11 -0800646 /**
647 * duration - Dwell time on each channel
648 *
649 * This optional parameter can be used to set the dwell time on each
650 * channel. In TUs.
651 */
652 u16 duration;
653
654 /**
655 * duration_mandatory - Whether the specified duration is mandatory
656 *
657 * If this is set, the duration specified by the %duration field is
658 * mandatory (and the driver should reject the scan request if it is
659 * unable to comply with the specified duration), otherwise it is the
660 * maximum duration and the actual duration may be shorter.
661 */
662 unsigned int duration_mandatory:1;
663
Dmitry Shmidtebd93af2017-02-21 13:40:44 -0800664 /**
665 * relative_rssi_set - Whether relative RSSI parameters are set
666 */
667 unsigned int relative_rssi_set:1;
668
669 /**
670 * relative_rssi - Relative RSSI for reporting better BSSs
671 *
672 * Amount of RSSI by which a BSS should be better than the current
673 * connected BSS to report the new BSS to user space.
674 */
675 s8 relative_rssi;
676
677 /**
678 * relative_adjust_band - Band to which RSSI should be adjusted
679 *
680 * The relative_adjust_rssi should be added to the band specified
681 * by relative_adjust_band.
682 */
683 enum set_band relative_adjust_band;
684
685 /**
686 * relative_adjust_rssi - RSSI to be added to relative_adjust_band
687 *
688 * An amount of relative_band_rssi should be added to the BSSs that
689 * belong to the band specified by relative_adjust_band while comparing
690 * with other bands for BSS reporting.
691 */
692 s8 relative_adjust_rssi;
693
Hai Shalomce48b4a2018-09-05 11:41:35 -0700694 /**
695 * oce_scan
696 *
697 * Enable the following OCE scan features: (WFA OCE TechSpec v1.0)
698 * - Accept broadcast Probe Response frame.
699 * - Probe Request frame deferral and suppression.
700 * - Max Channel Time - driver fills FILS request params IE with
701 * Maximum Channel Time.
702 * - Send 1st Probe Request frame in rate of minimum 5.5 Mbps.
703 */
704 unsigned int oce_scan:1;
705
Hai Shalomc1a21442022-02-04 13:43:00 -0800706 /**
707 * p2p_include_6ghz - Include 6 GHz channels for P2P full scan
708 *
709 */
710 unsigned int p2p_include_6ghz:1;
711
Sunil8cd6f4d2022-06-28 18:40:46 +0000712 /**
713 * non_coloc_6ghz - Force scanning of non-PSC 6 GHz channels
714 *
715 * If this is set, the driver should scan non-PSC channels from the
716 * scan request even if neighbor reports from 2.4/5 GHz APs did not
717 * report a co-located AP on these channels. The default is to scan
718 * non-PSC channels only if a co-located AP was reported on the channel.
719 */
720 unsigned int non_coloc_6ghz:1;
721
Sunil Ravi2a14cf12023-11-21 00:54:38 +0000722 /**
723 * min_probe_req_content - Minimize probe request content to only have
724 * minimal requirement elements, e.g., supported rates etc., and no
725 * additional elements other then those provided by user space.
726 */
727 unsigned int min_probe_req_content:1;
728
Sunil Ravi99c035e2024-07-12 01:42:03 +0000729 /**
730 * link_id - Specify the link that is requesting the scan on an MLD
731 *
732 * This is set when operating as an AP MLD and doing an OBSS scan.
733 * -1 indicates that no particular link ID is set.
734 */
735 s8 link_id;
736
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -0800737 /*
738 * NOTE: Whenever adding new parameters here, please make sure
739 * wpa_scan_clone_params() and wpa_scan_free_params() get updated with
740 * matching changes.
741 */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700742};
743
744/**
745 * struct wpa_driver_auth_params - Authentication parameters
746 * Data for struct wpa_driver_ops::authenticate().
747 */
748struct wpa_driver_auth_params {
749 int freq;
750 const u8 *bssid;
751 const u8 *ssid;
752 size_t ssid_len;
753 int auth_alg;
754 const u8 *ie;
755 size_t ie_len;
756 const u8 *wep_key[4];
757 size_t wep_key_len[4];
758 int wep_tx_keyidx;
759 int local_state_change;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800760
761 /**
762 * p2p - Whether this connection is a P2P group
763 */
764 int p2p;
765
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800766 /**
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800767 * auth_data - Additional elements for Authentication frame
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800768 *
769 * This buffer starts with the Authentication transaction sequence
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800770 * number field. If no special handling of such elements is needed, this
771 * pointer is %NULL. This is used with SAE and FILS.
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800772 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800773 const u8 *auth_data;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800774
775 /**
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800776 * auth_data_len - Length of auth_data buffer in octets
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800777 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800778 size_t auth_data_len;
Sunil Ravi77d572f2023-01-17 23:58:31 +0000779
780 /**
781 * mld - Establish an MLD connection
782 */
783 bool mld;
784
785 /**
786 * mld_link_id - The link ID of the MLD AP to which we are associating
787 */
788 u8 mld_link_id;
789
790 /**
791 * The MLD AP address
792 */
793 const u8 *ap_mld_addr;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700794};
795
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800796/**
797 * enum wps_mode - WPS mode
798 */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700799enum wps_mode {
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800800 /**
801 * WPS_MODE_NONE - No WPS provisioning being used
802 */
803 WPS_MODE_NONE,
804
805 /**
806 * WPS_MODE_OPEN - WPS provisioning with AP that is in open mode
807 */
808 WPS_MODE_OPEN,
809
810 /**
811 * WPS_MODE_PRIVACY - WPS provisioning with AP that is using protection
812 */
813 WPS_MODE_PRIVACY
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700814};
815
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800816/**
817 * struct hostapd_freq_params - Channel parameters
818 */
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700819struct hostapd_freq_params {
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800820 /**
821 * mode - Mode/band (HOSTAPD_MODE_IEEE80211A, ..)
822 */
823 enum hostapd_hw_mode mode;
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700824
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800825 /**
826 * freq - Primary channel center frequency in MHz
827 */
828 int freq;
829
830 /**
831 * channel - Channel number
832 */
833 int channel;
834
835 /**
836 * ht_enabled - Whether HT is enabled
837 */
838 int ht_enabled;
839
840 /**
841 * sec_channel_offset - Secondary channel offset for HT40
842 *
843 * 0 = HT40 disabled,
844 * -1 = HT40 enabled, secondary channel below primary,
845 * 1 = HT40 enabled, secondary channel above primary
846 */
847 int sec_channel_offset;
848
849 /**
850 * vht_enabled - Whether VHT is enabled
851 */
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700852 int vht_enabled;
853
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800854 /**
Hai Shalom81f62d82019-07-22 12:10:00 -0700855 * he_enabled - Whether HE is enabled
856 */
857 int he_enabled;
858
859 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800860 * center_freq1 - Segment 0 center frequency in MHz
861 *
862 * Valid for both HT and VHT.
863 */
864 int center_freq1;
865
866 /**
867 * center_freq2 - Segment 1 center frequency in MHz
868 *
869 * Non-zero only for bandwidth 80 and an 80+80 channel
870 */
871 int center_freq2;
872
873 /**
874 * bandwidth - Channel bandwidth in MHz (20, 40, 80, 160)
875 */
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700876 int bandwidth;
Hai Shalomc3565922019-10-28 11:58:20 -0700877
878 /**
879 * This structure describes the most essential parameters needed
880 * for IEEE 802.11ay EDMG configuration.
881 */
882 struct ieee80211_edmg_config edmg;
Sunil Ravia04bd252022-05-02 22:54:18 -0700883
884 /**
885 * radar_background - Whether radar/CAC background is requested
886 */
887 bool radar_background;
888
889 /**
890 * eht_enabled - Whether EHT is enabled
891 */
892 bool eht_enabled;
Sunil Ravi2a14cf12023-11-21 00:54:38 +0000893
894 /**
895 * link_id: If >=0 indicates the link of the AP MLD to configure
896 */
897 int link_id;
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700898};
899
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700900/**
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700901 * struct wpa_driver_sta_auth_params - Authentication parameters
902 * Data for struct wpa_driver_ops::sta_auth().
903 */
904struct wpa_driver_sta_auth_params {
905
906 /**
907 * own_addr - Source address and BSSID for authentication frame
908 */
909 const u8 *own_addr;
910
911 /**
912 * addr - MAC address of the station to associate
913 */
914 const u8 *addr;
915
916 /**
917 * seq - authentication sequence number
918 */
919 u16 seq;
920
921 /**
922 * status - authentication response status code
923 */
924 u16 status;
925
926 /**
927 * ie - authentication frame ie buffer
928 */
929 const u8 *ie;
930
931 /**
932 * len - ie buffer length
933 */
934 size_t len;
935
936 /**
937 * fils_auth - Indicates whether FILS authentication is being performed
938 */
939 int fils_auth;
940
941 /**
942 * fils_anonce - ANonce (required for FILS)
943 */
944 u8 fils_anonce[WPA_NONCE_LEN];
945
946 /**
947 * fils_snonce - SNonce (required for FILS)
948 */
949 u8 fils_snonce[WPA_NONCE_LEN];
950
951 /**
952 * fils_kek - key for encryption (required for FILS)
953 */
954 u8 fils_kek[WPA_KEK_MAX_LEN];
955
956 /**
957 * fils_kek_len - Length of the fils_kek in octets (required for FILS)
958 */
959 size_t fils_kek_len;
960};
961
Sunil Ravi77d572f2023-01-17 23:58:31 +0000962struct wpa_driver_mld_params {
963 /**
964 * mld_addr - AP's MLD address
965 */
966 const u8 *mld_addr;
967
968 /**
969 * valid_links - The valid links including the association link
970 */
971 u16 valid_links;
972
973 /**
974 * assoc_link_id - The link on which the association is performed
975 */
976 u8 assoc_link_id;
977
978 /**
979 * mld_links - Link information
980 *
981 * Should include information on all the requested links for association
982 * including the link on which the association should take place.
983 * For the association link, the ies and ies_len should be NULL and
984 * 0 respectively.
985 */
986 struct {
987 int freq;
988 const u8 *bssid;
989 const u8 *ies;
990 size_t ies_len;
Sunil Ravib0ac25f2024-07-12 01:42:03 +0000991 int error;
992 bool disabled;
Sunil Ravi77d572f2023-01-17 23:58:31 +0000993 } mld_links[MAX_NUM_MLD_LINKS];
994};
995
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700996/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700997 * struct wpa_driver_associate_params - Association parameters
998 * Data for struct wpa_driver_ops::associate().
999 */
1000struct wpa_driver_associate_params {
1001 /**
1002 * bssid - BSSID of the selected AP
1003 * This can be %NULL, if ap_scan=2 mode is used and the driver is
1004 * responsible for selecting with which BSS to associate. */
1005 const u8 *bssid;
1006
1007 /**
Dmitry Shmidt96be6222014-02-13 10:16:51 -08001008 * bssid_hint - BSSID of a proposed AP
1009 *
1010 * This indicates which BSS has been found a suitable candidate for
1011 * initial association for drivers that use driver/firmwate-based BSS
1012 * selection. Unlike the @bssid parameter, @bssid_hint does not limit
1013 * the driver from selecting other BSSes in the ESS.
1014 */
1015 const u8 *bssid_hint;
1016
1017 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001018 * ssid - The selected SSID
1019 */
1020 const u8 *ssid;
1021
1022 /**
1023 * ssid_len - Length of the SSID (1..32)
1024 */
1025 size_t ssid_len;
1026
1027 /**
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -07001028 * freq - channel parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001029 */
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -07001030 struct hostapd_freq_params freq;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001031
1032 /**
Dmitry Shmidt96be6222014-02-13 10:16:51 -08001033 * freq_hint - Frequency of the channel the proposed AP is using
1034 *
1035 * This provides a channel on which a suitable BSS has been found as a
1036 * hint for the driver. Unlike the @freq parameter, @freq_hint does not
1037 * limit the driver from selecting other channels for
1038 * driver/firmware-based BSS selection.
1039 */
1040 int freq_hint;
1041
1042 /**
Dmitry Shmidt04949592012-07-19 12:16:46 -07001043 * bg_scan_period - Background scan period in seconds, 0 to disable
1044 * background scan, or -1 to indicate no change to default driver
1045 * configuration
1046 */
1047 int bg_scan_period;
1048
1049 /**
Dmitry Shmidt2ac5f602014-03-07 10:08:21 -08001050 * beacon_int - Beacon interval for IBSS or 0 to use driver default
1051 */
1052 int beacon_int;
1053
1054 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001055 * wpa_ie - WPA information element for (Re)Association Request
1056 * WPA information element to be included in (Re)Association
1057 * Request (including information element id and length). Use
1058 * of this WPA IE is optional. If the driver generates the WPA
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001059 * IE, it can use pairwise_suite, group_suite, group_mgmt_suite, and
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001060 * key_mgmt_suite to select proper algorithms. In this case,
1061 * the driver has to notify wpa_supplicant about the used WPA
1062 * IE by generating an event that the interface code will
1063 * convert into EVENT_ASSOCINFO data (see below).
1064 *
1065 * When using WPA2/IEEE 802.11i, wpa_ie is used for RSN IE
1066 * instead. The driver can determine which version is used by
1067 * looking at the first byte of the IE (0xdd for WPA, 0x30 for
1068 * WPA2/RSN).
1069 *
1070 * When using WPS, wpa_ie is used for WPS IE instead of WPA/RSN IE.
1071 */
1072 const u8 *wpa_ie;
1073
1074 /**
1075 * wpa_ie_len - length of the wpa_ie
1076 */
1077 size_t wpa_ie_len;
1078
1079 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001080 * wpa_proto - Bitfield of WPA_PROTO_* values to indicate WPA/WPA2
1081 */
1082 unsigned int wpa_proto;
1083
1084 /**
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001085 * pairwise_suite - Selected pairwise cipher suite (WPA_CIPHER_*)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001086 *
1087 * This is usually ignored if @wpa_ie is used.
1088 */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001089 unsigned int pairwise_suite;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001090
1091 /**
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001092 * group_suite - Selected group cipher suite (WPA_CIPHER_*)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001093 *
1094 * This is usually ignored if @wpa_ie is used.
1095 */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001096 unsigned int group_suite;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001097
1098 /**
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001099 * mgmt_group_suite - Selected group management cipher suite (WPA_CIPHER_*)
1100 *
1101 * This is usually ignored if @wpa_ie is used.
1102 */
1103 unsigned int mgmt_group_suite;
1104
1105 /**
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001106 * key_mgmt_suite - Selected key management suite (WPA_KEY_MGMT_*)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001107 *
1108 * This is usually ignored if @wpa_ie is used.
1109 */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001110 unsigned int key_mgmt_suite;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001111
1112 /**
Sunil Ravi89eba102022-09-13 21:04:37 -07001113 * allowed_key_mgmts - Bitfield of allowed key management suites
1114 * (WPA_KEY_MGMT_*) other than @key_mgmt_suite for the current
1115 * connection
1116 *
1117 * SME in the driver may choose key_mgmt from this list for the initial
1118 * connection or roaming. The driver which doesn't support this
1119 * ignores this parameter.
1120 */
1121 unsigned int allowed_key_mgmts;
1122
1123 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001124 * auth_alg - Allowed authentication algorithms
1125 * Bit field of WPA_AUTH_ALG_*
1126 */
1127 int auth_alg;
1128
1129 /**
1130 * mode - Operation mode (infra/ibss) IEEE80211_MODE_*
1131 */
1132 int mode;
1133
1134 /**
1135 * wep_key - WEP keys for static WEP configuration
1136 */
1137 const u8 *wep_key[4];
1138
1139 /**
1140 * wep_key_len - WEP key length for static WEP configuration
1141 */
1142 size_t wep_key_len[4];
1143
1144 /**
1145 * wep_tx_keyidx - WEP TX key index for static WEP configuration
1146 */
1147 int wep_tx_keyidx;
1148
1149 /**
1150 * mgmt_frame_protection - IEEE 802.11w management frame protection
1151 */
1152 enum mfp_options mgmt_frame_protection;
1153
1154 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001155 * passphrase - RSN passphrase for PSK
1156 *
1157 * This value is made available only for WPA/WPA2-Personal (PSK) and
Hai Shalom74f70d42019-02-11 14:42:39 -08001158 * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK. This
1159 * is the 8..63 character ASCII passphrase, if available. Please note
1160 * that this can be %NULL if passphrase was not used to generate the
1161 * PSK. In that case, the psk field must be used to fetch the PSK.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001162 */
1163 const char *passphrase;
1164
1165 /**
1166 * psk - RSN PSK (alternative for passphrase for PSK)
1167 *
1168 * This value is made available only for WPA/WPA2-Personal (PSK) and
Hai Shalom74f70d42019-02-11 14:42:39 -08001169 * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK. This
1170 * is the 32-octet (256-bit) PSK, if available. The driver wrapper
1171 * should be prepared to handle %NULL value as an error.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001172 */
1173 const u8 *psk;
1174
1175 /**
Sunil Ravi2a14cf12023-11-21 00:54:38 +00001176 * sae_password - Password for SAE authentication
1177 *
1178 * This value is made available only for WPA3-Personal (SAE) and only
1179 * for drivers that set WPA_DRIVER_FLAGS2_SAE_OFFLOAD.
1180 */
1181 const char *sae_password;
1182
1183 /**
1184 * sae_password_id - Password Identifier for SAE authentication
1185 *
1186 * This value is made available only for WPA3-Personal (SAE) and only
1187 * for drivers that set WPA_DRIVER_FLAGS2_SAE_OFFLOAD. If %NULL, SAE
1188 * password identifier is not used.
1189 */
1190 const char *sae_password_id;
1191
1192 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001193 * drop_unencrypted - Enable/disable unencrypted frame filtering
1194 *
1195 * Configure the driver to drop all non-EAPOL frames (both receive and
1196 * transmit paths). Unencrypted EAPOL frames (ethertype 0x888e) must
1197 * still be allowed for key negotiation.
1198 */
1199 int drop_unencrypted;
1200
1201 /**
1202 * prev_bssid - Previously used BSSID in this ESS
1203 *
1204 * When not %NULL, this is a request to use reassociation instead of
1205 * association.
1206 */
1207 const u8 *prev_bssid;
1208
1209 /**
1210 * wps - WPS mode
1211 *
1212 * If the driver needs to do special configuration for WPS association,
1213 * this variable provides more information on what type of association
Sunil Ravia04bd252022-05-02 22:54:18 -07001214 * is being requested. Most drivers should not need to use this.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001215 */
1216 enum wps_mode wps;
1217
1218 /**
1219 * p2p - Whether this connection is a P2P group
1220 */
1221 int p2p;
1222
1223 /**
1224 * uapsd - UAPSD parameters for the network
1225 * -1 = do not change defaults
1226 * AP mode: 1 = enabled, 0 = disabled
1227 * STA mode: bits 0..3 UAPSD enabled for VO,VI,BK,BE
1228 */
1229 int uapsd;
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08001230
1231 /**
1232 * fixed_bssid - Whether to force this BSSID in IBSS mode
1233 * 1 = Fix this BSSID and prevent merges.
1234 * 0 = Do not fix BSSID.
1235 */
1236 int fixed_bssid;
1237
1238 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08001239 * fixed_freq - Fix control channel in IBSS mode
1240 * 0 = don't fix control channel (default)
1241 * 1 = fix control channel; this prevents IBSS merging with another
1242 * channel
1243 */
1244 int fixed_freq;
1245
1246 /**
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08001247 * disable_ht - Disable HT (IEEE 802.11n) for this connection
1248 */
1249 int disable_ht;
1250
1251 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001252 * htcaps - HT Capabilities over-rides
1253 *
1254 * Only bits set in the mask will be used, and not all values are used
1255 * by the kernel anyway. Currently, MCS, MPDU and MSDU fields are used.
1256 *
1257 * Pointer to struct ieee80211_ht_capabilities.
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08001258 */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001259 const u8 *htcaps;
1260
1261 /**
1262 * htcaps_mask - HT Capabilities over-rides mask
1263 *
1264 * Pointer to struct ieee80211_ht_capabilities.
1265 */
1266 const u8 *htcaps_mask;
Dmitry Shmidt2f023192013-03-12 12:44:17 -07001267
1268#ifdef CONFIG_VHT_OVERRIDES
1269 /**
1270 * disable_vht - Disable VHT for this connection
1271 */
1272 int disable_vht;
1273
1274 /**
1275 * VHT capability overrides.
1276 */
1277 const struct ieee80211_vht_capabilities *vhtcaps;
1278 const struct ieee80211_vht_capabilities *vhtcaps_mask;
1279#endif /* CONFIG_VHT_OVERRIDES */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001280
Hai Shalomfdcde762020-04-02 11:19:20 -07001281#ifdef CONFIG_HE_OVERRIDES
1282 /**
1283 * disable_he - Disable HE for this connection
1284 */
1285 int disable_he;
1286#endif /* CONFIG_HE_OVERRIDES */
1287
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001288 /**
1289 * req_key_mgmt_offload - Request key management offload for connection
1290 *
1291 * Request key management offload for this connection if the device
1292 * supports it.
1293 */
1294 int req_key_mgmt_offload;
1295
1296 /**
Hai Shalomc3565922019-10-28 11:58:20 -07001297 * req_handshake_offload - Request EAPOL handshake offload
1298 *
1299 * Request EAPOL handshake offload for this connection if the device
1300 * supports it.
1301 */
1302 int req_handshake_offload;
1303
1304 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001305 * Flag for indicating whether this association includes support for
1306 * RRM (Radio Resource Measurements)
1307 */
1308 int rrm_used;
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08001309
1310 /**
1311 * pbss - If set, connect to a PCP in a PBSS. Otherwise, connect to an
1312 * AP as usual. Valid for DMG network only.
1313 */
1314 int pbss;
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08001315
1316 /**
1317 * fils_kek - KEK for FILS association frame protection (AES-SIV)
1318 */
1319 const u8 *fils_kek;
1320
1321 /**
1322 * fils_kek_len: Length of fils_kek in bytes
1323 */
1324 size_t fils_kek_len;
1325
1326 /**
1327 * fils_nonces - Nonces for FILS association frame protection
1328 * (AES-SIV AAD)
1329 */
1330 const u8 *fils_nonces;
1331
1332 /**
1333 * fils_nonces_len: Length of fils_nonce in bytes
1334 */
1335 size_t fils_nonces_len;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001336
1337 /**
1338 * fils_erp_username - Username part of keyName-NAI
1339 */
1340 const u8 *fils_erp_username;
1341
1342 /**
1343 * fils_erp_username_len - Length of fils_erp_username in bytes
1344 */
1345 size_t fils_erp_username_len;
1346
1347 /**
1348 * fils_erp_realm - Realm/domain name to use in FILS ERP
1349 */
1350 const u8 *fils_erp_realm;
1351
1352 /**
1353 * fils_erp_realm_len - Length of fils_erp_realm in bytes
1354 */
1355 size_t fils_erp_realm_len;
1356
1357 /**
1358 * fils_erp_next_seq_num - The next sequence number to use in FILS ERP
1359 * messages
1360 */
1361 u16 fils_erp_next_seq_num;
1362
1363 /**
1364 * fils_erp_rrk - Re-authentication root key (rRK) for the keyName-NAI
1365 * specified by fils_erp_username@fils_erp_realm.
1366 */
1367 const u8 *fils_erp_rrk;
1368
1369 /**
1370 * fils_erp_rrk_len - Length of fils_erp_rrk in bytes
1371 */
1372 size_t fils_erp_rrk_len;
Hai Shalom60840252021-02-19 19:02:11 -08001373
1374 /**
1375 * sae_pwe - SAE mechanism for PWE derivation
1376 * 0 = hunting-and-pecking loop only
1377 * 1 = hash-to-element only
1378 * 2 = both hunting-and-pecking loop and hash-to-element enabled
1379 */
Sunil Ravi77d572f2023-01-17 23:58:31 +00001380 enum sae_pwe sae_pwe;
1381
Winnie Chen4138eec2022-11-10 16:32:53 +08001382#if defined(CONFIG_DRIVER_NL80211_BRCM) || defined(CONFIG_DRIVER_NL80211_SYNA)
Vinayak Yadawade62409f2022-01-20 12:32:07 +05301383 /**
1384 * td_policy - Transition Disable Policy
1385 */
1386 u32 td_policy;
Winnie Chen4138eec2022-11-10 16:32:53 +08001387#endif /* CONFIG_DRIVER_NL80211_BRCM || CONFIG_DRIVER_NL80211_SYNA */
Sunil Ravi77d572f2023-01-17 23:58:31 +00001388
1389 /**
1390 * disable_eht - Disable EHT for this connection
1391 */
1392 int disable_eht;
1393
1394 /*
1395 * mld_params - MLD association parameters
1396 */
1397 struct wpa_driver_mld_params mld_params;
Sunil Ravic0f5d412024-09-11 22:12:49 +00001398
1399
1400 /**
1401 * rsn_overriding - wpa_supplicant RSN overriding support
1402 */
1403 bool rsn_overriding;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001404};
1405
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001406enum hide_ssid {
1407 NO_SSID_HIDING,
1408 HIDDEN_SSID_ZERO_LEN,
1409 HIDDEN_SSID_ZERO_CONTENTS
1410};
1411
Hai Shalom81f62d82019-07-22 12:10:00 -07001412enum ch_switch_state {
1413 CH_SW_STARTED,
1414 CH_SW_FINISHED
1415};
1416
Dmitry Shmidtb58836e2014-04-29 14:35:56 -07001417struct wowlan_triggers {
1418 u8 any;
1419 u8 disconnect;
1420 u8 magic_pkt;
1421 u8 gtk_rekey_failure;
1422 u8 eap_identity_req;
1423 u8 four_way_handshake;
1424 u8 rfkill_release;
1425};
1426
Sunil Ravi7f769292024-07-23 22:21:32 +00001427struct unsol_bcast_probe_resp {
1428 /**
1429 * Unsolicited broadcast Probe Response interval in TUs
1430 */
1431 unsigned int unsol_bcast_probe_resp_interval;
1432
1433 /**
1434 * Unsolicited broadcast Probe Response template data
1435 */
1436 u8 *unsol_bcast_probe_resp_tmpl;
1437
1438 /**
1439 * Unsolicited broadcast Probe Response template length
1440 */
1441 size_t unsol_bcast_probe_resp_tmpl_len;
1442};
1443
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001444struct wpa_driver_ap_params {
1445 /**
1446 * head - Beacon head from IEEE 802.11 header to IEs before TIM IE
1447 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08001448 u8 *head;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001449
1450 /**
1451 * head_len - Length of the head buffer in octets
1452 */
1453 size_t head_len;
1454
1455 /**
1456 * tail - Beacon tail following TIM IE
1457 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08001458 u8 *tail;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001459
1460 /**
1461 * tail_len - Length of the tail buffer in octets
1462 */
1463 size_t tail_len;
1464
1465 /**
1466 * dtim_period - DTIM period
1467 */
1468 int dtim_period;
1469
1470 /**
1471 * beacon_int - Beacon interval
1472 */
1473 int beacon_int;
1474
1475 /**
1476 * basic_rates: -1 terminated array of basic rates in 100 kbps
1477 *
1478 * This parameter can be used to set a specific basic rate set for the
1479 * BSS. If %NULL, default basic rate set is used.
1480 */
1481 int *basic_rates;
1482
1483 /**
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001484 * beacon_rate: Beacon frame data rate
1485 *
1486 * This parameter can be used to set a specific Beacon frame data rate
1487 * for the BSS. The interpretation of this value depends on the
Hai Shalom60840252021-02-19 19:02:11 -08001488 * rate_type (legacy: in 100 kbps units, HT: HT-MCS, VHT: VHT-MCS,
1489 * HE: HE-MCS). If beacon_rate == 0 and rate_type == 0
1490 * (BEACON_RATE_LEGACY), the default Beacon frame data rate is used.
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001491 */
1492 unsigned int beacon_rate;
1493
1494 /**
Hai Shalom60840252021-02-19 19:02:11 -08001495 * beacon_rate_type: Beacon data rate type (legacy/HT/VHT/HE)
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001496 */
1497 enum beacon_rate_type rate_type;
1498
1499 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001500 * proberesp - Probe Response template
1501 *
1502 * This is used by drivers that reply to Probe Requests internally in
1503 * AP mode and require the full Probe Response template.
1504 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08001505 u8 *proberesp;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001506
1507 /**
1508 * proberesp_len - Length of the proberesp buffer in octets
1509 */
1510 size_t proberesp_len;
1511
1512 /**
1513 * ssid - The SSID to use in Beacon/Probe Response frames
1514 */
1515 const u8 *ssid;
1516
1517 /**
1518 * ssid_len - Length of the SSID (1..32)
1519 */
1520 size_t ssid_len;
1521
1522 /**
1523 * hide_ssid - Whether to hide the SSID
1524 */
1525 enum hide_ssid hide_ssid;
1526
1527 /**
1528 * pairwise_ciphers - WPA_CIPHER_* bitfield
1529 */
1530 unsigned int pairwise_ciphers;
1531
1532 /**
1533 * group_cipher - WPA_CIPHER_*
1534 */
1535 unsigned int group_cipher;
1536
1537 /**
1538 * key_mgmt_suites - WPA_KEY_MGMT_* bitfield
1539 */
1540 unsigned int key_mgmt_suites;
1541
1542 /**
1543 * auth_algs - WPA_AUTH_ALG_* bitfield
1544 */
1545 unsigned int auth_algs;
1546
1547 /**
1548 * wpa_version - WPA_PROTO_* bitfield
1549 */
1550 unsigned int wpa_version;
1551
1552 /**
1553 * privacy - Whether privacy is used in the BSS
1554 */
1555 int privacy;
1556
1557 /**
1558 * beacon_ies - WPS/P2P IE(s) for Beacon frames
1559 *
1560 * This is used to add IEs like WPS IE and P2P IE by drivers that do
1561 * not use the full Beacon template.
1562 */
1563 const struct wpabuf *beacon_ies;
1564
1565 /**
1566 * proberesp_ies - P2P/WPS IE(s) for Probe Response frames
1567 *
1568 * This is used to add IEs like WPS IE and P2P IE by drivers that
1569 * reply to Probe Request frames internally.
1570 */
1571 const struct wpabuf *proberesp_ies;
1572
1573 /**
1574 * assocresp_ies - WPS IE(s) for (Re)Association Response frames
1575 *
1576 * This is used to add IEs like WPS IE by drivers that reply to
1577 * (Re)Association Request frames internally.
1578 */
1579 const struct wpabuf *assocresp_ies;
1580
1581 /**
1582 * isolate - Whether to isolate frames between associated stations
1583 *
1584 * If this is non-zero, the AP is requested to disable forwarding of
1585 * frames between associated stations.
1586 */
1587 int isolate;
1588
1589 /**
1590 * cts_protect - Whether CTS protection is enabled
1591 */
1592 int cts_protect;
1593
1594 /**
1595 * preamble - Whether short preamble is enabled
1596 */
1597 int preamble;
1598
1599 /**
1600 * short_slot_time - Whether short slot time is enabled
1601 *
1602 * 0 = short slot time disable, 1 = short slot time enabled, -1 = do
1603 * not set (e.g., when 802.11g mode is not in use)
1604 */
1605 int short_slot_time;
1606
1607 /**
1608 * ht_opmode - HT operation mode or -1 if HT not in use
1609 */
1610 int ht_opmode;
1611
1612 /**
1613 * interworking - Whether Interworking is enabled
1614 */
1615 int interworking;
1616
1617 /**
1618 * hessid - Homogeneous ESS identifier or %NULL if not set
1619 */
1620 const u8 *hessid;
1621
1622 /**
1623 * access_network_type - Access Network Type (0..15)
1624 *
1625 * This is used for filtering Probe Request frames when Interworking is
1626 * enabled.
1627 */
1628 u8 access_network_type;
Dmitry Shmidt04949592012-07-19 12:16:46 -07001629
1630 /**
1631 * ap_max_inactivity - Timeout in seconds to detect STA's inactivity
1632 *
1633 * This is used by driver which advertises this capability.
1634 */
1635 int ap_max_inactivity;
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07001636
1637 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08001638 * ctwindow - Client Traffic Window (in TUs)
1639 */
1640 u8 p2p_go_ctwindow;
1641
1642 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07001643 * disable_dgaf - Whether group-addressed frames are disabled
1644 */
1645 int disable_dgaf;
Dmitry Shmidtf21452a2014-02-26 10:55:25 -08001646
1647 /**
1648 * osen - Whether OSEN security is enabled
1649 */
1650 int osen;
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07001651
1652 /**
1653 * freq - Channel parameters for dynamic bandwidth changes
1654 */
1655 struct hostapd_freq_params *freq;
Dmitry Shmidt7f656022015-02-25 14:36:37 -08001656
1657 /**
1658 * reenable - Whether this is to re-enable beaconing
1659 */
1660 int reenable;
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08001661
1662 /**
1663 * pbss - Whether to start a PCP (in PBSS) instead of an AP in
1664 * infrastructure BSS. Valid only for DMG network.
1665 */
1666 int pbss;
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001667
1668 /**
1669 * multicast_to_unicast - Whether to use multicast_to_unicast
1670 *
1671 * If this is non-zero, the AP is requested to perform multicast to
1672 * unicast conversion for ARP, IPv4, and IPv6 frames (possibly within
1673 * 802.1Q). If enabled, such frames are to be sent to each station
1674 * separately, with the DA replaced by their own MAC address rather
1675 * than the group address.
1676 *
1677 * Note that this may break certain expectations of the receiver, such
1678 * as the ability to drop unicast IP packets received within multicast
1679 * L2 frames, or the ability to not send ICMP destination unreachable
1680 * messages for packets received in L2 multicast (which is required,
1681 * but the receiver can't tell the difference if this new option is
1682 * enabled.)
1683 *
1684 * This also doesn't implement the 802.11 DMS (directed multicast
1685 * service).
1686 */
1687 int multicast_to_unicast;
Hai Shalom74f70d42019-02-11 14:42:39 -08001688
1689 /**
1690 * ftm_responder - Whether FTM responder is enabled
1691 */
1692 int ftm_responder;
1693
1694 /**
1695 * lci - Binary data, the content of an LCI report IE with type 8 as
1696 * defined in IEEE Std 802.11-2016, 9.4.2.22.10
1697 */
1698 const struct wpabuf *lci;
1699
1700 /**
1701 * civic - Binary data, the content of a measurement report IE with
1702 * type 11 as defined in IEEE Std 802.11-2016, 9.4.2.22.13
1703 */
1704 const struct wpabuf *civic;
Hai Shalomc3565922019-10-28 11:58:20 -07001705
1706 /**
Hai Shalom60840252021-02-19 19:02:11 -08001707 * he_spr_ctrl - Spatial Reuse control field of SPR element
Hai Shalomc3565922019-10-28 11:58:20 -07001708 */
Hai Shalom60840252021-02-19 19:02:11 -08001709 u8 he_spr_ctrl;
1710
1711 /**
1712 * he_spr_non_srg_obss_pd_max_offset - Non-SRG Maximum TX power offset
1713 */
1714 u8 he_spr_non_srg_obss_pd_max_offset;
Hai Shalomc3565922019-10-28 11:58:20 -07001715
1716 /**
1717 * he_spr_srg_obss_pd_min_offset - Minimum TX power offset
1718 */
Hai Shalom60840252021-02-19 19:02:11 -08001719 u8 he_spr_srg_obss_pd_min_offset;
Hai Shalomc3565922019-10-28 11:58:20 -07001720
1721 /**
1722 * he_spr_srg_obss_pd_max_offset - Maximum TX power offset
1723 */
Hai Shalom60840252021-02-19 19:02:11 -08001724 u8 he_spr_srg_obss_pd_max_offset;
1725
1726 /**
1727 * he_spr_bss_color_bitmap - BSS color values used by members of the
1728 * SRG.
1729 */
1730 u8 he_spr_bss_color_bitmap[8];
1731
1732 /**
1733 * he_spr_partial_bssid_bitmap - Partial BSSID values used by members
1734 * of the SRG.
1735 */
1736 u8 he_spr_partial_bssid_bitmap[8];
Hai Shalomfdcde762020-04-02 11:19:20 -07001737
1738 /**
1739 * he_bss_color - Whether the BSS Color is disabled
1740 */
1741 int he_bss_color_disabled;
1742
1743 /**
1744 * he_bss_color_partial - The BSS Color AID equation
1745 */
1746 int he_bss_color_partial;
1747
1748 /**
1749 * he_bss_color - The BSS Color of the AP
1750 */
1751 int he_bss_color;
1752
1753 /**
1754 * twt_responder - Whether Target Wait Time responder is enabled
1755 */
1756 int twt_responder;
Hai Shalom60840252021-02-19 19:02:11 -08001757
1758 /**
1759 * sae_pwe - SAE mechanism for PWE derivation
1760 * 0 = hunting-and-pecking loop only
1761 * 1 = hash-to-element only
1762 * 2 = both hunting-and-pecking loop and hash-to-element enabled
1763 */
Sunil Ravi77d572f2023-01-17 23:58:31 +00001764 enum sae_pwe sae_pwe;
Hai Shalom60840252021-02-19 19:02:11 -08001765
1766 /**
1767 * FILS Discovery frame minimum interval in TUs
1768 */
1769 u32 fd_min_int;
1770
1771 /**
1772 * FILS Discovery frame maximum interval in TUs (0 = FD frame disabled)
1773 */
1774 u32 fd_max_int;
1775
1776 /**
1777 * FILS Discovery frame template data
1778 */
1779 u8 *fd_frame_tmpl;
1780
1781 /**
1782 * FILS Discovery frame template length
1783 */
1784 size_t fd_frame_tmpl_len;
1785
1786 /**
Sunil Ravi77d572f2023-01-17 23:58:31 +00001787 * mbssid_tx_iface - Transmitting interface of the MBSSID set
1788 */
1789 const char *mbssid_tx_iface;
1790
1791 /**
1792 * mbssid_index - The index of this BSS in the MBSSID set
1793 */
1794 unsigned int mbssid_index;
1795
1796 /**
1797 * mbssid_elem - Buffer containing all MBSSID elements
1798 */
1799 u8 *mbssid_elem;
1800
1801 /**
1802 * mbssid_elem_len - Total length of all MBSSID elements
1803 */
1804 size_t mbssid_elem_len;
1805
1806 /**
1807 * mbssid_elem_count - The number of MBSSID elements
1808 */
1809 u8 mbssid_elem_count;
1810
1811 /**
1812 * mbssid_elem_offset - Offsets to elements in mbssid_elem.
1813 * Kernel will use these offsets to generate multiple BSSID beacons.
1814 */
1815 u8 **mbssid_elem_offset;
1816
1817 /**
1818 * ema - Enhanced MBSSID advertisements support.
1819 */
1820 bool ema;
Sunil Ravi036cec52023-03-29 11:35:17 -07001821
1822 /**
1823 * punct_bitmap - Preamble puncturing bitmap
1824 * Each bit corresponds to a 20 MHz subchannel, the lowest bit for the
1825 * channel with the lowest frequency. A bit set to 1 indicates that the
1826 * subchannel is punctured, otherwise active.
1827 */
1828 u16 punct_bitmap;
Sunil Ravi640215c2023-06-28 23:08:09 +00001829
1830 /**
1831 * rnr_elem - This buffer contains all of reduced neighbor report (RNR)
1832 * elements
1833 */
1834 u8 *rnr_elem;
1835
1836 /**
1837 * rnr_elem_len - Length of rnr_elem buffer
1838 */
1839 size_t rnr_elem_len;
1840
1841 /**
1842 * rnr_elem_count - Number of RNR elements
1843 */
1844 unsigned int rnr_elem_count;
1845
1846 /**
1847 * rnr_elem_offset - The offsets to the elements in rnr_elem.
1848 * The driver will use these to include RNR elements in EMA beacons.
1849 */
1850 u8 **rnr_elem_offset;
1851
Sunil Ravi7f769292024-07-23 22:21:32 +00001852 /* Unsolicited broadcast Probe Response data */
1853 struct unsol_bcast_probe_resp ubpr;
1854
Sunil Ravi640215c2023-06-28 23:08:09 +00001855 /**
1856 * allowed_freqs - List of allowed 20 MHz channel center frequencies in
1857 * MHz for AP operation. Drivers which support this parameter will
1858 * generate a new list based on this provided list by filtering out
1859 * channels that cannot be used at that time due to regulatory or other
1860 * constraints. The resulting list is used as the list of all allowed
1861 * channels whenever performing operations like ACS and DFS.
1862 */
1863 int *allowed_freqs;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00001864
1865 /*
1866 * mld_ap - Whether operating as an AP MLD
1867 */
1868 bool mld_ap;
1869
1870 /**
1871 * mld_link_id - Link id for MLD BSS's
1872 */
1873 u8 mld_link_id;
1874
1875 /**
1876 * psk - PSK passed to the driver for 4-way handshake offload
1877 */
1878 u8 psk[PMK_LEN];
1879
1880 /**
1881 * psk_len - PSK length in bytes (0 = not set)
1882 */
1883 size_t psk_len;
1884
1885 /**
1886 * sae_password - SAE password for SAE offload
1887 */
1888 const char *sae_password;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001889};
1890
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001891struct wpa_driver_mesh_bss_params {
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001892#define WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS 0x00000001
1893#define WPA_DRIVER_MESH_CONF_FLAG_PEER_LINK_TIMEOUT 0x00000002
1894#define WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS 0x00000004
1895#define WPA_DRIVER_MESH_CONF_FLAG_HT_OP_MODE 0x00000008
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001896#define WPA_DRIVER_MESH_CONF_FLAG_RSSI_THRESHOLD 0x00000010
Hai Shalomc1a21442022-02-04 13:43:00 -08001897#define WPA_DRIVER_MESH_CONF_FLAG_FORWARDING 0x00000020
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001898 /*
1899 * TODO: Other mesh configuration parameters would go here.
1900 * See NL80211_MESHCONF_* for all the mesh config parameters.
1901 */
1902 unsigned int flags;
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001903 int auto_plinks;
Dmitry Shmidt2f74e362015-01-21 13:19:05 -08001904 int peer_link_timeout;
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001905 int max_peer_links;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001906 int rssi_threshold;
Hai Shalomc1a21442022-02-04 13:43:00 -08001907 int forwarding;
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001908 u16 ht_opmode;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001909};
1910
1911struct wpa_driver_mesh_join_params {
1912 const u8 *meshid;
1913 int meshid_len;
1914 const int *basic_rates;
1915 const u8 *ies;
1916 int ie_len;
Dmitry Shmidtff787d52015-01-12 13:01:47 -08001917 struct hostapd_freq_params freq;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001918 int beacon_int;
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07001919 int dtim_period;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001920 struct wpa_driver_mesh_bss_params conf;
1921#define WPA_DRIVER_MESH_FLAG_USER_MPM 0x00000001
1922#define WPA_DRIVER_MESH_FLAG_DRIVER_MPM 0x00000002
1923#define WPA_DRIVER_MESH_FLAG_SAE_AUTH 0x00000004
1924#define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008
1925 unsigned int flags;
Hai Shalom60840252021-02-19 19:02:11 -08001926 bool handle_dfs;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001927};
1928
Hai Shalomfdcde762020-04-02 11:19:20 -07001929struct wpa_driver_set_key_params {
1930 /**
1931 * ifname - Interface name (for multi-SSID/VLAN support) */
1932 const char *ifname;
1933
1934 /**
1935 * alg - Encryption algorithm
1936 *
1937 * (%WPA_ALG_NONE, %WPA_ALG_WEP, %WPA_ALG_TKIP, %WPA_ALG_CCMP,
Hai Shalom4fbc08f2020-05-18 12:37:00 -07001938 * %WPA_ALG_BIP_AES_CMAC_128, %WPA_ALG_GCMP, %WPA_ALG_GCMP_256,
1939 * %WPA_ALG_CCMP_256, %WPA_ALG_BIP_GMAC_128, %WPA_ALG_BIP_GMAC_256,
1940 * %WPA_ALG_BIP_CMAC_256);
Hai Shalomfdcde762020-04-02 11:19:20 -07001941 * %WPA_ALG_NONE clears the key. */
1942 enum wpa_alg alg;
1943
1944 /**
1945 * addr - Address of the peer STA
1946 *
1947 * (BSSID of the current AP when setting pairwise key in station mode),
1948 * ff:ff:ff:ff:ff:ff for broadcast keys, %NULL for default keys that
1949 * are used both for broadcast and unicast; when clearing keys, %NULL
1950 * is used to indicate that both the broadcast-only and default key of
1951 * the specified key index is to be cleared */
1952 const u8 *addr;
1953
1954 /**
1955 * key_idx - Key index
1956 *
1957 * (0..3), usually 0 for unicast keys; 4..5 for IGTK; 6..7 for BIGTK */
1958 int key_idx;
1959
1960 /**
1961 * set_tx - Configure this key as the default Tx key
1962 *
1963 * Only used when driver does not support separate unicast/individual
1964 * key */
1965 int set_tx;
1966
1967 /**
1968 * seq - Sequence number/packet number
1969 *
1970 * seq_len octets, the next packet number to be used for in replay
1971 * protection; configured for Rx keys (in most cases, this is only used
1972 * with broadcast keys and set to zero for unicast keys); %NULL if not
1973 * set */
1974 const u8 *seq;
1975
1976 /**
1977 * seq_len - Length of the seq, depends on the algorithm
1978 *
1979 * TKIP: 6 octets, CCMP/GCMP: 6 octets, IGTK: 6 octets */
1980 size_t seq_len;
1981
1982 /**
1983 * key - Key buffer
1984 *
1985 * TKIP: 16-byte temporal key, 8-byte Tx Mic key, 8-byte Rx Mic Key */
1986 const u8 *key;
1987
1988 /**
1989 * key_len - Length of the key buffer in octets
1990 *
1991 * WEP: 5 or 13, TKIP: 32, CCMP/GCMP: 16, IGTK: 16 */
1992 size_t key_len;
1993
1994 /**
1995 * vlan_id - VLAN index (0..4095) for VLAN offload cases */
1996 int vlan_id;
1997
1998 /**
1999 * key_flag - Additional key flags
2000 *
2001 * %KEY_FLAG_MODIFY
2002 * Set when an already installed key must be updated.
2003 * So far the only use-case is changing RX/TX status for
2004 * pairwise keys. Must not be set when deleting a key.
2005 * %KEY_FLAG_DEFAULT
2006 * Set when the key is also a default key. Must not be set when
2007 * deleting a key.
2008 * %KEY_FLAG_RX
2009 * The key is valid for RX. Must not be set when deleting a key.
2010 * %KEY_FLAG_TX
2011 * The key is valid for TX. Must not be set when deleting a key.
2012 * %KEY_FLAG_GROUP
2013 * The key is a broadcast or group key.
2014 * %KEY_FLAG_PAIRWISE
2015 * The key is a pairwise key.
2016 * %KEY_FLAG_PMK
2017 * The key is a Pairwise Master Key (PMK).
2018 *
2019 * Valid and pre-defined combinations are:
2020 * %KEY_FLAG_GROUP_RX_TX
2021 * WEP key not to be installed as default key.
2022 * %KEY_FLAG_GROUP_RX_TX_DEFAULT
2023 * Default WEP or WPA-NONE key.
2024 * %KEY_FLAG_GROUP_RX
2025 * GTK key valid for RX only.
2026 * %KEY_FLAG_GROUP_TX_DEFAULT
2027 * GTK key valid for TX only, immediately taking over TX.
2028 * %KEY_FLAG_PAIRWISE_RX_TX
2029 * Pairwise key immediately becoming the active pairwise key.
2030 * %KEY_FLAG_PAIRWISE_RX
2031 * Pairwise key not yet valid for TX. (Only usable when Extended
2032 * Key ID is supported by the driver.)
2033 * %KEY_FLAG_PAIRWISE_RX_TX_MODIFY
2034 * Enable TX for a pairwise key installed with
2035 * KEY_FLAG_PAIRWISE_RX.
2036 *
2037 * Not a valid standalone key type but pre-defined to be combined
2038 * with other key_flags:
2039 * %KEY_FLAG_RX_TX
2040 * RX/TX key. */
2041 enum key_flag key_flag;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002042
2043 /**
2044 * link_id - MLO Link ID
2045 *
2046 * Set to a valid Link ID (0-14) when applicable, otherwise -1. */
2047 int link_id;
Hai Shalomfdcde762020-04-02 11:19:20 -07002048};
2049
Hai Shalom4fbc08f2020-05-18 12:37:00 -07002050enum wpa_driver_if_type {
2051 /**
2052 * WPA_IF_STATION - Station mode interface
2053 */
2054 WPA_IF_STATION,
2055
2056 /**
2057 * WPA_IF_AP_VLAN - AP mode VLAN interface
2058 *
2059 * This interface shares its address and Beacon frame with the main
2060 * BSS.
2061 */
2062 WPA_IF_AP_VLAN,
2063
2064 /**
2065 * WPA_IF_AP_BSS - AP mode BSS interface
2066 *
2067 * This interface has its own address and Beacon frame.
2068 */
2069 WPA_IF_AP_BSS,
2070
2071 /**
2072 * WPA_IF_P2P_GO - P2P Group Owner
2073 */
2074 WPA_IF_P2P_GO,
2075
2076 /**
2077 * WPA_IF_P2P_CLIENT - P2P Client
2078 */
2079 WPA_IF_P2P_CLIENT,
2080
2081 /**
2082 * WPA_IF_P2P_GROUP - P2P Group interface (will become either
2083 * WPA_IF_P2P_GO or WPA_IF_P2P_CLIENT, but the role is not yet known)
2084 */
2085 WPA_IF_P2P_GROUP,
2086
2087 /**
Sunil Ravia04bd252022-05-02 22:54:18 -07002088 * WPA_IF_P2P_DEVICE - P2P Device interface is used to identify the
Hai Shalom4fbc08f2020-05-18 12:37:00 -07002089 * abstracted P2P Device function in the driver
2090 */
2091 WPA_IF_P2P_DEVICE,
2092
2093 /*
2094 * WPA_IF_MESH - Mesh interface
2095 */
2096 WPA_IF_MESH,
2097
2098 /*
2099 * WPA_IF_TDLS - TDLS offchannel interface (used for pref freq only)
2100 */
2101 WPA_IF_TDLS,
2102
2103 /*
2104 * WPA_IF_IBSS - IBSS interface (used for pref freq only)
2105 */
2106 WPA_IF_IBSS,
2107
2108 /*
2109 * WPA_IF_NAN - NAN Device
2110 */
2111 WPA_IF_NAN,
2112
2113 /* keep last */
2114 WPA_IF_MAX
2115};
2116
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002117/**
2118 * struct wpa_driver_capa - Driver capability information
2119 */
2120struct wpa_driver_capa {
2121#define WPA_DRIVER_CAPA_KEY_MGMT_WPA 0x00000001
2122#define WPA_DRIVER_CAPA_KEY_MGMT_WPA2 0x00000002
2123#define WPA_DRIVER_CAPA_KEY_MGMT_WPA_PSK 0x00000004
2124#define WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK 0x00000008
2125#define WPA_DRIVER_CAPA_KEY_MGMT_WPA_NONE 0x00000010
2126#define WPA_DRIVER_CAPA_KEY_MGMT_FT 0x00000020
2127#define WPA_DRIVER_CAPA_KEY_MGMT_FT_PSK 0x00000040
Dmitry Shmidtd5e49232012-12-03 15:08:10 -08002128#define WPA_DRIVER_CAPA_KEY_MGMT_WAPI_PSK 0x00000080
Dmitry Shmidt807291d2015-01-27 13:40:23 -08002129#define WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B 0x00000100
2130#define WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B_192 0x00000200
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002131#define WPA_DRIVER_CAPA_KEY_MGMT_OWE 0x00000400
2132#define WPA_DRIVER_CAPA_KEY_MGMT_DPP 0x00000800
2133#define WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA256 0x00001000
2134#define WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA384 0x00002000
2135#define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA256 0x00004000
2136#define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA384 0x00008000
Hai Shalom74f70d42019-02-11 14:42:39 -08002137#define WPA_DRIVER_CAPA_KEY_MGMT_SAE 0x00010000
Tanmay Garga7fd80d2020-05-18 15:52:44 +05302138#define WPA_DRIVER_CAPA_KEY_MGMT_802_1X_SHA256 0x00020000
2139#define WPA_DRIVER_CAPA_KEY_MGMT_PSK_SHA256 0x00040000
2140#define WPA_DRIVER_CAPA_KEY_MGMT_TPK_HANDSHAKE 0x00080000
2141#define WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE 0x00100000
2142#define WPA_DRIVER_CAPA_KEY_MGMT_FT_802_1X_SHA384 0x00200000
2143#define WPA_DRIVER_CAPA_KEY_MGMT_CCKM 0x00400000
2144#define WPA_DRIVER_CAPA_KEY_MGMT_OSEN 0x00800000
Sunil Ravi89eba102022-09-13 21:04:37 -07002145#define WPA_DRIVER_CAPA_KEY_MGMT_SAE_EXT_KEY 0x01000000
2146#define WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE_EXT_KEY 0x02000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002147 /** Bitfield of supported key management suites */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002148 unsigned int key_mgmt;
Hai Shalom4fbc08f2020-05-18 12:37:00 -07002149 unsigned int key_mgmt_iftype[WPA_IF_MAX];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002150
2151#define WPA_DRIVER_CAPA_ENC_WEP40 0x00000001
2152#define WPA_DRIVER_CAPA_ENC_WEP104 0x00000002
2153#define WPA_DRIVER_CAPA_ENC_TKIP 0x00000004
2154#define WPA_DRIVER_CAPA_ENC_CCMP 0x00000008
Dmitry Shmidt04949592012-07-19 12:16:46 -07002155#define WPA_DRIVER_CAPA_ENC_WEP128 0x00000010
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07002156#define WPA_DRIVER_CAPA_ENC_GCMP 0x00000020
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08002157#define WPA_DRIVER_CAPA_ENC_GCMP_256 0x00000040
2158#define WPA_DRIVER_CAPA_ENC_CCMP_256 0x00000080
2159#define WPA_DRIVER_CAPA_ENC_BIP 0x00000100
2160#define WPA_DRIVER_CAPA_ENC_BIP_GMAC_128 0x00000200
2161#define WPA_DRIVER_CAPA_ENC_BIP_GMAC_256 0x00000400
2162#define WPA_DRIVER_CAPA_ENC_BIP_CMAC_256 0x00000800
Dmitry Shmidtf21452a2014-02-26 10:55:25 -08002163#define WPA_DRIVER_CAPA_ENC_GTK_NOT_USED 0x00001000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002164 /** Bitfield of supported cipher suites */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002165 unsigned int enc;
2166
2167#define WPA_DRIVER_AUTH_OPEN 0x00000001
2168#define WPA_DRIVER_AUTH_SHARED 0x00000002
2169#define WPA_DRIVER_AUTH_LEAP 0x00000004
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002170 /** Bitfield of supported IEEE 802.11 authentication algorithms */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002171 unsigned int auth;
2172
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002173/** Driver generated WPA/RSN IE */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002174#define WPA_DRIVER_FLAGS_DRIVER_IE 0x00000001
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002175/** Driver needs static WEP key setup after association command */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002176#define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC 0x00000002
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002177/** Driver takes care of all DFS operations */
Dmitry Shmidtd11f0192014-03-24 12:09:47 -07002178#define WPA_DRIVER_FLAGS_DFS_OFFLOAD 0x00000004
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002179/** Driver takes care of RSN 4-way handshake internally; PMK is configured with
Hai Shalomfdcde762020-04-02 11:19:20 -07002180 * struct wpa_driver_ops::set_key using key_flag = KEY_FLAG_PMK */
Hai Shalom74f70d42019-02-11 14:42:39 -08002181#define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X 0x00000008
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002182/** Driver is for a wired Ethernet interface */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002183#define WPA_DRIVER_FLAGS_WIRED 0x00000010
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002184/** Driver provides separate commands for authentication and association (SME in
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002185 * wpa_supplicant). */
2186#define WPA_DRIVER_FLAGS_SME 0x00000020
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002187/** Driver supports AP mode */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002188#define WPA_DRIVER_FLAGS_AP 0x00000040
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002189/** Driver needs static WEP key setup after association has been completed */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002190#define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE 0x00000080
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002191/** Driver supports dynamic HT 20/40 MHz channel changes during BSS lifetime */
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07002192#define WPA_DRIVER_FLAGS_HT_2040_COEX 0x00000100
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002193/** Driver supports concurrent P2P operations */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002194#define WPA_DRIVER_FLAGS_P2P_CONCURRENT 0x00000200
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002195/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002196 * Driver uses the initial interface as a dedicated management interface, i.e.,
2197 * it cannot be used for P2P group operations or non-P2P purposes.
2198 */
2199#define WPA_DRIVER_FLAGS_P2P_DEDICATED_INTERFACE 0x00000400
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002200/** This interface is P2P capable (P2P GO or P2P Client) */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002201#define WPA_DRIVER_FLAGS_P2P_CAPABLE 0x00000800
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002202/** Driver supports station and key removal when stopping an AP */
Dmitry Shmidta38abf92014-03-06 13:38:44 -08002203#define WPA_DRIVER_FLAGS_AP_TEARDOWN_SUPPORT 0x00001000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002204/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002205 * Driver uses the initial interface for P2P management interface and non-P2P
2206 * purposes (e.g., connect to infra AP), but this interface cannot be used for
2207 * P2P group operations.
2208 */
2209#define WPA_DRIVER_FLAGS_P2P_MGMT_AND_NON_P2P 0x00002000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002210/**
Hai Shalomc1a21442022-02-04 13:43:00 -08002211 * Driver is known to use valid error codes, i.e., when it indicates that
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002212 * something (e.g., association) fails, there was indeed a failure and the
2213 * operation does not end up getting completed successfully later.
2214 */
Hai Shalomc1a21442022-02-04 13:43:00 -08002215#define WPA_DRIVER_FLAGS_VALID_ERROR_CODES 0x00004000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002216/** Driver supports off-channel TX */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002217#define WPA_DRIVER_FLAGS_OFFCHANNEL_TX 0x00008000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002218/** Driver indicates TX status events for EAPOL Data frames */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002219#define WPA_DRIVER_FLAGS_EAPOL_TX_STATUS 0x00010000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002220/** Driver indicates TX status events for Deauth/Disassoc frames */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002221#define WPA_DRIVER_FLAGS_DEAUTH_TX_STATUS 0x00020000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002222/** Driver supports roaming (BSS selection) in firmware */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002223#define WPA_DRIVER_FLAGS_BSS_SELECTION 0x00040000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002224/** Driver supports operating as a TDLS peer */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002225#define WPA_DRIVER_FLAGS_TDLS_SUPPORT 0x00080000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002226/** Driver requires external TDLS setup/teardown/discovery */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002227#define WPA_DRIVER_FLAGS_TDLS_EXTERNAL_SETUP 0x00100000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002228/** Driver indicates support for Probe Response offloading in AP mode */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002229#define WPA_DRIVER_FLAGS_PROBE_RESP_OFFLOAD 0x00200000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002230/** Driver supports U-APSD in AP mode */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002231#define WPA_DRIVER_FLAGS_AP_UAPSD 0x00400000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002232/** Driver supports inactivity timer in AP mode */
Dmitry Shmidt04949592012-07-19 12:16:46 -07002233#define WPA_DRIVER_FLAGS_INACTIVITY_TIMER 0x00800000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002234/** Driver expects user space implementation of MLME in AP mode */
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07002235#define WPA_DRIVER_FLAGS_AP_MLME 0x01000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002236/** Driver supports SAE with user space SME */
Dmitry Shmidtd5e49232012-12-03 15:08:10 -08002237#define WPA_DRIVER_FLAGS_SAE 0x02000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002238/** Driver makes use of OBSS scan mechanism in wpa_supplicant */
Dmitry Shmidtd5e49232012-12-03 15:08:10 -08002239#define WPA_DRIVER_FLAGS_OBSS_SCAN 0x04000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002240/** Driver supports IBSS (Ad-hoc) mode */
Dmitry Shmidt700a1372013-03-15 14:14:44 -07002241#define WPA_DRIVER_FLAGS_IBSS 0x08000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002242/** Driver supports radar detection */
Dmitry Shmidtea69e842013-05-13 14:52:28 -07002243#define WPA_DRIVER_FLAGS_RADAR 0x10000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002244/** Driver supports a dedicated interface for P2P Device */
Dmitry Shmidt34af3062013-07-11 10:46:32 -07002245#define WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE 0x20000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002246/** Driver supports QoS Mapping */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08002247#define WPA_DRIVER_FLAGS_QOS_MAPPING 0x40000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002248/** Driver supports CSA in AP mode */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08002249#define WPA_DRIVER_FLAGS_AP_CSA 0x80000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002250/** Driver supports mesh */
2251#define WPA_DRIVER_FLAGS_MESH 0x0000000100000000ULL
2252/** Driver support ACS offload */
2253#define WPA_DRIVER_FLAGS_ACS_OFFLOAD 0x0000000200000000ULL
2254/** Driver supports key management offload */
2255#define WPA_DRIVER_FLAGS_KEY_MGMT_OFFLOAD 0x0000000400000000ULL
2256/** Driver supports TDLS channel switching */
2257#define WPA_DRIVER_FLAGS_TDLS_CHANNEL_SWITCH 0x0000000800000000ULL
Dmitry Shmidtff787d52015-01-12 13:01:47 -08002258/** Driver supports IBSS with HT datarates */
2259#define WPA_DRIVER_FLAGS_HT_IBSS 0x0000001000000000ULL
Dmitry Shmidt7f656022015-02-25 14:36:37 -08002260/** Driver supports IBSS with VHT datarates */
2261#define WPA_DRIVER_FLAGS_VHT_IBSS 0x0000002000000000ULL
Dmitry Shmidtb1e52102015-05-29 12:36:29 -07002262/** Driver supports automatic band selection */
2263#define WPA_DRIVER_FLAGS_SUPPORT_HW_MODE_ANY 0x0000004000000000ULL
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002264/** Driver supports simultaneous off-channel operations */
2265#define WPA_DRIVER_FLAGS_OFFCHANNEL_SIMULTANEOUS 0x0000008000000000ULL
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002266/** Driver supports full AP client state */
2267#define WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE 0x0000010000000000ULL
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07002268/** Driver supports P2P Listen offload */
2269#define WPA_DRIVER_FLAGS_P2P_LISTEN_OFFLOAD 0x0000020000000000ULL
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08002270/** Driver supports FILS */
2271#define WPA_DRIVER_FLAGS_SUPPORT_FILS 0x0000040000000000ULL
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08002272/** Driver supports Beacon frame TX rate configuration (legacy rates) */
2273#define WPA_DRIVER_FLAGS_BEACON_RATE_LEGACY 0x0000080000000000ULL
2274/** Driver supports Beacon frame TX rate configuration (HT rates) */
2275#define WPA_DRIVER_FLAGS_BEACON_RATE_HT 0x0000100000000000ULL
2276/** Driver supports Beacon frame TX rate configuration (VHT rates) */
2277#define WPA_DRIVER_FLAGS_BEACON_RATE_VHT 0x0000200000000000ULL
Dmitry Shmidtebd93af2017-02-21 13:40:44 -08002278/** Driver supports mgmt_tx with random TX address in non-connected state */
2279#define WPA_DRIVER_FLAGS_MGMT_TX_RANDOM_TA 0x0000400000000000ULL
2280/** Driver supports mgmt_tx with random TX addr in connected state */
2281#define WPA_DRIVER_FLAGS_MGMT_TX_RANDOM_TA_CONNECTED 0x0000800000000000ULL
2282/** Driver supports better BSS reporting with sched_scan in connected mode */
2283#define WPA_DRIVER_FLAGS_SCHED_SCAN_RELATIVE_RSSI 0x0001000000000000ULL
2284/** Driver supports HE capabilities */
2285#define WPA_DRIVER_FLAGS_HE_CAPABILITIES 0x0002000000000000ULL
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002286/** Driver supports FILS shared key offload */
2287#define WPA_DRIVER_FLAGS_FILS_SK_OFFLOAD 0x0004000000000000ULL
2288/** Driver supports all OCE STA specific mandatory features */
2289#define WPA_DRIVER_FLAGS_OCE_STA 0x0008000000000000ULL
2290/** Driver supports all OCE AP specific mandatory features */
2291#define WPA_DRIVER_FLAGS_OCE_AP 0x0010000000000000ULL
2292/**
2293 * Driver supports all OCE STA-CFON specific mandatory features only.
2294 * If a driver sets this bit but not the %WPA_DRIVER_FLAGS_OCE_AP, the
2295 * userspace shall assume that this driver may not support all OCE AP
2296 * functionality but can support only OCE STA-CFON functionality.
2297 */
2298#define WPA_DRIVER_FLAGS_OCE_STA_CFON 0x0020000000000000ULL
Roshan Pius3a1667e2018-07-03 15:17:14 -07002299/** Driver supports MFP-optional in the connect command */
2300#define WPA_DRIVER_FLAGS_MFP_OPTIONAL 0x0040000000000000ULL
Hai Shalom39ba6fc2019-01-22 12:40:38 -08002301/** Driver is a self-managed regulatory device */
2302#define WPA_DRIVER_FLAGS_SELF_MANAGED_REGULATORY 0x0080000000000000ULL
Hai Shalom74f70d42019-02-11 14:42:39 -08002303/** Driver supports FTM responder functionality */
2304#define WPA_DRIVER_FLAGS_FTM_RESPONDER 0x0100000000000000ULL
2305/** Driver support 4-way handshake offload for WPA-Personal */
2306#define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK 0x0200000000000000ULL
Hai Shalomb755a2a2020-04-23 21:49:02 -07002307/** Driver supports a separate control port TX for EAPOL frames */
Hai Shalomfdcde762020-04-02 11:19:20 -07002308#define WPA_DRIVER_FLAGS_CONTROL_PORT 0x0400000000000000ULL
2309/** Driver supports VLAN offload */
2310#define WPA_DRIVER_FLAGS_VLAN_OFFLOAD 0x0800000000000000ULL
2311/** Driver supports UPDATE_FT_IES command */
2312#define WPA_DRIVER_FLAGS_UPDATE_FT_IES 0x1000000000000000ULL
2313/** Driver can correctly rekey PTKs without Extended Key ID */
2314#define WPA_DRIVER_FLAGS_SAFE_PTK0_REKEYS 0x2000000000000000ULL
2315/** Driver supports Beacon protection */
2316#define WPA_DRIVER_FLAGS_BEACON_PROTECTION 0x4000000000000000ULL
2317/** Driver supports Extended Key ID */
2318#define WPA_DRIVER_FLAGS_EXTENDED_KEY_ID 0x8000000000000000ULL
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002319 u64 flags;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002320
Hai Shalomb755a2a2020-04-23 21:49:02 -07002321/** Driver supports a separate control port RX for EAPOL frames */
2322#define WPA_DRIVER_FLAGS2_CONTROL_PORT_RX 0x0000000000000001ULL
Hai Shalom899fcc72020-10-19 14:38:18 -07002323/** Driver supports TX status reports for EAPOL frames through control port */
2324#define WPA_DRIVER_FLAGS2_CONTROL_PORT_TX_STATUS 0x0000000000000002ULL
Sunil Ravi89eba102022-09-13 21:04:37 -07002325/** Driver supports secure LTF in AP mode */
2326#define WPA_DRIVER_FLAGS2_SEC_LTF_AP 0x0000000000000004ULL
2327/** Driver supports secure RTT measurement exchange in AP mode */
2328#define WPA_DRIVER_FLAGS2_SEC_RTT_AP 0x0000000000000008ULL
Hai Shalom60840252021-02-19 19:02:11 -08002329/**
2330 * Driver supports protection of range negotiation and measurement management
Sunil Ravi89eba102022-09-13 21:04:37 -07002331 * frames in AP mode
Hai Shalom60840252021-02-19 19:02:11 -08002332 */
Sunil Ravi89eba102022-09-13 21:04:37 -07002333#define WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_AP 0x0000000000000010ULL
Hai Shalom60840252021-02-19 19:02:11 -08002334/** Driver supports Beacon frame TX rate configuration (HE rates) */
2335#define WPA_DRIVER_FLAGS2_BEACON_RATE_HE 0x0000000000000020ULL
2336/** Driver supports Beacon protection only in client mode */
2337#define WPA_DRIVER_FLAGS2_BEACON_PROTECTION_CLIENT 0x0000000000000040ULL
2338/** Driver supports Operating Channel Validation */
2339#define WPA_DRIVER_FLAGS2_OCV 0x0000000000000080ULL
2340/** Driver expects user space implementation of SME in AP mode */
2341#define WPA_DRIVER_FLAGS2_AP_SME 0x0000000000000100ULL
Sunil Ravia04bd252022-05-02 22:54:18 -07002342/** Driver handles SA Query procedures in AP mode */
2343#define WPA_DRIVER_FLAGS2_SA_QUERY_OFFLOAD_AP 0x0000000000000200ULL
2344/** Driver supports background radar/CAC detection */
Sunil Ravi2a14cf12023-11-21 00:54:38 +00002345#define WPA_DRIVER_FLAGS2_RADAR_BACKGROUND 0x0000000000000400ULL
Sunil Ravi89eba102022-09-13 21:04:37 -07002346/** Driver supports secure LTF in STA mode */
2347#define WPA_DRIVER_FLAGS2_SEC_LTF_STA 0x0000000000000800ULL
2348/** Driver supports secure RTT measurement exchange in STA mode */
2349#define WPA_DRIVER_FLAGS2_SEC_RTT_STA 0x0000000000001000ULL
2350/**
2351 * Driver supports protection of range negotiation and measurement management
2352 * frames in STA mode
2353 */
2354#define WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_STA 0x0000000000002000ULL
Sunil Ravi77d572f2023-01-17 23:58:31 +00002355/** Driver supports MLO in station/AP mode */
2356#define WPA_DRIVER_FLAGS2_MLO 0x0000000000004000ULL
Sunil Ravi2a14cf12023-11-21 00:54:38 +00002357/** Driver supports minimal scan request probe content */
2358#define WPA_DRIVER_FLAGS2_SCAN_MIN_PREQ 0x0000000000008000ULL
2359/** Driver supports SAE authentication offload in STA mode */
2360#define WPA_DRIVER_FLAGS2_SAE_OFFLOAD_STA 0x0000000000010000ULL
2361/** Driver support AP_PSK authentication offload */
2362#define WPA_DRIVER_FLAGS2_4WAY_HANDSHAKE_AP_PSK 0x0000000000020000ULL
2363/** Driver supports OWE STA offload */
2364#define WPA_DRIVER_FLAGS2_OWE_OFFLOAD_STA 0x0000000000040000ULL
2365/** Driver supports OWE AP offload */
2366#define WPA_DRIVER_FLAGS2_OWE_OFFLOAD_AP 0x0000000000080000ULL
2367/** Driver support AP SAE authentication offload */
2368#define WPA_DRIVER_FLAGS2_SAE_OFFLOAD_AP 0x0000000000100000ULL
Sunil Ravi7f769292024-07-23 22:21:32 +00002369/** Driver supports TWT responder in HT and VHT modes */
2370#define WPA_DRIVER_FLAGS2_HT_VHT_TWT_RESPONDER 0x0000000000200000ULL
2371/** Driver supports RSN override elements */
2372#define WPA_DRIVER_FLAGS2_RSN_OVERRIDE_STA 0x0000000000400000ULL
Sunil Ravic0f5d412024-09-11 22:12:49 +00002373/** Driver supports NAN offload */
2374#define WPA_DRIVER_FLAGS2_NAN_OFFLOAD 0x0000000000800000ULL
Hai Shalomb755a2a2020-04-23 21:49:02 -07002375 u64 flags2;
2376
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002377#define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \
2378 (drv_flags & WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE)
2379
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002380 unsigned int wmm_ac_supported:1;
2381
2382 unsigned int mac_addr_rand_scan_supported:1;
2383 unsigned int mac_addr_rand_sched_scan_supported:1;
2384
2385 /** Maximum number of supported active probe SSIDs */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002386 int max_scan_ssids;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002387
2388 /** Maximum number of supported active probe SSIDs for sched_scan */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002389 int max_sched_scan_ssids;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002390
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08002391 /** Maximum number of supported scan plans for scheduled scan */
2392 unsigned int max_sched_scan_plans;
2393
2394 /** Maximum interval in a scan plan. In seconds */
2395 u32 max_sched_scan_plan_interval;
2396
2397 /** Maximum number of iterations in a single scan plan */
2398 u32 max_sched_scan_plan_iterations;
2399
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002400 /** Whether sched_scan (offloaded scanning) is supported */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002401 int sched_scan_supported;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002402
2403 /** Maximum number of supported match sets for sched_scan */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002404 int max_match_sets;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002405
2406 /**
2407 * max_remain_on_chan - Maximum remain-on-channel duration in msec
2408 */
2409 unsigned int max_remain_on_chan;
2410
2411 /**
2412 * max_stations - Maximum number of associated stations the driver
2413 * supports in AP mode
2414 */
2415 unsigned int max_stations;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002416
2417 /**
2418 * probe_resp_offloads - Bitmap of supported protocols by the driver
2419 * for Probe Response offloading.
2420 */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002421/** Driver Probe Response offloading support for WPS ver. 1 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002422#define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS 0x00000001
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002423/** Driver Probe Response offloading support for WPS ver. 2 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002424#define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS2 0x00000002
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002425/** Driver Probe Response offloading support for P2P */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002426#define WPA_DRIVER_PROBE_RESP_OFFLOAD_P2P 0x00000004
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002427/** Driver Probe Response offloading support for IEEE 802.11u (Interworking) */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002428#define WPA_DRIVER_PROBE_RESP_OFFLOAD_INTERWORKING 0x00000008
2429 unsigned int probe_resp_offloads;
Dmitry Shmidt444d5672013-04-01 13:08:44 -07002430
Dmitry Shmidt8bae4132013-06-06 11:25:10 -07002431 unsigned int max_acl_mac_addrs;
2432
Dmitry Shmidt444d5672013-04-01 13:08:44 -07002433 /**
Dmitry Shmidtc2ebb4b2013-07-24 12:57:51 -07002434 * Number of supported concurrent channels
2435 */
2436 unsigned int num_multichan_concurrent;
2437
2438 /**
Dmitry Shmidt444d5672013-04-01 13:08:44 -07002439 * extended_capa - extended capabilities in driver/device
2440 *
2441 * Must be allocated and freed by driver and the pointers must be
2442 * valid for the lifetime of the driver, i.e., freed in deinit()
2443 */
2444 const u8 *extended_capa, *extended_capa_mask;
2445 unsigned int extended_capa_len;
Dmitry Shmidtb58836e2014-04-29 14:35:56 -07002446
2447 struct wowlan_triggers wowlan_triggers;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002448
2449/** Driver adds the DS Params Set IE in Probe Request frames */
2450#define WPA_DRIVER_FLAGS_DS_PARAM_SET_IE_IN_PROBES 0x00000001
2451/** Driver adds the WFA TPC IE in Probe Request frames */
2452#define WPA_DRIVER_FLAGS_WFA_TPC_IE_IN_PROBES 0x00000002
2453/** Driver handles quiet period requests */
2454#define WPA_DRIVER_FLAGS_QUIET 0x00000004
2455/**
2456 * Driver is capable of inserting the current TX power value into the body of
2457 * transmitted frames.
2458 * Background: Some Action frames include a TPC Report IE. This IE contains a
2459 * TX power field, which has to be updated by lower layers. One such Action
2460 * frame is Link Measurement Report (part of RRM). Another is TPC Report (part
2461 * of spectrum management). Note that this insertion takes place at a fixed
2462 * offset, namely the 6th byte in the Action frame body.
2463 */
2464#define WPA_DRIVER_FLAGS_TX_POWER_INSERTION 0x00000008
Dmitry Shmidt849734c2016-05-27 09:59:01 -07002465/**
2466 * Driver supports RRM. With this support, the driver will accept to use RRM in
2467 * (Re)Association Request frames, without supporting quiet period.
2468 */
2469#define WPA_DRIVER_FLAGS_SUPPORT_RRM 0x00000010
2470
Dmitry Shmidt29333592017-01-09 12:27:11 -08002471/** Driver supports setting the scan dwell time */
2472#define WPA_DRIVER_FLAGS_SUPPORT_SET_SCAN_DWELL 0x00000020
2473/** Driver supports Beacon Report Measurement */
2474#define WPA_DRIVER_FLAGS_SUPPORT_BEACON_REPORT 0x00000040
2475
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002476 u32 rrm_flags;
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002477
2478 /* Driver concurrency capabilities */
2479 unsigned int conc_capab;
2480 /* Maximum number of concurrent channels on 2.4 GHz */
2481 unsigned int max_conc_chan_2_4;
2482 /* Maximum number of concurrent channels on 5 GHz */
2483 unsigned int max_conc_chan_5_0;
2484
2485 /* Maximum number of supported CSA counters */
2486 u16 max_csa_counters;
Sunil Ravi89eba102022-09-13 21:04:37 -07002487
2488 /* Maximum number of supported AKM suites in commands */
2489 unsigned int max_num_akms;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002490
2491 /* Maximum number of interfaces supported for MBSSID advertisement */
2492 unsigned int mbssid_max_interfaces;
2493 /* Maximum profile periodicity for enhanced MBSSID advertisement */
2494 unsigned int ema_max_periodicity;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002495};
2496
2497
2498struct hostapd_data;
2499
Sunil Ravi036cec52023-03-29 11:35:17 -07002500enum guard_interval {
2501 GUARD_INTERVAL_0_4 = 1,
2502 GUARD_INTERVAL_0_8 = 2,
2503 GUARD_INTERVAL_1_6 = 3,
2504 GUARD_INTERVAL_3_2 = 4,
2505};
2506
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002507#define STA_DRV_DATA_TX_MCS BIT(0)
2508#define STA_DRV_DATA_RX_MCS BIT(1)
2509#define STA_DRV_DATA_TX_VHT_MCS BIT(2)
2510#define STA_DRV_DATA_RX_VHT_MCS BIT(3)
2511#define STA_DRV_DATA_TX_VHT_NSS BIT(4)
2512#define STA_DRV_DATA_RX_VHT_NSS BIT(5)
2513#define STA_DRV_DATA_TX_SHORT_GI BIT(6)
2514#define STA_DRV_DATA_RX_SHORT_GI BIT(7)
Roshan Pius3a1667e2018-07-03 15:17:14 -07002515#define STA_DRV_DATA_LAST_ACK_RSSI BIT(8)
Hai Shalomc1a21442022-02-04 13:43:00 -08002516#define STA_DRV_DATA_CONN_TIME BIT(9)
Sunil Ravi77d572f2023-01-17 23:58:31 +00002517#define STA_DRV_DATA_TX_HE_MCS BIT(10)
2518#define STA_DRV_DATA_RX_HE_MCS BIT(11)
2519#define STA_DRV_DATA_TX_HE_NSS BIT(12)
2520#define STA_DRV_DATA_RX_HE_NSS BIT(13)
Sunil Ravi036cec52023-03-29 11:35:17 -07002521#define STA_DRV_DATA_TX_HE_DCM BIT(14)
2522#define STA_DRV_DATA_RX_HE_DCM BIT(15)
2523#define STA_DRV_DATA_TX_HE_GI BIT(16)
2524#define STA_DRV_DATA_RX_HE_GI BIT(17)
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002525
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002526struct hostap_sta_driver_data {
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002527 unsigned long rx_packets, tx_packets;
2528 unsigned long long rx_bytes, tx_bytes;
Hai Shalom81f62d82019-07-22 12:10:00 -07002529 unsigned long long rx_airtime, tx_airtime;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002530 unsigned long long beacons_count;
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002531 int bytes_64bit; /* whether 64-bit byte counters are supported */
Sunil Ravi77d572f2023-01-17 23:58:31 +00002532 unsigned long current_tx_rate; /* in kbps */
2533 unsigned long current_rx_rate; /* in kbps */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002534 unsigned long inactive_msec;
Hai Shalomc1a21442022-02-04 13:43:00 -08002535 unsigned long connected_sec;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002536 unsigned long flags; /* bitfield of STA_DRV_DATA_* */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002537 unsigned long num_ps_buf_frames;
2538 unsigned long tx_retry_failed;
2539 unsigned long tx_retry_count;
Roshan Pius3a1667e2018-07-03 15:17:14 -07002540 s8 last_ack_rssi;
Hai Shalom81f62d82019-07-22 12:10:00 -07002541 unsigned long backlog_packets;
2542 unsigned long backlog_bytes;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002543 unsigned long fcs_error_count;
2544 unsigned long beacon_loss_count;
2545 unsigned long expected_throughput;
2546 unsigned long rx_drop_misc;
2547 unsigned long rx_mpdus;
2548 int signal; /* dBm; or -WPA_INVALID_NOISE */
2549 u8 rx_hemcs;
2550 u8 tx_hemcs;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002551 u8 rx_vhtmcs;
2552 u8 tx_vhtmcs;
2553 u8 rx_mcs;
2554 u8 tx_mcs;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002555 u8 rx_he_nss;
2556 u8 tx_he_nss;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002557 u8 rx_vht_nss;
2558 u8 tx_vht_nss;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002559 s8 avg_signal; /* dBm */
2560 s8 avg_beacon_signal; /* dBm */
2561 s8 avg_ack_signal; /* dBm */
Sunil Ravi036cec52023-03-29 11:35:17 -07002562 enum guard_interval rx_guard_interval, tx_guard_interval;
2563 u8 rx_dcm, tx_dcm;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002564};
2565
2566struct hostapd_sta_add_params {
2567 const u8 *addr;
2568 u16 aid;
2569 u16 capability;
2570 const u8 *supp_rates;
2571 size_t supp_rates_len;
2572 u16 listen_interval;
2573 const struct ieee80211_ht_capabilities *ht_capabilities;
Dmitry Shmidta54fa5f2013-01-15 13:53:35 -08002574 const struct ieee80211_vht_capabilities *vht_capabilities;
Dmitry Shmidtbd14a572014-02-18 10:33:49 -08002575 int vht_opmode_enabled;
2576 u8 vht_opmode;
Hai Shalom81f62d82019-07-22 12:10:00 -07002577 const struct ieee80211_he_capabilities *he_capab;
2578 size_t he_capab_len;
Hai Shalom4fbc08f2020-05-18 12:37:00 -07002579 const struct ieee80211_he_6ghz_band_cap *he_6ghz_capab;
Sunil Ravia04bd252022-05-02 22:54:18 -07002580 const struct ieee80211_eht_capabilities *eht_capab;
2581 size_t eht_capab_len;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002582 u32 flags; /* bitmask of WPA_STA_* flags */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002583 u32 flags_mask; /* unset bits in flags */
2584#ifdef CONFIG_MESH
2585 enum mesh_plink_state plink_state;
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07002586 u16 peer_aid;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002587#endif /* CONFIG_MESH */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002588 int set; /* Set STA parameters instead of add */
2589 u8 qosinfo;
Dmitry Shmidtf8623282013-02-20 14:34:59 -08002590 const u8 *ext_capab;
2591 size_t ext_capab_len;
Dmitry Shmidt344abd32014-01-14 13:17:00 -08002592 const u8 *supp_channels;
2593 size_t supp_channels_len;
2594 const u8 *supp_oper_classes;
2595 size_t supp_oper_classes_len;
Dmitry Shmidt849734c2016-05-27 09:59:01 -07002596 int support_p2p_ps;
Sunil Ravi036cec52023-03-29 11:35:17 -07002597
2598 bool mld_link_sta;
2599 s8 mld_link_id;
2600 const u8 *mld_link_addr;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002601};
2602
Dmitry Shmidt8bae4132013-06-06 11:25:10 -07002603struct mac_address {
2604 u8 addr[ETH_ALEN];
2605};
2606
2607struct hostapd_acl_params {
2608 u8 acl_policy;
2609 unsigned int num_mac_acl;
2610 struct mac_address mac_acl[0];
2611};
2612
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002613struct wpa_init_params {
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002614 void *global_priv;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002615 const u8 *bssid;
2616 const char *ifname;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002617 const char *driver_params;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002618 int use_pae_group_addr;
2619 char **bridge;
2620 size_t num_bridge;
2621
2622 u8 *own_addr; /* buffer for writing own MAC address */
2623};
2624
2625
2626struct wpa_bss_params {
2627 /** Interface name (for multi-SSID/VLAN support) */
2628 const char *ifname;
2629 /** Whether IEEE 802.1X or WPA/WPA2 is enabled */
2630 int enabled;
2631
2632 int wpa;
2633 int ieee802_1x;
2634 int wpa_group;
2635 int wpa_pairwise;
2636 int wpa_key_mgmt;
2637 int rsn_preauth;
2638 enum mfp_options ieee80211w;
2639};
2640
2641#define WPA_STA_AUTHORIZED BIT(0)
2642#define WPA_STA_WMM BIT(1)
2643#define WPA_STA_SHORT_PREAMBLE BIT(2)
2644#define WPA_STA_MFP BIT(3)
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002645#define WPA_STA_TDLS_PEER BIT(4)
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002646#define WPA_STA_AUTHENTICATED BIT(5)
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002647#define WPA_STA_ASSOCIATED BIT(6)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002648
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002649enum tdls_oper {
2650 TDLS_DISCOVERY_REQ,
2651 TDLS_SETUP,
2652 TDLS_TEARDOWN,
2653 TDLS_ENABLE_LINK,
2654 TDLS_DISABLE_LINK,
2655 TDLS_ENABLE,
2656 TDLS_DISABLE
2657};
2658
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07002659enum wnm_oper {
2660 WNM_SLEEP_ENTER_CONFIRM,
2661 WNM_SLEEP_ENTER_FAIL,
2662 WNM_SLEEP_EXIT_CONFIRM,
2663 WNM_SLEEP_EXIT_FAIL,
2664 WNM_SLEEP_TFS_REQ_IE_ADD, /* STA requests driver to add TFS req IE */
2665 WNM_SLEEP_TFS_REQ_IE_NONE, /* STA requests empty TFS req IE */
2666 WNM_SLEEP_TFS_REQ_IE_SET, /* AP requests driver to set TFS req IE for
2667 * a STA */
2668 WNM_SLEEP_TFS_RESP_IE_ADD, /* AP requests driver to add TFS resp IE
2669 * for a STA */
2670 WNM_SLEEP_TFS_RESP_IE_NONE, /* AP requests empty TFS resp IE */
2671 WNM_SLEEP_TFS_RESP_IE_SET, /* AP requests driver to set TFS resp IE
2672 * for a STA */
2673 WNM_SLEEP_TFS_IE_DEL /* AP delete the TFS IE */
2674};
2675
Roshan Pius3a1667e2018-07-03 15:17:14 -07002676/* enum smps_mode - SMPS mode definitions */
2677enum smps_mode {
2678 SMPS_AUTOMATIC,
2679 SMPS_OFF,
2680 SMPS_DYNAMIC,
2681 SMPS_STATIC,
2682
2683 /* Keep last */
2684 SMPS_INVALID,
2685};
2686
Hai Shalom74f70d42019-02-11 14:42:39 -08002687#define WPA_INVALID_NOISE 9999
Dmitry Shmidt34af3062013-07-11 10:46:32 -07002688
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002689/**
2690 * struct wpa_signal_info - Information about channel signal quality
Hai Shalom74f70d42019-02-11 14:42:39 -08002691 * @frequency: control frequency
2692 * @above_threshold: true if the above threshold was crossed
2693 * (relevant for a CQM event)
Sunil Ravi77d572f2023-01-17 23:58:31 +00002694 * @data: STA information
Hai Shalom74f70d42019-02-11 14:42:39 -08002695 * @current_noise: %WPA_INVALID_NOISE if not supported
Hai Shalom74f70d42019-02-11 14:42:39 -08002696 * @chanwidth: channel width
2697 * @center_frq1: center frequency for the first segment
2698 * @center_frq2: center frequency for the second segment (if relevant)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002699 */
2700struct wpa_signal_info {
2701 u32 frequency;
2702 int above_threshold;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002703 struct hostap_sta_driver_data data;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002704 int current_noise;
Dmitry Shmidt34af3062013-07-11 10:46:32 -07002705 enum chan_width chanwidth;
2706 int center_frq1;
2707 int center_frq2;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002708};
2709
Sunil Ravi89eba102022-09-13 21:04:37 -07002710struct wpa_mlo_signal_info {
2711 u16 valid_links;
2712 struct wpa_signal_info links[MAX_NUM_MLD_LINKS];
2713};
2714
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002715/**
Hai Shalom74f70d42019-02-11 14:42:39 -08002716 * struct wpa_channel_info - Information about the current channel
2717 * @frequency: Center frequency of the primary 20 MHz channel
2718 * @chanwidth: Width of the current operating channel
2719 * @sec_channel: Location of the secondary 20 MHz channel (either +1 or -1).
2720 * This field is only filled in when using a 40 MHz channel.
2721 * @center_frq1: Center frequency of frequency segment 0
2722 * @center_frq2: Center frequency of frequency segment 1 (for 80+80 channels)
2723 * @seg1_idx: Frequency segment 1 index when using a 80+80 channel. This is
2724 * derived from center_frq2 for convenience.
2725 */
2726struct wpa_channel_info {
2727 u32 frequency;
2728 enum chan_width chanwidth;
2729 int sec_channel;
2730 int center_frq1;
2731 int center_frq2;
2732 u8 seg1_idx;
2733};
2734
2735/**
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002736 * struct beacon_data - Beacon data
2737 * @head: Head portion of Beacon frame (before TIM IE)
2738 * @tail: Tail portion of Beacon frame (after TIM IE)
2739 * @beacon_ies: Extra information element(s) to add into Beacon frames or %NULL
2740 * @proberesp_ies: Extra information element(s) to add into Probe Response
2741 * frames or %NULL
2742 * @assocresp_ies: Extra information element(s) to add into (Re)Association
2743 * Response frames or %NULL
2744 * @probe_resp: Probe Response frame template
2745 * @head_len: Length of @head
2746 * @tail_len: Length of @tail
2747 * @beacon_ies_len: Length of beacon_ies in octets
2748 * @proberesp_ies_len: Length of proberesp_ies in octets
2749 * @proberesp_ies_len: Length of proberesp_ies in octets
2750 * @probe_resp_len: Length of probe response template (@probe_resp)
2751 */
2752struct beacon_data {
2753 u8 *head, *tail;
2754 u8 *beacon_ies;
2755 u8 *proberesp_ies;
2756 u8 *assocresp_ies;
2757 u8 *probe_resp;
2758
2759 size_t head_len, tail_len;
2760 size_t beacon_ies_len;
2761 size_t proberesp_ies_len;
2762 size_t assocresp_ies_len;
2763 size_t probe_resp_len;
2764};
2765
2766/**
2767 * struct csa_settings - Settings for channel switch command
2768 * @cs_count: Count in Beacon frames (TBTT) to perform the switch
2769 * @block_tx: 1 - block transmission for CSA period
2770 * @freq_params: Next channel frequency parameter
2771 * @beacon_csa: Beacon/probe resp/asooc resp info for CSA period
2772 * @beacon_after: Next beacon/probe resp/asooc resp info
2773 * @counter_offset_beacon: Offset to the count field in beacon's tail
2774 * @counter_offset_presp: Offset to the count field in probe resp.
Sunil Ravi036cec52023-03-29 11:35:17 -07002775 * @punct_bitmap - Preamble puncturing bitmap
Sunil Ravib0ac25f2024-07-12 01:42:03 +00002776 * @link_id: Link ID to determine the link for MLD; -1 for non-MLD
Sunil Ravi7f769292024-07-23 22:21:32 +00002777 * @ubpr: Unsolicited broadcast Probe Response frame data
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002778 */
2779struct csa_settings {
2780 u8 cs_count;
2781 u8 block_tx;
2782
2783 struct hostapd_freq_params freq_params;
2784 struct beacon_data beacon_csa;
2785 struct beacon_data beacon_after;
2786
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002787 u16 counter_offset_beacon[2];
2788 u16 counter_offset_presp[2];
Sunil Ravi036cec52023-03-29 11:35:17 -07002789
2790 u16 punct_bitmap;
Sunil Ravib0ac25f2024-07-12 01:42:03 +00002791 int link_id;
Sunil Ravi7f769292024-07-23 22:21:32 +00002792
2793 struct unsol_bcast_probe_resp ubpr;
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002794};
2795
Sunil Ravia04bd252022-05-02 22:54:18 -07002796/**
2797 * struct cca_settings - Settings for color switch command
2798 * @cca_count: Count in Beacon frames (TBTT) to perform the switch
2799 * @cca_color: The new color that we are switching to
2800 * @beacon_cca: Beacon/Probe Response/(Re)Association Response frame info for
2801 * color switch period
2802 * @beacon_after: Next Beacon/Probe Response/(Re)Association Response frame info
2803 * @counter_offset_beacon: Offset to the count field in Beacon frame tail
2804 * @counter_offset_presp: Offset to the count field in Probe Response frame
Sunil Ravi7f769292024-07-23 22:21:32 +00002805 * @ubpr: Unsolicited broadcast Probe Response frame data
2806 * @link_id: If >= 0 indicates the link of the AP MLD to configure
Sunil Ravia04bd252022-05-02 22:54:18 -07002807 */
2808struct cca_settings {
2809 u8 cca_count;
2810 u8 cca_color;
2811
2812 struct beacon_data beacon_cca;
2813 struct beacon_data beacon_after;
2814
2815 u16 counter_offset_beacon;
2816 u16 counter_offset_presp;
Sunil Ravi7f769292024-07-23 22:21:32 +00002817
2818 struct unsol_bcast_probe_resp ubpr;
2819
2820 int link_id;
Sunil Ravia04bd252022-05-02 22:54:18 -07002821};
2822
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07002823/* TDLS peer capabilities for send_tdls_mgmt() */
2824enum tdls_peer_capability {
2825 TDLS_PEER_HT = BIT(0),
2826 TDLS_PEER_VHT = BIT(1),
2827 TDLS_PEER_WMM = BIT(2),
Hai Shalomc1a21442022-02-04 13:43:00 -08002828 TDLS_PEER_HE = BIT(3),
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07002829};
2830
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002831/* valid info in the wmm_params struct */
2832enum wmm_params_valid_info {
2833 WMM_PARAMS_UAPSD_QUEUES_INFO = BIT(0),
2834};
2835
2836/**
2837 * struct wmm_params - WMM parameterss configured for this association
2838 * @info_bitmap: Bitmap of valid wmm_params info; indicates what fields
2839 * of the struct contain valid information.
2840 * @uapsd_queues: Bitmap of ACs configured for uapsd (valid only if
2841 * %WMM_PARAMS_UAPSD_QUEUES_INFO is set)
2842 */
2843struct wmm_params {
2844 u8 info_bitmap;
2845 u8 uapsd_queues;
2846};
2847
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07002848#ifdef CONFIG_MACSEC
2849struct macsec_init_params {
Hai Shalome21d4e82020-04-29 16:34:06 -07002850 bool always_include_sci;
2851 bool use_es;
2852 bool use_scb;
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07002853};
2854#endif /* CONFIG_MACSEC */
2855
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002856enum drv_br_port_attr {
2857 DRV_BR_PORT_ATTR_PROXYARP,
2858 DRV_BR_PORT_ATTR_HAIRPIN_MODE,
Sunil Ravi036cec52023-03-29 11:35:17 -07002859 DRV_BR_PORT_ATTR_MCAST2UCAST,
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002860};
2861
2862enum drv_br_net_param {
2863 DRV_BR_NET_PARAM_GARP_ACCEPT,
Dmitry Shmidt83474442015-04-15 13:47:09 -07002864 DRV_BR_MULTICAST_SNOOPING,
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002865};
2866
2867struct drv_acs_params {
2868 /* Selected mode (HOSTAPD_MODE_*) */
2869 enum hostapd_hw_mode hw_mode;
2870
2871 /* Indicates whether HT is enabled */
2872 int ht_enabled;
2873
2874 /* Indicates whether HT40 is enabled */
2875 int ht40_enabled;
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07002876
2877 /* Indicates whether VHT is enabled */
2878 int vht_enabled;
2879
2880 /* Configured ACS channel width */
2881 u16 ch_width;
2882
Ahmed ElArabawy0ff61c52019-12-26 12:38:39 -08002883 /* ACS frequency list info */
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002884 const int *freq_list;
Hai Shalomfdcde762020-04-02 11:19:20 -07002885
2886 /* Indicates whether EDMG is enabled */
2887 int edmg_enabled;
Sunil Ravia04bd252022-05-02 22:54:18 -07002888
2889 /* Indicates whether EHT is enabled */
2890 bool eht_enabled;
Sunil Ravib0ac25f2024-07-12 01:42:03 +00002891
2892 /* Indicates the link if MLO case; -1 otherwise */
2893 int link_id;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002894};
2895
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002896struct wpa_bss_trans_info {
2897 u8 mbo_transition_reason;
2898 u8 n_candidates;
2899 u8 *bssid;
2900};
2901
2902struct wpa_bss_candidate_info {
2903 u8 num;
2904 struct candidate_list {
2905 u8 bssid[ETH_ALEN];
2906 u8 is_accept;
2907 u32 reject_reason;
2908 } *candidates;
2909};
2910
2911struct wpa_pmkid_params {
2912 const u8 *bssid;
2913 const u8 *ssid;
2914 size_t ssid_len;
2915 const u8 *fils_cache_id;
2916 const u8 *pmkid;
2917 const u8 *pmk;
2918 size_t pmk_len;
Hai Shalomfdcde762020-04-02 11:19:20 -07002919 u32 pmk_lifetime;
2920 u8 pmk_reauth_threshold;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002921};
2922
2923/* Mask used to specify which connection parameters have to be updated */
2924enum wpa_drv_update_connect_params_mask {
2925 WPA_DRV_UPDATE_ASSOC_IES = BIT(0),
2926 WPA_DRV_UPDATE_FILS_ERP_INFO = BIT(1),
2927 WPA_DRV_UPDATE_AUTH_TYPE = BIT(2),
Winnie Chen4138eec2022-11-10 16:32:53 +08002928#if defined(CONFIG_DRIVER_NL80211_BRCM) || defined(CONFIG_DRIVER_NL80211_SYNA)
Vinayak Yadawade62409f2022-01-20 12:32:07 +05302929 WPA_DRV_UPDATE_TD_POLICY = BIT(3),
Winnie Chen4138eec2022-11-10 16:32:53 +08002930#endif /* CONFIG_DRIVER_NL80211_BRCM || CONFIG_DRIVER_NL80211_SYNA */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002931};
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07002932
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002933/**
Roshan Pius3a1667e2018-07-03 15:17:14 -07002934 * struct external_auth - External authentication trigger parameters
2935 *
2936 * These are used across the external authentication request and event
2937 * interfaces.
2938 * @action: Action type / trigger for external authentication. Only significant
2939 * for the event interface.
2940 * @bssid: BSSID of the peer with which the authentication has to happen. Used
2941 * by both the request and event interface.
2942 * @ssid: SSID of the AP. Used by both the request and event interface.
2943 * @ssid_len: SSID length in octets.
2944 * @key_mgmt_suite: AKM suite of the respective authentication. Optional for
2945 * the request interface.
2946 * @status: Status code, %WLAN_STATUS_SUCCESS for successful authentication,
2947 * use %WLAN_STATUS_UNSPECIFIED_FAILURE if wpa_supplicant cannot give
2948 * the real status code for failures. Used only for the request interface
2949 * from user space to the driver.
Hai Shalom5f92bc92019-04-18 11:54:11 -07002950 * @pmkid: Generated PMKID as part of external auth exchange (e.g., SAE).
Sunil Ravi036cec52023-03-29 11:35:17 -07002951 * @mld_addr: AP's MLD address or %NULL if MLO is not used
Roshan Pius3a1667e2018-07-03 15:17:14 -07002952 */
2953struct external_auth {
2954 enum {
2955 EXT_AUTH_START,
2956 EXT_AUTH_ABORT,
2957 } action;
Hai Shalom5f92bc92019-04-18 11:54:11 -07002958 const u8 *bssid;
2959 const u8 *ssid;
Roshan Pius3a1667e2018-07-03 15:17:14 -07002960 size_t ssid_len;
2961 unsigned int key_mgmt_suite;
2962 u16 status;
Hai Shalom5f92bc92019-04-18 11:54:11 -07002963 const u8 *pmkid;
Sunil Ravi036cec52023-03-29 11:35:17 -07002964 const u8 *mld_addr;
Roshan Pius3a1667e2018-07-03 15:17:14 -07002965};
2966
Sunil Ravi89eba102022-09-13 21:04:37 -07002967#define WPAS_MAX_PASN_PEERS 10
2968
2969enum pasn_status {
2970 PASN_STATUS_SUCCESS = 0,
2971 PASN_STATUS_FAILURE = 1,
2972};
2973
2974/**
2975 * struct pasn_peer - PASN peer parameters
2976 *
2977 * Used to process the PASN authentication event from the driver to
2978 * userspace and to send a response back.
2979 * @own_addr: Own MAC address specified by the driver to use for PASN
2980 * handshake.
2981 * @peer_addr: MAC address of the peer with which PASN authentication is to be
2982 * performed.
2983 * @network_id: Unique id for the network.
2984 * This identifier is used as a unique identifier for each network
2985 * block when using the control interface. Each network is allocated an
2986 * id when it is being created, either when reading the configuration
2987 * file or when a new network is added through the control interface.
2988 * @akmp: Authentication key management protocol type supported.
2989 * @cipher: Cipher suite.
2990 * @group: Finite cyclic group. Default group used is 19 (ECC).
2991 * @ltf_keyseed_required: Indicates whether LTF keyseed generation is required
2992 * @status: PASN response status, %PASN_STATUS_SUCCESS for successful
2993 * authentication, use %PASN_STATUS_FAILURE if PASN authentication
2994 * fails or if wpa_supplicant fails to set the security ranging context to
2995 * the driver
2996 */
2997struct pasn_peer {
2998 u8 own_addr[ETH_ALEN];
2999 u8 peer_addr[ETH_ALEN];
3000 int network_id;
3001 int akmp;
3002 int cipher;
3003 int group;
3004 bool ltf_keyseed_required;
3005 enum pasn_status status;
3006};
3007
3008/**
3009 * struct pasn_auth - PASN authentication trigger parameters
3010 *
3011 * These are used across the PASN authentication event from the driver to
3012 * userspace and to send a response to it.
3013 * @action: Action type. Only significant for the event interface.
3014 * @num_peers: The number of peers for which the PASN handshake is requested
3015 * for.
3016 * @peer: Holds the peer details.
3017 */
3018struct pasn_auth {
3019 enum {
3020 PASN_ACTION_AUTH,
3021 PASN_ACTION_DELETE_SECURE_RANGING_CONTEXT,
3022 } action;
3023 unsigned int num_peers;
3024 struct pasn_peer peer[WPAS_MAX_PASN_PEERS];
3025};
3026
3027/**
3028 * struct secure_ranging_params - Parameters required to set secure ranging
3029 * context for a peer.
3030 *
3031 * @action: Add or delete a security context to the driver.
3032 * @own_addr: Own MAC address used during key derivation.
3033 * @peer_addr: Address of the peer device.
3034 * @cipher: Cipher suite.
3035 * @tk_len: Length of temporal key.
3036 * @tk: Temporal key buffer.
3037 * @ltf_keyseed_len: Length of LTF keyseed.
3038 * @ltf_keyeed: LTF keyseed buffer.
3039 */
3040struct secure_ranging_params {
3041 u32 action;
3042 const u8 *own_addr;
3043 const u8 *peer_addr;
3044 u32 cipher;
3045 u8 tk_len;
3046 const u8 *tk;
3047 u8 ltf_keyseed_len;
3048 const u8 *ltf_keyseed;
3049};
3050
Hai Shalom60840252021-02-19 19:02:11 -08003051/* enum nested_attr - Used to specify if subcommand uses nested attributes */
3052enum nested_attr {
3053 NESTED_ATTR_NOT_USED = 0,
3054 NESTED_ATTR_USED = 1,
3055 NESTED_ATTR_UNSPECIFIED = 2,
3056};
3057
Sunil8cd6f4d2022-06-28 18:40:46 +00003058/* Preferred channel list information */
3059
3060/* GO role */
3061#define WEIGHTED_PCL_GO BIT(0)
3062/* P2P Client role */
3063#define WEIGHTED_PCL_CLI BIT(1)
3064/* Must be considered for operating channel */
3065#define WEIGHTED_PCL_MUST_CONSIDER BIT(2)
3066/* Should be excluded in GO negotiation */
3067#define WEIGHTED_PCL_EXCLUDE BIT(3)
3068
3069/* Preferred channel list with weight */
3070struct weighted_pcl {
3071 u32 freq; /* MHz */
3072 u8 weight;
3073 u32 flag; /* bitmap for WEIGHTED_PCL_* */
3074};
3075
Sunil Ravi89eba102022-09-13 21:04:37 -07003076struct driver_sta_mlo_info {
Sunil Ravi640215c2023-06-28 23:08:09 +00003077 bool default_map;
Sunil Ravi77d572f2023-01-17 23:58:31 +00003078 u16 req_links; /* bitmap of requested link IDs */
3079 u16 valid_links; /* bitmap of accepted link IDs */
3080 u8 assoc_link_id;
Sunil Ravi89eba102022-09-13 21:04:37 -07003081 u8 ap_mld_addr[ETH_ALEN];
3082 struct {
3083 u8 addr[ETH_ALEN];
3084 u8 bssid[ETH_ALEN];
3085 unsigned int freq;
Sunil Ravi640215c2023-06-28 23:08:09 +00003086 struct t2lm_mapping t2lmap;
Sunil Ravi89eba102022-09-13 21:04:37 -07003087 } links[MAX_NUM_MLD_LINKS];
3088};
3089
Roshan Pius3a1667e2018-07-03 15:17:14 -07003090/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003091 * struct wpa_driver_ops - Driver interface API definition
3092 *
3093 * This structure defines the API that each driver interface needs to implement
3094 * for core wpa_supplicant code. All driver specific functionality is captured
3095 * in this wrapper.
3096 */
3097struct wpa_driver_ops {
3098 /** Name of the driver interface */
3099 const char *name;
3100 /** One line description of the driver interface */
3101 const char *desc;
3102
3103 /**
3104 * get_bssid - Get the current BSSID
3105 * @priv: private driver interface data
3106 * @bssid: buffer for BSSID (ETH_ALEN = 6 bytes)
3107 *
3108 * Returns: 0 on success, -1 on failure
3109 *
3110 * Query kernel driver for the current BSSID and copy it to bssid.
3111 * Setting bssid to 00:00:00:00:00:00 is recommended if the STA is not
3112 * associated.
3113 */
3114 int (*get_bssid)(void *priv, u8 *bssid);
3115
3116 /**
3117 * get_ssid - Get the current SSID
3118 * @priv: private driver interface data
3119 * @ssid: buffer for SSID (at least 32 bytes)
3120 *
3121 * Returns: Length of the SSID on success, -1 on failure
3122 *
3123 * Query kernel driver for the current SSID and copy it to ssid.
3124 * Returning zero is recommended if the STA is not associated.
3125 *
3126 * Note: SSID is an array of octets, i.e., it is not nul terminated and
3127 * can, at least in theory, contain control characters (including nul)
3128 * and as such, should be processed as binary data, not a printable
3129 * string.
3130 */
3131 int (*get_ssid)(void *priv, u8 *ssid);
3132
3133 /**
3134 * set_key - Configure encryption key
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003135 * @priv: private driver interface data
Hai Shalomfdcde762020-04-02 11:19:20 -07003136 * @params: Key parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003137 * Returns: 0 on success, -1 on failure
3138 *
3139 * Configure the given key for the kernel driver. If the driver
3140 * supports separate individual keys (4 default keys + 1 individual),
3141 * addr can be used to determine whether the key is default or
3142 * individual. If only 4 keys are supported, the default key with key
3143 * index 0 is used as the individual key. STA must be configured to use
3144 * it as the default Tx key (set_tx is set) and accept Rx for all the
3145 * key indexes. In most cases, WPA uses only key indexes 1 and 2 for
3146 * broadcast keys, so key index 0 is available for this kind of
3147 * configuration.
3148 *
3149 * Please note that TKIP keys include separate TX and RX MIC keys and
3150 * some drivers may expect them in different order than wpa_supplicant
3151 * is using. If the TX/RX keys are swapped, all TKIP encrypted packets
3152 * will trigger Michael MIC errors. This can be fixed by changing the
Sunil Ravia04bd252022-05-02 22:54:18 -07003153 * order of MIC keys by swapping the bytes 16..23 and 24..31 of the key
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003154 * in driver_*.c set_key() implementation, see driver_ndis.c for an
3155 * example on how this can be done.
3156 */
Hai Shalomfdcde762020-04-02 11:19:20 -07003157 int (*set_key)(void *priv, struct wpa_driver_set_key_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003158
3159 /**
3160 * init - Initialize driver interface
3161 * @ctx: context to be used when calling wpa_supplicant functions,
3162 * e.g., wpa_supplicant_event()
3163 * @ifname: interface name, e.g., wlan0
3164 *
3165 * Returns: Pointer to private data, %NULL on failure
3166 *
3167 * Initialize driver interface, including event processing for kernel
3168 * driver events (e.g., associated, scan results, Michael MIC failure).
3169 * This function can allocate a private configuration data area for
3170 * @ctx, file descriptor, interface name, etc. information that may be
3171 * needed in future driver operations. If this is not used, non-NULL
3172 * value will need to be returned because %NULL is used to indicate
3173 * failure. The returned value will be used as 'void *priv' data for
3174 * all other driver_ops functions.
3175 *
3176 * The main event loop (eloop.c) of wpa_supplicant can be used to
3177 * register callback for read sockets (eloop_register_read_sock()).
3178 *
3179 * See below for more information about events and
3180 * wpa_supplicant_event() function.
3181 */
3182 void * (*init)(void *ctx, const char *ifname);
3183
3184 /**
3185 * deinit - Deinitialize driver interface
3186 * @priv: private driver interface data from init()
3187 *
3188 * Shut down driver interface and processing of driver events. Free
3189 * private data buffer if one was allocated in init() handler.
3190 */
3191 void (*deinit)(void *priv);
3192
3193 /**
3194 * set_param - Set driver configuration parameters
3195 * @priv: private driver interface data from init()
3196 * @param: driver specific configuration parameters
3197 *
3198 * Returns: 0 on success, -1 on failure
3199 *
3200 * Optional handler for notifying driver interface about configuration
3201 * parameters (driver_param).
3202 */
3203 int (*set_param)(void *priv, const char *param);
3204
3205 /**
3206 * set_countermeasures - Enable/disable TKIP countermeasures
3207 * @priv: private driver interface data
3208 * @enabled: 1 = countermeasures enabled, 0 = disabled
3209 *
3210 * Returns: 0 on success, -1 on failure
3211 *
3212 * Configure TKIP countermeasures. When these are enabled, the driver
3213 * should drop all received and queued frames that are using TKIP.
3214 */
3215 int (*set_countermeasures)(void *priv, int enabled);
3216
3217 /**
3218 * deauthenticate - Request driver to deauthenticate
3219 * @priv: private driver interface data
3220 * @addr: peer address (BSSID of the AP)
3221 * @reason_code: 16-bit reason code to be sent in the deauthentication
3222 * frame
3223 *
3224 * Returns: 0 on success, -1 on failure
3225 */
Hai Shalom81f62d82019-07-22 12:10:00 -07003226 int (*deauthenticate)(void *priv, const u8 *addr, u16 reason_code);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003227
3228 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003229 * associate - Request driver to associate
3230 * @priv: private driver interface data
3231 * @params: association parameters
3232 *
3233 * Returns: 0 on success, -1 on failure
3234 */
3235 int (*associate)(void *priv,
3236 struct wpa_driver_associate_params *params);
3237
3238 /**
3239 * add_pmkid - Add PMKSA cache entry to the driver
3240 * @priv: private driver interface data
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003241 * @params: PMKSA parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003242 *
3243 * Returns: 0 on success, -1 on failure
3244 *
3245 * This function is called when a new PMK is received, as a result of
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003246 * either normal authentication or RSN pre-authentication. The PMKSA
3247 * parameters are either a set of bssid, pmkid, and pmk; or a set of
3248 * ssid, fils_cache_id, pmkid, and pmk.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003249 *
3250 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
3251 * associate(), add_pmkid() can be used to add new PMKSA cache entries
3252 * in the driver. If the driver uses wpa_ie from wpa_supplicant, this
3253 * driver_ops function does not need to be implemented. Likewise, if
3254 * the driver does not support WPA, this function is not needed.
3255 */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003256 int (*add_pmkid)(void *priv, struct wpa_pmkid_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003257
3258 /**
3259 * remove_pmkid - Remove PMKSA cache entry to the driver
3260 * @priv: private driver interface data
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003261 * @params: PMKSA parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003262 *
3263 * Returns: 0 on success, -1 on failure
3264 *
3265 * This function is called when the supplicant drops a PMKSA cache
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003266 * entry for any reason. The PMKSA parameters are either a set of
3267 * bssid and pmkid; or a set of ssid, fils_cache_id, and pmkid.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003268 *
3269 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
3270 * associate(), remove_pmkid() can be used to synchronize PMKSA caches
3271 * between the driver and wpa_supplicant. If the driver uses wpa_ie
3272 * from wpa_supplicant, this driver_ops function does not need to be
3273 * implemented. Likewise, if the driver does not support WPA, this
3274 * function is not needed.
3275 */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003276 int (*remove_pmkid)(void *priv, struct wpa_pmkid_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003277
3278 /**
3279 * flush_pmkid - Flush PMKSA cache
3280 * @priv: private driver interface data
3281 *
3282 * Returns: 0 on success, -1 on failure
3283 *
3284 * This function is called when the supplicant drops all PMKSA cache
3285 * entries for any reason.
3286 *
3287 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
3288 * associate(), remove_pmkid() can be used to synchronize PMKSA caches
3289 * between the driver and wpa_supplicant. If the driver uses wpa_ie
3290 * from wpa_supplicant, this driver_ops function does not need to be
3291 * implemented. Likewise, if the driver does not support WPA, this
3292 * function is not needed.
3293 */
3294 int (*flush_pmkid)(void *priv);
3295
3296 /**
3297 * get_capa - Get driver capabilities
3298 * @priv: private driver interface data
3299 *
3300 * Returns: 0 on success, -1 on failure
3301 *
3302 * Get driver/firmware/hardware capabilities.
3303 */
3304 int (*get_capa)(void *priv, struct wpa_driver_capa *capa);
3305
3306 /**
3307 * poll - Poll driver for association information
3308 * @priv: private driver interface data
3309 *
Sunil Ravi77d572f2023-01-17 23:58:31 +00003310 * This is an optional callback that can be used when the driver does
3311 * not provide event mechanism for association events. This is called
3312 * when receiving WPA/RSN EAPOL-Key messages that require association
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003313 * information. The driver interface is supposed to generate associnfo
3314 * event before returning from this callback function. In addition, the
3315 * driver interface should generate an association event after having
3316 * sent out associnfo.
3317 */
3318 void (*poll)(void *priv);
3319
3320 /**
Dmitry Shmidte4663042016-04-04 10:07:49 -07003321 * get_ifindex - Get interface index
3322 * @priv: private driver interface data
3323 *
3324 * Returns: Interface index
3325 */
3326 unsigned int (*get_ifindex)(void *priv);
3327
3328 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003329 * get_ifname - Get interface name
3330 * @priv: private driver interface data
3331 *
3332 * Returns: Pointer to the interface name. This can differ from the
3333 * interface name used in init() call. Init() is called first.
3334 *
3335 * This optional function can be used to allow the driver interface to
3336 * replace the interface name with something else, e.g., based on an
3337 * interface mapping from a more descriptive name.
3338 */
3339 const char * (*get_ifname)(void *priv);
3340
3341 /**
3342 * get_mac_addr - Get own MAC address
3343 * @priv: private driver interface data
3344 *
3345 * Returns: Pointer to own MAC address or %NULL on failure
3346 *
3347 * This optional function can be used to get the own MAC address of the
3348 * device from the driver interface code. This is only needed if the
3349 * l2_packet implementation for the OS does not provide easy access to
3350 * a MAC address. */
3351 const u8 * (*get_mac_addr)(void *priv);
3352
3353 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003354 * set_operstate - Sets device operating state to DORMANT or UP
3355 * @priv: private driver interface data
3356 * @state: 0 = dormant, 1 = up
3357 * Returns: 0 on success, -1 on failure
3358 *
3359 * This is an optional function that can be used on operating systems
3360 * that support a concept of controlling network device state from user
3361 * space applications. This function, if set, gets called with
3362 * state = 1 when authentication has been completed and with state = 0
3363 * when connection is lost.
3364 */
3365 int (*set_operstate)(void *priv, int state);
3366
3367 /**
3368 * mlme_setprotection - MLME-SETPROTECTION.request primitive
3369 * @priv: Private driver interface data
3370 * @addr: Address of the station for which to set protection (may be
3371 * %NULL for group keys)
3372 * @protect_type: MLME_SETPROTECTION_PROTECT_TYPE_*
3373 * @key_type: MLME_SETPROTECTION_KEY_TYPE_*
3374 * Returns: 0 on success, -1 on failure
3375 *
3376 * This is an optional function that can be used to set the driver to
3377 * require protection for Tx and/or Rx frames. This uses the layer
3378 * interface defined in IEEE 802.11i-2004 clause 10.3.22.1
3379 * (MLME-SETPROTECTION.request). Many drivers do not use explicit
3380 * set protection operation; instead, they set protection implicitly
3381 * based on configured keys.
3382 */
3383 int (*mlme_setprotection)(void *priv, const u8 *addr, int protect_type,
3384 int key_type);
3385
3386 /**
3387 * get_hw_feature_data - Get hardware support data (channels and rates)
3388 * @priv: Private driver interface data
3389 * @num_modes: Variable for returning the number of returned modes
3390 * flags: Variable for returning hardware feature flags
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003391 * @dfs: Variable for returning DFS region (HOSTAPD_DFS_REGION_*)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003392 * Returns: Pointer to allocated hardware data on success or %NULL on
3393 * failure. Caller is responsible for freeing this.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003394 */
3395 struct hostapd_hw_modes * (*get_hw_feature_data)(void *priv,
3396 u16 *num_modes,
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003397 u16 *flags, u8 *dfs);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003398
3399 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003400 * send_mlme - Send management frame from MLME
3401 * @priv: Private driver interface data
3402 * @data: IEEE 802.11 management frame with IEEE 802.11 header
3403 * @data_len: Size of the management frame
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003404 * @noack: Do not wait for this frame to be acked (disable retries)
Dmitry Shmidta3dc3092015-06-23 11:21:28 -07003405 * @freq: Frequency (in MHz) to send the frame on, or 0 to let the
3406 * driver decide
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08003407 * @csa_offs: Array of CSA offsets or %NULL
3408 * @csa_offs_len: Number of elements in csa_offs
Hai Shalomfdcde762020-04-02 11:19:20 -07003409 * @no_encrypt: Do not encrypt frame even if appropriate key exists
3410 * (used only for testing purposes)
3411 * @wait: Time to wait off-channel for a response (in ms), or zero
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003412 * @link_id: Link ID to use for TX, or -1 if not set
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003413 * Returns: 0 on success, -1 on failure
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003414 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003415 int (*send_mlme)(void *priv, const u8 *data, size_t data_len,
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08003416 int noack, unsigned int freq, const u16 *csa_offs,
Hai Shalomfdcde762020-04-02 11:19:20 -07003417 size_t csa_offs_len, int no_encrypt,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003418 unsigned int wait, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003419
3420 /**
3421 * update_ft_ies - Update FT (IEEE 802.11r) IEs
3422 * @priv: Private driver interface data
3423 * @md: Mobility domain (2 octets) (also included inside ies)
3424 * @ies: FT IEs (MDIE, FTIE, ...) or %NULL to remove IEs
3425 * @ies_len: Length of FT IEs in bytes
3426 * Returns: 0 on success, -1 on failure
3427 *
3428 * The supplicant uses this callback to let the driver know that keying
3429 * material for FT is available and that the driver can use the
3430 * provided IEs in the next message in FT authentication sequence.
3431 *
3432 * This function is only needed for driver that support IEEE 802.11r
3433 * (Fast BSS Transition).
3434 */
3435 int (*update_ft_ies)(void *priv, const u8 *md, const u8 *ies,
3436 size_t ies_len);
3437
3438 /**
Sunil Ravi99c035e2024-07-12 01:42:03 +00003439 * get_scan_results - Fetch the latest scan results
3440 * @priv: Private driver interface data
3441 * @bssid: Return results only for the specified BSSID, %NULL for all
3442 *
3443 * Returns: Allocated buffer of scan results (caller is responsible for
3444 * freeing the data structure) on success, NULL on failure
3445 */
3446 struct wpa_scan_results * (*get_scan_results)(void *priv,
3447 const u8 *bssid);
3448
3449 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003450 * get_scan_results2 - Fetch the latest scan results
3451 * @priv: private driver interface data
3452 *
3453 * Returns: Allocated buffer of scan results (caller is responsible for
3454 * freeing the data structure) on success, NULL on failure
3455 */
3456 struct wpa_scan_results * (*get_scan_results2)(void *priv);
3457
3458 /**
3459 * set_country - Set country
3460 * @priv: Private driver interface data
3461 * @alpha2: country to which to switch to
3462 * Returns: 0 on success, -1 on failure
3463 *
3464 * This function is for drivers which support some form
3465 * of setting a regulatory domain.
3466 */
3467 int (*set_country)(void *priv, const char *alpha2);
3468
3469 /**
Dmitry Shmidtcce06662013-11-04 18:44:24 -08003470 * get_country - Get country
3471 * @priv: Private driver interface data
3472 * @alpha2: Buffer for returning country code (at least 3 octets)
3473 * Returns: 0 on success, -1 on failure
3474 */
3475 int (*get_country)(void *priv, char *alpha2);
3476
3477 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003478 * global_init - Global driver initialization
Dmitry Shmidte4663042016-04-04 10:07:49 -07003479 * @ctx: wpa_global pointer
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003480 * Returns: Pointer to private data (global), %NULL on failure
3481 *
3482 * This optional function is called to initialize the driver wrapper
3483 * for global data, i.e., data that applies to all interfaces. If this
3484 * function is implemented, global_deinit() will also need to be
3485 * implemented to free the private data. The driver will also likely
3486 * use init2() function instead of init() to get the pointer to global
3487 * data available to per-interface initializer.
3488 */
Dmitry Shmidte4663042016-04-04 10:07:49 -07003489 void * (*global_init)(void *ctx);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003490
3491 /**
3492 * global_deinit - Global driver deinitialization
3493 * @priv: private driver global data from global_init()
3494 *
3495 * Terminate any global driver related functionality and free the
3496 * global data structure.
3497 */
3498 void (*global_deinit)(void *priv);
3499
3500 /**
3501 * init2 - Initialize driver interface (with global data)
3502 * @ctx: context to be used when calling wpa_supplicant functions,
3503 * e.g., wpa_supplicant_event()
3504 * @ifname: interface name, e.g., wlan0
3505 * @global_priv: private driver global data from global_init()
3506 * Returns: Pointer to private data, %NULL on failure
3507 *
3508 * This function can be used instead of init() if the driver wrapper
3509 * uses global data.
3510 */
3511 void * (*init2)(void *ctx, const char *ifname, void *global_priv);
3512
3513 /**
3514 * get_interfaces - Get information about available interfaces
3515 * @global_priv: private driver global data from global_init()
3516 * Returns: Allocated buffer of interface information (caller is
3517 * responsible for freeing the data structure) on success, NULL on
3518 * failure
3519 */
3520 struct wpa_interface_info * (*get_interfaces)(void *global_priv);
3521
3522 /**
3523 * scan2 - Request the driver to initiate scan
3524 * @priv: private driver interface data
3525 * @params: Scan parameters
3526 *
3527 * Returns: 0 on success, -1 on failure
3528 *
3529 * Once the scan results are ready, the driver should report scan
3530 * results event for wpa_supplicant which will eventually request the
3531 * results with wpa_driver_get_scan_results2().
3532 */
3533 int (*scan2)(void *priv, struct wpa_driver_scan_params *params);
3534
3535 /**
3536 * authenticate - Request driver to authenticate
3537 * @priv: private driver interface data
3538 * @params: authentication parameters
3539 * Returns: 0 on success, -1 on failure
3540 *
3541 * This is an optional function that can be used with drivers that
3542 * support separate authentication and association steps, i.e., when
3543 * wpa_supplicant can act as the SME. If not implemented, associate()
3544 * function is expected to take care of IEEE 802.11 authentication,
3545 * too.
3546 */
3547 int (*authenticate)(void *priv,
3548 struct wpa_driver_auth_params *params);
3549
3550 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003551 * set_ap - Set Beacon and Probe Response information for AP mode
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003552 * @priv: Private driver interface data
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003553 * @params: Parameters to use in AP mode
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003554 *
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003555 * This function is used to configure Beacon template and/or extra IEs
3556 * to add for Beacon and Probe Response frames for the driver in
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003557 * AP mode. The driver is responsible for building the full Beacon
3558 * frame by concatenating the head part with TIM IE generated by the
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003559 * driver/firmware and finishing with the tail part. Depending on the
3560 * driver architectue, this can be done either by using the full
3561 * template or the set of additional IEs (e.g., WPS and P2P IE).
3562 * Similarly, Probe Response processing depends on the driver design.
3563 * If the driver (or firmware) takes care of replying to Probe Request
3564 * frames, the extra IEs provided here needs to be added to the Probe
3565 * Response frames.
3566 *
3567 * Returns: 0 on success, -1 on failure
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003568 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003569 int (*set_ap)(void *priv, struct wpa_driver_ap_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003570
3571 /**
Dmitry Shmidt8bae4132013-06-06 11:25:10 -07003572 * set_acl - Set ACL in AP mode
3573 * @priv: Private driver interface data
3574 * @params: Parameters to configure ACL
3575 * Returns: 0 on success, -1 on failure
3576 *
3577 * This is used only for the drivers which support MAC address ACL.
3578 */
3579 int (*set_acl)(void *priv, struct hostapd_acl_params *params);
3580
3581 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003582 * hapd_init - Initialize driver interface (hostapd only)
3583 * @hapd: Pointer to hostapd context
3584 * @params: Configuration for the driver wrapper
3585 * Returns: Pointer to private data, %NULL on failure
3586 *
3587 * This function is used instead of init() or init2() when the driver
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003588 * wrapper is used with hostapd.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003589 */
3590 void * (*hapd_init)(struct hostapd_data *hapd,
3591 struct wpa_init_params *params);
3592
3593 /**
3594 * hapd_deinit - Deinitialize driver interface (hostapd only)
3595 * @priv: Private driver interface data from hapd_init()
3596 */
3597 void (*hapd_deinit)(void *priv);
3598
3599 /**
3600 * set_ieee8021x - Enable/disable IEEE 802.1X support (AP only)
3601 * @priv: Private driver interface data
3602 * @params: BSS parameters
3603 * Returns: 0 on success, -1 on failure
3604 *
3605 * This is an optional function to configure the kernel driver to
3606 * enable/disable IEEE 802.1X support and set WPA/WPA2 parameters. This
3607 * can be left undefined (set to %NULL) if IEEE 802.1X support is
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003608 * always enabled and the driver uses set_ap() to set WPA/RSN IE
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003609 * for Beacon frames.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003610 *
3611 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003612 */
3613 int (*set_ieee8021x)(void *priv, struct wpa_bss_params *params);
3614
3615 /**
3616 * set_privacy - Enable/disable privacy (AP only)
3617 * @priv: Private driver interface data
3618 * @enabled: 1 = privacy enabled, 0 = disabled
3619 * Returns: 0 on success, -1 on failure
3620 *
3621 * This is an optional function to configure privacy field in the
3622 * kernel driver for Beacon frames. This can be left undefined (set to
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003623 * %NULL) if the driver uses the Beacon template from set_ap().
3624 *
3625 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003626 */
3627 int (*set_privacy)(void *priv, int enabled);
3628
3629 /**
3630 * get_seqnum - Fetch the current TSC/packet number (AP only)
3631 * @ifname: The interface name (main or virtual)
3632 * @priv: Private driver interface data
3633 * @addr: MAC address of the station or %NULL for group keys
3634 * @idx: Key index
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003635 * @link_id: Link ID for a group key, or -1 if not set
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003636 * @seq: Buffer for returning the latest used TSC/packet number
3637 * Returns: 0 on success, -1 on failure
3638 *
3639 * This function is used to fetch the last used TSC/packet number for
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07003640 * a TKIP, CCMP, GCMP, or BIP/IGTK key. It is mainly used with group
3641 * keys, so there is no strict requirement on implementing support for
3642 * unicast keys (i.e., addr != %NULL).
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003643 */
3644 int (*get_seqnum)(const char *ifname, void *priv, const u8 *addr,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003645 int idx, int link_id, u8 *seq);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003646
3647 /**
3648 * flush - Flush all association stations (AP only)
3649 * @priv: Private driver interface data
Sunil Ravi7f769292024-07-23 22:21:32 +00003650 * @link_id: In case of MLO, valid link ID on which all associated
3651 * stations will be flushed, -1 otherwise.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003652 * Returns: 0 on success, -1 on failure
3653 *
3654 * This function requests the driver to disassociate all associated
3655 * stations. This function does not need to be implemented if the
3656 * driver does not process association frames internally.
3657 */
Sunil Ravi7f769292024-07-23 22:21:32 +00003658 int (*flush)(void *priv, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003659
3660 /**
3661 * set_generic_elem - Add IEs into Beacon/Probe Response frames (AP)
3662 * @priv: Private driver interface data
3663 * @elem: Information elements
3664 * @elem_len: Length of the elem buffer in octets
3665 * Returns: 0 on success, -1 on failure
3666 *
3667 * This is an optional function to add information elements in the
3668 * kernel driver for Beacon and Probe Response frames. This can be left
3669 * undefined (set to %NULL) if the driver uses the Beacon template from
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003670 * set_ap().
3671 *
3672 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003673 */
3674 int (*set_generic_elem)(void *priv, const u8 *elem, size_t elem_len);
3675
3676 /**
Jouni Malinen1e6c57f2012-09-05 17:07:03 +03003677 * read_sta_data - Fetch station data
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003678 * @priv: Private driver interface data
3679 * @data: Buffer for returning station information
3680 * @addr: MAC address of the station
3681 * Returns: 0 on success, -1 on failure
3682 */
3683 int (*read_sta_data)(void *priv, struct hostap_sta_driver_data *data,
3684 const u8 *addr);
3685
3686 /**
Hai Shalomfdcde762020-04-02 11:19:20 -07003687 * tx_control_port - Send a frame over the 802.1X controlled port
3688 * @priv: Private driver interface data
3689 * @dest: Destination MAC address
3690 * @proto: Ethertype in host byte order
3691 * @buf: Frame payload starting from IEEE 802.1X header
3692 * @len: Frame payload length
3693 * @no_encrypt: Do not encrypt frame
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003694 * @link_id: Link ID to use for TX, or -1 if not set
Hai Shalomfdcde762020-04-02 11:19:20 -07003695 *
3696 * Returns 0 on success, else an error
3697 *
3698 * This is like a normal Ethernet send except that the driver is aware
3699 * (by other means than the Ethertype) that this frame is special,
3700 * and more importantly it gains an ordering between the transmission of
3701 * the frame and other driver management operations such as key
3702 * installations. This can be used to work around known limitations in
3703 * IEEE 802.11 protocols such as race conditions between rekeying 4-way
3704 * handshake message 4/4 and a PTK being overwritten.
3705 *
3706 * This function is only used for a given interface if the driver
3707 * instance reports WPA_DRIVER_FLAGS_CONTROL_PORT capability. Otherwise,
3708 * API users will fall back to sending the frame via a normal socket.
3709 */
3710 int (*tx_control_port)(void *priv, const u8 *dest,
3711 u16 proto, const u8 *buf, size_t len,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003712 int no_encrypt, int link_id);
Hai Shalomfdcde762020-04-02 11:19:20 -07003713
3714 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003715 * hapd_send_eapol - Send an EAPOL packet (AP only)
3716 * @priv: private driver interface data
3717 * @addr: Destination MAC address
3718 * @data: EAPOL packet starting with IEEE 802.1X header
3719 * @data_len: Length of the EAPOL packet in octets
3720 * @encrypt: Whether the frame should be encrypted
3721 * @own_addr: Source MAC address
3722 * @flags: WPA_STA_* flags for the destination station
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003723 * @link_id: Link ID to use for TX, or -1 if not set
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003724 *
3725 * Returns: 0 on success, -1 on failure
3726 */
3727 int (*hapd_send_eapol)(void *priv, const u8 *addr, const u8 *data,
3728 size_t data_len, int encrypt,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003729 const u8 *own_addr, u32 flags, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003730
3731 /**
3732 * sta_deauth - Deauthenticate a station (AP only)
3733 * @priv: Private driver interface data
3734 * @own_addr: Source address and BSSID for the Deauthentication frame
3735 * @addr: MAC address of the station to deauthenticate
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003736 * @reason: Reason code for the Deauthentication frame
3737 * @link_id: Link ID to use for Deauthentication frame, or -1 if not set
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003738 * Returns: 0 on success, -1 on failure
3739 *
3740 * This function requests a specific station to be deauthenticated and
3741 * a Deauthentication frame to be sent to it.
3742 */
3743 int (*sta_deauth)(void *priv, const u8 *own_addr, const u8 *addr,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003744 u16 reason, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003745
3746 /**
3747 * sta_disassoc - Disassociate a station (AP only)
3748 * @priv: Private driver interface data
3749 * @own_addr: Source address and BSSID for the Disassociation frame
3750 * @addr: MAC address of the station to disassociate
3751 * @reason: Reason code for the Disassociation frame
3752 * Returns: 0 on success, -1 on failure
3753 *
3754 * This function requests a specific station to be disassociated and
3755 * a Disassociation frame to be sent to it.
3756 */
3757 int (*sta_disassoc)(void *priv, const u8 *own_addr, const u8 *addr,
Hai Shalom81f62d82019-07-22 12:10:00 -07003758 u16 reason);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003759
3760 /**
3761 * sta_remove - Remove a station entry (AP only)
3762 * @priv: Private driver interface data
3763 * @addr: MAC address of the station to be removed
3764 * Returns: 0 on success, -1 on failure
3765 */
3766 int (*sta_remove)(void *priv, const u8 *addr);
3767
3768 /**
3769 * hapd_get_ssid - Get the current SSID (AP only)
3770 * @priv: Private driver interface data
3771 * @buf: Buffer for returning the SSID
3772 * @len: Maximum length of the buffer
3773 * Returns: Length of the SSID on success, -1 on failure
3774 *
3775 * This function need not be implemented if the driver uses Beacon
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003776 * template from set_ap() and does not reply to Probe Request frames.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003777 */
3778 int (*hapd_get_ssid)(void *priv, u8 *buf, int len);
3779
3780 /**
3781 * hapd_set_ssid - Set SSID (AP only)
3782 * @priv: Private driver interface data
3783 * @buf: SSID
3784 * @len: Length of the SSID in octets
3785 * Returns: 0 on success, -1 on failure
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003786 *
3787 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003788 */
3789 int (*hapd_set_ssid)(void *priv, const u8 *buf, int len);
3790
3791 /**
3792 * hapd_set_countermeasures - Enable/disable TKIP countermeasures (AP)
3793 * @priv: Private driver interface data
3794 * @enabled: 1 = countermeasures enabled, 0 = disabled
3795 * Returns: 0 on success, -1 on failure
3796 *
3797 * This need not be implemented if the driver does not take care of
3798 * association processing.
3799 */
3800 int (*hapd_set_countermeasures)(void *priv, int enabled);
3801
3802 /**
3803 * sta_add - Add a station entry
3804 * @priv: Private driver interface data
3805 * @params: Station parameters
3806 * Returns: 0 on success, -1 on failure
3807 *
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08003808 * This function is used to add or set (params->set 1) a station
3809 * entry in the driver. Adding STA entries is used only if the driver
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003810 * does not take care of association processing.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003811 *
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08003812 * With drivers that don't support full AP client state, this function
3813 * is used to add a station entry to the driver once the station has
3814 * completed association.
3815 *
3816 * With TDLS, this function is used to add or set (params->set 1)
3817 * TDLS peer entries (even with drivers that do not support full AP
3818 * client state).
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003819 */
3820 int (*sta_add)(void *priv, struct hostapd_sta_add_params *params);
3821
3822 /**
3823 * get_inact_sec - Get station inactivity duration (AP only)
3824 * @priv: Private driver interface data
3825 * @addr: Station address
3826 * Returns: Number of seconds station has been inactive, -1 on failure
3827 */
3828 int (*get_inact_sec)(void *priv, const u8 *addr);
3829
3830 /**
3831 * sta_clear_stats - Clear station statistics (AP only)
3832 * @priv: Private driver interface data
3833 * @addr: Station address
3834 * Returns: 0 on success, -1 on failure
3835 */
3836 int (*sta_clear_stats)(void *priv, const u8 *addr);
3837
3838 /**
3839 * set_freq - Set channel/frequency (AP only)
3840 * @priv: Private driver interface data
3841 * @freq: Channel parameters
3842 * Returns: 0 on success, -1 on failure
3843 */
3844 int (*set_freq)(void *priv, struct hostapd_freq_params *freq);
3845
3846 /**
3847 * set_rts - Set RTS threshold
3848 * @priv: Private driver interface data
3849 * @rts: RTS threshold in octets
3850 * Returns: 0 on success, -1 on failure
3851 */
3852 int (*set_rts)(void *priv, int rts);
3853
3854 /**
3855 * set_frag - Set fragmentation threshold
3856 * @priv: Private driver interface data
3857 * @frag: Fragmentation threshold in octets
3858 * Returns: 0 on success, -1 on failure
3859 */
3860 int (*set_frag)(void *priv, int frag);
3861
3862 /**
3863 * sta_set_flags - Set station flags (AP only)
3864 * @priv: Private driver interface data
3865 * @addr: Station address
3866 * @total_flags: Bitmap of all WPA_STA_* flags currently set
3867 * @flags_or: Bitmap of WPA_STA_* flags to add
3868 * @flags_and: Bitmap of WPA_STA_* flags to us as a mask
3869 * Returns: 0 on success, -1 on failure
3870 */
3871 int (*sta_set_flags)(void *priv, const u8 *addr,
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08003872 unsigned int total_flags, unsigned int flags_or,
3873 unsigned int flags_and);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003874
3875 /**
Hai Shalom81f62d82019-07-22 12:10:00 -07003876 * sta_set_airtime_weight - Set station airtime weight (AP only)
3877 * @priv: Private driver interface data
3878 * @addr: Station address
3879 * @weight: New weight for station airtime assignment
3880 * Returns: 0 on success, -1 on failure
3881 */
3882 int (*sta_set_airtime_weight)(void *priv, const u8 *addr,
3883 unsigned int weight);
3884
3885 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003886 * set_tx_queue_params - Set TX queue parameters
3887 * @priv: Private driver interface data
3888 * @queue: Queue number (0 = VO, 1 = VI, 2 = BE, 3 = BK)
3889 * @aifs: AIFS
3890 * @cw_min: cwMin
3891 * @cw_max: cwMax
3892 * @burst_time: Maximum length for bursting in 0.1 msec units
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003893 * @link_id: Link ID to use, or -1 for non MLD.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003894 */
3895 int (*set_tx_queue_params)(void *priv, int queue, int aifs, int cw_min,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003896 int cw_max, int burst_time, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003897
3898 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003899 * if_add - Add a virtual interface
3900 * @priv: Private driver interface data
3901 * @type: Interface type
3902 * @ifname: Interface name for the new virtual interface
3903 * @addr: Local address to use for the interface or %NULL to use the
3904 * parent interface address
3905 * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces
3906 * @drv_priv: Pointer for overwriting the driver context or %NULL if
3907 * not allowed (applies only to %WPA_IF_AP_BSS type)
3908 * @force_ifname: Buffer for returning an interface name that the
3909 * driver ended up using if it differs from the requested ifname
3910 * @if_addr: Buffer for returning the allocated interface address
3911 * (this may differ from the requested addr if the driver cannot
3912 * change interface address)
3913 * @bridge: Bridge interface to use or %NULL if no bridge configured
Dmitry Shmidtcce06662013-11-04 18:44:24 -08003914 * @use_existing: Whether to allow existing interface to be used
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08003915 * @setup_ap: Whether to setup AP for %WPA_IF_AP_BSS interfaces
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003916 * Returns: 0 on success, -1 on failure
3917 */
3918 int (*if_add)(void *priv, enum wpa_driver_if_type type,
3919 const char *ifname, const u8 *addr, void *bss_ctx,
3920 void **drv_priv, char *force_ifname, u8 *if_addr,
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08003921 const char *bridge, int use_existing, int setup_ap);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003922
3923 /**
3924 * if_remove - Remove a virtual interface
3925 * @priv: Private driver interface data
3926 * @type: Interface type
3927 * @ifname: Interface name of the virtual interface to be removed
3928 * Returns: 0 on success, -1 on failure
3929 */
3930 int (*if_remove)(void *priv, enum wpa_driver_if_type type,
3931 const char *ifname);
3932
3933 /**
3934 * set_sta_vlan - Bind a station into a specific interface (AP only)
3935 * @priv: Private driver interface data
3936 * @ifname: Interface (main or virtual BSS or VLAN)
3937 * @addr: MAC address of the associated station
3938 * @vlan_id: VLAN ID
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003939 * @link_id: The link ID or -1 for non-MLO
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003940 * Returns: 0 on success, -1 on failure
3941 *
3942 * This function is used to bind a station to a specific virtual
3943 * interface. It is only used if when virtual interfaces are supported,
3944 * e.g., to assign stations to different VLAN interfaces based on
3945 * information from a RADIUS server. This allows separate broadcast
3946 * domains to be used with a single BSS.
3947 */
3948 int (*set_sta_vlan)(void *priv, const u8 *addr, const char *ifname,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003949 int vlan_id, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003950
3951 /**
3952 * commit - Optional commit changes handler (AP only)
3953 * @priv: driver private data
3954 * Returns: 0 on success, -1 on failure
3955 *
3956 * This optional handler function can be registered if the driver
3957 * interface implementation needs to commit changes (e.g., by setting
3958 * network interface up) at the end of initial configuration. If set,
3959 * this handler will be called after initial setup has been completed.
3960 */
3961 int (*commit)(void *priv);
3962
3963 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003964 * set_radius_acl_auth - Notification of RADIUS ACL change
3965 * @priv: Private driver interface data
3966 * @mac: MAC address of the station
3967 * @accepted: Whether the station was accepted
3968 * @session_timeout: Session timeout for the station
3969 * Returns: 0 on success, -1 on failure
3970 */
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07003971 int (*set_radius_acl_auth)(void *priv, const u8 *mac, int accepted,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003972 u32 session_timeout);
3973
3974 /**
3975 * set_radius_acl_expire - Notification of RADIUS ACL expiration
3976 * @priv: Private driver interface data
3977 * @mac: MAC address of the station
3978 * Returns: 0 on success, -1 on failure
3979 */
3980 int (*set_radius_acl_expire)(void *priv, const u8 *mac);
3981
3982 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003983 * set_ap_wps_ie - Add WPS IE(s) into Beacon/Probe Response frames (AP)
3984 * @priv: Private driver interface data
3985 * @beacon: WPS IE(s) for Beacon frames or %NULL to remove extra IE(s)
3986 * @proberesp: WPS IE(s) for Probe Response frames or %NULL to remove
3987 * extra IE(s)
3988 * @assocresp: WPS IE(s) for (Re)Association Response frames or %NULL
3989 * to remove extra IE(s)
3990 * Returns: 0 on success, -1 on failure
3991 *
3992 * This is an optional function to add WPS IE in the kernel driver for
3993 * Beacon and Probe Response frames. This can be left undefined (set
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003994 * to %NULL) if the driver uses the Beacon template from set_ap()
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003995 * and does not process Probe Request frames. If the driver takes care
3996 * of (Re)Association frame processing, the assocresp buffer includes
3997 * WPS IE(s) that need to be added to (Re)Association Response frames
3998 * whenever a (Re)Association Request frame indicated use of WPS.
3999 *
4000 * This will also be used to add P2P IE(s) into Beacon/Probe Response
4001 * frames when operating as a GO. The driver is responsible for adding
4002 * timing related attributes (e.g., NoA) in addition to the IEs
4003 * included here by appending them after these buffers. This call is
4004 * also used to provide Probe Response IEs for P2P Listen state
4005 * operations for drivers that generate the Probe Response frames
4006 * internally.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004007 *
4008 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004009 */
4010 int (*set_ap_wps_ie)(void *priv, const struct wpabuf *beacon,
4011 const struct wpabuf *proberesp,
4012 const struct wpabuf *assocresp);
4013
4014 /**
4015 * set_supp_port - Set IEEE 802.1X Supplicant Port status
4016 * @priv: Private driver interface data
4017 * @authorized: Whether the port is authorized
4018 * Returns: 0 on success, -1 on failure
4019 */
4020 int (*set_supp_port)(void *priv, int authorized);
4021
4022 /**
4023 * set_wds_sta - Bind a station into a 4-address WDS (AP only)
4024 * @priv: Private driver interface data
4025 * @addr: MAC address of the associated station
4026 * @aid: Association ID
4027 * @val: 1 = bind to 4-address WDS; 0 = unbind
4028 * @bridge_ifname: Bridge interface to use for the WDS station or %NULL
4029 * to indicate that bridge is not to be used
Dmitry Shmidtc2ebb4b2013-07-24 12:57:51 -07004030 * @ifname_wds: Buffer to return the interface name for the new WDS
4031 * station or %NULL to indicate name is not returned.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004032 * Returns: 0 on success, -1 on failure
4033 */
4034 int (*set_wds_sta)(void *priv, const u8 *addr, int aid, int val,
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07004035 const char *bridge_ifname, char *ifname_wds);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004036
4037 /**
4038 * send_action - Transmit an Action frame
4039 * @priv: Private driver interface data
4040 * @freq: Frequency (in MHz) of the channel
4041 * @wait: Time to wait off-channel for a response (in ms), or zero
4042 * @dst: Destination MAC address (Address 1)
4043 * @src: Source MAC address (Address 2)
4044 * @bssid: BSSID (Address 3)
4045 * @data: Frame body
4046 * @data_len: data length in octets
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004047 @ @no_cck: Whether CCK rates must not be used to transmit this frame
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004048 * Returns: 0 on success, -1 on failure
4049 *
4050 * This command can be used to request the driver to transmit an action
4051 * frame to the specified destination.
4052 *
4053 * If the %WPA_DRIVER_FLAGS_OFFCHANNEL_TX flag is set, the frame will
4054 * be transmitted on the given channel and the device will wait for a
4055 * response on that channel for the given wait time.
4056 *
4057 * If the flag is not set, the wait time will be ignored. In this case,
4058 * if a remain-on-channel duration is in progress, the frame must be
4059 * transmitted on that channel; alternatively the frame may be sent on
4060 * the current operational channel (if in associated state in station
4061 * mode or while operating as an AP.)
Dmitry Shmidtebd93af2017-02-21 13:40:44 -08004062 *
4063 * If @src differs from the device MAC address, use of a random
4064 * transmitter address is requested for this message exchange.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004065 */
4066 int (*send_action)(void *priv, unsigned int freq, unsigned int wait,
4067 const u8 *dst, const u8 *src, const u8 *bssid,
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004068 const u8 *data, size_t data_len, int no_cck);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004069
4070 /**
4071 * send_action_cancel_wait - Cancel action frame TX wait
4072 * @priv: Private driver interface data
4073 *
4074 * This command cancels the wait time associated with sending an action
4075 * frame. It is only available when %WPA_DRIVER_FLAGS_OFFCHANNEL_TX is
4076 * set in the driver flags.
4077 */
4078 void (*send_action_cancel_wait)(void *priv);
4079
4080 /**
4081 * remain_on_channel - Remain awake on a channel
4082 * @priv: Private driver interface data
4083 * @freq: Frequency (in MHz) of the channel
4084 * @duration: Duration in milliseconds
4085 * Returns: 0 on success, -1 on failure
4086 *
4087 * This command is used to request the driver to remain awake on the
4088 * specified channel for the specified duration and report received
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08004089 * Action frames with EVENT_RX_MGMT events. Optionally, received
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004090 * Probe Request frames may also be requested to be reported by calling
4091 * probe_req_report(). These will be reported with EVENT_RX_PROBE_REQ.
4092 *
4093 * The driver may not be at the requested channel when this function
4094 * returns, i.e., the return code is only indicating whether the
4095 * request was accepted. The caller will need to wait until the
4096 * EVENT_REMAIN_ON_CHANNEL event indicates that the driver has
4097 * completed the channel change. This may take some time due to other
4098 * need for the radio and the caller should be prepared to timing out
4099 * its wait since there are no guarantees on when this request can be
4100 * executed.
4101 */
4102 int (*remain_on_channel)(void *priv, unsigned int freq,
4103 unsigned int duration);
4104
4105 /**
4106 * cancel_remain_on_channel - Cancel remain-on-channel operation
4107 * @priv: Private driver interface data
4108 *
4109 * This command can be used to cancel a remain-on-channel operation
4110 * before its originally requested duration has passed. This could be
4111 * used, e.g., when remain_on_channel() is used to request extra time
4112 * to receive a response to an Action frame and the response is
4113 * received when there is still unneeded time remaining on the
4114 * remain-on-channel operation.
4115 */
4116 int (*cancel_remain_on_channel)(void *priv);
4117
4118 /**
4119 * probe_req_report - Request Probe Request frames to be indicated
4120 * @priv: Private driver interface data
4121 * @report: Whether to report received Probe Request frames
4122 * Returns: 0 on success, -1 on failure (or if not supported)
4123 *
4124 * This command can be used to request the driver to indicate when
4125 * Probe Request frames are received with EVENT_RX_PROBE_REQ events.
4126 * Since this operation may require extra resources, e.g., due to less
4127 * optimal hardware/firmware RX filtering, many drivers may disable
4128 * Probe Request reporting at least in station mode. This command is
4129 * used to notify the driver when the Probe Request frames need to be
4130 * reported, e.g., during remain-on-channel operations.
4131 */
4132 int (*probe_req_report)(void *priv, int report);
4133
4134 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004135 * deinit_ap - Deinitialize AP mode
4136 * @priv: Private driver interface data
4137 * Returns: 0 on success, -1 on failure (or if not supported)
4138 *
4139 * This optional function can be used to disable AP mode related
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07004140 * configuration. If the interface was not dynamically added,
4141 * change the driver mode to station mode to allow normal station
4142 * operations like scanning to be completed.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004143 */
4144 int (*deinit_ap)(void *priv);
4145
4146 /**
Dmitry Shmidt04949592012-07-19 12:16:46 -07004147 * deinit_p2p_cli - Deinitialize P2P client mode
4148 * @priv: Private driver interface data
4149 * Returns: 0 on success, -1 on failure (or if not supported)
4150 *
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07004151 * This optional function can be used to disable P2P client mode. If the
4152 * interface was not dynamically added, change the interface type back
4153 * to station mode.
Dmitry Shmidt04949592012-07-19 12:16:46 -07004154 */
4155 int (*deinit_p2p_cli)(void *priv);
4156
4157 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004158 * suspend - Notification on system suspend/hibernate event
4159 * @priv: Private driver interface data
4160 */
4161 void (*suspend)(void *priv);
4162
4163 /**
4164 * resume - Notification on system resume/thaw event
4165 * @priv: Private driver interface data
4166 */
4167 void (*resume)(void *priv);
4168
4169 /**
4170 * signal_monitor - Set signal monitoring parameters
4171 * @priv: Private driver interface data
4172 * @threshold: Threshold value for signal change events; 0 = disabled
4173 * @hysteresis: Minimum change in signal strength before indicating a
4174 * new event
4175 * Returns: 0 on success, -1 on failure (or if not supported)
4176 *
4177 * This function can be used to configure monitoring of signal strength
4178 * with the current AP. Whenever signal strength drops below the
4179 * %threshold value or increases above it, EVENT_SIGNAL_CHANGE event
4180 * should be generated assuming the signal strength has changed at
4181 * least %hysteresis from the previously indicated signal change event.
4182 */
4183 int (*signal_monitor)(void *priv, int threshold, int hysteresis);
4184
4185 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004186 * get_noa - Get current Notice of Absence attribute payload
4187 * @priv: Private driver interface data
4188 * @buf: Buffer for returning NoA
4189 * @buf_len: Buffer length in octets
4190 * Returns: Number of octets used in buf, 0 to indicate no NoA is being
4191 * advertized, or -1 on failure
4192 *
4193 * This function is used to fetch the current Notice of Absence
4194 * attribute value from GO.
4195 */
4196 int (*get_noa)(void *priv, u8 *buf, size_t buf_len);
4197
4198 /**
4199 * set_noa - Set Notice of Absence parameters for GO (testing)
4200 * @priv: Private driver interface data
4201 * @count: Count
4202 * @start: Start time in ms from next TBTT
4203 * @duration: Duration in ms
4204 * Returns: 0 on success or -1 on failure
4205 *
4206 * This function is used to set Notice of Absence parameters for GO. It
4207 * is used only for testing. To disable NoA, all parameters are set to
4208 * 0.
4209 */
4210 int (*set_noa)(void *priv, u8 count, int start, int duration);
4211
4212 /**
4213 * set_p2p_powersave - Set P2P power save options
4214 * @priv: Private driver interface data
4215 * @legacy_ps: 0 = disable, 1 = enable, 2 = maximum PS, -1 = no change
4216 * @opp_ps: 0 = disable, 1 = enable, -1 = no change
4217 * @ctwindow: 0.. = change (msec), -1 = no change
4218 * Returns: 0 on success or -1 on failure
4219 */
4220 int (*set_p2p_powersave)(void *priv, int legacy_ps, int opp_ps,
4221 int ctwindow);
4222
4223 /**
4224 * ampdu - Enable/disable aggregation
4225 * @priv: Private driver interface data
4226 * @ampdu: 1/0 = enable/disable A-MPDU aggregation
4227 * Returns: 0 on success or -1 on failure
4228 */
4229 int (*ampdu)(void *priv, int ampdu);
4230
4231 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004232 * get_radio_name - Get physical radio name for the device
4233 * @priv: Private driver interface data
4234 * Returns: Radio name or %NULL if not known
4235 *
4236 * The returned data must not be modified by the caller. It is assumed
4237 * that any interface that has the same radio name as another is
4238 * sharing the same physical radio. This information can be used to
4239 * share scan results etc. information between the virtual interfaces
4240 * to speed up various operations.
4241 */
4242 const char * (*get_radio_name)(void *priv);
4243
4244 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004245 * send_tdls_mgmt - for sending TDLS management packets
4246 * @priv: private driver interface data
4247 * @dst: Destination (peer) MAC address
4248 * @action_code: TDLS action code for the mssage
4249 * @dialog_token: Dialog Token to use in the message (if needed)
4250 * @status_code: Status Code or Reason Code to use (if needed)
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07004251 * @peer_capab: TDLS peer capability (TDLS_PEER_* bitfield)
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -07004252 * @initiator: Is the current end the TDLS link initiator
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004253 * @buf: TDLS IEs to add to the message
4254 * @len: Length of buf in octets
Sunil Ravi2a14cf12023-11-21 00:54:38 +00004255 * @link_id: If >= 0 indicates the link of the AP MLD to specify the
4256 * operating channel on which to send a TDLS Discovery Response frame.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004257 * Returns: 0 on success, negative (<0) on failure
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004258 *
4259 * This optional function can be used to send packet to driver which is
4260 * responsible for receiving and sending all TDLS packets.
4261 */
4262 int (*send_tdls_mgmt)(void *priv, const u8 *dst, u8 action_code,
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07004263 u8 dialog_token, u16 status_code, u32 peer_capab,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00004264 int initiator, const u8 *buf, size_t len,
4265 int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004266
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004267 /**
4268 * tdls_oper - Ask the driver to perform high-level TDLS operations
4269 * @priv: Private driver interface data
4270 * @oper: TDLS high-level operation. See %enum tdls_oper
4271 * @peer: Destination (peer) MAC address
4272 * Returns: 0 on success, negative (<0) on failure
4273 *
4274 * This optional function can be used to send high-level TDLS commands
4275 * to the driver.
4276 */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004277 int (*tdls_oper)(void *priv, enum tdls_oper oper, const u8 *peer);
4278
4279 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07004280 * wnm_oper - Notify driver of the WNM frame reception
4281 * @priv: Private driver interface data
4282 * @oper: WNM operation. See %enum wnm_oper
4283 * @peer: Destination (peer) MAC address
4284 * @buf: Buffer for the driver to fill in (for getting IE)
4285 * @buf_len: Return the len of buf
4286 * Returns: 0 on success, negative (<0) on failure
4287 */
4288 int (*wnm_oper)(void *priv, enum wnm_oper oper, const u8 *peer,
4289 u8 *buf, u16 *buf_len);
4290
4291 /**
Dmitry Shmidt051af732013-10-22 13:52:46 -07004292 * set_qos_map - Set QoS Map
4293 * @priv: Private driver interface data
4294 * @qos_map_set: QoS Map
4295 * @qos_map_set_len: Length of QoS Map
4296 */
4297 int (*set_qos_map)(void *priv, const u8 *qos_map_set,
4298 u8 qos_map_set_len);
4299
4300 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004301 * br_add_ip_neigh - Add a neigh to the bridge ip neigh table
4302 * @priv: Private driver interface data
4303 * @version: IP version of the IP address, 4 or 6
4304 * @ipaddr: IP address for the neigh entry
4305 * @prefixlen: IP address prefix length
4306 * @addr: Corresponding MAC address
4307 * Returns: 0 on success, negative (<0) on failure
4308 */
4309 int (*br_add_ip_neigh)(void *priv, u8 version, const u8 *ipaddr,
4310 int prefixlen, const u8 *addr);
4311
4312 /**
4313 * br_delete_ip_neigh - Remove a neigh from the bridge ip neigh table
4314 * @priv: Private driver interface data
4315 * @version: IP version of the IP address, 4 or 6
4316 * @ipaddr: IP address for the neigh entry
4317 * Returns: 0 on success, negative (<0) on failure
4318 */
4319 int (*br_delete_ip_neigh)(void *priv, u8 version, const u8 *ipaddr);
4320
4321 /**
4322 * br_port_set_attr - Set a bridge port attribute
4323 * @attr: Bridge port attribute to set
4324 * @val: Value to be set
4325 * Returns: 0 on success, negative (<0) on failure
4326 */
4327 int (*br_port_set_attr)(void *priv, enum drv_br_port_attr attr,
4328 unsigned int val);
4329
4330 /**
4331 * br_port_set_attr - Set a bridge network parameter
4332 * @param: Bridge parameter to set
4333 * @val: Value to be set
4334 * Returns: 0 on success, negative (<0) on failure
4335 */
4336 int (*br_set_net_param)(void *priv, enum drv_br_net_param param,
4337 unsigned int val);
4338
4339 /**
Hai Shalomfdcde762020-04-02 11:19:20 -07004340 * get_wowlan - Get wake-on-wireless status
4341 * @priv: Private driver interface data
4342 */
4343 int (*get_wowlan)(void *priv);
4344
4345 /**
Dmitry Shmidtb58836e2014-04-29 14:35:56 -07004346 * set_wowlan - Set wake-on-wireless triggers
4347 * @priv: Private driver interface data
4348 * @triggers: wowlan triggers
4349 */
4350 int (*set_wowlan)(void *priv, const struct wowlan_triggers *triggers);
4351
4352 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004353 * signal_poll - Get current connection information
4354 * @priv: Private driver interface data
4355 * @signal_info: Connection info structure
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07004356 */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004357 int (*signal_poll)(void *priv, struct wpa_signal_info *signal_info);
Dmitry Shmidtbd567ad2011-05-09 14:17:09 -07004358
4359 /**
Sunil Ravi89eba102022-09-13 21:04:37 -07004360 * mlo_signal_poll - Get current MLO connection information
4361 * @priv: Private driver interface data
4362 * @mlo_signal_info: MLO connection info structure
4363 */
4364 int (*mlo_signal_poll)(void *priv,
4365 struct wpa_mlo_signal_info *mlo_signal_info);
4366
4367 /**
Hai Shalom74f70d42019-02-11 14:42:39 -08004368 * channel_info - Get parameters of the current operating channel
4369 * @priv: Private driver interface data
4370 * @channel_info: Channel info structure
4371 * Returns: 0 on success, negative (<0) on failure
4372 */
4373 int (*channel_info)(void *priv, struct wpa_channel_info *channel_info);
4374
4375 /**
Jouni Malinen75ecf522011-06-27 15:19:46 -07004376 * set_authmode - Set authentication algorithm(s) for static WEP
4377 * @priv: Private driver interface data
4378 * @authmode: 1=Open System, 2=Shared Key, 3=both
4379 * Returns: 0 on success, -1 on failure
4380 *
4381 * This function can be used to set authentication algorithms for AP
4382 * mode when static WEP is used. If the driver uses user space MLME/SME
4383 * implementation, there is no need to implement this function.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004384 *
4385 * DEPRECATED - use set_ap() instead
Jouni Malinen75ecf522011-06-27 15:19:46 -07004386 */
4387 int (*set_authmode)(void *priv, int authmode);
Dmitry Shmidt292b0c32013-11-22 12:54:42 -08004388
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004389#ifdef ANDROID
Jouni Malinen75ecf522011-06-27 15:19:46 -07004390 /**
Dmitry Shmidt292b0c32013-11-22 12:54:42 -08004391 * driver_cmd - Execute driver-specific command
4392 * @priv: Private driver interface data
4393 * @cmd: Command to execute
4394 * @buf: Return buffer
4395 * @buf_len: Buffer length
Dmitry Shmidtbd567ad2011-05-09 14:17:09 -07004396 * Returns: 0 on success, -1 on failure
4397 */
Dmitry Shmidt292b0c32013-11-22 12:54:42 -08004398 int (*driver_cmd)(void *priv, char *cmd, char *buf, size_t buf_len);
4399#endif /* ANDROID */
4400
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004401 /**
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004402 * vendor_cmd - Execute vendor specific command
4403 * @priv: Private driver interface data
4404 * @vendor_id: Vendor id
4405 * @subcmd: Vendor command id
Hai Shalom60840252021-02-19 19:02:11 -08004406 * @nested_attr_flag: Specifies if vendor subcommand uses nested
4407 * attributes or not
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004408 * @data: Vendor command parameters (%NULL if no parameters)
4409 * @data_len: Data length
4410 * @buf: Return buffer (%NULL to ignore reply)
4411 * Returns: 0 on success, negative (<0) on failure
4412 *
4413 * This function handles vendor specific commands that are passed to
4414 * the driver/device. The command is identified by vendor id and
Hai Shalom60840252021-02-19 19:02:11 -08004415 * command id. The nested_attr_flag specifies whether the subcommand
4416 * uses nested attributes or not. Parameters can be passed
4417 * as argument to the command in the data buffer. Reply (if any) will be
4418 * filled in the supplied return buffer.
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004419 *
4420 * The exact driver behavior is driver interface and vendor specific. As
4421 * an example, this will be converted to a vendor specific cfg80211
4422 * command in case of the nl80211 driver interface.
4423 */
4424 int (*vendor_cmd)(void *priv, unsigned int vendor_id,
4425 unsigned int subcmd, const u8 *data, size_t data_len,
Hai Shalom60840252021-02-19 19:02:11 -08004426 enum nested_attr nested_attr_flag,
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004427 struct wpabuf *buf);
4428
4429 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004430 * set_rekey_info - Set rekey information
4431 * @priv: Private driver interface data
4432 * @kek: Current KEK
Dmitry Shmidt807291d2015-01-27 13:40:23 -08004433 * @kek_len: KEK length in octets
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004434 * @kck: Current KCK
Dmitry Shmidt807291d2015-01-27 13:40:23 -08004435 * @kck_len: KCK length in octets
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004436 * @replay_ctr: Current EAPOL-Key Replay Counter
4437 *
4438 * This optional function can be used to provide information for the
4439 * driver/firmware to process EAPOL-Key frames in Group Key Handshake
4440 * while the host (including wpa_supplicant) is sleeping.
4441 */
Dmitry Shmidt807291d2015-01-27 13:40:23 -08004442 void (*set_rekey_info)(void *priv, const u8 *kek, size_t kek_len,
4443 const u8 *kck, size_t kck_len,
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004444 const u8 *replay_ctr);
4445
4446 /**
4447 * sta_assoc - Station association indication
4448 * @priv: Private driver interface data
4449 * @own_addr: Source address and BSSID for association frame
4450 * @addr: MAC address of the station to associate
4451 * @reassoc: flag to indicate re-association
4452 * @status: association response status code
4453 * @ie: assoc response ie buffer
4454 * @len: ie buffer length
4455 * Returns: 0 on success, -1 on failure
4456 *
4457 * This function indicates the driver to send (Re)Association
4458 * Response frame to the station.
4459 */
4460 int (*sta_assoc)(void *priv, const u8 *own_addr, const u8 *addr,
4461 int reassoc, u16 status, const u8 *ie, size_t len);
4462
4463 /**
4464 * sta_auth - Station authentication indication
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004465 * @priv: private driver interface data
4466 * @params: Station authentication parameters
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004467 *
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004468 * Returns: 0 on success, -1 on failure
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004469 */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004470 int (*sta_auth)(void *priv,
4471 struct wpa_driver_sta_auth_params *params);
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004472
4473 /**
4474 * add_tspec - Add traffic stream
4475 * @priv: Private driver interface data
4476 * @addr: MAC address of the station to associate
4477 * @tspec_ie: tspec ie buffer
4478 * @tspec_ielen: tspec ie length
4479 * Returns: 0 on success, -1 on failure
4480 *
4481 * This function adds the traffic steam for the station
4482 * and fills the medium_time in tspec_ie.
4483 */
4484 int (*add_tspec)(void *priv, const u8 *addr, u8 *tspec_ie,
4485 size_t tspec_ielen);
4486
4487 /**
4488 * add_sta_node - Add a station node in the driver
4489 * @priv: Private driver interface data
4490 * @addr: MAC address of the station to add
4491 * @auth_alg: authentication algorithm used by the station
4492 * Returns: 0 on success, -1 on failure
4493 *
4494 * This function adds the station node in the driver, when
4495 * the station gets added by FT-over-DS.
4496 */
4497 int (*add_sta_node)(void *priv, const u8 *addr, u16 auth_alg);
4498
4499 /**
4500 * sched_scan - Request the driver to initiate scheduled scan
4501 * @priv: Private driver interface data
4502 * @params: Scan parameters
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004503 * Returns: 0 on success, -1 on failure
4504 *
4505 * This operation should be used for scheduled scan offload to
4506 * the hardware. Every time scan results are available, the
4507 * driver should report scan results event for wpa_supplicant
4508 * which will eventually request the results with
4509 * wpa_driver_get_scan_results2(). This operation is optional
4510 * and if not provided or if it returns -1, we fall back to
4511 * normal host-scheduled scans.
4512 */
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08004513 int (*sched_scan)(void *priv, struct wpa_driver_scan_params *params);
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004514
4515 /**
4516 * stop_sched_scan - Request the driver to stop a scheduled scan
4517 * @priv: Private driver interface data
4518 * Returns: 0 on success, -1 on failure
4519 *
4520 * This should cause the scheduled scan to be stopped and
4521 * results should stop being sent. Must be supported if
4522 * sched_scan is supported.
4523 */
4524 int (*stop_sched_scan)(void *priv);
4525
4526 /**
4527 * poll_client - Probe (null data or such) the given station
4528 * @priv: Private driver interface data
4529 * @own_addr: MAC address of sending interface
4530 * @addr: MAC address of the station to probe
4531 * @qos: Indicates whether station is QoS station
4532 *
4533 * This function is used to verify whether an associated station is
4534 * still present. This function does not need to be implemented if the
4535 * driver provides such inactivity polling mechanism.
4536 */
4537 void (*poll_client)(void *priv, const u8 *own_addr,
4538 const u8 *addr, int qos);
Dmitry Shmidt04949592012-07-19 12:16:46 -07004539
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004540 /**
Dmitry Shmidt04949592012-07-19 12:16:46 -07004541 * radio_disable - Disable/enable radio
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004542 * @priv: Private driver interface data
Dmitry Shmidt04949592012-07-19 12:16:46 -07004543 * @disabled: 1=disable 0=enable radio
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004544 * Returns: 0 on success, -1 on failure
4545 *
Dmitry Shmidt04949592012-07-19 12:16:46 -07004546 * This optional command is for testing purposes. It can be used to
4547 * disable the radio on a testbed device to simulate out-of-radio-range
4548 * conditions.
4549 */
4550 int (*radio_disable)(void *priv, int disabled);
4551
4552 /**
4553 * switch_channel - Announce channel switch and migrate the GO to the
4554 * given frequency
4555 * @priv: Private driver interface data
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08004556 * @settings: Settings for CSA period and new channel
Dmitry Shmidt04949592012-07-19 12:16:46 -07004557 * Returns: 0 on success, -1 on failure
4558 *
4559 * This function is used to move the GO to the legacy STA channel to
4560 * avoid frequency conflict in single channel concurrency.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004561 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08004562 int (*switch_channel)(void *priv, struct csa_settings *settings);
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004563
4564 /**
Sunil Ravia04bd252022-05-02 22:54:18 -07004565 * switch_color - Announce color switch and migrate the BSS to the
4566 * given color
4567 * @priv: Private driver interface data
4568 * @settings: Settings for CCA period and new color
4569 * Returns: 0 on success, -1 on failure
4570 *
4571 * This function is used to move the BSS to its new color.
4572 */
4573 int (*switch_color)(void *priv, struct cca_settings *settings);
4574
4575 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004576 * add_tx_ts - Add traffic stream
4577 * @priv: Private driver interface data
4578 * @tsid: Traffic stream ID
4579 * @addr: Receiver address
4580 * @user_prio: User priority of the traffic stream
4581 * @admitted_time: Admitted time for this TS in units of
4582 * 32 microsecond periods (per second).
4583 * Returns: 0 on success, -1 on failure
4584 */
4585 int (*add_tx_ts)(void *priv, u8 tsid, const u8 *addr, u8 user_prio,
4586 u16 admitted_time);
4587
4588 /**
4589 * del_tx_ts - Delete traffic stream
4590 * @priv: Private driver interface data
4591 * @tsid: Traffic stream ID
4592 * @addr: Receiver address
4593 * Returns: 0 on success, -1 on failure
4594 */
4595 int (*del_tx_ts)(void *priv, u8 tsid, const u8 *addr);
4596
4597 /**
4598 * Enable channel-switching with TDLS peer
4599 * @priv: Private driver interface data
4600 * @addr: MAC address of the TDLS peer
4601 * @oper_class: Operating class of the switch channel
4602 * @params: Channel specification
4603 * Returns: 0 on success, -1 on failure
4604 *
4605 * The function indicates to driver that it can start switching to a
4606 * different channel with a specified TDLS peer. The switching is
4607 * assumed on until canceled with tdls_disable_channel_switch().
4608 */
4609 int (*tdls_enable_channel_switch)(
4610 void *priv, const u8 *addr, u8 oper_class,
4611 const struct hostapd_freq_params *params);
4612
4613 /**
4614 * Disable channel switching with TDLS peer
4615 * @priv: Private driver interface data
4616 * @addr: MAC address of the TDLS peer
4617 * Returns: 0 on success, -1 on failure
4618 *
4619 * This function indicates to the driver that it should stop switching
4620 * with a given TDLS peer.
4621 */
4622 int (*tdls_disable_channel_switch)(void *priv, const u8 *addr);
4623
4624 /**
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004625 * start_dfs_cac - Listen for radar interference on the channel
4626 * @priv: Private driver interface data
Dmitry Shmidt051af732013-10-22 13:52:46 -07004627 * @freq: Channel parameters
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004628 * Returns: 0 on success, -1 on failure
4629 */
Dmitry Shmidt051af732013-10-22 13:52:46 -07004630 int (*start_dfs_cac)(void *priv, struct hostapd_freq_params *freq);
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004631
4632 /**
4633 * stop_ap - Removes beacon from AP
4634 * @priv: Private driver interface data
Sunil Ravi99c035e2024-07-12 01:42:03 +00004635 * @link_id: Link ID of the specified link; -1 for non-MLD
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004636 * Returns: 0 on success, -1 on failure (or if not supported)
4637 *
4638 * This optional function can be used to disable AP mode related
4639 * configuration. Unlike deinit_ap, it does not change to station
4640 * mode.
4641 */
Sunil Ravi99c035e2024-07-12 01:42:03 +00004642 int (*stop_ap)(void *priv, int link_id);
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07004643
4644 /**
4645 * get_survey - Retrieve survey data
4646 * @priv: Private driver interface data
4647 * @freq: If set, survey data for the specified frequency is only
4648 * being requested. If not set, all survey data is requested.
4649 * Returns: 0 on success, -1 on failure
4650 *
4651 * Use this to retrieve:
4652 *
4653 * - the observed channel noise floor
4654 * - the amount of time we have spent on the channel
4655 * - the amount of time during which we have spent on the channel that
4656 * the radio has determined the medium is busy and we cannot
4657 * transmit
4658 * - the amount of time we have spent receiving data
4659 * - the amount of time we have spent transmitting data
4660 *
4661 * This data can be used for spectrum heuristics. One example is
4662 * Automatic Channel Selection (ACS). The channel survey data is
4663 * kept on a linked list on the channel data, one entry is added
4664 * for each survey. The min_nf of the channel is updated for each
4665 * survey.
4666 */
4667 int (*get_survey)(void *priv, unsigned int freq);
Dmitry Shmidt56052862013-10-04 10:23:25 -07004668
4669 /**
4670 * status - Get driver interface status information
4671 * @priv: Private driver interface data
Hai Shalom74f70d42019-02-11 14:42:39 -08004672 * @buf: Buffer for printing the status information
Dmitry Shmidt56052862013-10-04 10:23:25 -07004673 * @buflen: Maximum length of the buffer
4674 * Returns: Length of written status information or -1 on failure
4675 */
4676 int (*status)(void *priv, char *buf, size_t buflen);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004677
Dmitry Shmidt661b4f72014-09-29 14:58:27 -07004678 /**
4679 * roaming - Set roaming policy for driver-based BSS selection
4680 * @priv: Private driver interface data
4681 * @allowed: Whether roaming within ESS is allowed
4682 * @bssid: Forced BSSID if roaming is disabled or %NULL if not set
4683 * Returns: Length of written status information or -1 on failure
4684 *
4685 * This optional callback can be used to update roaming policy from the
4686 * associate() command (bssid being set there indicates that the driver
4687 * should not roam before getting this roaming() call to allow roaming.
4688 * If the driver does not indicate WPA_DRIVER_FLAGS_BSS_SELECTION
4689 * capability, roaming policy is handled within wpa_supplicant and there
4690 * is no need to implement or react to this callback.
4691 */
4692 int (*roaming)(void *priv, int allowed, const u8 *bssid);
4693
4694 /**
Roshan Pius3a1667e2018-07-03 15:17:14 -07004695 * disable_fils - Enable/disable FILS feature
4696 * @priv: Private driver interface data
4697 * @disable: 0-enable and 1-disable FILS feature
4698 * Returns: 0 on success, -1 on failure
4699 *
4700 * This callback can be used to configure driver and below layers to
4701 * enable/disable all FILS features.
4702 */
4703 int (*disable_fils)(void *priv, int disable);
4704
4705 /**
Dmitry Shmidt661b4f72014-09-29 14:58:27 -07004706 * set_mac_addr - Set MAC address
4707 * @priv: Private driver interface data
4708 * @addr: MAC address to use or %NULL for setting back to permanent
4709 * Returns: 0 on success, -1 on failure
4710 */
4711 int (*set_mac_addr)(void *priv, const u8 *addr);
4712
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004713#ifdef CONFIG_MACSEC
4714 int (*macsec_init)(void *priv, struct macsec_init_params *params);
4715
4716 int (*macsec_deinit)(void *priv);
4717
4718 /**
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004719 * macsec_get_capability - Inform MKA of this driver's capability
4720 * @priv: Private driver interface data
4721 * @cap: Driver's capability
4722 * Returns: 0 on success, -1 on failure
4723 */
4724 int (*macsec_get_capability)(void *priv, enum macsec_cap *cap);
4725
4726 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004727 * enable_protect_frames - Set protect frames status
4728 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004729 * @enabled: true = protect frames enabled
4730 * false = protect frames disabled
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004731 * Returns: 0 on success, -1 on failure (or if not supported)
4732 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004733 int (*enable_protect_frames)(void *priv, bool enabled);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004734
4735 /**
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004736 * enable_encrypt - Set encryption status
4737 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004738 * @enabled: true = encrypt outgoing traffic
4739 * false = integrity-only protection on outgoing traffic
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004740 * Returns: 0 on success, -1 on failure (or if not supported)
4741 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004742 int (*enable_encrypt)(void *priv, bool enabled);
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004743
4744 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004745 * set_replay_protect - Set replay protect status and window size
4746 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004747 * @enabled: true = replay protect enabled
4748 * false = replay protect disabled
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004749 * @window: replay window size, valid only when replay protect enabled
4750 * Returns: 0 on success, -1 on failure (or if not supported)
4751 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004752 int (*set_replay_protect)(void *priv, bool enabled, u32 window);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004753
4754 /**
Sunil Ravi036cec52023-03-29 11:35:17 -07004755 * set_offload - Set MACsec hardware offload
4756 * @priv: Private driver interface data
4757 * @offload: 0 = MACSEC_OFFLOAD_OFF
4758 * 1 = MACSEC_OFFLOAD_PHY
4759 * 2 = MACSEC_OFFLOAD_MAC
4760 * Returns: 0 on success, -1 on failure (or if not supported)
4761 */
4762 int (*set_offload)(void *priv, u8 offload);
4763
4764 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004765 * set_current_cipher_suite - Set current cipher suite
4766 * @priv: Private driver interface data
4767 * @cs: EUI64 identifier
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004768 * Returns: 0 on success, -1 on failure (or if not supported)
4769 */
Dmitry Shmidt7d175302016-09-06 13:11:34 -07004770 int (*set_current_cipher_suite)(void *priv, u64 cs);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004771
4772 /**
4773 * enable_controlled_port - Set controlled port status
4774 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004775 * @enabled: true = controlled port enabled
4776 * false = controlled port disabled
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004777 * Returns: 0 on success, -1 on failure (or if not supported)
4778 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004779 int (*enable_controlled_port)(void *priv, bool enabled);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004780
4781 /**
4782 * get_receive_lowest_pn - Get receive lowest pn
4783 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004784 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004785 * Returns: 0 on success, -1 on failure (or if not supported)
4786 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004787 int (*get_receive_lowest_pn)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004788
4789 /**
4790 * get_transmit_next_pn - Get transmit next pn
4791 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004792 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004793 * Returns: 0 on success, -1 on failure (or if not supported)
4794 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004795 int (*get_transmit_next_pn)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004796
4797 /**
4798 * set_transmit_next_pn - Set transmit next pn
4799 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004800 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004801 * Returns: 0 on success, -1 on failure (or if not supported)
4802 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004803 int (*set_transmit_next_pn)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004804
4805 /**
Hai Shalom74f70d42019-02-11 14:42:39 -08004806 * set_receive_lowest_pn - Set receive lowest PN
4807 * @priv: Private driver interface data
4808 * @sa: secure association
4809 * Returns: 0 on success, -1 on failure (or if not supported)
4810 */
4811 int (*set_receive_lowest_pn)(void *priv, struct receive_sa *sa);
4812
4813 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004814 * create_receive_sc - create secure channel for receiving
4815 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004816 * @sc: secure channel
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004817 * @conf_offset: confidentiality offset (0, 30, or 50)
4818 * @validation: frame validation policy (0 = Disabled, 1 = Checked,
4819 * 2 = Strict)
4820 * Returns: 0 on success, -1 on failure (or if not supported)
4821 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004822 int (*create_receive_sc)(void *priv, struct receive_sc *sc,
4823 unsigned int conf_offset,
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004824 int validation);
4825
4826 /**
4827 * delete_receive_sc - delete secure connection for receiving
4828 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004829 * @sc: secure channel
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004830 * Returns: 0 on success, -1 on failure
4831 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004832 int (*delete_receive_sc)(void *priv, struct receive_sc *sc);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004833
4834 /**
4835 * create_receive_sa - create secure association for receive
4836 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004837 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004838 * Returns: 0 on success, -1 on failure
4839 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004840 int (*create_receive_sa)(void *priv, struct receive_sa *sa);
4841
4842 /**
4843 * delete_receive_sa - Delete secure association for receive
4844 * @priv: Private driver interface data from init()
4845 * @sa: Secure association
4846 * Returns: 0 on success, -1 on failure
4847 */
4848 int (*delete_receive_sa)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004849
4850 /**
4851 * enable_receive_sa - enable the SA for receive
4852 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004853 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004854 * Returns: 0 on success, -1 on failure
4855 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004856 int (*enable_receive_sa)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004857
4858 /**
4859 * disable_receive_sa - disable SA for receive
4860 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004861 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004862 * Returns: 0 on success, -1 on failure
4863 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004864 int (*disable_receive_sa)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004865
4866 /**
4867 * create_transmit_sc - create secure connection for transmit
4868 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004869 * @sc: secure channel
4870 * @conf_offset: confidentiality offset (0, 30, or 50)
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004871 * Returns: 0 on success, -1 on failure
4872 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004873 int (*create_transmit_sc)(void *priv, struct transmit_sc *sc,
4874 unsigned int conf_offset);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004875
4876 /**
4877 * delete_transmit_sc - delete secure connection for transmit
4878 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004879 * @sc: secure channel
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004880 * Returns: 0 on success, -1 on failure
4881 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004882 int (*delete_transmit_sc)(void *priv, struct transmit_sc *sc);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004883
4884 /**
4885 * create_transmit_sa - create secure association for transmit
4886 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004887 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004888 * Returns: 0 on success, -1 on failure
4889 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004890 int (*create_transmit_sa)(void *priv, struct transmit_sa *sa);
4891
4892 /**
4893 * delete_transmit_sa - Delete secure association for transmit
4894 * @priv: Private driver interface data from init()
4895 * @sa: Secure association
4896 * Returns: 0 on success, -1 on failure
4897 */
4898 int (*delete_transmit_sa)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004899
4900 /**
4901 * enable_transmit_sa - enable SA for transmit
4902 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004903 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004904 * Returns: 0 on success, -1 on failure
4905 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004906 int (*enable_transmit_sa)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004907
4908 /**
4909 * disable_transmit_sa - disable SA for transmit
4910 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004911 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004912 * Returns: 0 on success, -1 on failure
4913 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004914 int (*disable_transmit_sa)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004915#endif /* CONFIG_MACSEC */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004916
4917 /**
4918 * init_mesh - Driver specific initialization for mesh
4919 * @priv: Private driver interface data
4920 * Returns: 0 on success, -1 on failure
4921 */
4922 int (*init_mesh)(void *priv);
4923
4924 /**
4925 * join_mesh - Join a mesh network
4926 * @priv: Private driver interface data
4927 * @params: Mesh configuration parameters
4928 * Returns: 0 on success, -1 on failure
4929 */
4930 int (*join_mesh)(void *priv,
4931 struct wpa_driver_mesh_join_params *params);
4932
4933 /**
4934 * leave_mesh - Leave a mesh network
4935 * @priv: Private driver interface data
4936 * Returns 0 on success, -1 on failure
4937 */
4938 int (*leave_mesh)(void *priv);
4939
4940 /**
Hai Shalom81f62d82019-07-22 12:10:00 -07004941 * probe_mesh_link - Inject a frame over direct mesh link to a given
4942 * peer skipping the next_hop lookup from mpath table.
4943 * @priv: Private driver interface data
4944 * @addr: Peer MAC address
4945 * @eth: Ethernet frame to be sent
4946 * @len: Ethernet frame lengtn in bytes
4947 * Returns 0 on success, -1 on failure
4948 */
4949 int (*probe_mesh_link)(void *priv, const u8 *addr, const u8 *eth,
4950 size_t len);
4951
4952 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004953 * do_acs - Automatically select channel
4954 * @priv: Private driver interface data
4955 * @params: Parameters for ACS
4956 * Returns 0 on success, -1 on failure
4957 *
4958 * This command can be used to offload ACS to the driver if the driver
4959 * indicates support for such offloading (WPA_DRIVER_FLAGS_ACS_OFFLOAD).
4960 */
4961 int (*do_acs)(void *priv, struct drv_acs_params *params);
Ravi Joshie6ccb162015-07-16 17:45:41 -07004962
4963 /**
Hai Shalom60840252021-02-19 19:02:11 -08004964 * set_band - Notify driver of band(s) selection
Ravi Joshie6ccb162015-07-16 17:45:41 -07004965 * @priv: Private driver interface data
Hai Shalom60840252021-02-19 19:02:11 -08004966 * @band_mask: The selected band(s) bit mask (from enum set_band)
Ravi Joshie6ccb162015-07-16 17:45:41 -07004967 * Returns 0 on success, -1 on failure
4968 */
Hai Shalom60840252021-02-19 19:02:11 -08004969 int (*set_band)(void *priv, u32 band_mask);
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08004970
4971 /**
4972 * get_pref_freq_list - Get preferred frequency list for an interface
4973 * @priv: Private driver interface data
4974 * @if_type: Interface type
4975 * @num: Number of channels
Sunil8cd6f4d2022-06-28 18:40:46 +00004976 * @freq_list: Weighted preferred channel list
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08004977 * Returns 0 on success, -1 on failure
4978 *
4979 * This command can be used to query the preferred frequency list from
Sunil8cd6f4d2022-06-28 18:40:46 +00004980 * the driver specific to a particular interface type. The freq_list
4981 * array needs to have room for *num entries. *num will be updated to
4982 * indicate the number of entries fetched from the driver.
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08004983 */
4984 int (*get_pref_freq_list)(void *priv, enum wpa_driver_if_type if_type,
Sunil8cd6f4d2022-06-28 18:40:46 +00004985 unsigned int *num,
4986 struct weighted_pcl *freq_list);
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08004987
4988 /**
4989 * set_prob_oper_freq - Indicate probable P2P operating channel
4990 * @priv: Private driver interface data
4991 * @freq: Channel frequency in MHz
4992 * Returns 0 on success, -1 on failure
4993 *
4994 * This command can be used to inform the driver of the operating
4995 * frequency that an ongoing P2P group formation is likely to come up
4996 * on. Local device is assuming P2P Client role.
4997 */
4998 int (*set_prob_oper_freq)(void *priv, unsigned int freq);
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08004999
5000 /**
5001 * abort_scan - Request the driver to abort an ongoing scan
5002 * @priv: Private driver interface data
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08005003 * @scan_cookie: Cookie identifying the scan request. This is used only
5004 * when the vendor interface QCA_NL80211_VENDOR_SUBCMD_TRIGGER_SCAN
5005 * was used to trigger scan. Otherwise, 0 is used.
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08005006 * Returns 0 on success, -1 on failure
5007 */
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08005008 int (*abort_scan)(void *priv, u64 scan_cookie);
Dmitry Shmidt849734c2016-05-27 09:59:01 -07005009
5010 /**
5011 * configure_data_frame_filters - Request to configure frame filters
5012 * @priv: Private driver interface data
5013 * @filter_flags: The type of frames to filter (bitfield of
5014 * WPA_DATA_FRAME_FILTER_FLAG_*)
5015 * Returns: 0 on success or -1 on failure
5016 */
5017 int (*configure_data_frame_filters)(void *priv, u32 filter_flags);
Dmitry Shmidtd5ab1b52016-06-21 12:38:41 -07005018
5019 /**
5020 * get_ext_capab - Get extended capabilities for the specified interface
5021 * @priv: Private driver interface data
5022 * @type: Interface type for which to get extended capabilities
5023 * @ext_capab: Extended capabilities fetched
5024 * @ext_capab_mask: Extended capabilities mask
5025 * @ext_capab_len: Length of the extended capabilities
5026 * Returns: 0 on success or -1 on failure
5027 */
5028 int (*get_ext_capab)(void *priv, enum wpa_driver_if_type type,
5029 const u8 **ext_capab, const u8 **ext_capab_mask,
5030 unsigned int *ext_capab_len);
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07005031
5032 /**
Sunil Ravi2a14cf12023-11-21 00:54:38 +00005033 * get_mld_capab - Get MLD capabilities for the specified interface
5034 * @priv: Private driver interface data
5035 * @type: Interface type for which to get MLD capabilities
5036 * @eml_capa: EML capabilities
5037 * @mld_capa_and_ops: MLD Capabilities and Operations
5038 * Returns: 0 on success or -1 on failure
5039 */
5040 int (*get_mld_capab)(void *priv, enum wpa_driver_if_type type,
5041 u16 *eml_capa, u16 *mld_capa_and_ops);
5042
5043 /**
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07005044 * p2p_lo_start - Start offloading P2P listen to device
5045 * @priv: Private driver interface data
5046 * @freq: Listening frequency (MHz) for P2P listen
5047 * @period: Length of the listen operation in milliseconds
5048 * @interval: Interval for running the listen operation in milliseconds
5049 * @count: Number of times to run the listen operation
5050 * @device_types: Device primary and secondary types
5051 * @dev_types_len: Number of bytes for device_types
5052 * @ies: P2P IE and WSC IE for Probe Response frames
5053 * @ies_len: Length of ies in bytes
5054 * Returns: 0 on success or -1 on failure
5055 */
5056 int (*p2p_lo_start)(void *priv, unsigned int freq,
5057 unsigned int period, unsigned int interval,
5058 unsigned int count,
5059 const u8 *device_types, size_t dev_types_len,
5060 const u8 *ies, size_t ies_len);
5061
5062 /**
5063 * p2p_lo_stop - Stop P2P listen offload
5064 * @priv: Private driver interface data
5065 * Returns: 0 on success or -1 on failure
5066 */
5067 int (*p2p_lo_stop)(void *priv);
Dmitry Shmidt7f2c7532016-08-15 09:48:12 -07005068
5069 /**
5070 * set_default_scan_ies - Set default scan IEs
5071 * @priv: Private driver interface data
5072 * @ies: Scan default IEs buffer
5073 * @ies_len: Length of IEs in bytes
5074 * Returns: 0 on success or -1 on failure
5075 *
5076 * The driver can use these by default when there are no scan IEs coming
5077 * in the subsequent scan requests. Also in case of one or more of IEs
5078 * given in set_default_scan_ies() are missing in the subsequent scan
5079 * request, the driver should merge the missing scan IEs in the scan
5080 * request from the IEs set by set_default_scan_ies() in the Probe
5081 * Request frames sent.
5082 */
5083 int (*set_default_scan_ies)(void *priv, const u8 *ies, size_t ies_len);
5084
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08005085 /**
5086 * set_tdls_mode - Set TDLS trigger mode to the host driver
5087 * @priv: Private driver interface data
5088 * @tdls_external_control: Represents if TDLS external trigger control
5089 * mode is enabled/disabled.
5090 *
5091 * This optional callback can be used to configure the TDLS external
5092 * trigger control mode to the host driver.
5093 */
5094 int (*set_tdls_mode)(void *priv, int tdls_external_control);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005095
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005096 /**
5097 * get_bss_transition_status - Get candidate BSS's transition status
5098 * @priv: Private driver interface data
5099 * @params: Candidate BSS list
5100 *
5101 * Get the accept or reject reason code for a list of BSS transition
5102 * candidates.
5103 */
5104 struct wpa_bss_candidate_info *
5105 (*get_bss_transition_status)(void *priv,
5106 struct wpa_bss_trans_info *params);
5107 /**
5108 * ignore_assoc_disallow - Configure driver to ignore assoc_disallow
5109 * @priv: Private driver interface data
5110 * @ignore_disallow: 0 to not ignore, 1 to ignore
5111 * Returns: 0 on success, -1 on failure
5112 */
5113 int (*ignore_assoc_disallow)(void *priv, int ignore_disallow);
5114
5115 /**
Hai Shalom899fcc72020-10-19 14:38:18 -07005116 * set_bssid_tmp_disallow - Set disallowed BSSIDs to the driver
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005117 * @priv: Private driver interface data
Hai Shalom899fcc72020-10-19 14:38:18 -07005118 * @num_bssid: Number of temporarily disallowed BSSIDs
5119 * @bssids: List of temporarily disallowed BSSIDs
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005120 */
Hai Shalom899fcc72020-10-19 14:38:18 -07005121 int (*set_bssid_tmp_disallow)(void *priv, unsigned int num_bssid,
5122 const u8 *bssid);
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005123
5124 /**
5125 * update_connect_params - Update the connection parameters
5126 * @priv: Private driver interface data
5127 * @params: Association parameters
5128 * @mask: Bit mask indicating which parameters in @params have to be
5129 * updated
5130 * Returns: 0 on success, -1 on failure
5131 *
5132 * Update the connection parameters when in connected state so that the
5133 * driver uses the updated parameters for subsequent roaming. This is
5134 * used only with drivers that implement internal BSS selection and
5135 * roaming.
5136 */
5137 int (*update_connect_params)(
5138 void *priv, struct wpa_driver_associate_params *params,
5139 enum wpa_drv_update_connect_params_mask mask);
Roshan Pius3a1667e2018-07-03 15:17:14 -07005140
5141 /**
5142 * send_external_auth_status - Indicate the status of external
5143 * authentication processing to the host driver.
5144 * @priv: Private driver interface data
5145 * @params: Status of authentication processing.
5146 * Returns: 0 on success, -1 on failure
5147 */
5148 int (*send_external_auth_status)(void *priv,
5149 struct external_auth *params);
Hai Shalom74f70d42019-02-11 14:42:39 -08005150
5151 /**
5152 * set_4addr_mode - Set 4-address mode
5153 * @priv: Private driver interface data
5154 * @bridge_ifname: Bridge interface name
5155 * @val: 0 - disable 4addr mode, 1 - enable 4addr mode
5156 * Returns: 0 on success, < 0 on failure
5157 */
5158 int (*set_4addr_mode)(void *priv, const char *bridge_ifname, int val);
Hai Shalom81f62d82019-07-22 12:10:00 -07005159
5160 /**
5161 * update_dh_ie - Update DH IE
5162 * @priv: Private driver interface data
5163 * @peer_mac: Peer MAC address
5164 * @reason_code: Reacon code
5165 * @ie: DH IE
5166 * @ie_len: DH IE length in bytes
5167 * Returns: 0 on success, -1 on failure
5168 *
5169 * This callback is used to let the driver know the DH processing result
5170 * and DH IE for a pending association.
5171 */
5172 int (*update_dh_ie)(void *priv, const u8 *peer_mac, u16 reason_code,
5173 const u8 *ie, size_t ie_len);
Hai Shalomb755a2a2020-04-23 21:49:02 -07005174
5175 /**
5176 * dpp_listen - Notify driver about start/stop of DPP listen
5177 * @priv: Private driver interface data
5178 * @enable: Whether listen state is enabled (or disabled)
5179 * Returns: 0 on success, -1 on failure
5180 *
5181 * This optional callback can be used to update RX frame filtering to
5182 * explicitly allow reception of broadcast Public Action frames.
5183 */
Hai Shalome21d4e82020-04-29 16:34:06 -07005184 int (*dpp_listen)(void *priv, bool enable);
Hai Shalomc1a21442022-02-04 13:43:00 -08005185
Sunil Ravi89eba102022-09-13 21:04:37 -07005186 /**
5187 * set_secure_ranging_ctx - Add or delete secure ranging parameters of
5188 * the specified peer to the driver.
5189 * @priv: Private driver interface data
5190 * @params: Secure ranging parameters
5191 * Returns: 0 on success, -1 on failure
5192 *
5193 */
5194 int (*set_secure_ranging_ctx)(void *priv,
5195 struct secure_ranging_params *params);
5196
5197 /**
5198 * send_pasn_resp - Send PASN response for a set of peers to the
5199 * driver.
5200 * @priv: Private driver interface data
5201 * @params: Parameters holding peers and respective status.
5202 * Returns: 0 on success, -1 on failure
5203 */
5204 int (*send_pasn_resp)(void *priv, struct pasn_auth *params);
5205
5206 /**
5207 * get_sta_mlo_info - Get the current multi-link association info
5208 * @priv: Private driver interface data
5209 * @mlo: Pointer to fill multi-link association info
5210 * Returns: 0 on success, -1 on failure
5211 *
5212 * This callback is used to fetch multi-link of the current association.
5213 */
5214 int (*get_sta_mlo_info)(void *priv,
5215 struct driver_sta_mlo_info *mlo_info);
5216
Sunil Ravi036cec52023-03-29 11:35:17 -07005217 /**
5218 * link_add - Add a link to the AP MLD interface
5219 * @priv: Private driver interface data
5220 * @link_id: The link ID
5221 * @addr: The MAC address to use for the link
Sunil Ravi99c035e2024-07-12 01:42:03 +00005222 * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces
Sunil Ravi036cec52023-03-29 11:35:17 -07005223 * Returns: 0 on success, negative value on failure
5224 */
Sunil Ravi99c035e2024-07-12 01:42:03 +00005225 int (*link_add)(void *priv, u8 link_id, const u8 *addr, void *bss_ctx);
5226
5227 /**
5228 * link_remove - Remove a link from the AP MLD interface
5229 * @priv: Private driver interface data
5230 * @type: Interface type
5231 * @ifname: Interface name of the virtual interface from where the link
5232 * is to be removed.
5233 * @link_id: Valid link ID to remove
5234 * Returns: 0 on success, -1 on failure
5235 */
5236 int (*link_remove)(void *priv, enum wpa_driver_if_type type,
5237 const char *ifname, u8 link_id);
5238
5239 /**
5240 * is_drv_shared - Check whether the driver interface is shared
5241 * @priv: Private driver interface data from init()
Sunil Ravic0f5d412024-09-11 22:12:49 +00005242 * @link_id: Link ID to match
5243 * Returns: true if it is being used or else false.
Sunil Ravi99c035e2024-07-12 01:42:03 +00005244 *
5245 * Checks whether the driver interface is being used by other partner
5246 * BSS(s) or not. This is used to decide whether the driver interface
5247 * needs to be deinitilized when one interface is getting deinitialized.
5248 *
Sunil Ravic0f5d412024-09-11 22:12:49 +00005249 * NOTE: @link_id will be used only when there is only one BSS
5250 * present and if that single link is active. In that case, the
5251 * link ID is matched with the active link_id to decide whether the
5252 * driver interface is being used by other partner BSS(s).
Sunil Ravi99c035e2024-07-12 01:42:03 +00005253 */
Sunil Ravic0f5d412024-09-11 22:12:49 +00005254 bool (*is_drv_shared)(void *priv, int link_id);
Sunil Ravi99c035e2024-07-12 01:42:03 +00005255
5256 /**
5257 * link_sta_remove - Remove a link STA from an MLD STA
5258 * @priv: Private driver interface data
5259 * @link_id: The link ID which the link STA is using
5260 * @addr: The MLD MAC address of the MLD STA
5261 * Returns: 0 on success, negative value on failure
5262 */
5263 int (*link_sta_remove)(void *priv, u8 link_id, const u8 *addr);
Sunil Ravi036cec52023-03-29 11:35:17 -07005264
Sunil Ravic0f5d412024-09-11 22:12:49 +00005265 /**
5266 * nan_flush - Flush all NAN offload services
5267 * @priv: Private driver interface data
5268 * Returns: 0 on success, negative value on failure
5269 */
5270 int (*nan_flush)(void *priv);
5271
5272 /**
5273 * nan_publish - NAN offload for Publish()
5274 * @priv: Private driver interface data
5275 * @src: Source P2P device addr
5276 * @publish_id: Publish instance to add
5277 * @service_name: Service name
5278 * @service_id: Service ID (6 octet value derived from service name)
5279 * @srv_proto_type: Service protocol type
5280 * @ssi: Service specific information or %NULL
5281 * @elems: Information elements for Element Container attribute or %NULL
5282 * @params: Configuration parameters
5283 * Returns: 0 on success, negative value on failure
5284 */
5285 int (*nan_publish)(void *priv, const u8 *src, int publish_id,
5286 const char *service_name, const u8 *service_id,
5287 enum nan_service_protocol_type srv_proto_type,
5288 const struct wpabuf *ssi, const struct wpabuf *elems,
5289 struct nan_publish_params *params);
5290
5291 /**
5292 * nan_cancel_publish - NAN offload for CancelPublish()
5293 * @priv: Private driver interface data
5294 * @publish_id: Publish instance to cancel
5295 * Returns: 0 on success, negative value on failure
5296 */
5297 int (*nan_cancel_publish)(void *priv, int publish_id);
5298
5299 /**
5300 * nan_update_publish - NAN offload for UpdatePublish()
5301 * @priv: Private driver interface data
5302 * @ssi: Service specific information or %NULL
5303 * Returns: 0 on success, negative value on failure
5304 */
5305 int (*nan_update_publish)(void *priv, int publish_id,
5306 const struct wpabuf *ssi);
5307
5308 /**
5309 * nan_subscribe - NAN offload for Subscribe()
5310 * @priv: Private driver interface data
5311 * @src: Source P2P device addr
5312 * @subscribe_id: Subscribe instance to add
5313 * @service_name: Service name
5314 * @service_id: Service ID (6 octet value derived from service name)
5315 * @srv_proto_type: Service protocol type
5316 * @ssi: Service specific information or %NULL
5317 * @elems: Information elements for Element Container attribute or %NULL
5318 * @params: Configuration parameters
5319 * Returns: 0 on success, negative value on failure
5320 */
5321 int (*nan_subscribe)(void *priv, const u8 *src, int subscribe_id,
5322 const char *service_name, const u8 *service_id,
5323 enum nan_service_protocol_type srv_proto_type,
5324 const struct wpabuf *ssi,
5325 const struct wpabuf *elems,
5326 struct nan_subscribe_params *params);
5327
5328 /**
5329 * nan_cancel_subscribe - NAN offload for CancelSubscribe()
5330 * @priv: Private driver interface data
5331 * @subscribe_id: Subscribe instance to cancel
5332 * Returns: 0 on success, negative value on failure
5333 */
5334 int (*nan_cancel_subscribe)(void *priv, int subscribe_id);
5335
Hai Shalomc1a21442022-02-04 13:43:00 -08005336#ifdef CONFIG_TESTING_OPTIONS
5337 int (*register_frame)(void *priv, u16 type,
5338 const u8 *match, size_t match_len,
5339 bool multicast);
5340#endif /* CONFIG_TESTING_OPTIONS */
Sunil Ravic0f5d412024-09-11 22:12:49 +00005341
5342 /**
5343 * get_multi_hw_info - Get multiple underlying hardware information
5344 * (hardware IDx and supported frequency range)
5345 * @priv: Private driver interface data
5346 * @num_multi_hws: Variable for returning the number of returned
5347 * hardware info data
5348 * Returns: Pointer to allocated multiple hardware data on success
5349 * or %NULL on failure. Caller is responsible for freeing this.
5350 */
5351 struct hostapd_multi_hw_info *
5352 (*get_multi_hw_info)(void *priv, unsigned int *num_multi_hws);
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005353};
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005354
5355/**
5356 * enum wpa_event_type - Event type for wpa_supplicant_event() calls
5357 */
5358enum wpa_event_type {
5359 /**
5360 * EVENT_ASSOC - Association completed
5361 *
5362 * This event needs to be delivered when the driver completes IEEE
5363 * 802.11 association or reassociation successfully.
5364 * wpa_driver_ops::get_bssid() is expected to provide the current BSSID
5365 * after this event has been generated. In addition, optional
5366 * EVENT_ASSOCINFO may be generated just before EVENT_ASSOC to provide
5367 * more information about the association. If the driver interface gets
5368 * both of these events at the same time, it can also include the
5369 * assoc_info data in EVENT_ASSOC call.
5370 */
5371 EVENT_ASSOC,
5372
5373 /**
5374 * EVENT_DISASSOC - Association lost
5375 *
5376 * This event should be called when association is lost either due to
5377 * receiving deauthenticate or disassociate frame from the AP or when
5378 * sending either of these frames to the current AP. If the driver
5379 * supports separate deauthentication event, EVENT_DISASSOC should only
5380 * be used for disassociation and EVENT_DEAUTH for deauthentication.
5381 * In AP mode, union wpa_event_data::disassoc_info is required.
5382 */
5383 EVENT_DISASSOC,
5384
5385 /**
5386 * EVENT_MICHAEL_MIC_FAILURE - Michael MIC (TKIP) detected
5387 *
5388 * This event must be delivered when a Michael MIC error is detected by
5389 * the local driver. Additional data for event processing is
5390 * provided with union wpa_event_data::michael_mic_failure. This
Sunil Ravia04bd252022-05-02 22:54:18 -07005391 * information is used to request new encryption key and to initiate
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005392 * TKIP countermeasures if needed.
5393 */
5394 EVENT_MICHAEL_MIC_FAILURE,
5395
5396 /**
5397 * EVENT_SCAN_RESULTS - Scan results available
5398 *
5399 * This event must be called whenever scan results are available to be
5400 * fetched with struct wpa_driver_ops::get_scan_results(). This event
5401 * is expected to be used some time after struct wpa_driver_ops::scan()
5402 * is called. If the driver provides an unsolicited event when the scan
5403 * has been completed, this event can be used to trigger
5404 * EVENT_SCAN_RESULTS call. If such event is not available from the
5405 * driver, the driver wrapper code is expected to use a registered
5406 * timeout to generate EVENT_SCAN_RESULTS call after the time that the
5407 * scan is expected to be completed. Optional information about
5408 * completed scan can be provided with union wpa_event_data::scan_info.
5409 */
5410 EVENT_SCAN_RESULTS,
5411
5412 /**
5413 * EVENT_ASSOCINFO - Report optional extra information for association
5414 *
5415 * This event can be used to report extra association information for
5416 * EVENT_ASSOC processing. This extra information includes IEs from
5417 * association frames and Beacon/Probe Response frames in union
5418 * wpa_event_data::assoc_info. EVENT_ASSOCINFO must be send just before
5419 * EVENT_ASSOC. Alternatively, the driver interface can include
5420 * assoc_info data in the EVENT_ASSOC call if it has all the
5421 * information available at the same point.
5422 */
5423 EVENT_ASSOCINFO,
5424
5425 /**
5426 * EVENT_INTERFACE_STATUS - Report interface status changes
5427 *
5428 * This optional event can be used to report changes in interface
5429 * status (interface added/removed) using union
5430 * wpa_event_data::interface_status. This can be used to trigger
5431 * wpa_supplicant to stop and re-start processing for the interface,
5432 * e.g., when a cardbus card is ejected/inserted.
5433 */
5434 EVENT_INTERFACE_STATUS,
5435
5436 /**
5437 * EVENT_PMKID_CANDIDATE - Report a candidate AP for pre-authentication
5438 *
5439 * This event can be used to inform wpa_supplicant about candidates for
5440 * RSN (WPA2) pre-authentication. If wpa_supplicant is not responsible
5441 * for scan request (ap_scan=2 mode), this event is required for
5442 * pre-authentication. If wpa_supplicant is performing scan request
5443 * (ap_scan=1), this event is optional since scan results can be used
5444 * to add pre-authentication candidates. union
5445 * wpa_event_data::pmkid_candidate is used to report the BSSID of the
5446 * candidate and priority of the candidate, e.g., based on the signal
5447 * strength, in order to try to pre-authenticate first with candidates
5448 * that are most likely targets for re-association.
5449 *
5450 * EVENT_PMKID_CANDIDATE can be called whenever the driver has updates
5451 * on the candidate list. In addition, it can be called for the current
5452 * AP and APs that have existing PMKSA cache entries. wpa_supplicant
5453 * will automatically skip pre-authentication in cases where a valid
5454 * PMKSA exists. When more than one candidate exists, this event should
5455 * be generated once for each candidate.
5456 *
5457 * Driver will be notified about successful pre-authentication with
5458 * struct wpa_driver_ops::add_pmkid() calls.
5459 */
5460 EVENT_PMKID_CANDIDATE,
5461
5462 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005463 * EVENT_TDLS - Request TDLS operation
5464 *
5465 * This event can be used to request a TDLS operation to be performed.
5466 */
5467 EVENT_TDLS,
5468
5469 /**
5470 * EVENT_FT_RESPONSE - Report FT (IEEE 802.11r) response IEs
5471 *
5472 * The driver is expected to report the received FT IEs from
5473 * FT authentication sequence from the AP. The FT IEs are included in
5474 * the extra information in union wpa_event_data::ft_ies.
5475 */
5476 EVENT_FT_RESPONSE,
5477
5478 /**
5479 * EVENT_IBSS_RSN_START - Request RSN authentication in IBSS
5480 *
5481 * The driver can use this event to inform wpa_supplicant about a STA
5482 * in an IBSS with which protected frames could be exchanged. This
5483 * event starts RSN authentication with the other STA to authenticate
5484 * the STA and set up encryption keys with it.
5485 */
5486 EVENT_IBSS_RSN_START,
5487
5488 /**
5489 * EVENT_AUTH - Authentication result
5490 *
5491 * This event should be called when authentication attempt has been
5492 * completed. This is only used if the driver supports separate
5493 * authentication step (struct wpa_driver_ops::authenticate).
5494 * Information about authentication result is included in
5495 * union wpa_event_data::auth.
5496 */
5497 EVENT_AUTH,
5498
5499 /**
5500 * EVENT_DEAUTH - Authentication lost
5501 *
5502 * This event should be called when authentication is lost either due
5503 * to receiving deauthenticate frame from the AP or when sending that
5504 * frame to the current AP.
5505 * In AP mode, union wpa_event_data::deauth_info is required.
5506 */
5507 EVENT_DEAUTH,
5508
5509 /**
5510 * EVENT_ASSOC_REJECT - Association rejected
5511 *
5512 * This event should be called when (re)association attempt has been
5513 * rejected by the AP. Information about the association response is
5514 * included in union wpa_event_data::assoc_reject.
5515 */
5516 EVENT_ASSOC_REJECT,
5517
5518 /**
5519 * EVENT_AUTH_TIMED_OUT - Authentication timed out
5520 */
5521 EVENT_AUTH_TIMED_OUT,
5522
5523 /**
5524 * EVENT_ASSOC_TIMED_OUT - Association timed out
5525 */
5526 EVENT_ASSOC_TIMED_OUT,
5527
5528 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005529 * EVENT_WPS_BUTTON_PUSHED - Report hardware push button press for WPS
5530 */
5531 EVENT_WPS_BUTTON_PUSHED,
5532
5533 /**
5534 * EVENT_TX_STATUS - Report TX status
5535 */
5536 EVENT_TX_STATUS,
5537
5538 /**
5539 * EVENT_RX_FROM_UNKNOWN - Report RX from unknown STA
5540 */
5541 EVENT_RX_FROM_UNKNOWN,
5542
5543 /**
5544 * EVENT_RX_MGMT - Report RX of a management frame
5545 */
5546 EVENT_RX_MGMT,
5547
5548 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005549 * EVENT_REMAIN_ON_CHANNEL - Remain-on-channel duration started
5550 *
5551 * This event is used to indicate when the driver has started the
5552 * requested remain-on-channel duration. Information about the
5553 * operation is included in union wpa_event_data::remain_on_channel.
5554 */
5555 EVENT_REMAIN_ON_CHANNEL,
5556
5557 /**
5558 * EVENT_CANCEL_REMAIN_ON_CHANNEL - Remain-on-channel timed out
5559 *
5560 * This event is used to indicate when the driver has completed
5561 * remain-on-channel duration, i.e., may noot be available on the
5562 * requested channel anymore. Information about the
5563 * operation is included in union wpa_event_data::remain_on_channel.
5564 */
5565 EVENT_CANCEL_REMAIN_ON_CHANNEL,
5566
5567 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005568 * EVENT_RX_PROBE_REQ - Indicate received Probe Request frame
5569 *
5570 * This event is used to indicate when a Probe Request frame has been
5571 * received. Information about the received frame is included in
5572 * union wpa_event_data::rx_probe_req. The driver is required to report
5573 * these events only after successfully completed probe_req_report()
5574 * commands to request the events (i.e., report parameter is non-zero)
5575 * in station mode. In AP mode, Probe Request frames should always be
5576 * reported.
5577 */
5578 EVENT_RX_PROBE_REQ,
5579
5580 /**
5581 * EVENT_NEW_STA - New wired device noticed
5582 *
5583 * This event is used to indicate that a new device has been detected
5584 * in a network that does not use association-like functionality (i.e.,
5585 * mainly wired Ethernet). This can be used to start EAPOL
5586 * authenticator when receiving a frame from a device. The address of
5587 * the device is included in union wpa_event_data::new_sta.
5588 */
5589 EVENT_NEW_STA,
5590
5591 /**
5592 * EVENT_EAPOL_RX - Report received EAPOL frame
5593 *
5594 * When in AP mode with hostapd, this event is required to be used to
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08005595 * deliver the receive EAPOL frames from the driver.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005596 */
5597 EVENT_EAPOL_RX,
5598
5599 /**
5600 * EVENT_SIGNAL_CHANGE - Indicate change in signal strength
5601 *
5602 * This event is used to indicate changes in the signal strength
5603 * observed in frames received from the current AP if signal strength
5604 * monitoring has been enabled with signal_monitor().
5605 */
5606 EVENT_SIGNAL_CHANGE,
5607
5608 /**
5609 * EVENT_INTERFACE_ENABLED - Notify that interface was enabled
5610 *
5611 * This event is used to indicate that the interface was enabled after
5612 * having been previously disabled, e.g., due to rfkill.
5613 */
5614 EVENT_INTERFACE_ENABLED,
5615
5616 /**
5617 * EVENT_INTERFACE_DISABLED - Notify that interface was disabled
5618 *
5619 * This event is used to indicate that the interface was disabled,
5620 * e.g., due to rfkill.
5621 */
5622 EVENT_INTERFACE_DISABLED,
5623
5624 /**
5625 * EVENT_CHANNEL_LIST_CHANGED - Channel list changed
5626 *
5627 * This event is used to indicate that the channel list has changed,
5628 * e.g., because of a regulatory domain change triggered by scan
5629 * results including an AP advertising a country code.
5630 */
5631 EVENT_CHANNEL_LIST_CHANGED,
5632
5633 /**
5634 * EVENT_INTERFACE_UNAVAILABLE - Notify that interface is unavailable
5635 *
5636 * This event is used to indicate that the driver cannot maintain this
5637 * interface in its operation mode anymore. The most likely use for
5638 * this is to indicate that AP mode operation is not available due to
5639 * operating channel would need to be changed to a DFS channel when
5640 * the driver does not support radar detection and another virtual
5641 * interfaces caused the operating channel to change. Other similar
5642 * resource conflicts could also trigger this for station mode
Dmitry Shmidtd30ac602014-06-30 09:54:22 -07005643 * interfaces. This event can be propagated when channel switching
5644 * fails.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005645 */
5646 EVENT_INTERFACE_UNAVAILABLE,
5647
5648 /**
5649 * EVENT_BEST_CHANNEL
5650 *
5651 * Driver generates this event whenever it detects a better channel
5652 * (e.g., based on RSSI or channel use). This information can be used
5653 * to improve channel selection for a new AP/P2P group.
5654 */
5655 EVENT_BEST_CHANNEL,
5656
5657 /**
5658 * EVENT_UNPROT_DEAUTH - Unprotected Deauthentication frame received
5659 *
5660 * This event should be called when a Deauthentication frame is dropped
5661 * due to it not being protected (MFP/IEEE 802.11w).
5662 * union wpa_event_data::unprot_deauth is required to provide more
5663 * details of the frame.
5664 */
5665 EVENT_UNPROT_DEAUTH,
5666
5667 /**
5668 * EVENT_UNPROT_DISASSOC - Unprotected Disassociation frame received
5669 *
5670 * This event should be called when a Disassociation frame is dropped
5671 * due to it not being protected (MFP/IEEE 802.11w).
5672 * union wpa_event_data::unprot_disassoc is required to provide more
5673 * details of the frame.
5674 */
5675 EVENT_UNPROT_DISASSOC,
5676
5677 /**
5678 * EVENT_STATION_LOW_ACK
5679 *
5680 * Driver generates this event whenever it detected that a particular
5681 * station was lost. Detection can be through massive transmission
5682 * failures for example.
5683 */
5684 EVENT_STATION_LOW_ACK,
5685
5686 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005687 * EVENT_IBSS_PEER_LOST - IBSS peer not reachable anymore
5688 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08005689 EVENT_IBSS_PEER_LOST,
5690
5691 /**
5692 * EVENT_DRIVER_GTK_REKEY - Device/driver did GTK rekey
5693 *
5694 * This event carries the new replay counter to notify wpa_supplicant
5695 * of the current EAPOL-Key Replay Counter in case the driver/firmware
5696 * completed Group Key Handshake while the host (including
5697 * wpa_supplicant was sleeping).
5698 */
5699 EVENT_DRIVER_GTK_REKEY,
5700
5701 /**
5702 * EVENT_SCHED_SCAN_STOPPED - Scheduled scan was stopped
5703 */
5704 EVENT_SCHED_SCAN_STOPPED,
5705
5706 /**
5707 * EVENT_DRIVER_CLIENT_POLL_OK - Station responded to poll
5708 *
5709 * This event indicates that the station responded to the poll
5710 * initiated with @poll_client.
5711 */
5712 EVENT_DRIVER_CLIENT_POLL_OK,
5713
5714 /**
5715 * EVENT_EAPOL_TX_STATUS - notify of EAPOL TX status
5716 */
Dmitry Shmidt04949592012-07-19 12:16:46 -07005717 EVENT_EAPOL_TX_STATUS,
5718
5719 /**
5720 * EVENT_CH_SWITCH - AP or GO decided to switch channels
5721 *
5722 * Described in wpa_event_data.ch_switch
5723 * */
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07005724 EVENT_CH_SWITCH,
5725
5726 /**
Hai Shalom81f62d82019-07-22 12:10:00 -07005727 * EVENT_CH_SWITCH_STARTED - AP or GO started to switch channels
5728 *
5729 * This is a pre-switch event indicating the shortly following switch
5730 * of operating channels.
5731 *
5732 * Described in wpa_event_data.ch_switch
5733 */
5734 EVENT_CH_SWITCH_STARTED,
5735 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07005736 * EVENT_WNM - Request WNM operation
5737 *
5738 * This event can be used to request a WNM operation to be performed.
5739 */
Dmitry Shmidtf8623282013-02-20 14:34:59 -08005740 EVENT_WNM,
5741
5742 /**
5743 * EVENT_CONNECT_FAILED_REASON - Connection failure reason in AP mode
5744 *
5745 * This event indicates that the driver reported a connection failure
5746 * with the specified client (for example, max client reached, etc.) in
5747 * AP mode.
5748 */
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005749 EVENT_CONNECT_FAILED_REASON,
5750
5751 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005752 * EVENT_DFS_RADAR_DETECTED - Notify of radar detection
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005753 *
5754 * A radar has been detected on the supplied frequency, hostapd should
5755 * react accordingly (e.g., change channel).
5756 */
5757 EVENT_DFS_RADAR_DETECTED,
5758
5759 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005760 * EVENT_DFS_CAC_FINISHED - Notify that channel availability check has been completed
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005761 *
5762 * After a successful CAC, the channel can be marked clear and used.
5763 */
5764 EVENT_DFS_CAC_FINISHED,
5765
5766 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005767 * EVENT_DFS_CAC_ABORTED - Notify that channel availability check has been aborted
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005768 *
5769 * The CAC was not successful, and the channel remains in the previous
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08005770 * state. This may happen due to a radar being detected or other
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005771 * external influences.
5772 */
5773 EVENT_DFS_CAC_ABORTED,
5774
5775 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005776 * EVENT_DFS_NOP_FINISHED - Notify that non-occupancy period is over
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005777 *
5778 * The channel which was previously unavailable is now available again.
5779 */
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07005780 EVENT_DFS_NOP_FINISHED,
5781
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08005782 /**
5783 * EVENT_SURVEY - Received survey data
5784 *
5785 * This event gets triggered when a driver query is issued for survey
5786 * data and the requested data becomes available. The returned data is
5787 * stored in struct survey_results. The results provide at most one
5788 * survey entry for each frequency and at minimum will provide one
5789 * survey entry for one frequency. The survey data can be os_malloc()'d
5790 * and then os_free()'d, so the event callback must only copy data.
5791 */
5792 EVENT_SURVEY,
5793
5794 /**
5795 * EVENT_SCAN_STARTED - Scan started
5796 *
5797 * This indicates that driver has started a scan operation either based
5798 * on a request from wpa_supplicant/hostapd or from another application.
5799 * EVENT_SCAN_RESULTS is used to indicate when the scan has been
5800 * completed (either successfully or by getting cancelled).
5801 */
Dmitry Shmidtcf32e602014-01-28 10:57:39 -08005802 EVENT_SCAN_STARTED,
5803
5804 /**
5805 * EVENT_AVOID_FREQUENCIES - Received avoid frequency range
5806 *
5807 * This event indicates a set of frequency ranges that should be avoided
5808 * to reduce issues due to interference or internal co-existence
5809 * information in the driver.
5810 */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08005811 EVENT_AVOID_FREQUENCIES,
5812
5813 /**
5814 * EVENT_NEW_PEER_CANDIDATE - new (unknown) mesh peer notification
5815 */
5816 EVENT_NEW_PEER_CANDIDATE,
5817
5818 /**
5819 * EVENT_ACS_CHANNEL_SELECTED - Received selected channels by ACS
5820 *
5821 * Indicates a pair of primary and secondary channels chosen by ACS
5822 * in device.
5823 */
5824 EVENT_ACS_CHANNEL_SELECTED,
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005825
5826 /**
5827 * EVENT_DFS_CAC_STARTED - Notify that channel availability check has
5828 * been started.
5829 *
5830 * This event indicates that channel availability check has been started
5831 * on a DFS frequency by a driver that supports DFS Offload.
5832 */
5833 EVENT_DFS_CAC_STARTED,
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07005834
5835 /**
5836 * EVENT_P2P_LO_STOP - Notify that P2P listen offload is stopped
5837 */
5838 EVENT_P2P_LO_STOP,
Paul Stewart092955c2017-02-06 09:13:09 -08005839
5840 /**
5841 * EVENT_BEACON_LOSS - Beacon loss detected
5842 *
5843 * This event indicates that no Beacon frames has been received from
5844 * the current AP. This may indicate that the AP is not anymore in
5845 * range.
5846 */
5847 EVENT_BEACON_LOSS,
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005848
5849 /**
5850 * EVENT_DFS_PRE_CAC_EXPIRED - Notify that channel availability check
5851 * done previously (Pre-CAC) on the channel has expired. This would
5852 * normally be on a non-ETSI DFS regulatory domain. DFS state of the
5853 * channel will be moved from available to usable. A new CAC has to be
5854 * performed before start operating on this channel.
5855 */
5856 EVENT_DFS_PRE_CAC_EXPIRED,
Roshan Pius3a1667e2018-07-03 15:17:14 -07005857
5858 /**
5859 * EVENT_EXTERNAL_AUTH - This event interface is used by host drivers
5860 * that do not define separate commands for authentication and
5861 * association (~WPA_DRIVER_FLAGS_SME) but offload the 802.11
5862 * authentication to wpa_supplicant. This event carries all the
5863 * necessary information from the host driver for the authentication to
5864 * happen.
5865 */
5866 EVENT_EXTERNAL_AUTH,
5867
5868 /**
5869 * EVENT_PORT_AUTHORIZED - Notification that a connection is authorized
5870 *
5871 * This event should be indicated when the driver completes the 4-way
5872 * handshake. This event should be preceded by an EVENT_ASSOC that
5873 * indicates the completion of IEEE 802.11 association.
5874 */
5875 EVENT_PORT_AUTHORIZED,
5876
5877 /**
5878 * EVENT_STATION_OPMODE_CHANGED - Notify STA's HT/VHT operation mode
5879 * change event.
5880 */
5881 EVENT_STATION_OPMODE_CHANGED,
5882
5883 /**
5884 * EVENT_INTERFACE_MAC_CHANGED - Notify that interface MAC changed
5885 *
5886 * This event is emitted when the MAC changes while the interface is
5887 * enabled. When an interface was disabled and becomes enabled, it
5888 * must be always assumed that the MAC possibly changed.
5889 */
5890 EVENT_INTERFACE_MAC_CHANGED,
5891
5892 /**
5893 * EVENT_WDS_STA_INTERFACE_STATUS - Notify WDS STA interface status
5894 *
5895 * This event is emitted when an interface is added/removed for WDS STA.
5896 */
5897 EVENT_WDS_STA_INTERFACE_STATUS,
Hai Shalom81f62d82019-07-22 12:10:00 -07005898
5899 /**
5900 * EVENT_UPDATE_DH - Notification of updated DH information
5901 */
5902 EVENT_UPDATE_DH,
Hai Shalomfdcde762020-04-02 11:19:20 -07005903
5904 /**
5905 * EVENT_UNPROT_BEACON - Unprotected Beacon frame received
5906 *
5907 * This event should be called when a Beacon frame is dropped due to it
5908 * not being protected correctly. union wpa_event_data::unprot_beacon
5909 * is required to provide more details of the frame.
5910 */
5911 EVENT_UNPROT_BEACON,
Hai Shalomc1a21442022-02-04 13:43:00 -08005912
5913 /**
5914 * EVENT_TX_WAIT_EXPIRE - TX wait timed out
5915 *
5916 * This event is used to indicate when the driver has completed
5917 * wait for a response frame based on a TX request that specified a
5918 * non-zero wait time and that has not been explicitly cancelled.
5919 */
5920 EVENT_TX_WAIT_EXPIRE,
Sunil Ravia04bd252022-05-02 22:54:18 -07005921
5922 /**
5923 * EVENT_BSS_COLOR_COLLISION - Notification of a BSS color collision
5924 */
5925 EVENT_BSS_COLOR_COLLISION,
5926
5927 /**
5928 * EVENT_CCA_STARTED_NOTIFY - Notification that CCA has started
5929 */
5930 EVENT_CCA_STARTED_NOTIFY,
5931
5932 /**
5933 * EVENT_CCA_ABORTED_NOTIFY - Notification that CCA has aborted
5934 */
5935 EVENT_CCA_ABORTED_NOTIFY,
5936
5937 /**
5938 * EVENT_CCA_NOTIFY - Notification that CCA has completed
5939 */
5940 EVENT_CCA_NOTIFY,
Sunil Ravi89eba102022-09-13 21:04:37 -07005941
5942 /**
5943 * EVENT_PASN_AUTH - This event is used by the driver that requests
5944 * PASN authentication and secure ranging context for multiple peers.
5945 */
5946 EVENT_PASN_AUTH,
5947
5948 /**
5949 * EVENT_LINK_CH_SWITCH - MLD AP link decided to switch channels
5950 *
5951 * Described in wpa_event_data.ch_switch.
5952 *
5953 */
5954 EVENT_LINK_CH_SWITCH,
5955
5956 /**
5957 * EVENT_LINK_CH_SWITCH_STARTED - MLD AP link started to switch channels
5958 *
5959 * This is a pre-switch event indicating the shortly following switch
5960 * of operating channels.
5961 *
5962 * Described in wpa_event_data.ch_switch.
5963 */
5964 EVENT_LINK_CH_SWITCH_STARTED,
Sunil Ravi640215c2023-06-28 23:08:09 +00005965
5966 /**
5967 * EVENT_TID_LINK_MAP - MLD event to set TID-to-link mapping
5968 *
5969 * This event is used by the driver to indicate the received TID-to-link
5970 * mapping response from the associated AP MLD.
5971 *
5972 * Described in wpa_event_data.t2l_map_info.
5973 */
5974 EVENT_TID_LINK_MAP,
5975
5976 /**
5977 * EVENT_LINK_RECONFIG - Notification that AP links removed
5978 */
5979 EVENT_LINK_RECONFIG,
Sunil Ravic0f5d412024-09-11 22:12:49 +00005980
5981 /**
5982 * EVENT_MLD_INTERFACE_FREED - Notification of AP MLD interface removal
5983 */
5984 EVENT_MLD_INTERFACE_FREED,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005985};
5986
5987
5988/**
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07005989 * struct freq_survey - Channel survey info
5990 *
5991 * @ifidx: Interface index in which this survey was observed
5992 * @freq: Center of frequency of the surveyed channel
5993 * @nf: Channel noise floor in dBm
5994 * @channel_time: Amount of time in ms the radio spent on the channel
5995 * @channel_time_busy: Amount of time in ms the radio detected some signal
5996 * that indicated to the radio the channel was not clear
5997 * @channel_time_rx: Amount of time the radio spent receiving data
5998 * @channel_time_tx: Amount of time the radio spent transmitting data
5999 * @filled: bitmask indicating which fields have been reported, see
6000 * SURVEY_HAS_* defines.
6001 * @list: Internal list pointers
6002 */
6003struct freq_survey {
6004 u32 ifidx;
6005 unsigned int freq;
6006 s8 nf;
6007 u64 channel_time;
6008 u64 channel_time_busy;
6009 u64 channel_time_rx;
6010 u64 channel_time_tx;
6011 unsigned int filled;
6012 struct dl_list list;
6013};
6014
6015#define SURVEY_HAS_NF BIT(0)
6016#define SURVEY_HAS_CHAN_TIME BIT(1)
6017#define SURVEY_HAS_CHAN_TIME_BUSY BIT(2)
6018#define SURVEY_HAS_CHAN_TIME_RX BIT(3)
6019#define SURVEY_HAS_CHAN_TIME_TX BIT(4)
6020
Hai Shalom60840252021-02-19 19:02:11 -08006021/**
6022 * enum sta_connect_fail_reason_codes - STA connect failure reason code values
6023 * @STA_CONNECT_FAIL_REASON_UNSPECIFIED: No reason code specified for
6024 * connection failure.
6025 * @STA_CONNECT_FAIL_REASON_NO_BSS_FOUND: No Probe Response frame received
6026 * for unicast Probe Request frame.
6027 * @STA_CONNECT_FAIL_REASON_AUTH_TX_FAIL: STA failed to send auth request.
6028 * @STA_CONNECT_FAIL_REASON_AUTH_NO_ACK_RECEIVED: AP didn't send ACK for
6029 * auth request.
6030 * @STA_CONNECT_FAIL_REASON_AUTH_NO_RESP_RECEIVED: Auth response is not
6031 * received from AP.
6032 * @STA_CONNECT_FAIL_REASON_ASSOC_REQ_TX_FAIL: STA failed to send
6033 * Association Request frame.
6034 * @STA_CONNECT_FAIL_REASON_ASSOC_NO_ACK_RECEIVED: AP didn't send ACK for
6035 * Association Request frame.
6036 * @STA_CONNECT_FAIL_REASON_ASSOC_NO_RESP_RECEIVED: Association Response
6037 * frame is not received from AP.
6038 */
6039enum sta_connect_fail_reason_codes {
6040 STA_CONNECT_FAIL_REASON_UNSPECIFIED = 0,
6041 STA_CONNECT_FAIL_REASON_NO_BSS_FOUND = 1,
6042 STA_CONNECT_FAIL_REASON_AUTH_TX_FAIL = 2,
6043 STA_CONNECT_FAIL_REASON_AUTH_NO_ACK_RECEIVED = 3,
6044 STA_CONNECT_FAIL_REASON_AUTH_NO_RESP_RECEIVED = 4,
6045 STA_CONNECT_FAIL_REASON_ASSOC_REQ_TX_FAIL = 5,
6046 STA_CONNECT_FAIL_REASON_ASSOC_NO_ACK_RECEIVED = 6,
6047 STA_CONNECT_FAIL_REASON_ASSOC_NO_RESP_RECEIVED = 7,
6048};
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07006049
6050/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006051 * union wpa_event_data - Additional data for wpa_supplicant_event() calls
6052 */
6053union wpa_event_data {
6054 /**
6055 * struct assoc_info - Data for EVENT_ASSOC and EVENT_ASSOCINFO events
6056 *
6057 * This structure is optional for EVENT_ASSOC calls and required for
6058 * EVENT_ASSOCINFO calls. By using EVENT_ASSOC with this data, the
6059 * driver interface does not need to generate separate EVENT_ASSOCINFO
6060 * calls.
6061 */
6062 struct assoc_info {
6063 /**
6064 * reassoc - Flag to indicate association or reassociation
6065 */
6066 int reassoc;
6067
6068 /**
6069 * req_ies - (Re)Association Request IEs
6070 *
6071 * If the driver generates WPA/RSN IE, this event data must be
6072 * returned for WPA handshake to have needed information. If
6073 * wpa_supplicant-generated WPA/RSN IE is used, this
6074 * information event is optional.
6075 *
6076 * This should start with the first IE (fixed fields before IEs
6077 * are not included).
6078 */
6079 const u8 *req_ies;
6080
6081 /**
6082 * req_ies_len - Length of req_ies in bytes
6083 */
6084 size_t req_ies_len;
6085
6086 /**
6087 * resp_ies - (Re)Association Response IEs
6088 *
6089 * Optional association data from the driver. This data is not
6090 * required WPA, but may be useful for some protocols and as
6091 * such, should be reported if this is available to the driver
6092 * interface.
6093 *
6094 * This should start with the first IE (fixed fields before IEs
6095 * are not included).
6096 */
6097 const u8 *resp_ies;
6098
6099 /**
6100 * resp_ies_len - Length of resp_ies in bytes
6101 */
6102 size_t resp_ies_len;
6103
6104 /**
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08006105 * resp_frame - (Re)Association Response frame
6106 */
6107 const u8 *resp_frame;
6108
6109 /**
6110 * resp_frame_len - (Re)Association Response frame length
6111 */
6112 size_t resp_frame_len;
6113
6114 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006115 * beacon_ies - Beacon or Probe Response IEs
6116 *
6117 * Optional Beacon/ProbeResp data: IEs included in Beacon or
6118 * Probe Response frames from the current AP (i.e., the one
6119 * that the client just associated with). This information is
6120 * used to update WPA/RSN IE for the AP. If this field is not
6121 * set, the results from previous scan will be used. If no
6122 * data for the new AP is found, scan results will be requested
6123 * again (without scan request). At this point, the driver is
6124 * expected to provide WPA/RSN IE for the AP (if WPA/WPA2 is
6125 * used).
6126 *
6127 * This should start with the first IE (fixed fields before IEs
6128 * are not included).
6129 */
6130 const u8 *beacon_ies;
6131
6132 /**
6133 * beacon_ies_len - Length of beacon_ies */
6134 size_t beacon_ies_len;
6135
6136 /**
6137 * freq - Frequency of the operational channel in MHz
6138 */
6139 unsigned int freq;
6140
6141 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006142 * wmm_params - WMM parameters used in this association.
6143 */
6144 struct wmm_params wmm_params;
6145
6146 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006147 * addr - Station address (for AP mode)
6148 */
6149 const u8 *addr;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006150
6151 /**
6152 * The following is the key management offload information
6153 * @authorized
6154 * @key_replay_ctr
6155 * @key_replay_ctr_len
6156 * @ptk_kck
6157 * @ptk_kek_len
6158 * @ptk_kek
6159 * @ptk_kek_len
6160 */
6161
6162 /**
6163 * authorized - Status of key management offload,
6164 * 1 = successful
6165 */
6166 int authorized;
6167
6168 /**
6169 * key_replay_ctr - Key replay counter value last used
6170 * in a valid EAPOL-Key frame
6171 */
6172 const u8 *key_replay_ctr;
6173
6174 /**
6175 * key_replay_ctr_len - The length of key_replay_ctr
6176 */
6177 size_t key_replay_ctr_len;
6178
6179 /**
6180 * ptk_kck - The derived PTK KCK
6181 */
6182 const u8 *ptk_kck;
6183
6184 /**
6185 * ptk_kek_len - The length of ptk_kck
6186 */
6187 size_t ptk_kck_len;
6188
6189 /**
6190 * ptk_kek - The derived PTK KEK
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07006191 * This is used in key management offload and also in FILS SK
6192 * offload.
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006193 */
6194 const u8 *ptk_kek;
6195
6196 /**
6197 * ptk_kek_len - The length of ptk_kek
6198 */
6199 size_t ptk_kek_len;
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08006200
6201 /**
6202 * subnet_status - The subnet status:
6203 * 0 = unknown, 1 = unchanged, 2 = changed
6204 */
6205 u8 subnet_status;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07006206
6207 /**
6208 * The following information is used in FILS SK offload
6209 * @fils_erp_next_seq_num
6210 * @fils_pmk
6211 * @fils_pmk_len
6212 * @fils_pmkid
6213 */
6214
6215 /**
6216 * fils_erp_next_seq_num - The next sequence number to use in
6217 * FILS ERP messages
6218 */
6219 u16 fils_erp_next_seq_num;
6220
6221 /**
6222 * fils_pmk - A new PMK if generated in case of FILS
6223 * authentication
6224 */
6225 const u8 *fils_pmk;
6226
6227 /**
6228 * fils_pmk_len - Length of fils_pmk
6229 */
6230 size_t fils_pmk_len;
6231
6232 /**
6233 * fils_pmkid - PMKID used or generated in FILS authentication
6234 */
6235 const u8 *fils_pmkid;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006236
6237 /**
6238 * link_addr - Link address of the STA
6239 */
6240 const u8 *link_addr;
6241
6242 /**
6243 * assoc_link_id - Association link id of the MLO association or
6244 * -1 if MLO is not used
6245 */
6246 int assoc_link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006247 } assoc_info;
6248
6249 /**
6250 * struct disassoc_info - Data for EVENT_DISASSOC events
6251 */
6252 struct disassoc_info {
6253 /**
6254 * addr - Station address (for AP mode)
6255 */
6256 const u8 *addr;
6257
6258 /**
6259 * reason_code - Reason Code (host byte order) used in
6260 * Deauthentication frame
6261 */
6262 u16 reason_code;
6263
6264 /**
6265 * ie - Optional IE(s) in Disassociation frame
6266 */
6267 const u8 *ie;
6268
6269 /**
6270 * ie_len - Length of ie buffer in octets
6271 */
6272 size_t ie_len;
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08006273
6274 /**
6275 * locally_generated - Whether the frame was locally generated
6276 */
6277 int locally_generated;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006278 } disassoc_info;
6279
6280 /**
6281 * struct deauth_info - Data for EVENT_DEAUTH events
6282 */
6283 struct deauth_info {
6284 /**
6285 * addr - Station address (for AP mode)
6286 */
6287 const u8 *addr;
6288
6289 /**
6290 * reason_code - Reason Code (host byte order) used in
6291 * Deauthentication frame
6292 */
6293 u16 reason_code;
6294
6295 /**
6296 * ie - Optional IE(s) in Deauthentication frame
6297 */
6298 const u8 *ie;
6299
6300 /**
6301 * ie_len - Length of ie buffer in octets
6302 */
6303 size_t ie_len;
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08006304
6305 /**
6306 * locally_generated - Whether the frame was locally generated
6307 */
6308 int locally_generated;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006309 } deauth_info;
6310
6311 /**
6312 * struct michael_mic_failure - Data for EVENT_MICHAEL_MIC_FAILURE
6313 */
6314 struct michael_mic_failure {
6315 int unicast;
6316 const u8 *src;
6317 } michael_mic_failure;
6318
6319 /**
6320 * struct interface_status - Data for EVENT_INTERFACE_STATUS
6321 */
6322 struct interface_status {
Dmitry Shmidte4663042016-04-04 10:07:49 -07006323 unsigned int ifindex;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006324 char ifname[100];
6325 enum {
6326 EVENT_INTERFACE_ADDED, EVENT_INTERFACE_REMOVED
6327 } ievent;
6328 } interface_status;
6329
6330 /**
6331 * struct pmkid_candidate - Data for EVENT_PMKID_CANDIDATE
6332 */
6333 struct pmkid_candidate {
6334 /** BSSID of the PMKID candidate */
6335 u8 bssid[ETH_ALEN];
6336 /** Smaller the index, higher the priority */
6337 int index;
6338 /** Whether RSN IE includes pre-authenticate flag */
6339 int preauth;
6340 } pmkid_candidate;
6341
6342 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006343 * struct tdls - Data for EVENT_TDLS
6344 */
6345 struct tdls {
6346 u8 peer[ETH_ALEN];
6347 enum {
6348 TDLS_REQUEST_SETUP,
Dmitry Shmidt4dd28dc2015-03-10 11:21:43 -07006349 TDLS_REQUEST_TEARDOWN,
6350 TDLS_REQUEST_DISCOVER,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006351 } oper;
6352 u16 reason_code; /* for teardown */
6353 } tdls;
6354
6355 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07006356 * struct wnm - Data for EVENT_WNM
6357 */
6358 struct wnm {
6359 u8 addr[ETH_ALEN];
6360 enum {
6361 WNM_OPER_SLEEP,
6362 } oper;
6363 enum {
6364 WNM_SLEEP_ENTER,
6365 WNM_SLEEP_EXIT
6366 } sleep_action;
6367 int sleep_intval;
6368 u16 reason_code;
6369 u8 *buf;
6370 u16 buf_len;
6371 } wnm;
6372
6373 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006374 * struct ft_ies - FT information elements (EVENT_FT_RESPONSE)
6375 *
6376 * During FT (IEEE 802.11r) authentication sequence, the driver is
6377 * expected to use this event to report received FT IEs (MDIE, FTIE,
6378 * RSN IE, TIE, possible resource request) to the supplicant. The FT
6379 * IEs for the next message will be delivered through the
6380 * struct wpa_driver_ops::update_ft_ies() callback.
6381 */
6382 struct ft_ies {
6383 const u8 *ies;
6384 size_t ies_len;
6385 int ft_action;
6386 u8 target_ap[ETH_ALEN];
6387 /** Optional IE(s), e.g., WMM TSPEC(s), for RIC-Request */
6388 const u8 *ric_ies;
6389 /** Length of ric_ies buffer in octets */
6390 size_t ric_ies_len;
6391 } ft_ies;
6392
6393 /**
6394 * struct ibss_rsn_start - Data for EVENT_IBSS_RSN_START
6395 */
6396 struct ibss_rsn_start {
6397 u8 peer[ETH_ALEN];
6398 } ibss_rsn_start;
6399
6400 /**
6401 * struct auth_info - Data for EVENT_AUTH events
6402 */
6403 struct auth_info {
6404 u8 peer[ETH_ALEN];
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006405 u8 bssid[ETH_ALEN];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006406 u16 auth_type;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006407 u16 auth_transaction;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006408 u16 status_code;
6409 const u8 *ies;
6410 size_t ies_len;
6411 } auth;
6412
6413 /**
6414 * struct assoc_reject - Data for EVENT_ASSOC_REJECT events
6415 */
6416 struct assoc_reject {
6417 /**
6418 * bssid - BSSID of the AP that rejected association
6419 */
6420 const u8 *bssid;
6421
6422 /**
6423 * resp_ies - (Re)Association Response IEs
6424 *
6425 * Optional association data from the driver. This data is not
6426 * required WPA, but may be useful for some protocols and as
6427 * such, should be reported if this is available to the driver
6428 * interface.
6429 *
6430 * This should start with the first IE (fixed fields before IEs
6431 * are not included).
6432 */
6433 const u8 *resp_ies;
6434
6435 /**
6436 * resp_ies_len - Length of resp_ies in bytes
6437 */
6438 size_t resp_ies_len;
6439
6440 /**
6441 * status_code - Status Code from (Re)association Response
6442 */
6443 u16 status_code;
Dmitry Shmidtd5ab1b52016-06-21 12:38:41 -07006444
6445 /**
6446 * timed_out - Whether failure is due to timeout (etc.) rather
6447 * than explicit rejection response from the AP.
6448 */
6449 int timed_out;
Dmitry Shmidtebd93af2017-02-21 13:40:44 -08006450
6451 /**
6452 * timeout_reason - Reason for the timeout
6453 */
6454 const char *timeout_reason;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07006455
6456 /**
6457 * fils_erp_next_seq_num - The next sequence number to use in
6458 * FILS ERP messages
6459 */
6460 u16 fils_erp_next_seq_num;
Hai Shalom60840252021-02-19 19:02:11 -08006461
6462 /**
6463 * reason_code - Connection failure reason code from the driver
6464 */
6465 enum sta_connect_fail_reason_codes reason_code;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006466 } assoc_reject;
6467
6468 struct timeout_event {
6469 u8 addr[ETH_ALEN];
6470 } timeout_event;
6471
6472 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006473 * struct tx_status - Data for EVENT_TX_STATUS events
6474 */
6475 struct tx_status {
6476 u16 type;
6477 u16 stype;
6478 const u8 *dst;
6479 const u8 *data;
6480 size_t data_len;
6481 int ack;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006482 int link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006483 } tx_status;
6484
6485 /**
6486 * struct rx_from_unknown - Data for EVENT_RX_FROM_UNKNOWN events
6487 */
6488 struct rx_from_unknown {
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006489 const u8 *bssid;
6490 const u8 *addr;
6491 int wds;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006492 } rx_from_unknown;
6493
6494 /**
6495 * struct rx_mgmt - Data for EVENT_RX_MGMT events
6496 */
6497 struct rx_mgmt {
6498 const u8 *frame;
6499 size_t frame_len;
6500 u32 datarate;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006501
6502 /**
Dmitry Shmidt98660862014-03-11 17:26:21 -07006503 * drv_priv - Pointer to store driver private BSS information
6504 *
6505 * If not set to NULL, this is used for comparison with
6506 * hostapd_data->drv_priv to determine which BSS should process
6507 * the frame.
6508 */
6509 void *drv_priv;
6510
6511 /**
Sunil Ravi7f769292024-07-23 22:21:32 +00006512 * ctx - Pointer to store ctx of private BSS information
6513 *
6514 * If not set to NULL, this is used for forwarding the packet
6515 * to right link BSS of ML BSS.
6516 */
6517 void *ctx;
6518
6519 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006520 * freq - Frequency (in MHz) on which the frame was received
6521 */
6522 int freq;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08006523
6524 /**
6525 * ssi_signal - Signal strength in dBm (or 0 if not available)
6526 */
6527 int ssi_signal;
Sunil Ravi036cec52023-03-29 11:35:17 -07006528
6529 /**
6530 * link_id - MLO link on which the frame was received or -1 for
6531 * non MLD.
6532 */
6533 int link_id;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08006534 } rx_mgmt;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006535
6536 /**
6537 * struct remain_on_channel - Data for EVENT_REMAIN_ON_CHANNEL events
6538 *
6539 * This is also used with EVENT_CANCEL_REMAIN_ON_CHANNEL events.
6540 */
6541 struct remain_on_channel {
6542 /**
6543 * freq - Channel frequency in MHz
6544 */
6545 unsigned int freq;
6546
6547 /**
6548 * duration - Duration to remain on the channel in milliseconds
6549 */
6550 unsigned int duration;
6551 } remain_on_channel;
6552
6553 /**
6554 * struct scan_info - Optional data for EVENT_SCAN_RESULTS events
6555 * @aborted: Whether the scan was aborted
6556 * @freqs: Scanned frequencies in MHz (%NULL = all channels scanned)
6557 * @num_freqs: Number of entries in freqs array
6558 * @ssids: Scanned SSIDs (%NULL or zero-length SSID indicates wildcard
6559 * SSID)
6560 * @num_ssids: Number of entries in ssids array
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08006561 * @external_scan: Whether the scan info is for an external scan
6562 * @nl_scan_event: 1 if the source of this scan event is a normal scan,
6563 * 0 if the source of the scan event is a vendor scan
Dmitry Shmidt29333592017-01-09 12:27:11 -08006564 * @scan_start_tsf: Time when the scan started in terms of TSF of the
6565 * BSS that the interface that requested the scan is connected to
6566 * (if available).
6567 * @scan_start_tsf_bssid: The BSSID according to which %scan_start_tsf
6568 * is set.
Sunil Ravi99c035e2024-07-12 01:42:03 +00006569 * @scan_cookie: Unique identification representing the corresponding
6570 * scan request. 0 if no unique identification is available.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006571 */
6572 struct scan_info {
6573 int aborted;
6574 const int *freqs;
6575 size_t num_freqs;
6576 struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS];
6577 size_t num_ssids;
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08006578 int external_scan;
6579 int nl_scan_event;
Dmitry Shmidt29333592017-01-09 12:27:11 -08006580 u64 scan_start_tsf;
6581 u8 scan_start_tsf_bssid[ETH_ALEN];
Sunil Ravi99c035e2024-07-12 01:42:03 +00006582 u64 scan_cookie;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006583 } scan_info;
6584
6585 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006586 * struct rx_probe_req - Data for EVENT_RX_PROBE_REQ events
6587 */
6588 struct rx_probe_req {
6589 /**
6590 * sa - Source address of the received Probe Request frame
6591 */
6592 const u8 *sa;
6593
6594 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006595 * da - Destination address of the received Probe Request frame
6596 * or %NULL if not available
6597 */
6598 const u8 *da;
6599
6600 /**
6601 * bssid - BSSID of the received Probe Request frame or %NULL
6602 * if not available
6603 */
6604 const u8 *bssid;
6605
6606 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006607 * ie - IEs from the Probe Request body
6608 */
6609 const u8 *ie;
6610
6611 /**
6612 * ie_len - Length of ie buffer in octets
6613 */
6614 size_t ie_len;
Dmitry Shmidt04949592012-07-19 12:16:46 -07006615
6616 /**
6617 * signal - signal strength in dBm (or 0 if not available)
6618 */
6619 int ssi_signal;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006620 } rx_probe_req;
6621
6622 /**
6623 * struct new_sta - Data for EVENT_NEW_STA events
6624 */
6625 struct new_sta {
6626 const u8 *addr;
6627 } new_sta;
6628
6629 /**
6630 * struct eapol_rx - Data for EVENT_EAPOL_RX events
6631 */
6632 struct eapol_rx {
6633 const u8 *src;
6634 const u8 *data;
6635 size_t data_len;
Sunil8cd6f4d2022-06-28 18:40:46 +00006636 enum frame_encryption encrypted;
Sunil Ravi036cec52023-03-29 11:35:17 -07006637 int link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006638 } eapol_rx;
6639
6640 /**
6641 * signal_change - Data for EVENT_SIGNAL_CHANGE events
6642 */
6643 struct wpa_signal_info signal_change;
6644
6645 /**
6646 * struct best_channel - Data for EVENT_BEST_CHANNEL events
6647 * @freq_24: Best 2.4 GHz band channel frequency in MHz
6648 * @freq_5: Best 5 GHz band channel frequency in MHz
6649 * @freq_overall: Best channel frequency in MHz
6650 *
6651 * 0 can be used to indicate no preference in either band.
6652 */
6653 struct best_channel {
6654 int freq_24;
6655 int freq_5;
6656 int freq_overall;
6657 } best_chan;
6658
6659 struct unprot_deauth {
6660 const u8 *sa;
6661 const u8 *da;
6662 u16 reason_code;
6663 } unprot_deauth;
6664
6665 struct unprot_disassoc {
6666 const u8 *sa;
6667 const u8 *da;
6668 u16 reason_code;
6669 } unprot_disassoc;
6670
6671 /**
6672 * struct low_ack - Data for EVENT_STATION_LOW_ACK events
6673 * @addr: station address
Paul Stewart092955c2017-02-06 09:13:09 -08006674 * @num_packets: Number of packets lost (consecutive packets not
6675 * acknowledged)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006676 */
6677 struct low_ack {
6678 u8 addr[ETH_ALEN];
Paul Stewart092955c2017-02-06 09:13:09 -08006679 u32 num_packets;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006680 } low_ack;
6681
6682 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006683 * struct ibss_peer_lost - Data for EVENT_IBSS_PEER_LOST
6684 */
6685 struct ibss_peer_lost {
6686 u8 peer[ETH_ALEN];
6687 } ibss_peer_lost;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006688
6689 /**
6690 * struct driver_gtk_rekey - Data for EVENT_DRIVER_GTK_REKEY
6691 */
6692 struct driver_gtk_rekey {
6693 const u8 *bssid;
6694 const u8 *replay_ctr;
6695 } driver_gtk_rekey;
6696
6697 /**
6698 * struct client_poll - Data for EVENT_DRIVER_CLIENT_POLL_OK events
6699 * @addr: station address
6700 */
6701 struct client_poll {
6702 u8 addr[ETH_ALEN];
6703 } client_poll;
6704
6705 /**
6706 * struct eapol_tx_status
6707 * @dst: Original destination
6708 * @data: Data starting with IEEE 802.1X header (!)
6709 * @data_len: Length of data
6710 * @ack: Indicates ack or lost frame
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006711 * @link_id: MLD link id used to transmit the frame or -1 for non MLO
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006712 *
6713 * This corresponds to hapd_send_eapol if the frame sent
6714 * there isn't just reported as EVENT_TX_STATUS.
6715 */
6716 struct eapol_tx_status {
6717 const u8 *dst;
6718 const u8 *data;
6719 int data_len;
6720 int ack;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006721 int link_id;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006722 } eapol_tx_status;
Dmitry Shmidt04949592012-07-19 12:16:46 -07006723
6724 /**
6725 * struct ch_switch
6726 * @freq: Frequency of new channel in MHz
6727 * @ht_enabled: Whether this is an HT channel
6728 * @ch_offset: Secondary channel offset
Dmitry Shmidt04f534e2013-12-09 15:50:16 -08006729 * @ch_width: Channel width
6730 * @cf1: Center frequency 1
6731 * @cf2: Center frequency 2
Sunil Ravi89eba102022-09-13 21:04:37 -07006732 * @link_id: Link ID of the MLO link
Sunil Ravi036cec52023-03-29 11:35:17 -07006733 * @punct_bitmap: Puncturing bitmap
Dmitry Shmidt04949592012-07-19 12:16:46 -07006734 */
6735 struct ch_switch {
6736 int freq;
6737 int ht_enabled;
6738 int ch_offset;
Dmitry Shmidt04f534e2013-12-09 15:50:16 -08006739 enum chan_width ch_width;
6740 int cf1;
6741 int cf2;
Sunil Ravi89eba102022-09-13 21:04:37 -07006742 int link_id;
Sunil Ravi036cec52023-03-29 11:35:17 -07006743 u16 punct_bitmap;
Dmitry Shmidt04949592012-07-19 12:16:46 -07006744 } ch_switch;
Dmitry Shmidtf8623282013-02-20 14:34:59 -08006745
6746 /**
6747 * struct connect_failed - Data for EVENT_CONNECT_FAILED_REASON
6748 * @addr: Remote client address
6749 * @code: Reason code for connection failure
6750 */
6751 struct connect_failed_reason {
6752 u8 addr[ETH_ALEN];
6753 enum {
6754 MAX_CLIENT_REACHED,
6755 BLOCKED_CLIENT
6756 } code;
6757 } connect_failed_reason;
Dmitry Shmidtea69e842013-05-13 14:52:28 -07006758
6759 /**
6760 * struct dfs_event - Data for radar detected events
6761 * @freq: Frequency of the channel in MHz
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006762 * @link_id: If >= 0, Link ID of the MLO link
Dmitry Shmidtea69e842013-05-13 14:52:28 -07006763 */
6764 struct dfs_event {
6765 int freq;
Dmitry Shmidt051af732013-10-22 13:52:46 -07006766 int ht_enabled;
6767 int chan_offset;
6768 enum chan_width chan_width;
6769 int cf1;
6770 int cf2;
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006771 int link_id;
Dmitry Shmidtea69e842013-05-13 14:52:28 -07006772 } dfs_event;
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07006773
6774 /**
6775 * survey_results - Survey result data for EVENT_SURVEY
6776 * @freq_filter: Requested frequency survey filter, 0 if request
6777 * was for all survey data
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006778 * @survey_list: Linked list of survey data (struct freq_survey)
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07006779 */
6780 struct survey_results {
6781 unsigned int freq_filter;
6782 struct dl_list survey_list; /* struct freq_survey */
6783 } survey_results;
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08006784
6785 /**
6786 * channel_list_changed - Data for EVENT_CHANNEL_LIST_CHANGED
6787 * @initiator: Initiator of the regulatory change
Dmitry Shmidt7dba0e52014-04-14 10:49:15 -07006788 * @type: Regulatory change type
6789 * @alpha2: Country code (or "" if not available)
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006790 * @beacon_hint_before: Data for frequency attributes before beacon hint
6791 * event if initiator == REGDOM_BEACON_HINT
6792 * @beacon_hint_after: Data for frequency attributes after beacon hint
6793 * event if initiator == REGDOM_BEACON_HINT
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08006794 */
6795 struct channel_list_changed {
6796 enum reg_change_initiator initiator;
Dmitry Shmidt7dba0e52014-04-14 10:49:15 -07006797 enum reg_type type;
6798 char alpha2[3];
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006799 struct frequency_attrs {
6800 unsigned int freq;
6801 unsigned int max_tx_power;
6802 bool disabled;
6803 bool no_ir;
6804 bool radar;
6805 } beacon_hint_before, beacon_hint_after;
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08006806 } channel_list_changed;
Dmitry Shmidtcf32e602014-01-28 10:57:39 -08006807
6808 /**
6809 * freq_range - List of frequency ranges
6810 *
6811 * This is used as the data with EVENT_AVOID_FREQUENCIES.
6812 */
6813 struct wpa_freq_range_list freq_range;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006814
6815 /**
6816 * struct mesh_peer
6817 *
6818 * @peer: Peer address
6819 * @ies: Beacon IEs
6820 * @ie_len: Length of @ies
6821 *
6822 * Notification of new candidate mesh peer.
6823 */
6824 struct mesh_peer {
6825 const u8 *peer;
6826 const u8 *ies;
6827 size_t ie_len;
6828 } mesh_peer;
6829
6830 /**
6831 * struct acs_selected_channels - Data for EVENT_ACS_CHANNEL_SELECTED
Ahmed ElArabawy0ff61c52019-12-26 12:38:39 -08006832 * @pri_freq: Selected primary frequency
6833 * @sec_freq: Selected secondary frequency
Hai Shalomfdcde762020-04-02 11:19:20 -07006834 * @edmg_channel: Selected EDMG channel
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006835 * @vht_seg0_center_ch: VHT mode Segment0 center channel
Hai Shalomfdcde762020-04-02 11:19:20 -07006836 * The value is the index of the channel center frequency for
6837 * 20 MHz, 40 MHz, and 80 MHz channels. The value is the center
6838 * frequency index of the primary 80 MHz segment for 160 MHz and
6839 * 80+80 MHz channels.
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006840 * @vht_seg1_center_ch: VHT mode Segment1 center channel
Hai Shalomfdcde762020-04-02 11:19:20 -07006841 * The value is zero for 20 MHz, 40 MHz, and 80 MHz channels. The
6842 * value is the index of the channel center frequency for 160 MHz
6843 * channels and the center frequency index of the secondary 80 MHz
6844 * segment for 80+80 MHz channels.
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006845 * @ch_width: Selected Channel width by driver. Driver may choose to
6846 * change hostapd configured ACS channel width due driver internal
6847 * channel restrictions.
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006848 * @hw_mode: Selected band (used with hw_mode=any)
6849 * @puncture_bitmap: Indicate the puncturing channels
6850 * @link_id: Indicate the link id if operating as AP MLD; -1 otherwise
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006851 */
6852 struct acs_selected_channels {
Ahmed ElArabawy0ff61c52019-12-26 12:38:39 -08006853 unsigned int pri_freq;
6854 unsigned int sec_freq;
Hai Shalomfdcde762020-04-02 11:19:20 -07006855 u8 edmg_channel;
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006856 u8 vht_seg0_center_ch;
6857 u8 vht_seg1_center_ch;
6858 u16 ch_width;
Dmitry Shmidtb1e52102015-05-29 12:36:29 -07006859 enum hostapd_hw_mode hw_mode;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006860 u16 puncture_bitmap;
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006861 int link_id;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006862 } acs_selected_channels;
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07006863
6864 /**
6865 * struct p2p_lo_stop - Reason code for P2P Listen offload stop event
6866 * @reason_code: Reason for stopping offload
6867 * P2P_LO_STOPPED_REASON_COMPLETE: Listen offload finished as
6868 * scheduled.
6869 * P2P_LO_STOPPED_REASON_RECV_STOP_CMD: Host requested offload to
6870 * be stopped.
6871 * P2P_LO_STOPPED_REASON_INVALID_PARAM: Invalid listen offload
6872 * parameters.
6873 * P2P_LO_STOPPED_REASON_NOT_SUPPORTED: Listen offload not
6874 * supported by device.
6875 */
6876 struct p2p_lo_stop {
6877 enum {
6878 P2P_LO_STOPPED_REASON_COMPLETE = 0,
6879 P2P_LO_STOPPED_REASON_RECV_STOP_CMD,
6880 P2P_LO_STOPPED_REASON_INVALID_PARAM,
6881 P2P_LO_STOPPED_REASON_NOT_SUPPORTED,
6882 } reason_code;
6883 } p2p_lo_stop;
Roshan Pius3a1667e2018-07-03 15:17:14 -07006884
6885 /* For EVENT_EXTERNAL_AUTH */
6886 struct external_auth external_auth;
6887
6888 /**
6889 * struct sta_opmode - Station's operation mode change event
6890 * @addr: The station MAC address
6891 * @smps_mode: SMPS mode of the station
6892 * @chan_width: Channel width of the station
6893 * @rx_nss: RX_NSS of the station
6894 *
6895 * This is used as data with EVENT_STATION_OPMODE_CHANGED.
6896 */
6897 struct sta_opmode {
6898 const u8 *addr;
6899 enum smps_mode smps_mode;
6900 enum chan_width chan_width;
6901 u8 rx_nss;
6902 } sta_opmode;
6903
6904 /**
6905 * struct wds_sta_interface - Data for EVENT_WDS_STA_INTERFACE_STATUS.
6906 */
6907 struct wds_sta_interface {
6908 const u8 *sta_addr;
6909 const char *ifname;
6910 enum {
6911 INTERFACE_ADDED,
6912 INTERFACE_REMOVED
6913 } istatus;
6914 } wds_sta_interface;
Hai Shalom81f62d82019-07-22 12:10:00 -07006915
6916 /**
6917 * struct update_dh - Data for EVENT_UPDATE_DH
6918 */
6919 struct update_dh {
6920 const u8 *peer;
6921 const u8 *ie;
6922 size_t ie_len;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006923 int assoc_link_id;
6924 const u8 *link_addr;
Hai Shalom81f62d82019-07-22 12:10:00 -07006925 } update_dh;
Hai Shalomfdcde762020-04-02 11:19:20 -07006926
6927 /**
6928 * struct unprot_beacon - Data for EVENT_UNPROT_BEACON
6929 */
6930 struct unprot_beacon {
6931 const u8 *sa;
6932 } unprot_beacon;
Sunil Ravia04bd252022-05-02 22:54:18 -07006933
6934 /**
6935 * struct bss_color_collision - Data for EVENT_BSS_COLOR_COLLISION
6936 */
6937 struct bss_color_collision {
6938 u64 bitmap;
Sunil Ravi7f769292024-07-23 22:21:32 +00006939 int link_id;
Sunil Ravia04bd252022-05-02 22:54:18 -07006940 } bss_color_collision;
Sunil Ravi89eba102022-09-13 21:04:37 -07006941
6942 /**
6943 * struct pasn_auth - Data for EVENT_PASN_AUTH
6944 */
6945 struct pasn_auth pasn_auth;
6946
Sunil Ravi77d572f2023-01-17 23:58:31 +00006947 /**
6948 * struct port_authorized - Data for EVENT_PORT_AUTHORIZED
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006949 * @td_bitmap: For STA mode, transition disable bitmap, if received in
6950 * EAPOL-Key msg 3/4
6951 * @td_bitmap_len: For STA mode, length of td_bitmap
6952 * @sta_addr: For AP mode, the MAC address of the associated STA
6953 *
6954 * This event is used to indicate that the port is authorized and
6955 * open for normal data in STA and AP modes when 4-way handshake is
6956 * offloaded to the driver.
Sunil Ravi77d572f2023-01-17 23:58:31 +00006957 */
6958 struct port_authorized {
6959 const u8 *td_bitmap;
6960 size_t td_bitmap_len;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006961 const u8 *sta_addr;
Sunil Ravi77d572f2023-01-17 23:58:31 +00006962 } port_authorized;
Sunil Ravi640215c2023-06-28 23:08:09 +00006963
6964 /**
6965 * struct tid_link_map_info - Data for EVENT_TID_LINK_MAP
6966 */
6967 struct tid_link_map_info {
6968 bool default_map;
6969 u8 valid_links;
6970 struct t2lm_mapping t2lmap[MAX_NUM_MLD_LINKS];
6971 } t2l_map_info;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006972};
6973
6974/**
6975 * wpa_supplicant_event - Report a driver event for wpa_supplicant
6976 * @ctx: Context pointer (wpa_s); this is the ctx variable registered
6977 * with struct wpa_driver_ops::init()
6978 * @event: event type (defined above)
6979 * @data: possible extra data for the event
6980 *
6981 * Driver wrapper code should call this function whenever an event is received
6982 * from the driver.
6983 */
6984void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
6985 union wpa_event_data *data);
6986
Dmitry Shmidte4663042016-04-04 10:07:49 -07006987/**
6988 * wpa_supplicant_event_global - Report a driver event for wpa_supplicant
6989 * @ctx: Context pointer (wpa_s); this is the ctx variable registered
6990 * with struct wpa_driver_ops::init()
6991 * @event: event type (defined above)
6992 * @data: possible extra data for the event
6993 *
6994 * Same as wpa_supplicant_event(), but we search for the interface in
6995 * wpa_global.
6996 */
6997void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
6998 union wpa_event_data *data);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006999
7000/*
7001 * The following inline functions are provided for convenience to simplify
7002 * event indication for some of the common events.
7003 */
7004
Sunil Ravi2a14cf12023-11-21 00:54:38 +00007005static inline void drv_event_assoc(void *ctx, const u8 *addr, const u8 *req_ies,
7006 size_t req_ielen, const u8 *resp_ies,
7007 size_t resp_ielen, const u8 *link_addr,
7008 int assoc_link_id, int reassoc)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007009{
7010 union wpa_event_data event;
7011 os_memset(&event, 0, sizeof(event));
7012 event.assoc_info.reassoc = reassoc;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00007013 event.assoc_info.req_ies = req_ies;
7014 event.assoc_info.req_ies_len = req_ielen;
7015 event.assoc_info.resp_ies = resp_ies;
7016 event.assoc_info.resp_ies_len = resp_ielen;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007017 event.assoc_info.addr = addr;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00007018 event.assoc_info.link_addr = link_addr;
7019 event.assoc_info.assoc_link_id = assoc_link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007020 wpa_supplicant_event(ctx, EVENT_ASSOC, &event);
7021}
7022
7023static inline void drv_event_disassoc(void *ctx, const u8 *addr)
7024{
7025 union wpa_event_data event;
7026 os_memset(&event, 0, sizeof(event));
7027 event.disassoc_info.addr = addr;
7028 wpa_supplicant_event(ctx, EVENT_DISASSOC, &event);
7029}
7030
7031static inline void drv_event_eapol_rx(void *ctx, const u8 *src, const u8 *data,
7032 size_t data_len)
7033{
7034 union wpa_event_data event;
7035 os_memset(&event, 0, sizeof(event));
7036 event.eapol_rx.src = src;
7037 event.eapol_rx.data = data;
7038 event.eapol_rx.data_len = data_len;
Sunil8cd6f4d2022-06-28 18:40:46 +00007039 event.eapol_rx.encrypted = FRAME_ENCRYPTION_UNKNOWN;
Sunil Ravi036cec52023-03-29 11:35:17 -07007040 event.eapol_rx.link_id = -1;
Sunil8cd6f4d2022-06-28 18:40:46 +00007041 wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event);
7042}
7043
7044static inline void drv_event_eapol_rx2(void *ctx, const u8 *src, const u8 *data,
Sunil Ravi036cec52023-03-29 11:35:17 -07007045 size_t data_len,
7046 enum frame_encryption encrypted,
7047 int link_id)
Sunil8cd6f4d2022-06-28 18:40:46 +00007048{
7049 union wpa_event_data event;
7050 os_memset(&event, 0, sizeof(event));
7051 event.eapol_rx.src = src;
7052 event.eapol_rx.data = data;
7053 event.eapol_rx.data_len = data_len;
7054 event.eapol_rx.encrypted = encrypted;
Sunil Ravi036cec52023-03-29 11:35:17 -07007055 event.eapol_rx.link_id = link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007056 wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event);
7057}
7058
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08007059/* driver_common.c */
7060void wpa_scan_results_free(struct wpa_scan_results *res);
7061
7062/* Convert wpa_event_type to a string for logging */
7063const char * event_to_string(enum wpa_event_type event);
7064
Dmitry Shmidt661b4f72014-09-29 14:58:27 -07007065/* Convert chan_width to a string for logging and control interfaces */
7066const char * channel_width_to_string(enum chan_width width);
7067
Hai Shalom74f70d42019-02-11 14:42:39 -08007068int channel_width_to_int(enum chan_width width);
7069
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08007070int ht_supported(const struct hostapd_hw_modes *mode);
7071int vht_supported(const struct hostapd_hw_modes *mode);
Sunil Ravi77d572f2023-01-17 23:58:31 +00007072bool he_supported(const struct hostapd_hw_modes *hw_mode,
7073 enum ieee80211_op_mode op_mode);
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08007074
7075struct wowlan_triggers *
7076wpa_get_wowlan_triggers(const char *wowlan_triggers,
7077 const struct wpa_driver_capa *capa);
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07007078/* Convert driver flag to string */
7079const char * driver_flag_to_string(u64 flag);
Hai Shalomb755a2a2020-04-23 21:49:02 -07007080const char * driver_flag2_to_string(u64 flag2);
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08007081
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08007082/* NULL terminated array of linked in driver wrappers */
Dmitry Shmidt1d755d02015-04-28 10:34:29 -07007083extern const struct wpa_driver_ops *const wpa_drivers[];
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08007084
Dmitry Shmidt4ae50e62016-06-27 13:48:39 -07007085
7086/* Available drivers */
7087
7088#ifdef CONFIG_DRIVER_WEXT
7089extern const struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */
7090#endif /* CONFIG_DRIVER_WEXT */
7091#ifdef CONFIG_DRIVER_NL80211
7092/* driver_nl80211.c */
7093extern const struct wpa_driver_ops wpa_driver_nl80211_ops;
7094#endif /* CONFIG_DRIVER_NL80211 */
7095#ifdef CONFIG_DRIVER_HOSTAP
7096extern const struct wpa_driver_ops wpa_driver_hostap_ops; /* driver_hostap.c */
7097#endif /* CONFIG_DRIVER_HOSTAP */
7098#ifdef CONFIG_DRIVER_BSD
7099extern const struct wpa_driver_ops wpa_driver_bsd_ops; /* driver_bsd.c */
7100#endif /* CONFIG_DRIVER_BSD */
7101#ifdef CONFIG_DRIVER_OPENBSD
7102/* driver_openbsd.c */
7103extern const struct wpa_driver_ops wpa_driver_openbsd_ops;
7104#endif /* CONFIG_DRIVER_OPENBSD */
7105#ifdef CONFIG_DRIVER_NDIS
7106extern struct wpa_driver_ops wpa_driver_ndis_ops; /* driver_ndis.c */
7107#endif /* CONFIG_DRIVER_NDIS */
7108#ifdef CONFIG_DRIVER_WIRED
7109extern const struct wpa_driver_ops wpa_driver_wired_ops; /* driver_wired.c */
7110#endif /* CONFIG_DRIVER_WIRED */
7111#ifdef CONFIG_DRIVER_MACSEC_QCA
7112/* driver_macsec_qca.c */
7113extern const struct wpa_driver_ops wpa_driver_macsec_qca_ops;
7114#endif /* CONFIG_DRIVER_MACSEC_QCA */
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08007115#ifdef CONFIG_DRIVER_MACSEC_LINUX
7116/* driver_macsec_linux.c */
7117extern const struct wpa_driver_ops wpa_driver_macsec_linux_ops;
7118#endif /* CONFIG_DRIVER_MACSEC_LINUX */
Dmitry Shmidt4ae50e62016-06-27 13:48:39 -07007119#ifdef CONFIG_DRIVER_ROBOSWITCH
7120/* driver_roboswitch.c */
7121extern const struct wpa_driver_ops wpa_driver_roboswitch_ops;
7122#endif /* CONFIG_DRIVER_ROBOSWITCH */
7123#ifdef CONFIG_DRIVER_ATHEROS
7124/* driver_atheros.c */
7125extern const struct wpa_driver_ops wpa_driver_atheros_ops;
7126#endif /* CONFIG_DRIVER_ATHEROS */
7127#ifdef CONFIG_DRIVER_NONE
7128extern const struct wpa_driver_ops wpa_driver_none_ops; /* driver_none.c */
7129#endif /* CONFIG_DRIVER_NONE */
7130
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007131#endif /* DRIVER_H */