blob: 8a7e673464ae9d98d3453e2ec08c5b5ab99a70a4 [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
Sunil Ravic0f5d412024-09-11 22:12:49 +00001407 /**
1408 * rsn_overriding - wpa_supplicant RSN overriding support
1409 */
1410 bool rsn_overriding;
Sunil Ravi876a49b2025-02-03 19:18:32 +00001411
1412 /**
1413 * spp_amsdu - SPP A-MSDU used on this connection
1414 */
1415 bool spp_amsdu;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001416};
1417
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001418enum hide_ssid {
1419 NO_SSID_HIDING,
1420 HIDDEN_SSID_ZERO_LEN,
1421 HIDDEN_SSID_ZERO_CONTENTS
1422};
1423
Hai Shalom81f62d82019-07-22 12:10:00 -07001424enum ch_switch_state {
1425 CH_SW_STARTED,
1426 CH_SW_FINISHED
1427};
1428
Dmitry Shmidtb58836e2014-04-29 14:35:56 -07001429struct wowlan_triggers {
1430 u8 any;
1431 u8 disconnect;
1432 u8 magic_pkt;
1433 u8 gtk_rekey_failure;
1434 u8 eap_identity_req;
1435 u8 four_way_handshake;
1436 u8 rfkill_release;
1437};
1438
Sunil Ravi7f769292024-07-23 22:21:32 +00001439struct unsol_bcast_probe_resp {
1440 /**
1441 * Unsolicited broadcast Probe Response interval in TUs
1442 */
1443 unsigned int unsol_bcast_probe_resp_interval;
1444
1445 /**
1446 * Unsolicited broadcast Probe Response template data
1447 */
1448 u8 *unsol_bcast_probe_resp_tmpl;
1449
1450 /**
1451 * Unsolicited broadcast Probe Response template length
1452 */
1453 size_t unsol_bcast_probe_resp_tmpl_len;
1454};
1455
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001456struct wpa_driver_ap_params {
1457 /**
1458 * head - Beacon head from IEEE 802.11 header to IEs before TIM IE
1459 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08001460 u8 *head;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001461
1462 /**
1463 * head_len - Length of the head buffer in octets
1464 */
1465 size_t head_len;
1466
1467 /**
1468 * tail - Beacon tail following TIM IE
1469 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08001470 u8 *tail;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001471
1472 /**
1473 * tail_len - Length of the tail buffer in octets
1474 */
1475 size_t tail_len;
1476
1477 /**
1478 * dtim_period - DTIM period
1479 */
1480 int dtim_period;
1481
1482 /**
1483 * beacon_int - Beacon interval
1484 */
1485 int beacon_int;
1486
1487 /**
1488 * basic_rates: -1 terminated array of basic rates in 100 kbps
1489 *
1490 * This parameter can be used to set a specific basic rate set for the
1491 * BSS. If %NULL, default basic rate set is used.
1492 */
1493 int *basic_rates;
1494
1495 /**
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001496 * beacon_rate: Beacon frame data rate
1497 *
1498 * This parameter can be used to set a specific Beacon frame data rate
1499 * for the BSS. The interpretation of this value depends on the
Hai Shalom60840252021-02-19 19:02:11 -08001500 * rate_type (legacy: in 100 kbps units, HT: HT-MCS, VHT: VHT-MCS,
1501 * HE: HE-MCS). If beacon_rate == 0 and rate_type == 0
1502 * (BEACON_RATE_LEGACY), the default Beacon frame data rate is used.
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001503 */
1504 unsigned int beacon_rate;
1505
1506 /**
Hai Shalom60840252021-02-19 19:02:11 -08001507 * beacon_rate_type: Beacon data rate type (legacy/HT/VHT/HE)
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001508 */
1509 enum beacon_rate_type rate_type;
1510
1511 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001512 * proberesp - Probe Response template
1513 *
1514 * This is used by drivers that reply to Probe Requests internally in
1515 * AP mode and require the full Probe Response template.
1516 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08001517 u8 *proberesp;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001518
1519 /**
1520 * proberesp_len - Length of the proberesp buffer in octets
1521 */
1522 size_t proberesp_len;
1523
1524 /**
1525 * ssid - The SSID to use in Beacon/Probe Response frames
1526 */
1527 const u8 *ssid;
1528
1529 /**
1530 * ssid_len - Length of the SSID (1..32)
1531 */
1532 size_t ssid_len;
1533
1534 /**
1535 * hide_ssid - Whether to hide the SSID
1536 */
1537 enum hide_ssid hide_ssid;
1538
1539 /**
1540 * pairwise_ciphers - WPA_CIPHER_* bitfield
1541 */
1542 unsigned int pairwise_ciphers;
1543
1544 /**
1545 * group_cipher - WPA_CIPHER_*
1546 */
1547 unsigned int group_cipher;
1548
1549 /**
1550 * key_mgmt_suites - WPA_KEY_MGMT_* bitfield
1551 */
1552 unsigned int key_mgmt_suites;
1553
1554 /**
1555 * auth_algs - WPA_AUTH_ALG_* bitfield
1556 */
1557 unsigned int auth_algs;
1558
1559 /**
1560 * wpa_version - WPA_PROTO_* bitfield
1561 */
1562 unsigned int wpa_version;
1563
1564 /**
1565 * privacy - Whether privacy is used in the BSS
1566 */
1567 int privacy;
1568
1569 /**
1570 * beacon_ies - WPS/P2P IE(s) for Beacon frames
1571 *
1572 * This is used to add IEs like WPS IE and P2P IE by drivers that do
1573 * not use the full Beacon template.
1574 */
1575 const struct wpabuf *beacon_ies;
1576
1577 /**
1578 * proberesp_ies - P2P/WPS IE(s) for Probe Response frames
1579 *
1580 * This is used to add IEs like WPS IE and P2P IE by drivers that
1581 * reply to Probe Request frames internally.
1582 */
1583 const struct wpabuf *proberesp_ies;
1584
1585 /**
1586 * assocresp_ies - WPS IE(s) for (Re)Association Response frames
1587 *
1588 * This is used to add IEs like WPS IE by drivers that reply to
1589 * (Re)Association Request frames internally.
1590 */
1591 const struct wpabuf *assocresp_ies;
1592
1593 /**
1594 * isolate - Whether to isolate frames between associated stations
1595 *
1596 * If this is non-zero, the AP is requested to disable forwarding of
1597 * frames between associated stations.
1598 */
1599 int isolate;
1600
1601 /**
1602 * cts_protect - Whether CTS protection is enabled
1603 */
1604 int cts_protect;
1605
1606 /**
1607 * preamble - Whether short preamble is enabled
1608 */
1609 int preamble;
1610
1611 /**
1612 * short_slot_time - Whether short slot time is enabled
1613 *
1614 * 0 = short slot time disable, 1 = short slot time enabled, -1 = do
1615 * not set (e.g., when 802.11g mode is not in use)
1616 */
1617 int short_slot_time;
1618
1619 /**
1620 * ht_opmode - HT operation mode or -1 if HT not in use
1621 */
1622 int ht_opmode;
1623
1624 /**
1625 * interworking - Whether Interworking is enabled
1626 */
1627 int interworking;
1628
1629 /**
1630 * hessid - Homogeneous ESS identifier or %NULL if not set
1631 */
1632 const u8 *hessid;
1633
1634 /**
1635 * access_network_type - Access Network Type (0..15)
1636 *
1637 * This is used for filtering Probe Request frames when Interworking is
1638 * enabled.
1639 */
1640 u8 access_network_type;
Dmitry Shmidt04949592012-07-19 12:16:46 -07001641
1642 /**
1643 * ap_max_inactivity - Timeout in seconds to detect STA's inactivity
1644 *
1645 * This is used by driver which advertises this capability.
1646 */
1647 int ap_max_inactivity;
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07001648
1649 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08001650 * ctwindow - Client Traffic Window (in TUs)
1651 */
1652 u8 p2p_go_ctwindow;
1653
1654 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07001655 * disable_dgaf - Whether group-addressed frames are disabled
1656 */
1657 int disable_dgaf;
Dmitry Shmidtf21452a2014-02-26 10:55:25 -08001658
1659 /**
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07001660 * freq - Channel parameters for dynamic bandwidth changes
1661 */
1662 struct hostapd_freq_params *freq;
Dmitry Shmidt7f656022015-02-25 14:36:37 -08001663
1664 /**
1665 * reenable - Whether this is to re-enable beaconing
1666 */
1667 int reenable;
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08001668
1669 /**
1670 * pbss - Whether to start a PCP (in PBSS) instead of an AP in
1671 * infrastructure BSS. Valid only for DMG network.
1672 */
1673 int pbss;
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08001674
1675 /**
1676 * multicast_to_unicast - Whether to use multicast_to_unicast
1677 *
1678 * If this is non-zero, the AP is requested to perform multicast to
1679 * unicast conversion for ARP, IPv4, and IPv6 frames (possibly within
1680 * 802.1Q). If enabled, such frames are to be sent to each station
1681 * separately, with the DA replaced by their own MAC address rather
1682 * than the group address.
1683 *
1684 * Note that this may break certain expectations of the receiver, such
1685 * as the ability to drop unicast IP packets received within multicast
1686 * L2 frames, or the ability to not send ICMP destination unreachable
1687 * messages for packets received in L2 multicast (which is required,
1688 * but the receiver can't tell the difference if this new option is
1689 * enabled.)
1690 *
1691 * This also doesn't implement the 802.11 DMS (directed multicast
1692 * service).
1693 */
1694 int multicast_to_unicast;
Hai Shalom74f70d42019-02-11 14:42:39 -08001695
1696 /**
1697 * ftm_responder - Whether FTM responder is enabled
1698 */
1699 int ftm_responder;
1700
1701 /**
1702 * lci - Binary data, the content of an LCI report IE with type 8 as
1703 * defined in IEEE Std 802.11-2016, 9.4.2.22.10
1704 */
1705 const struct wpabuf *lci;
1706
1707 /**
1708 * civic - Binary data, the content of a measurement report IE with
1709 * type 11 as defined in IEEE Std 802.11-2016, 9.4.2.22.13
1710 */
1711 const struct wpabuf *civic;
Hai Shalomc3565922019-10-28 11:58:20 -07001712
1713 /**
Hai Shalom60840252021-02-19 19:02:11 -08001714 * he_spr_ctrl - Spatial Reuse control field of SPR element
Hai Shalomc3565922019-10-28 11:58:20 -07001715 */
Hai Shalom60840252021-02-19 19:02:11 -08001716 u8 he_spr_ctrl;
1717
1718 /**
1719 * he_spr_non_srg_obss_pd_max_offset - Non-SRG Maximum TX power offset
1720 */
1721 u8 he_spr_non_srg_obss_pd_max_offset;
Hai Shalomc3565922019-10-28 11:58:20 -07001722
1723 /**
1724 * he_spr_srg_obss_pd_min_offset - Minimum TX power offset
1725 */
Hai Shalom60840252021-02-19 19:02:11 -08001726 u8 he_spr_srg_obss_pd_min_offset;
Hai Shalomc3565922019-10-28 11:58:20 -07001727
1728 /**
1729 * he_spr_srg_obss_pd_max_offset - Maximum TX power offset
1730 */
Hai Shalom60840252021-02-19 19:02:11 -08001731 u8 he_spr_srg_obss_pd_max_offset;
1732
1733 /**
1734 * he_spr_bss_color_bitmap - BSS color values used by members of the
1735 * SRG.
1736 */
1737 u8 he_spr_bss_color_bitmap[8];
1738
1739 /**
1740 * he_spr_partial_bssid_bitmap - Partial BSSID values used by members
1741 * of the SRG.
1742 */
1743 u8 he_spr_partial_bssid_bitmap[8];
Hai Shalomfdcde762020-04-02 11:19:20 -07001744
1745 /**
1746 * he_bss_color - Whether the BSS Color is disabled
1747 */
1748 int he_bss_color_disabled;
1749
1750 /**
1751 * he_bss_color_partial - The BSS Color AID equation
1752 */
1753 int he_bss_color_partial;
1754
1755 /**
1756 * he_bss_color - The BSS Color of the AP
1757 */
1758 int he_bss_color;
1759
1760 /**
1761 * twt_responder - Whether Target Wait Time responder is enabled
1762 */
1763 int twt_responder;
Hai Shalom60840252021-02-19 19:02:11 -08001764
1765 /**
1766 * sae_pwe - SAE mechanism for PWE derivation
1767 * 0 = hunting-and-pecking loop only
1768 * 1 = hash-to-element only
1769 * 2 = both hunting-and-pecking loop and hash-to-element enabled
1770 */
Sunil Ravi77d572f2023-01-17 23:58:31 +00001771 enum sae_pwe sae_pwe;
Hai Shalom60840252021-02-19 19:02:11 -08001772
1773 /**
1774 * FILS Discovery frame minimum interval in TUs
1775 */
1776 u32 fd_min_int;
1777
1778 /**
1779 * FILS Discovery frame maximum interval in TUs (0 = FD frame disabled)
1780 */
1781 u32 fd_max_int;
1782
1783 /**
1784 * FILS Discovery frame template data
1785 */
1786 u8 *fd_frame_tmpl;
1787
1788 /**
1789 * FILS Discovery frame template length
1790 */
1791 size_t fd_frame_tmpl_len;
1792
1793 /**
Sunil Ravi77d572f2023-01-17 23:58:31 +00001794 * mbssid_tx_iface - Transmitting interface of the MBSSID set
1795 */
1796 const char *mbssid_tx_iface;
1797
1798 /**
1799 * mbssid_index - The index of this BSS in the MBSSID set
1800 */
1801 unsigned int mbssid_index;
1802
1803 /**
1804 * mbssid_elem - Buffer containing all MBSSID elements
1805 */
1806 u8 *mbssid_elem;
1807
1808 /**
1809 * mbssid_elem_len - Total length of all MBSSID elements
1810 */
1811 size_t mbssid_elem_len;
1812
1813 /**
1814 * mbssid_elem_count - The number of MBSSID elements
1815 */
1816 u8 mbssid_elem_count;
1817
1818 /**
1819 * mbssid_elem_offset - Offsets to elements in mbssid_elem.
1820 * Kernel will use these offsets to generate multiple BSSID beacons.
1821 */
1822 u8 **mbssid_elem_offset;
1823
1824 /**
1825 * ema - Enhanced MBSSID advertisements support.
1826 */
1827 bool ema;
Sunil Ravi036cec52023-03-29 11:35:17 -07001828
1829 /**
1830 * punct_bitmap - Preamble puncturing bitmap
1831 * Each bit corresponds to a 20 MHz subchannel, the lowest bit for the
1832 * channel with the lowest frequency. A bit set to 1 indicates that the
1833 * subchannel is punctured, otherwise active.
1834 */
1835 u16 punct_bitmap;
Sunil Ravi640215c2023-06-28 23:08:09 +00001836
1837 /**
1838 * rnr_elem - This buffer contains all of reduced neighbor report (RNR)
1839 * elements
1840 */
1841 u8 *rnr_elem;
1842
1843 /**
1844 * rnr_elem_len - Length of rnr_elem buffer
1845 */
1846 size_t rnr_elem_len;
1847
1848 /**
1849 * rnr_elem_count - Number of RNR elements
1850 */
1851 unsigned int rnr_elem_count;
1852
1853 /**
1854 * rnr_elem_offset - The offsets to the elements in rnr_elem.
1855 * The driver will use these to include RNR elements in EMA beacons.
1856 */
1857 u8 **rnr_elem_offset;
1858
Sunil Ravi7f769292024-07-23 22:21:32 +00001859 /* Unsolicited broadcast Probe Response data */
1860 struct unsol_bcast_probe_resp ubpr;
1861
Sunil Ravi640215c2023-06-28 23:08:09 +00001862 /**
1863 * allowed_freqs - List of allowed 20 MHz channel center frequencies in
1864 * MHz for AP operation. Drivers which support this parameter will
1865 * generate a new list based on this provided list by filtering out
1866 * channels that cannot be used at that time due to regulatory or other
1867 * constraints. The resulting list is used as the list of all allowed
1868 * channels whenever performing operations like ACS and DFS.
1869 */
1870 int *allowed_freqs;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00001871
1872 /*
1873 * mld_ap - Whether operating as an AP MLD
1874 */
1875 bool mld_ap;
1876
1877 /**
1878 * mld_link_id - Link id for MLD BSS's
1879 */
1880 u8 mld_link_id;
1881
1882 /**
1883 * psk - PSK passed to the driver for 4-way handshake offload
1884 */
1885 u8 psk[PMK_LEN];
1886
1887 /**
1888 * psk_len - PSK length in bytes (0 = not set)
1889 */
1890 size_t psk_len;
1891
1892 /**
1893 * sae_password - SAE password for SAE offload
1894 */
1895 const char *sae_password;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001896};
1897
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001898struct wpa_driver_mesh_bss_params {
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001899#define WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS 0x00000001
1900#define WPA_DRIVER_MESH_CONF_FLAG_PEER_LINK_TIMEOUT 0x00000002
1901#define WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS 0x00000004
1902#define WPA_DRIVER_MESH_CONF_FLAG_HT_OP_MODE 0x00000008
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001903#define WPA_DRIVER_MESH_CONF_FLAG_RSSI_THRESHOLD 0x00000010
Hai Shalomc1a21442022-02-04 13:43:00 -08001904#define WPA_DRIVER_MESH_CONF_FLAG_FORWARDING 0x00000020
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001905 /*
1906 * TODO: Other mesh configuration parameters would go here.
1907 * See NL80211_MESHCONF_* for all the mesh config parameters.
1908 */
1909 unsigned int flags;
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001910 int auto_plinks;
Dmitry Shmidt2f74e362015-01-21 13:19:05 -08001911 int peer_link_timeout;
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001912 int max_peer_links;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001913 int rssi_threshold;
Hai Shalomc1a21442022-02-04 13:43:00 -08001914 int forwarding;
Dmitry Shmidtd13095b2016-08-22 14:02:19 -07001915 u16 ht_opmode;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001916};
1917
1918struct wpa_driver_mesh_join_params {
1919 const u8 *meshid;
1920 int meshid_len;
1921 const int *basic_rates;
1922 const u8 *ies;
1923 int ie_len;
Dmitry Shmidtff787d52015-01-12 13:01:47 -08001924 struct hostapd_freq_params freq;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001925 int beacon_int;
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07001926 int dtim_period;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001927 struct wpa_driver_mesh_bss_params conf;
1928#define WPA_DRIVER_MESH_FLAG_USER_MPM 0x00000001
1929#define WPA_DRIVER_MESH_FLAG_DRIVER_MPM 0x00000002
1930#define WPA_DRIVER_MESH_FLAG_SAE_AUTH 0x00000004
1931#define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008
1932 unsigned int flags;
Hai Shalom60840252021-02-19 19:02:11 -08001933 bool handle_dfs;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001934};
1935
Hai Shalomfdcde762020-04-02 11:19:20 -07001936struct wpa_driver_set_key_params {
1937 /**
1938 * ifname - Interface name (for multi-SSID/VLAN support) */
1939 const char *ifname;
1940
1941 /**
1942 * alg - Encryption algorithm
1943 *
1944 * (%WPA_ALG_NONE, %WPA_ALG_WEP, %WPA_ALG_TKIP, %WPA_ALG_CCMP,
Hai Shalom4fbc08f2020-05-18 12:37:00 -07001945 * %WPA_ALG_BIP_AES_CMAC_128, %WPA_ALG_GCMP, %WPA_ALG_GCMP_256,
1946 * %WPA_ALG_CCMP_256, %WPA_ALG_BIP_GMAC_128, %WPA_ALG_BIP_GMAC_256,
1947 * %WPA_ALG_BIP_CMAC_256);
Hai Shalomfdcde762020-04-02 11:19:20 -07001948 * %WPA_ALG_NONE clears the key. */
1949 enum wpa_alg alg;
1950
1951 /**
1952 * addr - Address of the peer STA
1953 *
1954 * (BSSID of the current AP when setting pairwise key in station mode),
1955 * ff:ff:ff:ff:ff:ff for broadcast keys, %NULL for default keys that
1956 * are used both for broadcast and unicast; when clearing keys, %NULL
1957 * is used to indicate that both the broadcast-only and default key of
1958 * the specified key index is to be cleared */
1959 const u8 *addr;
1960
1961 /**
1962 * key_idx - Key index
1963 *
1964 * (0..3), usually 0 for unicast keys; 4..5 for IGTK; 6..7 for BIGTK */
1965 int key_idx;
1966
1967 /**
1968 * set_tx - Configure this key as the default Tx key
1969 *
1970 * Only used when driver does not support separate unicast/individual
1971 * key */
1972 int set_tx;
1973
1974 /**
1975 * seq - Sequence number/packet number
1976 *
1977 * seq_len octets, the next packet number to be used for in replay
1978 * protection; configured for Rx keys (in most cases, this is only used
1979 * with broadcast keys and set to zero for unicast keys); %NULL if not
1980 * set */
1981 const u8 *seq;
1982
1983 /**
1984 * seq_len - Length of the seq, depends on the algorithm
1985 *
1986 * TKIP: 6 octets, CCMP/GCMP: 6 octets, IGTK: 6 octets */
1987 size_t seq_len;
1988
1989 /**
1990 * key - Key buffer
1991 *
1992 * TKIP: 16-byte temporal key, 8-byte Tx Mic key, 8-byte Rx Mic Key */
1993 const u8 *key;
1994
1995 /**
1996 * key_len - Length of the key buffer in octets
1997 *
1998 * WEP: 5 or 13, TKIP: 32, CCMP/GCMP: 16, IGTK: 16 */
1999 size_t key_len;
2000
2001 /**
2002 * vlan_id - VLAN index (0..4095) for VLAN offload cases */
2003 int vlan_id;
2004
2005 /**
2006 * key_flag - Additional key flags
2007 *
2008 * %KEY_FLAG_MODIFY
2009 * Set when an already installed key must be updated.
2010 * So far the only use-case is changing RX/TX status for
2011 * pairwise keys. Must not be set when deleting a key.
2012 * %KEY_FLAG_DEFAULT
2013 * Set when the key is also a default key. Must not be set when
2014 * deleting a key.
2015 * %KEY_FLAG_RX
2016 * The key is valid for RX. Must not be set when deleting a key.
2017 * %KEY_FLAG_TX
2018 * The key is valid for TX. Must not be set when deleting a key.
2019 * %KEY_FLAG_GROUP
2020 * The key is a broadcast or group key.
2021 * %KEY_FLAG_PAIRWISE
2022 * The key is a pairwise key.
2023 * %KEY_FLAG_PMK
2024 * The key is a Pairwise Master Key (PMK).
2025 *
2026 * Valid and pre-defined combinations are:
2027 * %KEY_FLAG_GROUP_RX_TX
2028 * WEP key not to be installed as default key.
2029 * %KEY_FLAG_GROUP_RX_TX_DEFAULT
2030 * Default WEP or WPA-NONE key.
2031 * %KEY_FLAG_GROUP_RX
2032 * GTK key valid for RX only.
2033 * %KEY_FLAG_GROUP_TX_DEFAULT
2034 * GTK key valid for TX only, immediately taking over TX.
2035 * %KEY_FLAG_PAIRWISE_RX_TX
Sunil Ravi876a49b2025-02-03 19:18:32 +00002036 * Pairwise key immediately becoming the active pairwise key. If this
2037 * key was previously set as an alternative RX-only key with
2038 * %KEY_FLAG_PAIRWISE_RX | %KEY_FLAG_NEXT, the alternative RX-only key
2039 * is taken into use for both TX and RX without changing the RX counter
2040 * values.
Hai Shalomfdcde762020-04-02 11:19:20 -07002041 * %KEY_FLAG_PAIRWISE_RX
2042 * Pairwise key not yet valid for TX. (Only usable when Extended
Sunil Ravi876a49b2025-02-03 19:18:32 +00002043 * Key ID is supported by the driver or when configuring the next TK
2044 * for RX-only with %KEY_FLAG_NEXT in which case the new TK can be used
2045 * as an alternative key for decrypting received frames without
2046 * replacing the possibly already configured old TK.)
Hai Shalomfdcde762020-04-02 11:19:20 -07002047 * %KEY_FLAG_PAIRWISE_RX_TX_MODIFY
2048 * Enable TX for a pairwise key installed with
2049 * KEY_FLAG_PAIRWISE_RX.
2050 *
2051 * Not a valid standalone key type but pre-defined to be combined
2052 * with other key_flags:
2053 * %KEY_FLAG_RX_TX
2054 * RX/TX key. */
2055 enum key_flag key_flag;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002056
2057 /**
2058 * link_id - MLO Link ID
2059 *
2060 * Set to a valid Link ID (0-14) when applicable, otherwise -1. */
2061 int link_id;
Hai Shalomfdcde762020-04-02 11:19:20 -07002062};
2063
Hai Shalom4fbc08f2020-05-18 12:37:00 -07002064enum wpa_driver_if_type {
2065 /**
2066 * WPA_IF_STATION - Station mode interface
2067 */
2068 WPA_IF_STATION,
2069
2070 /**
2071 * WPA_IF_AP_VLAN - AP mode VLAN interface
2072 *
2073 * This interface shares its address and Beacon frame with the main
2074 * BSS.
2075 */
2076 WPA_IF_AP_VLAN,
2077
2078 /**
2079 * WPA_IF_AP_BSS - AP mode BSS interface
2080 *
2081 * This interface has its own address and Beacon frame.
2082 */
2083 WPA_IF_AP_BSS,
2084
2085 /**
2086 * WPA_IF_P2P_GO - P2P Group Owner
2087 */
2088 WPA_IF_P2P_GO,
2089
2090 /**
2091 * WPA_IF_P2P_CLIENT - P2P Client
2092 */
2093 WPA_IF_P2P_CLIENT,
2094
2095 /**
2096 * WPA_IF_P2P_GROUP - P2P Group interface (will become either
2097 * WPA_IF_P2P_GO or WPA_IF_P2P_CLIENT, but the role is not yet known)
2098 */
2099 WPA_IF_P2P_GROUP,
2100
2101 /**
Sunil Ravia04bd252022-05-02 22:54:18 -07002102 * WPA_IF_P2P_DEVICE - P2P Device interface is used to identify the
Hai Shalom4fbc08f2020-05-18 12:37:00 -07002103 * abstracted P2P Device function in the driver
2104 */
2105 WPA_IF_P2P_DEVICE,
2106
2107 /*
2108 * WPA_IF_MESH - Mesh interface
2109 */
2110 WPA_IF_MESH,
2111
2112 /*
2113 * WPA_IF_TDLS - TDLS offchannel interface (used for pref freq only)
2114 */
2115 WPA_IF_TDLS,
2116
2117 /*
2118 * WPA_IF_IBSS - IBSS interface (used for pref freq only)
2119 */
2120 WPA_IF_IBSS,
2121
2122 /*
2123 * WPA_IF_NAN - NAN Device
2124 */
2125 WPA_IF_NAN,
2126
2127 /* keep last */
2128 WPA_IF_MAX
2129};
2130
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002131/**
2132 * struct wpa_driver_capa - Driver capability information
2133 */
2134struct wpa_driver_capa {
2135#define WPA_DRIVER_CAPA_KEY_MGMT_WPA 0x00000001
2136#define WPA_DRIVER_CAPA_KEY_MGMT_WPA2 0x00000002
2137#define WPA_DRIVER_CAPA_KEY_MGMT_WPA_PSK 0x00000004
2138#define WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK 0x00000008
2139#define WPA_DRIVER_CAPA_KEY_MGMT_WPA_NONE 0x00000010
2140#define WPA_DRIVER_CAPA_KEY_MGMT_FT 0x00000020
2141#define WPA_DRIVER_CAPA_KEY_MGMT_FT_PSK 0x00000040
Dmitry Shmidtd5e49232012-12-03 15:08:10 -08002142#define WPA_DRIVER_CAPA_KEY_MGMT_WAPI_PSK 0x00000080
Dmitry Shmidt807291d2015-01-27 13:40:23 -08002143#define WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B 0x00000100
2144#define WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B_192 0x00000200
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002145#define WPA_DRIVER_CAPA_KEY_MGMT_OWE 0x00000400
2146#define WPA_DRIVER_CAPA_KEY_MGMT_DPP 0x00000800
2147#define WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA256 0x00001000
2148#define WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA384 0x00002000
2149#define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA256 0x00004000
2150#define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA384 0x00008000
Hai Shalom74f70d42019-02-11 14:42:39 -08002151#define WPA_DRIVER_CAPA_KEY_MGMT_SAE 0x00010000
Tanmay Garga7fd80d2020-05-18 15:52:44 +05302152#define WPA_DRIVER_CAPA_KEY_MGMT_802_1X_SHA256 0x00020000
2153#define WPA_DRIVER_CAPA_KEY_MGMT_PSK_SHA256 0x00040000
2154#define WPA_DRIVER_CAPA_KEY_MGMT_TPK_HANDSHAKE 0x00080000
2155#define WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE 0x00100000
2156#define WPA_DRIVER_CAPA_KEY_MGMT_FT_802_1X_SHA384 0x00200000
2157#define WPA_DRIVER_CAPA_KEY_MGMT_CCKM 0x00400000
Sunil Ravi89eba102022-09-13 21:04:37 -07002158#define WPA_DRIVER_CAPA_KEY_MGMT_SAE_EXT_KEY 0x01000000
2159#define WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE_EXT_KEY 0x02000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002160 /** Bitfield of supported key management suites */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002161 unsigned int key_mgmt;
Hai Shalom4fbc08f2020-05-18 12:37:00 -07002162 unsigned int key_mgmt_iftype[WPA_IF_MAX];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002163
2164#define WPA_DRIVER_CAPA_ENC_WEP40 0x00000001
2165#define WPA_DRIVER_CAPA_ENC_WEP104 0x00000002
2166#define WPA_DRIVER_CAPA_ENC_TKIP 0x00000004
2167#define WPA_DRIVER_CAPA_ENC_CCMP 0x00000008
Dmitry Shmidt04949592012-07-19 12:16:46 -07002168#define WPA_DRIVER_CAPA_ENC_WEP128 0x00000010
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07002169#define WPA_DRIVER_CAPA_ENC_GCMP 0x00000020
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08002170#define WPA_DRIVER_CAPA_ENC_GCMP_256 0x00000040
2171#define WPA_DRIVER_CAPA_ENC_CCMP_256 0x00000080
2172#define WPA_DRIVER_CAPA_ENC_BIP 0x00000100
2173#define WPA_DRIVER_CAPA_ENC_BIP_GMAC_128 0x00000200
2174#define WPA_DRIVER_CAPA_ENC_BIP_GMAC_256 0x00000400
2175#define WPA_DRIVER_CAPA_ENC_BIP_CMAC_256 0x00000800
Dmitry Shmidtf21452a2014-02-26 10:55:25 -08002176#define WPA_DRIVER_CAPA_ENC_GTK_NOT_USED 0x00001000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002177 /** Bitfield of supported cipher suites */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002178 unsigned int enc;
2179
2180#define WPA_DRIVER_AUTH_OPEN 0x00000001
2181#define WPA_DRIVER_AUTH_SHARED 0x00000002
2182#define WPA_DRIVER_AUTH_LEAP 0x00000004
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002183 /** Bitfield of supported IEEE 802.11 authentication algorithms */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002184 unsigned int auth;
2185
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002186/** Driver generated WPA/RSN IE */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002187#define WPA_DRIVER_FLAGS_DRIVER_IE 0x00000001
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002188/** Driver needs static WEP key setup after association command */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002189#define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC 0x00000002
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002190/** Driver takes care of all DFS operations */
Dmitry Shmidtd11f0192014-03-24 12:09:47 -07002191#define WPA_DRIVER_FLAGS_DFS_OFFLOAD 0x00000004
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002192/** Driver takes care of RSN 4-way handshake internally; PMK is configured with
Hai Shalomfdcde762020-04-02 11:19:20 -07002193 * struct wpa_driver_ops::set_key using key_flag = KEY_FLAG_PMK */
Hai Shalom74f70d42019-02-11 14:42:39 -08002194#define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X 0x00000008
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002195/** Driver is for a wired Ethernet interface */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002196#define WPA_DRIVER_FLAGS_WIRED 0x00000010
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002197/** Driver provides separate commands for authentication and association (SME in
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002198 * wpa_supplicant). */
2199#define WPA_DRIVER_FLAGS_SME 0x00000020
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002200/** Driver supports AP mode */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002201#define WPA_DRIVER_FLAGS_AP 0x00000040
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002202/** Driver needs static WEP key setup after association has been completed */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002203#define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE 0x00000080
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002204/** Driver supports dynamic HT 20/40 MHz channel changes during BSS lifetime */
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07002205#define WPA_DRIVER_FLAGS_HT_2040_COEX 0x00000100
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002206/** Driver supports concurrent P2P operations */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002207#define WPA_DRIVER_FLAGS_P2P_CONCURRENT 0x00000200
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002208/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002209 * Driver uses the initial interface as a dedicated management interface, i.e.,
2210 * it cannot be used for P2P group operations or non-P2P purposes.
2211 */
2212#define WPA_DRIVER_FLAGS_P2P_DEDICATED_INTERFACE 0x00000400
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002213/** This interface is P2P capable (P2P GO or P2P Client) */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002214#define WPA_DRIVER_FLAGS_P2P_CAPABLE 0x00000800
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002215/** Driver supports station and key removal when stopping an AP */
Dmitry Shmidta38abf92014-03-06 13:38:44 -08002216#define WPA_DRIVER_FLAGS_AP_TEARDOWN_SUPPORT 0x00001000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002217/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002218 * Driver uses the initial interface for P2P management interface and non-P2P
2219 * purposes (e.g., connect to infra AP), but this interface cannot be used for
2220 * P2P group operations.
2221 */
2222#define WPA_DRIVER_FLAGS_P2P_MGMT_AND_NON_P2P 0x00002000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002223/**
Hai Shalomc1a21442022-02-04 13:43:00 -08002224 * Driver is known to use valid error codes, i.e., when it indicates that
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002225 * something (e.g., association) fails, there was indeed a failure and the
2226 * operation does not end up getting completed successfully later.
2227 */
Hai Shalomc1a21442022-02-04 13:43:00 -08002228#define WPA_DRIVER_FLAGS_VALID_ERROR_CODES 0x00004000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002229/** Driver supports off-channel TX */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002230#define WPA_DRIVER_FLAGS_OFFCHANNEL_TX 0x00008000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002231/** Driver indicates TX status events for EAPOL Data frames */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002232#define WPA_DRIVER_FLAGS_EAPOL_TX_STATUS 0x00010000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002233/** Driver indicates TX status events for Deauth/Disassoc frames */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002234#define WPA_DRIVER_FLAGS_DEAUTH_TX_STATUS 0x00020000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002235/** Driver supports roaming (BSS selection) in firmware */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002236#define WPA_DRIVER_FLAGS_BSS_SELECTION 0x00040000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002237/** Driver supports operating as a TDLS peer */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002238#define WPA_DRIVER_FLAGS_TDLS_SUPPORT 0x00080000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002239/** Driver requires external TDLS setup/teardown/discovery */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002240#define WPA_DRIVER_FLAGS_TDLS_EXTERNAL_SETUP 0x00100000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002241/** Driver indicates support for Probe Response offloading in AP mode */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002242#define WPA_DRIVER_FLAGS_PROBE_RESP_OFFLOAD 0x00200000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002243/** Driver supports U-APSD in AP mode */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002244#define WPA_DRIVER_FLAGS_AP_UAPSD 0x00400000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002245/** Driver supports inactivity timer in AP mode */
Dmitry Shmidt04949592012-07-19 12:16:46 -07002246#define WPA_DRIVER_FLAGS_INACTIVITY_TIMER 0x00800000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002247/** Driver expects user space implementation of MLME in AP mode */
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07002248#define WPA_DRIVER_FLAGS_AP_MLME 0x01000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002249/** Driver supports SAE with user space SME */
Dmitry Shmidtd5e49232012-12-03 15:08:10 -08002250#define WPA_DRIVER_FLAGS_SAE 0x02000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002251/** Driver makes use of OBSS scan mechanism in wpa_supplicant */
Dmitry Shmidtd5e49232012-12-03 15:08:10 -08002252#define WPA_DRIVER_FLAGS_OBSS_SCAN 0x04000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002253/** Driver supports IBSS (Ad-hoc) mode */
Dmitry Shmidt700a1372013-03-15 14:14:44 -07002254#define WPA_DRIVER_FLAGS_IBSS 0x08000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002255/** Driver supports radar detection */
Dmitry Shmidtea69e842013-05-13 14:52:28 -07002256#define WPA_DRIVER_FLAGS_RADAR 0x10000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002257/** Driver supports a dedicated interface for P2P Device */
Dmitry Shmidt34af3062013-07-11 10:46:32 -07002258#define WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE 0x20000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002259/** Driver supports QoS Mapping */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08002260#define WPA_DRIVER_FLAGS_QOS_MAPPING 0x40000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002261/** Driver supports CSA in AP mode */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08002262#define WPA_DRIVER_FLAGS_AP_CSA 0x80000000
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002263/** Driver supports mesh */
2264#define WPA_DRIVER_FLAGS_MESH 0x0000000100000000ULL
2265/** Driver support ACS offload */
2266#define WPA_DRIVER_FLAGS_ACS_OFFLOAD 0x0000000200000000ULL
2267/** Driver supports key management offload */
2268#define WPA_DRIVER_FLAGS_KEY_MGMT_OFFLOAD 0x0000000400000000ULL
2269/** Driver supports TDLS channel switching */
2270#define WPA_DRIVER_FLAGS_TDLS_CHANNEL_SWITCH 0x0000000800000000ULL
Dmitry Shmidtff787d52015-01-12 13:01:47 -08002271/** Driver supports IBSS with HT datarates */
2272#define WPA_DRIVER_FLAGS_HT_IBSS 0x0000001000000000ULL
Dmitry Shmidt7f656022015-02-25 14:36:37 -08002273/** Driver supports IBSS with VHT datarates */
2274#define WPA_DRIVER_FLAGS_VHT_IBSS 0x0000002000000000ULL
Dmitry Shmidtb1e52102015-05-29 12:36:29 -07002275/** Driver supports automatic band selection */
2276#define WPA_DRIVER_FLAGS_SUPPORT_HW_MODE_ANY 0x0000004000000000ULL
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002277/** Driver supports simultaneous off-channel operations */
2278#define WPA_DRIVER_FLAGS_OFFCHANNEL_SIMULTANEOUS 0x0000008000000000ULL
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002279/** Driver supports full AP client state */
2280#define WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE 0x0000010000000000ULL
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07002281/** Driver supports P2P Listen offload */
2282#define WPA_DRIVER_FLAGS_P2P_LISTEN_OFFLOAD 0x0000020000000000ULL
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08002283/** Driver supports FILS */
2284#define WPA_DRIVER_FLAGS_SUPPORT_FILS 0x0000040000000000ULL
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08002285/** Driver supports Beacon frame TX rate configuration (legacy rates) */
2286#define WPA_DRIVER_FLAGS_BEACON_RATE_LEGACY 0x0000080000000000ULL
2287/** Driver supports Beacon frame TX rate configuration (HT rates) */
2288#define WPA_DRIVER_FLAGS_BEACON_RATE_HT 0x0000100000000000ULL
2289/** Driver supports Beacon frame TX rate configuration (VHT rates) */
2290#define WPA_DRIVER_FLAGS_BEACON_RATE_VHT 0x0000200000000000ULL
Dmitry Shmidtebd93af2017-02-21 13:40:44 -08002291/** Driver supports mgmt_tx with random TX address in non-connected state */
2292#define WPA_DRIVER_FLAGS_MGMT_TX_RANDOM_TA 0x0000400000000000ULL
2293/** Driver supports mgmt_tx with random TX addr in connected state */
2294#define WPA_DRIVER_FLAGS_MGMT_TX_RANDOM_TA_CONNECTED 0x0000800000000000ULL
2295/** Driver supports better BSS reporting with sched_scan in connected mode */
2296#define WPA_DRIVER_FLAGS_SCHED_SCAN_RELATIVE_RSSI 0x0001000000000000ULL
2297/** Driver supports HE capabilities */
2298#define WPA_DRIVER_FLAGS_HE_CAPABILITIES 0x0002000000000000ULL
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002299/** Driver supports FILS shared key offload */
2300#define WPA_DRIVER_FLAGS_FILS_SK_OFFLOAD 0x0004000000000000ULL
2301/** Driver supports all OCE STA specific mandatory features */
2302#define WPA_DRIVER_FLAGS_OCE_STA 0x0008000000000000ULL
2303/** Driver supports all OCE AP specific mandatory features */
2304#define WPA_DRIVER_FLAGS_OCE_AP 0x0010000000000000ULL
2305/**
2306 * Driver supports all OCE STA-CFON specific mandatory features only.
2307 * If a driver sets this bit but not the %WPA_DRIVER_FLAGS_OCE_AP, the
2308 * userspace shall assume that this driver may not support all OCE AP
2309 * functionality but can support only OCE STA-CFON functionality.
2310 */
2311#define WPA_DRIVER_FLAGS_OCE_STA_CFON 0x0020000000000000ULL
Roshan Pius3a1667e2018-07-03 15:17:14 -07002312/** Driver supports MFP-optional in the connect command */
2313#define WPA_DRIVER_FLAGS_MFP_OPTIONAL 0x0040000000000000ULL
Hai Shalom39ba6fc2019-01-22 12:40:38 -08002314/** Driver is a self-managed regulatory device */
2315#define WPA_DRIVER_FLAGS_SELF_MANAGED_REGULATORY 0x0080000000000000ULL
Hai Shalom74f70d42019-02-11 14:42:39 -08002316/** Driver supports FTM responder functionality */
2317#define WPA_DRIVER_FLAGS_FTM_RESPONDER 0x0100000000000000ULL
2318/** Driver support 4-way handshake offload for WPA-Personal */
2319#define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK 0x0200000000000000ULL
Hai Shalomb755a2a2020-04-23 21:49:02 -07002320/** Driver supports a separate control port TX for EAPOL frames */
Hai Shalomfdcde762020-04-02 11:19:20 -07002321#define WPA_DRIVER_FLAGS_CONTROL_PORT 0x0400000000000000ULL
2322/** Driver supports VLAN offload */
2323#define WPA_DRIVER_FLAGS_VLAN_OFFLOAD 0x0800000000000000ULL
2324/** Driver supports UPDATE_FT_IES command */
2325#define WPA_DRIVER_FLAGS_UPDATE_FT_IES 0x1000000000000000ULL
2326/** Driver can correctly rekey PTKs without Extended Key ID */
2327#define WPA_DRIVER_FLAGS_SAFE_PTK0_REKEYS 0x2000000000000000ULL
2328/** Driver supports Beacon protection */
2329#define WPA_DRIVER_FLAGS_BEACON_PROTECTION 0x4000000000000000ULL
2330/** Driver supports Extended Key ID */
2331#define WPA_DRIVER_FLAGS_EXTENDED_KEY_ID 0x8000000000000000ULL
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002332 u64 flags;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002333
Hai Shalomb755a2a2020-04-23 21:49:02 -07002334/** Driver supports a separate control port RX for EAPOL frames */
2335#define WPA_DRIVER_FLAGS2_CONTROL_PORT_RX 0x0000000000000001ULL
Hai Shalom899fcc72020-10-19 14:38:18 -07002336/** Driver supports TX status reports for EAPOL frames through control port */
2337#define WPA_DRIVER_FLAGS2_CONTROL_PORT_TX_STATUS 0x0000000000000002ULL
Sunil Ravi89eba102022-09-13 21:04:37 -07002338/** Driver supports secure LTF in AP mode */
2339#define WPA_DRIVER_FLAGS2_SEC_LTF_AP 0x0000000000000004ULL
2340/** Driver supports secure RTT measurement exchange in AP mode */
2341#define WPA_DRIVER_FLAGS2_SEC_RTT_AP 0x0000000000000008ULL
Hai Shalom60840252021-02-19 19:02:11 -08002342/**
2343 * Driver supports protection of range negotiation and measurement management
Sunil Ravi89eba102022-09-13 21:04:37 -07002344 * frames in AP mode
Hai Shalom60840252021-02-19 19:02:11 -08002345 */
Sunil Ravi89eba102022-09-13 21:04:37 -07002346#define WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_AP 0x0000000000000010ULL
Hai Shalom60840252021-02-19 19:02:11 -08002347/** Driver supports Beacon frame TX rate configuration (HE rates) */
2348#define WPA_DRIVER_FLAGS2_BEACON_RATE_HE 0x0000000000000020ULL
2349/** Driver supports Beacon protection only in client mode */
2350#define WPA_DRIVER_FLAGS2_BEACON_PROTECTION_CLIENT 0x0000000000000040ULL
2351/** Driver supports Operating Channel Validation */
2352#define WPA_DRIVER_FLAGS2_OCV 0x0000000000000080ULL
2353/** Driver expects user space implementation of SME in AP mode */
2354#define WPA_DRIVER_FLAGS2_AP_SME 0x0000000000000100ULL
Sunil Ravia04bd252022-05-02 22:54:18 -07002355/** Driver handles SA Query procedures in AP mode */
2356#define WPA_DRIVER_FLAGS2_SA_QUERY_OFFLOAD_AP 0x0000000000000200ULL
2357/** Driver supports background radar/CAC detection */
Sunil Ravi2a14cf12023-11-21 00:54:38 +00002358#define WPA_DRIVER_FLAGS2_RADAR_BACKGROUND 0x0000000000000400ULL
Sunil Ravi89eba102022-09-13 21:04:37 -07002359/** Driver supports secure LTF in STA mode */
2360#define WPA_DRIVER_FLAGS2_SEC_LTF_STA 0x0000000000000800ULL
2361/** Driver supports secure RTT measurement exchange in STA mode */
2362#define WPA_DRIVER_FLAGS2_SEC_RTT_STA 0x0000000000001000ULL
2363/**
2364 * Driver supports protection of range negotiation and measurement management
2365 * frames in STA mode
2366 */
2367#define WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_STA 0x0000000000002000ULL
Sunil Ravi77d572f2023-01-17 23:58:31 +00002368/** Driver supports MLO in station/AP mode */
2369#define WPA_DRIVER_FLAGS2_MLO 0x0000000000004000ULL
Sunil Ravi2a14cf12023-11-21 00:54:38 +00002370/** Driver supports minimal scan request probe content */
2371#define WPA_DRIVER_FLAGS2_SCAN_MIN_PREQ 0x0000000000008000ULL
2372/** Driver supports SAE authentication offload in STA mode */
2373#define WPA_DRIVER_FLAGS2_SAE_OFFLOAD_STA 0x0000000000010000ULL
2374/** Driver support AP_PSK authentication offload */
2375#define WPA_DRIVER_FLAGS2_4WAY_HANDSHAKE_AP_PSK 0x0000000000020000ULL
2376/** Driver supports OWE STA offload */
2377#define WPA_DRIVER_FLAGS2_OWE_OFFLOAD_STA 0x0000000000040000ULL
2378/** Driver supports OWE AP offload */
2379#define WPA_DRIVER_FLAGS2_OWE_OFFLOAD_AP 0x0000000000080000ULL
2380/** Driver support AP SAE authentication offload */
2381#define WPA_DRIVER_FLAGS2_SAE_OFFLOAD_AP 0x0000000000100000ULL
Sunil Ravi7f769292024-07-23 22:21:32 +00002382/** Driver supports TWT responder in HT and VHT modes */
2383#define WPA_DRIVER_FLAGS2_HT_VHT_TWT_RESPONDER 0x0000000000200000ULL
2384/** Driver supports RSN override elements */
2385#define WPA_DRIVER_FLAGS2_RSN_OVERRIDE_STA 0x0000000000400000ULL
Sunil Ravic0f5d412024-09-11 22:12:49 +00002386/** Driver supports NAN offload */
2387#define WPA_DRIVER_FLAGS2_NAN_OFFLOAD 0x0000000000800000ULL
Sunil Ravi876a49b2025-02-03 19:18:32 +00002388/** Driver/device supports SPP A-MSDUs */
2389#define WPA_DRIVER_FLAGS2_SPP_AMSDU 0x0000000001000000ULL
2390/** Driver supports P2P V2 */
2391#define WPA_DRIVER_FLAGS2_P2P_FEATURE_V2 0x0000000002000000ULL
2392/** Driver supports P2P PCC mode */
2393#define WPA_DRIVER_FLAGS2_P2P_FEATURE_PCC_MODE 0x0000000004000000ULL
Hai Shalomb755a2a2020-04-23 21:49:02 -07002394 u64 flags2;
2395
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002396#define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \
2397 (drv_flags & WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE)
2398
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002399 unsigned int wmm_ac_supported:1;
2400
2401 unsigned int mac_addr_rand_scan_supported:1;
2402 unsigned int mac_addr_rand_sched_scan_supported:1;
2403
2404 /** Maximum number of supported active probe SSIDs */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002405 int max_scan_ssids;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002406
2407 /** Maximum number of supported active probe SSIDs for sched_scan */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002408 int max_sched_scan_ssids;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002409
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08002410 /** Maximum number of supported scan plans for scheduled scan */
2411 unsigned int max_sched_scan_plans;
2412
2413 /** Maximum interval in a scan plan. In seconds */
2414 u32 max_sched_scan_plan_interval;
2415
2416 /** Maximum number of iterations in a single scan plan */
2417 u32 max_sched_scan_plan_iterations;
2418
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002419 /** Whether sched_scan (offloaded scanning) is supported */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002420 int sched_scan_supported;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002421
2422 /** Maximum number of supported match sets for sched_scan */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002423 int max_match_sets;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002424
2425 /**
2426 * max_remain_on_chan - Maximum remain-on-channel duration in msec
2427 */
2428 unsigned int max_remain_on_chan;
2429
2430 /**
2431 * max_stations - Maximum number of associated stations the driver
2432 * supports in AP mode
2433 */
2434 unsigned int max_stations;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002435
2436 /**
2437 * probe_resp_offloads - Bitmap of supported protocols by the driver
2438 * for Probe Response offloading.
2439 */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002440/** Driver Probe Response offloading support for WPS ver. 1 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002441#define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS 0x00000001
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002442/** Driver Probe Response offloading support for WPS ver. 2 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002443#define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS2 0x00000002
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002444/** Driver Probe Response offloading support for P2P */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002445#define WPA_DRIVER_PROBE_RESP_OFFLOAD_P2P 0x00000004
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002446/** Driver Probe Response offloading support for IEEE 802.11u (Interworking) */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002447#define WPA_DRIVER_PROBE_RESP_OFFLOAD_INTERWORKING 0x00000008
2448 unsigned int probe_resp_offloads;
Dmitry Shmidt444d5672013-04-01 13:08:44 -07002449
Dmitry Shmidt8bae4132013-06-06 11:25:10 -07002450 unsigned int max_acl_mac_addrs;
2451
Dmitry Shmidt444d5672013-04-01 13:08:44 -07002452 /**
Dmitry Shmidtc2ebb4b2013-07-24 12:57:51 -07002453 * Number of supported concurrent channels
2454 */
2455 unsigned int num_multichan_concurrent;
2456
2457 /**
Dmitry Shmidt444d5672013-04-01 13:08:44 -07002458 * extended_capa - extended capabilities in driver/device
2459 *
2460 * Must be allocated and freed by driver and the pointers must be
2461 * valid for the lifetime of the driver, i.e., freed in deinit()
2462 */
2463 const u8 *extended_capa, *extended_capa_mask;
2464 unsigned int extended_capa_len;
Dmitry Shmidtb58836e2014-04-29 14:35:56 -07002465
2466 struct wowlan_triggers wowlan_triggers;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002467
2468/** Driver adds the DS Params Set IE in Probe Request frames */
2469#define WPA_DRIVER_FLAGS_DS_PARAM_SET_IE_IN_PROBES 0x00000001
2470/** Driver adds the WFA TPC IE in Probe Request frames */
2471#define WPA_DRIVER_FLAGS_WFA_TPC_IE_IN_PROBES 0x00000002
2472/** Driver handles quiet period requests */
2473#define WPA_DRIVER_FLAGS_QUIET 0x00000004
2474/**
2475 * Driver is capable of inserting the current TX power value into the body of
2476 * transmitted frames.
2477 * Background: Some Action frames include a TPC Report IE. This IE contains a
2478 * TX power field, which has to be updated by lower layers. One such Action
2479 * frame is Link Measurement Report (part of RRM). Another is TPC Report (part
2480 * of spectrum management). Note that this insertion takes place at a fixed
2481 * offset, namely the 6th byte in the Action frame body.
2482 */
2483#define WPA_DRIVER_FLAGS_TX_POWER_INSERTION 0x00000008
Dmitry Shmidt849734c2016-05-27 09:59:01 -07002484/**
2485 * Driver supports RRM. With this support, the driver will accept to use RRM in
2486 * (Re)Association Request frames, without supporting quiet period.
2487 */
2488#define WPA_DRIVER_FLAGS_SUPPORT_RRM 0x00000010
2489
Dmitry Shmidt29333592017-01-09 12:27:11 -08002490/** Driver supports setting the scan dwell time */
2491#define WPA_DRIVER_FLAGS_SUPPORT_SET_SCAN_DWELL 0x00000020
2492/** Driver supports Beacon Report Measurement */
2493#define WPA_DRIVER_FLAGS_SUPPORT_BEACON_REPORT 0x00000040
2494
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002495 u32 rrm_flags;
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002496
2497 /* Driver concurrency capabilities */
2498 unsigned int conc_capab;
2499 /* Maximum number of concurrent channels on 2.4 GHz */
2500 unsigned int max_conc_chan_2_4;
2501 /* Maximum number of concurrent channels on 5 GHz */
2502 unsigned int max_conc_chan_5_0;
2503
2504 /* Maximum number of supported CSA counters */
2505 u16 max_csa_counters;
Sunil Ravi89eba102022-09-13 21:04:37 -07002506
2507 /* Maximum number of supported AKM suites in commands */
2508 unsigned int max_num_akms;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002509
2510 /* Maximum number of interfaces supported for MBSSID advertisement */
2511 unsigned int mbssid_max_interfaces;
2512 /* Maximum profile periodicity for enhanced MBSSID advertisement */
2513 unsigned int ema_max_periodicity;
Sunil Ravi79e6c4f2025-01-04 00:47:06 +00002514
2515 /* Maximum number of bytes of extra IE(s) that can be added to Probe
2516 * Request frames */
2517 size_t max_probe_req_ie_len;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002518};
2519
2520
2521struct hostapd_data;
2522
Sunil Ravi036cec52023-03-29 11:35:17 -07002523enum guard_interval {
2524 GUARD_INTERVAL_0_4 = 1,
2525 GUARD_INTERVAL_0_8 = 2,
2526 GUARD_INTERVAL_1_6 = 3,
2527 GUARD_INTERVAL_3_2 = 4,
2528};
2529
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002530#define STA_DRV_DATA_TX_MCS BIT(0)
2531#define STA_DRV_DATA_RX_MCS BIT(1)
2532#define STA_DRV_DATA_TX_VHT_MCS BIT(2)
2533#define STA_DRV_DATA_RX_VHT_MCS BIT(3)
2534#define STA_DRV_DATA_TX_VHT_NSS BIT(4)
2535#define STA_DRV_DATA_RX_VHT_NSS BIT(5)
2536#define STA_DRV_DATA_TX_SHORT_GI BIT(6)
2537#define STA_DRV_DATA_RX_SHORT_GI BIT(7)
Roshan Pius3a1667e2018-07-03 15:17:14 -07002538#define STA_DRV_DATA_LAST_ACK_RSSI BIT(8)
Hai Shalomc1a21442022-02-04 13:43:00 -08002539#define STA_DRV_DATA_CONN_TIME BIT(9)
Sunil Ravi77d572f2023-01-17 23:58:31 +00002540#define STA_DRV_DATA_TX_HE_MCS BIT(10)
2541#define STA_DRV_DATA_RX_HE_MCS BIT(11)
2542#define STA_DRV_DATA_TX_HE_NSS BIT(12)
2543#define STA_DRV_DATA_RX_HE_NSS BIT(13)
Sunil Ravi036cec52023-03-29 11:35:17 -07002544#define STA_DRV_DATA_TX_HE_DCM BIT(14)
2545#define STA_DRV_DATA_RX_HE_DCM BIT(15)
2546#define STA_DRV_DATA_TX_HE_GI BIT(16)
2547#define STA_DRV_DATA_RX_HE_GI BIT(17)
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002548
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002549struct hostap_sta_driver_data {
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002550 unsigned long rx_packets, tx_packets;
2551 unsigned long long rx_bytes, tx_bytes;
Hai Shalom81f62d82019-07-22 12:10:00 -07002552 unsigned long long rx_airtime, tx_airtime;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002553 unsigned long long beacons_count;
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002554 int bytes_64bit; /* whether 64-bit byte counters are supported */
Sunil Ravi77d572f2023-01-17 23:58:31 +00002555 unsigned long current_tx_rate; /* in kbps */
2556 unsigned long current_rx_rate; /* in kbps */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002557 unsigned long inactive_msec;
Hai Shalomc1a21442022-02-04 13:43:00 -08002558 unsigned long connected_sec;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002559 unsigned long flags; /* bitfield of STA_DRV_DATA_* */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002560 unsigned long num_ps_buf_frames;
2561 unsigned long tx_retry_failed;
2562 unsigned long tx_retry_count;
Roshan Pius3a1667e2018-07-03 15:17:14 -07002563 s8 last_ack_rssi;
Hai Shalom81f62d82019-07-22 12:10:00 -07002564 unsigned long backlog_packets;
2565 unsigned long backlog_bytes;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002566 unsigned long fcs_error_count;
2567 unsigned long beacon_loss_count;
2568 unsigned long expected_throughput;
2569 unsigned long rx_drop_misc;
2570 unsigned long rx_mpdus;
2571 int signal; /* dBm; or -WPA_INVALID_NOISE */
2572 u8 rx_hemcs;
2573 u8 tx_hemcs;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002574 u8 rx_vhtmcs;
2575 u8 tx_vhtmcs;
2576 u8 rx_mcs;
2577 u8 tx_mcs;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002578 u8 rx_he_nss;
2579 u8 tx_he_nss;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002580 u8 rx_vht_nss;
2581 u8 tx_vht_nss;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002582 s8 avg_signal; /* dBm */
2583 s8 avg_beacon_signal; /* dBm */
2584 s8 avg_ack_signal; /* dBm */
Sunil Ravi036cec52023-03-29 11:35:17 -07002585 enum guard_interval rx_guard_interval, tx_guard_interval;
2586 u8 rx_dcm, tx_dcm;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002587};
2588
2589struct hostapd_sta_add_params {
2590 const u8 *addr;
2591 u16 aid;
2592 u16 capability;
2593 const u8 *supp_rates;
2594 size_t supp_rates_len;
2595 u16 listen_interval;
2596 const struct ieee80211_ht_capabilities *ht_capabilities;
Dmitry Shmidta54fa5f2013-01-15 13:53:35 -08002597 const struct ieee80211_vht_capabilities *vht_capabilities;
Dmitry Shmidtbd14a572014-02-18 10:33:49 -08002598 int vht_opmode_enabled;
2599 u8 vht_opmode;
Hai Shalom81f62d82019-07-22 12:10:00 -07002600 const struct ieee80211_he_capabilities *he_capab;
2601 size_t he_capab_len;
Hai Shalom4fbc08f2020-05-18 12:37:00 -07002602 const struct ieee80211_he_6ghz_band_cap *he_6ghz_capab;
Sunil Ravia04bd252022-05-02 22:54:18 -07002603 const struct ieee80211_eht_capabilities *eht_capab;
2604 size_t eht_capab_len;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002605 u32 flags; /* bitmask of WPA_STA_* flags */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002606 u32 flags_mask; /* unset bits in flags */
2607#ifdef CONFIG_MESH
2608 enum mesh_plink_state plink_state;
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07002609 u16 peer_aid;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002610#endif /* CONFIG_MESH */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002611 int set; /* Set STA parameters instead of add */
2612 u8 qosinfo;
Dmitry Shmidtf8623282013-02-20 14:34:59 -08002613 const u8 *ext_capab;
2614 size_t ext_capab_len;
Dmitry Shmidt344abd32014-01-14 13:17:00 -08002615 const u8 *supp_channels;
2616 size_t supp_channels_len;
2617 const u8 *supp_oper_classes;
2618 size_t supp_oper_classes_len;
Dmitry Shmidt849734c2016-05-27 09:59:01 -07002619 int support_p2p_ps;
Sunil Ravi036cec52023-03-29 11:35:17 -07002620
2621 bool mld_link_sta;
2622 s8 mld_link_id;
2623 const u8 *mld_link_addr;
Sunil Ravi79e6c4f2025-01-04 00:47:06 +00002624 u16 eml_cap;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002625};
2626
Dmitry Shmidt8bae4132013-06-06 11:25:10 -07002627struct mac_address {
2628 u8 addr[ETH_ALEN];
2629};
2630
2631struct hostapd_acl_params {
2632 u8 acl_policy;
2633 unsigned int num_mac_acl;
2634 struct mac_address mac_acl[0];
2635};
2636
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002637struct wpa_init_params {
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002638 void *global_priv;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002639 const u8 *bssid;
2640 const char *ifname;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002641 const char *driver_params;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002642 int use_pae_group_addr;
2643 char **bridge;
2644 size_t num_bridge;
2645
2646 u8 *own_addr; /* buffer for writing own MAC address */
2647};
2648
2649
2650struct wpa_bss_params {
2651 /** Interface name (for multi-SSID/VLAN support) */
2652 const char *ifname;
2653 /** Whether IEEE 802.1X or WPA/WPA2 is enabled */
2654 int enabled;
2655
2656 int wpa;
2657 int ieee802_1x;
2658 int wpa_group;
2659 int wpa_pairwise;
2660 int wpa_key_mgmt;
2661 int rsn_preauth;
2662 enum mfp_options ieee80211w;
2663};
2664
2665#define WPA_STA_AUTHORIZED BIT(0)
2666#define WPA_STA_WMM BIT(1)
2667#define WPA_STA_SHORT_PREAMBLE BIT(2)
2668#define WPA_STA_MFP BIT(3)
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08002669#define WPA_STA_TDLS_PEER BIT(4)
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002670#define WPA_STA_AUTHENTICATED BIT(5)
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08002671#define WPA_STA_ASSOCIATED BIT(6)
Sunil Ravi876a49b2025-02-03 19:18:32 +00002672#define WPA_STA_SPP_AMSDU BIT(7)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002673
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002674enum tdls_oper {
2675 TDLS_DISCOVERY_REQ,
2676 TDLS_SETUP,
2677 TDLS_TEARDOWN,
2678 TDLS_ENABLE_LINK,
2679 TDLS_DISABLE_LINK,
2680 TDLS_ENABLE,
2681 TDLS_DISABLE
2682};
2683
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07002684enum wnm_oper {
2685 WNM_SLEEP_ENTER_CONFIRM,
2686 WNM_SLEEP_ENTER_FAIL,
2687 WNM_SLEEP_EXIT_CONFIRM,
2688 WNM_SLEEP_EXIT_FAIL,
2689 WNM_SLEEP_TFS_REQ_IE_ADD, /* STA requests driver to add TFS req IE */
2690 WNM_SLEEP_TFS_REQ_IE_NONE, /* STA requests empty TFS req IE */
2691 WNM_SLEEP_TFS_REQ_IE_SET, /* AP requests driver to set TFS req IE for
2692 * a STA */
2693 WNM_SLEEP_TFS_RESP_IE_ADD, /* AP requests driver to add TFS resp IE
2694 * for a STA */
2695 WNM_SLEEP_TFS_RESP_IE_NONE, /* AP requests empty TFS resp IE */
2696 WNM_SLEEP_TFS_RESP_IE_SET, /* AP requests driver to set TFS resp IE
2697 * for a STA */
2698 WNM_SLEEP_TFS_IE_DEL /* AP delete the TFS IE */
2699};
2700
Roshan Pius3a1667e2018-07-03 15:17:14 -07002701/* enum smps_mode - SMPS mode definitions */
2702enum smps_mode {
2703 SMPS_AUTOMATIC,
2704 SMPS_OFF,
2705 SMPS_DYNAMIC,
2706 SMPS_STATIC,
2707
2708 /* Keep last */
2709 SMPS_INVALID,
2710};
2711
Hai Shalom74f70d42019-02-11 14:42:39 -08002712#define WPA_INVALID_NOISE 9999
Dmitry Shmidt34af3062013-07-11 10:46:32 -07002713
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002714/**
2715 * struct wpa_signal_info - Information about channel signal quality
Hai Shalom74f70d42019-02-11 14:42:39 -08002716 * @frequency: control frequency
2717 * @above_threshold: true if the above threshold was crossed
2718 * (relevant for a CQM event)
Sunil Ravi77d572f2023-01-17 23:58:31 +00002719 * @data: STA information
Hai Shalom74f70d42019-02-11 14:42:39 -08002720 * @current_noise: %WPA_INVALID_NOISE if not supported
Hai Shalom74f70d42019-02-11 14:42:39 -08002721 * @chanwidth: channel width
2722 * @center_frq1: center frequency for the first segment
2723 * @center_frq2: center frequency for the second segment (if relevant)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002724 */
2725struct wpa_signal_info {
2726 u32 frequency;
2727 int above_threshold;
Sunil Ravi77d572f2023-01-17 23:58:31 +00002728 struct hostap_sta_driver_data data;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002729 int current_noise;
Dmitry Shmidt34af3062013-07-11 10:46:32 -07002730 enum chan_width chanwidth;
2731 int center_frq1;
2732 int center_frq2;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002733};
2734
Sunil Ravi89eba102022-09-13 21:04:37 -07002735struct wpa_mlo_signal_info {
2736 u16 valid_links;
2737 struct wpa_signal_info links[MAX_NUM_MLD_LINKS];
2738};
2739
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07002740/**
Hai Shalom74f70d42019-02-11 14:42:39 -08002741 * struct wpa_channel_info - Information about the current channel
2742 * @frequency: Center frequency of the primary 20 MHz channel
2743 * @chanwidth: Width of the current operating channel
2744 * @sec_channel: Location of the secondary 20 MHz channel (either +1 or -1).
2745 * This field is only filled in when using a 40 MHz channel.
2746 * @center_frq1: Center frequency of frequency segment 0
2747 * @center_frq2: Center frequency of frequency segment 1 (for 80+80 channels)
2748 * @seg1_idx: Frequency segment 1 index when using a 80+80 channel. This is
2749 * derived from center_frq2 for convenience.
2750 */
2751struct wpa_channel_info {
2752 u32 frequency;
2753 enum chan_width chanwidth;
2754 int sec_channel;
2755 int center_frq1;
2756 int center_frq2;
2757 u8 seg1_idx;
2758};
2759
2760/**
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002761 * struct beacon_data - Beacon data
2762 * @head: Head portion of Beacon frame (before TIM IE)
2763 * @tail: Tail portion of Beacon frame (after TIM IE)
2764 * @beacon_ies: Extra information element(s) to add into Beacon frames or %NULL
2765 * @proberesp_ies: Extra information element(s) to add into Probe Response
2766 * frames or %NULL
2767 * @assocresp_ies: Extra information element(s) to add into (Re)Association
2768 * Response frames or %NULL
2769 * @probe_resp: Probe Response frame template
2770 * @head_len: Length of @head
2771 * @tail_len: Length of @tail
2772 * @beacon_ies_len: Length of beacon_ies in octets
2773 * @proberesp_ies_len: Length of proberesp_ies in octets
2774 * @proberesp_ies_len: Length of proberesp_ies in octets
2775 * @probe_resp_len: Length of probe response template (@probe_resp)
2776 */
2777struct beacon_data {
2778 u8 *head, *tail;
2779 u8 *beacon_ies;
2780 u8 *proberesp_ies;
2781 u8 *assocresp_ies;
2782 u8 *probe_resp;
2783
2784 size_t head_len, tail_len;
2785 size_t beacon_ies_len;
2786 size_t proberesp_ies_len;
2787 size_t assocresp_ies_len;
2788 size_t probe_resp_len;
2789};
2790
2791/**
2792 * struct csa_settings - Settings for channel switch command
2793 * @cs_count: Count in Beacon frames (TBTT) to perform the switch
2794 * @block_tx: 1 - block transmission for CSA period
2795 * @freq_params: Next channel frequency parameter
2796 * @beacon_csa: Beacon/probe resp/asooc resp info for CSA period
2797 * @beacon_after: Next beacon/probe resp/asooc resp info
2798 * @counter_offset_beacon: Offset to the count field in beacon's tail
2799 * @counter_offset_presp: Offset to the count field in probe resp.
Sunil Ravib0ac25f2024-07-12 01:42:03 +00002800 * @link_id: Link ID to determine the link for MLD; -1 for non-MLD
Sunil Ravi7f769292024-07-23 22:21:32 +00002801 * @ubpr: Unsolicited broadcast Probe Response frame data
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002802 */
2803struct csa_settings {
2804 u8 cs_count;
2805 u8 block_tx;
2806
2807 struct hostapd_freq_params freq_params;
2808 struct beacon_data beacon_csa;
2809 struct beacon_data beacon_after;
2810
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002811 u16 counter_offset_beacon[2];
2812 u16 counter_offset_presp[2];
Sunil Ravi036cec52023-03-29 11:35:17 -07002813
Sunil Ravib0ac25f2024-07-12 01:42:03 +00002814 int link_id;
Sunil Ravi7f769292024-07-23 22:21:32 +00002815
2816 struct unsol_bcast_probe_resp ubpr;
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002817};
2818
Sunil Ravia04bd252022-05-02 22:54:18 -07002819/**
2820 * struct cca_settings - Settings for color switch command
2821 * @cca_count: Count in Beacon frames (TBTT) to perform the switch
2822 * @cca_color: The new color that we are switching to
2823 * @beacon_cca: Beacon/Probe Response/(Re)Association Response frame info for
2824 * color switch period
2825 * @beacon_after: Next Beacon/Probe Response/(Re)Association Response frame info
2826 * @counter_offset_beacon: Offset to the count field in Beacon frame tail
2827 * @counter_offset_presp: Offset to the count field in Probe Response frame
Sunil Ravi7f769292024-07-23 22:21:32 +00002828 * @ubpr: Unsolicited broadcast Probe Response frame data
2829 * @link_id: If >= 0 indicates the link of the AP MLD to configure
Sunil Ravia04bd252022-05-02 22:54:18 -07002830 */
2831struct cca_settings {
2832 u8 cca_count;
2833 u8 cca_color;
2834
2835 struct beacon_data beacon_cca;
2836 struct beacon_data beacon_after;
2837
2838 u16 counter_offset_beacon;
2839 u16 counter_offset_presp;
Sunil Ravi7f769292024-07-23 22:21:32 +00002840
2841 struct unsol_bcast_probe_resp ubpr;
2842
2843 int link_id;
Sunil Ravia04bd252022-05-02 22:54:18 -07002844};
2845
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07002846/* TDLS peer capabilities for send_tdls_mgmt() */
2847enum tdls_peer_capability {
2848 TDLS_PEER_HT = BIT(0),
2849 TDLS_PEER_VHT = BIT(1),
2850 TDLS_PEER_WMM = BIT(2),
Hai Shalomc1a21442022-02-04 13:43:00 -08002851 TDLS_PEER_HE = BIT(3),
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07002852};
2853
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002854/* valid info in the wmm_params struct */
2855enum wmm_params_valid_info {
2856 WMM_PARAMS_UAPSD_QUEUES_INFO = BIT(0),
2857};
2858
2859/**
2860 * struct wmm_params - WMM parameterss configured for this association
2861 * @info_bitmap: Bitmap of valid wmm_params info; indicates what fields
2862 * of the struct contain valid information.
2863 * @uapsd_queues: Bitmap of ACs configured for uapsd (valid only if
2864 * %WMM_PARAMS_UAPSD_QUEUES_INFO is set)
2865 */
2866struct wmm_params {
2867 u8 info_bitmap;
2868 u8 uapsd_queues;
2869};
2870
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07002871#ifdef CONFIG_MACSEC
2872struct macsec_init_params {
Hai Shalome21d4e82020-04-29 16:34:06 -07002873 bool always_include_sci;
2874 bool use_es;
2875 bool use_scb;
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07002876};
2877#endif /* CONFIG_MACSEC */
2878
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002879enum drv_br_port_attr {
2880 DRV_BR_PORT_ATTR_PROXYARP,
2881 DRV_BR_PORT_ATTR_HAIRPIN_MODE,
Sunil Ravi036cec52023-03-29 11:35:17 -07002882 DRV_BR_PORT_ATTR_MCAST2UCAST,
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002883};
2884
2885enum drv_br_net_param {
2886 DRV_BR_NET_PARAM_GARP_ACCEPT,
Dmitry Shmidt83474442015-04-15 13:47:09 -07002887 DRV_BR_MULTICAST_SNOOPING,
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002888};
2889
2890struct drv_acs_params {
2891 /* Selected mode (HOSTAPD_MODE_*) */
2892 enum hostapd_hw_mode hw_mode;
2893
2894 /* Indicates whether HT is enabled */
2895 int ht_enabled;
2896
2897 /* Indicates whether HT40 is enabled */
2898 int ht40_enabled;
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07002899
2900 /* Indicates whether VHT is enabled */
2901 int vht_enabled;
2902
2903 /* Configured ACS channel width */
2904 u16 ch_width;
2905
Ahmed ElArabawy0ff61c52019-12-26 12:38:39 -08002906 /* ACS frequency list info */
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08002907 const int *freq_list;
Hai Shalomfdcde762020-04-02 11:19:20 -07002908
2909 /* Indicates whether EDMG is enabled */
2910 int edmg_enabled;
Sunil Ravia04bd252022-05-02 22:54:18 -07002911
2912 /* Indicates whether EHT is enabled */
2913 bool eht_enabled;
Sunil Ravib0ac25f2024-07-12 01:42:03 +00002914
2915 /* Indicates the link if MLO case; -1 otherwise */
2916 int link_id;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08002917};
2918
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002919struct wpa_bss_trans_info {
2920 u8 mbo_transition_reason;
2921 u8 n_candidates;
2922 u8 *bssid;
2923};
2924
2925struct wpa_bss_candidate_info {
2926 u8 num;
2927 struct candidate_list {
2928 u8 bssid[ETH_ALEN];
2929 u8 is_accept;
2930 u32 reject_reason;
2931 } *candidates;
2932};
2933
2934struct wpa_pmkid_params {
2935 const u8 *bssid;
2936 const u8 *ssid;
2937 size_t ssid_len;
2938 const u8 *fils_cache_id;
2939 const u8 *pmkid;
2940 const u8 *pmk;
2941 size_t pmk_len;
Hai Shalomfdcde762020-04-02 11:19:20 -07002942 u32 pmk_lifetime;
2943 u8 pmk_reauth_threshold;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002944};
2945
2946/* Mask used to specify which connection parameters have to be updated */
2947enum wpa_drv_update_connect_params_mask {
2948 WPA_DRV_UPDATE_ASSOC_IES = BIT(0),
2949 WPA_DRV_UPDATE_FILS_ERP_INFO = BIT(1),
2950 WPA_DRV_UPDATE_AUTH_TYPE = BIT(2),
Winnie Chen4138eec2022-11-10 16:32:53 +08002951#if defined(CONFIG_DRIVER_NL80211_BRCM) || defined(CONFIG_DRIVER_NL80211_SYNA)
Vinayak Yadawade62409f2022-01-20 12:32:07 +05302952 WPA_DRV_UPDATE_TD_POLICY = BIT(3),
Winnie Chen4138eec2022-11-10 16:32:53 +08002953#endif /* CONFIG_DRIVER_NL80211_BRCM || CONFIG_DRIVER_NL80211_SYNA */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07002954};
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07002955
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08002956/**
Roshan Pius3a1667e2018-07-03 15:17:14 -07002957 * struct external_auth - External authentication trigger parameters
2958 *
2959 * These are used across the external authentication request and event
2960 * interfaces.
2961 * @action: Action type / trigger for external authentication. Only significant
2962 * for the event interface.
2963 * @bssid: BSSID of the peer with which the authentication has to happen. Used
2964 * by both the request and event interface.
2965 * @ssid: SSID of the AP. Used by both the request and event interface.
2966 * @ssid_len: SSID length in octets.
2967 * @key_mgmt_suite: AKM suite of the respective authentication. Optional for
2968 * the request interface.
2969 * @status: Status code, %WLAN_STATUS_SUCCESS for successful authentication,
2970 * use %WLAN_STATUS_UNSPECIFIED_FAILURE if wpa_supplicant cannot give
2971 * the real status code for failures. Used only for the request interface
2972 * from user space to the driver.
Hai Shalom5f92bc92019-04-18 11:54:11 -07002973 * @pmkid: Generated PMKID as part of external auth exchange (e.g., SAE).
Sunil Ravi036cec52023-03-29 11:35:17 -07002974 * @mld_addr: AP's MLD address or %NULL if MLO is not used
Roshan Pius3a1667e2018-07-03 15:17:14 -07002975 */
2976struct external_auth {
2977 enum {
2978 EXT_AUTH_START,
2979 EXT_AUTH_ABORT,
2980 } action;
Hai Shalom5f92bc92019-04-18 11:54:11 -07002981 const u8 *bssid;
2982 const u8 *ssid;
Roshan Pius3a1667e2018-07-03 15:17:14 -07002983 size_t ssid_len;
2984 unsigned int key_mgmt_suite;
2985 u16 status;
Hai Shalom5f92bc92019-04-18 11:54:11 -07002986 const u8 *pmkid;
Sunil Ravi036cec52023-03-29 11:35:17 -07002987 const u8 *mld_addr;
Roshan Pius3a1667e2018-07-03 15:17:14 -07002988};
2989
Sunil Ravi89eba102022-09-13 21:04:37 -07002990#define WPAS_MAX_PASN_PEERS 10
2991
2992enum pasn_status {
2993 PASN_STATUS_SUCCESS = 0,
2994 PASN_STATUS_FAILURE = 1,
2995};
2996
2997/**
2998 * struct pasn_peer - PASN peer parameters
2999 *
3000 * Used to process the PASN authentication event from the driver to
3001 * userspace and to send a response back.
3002 * @own_addr: Own MAC address specified by the driver to use for PASN
3003 * handshake.
3004 * @peer_addr: MAC address of the peer with which PASN authentication is to be
3005 * performed.
3006 * @network_id: Unique id for the network.
3007 * This identifier is used as a unique identifier for each network
3008 * block when using the control interface. Each network is allocated an
3009 * id when it is being created, either when reading the configuration
3010 * file or when a new network is added through the control interface.
3011 * @akmp: Authentication key management protocol type supported.
3012 * @cipher: Cipher suite.
3013 * @group: Finite cyclic group. Default group used is 19 (ECC).
3014 * @ltf_keyseed_required: Indicates whether LTF keyseed generation is required
3015 * @status: PASN response status, %PASN_STATUS_SUCCESS for successful
3016 * authentication, use %PASN_STATUS_FAILURE if PASN authentication
3017 * fails or if wpa_supplicant fails to set the security ranging context to
3018 * the driver
3019 */
3020struct pasn_peer {
3021 u8 own_addr[ETH_ALEN];
3022 u8 peer_addr[ETH_ALEN];
3023 int network_id;
3024 int akmp;
3025 int cipher;
3026 int group;
3027 bool ltf_keyseed_required;
3028 enum pasn_status status;
3029};
3030
3031/**
3032 * struct pasn_auth - PASN authentication trigger parameters
3033 *
3034 * These are used across the PASN authentication event from the driver to
3035 * userspace and to send a response to it.
3036 * @action: Action type. Only significant for the event interface.
3037 * @num_peers: The number of peers for which the PASN handshake is requested
3038 * for.
3039 * @peer: Holds the peer details.
3040 */
3041struct pasn_auth {
3042 enum {
3043 PASN_ACTION_AUTH,
3044 PASN_ACTION_DELETE_SECURE_RANGING_CONTEXT,
3045 } action;
3046 unsigned int num_peers;
3047 struct pasn_peer peer[WPAS_MAX_PASN_PEERS];
3048};
3049
3050/**
3051 * struct secure_ranging_params - Parameters required to set secure ranging
3052 * context for a peer.
3053 *
3054 * @action: Add or delete a security context to the driver.
3055 * @own_addr: Own MAC address used during key derivation.
3056 * @peer_addr: Address of the peer device.
3057 * @cipher: Cipher suite.
3058 * @tk_len: Length of temporal key.
3059 * @tk: Temporal key buffer.
3060 * @ltf_keyseed_len: Length of LTF keyseed.
3061 * @ltf_keyeed: LTF keyseed buffer.
3062 */
3063struct secure_ranging_params {
3064 u32 action;
3065 const u8 *own_addr;
3066 const u8 *peer_addr;
3067 u32 cipher;
3068 u8 tk_len;
3069 const u8 *tk;
3070 u8 ltf_keyseed_len;
3071 const u8 *ltf_keyseed;
3072};
3073
Hai Shalom60840252021-02-19 19:02:11 -08003074/* enum nested_attr - Used to specify if subcommand uses nested attributes */
3075enum nested_attr {
3076 NESTED_ATTR_NOT_USED = 0,
3077 NESTED_ATTR_USED = 1,
3078 NESTED_ATTR_UNSPECIFIED = 2,
3079};
3080
Sunil8cd6f4d2022-06-28 18:40:46 +00003081/* Preferred channel list information */
3082
3083/* GO role */
3084#define WEIGHTED_PCL_GO BIT(0)
3085/* P2P Client role */
3086#define WEIGHTED_PCL_CLI BIT(1)
3087/* Must be considered for operating channel */
3088#define WEIGHTED_PCL_MUST_CONSIDER BIT(2)
3089/* Should be excluded in GO negotiation */
3090#define WEIGHTED_PCL_EXCLUDE BIT(3)
3091
3092/* Preferred channel list with weight */
3093struct weighted_pcl {
3094 u32 freq; /* MHz */
3095 u8 weight;
3096 u32 flag; /* bitmap for WEIGHTED_PCL_* */
3097};
3098
Sunil Ravi89eba102022-09-13 21:04:37 -07003099struct driver_sta_mlo_info {
Sunil Ravi640215c2023-06-28 23:08:09 +00003100 bool default_map;
Sunil Ravi77d572f2023-01-17 23:58:31 +00003101 u16 req_links; /* bitmap of requested link IDs */
3102 u16 valid_links; /* bitmap of accepted link IDs */
3103 u8 assoc_link_id;
Sunil Ravi89eba102022-09-13 21:04:37 -07003104 u8 ap_mld_addr[ETH_ALEN];
3105 struct {
3106 u8 addr[ETH_ALEN];
3107 u8 bssid[ETH_ALEN];
3108 unsigned int freq;
Sunil Ravi640215c2023-06-28 23:08:09 +00003109 struct t2lm_mapping t2lmap;
Sunil Ravi89eba102022-09-13 21:04:37 -07003110 } links[MAX_NUM_MLD_LINKS];
3111};
3112
Roshan Pius3a1667e2018-07-03 15:17:14 -07003113/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003114 * struct wpa_driver_ops - Driver interface API definition
3115 *
3116 * This structure defines the API that each driver interface needs to implement
3117 * for core wpa_supplicant code. All driver specific functionality is captured
3118 * in this wrapper.
3119 */
3120struct wpa_driver_ops {
3121 /** Name of the driver interface */
3122 const char *name;
3123 /** One line description of the driver interface */
3124 const char *desc;
3125
3126 /**
3127 * get_bssid - Get the current BSSID
3128 * @priv: private driver interface data
3129 * @bssid: buffer for BSSID (ETH_ALEN = 6 bytes)
3130 *
3131 * Returns: 0 on success, -1 on failure
3132 *
3133 * Query kernel driver for the current BSSID and copy it to bssid.
3134 * Setting bssid to 00:00:00:00:00:00 is recommended if the STA is not
3135 * associated.
3136 */
3137 int (*get_bssid)(void *priv, u8 *bssid);
3138
3139 /**
3140 * get_ssid - Get the current SSID
3141 * @priv: private driver interface data
3142 * @ssid: buffer for SSID (at least 32 bytes)
3143 *
3144 * Returns: Length of the SSID on success, -1 on failure
3145 *
3146 * Query kernel driver for the current SSID and copy it to ssid.
3147 * Returning zero is recommended if the STA is not associated.
3148 *
3149 * Note: SSID is an array of octets, i.e., it is not nul terminated and
3150 * can, at least in theory, contain control characters (including nul)
3151 * and as such, should be processed as binary data, not a printable
3152 * string.
3153 */
3154 int (*get_ssid)(void *priv, u8 *ssid);
3155
3156 /**
3157 * set_key - Configure encryption key
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003158 * @priv: private driver interface data
Hai Shalomfdcde762020-04-02 11:19:20 -07003159 * @params: Key parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003160 * Returns: 0 on success, -1 on failure
3161 *
3162 * Configure the given key for the kernel driver. If the driver
3163 * supports separate individual keys (4 default keys + 1 individual),
3164 * addr can be used to determine whether the key is default or
3165 * individual. If only 4 keys are supported, the default key with key
3166 * index 0 is used as the individual key. STA must be configured to use
3167 * it as the default Tx key (set_tx is set) and accept Rx for all the
3168 * key indexes. In most cases, WPA uses only key indexes 1 and 2 for
3169 * broadcast keys, so key index 0 is available for this kind of
3170 * configuration.
3171 *
Sunil Ravi876a49b2025-02-03 19:18:32 +00003172 * For pairwise keys, there are potential race conditions between
3173 * enabling a new TK on each end of the connection and sending the first
3174 * protected frame. Drivers have multiple options on which style of key
3175 * configuration to support with the simplest option not providing any
3176 * protection for the race condition while the more complex options do
3177 * provide partial or full protection.
3178 *
3179 * Option 1: Do not support extended key IDs (i.e., use only Key ID 0
3180 * for pairwise keys) and do not support configuration of the next TK
3181 * as an alternative RX key. This provides no protection, but is simple
3182 * to support. The driver needs to ignore set_key() calls with
3183 * KEY_FLAG_NEXT.
3184 *
3185 * Option 2: Do not support extended key IDs (i.e., use only Key ID 0
3186 * for pairwise keys), but support configuration of the next TK as an
3187 * alternative RX key for the initial 4-way handshake. This provides
3188 * protection for the initial key setup at the beginning of an
3189 * association. The driver needs to configure the initial TK for RX-only
3190 * when receiving a set_key() call with KEY_FLAG_NEXT. This RX-only key
3191 * is ready for receiving protected Data frames from the peer before the
3192 * local device has enabled the key for TX. Unprotected EAPOL frames
3193 * need to be allowed even when this next TK is configured as RX-only
3194 * key. The same key is then set with KEY_FLAG_PAIRWISE_RX_TX to enable
3195 * its use for both TX and RX. The driver ignores set_key() calls with
3196 * KEY_FLAG_NEXT when a TK has been configured. When fully enabling the
3197 * TK for TX and RX, the RX counters associated with the TK must not be
3198 * cleared.
3199 *
3200 * Option 3: Same as option 2, but the driver supports multiple RX keys
3201 * in parallel during PTK rekeying. The driver processed set_key() calls
3202 * with KEY_FLAG_NEXT also when a TK has been configured. At that point
3203 * in the rekeying sequence the driver uses the previously configured TK
3204 * for TX and decrypts received frames with either the previously
3205 * configured TK or the next TK (RX-only).
3206 *
3207 * Option 4: The driver supports extended Key IDs and they are used for
3208 * an association but does not support KEY_FLAG_NEXT (options 2 and 3).
3209 * The next TK is configured as RX-only with KEY_FLAG_PAIRWISE_RX and
3210 * it is enabled for TX and RX with KEY_FLAG_PAIRWISE_RX_TX_MODIFY. When
3211 * extended key ID is not used for an association, the driver behaves
3212 * like in option 1.
3213 *
3214 * Option 5 and 6: Like option 4 but with support for KEY_FLAG_NEXT as
3215 * described above for options 2 and 3, respectively. Option 4 is used
3216 * for cases where extended key IDs are used for an association. Option
3217 * 2 or 3 is used for cases where extended key IDs are not used.
3218 *
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003219 * Please note that TKIP keys include separate TX and RX MIC keys and
3220 * some drivers may expect them in different order than wpa_supplicant
3221 * is using. If the TX/RX keys are swapped, all TKIP encrypted packets
3222 * will trigger Michael MIC errors. This can be fixed by changing the
Sunil Ravia04bd252022-05-02 22:54:18 -07003223 * order of MIC keys by swapping the bytes 16..23 and 24..31 of the key
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003224 * in driver_*.c set_key() implementation, see driver_ndis.c for an
3225 * example on how this can be done.
3226 */
Hai Shalomfdcde762020-04-02 11:19:20 -07003227 int (*set_key)(void *priv, struct wpa_driver_set_key_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003228
3229 /**
3230 * init - Initialize driver interface
3231 * @ctx: context to be used when calling wpa_supplicant functions,
3232 * e.g., wpa_supplicant_event()
3233 * @ifname: interface name, e.g., wlan0
3234 *
3235 * Returns: Pointer to private data, %NULL on failure
3236 *
3237 * Initialize driver interface, including event processing for kernel
3238 * driver events (e.g., associated, scan results, Michael MIC failure).
3239 * This function can allocate a private configuration data area for
3240 * @ctx, file descriptor, interface name, etc. information that may be
3241 * needed in future driver operations. If this is not used, non-NULL
3242 * value will need to be returned because %NULL is used to indicate
3243 * failure. The returned value will be used as 'void *priv' data for
3244 * all other driver_ops functions.
3245 *
3246 * The main event loop (eloop.c) of wpa_supplicant can be used to
3247 * register callback for read sockets (eloop_register_read_sock()).
3248 *
3249 * See below for more information about events and
3250 * wpa_supplicant_event() function.
3251 */
3252 void * (*init)(void *ctx, const char *ifname);
3253
3254 /**
3255 * deinit - Deinitialize driver interface
3256 * @priv: private driver interface data from init()
3257 *
3258 * Shut down driver interface and processing of driver events. Free
3259 * private data buffer if one was allocated in init() handler.
3260 */
3261 void (*deinit)(void *priv);
3262
3263 /**
3264 * set_param - Set driver configuration parameters
3265 * @priv: private driver interface data from init()
3266 * @param: driver specific configuration parameters
3267 *
3268 * Returns: 0 on success, -1 on failure
3269 *
3270 * Optional handler for notifying driver interface about configuration
3271 * parameters (driver_param).
3272 */
3273 int (*set_param)(void *priv, const char *param);
3274
3275 /**
3276 * set_countermeasures - Enable/disable TKIP countermeasures
3277 * @priv: private driver interface data
3278 * @enabled: 1 = countermeasures enabled, 0 = disabled
3279 *
3280 * Returns: 0 on success, -1 on failure
3281 *
3282 * Configure TKIP countermeasures. When these are enabled, the driver
3283 * should drop all received and queued frames that are using TKIP.
3284 */
3285 int (*set_countermeasures)(void *priv, int enabled);
3286
3287 /**
3288 * deauthenticate - Request driver to deauthenticate
3289 * @priv: private driver interface data
3290 * @addr: peer address (BSSID of the AP)
3291 * @reason_code: 16-bit reason code to be sent in the deauthentication
3292 * frame
3293 *
3294 * Returns: 0 on success, -1 on failure
3295 */
Hai Shalom81f62d82019-07-22 12:10:00 -07003296 int (*deauthenticate)(void *priv, const u8 *addr, u16 reason_code);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003297
3298 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003299 * associate - Request driver to associate
3300 * @priv: private driver interface data
3301 * @params: association parameters
3302 *
3303 * Returns: 0 on success, -1 on failure
3304 */
3305 int (*associate)(void *priv,
3306 struct wpa_driver_associate_params *params);
3307
3308 /**
3309 * add_pmkid - Add PMKSA cache entry to the driver
3310 * @priv: private driver interface data
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003311 * @params: PMKSA parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003312 *
3313 * Returns: 0 on success, -1 on failure
3314 *
3315 * This function is called when a new PMK is received, as a result of
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003316 * either normal authentication or RSN pre-authentication. The PMKSA
3317 * parameters are either a set of bssid, pmkid, and pmk; or a set of
3318 * ssid, fils_cache_id, pmkid, and pmk.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003319 *
3320 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
3321 * associate(), add_pmkid() can be used to add new PMKSA cache entries
3322 * in the driver. If the driver uses wpa_ie from wpa_supplicant, this
3323 * driver_ops function does not need to be implemented. Likewise, if
3324 * the driver does not support WPA, this function is not needed.
3325 */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003326 int (*add_pmkid)(void *priv, struct wpa_pmkid_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003327
3328 /**
3329 * remove_pmkid - Remove PMKSA cache entry to the driver
3330 * @priv: private driver interface data
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003331 * @params: PMKSA parameters
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003332 *
3333 * Returns: 0 on success, -1 on failure
3334 *
3335 * This function is called when the supplicant drops a PMKSA cache
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003336 * entry for any reason. The PMKSA parameters are either a set of
3337 * bssid and pmkid; or a set of ssid, fils_cache_id, and pmkid.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003338 *
3339 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
3340 * associate(), remove_pmkid() can be used to synchronize PMKSA caches
3341 * between the driver and wpa_supplicant. If the driver uses wpa_ie
3342 * from wpa_supplicant, this driver_ops function does not need to be
3343 * implemented. Likewise, if the driver does not support WPA, this
3344 * function is not needed.
3345 */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003346 int (*remove_pmkid)(void *priv, struct wpa_pmkid_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003347
3348 /**
3349 * flush_pmkid - Flush PMKSA cache
3350 * @priv: private driver interface data
3351 *
3352 * Returns: 0 on success, -1 on failure
3353 *
3354 * This function is called when the supplicant drops all PMKSA cache
3355 * entries for any reason.
3356 *
3357 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
3358 * associate(), remove_pmkid() can be used to synchronize PMKSA caches
3359 * between the driver and wpa_supplicant. If the driver uses wpa_ie
3360 * from wpa_supplicant, this driver_ops function does not need to be
3361 * implemented. Likewise, if the driver does not support WPA, this
3362 * function is not needed.
3363 */
3364 int (*flush_pmkid)(void *priv);
3365
3366 /**
3367 * get_capa - Get driver capabilities
3368 * @priv: private driver interface data
3369 *
3370 * Returns: 0 on success, -1 on failure
3371 *
3372 * Get driver/firmware/hardware capabilities.
3373 */
3374 int (*get_capa)(void *priv, struct wpa_driver_capa *capa);
3375
3376 /**
3377 * poll - Poll driver for association information
3378 * @priv: private driver interface data
3379 *
Sunil Ravi77d572f2023-01-17 23:58:31 +00003380 * This is an optional callback that can be used when the driver does
3381 * not provide event mechanism for association events. This is called
3382 * when receiving WPA/RSN EAPOL-Key messages that require association
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003383 * information. The driver interface is supposed to generate associnfo
3384 * event before returning from this callback function. In addition, the
3385 * driver interface should generate an association event after having
3386 * sent out associnfo.
3387 */
3388 void (*poll)(void *priv);
3389
3390 /**
Dmitry Shmidte4663042016-04-04 10:07:49 -07003391 * get_ifindex - Get interface index
3392 * @priv: private driver interface data
3393 *
3394 * Returns: Interface index
3395 */
3396 unsigned int (*get_ifindex)(void *priv);
3397
3398 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003399 * get_ifname - Get interface name
3400 * @priv: private driver interface data
3401 *
3402 * Returns: Pointer to the interface name. This can differ from the
3403 * interface name used in init() call. Init() is called first.
3404 *
3405 * This optional function can be used to allow the driver interface to
3406 * replace the interface name with something else, e.g., based on an
3407 * interface mapping from a more descriptive name.
3408 */
3409 const char * (*get_ifname)(void *priv);
3410
3411 /**
3412 * get_mac_addr - Get own MAC address
3413 * @priv: private driver interface data
3414 *
3415 * Returns: Pointer to own MAC address or %NULL on failure
3416 *
3417 * This optional function can be used to get the own MAC address of the
3418 * device from the driver interface code. This is only needed if the
3419 * l2_packet implementation for the OS does not provide easy access to
3420 * a MAC address. */
3421 const u8 * (*get_mac_addr)(void *priv);
3422
3423 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003424 * set_operstate - Sets device operating state to DORMANT or UP
3425 * @priv: private driver interface data
3426 * @state: 0 = dormant, 1 = up
3427 * Returns: 0 on success, -1 on failure
3428 *
3429 * This is an optional function that can be used on operating systems
3430 * that support a concept of controlling network device state from user
3431 * space applications. This function, if set, gets called with
3432 * state = 1 when authentication has been completed and with state = 0
3433 * when connection is lost.
3434 */
3435 int (*set_operstate)(void *priv, int state);
3436
3437 /**
3438 * mlme_setprotection - MLME-SETPROTECTION.request primitive
3439 * @priv: Private driver interface data
3440 * @addr: Address of the station for which to set protection (may be
3441 * %NULL for group keys)
3442 * @protect_type: MLME_SETPROTECTION_PROTECT_TYPE_*
3443 * @key_type: MLME_SETPROTECTION_KEY_TYPE_*
3444 * Returns: 0 on success, -1 on failure
3445 *
3446 * This is an optional function that can be used to set the driver to
3447 * require protection for Tx and/or Rx frames. This uses the layer
3448 * interface defined in IEEE 802.11i-2004 clause 10.3.22.1
3449 * (MLME-SETPROTECTION.request). Many drivers do not use explicit
3450 * set protection operation; instead, they set protection implicitly
3451 * based on configured keys.
3452 */
3453 int (*mlme_setprotection)(void *priv, const u8 *addr, int protect_type,
3454 int key_type);
3455
3456 /**
3457 * get_hw_feature_data - Get hardware support data (channels and rates)
3458 * @priv: Private driver interface data
3459 * @num_modes: Variable for returning the number of returned modes
3460 * flags: Variable for returning hardware feature flags
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003461 * @dfs: Variable for returning DFS region (HOSTAPD_DFS_REGION_*)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003462 * Returns: Pointer to allocated hardware data on success or %NULL on
3463 * failure. Caller is responsible for freeing this.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003464 */
3465 struct hostapd_hw_modes * (*get_hw_feature_data)(void *priv,
3466 u16 *num_modes,
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07003467 u16 *flags, u8 *dfs);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003468
3469 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003470 * send_mlme - Send management frame from MLME
3471 * @priv: Private driver interface data
3472 * @data: IEEE 802.11 management frame with IEEE 802.11 header
3473 * @data_len: Size of the management frame
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003474 * @noack: Do not wait for this frame to be acked (disable retries)
Dmitry Shmidta3dc3092015-06-23 11:21:28 -07003475 * @freq: Frequency (in MHz) to send the frame on, or 0 to let the
3476 * driver decide
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08003477 * @csa_offs: Array of CSA offsets or %NULL
3478 * @csa_offs_len: Number of elements in csa_offs
Hai Shalomfdcde762020-04-02 11:19:20 -07003479 * @no_encrypt: Do not encrypt frame even if appropriate key exists
3480 * (used only for testing purposes)
3481 * @wait: Time to wait off-channel for a response (in ms), or zero
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003482 * @link_id: Link ID to use for TX, or -1 if not set
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003483 * Returns: 0 on success, -1 on failure
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003484 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003485 int (*send_mlme)(void *priv, const u8 *data, size_t data_len,
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08003486 int noack, unsigned int freq, const u16 *csa_offs,
Hai Shalomfdcde762020-04-02 11:19:20 -07003487 size_t csa_offs_len, int no_encrypt,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003488 unsigned int wait, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003489
3490 /**
3491 * update_ft_ies - Update FT (IEEE 802.11r) IEs
3492 * @priv: Private driver interface data
3493 * @md: Mobility domain (2 octets) (also included inside ies)
3494 * @ies: FT IEs (MDIE, FTIE, ...) or %NULL to remove IEs
3495 * @ies_len: Length of FT IEs in bytes
3496 * Returns: 0 on success, -1 on failure
3497 *
3498 * The supplicant uses this callback to let the driver know that keying
3499 * material for FT is available and that the driver can use the
3500 * provided IEs in the next message in FT authentication sequence.
3501 *
3502 * This function is only needed for driver that support IEEE 802.11r
3503 * (Fast BSS Transition).
3504 */
3505 int (*update_ft_ies)(void *priv, const u8 *md, const u8 *ies,
3506 size_t ies_len);
3507
3508 /**
Sunil Ravi99c035e2024-07-12 01:42:03 +00003509 * get_scan_results - Fetch the latest scan results
3510 * @priv: Private driver interface data
3511 * @bssid: Return results only for the specified BSSID, %NULL for all
3512 *
3513 * Returns: Allocated buffer of scan results (caller is responsible for
3514 * freeing the data structure) on success, NULL on failure
3515 */
3516 struct wpa_scan_results * (*get_scan_results)(void *priv,
3517 const u8 *bssid);
3518
3519 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003520 * get_scan_results2 - Fetch the latest scan results
3521 * @priv: private driver interface data
3522 *
3523 * Returns: Allocated buffer of scan results (caller is responsible for
3524 * freeing the data structure) on success, NULL on failure
3525 */
3526 struct wpa_scan_results * (*get_scan_results2)(void *priv);
3527
3528 /**
3529 * set_country - Set country
3530 * @priv: Private driver interface data
3531 * @alpha2: country to which to switch to
3532 * Returns: 0 on success, -1 on failure
3533 *
3534 * This function is for drivers which support some form
3535 * of setting a regulatory domain.
3536 */
3537 int (*set_country)(void *priv, const char *alpha2);
3538
3539 /**
Dmitry Shmidtcce06662013-11-04 18:44:24 -08003540 * get_country - Get country
3541 * @priv: Private driver interface data
3542 * @alpha2: Buffer for returning country code (at least 3 octets)
3543 * Returns: 0 on success, -1 on failure
3544 */
3545 int (*get_country)(void *priv, char *alpha2);
3546
3547 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003548 * global_init - Global driver initialization
Dmitry Shmidte4663042016-04-04 10:07:49 -07003549 * @ctx: wpa_global pointer
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003550 * Returns: Pointer to private data (global), %NULL on failure
3551 *
3552 * This optional function is called to initialize the driver wrapper
3553 * for global data, i.e., data that applies to all interfaces. If this
3554 * function is implemented, global_deinit() will also need to be
3555 * implemented to free the private data. The driver will also likely
3556 * use init2() function instead of init() to get the pointer to global
3557 * data available to per-interface initializer.
3558 */
Dmitry Shmidte4663042016-04-04 10:07:49 -07003559 void * (*global_init)(void *ctx);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003560
3561 /**
3562 * global_deinit - Global driver deinitialization
3563 * @priv: private driver global data from global_init()
3564 *
3565 * Terminate any global driver related functionality and free the
3566 * global data structure.
3567 */
3568 void (*global_deinit)(void *priv);
3569
3570 /**
3571 * init2 - Initialize driver interface (with global data)
3572 * @ctx: context to be used when calling wpa_supplicant functions,
3573 * e.g., wpa_supplicant_event()
3574 * @ifname: interface name, e.g., wlan0
3575 * @global_priv: private driver global data from global_init()
Sunil Ravi79e6c4f2025-01-04 00:47:06 +00003576 * @p2p_mode: P2P mode for a GO (not applicable for other interface
3577 * types)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003578 * Returns: Pointer to private data, %NULL on failure
3579 *
3580 * This function can be used instead of init() if the driver wrapper
3581 * uses global data.
3582 */
Sunil Ravi79e6c4f2025-01-04 00:47:06 +00003583 void * (*init2)(void *ctx, const char *ifname, void *global_priv,
3584 enum wpa_p2p_mode p2p_mode);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003585
3586 /**
3587 * get_interfaces - Get information about available interfaces
3588 * @global_priv: private driver global data from global_init()
3589 * Returns: Allocated buffer of interface information (caller is
3590 * responsible for freeing the data structure) on success, NULL on
3591 * failure
3592 */
3593 struct wpa_interface_info * (*get_interfaces)(void *global_priv);
3594
3595 /**
3596 * scan2 - Request the driver to initiate scan
3597 * @priv: private driver interface data
3598 * @params: Scan parameters
3599 *
3600 * Returns: 0 on success, -1 on failure
3601 *
3602 * Once the scan results are ready, the driver should report scan
3603 * results event for wpa_supplicant which will eventually request the
3604 * results with wpa_driver_get_scan_results2().
3605 */
3606 int (*scan2)(void *priv, struct wpa_driver_scan_params *params);
3607
3608 /**
3609 * authenticate - Request driver to authenticate
3610 * @priv: private driver interface data
3611 * @params: authentication parameters
3612 * Returns: 0 on success, -1 on failure
3613 *
3614 * This is an optional function that can be used with drivers that
3615 * support separate authentication and association steps, i.e., when
3616 * wpa_supplicant can act as the SME. If not implemented, associate()
3617 * function is expected to take care of IEEE 802.11 authentication,
3618 * too.
3619 */
3620 int (*authenticate)(void *priv,
3621 struct wpa_driver_auth_params *params);
3622
3623 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003624 * set_ap - Set Beacon and Probe Response information for AP mode
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003625 * @priv: Private driver interface data
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003626 * @params: Parameters to use in AP mode
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003627 *
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003628 * This function is used to configure Beacon template and/or extra IEs
3629 * to add for Beacon and Probe Response frames for the driver in
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003630 * AP mode. The driver is responsible for building the full Beacon
3631 * frame by concatenating the head part with TIM IE generated by the
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003632 * driver/firmware and finishing with the tail part. Depending on the
3633 * driver architectue, this can be done either by using the full
3634 * template or the set of additional IEs (e.g., WPS and P2P IE).
3635 * Similarly, Probe Response processing depends on the driver design.
3636 * If the driver (or firmware) takes care of replying to Probe Request
3637 * frames, the extra IEs provided here needs to be added to the Probe
3638 * Response frames.
3639 *
3640 * Returns: 0 on success, -1 on failure
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003641 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003642 int (*set_ap)(void *priv, struct wpa_driver_ap_params *params);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003643
3644 /**
Dmitry Shmidt8bae4132013-06-06 11:25:10 -07003645 * set_acl - Set ACL in AP mode
3646 * @priv: Private driver interface data
3647 * @params: Parameters to configure ACL
3648 * Returns: 0 on success, -1 on failure
3649 *
3650 * This is used only for the drivers which support MAC address ACL.
3651 */
3652 int (*set_acl)(void *priv, struct hostapd_acl_params *params);
3653
3654 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003655 * hapd_init - Initialize driver interface (hostapd only)
3656 * @hapd: Pointer to hostapd context
3657 * @params: Configuration for the driver wrapper
3658 * Returns: Pointer to private data, %NULL on failure
3659 *
3660 * This function is used instead of init() or init2() when the driver
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003661 * wrapper is used with hostapd.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003662 */
3663 void * (*hapd_init)(struct hostapd_data *hapd,
3664 struct wpa_init_params *params);
3665
3666 /**
3667 * hapd_deinit - Deinitialize driver interface (hostapd only)
3668 * @priv: Private driver interface data from hapd_init()
3669 */
3670 void (*hapd_deinit)(void *priv);
3671
3672 /**
3673 * set_ieee8021x - Enable/disable IEEE 802.1X support (AP only)
3674 * @priv: Private driver interface data
3675 * @params: BSS parameters
3676 * Returns: 0 on success, -1 on failure
3677 *
3678 * This is an optional function to configure the kernel driver to
3679 * enable/disable IEEE 802.1X support and set WPA/WPA2 parameters. This
3680 * can be left undefined (set to %NULL) if IEEE 802.1X support is
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003681 * always enabled and the driver uses set_ap() to set WPA/RSN IE
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003682 * for Beacon frames.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003683 *
3684 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003685 */
3686 int (*set_ieee8021x)(void *priv, struct wpa_bss_params *params);
3687
3688 /**
3689 * set_privacy - Enable/disable privacy (AP only)
3690 * @priv: Private driver interface data
3691 * @enabled: 1 = privacy enabled, 0 = disabled
3692 * Returns: 0 on success, -1 on failure
3693 *
3694 * This is an optional function to configure privacy field in the
3695 * kernel driver for Beacon frames. This can be left undefined (set to
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003696 * %NULL) if the driver uses the Beacon template from set_ap().
3697 *
3698 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003699 */
3700 int (*set_privacy)(void *priv, int enabled);
3701
3702 /**
3703 * get_seqnum - Fetch the current TSC/packet number (AP only)
3704 * @ifname: The interface name (main or virtual)
3705 * @priv: Private driver interface data
3706 * @addr: MAC address of the station or %NULL for group keys
3707 * @idx: Key index
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003708 * @link_id: Link ID for a group key, or -1 if not set
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003709 * @seq: Buffer for returning the latest used TSC/packet number
3710 * Returns: 0 on success, -1 on failure
3711 *
3712 * This function is used to fetch the last used TSC/packet number for
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07003713 * a TKIP, CCMP, GCMP, or BIP/IGTK key. It is mainly used with group
3714 * keys, so there is no strict requirement on implementing support for
3715 * unicast keys (i.e., addr != %NULL).
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003716 */
3717 int (*get_seqnum)(const char *ifname, void *priv, const u8 *addr,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003718 int idx, int link_id, u8 *seq);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003719
3720 /**
3721 * flush - Flush all association stations (AP only)
3722 * @priv: Private driver interface data
Sunil Ravi7f769292024-07-23 22:21:32 +00003723 * @link_id: In case of MLO, valid link ID on which all associated
3724 * stations will be flushed, -1 otherwise.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003725 * Returns: 0 on success, -1 on failure
3726 *
3727 * This function requests the driver to disassociate all associated
3728 * stations. This function does not need to be implemented if the
3729 * driver does not process association frames internally.
3730 */
Sunil Ravi7f769292024-07-23 22:21:32 +00003731 int (*flush)(void *priv, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003732
3733 /**
3734 * set_generic_elem - Add IEs into Beacon/Probe Response frames (AP)
3735 * @priv: Private driver interface data
3736 * @elem: Information elements
3737 * @elem_len: Length of the elem buffer in octets
3738 * Returns: 0 on success, -1 on failure
3739 *
3740 * This is an optional function to add information elements in the
3741 * kernel driver for Beacon and Probe Response frames. This can be left
3742 * undefined (set to %NULL) if the driver uses the Beacon template from
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003743 * set_ap().
3744 *
3745 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003746 */
3747 int (*set_generic_elem)(void *priv, const u8 *elem, size_t elem_len);
3748
3749 /**
Jouni Malinen1e6c57f2012-09-05 17:07:03 +03003750 * read_sta_data - Fetch station data
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003751 * @priv: Private driver interface data
3752 * @data: Buffer for returning station information
3753 * @addr: MAC address of the station
3754 * Returns: 0 on success, -1 on failure
3755 */
3756 int (*read_sta_data)(void *priv, struct hostap_sta_driver_data *data,
3757 const u8 *addr);
3758
3759 /**
Hai Shalomfdcde762020-04-02 11:19:20 -07003760 * tx_control_port - Send a frame over the 802.1X controlled port
3761 * @priv: Private driver interface data
3762 * @dest: Destination MAC address
3763 * @proto: Ethertype in host byte order
3764 * @buf: Frame payload starting from IEEE 802.1X header
3765 * @len: Frame payload length
3766 * @no_encrypt: Do not encrypt frame
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003767 * @link_id: Link ID to use for TX, or -1 if not set
Hai Shalomfdcde762020-04-02 11:19:20 -07003768 *
3769 * Returns 0 on success, else an error
3770 *
3771 * This is like a normal Ethernet send except that the driver is aware
3772 * (by other means than the Ethertype) that this frame is special,
3773 * and more importantly it gains an ordering between the transmission of
3774 * the frame and other driver management operations such as key
3775 * installations. This can be used to work around known limitations in
3776 * IEEE 802.11 protocols such as race conditions between rekeying 4-way
3777 * handshake message 4/4 and a PTK being overwritten.
3778 *
3779 * This function is only used for a given interface if the driver
3780 * instance reports WPA_DRIVER_FLAGS_CONTROL_PORT capability. Otherwise,
3781 * API users will fall back to sending the frame via a normal socket.
3782 */
3783 int (*tx_control_port)(void *priv, const u8 *dest,
3784 u16 proto, const u8 *buf, size_t len,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003785 int no_encrypt, int link_id);
Hai Shalomfdcde762020-04-02 11:19:20 -07003786
3787 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003788 * hapd_send_eapol - Send an EAPOL packet (AP only)
3789 * @priv: private driver interface data
3790 * @addr: Destination MAC address
3791 * @data: EAPOL packet starting with IEEE 802.1X header
3792 * @data_len: Length of the EAPOL packet in octets
3793 * @encrypt: Whether the frame should be encrypted
3794 * @own_addr: Source MAC address
3795 * @flags: WPA_STA_* flags for the destination station
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003796 * @link_id: Link ID to use for TX, or -1 if not set
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003797 *
3798 * Returns: 0 on success, -1 on failure
3799 */
3800 int (*hapd_send_eapol)(void *priv, const u8 *addr, const u8 *data,
3801 size_t data_len, int encrypt,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003802 const u8 *own_addr, u32 flags, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003803
3804 /**
3805 * sta_deauth - Deauthenticate a station (AP only)
3806 * @priv: Private driver interface data
3807 * @own_addr: Source address and BSSID for the Deauthentication frame
3808 * @addr: MAC address of the station to deauthenticate
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003809 * @reason: Reason code for the Deauthentication frame
3810 * @link_id: Link ID to use for Deauthentication frame, or -1 if not set
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003811 * Returns: 0 on success, -1 on failure
3812 *
3813 * This function requests a specific station to be deauthenticated and
3814 * a Deauthentication frame to be sent to it.
3815 */
3816 int (*sta_deauth)(void *priv, const u8 *own_addr, const u8 *addr,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003817 u16 reason, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003818
3819 /**
3820 * sta_disassoc - Disassociate a station (AP only)
3821 * @priv: Private driver interface data
3822 * @own_addr: Source address and BSSID for the Disassociation frame
3823 * @addr: MAC address of the station to disassociate
3824 * @reason: Reason code for the Disassociation frame
3825 * Returns: 0 on success, -1 on failure
3826 *
3827 * This function requests a specific station to be disassociated and
3828 * a Disassociation frame to be sent to it.
3829 */
3830 int (*sta_disassoc)(void *priv, const u8 *own_addr, const u8 *addr,
Hai Shalom81f62d82019-07-22 12:10:00 -07003831 u16 reason);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003832
3833 /**
3834 * sta_remove - Remove a station entry (AP only)
3835 * @priv: Private driver interface data
3836 * @addr: MAC address of the station to be removed
3837 * Returns: 0 on success, -1 on failure
3838 */
3839 int (*sta_remove)(void *priv, const u8 *addr);
3840
3841 /**
3842 * hapd_get_ssid - Get the current SSID (AP only)
3843 * @priv: Private driver interface data
3844 * @buf: Buffer for returning the SSID
3845 * @len: Maximum length of the buffer
3846 * Returns: Length of the SSID on success, -1 on failure
3847 *
3848 * This function need not be implemented if the driver uses Beacon
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003849 * template from set_ap() and does not reply to Probe Request frames.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003850 */
3851 int (*hapd_get_ssid)(void *priv, u8 *buf, int len);
3852
3853 /**
3854 * hapd_set_ssid - Set SSID (AP only)
3855 * @priv: Private driver interface data
3856 * @buf: SSID
3857 * @len: Length of the SSID in octets
3858 * Returns: 0 on success, -1 on failure
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003859 *
3860 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003861 */
3862 int (*hapd_set_ssid)(void *priv, const u8 *buf, int len);
3863
3864 /**
3865 * hapd_set_countermeasures - Enable/disable TKIP countermeasures (AP)
3866 * @priv: Private driver interface data
3867 * @enabled: 1 = countermeasures enabled, 0 = disabled
3868 * Returns: 0 on success, -1 on failure
3869 *
3870 * This need not be implemented if the driver does not take care of
3871 * association processing.
3872 */
3873 int (*hapd_set_countermeasures)(void *priv, int enabled);
3874
3875 /**
3876 * sta_add - Add a station entry
3877 * @priv: Private driver interface data
3878 * @params: Station parameters
3879 * Returns: 0 on success, -1 on failure
3880 *
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08003881 * This function is used to add or set (params->set 1) a station
3882 * entry in the driver. Adding STA entries is used only if the driver
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003883 * does not take care of association processing.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08003884 *
Dmitry Shmidt57c2d392016-02-23 13:40:19 -08003885 * With drivers that don't support full AP client state, this function
3886 * is used to add a station entry to the driver once the station has
3887 * completed association.
3888 *
3889 * With TDLS, this function is used to add or set (params->set 1)
3890 * TDLS peer entries (even with drivers that do not support full AP
3891 * client state).
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003892 */
3893 int (*sta_add)(void *priv, struct hostapd_sta_add_params *params);
3894
3895 /**
3896 * get_inact_sec - Get station inactivity duration (AP only)
3897 * @priv: Private driver interface data
3898 * @addr: Station address
3899 * Returns: Number of seconds station has been inactive, -1 on failure
3900 */
3901 int (*get_inact_sec)(void *priv, const u8 *addr);
3902
3903 /**
3904 * sta_clear_stats - Clear station statistics (AP only)
3905 * @priv: Private driver interface data
3906 * @addr: Station address
3907 * Returns: 0 on success, -1 on failure
3908 */
3909 int (*sta_clear_stats)(void *priv, const u8 *addr);
3910
3911 /**
3912 * set_freq - Set channel/frequency (AP only)
3913 * @priv: Private driver interface data
3914 * @freq: Channel parameters
3915 * Returns: 0 on success, -1 on failure
3916 */
3917 int (*set_freq)(void *priv, struct hostapd_freq_params *freq);
3918
3919 /**
3920 * set_rts - Set RTS threshold
3921 * @priv: Private driver interface data
3922 * @rts: RTS threshold in octets
3923 * Returns: 0 on success, -1 on failure
3924 */
3925 int (*set_rts)(void *priv, int rts);
3926
3927 /**
3928 * set_frag - Set fragmentation threshold
3929 * @priv: Private driver interface data
3930 * @frag: Fragmentation threshold in octets
3931 * Returns: 0 on success, -1 on failure
3932 */
3933 int (*set_frag)(void *priv, int frag);
3934
3935 /**
3936 * sta_set_flags - Set station flags (AP only)
3937 * @priv: Private driver interface data
3938 * @addr: Station address
3939 * @total_flags: Bitmap of all WPA_STA_* flags currently set
3940 * @flags_or: Bitmap of WPA_STA_* flags to add
3941 * @flags_and: Bitmap of WPA_STA_* flags to us as a mask
3942 * Returns: 0 on success, -1 on failure
3943 */
3944 int (*sta_set_flags)(void *priv, const u8 *addr,
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08003945 unsigned int total_flags, unsigned int flags_or,
3946 unsigned int flags_and);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003947
3948 /**
Hai Shalom81f62d82019-07-22 12:10:00 -07003949 * sta_set_airtime_weight - Set station airtime weight (AP only)
3950 * @priv: Private driver interface data
3951 * @addr: Station address
3952 * @weight: New weight for station airtime assignment
3953 * Returns: 0 on success, -1 on failure
3954 */
3955 int (*sta_set_airtime_weight)(void *priv, const u8 *addr,
3956 unsigned int weight);
3957
3958 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003959 * set_tx_queue_params - Set TX queue parameters
3960 * @priv: Private driver interface data
3961 * @queue: Queue number (0 = VO, 1 = VI, 2 = BE, 3 = BK)
3962 * @aifs: AIFS
3963 * @cw_min: cwMin
3964 * @cw_max: cwMax
3965 * @burst_time: Maximum length for bursting in 0.1 msec units
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003966 * @link_id: Link ID to use, or -1 for non MLD.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003967 */
3968 int (*set_tx_queue_params)(void *priv, int queue, int aifs, int cw_min,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00003969 int cw_max, int burst_time, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003970
3971 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003972 * if_add - Add a virtual interface
3973 * @priv: Private driver interface data
3974 * @type: Interface type
3975 * @ifname: Interface name for the new virtual interface
3976 * @addr: Local address to use for the interface or %NULL to use the
3977 * parent interface address
3978 * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces
3979 * @drv_priv: Pointer for overwriting the driver context or %NULL if
3980 * not allowed (applies only to %WPA_IF_AP_BSS type)
3981 * @force_ifname: Buffer for returning an interface name that the
3982 * driver ended up using if it differs from the requested ifname
3983 * @if_addr: Buffer for returning the allocated interface address
3984 * (this may differ from the requested addr if the driver cannot
3985 * change interface address)
3986 * @bridge: Bridge interface to use or %NULL if no bridge configured
Dmitry Shmidtcce06662013-11-04 18:44:24 -08003987 * @use_existing: Whether to allow existing interface to be used
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08003988 * @setup_ap: Whether to setup AP for %WPA_IF_AP_BSS interfaces
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003989 * Returns: 0 on success, -1 on failure
3990 */
3991 int (*if_add)(void *priv, enum wpa_driver_if_type type,
3992 const char *ifname, const u8 *addr, void *bss_ctx,
3993 void **drv_priv, char *force_ifname, u8 *if_addr,
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08003994 const char *bridge, int use_existing, int setup_ap);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07003995
3996 /**
3997 * if_remove - Remove a virtual interface
3998 * @priv: Private driver interface data
3999 * @type: Interface type
4000 * @ifname: Interface name of the virtual interface to be removed
4001 * Returns: 0 on success, -1 on failure
4002 */
4003 int (*if_remove)(void *priv, enum wpa_driver_if_type type,
4004 const char *ifname);
4005
4006 /**
4007 * set_sta_vlan - Bind a station into a specific interface (AP only)
4008 * @priv: Private driver interface data
4009 * @ifname: Interface (main or virtual BSS or VLAN)
4010 * @addr: MAC address of the associated station
4011 * @vlan_id: VLAN ID
Sunil Ravi2a14cf12023-11-21 00:54:38 +00004012 * @link_id: The link ID or -1 for non-MLO
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004013 * Returns: 0 on success, -1 on failure
4014 *
4015 * This function is used to bind a station to a specific virtual
4016 * interface. It is only used if when virtual interfaces are supported,
4017 * e.g., to assign stations to different VLAN interfaces based on
4018 * information from a RADIUS server. This allows separate broadcast
4019 * domains to be used with a single BSS.
4020 */
4021 int (*set_sta_vlan)(void *priv, const u8 *addr, const char *ifname,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00004022 int vlan_id, int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004023
4024 /**
4025 * commit - Optional commit changes handler (AP only)
4026 * @priv: driver private data
4027 * Returns: 0 on success, -1 on failure
4028 *
4029 * This optional handler function can be registered if the driver
4030 * interface implementation needs to commit changes (e.g., by setting
4031 * network interface up) at the end of initial configuration. If set,
4032 * this handler will be called after initial setup has been completed.
4033 */
4034 int (*commit)(void *priv);
4035
4036 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004037 * set_radius_acl_auth - Notification of RADIUS ACL change
4038 * @priv: Private driver interface data
4039 * @mac: MAC address of the station
4040 * @accepted: Whether the station was accepted
4041 * @session_timeout: Session timeout for the station
4042 * Returns: 0 on success, -1 on failure
4043 */
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07004044 int (*set_radius_acl_auth)(void *priv, const u8 *mac, int accepted,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004045 u32 session_timeout);
4046
4047 /**
4048 * set_radius_acl_expire - Notification of RADIUS ACL expiration
4049 * @priv: Private driver interface data
4050 * @mac: MAC address of the station
4051 * Returns: 0 on success, -1 on failure
4052 */
4053 int (*set_radius_acl_expire)(void *priv, const u8 *mac);
4054
4055 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004056 * set_ap_wps_ie - Add WPS IE(s) into Beacon/Probe Response frames (AP)
4057 * @priv: Private driver interface data
4058 * @beacon: WPS IE(s) for Beacon frames or %NULL to remove extra IE(s)
4059 * @proberesp: WPS IE(s) for Probe Response frames or %NULL to remove
4060 * extra IE(s)
4061 * @assocresp: WPS IE(s) for (Re)Association Response frames or %NULL
4062 * to remove extra IE(s)
4063 * Returns: 0 on success, -1 on failure
4064 *
4065 * This is an optional function to add WPS IE in the kernel driver for
4066 * Beacon and Probe Response frames. This can be left undefined (set
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004067 * to %NULL) if the driver uses the Beacon template from set_ap()
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004068 * and does not process Probe Request frames. If the driver takes care
4069 * of (Re)Association frame processing, the assocresp buffer includes
4070 * WPS IE(s) that need to be added to (Re)Association Response frames
4071 * whenever a (Re)Association Request frame indicated use of WPS.
4072 *
4073 * This will also be used to add P2P IE(s) into Beacon/Probe Response
4074 * frames when operating as a GO. The driver is responsible for adding
4075 * timing related attributes (e.g., NoA) in addition to the IEs
4076 * included here by appending them after these buffers. This call is
4077 * also used to provide Probe Response IEs for P2P Listen state
4078 * operations for drivers that generate the Probe Response frames
4079 * internally.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004080 *
4081 * DEPRECATED - use set_ap() instead
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004082 */
4083 int (*set_ap_wps_ie)(void *priv, const struct wpabuf *beacon,
4084 const struct wpabuf *proberesp,
4085 const struct wpabuf *assocresp);
4086
4087 /**
4088 * set_supp_port - Set IEEE 802.1X Supplicant Port status
4089 * @priv: Private driver interface data
4090 * @authorized: Whether the port is authorized
4091 * Returns: 0 on success, -1 on failure
4092 */
4093 int (*set_supp_port)(void *priv, int authorized);
4094
4095 /**
4096 * set_wds_sta - Bind a station into a 4-address WDS (AP only)
4097 * @priv: Private driver interface data
4098 * @addr: MAC address of the associated station
4099 * @aid: Association ID
4100 * @val: 1 = bind to 4-address WDS; 0 = unbind
4101 * @bridge_ifname: Bridge interface to use for the WDS station or %NULL
4102 * to indicate that bridge is not to be used
Dmitry Shmidtc2ebb4b2013-07-24 12:57:51 -07004103 * @ifname_wds: Buffer to return the interface name for the new WDS
4104 * station or %NULL to indicate name is not returned.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004105 * Returns: 0 on success, -1 on failure
4106 */
4107 int (*set_wds_sta)(void *priv, const u8 *addr, int aid, int val,
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07004108 const char *bridge_ifname, char *ifname_wds);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004109
4110 /**
4111 * send_action - Transmit an Action frame
4112 * @priv: Private driver interface data
4113 * @freq: Frequency (in MHz) of the channel
4114 * @wait: Time to wait off-channel for a response (in ms), or zero
4115 * @dst: Destination MAC address (Address 1)
4116 * @src: Source MAC address (Address 2)
4117 * @bssid: BSSID (Address 3)
4118 * @data: Frame body
4119 * @data_len: data length in octets
Sunil Ravi79e6c4f2025-01-04 00:47:06 +00004120 * @no_cck: Whether CCK rates must not be used to transmit this frame
4121 * @link_id: Link ID of the specified link; -1 for non-MLO cases and for
4122 * frames that target the MLD instead of a specific link in MLO
4123 * cases
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004124 * Returns: 0 on success, -1 on failure
4125 *
4126 * This command can be used to request the driver to transmit an action
4127 * frame to the specified destination.
4128 *
4129 * If the %WPA_DRIVER_FLAGS_OFFCHANNEL_TX flag is set, the frame will
4130 * be transmitted on the given channel and the device will wait for a
4131 * response on that channel for the given wait time.
4132 *
4133 * If the flag is not set, the wait time will be ignored. In this case,
4134 * if a remain-on-channel duration is in progress, the frame must be
4135 * transmitted on that channel; alternatively the frame may be sent on
4136 * the current operational channel (if in associated state in station
4137 * mode or while operating as an AP.)
Dmitry Shmidtebd93af2017-02-21 13:40:44 -08004138 *
4139 * If @src differs from the device MAC address, use of a random
4140 * transmitter address is requested for this message exchange.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004141 */
4142 int (*send_action)(void *priv, unsigned int freq, unsigned int wait,
4143 const u8 *dst, const u8 *src, const u8 *bssid,
Sunil Ravi79e6c4f2025-01-04 00:47:06 +00004144 const u8 *data, size_t data_len, int no_cck,
4145 int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004146
4147 /**
4148 * send_action_cancel_wait - Cancel action frame TX wait
4149 * @priv: Private driver interface data
4150 *
4151 * This command cancels the wait time associated with sending an action
4152 * frame. It is only available when %WPA_DRIVER_FLAGS_OFFCHANNEL_TX is
4153 * set in the driver flags.
4154 */
4155 void (*send_action_cancel_wait)(void *priv);
4156
4157 /**
4158 * remain_on_channel - Remain awake on a channel
4159 * @priv: Private driver interface data
4160 * @freq: Frequency (in MHz) of the channel
4161 * @duration: Duration in milliseconds
4162 * Returns: 0 on success, -1 on failure
4163 *
4164 * This command is used to request the driver to remain awake on the
4165 * specified channel for the specified duration and report received
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08004166 * Action frames with EVENT_RX_MGMT events. Optionally, received
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004167 * Probe Request frames may also be requested to be reported by calling
4168 * probe_req_report(). These will be reported with EVENT_RX_PROBE_REQ.
4169 *
4170 * The driver may not be at the requested channel when this function
4171 * returns, i.e., the return code is only indicating whether the
4172 * request was accepted. The caller will need to wait until the
4173 * EVENT_REMAIN_ON_CHANNEL event indicates that the driver has
4174 * completed the channel change. This may take some time due to other
4175 * need for the radio and the caller should be prepared to timing out
4176 * its wait since there are no guarantees on when this request can be
4177 * executed.
4178 */
4179 int (*remain_on_channel)(void *priv, unsigned int freq,
4180 unsigned int duration);
4181
4182 /**
4183 * cancel_remain_on_channel - Cancel remain-on-channel operation
4184 * @priv: Private driver interface data
4185 *
4186 * This command can be used to cancel a remain-on-channel operation
4187 * before its originally requested duration has passed. This could be
4188 * used, e.g., when remain_on_channel() is used to request extra time
4189 * to receive a response to an Action frame and the response is
4190 * received when there is still unneeded time remaining on the
4191 * remain-on-channel operation.
4192 */
4193 int (*cancel_remain_on_channel)(void *priv);
4194
4195 /**
4196 * probe_req_report - Request Probe Request frames to be indicated
4197 * @priv: Private driver interface data
4198 * @report: Whether to report received Probe Request frames
4199 * Returns: 0 on success, -1 on failure (or if not supported)
4200 *
4201 * This command can be used to request the driver to indicate when
4202 * Probe Request frames are received with EVENT_RX_PROBE_REQ events.
4203 * Since this operation may require extra resources, e.g., due to less
4204 * optimal hardware/firmware RX filtering, many drivers may disable
4205 * Probe Request reporting at least in station mode. This command is
4206 * used to notify the driver when the Probe Request frames need to be
4207 * reported, e.g., during remain-on-channel operations.
4208 */
4209 int (*probe_req_report)(void *priv, int report);
4210
4211 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004212 * deinit_ap - Deinitialize AP mode
4213 * @priv: Private driver interface data
4214 * Returns: 0 on success, -1 on failure (or if not supported)
4215 *
4216 * This optional function can be used to disable AP mode related
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07004217 * configuration. If the interface was not dynamically added,
4218 * change the driver mode to station mode to allow normal station
4219 * operations like scanning to be completed.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004220 */
4221 int (*deinit_ap)(void *priv);
4222
4223 /**
Dmitry Shmidt04949592012-07-19 12:16:46 -07004224 * deinit_p2p_cli - Deinitialize P2P client mode
4225 * @priv: Private driver interface data
4226 * Returns: 0 on success, -1 on failure (or if not supported)
4227 *
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07004228 * This optional function can be used to disable P2P client mode. If the
4229 * interface was not dynamically added, change the interface type back
4230 * to station mode.
Dmitry Shmidt04949592012-07-19 12:16:46 -07004231 */
4232 int (*deinit_p2p_cli)(void *priv);
4233
4234 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004235 * suspend - Notification on system suspend/hibernate event
4236 * @priv: Private driver interface data
4237 */
4238 void (*suspend)(void *priv);
4239
4240 /**
4241 * resume - Notification on system resume/thaw event
4242 * @priv: Private driver interface data
4243 */
4244 void (*resume)(void *priv);
4245
4246 /**
4247 * signal_monitor - Set signal monitoring parameters
4248 * @priv: Private driver interface data
4249 * @threshold: Threshold value for signal change events; 0 = disabled
4250 * @hysteresis: Minimum change in signal strength before indicating a
4251 * new event
4252 * Returns: 0 on success, -1 on failure (or if not supported)
4253 *
4254 * This function can be used to configure monitoring of signal strength
4255 * with the current AP. Whenever signal strength drops below the
4256 * %threshold value or increases above it, EVENT_SIGNAL_CHANGE event
4257 * should be generated assuming the signal strength has changed at
4258 * least %hysteresis from the previously indicated signal change event.
4259 */
4260 int (*signal_monitor)(void *priv, int threshold, int hysteresis);
4261
4262 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004263 * get_noa - Get current Notice of Absence attribute payload
4264 * @priv: Private driver interface data
4265 * @buf: Buffer for returning NoA
4266 * @buf_len: Buffer length in octets
4267 * Returns: Number of octets used in buf, 0 to indicate no NoA is being
4268 * advertized, or -1 on failure
4269 *
4270 * This function is used to fetch the current Notice of Absence
4271 * attribute value from GO.
4272 */
4273 int (*get_noa)(void *priv, u8 *buf, size_t buf_len);
4274
4275 /**
4276 * set_noa - Set Notice of Absence parameters for GO (testing)
4277 * @priv: Private driver interface data
4278 * @count: Count
4279 * @start: Start time in ms from next TBTT
4280 * @duration: Duration in ms
4281 * Returns: 0 on success or -1 on failure
4282 *
4283 * This function is used to set Notice of Absence parameters for GO. It
4284 * is used only for testing. To disable NoA, all parameters are set to
4285 * 0.
4286 */
4287 int (*set_noa)(void *priv, u8 count, int start, int duration);
4288
4289 /**
4290 * set_p2p_powersave - Set P2P power save options
4291 * @priv: Private driver interface data
4292 * @legacy_ps: 0 = disable, 1 = enable, 2 = maximum PS, -1 = no change
4293 * @opp_ps: 0 = disable, 1 = enable, -1 = no change
4294 * @ctwindow: 0.. = change (msec), -1 = no change
4295 * Returns: 0 on success or -1 on failure
4296 */
4297 int (*set_p2p_powersave)(void *priv, int legacy_ps, int opp_ps,
4298 int ctwindow);
4299
4300 /**
4301 * ampdu - Enable/disable aggregation
4302 * @priv: Private driver interface data
4303 * @ampdu: 1/0 = enable/disable A-MPDU aggregation
4304 * Returns: 0 on success or -1 on failure
4305 */
4306 int (*ampdu)(void *priv, int ampdu);
4307
4308 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004309 * get_radio_name - Get physical radio name for the device
4310 * @priv: Private driver interface data
4311 * Returns: Radio name or %NULL if not known
4312 *
4313 * The returned data must not be modified by the caller. It is assumed
4314 * that any interface that has the same radio name as another is
4315 * sharing the same physical radio. This information can be used to
4316 * share scan results etc. information between the virtual interfaces
4317 * to speed up various operations.
4318 */
4319 const char * (*get_radio_name)(void *priv);
4320
4321 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004322 * send_tdls_mgmt - for sending TDLS management packets
4323 * @priv: private driver interface data
4324 * @dst: Destination (peer) MAC address
4325 * @action_code: TDLS action code for the mssage
4326 * @dialog_token: Dialog Token to use in the message (if needed)
4327 * @status_code: Status Code or Reason Code to use (if needed)
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07004328 * @peer_capab: TDLS peer capability (TDLS_PEER_* bitfield)
Dmitry Shmidt9ead16e2014-10-07 13:15:23 -07004329 * @initiator: Is the current end the TDLS link initiator
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004330 * @buf: TDLS IEs to add to the message
4331 * @len: Length of buf in octets
Sunil Ravi2a14cf12023-11-21 00:54:38 +00004332 * @link_id: If >= 0 indicates the link of the AP MLD to specify the
4333 * operating channel on which to send a TDLS Discovery Response frame.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004334 * Returns: 0 on success, negative (<0) on failure
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004335 *
4336 * This optional function can be used to send packet to driver which is
4337 * responsible for receiving and sending all TDLS packets.
4338 */
4339 int (*send_tdls_mgmt)(void *priv, const u8 *dst, u8 action_code,
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -07004340 u8 dialog_token, u16 status_code, u32 peer_capab,
Sunil Ravi2a14cf12023-11-21 00:54:38 +00004341 int initiator, const u8 *buf, size_t len,
4342 int link_id);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004343
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004344 /**
4345 * tdls_oper - Ask the driver to perform high-level TDLS operations
4346 * @priv: Private driver interface data
4347 * @oper: TDLS high-level operation. See %enum tdls_oper
4348 * @peer: Destination (peer) MAC address
4349 * Returns: 0 on success, negative (<0) on failure
4350 *
4351 * This optional function can be used to send high-level TDLS commands
4352 * to the driver.
4353 */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004354 int (*tdls_oper)(void *priv, enum tdls_oper oper, const u8 *peer);
4355
4356 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07004357 * wnm_oper - Notify driver of the WNM frame reception
4358 * @priv: Private driver interface data
4359 * @oper: WNM operation. See %enum wnm_oper
4360 * @peer: Destination (peer) MAC address
4361 * @buf: Buffer for the driver to fill in (for getting IE)
4362 * @buf_len: Return the len of buf
4363 * Returns: 0 on success, negative (<0) on failure
4364 */
4365 int (*wnm_oper)(void *priv, enum wnm_oper oper, const u8 *peer,
4366 u8 *buf, u16 *buf_len);
4367
4368 /**
Dmitry Shmidt051af732013-10-22 13:52:46 -07004369 * set_qos_map - Set QoS Map
4370 * @priv: Private driver interface data
4371 * @qos_map_set: QoS Map
4372 * @qos_map_set_len: Length of QoS Map
4373 */
4374 int (*set_qos_map)(void *priv, const u8 *qos_map_set,
4375 u8 qos_map_set_len);
4376
4377 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004378 * br_add_ip_neigh - Add a neigh to the bridge ip neigh table
4379 * @priv: Private driver interface data
4380 * @version: IP version of the IP address, 4 or 6
4381 * @ipaddr: IP address for the neigh entry
4382 * @prefixlen: IP address prefix length
4383 * @addr: Corresponding MAC address
4384 * Returns: 0 on success, negative (<0) on failure
4385 */
4386 int (*br_add_ip_neigh)(void *priv, u8 version, const u8 *ipaddr,
4387 int prefixlen, const u8 *addr);
4388
4389 /**
4390 * br_delete_ip_neigh - Remove a neigh from the bridge ip neigh table
4391 * @priv: Private driver interface data
4392 * @version: IP version of the IP address, 4 or 6
4393 * @ipaddr: IP address for the neigh entry
4394 * Returns: 0 on success, negative (<0) on failure
4395 */
4396 int (*br_delete_ip_neigh)(void *priv, u8 version, const u8 *ipaddr);
4397
4398 /**
4399 * br_port_set_attr - Set a bridge port attribute
4400 * @attr: Bridge port attribute to set
4401 * @val: Value to be set
4402 * Returns: 0 on success, negative (<0) on failure
4403 */
4404 int (*br_port_set_attr)(void *priv, enum drv_br_port_attr attr,
4405 unsigned int val);
4406
4407 /**
4408 * br_port_set_attr - Set a bridge network parameter
4409 * @param: Bridge parameter to set
4410 * @val: Value to be set
4411 * Returns: 0 on success, negative (<0) on failure
4412 */
4413 int (*br_set_net_param)(void *priv, enum drv_br_net_param param,
4414 unsigned int val);
4415
4416 /**
Hai Shalomfdcde762020-04-02 11:19:20 -07004417 * get_wowlan - Get wake-on-wireless status
4418 * @priv: Private driver interface data
4419 */
4420 int (*get_wowlan)(void *priv);
4421
4422 /**
Dmitry Shmidtb58836e2014-04-29 14:35:56 -07004423 * set_wowlan - Set wake-on-wireless triggers
4424 * @priv: Private driver interface data
4425 * @triggers: wowlan triggers
4426 */
4427 int (*set_wowlan)(void *priv, const struct wowlan_triggers *triggers);
4428
4429 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004430 * signal_poll - Get current connection information
4431 * @priv: Private driver interface data
4432 * @signal_info: Connection info structure
Dmitry Shmidt7832adb2014-04-29 10:53:02 -07004433 */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004434 int (*signal_poll)(void *priv, struct wpa_signal_info *signal_info);
Dmitry Shmidtbd567ad2011-05-09 14:17:09 -07004435
4436 /**
Sunil Ravi89eba102022-09-13 21:04:37 -07004437 * mlo_signal_poll - Get current MLO connection information
4438 * @priv: Private driver interface data
4439 * @mlo_signal_info: MLO connection info structure
4440 */
4441 int (*mlo_signal_poll)(void *priv,
4442 struct wpa_mlo_signal_info *mlo_signal_info);
4443
4444 /**
Hai Shalom74f70d42019-02-11 14:42:39 -08004445 * channel_info - Get parameters of the current operating channel
4446 * @priv: Private driver interface data
4447 * @channel_info: Channel info structure
4448 * Returns: 0 on success, negative (<0) on failure
4449 */
4450 int (*channel_info)(void *priv, struct wpa_channel_info *channel_info);
4451
4452 /**
Jouni Malinen75ecf522011-06-27 15:19:46 -07004453 * set_authmode - Set authentication algorithm(s) for static WEP
4454 * @priv: Private driver interface data
4455 * @authmode: 1=Open System, 2=Shared Key, 3=both
4456 * Returns: 0 on success, -1 on failure
4457 *
4458 * This function can be used to set authentication algorithms for AP
4459 * mode when static WEP is used. If the driver uses user space MLME/SME
4460 * implementation, there is no need to implement this function.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004461 *
4462 * DEPRECATED - use set_ap() instead
Jouni Malinen75ecf522011-06-27 15:19:46 -07004463 */
4464 int (*set_authmode)(void *priv, int authmode);
Dmitry Shmidt292b0c32013-11-22 12:54:42 -08004465
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004466#ifdef ANDROID
Jouni Malinen75ecf522011-06-27 15:19:46 -07004467 /**
Dmitry Shmidt292b0c32013-11-22 12:54:42 -08004468 * driver_cmd - Execute driver-specific command
4469 * @priv: Private driver interface data
4470 * @cmd: Command to execute
4471 * @buf: Return buffer
4472 * @buf_len: Buffer length
Dmitry Shmidtbd567ad2011-05-09 14:17:09 -07004473 * Returns: 0 on success, -1 on failure
4474 */
Dmitry Shmidt292b0c32013-11-22 12:54:42 -08004475 int (*driver_cmd)(void *priv, char *cmd, char *buf, size_t buf_len);
4476#endif /* ANDROID */
4477
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004478 /**
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004479 * vendor_cmd - Execute vendor specific command
4480 * @priv: Private driver interface data
4481 * @vendor_id: Vendor id
4482 * @subcmd: Vendor command id
Hai Shalom60840252021-02-19 19:02:11 -08004483 * @nested_attr_flag: Specifies if vendor subcommand uses nested
4484 * attributes or not
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004485 * @data: Vendor command parameters (%NULL if no parameters)
4486 * @data_len: Data length
4487 * @buf: Return buffer (%NULL to ignore reply)
4488 * Returns: 0 on success, negative (<0) on failure
4489 *
4490 * This function handles vendor specific commands that are passed to
4491 * the driver/device. The command is identified by vendor id and
Hai Shalom60840252021-02-19 19:02:11 -08004492 * command id. The nested_attr_flag specifies whether the subcommand
4493 * uses nested attributes or not. Parameters can be passed
4494 * as argument to the command in the data buffer. Reply (if any) will be
4495 * filled in the supplied return buffer.
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004496 *
4497 * The exact driver behavior is driver interface and vendor specific. As
4498 * an example, this will be converted to a vendor specific cfg80211
4499 * command in case of the nl80211 driver interface.
4500 */
4501 int (*vendor_cmd)(void *priv, unsigned int vendor_id,
4502 unsigned int subcmd, const u8 *data, size_t data_len,
Hai Shalom60840252021-02-19 19:02:11 -08004503 enum nested_attr nested_attr_flag,
Dmitry Shmidta38abf92014-03-06 13:38:44 -08004504 struct wpabuf *buf);
4505
4506 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004507 * set_rekey_info - Set rekey information
4508 * @priv: Private driver interface data
4509 * @kek: Current KEK
Dmitry Shmidt807291d2015-01-27 13:40:23 -08004510 * @kek_len: KEK length in octets
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004511 * @kck: Current KCK
Dmitry Shmidt807291d2015-01-27 13:40:23 -08004512 * @kck_len: KCK length in octets
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004513 * @replay_ctr: Current EAPOL-Key Replay Counter
4514 *
4515 * This optional function can be used to provide information for the
4516 * driver/firmware to process EAPOL-Key frames in Group Key Handshake
4517 * while the host (including wpa_supplicant) is sleeping.
4518 */
Dmitry Shmidt807291d2015-01-27 13:40:23 -08004519 void (*set_rekey_info)(void *priv, const u8 *kek, size_t kek_len,
4520 const u8 *kck, size_t kck_len,
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004521 const u8 *replay_ctr);
4522
4523 /**
4524 * sta_assoc - Station association indication
4525 * @priv: Private driver interface data
4526 * @own_addr: Source address and BSSID for association frame
4527 * @addr: MAC address of the station to associate
4528 * @reassoc: flag to indicate re-association
4529 * @status: association response status code
4530 * @ie: assoc response ie buffer
4531 * @len: ie buffer length
4532 * Returns: 0 on success, -1 on failure
4533 *
4534 * This function indicates the driver to send (Re)Association
4535 * Response frame to the station.
4536 */
4537 int (*sta_assoc)(void *priv, const u8 *own_addr, const u8 *addr,
4538 int reassoc, u16 status, const u8 *ie, size_t len);
4539
4540 /**
4541 * sta_auth - Station authentication indication
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004542 * @priv: private driver interface data
4543 * @params: Station authentication parameters
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004544 *
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004545 * Returns: 0 on success, -1 on failure
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004546 */
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07004547 int (*sta_auth)(void *priv,
4548 struct wpa_driver_sta_auth_params *params);
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004549
4550 /**
4551 * add_tspec - Add traffic stream
4552 * @priv: Private driver interface data
4553 * @addr: MAC address of the station to associate
4554 * @tspec_ie: tspec ie buffer
4555 * @tspec_ielen: tspec ie length
4556 * Returns: 0 on success, -1 on failure
4557 *
4558 * This function adds the traffic steam for the station
4559 * and fills the medium_time in tspec_ie.
4560 */
4561 int (*add_tspec)(void *priv, const u8 *addr, u8 *tspec_ie,
4562 size_t tspec_ielen);
4563
4564 /**
4565 * add_sta_node - Add a station node in the driver
4566 * @priv: Private driver interface data
4567 * @addr: MAC address of the station to add
4568 * @auth_alg: authentication algorithm used by the station
4569 * Returns: 0 on success, -1 on failure
4570 *
4571 * This function adds the station node in the driver, when
4572 * the station gets added by FT-over-DS.
4573 */
4574 int (*add_sta_node)(void *priv, const u8 *addr, u16 auth_alg);
4575
4576 /**
4577 * sched_scan - Request the driver to initiate scheduled scan
4578 * @priv: Private driver interface data
4579 * @params: Scan parameters
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004580 * Returns: 0 on success, -1 on failure
4581 *
4582 * This operation should be used for scheduled scan offload to
4583 * the hardware. Every time scan results are available, the
4584 * driver should report scan results event for wpa_supplicant
4585 * which will eventually request the results with
4586 * wpa_driver_get_scan_results2(). This operation is optional
4587 * and if not provided or if it returns -1, we fall back to
4588 * normal host-scheduled scans.
4589 */
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08004590 int (*sched_scan)(void *priv, struct wpa_driver_scan_params *params);
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004591
4592 /**
4593 * stop_sched_scan - Request the driver to stop a scheduled scan
4594 * @priv: Private driver interface data
4595 * Returns: 0 on success, -1 on failure
4596 *
4597 * This should cause the scheduled scan to be stopped and
4598 * results should stop being sent. Must be supported if
4599 * sched_scan is supported.
4600 */
4601 int (*stop_sched_scan)(void *priv);
4602
4603 /**
4604 * poll_client - Probe (null data or such) the given station
4605 * @priv: Private driver interface data
4606 * @own_addr: MAC address of sending interface
4607 * @addr: MAC address of the station to probe
4608 * @qos: Indicates whether station is QoS station
4609 *
4610 * This function is used to verify whether an associated station is
4611 * still present. This function does not need to be implemented if the
4612 * driver provides such inactivity polling mechanism.
4613 */
4614 void (*poll_client)(void *priv, const u8 *own_addr,
4615 const u8 *addr, int qos);
Dmitry Shmidt04949592012-07-19 12:16:46 -07004616
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004617 /**
Dmitry Shmidt04949592012-07-19 12:16:46 -07004618 * radio_disable - Disable/enable radio
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004619 * @priv: Private driver interface data
Dmitry Shmidt04949592012-07-19 12:16:46 -07004620 * @disabled: 1=disable 0=enable radio
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004621 * Returns: 0 on success, -1 on failure
4622 *
Dmitry Shmidt04949592012-07-19 12:16:46 -07004623 * This optional command is for testing purposes. It can be used to
4624 * disable the radio on a testbed device to simulate out-of-radio-range
4625 * conditions.
4626 */
4627 int (*radio_disable)(void *priv, int disabled);
4628
4629 /**
4630 * switch_channel - Announce channel switch and migrate the GO to the
4631 * given frequency
4632 * @priv: Private driver interface data
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08004633 * @settings: Settings for CSA period and new channel
Dmitry Shmidt04949592012-07-19 12:16:46 -07004634 * Returns: 0 on success, -1 on failure
4635 *
4636 * This function is used to move the GO to the legacy STA channel to
4637 * avoid frequency conflict in single channel concurrency.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08004638 */
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08004639 int (*switch_channel)(void *priv, struct csa_settings *settings);
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004640
4641 /**
Sunil Ravia04bd252022-05-02 22:54:18 -07004642 * switch_color - Announce color switch and migrate the BSS to the
4643 * given color
4644 * @priv: Private driver interface data
4645 * @settings: Settings for CCA period and new color
4646 * Returns: 0 on success, -1 on failure
4647 *
4648 * This function is used to move the BSS to its new color.
4649 */
4650 int (*switch_color)(void *priv, struct cca_settings *settings);
4651
4652 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004653 * add_tx_ts - Add traffic stream
4654 * @priv: Private driver interface data
4655 * @tsid: Traffic stream ID
4656 * @addr: Receiver address
4657 * @user_prio: User priority of the traffic stream
4658 * @admitted_time: Admitted time for this TS in units of
4659 * 32 microsecond periods (per second).
4660 * Returns: 0 on success, -1 on failure
4661 */
4662 int (*add_tx_ts)(void *priv, u8 tsid, const u8 *addr, u8 user_prio,
4663 u16 admitted_time);
4664
4665 /**
4666 * del_tx_ts - Delete traffic stream
4667 * @priv: Private driver interface data
4668 * @tsid: Traffic stream ID
4669 * @addr: Receiver address
4670 * Returns: 0 on success, -1 on failure
4671 */
4672 int (*del_tx_ts)(void *priv, u8 tsid, const u8 *addr);
4673
4674 /**
4675 * Enable channel-switching with TDLS peer
4676 * @priv: Private driver interface data
4677 * @addr: MAC address of the TDLS peer
4678 * @oper_class: Operating class of the switch channel
4679 * @params: Channel specification
4680 * Returns: 0 on success, -1 on failure
4681 *
4682 * The function indicates to driver that it can start switching to a
4683 * different channel with a specified TDLS peer. The switching is
4684 * assumed on until canceled with tdls_disable_channel_switch().
4685 */
4686 int (*tdls_enable_channel_switch)(
4687 void *priv, const u8 *addr, u8 oper_class,
4688 const struct hostapd_freq_params *params);
4689
4690 /**
4691 * Disable channel switching with TDLS peer
4692 * @priv: Private driver interface data
4693 * @addr: MAC address of the TDLS peer
4694 * Returns: 0 on success, -1 on failure
4695 *
4696 * This function indicates to the driver that it should stop switching
4697 * with a given TDLS peer.
4698 */
4699 int (*tdls_disable_channel_switch)(void *priv, const u8 *addr);
4700
4701 /**
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004702 * start_dfs_cac - Listen for radar interference on the channel
4703 * @priv: Private driver interface data
Dmitry Shmidt051af732013-10-22 13:52:46 -07004704 * @freq: Channel parameters
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004705 * Returns: 0 on success, -1 on failure
4706 */
Dmitry Shmidt051af732013-10-22 13:52:46 -07004707 int (*start_dfs_cac)(void *priv, struct hostapd_freq_params *freq);
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004708
4709 /**
4710 * stop_ap - Removes beacon from AP
4711 * @priv: Private driver interface data
Sunil Ravi99c035e2024-07-12 01:42:03 +00004712 * @link_id: Link ID of the specified link; -1 for non-MLD
Dmitry Shmidtea69e842013-05-13 14:52:28 -07004713 * Returns: 0 on success, -1 on failure (or if not supported)
4714 *
4715 * This optional function can be used to disable AP mode related
4716 * configuration. Unlike deinit_ap, it does not change to station
4717 * mode.
4718 */
Sunil Ravi99c035e2024-07-12 01:42:03 +00004719 int (*stop_ap)(void *priv, int link_id);
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07004720
4721 /**
4722 * get_survey - Retrieve survey data
4723 * @priv: Private driver interface data
4724 * @freq: If set, survey data for the specified frequency is only
4725 * being requested. If not set, all survey data is requested.
4726 * Returns: 0 on success, -1 on failure
4727 *
4728 * Use this to retrieve:
4729 *
4730 * - the observed channel noise floor
4731 * - the amount of time we have spent on the channel
4732 * - the amount of time during which we have spent on the channel that
4733 * the radio has determined the medium is busy and we cannot
4734 * transmit
4735 * - the amount of time we have spent receiving data
4736 * - the amount of time we have spent transmitting data
4737 *
4738 * This data can be used for spectrum heuristics. One example is
4739 * Automatic Channel Selection (ACS). The channel survey data is
4740 * kept on a linked list on the channel data, one entry is added
4741 * for each survey. The min_nf of the channel is updated for each
4742 * survey.
4743 */
4744 int (*get_survey)(void *priv, unsigned int freq);
Dmitry Shmidt56052862013-10-04 10:23:25 -07004745
4746 /**
4747 * status - Get driver interface status information
4748 * @priv: Private driver interface data
Hai Shalom74f70d42019-02-11 14:42:39 -08004749 * @buf: Buffer for printing the status information
Dmitry Shmidt56052862013-10-04 10:23:25 -07004750 * @buflen: Maximum length of the buffer
4751 * Returns: Length of written status information or -1 on failure
4752 */
4753 int (*status)(void *priv, char *buf, size_t buflen);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004754
Dmitry Shmidt661b4f72014-09-29 14:58:27 -07004755 /**
4756 * roaming - Set roaming policy for driver-based BSS selection
4757 * @priv: Private driver interface data
4758 * @allowed: Whether roaming within ESS is allowed
4759 * @bssid: Forced BSSID if roaming is disabled or %NULL if not set
4760 * Returns: Length of written status information or -1 on failure
4761 *
4762 * This optional callback can be used to update roaming policy from the
4763 * associate() command (bssid being set there indicates that the driver
4764 * should not roam before getting this roaming() call to allow roaming.
4765 * If the driver does not indicate WPA_DRIVER_FLAGS_BSS_SELECTION
4766 * capability, roaming policy is handled within wpa_supplicant and there
4767 * is no need to implement or react to this callback.
4768 */
4769 int (*roaming)(void *priv, int allowed, const u8 *bssid);
4770
4771 /**
Roshan Pius3a1667e2018-07-03 15:17:14 -07004772 * disable_fils - Enable/disable FILS feature
4773 * @priv: Private driver interface data
4774 * @disable: 0-enable and 1-disable FILS feature
4775 * Returns: 0 on success, -1 on failure
4776 *
4777 * This callback can be used to configure driver and below layers to
4778 * enable/disable all FILS features.
4779 */
4780 int (*disable_fils)(void *priv, int disable);
4781
4782 /**
Dmitry Shmidt661b4f72014-09-29 14:58:27 -07004783 * set_mac_addr - Set MAC address
4784 * @priv: Private driver interface data
4785 * @addr: MAC address to use or %NULL for setting back to permanent
4786 * Returns: 0 on success, -1 on failure
4787 */
4788 int (*set_mac_addr)(void *priv, const u8 *addr);
4789
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004790#ifdef CONFIG_MACSEC
4791 int (*macsec_init)(void *priv, struct macsec_init_params *params);
4792
4793 int (*macsec_deinit)(void *priv);
4794
4795 /**
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004796 * macsec_get_capability - Inform MKA of this driver's capability
4797 * @priv: Private driver interface data
4798 * @cap: Driver's capability
4799 * Returns: 0 on success, -1 on failure
4800 */
4801 int (*macsec_get_capability)(void *priv, enum macsec_cap *cap);
4802
4803 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004804 * enable_protect_frames - Set protect frames status
4805 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004806 * @enabled: true = protect frames enabled
4807 * false = protect frames disabled
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004808 * Returns: 0 on success, -1 on failure (or if not supported)
4809 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004810 int (*enable_protect_frames)(void *priv, bool enabled);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004811
4812 /**
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004813 * enable_encrypt - Set encryption status
4814 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004815 * @enabled: true = encrypt outgoing traffic
4816 * false = integrity-only protection on outgoing traffic
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004817 * Returns: 0 on success, -1 on failure (or if not supported)
4818 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004819 int (*enable_encrypt)(void *priv, bool enabled);
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08004820
4821 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004822 * set_replay_protect - Set replay protect status and window size
4823 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004824 * @enabled: true = replay protect enabled
4825 * false = replay protect disabled
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004826 * @window: replay window size, valid only when replay protect enabled
4827 * Returns: 0 on success, -1 on failure (or if not supported)
4828 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004829 int (*set_replay_protect)(void *priv, bool enabled, u32 window);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004830
4831 /**
Sunil Ravi036cec52023-03-29 11:35:17 -07004832 * set_offload - Set MACsec hardware offload
4833 * @priv: Private driver interface data
4834 * @offload: 0 = MACSEC_OFFLOAD_OFF
4835 * 1 = MACSEC_OFFLOAD_PHY
4836 * 2 = MACSEC_OFFLOAD_MAC
4837 * Returns: 0 on success, -1 on failure (or if not supported)
4838 */
4839 int (*set_offload)(void *priv, u8 offload);
4840
4841 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004842 * set_current_cipher_suite - Set current cipher suite
4843 * @priv: Private driver interface data
4844 * @cs: EUI64 identifier
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004845 * Returns: 0 on success, -1 on failure (or if not supported)
4846 */
Dmitry Shmidt7d175302016-09-06 13:11:34 -07004847 int (*set_current_cipher_suite)(void *priv, u64 cs);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004848
4849 /**
4850 * enable_controlled_port - Set controlled port status
4851 * @priv: Private driver interface data
Hai Shalome21d4e82020-04-29 16:34:06 -07004852 * @enabled: true = controlled port enabled
4853 * false = controlled port disabled
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004854 * Returns: 0 on success, -1 on failure (or if not supported)
4855 */
Hai Shalome21d4e82020-04-29 16:34:06 -07004856 int (*enable_controlled_port)(void *priv, bool enabled);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004857
4858 /**
4859 * get_receive_lowest_pn - Get receive lowest pn
4860 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004861 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004862 * Returns: 0 on success, -1 on failure (or if not supported)
4863 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004864 int (*get_receive_lowest_pn)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004865
4866 /**
4867 * get_transmit_next_pn - Get transmit next pn
4868 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004869 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004870 * Returns: 0 on success, -1 on failure (or if not supported)
4871 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004872 int (*get_transmit_next_pn)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004873
4874 /**
4875 * set_transmit_next_pn - Set transmit next pn
4876 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004877 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004878 * Returns: 0 on success, -1 on failure (or if not supported)
4879 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004880 int (*set_transmit_next_pn)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004881
4882 /**
Hai Shalom74f70d42019-02-11 14:42:39 -08004883 * set_receive_lowest_pn - Set receive lowest PN
4884 * @priv: Private driver interface data
4885 * @sa: secure association
4886 * Returns: 0 on success, -1 on failure (or if not supported)
4887 */
4888 int (*set_receive_lowest_pn)(void *priv, struct receive_sa *sa);
4889
4890 /**
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004891 * create_receive_sc - create secure channel for receiving
4892 * @priv: Private driver interface data
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004893 * @sc: secure channel
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004894 * @conf_offset: confidentiality offset (0, 30, or 50)
4895 * @validation: frame validation policy (0 = Disabled, 1 = Checked,
4896 * 2 = Strict)
4897 * Returns: 0 on success, -1 on failure (or if not supported)
4898 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004899 int (*create_receive_sc)(void *priv, struct receive_sc *sc,
4900 unsigned int conf_offset,
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004901 int validation);
4902
4903 /**
4904 * delete_receive_sc - delete secure connection for receiving
4905 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004906 * @sc: secure channel
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004907 * Returns: 0 on success, -1 on failure
4908 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004909 int (*delete_receive_sc)(void *priv, struct receive_sc *sc);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004910
4911 /**
4912 * create_receive_sa - create secure association for receive
4913 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004914 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004915 * Returns: 0 on success, -1 on failure
4916 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004917 int (*create_receive_sa)(void *priv, struct receive_sa *sa);
4918
4919 /**
4920 * delete_receive_sa - Delete secure association for receive
4921 * @priv: Private driver interface data from init()
4922 * @sa: Secure association
4923 * Returns: 0 on success, -1 on failure
4924 */
4925 int (*delete_receive_sa)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004926
4927 /**
4928 * enable_receive_sa - enable the SA for receive
4929 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004930 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004931 * Returns: 0 on success, -1 on failure
4932 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004933 int (*enable_receive_sa)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004934
4935 /**
4936 * disable_receive_sa - disable SA for receive
4937 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004938 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004939 * Returns: 0 on success, -1 on failure
4940 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004941 int (*disable_receive_sa)(void *priv, struct receive_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004942
4943 /**
4944 * create_transmit_sc - create secure connection for transmit
4945 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004946 * @sc: secure channel
4947 * @conf_offset: confidentiality offset (0, 30, or 50)
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004948 * Returns: 0 on success, -1 on failure
4949 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004950 int (*create_transmit_sc)(void *priv, struct transmit_sc *sc,
4951 unsigned int conf_offset);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004952
4953 /**
4954 * delete_transmit_sc - delete secure connection for transmit
4955 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004956 * @sc: secure channel
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004957 * Returns: 0 on success, -1 on failure
4958 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004959 int (*delete_transmit_sc)(void *priv, struct transmit_sc *sc);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004960
4961 /**
4962 * create_transmit_sa - create secure association for transmit
4963 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004964 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004965 * Returns: 0 on success, -1 on failure
4966 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004967 int (*create_transmit_sa)(void *priv, struct transmit_sa *sa);
4968
4969 /**
4970 * delete_transmit_sa - Delete secure association for transmit
4971 * @priv: Private driver interface data from init()
4972 * @sa: Secure association
4973 * Returns: 0 on success, -1 on failure
4974 */
4975 int (*delete_transmit_sa)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004976
4977 /**
4978 * enable_transmit_sa - enable SA for transmit
4979 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004980 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004981 * Returns: 0 on success, -1 on failure
4982 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004983 int (*enable_transmit_sa)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004984
4985 /**
4986 * disable_transmit_sa - disable SA for transmit
4987 * @priv: private driver interface data from init()
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004988 * @sa: secure association
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004989 * Returns: 0 on success, -1 on failure
4990 */
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08004991 int (*disable_transmit_sa)(void *priv, struct transmit_sa *sa);
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -07004992#endif /* CONFIG_MACSEC */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08004993
4994 /**
4995 * init_mesh - Driver specific initialization for mesh
4996 * @priv: Private driver interface data
4997 * Returns: 0 on success, -1 on failure
4998 */
4999 int (*init_mesh)(void *priv);
5000
5001 /**
5002 * join_mesh - Join a mesh network
5003 * @priv: Private driver interface data
5004 * @params: Mesh configuration parameters
5005 * Returns: 0 on success, -1 on failure
5006 */
5007 int (*join_mesh)(void *priv,
5008 struct wpa_driver_mesh_join_params *params);
5009
5010 /**
5011 * leave_mesh - Leave a mesh network
5012 * @priv: Private driver interface data
5013 * Returns 0 on success, -1 on failure
5014 */
5015 int (*leave_mesh)(void *priv);
5016
5017 /**
Hai Shalom81f62d82019-07-22 12:10:00 -07005018 * probe_mesh_link - Inject a frame over direct mesh link to a given
5019 * peer skipping the next_hop lookup from mpath table.
5020 * @priv: Private driver interface data
5021 * @addr: Peer MAC address
5022 * @eth: Ethernet frame to be sent
5023 * @len: Ethernet frame lengtn in bytes
5024 * Returns 0 on success, -1 on failure
5025 */
5026 int (*probe_mesh_link)(void *priv, const u8 *addr, const u8 *eth,
5027 size_t len);
5028
5029 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08005030 * do_acs - Automatically select channel
5031 * @priv: Private driver interface data
5032 * @params: Parameters for ACS
5033 * Returns 0 on success, -1 on failure
5034 *
5035 * This command can be used to offload ACS to the driver if the driver
5036 * indicates support for such offloading (WPA_DRIVER_FLAGS_ACS_OFFLOAD).
5037 */
5038 int (*do_acs)(void *priv, struct drv_acs_params *params);
Ravi Joshie6ccb162015-07-16 17:45:41 -07005039
5040 /**
Hai Shalom60840252021-02-19 19:02:11 -08005041 * set_band - Notify driver of band(s) selection
Ravi Joshie6ccb162015-07-16 17:45:41 -07005042 * @priv: Private driver interface data
Hai Shalom60840252021-02-19 19:02:11 -08005043 * @band_mask: The selected band(s) bit mask (from enum set_band)
Ravi Joshie6ccb162015-07-16 17:45:41 -07005044 * Returns 0 on success, -1 on failure
5045 */
Hai Shalom60840252021-02-19 19:02:11 -08005046 int (*set_band)(void *priv, u32 band_mask);
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08005047
5048 /**
5049 * get_pref_freq_list - Get preferred frequency list for an interface
5050 * @priv: Private driver interface data
5051 * @if_type: Interface type
5052 * @num: Number of channels
Sunil8cd6f4d2022-06-28 18:40:46 +00005053 * @freq_list: Weighted preferred channel list
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08005054 * Returns 0 on success, -1 on failure
5055 *
5056 * This command can be used to query the preferred frequency list from
Sunil8cd6f4d2022-06-28 18:40:46 +00005057 * the driver specific to a particular interface type. The freq_list
5058 * array needs to have room for *num entries. *num will be updated to
5059 * indicate the number of entries fetched from the driver.
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08005060 */
5061 int (*get_pref_freq_list)(void *priv, enum wpa_driver_if_type if_type,
Sunil8cd6f4d2022-06-28 18:40:46 +00005062 unsigned int *num,
5063 struct weighted_pcl *freq_list);
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08005064
5065 /**
5066 * set_prob_oper_freq - Indicate probable P2P operating channel
5067 * @priv: Private driver interface data
5068 * @freq: Channel frequency in MHz
5069 * Returns 0 on success, -1 on failure
5070 *
5071 * This command can be used to inform the driver of the operating
5072 * frequency that an ongoing P2P group formation is likely to come up
5073 * on. Local device is assuming P2P Client role.
5074 */
5075 int (*set_prob_oper_freq)(void *priv, unsigned int freq);
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08005076
5077 /**
5078 * abort_scan - Request the driver to abort an ongoing scan
5079 * @priv: Private driver interface data
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08005080 * @scan_cookie: Cookie identifying the scan request. This is used only
5081 * when the vendor interface QCA_NL80211_VENDOR_SUBCMD_TRIGGER_SCAN
5082 * was used to trigger scan. Otherwise, 0 is used.
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08005083 * Returns 0 on success, -1 on failure
5084 */
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08005085 int (*abort_scan)(void *priv, u64 scan_cookie);
Dmitry Shmidt849734c2016-05-27 09:59:01 -07005086
5087 /**
5088 * configure_data_frame_filters - Request to configure frame filters
5089 * @priv: Private driver interface data
5090 * @filter_flags: The type of frames to filter (bitfield of
5091 * WPA_DATA_FRAME_FILTER_FLAG_*)
5092 * Returns: 0 on success or -1 on failure
5093 */
5094 int (*configure_data_frame_filters)(void *priv, u32 filter_flags);
Dmitry Shmidtd5ab1b52016-06-21 12:38:41 -07005095
5096 /**
5097 * get_ext_capab - Get extended capabilities for the specified interface
5098 * @priv: Private driver interface data
5099 * @type: Interface type for which to get extended capabilities
5100 * @ext_capab: Extended capabilities fetched
5101 * @ext_capab_mask: Extended capabilities mask
5102 * @ext_capab_len: Length of the extended capabilities
5103 * Returns: 0 on success or -1 on failure
5104 */
5105 int (*get_ext_capab)(void *priv, enum wpa_driver_if_type type,
5106 const u8 **ext_capab, const u8 **ext_capab_mask,
5107 unsigned int *ext_capab_len);
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07005108
5109 /**
Sunil Ravi2a14cf12023-11-21 00:54:38 +00005110 * get_mld_capab - Get MLD capabilities for the specified interface
5111 * @priv: Private driver interface data
5112 * @type: Interface type for which to get MLD capabilities
5113 * @eml_capa: EML capabilities
5114 * @mld_capa_and_ops: MLD Capabilities and Operations
5115 * Returns: 0 on success or -1 on failure
5116 */
5117 int (*get_mld_capab)(void *priv, enum wpa_driver_if_type type,
5118 u16 *eml_capa, u16 *mld_capa_and_ops);
5119
5120 /**
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07005121 * p2p_lo_start - Start offloading P2P listen to device
5122 * @priv: Private driver interface data
5123 * @freq: Listening frequency (MHz) for P2P listen
5124 * @period: Length of the listen operation in milliseconds
5125 * @interval: Interval for running the listen operation in milliseconds
5126 * @count: Number of times to run the listen operation
5127 * @device_types: Device primary and secondary types
5128 * @dev_types_len: Number of bytes for device_types
5129 * @ies: P2P IE and WSC IE for Probe Response frames
5130 * @ies_len: Length of ies in bytes
5131 * Returns: 0 on success or -1 on failure
5132 */
5133 int (*p2p_lo_start)(void *priv, unsigned int freq,
5134 unsigned int period, unsigned int interval,
5135 unsigned int count,
5136 const u8 *device_types, size_t dev_types_len,
5137 const u8 *ies, size_t ies_len);
5138
5139 /**
5140 * p2p_lo_stop - Stop P2P listen offload
5141 * @priv: Private driver interface data
5142 * Returns: 0 on success or -1 on failure
5143 */
5144 int (*p2p_lo_stop)(void *priv);
Dmitry Shmidt7f2c7532016-08-15 09:48:12 -07005145
5146 /**
5147 * set_default_scan_ies - Set default scan IEs
5148 * @priv: Private driver interface data
5149 * @ies: Scan default IEs buffer
5150 * @ies_len: Length of IEs in bytes
5151 * Returns: 0 on success or -1 on failure
5152 *
5153 * The driver can use these by default when there are no scan IEs coming
5154 * in the subsequent scan requests. Also in case of one or more of IEs
5155 * given in set_default_scan_ies() are missing in the subsequent scan
5156 * request, the driver should merge the missing scan IEs in the scan
5157 * request from the IEs set by set_default_scan_ies() in the Probe
5158 * Request frames sent.
5159 */
5160 int (*set_default_scan_ies)(void *priv, const u8 *ies, size_t ies_len);
5161
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08005162 /**
5163 * set_tdls_mode - Set TDLS trigger mode to the host driver
5164 * @priv: Private driver interface data
5165 * @tdls_external_control: Represents if TDLS external trigger control
5166 * mode is enabled/disabled.
5167 *
5168 * This optional callback can be used to configure the TDLS external
5169 * trigger control mode to the host driver.
5170 */
5171 int (*set_tdls_mode)(void *priv, int tdls_external_control);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005172
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005173 /**
5174 * get_bss_transition_status - Get candidate BSS's transition status
5175 * @priv: Private driver interface data
5176 * @params: Candidate BSS list
5177 *
5178 * Get the accept or reject reason code for a list of BSS transition
5179 * candidates.
5180 */
5181 struct wpa_bss_candidate_info *
5182 (*get_bss_transition_status)(void *priv,
5183 struct wpa_bss_trans_info *params);
5184 /**
5185 * ignore_assoc_disallow - Configure driver to ignore assoc_disallow
5186 * @priv: Private driver interface data
5187 * @ignore_disallow: 0 to not ignore, 1 to ignore
5188 * Returns: 0 on success, -1 on failure
5189 */
5190 int (*ignore_assoc_disallow)(void *priv, int ignore_disallow);
5191
5192 /**
Hai Shalom899fcc72020-10-19 14:38:18 -07005193 * set_bssid_tmp_disallow - Set disallowed BSSIDs to the driver
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005194 * @priv: Private driver interface data
Hai Shalom899fcc72020-10-19 14:38:18 -07005195 * @num_bssid: Number of temporarily disallowed BSSIDs
5196 * @bssids: List of temporarily disallowed BSSIDs
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005197 */
Hai Shalom899fcc72020-10-19 14:38:18 -07005198 int (*set_bssid_tmp_disallow)(void *priv, unsigned int num_bssid,
5199 const u8 *bssid);
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005200
5201 /**
5202 * update_connect_params - Update the connection parameters
5203 * @priv: Private driver interface data
5204 * @params: Association parameters
5205 * @mask: Bit mask indicating which parameters in @params have to be
5206 * updated
5207 * Returns: 0 on success, -1 on failure
5208 *
5209 * Update the connection parameters when in connected state so that the
5210 * driver uses the updated parameters for subsequent roaming. This is
5211 * used only with drivers that implement internal BSS selection and
5212 * roaming.
5213 */
5214 int (*update_connect_params)(
5215 void *priv, struct wpa_driver_associate_params *params,
5216 enum wpa_drv_update_connect_params_mask mask);
Roshan Pius3a1667e2018-07-03 15:17:14 -07005217
5218 /**
5219 * send_external_auth_status - Indicate the status of external
5220 * authentication processing to the host driver.
5221 * @priv: Private driver interface data
5222 * @params: Status of authentication processing.
5223 * Returns: 0 on success, -1 on failure
5224 */
5225 int (*send_external_auth_status)(void *priv,
5226 struct external_auth *params);
Hai Shalom74f70d42019-02-11 14:42:39 -08005227
5228 /**
5229 * set_4addr_mode - Set 4-address mode
5230 * @priv: Private driver interface data
5231 * @bridge_ifname: Bridge interface name
5232 * @val: 0 - disable 4addr mode, 1 - enable 4addr mode
5233 * Returns: 0 on success, < 0 on failure
5234 */
5235 int (*set_4addr_mode)(void *priv, const char *bridge_ifname, int val);
Hai Shalom81f62d82019-07-22 12:10:00 -07005236
5237 /**
5238 * update_dh_ie - Update DH IE
5239 * @priv: Private driver interface data
5240 * @peer_mac: Peer MAC address
5241 * @reason_code: Reacon code
5242 * @ie: DH IE
5243 * @ie_len: DH IE length in bytes
5244 * Returns: 0 on success, -1 on failure
5245 *
5246 * This callback is used to let the driver know the DH processing result
5247 * and DH IE for a pending association.
5248 */
5249 int (*update_dh_ie)(void *priv, const u8 *peer_mac, u16 reason_code,
5250 const u8 *ie, size_t ie_len);
Hai Shalomb755a2a2020-04-23 21:49:02 -07005251
5252 /**
5253 * dpp_listen - Notify driver about start/stop of DPP listen
5254 * @priv: Private driver interface data
5255 * @enable: Whether listen state is enabled (or disabled)
5256 * Returns: 0 on success, -1 on failure
5257 *
5258 * This optional callback can be used to update RX frame filtering to
5259 * explicitly allow reception of broadcast Public Action frames.
5260 */
Hai Shalome21d4e82020-04-29 16:34:06 -07005261 int (*dpp_listen)(void *priv, bool enable);
Hai Shalomc1a21442022-02-04 13:43:00 -08005262
Sunil Ravi89eba102022-09-13 21:04:37 -07005263 /**
5264 * set_secure_ranging_ctx - Add or delete secure ranging parameters of
5265 * the specified peer to the driver.
5266 * @priv: Private driver interface data
5267 * @params: Secure ranging parameters
5268 * Returns: 0 on success, -1 on failure
5269 *
5270 */
5271 int (*set_secure_ranging_ctx)(void *priv,
5272 struct secure_ranging_params *params);
5273
5274 /**
5275 * send_pasn_resp - Send PASN response for a set of peers to the
5276 * driver.
5277 * @priv: Private driver interface data
5278 * @params: Parameters holding peers and respective status.
5279 * Returns: 0 on success, -1 on failure
5280 */
5281 int (*send_pasn_resp)(void *priv, struct pasn_auth *params);
5282
5283 /**
5284 * get_sta_mlo_info - Get the current multi-link association info
5285 * @priv: Private driver interface data
5286 * @mlo: Pointer to fill multi-link association info
5287 * Returns: 0 on success, -1 on failure
5288 *
5289 * This callback is used to fetch multi-link of the current association.
5290 */
5291 int (*get_sta_mlo_info)(void *priv,
5292 struct driver_sta_mlo_info *mlo_info);
5293
Sunil Ravi036cec52023-03-29 11:35:17 -07005294 /**
5295 * link_add - Add a link to the AP MLD interface
5296 * @priv: Private driver interface data
5297 * @link_id: The link ID
5298 * @addr: The MAC address to use for the link
Sunil Ravi99c035e2024-07-12 01:42:03 +00005299 * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces
Sunil Ravi036cec52023-03-29 11:35:17 -07005300 * Returns: 0 on success, negative value on failure
5301 */
Sunil Ravi99c035e2024-07-12 01:42:03 +00005302 int (*link_add)(void *priv, u8 link_id, const u8 *addr, void *bss_ctx);
5303
5304 /**
5305 * link_remove - Remove a link from the AP MLD interface
5306 * @priv: Private driver interface data
5307 * @type: Interface type
5308 * @ifname: Interface name of the virtual interface from where the link
5309 * is to be removed.
5310 * @link_id: Valid link ID to remove
5311 * Returns: 0 on success, -1 on failure
5312 */
5313 int (*link_remove)(void *priv, enum wpa_driver_if_type type,
5314 const char *ifname, u8 link_id);
5315
5316 /**
5317 * is_drv_shared - Check whether the driver interface is shared
5318 * @priv: Private driver interface data from init()
Sunil Ravic0f5d412024-09-11 22:12:49 +00005319 * @link_id: Link ID to match
5320 * Returns: true if it is being used or else false.
Sunil Ravi99c035e2024-07-12 01:42:03 +00005321 *
5322 * Checks whether the driver interface is being used by other partner
5323 * BSS(s) or not. This is used to decide whether the driver interface
5324 * needs to be deinitilized when one interface is getting deinitialized.
5325 *
Sunil Ravic0f5d412024-09-11 22:12:49 +00005326 * NOTE: @link_id will be used only when there is only one BSS
5327 * present and if that single link is active. In that case, the
5328 * link ID is matched with the active link_id to decide whether the
5329 * driver interface is being used by other partner BSS(s).
Sunil Ravi99c035e2024-07-12 01:42:03 +00005330 */
Sunil Ravic0f5d412024-09-11 22:12:49 +00005331 bool (*is_drv_shared)(void *priv, int link_id);
Sunil Ravi99c035e2024-07-12 01:42:03 +00005332
5333 /**
5334 * link_sta_remove - Remove a link STA from an MLD STA
5335 * @priv: Private driver interface data
5336 * @link_id: The link ID which the link STA is using
5337 * @addr: The MLD MAC address of the MLD STA
5338 * Returns: 0 on success, negative value on failure
5339 */
5340 int (*link_sta_remove)(void *priv, u8 link_id, const u8 *addr);
Sunil Ravi036cec52023-03-29 11:35:17 -07005341
Sunil Ravic0f5d412024-09-11 22:12:49 +00005342 /**
5343 * nan_flush - Flush all NAN offload services
5344 * @priv: Private driver interface data
5345 * Returns: 0 on success, negative value on failure
5346 */
5347 int (*nan_flush)(void *priv);
5348
5349 /**
5350 * nan_publish - NAN offload for Publish()
5351 * @priv: Private driver interface data
5352 * @src: Source P2P device addr
5353 * @publish_id: Publish instance to add
5354 * @service_name: Service name
5355 * @service_id: Service ID (6 octet value derived from service name)
5356 * @srv_proto_type: Service protocol type
5357 * @ssi: Service specific information or %NULL
5358 * @elems: Information elements for Element Container attribute or %NULL
5359 * @params: Configuration parameters
5360 * Returns: 0 on success, negative value on failure
5361 */
5362 int (*nan_publish)(void *priv, const u8 *src, int publish_id,
5363 const char *service_name, const u8 *service_id,
5364 enum nan_service_protocol_type srv_proto_type,
5365 const struct wpabuf *ssi, const struct wpabuf *elems,
5366 struct nan_publish_params *params);
5367
5368 /**
5369 * nan_cancel_publish - NAN offload for CancelPublish()
5370 * @priv: Private driver interface data
5371 * @publish_id: Publish instance to cancel
5372 * Returns: 0 on success, negative value on failure
5373 */
5374 int (*nan_cancel_publish)(void *priv, int publish_id);
5375
5376 /**
5377 * nan_update_publish - NAN offload for UpdatePublish()
5378 * @priv: Private driver interface data
5379 * @ssi: Service specific information or %NULL
5380 * Returns: 0 on success, negative value on failure
5381 */
5382 int (*nan_update_publish)(void *priv, int publish_id,
5383 const struct wpabuf *ssi);
5384
5385 /**
5386 * nan_subscribe - NAN offload for Subscribe()
5387 * @priv: Private driver interface data
5388 * @src: Source P2P device addr
5389 * @subscribe_id: Subscribe instance to add
5390 * @service_name: Service name
5391 * @service_id: Service ID (6 octet value derived from service name)
5392 * @srv_proto_type: Service protocol type
5393 * @ssi: Service specific information or %NULL
5394 * @elems: Information elements for Element Container attribute or %NULL
5395 * @params: Configuration parameters
5396 * Returns: 0 on success, negative value on failure
5397 */
5398 int (*nan_subscribe)(void *priv, const u8 *src, int subscribe_id,
5399 const char *service_name, const u8 *service_id,
5400 enum nan_service_protocol_type srv_proto_type,
5401 const struct wpabuf *ssi,
5402 const struct wpabuf *elems,
5403 struct nan_subscribe_params *params);
5404
5405 /**
5406 * nan_cancel_subscribe - NAN offload for CancelSubscribe()
5407 * @priv: Private driver interface data
5408 * @subscribe_id: Subscribe instance to cancel
5409 * Returns: 0 on success, negative value on failure
5410 */
5411 int (*nan_cancel_subscribe)(void *priv, int subscribe_id);
5412
Sunil Ravi79e6c4f2025-01-04 00:47:06 +00005413 /**
5414 * can_share_drv - Check whether driver interface can be shared
5415 * @ctx: Pointer to hostapd context
5416 * @params: Configuration for the driver wrapper
5417 * @hapd: Pointer for overwriting the hapd context or %NULL
5418 * if can't find a shared drv
5419 *
5420 * Checks whether the driver interface with same phy name is
5421 * already present under the global driver which can be shared
5422 * instead of creating a new driver interface instance. If present,
5423 * @hapd will be overwritten with the hapd pointer which this shared
5424 * drv's first BSS is using. This will help the caller to later call
5425 * if_add().
5426 *
5427 * Returns: true if it can be shared or else false.
5428 */
5429 bool (*can_share_drv)(void *ctx, struct wpa_init_params *params,
5430 void **hapd);
5431
Hai Shalomc1a21442022-02-04 13:43:00 -08005432#ifdef CONFIG_TESTING_OPTIONS
5433 int (*register_frame)(void *priv, u16 type,
5434 const u8 *match, size_t match_len,
5435 bool multicast);
5436#endif /* CONFIG_TESTING_OPTIONS */
Sunil Ravic0f5d412024-09-11 22:12:49 +00005437
5438 /**
5439 * get_multi_hw_info - Get multiple underlying hardware information
5440 * (hardware IDx and supported frequency range)
5441 * @priv: Private driver interface data
5442 * @num_multi_hws: Variable for returning the number of returned
5443 * hardware info data
5444 * Returns: Pointer to allocated multiple hardware data on success
5445 * or %NULL on failure. Caller is responsible for freeing this.
5446 */
5447 struct hostapd_multi_hw_info *
5448 (*get_multi_hw_info)(void *priv, unsigned int *num_multi_hws);
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005449};
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005450
5451/**
5452 * enum wpa_event_type - Event type for wpa_supplicant_event() calls
5453 */
5454enum wpa_event_type {
5455 /**
5456 * EVENT_ASSOC - Association completed
5457 *
5458 * This event needs to be delivered when the driver completes IEEE
5459 * 802.11 association or reassociation successfully.
5460 * wpa_driver_ops::get_bssid() is expected to provide the current BSSID
5461 * after this event has been generated. In addition, optional
5462 * EVENT_ASSOCINFO may be generated just before EVENT_ASSOC to provide
5463 * more information about the association. If the driver interface gets
5464 * both of these events at the same time, it can also include the
5465 * assoc_info data in EVENT_ASSOC call.
5466 */
5467 EVENT_ASSOC,
5468
5469 /**
5470 * EVENT_DISASSOC - Association lost
5471 *
5472 * This event should be called when association is lost either due to
5473 * receiving deauthenticate or disassociate frame from the AP or when
5474 * sending either of these frames to the current AP. If the driver
5475 * supports separate deauthentication event, EVENT_DISASSOC should only
5476 * be used for disassociation and EVENT_DEAUTH for deauthentication.
5477 * In AP mode, union wpa_event_data::disassoc_info is required.
5478 */
5479 EVENT_DISASSOC,
5480
5481 /**
5482 * EVENT_MICHAEL_MIC_FAILURE - Michael MIC (TKIP) detected
5483 *
5484 * This event must be delivered when a Michael MIC error is detected by
5485 * the local driver. Additional data for event processing is
5486 * provided with union wpa_event_data::michael_mic_failure. This
Sunil Ravia04bd252022-05-02 22:54:18 -07005487 * information is used to request new encryption key and to initiate
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005488 * TKIP countermeasures if needed.
5489 */
5490 EVENT_MICHAEL_MIC_FAILURE,
5491
5492 /**
5493 * EVENT_SCAN_RESULTS - Scan results available
5494 *
5495 * This event must be called whenever scan results are available to be
5496 * fetched with struct wpa_driver_ops::get_scan_results(). This event
5497 * is expected to be used some time after struct wpa_driver_ops::scan()
5498 * is called. If the driver provides an unsolicited event when the scan
5499 * has been completed, this event can be used to trigger
5500 * EVENT_SCAN_RESULTS call. If such event is not available from the
5501 * driver, the driver wrapper code is expected to use a registered
5502 * timeout to generate EVENT_SCAN_RESULTS call after the time that the
5503 * scan is expected to be completed. Optional information about
5504 * completed scan can be provided with union wpa_event_data::scan_info.
5505 */
5506 EVENT_SCAN_RESULTS,
5507
5508 /**
5509 * EVENT_ASSOCINFO - Report optional extra information for association
5510 *
5511 * This event can be used to report extra association information for
5512 * EVENT_ASSOC processing. This extra information includes IEs from
5513 * association frames and Beacon/Probe Response frames in union
5514 * wpa_event_data::assoc_info. EVENT_ASSOCINFO must be send just before
5515 * EVENT_ASSOC. Alternatively, the driver interface can include
5516 * assoc_info data in the EVENT_ASSOC call if it has all the
5517 * information available at the same point.
5518 */
5519 EVENT_ASSOCINFO,
5520
5521 /**
5522 * EVENT_INTERFACE_STATUS - Report interface status changes
5523 *
5524 * This optional event can be used to report changes in interface
5525 * status (interface added/removed) using union
5526 * wpa_event_data::interface_status. This can be used to trigger
5527 * wpa_supplicant to stop and re-start processing for the interface,
5528 * e.g., when a cardbus card is ejected/inserted.
5529 */
5530 EVENT_INTERFACE_STATUS,
5531
5532 /**
5533 * EVENT_PMKID_CANDIDATE - Report a candidate AP for pre-authentication
5534 *
5535 * This event can be used to inform wpa_supplicant about candidates for
5536 * RSN (WPA2) pre-authentication. If wpa_supplicant is not responsible
5537 * for scan request (ap_scan=2 mode), this event is required for
5538 * pre-authentication. If wpa_supplicant is performing scan request
5539 * (ap_scan=1), this event is optional since scan results can be used
5540 * to add pre-authentication candidates. union
5541 * wpa_event_data::pmkid_candidate is used to report the BSSID of the
5542 * candidate and priority of the candidate, e.g., based on the signal
5543 * strength, in order to try to pre-authenticate first with candidates
5544 * that are most likely targets for re-association.
5545 *
5546 * EVENT_PMKID_CANDIDATE can be called whenever the driver has updates
5547 * on the candidate list. In addition, it can be called for the current
5548 * AP and APs that have existing PMKSA cache entries. wpa_supplicant
5549 * will automatically skip pre-authentication in cases where a valid
5550 * PMKSA exists. When more than one candidate exists, this event should
5551 * be generated once for each candidate.
5552 *
5553 * Driver will be notified about successful pre-authentication with
5554 * struct wpa_driver_ops::add_pmkid() calls.
5555 */
5556 EVENT_PMKID_CANDIDATE,
5557
5558 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005559 * EVENT_TDLS - Request TDLS operation
5560 *
5561 * This event can be used to request a TDLS operation to be performed.
5562 */
5563 EVENT_TDLS,
5564
5565 /**
5566 * EVENT_FT_RESPONSE - Report FT (IEEE 802.11r) response IEs
5567 *
5568 * The driver is expected to report the received FT IEs from
5569 * FT authentication sequence from the AP. The FT IEs are included in
5570 * the extra information in union wpa_event_data::ft_ies.
5571 */
5572 EVENT_FT_RESPONSE,
5573
5574 /**
5575 * EVENT_IBSS_RSN_START - Request RSN authentication in IBSS
5576 *
5577 * The driver can use this event to inform wpa_supplicant about a STA
5578 * in an IBSS with which protected frames could be exchanged. This
5579 * event starts RSN authentication with the other STA to authenticate
5580 * the STA and set up encryption keys with it.
5581 */
5582 EVENT_IBSS_RSN_START,
5583
5584 /**
5585 * EVENT_AUTH - Authentication result
5586 *
5587 * This event should be called when authentication attempt has been
5588 * completed. This is only used if the driver supports separate
5589 * authentication step (struct wpa_driver_ops::authenticate).
5590 * Information about authentication result is included in
5591 * union wpa_event_data::auth.
5592 */
5593 EVENT_AUTH,
5594
5595 /**
5596 * EVENT_DEAUTH - Authentication lost
5597 *
5598 * This event should be called when authentication is lost either due
5599 * to receiving deauthenticate frame from the AP or when sending that
5600 * frame to the current AP.
5601 * In AP mode, union wpa_event_data::deauth_info is required.
5602 */
5603 EVENT_DEAUTH,
5604
5605 /**
5606 * EVENT_ASSOC_REJECT - Association rejected
5607 *
5608 * This event should be called when (re)association attempt has been
5609 * rejected by the AP. Information about the association response is
5610 * included in union wpa_event_data::assoc_reject.
5611 */
5612 EVENT_ASSOC_REJECT,
5613
5614 /**
5615 * EVENT_AUTH_TIMED_OUT - Authentication timed out
5616 */
5617 EVENT_AUTH_TIMED_OUT,
5618
5619 /**
5620 * EVENT_ASSOC_TIMED_OUT - Association timed out
5621 */
5622 EVENT_ASSOC_TIMED_OUT,
5623
5624 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005625 * EVENT_WPS_BUTTON_PUSHED - Report hardware push button press for WPS
5626 */
5627 EVENT_WPS_BUTTON_PUSHED,
5628
5629 /**
5630 * EVENT_TX_STATUS - Report TX status
5631 */
5632 EVENT_TX_STATUS,
5633
5634 /**
5635 * EVENT_RX_FROM_UNKNOWN - Report RX from unknown STA
5636 */
5637 EVENT_RX_FROM_UNKNOWN,
5638
5639 /**
5640 * EVENT_RX_MGMT - Report RX of a management frame
5641 */
5642 EVENT_RX_MGMT,
5643
5644 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005645 * EVENT_REMAIN_ON_CHANNEL - Remain-on-channel duration started
5646 *
5647 * This event is used to indicate when the driver has started the
5648 * requested remain-on-channel duration. Information about the
5649 * operation is included in union wpa_event_data::remain_on_channel.
5650 */
5651 EVENT_REMAIN_ON_CHANNEL,
5652
5653 /**
5654 * EVENT_CANCEL_REMAIN_ON_CHANNEL - Remain-on-channel timed out
5655 *
5656 * This event is used to indicate when the driver has completed
5657 * remain-on-channel duration, i.e., may noot be available on the
5658 * requested channel anymore. Information about the
5659 * operation is included in union wpa_event_data::remain_on_channel.
5660 */
5661 EVENT_CANCEL_REMAIN_ON_CHANNEL,
5662
5663 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005664 * EVENT_RX_PROBE_REQ - Indicate received Probe Request frame
5665 *
5666 * This event is used to indicate when a Probe Request frame has been
5667 * received. Information about the received frame is included in
5668 * union wpa_event_data::rx_probe_req. The driver is required to report
5669 * these events only after successfully completed probe_req_report()
5670 * commands to request the events (i.e., report parameter is non-zero)
5671 * in station mode. In AP mode, Probe Request frames should always be
5672 * reported.
5673 */
5674 EVENT_RX_PROBE_REQ,
5675
5676 /**
5677 * EVENT_NEW_STA - New wired device noticed
5678 *
5679 * This event is used to indicate that a new device has been detected
5680 * in a network that does not use association-like functionality (i.e.,
5681 * mainly wired Ethernet). This can be used to start EAPOL
5682 * authenticator when receiving a frame from a device. The address of
5683 * the device is included in union wpa_event_data::new_sta.
5684 */
5685 EVENT_NEW_STA,
5686
5687 /**
5688 * EVENT_EAPOL_RX - Report received EAPOL frame
5689 *
5690 * When in AP mode with hostapd, this event is required to be used to
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08005691 * deliver the receive EAPOL frames from the driver.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005692 */
5693 EVENT_EAPOL_RX,
5694
5695 /**
5696 * EVENT_SIGNAL_CHANGE - Indicate change in signal strength
5697 *
5698 * This event is used to indicate changes in the signal strength
5699 * observed in frames received from the current AP if signal strength
5700 * monitoring has been enabled with signal_monitor().
5701 */
5702 EVENT_SIGNAL_CHANGE,
5703
5704 /**
5705 * EVENT_INTERFACE_ENABLED - Notify that interface was enabled
5706 *
5707 * This event is used to indicate that the interface was enabled after
5708 * having been previously disabled, e.g., due to rfkill.
5709 */
5710 EVENT_INTERFACE_ENABLED,
5711
5712 /**
5713 * EVENT_INTERFACE_DISABLED - Notify that interface was disabled
5714 *
5715 * This event is used to indicate that the interface was disabled,
5716 * e.g., due to rfkill.
5717 */
5718 EVENT_INTERFACE_DISABLED,
5719
5720 /**
5721 * EVENT_CHANNEL_LIST_CHANGED - Channel list changed
5722 *
5723 * This event is used to indicate that the channel list has changed,
5724 * e.g., because of a regulatory domain change triggered by scan
5725 * results including an AP advertising a country code.
5726 */
5727 EVENT_CHANNEL_LIST_CHANGED,
5728
5729 /**
5730 * EVENT_INTERFACE_UNAVAILABLE - Notify that interface is unavailable
5731 *
5732 * This event is used to indicate that the driver cannot maintain this
5733 * interface in its operation mode anymore. The most likely use for
5734 * this is to indicate that AP mode operation is not available due to
5735 * operating channel would need to be changed to a DFS channel when
5736 * the driver does not support radar detection and another virtual
5737 * interfaces caused the operating channel to change. Other similar
5738 * resource conflicts could also trigger this for station mode
Dmitry Shmidtd30ac602014-06-30 09:54:22 -07005739 * interfaces. This event can be propagated when channel switching
5740 * fails.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005741 */
5742 EVENT_INTERFACE_UNAVAILABLE,
5743
5744 /**
5745 * EVENT_BEST_CHANNEL
5746 *
5747 * Driver generates this event whenever it detects a better channel
5748 * (e.g., based on RSSI or channel use). This information can be used
5749 * to improve channel selection for a new AP/P2P group.
5750 */
5751 EVENT_BEST_CHANNEL,
5752
5753 /**
5754 * EVENT_UNPROT_DEAUTH - Unprotected Deauthentication frame received
5755 *
5756 * This event should be called when a Deauthentication frame is dropped
5757 * due to it not being protected (MFP/IEEE 802.11w).
5758 * union wpa_event_data::unprot_deauth is required to provide more
5759 * details of the frame.
5760 */
5761 EVENT_UNPROT_DEAUTH,
5762
5763 /**
5764 * EVENT_UNPROT_DISASSOC - Unprotected Disassociation frame received
5765 *
5766 * This event should be called when a Disassociation frame is dropped
5767 * due to it not being protected (MFP/IEEE 802.11w).
5768 * union wpa_event_data::unprot_disassoc is required to provide more
5769 * details of the frame.
5770 */
5771 EVENT_UNPROT_DISASSOC,
5772
5773 /**
5774 * EVENT_STATION_LOW_ACK
5775 *
5776 * Driver generates this event whenever it detected that a particular
5777 * station was lost. Detection can be through massive transmission
5778 * failures for example.
5779 */
5780 EVENT_STATION_LOW_ACK,
5781
5782 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07005783 * EVENT_IBSS_PEER_LOST - IBSS peer not reachable anymore
5784 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08005785 EVENT_IBSS_PEER_LOST,
5786
5787 /**
5788 * EVENT_DRIVER_GTK_REKEY - Device/driver did GTK rekey
5789 *
5790 * This event carries the new replay counter to notify wpa_supplicant
5791 * of the current EAPOL-Key Replay Counter in case the driver/firmware
5792 * completed Group Key Handshake while the host (including
5793 * wpa_supplicant was sleeping).
5794 */
5795 EVENT_DRIVER_GTK_REKEY,
5796
5797 /**
5798 * EVENT_SCHED_SCAN_STOPPED - Scheduled scan was stopped
5799 */
5800 EVENT_SCHED_SCAN_STOPPED,
5801
5802 /**
5803 * EVENT_DRIVER_CLIENT_POLL_OK - Station responded to poll
5804 *
5805 * This event indicates that the station responded to the poll
5806 * initiated with @poll_client.
5807 */
5808 EVENT_DRIVER_CLIENT_POLL_OK,
5809
5810 /**
5811 * EVENT_EAPOL_TX_STATUS - notify of EAPOL TX status
5812 */
Dmitry Shmidt04949592012-07-19 12:16:46 -07005813 EVENT_EAPOL_TX_STATUS,
5814
5815 /**
5816 * EVENT_CH_SWITCH - AP or GO decided to switch channels
5817 *
5818 * Described in wpa_event_data.ch_switch
5819 * */
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07005820 EVENT_CH_SWITCH,
5821
5822 /**
Hai Shalom81f62d82019-07-22 12:10:00 -07005823 * EVENT_CH_SWITCH_STARTED - AP or GO started to switch channels
5824 *
5825 * This is a pre-switch event indicating the shortly following switch
5826 * of operating channels.
5827 *
5828 * Described in wpa_event_data.ch_switch
5829 */
5830 EVENT_CH_SWITCH_STARTED,
5831 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07005832 * EVENT_WNM - Request WNM operation
5833 *
5834 * This event can be used to request a WNM operation to be performed.
5835 */
Dmitry Shmidtf8623282013-02-20 14:34:59 -08005836 EVENT_WNM,
5837
5838 /**
5839 * EVENT_CONNECT_FAILED_REASON - Connection failure reason in AP mode
5840 *
5841 * This event indicates that the driver reported a connection failure
5842 * with the specified client (for example, max client reached, etc.) in
5843 * AP mode.
5844 */
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005845 EVENT_CONNECT_FAILED_REASON,
5846
5847 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005848 * EVENT_DFS_RADAR_DETECTED - Notify of radar detection
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005849 *
5850 * A radar has been detected on the supplied frequency, hostapd should
5851 * react accordingly (e.g., change channel).
5852 */
5853 EVENT_DFS_RADAR_DETECTED,
5854
5855 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005856 * EVENT_DFS_CAC_FINISHED - Notify that channel availability check has been completed
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005857 *
5858 * After a successful CAC, the channel can be marked clear and used.
5859 */
5860 EVENT_DFS_CAC_FINISHED,
5861
5862 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005863 * EVENT_DFS_CAC_ABORTED - Notify that channel availability check has been aborted
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005864 *
5865 * The CAC was not successful, and the channel remains in the previous
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08005866 * state. This may happen due to a radar being detected or other
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005867 * external influences.
5868 */
5869 EVENT_DFS_CAC_ABORTED,
5870
5871 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005872 * EVENT_DFS_NOP_FINISHED - Notify that non-occupancy period is over
Dmitry Shmidtea69e842013-05-13 14:52:28 -07005873 *
5874 * The channel which was previously unavailable is now available again.
5875 */
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07005876 EVENT_DFS_NOP_FINISHED,
5877
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08005878 /**
5879 * EVENT_SURVEY - Received survey data
5880 *
5881 * This event gets triggered when a driver query is issued for survey
5882 * data and the requested data becomes available. The returned data is
5883 * stored in struct survey_results. The results provide at most one
5884 * survey entry for each frequency and at minimum will provide one
5885 * survey entry for one frequency. The survey data can be os_malloc()'d
5886 * and then os_free()'d, so the event callback must only copy data.
5887 */
5888 EVENT_SURVEY,
5889
5890 /**
5891 * EVENT_SCAN_STARTED - Scan started
5892 *
5893 * This indicates that driver has started a scan operation either based
5894 * on a request from wpa_supplicant/hostapd or from another application.
5895 * EVENT_SCAN_RESULTS is used to indicate when the scan has been
5896 * completed (either successfully or by getting cancelled).
5897 */
Dmitry Shmidtcf32e602014-01-28 10:57:39 -08005898 EVENT_SCAN_STARTED,
5899
5900 /**
5901 * EVENT_AVOID_FREQUENCIES - Received avoid frequency range
5902 *
5903 * This event indicates a set of frequency ranges that should be avoided
5904 * to reduce issues due to interference or internal co-existence
5905 * information in the driver.
5906 */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08005907 EVENT_AVOID_FREQUENCIES,
5908
5909 /**
5910 * EVENT_NEW_PEER_CANDIDATE - new (unknown) mesh peer notification
5911 */
5912 EVENT_NEW_PEER_CANDIDATE,
5913
5914 /**
5915 * EVENT_ACS_CHANNEL_SELECTED - Received selected channels by ACS
5916 *
5917 * Indicates a pair of primary and secondary channels chosen by ACS
5918 * in device.
5919 */
5920 EVENT_ACS_CHANNEL_SELECTED,
Dmitry Shmidt7f656022015-02-25 14:36:37 -08005921
5922 /**
5923 * EVENT_DFS_CAC_STARTED - Notify that channel availability check has
5924 * been started.
5925 *
5926 * This event indicates that channel availability check has been started
5927 * on a DFS frequency by a driver that supports DFS Offload.
5928 */
5929 EVENT_DFS_CAC_STARTED,
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07005930
5931 /**
5932 * EVENT_P2P_LO_STOP - Notify that P2P listen offload is stopped
5933 */
5934 EVENT_P2P_LO_STOP,
Paul Stewart092955c2017-02-06 09:13:09 -08005935
5936 /**
5937 * EVENT_BEACON_LOSS - Beacon loss detected
5938 *
5939 * This event indicates that no Beacon frames has been received from
5940 * the current AP. This may indicate that the AP is not anymore in
5941 * range.
5942 */
5943 EVENT_BEACON_LOSS,
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005944
5945 /**
5946 * EVENT_DFS_PRE_CAC_EXPIRED - Notify that channel availability check
5947 * done previously (Pre-CAC) on the channel has expired. This would
5948 * normally be on a non-ETSI DFS regulatory domain. DFS state of the
5949 * channel will be moved from available to usable. A new CAC has to be
5950 * performed before start operating on this channel.
5951 */
5952 EVENT_DFS_PRE_CAC_EXPIRED,
Roshan Pius3a1667e2018-07-03 15:17:14 -07005953
5954 /**
5955 * EVENT_EXTERNAL_AUTH - This event interface is used by host drivers
5956 * that do not define separate commands for authentication and
5957 * association (~WPA_DRIVER_FLAGS_SME) but offload the 802.11
5958 * authentication to wpa_supplicant. This event carries all the
5959 * necessary information from the host driver for the authentication to
5960 * happen.
5961 */
5962 EVENT_EXTERNAL_AUTH,
5963
5964 /**
5965 * EVENT_PORT_AUTHORIZED - Notification that a connection is authorized
5966 *
5967 * This event should be indicated when the driver completes the 4-way
5968 * handshake. This event should be preceded by an EVENT_ASSOC that
5969 * indicates the completion of IEEE 802.11 association.
5970 */
5971 EVENT_PORT_AUTHORIZED,
5972
5973 /**
5974 * EVENT_STATION_OPMODE_CHANGED - Notify STA's HT/VHT operation mode
5975 * change event.
5976 */
5977 EVENT_STATION_OPMODE_CHANGED,
5978
5979 /**
5980 * EVENT_INTERFACE_MAC_CHANGED - Notify that interface MAC changed
5981 *
5982 * This event is emitted when the MAC changes while the interface is
5983 * enabled. When an interface was disabled and becomes enabled, it
5984 * must be always assumed that the MAC possibly changed.
5985 */
5986 EVENT_INTERFACE_MAC_CHANGED,
5987
5988 /**
5989 * EVENT_WDS_STA_INTERFACE_STATUS - Notify WDS STA interface status
5990 *
5991 * This event is emitted when an interface is added/removed for WDS STA.
5992 */
5993 EVENT_WDS_STA_INTERFACE_STATUS,
Hai Shalom81f62d82019-07-22 12:10:00 -07005994
5995 /**
5996 * EVENT_UPDATE_DH - Notification of updated DH information
5997 */
5998 EVENT_UPDATE_DH,
Hai Shalomfdcde762020-04-02 11:19:20 -07005999
6000 /**
6001 * EVENT_UNPROT_BEACON - Unprotected Beacon frame received
6002 *
6003 * This event should be called when a Beacon frame is dropped due to it
6004 * not being protected correctly. union wpa_event_data::unprot_beacon
6005 * is required to provide more details of the frame.
6006 */
6007 EVENT_UNPROT_BEACON,
Hai Shalomc1a21442022-02-04 13:43:00 -08006008
6009 /**
6010 * EVENT_TX_WAIT_EXPIRE - TX wait timed out
6011 *
6012 * This event is used to indicate when the driver has completed
6013 * wait for a response frame based on a TX request that specified a
6014 * non-zero wait time and that has not been explicitly cancelled.
6015 */
6016 EVENT_TX_WAIT_EXPIRE,
Sunil Ravia04bd252022-05-02 22:54:18 -07006017
6018 /**
6019 * EVENT_BSS_COLOR_COLLISION - Notification of a BSS color collision
6020 */
6021 EVENT_BSS_COLOR_COLLISION,
6022
6023 /**
6024 * EVENT_CCA_STARTED_NOTIFY - Notification that CCA has started
6025 */
6026 EVENT_CCA_STARTED_NOTIFY,
6027
6028 /**
6029 * EVENT_CCA_ABORTED_NOTIFY - Notification that CCA has aborted
6030 */
6031 EVENT_CCA_ABORTED_NOTIFY,
6032
6033 /**
6034 * EVENT_CCA_NOTIFY - Notification that CCA has completed
6035 */
6036 EVENT_CCA_NOTIFY,
Sunil Ravi89eba102022-09-13 21:04:37 -07006037
6038 /**
6039 * EVENT_PASN_AUTH - This event is used by the driver that requests
6040 * PASN authentication and secure ranging context for multiple peers.
6041 */
6042 EVENT_PASN_AUTH,
6043
6044 /**
6045 * EVENT_LINK_CH_SWITCH - MLD AP link decided to switch channels
6046 *
6047 * Described in wpa_event_data.ch_switch.
6048 *
6049 */
6050 EVENT_LINK_CH_SWITCH,
6051
6052 /**
6053 * EVENT_LINK_CH_SWITCH_STARTED - MLD AP link started to switch channels
6054 *
6055 * This is a pre-switch event indicating the shortly following switch
6056 * of operating channels.
6057 *
6058 * Described in wpa_event_data.ch_switch.
6059 */
6060 EVENT_LINK_CH_SWITCH_STARTED,
Sunil Ravi640215c2023-06-28 23:08:09 +00006061
6062 /**
6063 * EVENT_TID_LINK_MAP - MLD event to set TID-to-link mapping
6064 *
6065 * This event is used by the driver to indicate the received TID-to-link
6066 * mapping response from the associated AP MLD.
6067 *
6068 * Described in wpa_event_data.t2l_map_info.
6069 */
6070 EVENT_TID_LINK_MAP,
6071
6072 /**
6073 * EVENT_LINK_RECONFIG - Notification that AP links removed
6074 */
6075 EVENT_LINK_RECONFIG,
Sunil Ravic0f5d412024-09-11 22:12:49 +00006076
6077 /**
6078 * EVENT_MLD_INTERFACE_FREED - Notification of AP MLD interface removal
6079 */
6080 EVENT_MLD_INTERFACE_FREED,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006081};
6082
6083
6084/**
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07006085 * struct freq_survey - Channel survey info
6086 *
6087 * @ifidx: Interface index in which this survey was observed
6088 * @freq: Center of frequency of the surveyed channel
6089 * @nf: Channel noise floor in dBm
6090 * @channel_time: Amount of time in ms the radio spent on the channel
6091 * @channel_time_busy: Amount of time in ms the radio detected some signal
6092 * that indicated to the radio the channel was not clear
6093 * @channel_time_rx: Amount of time the radio spent receiving data
6094 * @channel_time_tx: Amount of time the radio spent transmitting data
6095 * @filled: bitmask indicating which fields have been reported, see
6096 * SURVEY_HAS_* defines.
6097 * @list: Internal list pointers
6098 */
6099struct freq_survey {
6100 u32 ifidx;
6101 unsigned int freq;
6102 s8 nf;
6103 u64 channel_time;
6104 u64 channel_time_busy;
6105 u64 channel_time_rx;
6106 u64 channel_time_tx;
6107 unsigned int filled;
6108 struct dl_list list;
6109};
6110
6111#define SURVEY_HAS_NF BIT(0)
6112#define SURVEY_HAS_CHAN_TIME BIT(1)
6113#define SURVEY_HAS_CHAN_TIME_BUSY BIT(2)
6114#define SURVEY_HAS_CHAN_TIME_RX BIT(3)
6115#define SURVEY_HAS_CHAN_TIME_TX BIT(4)
6116
Hai Shalom60840252021-02-19 19:02:11 -08006117/**
6118 * enum sta_connect_fail_reason_codes - STA connect failure reason code values
6119 * @STA_CONNECT_FAIL_REASON_UNSPECIFIED: No reason code specified for
6120 * connection failure.
6121 * @STA_CONNECT_FAIL_REASON_NO_BSS_FOUND: No Probe Response frame received
6122 * for unicast Probe Request frame.
6123 * @STA_CONNECT_FAIL_REASON_AUTH_TX_FAIL: STA failed to send auth request.
6124 * @STA_CONNECT_FAIL_REASON_AUTH_NO_ACK_RECEIVED: AP didn't send ACK for
6125 * auth request.
6126 * @STA_CONNECT_FAIL_REASON_AUTH_NO_RESP_RECEIVED: Auth response is not
6127 * received from AP.
6128 * @STA_CONNECT_FAIL_REASON_ASSOC_REQ_TX_FAIL: STA failed to send
6129 * Association Request frame.
6130 * @STA_CONNECT_FAIL_REASON_ASSOC_NO_ACK_RECEIVED: AP didn't send ACK for
6131 * Association Request frame.
6132 * @STA_CONNECT_FAIL_REASON_ASSOC_NO_RESP_RECEIVED: Association Response
6133 * frame is not received from AP.
6134 */
6135enum sta_connect_fail_reason_codes {
6136 STA_CONNECT_FAIL_REASON_UNSPECIFIED = 0,
6137 STA_CONNECT_FAIL_REASON_NO_BSS_FOUND = 1,
6138 STA_CONNECT_FAIL_REASON_AUTH_TX_FAIL = 2,
6139 STA_CONNECT_FAIL_REASON_AUTH_NO_ACK_RECEIVED = 3,
6140 STA_CONNECT_FAIL_REASON_AUTH_NO_RESP_RECEIVED = 4,
6141 STA_CONNECT_FAIL_REASON_ASSOC_REQ_TX_FAIL = 5,
6142 STA_CONNECT_FAIL_REASON_ASSOC_NO_ACK_RECEIVED = 6,
6143 STA_CONNECT_FAIL_REASON_ASSOC_NO_RESP_RECEIVED = 7,
6144};
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07006145
6146/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006147 * union wpa_event_data - Additional data for wpa_supplicant_event() calls
6148 */
6149union wpa_event_data {
6150 /**
6151 * struct assoc_info - Data for EVENT_ASSOC and EVENT_ASSOCINFO events
6152 *
6153 * This structure is optional for EVENT_ASSOC calls and required for
6154 * EVENT_ASSOCINFO calls. By using EVENT_ASSOC with this data, the
6155 * driver interface does not need to generate separate EVENT_ASSOCINFO
6156 * calls.
6157 */
6158 struct assoc_info {
6159 /**
6160 * reassoc - Flag to indicate association or reassociation
6161 */
6162 int reassoc;
6163
6164 /**
6165 * req_ies - (Re)Association Request IEs
6166 *
6167 * If the driver generates WPA/RSN IE, this event data must be
6168 * returned for WPA handshake to have needed information. If
6169 * wpa_supplicant-generated WPA/RSN IE is used, this
6170 * information event is optional.
6171 *
6172 * This should start with the first IE (fixed fields before IEs
6173 * are not included).
6174 */
6175 const u8 *req_ies;
6176
6177 /**
6178 * req_ies_len - Length of req_ies in bytes
6179 */
6180 size_t req_ies_len;
6181
6182 /**
6183 * resp_ies - (Re)Association Response IEs
6184 *
6185 * Optional association data from the driver. This data is not
6186 * required WPA, but may be useful for some protocols and as
6187 * such, should be reported if this is available to the driver
6188 * interface.
6189 *
6190 * This should start with the first IE (fixed fields before IEs
6191 * are not included).
6192 */
6193 const u8 *resp_ies;
6194
6195 /**
6196 * resp_ies_len - Length of resp_ies in bytes
6197 */
6198 size_t resp_ies_len;
6199
6200 /**
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -08006201 * resp_frame - (Re)Association Response frame
6202 */
6203 const u8 *resp_frame;
6204
6205 /**
6206 * resp_frame_len - (Re)Association Response frame length
6207 */
6208 size_t resp_frame_len;
6209
6210 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006211 * beacon_ies - Beacon or Probe Response IEs
6212 *
6213 * Optional Beacon/ProbeResp data: IEs included in Beacon or
6214 * Probe Response frames from the current AP (i.e., the one
6215 * that the client just associated with). This information is
6216 * used to update WPA/RSN IE for the AP. If this field is not
6217 * set, the results from previous scan will be used. If no
6218 * data for the new AP is found, scan results will be requested
6219 * again (without scan request). At this point, the driver is
6220 * expected to provide WPA/RSN IE for the AP (if WPA/WPA2 is
6221 * used).
6222 *
6223 * This should start with the first IE (fixed fields before IEs
6224 * are not included).
6225 */
6226 const u8 *beacon_ies;
6227
6228 /**
6229 * beacon_ies_len - Length of beacon_ies */
6230 size_t beacon_ies_len;
6231
6232 /**
6233 * freq - Frequency of the operational channel in MHz
6234 */
6235 unsigned int freq;
6236
6237 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006238 * wmm_params - WMM parameters used in this association.
6239 */
6240 struct wmm_params wmm_params;
6241
6242 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006243 * addr - Station address (for AP mode)
6244 */
6245 const u8 *addr;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006246
6247 /**
6248 * The following is the key management offload information
6249 * @authorized
6250 * @key_replay_ctr
6251 * @key_replay_ctr_len
6252 * @ptk_kck
6253 * @ptk_kek_len
6254 * @ptk_kek
6255 * @ptk_kek_len
6256 */
6257
6258 /**
6259 * authorized - Status of key management offload,
6260 * 1 = successful
6261 */
6262 int authorized;
6263
6264 /**
6265 * key_replay_ctr - Key replay counter value last used
6266 * in a valid EAPOL-Key frame
6267 */
6268 const u8 *key_replay_ctr;
6269
6270 /**
6271 * key_replay_ctr_len - The length of key_replay_ctr
6272 */
6273 size_t key_replay_ctr_len;
6274
6275 /**
6276 * ptk_kck - The derived PTK KCK
6277 */
6278 const u8 *ptk_kck;
6279
6280 /**
6281 * ptk_kek_len - The length of ptk_kck
6282 */
6283 size_t ptk_kck_len;
6284
6285 /**
6286 * ptk_kek - The derived PTK KEK
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07006287 * This is used in key management offload and also in FILS SK
6288 * offload.
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006289 */
6290 const u8 *ptk_kek;
6291
6292 /**
6293 * ptk_kek_len - The length of ptk_kek
6294 */
6295 size_t ptk_kek_len;
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -08006296
6297 /**
6298 * subnet_status - The subnet status:
6299 * 0 = unknown, 1 = unchanged, 2 = changed
6300 */
6301 u8 subnet_status;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07006302
6303 /**
6304 * The following information is used in FILS SK offload
6305 * @fils_erp_next_seq_num
6306 * @fils_pmk
6307 * @fils_pmk_len
6308 * @fils_pmkid
6309 */
6310
6311 /**
6312 * fils_erp_next_seq_num - The next sequence number to use in
6313 * FILS ERP messages
6314 */
6315 u16 fils_erp_next_seq_num;
6316
6317 /**
6318 * fils_pmk - A new PMK if generated in case of FILS
6319 * authentication
6320 */
6321 const u8 *fils_pmk;
6322
6323 /**
6324 * fils_pmk_len - Length of fils_pmk
6325 */
6326 size_t fils_pmk_len;
6327
6328 /**
6329 * fils_pmkid - PMKID used or generated in FILS authentication
6330 */
6331 const u8 *fils_pmkid;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006332
6333 /**
6334 * link_addr - Link address of the STA
6335 */
6336 const u8 *link_addr;
6337
6338 /**
6339 * assoc_link_id - Association link id of the MLO association or
6340 * -1 if MLO is not used
6341 */
6342 int assoc_link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006343 } assoc_info;
6344
6345 /**
6346 * struct disassoc_info - Data for EVENT_DISASSOC events
6347 */
6348 struct disassoc_info {
6349 /**
6350 * addr - Station address (for AP mode)
6351 */
6352 const u8 *addr;
6353
6354 /**
6355 * reason_code - Reason Code (host byte order) used in
6356 * Deauthentication frame
6357 */
6358 u16 reason_code;
6359
6360 /**
6361 * ie - Optional IE(s) in Disassociation frame
6362 */
6363 const u8 *ie;
6364
6365 /**
6366 * ie_len - Length of ie buffer in octets
6367 */
6368 size_t ie_len;
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08006369
6370 /**
6371 * locally_generated - Whether the frame was locally generated
6372 */
6373 int locally_generated;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006374 } disassoc_info;
6375
6376 /**
6377 * struct deauth_info - Data for EVENT_DEAUTH events
6378 */
6379 struct deauth_info {
6380 /**
6381 * addr - Station address (for AP mode)
6382 */
6383 const u8 *addr;
6384
6385 /**
6386 * reason_code - Reason Code (host byte order) used in
6387 * Deauthentication frame
6388 */
6389 u16 reason_code;
6390
6391 /**
6392 * ie - Optional IE(s) in Deauthentication frame
6393 */
6394 const u8 *ie;
6395
6396 /**
6397 * ie_len - Length of ie buffer in octets
6398 */
6399 size_t ie_len;
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08006400
6401 /**
6402 * locally_generated - Whether the frame was locally generated
6403 */
6404 int locally_generated;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006405 } deauth_info;
6406
6407 /**
6408 * struct michael_mic_failure - Data for EVENT_MICHAEL_MIC_FAILURE
6409 */
6410 struct michael_mic_failure {
6411 int unicast;
6412 const u8 *src;
6413 } michael_mic_failure;
6414
6415 /**
6416 * struct interface_status - Data for EVENT_INTERFACE_STATUS
6417 */
6418 struct interface_status {
Dmitry Shmidte4663042016-04-04 10:07:49 -07006419 unsigned int ifindex;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006420 char ifname[100];
6421 enum {
6422 EVENT_INTERFACE_ADDED, EVENT_INTERFACE_REMOVED
6423 } ievent;
6424 } interface_status;
6425
6426 /**
6427 * struct pmkid_candidate - Data for EVENT_PMKID_CANDIDATE
6428 */
6429 struct pmkid_candidate {
6430 /** BSSID of the PMKID candidate */
6431 u8 bssid[ETH_ALEN];
6432 /** Smaller the index, higher the priority */
6433 int index;
6434 /** Whether RSN IE includes pre-authenticate flag */
6435 int preauth;
6436 } pmkid_candidate;
6437
6438 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006439 * struct tdls - Data for EVENT_TDLS
6440 */
6441 struct tdls {
6442 u8 peer[ETH_ALEN];
6443 enum {
6444 TDLS_REQUEST_SETUP,
Dmitry Shmidt4dd28dc2015-03-10 11:21:43 -07006445 TDLS_REQUEST_TEARDOWN,
6446 TDLS_REQUEST_DISCOVER,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006447 } oper;
6448 u16 reason_code; /* for teardown */
6449 } tdls;
6450
6451 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07006452 * struct wnm - Data for EVENT_WNM
6453 */
6454 struct wnm {
6455 u8 addr[ETH_ALEN];
6456 enum {
6457 WNM_OPER_SLEEP,
6458 } oper;
6459 enum {
6460 WNM_SLEEP_ENTER,
6461 WNM_SLEEP_EXIT
6462 } sleep_action;
6463 int sleep_intval;
6464 u16 reason_code;
6465 u8 *buf;
6466 u16 buf_len;
6467 } wnm;
6468
6469 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006470 * struct ft_ies - FT information elements (EVENT_FT_RESPONSE)
6471 *
6472 * During FT (IEEE 802.11r) authentication sequence, the driver is
6473 * expected to use this event to report received FT IEs (MDIE, FTIE,
6474 * RSN IE, TIE, possible resource request) to the supplicant. The FT
6475 * IEs for the next message will be delivered through the
6476 * struct wpa_driver_ops::update_ft_ies() callback.
6477 */
6478 struct ft_ies {
6479 const u8 *ies;
6480 size_t ies_len;
6481 int ft_action;
6482 u8 target_ap[ETH_ALEN];
6483 /** Optional IE(s), e.g., WMM TSPEC(s), for RIC-Request */
6484 const u8 *ric_ies;
6485 /** Length of ric_ies buffer in octets */
6486 size_t ric_ies_len;
6487 } ft_ies;
6488
6489 /**
6490 * struct ibss_rsn_start - Data for EVENT_IBSS_RSN_START
6491 */
6492 struct ibss_rsn_start {
6493 u8 peer[ETH_ALEN];
6494 } ibss_rsn_start;
6495
6496 /**
6497 * struct auth_info - Data for EVENT_AUTH events
6498 */
6499 struct auth_info {
6500 u8 peer[ETH_ALEN];
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006501 u8 bssid[ETH_ALEN];
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006502 u16 auth_type;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006503 u16 auth_transaction;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006504 u16 status_code;
6505 const u8 *ies;
6506 size_t ies_len;
6507 } auth;
6508
6509 /**
6510 * struct assoc_reject - Data for EVENT_ASSOC_REJECT events
6511 */
6512 struct assoc_reject {
6513 /**
6514 * bssid - BSSID of the AP that rejected association
6515 */
6516 const u8 *bssid;
6517
6518 /**
6519 * resp_ies - (Re)Association Response IEs
6520 *
6521 * Optional association data from the driver. This data is not
6522 * required WPA, but may be useful for some protocols and as
6523 * such, should be reported if this is available to the driver
6524 * interface.
6525 *
6526 * This should start with the first IE (fixed fields before IEs
6527 * are not included).
6528 */
6529 const u8 *resp_ies;
6530
6531 /**
6532 * resp_ies_len - Length of resp_ies in bytes
6533 */
6534 size_t resp_ies_len;
6535
6536 /**
6537 * status_code - Status Code from (Re)association Response
6538 */
6539 u16 status_code;
Dmitry Shmidtd5ab1b52016-06-21 12:38:41 -07006540
6541 /**
6542 * timed_out - Whether failure is due to timeout (etc.) rather
6543 * than explicit rejection response from the AP.
6544 */
6545 int timed_out;
Dmitry Shmidtebd93af2017-02-21 13:40:44 -08006546
6547 /**
6548 * timeout_reason - Reason for the timeout
6549 */
6550 const char *timeout_reason;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07006551
6552 /**
6553 * fils_erp_next_seq_num - The next sequence number to use in
6554 * FILS ERP messages
6555 */
6556 u16 fils_erp_next_seq_num;
Hai Shalom60840252021-02-19 19:02:11 -08006557
6558 /**
6559 * reason_code - Connection failure reason code from the driver
6560 */
6561 enum sta_connect_fail_reason_codes reason_code;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006562 } assoc_reject;
6563
6564 struct timeout_event {
6565 u8 addr[ETH_ALEN];
6566 } timeout_event;
6567
6568 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006569 * struct tx_status - Data for EVENT_TX_STATUS events
6570 */
6571 struct tx_status {
6572 u16 type;
6573 u16 stype;
6574 const u8 *dst;
6575 const u8 *data;
6576 size_t data_len;
6577 int ack;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006578 int link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006579 } tx_status;
6580
6581 /**
6582 * struct rx_from_unknown - Data for EVENT_RX_FROM_UNKNOWN events
6583 */
6584 struct rx_from_unknown {
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006585 const u8 *bssid;
6586 const u8 *addr;
6587 int wds;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006588 } rx_from_unknown;
6589
6590 /**
6591 * struct rx_mgmt - Data for EVENT_RX_MGMT events
6592 */
6593 struct rx_mgmt {
6594 const u8 *frame;
6595 size_t frame_len;
6596 u32 datarate;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006597
6598 /**
Dmitry Shmidt98660862014-03-11 17:26:21 -07006599 * drv_priv - Pointer to store driver private BSS information
6600 *
6601 * If not set to NULL, this is used for comparison with
6602 * hostapd_data->drv_priv to determine which BSS should process
6603 * the frame.
6604 */
6605 void *drv_priv;
6606
6607 /**
Sunil Ravi7f769292024-07-23 22:21:32 +00006608 * ctx - Pointer to store ctx of private BSS information
6609 *
6610 * If not set to NULL, this is used for forwarding the packet
6611 * to right link BSS of ML BSS.
6612 */
6613 void *ctx;
6614
6615 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006616 * freq - Frequency (in MHz) on which the frame was received
6617 */
6618 int freq;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08006619
6620 /**
6621 * ssi_signal - Signal strength in dBm (or 0 if not available)
6622 */
6623 int ssi_signal;
Sunil Ravi036cec52023-03-29 11:35:17 -07006624
6625 /**
6626 * link_id - MLO link on which the frame was received or -1 for
6627 * non MLD.
6628 */
6629 int link_id;
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08006630 } rx_mgmt;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006631
6632 /**
6633 * struct remain_on_channel - Data for EVENT_REMAIN_ON_CHANNEL events
6634 *
6635 * This is also used with EVENT_CANCEL_REMAIN_ON_CHANNEL events.
6636 */
6637 struct remain_on_channel {
6638 /**
6639 * freq - Channel frequency in MHz
6640 */
6641 unsigned int freq;
6642
6643 /**
6644 * duration - Duration to remain on the channel in milliseconds
6645 */
6646 unsigned int duration;
6647 } remain_on_channel;
6648
6649 /**
6650 * struct scan_info - Optional data for EVENT_SCAN_RESULTS events
6651 * @aborted: Whether the scan was aborted
6652 * @freqs: Scanned frequencies in MHz (%NULL = all channels scanned)
6653 * @num_freqs: Number of entries in freqs array
6654 * @ssids: Scanned SSIDs (%NULL or zero-length SSID indicates wildcard
6655 * SSID)
6656 * @num_ssids: Number of entries in ssids array
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08006657 * @external_scan: Whether the scan info is for an external scan
6658 * @nl_scan_event: 1 if the source of this scan event is a normal scan,
6659 * 0 if the source of the scan event is a vendor scan
Dmitry Shmidt29333592017-01-09 12:27:11 -08006660 * @scan_start_tsf: Time when the scan started in terms of TSF of the
6661 * BSS that the interface that requested the scan is connected to
6662 * (if available).
6663 * @scan_start_tsf_bssid: The BSSID according to which %scan_start_tsf
6664 * is set.
Sunil Ravi99c035e2024-07-12 01:42:03 +00006665 * @scan_cookie: Unique identification representing the corresponding
6666 * scan request. 0 if no unique identification is available.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006667 */
6668 struct scan_info {
6669 int aborted;
6670 const int *freqs;
6671 size_t num_freqs;
6672 struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS];
6673 size_t num_ssids;
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08006674 int external_scan;
6675 int nl_scan_event;
Dmitry Shmidt29333592017-01-09 12:27:11 -08006676 u64 scan_start_tsf;
6677 u8 scan_start_tsf_bssid[ETH_ALEN];
Sunil Ravi99c035e2024-07-12 01:42:03 +00006678 u64 scan_cookie;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006679 } scan_info;
6680
6681 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006682 * struct rx_probe_req - Data for EVENT_RX_PROBE_REQ events
6683 */
6684 struct rx_probe_req {
6685 /**
6686 * sa - Source address of the received Probe Request frame
6687 */
6688 const u8 *sa;
6689
6690 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006691 * da - Destination address of the received Probe Request frame
6692 * or %NULL if not available
6693 */
6694 const u8 *da;
6695
6696 /**
6697 * bssid - BSSID of the received Probe Request frame or %NULL
6698 * if not available
6699 */
6700 const u8 *bssid;
6701
6702 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006703 * ie - IEs from the Probe Request body
6704 */
6705 const u8 *ie;
6706
6707 /**
6708 * ie_len - Length of ie buffer in octets
6709 */
6710 size_t ie_len;
Dmitry Shmidt04949592012-07-19 12:16:46 -07006711
6712 /**
6713 * signal - signal strength in dBm (or 0 if not available)
6714 */
6715 int ssi_signal;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006716 } rx_probe_req;
6717
6718 /**
6719 * struct new_sta - Data for EVENT_NEW_STA events
6720 */
6721 struct new_sta {
6722 const u8 *addr;
6723 } new_sta;
6724
6725 /**
6726 * struct eapol_rx - Data for EVENT_EAPOL_RX events
6727 */
6728 struct eapol_rx {
6729 const u8 *src;
6730 const u8 *data;
6731 size_t data_len;
Sunil8cd6f4d2022-06-28 18:40:46 +00006732 enum frame_encryption encrypted;
Sunil Ravi036cec52023-03-29 11:35:17 -07006733 int link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006734 } eapol_rx;
6735
6736 /**
6737 * signal_change - Data for EVENT_SIGNAL_CHANGE events
6738 */
6739 struct wpa_signal_info signal_change;
6740
6741 /**
6742 * struct best_channel - Data for EVENT_BEST_CHANNEL events
6743 * @freq_24: Best 2.4 GHz band channel frequency in MHz
6744 * @freq_5: Best 5 GHz band channel frequency in MHz
6745 * @freq_overall: Best channel frequency in MHz
6746 *
6747 * 0 can be used to indicate no preference in either band.
6748 */
6749 struct best_channel {
6750 int freq_24;
6751 int freq_5;
6752 int freq_overall;
6753 } best_chan;
6754
6755 struct unprot_deauth {
6756 const u8 *sa;
6757 const u8 *da;
6758 u16 reason_code;
6759 } unprot_deauth;
6760
6761 struct unprot_disassoc {
6762 const u8 *sa;
6763 const u8 *da;
6764 u16 reason_code;
6765 } unprot_disassoc;
6766
6767 /**
6768 * struct low_ack - Data for EVENT_STATION_LOW_ACK events
6769 * @addr: station address
Paul Stewart092955c2017-02-06 09:13:09 -08006770 * @num_packets: Number of packets lost (consecutive packets not
6771 * acknowledged)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006772 */
6773 struct low_ack {
6774 u8 addr[ETH_ALEN];
Paul Stewart092955c2017-02-06 09:13:09 -08006775 u32 num_packets;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006776 } low_ack;
6777
6778 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07006779 * struct ibss_peer_lost - Data for EVENT_IBSS_PEER_LOST
6780 */
6781 struct ibss_peer_lost {
6782 u8 peer[ETH_ALEN];
6783 } ibss_peer_lost;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006784
6785 /**
6786 * struct driver_gtk_rekey - Data for EVENT_DRIVER_GTK_REKEY
6787 */
6788 struct driver_gtk_rekey {
6789 const u8 *bssid;
6790 const u8 *replay_ctr;
6791 } driver_gtk_rekey;
6792
6793 /**
6794 * struct client_poll - Data for EVENT_DRIVER_CLIENT_POLL_OK events
6795 * @addr: station address
6796 */
6797 struct client_poll {
6798 u8 addr[ETH_ALEN];
6799 } client_poll;
6800
6801 /**
6802 * struct eapol_tx_status
6803 * @dst: Original destination
6804 * @data: Data starting with IEEE 802.1X header (!)
6805 * @data_len: Length of data
6806 * @ack: Indicates ack or lost frame
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006807 * @link_id: MLD link id used to transmit the frame or -1 for non MLO
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006808 *
6809 * This corresponds to hapd_send_eapol if the frame sent
6810 * there isn't just reported as EVENT_TX_STATUS.
6811 */
6812 struct eapol_tx_status {
6813 const u8 *dst;
6814 const u8 *data;
6815 int data_len;
6816 int ack;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006817 int link_id;
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08006818 } eapol_tx_status;
Dmitry Shmidt04949592012-07-19 12:16:46 -07006819
6820 /**
6821 * struct ch_switch
6822 * @freq: Frequency of new channel in MHz
6823 * @ht_enabled: Whether this is an HT channel
6824 * @ch_offset: Secondary channel offset
Dmitry Shmidt04f534e2013-12-09 15:50:16 -08006825 * @ch_width: Channel width
6826 * @cf1: Center frequency 1
6827 * @cf2: Center frequency 2
Sunil Ravi89eba102022-09-13 21:04:37 -07006828 * @link_id: Link ID of the MLO link
Sunil Ravi036cec52023-03-29 11:35:17 -07006829 * @punct_bitmap: Puncturing bitmap
Dmitry Shmidt04949592012-07-19 12:16:46 -07006830 */
6831 struct ch_switch {
6832 int freq;
6833 int ht_enabled;
6834 int ch_offset;
Dmitry Shmidt04f534e2013-12-09 15:50:16 -08006835 enum chan_width ch_width;
6836 int cf1;
6837 int cf2;
Sunil Ravi89eba102022-09-13 21:04:37 -07006838 int link_id;
Sunil Ravi036cec52023-03-29 11:35:17 -07006839 u16 punct_bitmap;
Dmitry Shmidt04949592012-07-19 12:16:46 -07006840 } ch_switch;
Dmitry Shmidtf8623282013-02-20 14:34:59 -08006841
6842 /**
6843 * struct connect_failed - Data for EVENT_CONNECT_FAILED_REASON
6844 * @addr: Remote client address
6845 * @code: Reason code for connection failure
6846 */
6847 struct connect_failed_reason {
6848 u8 addr[ETH_ALEN];
6849 enum {
6850 MAX_CLIENT_REACHED,
6851 BLOCKED_CLIENT
6852 } code;
6853 } connect_failed_reason;
Dmitry Shmidtea69e842013-05-13 14:52:28 -07006854
6855 /**
6856 * struct dfs_event - Data for radar detected events
6857 * @freq: Frequency of the channel in MHz
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006858 * @link_id: If >= 0, Link ID of the MLO link
Dmitry Shmidtea69e842013-05-13 14:52:28 -07006859 */
6860 struct dfs_event {
6861 int freq;
Dmitry Shmidt051af732013-10-22 13:52:46 -07006862 int ht_enabled;
6863 int chan_offset;
6864 enum chan_width chan_width;
6865 int cf1;
6866 int cf2;
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006867 int link_id;
Dmitry Shmidtea69e842013-05-13 14:52:28 -07006868 } dfs_event;
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07006869
6870 /**
6871 * survey_results - Survey result data for EVENT_SURVEY
6872 * @freq_filter: Requested frequency survey filter, 0 if request
6873 * was for all survey data
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006874 * @survey_list: Linked list of survey data (struct freq_survey)
Dmitry Shmidtb7b4d0e2013-08-26 12:09:05 -07006875 */
6876 struct survey_results {
6877 unsigned int freq_filter;
6878 struct dl_list survey_list; /* struct freq_survey */
6879 } survey_results;
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08006880
6881 /**
6882 * channel_list_changed - Data for EVENT_CHANNEL_LIST_CHANGED
6883 * @initiator: Initiator of the regulatory change
Dmitry Shmidt7dba0e52014-04-14 10:49:15 -07006884 * @type: Regulatory change type
6885 * @alpha2: Country code (or "" if not available)
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006886 * @beacon_hint_before: Data for frequency attributes before beacon hint
6887 * event if initiator == REGDOM_BEACON_HINT
6888 * @beacon_hint_after: Data for frequency attributes after beacon hint
6889 * event if initiator == REGDOM_BEACON_HINT
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08006890 */
6891 struct channel_list_changed {
6892 enum reg_change_initiator initiator;
Dmitry Shmidt7dba0e52014-04-14 10:49:15 -07006893 enum reg_type type;
6894 char alpha2[3];
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006895 struct frequency_attrs {
6896 unsigned int freq;
6897 unsigned int max_tx_power;
6898 bool disabled;
6899 bool no_ir;
6900 bool radar;
6901 } beacon_hint_before, beacon_hint_after;
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -08006902 } channel_list_changed;
Dmitry Shmidtcf32e602014-01-28 10:57:39 -08006903
6904 /**
6905 * freq_range - List of frequency ranges
6906 *
6907 * This is used as the data with EVENT_AVOID_FREQUENCIES.
6908 */
6909 struct wpa_freq_range_list freq_range;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006910
6911 /**
6912 * struct mesh_peer
6913 *
6914 * @peer: Peer address
6915 * @ies: Beacon IEs
6916 * @ie_len: Length of @ies
6917 *
6918 * Notification of new candidate mesh peer.
6919 */
6920 struct mesh_peer {
6921 const u8 *peer;
6922 const u8 *ies;
6923 size_t ie_len;
6924 } mesh_peer;
6925
6926 /**
6927 * struct acs_selected_channels - Data for EVENT_ACS_CHANNEL_SELECTED
Ahmed ElArabawy0ff61c52019-12-26 12:38:39 -08006928 * @pri_freq: Selected primary frequency
6929 * @sec_freq: Selected secondary frequency
Hai Shalomfdcde762020-04-02 11:19:20 -07006930 * @edmg_channel: Selected EDMG channel
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006931 * @vht_seg0_center_ch: VHT mode Segment0 center channel
Hai Shalomfdcde762020-04-02 11:19:20 -07006932 * The value is the index of the channel center frequency for
6933 * 20 MHz, 40 MHz, and 80 MHz channels. The value is the center
6934 * frequency index of the primary 80 MHz segment for 160 MHz and
6935 * 80+80 MHz channels.
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006936 * @vht_seg1_center_ch: VHT mode Segment1 center channel
Hai Shalomfdcde762020-04-02 11:19:20 -07006937 * The value is zero for 20 MHz, 40 MHz, and 80 MHz channels. The
6938 * value is the index of the channel center frequency for 160 MHz
6939 * channels and the center frequency index of the secondary 80 MHz
6940 * segment for 80+80 MHz channels.
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006941 * @ch_width: Selected Channel width by driver. Driver may choose to
6942 * change hostapd configured ACS channel width due driver internal
6943 * channel restrictions.
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006944 * @hw_mode: Selected band (used with hw_mode=any)
6945 * @puncture_bitmap: Indicate the puncturing channels
6946 * @link_id: Indicate the link id if operating as AP MLD; -1 otherwise
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006947 */
6948 struct acs_selected_channels {
Ahmed ElArabawy0ff61c52019-12-26 12:38:39 -08006949 unsigned int pri_freq;
6950 unsigned int sec_freq;
Hai Shalomfdcde762020-04-02 11:19:20 -07006951 u8 edmg_channel;
Dmitry Shmidtdda10c22015-03-24 16:05:01 -07006952 u8 vht_seg0_center_ch;
6953 u8 vht_seg1_center_ch;
6954 u16 ch_width;
Dmitry Shmidtb1e52102015-05-29 12:36:29 -07006955 enum hostapd_hw_mode hw_mode;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00006956 u16 puncture_bitmap;
Sunil Ravib0ac25f2024-07-12 01:42:03 +00006957 int link_id;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08006958 } acs_selected_channels;
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07006959
6960 /**
6961 * struct p2p_lo_stop - Reason code for P2P Listen offload stop event
6962 * @reason_code: Reason for stopping offload
6963 * P2P_LO_STOPPED_REASON_COMPLETE: Listen offload finished as
6964 * scheduled.
6965 * P2P_LO_STOPPED_REASON_RECV_STOP_CMD: Host requested offload to
6966 * be stopped.
6967 * P2P_LO_STOPPED_REASON_INVALID_PARAM: Invalid listen offload
6968 * parameters.
6969 * P2P_LO_STOPPED_REASON_NOT_SUPPORTED: Listen offload not
6970 * supported by device.
6971 */
6972 struct p2p_lo_stop {
6973 enum {
6974 P2P_LO_STOPPED_REASON_COMPLETE = 0,
6975 P2P_LO_STOPPED_REASON_RECV_STOP_CMD,
6976 P2P_LO_STOPPED_REASON_INVALID_PARAM,
6977 P2P_LO_STOPPED_REASON_NOT_SUPPORTED,
6978 } reason_code;
6979 } p2p_lo_stop;
Roshan Pius3a1667e2018-07-03 15:17:14 -07006980
6981 /* For EVENT_EXTERNAL_AUTH */
6982 struct external_auth external_auth;
6983
6984 /**
6985 * struct sta_opmode - Station's operation mode change event
6986 * @addr: The station MAC address
6987 * @smps_mode: SMPS mode of the station
6988 * @chan_width: Channel width of the station
6989 * @rx_nss: RX_NSS of the station
6990 *
6991 * This is used as data with EVENT_STATION_OPMODE_CHANGED.
6992 */
6993 struct sta_opmode {
6994 const u8 *addr;
6995 enum smps_mode smps_mode;
6996 enum chan_width chan_width;
6997 u8 rx_nss;
6998 } sta_opmode;
6999
7000 /**
7001 * struct wds_sta_interface - Data for EVENT_WDS_STA_INTERFACE_STATUS.
7002 */
7003 struct wds_sta_interface {
7004 const u8 *sta_addr;
7005 const char *ifname;
7006 enum {
7007 INTERFACE_ADDED,
7008 INTERFACE_REMOVED
7009 } istatus;
7010 } wds_sta_interface;
Hai Shalom81f62d82019-07-22 12:10:00 -07007011
7012 /**
7013 * struct update_dh - Data for EVENT_UPDATE_DH
7014 */
7015 struct update_dh {
7016 const u8 *peer;
7017 const u8 *ie;
7018 size_t ie_len;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00007019 int assoc_link_id;
7020 const u8 *link_addr;
Hai Shalom81f62d82019-07-22 12:10:00 -07007021 } update_dh;
Hai Shalomfdcde762020-04-02 11:19:20 -07007022
7023 /**
7024 * struct unprot_beacon - Data for EVENT_UNPROT_BEACON
7025 */
7026 struct unprot_beacon {
7027 const u8 *sa;
7028 } unprot_beacon;
Sunil Ravia04bd252022-05-02 22:54:18 -07007029
7030 /**
7031 * struct bss_color_collision - Data for EVENT_BSS_COLOR_COLLISION
7032 */
7033 struct bss_color_collision {
7034 u64 bitmap;
Sunil Ravi7f769292024-07-23 22:21:32 +00007035 int link_id;
Sunil Ravia04bd252022-05-02 22:54:18 -07007036 } bss_color_collision;
Sunil Ravi89eba102022-09-13 21:04:37 -07007037
7038 /**
7039 * struct pasn_auth - Data for EVENT_PASN_AUTH
7040 */
7041 struct pasn_auth pasn_auth;
7042
Sunil Ravi77d572f2023-01-17 23:58:31 +00007043 /**
7044 * struct port_authorized - Data for EVENT_PORT_AUTHORIZED
Sunil Ravi2a14cf12023-11-21 00:54:38 +00007045 * @td_bitmap: For STA mode, transition disable bitmap, if received in
7046 * EAPOL-Key msg 3/4
7047 * @td_bitmap_len: For STA mode, length of td_bitmap
7048 * @sta_addr: For AP mode, the MAC address of the associated STA
7049 *
7050 * This event is used to indicate that the port is authorized and
7051 * open for normal data in STA and AP modes when 4-way handshake is
7052 * offloaded to the driver.
Sunil Ravi77d572f2023-01-17 23:58:31 +00007053 */
7054 struct port_authorized {
7055 const u8 *td_bitmap;
7056 size_t td_bitmap_len;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00007057 const u8 *sta_addr;
Sunil Ravi77d572f2023-01-17 23:58:31 +00007058 } port_authorized;
Sunil Ravi640215c2023-06-28 23:08:09 +00007059
7060 /**
7061 * struct tid_link_map_info - Data for EVENT_TID_LINK_MAP
7062 */
7063 struct tid_link_map_info {
7064 bool default_map;
7065 u8 valid_links;
7066 struct t2lm_mapping t2lmap[MAX_NUM_MLD_LINKS];
7067 } t2l_map_info;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007068};
7069
7070/**
7071 * wpa_supplicant_event - Report a driver event for wpa_supplicant
7072 * @ctx: Context pointer (wpa_s); this is the ctx variable registered
7073 * with struct wpa_driver_ops::init()
7074 * @event: event type (defined above)
7075 * @data: possible extra data for the event
7076 *
7077 * Driver wrapper code should call this function whenever an event is received
7078 * from the driver.
7079 */
7080void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
7081 union wpa_event_data *data);
7082
Dmitry Shmidte4663042016-04-04 10:07:49 -07007083/**
7084 * wpa_supplicant_event_global - Report a driver event for wpa_supplicant
7085 * @ctx: Context pointer (wpa_s); this is the ctx variable registered
7086 * with struct wpa_driver_ops::init()
7087 * @event: event type (defined above)
7088 * @data: possible extra data for the event
7089 *
7090 * Same as wpa_supplicant_event(), but we search for the interface in
7091 * wpa_global.
7092 */
7093void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
7094 union wpa_event_data *data);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007095
7096/*
7097 * The following inline functions are provided for convenience to simplify
7098 * event indication for some of the common events.
7099 */
7100
Sunil Ravi2a14cf12023-11-21 00:54:38 +00007101static inline void drv_event_assoc(void *ctx, const u8 *addr, const u8 *req_ies,
7102 size_t req_ielen, const u8 *resp_ies,
7103 size_t resp_ielen, const u8 *link_addr,
7104 int assoc_link_id, int reassoc)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007105{
7106 union wpa_event_data event;
7107 os_memset(&event, 0, sizeof(event));
7108 event.assoc_info.reassoc = reassoc;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00007109 event.assoc_info.req_ies = req_ies;
7110 event.assoc_info.req_ies_len = req_ielen;
7111 event.assoc_info.resp_ies = resp_ies;
7112 event.assoc_info.resp_ies_len = resp_ielen;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007113 event.assoc_info.addr = addr;
Sunil Ravi2a14cf12023-11-21 00:54:38 +00007114 event.assoc_info.link_addr = link_addr;
7115 event.assoc_info.assoc_link_id = assoc_link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007116 wpa_supplicant_event(ctx, EVENT_ASSOC, &event);
7117}
7118
7119static inline void drv_event_disassoc(void *ctx, const u8 *addr)
7120{
7121 union wpa_event_data event;
7122 os_memset(&event, 0, sizeof(event));
7123 event.disassoc_info.addr = addr;
7124 wpa_supplicant_event(ctx, EVENT_DISASSOC, &event);
7125}
7126
7127static inline void drv_event_eapol_rx(void *ctx, const u8 *src, const u8 *data,
7128 size_t data_len)
7129{
7130 union wpa_event_data event;
7131 os_memset(&event, 0, sizeof(event));
7132 event.eapol_rx.src = src;
7133 event.eapol_rx.data = data;
7134 event.eapol_rx.data_len = data_len;
Sunil8cd6f4d2022-06-28 18:40:46 +00007135 event.eapol_rx.encrypted = FRAME_ENCRYPTION_UNKNOWN;
Sunil Ravi036cec52023-03-29 11:35:17 -07007136 event.eapol_rx.link_id = -1;
Sunil8cd6f4d2022-06-28 18:40:46 +00007137 wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event);
7138}
7139
7140static inline void drv_event_eapol_rx2(void *ctx, const u8 *src, const u8 *data,
Sunil Ravi036cec52023-03-29 11:35:17 -07007141 size_t data_len,
7142 enum frame_encryption encrypted,
7143 int link_id)
Sunil8cd6f4d2022-06-28 18:40:46 +00007144{
7145 union wpa_event_data event;
7146 os_memset(&event, 0, sizeof(event));
7147 event.eapol_rx.src = src;
7148 event.eapol_rx.data = data;
7149 event.eapol_rx.data_len = data_len;
7150 event.eapol_rx.encrypted = encrypted;
Sunil Ravi036cec52023-03-29 11:35:17 -07007151 event.eapol_rx.link_id = link_id;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007152 wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event);
7153}
7154
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08007155/* driver_common.c */
7156void wpa_scan_results_free(struct wpa_scan_results *res);
7157
7158/* Convert wpa_event_type to a string for logging */
7159const char * event_to_string(enum wpa_event_type event);
7160
Dmitry Shmidt661b4f72014-09-29 14:58:27 -07007161/* Convert chan_width to a string for logging and control interfaces */
7162const char * channel_width_to_string(enum chan_width width);
7163
Hai Shalom74f70d42019-02-11 14:42:39 -08007164int channel_width_to_int(enum chan_width width);
7165
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08007166int ht_supported(const struct hostapd_hw_modes *mode);
7167int vht_supported(const struct hostapd_hw_modes *mode);
Sunil Ravi77d572f2023-01-17 23:58:31 +00007168bool he_supported(const struct hostapd_hw_modes *hw_mode,
7169 enum ieee80211_op_mode op_mode);
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08007170
7171struct wowlan_triggers *
7172wpa_get_wowlan_triggers(const char *wowlan_triggers,
7173 const struct wpa_driver_capa *capa);
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -07007174/* Convert driver flag to string */
7175const char * driver_flag_to_string(u64 flag);
Hai Shalomb755a2a2020-04-23 21:49:02 -07007176const char * driver_flag2_to_string(u64 flag2);
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08007177
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08007178/* NULL terminated array of linked in driver wrappers */
Dmitry Shmidt1d755d02015-04-28 10:34:29 -07007179extern const struct wpa_driver_ops *const wpa_drivers[];
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -08007180
Dmitry Shmidt4ae50e62016-06-27 13:48:39 -07007181
7182/* Available drivers */
7183
7184#ifdef CONFIG_DRIVER_WEXT
7185extern const struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */
7186#endif /* CONFIG_DRIVER_WEXT */
7187#ifdef CONFIG_DRIVER_NL80211
7188/* driver_nl80211.c */
7189extern const struct wpa_driver_ops wpa_driver_nl80211_ops;
7190#endif /* CONFIG_DRIVER_NL80211 */
7191#ifdef CONFIG_DRIVER_HOSTAP
7192extern const struct wpa_driver_ops wpa_driver_hostap_ops; /* driver_hostap.c */
7193#endif /* CONFIG_DRIVER_HOSTAP */
7194#ifdef CONFIG_DRIVER_BSD
7195extern const struct wpa_driver_ops wpa_driver_bsd_ops; /* driver_bsd.c */
7196#endif /* CONFIG_DRIVER_BSD */
7197#ifdef CONFIG_DRIVER_OPENBSD
7198/* driver_openbsd.c */
7199extern const struct wpa_driver_ops wpa_driver_openbsd_ops;
7200#endif /* CONFIG_DRIVER_OPENBSD */
7201#ifdef CONFIG_DRIVER_NDIS
7202extern struct wpa_driver_ops wpa_driver_ndis_ops; /* driver_ndis.c */
7203#endif /* CONFIG_DRIVER_NDIS */
7204#ifdef CONFIG_DRIVER_WIRED
7205extern const struct wpa_driver_ops wpa_driver_wired_ops; /* driver_wired.c */
7206#endif /* CONFIG_DRIVER_WIRED */
7207#ifdef CONFIG_DRIVER_MACSEC_QCA
7208/* driver_macsec_qca.c */
7209extern const struct wpa_driver_ops wpa_driver_macsec_qca_ops;
7210#endif /* CONFIG_DRIVER_MACSEC_QCA */
Dmitry Shmidtabb90a32016-12-05 15:34:39 -08007211#ifdef CONFIG_DRIVER_MACSEC_LINUX
7212/* driver_macsec_linux.c */
7213extern const struct wpa_driver_ops wpa_driver_macsec_linux_ops;
7214#endif /* CONFIG_DRIVER_MACSEC_LINUX */
Dmitry Shmidt4ae50e62016-06-27 13:48:39 -07007215#ifdef CONFIG_DRIVER_ROBOSWITCH
7216/* driver_roboswitch.c */
7217extern const struct wpa_driver_ops wpa_driver_roboswitch_ops;
7218#endif /* CONFIG_DRIVER_ROBOSWITCH */
7219#ifdef CONFIG_DRIVER_ATHEROS
7220/* driver_atheros.c */
7221extern const struct wpa_driver_ops wpa_driver_atheros_ops;
7222#endif /* CONFIG_DRIVER_ATHEROS */
7223#ifdef CONFIG_DRIVER_NONE
7224extern const struct wpa_driver_ops wpa_driver_none_ops; /* driver_none.c */
7225#endif /* CONFIG_DRIVER_NONE */
7226
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007227#endif /* DRIVER_H */