blob: 9ce5ec014691ebcad19385c7dad54f2b066fc023 [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 /**
Sunil Ravi79e6c4f2025-01-04 00:47:06 +0000895 * punct_bitmap - Preamble puncturing bitmap
896 * Each bit corresponds to a 20 MHz subchannel, the lowest bit for the
897 * channel with the lowest frequency. A bit set to 1 indicates that the
898 * subchannel is punctured, otherwise active.
899 */
900 u16 punct_bitmap;
901
902 /**
Sunil Ravi2a14cf12023-11-21 00:54:38 +0000903 * link_id: If >=0 indicates the link of the AP MLD to configure
904 */
905 int link_id;
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -0700906};
907
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700908/**
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700909 * struct wpa_driver_sta_auth_params - Authentication parameters
910 * Data for struct wpa_driver_ops::sta_auth().
911 */
912struct wpa_driver_sta_auth_params {
913
914 /**
915 * own_addr - Source address and BSSID for authentication frame
916 */
917 const u8 *own_addr;
918
919 /**
920 * addr - MAC address of the station to associate
921 */
922 const u8 *addr;
923
924 /**
925 * seq - authentication sequence number
926 */
927 u16 seq;
928
929 /**
930 * status - authentication response status code
931 */
932 u16 status;
933
934 /**
935 * ie - authentication frame ie buffer
936 */
937 const u8 *ie;
938
939 /**
940 * len - ie buffer length
941 */
942 size_t len;
943
944 /**
945 * fils_auth - Indicates whether FILS authentication is being performed
946 */
947 int fils_auth;
948
949 /**
950 * fils_anonce - ANonce (required for FILS)
951 */
952 u8 fils_anonce[WPA_NONCE_LEN];
953
954 /**
955 * fils_snonce - SNonce (required for FILS)
956 */
957 u8 fils_snonce[WPA_NONCE_LEN];
958
959 /**
960 * fils_kek - key for encryption (required for FILS)
961 */
962 u8 fils_kek[WPA_KEK_MAX_LEN];
963
964 /**
965 * fils_kek_len - Length of the fils_kek in octets (required for FILS)
966 */
967 size_t fils_kek_len;
968};
969
Sunil Ravi77d572f2023-01-17 23:58:31 +0000970struct wpa_driver_mld_params {
971 /**
972 * mld_addr - AP's MLD address
973 */
974 const u8 *mld_addr;
975
976 /**
977 * valid_links - The valid links including the association link
978 */
979 u16 valid_links;
980
981 /**
982 * assoc_link_id - The link on which the association is performed
983 */
984 u8 assoc_link_id;
985
986 /**
987 * mld_links - Link information
988 *
989 * Should include information on all the requested links for association
990 * including the link on which the association should take place.
991 * For the association link, the ies and ies_len should be NULL and
992 * 0 respectively.
993 */
994 struct {
995 int freq;
996 const u8 *bssid;
997 const u8 *ies;
998 size_t ies_len;
Sunil Ravib0ac25f2024-07-12 01:42:03 +0000999 int error;
1000 bool disabled;
Sunil Ravi77d572f2023-01-17 23:58:31 +00001001 } mld_links[MAX_NUM_MLD_LINKS];
1002};
1003
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001004/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001005 * struct wpa_driver_associate_params - Association parameters
1006 * Data for struct wpa_driver_ops::associate().
1007 */
1008struct wpa_driver_associate_params {
1009 /**
1010 * bssid - BSSID of the selected AP
1011 * This can be %NULL, if ap_scan=2 mode is used and the driver is
1012 * responsible for selecting with which BSS to associate. */
1013 const u8 *bssid;
1014
1015 /**
Dmitry Shmidt96be6222014-02-13 10:16:51 -08001016 * bssid_hint - BSSID of a proposed AP
1017 *
1018 * This indicates which BSS has been found a suitable candidate for
1019 * initial association for drivers that use driver/firmwate-based BSS
1020 * selection. Unlike the @bssid parameter, @bssid_hint does not limit
1021 * the driver from selecting other BSSes in the ESS.
1022 */
1023 const u8 *bssid_hint;
1024
1025 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001026 * ssid - The selected SSID
1027 */
1028 const u8 *ssid;
1029
1030 /**
1031 * ssid_len - Length of the SSID (1..32)
1032 */
1033 size_t ssid_len;
1034
1035 /**
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -07001036 * freq - channel parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001037 */
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -07001038 struct hostapd_freq_params freq;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001039
1040 /**
Dmitry Shmidt96be6222014-02-13 10:16:51 -08001041 * freq_hint - Frequency of the channel the proposed AP is using
1042 *
1043 * This provides a channel on which a suitable BSS has been found as a
1044 * hint for the driver. Unlike the @freq parameter, @freq_hint does not
1045 * limit the driver from selecting other channels for
1046 * driver/firmware-based BSS selection.
1047 */
1048 int freq_hint;
1049
1050 /**
Dmitry Shmidt04949592012-07-19 12:16:46 -07001051 * bg_scan_period - Background scan period in seconds, 0 to disable
1052 * background scan, or -1 to indicate no change to default driver
1053 * configuration
1054 */
1055 int bg_scan_period;
1056
1057 /**
Dmitry Shmidt2ac5f602014-03-07 10:08:21 -08001058 * beacon_int - Beacon interval for IBSS or 0 to use driver default
1059 */
1060 int beacon_int;
1061
1062 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001063 * wpa_ie - WPA information element for (Re)Association Request
1064 * WPA information element to be included in (Re)Association
1065 * Request (including information element id and length). Use
1066 * of this WPA IE is optional. If the driver generates the WPA
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001067 * IE, it can use pairwise_suite, group_suite, group_mgmt_suite, and
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001068 * key_mgmt_suite to select proper algorithms. In this case,
1069 * the driver has to notify wpa_supplicant about the used WPA
1070 * IE by generating an event that the interface code will
1071 * convert into EVENT_ASSOCINFO data (see below).
1072 *
1073 * When using WPA2/IEEE 802.11i, wpa_ie is used for RSN IE
1074 * instead. The driver can determine which version is used by
1075 * looking at the first byte of the IE (0xdd for WPA, 0x30 for
1076 * WPA2/RSN).
1077 *
1078 * When using WPS, wpa_ie is used for WPS IE instead of WPA/RSN IE.
1079 */
1080 const u8 *wpa_ie;
1081
1082 /**
1083 * wpa_ie_len - length of the wpa_ie
1084 */
1085 size_t wpa_ie_len;
1086
1087 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001088 * wpa_proto - Bitfield of WPA_PROTO_* values to indicate WPA/WPA2
1089 */
1090 unsigned int wpa_proto;
1091
1092 /**
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001093 * pairwise_suite - Selected pairwise cipher suite (WPA_CIPHER_*)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001094 *
1095 * This is usually ignored if @wpa_ie is used.
1096 */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001097 unsigned int pairwise_suite;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001098
1099 /**
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001100 * group_suite - Selected group cipher suite (WPA_CIPHER_*)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001101 *
1102 * This is usually ignored if @wpa_ie is used.
1103 */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001104 unsigned int group_suite;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001105
1106 /**
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001107 * mgmt_group_suite - Selected group management cipher suite (WPA_CIPHER_*)
1108 *
1109 * This is usually ignored if @wpa_ie is used.
1110 */
1111 unsigned int mgmt_group_suite;
1112
1113 /**
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001114 * key_mgmt_suite - Selected key management suite (WPA_KEY_MGMT_*)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001115 *
1116 * This is usually ignored if @wpa_ie is used.
1117 */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08001118 unsigned int key_mgmt_suite;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001119
1120 /**
Sunil Ravi89eba102022-09-13 21:04:37 -07001121 * allowed_key_mgmts - Bitfield of allowed key management suites
1122 * (WPA_KEY_MGMT_*) other than @key_mgmt_suite for the current
1123 * connection
1124 *
1125 * SME in the driver may choose key_mgmt from this list for the initial
1126 * connection or roaming. The driver which doesn't support this
1127 * ignores this parameter.
1128 */
1129 unsigned int allowed_key_mgmts;
1130
1131 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001132 * auth_alg - Allowed authentication algorithms
1133 * Bit field of WPA_AUTH_ALG_*
1134 */
1135 int auth_alg;
1136
1137 /**
1138 * mode - Operation mode (infra/ibss) IEEE80211_MODE_*
1139 */
1140 int mode;
1141
1142 /**
1143 * wep_key - WEP keys for static WEP configuration
1144 */
1145 const u8 *wep_key[4];
1146
1147 /**
1148 * wep_key_len - WEP key length for static WEP configuration
1149 */
1150 size_t wep_key_len[4];
1151
1152 /**
1153 * wep_tx_keyidx - WEP TX key index for static WEP configuration
1154 */
1155 int wep_tx_keyidx;
1156
1157 /**
1158 * mgmt_frame_protection - IEEE 802.11w management frame protection
1159 */
1160 enum mfp_options mgmt_frame_protection;
1161
1162 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001163 * passphrase - RSN passphrase for PSK
1164 *
1165 * This value is made available only for WPA/WPA2-Personal (PSK) and
Hai Shalom74f70d42019-02-11 14:42:39 -08001166 * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK. This
1167 * is the 8..63 character ASCII passphrase, if available. Please note
1168 * that this can be %NULL if passphrase was not used to generate the
1169 * PSK. In that case, the psk field must be used to fetch the PSK.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001170 */
1171 const char *passphrase;
1172
1173 /**
1174 * psk - RSN PSK (alternative for passphrase for PSK)
1175 *
1176 * This value is made available only for WPA/WPA2-Personal (PSK) and
Hai Shalom74f70d42019-02-11 14:42:39 -08001177 * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK. This
1178 * is the 32-octet (256-bit) PSK, if available. The driver wrapper
1179 * should be prepared to handle %NULL value as an error.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001180 */
1181 const u8 *psk;
1182
1183 /**
Sunil Ravi2a14cf12023-11-21 00:54:38 +00001184 * sae_password - Password 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.
1188 */
1189 const char *sae_password;
1190
1191 /**
1192 * sae_password_id - Password Identifier for SAE authentication
1193 *
1194 * This value is made available only for WPA3-Personal (SAE) and only
1195 * for drivers that set WPA_DRIVER_FLAGS2_SAE_OFFLOAD. If %NULL, SAE
1196 * password identifier is not used.
1197 */
1198 const char *sae_password_id;
1199
1200 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001201 * drop_unencrypted - Enable/disable unencrypted frame filtering
1202 *
1203 * Configure the driver to drop all non-EAPOL frames (both receive and
1204 * transmit paths). Unencrypted EAPOL frames (ethertype 0x888e) must
1205 * still be allowed for key negotiation.
1206 */
1207 int drop_unencrypted;
1208
1209 /**
1210 * prev_bssid - Previously used BSSID in this ESS
1211 *
1212 * When not %NULL, this is a request to use reassociation instead of
1213 * association.
1214 */
1215 const u8 *prev_bssid;
1216
1217 /**
1218 * wps - WPS mode
1219 *
1220 * If the driver needs to do special configuration for WPS association,
1221 * this variable provides more information on what type of association
Sunil Ravia04bd252022-05-02 22:54:18 -07001222 * is being requested. Most drivers should not need to use this.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001223 */
1224 enum wps_mode wps;
1225
1226 /**
1227 * p2p - Whether this connection is a P2P group
1228 */
1229 int p2p;
1230
1231 /**
1232 * uapsd - UAPSD parameters for the network
1233 * -1 = do not change defaults
1234 * AP mode: 1 = enabled, 0 = disabled
1235 * STA mode: bits 0..3 UAPSD enabled for VO,VI,BK,BE
1236 */
1237 int uapsd;
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08001238
1239 /**
1240 * fixed_bssid - Whether to force this BSSID in IBSS mode
1241 * 1 = Fix this BSSID and prevent merges.
1242 * 0 = Do not fix BSSID.
1243 */
1244 int fixed_bssid;
1245
1246 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08001247 * fixed_freq - Fix control channel in IBSS mode
1248 * 0 = don't fix control channel (default)
1249 * 1 = fix control channel; this prevents IBSS merging with another
1250 * channel
1251 */
1252 int fixed_freq;
1253
1254 /**
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08001255 * disable_ht - Disable HT (IEEE 802.11n) for this connection
1256 */
1257 int disable_ht;
1258
1259 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001260 * htcaps - HT Capabilities over-rides
1261 *
1262 * Only bits set in the mask will be used, and not all values are used
1263 * by the kernel anyway. Currently, MCS, MPDU and MSDU fields are used.
1264 *
1265 * Pointer to struct ieee80211_ht_capabilities.
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08001266 */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001267 const u8 *htcaps;
1268
1269 /**
1270 * htcaps_mask - HT Capabilities over-rides mask
1271 *
1272 * Pointer to struct ieee80211_ht_capabilities.
1273 */
1274 const u8 *htcaps_mask;
Dmitry Shmidt2f023192013-03-12 12:44:17 -07001275
1276#ifdef CONFIG_VHT_OVERRIDES
1277 /**
1278 * disable_vht - Disable VHT for this connection
1279 */
1280 int disable_vht;
1281
1282 /**
1283 * VHT capability overrides.
1284 */
1285 const struct ieee80211_vht_capabilities *vhtcaps;
1286 const struct ieee80211_vht_capabilities *vhtcaps_mask;
1287#endif /* CONFIG_VHT_OVERRIDES */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001288
Hai Shalomfdcde762020-04-02 11:19:20 -07001289#ifdef CONFIG_HE_OVERRIDES
1290 /**
1291 * disable_he - Disable HE for this connection
1292 */
1293 int disable_he;
1294#endif /* CONFIG_HE_OVERRIDES */
1295
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001296 /**
1297 * req_key_mgmt_offload - Request key management offload for connection
1298 *
1299 * Request key management offload for this connection if the device
1300 * supports it.
1301 */
1302 int req_key_mgmt_offload;
1303
1304 /**
Hai Shalomc3565922019-10-28 11:58:20 -07001305 * req_handshake_offload - Request EAPOL handshake offload
1306 *
1307 * Request EAPOL handshake offload for this connection if the device
1308 * supports it.
1309 */
1310 int req_handshake_offload;
1311
1312 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001313 * Flag for indicating whether this association includes support for
1314 * RRM (Radio Resource Measurements)
1315 */
1316 int rrm_used;
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08001317
1318 /**
1319 * pbss - If set, connect to a PCP in a PBSS. Otherwise, connect to an
1320 * AP as usual. Valid for DMG network only.
1321 */
1322 int pbss;
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08001323
1324 /**
1325 * fils_kek - KEK for FILS association frame protection (AES-SIV)
1326 */
1327 const u8 *fils_kek;
1328
1329 /**
1330 * fils_kek_len: Length of fils_kek in bytes
1331 */
1332 size_t fils_kek_len;
1333
1334 /**
1335 * fils_nonces - Nonces for FILS association frame protection
1336 * (AES-SIV AAD)
1337 */
1338 const u8 *fils_nonces;
1339
1340 /**
1341 * fils_nonces_len: Length of fils_nonce in bytes
1342 */
1343 size_t fils_nonces_len;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001344
1345 /**
1346 * fils_erp_username - Username part of keyName-NAI
1347 */
1348 const u8 *fils_erp_username;
1349
1350 /**
1351 * fils_erp_username_len - Length of fils_erp_username in bytes
1352 */
1353 size_t fils_erp_username_len;
1354
1355 /**
1356 * fils_erp_realm - Realm/domain name to use in FILS ERP
1357 */
1358 const u8 *fils_erp_realm;
1359
1360 /**
1361 * fils_erp_realm_len - Length of fils_erp_realm in bytes
1362 */
1363 size_t fils_erp_realm_len;
1364
1365 /**
1366 * fils_erp_next_seq_num - The next sequence number to use in FILS ERP
1367 * messages
1368 */
1369 u16 fils_erp_next_seq_num;
1370
1371 /**
1372 * fils_erp_rrk - Re-authentication root key (rRK) for the keyName-NAI
1373 * specified by fils_erp_username@fils_erp_realm.
1374 */
1375 const u8 *fils_erp_rrk;
1376
1377 /**
1378 * fils_erp_rrk_len - Length of fils_erp_rrk in bytes
1379 */
1380 size_t fils_erp_rrk_len;
Hai Shalom60840252021-02-19 19:02:11 -08001381
1382 /**
1383 * sae_pwe - SAE mechanism for PWE derivation
1384 * 0 = hunting-and-pecking loop only
1385 * 1 = hash-to-element only
1386 * 2 = both hunting-and-pecking loop and hash-to-element enabled
1387 */
Sunil Ravi77d572f2023-01-17 23:58:31 +00001388 enum sae_pwe sae_pwe;
1389
Winnie Chen4138eec2022-11-10 16:32:53 +08001390#if defined(CONFIG_DRIVER_NL80211_BRCM) || defined(CONFIG_DRIVER_NL80211_SYNA)
Vinayak Yadawade62409f2022-01-20 12:32:07 +05301391 /**
1392 * td_policy - Transition Disable Policy
1393 */
1394 u32 td_policy;
Winnie Chen4138eec2022-11-10 16:32:53 +08001395#endif /* CONFIG_DRIVER_NL80211_BRCM || CONFIG_DRIVER_NL80211_SYNA */
Sunil Ravi77d572f2023-01-17 23:58:31 +00001396
1397 /**
1398 * disable_eht - Disable EHT for this connection
1399 */
1400 int disable_eht;
1401
1402 /*
1403 * mld_params - MLD association parameters
1404 */
1405 struct wpa_driver_mld_params mld_params;
Sunil Ravic0f5d412024-09-11 22:12:49 +00001406
1407
1408 /**
1409 * rsn_overriding - wpa_supplicant RSN overriding support
1410 */
1411 bool rsn_overriding;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001412};
1413
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001414enum hide_ssid {
1415 NO_SSID_HIDING,
1416 HIDDEN_SSID_ZERO_LEN,
1417 HIDDEN_SSID_ZERO_CONTENTS
1418};
1419
Hai Shalom81f62d82019-07-22 12:10:00 -07001420enum ch_switch_state {
1421 CH_SW_STARTED,
1422 CH_SW_FINISHED
1423};
1424
Dmitry Shmidtb58836e2014-04-29 14:35:56 -07001425struct wowlan_triggers {
1426 u8 any;
1427 u8 disconnect;
1428 u8 magic_pkt;
1429 u8 gtk_rekey_failure;
1430 u8 eap_identity_req;
1431 u8 four_way_handshake;
1432 u8 rfkill_release;
1433};
1434
Sunil Ravi7f769292024-07-23 22:21:32 +00001435struct unsol_bcast_probe_resp {
1436 /**
1437 * Unsolicited broadcast Probe Response interval in TUs
1438 */
1439 unsigned int unsol_bcast_probe_resp_interval;
1440
1441 /**
1442 * Unsolicited broadcast Probe Response template data
1443 */
1444 u8 *unsol_bcast_probe_resp_tmpl;
1445
1446 /**
1447 * Unsolicited broadcast Probe Response template length
1448 */
1449 size_t unsol_bcast_probe_resp_tmpl_len;
1450};
1451
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001452struct wpa_driver_ap_params {
1453 /**
1454 * head - Beacon head from IEEE 802.11 header to IEs before TIM IE
1455 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08001456 u8 *head;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001457
1458 /**
1459 * head_len - Length of the head buffer in octets
1460 */
1461 size_t head_len;
1462
1463 /**
1464 * tail - Beacon tail following TIM IE
1465 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08001466 u8 *tail;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001467
1468 /**
1469 * tail_len - Length of the tail buffer in octets
1470 */
1471 size_t tail_len;
1472
1473 /**
1474 * dtim_period - DTIM period
1475 */
1476 int dtim_period;
1477
1478 /**
1479 * beacon_int - Beacon interval
1480 */
1481 int beacon_int;
1482
1483 /**
1484 * basic_rates: -1 terminated array of basic rates in 100 kbps
1485 *
1486 * This parameter can be used to set a specific basic rate set for the
1487 * BSS. If %NULL, default basic rate set is used.
1488 */
1489 int *basic_rates;
1490
1491 /**
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001492 * beacon_rate: Beacon frame data rate
1493 *
1494 * This parameter can be used to set a specific Beacon frame data rate
1495 * for the BSS. The interpretation of this value depends on the
Hai Shalom60840252021-02-19 19:02:11 -08001496 * rate_type (legacy: in 100 kbps units, HT: HT-MCS, VHT: VHT-MCS,
1497 * HE: HE-MCS). If beacon_rate == 0 and rate_type == 0
1498 * (BEACON_RATE_LEGACY), the default Beacon frame data rate is used.
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001499 */
1500 unsigned int beacon_rate;
1501
1502 /**
Hai Shalom60840252021-02-19 19:02:11 -08001503 * beacon_rate_type: Beacon data rate type (legacy/HT/VHT/HE)
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001504 */
1505 enum beacon_rate_type rate_type;
1506
1507 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001508 * proberesp - Probe Response template
1509 *
1510 * This is used by drivers that reply to Probe Requests internally in
1511 * AP mode and require the full Probe Response template.
1512 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08001513 u8 *proberesp;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001514
1515 /**
1516 * proberesp_len - Length of the proberesp buffer in octets
1517 */
1518 size_t proberesp_len;
1519
1520 /**
1521 * ssid - The SSID to use in Beacon/Probe Response frames
1522 */
1523 const u8 *ssid;
1524
1525 /**
1526 * ssid_len - Length of the SSID (1..32)
1527 */
1528 size_t ssid_len;
1529
1530 /**
1531 * hide_ssid - Whether to hide the SSID
1532 */
1533 enum hide_ssid hide_ssid;
1534
1535 /**
1536 * pairwise_ciphers - WPA_CIPHER_* bitfield
1537 */
1538 unsigned int pairwise_ciphers;
1539
1540 /**
1541 * group_cipher - WPA_CIPHER_*
1542 */
1543 unsigned int group_cipher;
1544
1545 /**
1546 * key_mgmt_suites - WPA_KEY_MGMT_* bitfield
1547 */
1548 unsigned int key_mgmt_suites;
1549
1550 /**
1551 * auth_algs - WPA_AUTH_ALG_* bitfield
1552 */
1553 unsigned int auth_algs;
1554
1555 /**
1556 * wpa_version - WPA_PROTO_* bitfield
1557 */
1558 unsigned int wpa_version;
1559
1560 /**
1561 * privacy - Whether privacy is used in the BSS
1562 */
1563 int privacy;
1564
1565 /**
1566 * beacon_ies - WPS/P2P IE(s) for Beacon frames
1567 *
1568 * This is used to add IEs like WPS IE and P2P IE by drivers that do
1569 * not use the full Beacon template.
1570 */
1571 const struct wpabuf *beacon_ies;
1572
1573 /**
1574 * proberesp_ies - P2P/WPS IE(s) for Probe Response frames
1575 *
1576 * This is used to add IEs like WPS IE and P2P IE by drivers that
1577 * reply to Probe Request frames internally.
1578 */
1579 const struct wpabuf *proberesp_ies;
1580
1581 /**
1582 * assocresp_ies - WPS IE(s) for (Re)Association Response frames
1583 *
1584 * This is used to add IEs like WPS IE by drivers that reply to
1585 * (Re)Association Request frames internally.
1586 */
1587 const struct wpabuf *assocresp_ies;
1588
1589 /**
1590 * isolate - Whether to isolate frames between associated stations
1591 *
1592 * If this is non-zero, the AP is requested to disable forwarding of
1593 * frames between associated stations.
1594 */
1595 int isolate;
1596
1597 /**
1598 * cts_protect - Whether CTS protection is enabled
1599 */
1600 int cts_protect;
1601
1602 /**
1603 * preamble - Whether short preamble is enabled
1604 */
1605 int preamble;
1606
1607 /**
1608 * short_slot_time - Whether short slot time is enabled
1609 *
1610 * 0 = short slot time disable, 1 = short slot time enabled, -1 = do
1611 * not set (e.g., when 802.11g mode is not in use)
1612 */
1613 int short_slot_time;
1614
1615 /**
1616 * ht_opmode - HT operation mode or -1 if HT not in use
1617 */
1618 int ht_opmode;
1619
1620 /**
1621 * interworking - Whether Interworking is enabled
1622 */
1623 int interworking;
1624
1625 /**
1626 * hessid - Homogeneous ESS identifier or %NULL if not set
1627 */
1628 const u8 *hessid;
1629
1630 /**
1631 * access_network_type - Access Network Type (0..15)
1632 *
1633 * This is used for filtering Probe Request frames when Interworking is
1634 * enabled.
1635 */
1636 u8 access_network_type;
Dmitry Shmidt04949592012-07-19 12:16:46 -07001637
1638 /**
1639 * ap_max_inactivity - Timeout in seconds to detect STA's inactivity
1640 *
1641 * This is used by driver which advertises this capability.
1642 */
1643 int ap_max_inactivity;
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07001644
1645 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08001646 * ctwindow - Client Traffic Window (in TUs)
1647 */
1648 u8 p2p_go_ctwindow;
1649
1650 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07001651 * disable_dgaf - Whether group-addressed frames are disabled
1652 */
1653 int disable_dgaf;
Dmitry Shmidtf21452a2014-02-26 10:55:25 -08001654
1655 /**
1656 * osen - Whether OSEN security is enabled
1657 */
1658 int osen;
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07001659
1660 /**
1661 * freq - Channel parameters for dynamic bandwidth changes
1662 */
1663 struct hostapd_freq_params *freq;
Dmitry Shmidt7f656022015-02-25 14:36:37 -08001664
1665 /**
1666 * reenable - Whether this is to re-enable beaconing
1667 */
1668 int reenable;
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08001669
1670 /**
1671 * pbss - Whether to start a PCP (in PBSS) instead of an AP in
1672 * infrastructure BSS. Valid only for DMG network.
1673 */
1674 int pbss;
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001675
1676 /**
1677 * multicast_to_unicast - Whether to use multicast_to_unicast
1678 *
1679 * If this is non-zero, the AP is requested to perform multicast to
1680 * unicast conversion for ARP, IPv4, and IPv6 frames (possibly within
1681 * 802.1Q). If enabled, such frames are to be sent to each station
1682 * separately, with the DA replaced by their own MAC address rather
1683 * than the group address.
1684 *
1685 * Note that this may break certain expectations of the receiver, such
1686 * as the ability to drop unicast IP packets received within multicast
1687 * L2 frames, or the ability to not send ICMP destination unreachable
1688 * messages for packets received in L2 multicast (which is required,
1689 * but the receiver can't tell the difference if this new option is
1690 * enabled.)
1691 *
1692 * This also doesn't implement the 802.11 DMS (directed multicast
1693 * service).
1694 */
1695 int multicast_to_unicast;
Hai Shalom74f70d42019-02-11 14:42:39 -08001696
1697 /**
1698 * ftm_responder - Whether FTM responder is enabled
1699 */
1700 int ftm_responder;
1701
1702 /**
1703 * lci - Binary data, the content of an LCI report IE with type 8 as
1704 * defined in IEEE Std 802.11-2016, 9.4.2.22.10
1705 */
1706 const struct wpabuf *lci;
1707
1708 /**
1709 * civic - Binary data, the content of a measurement report IE with
1710 * type 11 as defined in IEEE Std 802.11-2016, 9.4.2.22.13
1711 */
1712 const struct wpabuf *civic;
Hai Shalomc3565922019-10-28 11:58:20 -07001713
1714 /**
Hai Shalom60840252021-02-19 19:02:11 -08001715 * he_spr_ctrl - Spatial Reuse control field of SPR element
Hai Shalomc3565922019-10-28 11:58:20 -07001716 */
Hai Shalom60840252021-02-19 19:02:11 -08001717 u8 he_spr_ctrl;
1718
1719 /**
1720 * he_spr_non_srg_obss_pd_max_offset - Non-SRG Maximum TX power offset
1721 */
1722 u8 he_spr_non_srg_obss_pd_max_offset;
Hai Shalomc3565922019-10-28 11:58:20 -07001723
1724 /**
1725 * he_spr_srg_obss_pd_min_offset - Minimum TX power offset
1726 */
Hai Shalom60840252021-02-19 19:02:11 -08001727 u8 he_spr_srg_obss_pd_min_offset;
Hai Shalomc3565922019-10-28 11:58:20 -07001728
1729 /**
1730 * he_spr_srg_obss_pd_max_offset - Maximum TX power offset
1731 */
Hai Shalom60840252021-02-19 19:02:11 -08001732 u8 he_spr_srg_obss_pd_max_offset;
1733
1734 /**
1735 * he_spr_bss_color_bitmap - BSS color values used by members of the
1736 * SRG.
1737 */
1738 u8 he_spr_bss_color_bitmap[8];
1739
1740 /**
1741 * he_spr_partial_bssid_bitmap - Partial BSSID values used by members
1742 * of the SRG.
1743 */
1744 u8 he_spr_partial_bssid_bitmap[8];
Hai Shalomfdcde762020-04-02 11:19:20 -07001745
1746 /**
1747 * he_bss_color - Whether the BSS Color is disabled
1748 */
1749 int he_bss_color_disabled;
1750
1751 /**
1752 * he_bss_color_partial - The BSS Color AID equation
1753 */
1754 int he_bss_color_partial;
1755
1756 /**
1757 * he_bss_color - The BSS Color of the AP
1758 */
1759 int he_bss_color;
1760
1761 /**
1762 * twt_responder - Whether Target Wait Time responder is enabled
1763 */
1764 int twt_responder;
Hai Shalom60840252021-02-19 19:02:11 -08001765
1766 /**
1767 * sae_pwe - SAE mechanism for PWE derivation
1768 * 0 = hunting-and-pecking loop only
1769 * 1 = hash-to-element only
1770 * 2 = both hunting-and-pecking loop and hash-to-element enabled
1771 */
Sunil Ravi77d572f2023-01-17 23:58:31 +00001772 enum sae_pwe sae_pwe;
Hai Shalom60840252021-02-19 19:02:11 -08001773
1774 /**
1775 * FILS Discovery frame minimum interval in TUs
1776 */
1777 u32 fd_min_int;
1778
1779 /**
1780 * FILS Discovery frame maximum interval in TUs (0 = FD frame disabled)
1781 */
1782 u32 fd_max_int;
1783
1784 /**
1785 * FILS Discovery frame template data
1786 */
1787 u8 *fd_frame_tmpl;
1788
1789 /**
1790 * FILS Discovery frame template length
1791 */
1792 size_t fd_frame_tmpl_len;
1793
1794 /**
Sunil Ravi77d572f2023-01-17 23:58:31 +00001795 * mbssid_tx_iface - Transmitting interface of the MBSSID set
1796 */
1797 const char *mbssid_tx_iface;
1798
1799 /**
1800 * mbssid_index - The index of this BSS in the MBSSID set
1801 */
1802 unsigned int mbssid_index;
1803
1804 /**
1805 * mbssid_elem - Buffer containing all MBSSID elements
1806 */
1807 u8 *mbssid_elem;
1808
1809 /**
1810 * mbssid_elem_len - Total length of all MBSSID elements
1811 */
1812 size_t mbssid_elem_len;
1813
1814 /**
1815 * mbssid_elem_count - The number of MBSSID elements
1816 */
1817 u8 mbssid_elem_count;
1818
1819 /**
1820 * mbssid_elem_offset - Offsets to elements in mbssid_elem.
1821 * Kernel will use these offsets to generate multiple BSSID beacons.
1822 */
1823 u8 **mbssid_elem_offset;
1824
1825 /**
1826 * ema - Enhanced MBSSID advertisements support.
1827 */
1828 bool ema;
Sunil Ravi036cec52023-03-29 11:35:17 -07001829
1830 /**
1831 * punct_bitmap - Preamble puncturing bitmap
1832 * Each bit corresponds to a 20 MHz subchannel, the lowest bit for the
1833 * channel with the lowest frequency. A bit set to 1 indicates that the
1834 * subchannel is punctured, otherwise active.
1835 */
1836 u16 punct_bitmap;
Sunil Ravi640215c2023-06-28 23:08:09 +00001837
1838 /**
1839 * rnr_elem - This buffer contains all of reduced neighbor report (RNR)
1840 * elements
1841 */
1842 u8 *rnr_elem;
1843
1844 /**
1845 * rnr_elem_len - Length of rnr_elem buffer
1846 */
1847 size_t rnr_elem_len;
1848
1849 /**
1850 * rnr_elem_count - Number of RNR elements
1851 */
1852 unsigned int rnr_elem_count;
1853
1854 /**
1855 * rnr_elem_offset - The offsets to the elements in rnr_elem.
1856 * The driver will use these to include RNR elements in EMA beacons.
1857 */
1858 u8 **rnr_elem_offset;
1859
Sunil Ravi7f769292024-07-23 22:21:32 +00001860 /* Unsolicited broadcast Probe Response data */
1861 struct unsol_bcast_probe_resp ubpr;
1862
Sunil Ravi640215c2023-06-28 23:08:09 +00001863 /**
1864 * allowed_freqs - List of allowed 20 MHz channel center frequencies in
1865 * MHz for AP operation. Drivers which support this parameter will
1866 * generate a new list based on this provided list by filtering out
1867 * channels that cannot be used at that time due to regulatory or other
1868 * constraints. The resulting list is used as the list of all allowed
1869 * channels whenever performing operations like ACS and DFS.
1870 */
1871 int *allowed_freqs;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00001872
1873 /*
1874 * mld_ap - Whether operating as an AP MLD
1875 */
1876 bool mld_ap;
1877
1878 /**
1879 * mld_link_id - Link id for MLD BSS's
1880 */
1881 u8 mld_link_id;
1882
1883 /**
1884 * psk - PSK passed to the driver for 4-way handshake offload
1885 */
1886 u8 psk[PMK_LEN];
1887
1888 /**
1889 * psk_len - PSK length in bytes (0 = not set)
1890 */
1891 size_t psk_len;
1892
1893 /**
1894 * sae_password - SAE password for SAE offload
1895 */
1896 const char *sae_password;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001897};
1898
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001899struct wpa_driver_mesh_bss_params {
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001900#define WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS 0x00000001
1901#define WPA_DRIVER_MESH_CONF_FLAG_PEER_LINK_TIMEOUT 0x00000002
1902#define WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS 0x00000004
1903#define WPA_DRIVER_MESH_CONF_FLAG_HT_OP_MODE 0x00000008
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001904#define WPA_DRIVER_MESH_CONF_FLAG_RSSI_THRESHOLD 0x00000010
Hai Shalomc1a21442022-02-04 13:43:00 -08001905#define WPA_DRIVER_MESH_CONF_FLAG_FORWARDING 0x00000020
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001906 /*
1907 * TODO: Other mesh configuration parameters would go here.
1908 * See NL80211_MESHCONF_* for all the mesh config parameters.
1909 */
1910 unsigned int flags;
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001911 int auto_plinks;
Dmitry Shmidt2f74e362015-01-21 13:19:05 -08001912 int peer_link_timeout;
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001913 int max_peer_links;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001914 int rssi_threshold;
Hai Shalomc1a21442022-02-04 13:43:00 -08001915 int forwarding;
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001916 u16 ht_opmode;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001917};
1918
1919struct wpa_driver_mesh_join_params {
1920 const u8 *meshid;
1921 int meshid_len;
1922 const int *basic_rates;
1923 const u8 *ies;
1924 int ie_len;
Dmitry Shmidtff787d52015-01-12 13:01:47 -08001925 struct hostapd_freq_params freq;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001926 int beacon_int;
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07001927 int dtim_period;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001928 struct wpa_driver_mesh_bss_params conf;
1929#define WPA_DRIVER_MESH_FLAG_USER_MPM 0x00000001
1930#define WPA_DRIVER_MESH_FLAG_DRIVER_MPM 0x00000002
1931#define WPA_DRIVER_MESH_FLAG_SAE_AUTH 0x00000004
1932#define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008
1933 unsigned int flags;
Hai Shalom60840252021-02-19 19:02:11 -08001934 bool handle_dfs;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001935};
1936
Hai Shalomfdcde762020-04-02 11:19:20 -07001937struct wpa_driver_set_key_params {
1938 /**
1939 * ifname - Interface name (for multi-SSID/VLAN support) */
1940 const char *ifname;
1941
1942 /**
1943 * alg - Encryption algorithm
1944 *
1945 * (%WPA_ALG_NONE, %WPA_ALG_WEP, %WPA_ALG_TKIP, %WPA_ALG_CCMP,
Hai Shalom4fbc08f2020-05-18 12:37:00 -07001946 * %WPA_ALG_BIP_AES_CMAC_128, %WPA_ALG_GCMP, %WPA_ALG_GCMP_256,
1947 * %WPA_ALG_CCMP_256, %WPA_ALG_BIP_GMAC_128, %WPA_ALG_BIP_GMAC_256,
1948 * %WPA_ALG_BIP_CMAC_256);
Hai Shalomfdcde762020-04-02 11:19:20 -07001949 * %WPA_ALG_NONE clears the key. */
1950 enum wpa_alg alg;
1951
1952 /**
1953 * addr - Address of the peer STA
1954 *
1955 * (BSSID of the current AP when setting pairwise key in station mode),
1956 * ff:ff:ff:ff:ff:ff for broadcast keys, %NULL for default keys that
1957 * are used both for broadcast and unicast; when clearing keys, %NULL
1958 * is used to indicate that both the broadcast-only and default key of
1959 * the specified key index is to be cleared */
1960 const u8 *addr;
1961
1962 /**
1963 * key_idx - Key index
1964 *
1965 * (0..3), usually 0 for unicast keys; 4..5 for IGTK; 6..7 for BIGTK */
1966 int key_idx;
1967
1968 /**
1969 * set_tx - Configure this key as the default Tx key
1970 *
1971 * Only used when driver does not support separate unicast/individual
1972 * key */
1973 int set_tx;
1974
1975 /**
1976 * seq - Sequence number/packet number
1977 *
1978 * seq_len octets, the next packet number to be used for in replay
1979 * protection; configured for Rx keys (in most cases, this is only used
1980 * with broadcast keys and set to zero for unicast keys); %NULL if not
1981 * set */
1982 const u8 *seq;
1983
1984 /**
1985 * seq_len - Length of the seq, depends on the algorithm
1986 *
1987 * TKIP: 6 octets, CCMP/GCMP: 6 octets, IGTK: 6 octets */
1988 size_t seq_len;
1989
1990 /**
1991 * key - Key buffer
1992 *
1993 * TKIP: 16-byte temporal key, 8-byte Tx Mic key, 8-byte Rx Mic Key */
1994 const u8 *key;
1995
1996 /**
1997 * key_len - Length of the key buffer in octets
1998 *
1999 * WEP: 5 or 13, TKIP: 32, CCMP/GCMP: 16, IGTK: 16 */
2000 size_t key_len;
2001
2002 /**
2003 * vlan_id - VLAN index (0..4095) for VLAN offload cases */
2004 int vlan_id;
2005
2006 /**
2007 * key_flag - Additional key flags
2008 *
2009 * %KEY_FLAG_MODIFY
2010 * Set when an already installed key must be updated.
2011 * So far the only use-case is changing RX/TX status for
2012 * pairwise keys. Must not be set when deleting a key.
2013 * %KEY_FLAG_DEFAULT
2014 * Set when the key is also a default key. Must not be set when
2015 * deleting a key.
2016 * %KEY_FLAG_RX
2017 * The key is valid for RX. Must not be set when deleting a key.
2018 * %KEY_FLAG_TX
2019 * The key is valid for TX. Must not be set when deleting a key.
2020 * %KEY_FLAG_GROUP
2021 * The key is a broadcast or group key.
2022 * %KEY_FLAG_PAIRWISE
2023 * The key is a pairwise key.
2024 * %KEY_FLAG_PMK
2025 * The key is a Pairwise Master Key (PMK).
2026 *
2027 * Valid and pre-defined combinations are:
2028 * %KEY_FLAG_GROUP_RX_TX
2029 * WEP key not to be installed as default key.
2030 * %KEY_FLAG_GROUP_RX_TX_DEFAULT
2031 * Default WEP or WPA-NONE key.
2032 * %KEY_FLAG_GROUP_RX
2033 * GTK key valid for RX only.
2034 * %KEY_FLAG_GROUP_TX_DEFAULT
2035 * GTK key valid for TX only, immediately taking over TX.
2036 * %KEY_FLAG_PAIRWISE_RX_TX
2037 * Pairwise key immediately becoming the active pairwise key.
2038 * %KEY_FLAG_PAIRWISE_RX
2039 * Pairwise key not yet valid for TX. (Only usable when Extended
2040 * Key ID is supported by the driver.)
2041 * %KEY_FLAG_PAIRWISE_RX_TX_MODIFY
2042 * Enable TX for a pairwise key installed with
2043 * KEY_FLAG_PAIRWISE_RX.
2044 *
2045 * Not a valid standalone key type but pre-defined to be combined
2046 * with other key_flags:
2047 * %KEY_FLAG_RX_TX
2048 * RX/TX key. */
2049 enum key_flag key_flag;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002050
2051 /**
2052 * link_id - MLO Link ID
2053 *
2054 * Set to a valid Link ID (0-14) when applicable, otherwise -1. */
2055 int link_id;
Hai Shalomfdcde762020-04-02 11:19:20 -07002056};
2057
Hai Shalom4fbc08f2020-05-18 12:37:00 -07002058enum wpa_driver_if_type {
2059 /**
2060 * WPA_IF_STATION - Station mode interface
2061 */
2062 WPA_IF_STATION,
2063
2064 /**
2065 * WPA_IF_AP_VLAN - AP mode VLAN interface
2066 *
2067 * This interface shares its address and Beacon frame with the main
2068 * BSS.
2069 */
2070 WPA_IF_AP_VLAN,
2071
2072 /**
2073 * WPA_IF_AP_BSS - AP mode BSS interface
2074 *
2075 * This interface has its own address and Beacon frame.
2076 */
2077 WPA_IF_AP_BSS,
2078
2079 /**
2080 * WPA_IF_P2P_GO - P2P Group Owner
2081 */
2082 WPA_IF_P2P_GO,
2083
2084 /**
2085 * WPA_IF_P2P_CLIENT - P2P Client
2086 */
2087 WPA_IF_P2P_CLIENT,
2088
2089 /**
2090 * WPA_IF_P2P_GROUP - P2P Group interface (will become either
2091 * WPA_IF_P2P_GO or WPA_IF_P2P_CLIENT, but the role is not yet known)
2092 */
2093 WPA_IF_P2P_GROUP,
2094
2095 /**
Sunil Ravia04bd252022-05-02 22:54:18 -07002096 * WPA_IF_P2P_DEVICE - P2P Device interface is used to identify the
Hai Shalom4fbc08f2020-05-18 12:37:00 -07002097 * abstracted P2P Device function in the driver
2098 */
2099 WPA_IF_P2P_DEVICE,
2100
2101 /*
2102 * WPA_IF_MESH - Mesh interface
2103 */
2104 WPA_IF_MESH,
2105
2106 /*
2107 * WPA_IF_TDLS - TDLS offchannel interface (used for pref freq only)
2108 */
2109 WPA_IF_TDLS,
2110
2111 /*
2112 * WPA_IF_IBSS - IBSS interface (used for pref freq only)
2113 */
2114 WPA_IF_IBSS,
2115
2116 /*
2117 * WPA_IF_NAN - NAN Device
2118 */
2119 WPA_IF_NAN,
2120
2121 /* keep last */
2122 WPA_IF_MAX
2123};
2124
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002125/**
2126 * struct wpa_driver_capa - Driver capability information
2127 */
2128struct wpa_driver_capa {
2129#define WPA_DRIVER_CAPA_KEY_MGMT_WPA 0x00000001
2130#define WPA_DRIVER_CAPA_KEY_MGMT_WPA2 0x00000002
2131#define WPA_DRIVER_CAPA_KEY_MGMT_WPA_PSK 0x00000004
2132#define WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK 0x00000008
2133#define WPA_DRIVER_CAPA_KEY_MGMT_WPA_NONE 0x00000010
2134#define WPA_DRIVER_CAPA_KEY_MGMT_FT 0x00000020
2135#define WPA_DRIVER_CAPA_KEY_MGMT_FT_PSK 0x00000040
Dmitry Shmidtd5e49232012-12-03 15:08:10 -08002136#define WPA_DRIVER_CAPA_KEY_MGMT_WAPI_PSK 0x00000080
Dmitry Shmidt807291d2015-01-27 13:40:23 -08002137#define WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B 0x00000100
2138#define WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B_192 0x00000200
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002139#define WPA_DRIVER_CAPA_KEY_MGMT_OWE 0x00000400
2140#define WPA_DRIVER_CAPA_KEY_MGMT_DPP 0x00000800
2141#define WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA256 0x00001000
2142#define WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA384 0x00002000
2143#define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA256 0x00004000
2144#define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA384 0x00008000
Hai Shalom74f70d42019-02-11 14:42:39 -08002145#define WPA_DRIVER_CAPA_KEY_MGMT_SAE 0x00010000
Tanmay Garga7fd80d2020-05-18 15:52:44 +05302146#define WPA_DRIVER_CAPA_KEY_MGMT_802_1X_SHA256 0x00020000
2147#define WPA_DRIVER_CAPA_KEY_MGMT_PSK_SHA256 0x00040000
2148#define WPA_DRIVER_CAPA_KEY_MGMT_TPK_HANDSHAKE 0x00080000
2149#define WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE 0x00100000
2150#define WPA_DRIVER_CAPA_KEY_MGMT_FT_802_1X_SHA384 0x00200000
2151#define WPA_DRIVER_CAPA_KEY_MGMT_CCKM 0x00400000
2152#define WPA_DRIVER_CAPA_KEY_MGMT_OSEN 0x00800000
Sunil Ravi89eba102022-09-13 21:04:37 -07002153#define WPA_DRIVER_CAPA_KEY_MGMT_SAE_EXT_KEY 0x01000000
2154#define WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE_EXT_KEY 0x02000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002155 /** Bitfield of supported key management suites */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002156 unsigned int key_mgmt;
Hai Shalom4fbc08f2020-05-18 12:37:00 -07002157 unsigned int key_mgmt_iftype[WPA_IF_MAX];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002158
2159#define WPA_DRIVER_CAPA_ENC_WEP40 0x00000001
2160#define WPA_DRIVER_CAPA_ENC_WEP104 0x00000002
2161#define WPA_DRIVER_CAPA_ENC_TKIP 0x00000004
2162#define WPA_DRIVER_CAPA_ENC_CCMP 0x00000008
Dmitry Shmidt04949592012-07-19 12:16:46 -07002163#define WPA_DRIVER_CAPA_ENC_WEP128 0x00000010
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07002164#define WPA_DRIVER_CAPA_ENC_GCMP 0x00000020
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08002165#define WPA_DRIVER_CAPA_ENC_GCMP_256 0x00000040
2166#define WPA_DRIVER_CAPA_ENC_CCMP_256 0x00000080
2167#define WPA_DRIVER_CAPA_ENC_BIP 0x00000100
2168#define WPA_DRIVER_CAPA_ENC_BIP_GMAC_128 0x00000200
2169#define WPA_DRIVER_CAPA_ENC_BIP_GMAC_256 0x00000400
2170#define WPA_DRIVER_CAPA_ENC_BIP_CMAC_256 0x00000800
Dmitry Shmidtf21452a2014-02-26 10:55:25 -08002171#define WPA_DRIVER_CAPA_ENC_GTK_NOT_USED 0x00001000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002172 /** Bitfield of supported cipher suites */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002173 unsigned int enc;
2174
2175#define WPA_DRIVER_AUTH_OPEN 0x00000001
2176#define WPA_DRIVER_AUTH_SHARED 0x00000002
2177#define WPA_DRIVER_AUTH_LEAP 0x00000004
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002178 /** Bitfield of supported IEEE 802.11 authentication algorithms */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002179 unsigned int auth;
2180
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002181/** Driver generated WPA/RSN IE */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002182#define WPA_DRIVER_FLAGS_DRIVER_IE 0x00000001
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002183/** Driver needs static WEP key setup after association command */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002184#define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC 0x00000002
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002185/** Driver takes care of all DFS operations */
Dmitry Shmidtd11f0192014-03-24 12:09:47 -07002186#define WPA_DRIVER_FLAGS_DFS_OFFLOAD 0x00000004
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002187/** Driver takes care of RSN 4-way handshake internally; PMK is configured with
Hai Shalomfdcde762020-04-02 11:19:20 -07002188 * struct wpa_driver_ops::set_key using key_flag = KEY_FLAG_PMK */
Hai Shalom74f70d42019-02-11 14:42:39 -08002189#define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X 0x00000008
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002190/** Driver is for a wired Ethernet interface */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002191#define WPA_DRIVER_FLAGS_WIRED 0x00000010
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002192/** Driver provides separate commands for authentication and association (SME in
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002193 * wpa_supplicant). */
2194#define WPA_DRIVER_FLAGS_SME 0x00000020
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002195/** Driver supports AP mode */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002196#define WPA_DRIVER_FLAGS_AP 0x00000040
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002197/** Driver needs static WEP key setup after association has been completed */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002198#define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE 0x00000080
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002199/** Driver supports dynamic HT 20/40 MHz channel changes during BSS lifetime */
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07002200#define WPA_DRIVER_FLAGS_HT_2040_COEX 0x00000100
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002201/** Driver supports concurrent P2P operations */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002202#define WPA_DRIVER_FLAGS_P2P_CONCURRENT 0x00000200
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002203/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002204 * Driver uses the initial interface as a dedicated management interface, i.e.,
2205 * it cannot be used for P2P group operations or non-P2P purposes.
2206 */
2207#define WPA_DRIVER_FLAGS_P2P_DEDICATED_INTERFACE 0x00000400
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002208/** This interface is P2P capable (P2P GO or P2P Client) */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002209#define WPA_DRIVER_FLAGS_P2P_CAPABLE 0x00000800
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002210/** Driver supports station and key removal when stopping an AP */
Dmitry Shmidta38abf92014-03-06 13:38:44 -08002211#define WPA_DRIVER_FLAGS_AP_TEARDOWN_SUPPORT 0x00001000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002212/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002213 * Driver uses the initial interface for P2P management interface and non-P2P
2214 * purposes (e.g., connect to infra AP), but this interface cannot be used for
2215 * P2P group operations.
2216 */
2217#define WPA_DRIVER_FLAGS_P2P_MGMT_AND_NON_P2P 0x00002000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002218/**
Hai Shalomc1a21442022-02-04 13:43:00 -08002219 * Driver is known to use valid error codes, i.e., when it indicates that
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002220 * something (e.g., association) fails, there was indeed a failure and the
2221 * operation does not end up getting completed successfully later.
2222 */
Hai Shalomc1a21442022-02-04 13:43:00 -08002223#define WPA_DRIVER_FLAGS_VALID_ERROR_CODES 0x00004000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002224/** Driver supports off-channel TX */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002225#define WPA_DRIVER_FLAGS_OFFCHANNEL_TX 0x00008000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002226/** Driver indicates TX status events for EAPOL Data frames */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002227#define WPA_DRIVER_FLAGS_EAPOL_TX_STATUS 0x00010000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002228/** Driver indicates TX status events for Deauth/Disassoc frames */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002229#define WPA_DRIVER_FLAGS_DEAUTH_TX_STATUS 0x00020000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002230/** Driver supports roaming (BSS selection) in firmware */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002231#define WPA_DRIVER_FLAGS_BSS_SELECTION 0x00040000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002232/** Driver supports operating as a TDLS peer */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002233#define WPA_DRIVER_FLAGS_TDLS_SUPPORT 0x00080000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002234/** Driver requires external TDLS setup/teardown/discovery */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002235#define WPA_DRIVER_FLAGS_TDLS_EXTERNAL_SETUP 0x00100000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002236/** Driver indicates support for Probe Response offloading in AP mode */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002237#define WPA_DRIVER_FLAGS_PROBE_RESP_OFFLOAD 0x00200000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002238/** Driver supports U-APSD in AP mode */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002239#define WPA_DRIVER_FLAGS_AP_UAPSD 0x00400000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002240/** Driver supports inactivity timer in AP mode */
Dmitry Shmidt04949592012-07-19 12:16:46 -07002241#define WPA_DRIVER_FLAGS_INACTIVITY_TIMER 0x00800000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002242/** Driver expects user space implementation of MLME in AP mode */
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07002243#define WPA_DRIVER_FLAGS_AP_MLME 0x01000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002244/** Driver supports SAE with user space SME */
Dmitry Shmidtd5e49232012-12-03 15:08:10 -08002245#define WPA_DRIVER_FLAGS_SAE 0x02000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002246/** Driver makes use of OBSS scan mechanism in wpa_supplicant */
Dmitry Shmidtd5e49232012-12-03 15:08:10 -08002247#define WPA_DRIVER_FLAGS_OBSS_SCAN 0x04000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002248/** Driver supports IBSS (Ad-hoc) mode */
Dmitry Shmidt700a1372013-03-15 14:14:44 -07002249#define WPA_DRIVER_FLAGS_IBSS 0x08000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002250/** Driver supports radar detection */
Dmitry Shmidtea69e842013-05-13 14:52:28 -07002251#define WPA_DRIVER_FLAGS_RADAR 0x10000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002252/** Driver supports a dedicated interface for P2P Device */
Dmitry Shmidt34af3062013-07-11 10:46:32 -07002253#define WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE 0x20000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002254/** Driver supports QoS Mapping */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08002255#define WPA_DRIVER_FLAGS_QOS_MAPPING 0x40000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002256/** Driver supports CSA in AP mode */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08002257#define WPA_DRIVER_FLAGS_AP_CSA 0x80000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002258/** Driver supports mesh */
2259#define WPA_DRIVER_FLAGS_MESH 0x0000000100000000ULL
2260/** Driver support ACS offload */
2261#define WPA_DRIVER_FLAGS_ACS_OFFLOAD 0x0000000200000000ULL
2262/** Driver supports key management offload */
2263#define WPA_DRIVER_FLAGS_KEY_MGMT_OFFLOAD 0x0000000400000000ULL
2264/** Driver supports TDLS channel switching */
2265#define WPA_DRIVER_FLAGS_TDLS_CHANNEL_SWITCH 0x0000000800000000ULL
Dmitry Shmidtff787d52015-01-12 13:01:47 -08002266/** Driver supports IBSS with HT datarates */
2267#define WPA_DRIVER_FLAGS_HT_IBSS 0x0000001000000000ULL
Dmitry Shmidt7f656022015-02-25 14:36:37 -08002268/** Driver supports IBSS with VHT datarates */
2269#define WPA_DRIVER_FLAGS_VHT_IBSS 0x0000002000000000ULL
Dmitry Shmidtb1e52102015-05-29 12:36:29 -07002270/** Driver supports automatic band selection */
2271#define WPA_DRIVER_FLAGS_SUPPORT_HW_MODE_ANY 0x0000004000000000ULL
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002272/** Driver supports simultaneous off-channel operations */
2273#define WPA_DRIVER_FLAGS_OFFCHANNEL_SIMULTANEOUS 0x0000008000000000ULL
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002274/** Driver supports full AP client state */
2275#define WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE 0x0000010000000000ULL
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07002276/** Driver supports P2P Listen offload */
2277#define WPA_DRIVER_FLAGS_P2P_LISTEN_OFFLOAD 0x0000020000000000ULL
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08002278/** Driver supports FILS */
2279#define WPA_DRIVER_FLAGS_SUPPORT_FILS 0x0000040000000000ULL
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08002280/** Driver supports Beacon frame TX rate configuration (legacy rates) */
2281#define WPA_DRIVER_FLAGS_BEACON_RATE_LEGACY 0x0000080000000000ULL
2282/** Driver supports Beacon frame TX rate configuration (HT rates) */
2283#define WPA_DRIVER_FLAGS_BEACON_RATE_HT 0x0000100000000000ULL
2284/** Driver supports Beacon frame TX rate configuration (VHT rates) */
2285#define WPA_DRIVER_FLAGS_BEACON_RATE_VHT 0x0000200000000000ULL
Dmitry Shmidtebd93af2017-02-21 13:40:44 -08002286/** Driver supports mgmt_tx with random TX address in non-connected state */
2287#define WPA_DRIVER_FLAGS_MGMT_TX_RANDOM_TA 0x0000400000000000ULL
2288/** Driver supports mgmt_tx with random TX addr in connected state */
2289#define WPA_DRIVER_FLAGS_MGMT_TX_RANDOM_TA_CONNECTED 0x0000800000000000ULL
2290/** Driver supports better BSS reporting with sched_scan in connected mode */
2291#define WPA_DRIVER_FLAGS_SCHED_SCAN_RELATIVE_RSSI 0x0001000000000000ULL
2292/** Driver supports HE capabilities */
2293#define WPA_DRIVER_FLAGS_HE_CAPABILITIES 0x0002000000000000ULL
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002294/** Driver supports FILS shared key offload */
2295#define WPA_DRIVER_FLAGS_FILS_SK_OFFLOAD 0x0004000000000000ULL
2296/** Driver supports all OCE STA specific mandatory features */
2297#define WPA_DRIVER_FLAGS_OCE_STA 0x0008000000000000ULL
2298/** Driver supports all OCE AP specific mandatory features */
2299#define WPA_DRIVER_FLAGS_OCE_AP 0x0010000000000000ULL
2300/**
2301 * Driver supports all OCE STA-CFON specific mandatory features only.
2302 * If a driver sets this bit but not the %WPA_DRIVER_FLAGS_OCE_AP, the
2303 * userspace shall assume that this driver may not support all OCE AP
2304 * functionality but can support only OCE STA-CFON functionality.
2305 */
2306#define WPA_DRIVER_FLAGS_OCE_STA_CFON 0x0020000000000000ULL
Roshan Pius3a1667e2018-07-03 15:17:14 -07002307/** Driver supports MFP-optional in the connect command */
2308#define WPA_DRIVER_FLAGS_MFP_OPTIONAL 0x0040000000000000ULL
Hai Shalom39ba6fc2019-01-22 12:40:38 -08002309/** Driver is a self-managed regulatory device */
2310#define WPA_DRIVER_FLAGS_SELF_MANAGED_REGULATORY 0x0080000000000000ULL
Hai Shalom74f70d42019-02-11 14:42:39 -08002311/** Driver supports FTM responder functionality */
2312#define WPA_DRIVER_FLAGS_FTM_RESPONDER 0x0100000000000000ULL
2313/** Driver support 4-way handshake offload for WPA-Personal */
2314#define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK 0x0200000000000000ULL
Hai Shalomb755a2a2020-04-23 21:49:02 -07002315/** Driver supports a separate control port TX for EAPOL frames */
Hai Shalomfdcde762020-04-02 11:19:20 -07002316#define WPA_DRIVER_FLAGS_CONTROL_PORT 0x0400000000000000ULL
2317/** Driver supports VLAN offload */
2318#define WPA_DRIVER_FLAGS_VLAN_OFFLOAD 0x0800000000000000ULL
2319/** Driver supports UPDATE_FT_IES command */
2320#define WPA_DRIVER_FLAGS_UPDATE_FT_IES 0x1000000000000000ULL
2321/** Driver can correctly rekey PTKs without Extended Key ID */
2322#define WPA_DRIVER_FLAGS_SAFE_PTK0_REKEYS 0x2000000000000000ULL
2323/** Driver supports Beacon protection */
2324#define WPA_DRIVER_FLAGS_BEACON_PROTECTION 0x4000000000000000ULL
2325/** Driver supports Extended Key ID */
2326#define WPA_DRIVER_FLAGS_EXTENDED_KEY_ID 0x8000000000000000ULL
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002327 u64 flags;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002328
Hai Shalomb755a2a2020-04-23 21:49:02 -07002329/** Driver supports a separate control port RX for EAPOL frames */
2330#define WPA_DRIVER_FLAGS2_CONTROL_PORT_RX 0x0000000000000001ULL
Hai Shalom899fcc72020-10-19 14:38:18 -07002331/** Driver supports TX status reports for EAPOL frames through control port */
2332#define WPA_DRIVER_FLAGS2_CONTROL_PORT_TX_STATUS 0x0000000000000002ULL
Sunil Ravi89eba102022-09-13 21:04:37 -07002333/** Driver supports secure LTF in AP mode */
2334#define WPA_DRIVER_FLAGS2_SEC_LTF_AP 0x0000000000000004ULL
2335/** Driver supports secure RTT measurement exchange in AP mode */
2336#define WPA_DRIVER_FLAGS2_SEC_RTT_AP 0x0000000000000008ULL
Hai Shalom60840252021-02-19 19:02:11 -08002337/**
2338 * Driver supports protection of range negotiation and measurement management
Sunil Ravi89eba102022-09-13 21:04:37 -07002339 * frames in AP mode
Hai Shalom60840252021-02-19 19:02:11 -08002340 */
Sunil Ravi89eba102022-09-13 21:04:37 -07002341#define WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_AP 0x0000000000000010ULL
Hai Shalom60840252021-02-19 19:02:11 -08002342/** Driver supports Beacon frame TX rate configuration (HE rates) */
2343#define WPA_DRIVER_FLAGS2_BEACON_RATE_HE 0x0000000000000020ULL
2344/** Driver supports Beacon protection only in client mode */
2345#define WPA_DRIVER_FLAGS2_BEACON_PROTECTION_CLIENT 0x0000000000000040ULL
2346/** Driver supports Operating Channel Validation */
2347#define WPA_DRIVER_FLAGS2_OCV 0x0000000000000080ULL
2348/** Driver expects user space implementation of SME in AP mode */
2349#define WPA_DRIVER_FLAGS2_AP_SME 0x0000000000000100ULL
Sunil Ravia04bd252022-05-02 22:54:18 -07002350/** Driver handles SA Query procedures in AP mode */
2351#define WPA_DRIVER_FLAGS2_SA_QUERY_OFFLOAD_AP 0x0000000000000200ULL
2352/** Driver supports background radar/CAC detection */
Sunil Ravi2a14cf12023-11-21 00:54:38 +00002353#define WPA_DRIVER_FLAGS2_RADAR_BACKGROUND 0x0000000000000400ULL
Sunil Ravi89eba102022-09-13 21:04:37 -07002354/** Driver supports secure LTF in STA mode */
2355#define WPA_DRIVER_FLAGS2_SEC_LTF_STA 0x0000000000000800ULL
2356/** Driver supports secure RTT measurement exchange in STA mode */
2357#define WPA_DRIVER_FLAGS2_SEC_RTT_STA 0x0000000000001000ULL
2358/**
2359 * Driver supports protection of range negotiation and measurement management
2360 * frames in STA mode
2361 */
2362#define WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_STA 0x0000000000002000ULL
Sunil Ravi77d572f2023-01-17 23:58:31 +00002363/** Driver supports MLO in station/AP mode */
2364#define WPA_DRIVER_FLAGS2_MLO 0x0000000000004000ULL
Sunil Ravi2a14cf12023-11-21 00:54:38 +00002365/** Driver supports minimal scan request probe content */
2366#define WPA_DRIVER_FLAGS2_SCAN_MIN_PREQ 0x0000000000008000ULL
2367/** Driver supports SAE authentication offload in STA mode */
2368#define WPA_DRIVER_FLAGS2_SAE_OFFLOAD_STA 0x0000000000010000ULL
2369/** Driver support AP_PSK authentication offload */
2370#define WPA_DRIVER_FLAGS2_4WAY_HANDSHAKE_AP_PSK 0x0000000000020000ULL
2371/** Driver supports OWE STA offload */
2372#define WPA_DRIVER_FLAGS2_OWE_OFFLOAD_STA 0x0000000000040000ULL
2373/** Driver supports OWE AP offload */
2374#define WPA_DRIVER_FLAGS2_OWE_OFFLOAD_AP 0x0000000000080000ULL
2375/** Driver support AP SAE authentication offload */
2376#define WPA_DRIVER_FLAGS2_SAE_OFFLOAD_AP 0x0000000000100000ULL
Sunil Ravi7f769292024-07-23 22:21:32 +00002377/** Driver supports TWT responder in HT and VHT modes */
2378#define WPA_DRIVER_FLAGS2_HT_VHT_TWT_RESPONDER 0x0000000000200000ULL
2379/** Driver supports RSN override elements */
2380#define WPA_DRIVER_FLAGS2_RSN_OVERRIDE_STA 0x0000000000400000ULL
Sunil Ravic0f5d412024-09-11 22:12:49 +00002381/** Driver supports NAN offload */
2382#define WPA_DRIVER_FLAGS2_NAN_OFFLOAD 0x0000000000800000ULL
Hai Shalomb755a2a2020-04-23 21:49:02 -07002383 u64 flags2;
2384
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002385#define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \
2386 (drv_flags & WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE)
2387
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002388 unsigned int wmm_ac_supported:1;
2389
2390 unsigned int mac_addr_rand_scan_supported:1;
2391 unsigned int mac_addr_rand_sched_scan_supported:1;
2392
2393 /** Maximum number of supported active probe SSIDs */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002394 int max_scan_ssids;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002395
2396 /** Maximum number of supported active probe SSIDs for sched_scan */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002397 int max_sched_scan_ssids;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002398
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08002399 /** Maximum number of supported scan plans for scheduled scan */
2400 unsigned int max_sched_scan_plans;
2401
2402 /** Maximum interval in a scan plan. In seconds */
2403 u32 max_sched_scan_plan_interval;
2404
2405 /** Maximum number of iterations in a single scan plan */
2406 u32 max_sched_scan_plan_iterations;
2407
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002408 /** Whether sched_scan (offloaded scanning) is supported */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002409 int sched_scan_supported;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002410
2411 /** Maximum number of supported match sets for sched_scan */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002412 int max_match_sets;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002413
2414 /**
2415 * max_remain_on_chan - Maximum remain-on-channel duration in msec
2416 */
2417 unsigned int max_remain_on_chan;
2418
2419 /**
2420 * max_stations - Maximum number of associated stations the driver
2421 * supports in AP mode
2422 */
2423 unsigned int max_stations;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002424
2425 /**
2426 * probe_resp_offloads - Bitmap of supported protocols by the driver
2427 * for Probe Response offloading.
2428 */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002429/** Driver Probe Response offloading support for WPS ver. 1 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002430#define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS 0x00000001
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002431/** Driver Probe Response offloading support for WPS ver. 2 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002432#define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS2 0x00000002
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002433/** Driver Probe Response offloading support for P2P */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002434#define WPA_DRIVER_PROBE_RESP_OFFLOAD_P2P 0x00000004
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002435/** Driver Probe Response offloading support for IEEE 802.11u (Interworking) */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002436#define WPA_DRIVER_PROBE_RESP_OFFLOAD_INTERWORKING 0x00000008
2437 unsigned int probe_resp_offloads;
Dmitry Shmidt444d5672013-04-01 13:08:44 -07002438
Dmitry Shmidt8bae4132013-06-06 11:25:10 -07002439 unsigned int max_acl_mac_addrs;
2440
Dmitry Shmidt444d5672013-04-01 13:08:44 -07002441 /**
Dmitry Shmidtc2ebb4b2013-07-24 12:57:51 -07002442 * Number of supported concurrent channels
2443 */
2444 unsigned int num_multichan_concurrent;
2445
2446 /**
Dmitry Shmidt444d5672013-04-01 13:08:44 -07002447 * extended_capa - extended capabilities in driver/device
2448 *
2449 * Must be allocated and freed by driver and the pointers must be
2450 * valid for the lifetime of the driver, i.e., freed in deinit()
2451 */
2452 const u8 *extended_capa, *extended_capa_mask;
2453 unsigned int extended_capa_len;
Dmitry Shmidtb58836e2014-04-29 14:35:56 -07002454
2455 struct wowlan_triggers wowlan_triggers;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002456
2457/** Driver adds the DS Params Set IE in Probe Request frames */
2458#define WPA_DRIVER_FLAGS_DS_PARAM_SET_IE_IN_PROBES 0x00000001
2459/** Driver adds the WFA TPC IE in Probe Request frames */
2460#define WPA_DRIVER_FLAGS_WFA_TPC_IE_IN_PROBES 0x00000002
2461/** Driver handles quiet period requests */
2462#define WPA_DRIVER_FLAGS_QUIET 0x00000004
2463/**
2464 * Driver is capable of inserting the current TX power value into the body of
2465 * transmitted frames.
2466 * Background: Some Action frames include a TPC Report IE. This IE contains a
2467 * TX power field, which has to be updated by lower layers. One such Action
2468 * frame is Link Measurement Report (part of RRM). Another is TPC Report (part
2469 * of spectrum management). Note that this insertion takes place at a fixed
2470 * offset, namely the 6th byte in the Action frame body.
2471 */
2472#define WPA_DRIVER_FLAGS_TX_POWER_INSERTION 0x00000008
Dmitry Shmidt849734c2016-05-27 09:59:01 -07002473/**
2474 * Driver supports RRM. With this support, the driver will accept to use RRM in
2475 * (Re)Association Request frames, without supporting quiet period.
2476 */
2477#define WPA_DRIVER_FLAGS_SUPPORT_RRM 0x00000010
2478
Dmitry Shmidt29333592017-01-09 12:27:11 -08002479/** Driver supports setting the scan dwell time */
2480#define WPA_DRIVER_FLAGS_SUPPORT_SET_SCAN_DWELL 0x00000020
2481/** Driver supports Beacon Report Measurement */
2482#define WPA_DRIVER_FLAGS_SUPPORT_BEACON_REPORT 0x00000040
2483
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002484 u32 rrm_flags;
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002485
2486 /* Driver concurrency capabilities */
2487 unsigned int conc_capab;
2488 /* Maximum number of concurrent channels on 2.4 GHz */
2489 unsigned int max_conc_chan_2_4;
2490 /* Maximum number of concurrent channels on 5 GHz */
2491 unsigned int max_conc_chan_5_0;
2492
2493 /* Maximum number of supported CSA counters */
2494 u16 max_csa_counters;
Sunil Ravi89eba102022-09-13 21:04:37 -07002495
2496 /* Maximum number of supported AKM suites in commands */
2497 unsigned int max_num_akms;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002498
2499 /* Maximum number of interfaces supported for MBSSID advertisement */
2500 unsigned int mbssid_max_interfaces;
2501 /* Maximum profile periodicity for enhanced MBSSID advertisement */
2502 unsigned int ema_max_periodicity;
Sunil Ravi79e6c4f2025-01-04 00:47:06 +00002503
2504 /* Maximum number of bytes of extra IE(s) that can be added to Probe
2505 * Request frames */
2506 size_t max_probe_req_ie_len;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002507};
2508
2509
2510struct hostapd_data;
2511
Sunil Ravi036cec52023-03-29 11:35:17 -07002512enum guard_interval {
2513 GUARD_INTERVAL_0_4 = 1,
2514 GUARD_INTERVAL_0_8 = 2,
2515 GUARD_INTERVAL_1_6 = 3,
2516 GUARD_INTERVAL_3_2 = 4,
2517};
2518
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002519#define STA_DRV_DATA_TX_MCS BIT(0)
2520#define STA_DRV_DATA_RX_MCS BIT(1)
2521#define STA_DRV_DATA_TX_VHT_MCS BIT(2)
2522#define STA_DRV_DATA_RX_VHT_MCS BIT(3)
2523#define STA_DRV_DATA_TX_VHT_NSS BIT(4)
2524#define STA_DRV_DATA_RX_VHT_NSS BIT(5)
2525#define STA_DRV_DATA_TX_SHORT_GI BIT(6)
2526#define STA_DRV_DATA_RX_SHORT_GI BIT(7)
Roshan Pius3a1667e2018-07-03 15:17:14 -07002527#define STA_DRV_DATA_LAST_ACK_RSSI BIT(8)
Hai Shalomc1a21442022-02-04 13:43:00 -08002528#define STA_DRV_DATA_CONN_TIME BIT(9)
Sunil Ravi77d572f2023-01-17 23:58:31 +00002529#define STA_DRV_DATA_TX_HE_MCS BIT(10)
2530#define STA_DRV_DATA_RX_HE_MCS BIT(11)
2531#define STA_DRV_DATA_TX_HE_NSS BIT(12)
2532#define STA_DRV_DATA_RX_HE_NSS BIT(13)
Sunil Ravi036cec52023-03-29 11:35:17 -07002533#define STA_DRV_DATA_TX_HE_DCM BIT(14)
2534#define STA_DRV_DATA_RX_HE_DCM BIT(15)
2535#define STA_DRV_DATA_TX_HE_GI BIT(16)
2536#define STA_DRV_DATA_RX_HE_GI BIT(17)
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002537
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002538struct hostap_sta_driver_data {
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002539 unsigned long rx_packets, tx_packets;
2540 unsigned long long rx_bytes, tx_bytes;
Hai Shalom81f62d82019-07-22 12:10:00 -07002541 unsigned long long rx_airtime, tx_airtime;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002542 unsigned long long beacons_count;
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002543 int bytes_64bit; /* whether 64-bit byte counters are supported */
Sunil Ravi77d572f2023-01-17 23:58:31 +00002544 unsigned long current_tx_rate; /* in kbps */
2545 unsigned long current_rx_rate; /* in kbps */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002546 unsigned long inactive_msec;
Hai Shalomc1a21442022-02-04 13:43:00 -08002547 unsigned long connected_sec;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002548 unsigned long flags; /* bitfield of STA_DRV_DATA_* */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002549 unsigned long num_ps_buf_frames;
2550 unsigned long tx_retry_failed;
2551 unsigned long tx_retry_count;
Roshan Pius3a1667e2018-07-03 15:17:14 -07002552 s8 last_ack_rssi;
Hai Shalom81f62d82019-07-22 12:10:00 -07002553 unsigned long backlog_packets;
2554 unsigned long backlog_bytes;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002555 unsigned long fcs_error_count;
2556 unsigned long beacon_loss_count;
2557 unsigned long expected_throughput;
2558 unsigned long rx_drop_misc;
2559 unsigned long rx_mpdus;
2560 int signal; /* dBm; or -WPA_INVALID_NOISE */
2561 u8 rx_hemcs;
2562 u8 tx_hemcs;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002563 u8 rx_vhtmcs;
2564 u8 tx_vhtmcs;
2565 u8 rx_mcs;
2566 u8 tx_mcs;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002567 u8 rx_he_nss;
2568 u8 tx_he_nss;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002569 u8 rx_vht_nss;
2570 u8 tx_vht_nss;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002571 s8 avg_signal; /* dBm */
2572 s8 avg_beacon_signal; /* dBm */
2573 s8 avg_ack_signal; /* dBm */
Sunil Ravi036cec52023-03-29 11:35:17 -07002574 enum guard_interval rx_guard_interval, tx_guard_interval;
2575 u8 rx_dcm, tx_dcm;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002576};
2577
2578struct hostapd_sta_add_params {
2579 const u8 *addr;
2580 u16 aid;
2581 u16 capability;
2582 const u8 *supp_rates;
2583 size_t supp_rates_len;
2584 u16 listen_interval;
2585 const struct ieee80211_ht_capabilities *ht_capabilities;
Dmitry Shmidta54fa5f2013-01-15 13:53:35 -08002586 const struct ieee80211_vht_capabilities *vht_capabilities;
Dmitry Shmidtbd14a572014-02-18 10:33:49 -08002587 int vht_opmode_enabled;
2588 u8 vht_opmode;
Hai Shalom81f62d82019-07-22 12:10:00 -07002589 const struct ieee80211_he_capabilities *he_capab;
2590 size_t he_capab_len;
Hai Shalom4fbc08f2020-05-18 12:37:00 -07002591 const struct ieee80211_he_6ghz_band_cap *he_6ghz_capab;
Sunil Ravia04bd252022-05-02 22:54:18 -07002592 const struct ieee80211_eht_capabilities *eht_capab;
2593 size_t eht_capab_len;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002594 u32 flags; /* bitmask of WPA_STA_* flags */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002595 u32 flags_mask; /* unset bits in flags */
2596#ifdef CONFIG_MESH
2597 enum mesh_plink_state plink_state;
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07002598 u16 peer_aid;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002599#endif /* CONFIG_MESH */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002600 int set; /* Set STA parameters instead of add */
2601 u8 qosinfo;
Dmitry Shmidtf8623282013-02-20 14:34:59 -08002602 const u8 *ext_capab;
2603 size_t ext_capab_len;
Dmitry Shmidt344abd32014-01-14 13:17:00 -08002604 const u8 *supp_channels;
2605 size_t supp_channels_len;
2606 const u8 *supp_oper_classes;
2607 size_t supp_oper_classes_len;
Dmitry Shmidt849734c2016-05-27 09:59:01 -07002608 int support_p2p_ps;
Sunil Ravi036cec52023-03-29 11:35:17 -07002609
2610 bool mld_link_sta;
2611 s8 mld_link_id;
2612 const u8 *mld_link_addr;
Sunil Ravi79e6c4f2025-01-04 00:47:06 +00002613 u16 eml_cap;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002614};
2615
Dmitry Shmidt8bae4132013-06-06 11:25:10 -07002616struct mac_address {
2617 u8 addr[ETH_ALEN];
2618};
2619
2620struct hostapd_acl_params {
2621 u8 acl_policy;
2622 unsigned int num_mac_acl;
2623 struct mac_address mac_acl[0];
2624};
2625
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002626struct wpa_init_params {
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002627 void *global_priv;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002628 const u8 *bssid;
2629 const char *ifname;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002630 const char *driver_params;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002631 int use_pae_group_addr;
2632 char **bridge;
2633 size_t num_bridge;
2634
2635 u8 *own_addr; /* buffer for writing own MAC address */
2636};
2637
2638
2639struct wpa_bss_params {
2640 /** Interface name (for multi-SSID/VLAN support) */
2641 const char *ifname;
2642 /** Whether IEEE 802.1X or WPA/WPA2 is enabled */
2643 int enabled;
2644
2645 int wpa;
2646 int ieee802_1x;
2647 int wpa_group;
2648 int wpa_pairwise;
2649 int wpa_key_mgmt;
2650 int rsn_preauth;
2651 enum mfp_options ieee80211w;
2652};
2653
2654#define WPA_STA_AUTHORIZED BIT(0)
2655#define WPA_STA_WMM BIT(1)
2656#define WPA_STA_SHORT_PREAMBLE BIT(2)
2657#define WPA_STA_MFP BIT(3)
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002658#define WPA_STA_TDLS_PEER BIT(4)
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002659#define WPA_STA_AUTHENTICATED BIT(5)
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002660#define WPA_STA_ASSOCIATED BIT(6)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002661
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002662enum tdls_oper {
2663 TDLS_DISCOVERY_REQ,
2664 TDLS_SETUP,
2665 TDLS_TEARDOWN,
2666 TDLS_ENABLE_LINK,
2667 TDLS_DISABLE_LINK,
2668 TDLS_ENABLE,
2669 TDLS_DISABLE
2670};
2671
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07002672enum wnm_oper {
2673 WNM_SLEEP_ENTER_CONFIRM,
2674 WNM_SLEEP_ENTER_FAIL,
2675 WNM_SLEEP_EXIT_CONFIRM,
2676 WNM_SLEEP_EXIT_FAIL,
2677 WNM_SLEEP_TFS_REQ_IE_ADD, /* STA requests driver to add TFS req IE */
2678 WNM_SLEEP_TFS_REQ_IE_NONE, /* STA requests empty TFS req IE */
2679 WNM_SLEEP_TFS_REQ_IE_SET, /* AP requests driver to set TFS req IE for
2680 * a STA */
2681 WNM_SLEEP_TFS_RESP_IE_ADD, /* AP requests driver to add TFS resp IE
2682 * for a STA */
2683 WNM_SLEEP_TFS_RESP_IE_NONE, /* AP requests empty TFS resp IE */
2684 WNM_SLEEP_TFS_RESP_IE_SET, /* AP requests driver to set TFS resp IE
2685 * for a STA */
2686 WNM_SLEEP_TFS_IE_DEL /* AP delete the TFS IE */
2687};
2688
Roshan Pius3a1667e2018-07-03 15:17:14 -07002689/* enum smps_mode - SMPS mode definitions */
2690enum smps_mode {
2691 SMPS_AUTOMATIC,
2692 SMPS_OFF,
2693 SMPS_DYNAMIC,
2694 SMPS_STATIC,
2695
2696 /* Keep last */
2697 SMPS_INVALID,
2698};
2699
Hai Shalom74f70d42019-02-11 14:42:39 -08002700#define WPA_INVALID_NOISE 9999
Dmitry Shmidt34af3062013-07-11 10:46:32 -07002701
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002702/**
2703 * struct wpa_signal_info - Information about channel signal quality
Hai Shalom74f70d42019-02-11 14:42:39 -08002704 * @frequency: control frequency
2705 * @above_threshold: true if the above threshold was crossed
2706 * (relevant for a CQM event)
Sunil Ravi77d572f2023-01-17 23:58:31 +00002707 * @data: STA information
Hai Shalom74f70d42019-02-11 14:42:39 -08002708 * @current_noise: %WPA_INVALID_NOISE if not supported
Hai Shalom74f70d42019-02-11 14:42:39 -08002709 * @chanwidth: channel width
2710 * @center_frq1: center frequency for the first segment
2711 * @center_frq2: center frequency for the second segment (if relevant)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002712 */
2713struct wpa_signal_info {
2714 u32 frequency;
2715 int above_threshold;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002716 struct hostap_sta_driver_data data;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002717 int current_noise;
Dmitry Shmidt34af3062013-07-11 10:46:32 -07002718 enum chan_width chanwidth;
2719 int center_frq1;
2720 int center_frq2;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002721};
2722
Sunil Ravi89eba102022-09-13 21:04:37 -07002723struct wpa_mlo_signal_info {
2724 u16 valid_links;
2725 struct wpa_signal_info links[MAX_NUM_MLD_LINKS];
2726};
2727
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002728/**
Hai Shalom74f70d42019-02-11 14:42:39 -08002729 * struct wpa_channel_info - Information about the current channel
2730 * @frequency: Center frequency of the primary 20 MHz channel
2731 * @chanwidth: Width of the current operating channel
2732 * @sec_channel: Location of the secondary 20 MHz channel (either +1 or -1).
2733 * This field is only filled in when using a 40 MHz channel.
2734 * @center_frq1: Center frequency of frequency segment 0
2735 * @center_frq2: Center frequency of frequency segment 1 (for 80+80 channels)
2736 * @seg1_idx: Frequency segment 1 index when using a 80+80 channel. This is
2737 * derived from center_frq2 for convenience.
2738 */
2739struct wpa_channel_info {
2740 u32 frequency;
2741 enum chan_width chanwidth;
2742 int sec_channel;
2743 int center_frq1;
2744 int center_frq2;
2745 u8 seg1_idx;
2746};
2747
2748/**
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002749 * struct beacon_data - Beacon data
2750 * @head: Head portion of Beacon frame (before TIM IE)
2751 * @tail: Tail portion of Beacon frame (after TIM IE)
2752 * @beacon_ies: Extra information element(s) to add into Beacon frames or %NULL
2753 * @proberesp_ies: Extra information element(s) to add into Probe Response
2754 * frames or %NULL
2755 * @assocresp_ies: Extra information element(s) to add into (Re)Association
2756 * Response frames or %NULL
2757 * @probe_resp: Probe Response frame template
2758 * @head_len: Length of @head
2759 * @tail_len: Length of @tail
2760 * @beacon_ies_len: Length of beacon_ies in octets
2761 * @proberesp_ies_len: Length of proberesp_ies in octets
2762 * @proberesp_ies_len: Length of proberesp_ies in octets
2763 * @probe_resp_len: Length of probe response template (@probe_resp)
2764 */
2765struct beacon_data {
2766 u8 *head, *tail;
2767 u8 *beacon_ies;
2768 u8 *proberesp_ies;
2769 u8 *assocresp_ies;
2770 u8 *probe_resp;
2771
2772 size_t head_len, tail_len;
2773 size_t beacon_ies_len;
2774 size_t proberesp_ies_len;
2775 size_t assocresp_ies_len;
2776 size_t probe_resp_len;
2777};
2778
2779/**
2780 * struct csa_settings - Settings for channel switch command
2781 * @cs_count: Count in Beacon frames (TBTT) to perform the switch
2782 * @block_tx: 1 - block transmission for CSA period
2783 * @freq_params: Next channel frequency parameter
2784 * @beacon_csa: Beacon/probe resp/asooc resp info for CSA period
2785 * @beacon_after: Next beacon/probe resp/asooc resp info
2786 * @counter_offset_beacon: Offset to the count field in beacon's tail
2787 * @counter_offset_presp: Offset to the count field in probe resp.
Sunil Ravib0ac25f2024-07-12 01:42:03 +00002788 * @link_id: Link ID to determine the link for MLD; -1 for non-MLD
Sunil Ravi7f769292024-07-23 22:21:32 +00002789 * @ubpr: Unsolicited broadcast Probe Response frame data
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002790 */
2791struct csa_settings {
2792 u8 cs_count;
2793 u8 block_tx;
2794
2795 struct hostapd_freq_params freq_params;
2796 struct beacon_data beacon_csa;
2797 struct beacon_data beacon_after;
2798
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002799 u16 counter_offset_beacon[2];
2800 u16 counter_offset_presp[2];
Sunil Ravi036cec52023-03-29 11:35:17 -07002801
Sunil Ravib0ac25f2024-07-12 01:42:03 +00002802 int link_id;
Sunil Ravi7f769292024-07-23 22:21:32 +00002803
2804 struct unsol_bcast_probe_resp ubpr;
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002805};
2806
Sunil Ravia04bd252022-05-02 22:54:18 -07002807/**
2808 * struct cca_settings - Settings for color switch command
2809 * @cca_count: Count in Beacon frames (TBTT) to perform the switch
2810 * @cca_color: The new color that we are switching to
2811 * @beacon_cca: Beacon/Probe Response/(Re)Association Response frame info for
2812 * color switch period
2813 * @beacon_after: Next Beacon/Probe Response/(Re)Association Response frame info
2814 * @counter_offset_beacon: Offset to the count field in Beacon frame tail
2815 * @counter_offset_presp: Offset to the count field in Probe Response frame
Sunil Ravi7f769292024-07-23 22:21:32 +00002816 * @ubpr: Unsolicited broadcast Probe Response frame data
2817 * @link_id: If >= 0 indicates the link of the AP MLD to configure
Sunil Ravia04bd252022-05-02 22:54:18 -07002818 */
2819struct cca_settings {
2820 u8 cca_count;
2821 u8 cca_color;
2822
2823 struct beacon_data beacon_cca;
2824 struct beacon_data beacon_after;
2825
2826 u16 counter_offset_beacon;
2827 u16 counter_offset_presp;
Sunil Ravi7f769292024-07-23 22:21:32 +00002828
2829 struct unsol_bcast_probe_resp ubpr;
2830
2831 int link_id;
Sunil Ravia04bd252022-05-02 22:54:18 -07002832};
2833
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07002834/* TDLS peer capabilities for send_tdls_mgmt() */
2835enum tdls_peer_capability {
2836 TDLS_PEER_HT = BIT(0),
2837 TDLS_PEER_VHT = BIT(1),
2838 TDLS_PEER_WMM = BIT(2),
Hai Shalomc1a21442022-02-04 13:43:00 -08002839 TDLS_PEER_HE = BIT(3),
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07002840};
2841
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002842/* valid info in the wmm_params struct */
2843enum wmm_params_valid_info {
2844 WMM_PARAMS_UAPSD_QUEUES_INFO = BIT(0),
2845};
2846
2847/**
2848 * struct wmm_params - WMM parameterss configured for this association
2849 * @info_bitmap: Bitmap of valid wmm_params info; indicates what fields
2850 * of the struct contain valid information.
2851 * @uapsd_queues: Bitmap of ACs configured for uapsd (valid only if
2852 * %WMM_PARAMS_UAPSD_QUEUES_INFO is set)
2853 */
2854struct wmm_params {
2855 u8 info_bitmap;
2856 u8 uapsd_queues;
2857};
2858
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07002859#ifdef CONFIG_MACSEC
2860struct macsec_init_params {
Hai Shalome21d4e82020-04-29 16:34:06 -07002861 bool always_include_sci;
2862 bool use_es;
2863 bool use_scb;
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07002864};
2865#endif /* CONFIG_MACSEC */
2866
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002867enum drv_br_port_attr {
2868 DRV_BR_PORT_ATTR_PROXYARP,
2869 DRV_BR_PORT_ATTR_HAIRPIN_MODE,
Sunil Ravi036cec52023-03-29 11:35:17 -07002870 DRV_BR_PORT_ATTR_MCAST2UCAST,
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002871};
2872
2873enum drv_br_net_param {
2874 DRV_BR_NET_PARAM_GARP_ACCEPT,
Dmitry Shmidt83474442015-04-15 13:47:09 -07002875 DRV_BR_MULTICAST_SNOOPING,
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002876};
2877
2878struct drv_acs_params {
2879 /* Selected mode (HOSTAPD_MODE_*) */
2880 enum hostapd_hw_mode hw_mode;
2881
2882 /* Indicates whether HT is enabled */
2883 int ht_enabled;
2884
2885 /* Indicates whether HT40 is enabled */
2886 int ht40_enabled;
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07002887
2888 /* Indicates whether VHT is enabled */
2889 int vht_enabled;
2890
2891 /* Configured ACS channel width */
2892 u16 ch_width;
2893
Ahmed ElArabawy0ff61c52019-12-26 12:38:39 -08002894 /* ACS frequency list info */
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002895 const int *freq_list;
Hai Shalomfdcde762020-04-02 11:19:20 -07002896
2897 /* Indicates whether EDMG is enabled */
2898 int edmg_enabled;
Sunil Ravia04bd252022-05-02 22:54:18 -07002899
2900 /* Indicates whether EHT is enabled */
2901 bool eht_enabled;
Sunil Ravib0ac25f2024-07-12 01:42:03 +00002902
2903 /* Indicates the link if MLO case; -1 otherwise */
2904 int link_id;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002905};
2906
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002907struct wpa_bss_trans_info {
2908 u8 mbo_transition_reason;
2909 u8 n_candidates;
2910 u8 *bssid;
2911};
2912
2913struct wpa_bss_candidate_info {
2914 u8 num;
2915 struct candidate_list {
2916 u8 bssid[ETH_ALEN];
2917 u8 is_accept;
2918 u32 reject_reason;
2919 } *candidates;
2920};
2921
2922struct wpa_pmkid_params {
2923 const u8 *bssid;
2924 const u8 *ssid;
2925 size_t ssid_len;
2926 const u8 *fils_cache_id;
2927 const u8 *pmkid;
2928 const u8 *pmk;
2929 size_t pmk_len;
Hai Shalomfdcde762020-04-02 11:19:20 -07002930 u32 pmk_lifetime;
2931 u8 pmk_reauth_threshold;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002932};
2933
2934/* Mask used to specify which connection parameters have to be updated */
2935enum wpa_drv_update_connect_params_mask {
2936 WPA_DRV_UPDATE_ASSOC_IES = BIT(0),
2937 WPA_DRV_UPDATE_FILS_ERP_INFO = BIT(1),
2938 WPA_DRV_UPDATE_AUTH_TYPE = BIT(2),
Winnie Chen4138eec2022-11-10 16:32:53 +08002939#if defined(CONFIG_DRIVER_NL80211_BRCM) || defined(CONFIG_DRIVER_NL80211_SYNA)
Vinayak Yadawade62409f2022-01-20 12:32:07 +05302940 WPA_DRV_UPDATE_TD_POLICY = BIT(3),
Winnie Chen4138eec2022-11-10 16:32:53 +08002941#endif /* CONFIG_DRIVER_NL80211_BRCM || CONFIG_DRIVER_NL80211_SYNA */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002942};
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07002943
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002944/**
Roshan Pius3a1667e2018-07-03 15:17:14 -07002945 * struct external_auth - External authentication trigger parameters
2946 *
2947 * These are used across the external authentication request and event
2948 * interfaces.
2949 * @action: Action type / trigger for external authentication. Only significant
2950 * for the event interface.
2951 * @bssid: BSSID of the peer with which the authentication has to happen. Used
2952 * by both the request and event interface.
2953 * @ssid: SSID of the AP. Used by both the request and event interface.
2954 * @ssid_len: SSID length in octets.
2955 * @key_mgmt_suite: AKM suite of the respective authentication. Optional for
2956 * the request interface.
2957 * @status: Status code, %WLAN_STATUS_SUCCESS for successful authentication,
2958 * use %WLAN_STATUS_UNSPECIFIED_FAILURE if wpa_supplicant cannot give
2959 * the real status code for failures. Used only for the request interface
2960 * from user space to the driver.
Hai Shalom5f92bc92019-04-18 11:54:11 -07002961 * @pmkid: Generated PMKID as part of external auth exchange (e.g., SAE).
Sunil Ravi036cec52023-03-29 11:35:17 -07002962 * @mld_addr: AP's MLD address or %NULL if MLO is not used
Roshan Pius3a1667e2018-07-03 15:17:14 -07002963 */
2964struct external_auth {
2965 enum {
2966 EXT_AUTH_START,
2967 EXT_AUTH_ABORT,
2968 } action;
Hai Shalom5f92bc92019-04-18 11:54:11 -07002969 const u8 *bssid;
2970 const u8 *ssid;
Roshan Pius3a1667e2018-07-03 15:17:14 -07002971 size_t ssid_len;
2972 unsigned int key_mgmt_suite;
2973 u16 status;
Hai Shalom5f92bc92019-04-18 11:54:11 -07002974 const u8 *pmkid;
Sunil Ravi036cec52023-03-29 11:35:17 -07002975 const u8 *mld_addr;
Roshan Pius3a1667e2018-07-03 15:17:14 -07002976};
2977
Sunil Ravi89eba102022-09-13 21:04:37 -07002978#define WPAS_MAX_PASN_PEERS 10
2979
2980enum pasn_status {
2981 PASN_STATUS_SUCCESS = 0,
2982 PASN_STATUS_FAILURE = 1,
2983};
2984
2985/**
2986 * struct pasn_peer - PASN peer parameters
2987 *
2988 * Used to process the PASN authentication event from the driver to
2989 * userspace and to send a response back.
2990 * @own_addr: Own MAC address specified by the driver to use for PASN
2991 * handshake.
2992 * @peer_addr: MAC address of the peer with which PASN authentication is to be
2993 * performed.
2994 * @network_id: Unique id for the network.
2995 * This identifier is used as a unique identifier for each network
2996 * block when using the control interface. Each network is allocated an
2997 * id when it is being created, either when reading the configuration
2998 * file or when a new network is added through the control interface.
2999 * @akmp: Authentication key management protocol type supported.
3000 * @cipher: Cipher suite.
3001 * @group: Finite cyclic group. Default group used is 19 (ECC).
3002 * @ltf_keyseed_required: Indicates whether LTF keyseed generation is required
3003 * @status: PASN response status, %PASN_STATUS_SUCCESS for successful
3004 * authentication, use %PASN_STATUS_FAILURE if PASN authentication
3005 * fails or if wpa_supplicant fails to set the security ranging context to
3006 * the driver
3007 */
3008struct pasn_peer {
3009 u8 own_addr[ETH_ALEN];
3010 u8 peer_addr[ETH_ALEN];
3011 int network_id;
3012 int akmp;
3013 int cipher;
3014 int group;
3015 bool ltf_keyseed_required;
3016 enum pasn_status status;
3017};
3018
3019/**
3020 * struct pasn_auth - PASN authentication trigger parameters
3021 *
3022 * These are used across the PASN authentication event from the driver to
3023 * userspace and to send a response to it.
3024 * @action: Action type. Only significant for the event interface.
3025 * @num_peers: The number of peers for which the PASN handshake is requested
3026 * for.
3027 * @peer: Holds the peer details.
3028 */
3029struct pasn_auth {
3030 enum {
3031 PASN_ACTION_AUTH,
3032 PASN_ACTION_DELETE_SECURE_RANGING_CONTEXT,
3033 } action;
3034 unsigned int num_peers;
3035 struct pasn_peer peer[WPAS_MAX_PASN_PEERS];
3036};
3037
3038/**
3039 * struct secure_ranging_params - Parameters required to set secure ranging
3040 * context for a peer.
3041 *
3042 * @action: Add or delete a security context to the driver.
3043 * @own_addr: Own MAC address used during key derivation.
3044 * @peer_addr: Address of the peer device.
3045 * @cipher: Cipher suite.
3046 * @tk_len: Length of temporal key.
3047 * @tk: Temporal key buffer.
3048 * @ltf_keyseed_len: Length of LTF keyseed.
3049 * @ltf_keyeed: LTF keyseed buffer.
3050 */
3051struct secure_ranging_params {
3052 u32 action;
3053 const u8 *own_addr;
3054 const u8 *peer_addr;
3055 u32 cipher;
3056 u8 tk_len;
3057 const u8 *tk;
3058 u8 ltf_keyseed_len;
3059 const u8 *ltf_keyseed;
3060};
3061
Hai Shalom60840252021-02-19 19:02:11 -08003062/* enum nested_attr - Used to specify if subcommand uses nested attributes */
3063enum nested_attr {
3064 NESTED_ATTR_NOT_USED = 0,
3065 NESTED_ATTR_USED = 1,
3066 NESTED_ATTR_UNSPECIFIED = 2,
3067};
3068
Sunil8cd6f4d2022-06-28 18:40:46 +00003069/* Preferred channel list information */
3070
3071/* GO role */
3072#define WEIGHTED_PCL_GO BIT(0)
3073/* P2P Client role */
3074#define WEIGHTED_PCL_CLI BIT(1)
3075/* Must be considered for operating channel */
3076#define WEIGHTED_PCL_MUST_CONSIDER BIT(2)
3077/* Should be excluded in GO negotiation */
3078#define WEIGHTED_PCL_EXCLUDE BIT(3)
3079
3080/* Preferred channel list with weight */
3081struct weighted_pcl {
3082 u32 freq; /* MHz */
3083 u8 weight;
3084 u32 flag; /* bitmap for WEIGHTED_PCL_* */
3085};
3086
Sunil Ravi89eba102022-09-13 21:04:37 -07003087struct driver_sta_mlo_info {
Sunil Ravi640215c2023-06-28 23:08:09 +00003088 bool default_map;
Sunil Ravi77d572f2023-01-17 23:58:31 +00003089 u16 req_links; /* bitmap of requested link IDs */
3090 u16 valid_links; /* bitmap of accepted link IDs */
3091 u8 assoc_link_id;
Sunil Ravi89eba102022-09-13 21:04:37 -07003092 u8 ap_mld_addr[ETH_ALEN];
3093 struct {
3094 u8 addr[ETH_ALEN];
3095 u8 bssid[ETH_ALEN];
3096 unsigned int freq;
Sunil Ravi640215c2023-06-28 23:08:09 +00003097 struct t2lm_mapping t2lmap;
Sunil Ravi89eba102022-09-13 21:04:37 -07003098 } links[MAX_NUM_MLD_LINKS];
3099};
3100
Roshan Pius3a1667e2018-07-03 15:17:14 -07003101/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003102 * struct wpa_driver_ops - Driver interface API definition
3103 *
3104 * This structure defines the API that each driver interface needs to implement
3105 * for core wpa_supplicant code. All driver specific functionality is captured
3106 * in this wrapper.
3107 */
3108struct wpa_driver_ops {
3109 /** Name of the driver interface */
3110 const char *name;
3111 /** One line description of the driver interface */
3112 const char *desc;
3113
3114 /**
3115 * get_bssid - Get the current BSSID
3116 * @priv: private driver interface data
3117 * @bssid: buffer for BSSID (ETH_ALEN = 6 bytes)
3118 *
3119 * Returns: 0 on success, -1 on failure
3120 *
3121 * Query kernel driver for the current BSSID and copy it to bssid.
3122 * Setting bssid to 00:00:00:00:00:00 is recommended if the STA is not
3123 * associated.
3124 */
3125 int (*get_bssid)(void *priv, u8 *bssid);
3126
3127 /**
3128 * get_ssid - Get the current SSID
3129 * @priv: private driver interface data
3130 * @ssid: buffer for SSID (at least 32 bytes)
3131 *
3132 * Returns: Length of the SSID on success, -1 on failure
3133 *
3134 * Query kernel driver for the current SSID and copy it to ssid.
3135 * Returning zero is recommended if the STA is not associated.
3136 *
3137 * Note: SSID is an array of octets, i.e., it is not nul terminated and
3138 * can, at least in theory, contain control characters (including nul)
3139 * and as such, should be processed as binary data, not a printable
3140 * string.
3141 */
3142 int (*get_ssid)(void *priv, u8 *ssid);
3143
3144 /**
3145 * set_key - Configure encryption key
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003146 * @priv: private driver interface data
Hai Shalomfdcde762020-04-02 11:19:20 -07003147 * @params: Key parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003148 * Returns: 0 on success, -1 on failure
3149 *
3150 * Configure the given key for the kernel driver. If the driver
3151 * supports separate individual keys (4 default keys + 1 individual),
3152 * addr can be used to determine whether the key is default or
3153 * individual. If only 4 keys are supported, the default key with key
3154 * index 0 is used as the individual key. STA must be configured to use
3155 * it as the default Tx key (set_tx is set) and accept Rx for all the
3156 * key indexes. In most cases, WPA uses only key indexes 1 and 2 for
3157 * broadcast keys, so key index 0 is available for this kind of
3158 * configuration.
3159 *
3160 * Please note that TKIP keys include separate TX and RX MIC keys and
3161 * some drivers may expect them in different order than wpa_supplicant
3162 * is using. If the TX/RX keys are swapped, all TKIP encrypted packets
3163 * will trigger Michael MIC errors. This can be fixed by changing the
Sunil Ravia04bd252022-05-02 22:54:18 -07003164 * order of MIC keys by swapping the bytes 16..23 and 24..31 of the key
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003165 * in driver_*.c set_key() implementation, see driver_ndis.c for an
3166 * example on how this can be done.
3167 */
Hai Shalomfdcde762020-04-02 11:19:20 -07003168 int (*set_key)(void *priv, struct wpa_driver_set_key_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003169
3170 /**
3171 * init - Initialize driver interface
3172 * @ctx: context to be used when calling wpa_supplicant functions,
3173 * e.g., wpa_supplicant_event()
3174 * @ifname: interface name, e.g., wlan0
3175 *
3176 * Returns: Pointer to private data, %NULL on failure
3177 *
3178 * Initialize driver interface, including event processing for kernel
3179 * driver events (e.g., associated, scan results, Michael MIC failure).
3180 * This function can allocate a private configuration data area for
3181 * @ctx, file descriptor, interface name, etc. information that may be
3182 * needed in future driver operations. If this is not used, non-NULL
3183 * value will need to be returned because %NULL is used to indicate
3184 * failure. The returned value will be used as 'void *priv' data for
3185 * all other driver_ops functions.
3186 *
3187 * The main event loop (eloop.c) of wpa_supplicant can be used to
3188 * register callback for read sockets (eloop_register_read_sock()).
3189 *
3190 * See below for more information about events and
3191 * wpa_supplicant_event() function.
3192 */
3193 void * (*init)(void *ctx, const char *ifname);
3194
3195 /**
3196 * deinit - Deinitialize driver interface
3197 * @priv: private driver interface data from init()
3198 *
3199 * Shut down driver interface and processing of driver events. Free
3200 * private data buffer if one was allocated in init() handler.
3201 */
3202 void (*deinit)(void *priv);
3203
3204 /**
3205 * set_param - Set driver configuration parameters
3206 * @priv: private driver interface data from init()
3207 * @param: driver specific configuration parameters
3208 *
3209 * Returns: 0 on success, -1 on failure
3210 *
3211 * Optional handler for notifying driver interface about configuration
3212 * parameters (driver_param).
3213 */
3214 int (*set_param)(void *priv, const char *param);
3215
3216 /**
3217 * set_countermeasures - Enable/disable TKIP countermeasures
3218 * @priv: private driver interface data
3219 * @enabled: 1 = countermeasures enabled, 0 = disabled
3220 *
3221 * Returns: 0 on success, -1 on failure
3222 *
3223 * Configure TKIP countermeasures. When these are enabled, the driver
3224 * should drop all received and queued frames that are using TKIP.
3225 */
3226 int (*set_countermeasures)(void *priv, int enabled);
3227
3228 /**
3229 * deauthenticate - Request driver to deauthenticate
3230 * @priv: private driver interface data
3231 * @addr: peer address (BSSID of the AP)
3232 * @reason_code: 16-bit reason code to be sent in the deauthentication
3233 * frame
3234 *
3235 * Returns: 0 on success, -1 on failure
3236 */
Hai Shalom81f62d82019-07-22 12:10:00 -07003237 int (*deauthenticate)(void *priv, const u8 *addr, u16 reason_code);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003238
3239 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003240 * associate - Request driver to associate
3241 * @priv: private driver interface data
3242 * @params: association parameters
3243 *
3244 * Returns: 0 on success, -1 on failure
3245 */
3246 int (*associate)(void *priv,
3247 struct wpa_driver_associate_params *params);
3248
3249 /**
3250 * add_pmkid - Add PMKSA cache entry to the driver
3251 * @priv: private driver interface data
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003252 * @params: PMKSA parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003253 *
3254 * Returns: 0 on success, -1 on failure
3255 *
3256 * This function is called when a new PMK is received, as a result of
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003257 * either normal authentication or RSN pre-authentication. The PMKSA
3258 * parameters are either a set of bssid, pmkid, and pmk; or a set of
3259 * ssid, fils_cache_id, pmkid, and pmk.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003260 *
3261 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
3262 * associate(), add_pmkid() can be used to add new PMKSA cache entries
3263 * in the driver. If the driver uses wpa_ie from wpa_supplicant, this
3264 * driver_ops function does not need to be implemented. Likewise, if
3265 * the driver does not support WPA, this function is not needed.
3266 */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003267 int (*add_pmkid)(void *priv, struct wpa_pmkid_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003268
3269 /**
3270 * remove_pmkid - Remove PMKSA cache entry to the driver
3271 * @priv: private driver interface data
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003272 * @params: PMKSA parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003273 *
3274 * Returns: 0 on success, -1 on failure
3275 *
3276 * This function is called when the supplicant drops a PMKSA cache
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003277 * entry for any reason. The PMKSA parameters are either a set of
3278 * bssid and pmkid; or a set of ssid, fils_cache_id, and pmkid.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003279 *
3280 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
3281 * associate(), remove_pmkid() can be used to synchronize PMKSA caches
3282 * between the driver and wpa_supplicant. If the driver uses wpa_ie
3283 * from wpa_supplicant, this driver_ops function does not need to be
3284 * implemented. Likewise, if the driver does not support WPA, this
3285 * function is not needed.
3286 */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003287 int (*remove_pmkid)(void *priv, struct wpa_pmkid_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003288
3289 /**
3290 * flush_pmkid - Flush PMKSA cache
3291 * @priv: private driver interface data
3292 *
3293 * Returns: 0 on success, -1 on failure
3294 *
3295 * This function is called when the supplicant drops all PMKSA cache
3296 * entries for any reason.
3297 *
3298 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
3299 * associate(), remove_pmkid() can be used to synchronize PMKSA caches
3300 * between the driver and wpa_supplicant. If the driver uses wpa_ie
3301 * from wpa_supplicant, this driver_ops function does not need to be
3302 * implemented. Likewise, if the driver does not support WPA, this
3303 * function is not needed.
3304 */
3305 int (*flush_pmkid)(void *priv);
3306
3307 /**
3308 * get_capa - Get driver capabilities
3309 * @priv: private driver interface data
3310 *
3311 * Returns: 0 on success, -1 on failure
3312 *
3313 * Get driver/firmware/hardware capabilities.
3314 */
3315 int (*get_capa)(void *priv, struct wpa_driver_capa *capa);
3316
3317 /**
3318 * poll - Poll driver for association information
3319 * @priv: private driver interface data
3320 *
Sunil Ravi77d572f2023-01-17 23:58:31 +00003321 * This is an optional callback that can be used when the driver does
3322 * not provide event mechanism for association events. This is called
3323 * when receiving WPA/RSN EAPOL-Key messages that require association
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003324 * information. The driver interface is supposed to generate associnfo
3325 * event before returning from this callback function. In addition, the
3326 * driver interface should generate an association event after having
3327 * sent out associnfo.
3328 */
3329 void (*poll)(void *priv);
3330
3331 /**
Dmitry Shmidte4663042016-04-04 10:07:49 -07003332 * get_ifindex - Get interface index
3333 * @priv: private driver interface data
3334 *
3335 * Returns: Interface index
3336 */
3337 unsigned int (*get_ifindex)(void *priv);
3338
3339 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003340 * get_ifname - Get interface name
3341 * @priv: private driver interface data
3342 *
3343 * Returns: Pointer to the interface name. This can differ from the
3344 * interface name used in init() call. Init() is called first.
3345 *
3346 * This optional function can be used to allow the driver interface to
3347 * replace the interface name with something else, e.g., based on an
3348 * interface mapping from a more descriptive name.
3349 */
3350 const char * (*get_ifname)(void *priv);
3351
3352 /**
3353 * get_mac_addr - Get own MAC address
3354 * @priv: private driver interface data
3355 *
3356 * Returns: Pointer to own MAC address or %NULL on failure
3357 *
3358 * This optional function can be used to get the own MAC address of the
3359 * device from the driver interface code. This is only needed if the
3360 * l2_packet implementation for the OS does not provide easy access to
3361 * a MAC address. */
3362 const u8 * (*get_mac_addr)(void *priv);
3363
3364 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003365 * set_operstate - Sets device operating state to DORMANT or UP
3366 * @priv: private driver interface data
3367 * @state: 0 = dormant, 1 = up
3368 * Returns: 0 on success, -1 on failure
3369 *
3370 * This is an optional function that can be used on operating systems
3371 * that support a concept of controlling network device state from user
3372 * space applications. This function, if set, gets called with
3373 * state = 1 when authentication has been completed and with state = 0
3374 * when connection is lost.
3375 */
3376 int (*set_operstate)(void *priv, int state);
3377
3378 /**
3379 * mlme_setprotection - MLME-SETPROTECTION.request primitive
3380 * @priv: Private driver interface data
3381 * @addr: Address of the station for which to set protection (may be
3382 * %NULL for group keys)
3383 * @protect_type: MLME_SETPROTECTION_PROTECT_TYPE_*
3384 * @key_type: MLME_SETPROTECTION_KEY_TYPE_*
3385 * Returns: 0 on success, -1 on failure
3386 *
3387 * This is an optional function that can be used to set the driver to
3388 * require protection for Tx and/or Rx frames. This uses the layer
3389 * interface defined in IEEE 802.11i-2004 clause 10.3.22.1
3390 * (MLME-SETPROTECTION.request). Many drivers do not use explicit
3391 * set protection operation; instead, they set protection implicitly
3392 * based on configured keys.
3393 */
3394 int (*mlme_setprotection)(void *priv, const u8 *addr, int protect_type,
3395 int key_type);
3396
3397 /**
3398 * get_hw_feature_data - Get hardware support data (channels and rates)
3399 * @priv: Private driver interface data
3400 * @num_modes: Variable for returning the number of returned modes
3401 * flags: Variable for returning hardware feature flags
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003402 * @dfs: Variable for returning DFS region (HOSTAPD_DFS_REGION_*)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003403 * Returns: Pointer to allocated hardware data on success or %NULL on
3404 * failure. Caller is responsible for freeing this.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003405 */
3406 struct hostapd_hw_modes * (*get_hw_feature_data)(void *priv,
3407 u16 *num_modes,
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003408 u16 *flags, u8 *dfs);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003409
3410 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003411 * send_mlme - Send management frame from MLME
3412 * @priv: Private driver interface data
3413 * @data: IEEE 802.11 management frame with IEEE 802.11 header
3414 * @data_len: Size of the management frame
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003415 * @noack: Do not wait for this frame to be acked (disable retries)
Dmitry Shmidta3dc3092015-06-23 11:21:28 -07003416 * @freq: Frequency (in MHz) to send the frame on, or 0 to let the
3417 * driver decide
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08003418 * @csa_offs: Array of CSA offsets or %NULL
3419 * @csa_offs_len: Number of elements in csa_offs
Hai Shalomfdcde762020-04-02 11:19:20 -07003420 * @no_encrypt: Do not encrypt frame even if appropriate key exists
3421 * (used only for testing purposes)
3422 * @wait: Time to wait off-channel for a response (in ms), or zero
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003423 * @link_id: Link ID to use for TX, or -1 if not set
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003424 * Returns: 0 on success, -1 on failure
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003425 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003426 int (*send_mlme)(void *priv, const u8 *data, size_t data_len,
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08003427 int noack, unsigned int freq, const u16 *csa_offs,
Hai Shalomfdcde762020-04-02 11:19:20 -07003428 size_t csa_offs_len, int no_encrypt,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003429 unsigned int wait, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003430
3431 /**
3432 * update_ft_ies - Update FT (IEEE 802.11r) IEs
3433 * @priv: Private driver interface data
3434 * @md: Mobility domain (2 octets) (also included inside ies)
3435 * @ies: FT IEs (MDIE, FTIE, ...) or %NULL to remove IEs
3436 * @ies_len: Length of FT IEs in bytes
3437 * Returns: 0 on success, -1 on failure
3438 *
3439 * The supplicant uses this callback to let the driver know that keying
3440 * material for FT is available and that the driver can use the
3441 * provided IEs in the next message in FT authentication sequence.
3442 *
3443 * This function is only needed for driver that support IEEE 802.11r
3444 * (Fast BSS Transition).
3445 */
3446 int (*update_ft_ies)(void *priv, const u8 *md, const u8 *ies,
3447 size_t ies_len);
3448
3449 /**
Sunil Ravi99c035e2024-07-12 01:42:03 +00003450 * get_scan_results - Fetch the latest scan results
3451 * @priv: Private driver interface data
3452 * @bssid: Return results only for the specified BSSID, %NULL for all
3453 *
3454 * Returns: Allocated buffer of scan results (caller is responsible for
3455 * freeing the data structure) on success, NULL on failure
3456 */
3457 struct wpa_scan_results * (*get_scan_results)(void *priv,
3458 const u8 *bssid);
3459
3460 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003461 * get_scan_results2 - Fetch the latest scan results
3462 * @priv: private driver interface data
3463 *
3464 * Returns: Allocated buffer of scan results (caller is responsible for
3465 * freeing the data structure) on success, NULL on failure
3466 */
3467 struct wpa_scan_results * (*get_scan_results2)(void *priv);
3468
3469 /**
3470 * set_country - Set country
3471 * @priv: Private driver interface data
3472 * @alpha2: country to which to switch to
3473 * Returns: 0 on success, -1 on failure
3474 *
3475 * This function is for drivers which support some form
3476 * of setting a regulatory domain.
3477 */
3478 int (*set_country)(void *priv, const char *alpha2);
3479
3480 /**
Dmitry Shmidtcce06662013-11-04 18:44:24 -08003481 * get_country - Get country
3482 * @priv: Private driver interface data
3483 * @alpha2: Buffer for returning country code (at least 3 octets)
3484 * Returns: 0 on success, -1 on failure
3485 */
3486 int (*get_country)(void *priv, char *alpha2);
3487
3488 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003489 * global_init - Global driver initialization
Dmitry Shmidte4663042016-04-04 10:07:49 -07003490 * @ctx: wpa_global pointer
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003491 * Returns: Pointer to private data (global), %NULL on failure
3492 *
3493 * This optional function is called to initialize the driver wrapper
3494 * for global data, i.e., data that applies to all interfaces. If this
3495 * function is implemented, global_deinit() will also need to be
3496 * implemented to free the private data. The driver will also likely
3497 * use init2() function instead of init() to get the pointer to global
3498 * data available to per-interface initializer.
3499 */
Dmitry Shmidte4663042016-04-04 10:07:49 -07003500 void * (*global_init)(void *ctx);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003501
3502 /**
3503 * global_deinit - Global driver deinitialization
3504 * @priv: private driver global data from global_init()
3505 *
3506 * Terminate any global driver related functionality and free the
3507 * global data structure.
3508 */
3509 void (*global_deinit)(void *priv);
3510
3511 /**
3512 * init2 - Initialize driver interface (with global data)
3513 * @ctx: context to be used when calling wpa_supplicant functions,
3514 * e.g., wpa_supplicant_event()
3515 * @ifname: interface name, e.g., wlan0
3516 * @global_priv: private driver global data from global_init()
Sunil Ravi79e6c4f2025-01-04 00:47:06 +00003517 * @p2p_mode: P2P mode for a GO (not applicable for other interface
3518 * types)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003519 * Returns: Pointer to private data, %NULL on failure
3520 *
3521 * This function can be used instead of init() if the driver wrapper
3522 * uses global data.
3523 */
Sunil Ravi79e6c4f2025-01-04 00:47:06 +00003524 void * (*init2)(void *ctx, const char *ifname, void *global_priv,
3525 enum wpa_p2p_mode p2p_mode);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003526
3527 /**
3528 * get_interfaces - Get information about available interfaces
3529 * @global_priv: private driver global data from global_init()
3530 * Returns: Allocated buffer of interface information (caller is
3531 * responsible for freeing the data structure) on success, NULL on
3532 * failure
3533 */
3534 struct wpa_interface_info * (*get_interfaces)(void *global_priv);
3535
3536 /**
3537 * scan2 - Request the driver to initiate scan
3538 * @priv: private driver interface data
3539 * @params: Scan parameters
3540 *
3541 * Returns: 0 on success, -1 on failure
3542 *
3543 * Once the scan results are ready, the driver should report scan
3544 * results event for wpa_supplicant which will eventually request the
3545 * results with wpa_driver_get_scan_results2().
3546 */
3547 int (*scan2)(void *priv, struct wpa_driver_scan_params *params);
3548
3549 /**
3550 * authenticate - Request driver to authenticate
3551 * @priv: private driver interface data
3552 * @params: authentication parameters
3553 * Returns: 0 on success, -1 on failure
3554 *
3555 * This is an optional function that can be used with drivers that
3556 * support separate authentication and association steps, i.e., when
3557 * wpa_supplicant can act as the SME. If not implemented, associate()
3558 * function is expected to take care of IEEE 802.11 authentication,
3559 * too.
3560 */
3561 int (*authenticate)(void *priv,
3562 struct wpa_driver_auth_params *params);
3563
3564 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003565 * set_ap - Set Beacon and Probe Response information for AP mode
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003566 * @priv: Private driver interface data
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003567 * @params: Parameters to use in AP mode
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003568 *
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003569 * This function is used to configure Beacon template and/or extra IEs
3570 * to add for Beacon and Probe Response frames for the driver in
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003571 * AP mode. The driver is responsible for building the full Beacon
3572 * frame by concatenating the head part with TIM IE generated by the
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003573 * driver/firmware and finishing with the tail part. Depending on the
3574 * driver architectue, this can be done either by using the full
3575 * template or the set of additional IEs (e.g., WPS and P2P IE).
3576 * Similarly, Probe Response processing depends on the driver design.
3577 * If the driver (or firmware) takes care of replying to Probe Request
3578 * frames, the extra IEs provided here needs to be added to the Probe
3579 * Response frames.
3580 *
3581 * Returns: 0 on success, -1 on failure
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003582 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003583 int (*set_ap)(void *priv, struct wpa_driver_ap_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003584
3585 /**
Dmitry Shmidt8bae4132013-06-06 11:25:10 -07003586 * set_acl - Set ACL in AP mode
3587 * @priv: Private driver interface data
3588 * @params: Parameters to configure ACL
3589 * Returns: 0 on success, -1 on failure
3590 *
3591 * This is used only for the drivers which support MAC address ACL.
3592 */
3593 int (*set_acl)(void *priv, struct hostapd_acl_params *params);
3594
3595 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003596 * hapd_init - Initialize driver interface (hostapd only)
3597 * @hapd: Pointer to hostapd context
3598 * @params: Configuration for the driver wrapper
3599 * Returns: Pointer to private data, %NULL on failure
3600 *
3601 * This function is used instead of init() or init2() when the driver
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003602 * wrapper is used with hostapd.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003603 */
3604 void * (*hapd_init)(struct hostapd_data *hapd,
3605 struct wpa_init_params *params);
3606
3607 /**
3608 * hapd_deinit - Deinitialize driver interface (hostapd only)
3609 * @priv: Private driver interface data from hapd_init()
3610 */
3611 void (*hapd_deinit)(void *priv);
3612
3613 /**
3614 * set_ieee8021x - Enable/disable IEEE 802.1X support (AP only)
3615 * @priv: Private driver interface data
3616 * @params: BSS parameters
3617 * Returns: 0 on success, -1 on failure
3618 *
3619 * This is an optional function to configure the kernel driver to
3620 * enable/disable IEEE 802.1X support and set WPA/WPA2 parameters. This
3621 * can be left undefined (set to %NULL) if IEEE 802.1X support is
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003622 * always enabled and the driver uses set_ap() to set WPA/RSN IE
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003623 * for Beacon frames.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003624 *
3625 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003626 */
3627 int (*set_ieee8021x)(void *priv, struct wpa_bss_params *params);
3628
3629 /**
3630 * set_privacy - Enable/disable privacy (AP only)
3631 * @priv: Private driver interface data
3632 * @enabled: 1 = privacy enabled, 0 = disabled
3633 * Returns: 0 on success, -1 on failure
3634 *
3635 * This is an optional function to configure privacy field in the
3636 * kernel driver for Beacon frames. This can be left undefined (set to
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003637 * %NULL) if the driver uses the Beacon template from set_ap().
3638 *
3639 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003640 */
3641 int (*set_privacy)(void *priv, int enabled);
3642
3643 /**
3644 * get_seqnum - Fetch the current TSC/packet number (AP only)
3645 * @ifname: The interface name (main or virtual)
3646 * @priv: Private driver interface data
3647 * @addr: MAC address of the station or %NULL for group keys
3648 * @idx: Key index
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003649 * @link_id: Link ID for a group key, or -1 if not set
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003650 * @seq: Buffer for returning the latest used TSC/packet number
3651 * Returns: 0 on success, -1 on failure
3652 *
3653 * This function is used to fetch the last used TSC/packet number for
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07003654 * a TKIP, CCMP, GCMP, or BIP/IGTK key. It is mainly used with group
3655 * keys, so there is no strict requirement on implementing support for
3656 * unicast keys (i.e., addr != %NULL).
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003657 */
3658 int (*get_seqnum)(const char *ifname, void *priv, const u8 *addr,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003659 int idx, int link_id, u8 *seq);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003660
3661 /**
3662 * flush - Flush all association stations (AP only)
3663 * @priv: Private driver interface data
Sunil Ravi7f769292024-07-23 22:21:32 +00003664 * @link_id: In case of MLO, valid link ID on which all associated
3665 * stations will be flushed, -1 otherwise.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003666 * Returns: 0 on success, -1 on failure
3667 *
3668 * This function requests the driver to disassociate all associated
3669 * stations. This function does not need to be implemented if the
3670 * driver does not process association frames internally.
3671 */
Sunil Ravi7f769292024-07-23 22:21:32 +00003672 int (*flush)(void *priv, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003673
3674 /**
3675 * set_generic_elem - Add IEs into Beacon/Probe Response frames (AP)
3676 * @priv: Private driver interface data
3677 * @elem: Information elements
3678 * @elem_len: Length of the elem buffer in octets
3679 * Returns: 0 on success, -1 on failure
3680 *
3681 * This is an optional function to add information elements in the
3682 * kernel driver for Beacon and Probe Response frames. This can be left
3683 * undefined (set to %NULL) if the driver uses the Beacon template from
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003684 * set_ap().
3685 *
3686 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003687 */
3688 int (*set_generic_elem)(void *priv, const u8 *elem, size_t elem_len);
3689
3690 /**
Jouni Malinen1e6c57f2012-09-05 17:07:03 +03003691 * read_sta_data - Fetch station data
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003692 * @priv: Private driver interface data
3693 * @data: Buffer for returning station information
3694 * @addr: MAC address of the station
3695 * Returns: 0 on success, -1 on failure
3696 */
3697 int (*read_sta_data)(void *priv, struct hostap_sta_driver_data *data,
3698 const u8 *addr);
3699
3700 /**
Hai Shalomfdcde762020-04-02 11:19:20 -07003701 * tx_control_port - Send a frame over the 802.1X controlled port
3702 * @priv: Private driver interface data
3703 * @dest: Destination MAC address
3704 * @proto: Ethertype in host byte order
3705 * @buf: Frame payload starting from IEEE 802.1X header
3706 * @len: Frame payload length
3707 * @no_encrypt: Do not encrypt frame
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003708 * @link_id: Link ID to use for TX, or -1 if not set
Hai Shalomfdcde762020-04-02 11:19:20 -07003709 *
3710 * Returns 0 on success, else an error
3711 *
3712 * This is like a normal Ethernet send except that the driver is aware
3713 * (by other means than the Ethertype) that this frame is special,
3714 * and more importantly it gains an ordering between the transmission of
3715 * the frame and other driver management operations such as key
3716 * installations. This can be used to work around known limitations in
3717 * IEEE 802.11 protocols such as race conditions between rekeying 4-way
3718 * handshake message 4/4 and a PTK being overwritten.
3719 *
3720 * This function is only used for a given interface if the driver
3721 * instance reports WPA_DRIVER_FLAGS_CONTROL_PORT capability. Otherwise,
3722 * API users will fall back to sending the frame via a normal socket.
3723 */
3724 int (*tx_control_port)(void *priv, const u8 *dest,
3725 u16 proto, const u8 *buf, size_t len,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003726 int no_encrypt, int link_id);
Hai Shalomfdcde762020-04-02 11:19:20 -07003727
3728 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003729 * hapd_send_eapol - Send an EAPOL packet (AP only)
3730 * @priv: private driver interface data
3731 * @addr: Destination MAC address
3732 * @data: EAPOL packet starting with IEEE 802.1X header
3733 * @data_len: Length of the EAPOL packet in octets
3734 * @encrypt: Whether the frame should be encrypted
3735 * @own_addr: Source MAC address
3736 * @flags: WPA_STA_* flags for the destination station
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003737 * @link_id: Link ID to use for TX, or -1 if not set
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003738 *
3739 * Returns: 0 on success, -1 on failure
3740 */
3741 int (*hapd_send_eapol)(void *priv, const u8 *addr, const u8 *data,
3742 size_t data_len, int encrypt,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003743 const u8 *own_addr, u32 flags, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003744
3745 /**
3746 * sta_deauth - Deauthenticate a station (AP only)
3747 * @priv: Private driver interface data
3748 * @own_addr: Source address and BSSID for the Deauthentication frame
3749 * @addr: MAC address of the station to deauthenticate
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003750 * @reason: Reason code for the Deauthentication frame
3751 * @link_id: Link ID to use for Deauthentication frame, or -1 if not set
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003752 * Returns: 0 on success, -1 on failure
3753 *
3754 * This function requests a specific station to be deauthenticated and
3755 * a Deauthentication frame to be sent to it.
3756 */
3757 int (*sta_deauth)(void *priv, const u8 *own_addr, const u8 *addr,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003758 u16 reason, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003759
3760 /**
3761 * sta_disassoc - Disassociate a station (AP only)
3762 * @priv: Private driver interface data
3763 * @own_addr: Source address and BSSID for the Disassociation frame
3764 * @addr: MAC address of the station to disassociate
3765 * @reason: Reason code for the Disassociation frame
3766 * Returns: 0 on success, -1 on failure
3767 *
3768 * This function requests a specific station to be disassociated and
3769 * a Disassociation frame to be sent to it.
3770 */
3771 int (*sta_disassoc)(void *priv, const u8 *own_addr, const u8 *addr,
Hai Shalom81f62d82019-07-22 12:10:00 -07003772 u16 reason);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003773
3774 /**
3775 * sta_remove - Remove a station entry (AP only)
3776 * @priv: Private driver interface data
3777 * @addr: MAC address of the station to be removed
3778 * Returns: 0 on success, -1 on failure
3779 */
3780 int (*sta_remove)(void *priv, const u8 *addr);
3781
3782 /**
3783 * hapd_get_ssid - Get the current SSID (AP only)
3784 * @priv: Private driver interface data
3785 * @buf: Buffer for returning the SSID
3786 * @len: Maximum length of the buffer
3787 * Returns: Length of the SSID on success, -1 on failure
3788 *
3789 * This function need not be implemented if the driver uses Beacon
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003790 * template from set_ap() and does not reply to Probe Request frames.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003791 */
3792 int (*hapd_get_ssid)(void *priv, u8 *buf, int len);
3793
3794 /**
3795 * hapd_set_ssid - Set SSID (AP only)
3796 * @priv: Private driver interface data
3797 * @buf: SSID
3798 * @len: Length of the SSID in octets
3799 * Returns: 0 on success, -1 on failure
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003800 *
3801 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003802 */
3803 int (*hapd_set_ssid)(void *priv, const u8 *buf, int len);
3804
3805 /**
3806 * hapd_set_countermeasures - Enable/disable TKIP countermeasures (AP)
3807 * @priv: Private driver interface data
3808 * @enabled: 1 = countermeasures enabled, 0 = disabled
3809 * Returns: 0 on success, -1 on failure
3810 *
3811 * This need not be implemented if the driver does not take care of
3812 * association processing.
3813 */
3814 int (*hapd_set_countermeasures)(void *priv, int enabled);
3815
3816 /**
3817 * sta_add - Add a station entry
3818 * @priv: Private driver interface data
3819 * @params: Station parameters
3820 * Returns: 0 on success, -1 on failure
3821 *
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08003822 * This function is used to add or set (params->set 1) a station
3823 * entry in the driver. Adding STA entries is used only if the driver
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003824 * does not take care of association processing.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003825 *
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08003826 * With drivers that don't support full AP client state, this function
3827 * is used to add a station entry to the driver once the station has
3828 * completed association.
3829 *
3830 * With TDLS, this function is used to add or set (params->set 1)
3831 * TDLS peer entries (even with drivers that do not support full AP
3832 * client state).
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003833 */
3834 int (*sta_add)(void *priv, struct hostapd_sta_add_params *params);
3835
3836 /**
3837 * get_inact_sec - Get station inactivity duration (AP only)
3838 * @priv: Private driver interface data
3839 * @addr: Station address
3840 * Returns: Number of seconds station has been inactive, -1 on failure
3841 */
3842 int (*get_inact_sec)(void *priv, const u8 *addr);
3843
3844 /**
3845 * sta_clear_stats - Clear station statistics (AP only)
3846 * @priv: Private driver interface data
3847 * @addr: Station address
3848 * Returns: 0 on success, -1 on failure
3849 */
3850 int (*sta_clear_stats)(void *priv, const u8 *addr);
3851
3852 /**
3853 * set_freq - Set channel/frequency (AP only)
3854 * @priv: Private driver interface data
3855 * @freq: Channel parameters
3856 * Returns: 0 on success, -1 on failure
3857 */
3858 int (*set_freq)(void *priv, struct hostapd_freq_params *freq);
3859
3860 /**
3861 * set_rts - Set RTS threshold
3862 * @priv: Private driver interface data
3863 * @rts: RTS threshold in octets
3864 * Returns: 0 on success, -1 on failure
3865 */
3866 int (*set_rts)(void *priv, int rts);
3867
3868 /**
3869 * set_frag - Set fragmentation threshold
3870 * @priv: Private driver interface data
3871 * @frag: Fragmentation threshold in octets
3872 * Returns: 0 on success, -1 on failure
3873 */
3874 int (*set_frag)(void *priv, int frag);
3875
3876 /**
3877 * sta_set_flags - Set station flags (AP only)
3878 * @priv: Private driver interface data
3879 * @addr: Station address
3880 * @total_flags: Bitmap of all WPA_STA_* flags currently set
3881 * @flags_or: Bitmap of WPA_STA_* flags to add
3882 * @flags_and: Bitmap of WPA_STA_* flags to us as a mask
3883 * Returns: 0 on success, -1 on failure
3884 */
3885 int (*sta_set_flags)(void *priv, const u8 *addr,
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08003886 unsigned int total_flags, unsigned int flags_or,
3887 unsigned int flags_and);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003888
3889 /**
Hai Shalom81f62d82019-07-22 12:10:00 -07003890 * sta_set_airtime_weight - Set station airtime weight (AP only)
3891 * @priv: Private driver interface data
3892 * @addr: Station address
3893 * @weight: New weight for station airtime assignment
3894 * Returns: 0 on success, -1 on failure
3895 */
3896 int (*sta_set_airtime_weight)(void *priv, const u8 *addr,
3897 unsigned int weight);
3898
3899 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003900 * set_tx_queue_params - Set TX queue parameters
3901 * @priv: Private driver interface data
3902 * @queue: Queue number (0 = VO, 1 = VI, 2 = BE, 3 = BK)
3903 * @aifs: AIFS
3904 * @cw_min: cwMin
3905 * @cw_max: cwMax
3906 * @burst_time: Maximum length for bursting in 0.1 msec units
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003907 * @link_id: Link ID to use, or -1 for non MLD.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003908 */
3909 int (*set_tx_queue_params)(void *priv, int queue, int aifs, int cw_min,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003910 int cw_max, int burst_time, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003911
3912 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003913 * if_add - Add a virtual interface
3914 * @priv: Private driver interface data
3915 * @type: Interface type
3916 * @ifname: Interface name for the new virtual interface
3917 * @addr: Local address to use for the interface or %NULL to use the
3918 * parent interface address
3919 * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces
3920 * @drv_priv: Pointer for overwriting the driver context or %NULL if
3921 * not allowed (applies only to %WPA_IF_AP_BSS type)
3922 * @force_ifname: Buffer for returning an interface name that the
3923 * driver ended up using if it differs from the requested ifname
3924 * @if_addr: Buffer for returning the allocated interface address
3925 * (this may differ from the requested addr if the driver cannot
3926 * change interface address)
3927 * @bridge: Bridge interface to use or %NULL if no bridge configured
Dmitry Shmidtcce06662013-11-04 18:44:24 -08003928 * @use_existing: Whether to allow existing interface to be used
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08003929 * @setup_ap: Whether to setup AP for %WPA_IF_AP_BSS interfaces
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003930 * Returns: 0 on success, -1 on failure
3931 */
3932 int (*if_add)(void *priv, enum wpa_driver_if_type type,
3933 const char *ifname, const u8 *addr, void *bss_ctx,
3934 void **drv_priv, char *force_ifname, u8 *if_addr,
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08003935 const char *bridge, int use_existing, int setup_ap);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003936
3937 /**
3938 * if_remove - Remove a virtual interface
3939 * @priv: Private driver interface data
3940 * @type: Interface type
3941 * @ifname: Interface name of the virtual interface to be removed
3942 * Returns: 0 on success, -1 on failure
3943 */
3944 int (*if_remove)(void *priv, enum wpa_driver_if_type type,
3945 const char *ifname);
3946
3947 /**
3948 * set_sta_vlan - Bind a station into a specific interface (AP only)
3949 * @priv: Private driver interface data
3950 * @ifname: Interface (main or virtual BSS or VLAN)
3951 * @addr: MAC address of the associated station
3952 * @vlan_id: VLAN ID
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003953 * @link_id: The link ID or -1 for non-MLO
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003954 * Returns: 0 on success, -1 on failure
3955 *
3956 * This function is used to bind a station to a specific virtual
3957 * interface. It is only used if when virtual interfaces are supported,
3958 * e.g., to assign stations to different VLAN interfaces based on
3959 * information from a RADIUS server. This allows separate broadcast
3960 * domains to be used with a single BSS.
3961 */
3962 int (*set_sta_vlan)(void *priv, const u8 *addr, const char *ifname,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003963 int vlan_id, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003964
3965 /**
3966 * commit - Optional commit changes handler (AP only)
3967 * @priv: driver private data
3968 * Returns: 0 on success, -1 on failure
3969 *
3970 * This optional handler function can be registered if the driver
3971 * interface implementation needs to commit changes (e.g., by setting
3972 * network interface up) at the end of initial configuration. If set,
3973 * this handler will be called after initial setup has been completed.
3974 */
3975 int (*commit)(void *priv);
3976
3977 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003978 * set_radius_acl_auth - Notification of RADIUS ACL change
3979 * @priv: Private driver interface data
3980 * @mac: MAC address of the station
3981 * @accepted: Whether the station was accepted
3982 * @session_timeout: Session timeout for the station
3983 * Returns: 0 on success, -1 on failure
3984 */
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07003985 int (*set_radius_acl_auth)(void *priv, const u8 *mac, int accepted,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003986 u32 session_timeout);
3987
3988 /**
3989 * set_radius_acl_expire - Notification of RADIUS ACL expiration
3990 * @priv: Private driver interface data
3991 * @mac: MAC address of the station
3992 * Returns: 0 on success, -1 on failure
3993 */
3994 int (*set_radius_acl_expire)(void *priv, const u8 *mac);
3995
3996 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003997 * set_ap_wps_ie - Add WPS IE(s) into Beacon/Probe Response frames (AP)
3998 * @priv: Private driver interface data
3999 * @beacon: WPS IE(s) for Beacon frames or %NULL to remove extra IE(s)
4000 * @proberesp: WPS IE(s) for Probe Response frames or %NULL to remove
4001 * extra IE(s)
4002 * @assocresp: WPS IE(s) for (Re)Association Response frames or %NULL
4003 * to remove extra IE(s)
4004 * Returns: 0 on success, -1 on failure
4005 *
4006 * This is an optional function to add WPS IE in the kernel driver for
4007 * Beacon and Probe Response frames. This can be left undefined (set
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004008 * to %NULL) if the driver uses the Beacon template from set_ap()
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004009 * and does not process Probe Request frames. If the driver takes care
4010 * of (Re)Association frame processing, the assocresp buffer includes
4011 * WPS IE(s) that need to be added to (Re)Association Response frames
4012 * whenever a (Re)Association Request frame indicated use of WPS.
4013 *
4014 * This will also be used to add P2P IE(s) into Beacon/Probe Response
4015 * frames when operating as a GO. The driver is responsible for adding
4016 * timing related attributes (e.g., NoA) in addition to the IEs
4017 * included here by appending them after these buffers. This call is
4018 * also used to provide Probe Response IEs for P2P Listen state
4019 * operations for drivers that generate the Probe Response frames
4020 * internally.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004021 *
4022 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004023 */
4024 int (*set_ap_wps_ie)(void *priv, const struct wpabuf *beacon,
4025 const struct wpabuf *proberesp,
4026 const struct wpabuf *assocresp);
4027
4028 /**
4029 * set_supp_port - Set IEEE 802.1X Supplicant Port status
4030 * @priv: Private driver interface data
4031 * @authorized: Whether the port is authorized
4032 * Returns: 0 on success, -1 on failure
4033 */
4034 int (*set_supp_port)(void *priv, int authorized);
4035
4036 /**
4037 * set_wds_sta - Bind a station into a 4-address WDS (AP only)
4038 * @priv: Private driver interface data
4039 * @addr: MAC address of the associated station
4040 * @aid: Association ID
4041 * @val: 1 = bind to 4-address WDS; 0 = unbind
4042 * @bridge_ifname: Bridge interface to use for the WDS station or %NULL
4043 * to indicate that bridge is not to be used
Dmitry Shmidtc2ebb4b2013-07-24 12:57:51 -07004044 * @ifname_wds: Buffer to return the interface name for the new WDS
4045 * station or %NULL to indicate name is not returned.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004046 * Returns: 0 on success, -1 on failure
4047 */
4048 int (*set_wds_sta)(void *priv, const u8 *addr, int aid, int val,
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07004049 const char *bridge_ifname, char *ifname_wds);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004050
4051 /**
4052 * send_action - Transmit an Action frame
4053 * @priv: Private driver interface data
4054 * @freq: Frequency (in MHz) of the channel
4055 * @wait: Time to wait off-channel for a response (in ms), or zero
4056 * @dst: Destination MAC address (Address 1)
4057 * @src: Source MAC address (Address 2)
4058 * @bssid: BSSID (Address 3)
4059 * @data: Frame body
4060 * @data_len: data length in octets
Sunil Ravi79e6c4f2025-01-04 00:47:06 +00004061 * @no_cck: Whether CCK rates must not be used to transmit this frame
4062 * @link_id: Link ID of the specified link; -1 for non-MLO cases and for
4063 * frames that target the MLD instead of a specific link in MLO
4064 * cases
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004065 * Returns: 0 on success, -1 on failure
4066 *
4067 * This command can be used to request the driver to transmit an action
4068 * frame to the specified destination.
4069 *
4070 * If the %WPA_DRIVER_FLAGS_OFFCHANNEL_TX flag is set, the frame will
4071 * be transmitted on the given channel and the device will wait for a
4072 * response on that channel for the given wait time.
4073 *
4074 * If the flag is not set, the wait time will be ignored. In this case,
4075 * if a remain-on-channel duration is in progress, the frame must be
4076 * transmitted on that channel; alternatively the frame may be sent on
4077 * the current operational channel (if in associated state in station
4078 * mode or while operating as an AP.)
Dmitry Shmidtebd93af2017-02-21 13:40:44 -08004079 *
4080 * If @src differs from the device MAC address, use of a random
4081 * transmitter address is requested for this message exchange.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004082 */
4083 int (*send_action)(void *priv, unsigned int freq, unsigned int wait,
4084 const u8 *dst, const u8 *src, const u8 *bssid,
Sunil Ravi79e6c4f2025-01-04 00:47:06 +00004085 const u8 *data, size_t data_len, int no_cck,
4086 int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004087
4088 /**
4089 * send_action_cancel_wait - Cancel action frame TX wait
4090 * @priv: Private driver interface data
4091 *
4092 * This command cancels the wait time associated with sending an action
4093 * frame. It is only available when %WPA_DRIVER_FLAGS_OFFCHANNEL_TX is
4094 * set in the driver flags.
4095 */
4096 void (*send_action_cancel_wait)(void *priv);
4097
4098 /**
4099 * remain_on_channel - Remain awake on a channel
4100 * @priv: Private driver interface data
4101 * @freq: Frequency (in MHz) of the channel
4102 * @duration: Duration in milliseconds
4103 * Returns: 0 on success, -1 on failure
4104 *
4105 * This command is used to request the driver to remain awake on the
4106 * specified channel for the specified duration and report received
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08004107 * Action frames with EVENT_RX_MGMT events. Optionally, received
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004108 * Probe Request frames may also be requested to be reported by calling
4109 * probe_req_report(). These will be reported with EVENT_RX_PROBE_REQ.
4110 *
4111 * The driver may not be at the requested channel when this function
4112 * returns, i.e., the return code is only indicating whether the
4113 * request was accepted. The caller will need to wait until the
4114 * EVENT_REMAIN_ON_CHANNEL event indicates that the driver has
4115 * completed the channel change. This may take some time due to other
4116 * need for the radio and the caller should be prepared to timing out
4117 * its wait since there are no guarantees on when this request can be
4118 * executed.
4119 */
4120 int (*remain_on_channel)(void *priv, unsigned int freq,
4121 unsigned int duration);
4122
4123 /**
4124 * cancel_remain_on_channel - Cancel remain-on-channel operation
4125 * @priv: Private driver interface data
4126 *
4127 * This command can be used to cancel a remain-on-channel operation
4128 * before its originally requested duration has passed. This could be
4129 * used, e.g., when remain_on_channel() is used to request extra time
4130 * to receive a response to an Action frame and the response is
4131 * received when there is still unneeded time remaining on the
4132 * remain-on-channel operation.
4133 */
4134 int (*cancel_remain_on_channel)(void *priv);
4135
4136 /**
4137 * probe_req_report - Request Probe Request frames to be indicated
4138 * @priv: Private driver interface data
4139 * @report: Whether to report received Probe Request frames
4140 * Returns: 0 on success, -1 on failure (or if not supported)
4141 *
4142 * This command can be used to request the driver to indicate when
4143 * Probe Request frames are received with EVENT_RX_PROBE_REQ events.
4144 * Since this operation may require extra resources, e.g., due to less
4145 * optimal hardware/firmware RX filtering, many drivers may disable
4146 * Probe Request reporting at least in station mode. This command is
4147 * used to notify the driver when the Probe Request frames need to be
4148 * reported, e.g., during remain-on-channel operations.
4149 */
4150 int (*probe_req_report)(void *priv, int report);
4151
4152 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004153 * deinit_ap - Deinitialize AP mode
4154 * @priv: Private driver interface data
4155 * Returns: 0 on success, -1 on failure (or if not supported)
4156 *
4157 * This optional function can be used to disable AP mode related
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07004158 * configuration. If the interface was not dynamically added,
4159 * change the driver mode to station mode to allow normal station
4160 * operations like scanning to be completed.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004161 */
4162 int (*deinit_ap)(void *priv);
4163
4164 /**
Dmitry Shmidt04949592012-07-19 12:16:46 -07004165 * deinit_p2p_cli - Deinitialize P2P client mode
4166 * @priv: Private driver interface data
4167 * Returns: 0 on success, -1 on failure (or if not supported)
4168 *
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07004169 * This optional function can be used to disable P2P client mode. If the
4170 * interface was not dynamically added, change the interface type back
4171 * to station mode.
Dmitry Shmidt04949592012-07-19 12:16:46 -07004172 */
4173 int (*deinit_p2p_cli)(void *priv);
4174
4175 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004176 * suspend - Notification on system suspend/hibernate event
4177 * @priv: Private driver interface data
4178 */
4179 void (*suspend)(void *priv);
4180
4181 /**
4182 * resume - Notification on system resume/thaw event
4183 * @priv: Private driver interface data
4184 */
4185 void (*resume)(void *priv);
4186
4187 /**
4188 * signal_monitor - Set signal monitoring parameters
4189 * @priv: Private driver interface data
4190 * @threshold: Threshold value for signal change events; 0 = disabled
4191 * @hysteresis: Minimum change in signal strength before indicating a
4192 * new event
4193 * Returns: 0 on success, -1 on failure (or if not supported)
4194 *
4195 * This function can be used to configure monitoring of signal strength
4196 * with the current AP. Whenever signal strength drops below the
4197 * %threshold value or increases above it, EVENT_SIGNAL_CHANGE event
4198 * should be generated assuming the signal strength has changed at
4199 * least %hysteresis from the previously indicated signal change event.
4200 */
4201 int (*signal_monitor)(void *priv, int threshold, int hysteresis);
4202
4203 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004204 * get_noa - Get current Notice of Absence attribute payload
4205 * @priv: Private driver interface data
4206 * @buf: Buffer for returning NoA
4207 * @buf_len: Buffer length in octets
4208 * Returns: Number of octets used in buf, 0 to indicate no NoA is being
4209 * advertized, or -1 on failure
4210 *
4211 * This function is used to fetch the current Notice of Absence
4212 * attribute value from GO.
4213 */
4214 int (*get_noa)(void *priv, u8 *buf, size_t buf_len);
4215
4216 /**
4217 * set_noa - Set Notice of Absence parameters for GO (testing)
4218 * @priv: Private driver interface data
4219 * @count: Count
4220 * @start: Start time in ms from next TBTT
4221 * @duration: Duration in ms
4222 * Returns: 0 on success or -1 on failure
4223 *
4224 * This function is used to set Notice of Absence parameters for GO. It
4225 * is used only for testing. To disable NoA, all parameters are set to
4226 * 0.
4227 */
4228 int (*set_noa)(void *priv, u8 count, int start, int duration);
4229
4230 /**
4231 * set_p2p_powersave - Set P2P power save options
4232 * @priv: Private driver interface data
4233 * @legacy_ps: 0 = disable, 1 = enable, 2 = maximum PS, -1 = no change
4234 * @opp_ps: 0 = disable, 1 = enable, -1 = no change
4235 * @ctwindow: 0.. = change (msec), -1 = no change
4236 * Returns: 0 on success or -1 on failure
4237 */
4238 int (*set_p2p_powersave)(void *priv, int legacy_ps, int opp_ps,
4239 int ctwindow);
4240
4241 /**
4242 * ampdu - Enable/disable aggregation
4243 * @priv: Private driver interface data
4244 * @ampdu: 1/0 = enable/disable A-MPDU aggregation
4245 * Returns: 0 on success or -1 on failure
4246 */
4247 int (*ampdu)(void *priv, int ampdu);
4248
4249 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004250 * get_radio_name - Get physical radio name for the device
4251 * @priv: Private driver interface data
4252 * Returns: Radio name or %NULL if not known
4253 *
4254 * The returned data must not be modified by the caller. It is assumed
4255 * that any interface that has the same radio name as another is
4256 * sharing the same physical radio. This information can be used to
4257 * share scan results etc. information between the virtual interfaces
4258 * to speed up various operations.
4259 */
4260 const char * (*get_radio_name)(void *priv);
4261
4262 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004263 * send_tdls_mgmt - for sending TDLS management packets
4264 * @priv: private driver interface data
4265 * @dst: Destination (peer) MAC address
4266 * @action_code: TDLS action code for the mssage
4267 * @dialog_token: Dialog Token to use in the message (if needed)
4268 * @status_code: Status Code or Reason Code to use (if needed)
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07004269 * @peer_capab: TDLS peer capability (TDLS_PEER_* bitfield)
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -07004270 * @initiator: Is the current end the TDLS link initiator
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004271 * @buf: TDLS IEs to add to the message
4272 * @len: Length of buf in octets
Sunil Ravi2a14cf12023-11-21 00:54:38 +00004273 * @link_id: If >= 0 indicates the link of the AP MLD to specify the
4274 * operating channel on which to send a TDLS Discovery Response frame.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004275 * Returns: 0 on success, negative (<0) on failure
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004276 *
4277 * This optional function can be used to send packet to driver which is
4278 * responsible for receiving and sending all TDLS packets.
4279 */
4280 int (*send_tdls_mgmt)(void *priv, const u8 *dst, u8 action_code,
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07004281 u8 dialog_token, u16 status_code, u32 peer_capab,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00004282 int initiator, const u8 *buf, size_t len,
4283 int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004284
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004285 /**
4286 * tdls_oper - Ask the driver to perform high-level TDLS operations
4287 * @priv: Private driver interface data
4288 * @oper: TDLS high-level operation. See %enum tdls_oper
4289 * @peer: Destination (peer) MAC address
4290 * Returns: 0 on success, negative (<0) on failure
4291 *
4292 * This optional function can be used to send high-level TDLS commands
4293 * to the driver.
4294 */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004295 int (*tdls_oper)(void *priv, enum tdls_oper oper, const u8 *peer);
4296
4297 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07004298 * wnm_oper - Notify driver of the WNM frame reception
4299 * @priv: Private driver interface data
4300 * @oper: WNM operation. See %enum wnm_oper
4301 * @peer: Destination (peer) MAC address
4302 * @buf: Buffer for the driver to fill in (for getting IE)
4303 * @buf_len: Return the len of buf
4304 * Returns: 0 on success, negative (<0) on failure
4305 */
4306 int (*wnm_oper)(void *priv, enum wnm_oper oper, const u8 *peer,
4307 u8 *buf, u16 *buf_len);
4308
4309 /**
Dmitry Shmidt051af732013-10-22 13:52:46 -07004310 * set_qos_map - Set QoS Map
4311 * @priv: Private driver interface data
4312 * @qos_map_set: QoS Map
4313 * @qos_map_set_len: Length of QoS Map
4314 */
4315 int (*set_qos_map)(void *priv, const u8 *qos_map_set,
4316 u8 qos_map_set_len);
4317
4318 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004319 * br_add_ip_neigh - Add a neigh to the bridge ip neigh table
4320 * @priv: Private driver interface data
4321 * @version: IP version of the IP address, 4 or 6
4322 * @ipaddr: IP address for the neigh entry
4323 * @prefixlen: IP address prefix length
4324 * @addr: Corresponding MAC address
4325 * Returns: 0 on success, negative (<0) on failure
4326 */
4327 int (*br_add_ip_neigh)(void *priv, u8 version, const u8 *ipaddr,
4328 int prefixlen, const u8 *addr);
4329
4330 /**
4331 * br_delete_ip_neigh - Remove a neigh from the bridge ip neigh table
4332 * @priv: Private driver interface data
4333 * @version: IP version of the IP address, 4 or 6
4334 * @ipaddr: IP address for the neigh entry
4335 * Returns: 0 on success, negative (<0) on failure
4336 */
4337 int (*br_delete_ip_neigh)(void *priv, u8 version, const u8 *ipaddr);
4338
4339 /**
4340 * br_port_set_attr - Set a bridge port attribute
4341 * @attr: Bridge port attribute to set
4342 * @val: Value to be set
4343 * Returns: 0 on success, negative (<0) on failure
4344 */
4345 int (*br_port_set_attr)(void *priv, enum drv_br_port_attr attr,
4346 unsigned int val);
4347
4348 /**
4349 * br_port_set_attr - Set a bridge network parameter
4350 * @param: Bridge parameter to set
4351 * @val: Value to be set
4352 * Returns: 0 on success, negative (<0) on failure
4353 */
4354 int (*br_set_net_param)(void *priv, enum drv_br_net_param param,
4355 unsigned int val);
4356
4357 /**
Hai Shalomfdcde762020-04-02 11:19:20 -07004358 * get_wowlan - Get wake-on-wireless status
4359 * @priv: Private driver interface data
4360 */
4361 int (*get_wowlan)(void *priv);
4362
4363 /**
Dmitry Shmidtb58836e2014-04-29 14:35:56 -07004364 * set_wowlan - Set wake-on-wireless triggers
4365 * @priv: Private driver interface data
4366 * @triggers: wowlan triggers
4367 */
4368 int (*set_wowlan)(void *priv, const struct wowlan_triggers *triggers);
4369
4370 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004371 * signal_poll - Get current connection information
4372 * @priv: Private driver interface data
4373 * @signal_info: Connection info structure
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07004374 */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004375 int (*signal_poll)(void *priv, struct wpa_signal_info *signal_info);
Dmitry Shmidtbd567ad2011-05-09 14:17:09 -07004376
4377 /**
Sunil Ravi89eba102022-09-13 21:04:37 -07004378 * mlo_signal_poll - Get current MLO connection information
4379 * @priv: Private driver interface data
4380 * @mlo_signal_info: MLO connection info structure
4381 */
4382 int (*mlo_signal_poll)(void *priv,
4383 struct wpa_mlo_signal_info *mlo_signal_info);
4384
4385 /**
Hai Shalom74f70d42019-02-11 14:42:39 -08004386 * channel_info - Get parameters of the current operating channel
4387 * @priv: Private driver interface data
4388 * @channel_info: Channel info structure
4389 * Returns: 0 on success, negative (<0) on failure
4390 */
4391 int (*channel_info)(void *priv, struct wpa_channel_info *channel_info);
4392
4393 /**
Jouni Malinen75ecf522011-06-27 15:19:46 -07004394 * set_authmode - Set authentication algorithm(s) for static WEP
4395 * @priv: Private driver interface data
4396 * @authmode: 1=Open System, 2=Shared Key, 3=both
4397 * Returns: 0 on success, -1 on failure
4398 *
4399 * This function can be used to set authentication algorithms for AP
4400 * mode when static WEP is used. If the driver uses user space MLME/SME
4401 * implementation, there is no need to implement this function.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004402 *
4403 * DEPRECATED - use set_ap() instead
Jouni Malinen75ecf522011-06-27 15:19:46 -07004404 */
4405 int (*set_authmode)(void *priv, int authmode);
Dmitry Shmidt292b0c32013-11-22 12:54:42 -08004406
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004407#ifdef ANDROID
Jouni Malinen75ecf522011-06-27 15:19:46 -07004408 /**
Dmitry Shmidt292b0c32013-11-22 12:54:42 -08004409 * driver_cmd - Execute driver-specific command
4410 * @priv: Private driver interface data
4411 * @cmd: Command to execute
4412 * @buf: Return buffer
4413 * @buf_len: Buffer length
Dmitry Shmidtbd567ad2011-05-09 14:17:09 -07004414 * Returns: 0 on success, -1 on failure
4415 */
Dmitry Shmidt292b0c32013-11-22 12:54:42 -08004416 int (*driver_cmd)(void *priv, char *cmd, char *buf, size_t buf_len);
4417#endif /* ANDROID */
4418
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004419 /**
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004420 * vendor_cmd - Execute vendor specific command
4421 * @priv: Private driver interface data
4422 * @vendor_id: Vendor id
4423 * @subcmd: Vendor command id
Hai Shalom60840252021-02-19 19:02:11 -08004424 * @nested_attr_flag: Specifies if vendor subcommand uses nested
4425 * attributes or not
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004426 * @data: Vendor command parameters (%NULL if no parameters)
4427 * @data_len: Data length
4428 * @buf: Return buffer (%NULL to ignore reply)
4429 * Returns: 0 on success, negative (<0) on failure
4430 *
4431 * This function handles vendor specific commands that are passed to
4432 * the driver/device. The command is identified by vendor id and
Hai Shalom60840252021-02-19 19:02:11 -08004433 * command id. The nested_attr_flag specifies whether the subcommand
4434 * uses nested attributes or not. Parameters can be passed
4435 * as argument to the command in the data buffer. Reply (if any) will be
4436 * filled in the supplied return buffer.
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004437 *
4438 * The exact driver behavior is driver interface and vendor specific. As
4439 * an example, this will be converted to a vendor specific cfg80211
4440 * command in case of the nl80211 driver interface.
4441 */
4442 int (*vendor_cmd)(void *priv, unsigned int vendor_id,
4443 unsigned int subcmd, const u8 *data, size_t data_len,
Hai Shalom60840252021-02-19 19:02:11 -08004444 enum nested_attr nested_attr_flag,
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004445 struct wpabuf *buf);
4446
4447 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004448 * set_rekey_info - Set rekey information
4449 * @priv: Private driver interface data
4450 * @kek: Current KEK
Dmitry Shmidt807291d2015-01-27 13:40:23 -08004451 * @kek_len: KEK length in octets
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004452 * @kck: Current KCK
Dmitry Shmidt807291d2015-01-27 13:40:23 -08004453 * @kck_len: KCK length in octets
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004454 * @replay_ctr: Current EAPOL-Key Replay Counter
4455 *
4456 * This optional function can be used to provide information for the
4457 * driver/firmware to process EAPOL-Key frames in Group Key Handshake
4458 * while the host (including wpa_supplicant) is sleeping.
4459 */
Dmitry Shmidt807291d2015-01-27 13:40:23 -08004460 void (*set_rekey_info)(void *priv, const u8 *kek, size_t kek_len,
4461 const u8 *kck, size_t kck_len,
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004462 const u8 *replay_ctr);
4463
4464 /**
4465 * sta_assoc - Station association indication
4466 * @priv: Private driver interface data
4467 * @own_addr: Source address and BSSID for association frame
4468 * @addr: MAC address of the station to associate
4469 * @reassoc: flag to indicate re-association
4470 * @status: association response status code
4471 * @ie: assoc response ie buffer
4472 * @len: ie buffer length
4473 * Returns: 0 on success, -1 on failure
4474 *
4475 * This function indicates the driver to send (Re)Association
4476 * Response frame to the station.
4477 */
4478 int (*sta_assoc)(void *priv, const u8 *own_addr, const u8 *addr,
4479 int reassoc, u16 status, const u8 *ie, size_t len);
4480
4481 /**
4482 * sta_auth - Station authentication indication
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004483 * @priv: private driver interface data
4484 * @params: Station authentication parameters
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004485 *
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004486 * Returns: 0 on success, -1 on failure
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004487 */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004488 int (*sta_auth)(void *priv,
4489 struct wpa_driver_sta_auth_params *params);
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004490
4491 /**
4492 * add_tspec - Add traffic stream
4493 * @priv: Private driver interface data
4494 * @addr: MAC address of the station to associate
4495 * @tspec_ie: tspec ie buffer
4496 * @tspec_ielen: tspec ie length
4497 * Returns: 0 on success, -1 on failure
4498 *
4499 * This function adds the traffic steam for the station
4500 * and fills the medium_time in tspec_ie.
4501 */
4502 int (*add_tspec)(void *priv, const u8 *addr, u8 *tspec_ie,
4503 size_t tspec_ielen);
4504
4505 /**
4506 * add_sta_node - Add a station node in the driver
4507 * @priv: Private driver interface data
4508 * @addr: MAC address of the station to add
4509 * @auth_alg: authentication algorithm used by the station
4510 * Returns: 0 on success, -1 on failure
4511 *
4512 * This function adds the station node in the driver, when
4513 * the station gets added by FT-over-DS.
4514 */
4515 int (*add_sta_node)(void *priv, const u8 *addr, u16 auth_alg);
4516
4517 /**
4518 * sched_scan - Request the driver to initiate scheduled scan
4519 * @priv: Private driver interface data
4520 * @params: Scan parameters
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004521 * Returns: 0 on success, -1 on failure
4522 *
4523 * This operation should be used for scheduled scan offload to
4524 * the hardware. Every time scan results are available, the
4525 * driver should report scan results event for wpa_supplicant
4526 * which will eventually request the results with
4527 * wpa_driver_get_scan_results2(). This operation is optional
4528 * and if not provided or if it returns -1, we fall back to
4529 * normal host-scheduled scans.
4530 */
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08004531 int (*sched_scan)(void *priv, struct wpa_driver_scan_params *params);
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004532
4533 /**
4534 * stop_sched_scan - Request the driver to stop a scheduled scan
4535 * @priv: Private driver interface data
4536 * Returns: 0 on success, -1 on failure
4537 *
4538 * This should cause the scheduled scan to be stopped and
4539 * results should stop being sent. Must be supported if
4540 * sched_scan is supported.
4541 */
4542 int (*stop_sched_scan)(void *priv);
4543
4544 /**
4545 * poll_client - Probe (null data or such) the given station
4546 * @priv: Private driver interface data
4547 * @own_addr: MAC address of sending interface
4548 * @addr: MAC address of the station to probe
4549 * @qos: Indicates whether station is QoS station
4550 *
4551 * This function is used to verify whether an associated station is
4552 * still present. This function does not need to be implemented if the
4553 * driver provides such inactivity polling mechanism.
4554 */
4555 void (*poll_client)(void *priv, const u8 *own_addr,
4556 const u8 *addr, int qos);
Dmitry Shmidt04949592012-07-19 12:16:46 -07004557
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004558 /**
Dmitry Shmidt04949592012-07-19 12:16:46 -07004559 * radio_disable - Disable/enable radio
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004560 * @priv: Private driver interface data
Dmitry Shmidt04949592012-07-19 12:16:46 -07004561 * @disabled: 1=disable 0=enable radio
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004562 * Returns: 0 on success, -1 on failure
4563 *
Dmitry Shmidt04949592012-07-19 12:16:46 -07004564 * This optional command is for testing purposes. It can be used to
4565 * disable the radio on a testbed device to simulate out-of-radio-range
4566 * conditions.
4567 */
4568 int (*radio_disable)(void *priv, int disabled);
4569
4570 /**
4571 * switch_channel - Announce channel switch and migrate the GO to the
4572 * given frequency
4573 * @priv: Private driver interface data
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08004574 * @settings: Settings for CSA period and new channel
Dmitry Shmidt04949592012-07-19 12:16:46 -07004575 * Returns: 0 on success, -1 on failure
4576 *
4577 * This function is used to move the GO to the legacy STA channel to
4578 * avoid frequency conflict in single channel concurrency.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004579 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08004580 int (*switch_channel)(void *priv, struct csa_settings *settings);
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004581
4582 /**
Sunil Ravia04bd252022-05-02 22:54:18 -07004583 * switch_color - Announce color switch and migrate the BSS to the
4584 * given color
4585 * @priv: Private driver interface data
4586 * @settings: Settings for CCA period and new color
4587 * Returns: 0 on success, -1 on failure
4588 *
4589 * This function is used to move the BSS to its new color.
4590 */
4591 int (*switch_color)(void *priv, struct cca_settings *settings);
4592
4593 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004594 * add_tx_ts - Add traffic stream
4595 * @priv: Private driver interface data
4596 * @tsid: Traffic stream ID
4597 * @addr: Receiver address
4598 * @user_prio: User priority of the traffic stream
4599 * @admitted_time: Admitted time for this TS in units of
4600 * 32 microsecond periods (per second).
4601 * Returns: 0 on success, -1 on failure
4602 */
4603 int (*add_tx_ts)(void *priv, u8 tsid, const u8 *addr, u8 user_prio,
4604 u16 admitted_time);
4605
4606 /**
4607 * del_tx_ts - Delete traffic stream
4608 * @priv: Private driver interface data
4609 * @tsid: Traffic stream ID
4610 * @addr: Receiver address
4611 * Returns: 0 on success, -1 on failure
4612 */
4613 int (*del_tx_ts)(void *priv, u8 tsid, const u8 *addr);
4614
4615 /**
4616 * Enable channel-switching with TDLS peer
4617 * @priv: Private driver interface data
4618 * @addr: MAC address of the TDLS peer
4619 * @oper_class: Operating class of the switch channel
4620 * @params: Channel specification
4621 * Returns: 0 on success, -1 on failure
4622 *
4623 * The function indicates to driver that it can start switching to a
4624 * different channel with a specified TDLS peer. The switching is
4625 * assumed on until canceled with tdls_disable_channel_switch().
4626 */
4627 int (*tdls_enable_channel_switch)(
4628 void *priv, const u8 *addr, u8 oper_class,
4629 const struct hostapd_freq_params *params);
4630
4631 /**
4632 * Disable channel switching with TDLS peer
4633 * @priv: Private driver interface data
4634 * @addr: MAC address of the TDLS peer
4635 * Returns: 0 on success, -1 on failure
4636 *
4637 * This function indicates to the driver that it should stop switching
4638 * with a given TDLS peer.
4639 */
4640 int (*tdls_disable_channel_switch)(void *priv, const u8 *addr);
4641
4642 /**
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004643 * start_dfs_cac - Listen for radar interference on the channel
4644 * @priv: Private driver interface data
Dmitry Shmidt051af732013-10-22 13:52:46 -07004645 * @freq: Channel parameters
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004646 * Returns: 0 on success, -1 on failure
4647 */
Dmitry Shmidt051af732013-10-22 13:52:46 -07004648 int (*start_dfs_cac)(void *priv, struct hostapd_freq_params *freq);
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004649
4650 /**
4651 * stop_ap - Removes beacon from AP
4652 * @priv: Private driver interface data
Sunil Ravi99c035e2024-07-12 01:42:03 +00004653 * @link_id: Link ID of the specified link; -1 for non-MLD
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004654 * Returns: 0 on success, -1 on failure (or if not supported)
4655 *
4656 * This optional function can be used to disable AP mode related
4657 * configuration. Unlike deinit_ap, it does not change to station
4658 * mode.
4659 */
Sunil Ravi99c035e2024-07-12 01:42:03 +00004660 int (*stop_ap)(void *priv, int link_id);
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07004661
4662 /**
4663 * get_survey - Retrieve survey data
4664 * @priv: Private driver interface data
4665 * @freq: If set, survey data for the specified frequency is only
4666 * being requested. If not set, all survey data is requested.
4667 * Returns: 0 on success, -1 on failure
4668 *
4669 * Use this to retrieve:
4670 *
4671 * - the observed channel noise floor
4672 * - the amount of time we have spent on the channel
4673 * - the amount of time during which we have spent on the channel that
4674 * the radio has determined the medium is busy and we cannot
4675 * transmit
4676 * - the amount of time we have spent receiving data
4677 * - the amount of time we have spent transmitting data
4678 *
4679 * This data can be used for spectrum heuristics. One example is
4680 * Automatic Channel Selection (ACS). The channel survey data is
4681 * kept on a linked list on the channel data, one entry is added
4682 * for each survey. The min_nf of the channel is updated for each
4683 * survey.
4684 */
4685 int (*get_survey)(void *priv, unsigned int freq);
Dmitry Shmidt56052862013-10-04 10:23:25 -07004686
4687 /**
4688 * status - Get driver interface status information
4689 * @priv: Private driver interface data
Hai Shalom74f70d42019-02-11 14:42:39 -08004690 * @buf: Buffer for printing the status information
Dmitry Shmidt56052862013-10-04 10:23:25 -07004691 * @buflen: Maximum length of the buffer
4692 * Returns: Length of written status information or -1 on failure
4693 */
4694 int (*status)(void *priv, char *buf, size_t buflen);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004695
Dmitry Shmidt661b4f72014-09-29 14:58:27 -07004696 /**
4697 * roaming - Set roaming policy for driver-based BSS selection
4698 * @priv: Private driver interface data
4699 * @allowed: Whether roaming within ESS is allowed
4700 * @bssid: Forced BSSID if roaming is disabled or %NULL if not set
4701 * Returns: Length of written status information or -1 on failure
4702 *
4703 * This optional callback can be used to update roaming policy from the
4704 * associate() command (bssid being set there indicates that the driver
4705 * should not roam before getting this roaming() call to allow roaming.
4706 * If the driver does not indicate WPA_DRIVER_FLAGS_BSS_SELECTION
4707 * capability, roaming policy is handled within wpa_supplicant and there
4708 * is no need to implement or react to this callback.
4709 */
4710 int (*roaming)(void *priv, int allowed, const u8 *bssid);
4711
4712 /**
Roshan Pius3a1667e2018-07-03 15:17:14 -07004713 * disable_fils - Enable/disable FILS feature
4714 * @priv: Private driver interface data
4715 * @disable: 0-enable and 1-disable FILS feature
4716 * Returns: 0 on success, -1 on failure
4717 *
4718 * This callback can be used to configure driver and below layers to
4719 * enable/disable all FILS features.
4720 */
4721 int (*disable_fils)(void *priv, int disable);
4722
4723 /**
Dmitry Shmidt661b4f72014-09-29 14:58:27 -07004724 * set_mac_addr - Set MAC address
4725 * @priv: Private driver interface data
4726 * @addr: MAC address to use or %NULL for setting back to permanent
4727 * Returns: 0 on success, -1 on failure
4728 */
4729 int (*set_mac_addr)(void *priv, const u8 *addr);
4730
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004731#ifdef CONFIG_MACSEC
4732 int (*macsec_init)(void *priv, struct macsec_init_params *params);
4733
4734 int (*macsec_deinit)(void *priv);
4735
4736 /**
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004737 * macsec_get_capability - Inform MKA of this driver's capability
4738 * @priv: Private driver interface data
4739 * @cap: Driver's capability
4740 * Returns: 0 on success, -1 on failure
4741 */
4742 int (*macsec_get_capability)(void *priv, enum macsec_cap *cap);
4743
4744 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004745 * enable_protect_frames - Set protect frames status
4746 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004747 * @enabled: true = protect frames enabled
4748 * false = protect frames disabled
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004749 * Returns: 0 on success, -1 on failure (or if not supported)
4750 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004751 int (*enable_protect_frames)(void *priv, bool enabled);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004752
4753 /**
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004754 * enable_encrypt - Set encryption status
4755 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004756 * @enabled: true = encrypt outgoing traffic
4757 * false = integrity-only protection on outgoing traffic
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004758 * Returns: 0 on success, -1 on failure (or if not supported)
4759 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004760 int (*enable_encrypt)(void *priv, bool enabled);
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004761
4762 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004763 * set_replay_protect - Set replay protect status and window size
4764 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004765 * @enabled: true = replay protect enabled
4766 * false = replay protect disabled
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004767 * @window: replay window size, valid only when replay protect enabled
4768 * Returns: 0 on success, -1 on failure (or if not supported)
4769 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004770 int (*set_replay_protect)(void *priv, bool enabled, u32 window);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004771
4772 /**
Sunil Ravi036cec52023-03-29 11:35:17 -07004773 * set_offload - Set MACsec hardware offload
4774 * @priv: Private driver interface data
4775 * @offload: 0 = MACSEC_OFFLOAD_OFF
4776 * 1 = MACSEC_OFFLOAD_PHY
4777 * 2 = MACSEC_OFFLOAD_MAC
4778 * Returns: 0 on success, -1 on failure (or if not supported)
4779 */
4780 int (*set_offload)(void *priv, u8 offload);
4781
4782 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004783 * set_current_cipher_suite - Set current cipher suite
4784 * @priv: Private driver interface data
4785 * @cs: EUI64 identifier
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004786 * Returns: 0 on success, -1 on failure (or if not supported)
4787 */
Dmitry Shmidt7d175302016-09-06 13:11:34 -07004788 int (*set_current_cipher_suite)(void *priv, u64 cs);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004789
4790 /**
4791 * enable_controlled_port - Set controlled port status
4792 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004793 * @enabled: true = controlled port enabled
4794 * false = controlled port disabled
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004795 * Returns: 0 on success, -1 on failure (or if not supported)
4796 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004797 int (*enable_controlled_port)(void *priv, bool enabled);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004798
4799 /**
4800 * get_receive_lowest_pn - Get receive lowest pn
4801 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004802 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004803 * Returns: 0 on success, -1 on failure (or if not supported)
4804 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004805 int (*get_receive_lowest_pn)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004806
4807 /**
4808 * get_transmit_next_pn - Get transmit next pn
4809 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004810 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004811 * Returns: 0 on success, -1 on failure (or if not supported)
4812 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004813 int (*get_transmit_next_pn)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004814
4815 /**
4816 * set_transmit_next_pn - Set transmit next pn
4817 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004818 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004819 * Returns: 0 on success, -1 on failure (or if not supported)
4820 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004821 int (*set_transmit_next_pn)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004822
4823 /**
Hai Shalom74f70d42019-02-11 14:42:39 -08004824 * set_receive_lowest_pn - Set receive lowest PN
4825 * @priv: Private driver interface data
4826 * @sa: secure association
4827 * Returns: 0 on success, -1 on failure (or if not supported)
4828 */
4829 int (*set_receive_lowest_pn)(void *priv, struct receive_sa *sa);
4830
4831 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004832 * create_receive_sc - create secure channel for receiving
4833 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004834 * @sc: secure channel
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004835 * @conf_offset: confidentiality offset (0, 30, or 50)
4836 * @validation: frame validation policy (0 = Disabled, 1 = Checked,
4837 * 2 = Strict)
4838 * Returns: 0 on success, -1 on failure (or if not supported)
4839 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004840 int (*create_receive_sc)(void *priv, struct receive_sc *sc,
4841 unsigned int conf_offset,
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004842 int validation);
4843
4844 /**
4845 * delete_receive_sc - delete secure connection for receiving
4846 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004847 * @sc: secure channel
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004848 * Returns: 0 on success, -1 on failure
4849 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004850 int (*delete_receive_sc)(void *priv, struct receive_sc *sc);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004851
4852 /**
4853 * create_receive_sa - create secure association for receive
4854 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004855 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004856 * Returns: 0 on success, -1 on failure
4857 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004858 int (*create_receive_sa)(void *priv, struct receive_sa *sa);
4859
4860 /**
4861 * delete_receive_sa - Delete secure association for receive
4862 * @priv: Private driver interface data from init()
4863 * @sa: Secure association
4864 * Returns: 0 on success, -1 on failure
4865 */
4866 int (*delete_receive_sa)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004867
4868 /**
4869 * enable_receive_sa - enable the SA for receive
4870 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004871 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004872 * Returns: 0 on success, -1 on failure
4873 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004874 int (*enable_receive_sa)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004875
4876 /**
4877 * disable_receive_sa - disable SA for receive
4878 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004879 * @sa: secure association
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 (*disable_receive_sa)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004883
4884 /**
4885 * create_transmit_sc - create secure connection for transmit
4886 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004887 * @sc: secure channel
4888 * @conf_offset: confidentiality offset (0, 30, or 50)
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004889 * Returns: 0 on success, -1 on failure
4890 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004891 int (*create_transmit_sc)(void *priv, struct transmit_sc *sc,
4892 unsigned int conf_offset);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004893
4894 /**
4895 * delete_transmit_sc - delete secure connection for transmit
4896 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004897 * @sc: secure channel
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004898 * Returns: 0 on success, -1 on failure
4899 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004900 int (*delete_transmit_sc)(void *priv, struct transmit_sc *sc);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004901
4902 /**
4903 * create_transmit_sa - create secure association for transmit
4904 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004905 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004906 * Returns: 0 on success, -1 on failure
4907 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004908 int (*create_transmit_sa)(void *priv, struct transmit_sa *sa);
4909
4910 /**
4911 * delete_transmit_sa - Delete secure association for transmit
4912 * @priv: Private driver interface data from init()
4913 * @sa: Secure association
4914 * Returns: 0 on success, -1 on failure
4915 */
4916 int (*delete_transmit_sa)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004917
4918 /**
4919 * enable_transmit_sa - enable SA for transmit
4920 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004921 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004922 * Returns: 0 on success, -1 on failure
4923 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004924 int (*enable_transmit_sa)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004925
4926 /**
4927 * disable_transmit_sa - disable SA for transmit
4928 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004929 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004930 * Returns: 0 on success, -1 on failure
4931 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004932 int (*disable_transmit_sa)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004933#endif /* CONFIG_MACSEC */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004934
4935 /**
4936 * init_mesh - Driver specific initialization for mesh
4937 * @priv: Private driver interface data
4938 * Returns: 0 on success, -1 on failure
4939 */
4940 int (*init_mesh)(void *priv);
4941
4942 /**
4943 * join_mesh - Join a mesh network
4944 * @priv: Private driver interface data
4945 * @params: Mesh configuration parameters
4946 * Returns: 0 on success, -1 on failure
4947 */
4948 int (*join_mesh)(void *priv,
4949 struct wpa_driver_mesh_join_params *params);
4950
4951 /**
4952 * leave_mesh - Leave a mesh network
4953 * @priv: Private driver interface data
4954 * Returns 0 on success, -1 on failure
4955 */
4956 int (*leave_mesh)(void *priv);
4957
4958 /**
Hai Shalom81f62d82019-07-22 12:10:00 -07004959 * probe_mesh_link - Inject a frame over direct mesh link to a given
4960 * peer skipping the next_hop lookup from mpath table.
4961 * @priv: Private driver interface data
4962 * @addr: Peer MAC address
4963 * @eth: Ethernet frame to be sent
4964 * @len: Ethernet frame lengtn in bytes
4965 * Returns 0 on success, -1 on failure
4966 */
4967 int (*probe_mesh_link)(void *priv, const u8 *addr, const u8 *eth,
4968 size_t len);
4969
4970 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004971 * do_acs - Automatically select channel
4972 * @priv: Private driver interface data
4973 * @params: Parameters for ACS
4974 * Returns 0 on success, -1 on failure
4975 *
4976 * This command can be used to offload ACS to the driver if the driver
4977 * indicates support for such offloading (WPA_DRIVER_FLAGS_ACS_OFFLOAD).
4978 */
4979 int (*do_acs)(void *priv, struct drv_acs_params *params);
Ravi Joshie6ccb162015-07-16 17:45:41 -07004980
4981 /**
Hai Shalom60840252021-02-19 19:02:11 -08004982 * set_band - Notify driver of band(s) selection
Ravi Joshie6ccb162015-07-16 17:45:41 -07004983 * @priv: Private driver interface data
Hai Shalom60840252021-02-19 19:02:11 -08004984 * @band_mask: The selected band(s) bit mask (from enum set_band)
Ravi Joshie6ccb162015-07-16 17:45:41 -07004985 * Returns 0 on success, -1 on failure
4986 */
Hai Shalom60840252021-02-19 19:02:11 -08004987 int (*set_band)(void *priv, u32 band_mask);
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08004988
4989 /**
4990 * get_pref_freq_list - Get preferred frequency list for an interface
4991 * @priv: Private driver interface data
4992 * @if_type: Interface type
4993 * @num: Number of channels
Sunil8cd6f4d2022-06-28 18:40:46 +00004994 * @freq_list: Weighted preferred channel list
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08004995 * Returns 0 on success, -1 on failure
4996 *
4997 * This command can be used to query the preferred frequency list from
Sunil8cd6f4d2022-06-28 18:40:46 +00004998 * the driver specific to a particular interface type. The freq_list
4999 * array needs to have room for *num entries. *num will be updated to
5000 * indicate the number of entries fetched from the driver.
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08005001 */
5002 int (*get_pref_freq_list)(void *priv, enum wpa_driver_if_type if_type,
Sunil8cd6f4d2022-06-28 18:40:46 +00005003 unsigned int *num,
5004 struct weighted_pcl *freq_list);
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08005005
5006 /**
5007 * set_prob_oper_freq - Indicate probable P2P operating channel
5008 * @priv: Private driver interface data
5009 * @freq: Channel frequency in MHz
5010 * Returns 0 on success, -1 on failure
5011 *
5012 * This command can be used to inform the driver of the operating
5013 * frequency that an ongoing P2P group formation is likely to come up
5014 * on. Local device is assuming P2P Client role.
5015 */
5016 int (*set_prob_oper_freq)(void *priv, unsigned int freq);
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08005017
5018 /**
5019 * abort_scan - Request the driver to abort an ongoing scan
5020 * @priv: Private driver interface data
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08005021 * @scan_cookie: Cookie identifying the scan request. This is used only
5022 * when the vendor interface QCA_NL80211_VENDOR_SUBCMD_TRIGGER_SCAN
5023 * was used to trigger scan. Otherwise, 0 is used.
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08005024 * Returns 0 on success, -1 on failure
5025 */
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08005026 int (*abort_scan)(void *priv, u64 scan_cookie);
Dmitry Shmidt849734c2016-05-27 09:59:01 -07005027
5028 /**
5029 * configure_data_frame_filters - Request to configure frame filters
5030 * @priv: Private driver interface data
5031 * @filter_flags: The type of frames to filter (bitfield of
5032 * WPA_DATA_FRAME_FILTER_FLAG_*)
5033 * Returns: 0 on success or -1 on failure
5034 */
5035 int (*configure_data_frame_filters)(void *priv, u32 filter_flags);
Dmitry Shmidtd5ab1b52016-06-21 12:38:41 -07005036
5037 /**
5038 * get_ext_capab - Get extended capabilities for the specified interface
5039 * @priv: Private driver interface data
5040 * @type: Interface type for which to get extended capabilities
5041 * @ext_capab: Extended capabilities fetched
5042 * @ext_capab_mask: Extended capabilities mask
5043 * @ext_capab_len: Length of the extended capabilities
5044 * Returns: 0 on success or -1 on failure
5045 */
5046 int (*get_ext_capab)(void *priv, enum wpa_driver_if_type type,
5047 const u8 **ext_capab, const u8 **ext_capab_mask,
5048 unsigned int *ext_capab_len);
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07005049
5050 /**
Sunil Ravi2a14cf12023-11-21 00:54:38 +00005051 * get_mld_capab - Get MLD capabilities for the specified interface
5052 * @priv: Private driver interface data
5053 * @type: Interface type for which to get MLD capabilities
5054 * @eml_capa: EML capabilities
5055 * @mld_capa_and_ops: MLD Capabilities and Operations
5056 * Returns: 0 on success or -1 on failure
5057 */
5058 int (*get_mld_capab)(void *priv, enum wpa_driver_if_type type,
5059 u16 *eml_capa, u16 *mld_capa_and_ops);
5060
5061 /**
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07005062 * p2p_lo_start - Start offloading P2P listen to device
5063 * @priv: Private driver interface data
5064 * @freq: Listening frequency (MHz) for P2P listen
5065 * @period: Length of the listen operation in milliseconds
5066 * @interval: Interval for running the listen operation in milliseconds
5067 * @count: Number of times to run the listen operation
5068 * @device_types: Device primary and secondary types
5069 * @dev_types_len: Number of bytes for device_types
5070 * @ies: P2P IE and WSC IE for Probe Response frames
5071 * @ies_len: Length of ies in bytes
5072 * Returns: 0 on success or -1 on failure
5073 */
5074 int (*p2p_lo_start)(void *priv, unsigned int freq,
5075 unsigned int period, unsigned int interval,
5076 unsigned int count,
5077 const u8 *device_types, size_t dev_types_len,
5078 const u8 *ies, size_t ies_len);
5079
5080 /**
5081 * p2p_lo_stop - Stop P2P listen offload
5082 * @priv: Private driver interface data
5083 * Returns: 0 on success or -1 on failure
5084 */
5085 int (*p2p_lo_stop)(void *priv);
Dmitry Shmidt7f2c7532016-08-15 09:48:12 -07005086
5087 /**
5088 * set_default_scan_ies - Set default scan IEs
5089 * @priv: Private driver interface data
5090 * @ies: Scan default IEs buffer
5091 * @ies_len: Length of IEs in bytes
5092 * Returns: 0 on success or -1 on failure
5093 *
5094 * The driver can use these by default when there are no scan IEs coming
5095 * in the subsequent scan requests. Also in case of one or more of IEs
5096 * given in set_default_scan_ies() are missing in the subsequent scan
5097 * request, the driver should merge the missing scan IEs in the scan
5098 * request from the IEs set by set_default_scan_ies() in the Probe
5099 * Request frames sent.
5100 */
5101 int (*set_default_scan_ies)(void *priv, const u8 *ies, size_t ies_len);
5102
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08005103 /**
5104 * set_tdls_mode - Set TDLS trigger mode to the host driver
5105 * @priv: Private driver interface data
5106 * @tdls_external_control: Represents if TDLS external trigger control
5107 * mode is enabled/disabled.
5108 *
5109 * This optional callback can be used to configure the TDLS external
5110 * trigger control mode to the host driver.
5111 */
5112 int (*set_tdls_mode)(void *priv, int tdls_external_control);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005113
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005114 /**
5115 * get_bss_transition_status - Get candidate BSS's transition status
5116 * @priv: Private driver interface data
5117 * @params: Candidate BSS list
5118 *
5119 * Get the accept or reject reason code for a list of BSS transition
5120 * candidates.
5121 */
5122 struct wpa_bss_candidate_info *
5123 (*get_bss_transition_status)(void *priv,
5124 struct wpa_bss_trans_info *params);
5125 /**
5126 * ignore_assoc_disallow - Configure driver to ignore assoc_disallow
5127 * @priv: Private driver interface data
5128 * @ignore_disallow: 0 to not ignore, 1 to ignore
5129 * Returns: 0 on success, -1 on failure
5130 */
5131 int (*ignore_assoc_disallow)(void *priv, int ignore_disallow);
5132
5133 /**
Hai Shalom899fcc72020-10-19 14:38:18 -07005134 * set_bssid_tmp_disallow - Set disallowed BSSIDs to the driver
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005135 * @priv: Private driver interface data
Hai Shalom899fcc72020-10-19 14:38:18 -07005136 * @num_bssid: Number of temporarily disallowed BSSIDs
5137 * @bssids: List of temporarily disallowed BSSIDs
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005138 */
Hai Shalom899fcc72020-10-19 14:38:18 -07005139 int (*set_bssid_tmp_disallow)(void *priv, unsigned int num_bssid,
5140 const u8 *bssid);
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005141
5142 /**
5143 * update_connect_params - Update the connection parameters
5144 * @priv: Private driver interface data
5145 * @params: Association parameters
5146 * @mask: Bit mask indicating which parameters in @params have to be
5147 * updated
5148 * Returns: 0 on success, -1 on failure
5149 *
5150 * Update the connection parameters when in connected state so that the
5151 * driver uses the updated parameters for subsequent roaming. This is
5152 * used only with drivers that implement internal BSS selection and
5153 * roaming.
5154 */
5155 int (*update_connect_params)(
5156 void *priv, struct wpa_driver_associate_params *params,
5157 enum wpa_drv_update_connect_params_mask mask);
Roshan Pius3a1667e2018-07-03 15:17:14 -07005158
5159 /**
5160 * send_external_auth_status - Indicate the status of external
5161 * authentication processing to the host driver.
5162 * @priv: Private driver interface data
5163 * @params: Status of authentication processing.
5164 * Returns: 0 on success, -1 on failure
5165 */
5166 int (*send_external_auth_status)(void *priv,
5167 struct external_auth *params);
Hai Shalom74f70d42019-02-11 14:42:39 -08005168
5169 /**
5170 * set_4addr_mode - Set 4-address mode
5171 * @priv: Private driver interface data
5172 * @bridge_ifname: Bridge interface name
5173 * @val: 0 - disable 4addr mode, 1 - enable 4addr mode
5174 * Returns: 0 on success, < 0 on failure
5175 */
5176 int (*set_4addr_mode)(void *priv, const char *bridge_ifname, int val);
Hai Shalom81f62d82019-07-22 12:10:00 -07005177
5178 /**
5179 * update_dh_ie - Update DH IE
5180 * @priv: Private driver interface data
5181 * @peer_mac: Peer MAC address
5182 * @reason_code: Reacon code
5183 * @ie: DH IE
5184 * @ie_len: DH IE length in bytes
5185 * Returns: 0 on success, -1 on failure
5186 *
5187 * This callback is used to let the driver know the DH processing result
5188 * and DH IE for a pending association.
5189 */
5190 int (*update_dh_ie)(void *priv, const u8 *peer_mac, u16 reason_code,
5191 const u8 *ie, size_t ie_len);
Hai Shalomb755a2a2020-04-23 21:49:02 -07005192
5193 /**
5194 * dpp_listen - Notify driver about start/stop of DPP listen
5195 * @priv: Private driver interface data
5196 * @enable: Whether listen state is enabled (or disabled)
5197 * Returns: 0 on success, -1 on failure
5198 *
5199 * This optional callback can be used to update RX frame filtering to
5200 * explicitly allow reception of broadcast Public Action frames.
5201 */
Hai Shalome21d4e82020-04-29 16:34:06 -07005202 int (*dpp_listen)(void *priv, bool enable);
Hai Shalomc1a21442022-02-04 13:43:00 -08005203
Sunil Ravi89eba102022-09-13 21:04:37 -07005204 /**
5205 * set_secure_ranging_ctx - Add or delete secure ranging parameters of
5206 * the specified peer to the driver.
5207 * @priv: Private driver interface data
5208 * @params: Secure ranging parameters
5209 * Returns: 0 on success, -1 on failure
5210 *
5211 */
5212 int (*set_secure_ranging_ctx)(void *priv,
5213 struct secure_ranging_params *params);
5214
5215 /**
5216 * send_pasn_resp - Send PASN response for a set of peers to the
5217 * driver.
5218 * @priv: Private driver interface data
5219 * @params: Parameters holding peers and respective status.
5220 * Returns: 0 on success, -1 on failure
5221 */
5222 int (*send_pasn_resp)(void *priv, struct pasn_auth *params);
5223
5224 /**
5225 * get_sta_mlo_info - Get the current multi-link association info
5226 * @priv: Private driver interface data
5227 * @mlo: Pointer to fill multi-link association info
5228 * Returns: 0 on success, -1 on failure
5229 *
5230 * This callback is used to fetch multi-link of the current association.
5231 */
5232 int (*get_sta_mlo_info)(void *priv,
5233 struct driver_sta_mlo_info *mlo_info);
5234
Sunil Ravi036cec52023-03-29 11:35:17 -07005235 /**
5236 * link_add - Add a link to the AP MLD interface
5237 * @priv: Private driver interface data
5238 * @link_id: The link ID
5239 * @addr: The MAC address to use for the link
Sunil Ravi99c035e2024-07-12 01:42:03 +00005240 * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces
Sunil Ravi036cec52023-03-29 11:35:17 -07005241 * Returns: 0 on success, negative value on failure
5242 */
Sunil Ravi99c035e2024-07-12 01:42:03 +00005243 int (*link_add)(void *priv, u8 link_id, const u8 *addr, void *bss_ctx);
5244
5245 /**
5246 * link_remove - Remove a link from the AP MLD interface
5247 * @priv: Private driver interface data
5248 * @type: Interface type
5249 * @ifname: Interface name of the virtual interface from where the link
5250 * is to be removed.
5251 * @link_id: Valid link ID to remove
5252 * Returns: 0 on success, -1 on failure
5253 */
5254 int (*link_remove)(void *priv, enum wpa_driver_if_type type,
5255 const char *ifname, u8 link_id);
5256
5257 /**
5258 * is_drv_shared - Check whether the driver interface is shared
5259 * @priv: Private driver interface data from init()
Sunil Ravic0f5d412024-09-11 22:12:49 +00005260 * @link_id: Link ID to match
5261 * Returns: true if it is being used or else false.
Sunil Ravi99c035e2024-07-12 01:42:03 +00005262 *
5263 * Checks whether the driver interface is being used by other partner
5264 * BSS(s) or not. This is used to decide whether the driver interface
5265 * needs to be deinitilized when one interface is getting deinitialized.
5266 *
Sunil Ravic0f5d412024-09-11 22:12:49 +00005267 * NOTE: @link_id will be used only when there is only one BSS
5268 * present and if that single link is active. In that case, the
5269 * link ID is matched with the active link_id to decide whether the
5270 * driver interface is being used by other partner BSS(s).
Sunil Ravi99c035e2024-07-12 01:42:03 +00005271 */
Sunil Ravic0f5d412024-09-11 22:12:49 +00005272 bool (*is_drv_shared)(void *priv, int link_id);
Sunil Ravi99c035e2024-07-12 01:42:03 +00005273
5274 /**
5275 * link_sta_remove - Remove a link STA from an MLD STA
5276 * @priv: Private driver interface data
5277 * @link_id: The link ID which the link STA is using
5278 * @addr: The MLD MAC address of the MLD STA
5279 * Returns: 0 on success, negative value on failure
5280 */
5281 int (*link_sta_remove)(void *priv, u8 link_id, const u8 *addr);
Sunil Ravi036cec52023-03-29 11:35:17 -07005282
Sunil Ravic0f5d412024-09-11 22:12:49 +00005283 /**
5284 * nan_flush - Flush all NAN offload services
5285 * @priv: Private driver interface data
5286 * Returns: 0 on success, negative value on failure
5287 */
5288 int (*nan_flush)(void *priv);
5289
5290 /**
5291 * nan_publish - NAN offload for Publish()
5292 * @priv: Private driver interface data
5293 * @src: Source P2P device addr
5294 * @publish_id: Publish instance to add
5295 * @service_name: Service name
5296 * @service_id: Service ID (6 octet value derived from service name)
5297 * @srv_proto_type: Service protocol type
5298 * @ssi: Service specific information or %NULL
5299 * @elems: Information elements for Element Container attribute or %NULL
5300 * @params: Configuration parameters
5301 * Returns: 0 on success, negative value on failure
5302 */
5303 int (*nan_publish)(void *priv, const u8 *src, int publish_id,
5304 const char *service_name, const u8 *service_id,
5305 enum nan_service_protocol_type srv_proto_type,
5306 const struct wpabuf *ssi, const struct wpabuf *elems,
5307 struct nan_publish_params *params);
5308
5309 /**
5310 * nan_cancel_publish - NAN offload for CancelPublish()
5311 * @priv: Private driver interface data
5312 * @publish_id: Publish instance to cancel
5313 * Returns: 0 on success, negative value on failure
5314 */
5315 int (*nan_cancel_publish)(void *priv, int publish_id);
5316
5317 /**
5318 * nan_update_publish - NAN offload for UpdatePublish()
5319 * @priv: Private driver interface data
5320 * @ssi: Service specific information or %NULL
5321 * Returns: 0 on success, negative value on failure
5322 */
5323 int (*nan_update_publish)(void *priv, int publish_id,
5324 const struct wpabuf *ssi);
5325
5326 /**
5327 * nan_subscribe - NAN offload for Subscribe()
5328 * @priv: Private driver interface data
5329 * @src: Source P2P device addr
5330 * @subscribe_id: Subscribe instance to add
5331 * @service_name: Service name
5332 * @service_id: Service ID (6 octet value derived from service name)
5333 * @srv_proto_type: Service protocol type
5334 * @ssi: Service specific information or %NULL
5335 * @elems: Information elements for Element Container attribute or %NULL
5336 * @params: Configuration parameters
5337 * Returns: 0 on success, negative value on failure
5338 */
5339 int (*nan_subscribe)(void *priv, const u8 *src, int subscribe_id,
5340 const char *service_name, const u8 *service_id,
5341 enum nan_service_protocol_type srv_proto_type,
5342 const struct wpabuf *ssi,
5343 const struct wpabuf *elems,
5344 struct nan_subscribe_params *params);
5345
5346 /**
5347 * nan_cancel_subscribe - NAN offload for CancelSubscribe()
5348 * @priv: Private driver interface data
5349 * @subscribe_id: Subscribe instance to cancel
5350 * Returns: 0 on success, negative value on failure
5351 */
5352 int (*nan_cancel_subscribe)(void *priv, int subscribe_id);
5353
Sunil Ravi79e6c4f2025-01-04 00:47:06 +00005354 /**
5355 * can_share_drv - Check whether driver interface can be shared
5356 * @ctx: Pointer to hostapd context
5357 * @params: Configuration for the driver wrapper
5358 * @hapd: Pointer for overwriting the hapd context or %NULL
5359 * if can't find a shared drv
5360 *
5361 * Checks whether the driver interface with same phy name is
5362 * already present under the global driver which can be shared
5363 * instead of creating a new driver interface instance. If present,
5364 * @hapd will be overwritten with the hapd pointer which this shared
5365 * drv's first BSS is using. This will help the caller to later call
5366 * if_add().
5367 *
5368 * Returns: true if it can be shared or else false.
5369 */
5370 bool (*can_share_drv)(void *ctx, struct wpa_init_params *params,
5371 void **hapd);
5372
Hai Shalomc1a21442022-02-04 13:43:00 -08005373#ifdef CONFIG_TESTING_OPTIONS
5374 int (*register_frame)(void *priv, u16 type,
5375 const u8 *match, size_t match_len,
5376 bool multicast);
5377#endif /* CONFIG_TESTING_OPTIONS */
Sunil Ravic0f5d412024-09-11 22:12:49 +00005378
5379 /**
5380 * get_multi_hw_info - Get multiple underlying hardware information
5381 * (hardware IDx and supported frequency range)
5382 * @priv: Private driver interface data
5383 * @num_multi_hws: Variable for returning the number of returned
5384 * hardware info data
5385 * Returns: Pointer to allocated multiple hardware data on success
5386 * or %NULL on failure. Caller is responsible for freeing this.
5387 */
5388 struct hostapd_multi_hw_info *
5389 (*get_multi_hw_info)(void *priv, unsigned int *num_multi_hws);
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005390};
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005391
5392/**
5393 * enum wpa_event_type - Event type for wpa_supplicant_event() calls
5394 */
5395enum wpa_event_type {
5396 /**
5397 * EVENT_ASSOC - Association completed
5398 *
5399 * This event needs to be delivered when the driver completes IEEE
5400 * 802.11 association or reassociation successfully.
5401 * wpa_driver_ops::get_bssid() is expected to provide the current BSSID
5402 * after this event has been generated. In addition, optional
5403 * EVENT_ASSOCINFO may be generated just before EVENT_ASSOC to provide
5404 * more information about the association. If the driver interface gets
5405 * both of these events at the same time, it can also include the
5406 * assoc_info data in EVENT_ASSOC call.
5407 */
5408 EVENT_ASSOC,
5409
5410 /**
5411 * EVENT_DISASSOC - Association lost
5412 *
5413 * This event should be called when association is lost either due to
5414 * receiving deauthenticate or disassociate frame from the AP or when
5415 * sending either of these frames to the current AP. If the driver
5416 * supports separate deauthentication event, EVENT_DISASSOC should only
5417 * be used for disassociation and EVENT_DEAUTH for deauthentication.
5418 * In AP mode, union wpa_event_data::disassoc_info is required.
5419 */
5420 EVENT_DISASSOC,
5421
5422 /**
5423 * EVENT_MICHAEL_MIC_FAILURE - Michael MIC (TKIP) detected
5424 *
5425 * This event must be delivered when a Michael MIC error is detected by
5426 * the local driver. Additional data for event processing is
5427 * provided with union wpa_event_data::michael_mic_failure. This
Sunil Ravia04bd252022-05-02 22:54:18 -07005428 * information is used to request new encryption key and to initiate
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005429 * TKIP countermeasures if needed.
5430 */
5431 EVENT_MICHAEL_MIC_FAILURE,
5432
5433 /**
5434 * EVENT_SCAN_RESULTS - Scan results available
5435 *
5436 * This event must be called whenever scan results are available to be
5437 * fetched with struct wpa_driver_ops::get_scan_results(). This event
5438 * is expected to be used some time after struct wpa_driver_ops::scan()
5439 * is called. If the driver provides an unsolicited event when the scan
5440 * has been completed, this event can be used to trigger
5441 * EVENT_SCAN_RESULTS call. If such event is not available from the
5442 * driver, the driver wrapper code is expected to use a registered
5443 * timeout to generate EVENT_SCAN_RESULTS call after the time that the
5444 * scan is expected to be completed. Optional information about
5445 * completed scan can be provided with union wpa_event_data::scan_info.
5446 */
5447 EVENT_SCAN_RESULTS,
5448
5449 /**
5450 * EVENT_ASSOCINFO - Report optional extra information for association
5451 *
5452 * This event can be used to report extra association information for
5453 * EVENT_ASSOC processing. This extra information includes IEs from
5454 * association frames and Beacon/Probe Response frames in union
5455 * wpa_event_data::assoc_info. EVENT_ASSOCINFO must be send just before
5456 * EVENT_ASSOC. Alternatively, the driver interface can include
5457 * assoc_info data in the EVENT_ASSOC call if it has all the
5458 * information available at the same point.
5459 */
5460 EVENT_ASSOCINFO,
5461
5462 /**
5463 * EVENT_INTERFACE_STATUS - Report interface status changes
5464 *
5465 * This optional event can be used to report changes in interface
5466 * status (interface added/removed) using union
5467 * wpa_event_data::interface_status. This can be used to trigger
5468 * wpa_supplicant to stop and re-start processing for the interface,
5469 * e.g., when a cardbus card is ejected/inserted.
5470 */
5471 EVENT_INTERFACE_STATUS,
5472
5473 /**
5474 * EVENT_PMKID_CANDIDATE - Report a candidate AP for pre-authentication
5475 *
5476 * This event can be used to inform wpa_supplicant about candidates for
5477 * RSN (WPA2) pre-authentication. If wpa_supplicant is not responsible
5478 * for scan request (ap_scan=2 mode), this event is required for
5479 * pre-authentication. If wpa_supplicant is performing scan request
5480 * (ap_scan=1), this event is optional since scan results can be used
5481 * to add pre-authentication candidates. union
5482 * wpa_event_data::pmkid_candidate is used to report the BSSID of the
5483 * candidate and priority of the candidate, e.g., based on the signal
5484 * strength, in order to try to pre-authenticate first with candidates
5485 * that are most likely targets for re-association.
5486 *
5487 * EVENT_PMKID_CANDIDATE can be called whenever the driver has updates
5488 * on the candidate list. In addition, it can be called for the current
5489 * AP and APs that have existing PMKSA cache entries. wpa_supplicant
5490 * will automatically skip pre-authentication in cases where a valid
5491 * PMKSA exists. When more than one candidate exists, this event should
5492 * be generated once for each candidate.
5493 *
5494 * Driver will be notified about successful pre-authentication with
5495 * struct wpa_driver_ops::add_pmkid() calls.
5496 */
5497 EVENT_PMKID_CANDIDATE,
5498
5499 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005500 * EVENT_TDLS - Request TDLS operation
5501 *
5502 * This event can be used to request a TDLS operation to be performed.
5503 */
5504 EVENT_TDLS,
5505
5506 /**
5507 * EVENT_FT_RESPONSE - Report FT (IEEE 802.11r) response IEs
5508 *
5509 * The driver is expected to report the received FT IEs from
5510 * FT authentication sequence from the AP. The FT IEs are included in
5511 * the extra information in union wpa_event_data::ft_ies.
5512 */
5513 EVENT_FT_RESPONSE,
5514
5515 /**
5516 * EVENT_IBSS_RSN_START - Request RSN authentication in IBSS
5517 *
5518 * The driver can use this event to inform wpa_supplicant about a STA
5519 * in an IBSS with which protected frames could be exchanged. This
5520 * event starts RSN authentication with the other STA to authenticate
5521 * the STA and set up encryption keys with it.
5522 */
5523 EVENT_IBSS_RSN_START,
5524
5525 /**
5526 * EVENT_AUTH - Authentication result
5527 *
5528 * This event should be called when authentication attempt has been
5529 * completed. This is only used if the driver supports separate
5530 * authentication step (struct wpa_driver_ops::authenticate).
5531 * Information about authentication result is included in
5532 * union wpa_event_data::auth.
5533 */
5534 EVENT_AUTH,
5535
5536 /**
5537 * EVENT_DEAUTH - Authentication lost
5538 *
5539 * This event should be called when authentication is lost either due
5540 * to receiving deauthenticate frame from the AP or when sending that
5541 * frame to the current AP.
5542 * In AP mode, union wpa_event_data::deauth_info is required.
5543 */
5544 EVENT_DEAUTH,
5545
5546 /**
5547 * EVENT_ASSOC_REJECT - Association rejected
5548 *
5549 * This event should be called when (re)association attempt has been
5550 * rejected by the AP. Information about the association response is
5551 * included in union wpa_event_data::assoc_reject.
5552 */
5553 EVENT_ASSOC_REJECT,
5554
5555 /**
5556 * EVENT_AUTH_TIMED_OUT - Authentication timed out
5557 */
5558 EVENT_AUTH_TIMED_OUT,
5559
5560 /**
5561 * EVENT_ASSOC_TIMED_OUT - Association timed out
5562 */
5563 EVENT_ASSOC_TIMED_OUT,
5564
5565 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005566 * EVENT_WPS_BUTTON_PUSHED - Report hardware push button press for WPS
5567 */
5568 EVENT_WPS_BUTTON_PUSHED,
5569
5570 /**
5571 * EVENT_TX_STATUS - Report TX status
5572 */
5573 EVENT_TX_STATUS,
5574
5575 /**
5576 * EVENT_RX_FROM_UNKNOWN - Report RX from unknown STA
5577 */
5578 EVENT_RX_FROM_UNKNOWN,
5579
5580 /**
5581 * EVENT_RX_MGMT - Report RX of a management frame
5582 */
5583 EVENT_RX_MGMT,
5584
5585 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005586 * EVENT_REMAIN_ON_CHANNEL - Remain-on-channel duration started
5587 *
5588 * This event is used to indicate when the driver has started the
5589 * requested remain-on-channel duration. Information about the
5590 * operation is included in union wpa_event_data::remain_on_channel.
5591 */
5592 EVENT_REMAIN_ON_CHANNEL,
5593
5594 /**
5595 * EVENT_CANCEL_REMAIN_ON_CHANNEL - Remain-on-channel timed out
5596 *
5597 * This event is used to indicate when the driver has completed
5598 * remain-on-channel duration, i.e., may noot be available on the
5599 * requested channel anymore. Information about the
5600 * operation is included in union wpa_event_data::remain_on_channel.
5601 */
5602 EVENT_CANCEL_REMAIN_ON_CHANNEL,
5603
5604 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005605 * EVENT_RX_PROBE_REQ - Indicate received Probe Request frame
5606 *
5607 * This event is used to indicate when a Probe Request frame has been
5608 * received. Information about the received frame is included in
5609 * union wpa_event_data::rx_probe_req. The driver is required to report
5610 * these events only after successfully completed probe_req_report()
5611 * commands to request the events (i.e., report parameter is non-zero)
5612 * in station mode. In AP mode, Probe Request frames should always be
5613 * reported.
5614 */
5615 EVENT_RX_PROBE_REQ,
5616
5617 /**
5618 * EVENT_NEW_STA - New wired device noticed
5619 *
5620 * This event is used to indicate that a new device has been detected
5621 * in a network that does not use association-like functionality (i.e.,
5622 * mainly wired Ethernet). This can be used to start EAPOL
5623 * authenticator when receiving a frame from a device. The address of
5624 * the device is included in union wpa_event_data::new_sta.
5625 */
5626 EVENT_NEW_STA,
5627
5628 /**
5629 * EVENT_EAPOL_RX - Report received EAPOL frame
5630 *
5631 * When in AP mode with hostapd, this event is required to be used to
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08005632 * deliver the receive EAPOL frames from the driver.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005633 */
5634 EVENT_EAPOL_RX,
5635
5636 /**
5637 * EVENT_SIGNAL_CHANGE - Indicate change in signal strength
5638 *
5639 * This event is used to indicate changes in the signal strength
5640 * observed in frames received from the current AP if signal strength
5641 * monitoring has been enabled with signal_monitor().
5642 */
5643 EVENT_SIGNAL_CHANGE,
5644
5645 /**
5646 * EVENT_INTERFACE_ENABLED - Notify that interface was enabled
5647 *
5648 * This event is used to indicate that the interface was enabled after
5649 * having been previously disabled, e.g., due to rfkill.
5650 */
5651 EVENT_INTERFACE_ENABLED,
5652
5653 /**
5654 * EVENT_INTERFACE_DISABLED - Notify that interface was disabled
5655 *
5656 * This event is used to indicate that the interface was disabled,
5657 * e.g., due to rfkill.
5658 */
5659 EVENT_INTERFACE_DISABLED,
5660
5661 /**
5662 * EVENT_CHANNEL_LIST_CHANGED - Channel list changed
5663 *
5664 * This event is used to indicate that the channel list has changed,
5665 * e.g., because of a regulatory domain change triggered by scan
5666 * results including an AP advertising a country code.
5667 */
5668 EVENT_CHANNEL_LIST_CHANGED,
5669
5670 /**
5671 * EVENT_INTERFACE_UNAVAILABLE - Notify that interface is unavailable
5672 *
5673 * This event is used to indicate that the driver cannot maintain this
5674 * interface in its operation mode anymore. The most likely use for
5675 * this is to indicate that AP mode operation is not available due to
5676 * operating channel would need to be changed to a DFS channel when
5677 * the driver does not support radar detection and another virtual
5678 * interfaces caused the operating channel to change. Other similar
5679 * resource conflicts could also trigger this for station mode
Dmitry Shmidtd30ac602014-06-30 09:54:22 -07005680 * interfaces. This event can be propagated when channel switching
5681 * fails.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005682 */
5683 EVENT_INTERFACE_UNAVAILABLE,
5684
5685 /**
5686 * EVENT_BEST_CHANNEL
5687 *
5688 * Driver generates this event whenever it detects a better channel
5689 * (e.g., based on RSSI or channel use). This information can be used
5690 * to improve channel selection for a new AP/P2P group.
5691 */
5692 EVENT_BEST_CHANNEL,
5693
5694 /**
5695 * EVENT_UNPROT_DEAUTH - Unprotected Deauthentication frame received
5696 *
5697 * This event should be called when a Deauthentication frame is dropped
5698 * due to it not being protected (MFP/IEEE 802.11w).
5699 * union wpa_event_data::unprot_deauth is required to provide more
5700 * details of the frame.
5701 */
5702 EVENT_UNPROT_DEAUTH,
5703
5704 /**
5705 * EVENT_UNPROT_DISASSOC - Unprotected Disassociation frame received
5706 *
5707 * This event should be called when a Disassociation frame is dropped
5708 * due to it not being protected (MFP/IEEE 802.11w).
5709 * union wpa_event_data::unprot_disassoc is required to provide more
5710 * details of the frame.
5711 */
5712 EVENT_UNPROT_DISASSOC,
5713
5714 /**
5715 * EVENT_STATION_LOW_ACK
5716 *
5717 * Driver generates this event whenever it detected that a particular
5718 * station was lost. Detection can be through massive transmission
5719 * failures for example.
5720 */
5721 EVENT_STATION_LOW_ACK,
5722
5723 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005724 * EVENT_IBSS_PEER_LOST - IBSS peer not reachable anymore
5725 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08005726 EVENT_IBSS_PEER_LOST,
5727
5728 /**
5729 * EVENT_DRIVER_GTK_REKEY - Device/driver did GTK rekey
5730 *
5731 * This event carries the new replay counter to notify wpa_supplicant
5732 * of the current EAPOL-Key Replay Counter in case the driver/firmware
5733 * completed Group Key Handshake while the host (including
5734 * wpa_supplicant was sleeping).
5735 */
5736 EVENT_DRIVER_GTK_REKEY,
5737
5738 /**
5739 * EVENT_SCHED_SCAN_STOPPED - Scheduled scan was stopped
5740 */
5741 EVENT_SCHED_SCAN_STOPPED,
5742
5743 /**
5744 * EVENT_DRIVER_CLIENT_POLL_OK - Station responded to poll
5745 *
5746 * This event indicates that the station responded to the poll
5747 * initiated with @poll_client.
5748 */
5749 EVENT_DRIVER_CLIENT_POLL_OK,
5750
5751 /**
5752 * EVENT_EAPOL_TX_STATUS - notify of EAPOL TX status
5753 */
Dmitry Shmidt04949592012-07-19 12:16:46 -07005754 EVENT_EAPOL_TX_STATUS,
5755
5756 /**
5757 * EVENT_CH_SWITCH - AP or GO decided to switch channels
5758 *
5759 * Described in wpa_event_data.ch_switch
5760 * */
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07005761 EVENT_CH_SWITCH,
5762
5763 /**
Hai Shalom81f62d82019-07-22 12:10:00 -07005764 * EVENT_CH_SWITCH_STARTED - AP or GO started to switch channels
5765 *
5766 * This is a pre-switch event indicating the shortly following switch
5767 * of operating channels.
5768 *
5769 * Described in wpa_event_data.ch_switch
5770 */
5771 EVENT_CH_SWITCH_STARTED,
5772 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07005773 * EVENT_WNM - Request WNM operation
5774 *
5775 * This event can be used to request a WNM operation to be performed.
5776 */
Dmitry Shmidtf8623282013-02-20 14:34:59 -08005777 EVENT_WNM,
5778
5779 /**
5780 * EVENT_CONNECT_FAILED_REASON - Connection failure reason in AP mode
5781 *
5782 * This event indicates that the driver reported a connection failure
5783 * with the specified client (for example, max client reached, etc.) in
5784 * AP mode.
5785 */
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005786 EVENT_CONNECT_FAILED_REASON,
5787
5788 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005789 * EVENT_DFS_RADAR_DETECTED - Notify of radar detection
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005790 *
5791 * A radar has been detected on the supplied frequency, hostapd should
5792 * react accordingly (e.g., change channel).
5793 */
5794 EVENT_DFS_RADAR_DETECTED,
5795
5796 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005797 * EVENT_DFS_CAC_FINISHED - Notify that channel availability check has been completed
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005798 *
5799 * After a successful CAC, the channel can be marked clear and used.
5800 */
5801 EVENT_DFS_CAC_FINISHED,
5802
5803 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005804 * EVENT_DFS_CAC_ABORTED - Notify that channel availability check has been aborted
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005805 *
5806 * The CAC was not successful, and the channel remains in the previous
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08005807 * state. This may happen due to a radar being detected or other
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005808 * external influences.
5809 */
5810 EVENT_DFS_CAC_ABORTED,
5811
5812 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005813 * EVENT_DFS_NOP_FINISHED - Notify that non-occupancy period is over
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005814 *
5815 * The channel which was previously unavailable is now available again.
5816 */
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07005817 EVENT_DFS_NOP_FINISHED,
5818
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08005819 /**
5820 * EVENT_SURVEY - Received survey data
5821 *
5822 * This event gets triggered when a driver query is issued for survey
5823 * data and the requested data becomes available. The returned data is
5824 * stored in struct survey_results. The results provide at most one
5825 * survey entry for each frequency and at minimum will provide one
5826 * survey entry for one frequency. The survey data can be os_malloc()'d
5827 * and then os_free()'d, so the event callback must only copy data.
5828 */
5829 EVENT_SURVEY,
5830
5831 /**
5832 * EVENT_SCAN_STARTED - Scan started
5833 *
5834 * This indicates that driver has started a scan operation either based
5835 * on a request from wpa_supplicant/hostapd or from another application.
5836 * EVENT_SCAN_RESULTS is used to indicate when the scan has been
5837 * completed (either successfully or by getting cancelled).
5838 */
Dmitry Shmidtcf32e602014-01-28 10:57:39 -08005839 EVENT_SCAN_STARTED,
5840
5841 /**
5842 * EVENT_AVOID_FREQUENCIES - Received avoid frequency range
5843 *
5844 * This event indicates a set of frequency ranges that should be avoided
5845 * to reduce issues due to interference or internal co-existence
5846 * information in the driver.
5847 */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08005848 EVENT_AVOID_FREQUENCIES,
5849
5850 /**
5851 * EVENT_NEW_PEER_CANDIDATE - new (unknown) mesh peer notification
5852 */
5853 EVENT_NEW_PEER_CANDIDATE,
5854
5855 /**
5856 * EVENT_ACS_CHANNEL_SELECTED - Received selected channels by ACS
5857 *
5858 * Indicates a pair of primary and secondary channels chosen by ACS
5859 * in device.
5860 */
5861 EVENT_ACS_CHANNEL_SELECTED,
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005862
5863 /**
5864 * EVENT_DFS_CAC_STARTED - Notify that channel availability check has
5865 * been started.
5866 *
5867 * This event indicates that channel availability check has been started
5868 * on a DFS frequency by a driver that supports DFS Offload.
5869 */
5870 EVENT_DFS_CAC_STARTED,
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07005871
5872 /**
5873 * EVENT_P2P_LO_STOP - Notify that P2P listen offload is stopped
5874 */
5875 EVENT_P2P_LO_STOP,
Paul Stewart092955c2017-02-06 09:13:09 -08005876
5877 /**
5878 * EVENT_BEACON_LOSS - Beacon loss detected
5879 *
5880 * This event indicates that no Beacon frames has been received from
5881 * the current AP. This may indicate that the AP is not anymore in
5882 * range.
5883 */
5884 EVENT_BEACON_LOSS,
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005885
5886 /**
5887 * EVENT_DFS_PRE_CAC_EXPIRED - Notify that channel availability check
5888 * done previously (Pre-CAC) on the channel has expired. This would
5889 * normally be on a non-ETSI DFS regulatory domain. DFS state of the
5890 * channel will be moved from available to usable. A new CAC has to be
5891 * performed before start operating on this channel.
5892 */
5893 EVENT_DFS_PRE_CAC_EXPIRED,
Roshan Pius3a1667e2018-07-03 15:17:14 -07005894
5895 /**
5896 * EVENT_EXTERNAL_AUTH - This event interface is used by host drivers
5897 * that do not define separate commands for authentication and
5898 * association (~WPA_DRIVER_FLAGS_SME) but offload the 802.11
5899 * authentication to wpa_supplicant. This event carries all the
5900 * necessary information from the host driver for the authentication to
5901 * happen.
5902 */
5903 EVENT_EXTERNAL_AUTH,
5904
5905 /**
5906 * EVENT_PORT_AUTHORIZED - Notification that a connection is authorized
5907 *
5908 * This event should be indicated when the driver completes the 4-way
5909 * handshake. This event should be preceded by an EVENT_ASSOC that
5910 * indicates the completion of IEEE 802.11 association.
5911 */
5912 EVENT_PORT_AUTHORIZED,
5913
5914 /**
5915 * EVENT_STATION_OPMODE_CHANGED - Notify STA's HT/VHT operation mode
5916 * change event.
5917 */
5918 EVENT_STATION_OPMODE_CHANGED,
5919
5920 /**
5921 * EVENT_INTERFACE_MAC_CHANGED - Notify that interface MAC changed
5922 *
5923 * This event is emitted when the MAC changes while the interface is
5924 * enabled. When an interface was disabled and becomes enabled, it
5925 * must be always assumed that the MAC possibly changed.
5926 */
5927 EVENT_INTERFACE_MAC_CHANGED,
5928
5929 /**
5930 * EVENT_WDS_STA_INTERFACE_STATUS - Notify WDS STA interface status
5931 *
5932 * This event is emitted when an interface is added/removed for WDS STA.
5933 */
5934 EVENT_WDS_STA_INTERFACE_STATUS,
Hai Shalom81f62d82019-07-22 12:10:00 -07005935
5936 /**
5937 * EVENT_UPDATE_DH - Notification of updated DH information
5938 */
5939 EVENT_UPDATE_DH,
Hai Shalomfdcde762020-04-02 11:19:20 -07005940
5941 /**
5942 * EVENT_UNPROT_BEACON - Unprotected Beacon frame received
5943 *
5944 * This event should be called when a Beacon frame is dropped due to it
5945 * not being protected correctly. union wpa_event_data::unprot_beacon
5946 * is required to provide more details of the frame.
5947 */
5948 EVENT_UNPROT_BEACON,
Hai Shalomc1a21442022-02-04 13:43:00 -08005949
5950 /**
5951 * EVENT_TX_WAIT_EXPIRE - TX wait timed out
5952 *
5953 * This event is used to indicate when the driver has completed
5954 * wait for a response frame based on a TX request that specified a
5955 * non-zero wait time and that has not been explicitly cancelled.
5956 */
5957 EVENT_TX_WAIT_EXPIRE,
Sunil Ravia04bd252022-05-02 22:54:18 -07005958
5959 /**
5960 * EVENT_BSS_COLOR_COLLISION - Notification of a BSS color collision
5961 */
5962 EVENT_BSS_COLOR_COLLISION,
5963
5964 /**
5965 * EVENT_CCA_STARTED_NOTIFY - Notification that CCA has started
5966 */
5967 EVENT_CCA_STARTED_NOTIFY,
5968
5969 /**
5970 * EVENT_CCA_ABORTED_NOTIFY - Notification that CCA has aborted
5971 */
5972 EVENT_CCA_ABORTED_NOTIFY,
5973
5974 /**
5975 * EVENT_CCA_NOTIFY - Notification that CCA has completed
5976 */
5977 EVENT_CCA_NOTIFY,
Sunil Ravi89eba102022-09-13 21:04:37 -07005978
5979 /**
5980 * EVENT_PASN_AUTH - This event is used by the driver that requests
5981 * PASN authentication and secure ranging context for multiple peers.
5982 */
5983 EVENT_PASN_AUTH,
5984
5985 /**
5986 * EVENT_LINK_CH_SWITCH - MLD AP link decided to switch channels
5987 *
5988 * Described in wpa_event_data.ch_switch.
5989 *
5990 */
5991 EVENT_LINK_CH_SWITCH,
5992
5993 /**
5994 * EVENT_LINK_CH_SWITCH_STARTED - MLD AP link started to switch channels
5995 *
5996 * This is a pre-switch event indicating the shortly following switch
5997 * of operating channels.
5998 *
5999 * Described in wpa_event_data.ch_switch.
6000 */
6001 EVENT_LINK_CH_SWITCH_STARTED,
Sunil Ravi640215c2023-06-28 23:08:09 +00006002
6003 /**
6004 * EVENT_TID_LINK_MAP - MLD event to set TID-to-link mapping
6005 *
6006 * This event is used by the driver to indicate the received TID-to-link
6007 * mapping response from the associated AP MLD.
6008 *
6009 * Described in wpa_event_data.t2l_map_info.
6010 */
6011 EVENT_TID_LINK_MAP,
6012
6013 /**
6014 * EVENT_LINK_RECONFIG - Notification that AP links removed
6015 */
6016 EVENT_LINK_RECONFIG,
Sunil Ravic0f5d412024-09-11 22:12:49 +00006017
6018 /**
6019 * EVENT_MLD_INTERFACE_FREED - Notification of AP MLD interface removal
6020 */
6021 EVENT_MLD_INTERFACE_FREED,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006022};
6023
6024
6025/**
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07006026 * struct freq_survey - Channel survey info
6027 *
6028 * @ifidx: Interface index in which this survey was observed
6029 * @freq: Center of frequency of the surveyed channel
6030 * @nf: Channel noise floor in dBm
6031 * @channel_time: Amount of time in ms the radio spent on the channel
6032 * @channel_time_busy: Amount of time in ms the radio detected some signal
6033 * that indicated to the radio the channel was not clear
6034 * @channel_time_rx: Amount of time the radio spent receiving data
6035 * @channel_time_tx: Amount of time the radio spent transmitting data
6036 * @filled: bitmask indicating which fields have been reported, see
6037 * SURVEY_HAS_* defines.
6038 * @list: Internal list pointers
6039 */
6040struct freq_survey {
6041 u32 ifidx;
6042 unsigned int freq;
6043 s8 nf;
6044 u64 channel_time;
6045 u64 channel_time_busy;
6046 u64 channel_time_rx;
6047 u64 channel_time_tx;
6048 unsigned int filled;
6049 struct dl_list list;
6050};
6051
6052#define SURVEY_HAS_NF BIT(0)
6053#define SURVEY_HAS_CHAN_TIME BIT(1)
6054#define SURVEY_HAS_CHAN_TIME_BUSY BIT(2)
6055#define SURVEY_HAS_CHAN_TIME_RX BIT(3)
6056#define SURVEY_HAS_CHAN_TIME_TX BIT(4)
6057
Hai Shalom60840252021-02-19 19:02:11 -08006058/**
6059 * enum sta_connect_fail_reason_codes - STA connect failure reason code values
6060 * @STA_CONNECT_FAIL_REASON_UNSPECIFIED: No reason code specified for
6061 * connection failure.
6062 * @STA_CONNECT_FAIL_REASON_NO_BSS_FOUND: No Probe Response frame received
6063 * for unicast Probe Request frame.
6064 * @STA_CONNECT_FAIL_REASON_AUTH_TX_FAIL: STA failed to send auth request.
6065 * @STA_CONNECT_FAIL_REASON_AUTH_NO_ACK_RECEIVED: AP didn't send ACK for
6066 * auth request.
6067 * @STA_CONNECT_FAIL_REASON_AUTH_NO_RESP_RECEIVED: Auth response is not
6068 * received from AP.
6069 * @STA_CONNECT_FAIL_REASON_ASSOC_REQ_TX_FAIL: STA failed to send
6070 * Association Request frame.
6071 * @STA_CONNECT_FAIL_REASON_ASSOC_NO_ACK_RECEIVED: AP didn't send ACK for
6072 * Association Request frame.
6073 * @STA_CONNECT_FAIL_REASON_ASSOC_NO_RESP_RECEIVED: Association Response
6074 * frame is not received from AP.
6075 */
6076enum sta_connect_fail_reason_codes {
6077 STA_CONNECT_FAIL_REASON_UNSPECIFIED = 0,
6078 STA_CONNECT_FAIL_REASON_NO_BSS_FOUND = 1,
6079 STA_CONNECT_FAIL_REASON_AUTH_TX_FAIL = 2,
6080 STA_CONNECT_FAIL_REASON_AUTH_NO_ACK_RECEIVED = 3,
6081 STA_CONNECT_FAIL_REASON_AUTH_NO_RESP_RECEIVED = 4,
6082 STA_CONNECT_FAIL_REASON_ASSOC_REQ_TX_FAIL = 5,
6083 STA_CONNECT_FAIL_REASON_ASSOC_NO_ACK_RECEIVED = 6,
6084 STA_CONNECT_FAIL_REASON_ASSOC_NO_RESP_RECEIVED = 7,
6085};
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07006086
6087/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006088 * union wpa_event_data - Additional data for wpa_supplicant_event() calls
6089 */
6090union wpa_event_data {
6091 /**
6092 * struct assoc_info - Data for EVENT_ASSOC and EVENT_ASSOCINFO events
6093 *
6094 * This structure is optional for EVENT_ASSOC calls and required for
6095 * EVENT_ASSOCINFO calls. By using EVENT_ASSOC with this data, the
6096 * driver interface does not need to generate separate EVENT_ASSOCINFO
6097 * calls.
6098 */
6099 struct assoc_info {
6100 /**
6101 * reassoc - Flag to indicate association or reassociation
6102 */
6103 int reassoc;
6104
6105 /**
6106 * req_ies - (Re)Association Request IEs
6107 *
6108 * If the driver generates WPA/RSN IE, this event data must be
6109 * returned for WPA handshake to have needed information. If
6110 * wpa_supplicant-generated WPA/RSN IE is used, this
6111 * information event is optional.
6112 *
6113 * This should start with the first IE (fixed fields before IEs
6114 * are not included).
6115 */
6116 const u8 *req_ies;
6117
6118 /**
6119 * req_ies_len - Length of req_ies in bytes
6120 */
6121 size_t req_ies_len;
6122
6123 /**
6124 * resp_ies - (Re)Association Response IEs
6125 *
6126 * Optional association data from the driver. This data is not
6127 * required WPA, but may be useful for some protocols and as
6128 * such, should be reported if this is available to the driver
6129 * interface.
6130 *
6131 * This should start with the first IE (fixed fields before IEs
6132 * are not included).
6133 */
6134 const u8 *resp_ies;
6135
6136 /**
6137 * resp_ies_len - Length of resp_ies in bytes
6138 */
6139 size_t resp_ies_len;
6140
6141 /**
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08006142 * resp_frame - (Re)Association Response frame
6143 */
6144 const u8 *resp_frame;
6145
6146 /**
6147 * resp_frame_len - (Re)Association Response frame length
6148 */
6149 size_t resp_frame_len;
6150
6151 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006152 * beacon_ies - Beacon or Probe Response IEs
6153 *
6154 * Optional Beacon/ProbeResp data: IEs included in Beacon or
6155 * Probe Response frames from the current AP (i.e., the one
6156 * that the client just associated with). This information is
6157 * used to update WPA/RSN IE for the AP. If this field is not
6158 * set, the results from previous scan will be used. If no
6159 * data for the new AP is found, scan results will be requested
6160 * again (without scan request). At this point, the driver is
6161 * expected to provide WPA/RSN IE for the AP (if WPA/WPA2 is
6162 * used).
6163 *
6164 * This should start with the first IE (fixed fields before IEs
6165 * are not included).
6166 */
6167 const u8 *beacon_ies;
6168
6169 /**
6170 * beacon_ies_len - Length of beacon_ies */
6171 size_t beacon_ies_len;
6172
6173 /**
6174 * freq - Frequency of the operational channel in MHz
6175 */
6176 unsigned int freq;
6177
6178 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006179 * wmm_params - WMM parameters used in this association.
6180 */
6181 struct wmm_params wmm_params;
6182
6183 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006184 * addr - Station address (for AP mode)
6185 */
6186 const u8 *addr;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006187
6188 /**
6189 * The following is the key management offload information
6190 * @authorized
6191 * @key_replay_ctr
6192 * @key_replay_ctr_len
6193 * @ptk_kck
6194 * @ptk_kek_len
6195 * @ptk_kek
6196 * @ptk_kek_len
6197 */
6198
6199 /**
6200 * authorized - Status of key management offload,
6201 * 1 = successful
6202 */
6203 int authorized;
6204
6205 /**
6206 * key_replay_ctr - Key replay counter value last used
6207 * in a valid EAPOL-Key frame
6208 */
6209 const u8 *key_replay_ctr;
6210
6211 /**
6212 * key_replay_ctr_len - The length of key_replay_ctr
6213 */
6214 size_t key_replay_ctr_len;
6215
6216 /**
6217 * ptk_kck - The derived PTK KCK
6218 */
6219 const u8 *ptk_kck;
6220
6221 /**
6222 * ptk_kek_len - The length of ptk_kck
6223 */
6224 size_t ptk_kck_len;
6225
6226 /**
6227 * ptk_kek - The derived PTK KEK
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07006228 * This is used in key management offload and also in FILS SK
6229 * offload.
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006230 */
6231 const u8 *ptk_kek;
6232
6233 /**
6234 * ptk_kek_len - The length of ptk_kek
6235 */
6236 size_t ptk_kek_len;
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08006237
6238 /**
6239 * subnet_status - The subnet status:
6240 * 0 = unknown, 1 = unchanged, 2 = changed
6241 */
6242 u8 subnet_status;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07006243
6244 /**
6245 * The following information is used in FILS SK offload
6246 * @fils_erp_next_seq_num
6247 * @fils_pmk
6248 * @fils_pmk_len
6249 * @fils_pmkid
6250 */
6251
6252 /**
6253 * fils_erp_next_seq_num - The next sequence number to use in
6254 * FILS ERP messages
6255 */
6256 u16 fils_erp_next_seq_num;
6257
6258 /**
6259 * fils_pmk - A new PMK if generated in case of FILS
6260 * authentication
6261 */
6262 const u8 *fils_pmk;
6263
6264 /**
6265 * fils_pmk_len - Length of fils_pmk
6266 */
6267 size_t fils_pmk_len;
6268
6269 /**
6270 * fils_pmkid - PMKID used or generated in FILS authentication
6271 */
6272 const u8 *fils_pmkid;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006273
6274 /**
6275 * link_addr - Link address of the STA
6276 */
6277 const u8 *link_addr;
6278
6279 /**
6280 * assoc_link_id - Association link id of the MLO association or
6281 * -1 if MLO is not used
6282 */
6283 int assoc_link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006284 } assoc_info;
6285
6286 /**
6287 * struct disassoc_info - Data for EVENT_DISASSOC events
6288 */
6289 struct disassoc_info {
6290 /**
6291 * addr - Station address (for AP mode)
6292 */
6293 const u8 *addr;
6294
6295 /**
6296 * reason_code - Reason Code (host byte order) used in
6297 * Deauthentication frame
6298 */
6299 u16 reason_code;
6300
6301 /**
6302 * ie - Optional IE(s) in Disassociation frame
6303 */
6304 const u8 *ie;
6305
6306 /**
6307 * ie_len - Length of ie buffer in octets
6308 */
6309 size_t ie_len;
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08006310
6311 /**
6312 * locally_generated - Whether the frame was locally generated
6313 */
6314 int locally_generated;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006315 } disassoc_info;
6316
6317 /**
6318 * struct deauth_info - Data for EVENT_DEAUTH events
6319 */
6320 struct deauth_info {
6321 /**
6322 * addr - Station address (for AP mode)
6323 */
6324 const u8 *addr;
6325
6326 /**
6327 * reason_code - Reason Code (host byte order) used in
6328 * Deauthentication frame
6329 */
6330 u16 reason_code;
6331
6332 /**
6333 * ie - Optional IE(s) in Deauthentication frame
6334 */
6335 const u8 *ie;
6336
6337 /**
6338 * ie_len - Length of ie buffer in octets
6339 */
6340 size_t ie_len;
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08006341
6342 /**
6343 * locally_generated - Whether the frame was locally generated
6344 */
6345 int locally_generated;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006346 } deauth_info;
6347
6348 /**
6349 * struct michael_mic_failure - Data for EVENT_MICHAEL_MIC_FAILURE
6350 */
6351 struct michael_mic_failure {
6352 int unicast;
6353 const u8 *src;
6354 } michael_mic_failure;
6355
6356 /**
6357 * struct interface_status - Data for EVENT_INTERFACE_STATUS
6358 */
6359 struct interface_status {
Dmitry Shmidte4663042016-04-04 10:07:49 -07006360 unsigned int ifindex;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006361 char ifname[100];
6362 enum {
6363 EVENT_INTERFACE_ADDED, EVENT_INTERFACE_REMOVED
6364 } ievent;
6365 } interface_status;
6366
6367 /**
6368 * struct pmkid_candidate - Data for EVENT_PMKID_CANDIDATE
6369 */
6370 struct pmkid_candidate {
6371 /** BSSID of the PMKID candidate */
6372 u8 bssid[ETH_ALEN];
6373 /** Smaller the index, higher the priority */
6374 int index;
6375 /** Whether RSN IE includes pre-authenticate flag */
6376 int preauth;
6377 } pmkid_candidate;
6378
6379 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006380 * struct tdls - Data for EVENT_TDLS
6381 */
6382 struct tdls {
6383 u8 peer[ETH_ALEN];
6384 enum {
6385 TDLS_REQUEST_SETUP,
Dmitry Shmidt4dd28dc2015-03-10 11:21:43 -07006386 TDLS_REQUEST_TEARDOWN,
6387 TDLS_REQUEST_DISCOVER,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006388 } oper;
6389 u16 reason_code; /* for teardown */
6390 } tdls;
6391
6392 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07006393 * struct wnm - Data for EVENT_WNM
6394 */
6395 struct wnm {
6396 u8 addr[ETH_ALEN];
6397 enum {
6398 WNM_OPER_SLEEP,
6399 } oper;
6400 enum {
6401 WNM_SLEEP_ENTER,
6402 WNM_SLEEP_EXIT
6403 } sleep_action;
6404 int sleep_intval;
6405 u16 reason_code;
6406 u8 *buf;
6407 u16 buf_len;
6408 } wnm;
6409
6410 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006411 * struct ft_ies - FT information elements (EVENT_FT_RESPONSE)
6412 *
6413 * During FT (IEEE 802.11r) authentication sequence, the driver is
6414 * expected to use this event to report received FT IEs (MDIE, FTIE,
6415 * RSN IE, TIE, possible resource request) to the supplicant. The FT
6416 * IEs for the next message will be delivered through the
6417 * struct wpa_driver_ops::update_ft_ies() callback.
6418 */
6419 struct ft_ies {
6420 const u8 *ies;
6421 size_t ies_len;
6422 int ft_action;
6423 u8 target_ap[ETH_ALEN];
6424 /** Optional IE(s), e.g., WMM TSPEC(s), for RIC-Request */
6425 const u8 *ric_ies;
6426 /** Length of ric_ies buffer in octets */
6427 size_t ric_ies_len;
6428 } ft_ies;
6429
6430 /**
6431 * struct ibss_rsn_start - Data for EVENT_IBSS_RSN_START
6432 */
6433 struct ibss_rsn_start {
6434 u8 peer[ETH_ALEN];
6435 } ibss_rsn_start;
6436
6437 /**
6438 * struct auth_info - Data for EVENT_AUTH events
6439 */
6440 struct auth_info {
6441 u8 peer[ETH_ALEN];
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006442 u8 bssid[ETH_ALEN];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006443 u16 auth_type;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006444 u16 auth_transaction;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006445 u16 status_code;
6446 const u8 *ies;
6447 size_t ies_len;
6448 } auth;
6449
6450 /**
6451 * struct assoc_reject - Data for EVENT_ASSOC_REJECT events
6452 */
6453 struct assoc_reject {
6454 /**
6455 * bssid - BSSID of the AP that rejected association
6456 */
6457 const u8 *bssid;
6458
6459 /**
6460 * resp_ies - (Re)Association Response IEs
6461 *
6462 * Optional association data from the driver. This data is not
6463 * required WPA, but may be useful for some protocols and as
6464 * such, should be reported if this is available to the driver
6465 * interface.
6466 *
6467 * This should start with the first IE (fixed fields before IEs
6468 * are not included).
6469 */
6470 const u8 *resp_ies;
6471
6472 /**
6473 * resp_ies_len - Length of resp_ies in bytes
6474 */
6475 size_t resp_ies_len;
6476
6477 /**
6478 * status_code - Status Code from (Re)association Response
6479 */
6480 u16 status_code;
Dmitry Shmidtd5ab1b52016-06-21 12:38:41 -07006481
6482 /**
6483 * timed_out - Whether failure is due to timeout (etc.) rather
6484 * than explicit rejection response from the AP.
6485 */
6486 int timed_out;
Dmitry Shmidtebd93af2017-02-21 13:40:44 -08006487
6488 /**
6489 * timeout_reason - Reason for the timeout
6490 */
6491 const char *timeout_reason;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07006492
6493 /**
6494 * fils_erp_next_seq_num - The next sequence number to use in
6495 * FILS ERP messages
6496 */
6497 u16 fils_erp_next_seq_num;
Hai Shalom60840252021-02-19 19:02:11 -08006498
6499 /**
6500 * reason_code - Connection failure reason code from the driver
6501 */
6502 enum sta_connect_fail_reason_codes reason_code;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006503 } assoc_reject;
6504
6505 struct timeout_event {
6506 u8 addr[ETH_ALEN];
6507 } timeout_event;
6508
6509 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006510 * struct tx_status - Data for EVENT_TX_STATUS events
6511 */
6512 struct tx_status {
6513 u16 type;
6514 u16 stype;
6515 const u8 *dst;
6516 const u8 *data;
6517 size_t data_len;
6518 int ack;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006519 int link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006520 } tx_status;
6521
6522 /**
6523 * struct rx_from_unknown - Data for EVENT_RX_FROM_UNKNOWN events
6524 */
6525 struct rx_from_unknown {
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006526 const u8 *bssid;
6527 const u8 *addr;
6528 int wds;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006529 } rx_from_unknown;
6530
6531 /**
6532 * struct rx_mgmt - Data for EVENT_RX_MGMT events
6533 */
6534 struct rx_mgmt {
6535 const u8 *frame;
6536 size_t frame_len;
6537 u32 datarate;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006538
6539 /**
Dmitry Shmidt98660862014-03-11 17:26:21 -07006540 * drv_priv - Pointer to store driver private BSS information
6541 *
6542 * If not set to NULL, this is used for comparison with
6543 * hostapd_data->drv_priv to determine which BSS should process
6544 * the frame.
6545 */
6546 void *drv_priv;
6547
6548 /**
Sunil Ravi7f769292024-07-23 22:21:32 +00006549 * ctx - Pointer to store ctx of private BSS information
6550 *
6551 * If not set to NULL, this is used for forwarding the packet
6552 * to right link BSS of ML BSS.
6553 */
6554 void *ctx;
6555
6556 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006557 * freq - Frequency (in MHz) on which the frame was received
6558 */
6559 int freq;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08006560
6561 /**
6562 * ssi_signal - Signal strength in dBm (or 0 if not available)
6563 */
6564 int ssi_signal;
Sunil Ravi036cec52023-03-29 11:35:17 -07006565
6566 /**
6567 * link_id - MLO link on which the frame was received or -1 for
6568 * non MLD.
6569 */
6570 int link_id;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08006571 } rx_mgmt;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006572
6573 /**
6574 * struct remain_on_channel - Data for EVENT_REMAIN_ON_CHANNEL events
6575 *
6576 * This is also used with EVENT_CANCEL_REMAIN_ON_CHANNEL events.
6577 */
6578 struct remain_on_channel {
6579 /**
6580 * freq - Channel frequency in MHz
6581 */
6582 unsigned int freq;
6583
6584 /**
6585 * duration - Duration to remain on the channel in milliseconds
6586 */
6587 unsigned int duration;
6588 } remain_on_channel;
6589
6590 /**
6591 * struct scan_info - Optional data for EVENT_SCAN_RESULTS events
6592 * @aborted: Whether the scan was aborted
6593 * @freqs: Scanned frequencies in MHz (%NULL = all channels scanned)
6594 * @num_freqs: Number of entries in freqs array
6595 * @ssids: Scanned SSIDs (%NULL or zero-length SSID indicates wildcard
6596 * SSID)
6597 * @num_ssids: Number of entries in ssids array
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08006598 * @external_scan: Whether the scan info is for an external scan
6599 * @nl_scan_event: 1 if the source of this scan event is a normal scan,
6600 * 0 if the source of the scan event is a vendor scan
Dmitry Shmidt29333592017-01-09 12:27:11 -08006601 * @scan_start_tsf: Time when the scan started in terms of TSF of the
6602 * BSS that the interface that requested the scan is connected to
6603 * (if available).
6604 * @scan_start_tsf_bssid: The BSSID according to which %scan_start_tsf
6605 * is set.
Sunil Ravi99c035e2024-07-12 01:42:03 +00006606 * @scan_cookie: Unique identification representing the corresponding
6607 * scan request. 0 if no unique identification is available.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006608 */
6609 struct scan_info {
6610 int aborted;
6611 const int *freqs;
6612 size_t num_freqs;
6613 struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS];
6614 size_t num_ssids;
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08006615 int external_scan;
6616 int nl_scan_event;
Dmitry Shmidt29333592017-01-09 12:27:11 -08006617 u64 scan_start_tsf;
6618 u8 scan_start_tsf_bssid[ETH_ALEN];
Sunil Ravi99c035e2024-07-12 01:42:03 +00006619 u64 scan_cookie;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006620 } scan_info;
6621
6622 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006623 * struct rx_probe_req - Data for EVENT_RX_PROBE_REQ events
6624 */
6625 struct rx_probe_req {
6626 /**
6627 * sa - Source address of the received Probe Request frame
6628 */
6629 const u8 *sa;
6630
6631 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006632 * da - Destination address of the received Probe Request frame
6633 * or %NULL if not available
6634 */
6635 const u8 *da;
6636
6637 /**
6638 * bssid - BSSID of the received Probe Request frame or %NULL
6639 * if not available
6640 */
6641 const u8 *bssid;
6642
6643 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006644 * ie - IEs from the Probe Request body
6645 */
6646 const u8 *ie;
6647
6648 /**
6649 * ie_len - Length of ie buffer in octets
6650 */
6651 size_t ie_len;
Dmitry Shmidt04949592012-07-19 12:16:46 -07006652
6653 /**
6654 * signal - signal strength in dBm (or 0 if not available)
6655 */
6656 int ssi_signal;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006657 } rx_probe_req;
6658
6659 /**
6660 * struct new_sta - Data for EVENT_NEW_STA events
6661 */
6662 struct new_sta {
6663 const u8 *addr;
6664 } new_sta;
6665
6666 /**
6667 * struct eapol_rx - Data for EVENT_EAPOL_RX events
6668 */
6669 struct eapol_rx {
6670 const u8 *src;
6671 const u8 *data;
6672 size_t data_len;
Sunil8cd6f4d2022-06-28 18:40:46 +00006673 enum frame_encryption encrypted;
Sunil Ravi036cec52023-03-29 11:35:17 -07006674 int link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006675 } eapol_rx;
6676
6677 /**
6678 * signal_change - Data for EVENT_SIGNAL_CHANGE events
6679 */
6680 struct wpa_signal_info signal_change;
6681
6682 /**
6683 * struct best_channel - Data for EVENT_BEST_CHANNEL events
6684 * @freq_24: Best 2.4 GHz band channel frequency in MHz
6685 * @freq_5: Best 5 GHz band channel frequency in MHz
6686 * @freq_overall: Best channel frequency in MHz
6687 *
6688 * 0 can be used to indicate no preference in either band.
6689 */
6690 struct best_channel {
6691 int freq_24;
6692 int freq_5;
6693 int freq_overall;
6694 } best_chan;
6695
6696 struct unprot_deauth {
6697 const u8 *sa;
6698 const u8 *da;
6699 u16 reason_code;
6700 } unprot_deauth;
6701
6702 struct unprot_disassoc {
6703 const u8 *sa;
6704 const u8 *da;
6705 u16 reason_code;
6706 } unprot_disassoc;
6707
6708 /**
6709 * struct low_ack - Data for EVENT_STATION_LOW_ACK events
6710 * @addr: station address
Paul Stewart092955c2017-02-06 09:13:09 -08006711 * @num_packets: Number of packets lost (consecutive packets not
6712 * acknowledged)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006713 */
6714 struct low_ack {
6715 u8 addr[ETH_ALEN];
Paul Stewart092955c2017-02-06 09:13:09 -08006716 u32 num_packets;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006717 } low_ack;
6718
6719 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006720 * struct ibss_peer_lost - Data for EVENT_IBSS_PEER_LOST
6721 */
6722 struct ibss_peer_lost {
6723 u8 peer[ETH_ALEN];
6724 } ibss_peer_lost;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006725
6726 /**
6727 * struct driver_gtk_rekey - Data for EVENT_DRIVER_GTK_REKEY
6728 */
6729 struct driver_gtk_rekey {
6730 const u8 *bssid;
6731 const u8 *replay_ctr;
6732 } driver_gtk_rekey;
6733
6734 /**
6735 * struct client_poll - Data for EVENT_DRIVER_CLIENT_POLL_OK events
6736 * @addr: station address
6737 */
6738 struct client_poll {
6739 u8 addr[ETH_ALEN];
6740 } client_poll;
6741
6742 /**
6743 * struct eapol_tx_status
6744 * @dst: Original destination
6745 * @data: Data starting with IEEE 802.1X header (!)
6746 * @data_len: Length of data
6747 * @ack: Indicates ack or lost frame
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006748 * @link_id: MLD link id used to transmit the frame or -1 for non MLO
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006749 *
6750 * This corresponds to hapd_send_eapol if the frame sent
6751 * there isn't just reported as EVENT_TX_STATUS.
6752 */
6753 struct eapol_tx_status {
6754 const u8 *dst;
6755 const u8 *data;
6756 int data_len;
6757 int ack;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006758 int link_id;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006759 } eapol_tx_status;
Dmitry Shmidt04949592012-07-19 12:16:46 -07006760
6761 /**
6762 * struct ch_switch
6763 * @freq: Frequency of new channel in MHz
6764 * @ht_enabled: Whether this is an HT channel
6765 * @ch_offset: Secondary channel offset
Dmitry Shmidt04f534e2013-12-09 15:50:16 -08006766 * @ch_width: Channel width
6767 * @cf1: Center frequency 1
6768 * @cf2: Center frequency 2
Sunil Ravi89eba102022-09-13 21:04:37 -07006769 * @link_id: Link ID of the MLO link
Sunil Ravi036cec52023-03-29 11:35:17 -07006770 * @punct_bitmap: Puncturing bitmap
Dmitry Shmidt04949592012-07-19 12:16:46 -07006771 */
6772 struct ch_switch {
6773 int freq;
6774 int ht_enabled;
6775 int ch_offset;
Dmitry Shmidt04f534e2013-12-09 15:50:16 -08006776 enum chan_width ch_width;
6777 int cf1;
6778 int cf2;
Sunil Ravi89eba102022-09-13 21:04:37 -07006779 int link_id;
Sunil Ravi036cec52023-03-29 11:35:17 -07006780 u16 punct_bitmap;
Dmitry Shmidt04949592012-07-19 12:16:46 -07006781 } ch_switch;
Dmitry Shmidtf8623282013-02-20 14:34:59 -08006782
6783 /**
6784 * struct connect_failed - Data for EVENT_CONNECT_FAILED_REASON
6785 * @addr: Remote client address
6786 * @code: Reason code for connection failure
6787 */
6788 struct connect_failed_reason {
6789 u8 addr[ETH_ALEN];
6790 enum {
6791 MAX_CLIENT_REACHED,
6792 BLOCKED_CLIENT
6793 } code;
6794 } connect_failed_reason;
Dmitry Shmidtea69e842013-05-13 14:52:28 -07006795
6796 /**
6797 * struct dfs_event - Data for radar detected events
6798 * @freq: Frequency of the channel in MHz
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006799 * @link_id: If >= 0, Link ID of the MLO link
Dmitry Shmidtea69e842013-05-13 14:52:28 -07006800 */
6801 struct dfs_event {
6802 int freq;
Dmitry Shmidt051af732013-10-22 13:52:46 -07006803 int ht_enabled;
6804 int chan_offset;
6805 enum chan_width chan_width;
6806 int cf1;
6807 int cf2;
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006808 int link_id;
Dmitry Shmidtea69e842013-05-13 14:52:28 -07006809 } dfs_event;
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07006810
6811 /**
6812 * survey_results - Survey result data for EVENT_SURVEY
6813 * @freq_filter: Requested frequency survey filter, 0 if request
6814 * was for all survey data
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006815 * @survey_list: Linked list of survey data (struct freq_survey)
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07006816 */
6817 struct survey_results {
6818 unsigned int freq_filter;
6819 struct dl_list survey_list; /* struct freq_survey */
6820 } survey_results;
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08006821
6822 /**
6823 * channel_list_changed - Data for EVENT_CHANNEL_LIST_CHANGED
6824 * @initiator: Initiator of the regulatory change
Dmitry Shmidt7dba0e52014-04-14 10:49:15 -07006825 * @type: Regulatory change type
6826 * @alpha2: Country code (or "" if not available)
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006827 * @beacon_hint_before: Data for frequency attributes before beacon hint
6828 * event if initiator == REGDOM_BEACON_HINT
6829 * @beacon_hint_after: Data for frequency attributes after beacon hint
6830 * event if initiator == REGDOM_BEACON_HINT
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08006831 */
6832 struct channel_list_changed {
6833 enum reg_change_initiator initiator;
Dmitry Shmidt7dba0e52014-04-14 10:49:15 -07006834 enum reg_type type;
6835 char alpha2[3];
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006836 struct frequency_attrs {
6837 unsigned int freq;
6838 unsigned int max_tx_power;
6839 bool disabled;
6840 bool no_ir;
6841 bool radar;
6842 } beacon_hint_before, beacon_hint_after;
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08006843 } channel_list_changed;
Dmitry Shmidtcf32e602014-01-28 10:57:39 -08006844
6845 /**
6846 * freq_range - List of frequency ranges
6847 *
6848 * This is used as the data with EVENT_AVOID_FREQUENCIES.
6849 */
6850 struct wpa_freq_range_list freq_range;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006851
6852 /**
6853 * struct mesh_peer
6854 *
6855 * @peer: Peer address
6856 * @ies: Beacon IEs
6857 * @ie_len: Length of @ies
6858 *
6859 * Notification of new candidate mesh peer.
6860 */
6861 struct mesh_peer {
6862 const u8 *peer;
6863 const u8 *ies;
6864 size_t ie_len;
6865 } mesh_peer;
6866
6867 /**
6868 * struct acs_selected_channels - Data for EVENT_ACS_CHANNEL_SELECTED
Ahmed ElArabawy0ff61c52019-12-26 12:38:39 -08006869 * @pri_freq: Selected primary frequency
6870 * @sec_freq: Selected secondary frequency
Hai Shalomfdcde762020-04-02 11:19:20 -07006871 * @edmg_channel: Selected EDMG channel
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006872 * @vht_seg0_center_ch: VHT mode Segment0 center channel
Hai Shalomfdcde762020-04-02 11:19:20 -07006873 * The value is the index of the channel center frequency for
6874 * 20 MHz, 40 MHz, and 80 MHz channels. The value is the center
6875 * frequency index of the primary 80 MHz segment for 160 MHz and
6876 * 80+80 MHz channels.
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006877 * @vht_seg1_center_ch: VHT mode Segment1 center channel
Hai Shalomfdcde762020-04-02 11:19:20 -07006878 * The value is zero for 20 MHz, 40 MHz, and 80 MHz channels. The
6879 * value is the index of the channel center frequency for 160 MHz
6880 * channels and the center frequency index of the secondary 80 MHz
6881 * segment for 80+80 MHz channels.
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006882 * @ch_width: Selected Channel width by driver. Driver may choose to
6883 * change hostapd configured ACS channel width due driver internal
6884 * channel restrictions.
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006885 * @hw_mode: Selected band (used with hw_mode=any)
6886 * @puncture_bitmap: Indicate the puncturing channels
6887 * @link_id: Indicate the link id if operating as AP MLD; -1 otherwise
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006888 */
6889 struct acs_selected_channels {
Ahmed ElArabawy0ff61c52019-12-26 12:38:39 -08006890 unsigned int pri_freq;
6891 unsigned int sec_freq;
Hai Shalomfdcde762020-04-02 11:19:20 -07006892 u8 edmg_channel;
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006893 u8 vht_seg0_center_ch;
6894 u8 vht_seg1_center_ch;
6895 u16 ch_width;
Dmitry Shmidtb1e52102015-05-29 12:36:29 -07006896 enum hostapd_hw_mode hw_mode;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006897 u16 puncture_bitmap;
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006898 int link_id;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006899 } acs_selected_channels;
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07006900
6901 /**
6902 * struct p2p_lo_stop - Reason code for P2P Listen offload stop event
6903 * @reason_code: Reason for stopping offload
6904 * P2P_LO_STOPPED_REASON_COMPLETE: Listen offload finished as
6905 * scheduled.
6906 * P2P_LO_STOPPED_REASON_RECV_STOP_CMD: Host requested offload to
6907 * be stopped.
6908 * P2P_LO_STOPPED_REASON_INVALID_PARAM: Invalid listen offload
6909 * parameters.
6910 * P2P_LO_STOPPED_REASON_NOT_SUPPORTED: Listen offload not
6911 * supported by device.
6912 */
6913 struct p2p_lo_stop {
6914 enum {
6915 P2P_LO_STOPPED_REASON_COMPLETE = 0,
6916 P2P_LO_STOPPED_REASON_RECV_STOP_CMD,
6917 P2P_LO_STOPPED_REASON_INVALID_PARAM,
6918 P2P_LO_STOPPED_REASON_NOT_SUPPORTED,
6919 } reason_code;
6920 } p2p_lo_stop;
Roshan Pius3a1667e2018-07-03 15:17:14 -07006921
6922 /* For EVENT_EXTERNAL_AUTH */
6923 struct external_auth external_auth;
6924
6925 /**
6926 * struct sta_opmode - Station's operation mode change event
6927 * @addr: The station MAC address
6928 * @smps_mode: SMPS mode of the station
6929 * @chan_width: Channel width of the station
6930 * @rx_nss: RX_NSS of the station
6931 *
6932 * This is used as data with EVENT_STATION_OPMODE_CHANGED.
6933 */
6934 struct sta_opmode {
6935 const u8 *addr;
6936 enum smps_mode smps_mode;
6937 enum chan_width chan_width;
6938 u8 rx_nss;
6939 } sta_opmode;
6940
6941 /**
6942 * struct wds_sta_interface - Data for EVENT_WDS_STA_INTERFACE_STATUS.
6943 */
6944 struct wds_sta_interface {
6945 const u8 *sta_addr;
6946 const char *ifname;
6947 enum {
6948 INTERFACE_ADDED,
6949 INTERFACE_REMOVED
6950 } istatus;
6951 } wds_sta_interface;
Hai Shalom81f62d82019-07-22 12:10:00 -07006952
6953 /**
6954 * struct update_dh - Data for EVENT_UPDATE_DH
6955 */
6956 struct update_dh {
6957 const u8 *peer;
6958 const u8 *ie;
6959 size_t ie_len;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006960 int assoc_link_id;
6961 const u8 *link_addr;
Hai Shalom81f62d82019-07-22 12:10:00 -07006962 } update_dh;
Hai Shalomfdcde762020-04-02 11:19:20 -07006963
6964 /**
6965 * struct unprot_beacon - Data for EVENT_UNPROT_BEACON
6966 */
6967 struct unprot_beacon {
6968 const u8 *sa;
6969 } unprot_beacon;
Sunil Ravia04bd252022-05-02 22:54:18 -07006970
6971 /**
6972 * struct bss_color_collision - Data for EVENT_BSS_COLOR_COLLISION
6973 */
6974 struct bss_color_collision {
6975 u64 bitmap;
Sunil Ravi7f769292024-07-23 22:21:32 +00006976 int link_id;
Sunil Ravia04bd252022-05-02 22:54:18 -07006977 } bss_color_collision;
Sunil Ravi89eba102022-09-13 21:04:37 -07006978
6979 /**
6980 * struct pasn_auth - Data for EVENT_PASN_AUTH
6981 */
6982 struct pasn_auth pasn_auth;
6983
Sunil Ravi77d572f2023-01-17 23:58:31 +00006984 /**
6985 * struct port_authorized - Data for EVENT_PORT_AUTHORIZED
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006986 * @td_bitmap: For STA mode, transition disable bitmap, if received in
6987 * EAPOL-Key msg 3/4
6988 * @td_bitmap_len: For STA mode, length of td_bitmap
6989 * @sta_addr: For AP mode, the MAC address of the associated STA
6990 *
6991 * This event is used to indicate that the port is authorized and
6992 * open for normal data in STA and AP modes when 4-way handshake is
6993 * offloaded to the driver.
Sunil Ravi77d572f2023-01-17 23:58:31 +00006994 */
6995 struct port_authorized {
6996 const u8 *td_bitmap;
6997 size_t td_bitmap_len;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006998 const u8 *sta_addr;
Sunil Ravi77d572f2023-01-17 23:58:31 +00006999 } port_authorized;
Sunil Ravi640215c2023-06-28 23:08:09 +00007000
7001 /**
7002 * struct tid_link_map_info - Data for EVENT_TID_LINK_MAP
7003 */
7004 struct tid_link_map_info {
7005 bool default_map;
7006 u8 valid_links;
7007 struct t2lm_mapping t2lmap[MAX_NUM_MLD_LINKS];
7008 } t2l_map_info;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007009};
7010
7011/**
7012 * wpa_supplicant_event - Report a driver event for wpa_supplicant
7013 * @ctx: Context pointer (wpa_s); this is the ctx variable registered
7014 * with struct wpa_driver_ops::init()
7015 * @event: event type (defined above)
7016 * @data: possible extra data for the event
7017 *
7018 * Driver wrapper code should call this function whenever an event is received
7019 * from the driver.
7020 */
7021void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
7022 union wpa_event_data *data);
7023
Dmitry Shmidte4663042016-04-04 10:07:49 -07007024/**
7025 * wpa_supplicant_event_global - Report a driver event for wpa_supplicant
7026 * @ctx: Context pointer (wpa_s); this is the ctx variable registered
7027 * with struct wpa_driver_ops::init()
7028 * @event: event type (defined above)
7029 * @data: possible extra data for the event
7030 *
7031 * Same as wpa_supplicant_event(), but we search for the interface in
7032 * wpa_global.
7033 */
7034void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
7035 union wpa_event_data *data);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007036
7037/*
7038 * The following inline functions are provided for convenience to simplify
7039 * event indication for some of the common events.
7040 */
7041
Sunil Ravi2a14cf12023-11-21 00:54:38 +00007042static inline void drv_event_assoc(void *ctx, const u8 *addr, const u8 *req_ies,
7043 size_t req_ielen, const u8 *resp_ies,
7044 size_t resp_ielen, const u8 *link_addr,
7045 int assoc_link_id, int reassoc)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007046{
7047 union wpa_event_data event;
7048 os_memset(&event, 0, sizeof(event));
7049 event.assoc_info.reassoc = reassoc;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00007050 event.assoc_info.req_ies = req_ies;
7051 event.assoc_info.req_ies_len = req_ielen;
7052 event.assoc_info.resp_ies = resp_ies;
7053 event.assoc_info.resp_ies_len = resp_ielen;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007054 event.assoc_info.addr = addr;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00007055 event.assoc_info.link_addr = link_addr;
7056 event.assoc_info.assoc_link_id = assoc_link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007057 wpa_supplicant_event(ctx, EVENT_ASSOC, &event);
7058}
7059
7060static inline void drv_event_disassoc(void *ctx, const u8 *addr)
7061{
7062 union wpa_event_data event;
7063 os_memset(&event, 0, sizeof(event));
7064 event.disassoc_info.addr = addr;
7065 wpa_supplicant_event(ctx, EVENT_DISASSOC, &event);
7066}
7067
7068static inline void drv_event_eapol_rx(void *ctx, const u8 *src, const u8 *data,
7069 size_t data_len)
7070{
7071 union wpa_event_data event;
7072 os_memset(&event, 0, sizeof(event));
7073 event.eapol_rx.src = src;
7074 event.eapol_rx.data = data;
7075 event.eapol_rx.data_len = data_len;
Sunil8cd6f4d2022-06-28 18:40:46 +00007076 event.eapol_rx.encrypted = FRAME_ENCRYPTION_UNKNOWN;
Sunil Ravi036cec52023-03-29 11:35:17 -07007077 event.eapol_rx.link_id = -1;
Sunil8cd6f4d2022-06-28 18:40:46 +00007078 wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event);
7079}
7080
7081static inline void drv_event_eapol_rx2(void *ctx, const u8 *src, const u8 *data,
Sunil Ravi036cec52023-03-29 11:35:17 -07007082 size_t data_len,
7083 enum frame_encryption encrypted,
7084 int link_id)
Sunil8cd6f4d2022-06-28 18:40:46 +00007085{
7086 union wpa_event_data event;
7087 os_memset(&event, 0, sizeof(event));
7088 event.eapol_rx.src = src;
7089 event.eapol_rx.data = data;
7090 event.eapol_rx.data_len = data_len;
7091 event.eapol_rx.encrypted = encrypted;
Sunil Ravi036cec52023-03-29 11:35:17 -07007092 event.eapol_rx.link_id = link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007093 wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event);
7094}
7095
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08007096/* driver_common.c */
7097void wpa_scan_results_free(struct wpa_scan_results *res);
7098
7099/* Convert wpa_event_type to a string for logging */
7100const char * event_to_string(enum wpa_event_type event);
7101
Dmitry Shmidt661b4f72014-09-29 14:58:27 -07007102/* Convert chan_width to a string for logging and control interfaces */
7103const char * channel_width_to_string(enum chan_width width);
7104
Hai Shalom74f70d42019-02-11 14:42:39 -08007105int channel_width_to_int(enum chan_width width);
7106
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08007107int ht_supported(const struct hostapd_hw_modes *mode);
7108int vht_supported(const struct hostapd_hw_modes *mode);
Sunil Ravi77d572f2023-01-17 23:58:31 +00007109bool he_supported(const struct hostapd_hw_modes *hw_mode,
7110 enum ieee80211_op_mode op_mode);
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08007111
7112struct wowlan_triggers *
7113wpa_get_wowlan_triggers(const char *wowlan_triggers,
7114 const struct wpa_driver_capa *capa);
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07007115/* Convert driver flag to string */
7116const char * driver_flag_to_string(u64 flag);
Hai Shalomb755a2a2020-04-23 21:49:02 -07007117const char * driver_flag2_to_string(u64 flag2);
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08007118
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08007119/* NULL terminated array of linked in driver wrappers */
Dmitry Shmidt1d755d02015-04-28 10:34:29 -07007120extern const struct wpa_driver_ops *const wpa_drivers[];
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08007121
Dmitry Shmidt4ae50e62016-06-27 13:48:39 -07007122
7123/* Available drivers */
7124
7125#ifdef CONFIG_DRIVER_WEXT
7126extern const struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */
7127#endif /* CONFIG_DRIVER_WEXT */
7128#ifdef CONFIG_DRIVER_NL80211
7129/* driver_nl80211.c */
7130extern const struct wpa_driver_ops wpa_driver_nl80211_ops;
7131#endif /* CONFIG_DRIVER_NL80211 */
7132#ifdef CONFIG_DRIVER_HOSTAP
7133extern const struct wpa_driver_ops wpa_driver_hostap_ops; /* driver_hostap.c */
7134#endif /* CONFIG_DRIVER_HOSTAP */
7135#ifdef CONFIG_DRIVER_BSD
7136extern const struct wpa_driver_ops wpa_driver_bsd_ops; /* driver_bsd.c */
7137#endif /* CONFIG_DRIVER_BSD */
7138#ifdef CONFIG_DRIVER_OPENBSD
7139/* driver_openbsd.c */
7140extern const struct wpa_driver_ops wpa_driver_openbsd_ops;
7141#endif /* CONFIG_DRIVER_OPENBSD */
7142#ifdef CONFIG_DRIVER_NDIS
7143extern struct wpa_driver_ops wpa_driver_ndis_ops; /* driver_ndis.c */
7144#endif /* CONFIG_DRIVER_NDIS */
7145#ifdef CONFIG_DRIVER_WIRED
7146extern const struct wpa_driver_ops wpa_driver_wired_ops; /* driver_wired.c */
7147#endif /* CONFIG_DRIVER_WIRED */
7148#ifdef CONFIG_DRIVER_MACSEC_QCA
7149/* driver_macsec_qca.c */
7150extern const struct wpa_driver_ops wpa_driver_macsec_qca_ops;
7151#endif /* CONFIG_DRIVER_MACSEC_QCA */
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08007152#ifdef CONFIG_DRIVER_MACSEC_LINUX
7153/* driver_macsec_linux.c */
7154extern const struct wpa_driver_ops wpa_driver_macsec_linux_ops;
7155#endif /* CONFIG_DRIVER_MACSEC_LINUX */
Dmitry Shmidt4ae50e62016-06-27 13:48:39 -07007156#ifdef CONFIG_DRIVER_ROBOSWITCH
7157/* driver_roboswitch.c */
7158extern const struct wpa_driver_ops wpa_driver_roboswitch_ops;
7159#endif /* CONFIG_DRIVER_ROBOSWITCH */
7160#ifdef CONFIG_DRIVER_ATHEROS
7161/* driver_atheros.c */
7162extern const struct wpa_driver_ops wpa_driver_atheros_ops;
7163#endif /* CONFIG_DRIVER_ATHEROS */
7164#ifdef CONFIG_DRIVER_NONE
7165extern const struct wpa_driver_ops wpa_driver_none_ops; /* driver_none.c */
7166#endif /* CONFIG_DRIVER_NONE */
7167
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007168#endif /* DRIVER_H */