/src/hostap/src/drivers/driver.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Driver interface definition |
3 | | * Copyright (c) 2003-2017, Jouni Malinen <j@w1.fi> |
4 | | * |
5 | | * This software may be distributed under the terms of the BSD license. |
6 | | * See README for more details. |
7 | | * |
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" |
23 | | #include "common/ieee802_11_defs.h" |
24 | | #include "common/wpa_common.h" |
25 | | #include "common/nan.h" |
26 | | #ifdef CONFIG_MACSEC |
27 | | #include "pae/ieee802_1x_kay.h" |
28 | | #endif /* CONFIG_MACSEC */ |
29 | | #include "utils/list.h" |
30 | | |
31 | | struct nan_subscribe_params; |
32 | | struct nan_publish_params; |
33 | | |
34 | | #define HOSTAPD_CHAN_DISABLED 0x00000001 |
35 | | #define HOSTAPD_CHAN_NO_IR 0x00000002 |
36 | 0 | #define HOSTAPD_CHAN_RADAR 0x00000008 |
37 | | #define HOSTAPD_CHAN_HT40PLUS 0x00000010 |
38 | | #define HOSTAPD_CHAN_HT40MINUS 0x00000020 |
39 | | #define HOSTAPD_CHAN_HT40 0x00000040 |
40 | | #define HOSTAPD_CHAN_SURVEY_LIST_INITIALIZED 0x00000080 |
41 | | |
42 | | #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 | | |
48 | | #define HOSTAPD_CHAN_VHT_80MHZ_SUBCHANNEL 0x00000800 |
49 | | #define HOSTAPD_CHAN_VHT_160MHZ_SUBCHANNEL 0x00001000 |
50 | | #define HOSTAPD_CHAN_EHT_320MHZ_SUBCHANNEL 0x00002000 |
51 | | |
52 | | #define HOSTAPD_CHAN_INDOOR_ONLY 0x00010000 |
53 | | #define HOSTAPD_CHAN_GO_CONCURRENT 0x00020000 |
54 | | #define HOSTAPD_CHAN_AUTO_BW 0x00040000 |
55 | | |
56 | | /* Allowed bandwidth mask */ |
57 | | enum hostapd_chan_width_attr { |
58 | | HOSTAPD_CHAN_WIDTH_10 = BIT(0), |
59 | | HOSTAPD_CHAN_WIDTH_20 = BIT(1), |
60 | | HOSTAPD_CHAN_WIDTH_40P = BIT(2), |
61 | | HOSTAPD_CHAN_WIDTH_40M = BIT(3), |
62 | | HOSTAPD_CHAN_WIDTH_80 = BIT(4), |
63 | | HOSTAPD_CHAN_WIDTH_160 = BIT(5), |
64 | | HOSTAPD_CHAN_WIDTH_320 = BIT(6), |
65 | | }; |
66 | | |
67 | | /* Filter gratuitous ARP */ |
68 | | #define WPA_DATA_FRAME_FILTER_FLAG_ARP BIT(0) |
69 | | /* Filter unsolicited Neighbor Advertisement */ |
70 | | #define WPA_DATA_FRAME_FILTER_FLAG_NA BIT(1) |
71 | | /* Filter unicast IP packets encrypted using the GTK */ |
72 | | #define WPA_DATA_FRAME_FILTER_FLAG_GTK BIT(2) |
73 | | |
74 | | #define HOSTAPD_DFS_REGION_FCC 1 |
75 | | #define HOSTAPD_DFS_REGION_ETSI 2 |
76 | | #define HOSTAPD_DFS_REGION_JP 3 |
77 | | |
78 | | /** |
79 | | * enum reg_change_initiator - Regulatory change initiator |
80 | | */ |
81 | | enum reg_change_initiator { |
82 | | REGDOM_SET_BY_CORE, |
83 | | REGDOM_SET_BY_USER, |
84 | | REGDOM_SET_BY_DRIVER, |
85 | | REGDOM_SET_BY_COUNTRY_IE, |
86 | | REGDOM_BEACON_HINT, |
87 | | }; |
88 | | |
89 | | /** |
90 | | * enum reg_type - Regulatory change types |
91 | | */ |
92 | | enum reg_type { |
93 | | REGDOM_TYPE_UNKNOWN, |
94 | | REGDOM_TYPE_COUNTRY, |
95 | | REGDOM_TYPE_WORLD, |
96 | | REGDOM_TYPE_CUSTOM_WORLD, |
97 | | REGDOM_TYPE_INTERSECTION, |
98 | | }; |
99 | | |
100 | | /** |
101 | | * struct hostapd_wmm_rule - WMM regulatory rule |
102 | | * @min_cwmin: Lower bound of CW_min value |
103 | | * @min_cwmax: Lower bound of CW_max value |
104 | | * @min_aifs: Lower bound of AIFS value |
105 | | * @max_txop: Upper bound of TXOP, value in units of 32 usec |
106 | | */ |
107 | | struct hostapd_wmm_rule { |
108 | | int min_cwmin; |
109 | | int min_cwmax; |
110 | | int min_aifs; |
111 | | int max_txop; |
112 | | }; |
113 | | |
114 | | /** |
115 | | * struct hostapd_channel_data - Channel information |
116 | | */ |
117 | | struct hostapd_channel_data { |
118 | | /** |
119 | | * chan - Channel number (IEEE 802.11) |
120 | | */ |
121 | | short chan; |
122 | | |
123 | | /** |
124 | | * freq - Frequency in MHz |
125 | | */ |
126 | | int freq; |
127 | | |
128 | | /** |
129 | | * flag - Channel flags (HOSTAPD_CHAN_*) |
130 | | */ |
131 | | int flag; |
132 | | |
133 | | /** |
134 | | * allowed_bw - Allowed channel width bitmask |
135 | | * |
136 | | * See enum hostapd_chan_width_attr. |
137 | | */ |
138 | | u32 allowed_bw; |
139 | | |
140 | | /** |
141 | | * max_tx_power - Regulatory transmit power limit in dBm |
142 | | */ |
143 | | u8 max_tx_power; |
144 | | |
145 | | /** |
146 | | * survey_list - Linked list of surveys (struct freq_survey) |
147 | | */ |
148 | | struct dl_list survey_list; |
149 | | |
150 | | /** |
151 | | * min_nf - Minimum observed noise floor, in dBm, based on all |
152 | | * surveyed channel data |
153 | | */ |
154 | | s8 min_nf; |
155 | | |
156 | | #ifdef CONFIG_ACS |
157 | | /** |
158 | | * interference_factor - Computed interference factor on this |
159 | | * channel (used internally in src/ap/acs.c; driver wrappers do not |
160 | | * need to set this) |
161 | | */ |
162 | | long double interference_factor; |
163 | | |
164 | | /** |
165 | | * interference_bss_based - Indicates whether the interference was |
166 | | * calculated from number of BSSs |
167 | | */ |
168 | | bool interference_bss_based; |
169 | | #endif /* CONFIG_ACS */ |
170 | | |
171 | | /** |
172 | | * dfs_cac_ms - DFS CAC time in milliseconds |
173 | | */ |
174 | | unsigned int dfs_cac_ms; |
175 | | |
176 | | /** |
177 | | * wmm_rules_valid - Indicates wmm_rules state |
178 | | */ |
179 | | int wmm_rules_valid; |
180 | | |
181 | | /** |
182 | | * wmm_rules - WMM regulatory rules |
183 | | */ |
184 | | struct hostapd_wmm_rule wmm_rules[WMM_AC_NUM]; |
185 | | |
186 | | /** |
187 | | * punct_bitmap - RU puncturing bitmap |
188 | | */ |
189 | | u16 punct_bitmap; |
190 | | }; |
191 | | |
192 | | #define HE_MAC_CAPAB_0 0 |
193 | | #define HE_MAX_MAC_CAPAB_SIZE 6 |
194 | | #define HE_MAX_PHY_CAPAB_SIZE 11 |
195 | | #define HE_MAX_MCS_CAPAB_SIZE 12 |
196 | | #define HE_MAX_PPET_CAPAB_SIZE 25 |
197 | | |
198 | | /** |
199 | | * struct he_capabilities - IEEE 802.11ax HE capabilities |
200 | | */ |
201 | | struct he_capabilities { |
202 | | u8 he_supported; |
203 | | u8 phy_cap[HE_MAX_PHY_CAPAB_SIZE]; |
204 | | u8 mac_cap[HE_MAX_MAC_CAPAB_SIZE]; |
205 | | u8 mcs[HE_MAX_MCS_CAPAB_SIZE]; |
206 | | u8 ppet[HE_MAX_PPET_CAPAB_SIZE]; |
207 | | u16 he_6ghz_capa; |
208 | | }; |
209 | | |
210 | | /* struct eht_capabilities - IEEE 802.11be EHT capabilities */ |
211 | | struct eht_capabilities { |
212 | | bool eht_supported; |
213 | | u16 mac_cap; |
214 | | u8 phy_cap[EHT_PHY_CAPAB_LEN]; |
215 | | u8 mcs[EHT_MCS_NSS_CAPAB_LEN]; |
216 | | u8 ppet[EHT_PPE_THRESH_CAPAB_LEN]; |
217 | | }; |
218 | | |
219 | | #define HOSTAPD_MODE_FLAG_HT_INFO_KNOWN BIT(0) |
220 | | #define HOSTAPD_MODE_FLAG_VHT_INFO_KNOWN BIT(1) |
221 | | #define HOSTAPD_MODE_FLAG_HE_INFO_KNOWN BIT(2) |
222 | | |
223 | | |
224 | | enum ieee80211_op_mode { |
225 | | IEEE80211_MODE_INFRA = 0, |
226 | | IEEE80211_MODE_IBSS = 1, |
227 | | IEEE80211_MODE_AP = 2, |
228 | | IEEE80211_MODE_MESH = 5, |
229 | | |
230 | | /* only add new entries before IEEE80211_MODE_NUM */ |
231 | | IEEE80211_MODE_NUM |
232 | | }; |
233 | | |
234 | | /** |
235 | | * struct ieee80211_edmg_config - EDMG configuration |
236 | | * |
237 | | * This structure describes most essential parameters needed |
238 | | * for IEEE 802.11ay EDMG configuration |
239 | | * |
240 | | * @channels: Bitmap that indicates the 2.16 GHz channel(s) |
241 | | * that are allowed to be used for transmissions. |
242 | | * Bit 0 indicates channel 1, bit 1 indicates channel 2, etc. |
243 | | * Set to 0 to indicate EDMG not supported. |
244 | | * @bw_config: Channel BW Configuration subfield encodes |
245 | | * the allowed channel bandwidth configurations |
246 | | */ |
247 | | struct ieee80211_edmg_config { |
248 | | u8 channels; |
249 | | enum edmg_bw_config bw_config; |
250 | | }; |
251 | | |
252 | | /** |
253 | | * struct hostapd_hw_modes - Supported hardware mode information |
254 | | */ |
255 | | struct hostapd_hw_modes { |
256 | | /** |
257 | | * mode - Hardware mode |
258 | | */ |
259 | | enum hostapd_hw_mode mode; |
260 | | |
261 | | /** |
262 | | * is_6ghz - Whether the mode information is for the 6 GHz band |
263 | | */ |
264 | | bool is_6ghz; |
265 | | |
266 | | /** |
267 | | * num_channels - Number of entries in the channels array |
268 | | */ |
269 | | int num_channels; |
270 | | |
271 | | /** |
272 | | * channels - Array of supported channels |
273 | | */ |
274 | | struct hostapd_channel_data *channels; |
275 | | |
276 | | /** |
277 | | * num_rates - Number of entries in the rates array |
278 | | */ |
279 | | int num_rates; |
280 | | |
281 | | /** |
282 | | * rates - Array of supported rates in 100 kbps units |
283 | | */ |
284 | | int *rates; |
285 | | |
286 | | /** |
287 | | * ht_capab - HT (IEEE 802.11n) capabilities |
288 | | */ |
289 | | u16 ht_capab; |
290 | | |
291 | | /** |
292 | | * mcs_set - MCS (IEEE 802.11n) rate parameters |
293 | | */ |
294 | | u8 mcs_set[16]; |
295 | | |
296 | | /** |
297 | | * a_mpdu_params - A-MPDU (IEEE 802.11n) parameters |
298 | | */ |
299 | | u8 a_mpdu_params; |
300 | | |
301 | | /** |
302 | | * vht_capab - VHT (IEEE 802.11ac) capabilities |
303 | | */ |
304 | | u32 vht_capab; |
305 | | |
306 | | /** |
307 | | * vht_mcs_set - VHT MCS (IEEE 802.11ac) rate parameters |
308 | | */ |
309 | | u8 vht_mcs_set[8]; |
310 | | |
311 | | unsigned int flags; /* HOSTAPD_MODE_FLAG_* */ |
312 | | |
313 | | /** |
314 | | * he_capab - HE (IEEE 802.11ax) capabilities |
315 | | */ |
316 | | struct he_capabilities he_capab[IEEE80211_MODE_NUM]; |
317 | | |
318 | | /** |
319 | | * This structure describes the most essential parameters needed |
320 | | * for IEEE 802.11ay EDMG configuration. |
321 | | */ |
322 | | struct ieee80211_edmg_config edmg; |
323 | | |
324 | | /** |
325 | | * eht_capab - EHT (IEEE 802.11be) capabilities |
326 | | */ |
327 | | struct eht_capabilities eht_capab[IEEE80211_MODE_NUM]; |
328 | | }; |
329 | | |
330 | | |
331 | | /** |
332 | | * struct hostapd_multi_hw_info: Supported multiple underlying hardware info |
333 | | */ |
334 | | struct hostapd_multi_hw_info { |
335 | | /** |
336 | | * hw_idx - Hardware index |
337 | | */ |
338 | | u8 hw_idx; |
339 | | |
340 | | /** |
341 | | * start_freq - Frequency range start in MHz |
342 | | */ |
343 | | int start_freq; |
344 | | |
345 | | /** |
346 | | * end_freq - Frequency range end in MHz |
347 | | */ |
348 | | int end_freq; |
349 | | }; |
350 | | |
351 | | |
352 | | #define IEEE80211_CAP_ESS 0x0001 |
353 | | #define IEEE80211_CAP_IBSS 0x0002 |
354 | | #define IEEE80211_CAP_PRIVACY 0x0010 |
355 | | #define IEEE80211_CAP_RRM 0x1000 |
356 | | |
357 | | /* DMG (60 GHz) IEEE 802.11ad */ |
358 | | /* type - bits 0..1 */ |
359 | | #define IEEE80211_CAP_DMG_MASK 0x0003 |
360 | | #define IEEE80211_CAP_DMG_IBSS 0x0001 /* Tx by: STA */ |
361 | | #define IEEE80211_CAP_DMG_PBSS 0x0002 /* Tx by: PCP */ |
362 | | #define IEEE80211_CAP_DMG_AP 0x0003 /* Tx by: AP */ |
363 | | |
364 | | #define WPA_SCAN_QUAL_INVALID BIT(0) |
365 | | #define WPA_SCAN_NOISE_INVALID BIT(1) |
366 | | #define WPA_SCAN_LEVEL_INVALID BIT(2) |
367 | | #define WPA_SCAN_LEVEL_DBM BIT(3) |
368 | | #define WPA_SCAN_ASSOCIATED BIT(5) |
369 | | |
370 | | /** |
371 | | * struct wpa_scan_res - Scan result for an BSS/IBSS |
372 | | * @flags: information flags about the BSS/IBSS (WPA_SCAN_*) |
373 | | * @bssid: BSSID |
374 | | * @freq: frequency of the channel in MHz (e.g., 2412 = channel 1) |
375 | | * @max_cw: the max channel width of the connection (calculated during scan |
376 | | * result processing) |
377 | | * @beacon_int: beacon interval in TUs (host byte order) |
378 | | * @caps: capability information field in host byte order |
379 | | * @qual: signal quality |
380 | | * @noise: noise level |
381 | | * @level: signal level |
382 | | * @tsf: Timestamp |
383 | | * @age: Age of the information in milliseconds (i.e., how many milliseconds |
384 | | * ago the last Beacon or Probe Response frame was received) |
385 | | * @est_throughput: Estimated throughput in kbps (this is calculated during |
386 | | * scan result processing if left zero by the driver wrapper) |
387 | | * @snr: Signal-to-noise ratio in dB (calculated during scan result processing) |
388 | | * @parent_tsf: Time when the Beacon/Probe Response frame was received in terms |
389 | | * of TSF of the BSS specified by %tsf_bssid. |
390 | | * @tsf_bssid: The BSS that %parent_tsf TSF time refers to. |
391 | | * @beacon_newer: Whether the Beacon frame data is known to be newer |
392 | | * @ie_len: length of the following IE field in octets |
393 | | * @beacon_ie_len: length of the following Beacon IE field in octets |
394 | | * |
395 | | * This structure is used as a generic format for scan results from the |
396 | | * driver. Each driver interface implementation is responsible for converting |
397 | | * the driver or OS specific scan results into this format. |
398 | | * |
399 | | * If the driver does not support reporting all IEs, the IE data structure is |
400 | | * constructed of the IEs that are available. This field will also need to |
401 | | * include SSID in IE format. All drivers are encouraged to be extended to |
402 | | * report all IEs to make it easier to support future additions. |
403 | | * |
404 | | * This structure data is followed by ie_len octets of IEs from Probe Response |
405 | | * frame (or if the driver does not indicate source of IEs, these may also be |
406 | | * from Beacon frame). After the first set of IEs, another set of IEs may follow |
407 | | * (with beacon_ie_len octets of data) if the driver provides both IE sets. |
408 | | */ |
409 | | struct wpa_scan_res { |
410 | | unsigned int flags; |
411 | | u8 bssid[ETH_ALEN]; |
412 | | int freq; |
413 | | enum chan_width max_cw; |
414 | | u16 beacon_int; |
415 | | u16 caps; |
416 | | int qual; |
417 | | int noise; |
418 | | int level; |
419 | | u64 tsf; |
420 | | unsigned int age; |
421 | | unsigned int est_throughput; |
422 | | int snr; |
423 | | u64 parent_tsf; |
424 | | u8 tsf_bssid[ETH_ALEN]; |
425 | | bool beacon_newer; |
426 | | size_t ie_len; |
427 | | size_t beacon_ie_len; |
428 | | /* Followed by ie_len + beacon_ie_len octets of IE data */ |
429 | | }; |
430 | | |
431 | | /** |
432 | | * struct wpa_scan_results - Scan results |
433 | | * @res: Array of pointers to allocated variable length scan result entries |
434 | | * @num: Number of entries in the scan result array |
435 | | * @fetch_time: Time when the results were fetched from the driver |
436 | | */ |
437 | | struct wpa_scan_results { |
438 | | struct wpa_scan_res **res; |
439 | | size_t num; |
440 | | struct os_reltime fetch_time; |
441 | | }; |
442 | | |
443 | | /** |
444 | | * struct wpa_interface_info - Network interface information |
445 | | * @next: Pointer to the next interface or NULL if this is the last one |
446 | | * @ifname: Interface name that can be used with init() or init2() |
447 | | * @desc: Human readable adapter description (e.g., vendor/model) or NULL if |
448 | | * not available |
449 | | * @drv_name: struct wpa_driver_ops::name (note: unlike other strings, this one |
450 | | * is not an allocated copy, i.e., get_interfaces() caller will not free |
451 | | * this) |
452 | | */ |
453 | | struct wpa_interface_info { |
454 | | struct wpa_interface_info *next; |
455 | | char *ifname; |
456 | | char *desc; |
457 | | const char *drv_name; |
458 | | }; |
459 | | |
460 | | #define WPAS_MAX_SCAN_SSIDS 16 |
461 | | |
462 | | /** |
463 | | * struct wpa_driver_scan_ssid - SSIDs to scan for |
464 | | * @ssid - specific SSID to scan for (ProbeReq) |
465 | | * %NULL or zero-length SSID is used to indicate active scan |
466 | | * with wildcard SSID. |
467 | | * @ssid_len - Length of the SSID in octets |
468 | | */ |
469 | | struct wpa_driver_scan_ssid { |
470 | | const u8 *ssid; |
471 | | size_t ssid_len; |
472 | | }; |
473 | | |
474 | | struct t2lm_mapping { |
475 | | /** |
476 | | * downlink - Bitmap of TIDs mapped with a link in downlink direction |
477 | | */ |
478 | | u8 downlink; |
479 | | |
480 | | /** |
481 | | * uplink - Bitmap of TIDs mapped with a link in uplink direction |
482 | | */ |
483 | | u8 uplink; |
484 | | }; |
485 | | |
486 | | /** |
487 | | * struct wpa_driver_scan_params - Scan parameters |
488 | | * Data for struct wpa_driver_ops::scan2(). |
489 | | */ |
490 | | struct wpa_driver_scan_params { |
491 | | /** |
492 | | * ssids - SSIDs to scan for |
493 | | */ |
494 | | struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS]; |
495 | | |
496 | | /** |
497 | | * num_ssids - Number of entries in ssids array |
498 | | * Zero indicates a request for a passive scan. |
499 | | */ |
500 | | size_t num_ssids; |
501 | | |
502 | | /** |
503 | | * extra_ies - Extra IE(s) to add into Probe Request or %NULL |
504 | | */ |
505 | | const u8 *extra_ies; |
506 | | |
507 | | /** |
508 | | * extra_ies_len - Length of extra_ies in octets |
509 | | */ |
510 | | size_t extra_ies_len; |
511 | | |
512 | | /** |
513 | | * freqs - Array of frequencies to scan or %NULL for all frequencies |
514 | | * |
515 | | * The frequency is set in MHz. The array is zero-terminated. |
516 | | */ |
517 | | int *freqs; |
518 | | |
519 | | /** |
520 | | * filter_ssids - Filter for reporting SSIDs |
521 | | * |
522 | | * This optional parameter can be used to request the driver wrapper to |
523 | | * filter scan results to include only the specified SSIDs. %NULL |
524 | | * indicates that no filtering is to be done. This can be used to |
525 | | * reduce memory needs for scan results in environments that have large |
526 | | * number of APs with different SSIDs. |
527 | | * |
528 | | * The driver wrapper is allowed to take this allocated buffer into its |
529 | | * own use by setting the pointer to %NULL. In that case, the driver |
530 | | * wrapper is responsible for freeing the buffer with os_free() once it |
531 | | * is not needed anymore. |
532 | | */ |
533 | | struct wpa_driver_scan_filter { |
534 | | u8 ssid[SSID_MAX_LEN]; |
535 | | size_t ssid_len; |
536 | | } *filter_ssids; |
537 | | |
538 | | /** |
539 | | * num_filter_ssids - Number of entries in filter_ssids array |
540 | | */ |
541 | | size_t num_filter_ssids; |
542 | | |
543 | | /** |
544 | | * filter_rssi - Filter by RSSI |
545 | | * |
546 | | * The driver may filter scan results in firmware to reduce host |
547 | | * wakeups and thereby save power. Specify the RSSI threshold in s32 |
548 | | * dBm. |
549 | | */ |
550 | | s32 filter_rssi; |
551 | | |
552 | | /** |
553 | | * p2p_probe - Used to disable CCK (802.11b) rates for P2P probes |
554 | | * |
555 | | * When set, the driver is expected to remove rates 1, 2, 5.5, and 11 |
556 | | * Mbps from the support rates element(s) in the Probe Request frames |
557 | | * and not to transmit the frames at any of those rates. |
558 | | */ |
559 | | unsigned int p2p_probe:1; |
560 | | |
561 | | /** |
562 | | * only_new_results - Request driver to report only new results |
563 | | * |
564 | | * This is used to request the driver to report only BSSes that have |
565 | | * been detected after this scan request has been started, i.e., to |
566 | | * flush old cached BSS entries. |
567 | | */ |
568 | | unsigned int only_new_results:1; |
569 | | |
570 | | /** |
571 | | * low_priority - Requests driver to use a lower scan priority |
572 | | * |
573 | | * This is used to request the driver to use a lower scan priority |
574 | | * if it supports such a thing. |
575 | | */ |
576 | | unsigned int low_priority:1; |
577 | | |
578 | | /** |
579 | | * mac_addr_rand - Requests driver to randomize MAC address |
580 | | */ |
581 | | unsigned int mac_addr_rand:1; |
582 | | |
583 | | /** |
584 | | * mac_addr - MAC address used with randomization. The address cannot be |
585 | | * a multicast one, i.e., bit 0 of byte 0 should not be set. |
586 | | */ |
587 | | u8 *mac_addr; |
588 | | |
589 | | /** |
590 | | * mac_addr_mask - MAC address mask used with randomization. |
591 | | * |
592 | | * Bits that are 0 in the mask should be randomized. Bits that are 1 in |
593 | | * the mask should be taken as is from mac_addr. The mask should not |
594 | | * allow the generation of a multicast address, i.e., bit 0 of byte 0 |
595 | | * must be set. |
596 | | */ |
597 | | const u8 *mac_addr_mask; |
598 | | |
599 | | /** |
600 | | * sched_scan_plans - Scan plans for scheduled scan |
601 | | * |
602 | | * Each scan plan consists of the number of iterations to scan and the |
603 | | * interval between scans. When a scan plan finishes (i.e., it was run |
604 | | * for the specified number of iterations), the next scan plan is |
605 | | * executed. The scan plans are executed in the order they appear in |
606 | | * the array (lower index first). The last scan plan will run infinitely |
607 | | * (until requested to stop), thus must not specify the number of |
608 | | * iterations. All other scan plans must specify the number of |
609 | | * iterations. |
610 | | */ |
611 | | struct sched_scan_plan { |
612 | | u32 interval; /* In seconds */ |
613 | | u32 iterations; /* Zero to run infinitely */ |
614 | | } *sched_scan_plans; |
615 | | |
616 | | /** |
617 | | * sched_scan_plans_num - Number of scan plans in sched_scan_plans array |
618 | | */ |
619 | | unsigned int sched_scan_plans_num; |
620 | | |
621 | | /** |
622 | | * sched_scan_start_delay - Delay to use before starting the first scan |
623 | | * |
624 | | * Delay (in seconds) before scheduling first scan plan cycle. The |
625 | | * driver may ignore this parameter and start immediately (or at any |
626 | | * other time), if this feature is not supported. |
627 | | */ |
628 | | u32 sched_scan_start_delay; |
629 | | |
630 | | /** |
631 | | * bssid - Specific BSSID to scan for |
632 | | * |
633 | | * This optional parameter can be used to replace the default wildcard |
634 | | * BSSID with a specific BSSID to scan for if results are needed from |
635 | | * only a single BSS. |
636 | | */ |
637 | | const u8 *bssid; |
638 | | |
639 | | /** |
640 | | * scan_cookie - Unique identification representing the scan request |
641 | | * |
642 | | * This scan_cookie carries a unique identification representing the |
643 | | * scan request if the host driver/kernel supports concurrent scan |
644 | | * requests. This cookie is returned from the corresponding driver |
645 | | * interface. |
646 | | * |
647 | | * Note: Unlike other parameters in this structure, scan_cookie is used |
648 | | * only to return information instead of setting parameters for the |
649 | | * scan. |
650 | | */ |
651 | | u64 scan_cookie; |
652 | | |
653 | | /** |
654 | | * duration - Dwell time on each channel |
655 | | * |
656 | | * This optional parameter can be used to set the dwell time on each |
657 | | * channel. In TUs. |
658 | | */ |
659 | | u16 duration; |
660 | | |
661 | | /** |
662 | | * duration_mandatory - Whether the specified duration is mandatory |
663 | | * |
664 | | * If this is set, the duration specified by the %duration field is |
665 | | * mandatory (and the driver should reject the scan request if it is |
666 | | * unable to comply with the specified duration), otherwise it is the |
667 | | * maximum duration and the actual duration may be shorter. |
668 | | */ |
669 | | unsigned int duration_mandatory:1; |
670 | | |
671 | | /** |
672 | | * relative_rssi_set - Whether relative RSSI parameters are set |
673 | | */ |
674 | | unsigned int relative_rssi_set:1; |
675 | | |
676 | | /** |
677 | | * relative_rssi - Relative RSSI for reporting better BSSs |
678 | | * |
679 | | * Amount of RSSI by which a BSS should be better than the current |
680 | | * connected BSS to report the new BSS to user space. |
681 | | */ |
682 | | s8 relative_rssi; |
683 | | |
684 | | /** |
685 | | * relative_adjust_band - Band to which RSSI should be adjusted |
686 | | * |
687 | | * The relative_adjust_rssi should be added to the band specified |
688 | | * by relative_adjust_band. |
689 | | */ |
690 | | enum set_band relative_adjust_band; |
691 | | |
692 | | /** |
693 | | * relative_adjust_rssi - RSSI to be added to relative_adjust_band |
694 | | * |
695 | | * An amount of relative_band_rssi should be added to the BSSs that |
696 | | * belong to the band specified by relative_adjust_band while comparing |
697 | | * with other bands for BSS reporting. |
698 | | */ |
699 | | s8 relative_adjust_rssi; |
700 | | |
701 | | /** |
702 | | * oce_scan |
703 | | * |
704 | | * Enable the following OCE scan features: (WFA OCE TechSpec v1.0) |
705 | | * - Accept broadcast Probe Response frame. |
706 | | * - Probe Request frame deferral and suppression. |
707 | | * - Max Channel Time - driver fills FILS request params IE with |
708 | | * Maximum Channel Time. |
709 | | * - Send 1st Probe Request frame in rate of minimum 5.5 Mbps. |
710 | | */ |
711 | | unsigned int oce_scan:1; |
712 | | |
713 | | /** |
714 | | * p2p_include_6ghz - Include 6 GHz channels for P2P full scan |
715 | | * |
716 | | */ |
717 | | unsigned int p2p_include_6ghz:1; |
718 | | |
719 | | /** |
720 | | * non_coloc_6ghz - Force scanning of non-PSC 6 GHz channels |
721 | | * |
722 | | * If this is set, the driver should scan non-PSC channels from the |
723 | | * scan request even if neighbor reports from 2.4/5 GHz APs did not |
724 | | * report a co-located AP on these channels. The default is to scan |
725 | | * non-PSC channels only if a co-located AP was reported on the channel. |
726 | | */ |
727 | | unsigned int non_coloc_6ghz:1; |
728 | | |
729 | | /** |
730 | | * min_probe_req_content - Minimize probe request content to only have |
731 | | * minimal requirement elements, e.g., supported rates etc., and no |
732 | | * additional elements other then those provided by user space. |
733 | | */ |
734 | | unsigned int min_probe_req_content:1; |
735 | | |
736 | | /** |
737 | | * link_id - Specify the link that is requesting the scan on an MLD |
738 | | * |
739 | | * This is set when operating as an AP MLD and doing an OBSS scan. |
740 | | * -1 indicates that no particular link ID is set. |
741 | | */ |
742 | | s8 link_id; |
743 | | |
744 | | /* |
745 | | * NOTE: Whenever adding new parameters here, please make sure |
746 | | * wpa_scan_clone_params() and wpa_scan_free_params() get updated with |
747 | | * matching changes. |
748 | | */ |
749 | | }; |
750 | | |
751 | | /** |
752 | | * struct wpa_driver_auth_params - Authentication parameters |
753 | | * Data for struct wpa_driver_ops::authenticate(). |
754 | | */ |
755 | | struct wpa_driver_auth_params { |
756 | | int freq; |
757 | | const u8 *bssid; |
758 | | const u8 *ssid; |
759 | | size_t ssid_len; |
760 | | int auth_alg; |
761 | | const u8 *ie; |
762 | | size_t ie_len; |
763 | | const u8 *wep_key[4]; |
764 | | size_t wep_key_len[4]; |
765 | | int wep_tx_keyidx; |
766 | | int local_state_change; |
767 | | |
768 | | /** |
769 | | * p2p - Whether this connection is a P2P group |
770 | | */ |
771 | | int p2p; |
772 | | |
773 | | /** |
774 | | * auth_data - Additional elements for Authentication frame |
775 | | * |
776 | | * This buffer starts with the Authentication transaction sequence |
777 | | * number field. If no special handling of such elements is needed, this |
778 | | * pointer is %NULL. This is used with SAE and FILS. |
779 | | */ |
780 | | const u8 *auth_data; |
781 | | |
782 | | /** |
783 | | * auth_data_len - Length of auth_data buffer in octets |
784 | | */ |
785 | | size_t auth_data_len; |
786 | | |
787 | | /** |
788 | | * mld - Establish an MLD connection |
789 | | */ |
790 | | bool mld; |
791 | | |
792 | | /** |
793 | | * mld_link_id - The link ID of the MLD AP to which we are associating |
794 | | */ |
795 | | u8 mld_link_id; |
796 | | |
797 | | /** |
798 | | * The MLD AP address |
799 | | */ |
800 | | const u8 *ap_mld_addr; |
801 | | }; |
802 | | |
803 | | /** |
804 | | * enum wps_mode - WPS mode |
805 | | */ |
806 | | enum wps_mode { |
807 | | /** |
808 | | * WPS_MODE_NONE - No WPS provisioning being used |
809 | | */ |
810 | | WPS_MODE_NONE, |
811 | | |
812 | | /** |
813 | | * WPS_MODE_OPEN - WPS provisioning with AP that is in open mode |
814 | | */ |
815 | | WPS_MODE_OPEN, |
816 | | |
817 | | /** |
818 | | * WPS_MODE_PRIVACY - WPS provisioning with AP that is using protection |
819 | | */ |
820 | | WPS_MODE_PRIVACY |
821 | | }; |
822 | | |
823 | | /** |
824 | | * struct hostapd_freq_params - Channel parameters |
825 | | */ |
826 | | struct hostapd_freq_params { |
827 | | /** |
828 | | * mode - Mode/band (HOSTAPD_MODE_IEEE80211A, ..) |
829 | | */ |
830 | | enum hostapd_hw_mode mode; |
831 | | |
832 | | /** |
833 | | * freq - Primary channel center frequency in MHz |
834 | | */ |
835 | | int freq; |
836 | | |
837 | | /** |
838 | | * channel - Channel number |
839 | | */ |
840 | | int channel; |
841 | | |
842 | | /** |
843 | | * ht_enabled - Whether HT is enabled |
844 | | */ |
845 | | int ht_enabled; |
846 | | |
847 | | /** |
848 | | * sec_channel_offset - Secondary channel offset for HT40 |
849 | | * |
850 | | * 0 = HT40 disabled, |
851 | | * -1 = HT40 enabled, secondary channel below primary, |
852 | | * 1 = HT40 enabled, secondary channel above primary |
853 | | */ |
854 | | int sec_channel_offset; |
855 | | |
856 | | /** |
857 | | * vht_enabled - Whether VHT is enabled |
858 | | */ |
859 | | int vht_enabled; |
860 | | |
861 | | /** |
862 | | * he_enabled - Whether HE is enabled |
863 | | */ |
864 | | int he_enabled; |
865 | | |
866 | | /** |
867 | | * center_freq1 - Segment 0 center frequency in MHz |
868 | | * |
869 | | * Valid for both HT and VHT. |
870 | | */ |
871 | | int center_freq1; |
872 | | |
873 | | /** |
874 | | * center_freq2 - Segment 1 center frequency in MHz |
875 | | * |
876 | | * Non-zero only for bandwidth 80 and an 80+80 channel |
877 | | */ |
878 | | int center_freq2; |
879 | | |
880 | | /** |
881 | | * bandwidth - Channel bandwidth in MHz (20, 40, 80, 160) |
882 | | */ |
883 | | int bandwidth; |
884 | | |
885 | | /** |
886 | | * This structure describes the most essential parameters needed |
887 | | * for IEEE 802.11ay EDMG configuration. |
888 | | */ |
889 | | struct ieee80211_edmg_config edmg; |
890 | | |
891 | | /** |
892 | | * radar_background - Whether radar/CAC background is requested |
893 | | */ |
894 | | bool radar_background; |
895 | | |
896 | | /** |
897 | | * eht_enabled - Whether EHT is enabled |
898 | | */ |
899 | | bool eht_enabled; |
900 | | |
901 | | /** |
902 | | * punct_bitmap - Preamble puncturing bitmap |
903 | | * Each bit corresponds to a 20 MHz subchannel, the lowest bit for the |
904 | | * channel with the lowest frequency. A bit set to 1 indicates that the |
905 | | * subchannel is punctured, otherwise active. |
906 | | */ |
907 | | u16 punct_bitmap; |
908 | | |
909 | | /** |
910 | | * link_id: If >=0 indicates the link of the AP MLD to configure |
911 | | */ |
912 | | int link_id; |
913 | | }; |
914 | | |
915 | | /** |
916 | | * struct wpa_driver_sta_auth_params - Authentication parameters |
917 | | * Data for struct wpa_driver_ops::sta_auth(). |
918 | | */ |
919 | | struct wpa_driver_sta_auth_params { |
920 | | |
921 | | /** |
922 | | * own_addr - Source address and BSSID for authentication frame |
923 | | */ |
924 | | const u8 *own_addr; |
925 | | |
926 | | /** |
927 | | * addr - MAC address of the station to associate |
928 | | */ |
929 | | const u8 *addr; |
930 | | |
931 | | /** |
932 | | * seq - authentication sequence number |
933 | | */ |
934 | | u16 seq; |
935 | | |
936 | | /** |
937 | | * status - authentication response status code |
938 | | */ |
939 | | u16 status; |
940 | | |
941 | | /** |
942 | | * ie - authentication frame ie buffer |
943 | | */ |
944 | | const u8 *ie; |
945 | | |
946 | | /** |
947 | | * len - ie buffer length |
948 | | */ |
949 | | size_t len; |
950 | | |
951 | | /** |
952 | | * fils_auth - Indicates whether FILS authentication is being performed |
953 | | */ |
954 | | int fils_auth; |
955 | | |
956 | | /** |
957 | | * fils_anonce - ANonce (required for FILS) |
958 | | */ |
959 | | u8 fils_anonce[WPA_NONCE_LEN]; |
960 | | |
961 | | /** |
962 | | * fils_snonce - SNonce (required for FILS) |
963 | | */ |
964 | | u8 fils_snonce[WPA_NONCE_LEN]; |
965 | | |
966 | | /** |
967 | | * fils_kek - key for encryption (required for FILS) |
968 | | */ |
969 | | u8 fils_kek[WPA_KEK_MAX_LEN]; |
970 | | |
971 | | /** |
972 | | * fils_kek_len - Length of the fils_kek in octets (required for FILS) |
973 | | */ |
974 | | size_t fils_kek_len; |
975 | | }; |
976 | | |
977 | | struct wpa_driver_mld_params { |
978 | | /** |
979 | | * mld_addr - AP's MLD address |
980 | | */ |
981 | | const u8 *mld_addr; |
982 | | |
983 | | /** |
984 | | * valid_links - The valid links including the association link |
985 | | */ |
986 | | u16 valid_links; |
987 | | |
988 | | /** |
989 | | * assoc_link_id - The link on which the association is performed |
990 | | */ |
991 | | u8 assoc_link_id; |
992 | | |
993 | | /** |
994 | | * mld_links - Link information |
995 | | * |
996 | | * Should include information on all the requested links for association |
997 | | * including the link on which the association should take place. |
998 | | * For the association link, the ies and ies_len should be NULL and |
999 | | * 0 respectively. |
1000 | | */ |
1001 | | struct { |
1002 | | int freq; |
1003 | | const u8 *bssid; |
1004 | | const u8 *ies; |
1005 | | size_t ies_len; |
1006 | | int error; |
1007 | | bool disabled; |
1008 | | } mld_links[MAX_NUM_MLD_LINKS]; |
1009 | | }; |
1010 | | |
1011 | | /** |
1012 | | * struct wpa_driver_associate_params - Association parameters |
1013 | | * Data for struct wpa_driver_ops::associate(). |
1014 | | */ |
1015 | | struct wpa_driver_associate_params { |
1016 | | /** |
1017 | | * bssid - BSSID of the selected AP |
1018 | | * This can be %NULL, if ap_scan=2 mode is used and the driver is |
1019 | | * responsible for selecting with which BSS to associate. */ |
1020 | | const u8 *bssid; |
1021 | | |
1022 | | /** |
1023 | | * bssid_hint - BSSID of a proposed AP |
1024 | | * |
1025 | | * This indicates which BSS has been found a suitable candidate for |
1026 | | * initial association for drivers that use driver/firmwate-based BSS |
1027 | | * selection. Unlike the @bssid parameter, @bssid_hint does not limit |
1028 | | * the driver from selecting other BSSes in the ESS. |
1029 | | */ |
1030 | | const u8 *bssid_hint; |
1031 | | |
1032 | | /** |
1033 | | * ssid - The selected SSID |
1034 | | */ |
1035 | | const u8 *ssid; |
1036 | | |
1037 | | /** |
1038 | | * ssid_len - Length of the SSID (1..32) |
1039 | | */ |
1040 | | size_t ssid_len; |
1041 | | |
1042 | | /** |
1043 | | * freq - channel parameters |
1044 | | */ |
1045 | | struct hostapd_freq_params freq; |
1046 | | |
1047 | | /** |
1048 | | * freq_hint - Frequency of the channel the proposed AP is using |
1049 | | * |
1050 | | * This provides a channel on which a suitable BSS has been found as a |
1051 | | * hint for the driver. Unlike the @freq parameter, @freq_hint does not |
1052 | | * limit the driver from selecting other channels for |
1053 | | * driver/firmware-based BSS selection. |
1054 | | */ |
1055 | | int freq_hint; |
1056 | | |
1057 | | /** |
1058 | | * bg_scan_period - Background scan period in seconds, 0 to disable |
1059 | | * background scan, or -1 to indicate no change to default driver |
1060 | | * configuration |
1061 | | */ |
1062 | | int bg_scan_period; |
1063 | | |
1064 | | /** |
1065 | | * beacon_int - Beacon interval for IBSS or 0 to use driver default |
1066 | | */ |
1067 | | int beacon_int; |
1068 | | |
1069 | | /** |
1070 | | * wpa_ie - WPA information element for (Re)Association Request |
1071 | | * WPA information element to be included in (Re)Association |
1072 | | * Request (including information element id and length). Use |
1073 | | * of this WPA IE is optional. If the driver generates the WPA |
1074 | | * IE, it can use pairwise_suite, group_suite, group_mgmt_suite, and |
1075 | | * key_mgmt_suite to select proper algorithms. In this case, |
1076 | | * the driver has to notify wpa_supplicant about the used WPA |
1077 | | * IE by generating an event that the interface code will |
1078 | | * convert into EVENT_ASSOCINFO data (see below). |
1079 | | * |
1080 | | * When using WPA2/IEEE 802.11i, wpa_ie is used for RSN IE |
1081 | | * instead. The driver can determine which version is used by |
1082 | | * looking at the first byte of the IE (0xdd for WPA, 0x30 for |
1083 | | * WPA2/RSN). |
1084 | | * |
1085 | | * When using WPS, wpa_ie is used for WPS IE instead of WPA/RSN IE. |
1086 | | */ |
1087 | | const u8 *wpa_ie; |
1088 | | |
1089 | | /** |
1090 | | * wpa_ie_len - length of the wpa_ie |
1091 | | */ |
1092 | | size_t wpa_ie_len; |
1093 | | |
1094 | | /** |
1095 | | * wpa_proto - Bitfield of WPA_PROTO_* values to indicate WPA/WPA2 |
1096 | | */ |
1097 | | unsigned int wpa_proto; |
1098 | | |
1099 | | /** |
1100 | | * pairwise_suite - Selected pairwise cipher suite (WPA_CIPHER_*) |
1101 | | * |
1102 | | * This is usually ignored if @wpa_ie is used. |
1103 | | */ |
1104 | | unsigned int pairwise_suite; |
1105 | | |
1106 | | /** |
1107 | | * group_suite - Selected group cipher suite (WPA_CIPHER_*) |
1108 | | * |
1109 | | * This is usually ignored if @wpa_ie is used. |
1110 | | */ |
1111 | | unsigned int group_suite; |
1112 | | |
1113 | | /** |
1114 | | * mgmt_group_suite - Selected group management cipher suite (WPA_CIPHER_*) |
1115 | | * |
1116 | | * This is usually ignored if @wpa_ie is used. |
1117 | | */ |
1118 | | unsigned int mgmt_group_suite; |
1119 | | |
1120 | | /** |
1121 | | * key_mgmt_suite - Selected key management suite (WPA_KEY_MGMT_*) |
1122 | | * |
1123 | | * This is usually ignored if @wpa_ie is used. |
1124 | | */ |
1125 | | unsigned int key_mgmt_suite; |
1126 | | |
1127 | | /** |
1128 | | * allowed_key_mgmts - Bitfield of allowed key management suites |
1129 | | * (WPA_KEY_MGMT_*) other than @key_mgmt_suite for the current |
1130 | | * connection |
1131 | | * |
1132 | | * SME in the driver may choose key_mgmt from this list for the initial |
1133 | | * connection or roaming. The driver which doesn't support this |
1134 | | * ignores this parameter. |
1135 | | */ |
1136 | | unsigned int allowed_key_mgmts; |
1137 | | |
1138 | | /** |
1139 | | * auth_alg - Allowed authentication algorithms |
1140 | | * Bit field of WPA_AUTH_ALG_* |
1141 | | */ |
1142 | | int auth_alg; |
1143 | | |
1144 | | /** |
1145 | | * mode - Operation mode (infra/ibss) IEEE80211_MODE_* |
1146 | | */ |
1147 | | int mode; |
1148 | | |
1149 | | /** |
1150 | | * wep_key - WEP keys for static WEP configuration |
1151 | | */ |
1152 | | const u8 *wep_key[4]; |
1153 | | |
1154 | | /** |
1155 | | * wep_key_len - WEP key length for static WEP configuration |
1156 | | */ |
1157 | | size_t wep_key_len[4]; |
1158 | | |
1159 | | /** |
1160 | | * wep_tx_keyidx - WEP TX key index for static WEP configuration |
1161 | | */ |
1162 | | int wep_tx_keyidx; |
1163 | | |
1164 | | /** |
1165 | | * mgmt_frame_protection - IEEE 802.11w management frame protection |
1166 | | */ |
1167 | | enum mfp_options mgmt_frame_protection; |
1168 | | |
1169 | | /** |
1170 | | * passphrase - RSN passphrase for PSK |
1171 | | * |
1172 | | * This value is made available only for WPA/WPA2-Personal (PSK) and |
1173 | | * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK. This |
1174 | | * is the 8..63 character ASCII passphrase, if available. Please note |
1175 | | * that this can be %NULL if passphrase was not used to generate the |
1176 | | * PSK. In that case, the psk field must be used to fetch the PSK. |
1177 | | */ |
1178 | | const char *passphrase; |
1179 | | |
1180 | | /** |
1181 | | * psk - RSN PSK (alternative for passphrase for PSK) |
1182 | | * |
1183 | | * This value is made available only for WPA/WPA2-Personal (PSK) and |
1184 | | * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK. This |
1185 | | * is the 32-octet (256-bit) PSK, if available. The driver wrapper |
1186 | | * should be prepared to handle %NULL value as an error. |
1187 | | */ |
1188 | | const u8 *psk; |
1189 | | |
1190 | | /** |
1191 | | * sae_password - Password for SAE authentication |
1192 | | * |
1193 | | * This value is made available only for WPA3-Personal (SAE) and only |
1194 | | * for drivers that set WPA_DRIVER_FLAGS2_SAE_OFFLOAD. |
1195 | | */ |
1196 | | const char *sae_password; |
1197 | | |
1198 | | /** |
1199 | | * sae_password_id - Password Identifier for SAE authentication |
1200 | | * |
1201 | | * This value is made available only for WPA3-Personal (SAE) and only |
1202 | | * for drivers that set WPA_DRIVER_FLAGS2_SAE_OFFLOAD. If %NULL, SAE |
1203 | | * password identifier is not used. |
1204 | | */ |
1205 | | const char *sae_password_id; |
1206 | | |
1207 | | /** |
1208 | | * drop_unencrypted - Enable/disable unencrypted frame filtering |
1209 | | * |
1210 | | * Configure the driver to drop all non-EAPOL frames (both receive and |
1211 | | * transmit paths). Unencrypted EAPOL frames (ethertype 0x888e) must |
1212 | | * still be allowed for key negotiation. |
1213 | | */ |
1214 | | int drop_unencrypted; |
1215 | | |
1216 | | /** |
1217 | | * prev_bssid - Previously used BSSID in this ESS |
1218 | | * |
1219 | | * When not %NULL, this is a request to use reassociation instead of |
1220 | | * association. |
1221 | | */ |
1222 | | const u8 *prev_bssid; |
1223 | | |
1224 | | /** |
1225 | | * wps - WPS mode |
1226 | | * |
1227 | | * If the driver needs to do special configuration for WPS association, |
1228 | | * this variable provides more information on what type of association |
1229 | | * is being requested. Most drivers should not need to use this. |
1230 | | */ |
1231 | | enum wps_mode wps; |
1232 | | |
1233 | | /** |
1234 | | * p2p - Whether this connection is a P2P group |
1235 | | */ |
1236 | | int p2p; |
1237 | | |
1238 | | /** |
1239 | | * uapsd - UAPSD parameters for the network |
1240 | | * -1 = do not change defaults |
1241 | | * AP mode: 1 = enabled, 0 = disabled |
1242 | | * STA mode: bits 0..3 UAPSD enabled for VO,VI,BK,BE |
1243 | | */ |
1244 | | int uapsd; |
1245 | | |
1246 | | /** |
1247 | | * fixed_bssid - Whether to force this BSSID in IBSS mode |
1248 | | * 1 = Fix this BSSID and prevent merges. |
1249 | | * 0 = Do not fix BSSID. |
1250 | | */ |
1251 | | int fixed_bssid; |
1252 | | |
1253 | | /** |
1254 | | * fixed_freq - Fix control channel in IBSS mode |
1255 | | * 0 = don't fix control channel (default) |
1256 | | * 1 = fix control channel; this prevents IBSS merging with another |
1257 | | * channel |
1258 | | */ |
1259 | | int fixed_freq; |
1260 | | |
1261 | | /** |
1262 | | * disable_ht - Disable HT (IEEE 802.11n) for this connection |
1263 | | */ |
1264 | | int disable_ht; |
1265 | | |
1266 | | /** |
1267 | | * htcaps - HT Capabilities over-rides |
1268 | | * |
1269 | | * Only bits set in the mask will be used, and not all values are used |
1270 | | * by the kernel anyway. Currently, MCS, MPDU and MSDU fields are used. |
1271 | | * |
1272 | | * Pointer to struct ieee80211_ht_capabilities. |
1273 | | */ |
1274 | | const u8 *htcaps; |
1275 | | |
1276 | | /** |
1277 | | * htcaps_mask - HT Capabilities over-rides mask |
1278 | | * |
1279 | | * Pointer to struct ieee80211_ht_capabilities. |
1280 | | */ |
1281 | | const u8 *htcaps_mask; |
1282 | | |
1283 | | #ifdef CONFIG_VHT_OVERRIDES |
1284 | | /** |
1285 | | * disable_vht - Disable VHT for this connection |
1286 | | */ |
1287 | | int disable_vht; |
1288 | | |
1289 | | /** |
1290 | | * VHT capability overrides. |
1291 | | */ |
1292 | | const struct ieee80211_vht_capabilities *vhtcaps; |
1293 | | const struct ieee80211_vht_capabilities *vhtcaps_mask; |
1294 | | #endif /* CONFIG_VHT_OVERRIDES */ |
1295 | | |
1296 | | #ifdef CONFIG_HE_OVERRIDES |
1297 | | /** |
1298 | | * disable_he - Disable HE for this connection |
1299 | | */ |
1300 | | int disable_he; |
1301 | | #endif /* CONFIG_HE_OVERRIDES */ |
1302 | | |
1303 | | /** |
1304 | | * req_key_mgmt_offload - Request key management offload for connection |
1305 | | * |
1306 | | * Request key management offload for this connection if the device |
1307 | | * supports it. |
1308 | | */ |
1309 | | int req_key_mgmt_offload; |
1310 | | |
1311 | | /** |
1312 | | * req_handshake_offload - Request EAPOL handshake offload |
1313 | | * |
1314 | | * Request EAPOL handshake offload for this connection if the device |
1315 | | * supports it. |
1316 | | */ |
1317 | | int req_handshake_offload; |
1318 | | |
1319 | | /** |
1320 | | * Flag for indicating whether this association includes support for |
1321 | | * RRM (Radio Resource Measurements) |
1322 | | */ |
1323 | | int rrm_used; |
1324 | | |
1325 | | /** |
1326 | | * pbss - If set, connect to a PCP in a PBSS. Otherwise, connect to an |
1327 | | * AP as usual. Valid for DMG network only. |
1328 | | */ |
1329 | | int pbss; |
1330 | | |
1331 | | /** |
1332 | | * fils_kek - KEK for FILS association frame protection (AES-SIV) |
1333 | | */ |
1334 | | const u8 *fils_kek; |
1335 | | |
1336 | | /** |
1337 | | * fils_kek_len: Length of fils_kek in bytes |
1338 | | */ |
1339 | | size_t fils_kek_len; |
1340 | | |
1341 | | /** |
1342 | | * fils_nonces - Nonces for FILS association frame protection |
1343 | | * (AES-SIV AAD) |
1344 | | */ |
1345 | | const u8 *fils_nonces; |
1346 | | |
1347 | | /** |
1348 | | * fils_nonces_len: Length of fils_nonce in bytes |
1349 | | */ |
1350 | | size_t fils_nonces_len; |
1351 | | |
1352 | | /** |
1353 | | * fils_erp_username - Username part of keyName-NAI |
1354 | | */ |
1355 | | const u8 *fils_erp_username; |
1356 | | |
1357 | | /** |
1358 | | * fils_erp_username_len - Length of fils_erp_username in bytes |
1359 | | */ |
1360 | | size_t fils_erp_username_len; |
1361 | | |
1362 | | /** |
1363 | | * fils_erp_realm - Realm/domain name to use in FILS ERP |
1364 | | */ |
1365 | | const u8 *fils_erp_realm; |
1366 | | |
1367 | | /** |
1368 | | * fils_erp_realm_len - Length of fils_erp_realm in bytes |
1369 | | */ |
1370 | | size_t fils_erp_realm_len; |
1371 | | |
1372 | | /** |
1373 | | * fils_erp_next_seq_num - The next sequence number to use in FILS ERP |
1374 | | * messages |
1375 | | */ |
1376 | | u16 fils_erp_next_seq_num; |
1377 | | |
1378 | | /** |
1379 | | * fils_erp_rrk - Re-authentication root key (rRK) for the keyName-NAI |
1380 | | * specified by fils_erp_username@fils_erp_realm. |
1381 | | */ |
1382 | | const u8 *fils_erp_rrk; |
1383 | | |
1384 | | /** |
1385 | | * fils_erp_rrk_len - Length of fils_erp_rrk in bytes |
1386 | | */ |
1387 | | size_t fils_erp_rrk_len; |
1388 | | |
1389 | | /** |
1390 | | * sae_pwe - SAE mechanism for PWE derivation |
1391 | | * 0 = hunting-and-pecking loop only |
1392 | | * 1 = hash-to-element only |
1393 | | * 2 = both hunting-and-pecking loop and hash-to-element enabled |
1394 | | */ |
1395 | | enum sae_pwe sae_pwe; |
1396 | | |
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; |
1406 | | |
1407 | | /** |
1408 | | * rsn_overriding - wpa_supplicant RSN overriding support |
1409 | | */ |
1410 | | bool rsn_overriding; |
1411 | | |
1412 | | /** |
1413 | | * spp_amsdu - SPP A-MSDU used on this connection |
1414 | | */ |
1415 | | bool spp_amsdu; |
1416 | | |
1417 | | /** |
1418 | | * bssid_filter - Allowed BSSIDs for the current association |
1419 | | * This can be %NULL to indicate no constraint. */ |
1420 | | const u8 *bssid_filter; |
1421 | | |
1422 | | /** |
1423 | | * bssid_filter_count - Number of allowed BSSIDs |
1424 | | */ |
1425 | | unsigned int bssid_filter_count; |
1426 | | |
1427 | | /** |
1428 | | * p2p_mode - P2P R1 only, P2P R2 only, or PCC mode |
1429 | | */ |
1430 | | enum wpa_p2p_mode p2p_mode; |
1431 | | }; |
1432 | | |
1433 | | enum hide_ssid { |
1434 | | NO_SSID_HIDING, |
1435 | | HIDDEN_SSID_ZERO_LEN, |
1436 | | HIDDEN_SSID_ZERO_CONTENTS |
1437 | | }; |
1438 | | |
1439 | | enum ch_switch_state { |
1440 | | CH_SW_STARTED, |
1441 | | CH_SW_FINISHED |
1442 | | }; |
1443 | | |
1444 | | struct wowlan_triggers { |
1445 | | u8 any; |
1446 | | u8 disconnect; |
1447 | | u8 magic_pkt; |
1448 | | u8 gtk_rekey_failure; |
1449 | | u8 eap_identity_req; |
1450 | | u8 four_way_handshake; |
1451 | | u8 rfkill_release; |
1452 | | }; |
1453 | | |
1454 | | struct unsol_bcast_probe_resp { |
1455 | | /** |
1456 | | * Unsolicited broadcast Probe Response interval in TUs |
1457 | | */ |
1458 | | unsigned int unsol_bcast_probe_resp_interval; |
1459 | | |
1460 | | /** |
1461 | | * Unsolicited broadcast Probe Response template data |
1462 | | */ |
1463 | | u8 *unsol_bcast_probe_resp_tmpl; |
1464 | | |
1465 | | /** |
1466 | | * Unsolicited broadcast Probe Response template length |
1467 | | */ |
1468 | | size_t unsol_bcast_probe_resp_tmpl_len; |
1469 | | }; |
1470 | | |
1471 | | struct mbssid_data { |
1472 | | /** |
1473 | | * mbssid_tx_iface - Transmitting interface of the MBSSID set |
1474 | | */ |
1475 | | const char *mbssid_tx_iface; |
1476 | | |
1477 | | /** |
1478 | | * mbssid_tx_iface_linkid - Link ID of the transmitting interface if |
1479 | | * it is part of an MLD. Otherwise, -1. |
1480 | | */ |
1481 | | int mbssid_tx_iface_linkid; |
1482 | | |
1483 | | /** |
1484 | | * mbssid_index - The index of this BSS in the MBSSID set |
1485 | | */ |
1486 | | unsigned int mbssid_index; |
1487 | | |
1488 | | /** |
1489 | | * mbssid_elem - Buffer containing all MBSSID elements |
1490 | | */ |
1491 | | u8 *mbssid_elem; |
1492 | | |
1493 | | /** |
1494 | | * mbssid_elem_len - Total length of all MBSSID elements |
1495 | | */ |
1496 | | size_t mbssid_elem_len; |
1497 | | |
1498 | | /** |
1499 | | * mbssid_elem_count - The number of MBSSID elements |
1500 | | */ |
1501 | | u8 mbssid_elem_count; |
1502 | | |
1503 | | /** |
1504 | | * mbssid_elem_offset - Offsets to elements in mbssid_elem. |
1505 | | * Kernel will use these offsets to generate multiple BSSID beacons. |
1506 | | */ |
1507 | | u8 **mbssid_elem_offset; |
1508 | | |
1509 | | /** |
1510 | | * ema - Enhanced MBSSID advertisements support. |
1511 | | */ |
1512 | | bool ema; |
1513 | | |
1514 | | /** |
1515 | | * rnr_elem - This buffer contains all of reduced neighbor report (RNR) |
1516 | | * elements |
1517 | | */ |
1518 | | u8 *rnr_elem; |
1519 | | |
1520 | | /** |
1521 | | * rnr_elem_len - Length of rnr_elem buffer |
1522 | | */ |
1523 | | size_t rnr_elem_len; |
1524 | | |
1525 | | /** |
1526 | | * rnr_elem_count - Number of RNR elements |
1527 | | */ |
1528 | | u8 rnr_elem_count; |
1529 | | |
1530 | | /** |
1531 | | * rnr_elem_offset - The offsets to the elements in rnr_elem. |
1532 | | * The driver will use these to include RNR elements in EMA beacons. |
1533 | | */ |
1534 | | u8 **rnr_elem_offset; |
1535 | | }; |
1536 | | |
1537 | | struct wpa_driver_ap_params { |
1538 | | /** |
1539 | | * head - Beacon head from IEEE 802.11 header to IEs before TIM IE |
1540 | | */ |
1541 | | u8 *head; |
1542 | | |
1543 | | /** |
1544 | | * head_len - Length of the head buffer in octets |
1545 | | */ |
1546 | | size_t head_len; |
1547 | | |
1548 | | /** |
1549 | | * tail - Beacon tail following TIM IE |
1550 | | */ |
1551 | | u8 *tail; |
1552 | | |
1553 | | /** |
1554 | | * tail_len - Length of the tail buffer in octets |
1555 | | */ |
1556 | | size_t tail_len; |
1557 | | |
1558 | | /** |
1559 | | * dtim_period - DTIM period |
1560 | | */ |
1561 | | int dtim_period; |
1562 | | |
1563 | | /** |
1564 | | * beacon_int - Beacon interval |
1565 | | */ |
1566 | | int beacon_int; |
1567 | | |
1568 | | /** |
1569 | | * basic_rates: -1 terminated array of basic rates in 100 kbps |
1570 | | * |
1571 | | * This parameter can be used to set a specific basic rate set for the |
1572 | | * BSS. If %NULL, default basic rate set is used. |
1573 | | */ |
1574 | | int *basic_rates; |
1575 | | |
1576 | | /** |
1577 | | * beacon_rate: Beacon frame data rate |
1578 | | * |
1579 | | * This parameter can be used to set a specific Beacon frame data rate |
1580 | | * for the BSS. The interpretation of this value depends on the |
1581 | | * rate_type (legacy: in 100 kbps units, HT: HT-MCS, VHT: VHT-MCS, |
1582 | | * HE: HE-MCS). If beacon_rate == 0 and rate_type == 0 |
1583 | | * (BEACON_RATE_LEGACY), the default Beacon frame data rate is used. |
1584 | | */ |
1585 | | unsigned int beacon_rate; |
1586 | | |
1587 | | /** |
1588 | | * beacon_rate_type: Beacon data rate type (legacy/HT/VHT/HE) |
1589 | | */ |
1590 | | enum beacon_rate_type rate_type; |
1591 | | |
1592 | | /** |
1593 | | * proberesp - Probe Response template |
1594 | | * |
1595 | | * This is used by drivers that reply to Probe Requests internally in |
1596 | | * AP mode and require the full Probe Response template. |
1597 | | */ |
1598 | | u8 *proberesp; |
1599 | | |
1600 | | /** |
1601 | | * proberesp_len - Length of the proberesp buffer in octets |
1602 | | */ |
1603 | | size_t proberesp_len; |
1604 | | |
1605 | | /** |
1606 | | * ssid - The SSID to use in Beacon/Probe Response frames |
1607 | | */ |
1608 | | const u8 *ssid; |
1609 | | |
1610 | | /** |
1611 | | * ssid_len - Length of the SSID (1..32) |
1612 | | */ |
1613 | | size_t ssid_len; |
1614 | | |
1615 | | /** |
1616 | | * hide_ssid - Whether to hide the SSID |
1617 | | */ |
1618 | | enum hide_ssid hide_ssid; |
1619 | | |
1620 | | /** |
1621 | | * pairwise_ciphers - WPA_CIPHER_* bitfield |
1622 | | */ |
1623 | | unsigned int pairwise_ciphers; |
1624 | | |
1625 | | /** |
1626 | | * group_cipher - WPA_CIPHER_* |
1627 | | */ |
1628 | | unsigned int group_cipher; |
1629 | | |
1630 | | /** |
1631 | | * key_mgmt_suites - WPA_KEY_MGMT_* bitfield |
1632 | | */ |
1633 | | unsigned int key_mgmt_suites; |
1634 | | |
1635 | | /** |
1636 | | * auth_algs - WPA_AUTH_ALG_* bitfield |
1637 | | */ |
1638 | | unsigned int auth_algs; |
1639 | | |
1640 | | /** |
1641 | | * wpa_version - WPA_PROTO_* bitfield |
1642 | | */ |
1643 | | unsigned int wpa_version; |
1644 | | |
1645 | | /** |
1646 | | * privacy - Whether privacy is used in the BSS |
1647 | | */ |
1648 | | int privacy; |
1649 | | |
1650 | | /** |
1651 | | * beacon_ies - WPS/P2P IE(s) for Beacon frames |
1652 | | * |
1653 | | * This is used to add IEs like WPS IE and P2P IE by drivers that do |
1654 | | * not use the full Beacon template. |
1655 | | */ |
1656 | | const struct wpabuf *beacon_ies; |
1657 | | |
1658 | | /** |
1659 | | * proberesp_ies - P2P/WPS IE(s) for Probe Response frames |
1660 | | * |
1661 | | * This is used to add IEs like WPS IE and P2P IE by drivers that |
1662 | | * reply to Probe Request frames internally. |
1663 | | */ |
1664 | | const struct wpabuf *proberesp_ies; |
1665 | | |
1666 | | /** |
1667 | | * assocresp_ies - WPS IE(s) for (Re)Association Response frames |
1668 | | * |
1669 | | * This is used to add IEs like WPS IE by drivers that reply to |
1670 | | * (Re)Association Request frames internally. |
1671 | | */ |
1672 | | const struct wpabuf *assocresp_ies; |
1673 | | |
1674 | | /** |
1675 | | * isolate - Whether to isolate frames between associated stations |
1676 | | * |
1677 | | * If this is non-zero, the AP is requested to disable forwarding of |
1678 | | * frames between associated stations. |
1679 | | */ |
1680 | | int isolate; |
1681 | | |
1682 | | /** |
1683 | | * cts_protect - Whether CTS protection is enabled |
1684 | | */ |
1685 | | int cts_protect; |
1686 | | |
1687 | | /** |
1688 | | * preamble - Whether short preamble is enabled |
1689 | | */ |
1690 | | int preamble; |
1691 | | |
1692 | | /** |
1693 | | * short_slot_time - Whether short slot time is enabled |
1694 | | * |
1695 | | * 0 = short slot time disable, 1 = short slot time enabled, -1 = do |
1696 | | * not set (e.g., when 802.11g mode is not in use) |
1697 | | */ |
1698 | | int short_slot_time; |
1699 | | |
1700 | | /** |
1701 | | * ht_opmode - HT operation mode or -1 if HT not in use |
1702 | | */ |
1703 | | int ht_opmode; |
1704 | | |
1705 | | /** |
1706 | | * interworking - Whether Interworking is enabled |
1707 | | */ |
1708 | | int interworking; |
1709 | | |
1710 | | /** |
1711 | | * hessid - Homogeneous ESS identifier or %NULL if not set |
1712 | | */ |
1713 | | const u8 *hessid; |
1714 | | |
1715 | | /** |
1716 | | * access_network_type - Access Network Type (0..15) |
1717 | | * |
1718 | | * This is used for filtering Probe Request frames when Interworking is |
1719 | | * enabled. |
1720 | | */ |
1721 | | u8 access_network_type; |
1722 | | |
1723 | | /** |
1724 | | * ap_max_inactivity - Timeout in seconds to detect STA's inactivity |
1725 | | * |
1726 | | * This is used by driver which advertises this capability. |
1727 | | */ |
1728 | | int ap_max_inactivity; |
1729 | | |
1730 | | /** |
1731 | | * ctwindow - Client Traffic Window (in TUs) |
1732 | | */ |
1733 | | u8 p2p_go_ctwindow; |
1734 | | |
1735 | | /** |
1736 | | * disable_dgaf - Whether group-addressed frames are disabled |
1737 | | */ |
1738 | | int disable_dgaf; |
1739 | | |
1740 | | /** |
1741 | | * freq - Channel parameters for dynamic bandwidth changes |
1742 | | */ |
1743 | | struct hostapd_freq_params *freq; |
1744 | | |
1745 | | /** |
1746 | | * reenable - Whether this is to re-enable beaconing |
1747 | | */ |
1748 | | int reenable; |
1749 | | |
1750 | | /** |
1751 | | * pbss - Whether to start a PCP (in PBSS) instead of an AP in |
1752 | | * infrastructure BSS. Valid only for DMG network. |
1753 | | */ |
1754 | | int pbss; |
1755 | | |
1756 | | /** |
1757 | | * multicast_to_unicast - Whether to use multicast_to_unicast |
1758 | | * |
1759 | | * If this is non-zero, the AP is requested to perform multicast to |
1760 | | * unicast conversion for ARP, IPv4, and IPv6 frames (possibly within |
1761 | | * 802.1Q). If enabled, such frames are to be sent to each station |
1762 | | * separately, with the DA replaced by their own MAC address rather |
1763 | | * than the group address. |
1764 | | * |
1765 | | * Note that this may break certain expectations of the receiver, such |
1766 | | * as the ability to drop unicast IP packets received within multicast |
1767 | | * L2 frames, or the ability to not send ICMP destination unreachable |
1768 | | * messages for packets received in L2 multicast (which is required, |
1769 | | * but the receiver can't tell the difference if this new option is |
1770 | | * enabled.) |
1771 | | * |
1772 | | * This also doesn't implement the 802.11 DMS (directed multicast |
1773 | | * service). |
1774 | | */ |
1775 | | int multicast_to_unicast; |
1776 | | |
1777 | | /** |
1778 | | * ftm_responder - Whether FTM responder is enabled |
1779 | | */ |
1780 | | int ftm_responder; |
1781 | | |
1782 | | /** |
1783 | | * lci - Binary data, the content of an LCI report IE with type 8 as |
1784 | | * defined in IEEE Std 802.11-2016, 9.4.2.22.10 |
1785 | | */ |
1786 | | const struct wpabuf *lci; |
1787 | | |
1788 | | /** |
1789 | | * civic - Binary data, the content of a measurement report IE with |
1790 | | * type 11 as defined in IEEE Std 802.11-2016, 9.4.2.22.13 |
1791 | | */ |
1792 | | const struct wpabuf *civic; |
1793 | | |
1794 | | /** |
1795 | | * he_spr_ctrl - Spatial Reuse control field of SPR element |
1796 | | */ |
1797 | | u8 he_spr_ctrl; |
1798 | | |
1799 | | /** |
1800 | | * he_spr_non_srg_obss_pd_max_offset - Non-SRG Maximum TX power offset |
1801 | | */ |
1802 | | u8 he_spr_non_srg_obss_pd_max_offset; |
1803 | | |
1804 | | /** |
1805 | | * he_spr_srg_obss_pd_min_offset - Minimum TX power offset |
1806 | | */ |
1807 | | u8 he_spr_srg_obss_pd_min_offset; |
1808 | | |
1809 | | /** |
1810 | | * he_spr_srg_obss_pd_max_offset - Maximum TX power offset |
1811 | | */ |
1812 | | u8 he_spr_srg_obss_pd_max_offset; |
1813 | | |
1814 | | /** |
1815 | | * he_spr_bss_color_bitmap - BSS color values used by members of the |
1816 | | * SRG. |
1817 | | */ |
1818 | | u8 he_spr_bss_color_bitmap[8]; |
1819 | | |
1820 | | /** |
1821 | | * he_spr_partial_bssid_bitmap - Partial BSSID values used by members |
1822 | | * of the SRG. |
1823 | | */ |
1824 | | u8 he_spr_partial_bssid_bitmap[8]; |
1825 | | |
1826 | | /** |
1827 | | * he_bss_color - Whether the BSS Color is disabled |
1828 | | */ |
1829 | | int he_bss_color_disabled; |
1830 | | |
1831 | | /** |
1832 | | * he_bss_color_partial - The BSS Color AID equation |
1833 | | */ |
1834 | | int he_bss_color_partial; |
1835 | | |
1836 | | /** |
1837 | | * he_bss_color - The BSS Color of the AP |
1838 | | */ |
1839 | | int he_bss_color; |
1840 | | |
1841 | | /** |
1842 | | * twt_responder - Whether Target Wait Time responder is enabled |
1843 | | */ |
1844 | | int twt_responder; |
1845 | | |
1846 | | /** |
1847 | | * sae_pwe - SAE mechanism for PWE derivation |
1848 | | * 0 = hunting-and-pecking loop only |
1849 | | * 1 = hash-to-element only |
1850 | | * 2 = both hunting-and-pecking loop and hash-to-element enabled |
1851 | | */ |
1852 | | enum sae_pwe sae_pwe; |
1853 | | |
1854 | | /** |
1855 | | * FILS Discovery frame minimum interval in TUs |
1856 | | */ |
1857 | | u32 fd_min_int; |
1858 | | |
1859 | | /** |
1860 | | * FILS Discovery frame maximum interval in TUs (0 = FD frame disabled) |
1861 | | */ |
1862 | | u32 fd_max_int; |
1863 | | |
1864 | | /** |
1865 | | * FILS Discovery frame template data |
1866 | | */ |
1867 | | u8 *fd_frame_tmpl; |
1868 | | |
1869 | | /** |
1870 | | * FILS Discovery frame template length |
1871 | | */ |
1872 | | size_t fd_frame_tmpl_len; |
1873 | | |
1874 | | /** |
1875 | | * mbssid - MBSSID element related params for Beacon frames |
1876 | | * |
1877 | | * This is used to add MBSSID element in beacon data. |
1878 | | */ |
1879 | | struct mbssid_data mbssid; |
1880 | | |
1881 | | /** |
1882 | | * punct_bitmap - Preamble puncturing bitmap |
1883 | | * Each bit corresponds to a 20 MHz subchannel, the lowest bit for the |
1884 | | * channel with the lowest frequency. A bit set to 1 indicates that the |
1885 | | * subchannel is punctured, otherwise active. |
1886 | | */ |
1887 | | u16 punct_bitmap; |
1888 | | |
1889 | | |
1890 | | /* Unsolicited broadcast Probe Response data */ |
1891 | | struct unsol_bcast_probe_resp ubpr; |
1892 | | |
1893 | | /** |
1894 | | * allowed_freqs - List of allowed 20 MHz channel center frequencies in |
1895 | | * MHz for AP operation. Drivers which support this parameter will |
1896 | | * generate a new list based on this provided list by filtering out |
1897 | | * channels that cannot be used at that time due to regulatory or other |
1898 | | * constraints. The resulting list is used as the list of all allowed |
1899 | | * channels whenever performing operations like ACS and DFS. |
1900 | | */ |
1901 | | int *allowed_freqs; |
1902 | | |
1903 | | /* |
1904 | | * mld_ap - Whether operating as an AP MLD |
1905 | | */ |
1906 | | bool mld_ap; |
1907 | | |
1908 | | /** |
1909 | | * mld_link_id - Link id for MLD BSS's |
1910 | | */ |
1911 | | u8 mld_link_id; |
1912 | | |
1913 | | /** |
1914 | | * psk - PSK passed to the driver for 4-way handshake offload |
1915 | | */ |
1916 | | u8 psk[PMK_LEN]; |
1917 | | |
1918 | | /** |
1919 | | * psk_len - PSK length in bytes (0 = not set) |
1920 | | */ |
1921 | | size_t psk_len; |
1922 | | |
1923 | | /** |
1924 | | * sae_password - SAE password for SAE offload |
1925 | | */ |
1926 | | const char *sae_password; |
1927 | | }; |
1928 | | |
1929 | | struct wpa_driver_mesh_bss_params { |
1930 | | #define WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS 0x00000001 |
1931 | | #define WPA_DRIVER_MESH_CONF_FLAG_PEER_LINK_TIMEOUT 0x00000002 |
1932 | | #define WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS 0x00000004 |
1933 | | #define WPA_DRIVER_MESH_CONF_FLAG_HT_OP_MODE 0x00000008 |
1934 | | #define WPA_DRIVER_MESH_CONF_FLAG_RSSI_THRESHOLD 0x00000010 |
1935 | | #define WPA_DRIVER_MESH_CONF_FLAG_FORWARDING 0x00000020 |
1936 | | /* |
1937 | | * TODO: Other mesh configuration parameters would go here. |
1938 | | * See NL80211_MESHCONF_* for all the mesh config parameters. |
1939 | | */ |
1940 | | unsigned int flags; |
1941 | | int auto_plinks; |
1942 | | int peer_link_timeout; |
1943 | | int max_peer_links; |
1944 | | int rssi_threshold; |
1945 | | int forwarding; |
1946 | | u16 ht_opmode; |
1947 | | }; |
1948 | | |
1949 | | struct wpa_driver_mesh_join_params { |
1950 | | const u8 *meshid; |
1951 | | int meshid_len; |
1952 | | const int *basic_rates; |
1953 | | const u8 *ies; |
1954 | | int ie_len; |
1955 | | struct hostapd_freq_params freq; |
1956 | | int beacon_int; |
1957 | | int dtim_period; |
1958 | | struct wpa_driver_mesh_bss_params conf; |
1959 | | #define WPA_DRIVER_MESH_FLAG_USER_MPM 0x00000001 |
1960 | | #define WPA_DRIVER_MESH_FLAG_DRIVER_MPM 0x00000002 |
1961 | | #define WPA_DRIVER_MESH_FLAG_SAE_AUTH 0x00000004 |
1962 | | #define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008 |
1963 | | unsigned int flags; |
1964 | | bool handle_dfs; |
1965 | | }; |
1966 | | |
1967 | | struct wpa_driver_set_key_params { |
1968 | | /** |
1969 | | * ifname - Interface name (for multi-SSID/VLAN support) */ |
1970 | | const char *ifname; |
1971 | | |
1972 | | /** |
1973 | | * alg - Encryption algorithm |
1974 | | * |
1975 | | * (%WPA_ALG_NONE, %WPA_ALG_WEP, %WPA_ALG_TKIP, %WPA_ALG_CCMP, |
1976 | | * %WPA_ALG_BIP_AES_CMAC_128, %WPA_ALG_GCMP, %WPA_ALG_GCMP_256, |
1977 | | * %WPA_ALG_CCMP_256, %WPA_ALG_BIP_GMAC_128, %WPA_ALG_BIP_GMAC_256, |
1978 | | * %WPA_ALG_BIP_CMAC_256); |
1979 | | * %WPA_ALG_NONE clears the key. */ |
1980 | | enum wpa_alg alg; |
1981 | | |
1982 | | /** |
1983 | | * addr - Address of the peer STA |
1984 | | * |
1985 | | * (BSSID of the current AP when setting pairwise key in station mode), |
1986 | | * ff:ff:ff:ff:ff:ff for broadcast keys, %NULL for default keys that |
1987 | | * are used both for broadcast and unicast; when clearing keys, %NULL |
1988 | | * is used to indicate that both the broadcast-only and default key of |
1989 | | * the specified key index is to be cleared */ |
1990 | | const u8 *addr; |
1991 | | |
1992 | | /** |
1993 | | * key_idx - Key index |
1994 | | * |
1995 | | * (0..3), usually 0 for unicast keys; 4..5 for IGTK; 6..7 for BIGTK */ |
1996 | | int key_idx; |
1997 | | |
1998 | | /** |
1999 | | * set_tx - Configure this key as the default Tx key |
2000 | | * |
2001 | | * Only used when driver does not support separate unicast/individual |
2002 | | * key */ |
2003 | | int set_tx; |
2004 | | |
2005 | | /** |
2006 | | * seq - Sequence number/packet number |
2007 | | * |
2008 | | * seq_len octets, the next packet number to be used for in replay |
2009 | | * protection; configured for Rx keys (in most cases, this is only used |
2010 | | * with broadcast keys and set to zero for unicast keys); %NULL if not |
2011 | | * set */ |
2012 | | const u8 *seq; |
2013 | | |
2014 | | /** |
2015 | | * seq_len - Length of the seq, depends on the algorithm |
2016 | | * |
2017 | | * TKIP: 6 octets, CCMP/GCMP: 6 octets, IGTK: 6 octets */ |
2018 | | size_t seq_len; |
2019 | | |
2020 | | /** |
2021 | | * key - Key buffer |
2022 | | * |
2023 | | * TKIP: 16-byte temporal key, 8-byte Tx Mic key, 8-byte Rx Mic Key */ |
2024 | | const u8 *key; |
2025 | | |
2026 | | /** |
2027 | | * key_len - Length of the key buffer in octets |
2028 | | * |
2029 | | * WEP: 5 or 13, TKIP: 32, CCMP/GCMP: 16, IGTK: 16 */ |
2030 | | size_t key_len; |
2031 | | |
2032 | | /** |
2033 | | * vlan_id - VLAN index (0..4095) for VLAN offload cases */ |
2034 | | int vlan_id; |
2035 | | |
2036 | | /** |
2037 | | * key_flag - Additional key flags |
2038 | | * |
2039 | | * %KEY_FLAG_MODIFY |
2040 | | * Set when an already installed key must be updated. |
2041 | | * So far the only use-case is changing RX/TX status for |
2042 | | * pairwise keys. Must not be set when deleting a key. |
2043 | | * %KEY_FLAG_DEFAULT |
2044 | | * Set when the key is also a default key. Must not be set when |
2045 | | * deleting a key. |
2046 | | * %KEY_FLAG_RX |
2047 | | * The key is valid for RX. Must not be set when deleting a key. |
2048 | | * %KEY_FLAG_TX |
2049 | | * The key is valid for TX. Must not be set when deleting a key. |
2050 | | * %KEY_FLAG_GROUP |
2051 | | * The key is a broadcast or group key. |
2052 | | * %KEY_FLAG_PAIRWISE |
2053 | | * The key is a pairwise key. |
2054 | | * %KEY_FLAG_PMK |
2055 | | * The key is a Pairwise Master Key (PMK). |
2056 | | * |
2057 | | * Valid and pre-defined combinations are: |
2058 | | * %KEY_FLAG_GROUP_RX_TX |
2059 | | * WEP key not to be installed as default key. |
2060 | | * %KEY_FLAG_GROUP_RX_TX_DEFAULT |
2061 | | * Default WEP or WPA-NONE key. |
2062 | | * %KEY_FLAG_GROUP_RX |
2063 | | * GTK key valid for RX only. |
2064 | | * %KEY_FLAG_GROUP_TX_DEFAULT |
2065 | | * GTK key valid for TX only, immediately taking over TX. |
2066 | | * %KEY_FLAG_PAIRWISE_RX_TX |
2067 | | * Pairwise key immediately becoming the active pairwise key. If this |
2068 | | * key was previously set as an alternative RX-only key with |
2069 | | * %KEY_FLAG_PAIRWISE_RX | %KEY_FLAG_NEXT, the alternative RX-only key |
2070 | | * is taken into use for both TX and RX without changing the RX counter |
2071 | | * values. |
2072 | | * %KEY_FLAG_PAIRWISE_RX |
2073 | | * Pairwise key not yet valid for TX. (Only usable when Extended |
2074 | | * Key ID is supported by the driver or when configuring the next TK |
2075 | | * for RX-only with %KEY_FLAG_NEXT in which case the new TK can be used |
2076 | | * as an alternative key for decrypting received frames without |
2077 | | * replacing the possibly already configured old TK.) |
2078 | | * %KEY_FLAG_PAIRWISE_RX_TX_MODIFY |
2079 | | * Enable TX for a pairwise key installed with |
2080 | | * KEY_FLAG_PAIRWISE_RX. |
2081 | | * |
2082 | | * Not a valid standalone key type but pre-defined to be combined |
2083 | | * with other key_flags: |
2084 | | * %KEY_FLAG_RX_TX |
2085 | | * RX/TX key. */ |
2086 | | enum key_flag key_flag; |
2087 | | |
2088 | | /** |
2089 | | * link_id - MLO Link ID |
2090 | | * |
2091 | | * Set to a valid Link ID (0-14) when applicable, otherwise -1. */ |
2092 | | int link_id; |
2093 | | }; |
2094 | | |
2095 | | enum wpa_driver_if_type { |
2096 | | /** |
2097 | | * WPA_IF_STATION - Station mode interface |
2098 | | */ |
2099 | | WPA_IF_STATION, |
2100 | | |
2101 | | /** |
2102 | | * WPA_IF_AP_VLAN - AP mode VLAN interface |
2103 | | * |
2104 | | * This interface shares its address and Beacon frame with the main |
2105 | | * BSS. |
2106 | | */ |
2107 | | WPA_IF_AP_VLAN, |
2108 | | |
2109 | | /** |
2110 | | * WPA_IF_AP_BSS - AP mode BSS interface |
2111 | | * |
2112 | | * This interface has its own address and Beacon frame. |
2113 | | */ |
2114 | | WPA_IF_AP_BSS, |
2115 | | |
2116 | | /** |
2117 | | * WPA_IF_P2P_GO - P2P Group Owner |
2118 | | */ |
2119 | | WPA_IF_P2P_GO, |
2120 | | |
2121 | | /** |
2122 | | * WPA_IF_P2P_CLIENT - P2P Client |
2123 | | */ |
2124 | | WPA_IF_P2P_CLIENT, |
2125 | | |
2126 | | /** |
2127 | | * WPA_IF_P2P_GROUP - P2P Group interface (will become either |
2128 | | * WPA_IF_P2P_GO or WPA_IF_P2P_CLIENT, but the role is not yet known) |
2129 | | */ |
2130 | | WPA_IF_P2P_GROUP, |
2131 | | |
2132 | | /** |
2133 | | * WPA_IF_P2P_DEVICE - P2P Device interface is used to identify the |
2134 | | * abstracted P2P Device function in the driver |
2135 | | */ |
2136 | | WPA_IF_P2P_DEVICE, |
2137 | | |
2138 | | /* |
2139 | | * WPA_IF_MESH - Mesh interface |
2140 | | */ |
2141 | | WPA_IF_MESH, |
2142 | | |
2143 | | /* |
2144 | | * WPA_IF_TDLS - TDLS offchannel interface (used for pref freq only) |
2145 | | */ |
2146 | | WPA_IF_TDLS, |
2147 | | |
2148 | | /* |
2149 | | * WPA_IF_IBSS - IBSS interface (used for pref freq only) |
2150 | | */ |
2151 | | WPA_IF_IBSS, |
2152 | | |
2153 | | /* |
2154 | | * WPA_IF_NAN - NAN Device |
2155 | | */ |
2156 | | WPA_IF_NAN, |
2157 | | |
2158 | | /* keep last */ |
2159 | | WPA_IF_MAX |
2160 | | }; |
2161 | | |
2162 | | /** |
2163 | | * struct wpa_driver_capa - Driver capability information |
2164 | | */ |
2165 | | struct wpa_driver_capa { |
2166 | | #define WPA_DRIVER_CAPA_KEY_MGMT_WPA 0x00000001 |
2167 | | #define WPA_DRIVER_CAPA_KEY_MGMT_WPA2 0x00000002 |
2168 | | #define WPA_DRIVER_CAPA_KEY_MGMT_WPA_PSK 0x00000004 |
2169 | | #define WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK 0x00000008 |
2170 | | #define WPA_DRIVER_CAPA_KEY_MGMT_WPA_NONE 0x00000010 |
2171 | | #define WPA_DRIVER_CAPA_KEY_MGMT_FT 0x00000020 |
2172 | | #define WPA_DRIVER_CAPA_KEY_MGMT_FT_PSK 0x00000040 |
2173 | | #define WPA_DRIVER_CAPA_KEY_MGMT_WAPI_PSK 0x00000080 |
2174 | | #define WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B 0x00000100 |
2175 | | #define WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B_192 0x00000200 |
2176 | | #define WPA_DRIVER_CAPA_KEY_MGMT_OWE 0x00000400 |
2177 | | #define WPA_DRIVER_CAPA_KEY_MGMT_DPP 0x00000800 |
2178 | | #define WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA256 0x00001000 |
2179 | | #define WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA384 0x00002000 |
2180 | | #define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA256 0x00004000 |
2181 | | #define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA384 0x00008000 |
2182 | | #define WPA_DRIVER_CAPA_KEY_MGMT_SAE 0x00010000 |
2183 | | #define WPA_DRIVER_CAPA_KEY_MGMT_802_1X_SHA256 0x00020000 |
2184 | | #define WPA_DRIVER_CAPA_KEY_MGMT_PSK_SHA256 0x00040000 |
2185 | | #define WPA_DRIVER_CAPA_KEY_MGMT_TPK_HANDSHAKE 0x00080000 |
2186 | | #define WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE 0x00100000 |
2187 | | #define WPA_DRIVER_CAPA_KEY_MGMT_FT_802_1X_SHA384 0x00200000 |
2188 | | #define WPA_DRIVER_CAPA_KEY_MGMT_CCKM 0x00400000 |
2189 | | #define WPA_DRIVER_CAPA_KEY_MGMT_SAE_EXT_KEY 0x01000000 |
2190 | | #define WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE_EXT_KEY 0x02000000 |
2191 | | /** Bitfield of supported key management suites */ |
2192 | | unsigned int key_mgmt; |
2193 | | unsigned int key_mgmt_iftype[WPA_IF_MAX]; |
2194 | | |
2195 | | #define WPA_DRIVER_CAPA_ENC_WEP40 0x00000001 |
2196 | | #define WPA_DRIVER_CAPA_ENC_WEP104 0x00000002 |
2197 | | #define WPA_DRIVER_CAPA_ENC_TKIP 0x00000004 |
2198 | | #define WPA_DRIVER_CAPA_ENC_CCMP 0x00000008 |
2199 | | #define WPA_DRIVER_CAPA_ENC_WEP128 0x00000010 |
2200 | | #define WPA_DRIVER_CAPA_ENC_GCMP 0x00000020 |
2201 | | #define WPA_DRIVER_CAPA_ENC_GCMP_256 0x00000040 |
2202 | | #define WPA_DRIVER_CAPA_ENC_CCMP_256 0x00000080 |
2203 | | #define WPA_DRIVER_CAPA_ENC_BIP 0x00000100 |
2204 | | #define WPA_DRIVER_CAPA_ENC_BIP_GMAC_128 0x00000200 |
2205 | | #define WPA_DRIVER_CAPA_ENC_BIP_GMAC_256 0x00000400 |
2206 | | #define WPA_DRIVER_CAPA_ENC_BIP_CMAC_256 0x00000800 |
2207 | | #define WPA_DRIVER_CAPA_ENC_GTK_NOT_USED 0x00001000 |
2208 | | /** Bitfield of supported cipher suites */ |
2209 | | unsigned int enc; |
2210 | | |
2211 | | #define WPA_DRIVER_AUTH_OPEN 0x00000001 |
2212 | | #define WPA_DRIVER_AUTH_SHARED 0x00000002 |
2213 | | #define WPA_DRIVER_AUTH_LEAP 0x00000004 |
2214 | | /** Bitfield of supported IEEE 802.11 authentication algorithms */ |
2215 | | unsigned int auth; |
2216 | | |
2217 | | /** Driver generated WPA/RSN IE */ |
2218 | | #define WPA_DRIVER_FLAGS_DRIVER_IE 0x00000001 |
2219 | | /** Driver needs static WEP key setup after association command */ |
2220 | | #define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC 0x00000002 |
2221 | | /** Driver takes care of all DFS operations */ |
2222 | | #define WPA_DRIVER_FLAGS_DFS_OFFLOAD 0x00000004 |
2223 | | /** Driver takes care of RSN 4-way handshake internally; PMK is configured with |
2224 | | * struct wpa_driver_ops::set_key using key_flag = KEY_FLAG_PMK */ |
2225 | | #define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X 0x00000008 |
2226 | | /** Driver is for a wired Ethernet interface */ |
2227 | | #define WPA_DRIVER_FLAGS_WIRED 0x00000010 |
2228 | | /** Driver provides separate commands for authentication and association (SME in |
2229 | | * wpa_supplicant). */ |
2230 | | #define WPA_DRIVER_FLAGS_SME 0x00000020 |
2231 | | /** Driver supports AP mode */ |
2232 | | #define WPA_DRIVER_FLAGS_AP 0x00000040 |
2233 | | /** Driver needs static WEP key setup after association has been completed */ |
2234 | | #define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE 0x00000080 |
2235 | | /** Driver supports dynamic HT 20/40 MHz channel changes during BSS lifetime */ |
2236 | | #define WPA_DRIVER_FLAGS_HT_2040_COEX 0x00000100 |
2237 | | /** Driver supports concurrent P2P operations */ |
2238 | | #define WPA_DRIVER_FLAGS_P2P_CONCURRENT 0x00000200 |
2239 | | /** |
2240 | | * Driver uses the initial interface as a dedicated management interface, i.e., |
2241 | | * it cannot be used for P2P group operations or non-P2P purposes. |
2242 | | */ |
2243 | | #define WPA_DRIVER_FLAGS_P2P_DEDICATED_INTERFACE 0x00000400 |
2244 | | /** This interface is P2P capable (P2P GO or P2P Client) */ |
2245 | | #define WPA_DRIVER_FLAGS_P2P_CAPABLE 0x00000800 |
2246 | | /** Driver supports station and key removal when stopping an AP */ |
2247 | | #define WPA_DRIVER_FLAGS_AP_TEARDOWN_SUPPORT 0x00001000 |
2248 | | /** |
2249 | | * Driver uses the initial interface for P2P management interface and non-P2P |
2250 | | * purposes (e.g., connect to infra AP), but this interface cannot be used for |
2251 | | * P2P group operations. |
2252 | | */ |
2253 | | #define WPA_DRIVER_FLAGS_P2P_MGMT_AND_NON_P2P 0x00002000 |
2254 | | /** |
2255 | | * Driver is known to use valid error codes, i.e., when it indicates that |
2256 | | * something (e.g., association) fails, there was indeed a failure and the |
2257 | | * operation does not end up getting completed successfully later. |
2258 | | */ |
2259 | | #define WPA_DRIVER_FLAGS_VALID_ERROR_CODES 0x00004000 |
2260 | | /** Driver supports off-channel TX */ |
2261 | | #define WPA_DRIVER_FLAGS_OFFCHANNEL_TX 0x00008000 |
2262 | | /** Driver indicates TX status events for EAPOL Data frames */ |
2263 | | #define WPA_DRIVER_FLAGS_EAPOL_TX_STATUS 0x00010000 |
2264 | | /** Driver indicates TX status events for Deauth/Disassoc frames */ |
2265 | | #define WPA_DRIVER_FLAGS_DEAUTH_TX_STATUS 0x00020000 |
2266 | | /** Driver supports roaming (BSS selection) in firmware */ |
2267 | | #define WPA_DRIVER_FLAGS_BSS_SELECTION 0x00040000 |
2268 | | /** Driver supports operating as a TDLS peer */ |
2269 | | #define WPA_DRIVER_FLAGS_TDLS_SUPPORT 0x00080000 |
2270 | | /** Driver requires external TDLS setup/teardown/discovery */ |
2271 | | #define WPA_DRIVER_FLAGS_TDLS_EXTERNAL_SETUP 0x00100000 |
2272 | | /** Driver indicates support for Probe Response offloading in AP mode */ |
2273 | | #define WPA_DRIVER_FLAGS_PROBE_RESP_OFFLOAD 0x00200000 |
2274 | | /** Driver supports U-APSD in AP mode */ |
2275 | | #define WPA_DRIVER_FLAGS_AP_UAPSD 0x00400000 |
2276 | | /** Driver supports inactivity timer in AP mode */ |
2277 | | #define WPA_DRIVER_FLAGS_INACTIVITY_TIMER 0x00800000 |
2278 | | /** Driver expects user space implementation of MLME in AP mode */ |
2279 | | #define WPA_DRIVER_FLAGS_AP_MLME 0x01000000 |
2280 | | /** Driver supports SAE with user space SME */ |
2281 | | #define WPA_DRIVER_FLAGS_SAE 0x02000000 |
2282 | | /** Driver makes use of OBSS scan mechanism in wpa_supplicant */ |
2283 | | #define WPA_DRIVER_FLAGS_OBSS_SCAN 0x04000000 |
2284 | | /** Driver supports IBSS (Ad-hoc) mode */ |
2285 | | #define WPA_DRIVER_FLAGS_IBSS 0x08000000 |
2286 | | /** Driver supports radar detection */ |
2287 | | #define WPA_DRIVER_FLAGS_RADAR 0x10000000 |
2288 | | /** Driver supports a dedicated interface for P2P Device */ |
2289 | | #define WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE 0x20000000 |
2290 | | /** Driver supports QoS Mapping */ |
2291 | | #define WPA_DRIVER_FLAGS_QOS_MAPPING 0x40000000 |
2292 | | /** Driver supports CSA in AP mode */ |
2293 | | #define WPA_DRIVER_FLAGS_AP_CSA 0x80000000 |
2294 | | /** Driver supports mesh */ |
2295 | | #define WPA_DRIVER_FLAGS_MESH 0x0000000100000000ULL |
2296 | | /** Driver support ACS offload */ |
2297 | | #define WPA_DRIVER_FLAGS_ACS_OFFLOAD 0x0000000200000000ULL |
2298 | | /** Driver supports key management offload */ |
2299 | | #define WPA_DRIVER_FLAGS_KEY_MGMT_OFFLOAD 0x0000000400000000ULL |
2300 | | /** Driver supports TDLS channel switching */ |
2301 | | #define WPA_DRIVER_FLAGS_TDLS_CHANNEL_SWITCH 0x0000000800000000ULL |
2302 | | /** Driver supports IBSS with HT datarates */ |
2303 | | #define WPA_DRIVER_FLAGS_HT_IBSS 0x0000001000000000ULL |
2304 | | /** Driver supports IBSS with VHT datarates */ |
2305 | | #define WPA_DRIVER_FLAGS_VHT_IBSS 0x0000002000000000ULL |
2306 | | /** Driver supports automatic band selection */ |
2307 | | #define WPA_DRIVER_FLAGS_SUPPORT_HW_MODE_ANY 0x0000004000000000ULL |
2308 | | /** Driver supports simultaneous off-channel operations */ |
2309 | | #define WPA_DRIVER_FLAGS_OFFCHANNEL_SIMULTANEOUS 0x0000008000000000ULL |
2310 | | /** Driver supports full AP client state */ |
2311 | | #define WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE 0x0000010000000000ULL |
2312 | | /** Driver supports P2P Listen offload */ |
2313 | | #define WPA_DRIVER_FLAGS_P2P_LISTEN_OFFLOAD 0x0000020000000000ULL |
2314 | | /** Driver supports FILS */ |
2315 | | #define WPA_DRIVER_FLAGS_SUPPORT_FILS 0x0000040000000000ULL |
2316 | | /** Driver supports Beacon frame TX rate configuration (legacy rates) */ |
2317 | | #define WPA_DRIVER_FLAGS_BEACON_RATE_LEGACY 0x0000080000000000ULL |
2318 | | /** Driver supports Beacon frame TX rate configuration (HT rates) */ |
2319 | | #define WPA_DRIVER_FLAGS_BEACON_RATE_HT 0x0000100000000000ULL |
2320 | | /** Driver supports Beacon frame TX rate configuration (VHT rates) */ |
2321 | | #define WPA_DRIVER_FLAGS_BEACON_RATE_VHT 0x0000200000000000ULL |
2322 | | /** Driver supports mgmt_tx with random TX address in non-connected state */ |
2323 | | #define WPA_DRIVER_FLAGS_MGMT_TX_RANDOM_TA 0x0000400000000000ULL |
2324 | | /** Driver supports mgmt_tx with random TX addr in connected state */ |
2325 | | #define WPA_DRIVER_FLAGS_MGMT_TX_RANDOM_TA_CONNECTED 0x0000800000000000ULL |
2326 | | /** Driver supports better BSS reporting with sched_scan in connected mode */ |
2327 | | #define WPA_DRIVER_FLAGS_SCHED_SCAN_RELATIVE_RSSI 0x0001000000000000ULL |
2328 | | /** Driver supports HE capabilities */ |
2329 | | #define WPA_DRIVER_FLAGS_HE_CAPABILITIES 0x0002000000000000ULL |
2330 | | /** Driver supports FILS shared key offload */ |
2331 | | #define WPA_DRIVER_FLAGS_FILS_SK_OFFLOAD 0x0004000000000000ULL |
2332 | | /** Driver supports all OCE STA specific mandatory features */ |
2333 | | #define WPA_DRIVER_FLAGS_OCE_STA 0x0008000000000000ULL |
2334 | | /** Driver supports all OCE AP specific mandatory features */ |
2335 | | #define WPA_DRIVER_FLAGS_OCE_AP 0x0010000000000000ULL |
2336 | | /** |
2337 | | * Driver supports all OCE STA-CFON specific mandatory features only. |
2338 | | * If a driver sets this bit but not the %WPA_DRIVER_FLAGS_OCE_AP, the |
2339 | | * userspace shall assume that this driver may not support all OCE AP |
2340 | | * functionality but can support only OCE STA-CFON functionality. |
2341 | | */ |
2342 | | #define WPA_DRIVER_FLAGS_OCE_STA_CFON 0x0020000000000000ULL |
2343 | | /** Driver supports MFP-optional in the connect command */ |
2344 | | #define WPA_DRIVER_FLAGS_MFP_OPTIONAL 0x0040000000000000ULL |
2345 | | /** Driver is a self-managed regulatory device */ |
2346 | | #define WPA_DRIVER_FLAGS_SELF_MANAGED_REGULATORY 0x0080000000000000ULL |
2347 | | /** Driver supports FTM responder functionality */ |
2348 | | #define WPA_DRIVER_FLAGS_FTM_RESPONDER 0x0100000000000000ULL |
2349 | | /** Driver support 4-way handshake offload for WPA-Personal */ |
2350 | | #define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK 0x0200000000000000ULL |
2351 | | /** Driver supports a separate control port TX for EAPOL frames */ |
2352 | | #define WPA_DRIVER_FLAGS_CONTROL_PORT 0x0400000000000000ULL |
2353 | | /** Driver supports VLAN offload */ |
2354 | | #define WPA_DRIVER_FLAGS_VLAN_OFFLOAD 0x0800000000000000ULL |
2355 | | /** Driver supports UPDATE_FT_IES command */ |
2356 | | #define WPA_DRIVER_FLAGS_UPDATE_FT_IES 0x1000000000000000ULL |
2357 | | /** Driver can correctly rekey PTKs without Extended Key ID */ |
2358 | | #define WPA_DRIVER_FLAGS_SAFE_PTK0_REKEYS 0x2000000000000000ULL |
2359 | | /** Driver supports Beacon protection */ |
2360 | | #define WPA_DRIVER_FLAGS_BEACON_PROTECTION 0x4000000000000000ULL |
2361 | | /** Driver supports Extended Key ID */ |
2362 | | #define WPA_DRIVER_FLAGS_EXTENDED_KEY_ID 0x8000000000000000ULL |
2363 | | u64 flags; |
2364 | | |
2365 | | /** Driver supports a separate control port RX for EAPOL frames */ |
2366 | | #define WPA_DRIVER_FLAGS2_CONTROL_PORT_RX 0x0000000000000001ULL |
2367 | | /** Driver supports TX status reports for EAPOL frames through control port */ |
2368 | | #define WPA_DRIVER_FLAGS2_CONTROL_PORT_TX_STATUS 0x0000000000000002ULL |
2369 | | /** Driver supports secure LTF in AP mode */ |
2370 | | #define WPA_DRIVER_FLAGS2_SEC_LTF_AP 0x0000000000000004ULL |
2371 | | /** Driver supports secure RTT measurement exchange in AP mode */ |
2372 | | #define WPA_DRIVER_FLAGS2_SEC_RTT_AP 0x0000000000000008ULL |
2373 | | /** |
2374 | | * Driver supports protection of range negotiation and measurement management |
2375 | | * frames in AP mode |
2376 | | */ |
2377 | | #define WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_AP 0x0000000000000010ULL |
2378 | | /** Driver supports Beacon frame TX rate configuration (HE rates) */ |
2379 | | #define WPA_DRIVER_FLAGS2_BEACON_RATE_HE 0x0000000000000020ULL |
2380 | | /** Driver supports Beacon protection only in client mode */ |
2381 | | #define WPA_DRIVER_FLAGS2_BEACON_PROTECTION_CLIENT 0x0000000000000040ULL |
2382 | | /** Driver supports Operating Channel Validation */ |
2383 | | #define WPA_DRIVER_FLAGS2_OCV 0x0000000000000080ULL |
2384 | | /** Driver expects user space implementation of SME in AP mode */ |
2385 | | #define WPA_DRIVER_FLAGS2_AP_SME 0x0000000000000100ULL |
2386 | | /** Driver handles SA Query procedures in AP mode */ |
2387 | | #define WPA_DRIVER_FLAGS2_SA_QUERY_OFFLOAD_AP 0x0000000000000200ULL |
2388 | | /** Driver supports background radar/CAC detection */ |
2389 | | #define WPA_DRIVER_FLAGS2_RADAR_BACKGROUND 0x0000000000000400ULL |
2390 | | /** Driver supports secure LTF in STA mode */ |
2391 | | #define WPA_DRIVER_FLAGS2_SEC_LTF_STA 0x0000000000000800ULL |
2392 | | /** Driver supports secure RTT measurement exchange in STA mode */ |
2393 | | #define WPA_DRIVER_FLAGS2_SEC_RTT_STA 0x0000000000001000ULL |
2394 | | /** |
2395 | | * Driver supports protection of range negotiation and measurement management |
2396 | | * frames in STA mode |
2397 | | */ |
2398 | | #define WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_STA 0x0000000000002000ULL |
2399 | | /** Driver supports MLO in station/AP mode */ |
2400 | | #define WPA_DRIVER_FLAGS2_MLO 0x0000000000004000ULL |
2401 | | /** Driver supports minimal scan request probe content */ |
2402 | | #define WPA_DRIVER_FLAGS2_SCAN_MIN_PREQ 0x0000000000008000ULL |
2403 | | /** Driver supports SAE authentication offload in STA mode */ |
2404 | | #define WPA_DRIVER_FLAGS2_SAE_OFFLOAD_STA 0x0000000000010000ULL |
2405 | | /** Driver support AP_PSK authentication offload */ |
2406 | | #define WPA_DRIVER_FLAGS2_4WAY_HANDSHAKE_AP_PSK 0x0000000000020000ULL |
2407 | | /** Driver supports OWE STA offload */ |
2408 | | #define WPA_DRIVER_FLAGS2_OWE_OFFLOAD_STA 0x0000000000040000ULL |
2409 | | /** Driver supports OWE AP offload */ |
2410 | | #define WPA_DRIVER_FLAGS2_OWE_OFFLOAD_AP 0x0000000000080000ULL |
2411 | | /** Driver support AP SAE authentication offload */ |
2412 | | #define WPA_DRIVER_FLAGS2_SAE_OFFLOAD_AP 0x0000000000100000ULL |
2413 | | /** Driver supports TWT responder in HT and VHT modes */ |
2414 | | #define WPA_DRIVER_FLAGS2_HT_VHT_TWT_RESPONDER 0x0000000000200000ULL |
2415 | | /** Driver supports RSN override elements */ |
2416 | | #define WPA_DRIVER_FLAGS2_RSN_OVERRIDE_STA 0x0000000000400000ULL |
2417 | | /** Driver supports NAN offload */ |
2418 | | #define WPA_DRIVER_FLAGS2_NAN_OFFLOAD 0x0000000000800000ULL |
2419 | | /** Driver/device supports SPP A-MSDUs */ |
2420 | | #define WPA_DRIVER_FLAGS2_SPP_AMSDU 0x0000000001000000ULL |
2421 | | /** Driver supports P2P V2 */ |
2422 | | #define WPA_DRIVER_FLAGS2_P2P_FEATURE_V2 0x0000000002000000ULL |
2423 | | /** Driver supports P2P PCC mode */ |
2424 | | #define WPA_DRIVER_FLAGS2_P2P_FEATURE_PCC_MODE 0x0000000004000000ULL |
2425 | | u64 flags2; |
2426 | | |
2427 | | #define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \ |
2428 | | (drv_flags & WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE) |
2429 | | |
2430 | | unsigned int wmm_ac_supported:1; |
2431 | | |
2432 | | unsigned int mac_addr_rand_scan_supported:1; |
2433 | | unsigned int mac_addr_rand_sched_scan_supported:1; |
2434 | | |
2435 | | /** Maximum number of supported active probe SSIDs */ |
2436 | | int max_scan_ssids; |
2437 | | |
2438 | | /** Maximum number of supported active probe SSIDs for sched_scan */ |
2439 | | int max_sched_scan_ssids; |
2440 | | |
2441 | | /** Maximum number of supported scan plans for scheduled scan */ |
2442 | | unsigned int max_sched_scan_plans; |
2443 | | |
2444 | | /** Maximum interval in a scan plan. In seconds */ |
2445 | | u32 max_sched_scan_plan_interval; |
2446 | | |
2447 | | /** Maximum number of iterations in a single scan plan */ |
2448 | | u32 max_sched_scan_plan_iterations; |
2449 | | |
2450 | | /** Whether sched_scan (offloaded scanning) is supported */ |
2451 | | int sched_scan_supported; |
2452 | | |
2453 | | /** Maximum number of supported match sets for sched_scan */ |
2454 | | int max_match_sets; |
2455 | | |
2456 | | /** |
2457 | | * max_remain_on_chan - Maximum remain-on-channel duration in msec |
2458 | | */ |
2459 | | unsigned int max_remain_on_chan; |
2460 | | |
2461 | | /** |
2462 | | * max_stations - Maximum number of associated stations the driver |
2463 | | * supports in AP mode |
2464 | | */ |
2465 | | unsigned int max_stations; |
2466 | | |
2467 | | /** |
2468 | | * probe_resp_offloads - Bitmap of supported protocols by the driver |
2469 | | * for Probe Response offloading. |
2470 | | */ |
2471 | | /** Driver Probe Response offloading support for WPS ver. 1 */ |
2472 | | #define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS 0x00000001 |
2473 | | /** Driver Probe Response offloading support for WPS ver. 2 */ |
2474 | | #define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS2 0x00000002 |
2475 | | /** Driver Probe Response offloading support for P2P */ |
2476 | | #define WPA_DRIVER_PROBE_RESP_OFFLOAD_P2P 0x00000004 |
2477 | | /** Driver Probe Response offloading support for IEEE 802.11u (Interworking) */ |
2478 | | #define WPA_DRIVER_PROBE_RESP_OFFLOAD_INTERWORKING 0x00000008 |
2479 | | unsigned int probe_resp_offloads; |
2480 | | |
2481 | | unsigned int max_acl_mac_addrs; |
2482 | | |
2483 | | /** |
2484 | | * Number of supported concurrent channels |
2485 | | */ |
2486 | | unsigned int num_multichan_concurrent; |
2487 | | |
2488 | | /** |
2489 | | * extended_capa - extended capabilities in driver/device |
2490 | | * |
2491 | | * Must be allocated and freed by driver and the pointers must be |
2492 | | * valid for the lifetime of the driver, i.e., freed in deinit() |
2493 | | */ |
2494 | | const u8 *extended_capa, *extended_capa_mask; |
2495 | | unsigned int extended_capa_len; |
2496 | | |
2497 | | struct wowlan_triggers wowlan_triggers; |
2498 | | |
2499 | | /** Driver adds the DS Params Set IE in Probe Request frames */ |
2500 | | #define WPA_DRIVER_FLAGS_DS_PARAM_SET_IE_IN_PROBES 0x00000001 |
2501 | | /** Driver adds the WFA TPC IE in Probe Request frames */ |
2502 | | #define WPA_DRIVER_FLAGS_WFA_TPC_IE_IN_PROBES 0x00000002 |
2503 | | /** Driver handles quiet period requests */ |
2504 | | #define WPA_DRIVER_FLAGS_QUIET 0x00000004 |
2505 | | /** |
2506 | | * Driver is capable of inserting the current TX power value into the body of |
2507 | | * transmitted frames. |
2508 | | * Background: Some Action frames include a TPC Report IE. This IE contains a |
2509 | | * TX power field, which has to be updated by lower layers. One such Action |
2510 | | * frame is Link Measurement Report (part of RRM). Another is TPC Report (part |
2511 | | * of spectrum management). Note that this insertion takes place at a fixed |
2512 | | * offset, namely the 6th byte in the Action frame body. |
2513 | | */ |
2514 | | #define WPA_DRIVER_FLAGS_TX_POWER_INSERTION 0x00000008 |
2515 | | /** |
2516 | | * Driver supports RRM. With this support, the driver will accept to use RRM in |
2517 | | * (Re)Association Request frames, without supporting quiet period. |
2518 | | */ |
2519 | | #define WPA_DRIVER_FLAGS_SUPPORT_RRM 0x00000010 |
2520 | | |
2521 | | /** Driver supports setting the scan dwell time */ |
2522 | | #define WPA_DRIVER_FLAGS_SUPPORT_SET_SCAN_DWELL 0x00000020 |
2523 | | /** Driver supports Beacon Report Measurement */ |
2524 | | #define WPA_DRIVER_FLAGS_SUPPORT_BEACON_REPORT 0x00000040 |
2525 | | |
2526 | | u32 rrm_flags; |
2527 | | |
2528 | | /* Driver concurrency capabilities */ |
2529 | | unsigned int conc_capab; |
2530 | | /* Maximum number of concurrent channels on 2.4 GHz */ |
2531 | | unsigned int max_conc_chan_2_4; |
2532 | | /* Maximum number of concurrent channels on 5 GHz */ |
2533 | | unsigned int max_conc_chan_5_0; |
2534 | | |
2535 | | /* Maximum number of supported CSA counters */ |
2536 | | u16 max_csa_counters; |
2537 | | |
2538 | | /* Maximum number of supported AKM suites in commands */ |
2539 | | unsigned int max_num_akms; |
2540 | | |
2541 | | /* Maximum number of interfaces supported for MBSSID advertisement */ |
2542 | | unsigned int mbssid_max_interfaces; |
2543 | | /* Maximum profile periodicity for enhanced MBSSID advertisement */ |
2544 | | unsigned int ema_max_periodicity; |
2545 | | |
2546 | | /* Maximum number of bytes of extra IE(s) that can be added to Probe |
2547 | | * Request frames */ |
2548 | | size_t max_probe_req_ie_len; |
2549 | | }; |
2550 | | |
2551 | | |
2552 | | struct hostapd_data; |
2553 | | |
2554 | | enum guard_interval { |
2555 | | GUARD_INTERVAL_0_4 = 1, |
2556 | | GUARD_INTERVAL_0_8 = 2, |
2557 | | GUARD_INTERVAL_1_6 = 3, |
2558 | | GUARD_INTERVAL_3_2 = 4, |
2559 | | }; |
2560 | | |
2561 | | #define STA_DRV_DATA_TX_MCS BIT(0) |
2562 | | #define STA_DRV_DATA_RX_MCS BIT(1) |
2563 | | #define STA_DRV_DATA_TX_VHT_MCS BIT(2) |
2564 | | #define STA_DRV_DATA_RX_VHT_MCS BIT(3) |
2565 | | #define STA_DRV_DATA_TX_VHT_NSS BIT(4) |
2566 | | #define STA_DRV_DATA_RX_VHT_NSS BIT(5) |
2567 | | #define STA_DRV_DATA_TX_SHORT_GI BIT(6) |
2568 | | #define STA_DRV_DATA_RX_SHORT_GI BIT(7) |
2569 | | #define STA_DRV_DATA_LAST_ACK_RSSI BIT(8) |
2570 | | #define STA_DRV_DATA_CONN_TIME BIT(9) |
2571 | | #define STA_DRV_DATA_TX_HE_MCS BIT(10) |
2572 | | #define STA_DRV_DATA_RX_HE_MCS BIT(11) |
2573 | | #define STA_DRV_DATA_TX_HE_NSS BIT(12) |
2574 | | #define STA_DRV_DATA_RX_HE_NSS BIT(13) |
2575 | | #define STA_DRV_DATA_TX_HE_DCM BIT(14) |
2576 | | #define STA_DRV_DATA_RX_HE_DCM BIT(15) |
2577 | | #define STA_DRV_DATA_TX_HE_GI BIT(16) |
2578 | | #define STA_DRV_DATA_RX_HE_GI BIT(17) |
2579 | | |
2580 | | struct hostap_sta_driver_data { |
2581 | | unsigned long rx_packets, tx_packets; |
2582 | | unsigned long long rx_bytes, tx_bytes; |
2583 | | unsigned long long rx_airtime, tx_airtime; |
2584 | | unsigned long long beacons_count; |
2585 | | int bytes_64bit; /* whether 64-bit byte counters are supported */ |
2586 | | unsigned long current_tx_rate; /* in kbps */ |
2587 | | unsigned long current_rx_rate; /* in kbps */ |
2588 | | unsigned long inactive_msec; |
2589 | | unsigned long connected_sec; |
2590 | | unsigned long flags; /* bitfield of STA_DRV_DATA_* */ |
2591 | | unsigned long num_ps_buf_frames; |
2592 | | unsigned long tx_retry_failed; |
2593 | | unsigned long tx_retry_count; |
2594 | | s8 last_ack_rssi; |
2595 | | unsigned long backlog_packets; |
2596 | | unsigned long backlog_bytes; |
2597 | | unsigned long fcs_error_count; |
2598 | | unsigned long beacon_loss_count; |
2599 | | unsigned long expected_throughput; |
2600 | | unsigned long rx_drop_misc; |
2601 | | unsigned long rx_mpdus; |
2602 | | int signal; /* dBm; or -WPA_INVALID_NOISE */ |
2603 | | u8 rx_hemcs; |
2604 | | u8 tx_hemcs; |
2605 | | u8 rx_vhtmcs; |
2606 | | u8 tx_vhtmcs; |
2607 | | u8 rx_mcs; |
2608 | | u8 tx_mcs; |
2609 | | u8 rx_he_nss; |
2610 | | u8 tx_he_nss; |
2611 | | u8 rx_vht_nss; |
2612 | | u8 tx_vht_nss; |
2613 | | s8 avg_signal; /* dBm */ |
2614 | | s8 avg_beacon_signal; /* dBm */ |
2615 | | s8 avg_ack_signal; /* dBm */ |
2616 | | enum guard_interval rx_guard_interval, tx_guard_interval; |
2617 | | u8 rx_dcm, tx_dcm; |
2618 | | }; |
2619 | | |
2620 | | struct hostapd_sta_add_params { |
2621 | | const u8 *addr; |
2622 | | u16 aid; |
2623 | | u16 capability; |
2624 | | const u8 *supp_rates; |
2625 | | size_t supp_rates_len; |
2626 | | u16 listen_interval; |
2627 | | const struct ieee80211_ht_capabilities *ht_capabilities; |
2628 | | const struct ieee80211_vht_capabilities *vht_capabilities; |
2629 | | int vht_opmode_enabled; |
2630 | | u8 vht_opmode; |
2631 | | const struct ieee80211_he_capabilities *he_capab; |
2632 | | size_t he_capab_len; |
2633 | | const struct ieee80211_he_6ghz_band_cap *he_6ghz_capab; |
2634 | | const struct ieee80211_eht_capabilities *eht_capab; |
2635 | | size_t eht_capab_len; |
2636 | | u32 flags; /* bitmask of WPA_STA_* flags */ |
2637 | | u32 flags_mask; /* unset bits in flags */ |
2638 | | #ifdef CONFIG_MESH |
2639 | | enum mesh_plink_state plink_state; |
2640 | | u16 peer_aid; |
2641 | | #endif /* CONFIG_MESH */ |
2642 | | int set; /* Set STA parameters instead of add */ |
2643 | | u8 qosinfo; |
2644 | | const u8 *ext_capab; |
2645 | | size_t ext_capab_len; |
2646 | | const u8 *supp_channels; |
2647 | | size_t supp_channels_len; |
2648 | | const u8 *supp_oper_classes; |
2649 | | size_t supp_oper_classes_len; |
2650 | | int support_p2p_ps; |
2651 | | |
2652 | | bool mld_link_sta; |
2653 | | s8 mld_link_id; |
2654 | | const u8 *mld_link_addr; |
2655 | | u16 eml_cap; |
2656 | | }; |
2657 | | |
2658 | | struct mac_address { |
2659 | | u8 addr[ETH_ALEN]; |
2660 | | }; |
2661 | | |
2662 | | struct hostapd_acl_params { |
2663 | | u8 acl_policy; |
2664 | | unsigned int num_mac_acl; |
2665 | | struct mac_address mac_acl[0]; |
2666 | | }; |
2667 | | |
2668 | | struct wpa_init_params { |
2669 | | void *global_priv; |
2670 | | const u8 *bssid; |
2671 | | const char *ifname; |
2672 | | const char *driver_params; |
2673 | | int use_pae_group_addr; |
2674 | | char **bridge; |
2675 | | size_t num_bridge; |
2676 | | |
2677 | | u8 *own_addr; /* buffer for writing own MAC address */ |
2678 | | }; |
2679 | | |
2680 | | |
2681 | | struct wpa_bss_params { |
2682 | | /** Interface name (for multi-SSID/VLAN support) */ |
2683 | | const char *ifname; |
2684 | | /** Whether IEEE 802.1X or WPA/WPA2 is enabled */ |
2685 | | int enabled; |
2686 | | |
2687 | | int wpa; |
2688 | | int ieee802_1x; |
2689 | | int wpa_group; |
2690 | | int wpa_pairwise; |
2691 | | int wpa_key_mgmt; |
2692 | | int rsn_preauth; |
2693 | | enum mfp_options ieee80211w; |
2694 | | }; |
2695 | | |
2696 | | #define WPA_STA_AUTHORIZED BIT(0) |
2697 | | #define WPA_STA_WMM BIT(1) |
2698 | | #define WPA_STA_SHORT_PREAMBLE BIT(2) |
2699 | | #define WPA_STA_MFP BIT(3) |
2700 | | #define WPA_STA_TDLS_PEER BIT(4) |
2701 | | #define WPA_STA_AUTHENTICATED BIT(5) |
2702 | | #define WPA_STA_ASSOCIATED BIT(6) |
2703 | | #define WPA_STA_SPP_AMSDU BIT(7) |
2704 | | |
2705 | | enum tdls_oper { |
2706 | | TDLS_DISCOVERY_REQ, |
2707 | | TDLS_SETUP, |
2708 | | TDLS_TEARDOWN, |
2709 | | TDLS_ENABLE_LINK, |
2710 | | TDLS_DISABLE_LINK, |
2711 | | TDLS_ENABLE, |
2712 | | TDLS_DISABLE |
2713 | | }; |
2714 | | |
2715 | | enum wnm_oper { |
2716 | | WNM_SLEEP_ENTER_CONFIRM, |
2717 | | WNM_SLEEP_ENTER_FAIL, |
2718 | | WNM_SLEEP_EXIT_CONFIRM, |
2719 | | WNM_SLEEP_EXIT_FAIL, |
2720 | | WNM_SLEEP_TFS_REQ_IE_ADD, /* STA requests driver to add TFS req IE */ |
2721 | | WNM_SLEEP_TFS_REQ_IE_NONE, /* STA requests empty TFS req IE */ |
2722 | | WNM_SLEEP_TFS_REQ_IE_SET, /* AP requests driver to set TFS req IE for |
2723 | | * a STA */ |
2724 | | WNM_SLEEP_TFS_RESP_IE_ADD, /* AP requests driver to add TFS resp IE |
2725 | | * for a STA */ |
2726 | | WNM_SLEEP_TFS_RESP_IE_NONE, /* AP requests empty TFS resp IE */ |
2727 | | WNM_SLEEP_TFS_RESP_IE_SET, /* AP requests driver to set TFS resp IE |
2728 | | * for a STA */ |
2729 | | WNM_SLEEP_TFS_IE_DEL /* AP delete the TFS IE */ |
2730 | | }; |
2731 | | |
2732 | | /* enum smps_mode - SMPS mode definitions */ |
2733 | | enum smps_mode { |
2734 | | SMPS_AUTOMATIC, |
2735 | | SMPS_OFF, |
2736 | | SMPS_DYNAMIC, |
2737 | | SMPS_STATIC, |
2738 | | |
2739 | | /* Keep last */ |
2740 | | SMPS_INVALID, |
2741 | | }; |
2742 | | |
2743 | | #define WPA_INVALID_NOISE 9999 |
2744 | | |
2745 | | /** |
2746 | | * struct wpa_signal_info - Information about channel signal quality |
2747 | | * @frequency: control frequency |
2748 | | * @above_threshold: true if the above threshold was crossed |
2749 | | * (relevant for a CQM event) |
2750 | | * @data: STA information |
2751 | | * @current_noise: %WPA_INVALID_NOISE if not supported |
2752 | | * @chanwidth: channel width |
2753 | | * @center_frq1: center frequency for the first segment |
2754 | | * @center_frq2: center frequency for the second segment (if relevant) |
2755 | | */ |
2756 | | struct wpa_signal_info { |
2757 | | u32 frequency; |
2758 | | int above_threshold; |
2759 | | struct hostap_sta_driver_data data; |
2760 | | int current_noise; |
2761 | | enum chan_width chanwidth; |
2762 | | int center_frq1; |
2763 | | int center_frq2; |
2764 | | }; |
2765 | | |
2766 | | struct wpa_mlo_signal_info { |
2767 | | u16 valid_links; |
2768 | | struct wpa_signal_info links[MAX_NUM_MLD_LINKS]; |
2769 | | }; |
2770 | | |
2771 | | /** |
2772 | | * struct wpa_mlo_reconfig_info - Information about user-requested add and/or |
2773 | | * remove setup links for the current MLO association. |
2774 | | * |
2775 | | * @add_links: Bitmask of links to be added |
2776 | | * @add_link_bssid: Array of BSSIDs for the links to be added |
2777 | | * @add_link_freq: Array of frequencies for the links to be added |
2778 | | * @delete_links: Bitmask of links to be removed |
2779 | | */ |
2780 | | struct wpa_mlo_reconfig_info { |
2781 | | u16 add_links; |
2782 | | u8 add_link_bssid[MAX_NUM_MLD_LINKS][ETH_ALEN]; |
2783 | | int add_link_freq[MAX_NUM_MLD_LINKS]; |
2784 | | u16 delete_links; |
2785 | | }; |
2786 | | |
2787 | | /** |
2788 | | * struct wpa_channel_info - Information about the current channel |
2789 | | * @frequency: Center frequency of the primary 20 MHz channel |
2790 | | * @chanwidth: Width of the current operating channel |
2791 | | * @sec_channel: Location of the secondary 20 MHz channel (either +1 or -1). |
2792 | | * This field is only filled in when using a 40 MHz channel. |
2793 | | * @center_frq1: Center frequency of frequency segment 0 |
2794 | | * @center_frq2: Center frequency of frequency segment 1 (for 80+80 channels) |
2795 | | * @seg1_idx: Frequency segment 1 index when using a 80+80 channel. This is |
2796 | | * derived from center_frq2 for convenience. |
2797 | | */ |
2798 | | struct wpa_channel_info { |
2799 | | u32 frequency; |
2800 | | enum chan_width chanwidth; |
2801 | | int sec_channel; |
2802 | | int center_frq1; |
2803 | | int center_frq2; |
2804 | | u8 seg1_idx; |
2805 | | }; |
2806 | | |
2807 | | /** |
2808 | | * struct beacon_data - Beacon data |
2809 | | * @head: Head portion of Beacon frame (before TIM IE) |
2810 | | * @tail: Tail portion of Beacon frame (after TIM IE) |
2811 | | * @beacon_ies: Extra information element(s) to add into Beacon frames or %NULL |
2812 | | * @proberesp_ies: Extra information element(s) to add into Probe Response |
2813 | | * frames or %NULL |
2814 | | * @assocresp_ies: Extra information element(s) to add into (Re)Association |
2815 | | * Response frames or %NULL |
2816 | | * @probe_resp: Probe Response frame template |
2817 | | * @head_len: Length of @head |
2818 | | * @tail_len: Length of @tail |
2819 | | * @beacon_ies_len: Length of beacon_ies in octets |
2820 | | * @proberesp_ies_len: Length of proberesp_ies in octets |
2821 | | * @proberesp_ies_len: Length of proberesp_ies in octets |
2822 | | * @probe_resp_len: Length of probe response template (@probe_resp) |
2823 | | * @mbssid: MBSSID element(s) to add into Beacon frames |
2824 | | */ |
2825 | | struct beacon_data { |
2826 | | u8 *head, *tail; |
2827 | | u8 *beacon_ies; |
2828 | | u8 *proberesp_ies; |
2829 | | u8 *assocresp_ies; |
2830 | | u8 *probe_resp; |
2831 | | |
2832 | | size_t head_len, tail_len; |
2833 | | size_t beacon_ies_len; |
2834 | | size_t proberesp_ies_len; |
2835 | | size_t assocresp_ies_len; |
2836 | | size_t probe_resp_len; |
2837 | | |
2838 | | struct mbssid_data mbssid; |
2839 | | }; |
2840 | | |
2841 | | /** |
2842 | | * struct csa_settings - Settings for channel switch command |
2843 | | * @cs_count: Count in Beacon frames (TBTT) to perform the switch |
2844 | | * @block_tx: 1 - block transmission for CSA period |
2845 | | * @freq_params: Next channel frequency parameter |
2846 | | * @beacon_csa: Beacon/probe resp/asooc resp info for CSA period |
2847 | | * @beacon_after: Next beacon/probe resp/asooc resp info |
2848 | | * @counter_offset_beacon: Offset to the count field in beacon's tail |
2849 | | * @counter_offset_presp: Offset to the count field in probe resp. |
2850 | | * @link_id: Link ID to determine the link for MLD; -1 for non-MLD |
2851 | | * @ubpr: Unsolicited broadcast Probe Response frame data |
2852 | | */ |
2853 | | struct csa_settings { |
2854 | | u8 cs_count; |
2855 | | u8 block_tx; |
2856 | | |
2857 | | struct hostapd_freq_params freq_params; |
2858 | | struct beacon_data beacon_csa; |
2859 | | struct beacon_data beacon_after; |
2860 | | |
2861 | | u16 counter_offset_beacon[2]; |
2862 | | u16 counter_offset_presp[2]; |
2863 | | |
2864 | | int link_id; |
2865 | | |
2866 | | struct unsol_bcast_probe_resp ubpr; |
2867 | | }; |
2868 | | |
2869 | | /** |
2870 | | * struct cca_settings - Settings for color switch command |
2871 | | * @cca_count: Count in Beacon frames (TBTT) to perform the switch |
2872 | | * @cca_color: The new color that we are switching to |
2873 | | * @beacon_cca: Beacon/Probe Response/(Re)Association Response frame info for |
2874 | | * color switch period |
2875 | | * @beacon_after: Next Beacon/Probe Response/(Re)Association Response frame info |
2876 | | * @counter_offset_beacon: Offset to the count field in Beacon frame tail |
2877 | | * @counter_offset_presp: Offset to the count field in Probe Response frame |
2878 | | * @ubpr: Unsolicited broadcast Probe Response frame data |
2879 | | * @link_id: If >= 0 indicates the link of the AP MLD to configure |
2880 | | */ |
2881 | | struct cca_settings { |
2882 | | u8 cca_count; |
2883 | | u8 cca_color; |
2884 | | |
2885 | | struct beacon_data beacon_cca; |
2886 | | struct beacon_data beacon_after; |
2887 | | |
2888 | | u16 counter_offset_beacon; |
2889 | | u16 counter_offset_presp; |
2890 | | |
2891 | | struct unsol_bcast_probe_resp ubpr; |
2892 | | |
2893 | | int link_id; |
2894 | | }; |
2895 | | |
2896 | | /* TDLS peer capabilities for send_tdls_mgmt() */ |
2897 | | enum tdls_peer_capability { |
2898 | | TDLS_PEER_HT = BIT(0), |
2899 | | TDLS_PEER_VHT = BIT(1), |
2900 | | TDLS_PEER_WMM = BIT(2), |
2901 | | TDLS_PEER_HE = BIT(3), |
2902 | | }; |
2903 | | |
2904 | | /* valid info in the wmm_params struct */ |
2905 | | enum wmm_params_valid_info { |
2906 | | WMM_PARAMS_UAPSD_QUEUES_INFO = BIT(0), |
2907 | | }; |
2908 | | |
2909 | | /** |
2910 | | * struct wmm_params - WMM parameterss configured for this association |
2911 | | * @info_bitmap: Bitmap of valid wmm_params info; indicates what fields |
2912 | | * of the struct contain valid information. |
2913 | | * @uapsd_queues: Bitmap of ACs configured for uapsd (valid only if |
2914 | | * %WMM_PARAMS_UAPSD_QUEUES_INFO is set) |
2915 | | */ |
2916 | | struct wmm_params { |
2917 | | u8 info_bitmap; |
2918 | | u8 uapsd_queues; |
2919 | | }; |
2920 | | |
2921 | | #ifdef CONFIG_MACSEC |
2922 | | struct macsec_init_params { |
2923 | | bool always_include_sci; |
2924 | | bool use_es; |
2925 | | bool use_scb; |
2926 | | }; |
2927 | | #endif /* CONFIG_MACSEC */ |
2928 | | |
2929 | | enum drv_br_port_attr { |
2930 | | DRV_BR_PORT_ATTR_PROXYARP, |
2931 | | DRV_BR_PORT_ATTR_HAIRPIN_MODE, |
2932 | | DRV_BR_PORT_ATTR_MCAST2UCAST, |
2933 | | }; |
2934 | | |
2935 | | enum drv_br_net_param { |
2936 | | DRV_BR_NET_PARAM_GARP_ACCEPT, |
2937 | | DRV_BR_MULTICAST_SNOOPING, |
2938 | | }; |
2939 | | |
2940 | | struct drv_acs_params { |
2941 | | /* Selected mode (HOSTAPD_MODE_*) */ |
2942 | | enum hostapd_hw_mode hw_mode; |
2943 | | |
2944 | | /* Indicates whether HT is enabled */ |
2945 | | int ht_enabled; |
2946 | | |
2947 | | /* Indicates whether HT40 is enabled */ |
2948 | | int ht40_enabled; |
2949 | | |
2950 | | /* Indicates whether VHT is enabled */ |
2951 | | int vht_enabled; |
2952 | | |
2953 | | /* Configured ACS channel width */ |
2954 | | u16 ch_width; |
2955 | | |
2956 | | /* ACS frequency list info */ |
2957 | | const int *freq_list; |
2958 | | |
2959 | | /* Indicates whether EDMG is enabled */ |
2960 | | int edmg_enabled; |
2961 | | |
2962 | | /* Indicates whether EHT is enabled */ |
2963 | | bool eht_enabled; |
2964 | | |
2965 | | /* Indicates the link if MLO case; -1 otherwise */ |
2966 | | int link_id; |
2967 | | }; |
2968 | | |
2969 | | struct wpa_bss_trans_info { |
2970 | | u8 mbo_transition_reason; |
2971 | | u8 n_candidates; |
2972 | | u8 *bssid; |
2973 | | }; |
2974 | | |
2975 | | struct wpa_bss_candidate_info { |
2976 | | u8 num; |
2977 | | struct candidate_list { |
2978 | | u8 bssid[ETH_ALEN]; |
2979 | | u8 is_accept; |
2980 | | u32 reject_reason; |
2981 | | } *candidates; |
2982 | | }; |
2983 | | |
2984 | | struct wpa_pmkid_params { |
2985 | | const u8 *bssid; |
2986 | | const u8 *ssid; |
2987 | | size_t ssid_len; |
2988 | | const u8 *fils_cache_id; |
2989 | | const u8 *pmkid; |
2990 | | const u8 *pmk; |
2991 | | size_t pmk_len; |
2992 | | u32 pmk_lifetime; |
2993 | | u8 pmk_reauth_threshold; |
2994 | | }; |
2995 | | |
2996 | | /* Mask used to specify which connection parameters have to be updated */ |
2997 | | enum wpa_drv_update_connect_params_mask { |
2998 | | WPA_DRV_UPDATE_ASSOC_IES = BIT(0), |
2999 | | WPA_DRV_UPDATE_FILS_ERP_INFO = BIT(1), |
3000 | | WPA_DRV_UPDATE_AUTH_TYPE = BIT(2), |
3001 | | }; |
3002 | | |
3003 | | /** |
3004 | | * struct external_auth - External authentication trigger parameters |
3005 | | * |
3006 | | * These are used across the external authentication request and event |
3007 | | * interfaces. |
3008 | | * @action: Action type / trigger for external authentication. Only significant |
3009 | | * for the event interface. |
3010 | | * @bssid: BSSID of the peer with which the authentication has to happen. Used |
3011 | | * by both the request and event interface. |
3012 | | * @ssid: SSID of the AP. Used by both the request and event interface. |
3013 | | * @ssid_len: SSID length in octets. |
3014 | | * @key_mgmt_suite: AKM suite of the respective authentication. Optional for |
3015 | | * the request interface. |
3016 | | * @status: Status code, %WLAN_STATUS_SUCCESS for successful authentication, |
3017 | | * use %WLAN_STATUS_UNSPECIFIED_FAILURE if wpa_supplicant cannot give |
3018 | | * the real status code for failures. Used only for the request interface |
3019 | | * from user space to the driver. |
3020 | | * @pmkid: Generated PMKID as part of external auth exchange (e.g., SAE). |
3021 | | * @mld_addr: AP's MLD address or %NULL if MLO is not used |
3022 | | */ |
3023 | | struct external_auth { |
3024 | | enum { |
3025 | | EXT_AUTH_START, |
3026 | | EXT_AUTH_ABORT, |
3027 | | } action; |
3028 | | const u8 *bssid; |
3029 | | const u8 *ssid; |
3030 | | size_t ssid_len; |
3031 | | unsigned int key_mgmt_suite; |
3032 | | u16 status; |
3033 | | const u8 *pmkid; |
3034 | | const u8 *mld_addr; |
3035 | | }; |
3036 | | |
3037 | | #define WPAS_MAX_PASN_PEERS 10 |
3038 | | |
3039 | | enum pasn_status { |
3040 | | PASN_STATUS_SUCCESS = 0, |
3041 | | PASN_STATUS_FAILURE = 1, |
3042 | | }; |
3043 | | |
3044 | | /** |
3045 | | * struct pasn_peer - PASN peer parameters |
3046 | | * |
3047 | | * Used to process the PASN authentication event from the driver to |
3048 | | * userspace and to send a response back. |
3049 | | * @own_addr: Own MAC address specified by the driver to use for PASN |
3050 | | * handshake. |
3051 | | * @peer_addr: MAC address of the peer with which PASN authentication is to be |
3052 | | * performed. |
3053 | | * @network_id: Unique id for the network. |
3054 | | * This identifier is used as a unique identifier for each network |
3055 | | * block when using the control interface. Each network is allocated an |
3056 | | * id when it is being created, either when reading the configuration |
3057 | | * file or when a new network is added through the control interface. |
3058 | | * @akmp: Authentication key management protocol type supported. |
3059 | | * @cipher: Cipher suite. |
3060 | | * @group: Finite cyclic group. Default group used is 19 (ECC). |
3061 | | * @temporary_network: Indicates if a temporary network was created to perform |
3062 | | * PASN authentication. |
3063 | | * @password: Password of user requested network. |
3064 | | * @comeback_len: Length of the comeback cookie data. |
3065 | | * @comeback: Comeback cookie data that may be present in case a temporary |
3066 | | * rejection is received from the AP. |
3067 | | * @comeback_after: The time after which the STA can try for PASN handshake in |
3068 | | * case of temporary rejection. |
3069 | | * @ltf_keyseed_required: Indicates whether LTF keyseed generation is required |
3070 | | * @status: PASN response status, %PASN_STATUS_SUCCESS for successful |
3071 | | * authentication, use %PASN_STATUS_FAILURE if PASN authentication |
3072 | | * fails or if wpa_supplicant fails to set the security ranging context to |
3073 | | * the driver |
3074 | | */ |
3075 | | struct pasn_peer { |
3076 | | u8 own_addr[ETH_ALEN]; |
3077 | | u8 peer_addr[ETH_ALEN]; |
3078 | | int network_id; |
3079 | | int akmp; |
3080 | | int cipher; |
3081 | | int group; |
3082 | | bool temporary_network; |
3083 | | char *password; |
3084 | | size_t comeback_len; |
3085 | | u8 *comeback; |
3086 | | u16 comeback_after; |
3087 | | bool ltf_keyseed_required; |
3088 | | enum pasn_status status; |
3089 | | }; |
3090 | | |
3091 | | /** |
3092 | | * struct pasn_auth - PASN authentication trigger parameters |
3093 | | * |
3094 | | * These are used across the PASN authentication event from the driver to |
3095 | | * userspace and to send a response to it. |
3096 | | * @action: Action type. Only significant for the event interface. |
3097 | | * @num_peers: The number of peers for which the PASN handshake is requested |
3098 | | * for. |
3099 | | * @peer: Holds the peer details. |
3100 | | */ |
3101 | | struct pasn_auth { |
3102 | | enum { |
3103 | | PASN_ACTION_AUTH, |
3104 | | PASN_ACTION_DELETE_SECURE_RANGING_CONTEXT, |
3105 | | } action; |
3106 | | unsigned int num_peers; |
3107 | | struct pasn_peer peer[WPAS_MAX_PASN_PEERS]; |
3108 | | }; |
3109 | | |
3110 | | /** |
3111 | | * struct secure_ranging_params - Parameters required to set secure ranging |
3112 | | * context for a peer. |
3113 | | * |
3114 | | * @action: Add or delete a security context to the driver. |
3115 | | * @own_addr: Own MAC address used during key derivation. |
3116 | | * @peer_addr: Address of the peer device. |
3117 | | * @cipher: Cipher suite. |
3118 | | * @tk_len: Length of temporal key. |
3119 | | * @tk: Temporal key buffer. |
3120 | | * @ltf_keyseed_len: Length of LTF keyseed. |
3121 | | * @ltf_keyeed: LTF keyseed buffer. |
3122 | | */ |
3123 | | struct secure_ranging_params { |
3124 | | u32 action; |
3125 | | const u8 *own_addr; |
3126 | | const u8 *peer_addr; |
3127 | | u32 cipher; |
3128 | | u8 tk_len; |
3129 | | const u8 *tk; |
3130 | | u8 ltf_keyseed_len; |
3131 | | const u8 *ltf_keyseed; |
3132 | | }; |
3133 | | |
3134 | | /* enum nested_attr - Used to specify if subcommand uses nested attributes */ |
3135 | | enum nested_attr { |
3136 | | NESTED_ATTR_NOT_USED = 0, |
3137 | | NESTED_ATTR_USED = 1, |
3138 | | NESTED_ATTR_UNSPECIFIED = 2, |
3139 | | }; |
3140 | | |
3141 | | /* Preferred channel list information */ |
3142 | | |
3143 | | /* GO role */ |
3144 | | #define WEIGHTED_PCL_GO BIT(0) |
3145 | | /* P2P Client role */ |
3146 | | #define WEIGHTED_PCL_CLI BIT(1) |
3147 | | /* Must be considered for operating channel */ |
3148 | | #define WEIGHTED_PCL_MUST_CONSIDER BIT(2) |
3149 | | /* Should be excluded in GO negotiation */ |
3150 | | #define WEIGHTED_PCL_EXCLUDE BIT(3) |
3151 | | |
3152 | | /* Preferred channel list with weight */ |
3153 | | struct weighted_pcl { |
3154 | | u32 freq; /* MHz */ |
3155 | | u8 weight; |
3156 | | u32 flag; /* bitmap for WEIGHTED_PCL_* */ |
3157 | | }; |
3158 | | |
3159 | | struct driver_sta_mlo_info { |
3160 | | bool default_map; |
3161 | | u16 req_links; /* bitmap of requested link IDs */ |
3162 | | u16 valid_links; /* bitmap of accepted link IDs */ |
3163 | | u8 assoc_link_id; |
3164 | | u8 ap_mld_addr[ETH_ALEN]; |
3165 | | struct { |
3166 | | u8 addr[ETH_ALEN]; |
3167 | | u8 bssid[ETH_ALEN]; |
3168 | | unsigned int freq; |
3169 | | struct t2lm_mapping t2lmap; |
3170 | | } links[MAX_NUM_MLD_LINKS]; |
3171 | | }; |
3172 | | |
3173 | | /** |
3174 | | * struct wpa_driver_ops - Driver interface API definition |
3175 | | * |
3176 | | * This structure defines the API that each driver interface needs to implement |
3177 | | * for core wpa_supplicant code. All driver specific functionality is captured |
3178 | | * in this wrapper. |
3179 | | */ |
3180 | | struct wpa_driver_ops { |
3181 | | /** Name of the driver interface */ |
3182 | | const char *name; |
3183 | | /** One line description of the driver interface */ |
3184 | | const char *desc; |
3185 | | |
3186 | | /** |
3187 | | * get_bssid - Get the current BSSID |
3188 | | * @priv: private driver interface data |
3189 | | * @bssid: buffer for BSSID (ETH_ALEN = 6 bytes) |
3190 | | * |
3191 | | * Returns: 0 on success, -1 on failure |
3192 | | * |
3193 | | * Query kernel driver for the current BSSID and copy it to bssid. |
3194 | | * Setting bssid to 00:00:00:00:00:00 is recommended if the STA is not |
3195 | | * associated. |
3196 | | */ |
3197 | | int (*get_bssid)(void *priv, u8 *bssid); |
3198 | | |
3199 | | /** |
3200 | | * get_ssid - Get the current SSID |
3201 | | * @priv: private driver interface data |
3202 | | * @ssid: buffer for SSID (at least 32 bytes) |
3203 | | * |
3204 | | * Returns: Length of the SSID on success, -1 on failure |
3205 | | * |
3206 | | * Query kernel driver for the current SSID and copy it to ssid. |
3207 | | * Returning zero is recommended if the STA is not associated. |
3208 | | * |
3209 | | * Note: SSID is an array of octets, i.e., it is not nul terminated and |
3210 | | * can, at least in theory, contain control characters (including nul) |
3211 | | * and as such, should be processed as binary data, not a printable |
3212 | | * string. |
3213 | | */ |
3214 | | int (*get_ssid)(void *priv, u8 *ssid); |
3215 | | |
3216 | | /** |
3217 | | * set_key - Configure encryption key |
3218 | | * @priv: private driver interface data |
3219 | | * @params: Key parameters |
3220 | | * Returns: 0 on success, -1 on failure |
3221 | | * |
3222 | | * Configure the given key for the kernel driver. If the driver |
3223 | | * supports separate individual keys (4 default keys + 1 individual), |
3224 | | * addr can be used to determine whether the key is default or |
3225 | | * individual. If only 4 keys are supported, the default key with key |
3226 | | * index 0 is used as the individual key. STA must be configured to use |
3227 | | * it as the default Tx key (set_tx is set) and accept Rx for all the |
3228 | | * key indexes. In most cases, WPA uses only key indexes 1 and 2 for |
3229 | | * broadcast keys, so key index 0 is available for this kind of |
3230 | | * configuration. |
3231 | | * |
3232 | | * For pairwise keys, there are potential race conditions between |
3233 | | * enabling a new TK on each end of the connection and sending the first |
3234 | | * protected frame. Drivers have multiple options on which style of key |
3235 | | * configuration to support with the simplest option not providing any |
3236 | | * protection for the race condition while the more complex options do |
3237 | | * provide partial or full protection. |
3238 | | * |
3239 | | * Option 1: Do not support extended key IDs (i.e., use only Key ID 0 |
3240 | | * for pairwise keys) and do not support configuration of the next TK |
3241 | | * as an alternative RX key. This provides no protection, but is simple |
3242 | | * to support. The driver needs to ignore set_key() calls with |
3243 | | * KEY_FLAG_NEXT. |
3244 | | * |
3245 | | * Option 2: Do not support extended key IDs (i.e., use only Key ID 0 |
3246 | | * for pairwise keys), but support configuration of the next TK as an |
3247 | | * alternative RX key for the initial 4-way handshake. This provides |
3248 | | * protection for the initial key setup at the beginning of an |
3249 | | * association. The driver needs to configure the initial TK for RX-only |
3250 | | * when receiving a set_key() call with KEY_FLAG_NEXT. This RX-only key |
3251 | | * is ready for receiving protected Data frames from the peer before the |
3252 | | * local device has enabled the key for TX. Unprotected EAPOL frames |
3253 | | * need to be allowed even when this next TK is configured as RX-only |
3254 | | * key. The same key is then set with KEY_FLAG_PAIRWISE_RX_TX to enable |
3255 | | * its use for both TX and RX. The driver ignores set_key() calls with |
3256 | | * KEY_FLAG_NEXT when a TK has been configured. When fully enabling the |
3257 | | * TK for TX and RX, the RX counters associated with the TK must not be |
3258 | | * cleared. |
3259 | | * |
3260 | | * Option 3: Same as option 2, but the driver supports multiple RX keys |
3261 | | * in parallel during PTK rekeying. The driver processed set_key() calls |
3262 | | * with KEY_FLAG_NEXT also when a TK has been configured. At that point |
3263 | | * in the rekeying sequence the driver uses the previously configured TK |
3264 | | * for TX and decrypts received frames with either the previously |
3265 | | * configured TK or the next TK (RX-only). |
3266 | | * |
3267 | | * Option 4: The driver supports extended Key IDs and they are used for |
3268 | | * an association but does not support KEY_FLAG_NEXT (options 2 and 3). |
3269 | | * The next TK is configured as RX-only with KEY_FLAG_PAIRWISE_RX and |
3270 | | * it is enabled for TX and RX with KEY_FLAG_PAIRWISE_RX_TX_MODIFY. When |
3271 | | * extended key ID is not used for an association, the driver behaves |
3272 | | * like in option 1. |
3273 | | * |
3274 | | * Option 5 and 6: Like option 4 but with support for KEY_FLAG_NEXT as |
3275 | | * described above for options 2 and 3, respectively. Option 4 is used |
3276 | | * for cases where extended key IDs are used for an association. Option |
3277 | | * 2 or 3 is used for cases where extended key IDs are not used. |
3278 | | * |
3279 | | * Please note that TKIP keys include separate TX and RX MIC keys and |
3280 | | * some drivers may expect them in different order than wpa_supplicant |
3281 | | * is using. If the TX/RX keys are swapped, all TKIP encrypted packets |
3282 | | * will trigger Michael MIC errors. This can be fixed by changing the |
3283 | | * order of MIC keys by swapping the bytes 16..23 and 24..31 of the key |
3284 | | * in driver_*.c set_key() implementation, see driver_ndis.c for an |
3285 | | * example on how this can be done. |
3286 | | */ |
3287 | | int (*set_key)(void *priv, struct wpa_driver_set_key_params *params); |
3288 | | |
3289 | | /** |
3290 | | * init - Initialize driver interface |
3291 | | * @ctx: context to be used when calling wpa_supplicant functions, |
3292 | | * e.g., wpa_supplicant_event() |
3293 | | * @ifname: interface name, e.g., wlan0 |
3294 | | * |
3295 | | * Returns: Pointer to private data, %NULL on failure |
3296 | | * |
3297 | | * Initialize driver interface, including event processing for kernel |
3298 | | * driver events (e.g., associated, scan results, Michael MIC failure). |
3299 | | * This function can allocate a private configuration data area for |
3300 | | * @ctx, file descriptor, interface name, etc. information that may be |
3301 | | * needed in future driver operations. If this is not used, non-NULL |
3302 | | * value will need to be returned because %NULL is used to indicate |
3303 | | * failure. The returned value will be used as 'void *priv' data for |
3304 | | * all other driver_ops functions. |
3305 | | * |
3306 | | * The main event loop (eloop.c) of wpa_supplicant can be used to |
3307 | | * register callback for read sockets (eloop_register_read_sock()). |
3308 | | * |
3309 | | * See below for more information about events and |
3310 | | * wpa_supplicant_event() function. |
3311 | | */ |
3312 | | void * (*init)(void *ctx, const char *ifname); |
3313 | | |
3314 | | /** |
3315 | | * deinit - Deinitialize driver interface |
3316 | | * @priv: private driver interface data from init() |
3317 | | * |
3318 | | * Shut down driver interface and processing of driver events. Free |
3319 | | * private data buffer if one was allocated in init() handler. |
3320 | | */ |
3321 | | void (*deinit)(void *priv); |
3322 | | |
3323 | | /** |
3324 | | * set_param - Set driver configuration parameters |
3325 | | * @priv: private driver interface data from init() |
3326 | | * @param: driver specific configuration parameters |
3327 | | * |
3328 | | * Returns: 0 on success, -1 on failure |
3329 | | * |
3330 | | * Optional handler for notifying driver interface about configuration |
3331 | | * parameters (driver_param). |
3332 | | */ |
3333 | | int (*set_param)(void *priv, const char *param); |
3334 | | |
3335 | | /** |
3336 | | * set_countermeasures - Enable/disable TKIP countermeasures |
3337 | | * @priv: private driver interface data |
3338 | | * @enabled: 1 = countermeasures enabled, 0 = disabled |
3339 | | * |
3340 | | * Returns: 0 on success, -1 on failure |
3341 | | * |
3342 | | * Configure TKIP countermeasures. When these are enabled, the driver |
3343 | | * should drop all received and queued frames that are using TKIP. |
3344 | | */ |
3345 | | int (*set_countermeasures)(void *priv, int enabled); |
3346 | | |
3347 | | /** |
3348 | | * deauthenticate - Request driver to deauthenticate |
3349 | | * @priv: private driver interface data |
3350 | | * @addr: peer address (BSSID of the AP) |
3351 | | * @reason_code: 16-bit reason code to be sent in the deauthentication |
3352 | | * frame |
3353 | | * |
3354 | | * Returns: 0 on success, -1 on failure |
3355 | | */ |
3356 | | int (*deauthenticate)(void *priv, const u8 *addr, u16 reason_code); |
3357 | | |
3358 | | /** |
3359 | | * associate - Request driver to associate |
3360 | | * @priv: private driver interface data |
3361 | | * @params: association parameters |
3362 | | * |
3363 | | * Returns: 0 on success, -1 on failure |
3364 | | */ |
3365 | | int (*associate)(void *priv, |
3366 | | struct wpa_driver_associate_params *params); |
3367 | | |
3368 | | /** |
3369 | | * add_pmkid - Add PMKSA cache entry to the driver |
3370 | | * @priv: private driver interface data |
3371 | | * @params: PMKSA parameters |
3372 | | * |
3373 | | * Returns: 0 on success, -1 on failure |
3374 | | * |
3375 | | * This function is called when a new PMK is received, as a result of |
3376 | | * either normal authentication or RSN pre-authentication. The PMKSA |
3377 | | * parameters are either a set of bssid, pmkid, and pmk; or a set of |
3378 | | * ssid, fils_cache_id, pmkid, and pmk. |
3379 | | * |
3380 | | * If the driver generates RSN IE, i.e., it does not use wpa_ie in |
3381 | | * associate(), add_pmkid() can be used to add new PMKSA cache entries |
3382 | | * in the driver. If the driver uses wpa_ie from wpa_supplicant, this |
3383 | | * driver_ops function does not need to be implemented. Likewise, if |
3384 | | * the driver does not support WPA, this function is not needed. |
3385 | | */ |
3386 | | int (*add_pmkid)(void *priv, struct wpa_pmkid_params *params); |
3387 | | |
3388 | | /** |
3389 | | * remove_pmkid - Remove PMKSA cache entry to the driver |
3390 | | * @priv: private driver interface data |
3391 | | * @params: PMKSA parameters |
3392 | | * |
3393 | | * Returns: 0 on success, -1 on failure |
3394 | | * |
3395 | | * This function is called when the supplicant drops a PMKSA cache |
3396 | | * entry for any reason. The PMKSA parameters are either a set of |
3397 | | * bssid and pmkid; or a set of ssid, fils_cache_id, and pmkid. |
3398 | | * |
3399 | | * If the driver generates RSN IE, i.e., it does not use wpa_ie in |
3400 | | * associate(), remove_pmkid() can be used to synchronize PMKSA caches |
3401 | | * between the driver and wpa_supplicant. If the driver uses wpa_ie |
3402 | | * from wpa_supplicant, this driver_ops function does not need to be |
3403 | | * implemented. Likewise, if the driver does not support WPA, this |
3404 | | * function is not needed. |
3405 | | */ |
3406 | | int (*remove_pmkid)(void *priv, struct wpa_pmkid_params *params); |
3407 | | |
3408 | | /** |
3409 | | * flush_pmkid - Flush PMKSA cache |
3410 | | * @priv: private driver interface data |
3411 | | * |
3412 | | * Returns: 0 on success, -1 on failure |
3413 | | * |
3414 | | * This function is called when the supplicant drops all PMKSA cache |
3415 | | * entries for any reason. |
3416 | | * |
3417 | | * If the driver generates RSN IE, i.e., it does not use wpa_ie in |
3418 | | * associate(), remove_pmkid() can be used to synchronize PMKSA caches |
3419 | | * between the driver and wpa_supplicant. If the driver uses wpa_ie |
3420 | | * from wpa_supplicant, this driver_ops function does not need to be |
3421 | | * implemented. Likewise, if the driver does not support WPA, this |
3422 | | * function is not needed. |
3423 | | */ |
3424 | | int (*flush_pmkid)(void *priv); |
3425 | | |
3426 | | /** |
3427 | | * get_capa - Get driver capabilities |
3428 | | * @priv: private driver interface data |
3429 | | * |
3430 | | * Returns: 0 on success, -1 on failure |
3431 | | * |
3432 | | * Get driver/firmware/hardware capabilities. |
3433 | | */ |
3434 | | int (*get_capa)(void *priv, struct wpa_driver_capa *capa); |
3435 | | |
3436 | | /** |
3437 | | * poll - Poll driver for association information |
3438 | | * @priv: private driver interface data |
3439 | | * |
3440 | | * This is an optional callback that can be used when the driver does |
3441 | | * not provide event mechanism for association events. This is called |
3442 | | * when receiving WPA/RSN EAPOL-Key messages that require association |
3443 | | * information. The driver interface is supposed to generate associnfo |
3444 | | * event before returning from this callback function. In addition, the |
3445 | | * driver interface should generate an association event after having |
3446 | | * sent out associnfo. |
3447 | | */ |
3448 | | void (*poll)(void *priv); |
3449 | | |
3450 | | /** |
3451 | | * get_ifindex - Get interface index |
3452 | | * @priv: private driver interface data |
3453 | | * |
3454 | | * Returns: Interface index |
3455 | | */ |
3456 | | unsigned int (*get_ifindex)(void *priv); |
3457 | | |
3458 | | /** |
3459 | | * get_ifname - Get interface name |
3460 | | * @priv: private driver interface data |
3461 | | * |
3462 | | * Returns: Pointer to the interface name. This can differ from the |
3463 | | * interface name used in init() call. Init() is called first. |
3464 | | * |
3465 | | * This optional function can be used to allow the driver interface to |
3466 | | * replace the interface name with something else, e.g., based on an |
3467 | | * interface mapping from a more descriptive name. |
3468 | | */ |
3469 | | const char * (*get_ifname)(void *priv); |
3470 | | |
3471 | | /** |
3472 | | * get_mac_addr - Get own MAC address |
3473 | | * @priv: private driver interface data |
3474 | | * |
3475 | | * Returns: Pointer to own MAC address or %NULL on failure |
3476 | | * |
3477 | | * This optional function can be used to get the own MAC address of the |
3478 | | * device from the driver interface code. This is only needed if the |
3479 | | * l2_packet implementation for the OS does not provide easy access to |
3480 | | * a MAC address. */ |
3481 | | const u8 * (*get_mac_addr)(void *priv); |
3482 | | |
3483 | | /** |
3484 | | * set_operstate - Sets device operating state to DORMANT or UP |
3485 | | * @priv: private driver interface data |
3486 | | * @state: 0 = dormant, 1 = up |
3487 | | * Returns: 0 on success, -1 on failure |
3488 | | * |
3489 | | * This is an optional function that can be used on operating systems |
3490 | | * that support a concept of controlling network device state from user |
3491 | | * space applications. This function, if set, gets called with |
3492 | | * state = 1 when authentication has been completed and with state = 0 |
3493 | | * when connection is lost. |
3494 | | */ |
3495 | | int (*set_operstate)(void *priv, int state); |
3496 | | |
3497 | | /** |
3498 | | * mlme_setprotection - MLME-SETPROTECTION.request primitive |
3499 | | * @priv: Private driver interface data |
3500 | | * @addr: Address of the station for which to set protection (may be |
3501 | | * %NULL for group keys) |
3502 | | * @protect_type: MLME_SETPROTECTION_PROTECT_TYPE_* |
3503 | | * @key_type: MLME_SETPROTECTION_KEY_TYPE_* |
3504 | | * Returns: 0 on success, -1 on failure |
3505 | | * |
3506 | | * This is an optional function that can be used to set the driver to |
3507 | | * require protection for Tx and/or Rx frames. This uses the layer |
3508 | | * interface defined in IEEE 802.11i-2004 clause 10.3.22.1 |
3509 | | * (MLME-SETPROTECTION.request). Many drivers do not use explicit |
3510 | | * set protection operation; instead, they set protection implicitly |
3511 | | * based on configured keys. |
3512 | | */ |
3513 | | int (*mlme_setprotection)(void *priv, const u8 *addr, int protect_type, |
3514 | | int key_type); |
3515 | | |
3516 | | /** |
3517 | | * get_hw_feature_data - Get hardware support data (channels and rates) |
3518 | | * @priv: Private driver interface data |
3519 | | * @num_modes: Variable for returning the number of returned modes |
3520 | | * flags: Variable for returning hardware feature flags |
3521 | | * @dfs: Variable for returning DFS region (HOSTAPD_DFS_REGION_*) |
3522 | | * Returns: Pointer to allocated hardware data on success or %NULL on |
3523 | | * failure. Caller is responsible for freeing this. |
3524 | | */ |
3525 | | struct hostapd_hw_modes * (*get_hw_feature_data)(void *priv, |
3526 | | u16 *num_modes, |
3527 | | u16 *flags, u8 *dfs); |
3528 | | |
3529 | | /** |
3530 | | * send_mlme - Send management frame from MLME |
3531 | | * @priv: Private driver interface data |
3532 | | * @data: IEEE 802.11 management frame with IEEE 802.11 header |
3533 | | * @data_len: Size of the management frame |
3534 | | * @noack: Do not wait for this frame to be acked (disable retries) |
3535 | | * @freq: Frequency (in MHz) to send the frame on, or 0 to let the |
3536 | | * driver decide |
3537 | | * @csa_offs: Array of CSA offsets or %NULL |
3538 | | * @csa_offs_len: Number of elements in csa_offs |
3539 | | * @no_encrypt: Do not encrypt frame even if appropriate key exists |
3540 | | * (used only for testing purposes) |
3541 | | * @wait: Time to wait off-channel for a response (in ms), or zero |
3542 | | * @link_id: Link ID to use for TX, or -1 if not set |
3543 | | * Returns: 0 on success, -1 on failure |
3544 | | */ |
3545 | | int (*send_mlme)(void *priv, const u8 *data, size_t data_len, |
3546 | | int noack, unsigned int freq, const u16 *csa_offs, |
3547 | | size_t csa_offs_len, int no_encrypt, |
3548 | | unsigned int wait, int link_id); |
3549 | | |
3550 | | /** |
3551 | | * update_ft_ies - Update FT (IEEE 802.11r) IEs |
3552 | | * @priv: Private driver interface data |
3553 | | * @md: Mobility domain (2 octets) (also included inside ies) |
3554 | | * @ies: FT IEs (MDIE, FTIE, ...) or %NULL to remove IEs |
3555 | | * @ies_len: Length of FT IEs in bytes |
3556 | | * Returns: 0 on success, -1 on failure |
3557 | | * |
3558 | | * The supplicant uses this callback to let the driver know that keying |
3559 | | * material for FT is available and that the driver can use the |
3560 | | * provided IEs in the next message in FT authentication sequence. |
3561 | | * |
3562 | | * This function is only needed for driver that support IEEE 802.11r |
3563 | | * (Fast BSS Transition). |
3564 | | */ |
3565 | | int (*update_ft_ies)(void *priv, const u8 *md, const u8 *ies, |
3566 | | size_t ies_len); |
3567 | | |
3568 | | /** |
3569 | | * get_scan_results - Fetch the latest scan results |
3570 | | * @priv: Private driver interface data |
3571 | | * @bssid: Return results only for the specified BSSID, %NULL for all |
3572 | | * |
3573 | | * Returns: Allocated buffer of scan results (caller is responsible for |
3574 | | * freeing the data structure) on success, NULL on failure |
3575 | | */ |
3576 | | struct wpa_scan_results * (*get_scan_results)(void *priv, |
3577 | | const u8 *bssid); |
3578 | | |
3579 | | /** |
3580 | | * get_scan_results2 - Fetch the latest scan results |
3581 | | * @priv: private driver interface data |
3582 | | * |
3583 | | * Returns: Allocated buffer of scan results (caller is responsible for |
3584 | | * freeing the data structure) on success, NULL on failure |
3585 | | */ |
3586 | | struct wpa_scan_results * (*get_scan_results2)(void *priv); |
3587 | | |
3588 | | /** |
3589 | | * set_country - Set country |
3590 | | * @priv: Private driver interface data |
3591 | | * @alpha2: country to which to switch to |
3592 | | * Returns: 0 on success, -1 on failure |
3593 | | * |
3594 | | * This function is for drivers which support some form |
3595 | | * of setting a regulatory domain. |
3596 | | */ |
3597 | | int (*set_country)(void *priv, const char *alpha2); |
3598 | | |
3599 | | /** |
3600 | | * get_country - Get country |
3601 | | * @priv: Private driver interface data |
3602 | | * @alpha2: Buffer for returning country code (at least 3 octets) |
3603 | | * Returns: 0 on success, -1 on failure |
3604 | | */ |
3605 | | int (*get_country)(void *priv, char *alpha2); |
3606 | | |
3607 | | /** |
3608 | | * global_init - Global driver initialization |
3609 | | * @ctx: wpa_global pointer |
3610 | | * Returns: Pointer to private data (global), %NULL on failure |
3611 | | * |
3612 | | * This optional function is called to initialize the driver wrapper |
3613 | | * for global data, i.e., data that applies to all interfaces. If this |
3614 | | * function is implemented, global_deinit() will also need to be |
3615 | | * implemented to free the private data. The driver will also likely |
3616 | | * use init2() function instead of init() to get the pointer to global |
3617 | | * data available to per-interface initializer. |
3618 | | */ |
3619 | | void * (*global_init)(void *ctx); |
3620 | | |
3621 | | /** |
3622 | | * global_deinit - Global driver deinitialization |
3623 | | * @priv: private driver global data from global_init() |
3624 | | * |
3625 | | * Terminate any global driver related functionality and free the |
3626 | | * global data structure. |
3627 | | */ |
3628 | | void (*global_deinit)(void *priv); |
3629 | | |
3630 | | /** |
3631 | | * init2 - Initialize driver interface (with global data) |
3632 | | * @ctx: context to be used when calling wpa_supplicant functions, |
3633 | | * e.g., wpa_supplicant_event() |
3634 | | * @ifname: interface name, e.g., wlan0 |
3635 | | * @global_priv: private driver global data from global_init() |
3636 | | * @p2p_mode: P2P mode for a GO (not applicable for other interface |
3637 | | * types) |
3638 | | * Returns: Pointer to private data, %NULL on failure |
3639 | | * |
3640 | | * This function can be used instead of init() if the driver wrapper |
3641 | | * uses global data. |
3642 | | */ |
3643 | | void * (*init2)(void *ctx, const char *ifname, void *global_priv, |
3644 | | enum wpa_p2p_mode p2p_mode); |
3645 | | |
3646 | | /** |
3647 | | * get_interfaces - Get information about available interfaces |
3648 | | * @global_priv: private driver global data from global_init() |
3649 | | * Returns: Allocated buffer of interface information (caller is |
3650 | | * responsible for freeing the data structure) on success, NULL on |
3651 | | * failure |
3652 | | */ |
3653 | | struct wpa_interface_info * (*get_interfaces)(void *global_priv); |
3654 | | |
3655 | | /** |
3656 | | * scan2 - Request the driver to initiate scan |
3657 | | * @priv: private driver interface data |
3658 | | * @params: Scan parameters |
3659 | | * |
3660 | | * Returns: 0 on success, -1 on failure |
3661 | | * |
3662 | | * Once the scan results are ready, the driver should report scan |
3663 | | * results event for wpa_supplicant which will eventually request the |
3664 | | * results with wpa_driver_get_scan_results2(). |
3665 | | */ |
3666 | | int (*scan2)(void *priv, struct wpa_driver_scan_params *params); |
3667 | | |
3668 | | /** |
3669 | | * authenticate - Request driver to authenticate |
3670 | | * @priv: private driver interface data |
3671 | | * @params: authentication parameters |
3672 | | * Returns: 0 on success, -1 on failure |
3673 | | * |
3674 | | * This is an optional function that can be used with drivers that |
3675 | | * support separate authentication and association steps, i.e., when |
3676 | | * wpa_supplicant can act as the SME. If not implemented, associate() |
3677 | | * function is expected to take care of IEEE 802.11 authentication, |
3678 | | * too. |
3679 | | */ |
3680 | | int (*authenticate)(void *priv, |
3681 | | struct wpa_driver_auth_params *params); |
3682 | | |
3683 | | /** |
3684 | | * set_ap - Set Beacon and Probe Response information for AP mode |
3685 | | * @priv: Private driver interface data |
3686 | | * @params: Parameters to use in AP mode |
3687 | | * |
3688 | | * This function is used to configure Beacon template and/or extra IEs |
3689 | | * to add for Beacon and Probe Response frames for the driver in |
3690 | | * AP mode. The driver is responsible for building the full Beacon |
3691 | | * frame by concatenating the head part with TIM IE generated by the |
3692 | | * driver/firmware and finishing with the tail part. Depending on the |
3693 | | * driver architectue, this can be done either by using the full |
3694 | | * template or the set of additional IEs (e.g., WPS and P2P IE). |
3695 | | * Similarly, Probe Response processing depends on the driver design. |
3696 | | * If the driver (or firmware) takes care of replying to Probe Request |
3697 | | * frames, the extra IEs provided here needs to be added to the Probe |
3698 | | * Response frames. |
3699 | | * |
3700 | | * Returns: 0 on success, -1 on failure |
3701 | | */ |
3702 | | int (*set_ap)(void *priv, struct wpa_driver_ap_params *params); |
3703 | | |
3704 | | /** |
3705 | | * set_acl - Set ACL in AP mode |
3706 | | * @priv: Private driver interface data |
3707 | | * @params: Parameters to configure ACL |
3708 | | * Returns: 0 on success, -1 on failure |
3709 | | * |
3710 | | * This is used only for the drivers which support MAC address ACL. |
3711 | | */ |
3712 | | int (*set_acl)(void *priv, struct hostapd_acl_params *params); |
3713 | | |
3714 | | /** |
3715 | | * hapd_init - Initialize driver interface (hostapd only) |
3716 | | * @hapd: Pointer to hostapd context |
3717 | | * @params: Configuration for the driver wrapper |
3718 | | * Returns: Pointer to private data, %NULL on failure |
3719 | | * |
3720 | | * This function is used instead of init() or init2() when the driver |
3721 | | * wrapper is used with hostapd. |
3722 | | */ |
3723 | | void * (*hapd_init)(struct hostapd_data *hapd, |
3724 | | struct wpa_init_params *params); |
3725 | | |
3726 | | /** |
3727 | | * hapd_deinit - Deinitialize driver interface (hostapd only) |
3728 | | * @priv: Private driver interface data from hapd_init() |
3729 | | */ |
3730 | | void (*hapd_deinit)(void *priv); |
3731 | | |
3732 | | /** |
3733 | | * set_ieee8021x - Enable/disable IEEE 802.1X support (AP only) |
3734 | | * @priv: Private driver interface data |
3735 | | * @params: BSS parameters |
3736 | | * Returns: 0 on success, -1 on failure |
3737 | | * |
3738 | | * This is an optional function to configure the kernel driver to |
3739 | | * enable/disable IEEE 802.1X support and set WPA/WPA2 parameters. This |
3740 | | * can be left undefined (set to %NULL) if IEEE 802.1X support is |
3741 | | * always enabled and the driver uses set_ap() to set WPA/RSN IE |
3742 | | * for Beacon frames. |
3743 | | * |
3744 | | * DEPRECATED - use set_ap() instead |
3745 | | */ |
3746 | | int (*set_ieee8021x)(void *priv, struct wpa_bss_params *params); |
3747 | | |
3748 | | /** |
3749 | | * set_privacy - Enable/disable privacy (AP only) |
3750 | | * @priv: Private driver interface data |
3751 | | * @enabled: 1 = privacy enabled, 0 = disabled |
3752 | | * Returns: 0 on success, -1 on failure |
3753 | | * |
3754 | | * This is an optional function to configure privacy field in the |
3755 | | * kernel driver for Beacon frames. This can be left undefined (set to |
3756 | | * %NULL) if the driver uses the Beacon template from set_ap(). |
3757 | | * |
3758 | | * DEPRECATED - use set_ap() instead |
3759 | | */ |
3760 | | int (*set_privacy)(void *priv, int enabled); |
3761 | | |
3762 | | /** |
3763 | | * get_seqnum - Fetch the current TSC/packet number (AP only) |
3764 | | * @ifname: The interface name (main or virtual) |
3765 | | * @priv: Private driver interface data |
3766 | | * @addr: MAC address of the station or %NULL for group keys |
3767 | | * @idx: Key index |
3768 | | * @link_id: Link ID for a group key, or -1 if not set |
3769 | | * @seq: Buffer for returning the latest used TSC/packet number |
3770 | | * Returns: 0 on success, -1 on failure |
3771 | | * |
3772 | | * This function is used to fetch the last used TSC/packet number for |
3773 | | * a TKIP, CCMP, GCMP, or BIP/IGTK key. It is mainly used with group |
3774 | | * keys, so there is no strict requirement on implementing support for |
3775 | | * unicast keys (i.e., addr != %NULL). |
3776 | | */ |
3777 | | int (*get_seqnum)(const char *ifname, void *priv, const u8 *addr, |
3778 | | int idx, int link_id, u8 *seq); |
3779 | | |
3780 | | /** |
3781 | | * flush - Flush all association stations (AP only) |
3782 | | * @priv: Private driver interface data |
3783 | | * @link_id: In case of MLO, valid link ID on which all associated |
3784 | | * stations will be flushed, -1 otherwise. |
3785 | | * Returns: 0 on success, -1 on failure |
3786 | | * |
3787 | | * This function requests the driver to disassociate all associated |
3788 | | * stations. This function does not need to be implemented if the |
3789 | | * driver does not process association frames internally. |
3790 | | */ |
3791 | | int (*flush)(void *priv, int link_id); |
3792 | | |
3793 | | /** |
3794 | | * set_generic_elem - Add IEs into Beacon/Probe Response frames (AP) |
3795 | | * @priv: Private driver interface data |
3796 | | * @elem: Information elements |
3797 | | * @elem_len: Length of the elem buffer in octets |
3798 | | * Returns: 0 on success, -1 on failure |
3799 | | * |
3800 | | * This is an optional function to add information elements in the |
3801 | | * kernel driver for Beacon and Probe Response frames. This can be left |
3802 | | * undefined (set to %NULL) if the driver uses the Beacon template from |
3803 | | * set_ap(). |
3804 | | * |
3805 | | * DEPRECATED - use set_ap() instead |
3806 | | */ |
3807 | | int (*set_generic_elem)(void *priv, const u8 *elem, size_t elem_len); |
3808 | | |
3809 | | /** |
3810 | | * read_sta_data - Fetch station data |
3811 | | * @priv: Private driver interface data |
3812 | | * @data: Buffer for returning station information |
3813 | | * @addr: MAC address of the station |
3814 | | * Returns: 0 on success, -1 on failure |
3815 | | */ |
3816 | | int (*read_sta_data)(void *priv, struct hostap_sta_driver_data *data, |
3817 | | const u8 *addr); |
3818 | | |
3819 | | /** |
3820 | | * tx_control_port - Send a frame over the 802.1X controlled port |
3821 | | * @priv: Private driver interface data |
3822 | | * @dest: Destination MAC address |
3823 | | * @proto: Ethertype in host byte order |
3824 | | * @buf: Frame payload starting from IEEE 802.1X header |
3825 | | * @len: Frame payload length |
3826 | | * @no_encrypt: Do not encrypt frame |
3827 | | * @link_id: Link ID to use for TX, or -1 if not set |
3828 | | * |
3829 | | * Returns 0 on success, else an error |
3830 | | * |
3831 | | * This is like a normal Ethernet send except that the driver is aware |
3832 | | * (by other means than the Ethertype) that this frame is special, |
3833 | | * and more importantly it gains an ordering between the transmission of |
3834 | | * the frame and other driver management operations such as key |
3835 | | * installations. This can be used to work around known limitations in |
3836 | | * IEEE 802.11 protocols such as race conditions between rekeying 4-way |
3837 | | * handshake message 4/4 and a PTK being overwritten. |
3838 | | * |
3839 | | * This function is only used for a given interface if the driver |
3840 | | * instance reports WPA_DRIVER_FLAGS_CONTROL_PORT capability. Otherwise, |
3841 | | * API users will fall back to sending the frame via a normal socket. |
3842 | | */ |
3843 | | int (*tx_control_port)(void *priv, const u8 *dest, |
3844 | | u16 proto, const u8 *buf, size_t len, |
3845 | | int no_encrypt, int link_id); |
3846 | | |
3847 | | /** |
3848 | | * hapd_send_eapol - Send an EAPOL packet (AP only) |
3849 | | * @priv: private driver interface data |
3850 | | * @addr: Destination MAC address |
3851 | | * @data: EAPOL packet starting with IEEE 802.1X header |
3852 | | * @data_len: Length of the EAPOL packet in octets |
3853 | | * @encrypt: Whether the frame should be encrypted |
3854 | | * @own_addr: Source MAC address |
3855 | | * @flags: WPA_STA_* flags for the destination station |
3856 | | * @link_id: Link ID to use for TX, or -1 if not set |
3857 | | * |
3858 | | * Returns: 0 on success, -1 on failure |
3859 | | */ |
3860 | | int (*hapd_send_eapol)(void *priv, const u8 *addr, const u8 *data, |
3861 | | size_t data_len, int encrypt, |
3862 | | const u8 *own_addr, u32 flags, int link_id); |
3863 | | |
3864 | | /** |
3865 | | * sta_deauth - Deauthenticate a station (AP only) |
3866 | | * @priv: Private driver interface data |
3867 | | * @own_addr: Source address and BSSID for the Deauthentication frame |
3868 | | * @addr: MAC address of the station to deauthenticate |
3869 | | * @reason: Reason code for the Deauthentication frame |
3870 | | * @link_id: Link ID to use for Deauthentication frame, or -1 if not set |
3871 | | * Returns: 0 on success, -1 on failure |
3872 | | * |
3873 | | * This function requests a specific station to be deauthenticated and |
3874 | | * a Deauthentication frame to be sent to it. |
3875 | | */ |
3876 | | int (*sta_deauth)(void *priv, const u8 *own_addr, const u8 *addr, |
3877 | | u16 reason, int link_id); |
3878 | | |
3879 | | /** |
3880 | | * sta_disassoc - Disassociate a station (AP only) |
3881 | | * @priv: Private driver interface data |
3882 | | * @own_addr: Source address and BSSID for the Disassociation frame |
3883 | | * @addr: MAC address of the station to disassociate |
3884 | | * @reason: Reason code for the Disassociation frame |
3885 | | * @link_id: Link ID to use for Disassociation frame, or -1 if not set |
3886 | | * Returns: 0 on success, -1 on failure |
3887 | | * |
3888 | | * This function requests a specific station to be disassociated and |
3889 | | * a Disassociation frame to be sent to it. |
3890 | | */ |
3891 | | int (*sta_disassoc)(void *priv, const u8 *own_addr, const u8 *addr, |
3892 | | u16 reason, int link_id); |
3893 | | |
3894 | | /** |
3895 | | * sta_remove - Remove a station entry (AP only) |
3896 | | * @priv: Private driver interface data |
3897 | | * @addr: MAC address of the station to be removed |
3898 | | * Returns: 0 on success, -1 on failure |
3899 | | */ |
3900 | | int (*sta_remove)(void *priv, const u8 *addr); |
3901 | | |
3902 | | /** |
3903 | | * hapd_get_ssid - Get the current SSID (AP only) |
3904 | | * @priv: Private driver interface data |
3905 | | * @buf: Buffer for returning the SSID |
3906 | | * @len: Maximum length of the buffer |
3907 | | * Returns: Length of the SSID on success, -1 on failure |
3908 | | * |
3909 | | * This function need not be implemented if the driver uses Beacon |
3910 | | * template from set_ap() and does not reply to Probe Request frames. |
3911 | | */ |
3912 | | int (*hapd_get_ssid)(void *priv, u8 *buf, int len); |
3913 | | |
3914 | | /** |
3915 | | * hapd_set_ssid - Set SSID (AP only) |
3916 | | * @priv: Private driver interface data |
3917 | | * @buf: SSID |
3918 | | * @len: Length of the SSID in octets |
3919 | | * Returns: 0 on success, -1 on failure |
3920 | | * |
3921 | | * DEPRECATED - use set_ap() instead |
3922 | | */ |
3923 | | int (*hapd_set_ssid)(void *priv, const u8 *buf, int len); |
3924 | | |
3925 | | /** |
3926 | | * hapd_set_countermeasures - Enable/disable TKIP countermeasures (AP) |
3927 | | * @priv: Private driver interface data |
3928 | | * @enabled: 1 = countermeasures enabled, 0 = disabled |
3929 | | * Returns: 0 on success, -1 on failure |
3930 | | * |
3931 | | * This need not be implemented if the driver does not take care of |
3932 | | * association processing. |
3933 | | */ |
3934 | | int (*hapd_set_countermeasures)(void *priv, int enabled); |
3935 | | |
3936 | | /** |
3937 | | * sta_add - Add a station entry |
3938 | | * @priv: Private driver interface data |
3939 | | * @params: Station parameters |
3940 | | * Returns: 0 on success, -1 on failure |
3941 | | * |
3942 | | * This function is used to add or set (params->set 1) a station |
3943 | | * entry in the driver. Adding STA entries is used only if the driver |
3944 | | * does not take care of association processing. |
3945 | | * |
3946 | | * With drivers that don't support full AP client state, this function |
3947 | | * is used to add a station entry to the driver once the station has |
3948 | | * completed association. |
3949 | | * |
3950 | | * With TDLS, this function is used to add or set (params->set 1) |
3951 | | * TDLS peer entries (even with drivers that do not support full AP |
3952 | | * client state). |
3953 | | */ |
3954 | | int (*sta_add)(void *priv, struct hostapd_sta_add_params *params); |
3955 | | |
3956 | | /** |
3957 | | * get_inact_sec - Get station inactivity duration (AP only) |
3958 | | * @priv: Private driver interface data |
3959 | | * @addr: Station address |
3960 | | * Returns: Number of seconds station has been inactive, -1 on failure |
3961 | | */ |
3962 | | int (*get_inact_sec)(void *priv, const u8 *addr); |
3963 | | |
3964 | | /** |
3965 | | * sta_clear_stats - Clear station statistics (AP only) |
3966 | | * @priv: Private driver interface data |
3967 | | * @addr: Station address |
3968 | | * Returns: 0 on success, -1 on failure |
3969 | | */ |
3970 | | int (*sta_clear_stats)(void *priv, const u8 *addr); |
3971 | | |
3972 | | /** |
3973 | | * set_freq - Set channel/frequency (AP only) |
3974 | | * @priv: Private driver interface data |
3975 | | * @freq: Channel parameters |
3976 | | * Returns: 0 on success, -1 on failure |
3977 | | */ |
3978 | | int (*set_freq)(void *priv, struct hostapd_freq_params *freq); |
3979 | | |
3980 | | /** |
3981 | | * set_rts - Set RTS threshold |
3982 | | * @priv: Private driver interface data |
3983 | | * @rts: RTS threshold in octets |
3984 | | * Returns: 0 on success, -1 on failure |
3985 | | */ |
3986 | | int (*set_rts)(void *priv, int rts); |
3987 | | |
3988 | | /** |
3989 | | * set_frag - Set fragmentation threshold |
3990 | | * @priv: Private driver interface data |
3991 | | * @frag: Fragmentation threshold in octets |
3992 | | * Returns: 0 on success, -1 on failure |
3993 | | */ |
3994 | | int (*set_frag)(void *priv, int frag); |
3995 | | |
3996 | | /** |
3997 | | * sta_set_flags - Set station flags (AP only) |
3998 | | * @priv: Private driver interface data |
3999 | | * @addr: Station address |
4000 | | * @total_flags: Bitmap of all WPA_STA_* flags currently set |
4001 | | * @flags_or: Bitmap of WPA_STA_* flags to add |
4002 | | * @flags_and: Bitmap of WPA_STA_* flags to us as a mask |
4003 | | * Returns: 0 on success, -1 on failure |
4004 | | */ |
4005 | | int (*sta_set_flags)(void *priv, const u8 *addr, |
4006 | | unsigned int total_flags, unsigned int flags_or, |
4007 | | unsigned int flags_and); |
4008 | | |
4009 | | /** |
4010 | | * sta_set_airtime_weight - Set station airtime weight (AP only) |
4011 | | * @priv: Private driver interface data |
4012 | | * @addr: Station address |
4013 | | * @weight: New weight for station airtime assignment |
4014 | | * Returns: 0 on success, -1 on failure |
4015 | | */ |
4016 | | int (*sta_set_airtime_weight)(void *priv, const u8 *addr, |
4017 | | unsigned int weight); |
4018 | | |
4019 | | /** |
4020 | | * set_tx_queue_params - Set TX queue parameters |
4021 | | * @priv: Private driver interface data |
4022 | | * @queue: Queue number (0 = VO, 1 = VI, 2 = BE, 3 = BK) |
4023 | | * @aifs: AIFS |
4024 | | * @cw_min: cwMin |
4025 | | * @cw_max: cwMax |
4026 | | * @burst_time: Maximum length for bursting in 0.1 msec units |
4027 | | * @link_id: Link ID to use, or -1 for non MLD. |
4028 | | */ |
4029 | | int (*set_tx_queue_params)(void *priv, int queue, int aifs, int cw_min, |
4030 | | int cw_max, int burst_time, int link_id); |
4031 | | |
4032 | | /** |
4033 | | * if_add - Add a virtual interface |
4034 | | * @priv: Private driver interface data |
4035 | | * @type: Interface type |
4036 | | * @ifname: Interface name for the new virtual interface |
4037 | | * @addr: Local address to use for the interface or %NULL to use the |
4038 | | * parent interface address |
4039 | | * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces |
4040 | | * @drv_priv: Pointer for overwriting the driver context or %NULL if |
4041 | | * not allowed (applies only to %WPA_IF_AP_BSS type) |
4042 | | * @force_ifname: Buffer for returning an interface name that the |
4043 | | * driver ended up using if it differs from the requested ifname |
4044 | | * @if_addr: Buffer for returning the allocated interface address |
4045 | | * (this may differ from the requested addr if the driver cannot |
4046 | | * change interface address) |
4047 | | * @bridge: Bridge interface to use or %NULL if no bridge configured |
4048 | | * @use_existing: Whether to allow existing interface to be used |
4049 | | * @setup_ap: Whether to setup AP for %WPA_IF_AP_BSS interfaces |
4050 | | * Returns: 0 on success, -1 on failure |
4051 | | */ |
4052 | | int (*if_add)(void *priv, enum wpa_driver_if_type type, |
4053 | | const char *ifname, const u8 *addr, void *bss_ctx, |
4054 | | void **drv_priv, char *force_ifname, u8 *if_addr, |
4055 | | const char *bridge, int use_existing, int setup_ap); |
4056 | | |
4057 | | /** |
4058 | | * if_remove - Remove a virtual interface |
4059 | | * @priv: Private driver interface data |
4060 | | * @type: Interface type |
4061 | | * @ifname: Interface name of the virtual interface to be removed |
4062 | | * Returns: 0 on success, -1 on failure |
4063 | | */ |
4064 | | int (*if_remove)(void *priv, enum wpa_driver_if_type type, |
4065 | | const char *ifname); |
4066 | | |
4067 | | /** |
4068 | | * set_sta_vlan - Bind a station into a specific interface (AP only) |
4069 | | * @priv: Private driver interface data |
4070 | | * @ifname: Interface (main or virtual BSS or VLAN) |
4071 | | * @addr: MAC address of the associated station |
4072 | | * @vlan_id: VLAN ID |
4073 | | * @link_id: The link ID or -1 for non-MLO |
4074 | | * Returns: 0 on success, -1 on failure |
4075 | | * |
4076 | | * This function is used to bind a station to a specific virtual |
4077 | | * interface. It is only used if when virtual interfaces are supported, |
4078 | | * e.g., to assign stations to different VLAN interfaces based on |
4079 | | * information from a RADIUS server. This allows separate broadcast |
4080 | | * domains to be used with a single BSS. |
4081 | | */ |
4082 | | int (*set_sta_vlan)(void *priv, const u8 *addr, const char *ifname, |
4083 | | int vlan_id, int link_id); |
4084 | | |
4085 | | /** |
4086 | | * commit - Optional commit changes handler (AP only) |
4087 | | * @priv: driver private data |
4088 | | * Returns: 0 on success, -1 on failure |
4089 | | * |
4090 | | * This optional handler function can be registered if the driver |
4091 | | * interface implementation needs to commit changes (e.g., by setting |
4092 | | * network interface up) at the end of initial configuration. If set, |
4093 | | * this handler will be called after initial setup has been completed. |
4094 | | */ |
4095 | | int (*commit)(void *priv); |
4096 | | |
4097 | | /** |
4098 | | * set_radius_acl_auth - Notification of RADIUS ACL change |
4099 | | * @priv: Private driver interface data |
4100 | | * @mac: MAC address of the station |
4101 | | * @accepted: Whether the station was accepted |
4102 | | * @session_timeout: Session timeout for the station |
4103 | | * Returns: 0 on success, -1 on failure |
4104 | | */ |
4105 | | int (*set_radius_acl_auth)(void *priv, const u8 *mac, int accepted, |
4106 | | u32 session_timeout); |
4107 | | |
4108 | | /** |
4109 | | * set_radius_acl_expire - Notification of RADIUS ACL expiration |
4110 | | * @priv: Private driver interface data |
4111 | | * @mac: MAC address of the station |
4112 | | * Returns: 0 on success, -1 on failure |
4113 | | */ |
4114 | | int (*set_radius_acl_expire)(void *priv, const u8 *mac); |
4115 | | |
4116 | | /** |
4117 | | * set_ap_wps_ie - Add WPS IE(s) into Beacon/Probe Response frames (AP) |
4118 | | * @priv: Private driver interface data |
4119 | | * @beacon: WPS IE(s) for Beacon frames or %NULL to remove extra IE(s) |
4120 | | * @proberesp: WPS IE(s) for Probe Response frames or %NULL to remove |
4121 | | * extra IE(s) |
4122 | | * @assocresp: WPS IE(s) for (Re)Association Response frames or %NULL |
4123 | | * to remove extra IE(s) |
4124 | | * Returns: 0 on success, -1 on failure |
4125 | | * |
4126 | | * This is an optional function to add WPS IE in the kernel driver for |
4127 | | * Beacon and Probe Response frames. This can be left undefined (set |
4128 | | * to %NULL) if the driver uses the Beacon template from set_ap() |
4129 | | * and does not process Probe Request frames. If the driver takes care |
4130 | | * of (Re)Association frame processing, the assocresp buffer includes |
4131 | | * WPS IE(s) that need to be added to (Re)Association Response frames |
4132 | | * whenever a (Re)Association Request frame indicated use of WPS. |
4133 | | * |
4134 | | * This will also be used to add P2P IE(s) into Beacon/Probe Response |
4135 | | * frames when operating as a GO. The driver is responsible for adding |
4136 | | * timing related attributes (e.g., NoA) in addition to the IEs |
4137 | | * included here by appending them after these buffers. This call is |
4138 | | * also used to provide Probe Response IEs for P2P Listen state |
4139 | | * operations for drivers that generate the Probe Response frames |
4140 | | * internally. |
4141 | | * |
4142 | | * DEPRECATED - use set_ap() instead |
4143 | | */ |
4144 | | int (*set_ap_wps_ie)(void *priv, const struct wpabuf *beacon, |
4145 | | const struct wpabuf *proberesp, |
4146 | | const struct wpabuf *assocresp); |
4147 | | |
4148 | | /** |
4149 | | * set_supp_port - Set IEEE 802.1X Supplicant Port status |
4150 | | * @priv: Private driver interface data |
4151 | | * @authorized: Whether the port is authorized |
4152 | | * Returns: 0 on success, -1 on failure |
4153 | | */ |
4154 | | int (*set_supp_port)(void *priv, int authorized); |
4155 | | |
4156 | | /** |
4157 | | * set_wds_sta - Bind a station into a 4-address WDS (AP only) |
4158 | | * @priv: Private driver interface data |
4159 | | * @addr: MAC address of the associated station |
4160 | | * @aid: Association ID |
4161 | | * @val: 1 = bind to 4-address WDS; 0 = unbind |
4162 | | * @bridge_ifname: Bridge interface to use for the WDS station or %NULL |
4163 | | * to indicate that bridge is not to be used |
4164 | | * @ifname_wds: Buffer to return the interface name for the new WDS |
4165 | | * station or %NULL to indicate name is not returned. |
4166 | | * Returns: 0 on success, -1 on failure |
4167 | | */ |
4168 | | int (*set_wds_sta)(void *priv, const u8 *addr, int aid, int val, |
4169 | | const char *bridge_ifname, char *ifname_wds); |
4170 | | |
4171 | | /** |
4172 | | * send_action - Transmit an Action frame |
4173 | | * @priv: Private driver interface data |
4174 | | * @freq: Frequency (in MHz) of the channel |
4175 | | * @wait: Time to wait off-channel for a response (in ms), or zero |
4176 | | * @dst: Destination MAC address (Address 1) |
4177 | | * @src: Source MAC address (Address 2) |
4178 | | * @bssid: BSSID (Address 3) |
4179 | | * @data: Frame body |
4180 | | * @data_len: data length in octets |
4181 | | * @no_cck: Whether CCK rates must not be used to transmit this frame |
4182 | | * @link_id: Link ID of the specified link; -1 for non-MLO cases and for |
4183 | | * frames that target the MLD instead of a specific link in MLO |
4184 | | * cases |
4185 | | * Returns: 0 on success, -1 on failure |
4186 | | * |
4187 | | * This command can be used to request the driver to transmit an action |
4188 | | * frame to the specified destination. |
4189 | | * |
4190 | | * If the %WPA_DRIVER_FLAGS_OFFCHANNEL_TX flag is set, the frame will |
4191 | | * be transmitted on the given channel and the device will wait for a |
4192 | | * response on that channel for the given wait time. |
4193 | | * |
4194 | | * If the flag is not set, the wait time will be ignored. In this case, |
4195 | | * if a remain-on-channel duration is in progress, the frame must be |
4196 | | * transmitted on that channel; alternatively the frame may be sent on |
4197 | | * the current operational channel (if in associated state in station |
4198 | | * mode or while operating as an AP.) |
4199 | | * |
4200 | | * If @src differs from the device MAC address, use of a random |
4201 | | * transmitter address is requested for this message exchange. |
4202 | | */ |
4203 | | int (*send_action)(void *priv, unsigned int freq, unsigned int wait, |
4204 | | const u8 *dst, const u8 *src, const u8 *bssid, |
4205 | | const u8 *data, size_t data_len, int no_cck, |
4206 | | int link_id); |
4207 | | |
4208 | | /** |
4209 | | * send_action_cancel_wait - Cancel action frame TX wait |
4210 | | * @priv: Private driver interface data |
4211 | | * |
4212 | | * This command cancels the wait time associated with sending an action |
4213 | | * frame. It is only available when %WPA_DRIVER_FLAGS_OFFCHANNEL_TX is |
4214 | | * set in the driver flags. |
4215 | | */ |
4216 | | void (*send_action_cancel_wait)(void *priv); |
4217 | | |
4218 | | /** |
4219 | | * remain_on_channel - Remain awake on a channel |
4220 | | * @priv: Private driver interface data |
4221 | | * @freq: Frequency (in MHz) of the channel |
4222 | | * @duration: Duration in milliseconds |
4223 | | * Returns: 0 on success, -1 on failure |
4224 | | * |
4225 | | * This command is used to request the driver to remain awake on the |
4226 | | * specified channel for the specified duration and report received |
4227 | | * Action frames with EVENT_RX_MGMT events. Optionally, received |
4228 | | * Probe Request frames may also be requested to be reported by calling |
4229 | | * probe_req_report(). These will be reported with EVENT_RX_PROBE_REQ. |
4230 | | * |
4231 | | * The driver may not be at the requested channel when this function |
4232 | | * returns, i.e., the return code is only indicating whether the |
4233 | | * request was accepted. The caller will need to wait until the |
4234 | | * EVENT_REMAIN_ON_CHANNEL event indicates that the driver has |
4235 | | * completed the channel change. This may take some time due to other |
4236 | | * need for the radio and the caller should be prepared to timing out |
4237 | | * its wait since there are no guarantees on when this request can be |
4238 | | * executed. |
4239 | | */ |
4240 | | int (*remain_on_channel)(void *priv, unsigned int freq, |
4241 | | unsigned int duration); |
4242 | | |
4243 | | /** |
4244 | | * cancel_remain_on_channel - Cancel remain-on-channel operation |
4245 | | * @priv: Private driver interface data |
4246 | | * |
4247 | | * This command can be used to cancel a remain-on-channel operation |
4248 | | * before its originally requested duration has passed. This could be |
4249 | | * used, e.g., when remain_on_channel() is used to request extra time |
4250 | | * to receive a response to an Action frame and the response is |
4251 | | * received when there is still unneeded time remaining on the |
4252 | | * remain-on-channel operation. |
4253 | | */ |
4254 | | int (*cancel_remain_on_channel)(void *priv); |
4255 | | |
4256 | | /** |
4257 | | * probe_req_report - Request Probe Request frames to be indicated |
4258 | | * @priv: Private driver interface data |
4259 | | * @report: Whether to report received Probe Request frames |
4260 | | * Returns: 0 on success, -1 on failure (or if not supported) |
4261 | | * |
4262 | | * This command can be used to request the driver to indicate when |
4263 | | * Probe Request frames are received with EVENT_RX_PROBE_REQ events. |
4264 | | * Since this operation may require extra resources, e.g., due to less |
4265 | | * optimal hardware/firmware RX filtering, many drivers may disable |
4266 | | * Probe Request reporting at least in station mode. This command is |
4267 | | * used to notify the driver when the Probe Request frames need to be |
4268 | | * reported, e.g., during remain-on-channel operations. |
4269 | | */ |
4270 | | int (*probe_req_report)(void *priv, int report); |
4271 | | |
4272 | | /** |
4273 | | * deinit_ap - Deinitialize AP mode |
4274 | | * @priv: Private driver interface data |
4275 | | * Returns: 0 on success, -1 on failure (or if not supported) |
4276 | | * |
4277 | | * This optional function can be used to disable AP mode related |
4278 | | * configuration. If the interface was not dynamically added, |
4279 | | * change the driver mode to station mode to allow normal station |
4280 | | * operations like scanning to be completed. |
4281 | | */ |
4282 | | int (*deinit_ap)(void *priv); |
4283 | | |
4284 | | /** |
4285 | | * deinit_p2p_cli - Deinitialize P2P client mode |
4286 | | * @priv: Private driver interface data |
4287 | | * Returns: 0 on success, -1 on failure (or if not supported) |
4288 | | * |
4289 | | * This optional function can be used to disable P2P client mode. If the |
4290 | | * interface was not dynamically added, change the interface type back |
4291 | | * to station mode. |
4292 | | */ |
4293 | | int (*deinit_p2p_cli)(void *priv); |
4294 | | |
4295 | | /** |
4296 | | * suspend - Notification on system suspend/hibernate event |
4297 | | * @priv: Private driver interface data |
4298 | | */ |
4299 | | void (*suspend)(void *priv); |
4300 | | |
4301 | | /** |
4302 | | * resume - Notification on system resume/thaw event |
4303 | | * @priv: Private driver interface data |
4304 | | */ |
4305 | | void (*resume)(void *priv); |
4306 | | |
4307 | | /** |
4308 | | * signal_monitor - Set signal monitoring parameters |
4309 | | * @priv: Private driver interface data |
4310 | | * @threshold: Threshold value for signal change events; 0 = disabled |
4311 | | * @hysteresis: Minimum change in signal strength before indicating a |
4312 | | * new event |
4313 | | * Returns: 0 on success, -1 on failure (or if not supported) |
4314 | | * |
4315 | | * This function can be used to configure monitoring of signal strength |
4316 | | * with the current AP. Whenever signal strength drops below the |
4317 | | * %threshold value or increases above it, EVENT_SIGNAL_CHANGE event |
4318 | | * should be generated assuming the signal strength has changed at |
4319 | | * least %hysteresis from the previously indicated signal change event. |
4320 | | */ |
4321 | | int (*signal_monitor)(void *priv, int threshold, int hysteresis); |
4322 | | |
4323 | | /** |
4324 | | * get_noa - Get current Notice of Absence attribute payload |
4325 | | * @priv: Private driver interface data |
4326 | | * @buf: Buffer for returning NoA |
4327 | | * @buf_len: Buffer length in octets |
4328 | | * Returns: Number of octets used in buf, 0 to indicate no NoA is being |
4329 | | * advertized, or -1 on failure |
4330 | | * |
4331 | | * This function is used to fetch the current Notice of Absence |
4332 | | * attribute value from GO. |
4333 | | */ |
4334 | | int (*get_noa)(void *priv, u8 *buf, size_t buf_len); |
4335 | | |
4336 | | /** |
4337 | | * set_noa - Set Notice of Absence parameters for GO (testing) |
4338 | | * @priv: Private driver interface data |
4339 | | * @count: Count |
4340 | | * @start: Start time in ms from next TBTT |
4341 | | * @duration: Duration in ms |
4342 | | * Returns: 0 on success or -1 on failure |
4343 | | * |
4344 | | * This function is used to set Notice of Absence parameters for GO. It |
4345 | | * is used only for testing. To disable NoA, all parameters are set to |
4346 | | * 0. |
4347 | | */ |
4348 | | int (*set_noa)(void *priv, u8 count, int start, int duration); |
4349 | | |
4350 | | /** |
4351 | | * set_p2p_powersave - Set P2P power save options |
4352 | | * @priv: Private driver interface data |
4353 | | * @legacy_ps: 0 = disable, 1 = enable, 2 = maximum PS, -1 = no change |
4354 | | * @opp_ps: 0 = disable, 1 = enable, -1 = no change |
4355 | | * @ctwindow: 0.. = change (msec), -1 = no change |
4356 | | * Returns: 0 on success or -1 on failure |
4357 | | */ |
4358 | | int (*set_p2p_powersave)(void *priv, int legacy_ps, int opp_ps, |
4359 | | int ctwindow); |
4360 | | |
4361 | | /** |
4362 | | * ampdu - Enable/disable aggregation |
4363 | | * @priv: Private driver interface data |
4364 | | * @ampdu: 1/0 = enable/disable A-MPDU aggregation |
4365 | | * Returns: 0 on success or -1 on failure |
4366 | | */ |
4367 | | int (*ampdu)(void *priv, int ampdu); |
4368 | | |
4369 | | /** |
4370 | | * get_radio_name - Get physical radio name for the device |
4371 | | * @priv: Private driver interface data |
4372 | | * Returns: Radio name or %NULL if not known |
4373 | | * |
4374 | | * The returned data must not be modified by the caller. It is assumed |
4375 | | * that any interface that has the same radio name as another is |
4376 | | * sharing the same physical radio. This information can be used to |
4377 | | * share scan results etc. information between the virtual interfaces |
4378 | | * to speed up various operations. |
4379 | | */ |
4380 | | const char * (*get_radio_name)(void *priv); |
4381 | | |
4382 | | /** |
4383 | | * send_tdls_mgmt - for sending TDLS management packets |
4384 | | * @priv: private driver interface data |
4385 | | * @dst: Destination (peer) MAC address |
4386 | | * @action_code: TDLS action code for the mssage |
4387 | | * @dialog_token: Dialog Token to use in the message (if needed) |
4388 | | * @status_code: Status Code or Reason Code to use (if needed) |
4389 | | * @peer_capab: TDLS peer capability (TDLS_PEER_* bitfield) |
4390 | | * @initiator: Is the current end the TDLS link initiator |
4391 | | * @buf: TDLS IEs to add to the message |
4392 | | * @len: Length of buf in octets |
4393 | | * @link_id: If >= 0 indicates the link of the AP MLD to specify the |
4394 | | * operating channel on which to send a TDLS Discovery Response frame. |
4395 | | * Returns: 0 on success, negative (<0) on failure |
4396 | | * |
4397 | | * This optional function can be used to send packet to driver which is |
4398 | | * responsible for receiving and sending all TDLS packets. |
4399 | | */ |
4400 | | int (*send_tdls_mgmt)(void *priv, const u8 *dst, u8 action_code, |
4401 | | u8 dialog_token, u16 status_code, u32 peer_capab, |
4402 | | int initiator, const u8 *buf, size_t len, |
4403 | | int link_id); |
4404 | | |
4405 | | /** |
4406 | | * tdls_oper - Ask the driver to perform high-level TDLS operations |
4407 | | * @priv: Private driver interface data |
4408 | | * @oper: TDLS high-level operation. See %enum tdls_oper |
4409 | | * @peer: Destination (peer) MAC address |
4410 | | * Returns: 0 on success, negative (<0) on failure |
4411 | | * |
4412 | | * This optional function can be used to send high-level TDLS commands |
4413 | | * to the driver. |
4414 | | */ |
4415 | | int (*tdls_oper)(void *priv, enum tdls_oper oper, const u8 *peer); |
4416 | | |
4417 | | /** |
4418 | | * wnm_oper - Notify driver of the WNM frame reception |
4419 | | * @priv: Private driver interface data |
4420 | | * @oper: WNM operation. See %enum wnm_oper |
4421 | | * @peer: Destination (peer) MAC address |
4422 | | * @buf: Buffer for the driver to fill in (for getting IE) |
4423 | | * @buf_len: Return the len of buf |
4424 | | * Returns: 0 on success, negative (<0) on failure |
4425 | | */ |
4426 | | int (*wnm_oper)(void *priv, enum wnm_oper oper, const u8 *peer, |
4427 | | u8 *buf, u16 *buf_len); |
4428 | | |
4429 | | /** |
4430 | | * set_qos_map - Set QoS Map |
4431 | | * @priv: Private driver interface data |
4432 | | * @qos_map_set: QoS Map |
4433 | | * @qos_map_set_len: Length of QoS Map |
4434 | | */ |
4435 | | int (*set_qos_map)(void *priv, const u8 *qos_map_set, |
4436 | | u8 qos_map_set_len); |
4437 | | |
4438 | | /** |
4439 | | * br_add_ip_neigh - Add a neigh to the bridge ip neigh table |
4440 | | * @priv: Private driver interface data |
4441 | | * @version: IP version of the IP address, 4 or 6 |
4442 | | * @ipaddr: IP address for the neigh entry |
4443 | | * @prefixlen: IP address prefix length |
4444 | | * @addr: Corresponding MAC address |
4445 | | * Returns: 0 on success, negative (<0) on failure |
4446 | | */ |
4447 | | int (*br_add_ip_neigh)(void *priv, u8 version, const u8 *ipaddr, |
4448 | | int prefixlen, const u8 *addr); |
4449 | | |
4450 | | /** |
4451 | | * br_delete_ip_neigh - Remove a neigh from the bridge ip neigh table |
4452 | | * @priv: Private driver interface data |
4453 | | * @version: IP version of the IP address, 4 or 6 |
4454 | | * @ipaddr: IP address for the neigh entry |
4455 | | * Returns: 0 on success, negative (<0) on failure |
4456 | | */ |
4457 | | int (*br_delete_ip_neigh)(void *priv, u8 version, const u8 *ipaddr); |
4458 | | |
4459 | | /** |
4460 | | * br_port_set_attr - Set a bridge port attribute |
4461 | | * @attr: Bridge port attribute to set |
4462 | | * @val: Value to be set |
4463 | | * Returns: 0 on success, negative (<0) on failure |
4464 | | */ |
4465 | | int (*br_port_set_attr)(void *priv, enum drv_br_port_attr attr, |
4466 | | unsigned int val); |
4467 | | |
4468 | | /** |
4469 | | * br_port_set_attr - Set a bridge network parameter |
4470 | | * @param: Bridge parameter to set |
4471 | | * @val: Value to be set |
4472 | | * Returns: 0 on success, negative (<0) on failure |
4473 | | */ |
4474 | | int (*br_set_net_param)(void *priv, enum drv_br_net_param param, |
4475 | | unsigned int val); |
4476 | | |
4477 | | /** |
4478 | | * get_wowlan - Get wake-on-wireless status |
4479 | | * @priv: Private driver interface data |
4480 | | */ |
4481 | | int (*get_wowlan)(void *priv); |
4482 | | |
4483 | | /** |
4484 | | * set_wowlan - Set wake-on-wireless triggers |
4485 | | * @priv: Private driver interface data |
4486 | | * @triggers: wowlan triggers |
4487 | | */ |
4488 | | int (*set_wowlan)(void *priv, const struct wowlan_triggers *triggers); |
4489 | | |
4490 | | /** |
4491 | | * signal_poll - Get current connection information |
4492 | | * @priv: Private driver interface data |
4493 | | * @signal_info: Connection info structure |
4494 | | */ |
4495 | | int (*signal_poll)(void *priv, struct wpa_signal_info *signal_info); |
4496 | | |
4497 | | /** |
4498 | | * mlo_signal_poll - Get current MLO connection information |
4499 | | * @priv: Private driver interface data |
4500 | | * @mlo_signal_info: MLO connection info structure |
4501 | | */ |
4502 | | int (*mlo_signal_poll)(void *priv, |
4503 | | struct wpa_mlo_signal_info *mlo_signal_info); |
4504 | | |
4505 | | /** |
4506 | | * setup_link_reconfig - Used to initiate Link Reconfiguration request |
4507 | | * for the current MLO association. |
4508 | | * @priv: Private driver interface data |
4509 | | * @info: Link reconfiguration request info |
4510 | | */ |
4511 | | int (*setup_link_reconfig)(void *priv, |
4512 | | struct wpa_mlo_reconfig_info *info); |
4513 | | |
4514 | | /** |
4515 | | * channel_info - Get parameters of the current operating channel |
4516 | | * @priv: Private driver interface data |
4517 | | * @channel_info: Channel info structure |
4518 | | * Returns: 0 on success, negative (<0) on failure |
4519 | | */ |
4520 | | int (*channel_info)(void *priv, struct wpa_channel_info *channel_info); |
4521 | | |
4522 | | /** |
4523 | | * set_authmode - Set authentication algorithm(s) for static WEP |
4524 | | * @priv: Private driver interface data |
4525 | | * @authmode: 1=Open System, 2=Shared Key, 3=both |
4526 | | * Returns: 0 on success, -1 on failure |
4527 | | * |
4528 | | * This function can be used to set authentication algorithms for AP |
4529 | | * mode when static WEP is used. If the driver uses user space MLME/SME |
4530 | | * implementation, there is no need to implement this function. |
4531 | | * |
4532 | | * DEPRECATED - use set_ap() instead |
4533 | | */ |
4534 | | int (*set_authmode)(void *priv, int authmode); |
4535 | | |
4536 | | #ifdef ANDROID |
4537 | | /** |
4538 | | * driver_cmd - Execute driver-specific command |
4539 | | * @priv: Private driver interface data |
4540 | | * @cmd: Command to execute |
4541 | | * @buf: Return buffer |
4542 | | * @buf_len: Buffer length |
4543 | | * Returns: 0 on success, -1 on failure |
4544 | | */ |
4545 | | int (*driver_cmd)(void *priv, char *cmd, char *buf, size_t buf_len); |
4546 | | #endif /* ANDROID */ |
4547 | | |
4548 | | /** |
4549 | | * vendor_cmd - Execute vendor specific command |
4550 | | * @priv: Private driver interface data |
4551 | | * @vendor_id: Vendor id |
4552 | | * @subcmd: Vendor command id |
4553 | | * @nested_attr_flag: Specifies if vendor subcommand uses nested |
4554 | | * attributes or not |
4555 | | * @data: Vendor command parameters (%NULL if no parameters) |
4556 | | * @data_len: Data length |
4557 | | * @buf: Return buffer (%NULL to ignore reply) |
4558 | | * Returns: 0 on success, negative (<0) on failure |
4559 | | * |
4560 | | * This function handles vendor specific commands that are passed to |
4561 | | * the driver/device. The command is identified by vendor id and |
4562 | | * command id. The nested_attr_flag specifies whether the subcommand |
4563 | | * uses nested attributes or not. Parameters can be passed |
4564 | | * as argument to the command in the data buffer. Reply (if any) will be |
4565 | | * filled in the supplied return buffer. |
4566 | | * |
4567 | | * The exact driver behavior is driver interface and vendor specific. As |
4568 | | * an example, this will be converted to a vendor specific cfg80211 |
4569 | | * command in case of the nl80211 driver interface. |
4570 | | */ |
4571 | | int (*vendor_cmd)(void *priv, unsigned int vendor_id, |
4572 | | unsigned int subcmd, const u8 *data, size_t data_len, |
4573 | | enum nested_attr nested_attr_flag, |
4574 | | struct wpabuf *buf); |
4575 | | |
4576 | | /** |
4577 | | * set_rekey_info - Set rekey information |
4578 | | * @priv: Private driver interface data |
4579 | | * @kek: Current KEK |
4580 | | * @kek_len: KEK length in octets |
4581 | | * @kck: Current KCK |
4582 | | * @kck_len: KCK length in octets |
4583 | | * @replay_ctr: Current EAPOL-Key Replay Counter |
4584 | | * |
4585 | | * This optional function can be used to provide information for the |
4586 | | * driver/firmware to process EAPOL-Key frames in Group Key Handshake |
4587 | | * while the host (including wpa_supplicant) is sleeping. |
4588 | | */ |
4589 | | void (*set_rekey_info)(void *priv, const u8 *kek, size_t kek_len, |
4590 | | const u8 *kck, size_t kck_len, |
4591 | | const u8 *replay_ctr); |
4592 | | |
4593 | | /** |
4594 | | * sta_assoc - Station association indication |
4595 | | * @priv: Private driver interface data |
4596 | | * @own_addr: Source address and BSSID for association frame |
4597 | | * @addr: MAC address of the station to associate |
4598 | | * @reassoc: flag to indicate re-association |
4599 | | * @status: association response status code |
4600 | | * @ie: assoc response ie buffer |
4601 | | * @len: ie buffer length |
4602 | | * Returns: 0 on success, -1 on failure |
4603 | | * |
4604 | | * This function indicates the driver to send (Re)Association |
4605 | | * Response frame to the station. |
4606 | | */ |
4607 | | int (*sta_assoc)(void *priv, const u8 *own_addr, const u8 *addr, |
4608 | | int reassoc, u16 status, const u8 *ie, size_t len); |
4609 | | |
4610 | | /** |
4611 | | * sta_auth - Station authentication indication |
4612 | | * @priv: private driver interface data |
4613 | | * @params: Station authentication parameters |
4614 | | * |
4615 | | * Returns: 0 on success, -1 on failure |
4616 | | */ |
4617 | | int (*sta_auth)(void *priv, |
4618 | | struct wpa_driver_sta_auth_params *params); |
4619 | | |
4620 | | /** |
4621 | | * add_tspec - Add traffic stream |
4622 | | * @priv: Private driver interface data |
4623 | | * @addr: MAC address of the station to associate |
4624 | | * @tspec_ie: tspec ie buffer |
4625 | | * @tspec_ielen: tspec ie length |
4626 | | * Returns: 0 on success, -1 on failure |
4627 | | * |
4628 | | * This function adds the traffic steam for the station |
4629 | | * and fills the medium_time in tspec_ie. |
4630 | | */ |
4631 | | int (*add_tspec)(void *priv, const u8 *addr, u8 *tspec_ie, |
4632 | | size_t tspec_ielen); |
4633 | | |
4634 | | /** |
4635 | | * add_sta_node - Add a station node in the driver |
4636 | | * @priv: Private driver interface data |
4637 | | * @addr: MAC address of the station to add |
4638 | | * @auth_alg: authentication algorithm used by the station |
4639 | | * Returns: 0 on success, -1 on failure |
4640 | | * |
4641 | | * This function adds the station node in the driver, when |
4642 | | * the station gets added by FT-over-DS. |
4643 | | */ |
4644 | | int (*add_sta_node)(void *priv, const u8 *addr, u16 auth_alg); |
4645 | | |
4646 | | /** |
4647 | | * sched_scan - Request the driver to initiate scheduled scan |
4648 | | * @priv: Private driver interface data |
4649 | | * @params: Scan parameters |
4650 | | * Returns: 0 on success, -1 on failure |
4651 | | * |
4652 | | * This operation should be used for scheduled scan offload to |
4653 | | * the hardware. Every time scan results are available, the |
4654 | | * driver should report scan results event for wpa_supplicant |
4655 | | * which will eventually request the results with |
4656 | | * wpa_driver_get_scan_results2(). This operation is optional |
4657 | | * and if not provided or if it returns -1, we fall back to |
4658 | | * normal host-scheduled scans. |
4659 | | */ |
4660 | | int (*sched_scan)(void *priv, struct wpa_driver_scan_params *params); |
4661 | | |
4662 | | /** |
4663 | | * stop_sched_scan - Request the driver to stop a scheduled scan |
4664 | | * @priv: Private driver interface data |
4665 | | * Returns: 0 on success, -1 on failure |
4666 | | * |
4667 | | * This should cause the scheduled scan to be stopped and |
4668 | | * results should stop being sent. Must be supported if |
4669 | | * sched_scan is supported. |
4670 | | */ |
4671 | | int (*stop_sched_scan)(void *priv); |
4672 | | |
4673 | | /** |
4674 | | * poll_client - Probe (null data or such) the given station |
4675 | | * @priv: Private driver interface data |
4676 | | * @own_addr: MAC address of sending interface |
4677 | | * @addr: MAC address of the station to probe |
4678 | | * @qos: Indicates whether station is QoS station |
4679 | | * |
4680 | | * This function is used to verify whether an associated station is |
4681 | | * still present. This function does not need to be implemented if the |
4682 | | * driver provides such inactivity polling mechanism. |
4683 | | */ |
4684 | | void (*poll_client)(void *priv, const u8 *own_addr, |
4685 | | const u8 *addr, int qos); |
4686 | | |
4687 | | /** |
4688 | | * radio_disable - Disable/enable radio |
4689 | | * @priv: Private driver interface data |
4690 | | * @disabled: 1=disable 0=enable radio |
4691 | | * Returns: 0 on success, -1 on failure |
4692 | | * |
4693 | | * This optional command is for testing purposes. It can be used to |
4694 | | * disable the radio on a testbed device to simulate out-of-radio-range |
4695 | | * conditions. |
4696 | | */ |
4697 | | int (*radio_disable)(void *priv, int disabled); |
4698 | | |
4699 | | /** |
4700 | | * switch_channel - Announce channel switch and migrate the GO to the |
4701 | | * given frequency |
4702 | | * @priv: Private driver interface data |
4703 | | * @settings: Settings for CSA period and new channel |
4704 | | * Returns: 0 on success, -1 on failure |
4705 | | * |
4706 | | * This function is used to move the GO to the legacy STA channel to |
4707 | | * avoid frequency conflict in single channel concurrency. |
4708 | | */ |
4709 | | int (*switch_channel)(void *priv, struct csa_settings *settings); |
4710 | | |
4711 | | /** |
4712 | | * switch_color - Announce color switch and migrate the BSS to the |
4713 | | * given color |
4714 | | * @priv: Private driver interface data |
4715 | | * @settings: Settings for CCA period and new color |
4716 | | * Returns: 0 on success, -1 on failure |
4717 | | * |
4718 | | * This function is used to move the BSS to its new color. |
4719 | | */ |
4720 | | int (*switch_color)(void *priv, struct cca_settings *settings); |
4721 | | |
4722 | | /** |
4723 | | * add_tx_ts - Add traffic stream |
4724 | | * @priv: Private driver interface data |
4725 | | * @tsid: Traffic stream ID |
4726 | | * @addr: Receiver address |
4727 | | * @user_prio: User priority of the traffic stream |
4728 | | * @admitted_time: Admitted time for this TS in units of |
4729 | | * 32 microsecond periods (per second). |
4730 | | * Returns: 0 on success, -1 on failure |
4731 | | */ |
4732 | | int (*add_tx_ts)(void *priv, u8 tsid, const u8 *addr, u8 user_prio, |
4733 | | u16 admitted_time); |
4734 | | |
4735 | | /** |
4736 | | * del_tx_ts - Delete traffic stream |
4737 | | * @priv: Private driver interface data |
4738 | | * @tsid: Traffic stream ID |
4739 | | * @addr: Receiver address |
4740 | | * Returns: 0 on success, -1 on failure |
4741 | | */ |
4742 | | int (*del_tx_ts)(void *priv, u8 tsid, const u8 *addr); |
4743 | | |
4744 | | /** |
4745 | | * Enable channel-switching with TDLS peer |
4746 | | * @priv: Private driver interface data |
4747 | | * @addr: MAC address of the TDLS peer |
4748 | | * @oper_class: Operating class of the switch channel |
4749 | | * @params: Channel specification |
4750 | | * Returns: 0 on success, -1 on failure |
4751 | | * |
4752 | | * The function indicates to driver that it can start switching to a |
4753 | | * different channel with a specified TDLS peer. The switching is |
4754 | | * assumed on until canceled with tdls_disable_channel_switch(). |
4755 | | */ |
4756 | | int (*tdls_enable_channel_switch)( |
4757 | | void *priv, const u8 *addr, u8 oper_class, |
4758 | | const struct hostapd_freq_params *params); |
4759 | | |
4760 | | /** |
4761 | | * Disable channel switching with TDLS peer |
4762 | | * @priv: Private driver interface data |
4763 | | * @addr: MAC address of the TDLS peer |
4764 | | * Returns: 0 on success, -1 on failure |
4765 | | * |
4766 | | * This function indicates to the driver that it should stop switching |
4767 | | * with a given TDLS peer. |
4768 | | */ |
4769 | | int (*tdls_disable_channel_switch)(void *priv, const u8 *addr); |
4770 | | |
4771 | | /** |
4772 | | * start_dfs_cac - Listen for radar interference on the channel |
4773 | | * @priv: Private driver interface data |
4774 | | * @freq: Channel parameters |
4775 | | * Returns: 0 on success, -1 on failure |
4776 | | */ |
4777 | | int (*start_dfs_cac)(void *priv, struct hostapd_freq_params *freq); |
4778 | | |
4779 | | /** |
4780 | | * stop_ap - Removes beacon from AP |
4781 | | * @priv: Private driver interface data |
4782 | | * @link_id: Link ID of the specified link; -1 for non-MLD |
4783 | | * Returns: 0 on success, -1 on failure (or if not supported) |
4784 | | * |
4785 | | * This optional function can be used to disable AP mode related |
4786 | | * configuration. Unlike deinit_ap, it does not change to station |
4787 | | * mode. |
4788 | | */ |
4789 | | int (*stop_ap)(void *priv, int link_id); |
4790 | | |
4791 | | /** |
4792 | | * get_survey - Retrieve survey data |
4793 | | * @priv: Private driver interface data |
4794 | | * @freq: If set, survey data for the specified frequency is only |
4795 | | * being requested. If not set, all survey data is requested. |
4796 | | * Returns: 0 on success, -1 on failure |
4797 | | * |
4798 | | * Use this to retrieve: |
4799 | | * |
4800 | | * - the observed channel noise floor |
4801 | | * - the amount of time we have spent on the channel |
4802 | | * - the amount of time during which we have spent on the channel that |
4803 | | * the radio has determined the medium is busy and we cannot |
4804 | | * transmit |
4805 | | * - the amount of time we have spent receiving data |
4806 | | * - the amount of time we have spent transmitting data |
4807 | | * |
4808 | | * This data can be used for spectrum heuristics. One example is |
4809 | | * Automatic Channel Selection (ACS). The channel survey data is |
4810 | | * kept on a linked list on the channel data, one entry is added |
4811 | | * for each survey. The min_nf of the channel is updated for each |
4812 | | * survey. |
4813 | | */ |
4814 | | int (*get_survey)(void *priv, unsigned int freq); |
4815 | | |
4816 | | /** |
4817 | | * status - Get driver interface status information |
4818 | | * @priv: Private driver interface data |
4819 | | * @buf: Buffer for printing the status information |
4820 | | * @buflen: Maximum length of the buffer |
4821 | | * Returns: Length of written status information or -1 on failure |
4822 | | */ |
4823 | | int (*status)(void *priv, char *buf, size_t buflen); |
4824 | | |
4825 | | /** |
4826 | | * roaming - Set roaming policy for driver-based BSS selection |
4827 | | * @priv: Private driver interface data |
4828 | | * @allowed: Whether roaming within ESS is allowed |
4829 | | * @bssid: Forced BSSID if roaming is disabled or %NULL if not set |
4830 | | * Returns: Length of written status information or -1 on failure |
4831 | | * |
4832 | | * This optional callback can be used to update roaming policy from the |
4833 | | * associate() command (bssid being set there indicates that the driver |
4834 | | * should not roam before getting this roaming() call to allow roaming. |
4835 | | * If the driver does not indicate WPA_DRIVER_FLAGS_BSS_SELECTION |
4836 | | * capability, roaming policy is handled within wpa_supplicant and there |
4837 | | * is no need to implement or react to this callback. |
4838 | | */ |
4839 | | int (*roaming)(void *priv, int allowed, const u8 *bssid); |
4840 | | |
4841 | | /** |
4842 | | * disable_fils - Enable/disable FILS feature |
4843 | | * @priv: Private driver interface data |
4844 | | * @disable: 0-enable and 1-disable FILS feature |
4845 | | * Returns: 0 on success, -1 on failure |
4846 | | * |
4847 | | * This callback can be used to configure driver and below layers to |
4848 | | * enable/disable all FILS features. |
4849 | | */ |
4850 | | int (*disable_fils)(void *priv, int disable); |
4851 | | |
4852 | | /** |
4853 | | * set_mac_addr - Set MAC address |
4854 | | * @priv: Private driver interface data |
4855 | | * @addr: MAC address to use or %NULL for setting back to permanent |
4856 | | * Returns: 0 on success, -1 on failure |
4857 | | */ |
4858 | | int (*set_mac_addr)(void *priv, const u8 *addr); |
4859 | | |
4860 | | #ifdef CONFIG_MACSEC |
4861 | | int (*macsec_init)(void *priv, struct macsec_init_params *params); |
4862 | | |
4863 | | int (*macsec_deinit)(void *priv); |
4864 | | |
4865 | | /** |
4866 | | * macsec_get_capability - Inform MKA of this driver's capability |
4867 | | * @priv: Private driver interface data |
4868 | | * @cap: Driver's capability |
4869 | | * Returns: 0 on success, -1 on failure |
4870 | | */ |
4871 | | int (*macsec_get_capability)(void *priv, enum macsec_cap *cap); |
4872 | | |
4873 | | /** |
4874 | | * enable_protect_frames - Set protect frames status |
4875 | | * @priv: Private driver interface data |
4876 | | * @enabled: true = protect frames enabled |
4877 | | * false = protect frames disabled |
4878 | | * Returns: 0 on success, -1 on failure (or if not supported) |
4879 | | */ |
4880 | | int (*enable_protect_frames)(void *priv, bool enabled); |
4881 | | |
4882 | | /** |
4883 | | * enable_encrypt - Set encryption status |
4884 | | * @priv: Private driver interface data |
4885 | | * @enabled: true = encrypt outgoing traffic |
4886 | | * false = integrity-only protection on outgoing traffic |
4887 | | * Returns: 0 on success, -1 on failure (or if not supported) |
4888 | | */ |
4889 | | int (*enable_encrypt)(void *priv, bool enabled); |
4890 | | |
4891 | | /** |
4892 | | * set_replay_protect - Set replay protect status and window size |
4893 | | * @priv: Private driver interface data |
4894 | | * @enabled: true = replay protect enabled |
4895 | | * false = replay protect disabled |
4896 | | * @window: replay window size, valid only when replay protect enabled |
4897 | | * Returns: 0 on success, -1 on failure (or if not supported) |
4898 | | */ |
4899 | | int (*set_replay_protect)(void *priv, bool enabled, u32 window); |
4900 | | |
4901 | | /** |
4902 | | * set_offload - Set MACsec hardware offload |
4903 | | * @priv: Private driver interface data |
4904 | | * @offload: 0 = MACSEC_OFFLOAD_OFF |
4905 | | * 1 = MACSEC_OFFLOAD_PHY |
4906 | | * 2 = MACSEC_OFFLOAD_MAC |
4907 | | * Returns: 0 on success, -1 on failure (or if not supported) |
4908 | | */ |
4909 | | int (*set_offload)(void *priv, u8 offload); |
4910 | | |
4911 | | /** |
4912 | | * set_current_cipher_suite - Set current cipher suite |
4913 | | * @priv: Private driver interface data |
4914 | | * @cs: EUI64 identifier |
4915 | | * Returns: 0 on success, -1 on failure (or if not supported) |
4916 | | */ |
4917 | | int (*set_current_cipher_suite)(void *priv, u64 cs); |
4918 | | |
4919 | | /** |
4920 | | * enable_controlled_port - Set controlled port status |
4921 | | * @priv: Private driver interface data |
4922 | | * @enabled: true = controlled port enabled |
4923 | | * false = controlled port disabled |
4924 | | * Returns: 0 on success, -1 on failure (or if not supported) |
4925 | | */ |
4926 | | int (*enable_controlled_port)(void *priv, bool enabled); |
4927 | | |
4928 | | /** |
4929 | | * get_receive_lowest_pn - Get receive lowest pn |
4930 | | * @priv: Private driver interface data |
4931 | | * @sa: secure association |
4932 | | * Returns: 0 on success, -1 on failure (or if not supported) |
4933 | | */ |
4934 | | int (*get_receive_lowest_pn)(void *priv, struct receive_sa *sa); |
4935 | | |
4936 | | /** |
4937 | | * get_transmit_next_pn - Get transmit next pn |
4938 | | * @priv: Private driver interface data |
4939 | | * @sa: secure association |
4940 | | * Returns: 0 on success, -1 on failure (or if not supported) |
4941 | | */ |
4942 | | int (*get_transmit_next_pn)(void *priv, struct transmit_sa *sa); |
4943 | | |
4944 | | /** |
4945 | | * set_transmit_next_pn - Set transmit next pn |
4946 | | * @priv: Private driver interface data |
4947 | | * @sa: secure association |
4948 | | * Returns: 0 on success, -1 on failure (or if not supported) |
4949 | | */ |
4950 | | int (*set_transmit_next_pn)(void *priv, struct transmit_sa *sa); |
4951 | | |
4952 | | /** |
4953 | | * set_receive_lowest_pn - Set receive lowest PN |
4954 | | * @priv: Private driver interface data |
4955 | | * @sa: secure association |
4956 | | * Returns: 0 on success, -1 on failure (or if not supported) |
4957 | | */ |
4958 | | int (*set_receive_lowest_pn)(void *priv, struct receive_sa *sa); |
4959 | | |
4960 | | /** |
4961 | | * create_receive_sc - create secure channel for receiving |
4962 | | * @priv: Private driver interface data |
4963 | | * @sc: secure channel |
4964 | | * @conf_offset: confidentiality offset (0, 30, or 50) |
4965 | | * @validation: frame validation policy (0 = Disabled, 1 = Checked, |
4966 | | * 2 = Strict) |
4967 | | * Returns: 0 on success, -1 on failure (or if not supported) |
4968 | | */ |
4969 | | int (*create_receive_sc)(void *priv, struct receive_sc *sc, |
4970 | | unsigned int conf_offset, |
4971 | | int validation); |
4972 | | |
4973 | | /** |
4974 | | * delete_receive_sc - delete secure connection for receiving |
4975 | | * @priv: private driver interface data from init() |
4976 | | * @sc: secure channel |
4977 | | * Returns: 0 on success, -1 on failure |
4978 | | */ |
4979 | | int (*delete_receive_sc)(void *priv, struct receive_sc *sc); |
4980 | | |
4981 | | /** |
4982 | | * create_receive_sa - create secure association for receive |
4983 | | * @priv: private driver interface data from init() |
4984 | | * @sa: secure association |
4985 | | * Returns: 0 on success, -1 on failure |
4986 | | */ |
4987 | | int (*create_receive_sa)(void *priv, struct receive_sa *sa); |
4988 | | |
4989 | | /** |
4990 | | * delete_receive_sa - Delete secure association for receive |
4991 | | * @priv: Private driver interface data from init() |
4992 | | * @sa: Secure association |
4993 | | * Returns: 0 on success, -1 on failure |
4994 | | */ |
4995 | | int (*delete_receive_sa)(void *priv, struct receive_sa *sa); |
4996 | | |
4997 | | /** |
4998 | | * enable_receive_sa - enable the SA for receive |
4999 | | * @priv: private driver interface data from init() |
5000 | | * @sa: secure association |
5001 | | * Returns: 0 on success, -1 on failure |
5002 | | */ |
5003 | | int (*enable_receive_sa)(void *priv, struct receive_sa *sa); |
5004 | | |
5005 | | /** |
5006 | | * disable_receive_sa - disable SA for receive |
5007 | | * @priv: private driver interface data from init() |
5008 | | * @sa: secure association |
5009 | | * Returns: 0 on success, -1 on failure |
5010 | | */ |
5011 | | int (*disable_receive_sa)(void *priv, struct receive_sa *sa); |
5012 | | |
5013 | | /** |
5014 | | * create_transmit_sc - create secure connection for transmit |
5015 | | * @priv: private driver interface data from init() |
5016 | | * @sc: secure channel |
5017 | | * @conf_offset: confidentiality offset (0, 30, or 50) |
5018 | | * Returns: 0 on success, -1 on failure |
5019 | | */ |
5020 | | int (*create_transmit_sc)(void *priv, struct transmit_sc *sc, |
5021 | | unsigned int conf_offset); |
5022 | | |
5023 | | /** |
5024 | | * delete_transmit_sc - delete secure connection for transmit |
5025 | | * @priv: private driver interface data from init() |
5026 | | * @sc: secure channel |
5027 | | * Returns: 0 on success, -1 on failure |
5028 | | */ |
5029 | | int (*delete_transmit_sc)(void *priv, struct transmit_sc *sc); |
5030 | | |
5031 | | /** |
5032 | | * create_transmit_sa - create secure association for transmit |
5033 | | * @priv: private driver interface data from init() |
5034 | | * @sa: secure association |
5035 | | * Returns: 0 on success, -1 on failure |
5036 | | */ |
5037 | | int (*create_transmit_sa)(void *priv, struct transmit_sa *sa); |
5038 | | |
5039 | | /** |
5040 | | * delete_transmit_sa - Delete secure association for transmit |
5041 | | * @priv: Private driver interface data from init() |
5042 | | * @sa: Secure association |
5043 | | * Returns: 0 on success, -1 on failure |
5044 | | */ |
5045 | | int (*delete_transmit_sa)(void *priv, struct transmit_sa *sa); |
5046 | | |
5047 | | /** |
5048 | | * enable_transmit_sa - enable SA for transmit |
5049 | | * @priv: private driver interface data from init() |
5050 | | * @sa: secure association |
5051 | | * Returns: 0 on success, -1 on failure |
5052 | | */ |
5053 | | int (*enable_transmit_sa)(void *priv, struct transmit_sa *sa); |
5054 | | |
5055 | | /** |
5056 | | * disable_transmit_sa - disable SA for transmit |
5057 | | * @priv: private driver interface data from init() |
5058 | | * @sa: secure association |
5059 | | * Returns: 0 on success, -1 on failure |
5060 | | */ |
5061 | | int (*disable_transmit_sa)(void *priv, struct transmit_sa *sa); |
5062 | | #endif /* CONFIG_MACSEC */ |
5063 | | |
5064 | | /** |
5065 | | * init_mesh - Driver specific initialization for mesh |
5066 | | * @priv: Private driver interface data |
5067 | | * Returns: 0 on success, -1 on failure |
5068 | | */ |
5069 | | int (*init_mesh)(void *priv); |
5070 | | |
5071 | | /** |
5072 | | * join_mesh - Join a mesh network |
5073 | | * @priv: Private driver interface data |
5074 | | * @params: Mesh configuration parameters |
5075 | | * Returns: 0 on success, -1 on failure |
5076 | | */ |
5077 | | int (*join_mesh)(void *priv, |
5078 | | struct wpa_driver_mesh_join_params *params); |
5079 | | |
5080 | | /** |
5081 | | * leave_mesh - Leave a mesh network |
5082 | | * @priv: Private driver interface data |
5083 | | * Returns 0 on success, -1 on failure |
5084 | | */ |
5085 | | int (*leave_mesh)(void *priv); |
5086 | | |
5087 | | /** |
5088 | | * probe_mesh_link - Inject a frame over direct mesh link to a given |
5089 | | * peer skipping the next_hop lookup from mpath table. |
5090 | | * @priv: Private driver interface data |
5091 | | * @addr: Peer MAC address |
5092 | | * @eth: Ethernet frame to be sent |
5093 | | * @len: Ethernet frame lengtn in bytes |
5094 | | * Returns 0 on success, -1 on failure |
5095 | | */ |
5096 | | int (*probe_mesh_link)(void *priv, const u8 *addr, const u8 *eth, |
5097 | | size_t len); |
5098 | | |
5099 | | /** |
5100 | | * do_acs - Automatically select channel |
5101 | | * @priv: Private driver interface data |
5102 | | * @params: Parameters for ACS |
5103 | | * Returns 0 on success, -1 on failure |
5104 | | * |
5105 | | * This command can be used to offload ACS to the driver if the driver |
5106 | | * indicates support for such offloading (WPA_DRIVER_FLAGS_ACS_OFFLOAD). |
5107 | | */ |
5108 | | int (*do_acs)(void *priv, struct drv_acs_params *params); |
5109 | | |
5110 | | /** |
5111 | | * set_band - Notify driver of band(s) selection |
5112 | | * @priv: Private driver interface data |
5113 | | * @band_mask: The selected band(s) bit mask (from enum set_band) |
5114 | | * Returns 0 on success, -1 on failure |
5115 | | */ |
5116 | | int (*set_band)(void *priv, u32 band_mask); |
5117 | | |
5118 | | /** |
5119 | | * get_pref_freq_list - Get preferred frequency list for an interface |
5120 | | * @priv: Private driver interface data |
5121 | | * @if_type: Interface type |
5122 | | * @num: Number of channels |
5123 | | * @freq_list: Weighted preferred channel list |
5124 | | * Returns 0 on success, -1 on failure |
5125 | | * |
5126 | | * This command can be used to query the preferred frequency list from |
5127 | | * the driver specific to a particular interface type. The freq_list |
5128 | | * array needs to have room for *num entries. *num will be updated to |
5129 | | * indicate the number of entries fetched from the driver. |
5130 | | */ |
5131 | | int (*get_pref_freq_list)(void *priv, enum wpa_driver_if_type if_type, |
5132 | | unsigned int *num, |
5133 | | struct weighted_pcl *freq_list); |
5134 | | |
5135 | | /** |
5136 | | * set_prob_oper_freq - Indicate probable P2P operating channel |
5137 | | * @priv: Private driver interface data |
5138 | | * @freq: Channel frequency in MHz |
5139 | | * Returns 0 on success, -1 on failure |
5140 | | * |
5141 | | * This command can be used to inform the driver of the operating |
5142 | | * frequency that an ongoing P2P group formation is likely to come up |
5143 | | * on. Local device is assuming P2P Client role. |
5144 | | */ |
5145 | | int (*set_prob_oper_freq)(void *priv, unsigned int freq); |
5146 | | |
5147 | | /** |
5148 | | * abort_scan - Request the driver to abort an ongoing scan |
5149 | | * @priv: Private driver interface data |
5150 | | * @scan_cookie: Cookie identifying the scan request. This is used only |
5151 | | * when the vendor interface QCA_NL80211_VENDOR_SUBCMD_TRIGGER_SCAN |
5152 | | * was used to trigger scan. Otherwise, 0 is used. |
5153 | | * Returns 0 on success, -1 on failure |
5154 | | */ |
5155 | | int (*abort_scan)(void *priv, u64 scan_cookie); |
5156 | | |
5157 | | /** |
5158 | | * configure_data_frame_filters - Request to configure frame filters |
5159 | | * @priv: Private driver interface data |
5160 | | * @filter_flags: The type of frames to filter (bitfield of |
5161 | | * WPA_DATA_FRAME_FILTER_FLAG_*) |
5162 | | * Returns: 0 on success or -1 on failure |
5163 | | */ |
5164 | | int (*configure_data_frame_filters)(void *priv, u32 filter_flags); |
5165 | | |
5166 | | /** |
5167 | | * get_ext_capab - Get extended capabilities for the specified interface |
5168 | | * @priv: Private driver interface data |
5169 | | * @type: Interface type for which to get extended capabilities |
5170 | | * @ext_capab: Extended capabilities fetched |
5171 | | * @ext_capab_mask: Extended capabilities mask |
5172 | | * @ext_capab_len: Length of the extended capabilities |
5173 | | * Returns: 0 on success or -1 on failure |
5174 | | */ |
5175 | | int (*get_ext_capab)(void *priv, enum wpa_driver_if_type type, |
5176 | | const u8 **ext_capab, const u8 **ext_capab_mask, |
5177 | | unsigned int *ext_capab_len); |
5178 | | |
5179 | | /** |
5180 | | * get_mld_capab - Get MLD capabilities for the specified interface |
5181 | | * @priv: Private driver interface data |
5182 | | * @type: Interface type for which to get MLD capabilities |
5183 | | * @eml_capa: EML capabilities |
5184 | | * @mld_capa_and_ops: MLD Capabilities and Operations |
5185 | | * Returns: 0 on success or -1 on failure |
5186 | | */ |
5187 | | int (*get_mld_capab)(void *priv, enum wpa_driver_if_type type, |
5188 | | u16 *eml_capa, u16 *mld_capa_and_ops); |
5189 | | |
5190 | | /** |
5191 | | * p2p_lo_start - Start offloading P2P listen to device |
5192 | | * @priv: Private driver interface data |
5193 | | * @freq: Listening frequency (MHz) for P2P listen |
5194 | | * @period: Length of the listen operation in milliseconds |
5195 | | * @interval: Interval for running the listen operation in milliseconds |
5196 | | * @count: Number of times to run the listen operation |
5197 | | * @device_types: Device primary and secondary types |
5198 | | * @dev_types_len: Number of bytes for device_types |
5199 | | * @ies: P2P IE and WSC IE for Probe Response frames |
5200 | | * @ies_len: Length of ies in bytes |
5201 | | * Returns: 0 on success or -1 on failure |
5202 | | */ |
5203 | | int (*p2p_lo_start)(void *priv, unsigned int freq, |
5204 | | unsigned int period, unsigned int interval, |
5205 | | unsigned int count, |
5206 | | const u8 *device_types, size_t dev_types_len, |
5207 | | const u8 *ies, size_t ies_len); |
5208 | | |
5209 | | /** |
5210 | | * p2p_lo_stop - Stop P2P listen offload |
5211 | | * @priv: Private driver interface data |
5212 | | * Returns: 0 on success or -1 on failure |
5213 | | */ |
5214 | | int (*p2p_lo_stop)(void *priv); |
5215 | | |
5216 | | /** |
5217 | | * set_default_scan_ies - Set default scan IEs |
5218 | | * @priv: Private driver interface data |
5219 | | * @ies: Scan default IEs buffer |
5220 | | * @ies_len: Length of IEs in bytes |
5221 | | * Returns: 0 on success or -1 on failure |
5222 | | * |
5223 | | * The driver can use these by default when there are no scan IEs coming |
5224 | | * in the subsequent scan requests. Also in case of one or more of IEs |
5225 | | * given in set_default_scan_ies() are missing in the subsequent scan |
5226 | | * request, the driver should merge the missing scan IEs in the scan |
5227 | | * request from the IEs set by set_default_scan_ies() in the Probe |
5228 | | * Request frames sent. |
5229 | | */ |
5230 | | int (*set_default_scan_ies)(void *priv, const u8 *ies, size_t ies_len); |
5231 | | |
5232 | | /** |
5233 | | * set_tdls_mode - Set TDLS trigger mode to the host driver |
5234 | | * @priv: Private driver interface data |
5235 | | * @tdls_external_control: Represents if TDLS external trigger control |
5236 | | * mode is enabled/disabled. |
5237 | | * |
5238 | | * This optional callback can be used to configure the TDLS external |
5239 | | * trigger control mode to the host driver. |
5240 | | */ |
5241 | | int (*set_tdls_mode)(void *priv, int tdls_external_control); |
5242 | | |
5243 | | /** |
5244 | | * get_bss_transition_status - Get candidate BSS's transition status |
5245 | | * @priv: Private driver interface data |
5246 | | * @params: Candidate BSS list |
5247 | | * |
5248 | | * Get the accept or reject reason code for a list of BSS transition |
5249 | | * candidates. |
5250 | | */ |
5251 | | struct wpa_bss_candidate_info * |
5252 | | (*get_bss_transition_status)(void *priv, |
5253 | | struct wpa_bss_trans_info *params); |
5254 | | /** |
5255 | | * ignore_assoc_disallow - Configure driver to ignore assoc_disallow |
5256 | | * @priv: Private driver interface data |
5257 | | * @ignore_disallow: 0 to not ignore, 1 to ignore |
5258 | | * Returns: 0 on success, -1 on failure |
5259 | | */ |
5260 | | int (*ignore_assoc_disallow)(void *priv, int ignore_disallow); |
5261 | | |
5262 | | /** |
5263 | | * set_bssid_tmp_disallow - Set disallowed BSSIDs to the driver |
5264 | | * @priv: Private driver interface data |
5265 | | * @num_bssid: Number of temporarily disallowed BSSIDs |
5266 | | * @bssids: List of temporarily disallowed BSSIDs |
5267 | | */ |
5268 | | int (*set_bssid_tmp_disallow)(void *priv, unsigned int num_bssid, |
5269 | | const u8 *bssid); |
5270 | | |
5271 | | /** |
5272 | | * update_connect_params - Update the connection parameters |
5273 | | * @priv: Private driver interface data |
5274 | | * @params: Association parameters |
5275 | | * @mask: Bit mask indicating which parameters in @params have to be |
5276 | | * updated |
5277 | | * Returns: 0 on success, -1 on failure |
5278 | | * |
5279 | | * Update the connection parameters when in connected state so that the |
5280 | | * driver uses the updated parameters for subsequent roaming. This is |
5281 | | * used only with drivers that implement internal BSS selection and |
5282 | | * roaming. |
5283 | | */ |
5284 | | int (*update_connect_params)( |
5285 | | void *priv, struct wpa_driver_associate_params *params, |
5286 | | enum wpa_drv_update_connect_params_mask mask); |
5287 | | |
5288 | | /** |
5289 | | * send_external_auth_status - Indicate the status of external |
5290 | | * authentication processing to the host driver. |
5291 | | * @priv: Private driver interface data |
5292 | | * @params: Status of authentication processing. |
5293 | | * Returns: 0 on success, -1 on failure |
5294 | | */ |
5295 | | int (*send_external_auth_status)(void *priv, |
5296 | | struct external_auth *params); |
5297 | | |
5298 | | /** |
5299 | | * set_4addr_mode - Set 4-address mode |
5300 | | * @priv: Private driver interface data |
5301 | | * @bridge_ifname: Bridge interface name |
5302 | | * @val: 0 - disable 4addr mode, 1 - enable 4addr mode |
5303 | | * Returns: 0 on success, < 0 on failure |
5304 | | */ |
5305 | | int (*set_4addr_mode)(void *priv, const char *bridge_ifname, int val); |
5306 | | |
5307 | | /** |
5308 | | * update_dh_ie - Update DH IE |
5309 | | * @priv: Private driver interface data |
5310 | | * @peer_mac: Peer MAC address |
5311 | | * @reason_code: Reacon code |
5312 | | * @ie: DH IE |
5313 | | * @ie_len: DH IE length in bytes |
5314 | | * Returns: 0 on success, -1 on failure |
5315 | | * |
5316 | | * This callback is used to let the driver know the DH processing result |
5317 | | * and DH IE for a pending association. |
5318 | | */ |
5319 | | int (*update_dh_ie)(void *priv, const u8 *peer_mac, u16 reason_code, |
5320 | | const u8 *ie, size_t ie_len); |
5321 | | |
5322 | | /** |
5323 | | * dpp_listen - Notify driver about start/stop of DPP listen |
5324 | | * @priv: Private driver interface data |
5325 | | * @enable: Whether listen state is enabled (or disabled) |
5326 | | * Returns: 0 on success, -1 on failure |
5327 | | * |
5328 | | * This optional callback can be used to update RX frame filtering to |
5329 | | * explicitly allow reception of broadcast Public Action frames. |
5330 | | */ |
5331 | | int (*dpp_listen)(void *priv, bool enable); |
5332 | | |
5333 | | /** |
5334 | | * set_secure_ranging_ctx - Add or delete secure ranging parameters of |
5335 | | * the specified peer to the driver. |
5336 | | * @priv: Private driver interface data |
5337 | | * @params: Secure ranging parameters |
5338 | | * Returns: 0 on success, -1 on failure |
5339 | | * |
5340 | | */ |
5341 | | int (*set_secure_ranging_ctx)(void *priv, |
5342 | | struct secure_ranging_params *params); |
5343 | | |
5344 | | /** |
5345 | | * send_pasn_resp - Send PASN response for a set of peers to the |
5346 | | * driver. |
5347 | | * @priv: Private driver interface data |
5348 | | * @params: Parameters holding peers and respective status. |
5349 | | * Returns: 0 on success, -1 on failure |
5350 | | */ |
5351 | | int (*send_pasn_resp)(void *priv, struct pasn_auth *params); |
5352 | | |
5353 | | /** |
5354 | | * get_sta_mlo_info - Get the current multi-link association info |
5355 | | * @priv: Private driver interface data |
5356 | | * @mlo: Pointer to fill multi-link association info |
5357 | | * Returns: 0 on success, -1 on failure |
5358 | | * |
5359 | | * This callback is used to fetch multi-link of the current association. |
5360 | | */ |
5361 | | int (*get_sta_mlo_info)(void *priv, |
5362 | | struct driver_sta_mlo_info *mlo_info); |
5363 | | |
5364 | | /** |
5365 | | * link_add - Add a link to the AP MLD interface |
5366 | | * @priv: Private driver interface data |
5367 | | * @link_id: The link ID |
5368 | | * @addr: The MAC address to use for the link |
5369 | | * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces |
5370 | | * Returns: 0 on success, negative value on failure |
5371 | | */ |
5372 | | int (*link_add)(void *priv, u8 link_id, const u8 *addr, void *bss_ctx); |
5373 | | |
5374 | | /** |
5375 | | * link_remove - Remove a link from the AP MLD interface |
5376 | | * @priv: Private driver interface data |
5377 | | * @type: Interface type |
5378 | | * @ifname: Interface name of the virtual interface from where the link |
5379 | | * is to be removed. |
5380 | | * @link_id: Valid link ID to remove |
5381 | | * Returns: 0 on success, -1 on failure |
5382 | | */ |
5383 | | int (*link_remove)(void *priv, enum wpa_driver_if_type type, |
5384 | | const char *ifname, u8 link_id); |
5385 | | |
5386 | | /** |
5387 | | * is_drv_shared - Check whether the driver interface is shared |
5388 | | * @priv: Private driver interface data from init() |
5389 | | * @link_id: Link ID to match |
5390 | | * Returns: true if it is being used or else false. |
5391 | | * |
5392 | | * Checks whether the driver interface is being used by other partner |
5393 | | * BSS(s) or not. This is used to decide whether the driver interface |
5394 | | * needs to be deinitilized when one interface is getting deinitialized. |
5395 | | * |
5396 | | * NOTE: @link_id will be used only when there is only one BSS |
5397 | | * present and if that single link is active. In that case, the |
5398 | | * link ID is matched with the active link_id to decide whether the |
5399 | | * driver interface is being used by other partner BSS(s). |
5400 | | */ |
5401 | | bool (*is_drv_shared)(void *priv, int link_id); |
5402 | | |
5403 | | /** |
5404 | | * link_sta_remove - Remove a link STA from an MLD STA |
5405 | | * @priv: Private driver interface data |
5406 | | * @link_id: The link ID which the link STA is using |
5407 | | * @addr: The MLD MAC address of the MLD STA |
5408 | | * Returns: 0 on success, negative value on failure |
5409 | | */ |
5410 | | int (*link_sta_remove)(void *priv, u8 link_id, const u8 *addr); |
5411 | | |
5412 | | /** |
5413 | | * nan_flush - Flush all NAN offload services |
5414 | | * @priv: Private driver interface data |
5415 | | * Returns: 0 on success, negative value on failure |
5416 | | */ |
5417 | | int (*nan_flush)(void *priv); |
5418 | | |
5419 | | /** |
5420 | | * nan_publish - NAN offload for Publish() |
5421 | | * @priv: Private driver interface data |
5422 | | * @src: Source P2P device addr |
5423 | | * @publish_id: Publish instance to add |
5424 | | * @service_name: Service name |
5425 | | * @service_id: Service ID (6 octet value derived from service name) |
5426 | | * @srv_proto_type: Service protocol type |
5427 | | * @ssi: Service specific information or %NULL |
5428 | | * @elems: Information elements for Element Container attribute or %NULL |
5429 | | * @params: Configuration parameters |
5430 | | * Returns: 0 on success, negative value on failure |
5431 | | */ |
5432 | | int (*nan_publish)(void *priv, const u8 *src, int publish_id, |
5433 | | const char *service_name, const u8 *service_id, |
5434 | | enum nan_service_protocol_type srv_proto_type, |
5435 | | const struct wpabuf *ssi, const struct wpabuf *elems, |
5436 | | struct nan_publish_params *params); |
5437 | | |
5438 | | /** |
5439 | | * nan_cancel_publish - NAN offload for CancelPublish() |
5440 | | * @priv: Private driver interface data |
5441 | | * @publish_id: Publish instance to cancel |
5442 | | * Returns: 0 on success, negative value on failure |
5443 | | */ |
5444 | | int (*nan_cancel_publish)(void *priv, int publish_id); |
5445 | | |
5446 | | /** |
5447 | | * nan_update_publish - NAN offload for UpdatePublish() |
5448 | | * @priv: Private driver interface data |
5449 | | * @ssi: Service specific information or %NULL |
5450 | | * Returns: 0 on success, negative value on failure |
5451 | | */ |
5452 | | int (*nan_update_publish)(void *priv, int publish_id, |
5453 | | const struct wpabuf *ssi); |
5454 | | |
5455 | | /** |
5456 | | * nan_subscribe - NAN offload for Subscribe() |
5457 | | * @priv: Private driver interface data |
5458 | | * @src: Source P2P device addr |
5459 | | * @subscribe_id: Subscribe instance to add |
5460 | | * @service_name: Service name |
5461 | | * @service_id: Service ID (6 octet value derived from service name) |
5462 | | * @srv_proto_type: Service protocol type |
5463 | | * @ssi: Service specific information or %NULL |
5464 | | * @elems: Information elements for Element Container attribute or %NULL |
5465 | | * @params: Configuration parameters |
5466 | | * Returns: 0 on success, negative value on failure |
5467 | | */ |
5468 | | int (*nan_subscribe)(void *priv, const u8 *src, int subscribe_id, |
5469 | | const char *service_name, const u8 *service_id, |
5470 | | enum nan_service_protocol_type srv_proto_type, |
5471 | | const struct wpabuf *ssi, |
5472 | | const struct wpabuf *elems, |
5473 | | struct nan_subscribe_params *params); |
5474 | | |
5475 | | /** |
5476 | | * nan_cancel_subscribe - NAN offload for CancelSubscribe() |
5477 | | * @priv: Private driver interface data |
5478 | | * @subscribe_id: Subscribe instance to cancel |
5479 | | * Returns: 0 on success, negative value on failure |
5480 | | */ |
5481 | | int (*nan_cancel_subscribe)(void *priv, int subscribe_id); |
5482 | | |
5483 | | /** |
5484 | | * can_share_drv - Check whether driver interface can be shared |
5485 | | * @ctx: Pointer to hostapd context |
5486 | | * @params: Configuration for the driver wrapper |
5487 | | * @hapd: Pointer for overwriting the hapd context or %NULL |
5488 | | * if can't find a shared drv |
5489 | | * |
5490 | | * Checks whether the driver interface with same phy name is |
5491 | | * already present under the global driver which can be shared |
5492 | | * instead of creating a new driver interface instance. If present, |
5493 | | * @hapd will be overwritten with the hapd pointer which this shared |
5494 | | * drv's first BSS is using. This will help the caller to later call |
5495 | | * if_add(). |
5496 | | * |
5497 | | * Returns: true if it can be shared or else false. |
5498 | | */ |
5499 | | bool (*can_share_drv)(void *ctx, struct wpa_init_params *params, |
5500 | | void **hapd); |
5501 | | |
5502 | | #ifdef CONFIG_TESTING_OPTIONS |
5503 | | int (*register_frame)(void *priv, u16 type, |
5504 | | const u8 *match, size_t match_len, |
5505 | | bool multicast); |
5506 | | #endif /* CONFIG_TESTING_OPTIONS */ |
5507 | | |
5508 | | /** |
5509 | | * get_multi_hw_info - Get multiple underlying hardware information |
5510 | | * (hardware IDx and supported frequency range) |
5511 | | * @priv: Private driver interface data |
5512 | | * @num_multi_hws: Variable for returning the number of returned |
5513 | | * hardware info data |
5514 | | * Returns: Pointer to allocated multiple hardware data on success |
5515 | | * or %NULL on failure. Caller is responsible for freeing this. |
5516 | | */ |
5517 | | struct hostapd_multi_hw_info * |
5518 | | (*get_multi_hw_info)(void *priv, unsigned int *num_multi_hws); |
5519 | | }; |
5520 | | |
5521 | | /** |
5522 | | * enum wpa_event_type - Event type for wpa_supplicant_event() calls |
5523 | | */ |
5524 | | enum wpa_event_type { |
5525 | | /** |
5526 | | * EVENT_ASSOC - Association completed |
5527 | | * |
5528 | | * This event needs to be delivered when the driver completes IEEE |
5529 | | * 802.11 association or reassociation successfully. |
5530 | | * wpa_driver_ops::get_bssid() is expected to provide the current BSSID |
5531 | | * after this event has been generated. In addition, optional |
5532 | | * EVENT_ASSOCINFO may be generated just before EVENT_ASSOC to provide |
5533 | | * more information about the association. If the driver interface gets |
5534 | | * both of these events at the same time, it can also include the |
5535 | | * assoc_info data in EVENT_ASSOC call. |
5536 | | */ |
5537 | | EVENT_ASSOC, |
5538 | | |
5539 | | /** |
5540 | | * EVENT_DISASSOC - Association lost |
5541 | | * |
5542 | | * This event should be called when association is lost either due to |
5543 | | * receiving deauthenticate or disassociate frame from the AP or when |
5544 | | * sending either of these frames to the current AP. If the driver |
5545 | | * supports separate deauthentication event, EVENT_DISASSOC should only |
5546 | | * be used for disassociation and EVENT_DEAUTH for deauthentication. |
5547 | | * In AP mode, union wpa_event_data::disassoc_info is required. |
5548 | | */ |
5549 | | EVENT_DISASSOC, |
5550 | | |
5551 | | /** |
5552 | | * EVENT_MICHAEL_MIC_FAILURE - Michael MIC (TKIP) detected |
5553 | | * |
5554 | | * This event must be delivered when a Michael MIC error is detected by |
5555 | | * the local driver. Additional data for event processing is |
5556 | | * provided with union wpa_event_data::michael_mic_failure. This |
5557 | | * information is used to request new encryption key and to initiate |
5558 | | * TKIP countermeasures if needed. |
5559 | | */ |
5560 | | EVENT_MICHAEL_MIC_FAILURE, |
5561 | | |
5562 | | /** |
5563 | | * EVENT_SCAN_RESULTS - Scan results available |
5564 | | * |
5565 | | * This event must be called whenever scan results are available to be |
5566 | | * fetched with struct wpa_driver_ops::get_scan_results(). This event |
5567 | | * is expected to be used some time after struct wpa_driver_ops::scan() |
5568 | | * is called. If the driver provides an unsolicited event when the scan |
5569 | | * has been completed, this event can be used to trigger |
5570 | | * EVENT_SCAN_RESULTS call. If such event is not available from the |
5571 | | * driver, the driver wrapper code is expected to use a registered |
5572 | | * timeout to generate EVENT_SCAN_RESULTS call after the time that the |
5573 | | * scan is expected to be completed. Optional information about |
5574 | | * completed scan can be provided with union wpa_event_data::scan_info. |
5575 | | */ |
5576 | | EVENT_SCAN_RESULTS, |
5577 | | |
5578 | | /** |
5579 | | * EVENT_ASSOCINFO - Report optional extra information for association |
5580 | | * |
5581 | | * This event can be used to report extra association information for |
5582 | | * EVENT_ASSOC processing. This extra information includes IEs from |
5583 | | * association frames and Beacon/Probe Response frames in union |
5584 | | * wpa_event_data::assoc_info. EVENT_ASSOCINFO must be send just before |
5585 | | * EVENT_ASSOC. Alternatively, the driver interface can include |
5586 | | * assoc_info data in the EVENT_ASSOC call if it has all the |
5587 | | * information available at the same point. |
5588 | | */ |
5589 | | EVENT_ASSOCINFO, |
5590 | | |
5591 | | /** |
5592 | | * EVENT_INTERFACE_STATUS - Report interface status changes |
5593 | | * |
5594 | | * This optional event can be used to report changes in interface |
5595 | | * status (interface added/removed) using union |
5596 | | * wpa_event_data::interface_status. This can be used to trigger |
5597 | | * wpa_supplicant to stop and re-start processing for the interface, |
5598 | | * e.g., when a cardbus card is ejected/inserted. |
5599 | | */ |
5600 | | EVENT_INTERFACE_STATUS, |
5601 | | |
5602 | | /** |
5603 | | * EVENT_PMKID_CANDIDATE - Report a candidate AP for pre-authentication |
5604 | | * |
5605 | | * This event can be used to inform wpa_supplicant about candidates for |
5606 | | * RSN (WPA2) pre-authentication. If wpa_supplicant is not responsible |
5607 | | * for scan request (ap_scan=2 mode), this event is required for |
5608 | | * pre-authentication. If wpa_supplicant is performing scan request |
5609 | | * (ap_scan=1), this event is optional since scan results can be used |
5610 | | * to add pre-authentication candidates. union |
5611 | | * wpa_event_data::pmkid_candidate is used to report the BSSID of the |
5612 | | * candidate and priority of the candidate, e.g., based on the signal |
5613 | | * strength, in order to try to pre-authenticate first with candidates |
5614 | | * that are most likely targets for re-association. |
5615 | | * |
5616 | | * EVENT_PMKID_CANDIDATE can be called whenever the driver has updates |
5617 | | * on the candidate list. In addition, it can be called for the current |
5618 | | * AP and APs that have existing PMKSA cache entries. wpa_supplicant |
5619 | | * will automatically skip pre-authentication in cases where a valid |
5620 | | * PMKSA exists. When more than one candidate exists, this event should |
5621 | | * be generated once for each candidate. |
5622 | | * |
5623 | | * Driver will be notified about successful pre-authentication with |
5624 | | * struct wpa_driver_ops::add_pmkid() calls. |
5625 | | */ |
5626 | | EVENT_PMKID_CANDIDATE, |
5627 | | |
5628 | | /** |
5629 | | * EVENT_TDLS - Request TDLS operation |
5630 | | * |
5631 | | * This event can be used to request a TDLS operation to be performed. |
5632 | | */ |
5633 | | EVENT_TDLS, |
5634 | | |
5635 | | /** |
5636 | | * EVENT_FT_RESPONSE - Report FT (IEEE 802.11r) response IEs |
5637 | | * |
5638 | | * The driver is expected to report the received FT IEs from |
5639 | | * FT authentication sequence from the AP. The FT IEs are included in |
5640 | | * the extra information in union wpa_event_data::ft_ies. |
5641 | | */ |
5642 | | EVENT_FT_RESPONSE, |
5643 | | |
5644 | | /** |
5645 | | * EVENT_IBSS_RSN_START - Request RSN authentication in IBSS |
5646 | | * |
5647 | | * The driver can use this event to inform wpa_supplicant about a STA |
5648 | | * in an IBSS with which protected frames could be exchanged. This |
5649 | | * event starts RSN authentication with the other STA to authenticate |
5650 | | * the STA and set up encryption keys with it. |
5651 | | */ |
5652 | | EVENT_IBSS_RSN_START, |
5653 | | |
5654 | | /** |
5655 | | * EVENT_AUTH - Authentication result |
5656 | | * |
5657 | | * This event should be called when authentication attempt has been |
5658 | | * completed. This is only used if the driver supports separate |
5659 | | * authentication step (struct wpa_driver_ops::authenticate). |
5660 | | * Information about authentication result is included in |
5661 | | * union wpa_event_data::auth. |
5662 | | */ |
5663 | | EVENT_AUTH, |
5664 | | |
5665 | | /** |
5666 | | * EVENT_DEAUTH - Authentication lost |
5667 | | * |
5668 | | * This event should be called when authentication is lost either due |
5669 | | * to receiving deauthenticate frame from the AP or when sending that |
5670 | | * frame to the current AP. |
5671 | | * In AP mode, union wpa_event_data::deauth_info is required. |
5672 | | */ |
5673 | | EVENT_DEAUTH, |
5674 | | |
5675 | | /** |
5676 | | * EVENT_ASSOC_REJECT - Association rejected |
5677 | | * |
5678 | | * This event should be called when (re)association attempt has been |
5679 | | * rejected by the AP. Information about the association response is |
5680 | | * included in union wpa_event_data::assoc_reject. |
5681 | | */ |
5682 | | EVENT_ASSOC_REJECT, |
5683 | | |
5684 | | /** |
5685 | | * EVENT_AUTH_TIMED_OUT - Authentication timed out |
5686 | | */ |
5687 | | EVENT_AUTH_TIMED_OUT, |
5688 | | |
5689 | | /** |
5690 | | * EVENT_ASSOC_TIMED_OUT - Association timed out |
5691 | | */ |
5692 | | EVENT_ASSOC_TIMED_OUT, |
5693 | | |
5694 | | /** |
5695 | | * EVENT_WPS_BUTTON_PUSHED - Report hardware push button press for WPS |
5696 | | */ |
5697 | | EVENT_WPS_BUTTON_PUSHED, |
5698 | | |
5699 | | /** |
5700 | | * EVENT_TX_STATUS - Report TX status |
5701 | | */ |
5702 | | EVENT_TX_STATUS, |
5703 | | |
5704 | | /** |
5705 | | * EVENT_RX_FROM_UNKNOWN - Report RX from unknown STA |
5706 | | */ |
5707 | | EVENT_RX_FROM_UNKNOWN, |
5708 | | |
5709 | | /** |
5710 | | * EVENT_RX_MGMT - Report RX of a management frame |
5711 | | */ |
5712 | | EVENT_RX_MGMT, |
5713 | | |
5714 | | /** |
5715 | | * EVENT_REMAIN_ON_CHANNEL - Remain-on-channel duration started |
5716 | | * |
5717 | | * This event is used to indicate when the driver has started the |
5718 | | * requested remain-on-channel duration. Information about the |
5719 | | * operation is included in union wpa_event_data::remain_on_channel. |
5720 | | */ |
5721 | | EVENT_REMAIN_ON_CHANNEL, |
5722 | | |
5723 | | /** |
5724 | | * EVENT_CANCEL_REMAIN_ON_CHANNEL - Remain-on-channel timed out |
5725 | | * |
5726 | | * This event is used to indicate when the driver has completed |
5727 | | * remain-on-channel duration, i.e., may noot be available on the |
5728 | | * requested channel anymore. Information about the |
5729 | | * operation is included in union wpa_event_data::remain_on_channel. |
5730 | | */ |
5731 | | EVENT_CANCEL_REMAIN_ON_CHANNEL, |
5732 | | |
5733 | | /** |
5734 | | * EVENT_RX_PROBE_REQ - Indicate received Probe Request frame |
5735 | | * |
5736 | | * This event is used to indicate when a Probe Request frame has been |
5737 | | * received. Information about the received frame is included in |
5738 | | * union wpa_event_data::rx_probe_req. The driver is required to report |
5739 | | * these events only after successfully completed probe_req_report() |
5740 | | * commands to request the events (i.e., report parameter is non-zero) |
5741 | | * in station mode. In AP mode, Probe Request frames should always be |
5742 | | * reported. |
5743 | | */ |
5744 | | EVENT_RX_PROBE_REQ, |
5745 | | |
5746 | | /** |
5747 | | * EVENT_NEW_STA - New wired device noticed |
5748 | | * |
5749 | | * This event is used to indicate that a new device has been detected |
5750 | | * in a network that does not use association-like functionality (i.e., |
5751 | | * mainly wired Ethernet). This can be used to start EAPOL |
5752 | | * authenticator when receiving a frame from a device. The address of |
5753 | | * the device is included in union wpa_event_data::new_sta. |
5754 | | */ |
5755 | | EVENT_NEW_STA, |
5756 | | |
5757 | | /** |
5758 | | * EVENT_EAPOL_RX - Report received EAPOL frame |
5759 | | * |
5760 | | * When in AP mode with hostapd, this event is required to be used to |
5761 | | * deliver the receive EAPOL frames from the driver. |
5762 | | */ |
5763 | | EVENT_EAPOL_RX, |
5764 | | |
5765 | | /** |
5766 | | * EVENT_SIGNAL_CHANGE - Indicate change in signal strength |
5767 | | * |
5768 | | * This event is used to indicate changes in the signal strength |
5769 | | * observed in frames received from the current AP if signal strength |
5770 | | * monitoring has been enabled with signal_monitor(). |
5771 | | */ |
5772 | | EVENT_SIGNAL_CHANGE, |
5773 | | |
5774 | | /** |
5775 | | * EVENT_INTERFACE_ENABLED - Notify that interface was enabled |
5776 | | * |
5777 | | * This event is used to indicate that the interface was enabled after |
5778 | | * having been previously disabled, e.g., due to rfkill. |
5779 | | */ |
5780 | | EVENT_INTERFACE_ENABLED, |
5781 | | |
5782 | | /** |
5783 | | * EVENT_INTERFACE_DISABLED - Notify that interface was disabled |
5784 | | * |
5785 | | * This event is used to indicate that the interface was disabled, |
5786 | | * e.g., due to rfkill. |
5787 | | */ |
5788 | | EVENT_INTERFACE_DISABLED, |
5789 | | |
5790 | | /** |
5791 | | * EVENT_CHANNEL_LIST_CHANGED - Channel list changed |
5792 | | * |
5793 | | * This event is used to indicate that the channel list has changed, |
5794 | | * e.g., because of a regulatory domain change triggered by scan |
5795 | | * results including an AP advertising a country code. |
5796 | | */ |
5797 | | EVENT_CHANNEL_LIST_CHANGED, |
5798 | | |
5799 | | /** |
5800 | | * EVENT_INTERFACE_UNAVAILABLE - Notify that interface is unavailable |
5801 | | * |
5802 | | * This event is used to indicate that the driver cannot maintain this |
5803 | | * interface in its operation mode anymore. The most likely use for |
5804 | | * this is to indicate that AP mode operation is not available due to |
5805 | | * operating channel would need to be changed to a DFS channel when |
5806 | | * the driver does not support radar detection and another virtual |
5807 | | * interfaces caused the operating channel to change. Other similar |
5808 | | * resource conflicts could also trigger this for station mode |
5809 | | * interfaces. This event can be propagated when channel switching |
5810 | | * fails. |
5811 | | */ |
5812 | | EVENT_INTERFACE_UNAVAILABLE, |
5813 | | |
5814 | | /** |
5815 | | * EVENT_BEST_CHANNEL |
5816 | | * |
5817 | | * Driver generates this event whenever it detects a better channel |
5818 | | * (e.g., based on RSSI or channel use). This information can be used |
5819 | | * to improve channel selection for a new AP/P2P group. |
5820 | | */ |
5821 | | EVENT_BEST_CHANNEL, |
5822 | | |
5823 | | /** |
5824 | | * EVENT_UNPROT_DEAUTH - Unprotected Deauthentication frame received |
5825 | | * |
5826 | | * This event should be called when a Deauthentication frame is dropped |
5827 | | * due to it not being protected (MFP/IEEE 802.11w). |
5828 | | * union wpa_event_data::unprot_deauth is required to provide more |
5829 | | * details of the frame. |
5830 | | */ |
5831 | | EVENT_UNPROT_DEAUTH, |
5832 | | |
5833 | | /** |
5834 | | * EVENT_UNPROT_DISASSOC - Unprotected Disassociation frame received |
5835 | | * |
5836 | | * This event should be called when a Disassociation frame is dropped |
5837 | | * due to it not being protected (MFP/IEEE 802.11w). |
5838 | | * union wpa_event_data::unprot_disassoc is required to provide more |
5839 | | * details of the frame. |
5840 | | */ |
5841 | | EVENT_UNPROT_DISASSOC, |
5842 | | |
5843 | | /** |
5844 | | * EVENT_STATION_LOW_ACK |
5845 | | * |
5846 | | * Driver generates this event whenever it detected that a particular |
5847 | | * station was lost. Detection can be through massive transmission |
5848 | | * failures for example. |
5849 | | */ |
5850 | | EVENT_STATION_LOW_ACK, |
5851 | | |
5852 | | /** |
5853 | | * EVENT_IBSS_PEER_LOST - IBSS peer not reachable anymore |
5854 | | */ |
5855 | | EVENT_IBSS_PEER_LOST, |
5856 | | |
5857 | | /** |
5858 | | * EVENT_DRIVER_GTK_REKEY - Device/driver did GTK rekey |
5859 | | * |
5860 | | * This event carries the new replay counter to notify wpa_supplicant |
5861 | | * of the current EAPOL-Key Replay Counter in case the driver/firmware |
5862 | | * completed Group Key Handshake while the host (including |
5863 | | * wpa_supplicant was sleeping). |
5864 | | */ |
5865 | | EVENT_DRIVER_GTK_REKEY, |
5866 | | |
5867 | | /** |
5868 | | * EVENT_SCHED_SCAN_STOPPED - Scheduled scan was stopped |
5869 | | */ |
5870 | | EVENT_SCHED_SCAN_STOPPED, |
5871 | | |
5872 | | /** |
5873 | | * EVENT_DRIVER_CLIENT_POLL_OK - Station responded to poll |
5874 | | * |
5875 | | * This event indicates that the station responded to the poll |
5876 | | * initiated with @poll_client. |
5877 | | */ |
5878 | | EVENT_DRIVER_CLIENT_POLL_OK, |
5879 | | |
5880 | | /** |
5881 | | * EVENT_EAPOL_TX_STATUS - notify of EAPOL TX status |
5882 | | */ |
5883 | | EVENT_EAPOL_TX_STATUS, |
5884 | | |
5885 | | /** |
5886 | | * EVENT_CH_SWITCH - AP or GO decided to switch channels |
5887 | | * |
5888 | | * Described in wpa_event_data.ch_switch |
5889 | | * */ |
5890 | | EVENT_CH_SWITCH, |
5891 | | |
5892 | | /** |
5893 | | * EVENT_CH_SWITCH_STARTED - AP or GO started to switch channels |
5894 | | * |
5895 | | * This is a pre-switch event indicating the shortly following switch |
5896 | | * of operating channels. |
5897 | | * |
5898 | | * Described in wpa_event_data.ch_switch |
5899 | | */ |
5900 | | EVENT_CH_SWITCH_STARTED, |
5901 | | /** |
5902 | | * EVENT_WNM - Request WNM operation |
5903 | | * |
5904 | | * This event can be used to request a WNM operation to be performed. |
5905 | | */ |
5906 | | EVENT_WNM, |
5907 | | |
5908 | | /** |
5909 | | * EVENT_CONNECT_FAILED_REASON - Connection failure reason in AP mode |
5910 | | * |
5911 | | * This event indicates that the driver reported a connection failure |
5912 | | * with the specified client (for example, max client reached, etc.) in |
5913 | | * AP mode. |
5914 | | */ |
5915 | | EVENT_CONNECT_FAILED_REASON, |
5916 | | |
5917 | | /** |
5918 | | * EVENT_DFS_RADAR_DETECTED - Notify of radar detection |
5919 | | * |
5920 | | * A radar has been detected on the supplied frequency, hostapd should |
5921 | | * react accordingly (e.g., change channel). |
5922 | | */ |
5923 | | EVENT_DFS_RADAR_DETECTED, |
5924 | | |
5925 | | /** |
5926 | | * EVENT_DFS_CAC_FINISHED - Notify that channel availability check has been completed |
5927 | | * |
5928 | | * After a successful CAC, the channel can be marked clear and used. |
5929 | | */ |
5930 | | EVENT_DFS_CAC_FINISHED, |
5931 | | |
5932 | | /** |
5933 | | * EVENT_DFS_CAC_ABORTED - Notify that channel availability check has been aborted |
5934 | | * |
5935 | | * The CAC was not successful, and the channel remains in the previous |
5936 | | * state. This may happen due to a radar being detected or other |
5937 | | * external influences. |
5938 | | */ |
5939 | | EVENT_DFS_CAC_ABORTED, |
5940 | | |
5941 | | /** |
5942 | | * EVENT_DFS_NOP_FINISHED - Notify that non-occupancy period is over |
5943 | | * |
5944 | | * The channel which was previously unavailable is now available again. |
5945 | | */ |
5946 | | EVENT_DFS_NOP_FINISHED, |
5947 | | |
5948 | | /** |
5949 | | * EVENT_SURVEY - Received survey data |
5950 | | * |
5951 | | * This event gets triggered when a driver query is issued for survey |
5952 | | * data and the requested data becomes available. The returned data is |
5953 | | * stored in struct survey_results. The results provide at most one |
5954 | | * survey entry for each frequency and at minimum will provide one |
5955 | | * survey entry for one frequency. The survey data can be os_malloc()'d |
5956 | | * and then os_free()'d, so the event callback must only copy data. |
5957 | | */ |
5958 | | EVENT_SURVEY, |
5959 | | |
5960 | | /** |
5961 | | * EVENT_SCAN_STARTED - Scan started |
5962 | | * |
5963 | | * This indicates that driver has started a scan operation either based |
5964 | | * on a request from wpa_supplicant/hostapd or from another application. |
5965 | | * EVENT_SCAN_RESULTS is used to indicate when the scan has been |
5966 | | * completed (either successfully or by getting cancelled). |
5967 | | */ |
5968 | | EVENT_SCAN_STARTED, |
5969 | | |
5970 | | /** |
5971 | | * EVENT_AVOID_FREQUENCIES - Received avoid frequency range |
5972 | | * |
5973 | | * This event indicates a set of frequency ranges that should be avoided |
5974 | | * to reduce issues due to interference or internal co-existence |
5975 | | * information in the driver. |
5976 | | */ |
5977 | | EVENT_AVOID_FREQUENCIES, |
5978 | | |
5979 | | /** |
5980 | | * EVENT_NEW_PEER_CANDIDATE - new (unknown) mesh peer notification |
5981 | | */ |
5982 | | EVENT_NEW_PEER_CANDIDATE, |
5983 | | |
5984 | | /** |
5985 | | * EVENT_ACS_CHANNEL_SELECTED - Received selected channels by ACS |
5986 | | * |
5987 | | * Indicates a pair of primary and secondary channels chosen by ACS |
5988 | | * in device. |
5989 | | */ |
5990 | | EVENT_ACS_CHANNEL_SELECTED, |
5991 | | |
5992 | | /** |
5993 | | * EVENT_DFS_CAC_STARTED - Notify that channel availability check has |
5994 | | * been started. |
5995 | | * |
5996 | | * This event indicates that channel availability check has been started |
5997 | | * on a DFS frequency by a driver that supports DFS Offload. |
5998 | | */ |
5999 | | EVENT_DFS_CAC_STARTED, |
6000 | | |
6001 | | /** |
6002 | | * EVENT_P2P_LO_STOP - Notify that P2P listen offload is stopped |
6003 | | */ |
6004 | | EVENT_P2P_LO_STOP, |
6005 | | |
6006 | | /** |
6007 | | * EVENT_BEACON_LOSS - Beacon loss detected |
6008 | | * |
6009 | | * This event indicates that no Beacon frames has been received from |
6010 | | * the current AP. This may indicate that the AP is not anymore in |
6011 | | * range. |
6012 | | */ |
6013 | | EVENT_BEACON_LOSS, |
6014 | | |
6015 | | /** |
6016 | | * EVENT_DFS_PRE_CAC_EXPIRED - Notify that channel availability check |
6017 | | * done previously (Pre-CAC) on the channel has expired. This would |
6018 | | * normally be on a non-ETSI DFS regulatory domain. DFS state of the |
6019 | | * channel will be moved from available to usable. A new CAC has to be |
6020 | | * performed before start operating on this channel. |
6021 | | */ |
6022 | | EVENT_DFS_PRE_CAC_EXPIRED, |
6023 | | |
6024 | | /** |
6025 | | * EVENT_EXTERNAL_AUTH - This event interface is used by host drivers |
6026 | | * that do not define separate commands for authentication and |
6027 | | * association (~WPA_DRIVER_FLAGS_SME) but offload the 802.11 |
6028 | | * authentication to wpa_supplicant. This event carries all the |
6029 | | * necessary information from the host driver for the authentication to |
6030 | | * happen. |
6031 | | */ |
6032 | | EVENT_EXTERNAL_AUTH, |
6033 | | |
6034 | | /** |
6035 | | * EVENT_PORT_AUTHORIZED - Notification that a connection is authorized |
6036 | | * |
6037 | | * This event should be indicated when the driver completes the 4-way |
6038 | | * handshake. This event should be preceded by an EVENT_ASSOC that |
6039 | | * indicates the completion of IEEE 802.11 association. |
6040 | | */ |
6041 | | EVENT_PORT_AUTHORIZED, |
6042 | | |
6043 | | /** |
6044 | | * EVENT_STATION_OPMODE_CHANGED - Notify STA's HT/VHT operation mode |
6045 | | * change event. |
6046 | | */ |
6047 | | EVENT_STATION_OPMODE_CHANGED, |
6048 | | |
6049 | | /** |
6050 | | * EVENT_INTERFACE_MAC_CHANGED - Notify that interface MAC changed |
6051 | | * |
6052 | | * This event is emitted when the MAC changes while the interface is |
6053 | | * enabled. When an interface was disabled and becomes enabled, it |
6054 | | * must be always assumed that the MAC possibly changed. |
6055 | | */ |
6056 | | EVENT_INTERFACE_MAC_CHANGED, |
6057 | | |
6058 | | /** |
6059 | | * EVENT_WDS_STA_INTERFACE_STATUS - Notify WDS STA interface status |
6060 | | * |
6061 | | * This event is emitted when an interface is added/removed for WDS STA. |
6062 | | */ |
6063 | | EVENT_WDS_STA_INTERFACE_STATUS, |
6064 | | |
6065 | | /** |
6066 | | * EVENT_UPDATE_DH - Notification of updated DH information |
6067 | | */ |
6068 | | EVENT_UPDATE_DH, |
6069 | | |
6070 | | /** |
6071 | | * EVENT_UNPROT_BEACON - Unprotected Beacon frame received |
6072 | | * |
6073 | | * This event should be called when a Beacon frame is dropped due to it |
6074 | | * not being protected correctly. union wpa_event_data::unprot_beacon |
6075 | | * is required to provide more details of the frame. |
6076 | | */ |
6077 | | EVENT_UNPROT_BEACON, |
6078 | | |
6079 | | /** |
6080 | | * EVENT_TX_WAIT_EXPIRE - TX wait timed out |
6081 | | * |
6082 | | * This event is used to indicate when the driver has completed |
6083 | | * wait for a response frame based on a TX request that specified a |
6084 | | * non-zero wait time and that has not been explicitly cancelled. |
6085 | | */ |
6086 | | EVENT_TX_WAIT_EXPIRE, |
6087 | | |
6088 | | /** |
6089 | | * EVENT_BSS_COLOR_COLLISION - Notification of a BSS color collision |
6090 | | */ |
6091 | | EVENT_BSS_COLOR_COLLISION, |
6092 | | |
6093 | | /** |
6094 | | * EVENT_CCA_STARTED_NOTIFY - Notification that CCA has started |
6095 | | */ |
6096 | | EVENT_CCA_STARTED_NOTIFY, |
6097 | | |
6098 | | /** |
6099 | | * EVENT_CCA_ABORTED_NOTIFY - Notification that CCA has aborted |
6100 | | */ |
6101 | | EVENT_CCA_ABORTED_NOTIFY, |
6102 | | |
6103 | | /** |
6104 | | * EVENT_CCA_NOTIFY - Notification that CCA has completed |
6105 | | */ |
6106 | | EVENT_CCA_NOTIFY, |
6107 | | |
6108 | | /** |
6109 | | * EVENT_PASN_AUTH - This event is used by the driver that requests |
6110 | | * PASN authentication and secure ranging context for multiple peers. |
6111 | | */ |
6112 | | EVENT_PASN_AUTH, |
6113 | | |
6114 | | /** |
6115 | | * EVENT_LINK_CH_SWITCH - MLD AP link decided to switch channels |
6116 | | * |
6117 | | * Described in wpa_event_data.ch_switch. |
6118 | | * |
6119 | | */ |
6120 | | EVENT_LINK_CH_SWITCH, |
6121 | | |
6122 | | /** |
6123 | | * EVENT_LINK_CH_SWITCH_STARTED - MLD AP link started to switch channels |
6124 | | * |
6125 | | * This is a pre-switch event indicating the shortly following switch |
6126 | | * of operating channels. |
6127 | | * |
6128 | | * Described in wpa_event_data.ch_switch. |
6129 | | */ |
6130 | | EVENT_LINK_CH_SWITCH_STARTED, |
6131 | | |
6132 | | /** |
6133 | | * EVENT_TID_LINK_MAP - MLD event to set TID-to-link mapping |
6134 | | * |
6135 | | * This event is used by the driver to indicate the received TID-to-link |
6136 | | * mapping response from the associated AP MLD. |
6137 | | * |
6138 | | * Described in wpa_event_data.t2l_map_info. |
6139 | | */ |
6140 | | EVENT_TID_LINK_MAP, |
6141 | | |
6142 | | /** |
6143 | | * EVENT_LINK_RECONFIG - Notification that AP links removed |
6144 | | */ |
6145 | | EVENT_LINK_RECONFIG, |
6146 | | |
6147 | | /** |
6148 | | * EVENT_MLD_INTERFACE_FREED - Notification of AP MLD interface removal |
6149 | | */ |
6150 | | EVENT_MLD_INTERFACE_FREED, |
6151 | | |
6152 | | /** |
6153 | | * EVENT_SETUP_LINK_RECONFIG - Notification that new AP links added |
6154 | | */ |
6155 | | EVENT_SETUP_LINK_RECONFIG, |
6156 | | }; |
6157 | | |
6158 | | |
6159 | | /** |
6160 | | * struct freq_survey - Channel survey info |
6161 | | * |
6162 | | * @ifidx: Interface index in which this survey was observed |
6163 | | * @freq: Center of frequency of the surveyed channel |
6164 | | * @nf: Channel noise floor in dBm |
6165 | | * @channel_time: Amount of time in ms the radio spent on the channel |
6166 | | * @channel_time_busy: Amount of time in ms the radio detected some signal |
6167 | | * that indicated to the radio the channel was not clear |
6168 | | * @channel_time_rx: Amount of time the radio spent receiving data |
6169 | | * @channel_time_tx: Amount of time the radio spent transmitting data |
6170 | | * @filled: bitmask indicating which fields have been reported, see |
6171 | | * SURVEY_HAS_* defines. |
6172 | | * @list: Internal list pointers |
6173 | | */ |
6174 | | struct freq_survey { |
6175 | | u32 ifidx; |
6176 | | unsigned int freq; |
6177 | | s8 nf; |
6178 | | u64 channel_time; |
6179 | | u64 channel_time_busy; |
6180 | | u64 channel_time_rx; |
6181 | | u64 channel_time_tx; |
6182 | | unsigned int filled; |
6183 | | struct dl_list list; |
6184 | | }; |
6185 | | |
6186 | | #define SURVEY_HAS_NF BIT(0) |
6187 | | #define SURVEY_HAS_CHAN_TIME BIT(1) |
6188 | | #define SURVEY_HAS_CHAN_TIME_BUSY BIT(2) |
6189 | | #define SURVEY_HAS_CHAN_TIME_RX BIT(3) |
6190 | | #define SURVEY_HAS_CHAN_TIME_TX BIT(4) |
6191 | | |
6192 | | /** |
6193 | | * enum sta_connect_fail_reason_codes - STA connect failure reason code values |
6194 | | * @STA_CONNECT_FAIL_REASON_UNSPECIFIED: No reason code specified for |
6195 | | * connection failure. |
6196 | | * @STA_CONNECT_FAIL_REASON_NO_BSS_FOUND: No Probe Response frame received |
6197 | | * for unicast Probe Request frame. |
6198 | | * @STA_CONNECT_FAIL_REASON_AUTH_TX_FAIL: STA failed to send auth request. |
6199 | | * @STA_CONNECT_FAIL_REASON_AUTH_NO_ACK_RECEIVED: AP didn't send ACK for |
6200 | | * auth request. |
6201 | | * @STA_CONNECT_FAIL_REASON_AUTH_NO_RESP_RECEIVED: Auth response is not |
6202 | | * received from AP. |
6203 | | * @STA_CONNECT_FAIL_REASON_ASSOC_REQ_TX_FAIL: STA failed to send |
6204 | | * Association Request frame. |
6205 | | * @STA_CONNECT_FAIL_REASON_ASSOC_NO_ACK_RECEIVED: AP didn't send ACK for |
6206 | | * Association Request frame. |
6207 | | * @STA_CONNECT_FAIL_REASON_ASSOC_NO_RESP_RECEIVED: Association Response |
6208 | | * frame is not received from AP. |
6209 | | */ |
6210 | | enum sta_connect_fail_reason_codes { |
6211 | | STA_CONNECT_FAIL_REASON_UNSPECIFIED = 0, |
6212 | | STA_CONNECT_FAIL_REASON_NO_BSS_FOUND = 1, |
6213 | | STA_CONNECT_FAIL_REASON_AUTH_TX_FAIL = 2, |
6214 | | STA_CONNECT_FAIL_REASON_AUTH_NO_ACK_RECEIVED = 3, |
6215 | | STA_CONNECT_FAIL_REASON_AUTH_NO_RESP_RECEIVED = 4, |
6216 | | STA_CONNECT_FAIL_REASON_ASSOC_REQ_TX_FAIL = 5, |
6217 | | STA_CONNECT_FAIL_REASON_ASSOC_NO_ACK_RECEIVED = 6, |
6218 | | STA_CONNECT_FAIL_REASON_ASSOC_NO_RESP_RECEIVED = 7, |
6219 | | }; |
6220 | | |
6221 | | /** |
6222 | | * union wpa_event_data - Additional data for wpa_supplicant_event() calls |
6223 | | */ |
6224 | | union wpa_event_data { |
6225 | | /** |
6226 | | * struct assoc_info - Data for EVENT_ASSOC and EVENT_ASSOCINFO events |
6227 | | * |
6228 | | * This structure is optional for EVENT_ASSOC calls and required for |
6229 | | * EVENT_ASSOCINFO calls. By using EVENT_ASSOC with this data, the |
6230 | | * driver interface does not need to generate separate EVENT_ASSOCINFO |
6231 | | * calls. |
6232 | | */ |
6233 | | struct assoc_info { |
6234 | | /** |
6235 | | * reassoc - Flag to indicate association or reassociation |
6236 | | */ |
6237 | | int reassoc; |
6238 | | |
6239 | | /** |
6240 | | * req_ies - (Re)Association Request IEs |
6241 | | * |
6242 | | * If the driver generates WPA/RSN IE, this event data must be |
6243 | | * returned for WPA handshake to have needed information. If |
6244 | | * wpa_supplicant-generated WPA/RSN IE is used, this |
6245 | | * information event is optional. |
6246 | | * |
6247 | | * This should start with the first IE (fixed fields before IEs |
6248 | | * are not included). |
6249 | | */ |
6250 | | const u8 *req_ies; |
6251 | | |
6252 | | /** |
6253 | | * req_ies_len - Length of req_ies in bytes |
6254 | | */ |
6255 | | size_t req_ies_len; |
6256 | | |
6257 | | /** |
6258 | | * resp_ies - (Re)Association Response IEs |
6259 | | * |
6260 | | * Optional association data from the driver. This data is not |
6261 | | * required WPA, but may be useful for some protocols and as |
6262 | | * such, should be reported if this is available to the driver |
6263 | | * interface. |
6264 | | * |
6265 | | * This should start with the first IE (fixed fields before IEs |
6266 | | * are not included). |
6267 | | */ |
6268 | | const u8 *resp_ies; |
6269 | | |
6270 | | /** |
6271 | | * resp_ies_len - Length of resp_ies in bytes |
6272 | | */ |
6273 | | size_t resp_ies_len; |
6274 | | |
6275 | | /** |
6276 | | * resp_frame - (Re)Association Response frame |
6277 | | */ |
6278 | | const u8 *resp_frame; |
6279 | | |
6280 | | /** |
6281 | | * resp_frame_len - (Re)Association Response frame length |
6282 | | */ |
6283 | | size_t resp_frame_len; |
6284 | | |
6285 | | /** |
6286 | | * beacon_ies - Beacon or Probe Response IEs |
6287 | | * |
6288 | | * Optional Beacon/ProbeResp data: IEs included in Beacon or |
6289 | | * Probe Response frames from the current AP (i.e., the one |
6290 | | * that the client just associated with). This information is |
6291 | | * used to update WPA/RSN IE for the AP. If this field is not |
6292 | | * set, the results from previous scan will be used. If no |
6293 | | * data for the new AP is found, scan results will be requested |
6294 | | * again (without scan request). At this point, the driver is |
6295 | | * expected to provide WPA/RSN IE for the AP (if WPA/WPA2 is |
6296 | | * used). |
6297 | | * |
6298 | | * This should start with the first IE (fixed fields before IEs |
6299 | | * are not included). |
6300 | | */ |
6301 | | const u8 *beacon_ies; |
6302 | | |
6303 | | /** |
6304 | | * beacon_ies_len - Length of beacon_ies */ |
6305 | | size_t beacon_ies_len; |
6306 | | |
6307 | | /** |
6308 | | * freq - Frequency of the operational channel in MHz |
6309 | | */ |
6310 | | unsigned int freq; |
6311 | | |
6312 | | /** |
6313 | | * wmm_params - WMM parameters used in this association. |
6314 | | */ |
6315 | | struct wmm_params wmm_params; |
6316 | | |
6317 | | /** |
6318 | | * addr - Station address (for AP mode) |
6319 | | */ |
6320 | | const u8 *addr; |
6321 | | |
6322 | | /** |
6323 | | * The following is the key management offload information |
6324 | | * @authorized |
6325 | | * @key_replay_ctr |
6326 | | * @key_replay_ctr_len |
6327 | | * @ptk_kck |
6328 | | * @ptk_kek_len |
6329 | | * @ptk_kek |
6330 | | * @ptk_kek_len |
6331 | | */ |
6332 | | |
6333 | | /** |
6334 | | * authorized - Status of key management offload, |
6335 | | * 1 = successful |
6336 | | */ |
6337 | | int authorized; |
6338 | | |
6339 | | /** |
6340 | | * key_replay_ctr - Key replay counter value last used |
6341 | | * in a valid EAPOL-Key frame |
6342 | | */ |
6343 | | const u8 *key_replay_ctr; |
6344 | | |
6345 | | /** |
6346 | | * key_replay_ctr_len - The length of key_replay_ctr |
6347 | | */ |
6348 | | size_t key_replay_ctr_len; |
6349 | | |
6350 | | /** |
6351 | | * ptk_kck - The derived PTK KCK |
6352 | | */ |
6353 | | const u8 *ptk_kck; |
6354 | | |
6355 | | /** |
6356 | | * ptk_kek_len - The length of ptk_kck |
6357 | | */ |
6358 | | size_t ptk_kck_len; |
6359 | | |
6360 | | /** |
6361 | | * ptk_kek - The derived PTK KEK |
6362 | | * This is used in key management offload and also in FILS SK |
6363 | | * offload. |
6364 | | */ |
6365 | | const u8 *ptk_kek; |
6366 | | |
6367 | | /** |
6368 | | * ptk_kek_len - The length of ptk_kek |
6369 | | */ |
6370 | | size_t ptk_kek_len; |
6371 | | |
6372 | | /** |
6373 | | * subnet_status - The subnet status: |
6374 | | * 0 = unknown, 1 = unchanged, 2 = changed |
6375 | | */ |
6376 | | u8 subnet_status; |
6377 | | |
6378 | | /** |
6379 | | * The following information is used in FILS SK offload |
6380 | | * @fils_erp_next_seq_num |
6381 | | * @fils_pmk |
6382 | | * @fils_pmk_len |
6383 | | * @fils_pmkid |
6384 | | */ |
6385 | | |
6386 | | /** |
6387 | | * fils_erp_next_seq_num - The next sequence number to use in |
6388 | | * FILS ERP messages |
6389 | | */ |
6390 | | u16 fils_erp_next_seq_num; |
6391 | | |
6392 | | /** |
6393 | | * fils_pmk - A new PMK if generated in case of FILS |
6394 | | * authentication |
6395 | | */ |
6396 | | const u8 *fils_pmk; |
6397 | | |
6398 | | /** |
6399 | | * fils_pmk_len - Length of fils_pmk |
6400 | | */ |
6401 | | size_t fils_pmk_len; |
6402 | | |
6403 | | /** |
6404 | | * fils_pmkid - PMKID used or generated in FILS authentication |
6405 | | */ |
6406 | | const u8 *fils_pmkid; |
6407 | | |
6408 | | /** |
6409 | | * link_addr - Link address of the STA |
6410 | | */ |
6411 | | const u8 *link_addr; |
6412 | | |
6413 | | /** |
6414 | | * assoc_link_id - Association link id of the MLO association or |
6415 | | * -1 if MLO is not used |
6416 | | */ |
6417 | | int assoc_link_id; |
6418 | | } assoc_info; |
6419 | | |
6420 | | /** |
6421 | | * struct disassoc_info - Data for EVENT_DISASSOC events |
6422 | | */ |
6423 | | struct disassoc_info { |
6424 | | /** |
6425 | | * addr - Station address (for AP mode) |
6426 | | */ |
6427 | | const u8 *addr; |
6428 | | |
6429 | | /** |
6430 | | * reason_code - Reason Code (host byte order) used in |
6431 | | * Deauthentication frame |
6432 | | */ |
6433 | | u16 reason_code; |
6434 | | |
6435 | | /** |
6436 | | * ie - Optional IE(s) in Disassociation frame |
6437 | | */ |
6438 | | const u8 *ie; |
6439 | | |
6440 | | /** |
6441 | | * ie_len - Length of ie buffer in octets |
6442 | | */ |
6443 | | size_t ie_len; |
6444 | | |
6445 | | /** |
6446 | | * locally_generated - Whether the frame was locally generated |
6447 | | */ |
6448 | | int locally_generated; |
6449 | | } disassoc_info; |
6450 | | |
6451 | | /** |
6452 | | * struct deauth_info - Data for EVENT_DEAUTH events |
6453 | | */ |
6454 | | struct deauth_info { |
6455 | | /** |
6456 | | * addr - Station address (for AP mode) |
6457 | | */ |
6458 | | const u8 *addr; |
6459 | | |
6460 | | /** |
6461 | | * reason_code - Reason Code (host byte order) used in |
6462 | | * Deauthentication frame |
6463 | | */ |
6464 | | u16 reason_code; |
6465 | | |
6466 | | /** |
6467 | | * ie - Optional IE(s) in Deauthentication frame |
6468 | | */ |
6469 | | const u8 *ie; |
6470 | | |
6471 | | /** |
6472 | | * ie_len - Length of ie buffer in octets |
6473 | | */ |
6474 | | size_t ie_len; |
6475 | | |
6476 | | /** |
6477 | | * locally_generated - Whether the frame was locally generated |
6478 | | */ |
6479 | | int locally_generated; |
6480 | | } deauth_info; |
6481 | | |
6482 | | /** |
6483 | | * struct michael_mic_failure - Data for EVENT_MICHAEL_MIC_FAILURE |
6484 | | */ |
6485 | | struct michael_mic_failure { |
6486 | | int unicast; |
6487 | | const u8 *src; |
6488 | | } michael_mic_failure; |
6489 | | |
6490 | | /** |
6491 | | * struct interface_status - Data for EVENT_INTERFACE_STATUS |
6492 | | */ |
6493 | | struct interface_status { |
6494 | | unsigned int ifindex; |
6495 | | char ifname[100]; |
6496 | | enum { |
6497 | | EVENT_INTERFACE_ADDED, EVENT_INTERFACE_REMOVED |
6498 | | } ievent; |
6499 | | } interface_status; |
6500 | | |
6501 | | /** |
6502 | | * struct pmkid_candidate - Data for EVENT_PMKID_CANDIDATE |
6503 | | */ |
6504 | | struct pmkid_candidate { |
6505 | | /** BSSID of the PMKID candidate */ |
6506 | | u8 bssid[ETH_ALEN]; |
6507 | | /** Smaller the index, higher the priority */ |
6508 | | int index; |
6509 | | /** Whether RSN IE includes pre-authenticate flag */ |
6510 | | int preauth; |
6511 | | } pmkid_candidate; |
6512 | | |
6513 | | /** |
6514 | | * struct tdls - Data for EVENT_TDLS |
6515 | | */ |
6516 | | struct tdls { |
6517 | | u8 peer[ETH_ALEN]; |
6518 | | enum { |
6519 | | TDLS_REQUEST_SETUP, |
6520 | | TDLS_REQUEST_TEARDOWN, |
6521 | | TDLS_REQUEST_DISCOVER, |
6522 | | } oper; |
6523 | | u16 reason_code; /* for teardown */ |
6524 | | } tdls; |
6525 | | |
6526 | | /** |
6527 | | * struct wnm - Data for EVENT_WNM |
6528 | | */ |
6529 | | struct wnm { |
6530 | | u8 addr[ETH_ALEN]; |
6531 | | enum { |
6532 | | WNM_OPER_SLEEP, |
6533 | | } oper; |
6534 | | enum { |
6535 | | WNM_SLEEP_ENTER, |
6536 | | WNM_SLEEP_EXIT |
6537 | | } sleep_action; |
6538 | | int sleep_intval; |
6539 | | u16 reason_code; |
6540 | | u8 *buf; |
6541 | | u16 buf_len; |
6542 | | } wnm; |
6543 | | |
6544 | | /** |
6545 | | * struct ft_ies - FT information elements (EVENT_FT_RESPONSE) |
6546 | | * |
6547 | | * During FT (IEEE 802.11r) authentication sequence, the driver is |
6548 | | * expected to use this event to report received FT IEs (MDIE, FTIE, |
6549 | | * RSN IE, TIE, possible resource request) to the supplicant. The FT |
6550 | | * IEs for the next message will be delivered through the |
6551 | | * struct wpa_driver_ops::update_ft_ies() callback. |
6552 | | */ |
6553 | | struct ft_ies { |
6554 | | const u8 *ies; |
6555 | | size_t ies_len; |
6556 | | int ft_action; |
6557 | | u8 target_ap[ETH_ALEN]; |
6558 | | /** Optional IE(s), e.g., WMM TSPEC(s), for RIC-Request */ |
6559 | | const u8 *ric_ies; |
6560 | | /** Length of ric_ies buffer in octets */ |
6561 | | size_t ric_ies_len; |
6562 | | } ft_ies; |
6563 | | |
6564 | | /** |
6565 | | * struct ibss_rsn_start - Data for EVENT_IBSS_RSN_START |
6566 | | */ |
6567 | | struct ibss_rsn_start { |
6568 | | u8 peer[ETH_ALEN]; |
6569 | | } ibss_rsn_start; |
6570 | | |
6571 | | /** |
6572 | | * struct auth_info - Data for EVENT_AUTH events |
6573 | | */ |
6574 | | struct auth_info { |
6575 | | u8 peer[ETH_ALEN]; |
6576 | | u8 bssid[ETH_ALEN]; |
6577 | | u16 auth_type; |
6578 | | u16 auth_transaction; |
6579 | | u16 status_code; |
6580 | | const u8 *ies; |
6581 | | size_t ies_len; |
6582 | | } auth; |
6583 | | |
6584 | | /** |
6585 | | * struct assoc_reject - Data for EVENT_ASSOC_REJECT events |
6586 | | */ |
6587 | | struct assoc_reject { |
6588 | | /** |
6589 | | * bssid - BSSID of the AP that rejected association |
6590 | | */ |
6591 | | const u8 *bssid; |
6592 | | |
6593 | | /** |
6594 | | * resp_ies - (Re)Association Response IEs |
6595 | | * |
6596 | | * Optional association data from the driver. This data is not |
6597 | | * required WPA, but may be useful for some protocols and as |
6598 | | * such, should be reported if this is available to the driver |
6599 | | * interface. |
6600 | | * |
6601 | | * This should start with the first IE (fixed fields before IEs |
6602 | | * are not included). |
6603 | | */ |
6604 | | const u8 *resp_ies; |
6605 | | |
6606 | | /** |
6607 | | * resp_ies_len - Length of resp_ies in bytes |
6608 | | */ |
6609 | | size_t resp_ies_len; |
6610 | | |
6611 | | /** |
6612 | | * status_code - Status Code from (Re)association Response |
6613 | | */ |
6614 | | u16 status_code; |
6615 | | |
6616 | | /** |
6617 | | * timed_out - Whether failure is due to timeout (etc.) rather |
6618 | | * than explicit rejection response from the AP. |
6619 | | */ |
6620 | | int timed_out; |
6621 | | |
6622 | | /** |
6623 | | * timeout_reason - Reason for the timeout |
6624 | | */ |
6625 | | const char *timeout_reason; |
6626 | | |
6627 | | /** |
6628 | | * fils_erp_next_seq_num - The next sequence number to use in |
6629 | | * FILS ERP messages |
6630 | | */ |
6631 | | u16 fils_erp_next_seq_num; |
6632 | | |
6633 | | /** |
6634 | | * reason_code - Connection failure reason code from the driver |
6635 | | */ |
6636 | | enum sta_connect_fail_reason_codes reason_code; |
6637 | | } assoc_reject; |
6638 | | |
6639 | | struct timeout_event { |
6640 | | u8 addr[ETH_ALEN]; |
6641 | | } timeout_event; |
6642 | | |
6643 | | /** |
6644 | | * struct tx_status - Data for EVENT_TX_STATUS events |
6645 | | */ |
6646 | | struct tx_status { |
6647 | | u16 type; |
6648 | | u16 stype; |
6649 | | const u8 *dst; |
6650 | | const u8 *data; |
6651 | | size_t data_len; |
6652 | | int ack; |
6653 | | int link_id; |
6654 | | } tx_status; |
6655 | | |
6656 | | /** |
6657 | | * struct rx_from_unknown - Data for EVENT_RX_FROM_UNKNOWN events |
6658 | | */ |
6659 | | struct rx_from_unknown { |
6660 | | const u8 *bssid; |
6661 | | const u8 *addr; |
6662 | | int wds; |
6663 | | } rx_from_unknown; |
6664 | | |
6665 | | /** |
6666 | | * struct rx_mgmt - Data for EVENT_RX_MGMT events |
6667 | | */ |
6668 | | struct rx_mgmt { |
6669 | | const u8 *frame; |
6670 | | size_t frame_len; |
6671 | | u32 datarate; |
6672 | | |
6673 | | /** |
6674 | | * drv_priv - Pointer to store driver private BSS information |
6675 | | * |
6676 | | * If not set to NULL, this is used for comparison with |
6677 | | * hostapd_data->drv_priv to determine which BSS should process |
6678 | | * the frame. |
6679 | | */ |
6680 | | void *drv_priv; |
6681 | | |
6682 | | /** |
6683 | | * ctx - Pointer to store ctx of private BSS information |
6684 | | * |
6685 | | * If not set to NULL, this is used for forwarding the packet |
6686 | | * to right link BSS of ML BSS. |
6687 | | */ |
6688 | | void *ctx; |
6689 | | |
6690 | | /** |
6691 | | * freq - Frequency (in MHz) on which the frame was received |
6692 | | */ |
6693 | | int freq; |
6694 | | |
6695 | | /** |
6696 | | * ssi_signal - Signal strength in dBm (or 0 if not available) |
6697 | | */ |
6698 | | int ssi_signal; |
6699 | | |
6700 | | /** |
6701 | | * link_id - MLO link on which the frame was received or -1 for |
6702 | | * non MLD. |
6703 | | */ |
6704 | | int link_id; |
6705 | | } rx_mgmt; |
6706 | | |
6707 | | /** |
6708 | | * struct remain_on_channel - Data for EVENT_REMAIN_ON_CHANNEL events |
6709 | | * |
6710 | | * This is also used with EVENT_CANCEL_REMAIN_ON_CHANNEL events. |
6711 | | */ |
6712 | | struct remain_on_channel { |
6713 | | /** |
6714 | | * freq - Channel frequency in MHz |
6715 | | */ |
6716 | | unsigned int freq; |
6717 | | |
6718 | | /** |
6719 | | * duration - Duration to remain on the channel in milliseconds |
6720 | | */ |
6721 | | unsigned int duration; |
6722 | | } remain_on_channel; |
6723 | | |
6724 | | /** |
6725 | | * struct scan_info - Optional data for EVENT_SCAN_RESULTS events |
6726 | | * @aborted: Whether the scan was aborted |
6727 | | * @freqs: Scanned frequencies in MHz (%NULL = all channels scanned) |
6728 | | * @num_freqs: Number of entries in freqs array |
6729 | | * @ssids: Scanned SSIDs (%NULL or zero-length SSID indicates wildcard |
6730 | | * SSID) |
6731 | | * @num_ssids: Number of entries in ssids array |
6732 | | * @external_scan: Whether the scan info is for an external scan |
6733 | | * @nl_scan_event: 1 if the source of this scan event is a normal scan, |
6734 | | * 0 if the source of the scan event is a vendor scan |
6735 | | * @scan_start_tsf: Time when the scan started in terms of TSF of the |
6736 | | * BSS that the interface that requested the scan is connected to |
6737 | | * (if available). |
6738 | | * @scan_start_tsf_bssid: The BSSID according to which %scan_start_tsf |
6739 | | * is set. |
6740 | | * @scan_cookie: Unique identification representing the corresponding |
6741 | | * scan request. 0 if no unique identification is available. |
6742 | | */ |
6743 | | struct scan_info { |
6744 | | int aborted; |
6745 | | const int *freqs; |
6746 | | size_t num_freqs; |
6747 | | struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS]; |
6748 | | size_t num_ssids; |
6749 | | int external_scan; |
6750 | | int nl_scan_event; |
6751 | | u64 scan_start_tsf; |
6752 | | u8 scan_start_tsf_bssid[ETH_ALEN]; |
6753 | | u64 scan_cookie; |
6754 | | } scan_info; |
6755 | | |
6756 | | /** |
6757 | | * struct rx_probe_req - Data for EVENT_RX_PROBE_REQ events |
6758 | | */ |
6759 | | struct rx_probe_req { |
6760 | | /** |
6761 | | * sa - Source address of the received Probe Request frame |
6762 | | */ |
6763 | | const u8 *sa; |
6764 | | |
6765 | | /** |
6766 | | * da - Destination address of the received Probe Request frame |
6767 | | * or %NULL if not available |
6768 | | */ |
6769 | | const u8 *da; |
6770 | | |
6771 | | /** |
6772 | | * bssid - BSSID of the received Probe Request frame or %NULL |
6773 | | * if not available |
6774 | | */ |
6775 | | const u8 *bssid; |
6776 | | |
6777 | | /** |
6778 | | * ie - IEs from the Probe Request body |
6779 | | */ |
6780 | | const u8 *ie; |
6781 | | |
6782 | | /** |
6783 | | * ie_len - Length of ie buffer in octets |
6784 | | */ |
6785 | | size_t ie_len; |
6786 | | |
6787 | | /** |
6788 | | * signal - signal strength in dBm (or 0 if not available) |
6789 | | */ |
6790 | | int ssi_signal; |
6791 | | } rx_probe_req; |
6792 | | |
6793 | | /** |
6794 | | * struct new_sta - Data for EVENT_NEW_STA events |
6795 | | */ |
6796 | | struct new_sta { |
6797 | | const u8 *addr; |
6798 | | } new_sta; |
6799 | | |
6800 | | /** |
6801 | | * struct eapol_rx - Data for EVENT_EAPOL_RX events |
6802 | | */ |
6803 | | struct eapol_rx { |
6804 | | const u8 *src; |
6805 | | const u8 *data; |
6806 | | size_t data_len; |
6807 | | enum frame_encryption encrypted; |
6808 | | int link_id; |
6809 | | } eapol_rx; |
6810 | | |
6811 | | /** |
6812 | | * signal_change - Data for EVENT_SIGNAL_CHANGE events |
6813 | | */ |
6814 | | struct wpa_signal_info signal_change; |
6815 | | |
6816 | | /** |
6817 | | * struct best_channel - Data for EVENT_BEST_CHANNEL events |
6818 | | * @freq_24: Best 2.4 GHz band channel frequency in MHz |
6819 | | * @freq_5: Best 5 GHz band channel frequency in MHz |
6820 | | * @freq_overall: Best channel frequency in MHz |
6821 | | * |
6822 | | * 0 can be used to indicate no preference in either band. |
6823 | | */ |
6824 | | struct best_channel { |
6825 | | int freq_24; |
6826 | | int freq_5; |
6827 | | int freq_overall; |
6828 | | } best_chan; |
6829 | | |
6830 | | struct unprot_deauth { |
6831 | | const u8 *sa; |
6832 | | const u8 *da; |
6833 | | u16 reason_code; |
6834 | | } unprot_deauth; |
6835 | | |
6836 | | struct unprot_disassoc { |
6837 | | const u8 *sa; |
6838 | | const u8 *da; |
6839 | | u16 reason_code; |
6840 | | } unprot_disassoc; |
6841 | | |
6842 | | /** |
6843 | | * struct low_ack - Data for EVENT_STATION_LOW_ACK events |
6844 | | * @addr: station address |
6845 | | * @num_packets: Number of packets lost (consecutive packets not |
6846 | | * acknowledged) |
6847 | | */ |
6848 | | struct low_ack { |
6849 | | u8 addr[ETH_ALEN]; |
6850 | | u32 num_packets; |
6851 | | } low_ack; |
6852 | | |
6853 | | /** |
6854 | | * struct ibss_peer_lost - Data for EVENT_IBSS_PEER_LOST |
6855 | | */ |
6856 | | struct ibss_peer_lost { |
6857 | | u8 peer[ETH_ALEN]; |
6858 | | } ibss_peer_lost; |
6859 | | |
6860 | | /** |
6861 | | * struct driver_gtk_rekey - Data for EVENT_DRIVER_GTK_REKEY |
6862 | | */ |
6863 | | struct driver_gtk_rekey { |
6864 | | const u8 *bssid; |
6865 | | const u8 *replay_ctr; |
6866 | | } driver_gtk_rekey; |
6867 | | |
6868 | | /** |
6869 | | * struct client_poll - Data for EVENT_DRIVER_CLIENT_POLL_OK events |
6870 | | * @addr: station address |
6871 | | */ |
6872 | | struct client_poll { |
6873 | | u8 addr[ETH_ALEN]; |
6874 | | } client_poll; |
6875 | | |
6876 | | /** |
6877 | | * struct eapol_tx_status |
6878 | | * @dst: Original destination |
6879 | | * @data: Data starting with IEEE 802.1X header (!) |
6880 | | * @data_len: Length of data |
6881 | | * @ack: Indicates ack or lost frame |
6882 | | * @link_id: MLD link id used to transmit the frame or -1 for non MLO |
6883 | | * |
6884 | | * This corresponds to hapd_send_eapol if the frame sent |
6885 | | * there isn't just reported as EVENT_TX_STATUS. |
6886 | | */ |
6887 | | struct eapol_tx_status { |
6888 | | const u8 *dst; |
6889 | | const u8 *data; |
6890 | | int data_len; |
6891 | | int ack; |
6892 | | int link_id; |
6893 | | } eapol_tx_status; |
6894 | | |
6895 | | /** |
6896 | | * struct ch_switch |
6897 | | * @freq: Frequency of new channel in MHz |
6898 | | * @ht_enabled: Whether this is an HT channel |
6899 | | * @ch_offset: Secondary channel offset |
6900 | | * @ch_width: Channel width |
6901 | | * @cf1: Center frequency 1 |
6902 | | * @cf2: Center frequency 2 |
6903 | | * @link_id: Link ID of the MLO link |
6904 | | * @punct_bitmap: Puncturing bitmap |
6905 | | */ |
6906 | | struct ch_switch { |
6907 | | int freq; |
6908 | | int ht_enabled; |
6909 | | int ch_offset; |
6910 | | enum chan_width ch_width; |
6911 | | int cf1; |
6912 | | int cf2; |
6913 | | int link_id; |
6914 | | u16 punct_bitmap; |
6915 | | } ch_switch; |
6916 | | |
6917 | | /** |
6918 | | * struct connect_failed - Data for EVENT_CONNECT_FAILED_REASON |
6919 | | * @addr: Remote client address |
6920 | | * @code: Reason code for connection failure |
6921 | | */ |
6922 | | struct connect_failed_reason { |
6923 | | u8 addr[ETH_ALEN]; |
6924 | | enum { |
6925 | | MAX_CLIENT_REACHED, |
6926 | | BLOCKED_CLIENT |
6927 | | } code; |
6928 | | } connect_failed_reason; |
6929 | | |
6930 | | /** |
6931 | | * struct dfs_event - Data for radar detected events |
6932 | | * @freq: Frequency of the channel in MHz |
6933 | | * @link_id: If >= 0, Link ID of the MLO link |
6934 | | */ |
6935 | | struct dfs_event { |
6936 | | int freq; |
6937 | | int ht_enabled; |
6938 | | int chan_offset; |
6939 | | enum chan_width chan_width; |
6940 | | int cf1; |
6941 | | int cf2; |
6942 | | int link_id; |
6943 | | } dfs_event; |
6944 | | |
6945 | | /** |
6946 | | * survey_results - Survey result data for EVENT_SURVEY |
6947 | | * @freq_filter: Requested frequency survey filter, 0 if request |
6948 | | * was for all survey data |
6949 | | * @survey_list: Linked list of survey data (struct freq_survey) |
6950 | | */ |
6951 | | struct survey_results { |
6952 | | unsigned int freq_filter; |
6953 | | struct dl_list survey_list; /* struct freq_survey */ |
6954 | | } survey_results; |
6955 | | |
6956 | | /** |
6957 | | * channel_list_changed - Data for EVENT_CHANNEL_LIST_CHANGED |
6958 | | * @initiator: Initiator of the regulatory change |
6959 | | * @type: Regulatory change type |
6960 | | * @alpha2: Country code (or "" if not available) |
6961 | | * @beacon_hint_before: Data for frequency attributes before beacon hint |
6962 | | * event if initiator == REGDOM_BEACON_HINT |
6963 | | * @beacon_hint_after: Data for frequency attributes after beacon hint |
6964 | | * event if initiator == REGDOM_BEACON_HINT |
6965 | | */ |
6966 | | struct channel_list_changed { |
6967 | | enum reg_change_initiator initiator; |
6968 | | enum reg_type type; |
6969 | | char alpha2[3]; |
6970 | | struct frequency_attrs { |
6971 | | unsigned int freq; |
6972 | | unsigned int max_tx_power; |
6973 | | bool disabled; |
6974 | | bool no_ir; |
6975 | | bool radar; |
6976 | | } beacon_hint_before, beacon_hint_after; |
6977 | | } channel_list_changed; |
6978 | | |
6979 | | /** |
6980 | | * freq_range - List of frequency ranges |
6981 | | * |
6982 | | * This is used as the data with EVENT_AVOID_FREQUENCIES. |
6983 | | */ |
6984 | | struct wpa_freq_range_list freq_range; |
6985 | | |
6986 | | /** |
6987 | | * struct mesh_peer |
6988 | | * |
6989 | | * @peer: Peer address |
6990 | | * @ies: Beacon IEs |
6991 | | * @ie_len: Length of @ies |
6992 | | * |
6993 | | * Notification of new candidate mesh peer. |
6994 | | */ |
6995 | | struct mesh_peer { |
6996 | | const u8 *peer; |
6997 | | const u8 *ies; |
6998 | | size_t ie_len; |
6999 | | } mesh_peer; |
7000 | | |
7001 | | /** |
7002 | | * struct acs_selected_channels - Data for EVENT_ACS_CHANNEL_SELECTED |
7003 | | * @pri_freq: Selected primary frequency |
7004 | | * @sec_freq: Selected secondary frequency |
7005 | | * @edmg_channel: Selected EDMG channel |
7006 | | * @vht_seg0_center_ch: VHT mode Segment0 center channel |
7007 | | * The value is the index of the channel center frequency for |
7008 | | * 20 MHz, 40 MHz, and 80 MHz channels. The value is the center |
7009 | | * frequency index of the primary 80 MHz segment for 160 MHz and |
7010 | | * 80+80 MHz channels. |
7011 | | * @vht_seg1_center_ch: VHT mode Segment1 center channel |
7012 | | * The value is zero for 20 MHz, 40 MHz, and 80 MHz channels. The |
7013 | | * value is the index of the channel center frequency for 160 MHz |
7014 | | * channels and the center frequency index of the secondary 80 MHz |
7015 | | * segment for 80+80 MHz channels. |
7016 | | * @ch_width: Selected Channel width by driver. Driver may choose to |
7017 | | * change hostapd configured ACS channel width due driver internal |
7018 | | * channel restrictions. |
7019 | | * @hw_mode: Selected band (used with hw_mode=any) |
7020 | | * @puncture_bitmap: Indicate the puncturing channels |
7021 | | * @link_id: Indicate the link id if operating as AP MLD; -1 otherwise |
7022 | | */ |
7023 | | struct acs_selected_channels { |
7024 | | unsigned int pri_freq; |
7025 | | unsigned int sec_freq; |
7026 | | u8 edmg_channel; |
7027 | | u8 vht_seg0_center_ch; |
7028 | | u8 vht_seg1_center_ch; |
7029 | | u16 ch_width; |
7030 | | enum hostapd_hw_mode hw_mode; |
7031 | | u16 puncture_bitmap; |
7032 | | int link_id; |
7033 | | } acs_selected_channels; |
7034 | | |
7035 | | /** |
7036 | | * struct p2p_lo_stop - Reason code for P2P Listen offload stop event |
7037 | | * @reason_code: Reason for stopping offload |
7038 | | * P2P_LO_STOPPED_REASON_COMPLETE: Listen offload finished as |
7039 | | * scheduled. |
7040 | | * P2P_LO_STOPPED_REASON_RECV_STOP_CMD: Host requested offload to |
7041 | | * be stopped. |
7042 | | * P2P_LO_STOPPED_REASON_INVALID_PARAM: Invalid listen offload |
7043 | | * parameters. |
7044 | | * P2P_LO_STOPPED_REASON_NOT_SUPPORTED: Listen offload not |
7045 | | * supported by device. |
7046 | | */ |
7047 | | struct p2p_lo_stop { |
7048 | | enum { |
7049 | | P2P_LO_STOPPED_REASON_COMPLETE = 0, |
7050 | | P2P_LO_STOPPED_REASON_RECV_STOP_CMD, |
7051 | | P2P_LO_STOPPED_REASON_INVALID_PARAM, |
7052 | | P2P_LO_STOPPED_REASON_NOT_SUPPORTED, |
7053 | | } reason_code; |
7054 | | } p2p_lo_stop; |
7055 | | |
7056 | | /* For EVENT_EXTERNAL_AUTH */ |
7057 | | struct external_auth external_auth; |
7058 | | |
7059 | | /** |
7060 | | * struct sta_opmode - Station's operation mode change event |
7061 | | * @addr: The station MAC address |
7062 | | * @smps_mode: SMPS mode of the station |
7063 | | * @chan_width: Channel width of the station |
7064 | | * @rx_nss: RX_NSS of the station |
7065 | | * |
7066 | | * This is used as data with EVENT_STATION_OPMODE_CHANGED. |
7067 | | */ |
7068 | | struct sta_opmode { |
7069 | | const u8 *addr; |
7070 | | enum smps_mode smps_mode; |
7071 | | enum chan_width chan_width; |
7072 | | u8 rx_nss; |
7073 | | } sta_opmode; |
7074 | | |
7075 | | /** |
7076 | | * struct wds_sta_interface - Data for EVENT_WDS_STA_INTERFACE_STATUS. |
7077 | | */ |
7078 | | struct wds_sta_interface { |
7079 | | const u8 *sta_addr; |
7080 | | const char *ifname; |
7081 | | enum { |
7082 | | INTERFACE_ADDED, |
7083 | | INTERFACE_REMOVED |
7084 | | } istatus; |
7085 | | } wds_sta_interface; |
7086 | | |
7087 | | /** |
7088 | | * struct update_dh - Data for EVENT_UPDATE_DH |
7089 | | */ |
7090 | | struct update_dh { |
7091 | | const u8 *peer; |
7092 | | const u8 *ie; |
7093 | | size_t ie_len; |
7094 | | int assoc_link_id; |
7095 | | const u8 *link_addr; |
7096 | | } update_dh; |
7097 | | |
7098 | | /** |
7099 | | * struct unprot_beacon - Data for EVENT_UNPROT_BEACON |
7100 | | */ |
7101 | | struct unprot_beacon { |
7102 | | const u8 *sa; |
7103 | | } unprot_beacon; |
7104 | | |
7105 | | /** |
7106 | | * struct bss_color_collision - Data for EVENT_BSS_COLOR_COLLISION |
7107 | | */ |
7108 | | struct bss_color_collision { |
7109 | | u64 bitmap; |
7110 | | int link_id; |
7111 | | } bss_color_collision; |
7112 | | |
7113 | | /** |
7114 | | * struct pasn_auth - Data for EVENT_PASN_AUTH |
7115 | | */ |
7116 | | struct pasn_auth pasn_auth; |
7117 | | |
7118 | | /** |
7119 | | * struct port_authorized - Data for EVENT_PORT_AUTHORIZED |
7120 | | * @td_bitmap: For STA mode, transition disable bitmap, if received in |
7121 | | * EAPOL-Key msg 3/4 |
7122 | | * @td_bitmap_len: For STA mode, length of td_bitmap |
7123 | | * @sta_addr: For AP mode, the MAC address of the associated STA |
7124 | | * |
7125 | | * This event is used to indicate that the port is authorized and |
7126 | | * open for normal data in STA and AP modes when 4-way handshake is |
7127 | | * offloaded to the driver. |
7128 | | */ |
7129 | | struct port_authorized { |
7130 | | const u8 *td_bitmap; |
7131 | | size_t td_bitmap_len; |
7132 | | const u8 *sta_addr; |
7133 | | } port_authorized; |
7134 | | |
7135 | | /** |
7136 | | * struct tid_link_map_info - Data for EVENT_TID_LINK_MAP |
7137 | | */ |
7138 | | struct tid_link_map_info { |
7139 | | bool default_map; |
7140 | | u8 valid_links; |
7141 | | struct t2lm_mapping t2lmap[MAX_NUM_MLD_LINKS]; |
7142 | | } t2l_map_info; |
7143 | | |
7144 | | /** |
7145 | | * struct reconfig_info - Data for EVENT_SETUP_LINK_RECONFIG |
7146 | | */ |
7147 | | struct reconfig_info { |
7148 | | u16 added_links; |
7149 | | u8 count; |
7150 | | const u8 *status_list; |
7151 | | const u8 *resp_ie; /* Starting from Group Key Data */ |
7152 | | size_t resp_ie_len; |
7153 | | } reconfig_info; |
7154 | | }; |
7155 | | |
7156 | | /** |
7157 | | * wpa_supplicant_event - Report a driver event for wpa_supplicant |
7158 | | * @ctx: Context pointer (wpa_s); this is the ctx variable registered |
7159 | | * with struct wpa_driver_ops::init() |
7160 | | * @event: event type (defined above) |
7161 | | * @data: possible extra data for the event |
7162 | | * |
7163 | | * Driver wrapper code should call this function whenever an event is received |
7164 | | * from the driver. |
7165 | | */ |
7166 | | void wpa_supplicant_event(void *ctx, enum wpa_event_type event, |
7167 | | union wpa_event_data *data); |
7168 | | |
7169 | | /** |
7170 | | * wpa_supplicant_event_global - Report a driver event for wpa_supplicant |
7171 | | * @ctx: Context pointer (wpa_s); this is the ctx variable registered |
7172 | | * with struct wpa_driver_ops::init() |
7173 | | * @event: event type (defined above) |
7174 | | * @data: possible extra data for the event |
7175 | | * |
7176 | | * Same as wpa_supplicant_event(), but we search for the interface in |
7177 | | * wpa_global. |
7178 | | */ |
7179 | | void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event, |
7180 | | union wpa_event_data *data); |
7181 | | |
7182 | | /* |
7183 | | * The following inline functions are provided for convenience to simplify |
7184 | | * event indication for some of the common events. |
7185 | | */ |
7186 | | |
7187 | | static inline void drv_event_assoc(void *ctx, const u8 *addr, const u8 *req_ies, |
7188 | | size_t req_ielen, const u8 *resp_ies, |
7189 | | size_t resp_ielen, const u8 *link_addr, |
7190 | | int assoc_link_id, int reassoc) |
7191 | 0 | { |
7192 | 0 | union wpa_event_data event; |
7193 | 0 | os_memset(&event, 0, sizeof(event)); |
7194 | 0 | event.assoc_info.reassoc = reassoc; |
7195 | 0 | event.assoc_info.req_ies = req_ies; |
7196 | 0 | event.assoc_info.req_ies_len = req_ielen; |
7197 | 0 | event.assoc_info.resp_ies = resp_ies; |
7198 | 0 | event.assoc_info.resp_ies_len = resp_ielen; |
7199 | 0 | event.assoc_info.addr = addr; |
7200 | 0 | event.assoc_info.link_addr = link_addr; |
7201 | 0 | event.assoc_info.assoc_link_id = assoc_link_id; |
7202 | 0 | wpa_supplicant_event(ctx, EVENT_ASSOC, &event); |
7203 | 0 | } Unexecuted instantiation: wpa.c:drv_event_assoc Unexecuted instantiation: wpa_ft.c:drv_event_assoc Unexecuted instantiation: tdls.c:drv_event_assoc Unexecuted instantiation: ieee802_11_common.c:drv_event_assoc |
7204 | | |
7205 | | static inline void drv_event_disassoc(void *ctx, const u8 *addr) |
7206 | 0 | { |
7207 | 0 | union wpa_event_data event; |
7208 | 0 | os_memset(&event, 0, sizeof(event)); |
7209 | 0 | event.disassoc_info.addr = addr; |
7210 | 0 | wpa_supplicant_event(ctx, EVENT_DISASSOC, &event); |
7211 | 0 | } Unexecuted instantiation: wpa.c:drv_event_disassoc Unexecuted instantiation: wpa_ft.c:drv_event_disassoc Unexecuted instantiation: tdls.c:drv_event_disassoc Unexecuted instantiation: ieee802_11_common.c:drv_event_disassoc |
7212 | | |
7213 | | static inline void drv_event_eapol_rx(void *ctx, const u8 *src, const u8 *data, |
7214 | | size_t data_len) |
7215 | 0 | { |
7216 | 0 | union wpa_event_data event; |
7217 | 0 | os_memset(&event, 0, sizeof(event)); |
7218 | 0 | event.eapol_rx.src = src; |
7219 | 0 | event.eapol_rx.data = data; |
7220 | 0 | event.eapol_rx.data_len = data_len; |
7221 | 0 | event.eapol_rx.encrypted = FRAME_ENCRYPTION_UNKNOWN; |
7222 | 0 | event.eapol_rx.link_id = -1; |
7223 | 0 | wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event); |
7224 | 0 | } Unexecuted instantiation: wpa.c:drv_event_eapol_rx Unexecuted instantiation: wpa_ft.c:drv_event_eapol_rx Unexecuted instantiation: tdls.c:drv_event_eapol_rx Unexecuted instantiation: ieee802_11_common.c:drv_event_eapol_rx |
7225 | | |
7226 | | static inline void drv_event_eapol_rx2(void *ctx, const u8 *src, const u8 *data, |
7227 | | size_t data_len, |
7228 | | enum frame_encryption encrypted, |
7229 | | int link_id) |
7230 | 0 | { |
7231 | 0 | union wpa_event_data event; |
7232 | 0 | os_memset(&event, 0, sizeof(event)); |
7233 | 0 | event.eapol_rx.src = src; |
7234 | 0 | event.eapol_rx.data = data; |
7235 | 0 | event.eapol_rx.data_len = data_len; |
7236 | 0 | event.eapol_rx.encrypted = encrypted; |
7237 | 0 | event.eapol_rx.link_id = link_id; |
7238 | 0 | wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event); |
7239 | 0 | } Unexecuted instantiation: wpa.c:drv_event_eapol_rx2 Unexecuted instantiation: wpa_ft.c:drv_event_eapol_rx2 Unexecuted instantiation: tdls.c:drv_event_eapol_rx2 Unexecuted instantiation: ieee802_11_common.c:drv_event_eapol_rx2 |
7240 | | |
7241 | | /* driver_common.c */ |
7242 | | void wpa_scan_results_free(struct wpa_scan_results *res); |
7243 | | |
7244 | | /* Convert wpa_event_type to a string for logging */ |
7245 | | const char * event_to_string(enum wpa_event_type event); |
7246 | | |
7247 | | /* Convert chan_width to a string for logging and control interfaces */ |
7248 | | const char * channel_width_to_string(enum chan_width width); |
7249 | | |
7250 | | int channel_width_to_int(enum chan_width width); |
7251 | | |
7252 | | int ht_supported(const struct hostapd_hw_modes *mode); |
7253 | | int vht_supported(const struct hostapd_hw_modes *mode); |
7254 | | bool he_supported(const struct hostapd_hw_modes *hw_mode, |
7255 | | enum ieee80211_op_mode op_mode); |
7256 | | |
7257 | | struct wowlan_triggers * |
7258 | | wpa_get_wowlan_triggers(const char *wowlan_triggers, |
7259 | | const struct wpa_driver_capa *capa); |
7260 | | /* Convert driver flag to string */ |
7261 | | const char * driver_flag_to_string(u64 flag); |
7262 | | const char * driver_flag2_to_string(u64 flag2); |
7263 | | |
7264 | | /* NULL terminated array of linked in driver wrappers */ |
7265 | | extern const struct wpa_driver_ops *const wpa_drivers[]; |
7266 | | |
7267 | | |
7268 | | /* Available drivers */ |
7269 | | |
7270 | | #ifdef CONFIG_DRIVER_WEXT |
7271 | | extern const struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */ |
7272 | | #endif /* CONFIG_DRIVER_WEXT */ |
7273 | | #ifdef CONFIG_DRIVER_NL80211 |
7274 | | /* driver_nl80211.c */ |
7275 | | extern const struct wpa_driver_ops wpa_driver_nl80211_ops; |
7276 | | #endif /* CONFIG_DRIVER_NL80211 */ |
7277 | | #ifdef CONFIG_DRIVER_HOSTAP |
7278 | | extern const struct wpa_driver_ops wpa_driver_hostap_ops; /* driver_hostap.c */ |
7279 | | #endif /* CONFIG_DRIVER_HOSTAP */ |
7280 | | #ifdef CONFIG_DRIVER_BSD |
7281 | | extern const struct wpa_driver_ops wpa_driver_bsd_ops; /* driver_bsd.c */ |
7282 | | #endif /* CONFIG_DRIVER_BSD */ |
7283 | | #ifdef CONFIG_DRIVER_OPENBSD |
7284 | | /* driver_openbsd.c */ |
7285 | | extern const struct wpa_driver_ops wpa_driver_openbsd_ops; |
7286 | | #endif /* CONFIG_DRIVER_OPENBSD */ |
7287 | | #ifdef CONFIG_DRIVER_NDIS |
7288 | | extern struct wpa_driver_ops wpa_driver_ndis_ops; /* driver_ndis.c */ |
7289 | | #endif /* CONFIG_DRIVER_NDIS */ |
7290 | | #ifdef CONFIG_DRIVER_WIRED |
7291 | | extern const struct wpa_driver_ops wpa_driver_wired_ops; /* driver_wired.c */ |
7292 | | #endif /* CONFIG_DRIVER_WIRED */ |
7293 | | #ifdef CONFIG_DRIVER_MACSEC_QCA |
7294 | | /* driver_macsec_qca.c */ |
7295 | | extern const struct wpa_driver_ops wpa_driver_macsec_qca_ops; |
7296 | | #endif /* CONFIG_DRIVER_MACSEC_QCA */ |
7297 | | #ifdef CONFIG_DRIVER_MACSEC_LINUX |
7298 | | /* driver_macsec_linux.c */ |
7299 | | extern const struct wpa_driver_ops wpa_driver_macsec_linux_ops; |
7300 | | #endif /* CONFIG_DRIVER_MACSEC_LINUX */ |
7301 | | #ifdef CONFIG_DRIVER_ROBOSWITCH |
7302 | | /* driver_roboswitch.c */ |
7303 | | extern const struct wpa_driver_ops wpa_driver_roboswitch_ops; |
7304 | | #endif /* CONFIG_DRIVER_ROBOSWITCH */ |
7305 | | #ifdef CONFIG_DRIVER_ATHEROS |
7306 | | /* driver_atheros.c */ |
7307 | | extern const struct wpa_driver_ops wpa_driver_atheros_ops; |
7308 | | #endif /* CONFIG_DRIVER_ATHEROS */ |
7309 | | #ifdef CONFIG_DRIVER_NONE |
7310 | | extern const struct wpa_driver_ops wpa_driver_none_ops; /* driver_none.c */ |
7311 | | #endif /* CONFIG_DRIVER_NONE */ |
7312 | | |
7313 | | #endif /* DRIVER_H */ |