139beb93cSSam Leffler /*
2e28a4053SRui Paulo * Driver interface definition
385732ac8SCy Schubert * Copyright (c) 2003-2017, Jouni Malinen <j@w1.fi>
439beb93cSSam Leffler *
5f05cddf9SRui Paulo * This software may be distributed under the terms of the BSD license.
6f05cddf9SRui Paulo * See README for more details.
7e28a4053SRui Paulo *
8e28a4053SRui Paulo * This file defines a driver interface used by both %wpa_supplicant and
9e28a4053SRui Paulo * hostapd. The first part of the file defines data structures used in various
10e28a4053SRui Paulo * driver operations. This is followed by the struct wpa_driver_ops that each
11e28a4053SRui Paulo * driver wrapper will beed to define with callback functions for requesting
12e28a4053SRui Paulo * driver operations. After this, there are definitions for driver event
13e28a4053SRui Paulo * reporting with wpa_supplicant_event() and some convenience helper functions
14e28a4053SRui Paulo * that can be used to report events.
1539beb93cSSam Leffler */
1639beb93cSSam Leffler
1739beb93cSSam Leffler #ifndef DRIVER_H
1839beb93cSSam Leffler #define DRIVER_H
1939beb93cSSam Leffler
20e28a4053SRui Paulo #define WPA_SUPPLICANT_DRIVER_VERSION 4
2139beb93cSSam Leffler
22e28a4053SRui Paulo #include "common/defs.h"
23325151a3SRui Paulo #include "common/ieee802_11_defs.h"
2485732ac8SCy Schubert #include "common/wpa_common.h"
2585732ac8SCy Schubert #ifdef CONFIG_MACSEC
2685732ac8SCy Schubert #include "pae/ieee802_1x_kay.h"
2785732ac8SCy Schubert #endif /* CONFIG_MACSEC */
285b9c547cSRui Paulo #include "utils/list.h"
2939beb93cSSam Leffler
30e28a4053SRui Paulo #define HOSTAPD_CHAN_DISABLED 0x00000001
315b9c547cSRui Paulo #define HOSTAPD_CHAN_NO_IR 0x00000002
32e28a4053SRui Paulo #define HOSTAPD_CHAN_RADAR 0x00000008
33f05cddf9SRui Paulo #define HOSTAPD_CHAN_HT40PLUS 0x00000010
34f05cddf9SRui Paulo #define HOSTAPD_CHAN_HT40MINUS 0x00000020
35f05cddf9SRui Paulo #define HOSTAPD_CHAN_HT40 0x00000040
365b9c547cSRui Paulo #define HOSTAPD_CHAN_SURVEY_LIST_INITIALIZED 0x00000080
375b9c547cSRui Paulo
385b9c547cSRui Paulo #define HOSTAPD_CHAN_DFS_UNKNOWN 0x00000000
395b9c547cSRui Paulo #define HOSTAPD_CHAN_DFS_USABLE 0x00000100
405b9c547cSRui Paulo #define HOSTAPD_CHAN_DFS_UNAVAILABLE 0x00000200
415b9c547cSRui Paulo #define HOSTAPD_CHAN_DFS_AVAILABLE 0x00000300
425b9c547cSRui Paulo #define HOSTAPD_CHAN_DFS_MASK 0x00000300
435b9c547cSRui Paulo
44*a90b9d01SCy Schubert #define HOSTAPD_CHAN_VHT_80MHZ_SUBCHANNEL 0x00000800
45*a90b9d01SCy Schubert #define HOSTAPD_CHAN_VHT_160MHZ_SUBCHANNEL 0x00001000
46*a90b9d01SCy Schubert #define HOSTAPD_CHAN_EHT_320MHZ_SUBCHANNEL 0x00002000
475b9c547cSRui Paulo
485b9c547cSRui Paulo #define HOSTAPD_CHAN_INDOOR_ONLY 0x00010000
495b9c547cSRui Paulo #define HOSTAPD_CHAN_GO_CONCURRENT 0x00020000
505b9c547cSRui Paulo
514bc52338SCy Schubert /* Allowed bandwidth mask */
524bc52338SCy Schubert enum hostapd_chan_width_attr {
534bc52338SCy Schubert HOSTAPD_CHAN_WIDTH_10 = BIT(0),
544bc52338SCy Schubert HOSTAPD_CHAN_WIDTH_20 = BIT(1),
554bc52338SCy Schubert HOSTAPD_CHAN_WIDTH_40P = BIT(2),
564bc52338SCy Schubert HOSTAPD_CHAN_WIDTH_40M = BIT(3),
574bc52338SCy Schubert HOSTAPD_CHAN_WIDTH_80 = BIT(4),
584bc52338SCy Schubert HOSTAPD_CHAN_WIDTH_160 = BIT(5),
59*a90b9d01SCy Schubert HOSTAPD_CHAN_WIDTH_320 = BIT(6),
604bc52338SCy Schubert };
614bc52338SCy Schubert
62780fb4a2SCy Schubert /* Filter gratuitous ARP */
63780fb4a2SCy Schubert #define WPA_DATA_FRAME_FILTER_FLAG_ARP BIT(0)
64780fb4a2SCy Schubert /* Filter unsolicited Neighbor Advertisement */
65780fb4a2SCy Schubert #define WPA_DATA_FRAME_FILTER_FLAG_NA BIT(1)
66780fb4a2SCy Schubert /* Filter unicast IP packets encrypted using the GTK */
67780fb4a2SCy Schubert #define WPA_DATA_FRAME_FILTER_FLAG_GTK BIT(2)
68780fb4a2SCy Schubert
6985732ac8SCy Schubert #define HOSTAPD_DFS_REGION_FCC 1
7085732ac8SCy Schubert #define HOSTAPD_DFS_REGION_ETSI 2
7185732ac8SCy Schubert #define HOSTAPD_DFS_REGION_JP 3
7285732ac8SCy Schubert
735b9c547cSRui Paulo /**
745b9c547cSRui Paulo * enum reg_change_initiator - Regulatory change initiator
755b9c547cSRui Paulo */
765b9c547cSRui Paulo enum reg_change_initiator {
775b9c547cSRui Paulo REGDOM_SET_BY_CORE,
785b9c547cSRui Paulo REGDOM_SET_BY_USER,
795b9c547cSRui Paulo REGDOM_SET_BY_DRIVER,
805b9c547cSRui Paulo REGDOM_SET_BY_COUNTRY_IE,
815b9c547cSRui Paulo REGDOM_BEACON_HINT,
825b9c547cSRui Paulo };
835b9c547cSRui Paulo
845b9c547cSRui Paulo /**
855b9c547cSRui Paulo * enum reg_type - Regulatory change types
865b9c547cSRui Paulo */
875b9c547cSRui Paulo enum reg_type {
885b9c547cSRui Paulo REGDOM_TYPE_UNKNOWN,
895b9c547cSRui Paulo REGDOM_TYPE_COUNTRY,
905b9c547cSRui Paulo REGDOM_TYPE_WORLD,
915b9c547cSRui Paulo REGDOM_TYPE_CUSTOM_WORLD,
925b9c547cSRui Paulo REGDOM_TYPE_INTERSECTION,
935b9c547cSRui Paulo };
94e28a4053SRui Paulo
95e28a4053SRui Paulo /**
96206b73d0SCy Schubert * struct hostapd_wmm_rule - WMM regulatory rule
97206b73d0SCy Schubert * @min_cwmin: Lower bound of CW_min value
98206b73d0SCy Schubert * @min_cwmax: Lower bound of CW_max value
99206b73d0SCy Schubert * @min_aifs: Lower bound of AIFS value
100206b73d0SCy Schubert * @max_txop: Upper bound of TXOP, value in units of 32 usec
101206b73d0SCy Schubert */
102206b73d0SCy Schubert struct hostapd_wmm_rule {
103206b73d0SCy Schubert int min_cwmin;
104206b73d0SCy Schubert int min_cwmax;
105206b73d0SCy Schubert int min_aifs;
106206b73d0SCy Schubert int max_txop;
107206b73d0SCy Schubert };
108206b73d0SCy Schubert
109206b73d0SCy Schubert /**
110e28a4053SRui Paulo * struct hostapd_channel_data - Channel information
111e28a4053SRui Paulo */
112e28a4053SRui Paulo struct hostapd_channel_data {
113e28a4053SRui Paulo /**
114e28a4053SRui Paulo * chan - Channel number (IEEE 802.11)
115e28a4053SRui Paulo */
116e28a4053SRui Paulo short chan;
117e28a4053SRui Paulo
118e28a4053SRui Paulo /**
119e28a4053SRui Paulo * freq - Frequency in MHz
120e28a4053SRui Paulo */
121f05cddf9SRui Paulo int freq;
122e28a4053SRui Paulo
123e28a4053SRui Paulo /**
124e28a4053SRui Paulo * flag - Channel flags (HOSTAPD_CHAN_*)
125e28a4053SRui Paulo */
126e28a4053SRui Paulo int flag;
127e28a4053SRui Paulo
128e28a4053SRui Paulo /**
1294bc52338SCy Schubert * allowed_bw - Allowed channel width bitmask
1304bc52338SCy Schubert *
1314bc52338SCy Schubert * See enum hostapd_chan_width_attr.
1324bc52338SCy Schubert */
1334bc52338SCy Schubert u32 allowed_bw;
1344bc52338SCy Schubert
1354bc52338SCy Schubert /**
1365b9c547cSRui Paulo * max_tx_power - Regulatory transmit power limit in dBm
137e28a4053SRui Paulo */
138e28a4053SRui Paulo u8 max_tx_power;
1395b9c547cSRui Paulo
1405b9c547cSRui Paulo /**
1415b9c547cSRui Paulo * survey_list - Linked list of surveys (struct freq_survey)
1425b9c547cSRui Paulo */
1435b9c547cSRui Paulo struct dl_list survey_list;
1445b9c547cSRui Paulo
1455b9c547cSRui Paulo /**
1465b9c547cSRui Paulo * min_nf - Minimum observed noise floor, in dBm, based on all
1475b9c547cSRui Paulo * surveyed channel data
1485b9c547cSRui Paulo */
1495b9c547cSRui Paulo s8 min_nf;
1505b9c547cSRui Paulo
1515b9c547cSRui Paulo #ifdef CONFIG_ACS
1525b9c547cSRui Paulo /**
1535b9c547cSRui Paulo * interference_factor - Computed interference factor on this
1545b9c547cSRui Paulo * channel (used internally in src/ap/acs.c; driver wrappers do not
1555b9c547cSRui Paulo * need to set this)
1565b9c547cSRui Paulo */
1575b9c547cSRui Paulo long double interference_factor;
1585b9c547cSRui Paulo #endif /* CONFIG_ACS */
1595b9c547cSRui Paulo
1605b9c547cSRui Paulo /**
1615b9c547cSRui Paulo * dfs_cac_ms - DFS CAC time in milliseconds
1625b9c547cSRui Paulo */
1635b9c547cSRui Paulo unsigned int dfs_cac_ms;
16485732ac8SCy Schubert
16585732ac8SCy Schubert /**
166206b73d0SCy Schubert * wmm_rules_valid - Indicates wmm_rules state
16785732ac8SCy Schubert */
168206b73d0SCy Schubert int wmm_rules_valid;
169206b73d0SCy Schubert
170206b73d0SCy Schubert /**
171206b73d0SCy Schubert * wmm_rules - WMM regulatory rules
172206b73d0SCy Schubert */
173206b73d0SCy Schubert struct hostapd_wmm_rule wmm_rules[WMM_AC_NUM];
174*a90b9d01SCy Schubert
175*a90b9d01SCy Schubert /**
176*a90b9d01SCy Schubert * punct_bitmap - RU puncturing bitmap
177*a90b9d01SCy Schubert */
178*a90b9d01SCy Schubert u16 punct_bitmap;
17985732ac8SCy Schubert };
18085732ac8SCy Schubert
181c1d255d3SCy Schubert #define HE_MAC_CAPAB_0 0
182206b73d0SCy Schubert #define HE_MAX_MAC_CAPAB_SIZE 6
183206b73d0SCy Schubert #define HE_MAX_PHY_CAPAB_SIZE 11
184206b73d0SCy Schubert #define HE_MAX_MCS_CAPAB_SIZE 12
185206b73d0SCy Schubert #define HE_MAX_PPET_CAPAB_SIZE 25
186206b73d0SCy Schubert
18785732ac8SCy Schubert /**
18885732ac8SCy Schubert * struct he_capabilities - IEEE 802.11ax HE capabilities
18985732ac8SCy Schubert */
19085732ac8SCy Schubert struct he_capabilities {
19185732ac8SCy Schubert u8 he_supported;
192206b73d0SCy Schubert u8 phy_cap[HE_MAX_PHY_CAPAB_SIZE];
193206b73d0SCy Schubert u8 mac_cap[HE_MAX_MAC_CAPAB_SIZE];
194206b73d0SCy Schubert u8 mcs[HE_MAX_MCS_CAPAB_SIZE];
195206b73d0SCy Schubert u8 ppet[HE_MAX_PPET_CAPAB_SIZE];
196c1d255d3SCy Schubert u16 he_6ghz_capa;
19785732ac8SCy Schubert };
19885732ac8SCy Schubert
199*a90b9d01SCy Schubert /* struct eht_capabilities - IEEE 802.11be EHT capabilities */
200*a90b9d01SCy Schubert struct eht_capabilities {
201*a90b9d01SCy Schubert bool eht_supported;
202*a90b9d01SCy Schubert u16 mac_cap;
203*a90b9d01SCy Schubert u8 phy_cap[EHT_PHY_CAPAB_LEN];
204*a90b9d01SCy Schubert u8 mcs[EHT_MCS_NSS_CAPAB_LEN];
205*a90b9d01SCy Schubert u8 ppet[EHT_PPE_THRESH_CAPAB_LEN];
206*a90b9d01SCy Schubert };
207*a90b9d01SCy Schubert
208f05cddf9SRui Paulo #define HOSTAPD_MODE_FLAG_HT_INFO_KNOWN BIT(0)
2095b9c547cSRui Paulo #define HOSTAPD_MODE_FLAG_VHT_INFO_KNOWN BIT(1)
210*a90b9d01SCy Schubert #define HOSTAPD_MODE_FLAG_HE_INFO_KNOWN BIT(2)
211f05cddf9SRui Paulo
212206b73d0SCy Schubert
213206b73d0SCy Schubert enum ieee80211_op_mode {
214206b73d0SCy Schubert IEEE80211_MODE_INFRA = 0,
215206b73d0SCy Schubert IEEE80211_MODE_IBSS = 1,
216206b73d0SCy Schubert IEEE80211_MODE_AP = 2,
217206b73d0SCy Schubert IEEE80211_MODE_MESH = 5,
218206b73d0SCy Schubert
219206b73d0SCy Schubert /* only add new entries before IEEE80211_MODE_NUM */
220206b73d0SCy Schubert IEEE80211_MODE_NUM
221206b73d0SCy Schubert };
222206b73d0SCy Schubert
223e28a4053SRui Paulo /**
224c1d255d3SCy Schubert * struct ieee80211_edmg_config - EDMG configuration
225c1d255d3SCy Schubert *
226c1d255d3SCy Schubert * This structure describes most essential parameters needed
227c1d255d3SCy Schubert * for IEEE 802.11ay EDMG configuration
228c1d255d3SCy Schubert *
229c1d255d3SCy Schubert * @channels: Bitmap that indicates the 2.16 GHz channel(s)
230c1d255d3SCy Schubert * that are allowed to be used for transmissions.
231c1d255d3SCy Schubert * Bit 0 indicates channel 1, bit 1 indicates channel 2, etc.
232c1d255d3SCy Schubert * Set to 0 to indicate EDMG not supported.
233c1d255d3SCy Schubert * @bw_config: Channel BW Configuration subfield encodes
234c1d255d3SCy Schubert * the allowed channel bandwidth configurations
235c1d255d3SCy Schubert */
236c1d255d3SCy Schubert struct ieee80211_edmg_config {
237c1d255d3SCy Schubert u8 channels;
238c1d255d3SCy Schubert enum edmg_bw_config bw_config;
239c1d255d3SCy Schubert };
240c1d255d3SCy Schubert
241c1d255d3SCy Schubert /**
242e28a4053SRui Paulo * struct hostapd_hw_modes - Supported hardware mode information
243e28a4053SRui Paulo */
244e28a4053SRui Paulo struct hostapd_hw_modes {
245e28a4053SRui Paulo /**
246e28a4053SRui Paulo * mode - Hardware mode
247e28a4053SRui Paulo */
248e28a4053SRui Paulo enum hostapd_hw_mode mode;
249e28a4053SRui Paulo
250e28a4053SRui Paulo /**
251*a90b9d01SCy Schubert * is_6ghz - Whether the mode information is for the 6 GHz band
252*a90b9d01SCy Schubert */
253*a90b9d01SCy Schubert bool is_6ghz;
254*a90b9d01SCy Schubert
255*a90b9d01SCy Schubert /**
256e28a4053SRui Paulo * num_channels - Number of entries in the channels array
257e28a4053SRui Paulo */
258e28a4053SRui Paulo int num_channels;
259e28a4053SRui Paulo
260e28a4053SRui Paulo /**
261e28a4053SRui Paulo * channels - Array of supported channels
262e28a4053SRui Paulo */
263e28a4053SRui Paulo struct hostapd_channel_data *channels;
264e28a4053SRui Paulo
265e28a4053SRui Paulo /**
266e28a4053SRui Paulo * num_rates - Number of entries in the rates array
267e28a4053SRui Paulo */
268e28a4053SRui Paulo int num_rates;
269e28a4053SRui Paulo
270e28a4053SRui Paulo /**
271e28a4053SRui Paulo * rates - Array of supported rates in 100 kbps units
272e28a4053SRui Paulo */
273e28a4053SRui Paulo int *rates;
274e28a4053SRui Paulo
275e28a4053SRui Paulo /**
276e28a4053SRui Paulo * ht_capab - HT (IEEE 802.11n) capabilities
277e28a4053SRui Paulo */
278e28a4053SRui Paulo u16 ht_capab;
279e28a4053SRui Paulo
280e28a4053SRui Paulo /**
281e28a4053SRui Paulo * mcs_set - MCS (IEEE 802.11n) rate parameters
282e28a4053SRui Paulo */
283e28a4053SRui Paulo u8 mcs_set[16];
284e28a4053SRui Paulo
285e28a4053SRui Paulo /**
286e28a4053SRui Paulo * a_mpdu_params - A-MPDU (IEEE 802.11n) parameters
287e28a4053SRui Paulo */
288e28a4053SRui Paulo u8 a_mpdu_params;
289f05cddf9SRui Paulo
290f05cddf9SRui Paulo /**
291f05cddf9SRui Paulo * vht_capab - VHT (IEEE 802.11ac) capabilities
292f05cddf9SRui Paulo */
293f05cddf9SRui Paulo u32 vht_capab;
294f05cddf9SRui Paulo
295f05cddf9SRui Paulo /**
296f05cddf9SRui Paulo * vht_mcs_set - VHT MCS (IEEE 802.11ac) rate parameters
297f05cddf9SRui Paulo */
298f05cddf9SRui Paulo u8 vht_mcs_set[8];
299f05cddf9SRui Paulo
300f05cddf9SRui Paulo unsigned int flags; /* HOSTAPD_MODE_FLAG_* */
30185732ac8SCy Schubert
30285732ac8SCy Schubert /**
30385732ac8SCy Schubert * he_capab - HE (IEEE 802.11ax) capabilities
30485732ac8SCy Schubert */
305206b73d0SCy Schubert struct he_capabilities he_capab[IEEE80211_MODE_NUM];
306c1d255d3SCy Schubert
307c1d255d3SCy Schubert /**
308c1d255d3SCy Schubert * This structure describes the most essential parameters needed
309c1d255d3SCy Schubert * for IEEE 802.11ay EDMG configuration.
310c1d255d3SCy Schubert */
311c1d255d3SCy Schubert struct ieee80211_edmg_config edmg;
312*a90b9d01SCy Schubert
313*a90b9d01SCy Schubert /**
314*a90b9d01SCy Schubert * eht_capab - EHT (IEEE 802.11be) capabilities
315*a90b9d01SCy Schubert */
316*a90b9d01SCy Schubert struct eht_capabilities eht_capab[IEEE80211_MODE_NUM];
317e28a4053SRui Paulo };
318e28a4053SRui Paulo
31939beb93cSSam Leffler
32039beb93cSSam Leffler #define IEEE80211_CAP_ESS 0x0001
32139beb93cSSam Leffler #define IEEE80211_CAP_IBSS 0x0002
32239beb93cSSam Leffler #define IEEE80211_CAP_PRIVACY 0x0010
3235b9c547cSRui Paulo #define IEEE80211_CAP_RRM 0x1000
3245b9c547cSRui Paulo
3255b9c547cSRui Paulo /* DMG (60 GHz) IEEE 802.11ad */
3265b9c547cSRui Paulo /* type - bits 0..1 */
3275b9c547cSRui Paulo #define IEEE80211_CAP_DMG_MASK 0x0003
3285b9c547cSRui Paulo #define IEEE80211_CAP_DMG_IBSS 0x0001 /* Tx by: STA */
3295b9c547cSRui Paulo #define IEEE80211_CAP_DMG_PBSS 0x0002 /* Tx by: PCP */
3305b9c547cSRui Paulo #define IEEE80211_CAP_DMG_AP 0x0003 /* Tx by: AP */
33139beb93cSSam Leffler
332e28a4053SRui Paulo #define WPA_SCAN_QUAL_INVALID BIT(0)
333e28a4053SRui Paulo #define WPA_SCAN_NOISE_INVALID BIT(1)
334e28a4053SRui Paulo #define WPA_SCAN_LEVEL_INVALID BIT(2)
335e28a4053SRui Paulo #define WPA_SCAN_LEVEL_DBM BIT(3)
336e28a4053SRui Paulo #define WPA_SCAN_ASSOCIATED BIT(5)
33739beb93cSSam Leffler
33839beb93cSSam Leffler /**
33939beb93cSSam Leffler * struct wpa_scan_res - Scan result for an BSS/IBSS
340e28a4053SRui Paulo * @flags: information flags about the BSS/IBSS (WPA_SCAN_*)
34139beb93cSSam Leffler * @bssid: BSSID
34239beb93cSSam Leffler * @freq: frequency of the channel in MHz (e.g., 2412 = channel 1)
343*a90b9d01SCy Schubert * @max_cw: the max channel width of the connection (calculated during scan
344*a90b9d01SCy Schubert * result processing)
34539beb93cSSam Leffler * @beacon_int: beacon interval in TUs (host byte order)
34639beb93cSSam Leffler * @caps: capability information field in host byte order
34739beb93cSSam Leffler * @qual: signal quality
34839beb93cSSam Leffler * @noise: noise level
34939beb93cSSam Leffler * @level: signal level
35039beb93cSSam Leffler * @tsf: Timestamp
351e28a4053SRui Paulo * @age: Age of the information in milliseconds (i.e., how many milliseconds
352e28a4053SRui Paulo * ago the last Beacon or Probe Response frame was received)
3535b9c547cSRui Paulo * @est_throughput: Estimated throughput in kbps (this is calculated during
3545b9c547cSRui Paulo * scan result processing if left zero by the driver wrapper)
3555b9c547cSRui Paulo * @snr: Signal-to-noise ratio in dB (calculated during scan result processing)
35685732ac8SCy Schubert * @parent_tsf: Time when the Beacon/Probe Response frame was received in terms
35785732ac8SCy Schubert * of TSF of the BSS specified by %tsf_bssid.
35885732ac8SCy Schubert * @tsf_bssid: The BSS that %parent_tsf TSF time refers to.
359*a90b9d01SCy Schubert * @beacon_newer: Whether the Beacon frame data is known to be newer
36039beb93cSSam Leffler * @ie_len: length of the following IE field in octets
361e28a4053SRui Paulo * @beacon_ie_len: length of the following Beacon IE field in octets
36239beb93cSSam Leffler *
36339beb93cSSam Leffler * This structure is used as a generic format for scan results from the
36439beb93cSSam Leffler * driver. Each driver interface implementation is responsible for converting
36539beb93cSSam Leffler * the driver or OS specific scan results into this format.
36639beb93cSSam Leffler *
36739beb93cSSam Leffler * If the driver does not support reporting all IEs, the IE data structure is
36839beb93cSSam Leffler * constructed of the IEs that are available. This field will also need to
36939beb93cSSam Leffler * include SSID in IE format. All drivers are encouraged to be extended to
37039beb93cSSam Leffler * report all IEs to make it easier to support future additions.
3715b9c547cSRui Paulo *
3725b9c547cSRui Paulo * This structure data is followed by ie_len octets of IEs from Probe Response
3735b9c547cSRui Paulo * frame (or if the driver does not indicate source of IEs, these may also be
3745b9c547cSRui Paulo * from Beacon frame). After the first set of IEs, another set of IEs may follow
3755b9c547cSRui Paulo * (with beacon_ie_len octets of data) if the driver provides both IE sets.
37639beb93cSSam Leffler */
37739beb93cSSam Leffler struct wpa_scan_res {
378e28a4053SRui Paulo unsigned int flags;
37939beb93cSSam Leffler u8 bssid[ETH_ALEN];
38039beb93cSSam Leffler int freq;
381*a90b9d01SCy Schubert enum chan_width max_cw;
38239beb93cSSam Leffler u16 beacon_int;
38339beb93cSSam Leffler u16 caps;
38439beb93cSSam Leffler int qual;
38539beb93cSSam Leffler int noise;
38639beb93cSSam Leffler int level;
38739beb93cSSam Leffler u64 tsf;
388e28a4053SRui Paulo unsigned int age;
3895b9c547cSRui Paulo unsigned int est_throughput;
3905b9c547cSRui Paulo int snr;
39185732ac8SCy Schubert u64 parent_tsf;
39285732ac8SCy Schubert u8 tsf_bssid[ETH_ALEN];
393*a90b9d01SCy Schubert bool beacon_newer;
39439beb93cSSam Leffler size_t ie_len;
395e28a4053SRui Paulo size_t beacon_ie_len;
3965b9c547cSRui Paulo /* Followed by ie_len + beacon_ie_len octets of IE data */
39739beb93cSSam Leffler };
39839beb93cSSam Leffler
39939beb93cSSam Leffler /**
40039beb93cSSam Leffler * struct wpa_scan_results - Scan results
40139beb93cSSam Leffler * @res: Array of pointers to allocated variable length scan result entries
40239beb93cSSam Leffler * @num: Number of entries in the scan result array
4035b9c547cSRui Paulo * @fetch_time: Time when the results were fetched from the driver
40439beb93cSSam Leffler */
40539beb93cSSam Leffler struct wpa_scan_results {
40639beb93cSSam Leffler struct wpa_scan_res **res;
40739beb93cSSam Leffler size_t num;
4085b9c547cSRui Paulo struct os_reltime fetch_time;
40939beb93cSSam Leffler };
41039beb93cSSam Leffler
41139beb93cSSam Leffler /**
41239beb93cSSam Leffler * struct wpa_interface_info - Network interface information
41339beb93cSSam Leffler * @next: Pointer to the next interface or NULL if this is the last one
41439beb93cSSam Leffler * @ifname: Interface name that can be used with init() or init2()
41539beb93cSSam Leffler * @desc: Human readable adapter description (e.g., vendor/model) or NULL if
41639beb93cSSam Leffler * not available
4173157ba21SRui Paulo * @drv_name: struct wpa_driver_ops::name (note: unlike other strings, this one
41839beb93cSSam Leffler * is not an allocated copy, i.e., get_interfaces() caller will not free
41939beb93cSSam Leffler * this)
42039beb93cSSam Leffler */
42139beb93cSSam Leffler struct wpa_interface_info {
42239beb93cSSam Leffler struct wpa_interface_info *next;
42339beb93cSSam Leffler char *ifname;
42439beb93cSSam Leffler char *desc;
42539beb93cSSam Leffler const char *drv_name;
42639beb93cSSam Leffler };
42739beb93cSSam Leffler
428f05cddf9SRui Paulo #define WPAS_MAX_SCAN_SSIDS 16
429e28a4053SRui Paulo
430e28a4053SRui Paulo /**
431780fb4a2SCy Schubert * struct wpa_driver_scan_ssid - SSIDs to scan for
432780fb4a2SCy Schubert * @ssid - specific SSID to scan for (ProbeReq)
433780fb4a2SCy Schubert * %NULL or zero-length SSID is used to indicate active scan
434780fb4a2SCy Schubert * with wildcard SSID.
435780fb4a2SCy Schubert * @ssid_len - Length of the SSID in octets
436780fb4a2SCy Schubert */
437780fb4a2SCy Schubert struct wpa_driver_scan_ssid {
438780fb4a2SCy Schubert const u8 *ssid;
439780fb4a2SCy Schubert size_t ssid_len;
440780fb4a2SCy Schubert };
441780fb4a2SCy Schubert
442*a90b9d01SCy Schubert struct t2lm_mapping {
443*a90b9d01SCy Schubert /**
444*a90b9d01SCy Schubert * downlink - Bitmap of TIDs mapped with a link in downlink direction
445*a90b9d01SCy Schubert */
446*a90b9d01SCy Schubert u8 downlink;
447*a90b9d01SCy Schubert
448*a90b9d01SCy Schubert /**
449*a90b9d01SCy Schubert * uplink - Bitmap of TIDs mapped with a link in uplink direction
450*a90b9d01SCy Schubert */
451*a90b9d01SCy Schubert u8 uplink;
452*a90b9d01SCy Schubert };
453*a90b9d01SCy Schubert
454780fb4a2SCy Schubert /**
455e28a4053SRui Paulo * struct wpa_driver_scan_params - Scan parameters
456e28a4053SRui Paulo * Data for struct wpa_driver_ops::scan2().
457e28a4053SRui Paulo */
458e28a4053SRui Paulo struct wpa_driver_scan_params {
459e28a4053SRui Paulo /**
460e28a4053SRui Paulo * ssids - SSIDs to scan for
461e28a4053SRui Paulo */
462780fb4a2SCy Schubert struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS];
463e28a4053SRui Paulo
464e28a4053SRui Paulo /**
465e28a4053SRui Paulo * num_ssids - Number of entries in ssids array
466e28a4053SRui Paulo * Zero indicates a request for a passive scan.
467e28a4053SRui Paulo */
468e28a4053SRui Paulo size_t num_ssids;
469e28a4053SRui Paulo
470e28a4053SRui Paulo /**
471e28a4053SRui Paulo * extra_ies - Extra IE(s) to add into Probe Request or %NULL
472e28a4053SRui Paulo */
473e28a4053SRui Paulo const u8 *extra_ies;
474e28a4053SRui Paulo
475e28a4053SRui Paulo /**
476e28a4053SRui Paulo * extra_ies_len - Length of extra_ies in octets
477e28a4053SRui Paulo */
478e28a4053SRui Paulo size_t extra_ies_len;
479e28a4053SRui Paulo
480e28a4053SRui Paulo /**
481e28a4053SRui Paulo * freqs - Array of frequencies to scan or %NULL for all frequencies
482e28a4053SRui Paulo *
483e28a4053SRui Paulo * The frequency is set in MHz. The array is zero-terminated.
484e28a4053SRui Paulo */
485e28a4053SRui Paulo int *freqs;
486e28a4053SRui Paulo
487e28a4053SRui Paulo /**
488e28a4053SRui Paulo * filter_ssids - Filter for reporting SSIDs
489e28a4053SRui Paulo *
490e28a4053SRui Paulo * This optional parameter can be used to request the driver wrapper to
491e28a4053SRui Paulo * filter scan results to include only the specified SSIDs. %NULL
492e28a4053SRui Paulo * indicates that no filtering is to be done. This can be used to
493e28a4053SRui Paulo * reduce memory needs for scan results in environments that have large
494e28a4053SRui Paulo * number of APs with different SSIDs.
495e28a4053SRui Paulo *
496e28a4053SRui Paulo * The driver wrapper is allowed to take this allocated buffer into its
497e28a4053SRui Paulo * own use by setting the pointer to %NULL. In that case, the driver
498e28a4053SRui Paulo * wrapper is responsible for freeing the buffer with os_free() once it
499e28a4053SRui Paulo * is not needed anymore.
500e28a4053SRui Paulo */
501e28a4053SRui Paulo struct wpa_driver_scan_filter {
502325151a3SRui Paulo u8 ssid[SSID_MAX_LEN];
503e28a4053SRui Paulo size_t ssid_len;
504e28a4053SRui Paulo } *filter_ssids;
505e28a4053SRui Paulo
506e28a4053SRui Paulo /**
507e28a4053SRui Paulo * num_filter_ssids - Number of entries in filter_ssids array
508e28a4053SRui Paulo */
509e28a4053SRui Paulo size_t num_filter_ssids;
510f05cddf9SRui Paulo
511f05cddf9SRui Paulo /**
512f05cddf9SRui Paulo * filter_rssi - Filter by RSSI
513f05cddf9SRui Paulo *
514f05cddf9SRui Paulo * The driver may filter scan results in firmware to reduce host
515f05cddf9SRui Paulo * wakeups and thereby save power. Specify the RSSI threshold in s32
516f05cddf9SRui Paulo * dBm.
517f05cddf9SRui Paulo */
518f05cddf9SRui Paulo s32 filter_rssi;
519f05cddf9SRui Paulo
520f05cddf9SRui Paulo /**
521f05cddf9SRui Paulo * p2p_probe - Used to disable CCK (802.11b) rates for P2P probes
522f05cddf9SRui Paulo *
523f05cddf9SRui Paulo * When set, the driver is expected to remove rates 1, 2, 5.5, and 11
524f05cddf9SRui Paulo * Mbps from the support rates element(s) in the Probe Request frames
525f05cddf9SRui Paulo * and not to transmit the frames at any of those rates.
526f05cddf9SRui Paulo */
5275b9c547cSRui Paulo unsigned int p2p_probe:1;
5285b9c547cSRui Paulo
5295b9c547cSRui Paulo /**
5305b9c547cSRui Paulo * only_new_results - Request driver to report only new results
5315b9c547cSRui Paulo *
5325b9c547cSRui Paulo * This is used to request the driver to report only BSSes that have
5335b9c547cSRui Paulo * been detected after this scan request has been started, i.e., to
5345b9c547cSRui Paulo * flush old cached BSS entries.
5355b9c547cSRui Paulo */
5365b9c547cSRui Paulo unsigned int only_new_results:1;
5375b9c547cSRui Paulo
5385b9c547cSRui Paulo /**
5395b9c547cSRui Paulo * low_priority - Requests driver to use a lower scan priority
5405b9c547cSRui Paulo *
5415b9c547cSRui Paulo * This is used to request the driver to use a lower scan priority
5425b9c547cSRui Paulo * if it supports such a thing.
5435b9c547cSRui Paulo */
5445b9c547cSRui Paulo unsigned int low_priority:1;
5455b9c547cSRui Paulo
5465b9c547cSRui Paulo /**
5475b9c547cSRui Paulo * mac_addr_rand - Requests driver to randomize MAC address
5485b9c547cSRui Paulo */
5495b9c547cSRui Paulo unsigned int mac_addr_rand:1;
5505b9c547cSRui Paulo
5515b9c547cSRui Paulo /**
5525b9c547cSRui Paulo * mac_addr - MAC address used with randomization. The address cannot be
5535b9c547cSRui Paulo * a multicast one, i.e., bit 0 of byte 0 should not be set.
5545b9c547cSRui Paulo */
555c1d255d3SCy Schubert u8 *mac_addr;
5565b9c547cSRui Paulo
5575b9c547cSRui Paulo /**
5585b9c547cSRui Paulo * mac_addr_mask - MAC address mask used with randomization.
5595b9c547cSRui Paulo *
5605b9c547cSRui Paulo * Bits that are 0 in the mask should be randomized. Bits that are 1 in
5615b9c547cSRui Paulo * the mask should be taken as is from mac_addr. The mask should not
5625b9c547cSRui Paulo * allow the generation of a multicast address, i.e., bit 0 of byte 0
5635b9c547cSRui Paulo * must be set.
5645b9c547cSRui Paulo */
5655b9c547cSRui Paulo const u8 *mac_addr_mask;
5665b9c547cSRui Paulo
567780fb4a2SCy Schubert /**
568780fb4a2SCy Schubert * sched_scan_plans - Scan plans for scheduled scan
569780fb4a2SCy Schubert *
570780fb4a2SCy Schubert * Each scan plan consists of the number of iterations to scan and the
571780fb4a2SCy Schubert * interval between scans. When a scan plan finishes (i.e., it was run
572780fb4a2SCy Schubert * for the specified number of iterations), the next scan plan is
573780fb4a2SCy Schubert * executed. The scan plans are executed in the order they appear in
574780fb4a2SCy Schubert * the array (lower index first). The last scan plan will run infinitely
575780fb4a2SCy Schubert * (until requested to stop), thus must not specify the number of
576780fb4a2SCy Schubert * iterations. All other scan plans must specify the number of
577780fb4a2SCy Schubert * iterations.
578780fb4a2SCy Schubert */
579780fb4a2SCy Schubert struct sched_scan_plan {
580780fb4a2SCy Schubert u32 interval; /* In seconds */
581780fb4a2SCy Schubert u32 iterations; /* Zero to run infinitely */
582780fb4a2SCy Schubert } *sched_scan_plans;
583780fb4a2SCy Schubert
584780fb4a2SCy Schubert /**
585780fb4a2SCy Schubert * sched_scan_plans_num - Number of scan plans in sched_scan_plans array
586780fb4a2SCy Schubert */
587780fb4a2SCy Schubert unsigned int sched_scan_plans_num;
588780fb4a2SCy Schubert
589780fb4a2SCy Schubert /**
59085732ac8SCy Schubert * sched_scan_start_delay - Delay to use before starting the first scan
59185732ac8SCy Schubert *
59285732ac8SCy Schubert * Delay (in seconds) before scheduling first scan plan cycle. The
59385732ac8SCy Schubert * driver may ignore this parameter and start immediately (or at any
59485732ac8SCy Schubert * other time), if this feature is not supported.
59585732ac8SCy Schubert */
59685732ac8SCy Schubert u32 sched_scan_start_delay;
59785732ac8SCy Schubert
59885732ac8SCy Schubert /**
599780fb4a2SCy Schubert * bssid - Specific BSSID to scan for
600780fb4a2SCy Schubert *
601780fb4a2SCy Schubert * This optional parameter can be used to replace the default wildcard
602780fb4a2SCy Schubert * BSSID with a specific BSSID to scan for if results are needed from
603780fb4a2SCy Schubert * only a single BSS.
604780fb4a2SCy Schubert */
605780fb4a2SCy Schubert const u8 *bssid;
606780fb4a2SCy Schubert
60785732ac8SCy Schubert /**
60885732ac8SCy Schubert * scan_cookie - Unique identification representing the scan request
60985732ac8SCy Schubert *
61085732ac8SCy Schubert * This scan_cookie carries a unique identification representing the
61185732ac8SCy Schubert * scan request if the host driver/kernel supports concurrent scan
61285732ac8SCy Schubert * requests. This cookie is returned from the corresponding driver
61385732ac8SCy Schubert * interface.
61485732ac8SCy Schubert *
61585732ac8SCy Schubert * Note: Unlike other parameters in this structure, scan_cookie is used
61685732ac8SCy Schubert * only to return information instead of setting parameters for the
61785732ac8SCy Schubert * scan.
61885732ac8SCy Schubert */
61985732ac8SCy Schubert u64 scan_cookie;
62085732ac8SCy Schubert
62185732ac8SCy Schubert /**
62285732ac8SCy Schubert * duration - Dwell time on each channel
62385732ac8SCy Schubert *
62485732ac8SCy Schubert * This optional parameter can be used to set the dwell time on each
62585732ac8SCy Schubert * channel. In TUs.
62685732ac8SCy Schubert */
62785732ac8SCy Schubert u16 duration;
62885732ac8SCy Schubert
62985732ac8SCy Schubert /**
63085732ac8SCy Schubert * duration_mandatory - Whether the specified duration is mandatory
63185732ac8SCy Schubert *
63285732ac8SCy Schubert * If this is set, the duration specified by the %duration field is
63385732ac8SCy Schubert * mandatory (and the driver should reject the scan request if it is
63485732ac8SCy Schubert * unable to comply with the specified duration), otherwise it is the
63585732ac8SCy Schubert * maximum duration and the actual duration may be shorter.
63685732ac8SCy Schubert */
63785732ac8SCy Schubert unsigned int duration_mandatory:1;
63885732ac8SCy Schubert
63985732ac8SCy Schubert /**
64085732ac8SCy Schubert * relative_rssi_set - Whether relative RSSI parameters are set
64185732ac8SCy Schubert */
64285732ac8SCy Schubert unsigned int relative_rssi_set:1;
64385732ac8SCy Schubert
64485732ac8SCy Schubert /**
64585732ac8SCy Schubert * relative_rssi - Relative RSSI for reporting better BSSs
64685732ac8SCy Schubert *
64785732ac8SCy Schubert * Amount of RSSI by which a BSS should be better than the current
64885732ac8SCy Schubert * connected BSS to report the new BSS to user space.
64985732ac8SCy Schubert */
65085732ac8SCy Schubert s8 relative_rssi;
65185732ac8SCy Schubert
65285732ac8SCy Schubert /**
65385732ac8SCy Schubert * relative_adjust_band - Band to which RSSI should be adjusted
65485732ac8SCy Schubert *
65585732ac8SCy Schubert * The relative_adjust_rssi should be added to the band specified
65685732ac8SCy Schubert * by relative_adjust_band.
65785732ac8SCy Schubert */
65885732ac8SCy Schubert enum set_band relative_adjust_band;
65985732ac8SCy Schubert
66085732ac8SCy Schubert /**
66185732ac8SCy Schubert * relative_adjust_rssi - RSSI to be added to relative_adjust_band
66285732ac8SCy Schubert *
66385732ac8SCy Schubert * An amount of relative_band_rssi should be added to the BSSs that
66485732ac8SCy Schubert * belong to the band specified by relative_adjust_band while comparing
66585732ac8SCy Schubert * with other bands for BSS reporting.
66685732ac8SCy Schubert */
66785732ac8SCy Schubert s8 relative_adjust_rssi;
66885732ac8SCy Schubert
66985732ac8SCy Schubert /**
67085732ac8SCy Schubert * oce_scan
67185732ac8SCy Schubert *
67285732ac8SCy Schubert * Enable the following OCE scan features: (WFA OCE TechSpec v1.0)
67385732ac8SCy Schubert * - Accept broadcast Probe Response frame.
67485732ac8SCy Schubert * - Probe Request frame deferral and suppression.
67585732ac8SCy Schubert * - Max Channel Time - driver fills FILS request params IE with
67685732ac8SCy Schubert * Maximum Channel Time.
67785732ac8SCy Schubert * - Send 1st Probe Request frame in rate of minimum 5.5 Mbps.
67885732ac8SCy Schubert */
67985732ac8SCy Schubert unsigned int oce_scan:1;
68085732ac8SCy Schubert
681c1d255d3SCy Schubert /**
682c1d255d3SCy Schubert * p2p_include_6ghz - Include 6 GHz channels for P2P full scan
683c1d255d3SCy Schubert *
684c1d255d3SCy Schubert */
685c1d255d3SCy Schubert unsigned int p2p_include_6ghz:1;
686c1d255d3SCy Schubert
687*a90b9d01SCy Schubert /**
688*a90b9d01SCy Schubert * non_coloc_6ghz - Force scanning of non-PSC 6 GHz channels
689*a90b9d01SCy Schubert *
690*a90b9d01SCy Schubert * If this is set, the driver should scan non-PSC channels from the
691*a90b9d01SCy Schubert * scan request even if neighbor reports from 2.4/5 GHz APs did not
692*a90b9d01SCy Schubert * report a co-located AP on these channels. The default is to scan
693*a90b9d01SCy Schubert * non-PSC channels only if a co-located AP was reported on the channel.
694*a90b9d01SCy Schubert */
695*a90b9d01SCy Schubert unsigned int non_coloc_6ghz:1;
696*a90b9d01SCy Schubert
697*a90b9d01SCy Schubert /**
698*a90b9d01SCy Schubert * min_probe_req_content - Minimize probe request content to only have
699*a90b9d01SCy Schubert * minimal requirement elements, e.g., supported rates etc., and no
700*a90b9d01SCy Schubert * additional elements other then those provided by user space.
701*a90b9d01SCy Schubert */
702*a90b9d01SCy Schubert unsigned int min_probe_req_content:1;
703*a90b9d01SCy Schubert
704*a90b9d01SCy Schubert /**
705*a90b9d01SCy Schubert * link_id - Specify the link that is requesting the scan on an MLD
706*a90b9d01SCy Schubert *
707*a90b9d01SCy Schubert * This is set when operating as an AP MLD and doing an OBSS scan.
708*a90b9d01SCy Schubert * -1 indicates that no particular link ID is set.
709*a90b9d01SCy Schubert */
710*a90b9d01SCy Schubert s8 link_id;
711*a90b9d01SCy Schubert
7125b9c547cSRui Paulo /*
7135b9c547cSRui Paulo * NOTE: Whenever adding new parameters here, please make sure
7145b9c547cSRui Paulo * wpa_scan_clone_params() and wpa_scan_free_params() get updated with
7155b9c547cSRui Paulo * matching changes.
7165b9c547cSRui Paulo */
717e28a4053SRui Paulo };
718e28a4053SRui Paulo
719e28a4053SRui Paulo /**
720e28a4053SRui Paulo * struct wpa_driver_auth_params - Authentication parameters
721e28a4053SRui Paulo * Data for struct wpa_driver_ops::authenticate().
722e28a4053SRui Paulo */
723e28a4053SRui Paulo struct wpa_driver_auth_params {
724e28a4053SRui Paulo int freq;
725e28a4053SRui Paulo const u8 *bssid;
726e28a4053SRui Paulo const u8 *ssid;
727e28a4053SRui Paulo size_t ssid_len;
728e28a4053SRui Paulo int auth_alg;
729e28a4053SRui Paulo const u8 *ie;
730e28a4053SRui Paulo size_t ie_len;
731e28a4053SRui Paulo const u8 *wep_key[4];
732e28a4053SRui Paulo size_t wep_key_len[4];
733e28a4053SRui Paulo int wep_tx_keyidx;
734e28a4053SRui Paulo int local_state_change;
735f05cddf9SRui Paulo
736f05cddf9SRui Paulo /**
737f05cddf9SRui Paulo * p2p - Whether this connection is a P2P group
738f05cddf9SRui Paulo */
739f05cddf9SRui Paulo int p2p;
740f05cddf9SRui Paulo
7415b9c547cSRui Paulo /**
74285732ac8SCy Schubert * auth_data - Additional elements for Authentication frame
7435b9c547cSRui Paulo *
7445b9c547cSRui Paulo * This buffer starts with the Authentication transaction sequence
74585732ac8SCy Schubert * number field. If no special handling of such elements is needed, this
74685732ac8SCy Schubert * pointer is %NULL. This is used with SAE and FILS.
7475b9c547cSRui Paulo */
74885732ac8SCy Schubert const u8 *auth_data;
749f05cddf9SRui Paulo
7505b9c547cSRui Paulo /**
75185732ac8SCy Schubert * auth_data_len - Length of auth_data buffer in octets
7525b9c547cSRui Paulo */
75385732ac8SCy Schubert size_t auth_data_len;
754*a90b9d01SCy Schubert
755*a90b9d01SCy Schubert /**
756*a90b9d01SCy Schubert * mld - Establish an MLD connection
757*a90b9d01SCy Schubert */
758*a90b9d01SCy Schubert bool mld;
759*a90b9d01SCy Schubert
760*a90b9d01SCy Schubert /**
761*a90b9d01SCy Schubert * mld_link_id - The link ID of the MLD AP to which we are associating
762*a90b9d01SCy Schubert */
763*a90b9d01SCy Schubert u8 mld_link_id;
764*a90b9d01SCy Schubert
765*a90b9d01SCy Schubert /**
766*a90b9d01SCy Schubert * The MLD AP address
767*a90b9d01SCy Schubert */
768*a90b9d01SCy Schubert const u8 *ap_mld_addr;
769f05cddf9SRui Paulo };
770f05cddf9SRui Paulo
7715b9c547cSRui Paulo /**
7725b9c547cSRui Paulo * enum wps_mode - WPS mode
773f05cddf9SRui Paulo */
7745b9c547cSRui Paulo enum wps_mode {
7755b9c547cSRui Paulo /**
7765b9c547cSRui Paulo * WPS_MODE_NONE - No WPS provisioning being used
7775b9c547cSRui Paulo */
7785b9c547cSRui Paulo WPS_MODE_NONE,
7795b9c547cSRui Paulo
7805b9c547cSRui Paulo /**
7815b9c547cSRui Paulo * WPS_MODE_OPEN - WPS provisioning with AP that is in open mode
7825b9c547cSRui Paulo */
7835b9c547cSRui Paulo WPS_MODE_OPEN,
7845b9c547cSRui Paulo
7855b9c547cSRui Paulo /**
7865b9c547cSRui Paulo * WPS_MODE_PRIVACY - WPS provisioning with AP that is using protection
7875b9c547cSRui Paulo */
7885b9c547cSRui Paulo WPS_MODE_PRIVACY
7895b9c547cSRui Paulo };
7905b9c547cSRui Paulo
7915b9c547cSRui Paulo /**
7925b9c547cSRui Paulo * struct hostapd_freq_params - Channel parameters
7935b9c547cSRui Paulo */
7945b9c547cSRui Paulo struct hostapd_freq_params {
7955b9c547cSRui Paulo /**
7965b9c547cSRui Paulo * mode - Mode/band (HOSTAPD_MODE_IEEE80211A, ..)
7975b9c547cSRui Paulo */
7985b9c547cSRui Paulo enum hostapd_hw_mode mode;
7995b9c547cSRui Paulo
8005b9c547cSRui Paulo /**
8015b9c547cSRui Paulo * freq - Primary channel center frequency in MHz
8025b9c547cSRui Paulo */
8035b9c547cSRui Paulo int freq;
8045b9c547cSRui Paulo
8055b9c547cSRui Paulo /**
8065b9c547cSRui Paulo * channel - Channel number
8075b9c547cSRui Paulo */
8085b9c547cSRui Paulo int channel;
8095b9c547cSRui Paulo
8105b9c547cSRui Paulo /**
8115b9c547cSRui Paulo * ht_enabled - Whether HT is enabled
8125b9c547cSRui Paulo */
8135b9c547cSRui Paulo int ht_enabled;
8145b9c547cSRui Paulo
8155b9c547cSRui Paulo /**
8165b9c547cSRui Paulo * sec_channel_offset - Secondary channel offset for HT40
8175b9c547cSRui Paulo *
8185b9c547cSRui Paulo * 0 = HT40 disabled,
8195b9c547cSRui Paulo * -1 = HT40 enabled, secondary channel below primary,
8205b9c547cSRui Paulo * 1 = HT40 enabled, secondary channel above primary
8215b9c547cSRui Paulo */
8225b9c547cSRui Paulo int sec_channel_offset;
8235b9c547cSRui Paulo
8245b9c547cSRui Paulo /**
8255b9c547cSRui Paulo * vht_enabled - Whether VHT is enabled
8265b9c547cSRui Paulo */
8275b9c547cSRui Paulo int vht_enabled;
8285b9c547cSRui Paulo
8295b9c547cSRui Paulo /**
830206b73d0SCy Schubert * he_enabled - Whether HE is enabled
831206b73d0SCy Schubert */
832206b73d0SCy Schubert int he_enabled;
833206b73d0SCy Schubert
834206b73d0SCy Schubert /**
8355b9c547cSRui Paulo * center_freq1 - Segment 0 center frequency in MHz
8365b9c547cSRui Paulo *
8375b9c547cSRui Paulo * Valid for both HT and VHT.
8385b9c547cSRui Paulo */
8395b9c547cSRui Paulo int center_freq1;
8405b9c547cSRui Paulo
8415b9c547cSRui Paulo /**
8425b9c547cSRui Paulo * center_freq2 - Segment 1 center frequency in MHz
8435b9c547cSRui Paulo *
8445b9c547cSRui Paulo * Non-zero only for bandwidth 80 and an 80+80 channel
8455b9c547cSRui Paulo */
8465b9c547cSRui Paulo int center_freq2;
8475b9c547cSRui Paulo
8485b9c547cSRui Paulo /**
8495b9c547cSRui Paulo * bandwidth - Channel bandwidth in MHz (20, 40, 80, 160)
8505b9c547cSRui Paulo */
8515b9c547cSRui Paulo int bandwidth;
852c1d255d3SCy Schubert
853c1d255d3SCy Schubert /**
854c1d255d3SCy Schubert * This structure describes the most essential parameters needed
855c1d255d3SCy Schubert * for IEEE 802.11ay EDMG configuration.
856c1d255d3SCy Schubert */
857c1d255d3SCy Schubert struct ieee80211_edmg_config edmg;
858*a90b9d01SCy Schubert
859*a90b9d01SCy Schubert /**
860*a90b9d01SCy Schubert * radar_background - Whether radar/CAC background is requested
861*a90b9d01SCy Schubert */
862*a90b9d01SCy Schubert bool radar_background;
863*a90b9d01SCy Schubert
864*a90b9d01SCy Schubert /**
865*a90b9d01SCy Schubert * eht_enabled - Whether EHT is enabled
866*a90b9d01SCy Schubert */
867*a90b9d01SCy Schubert bool eht_enabled;
868*a90b9d01SCy Schubert
869*a90b9d01SCy Schubert /**
870*a90b9d01SCy Schubert * link_id: If >=0 indicates the link of the AP MLD to configure
871*a90b9d01SCy Schubert */
872*a90b9d01SCy Schubert int link_id;
873e28a4053SRui Paulo };
874e28a4053SRui Paulo
87539beb93cSSam Leffler /**
87685732ac8SCy Schubert * struct wpa_driver_sta_auth_params - Authentication parameters
87785732ac8SCy Schubert * Data for struct wpa_driver_ops::sta_auth().
87885732ac8SCy Schubert */
87985732ac8SCy Schubert struct wpa_driver_sta_auth_params {
88085732ac8SCy Schubert
88185732ac8SCy Schubert /**
88285732ac8SCy Schubert * own_addr - Source address and BSSID for authentication frame
88385732ac8SCy Schubert */
88485732ac8SCy Schubert const u8 *own_addr;
88585732ac8SCy Schubert
88685732ac8SCy Schubert /**
88785732ac8SCy Schubert * addr - MAC address of the station to associate
88885732ac8SCy Schubert */
88985732ac8SCy Schubert const u8 *addr;
89085732ac8SCy Schubert
89185732ac8SCy Schubert /**
89285732ac8SCy Schubert * seq - authentication sequence number
89385732ac8SCy Schubert */
89485732ac8SCy Schubert u16 seq;
89585732ac8SCy Schubert
89685732ac8SCy Schubert /**
89785732ac8SCy Schubert * status - authentication response status code
89885732ac8SCy Schubert */
89985732ac8SCy Schubert u16 status;
90085732ac8SCy Schubert
90185732ac8SCy Schubert /**
90285732ac8SCy Schubert * ie - authentication frame ie buffer
90385732ac8SCy Schubert */
90485732ac8SCy Schubert const u8 *ie;
90585732ac8SCy Schubert
90685732ac8SCy Schubert /**
90785732ac8SCy Schubert * len - ie buffer length
90885732ac8SCy Schubert */
90985732ac8SCy Schubert size_t len;
91085732ac8SCy Schubert
91185732ac8SCy Schubert /**
91285732ac8SCy Schubert * fils_auth - Indicates whether FILS authentication is being performed
91385732ac8SCy Schubert */
91485732ac8SCy Schubert int fils_auth;
91585732ac8SCy Schubert
91685732ac8SCy Schubert /**
91785732ac8SCy Schubert * fils_anonce - ANonce (required for FILS)
91885732ac8SCy Schubert */
91985732ac8SCy Schubert u8 fils_anonce[WPA_NONCE_LEN];
92085732ac8SCy Schubert
92185732ac8SCy Schubert /**
92285732ac8SCy Schubert * fils_snonce - SNonce (required for FILS)
92385732ac8SCy Schubert */
92485732ac8SCy Schubert u8 fils_snonce[WPA_NONCE_LEN];
92585732ac8SCy Schubert
92685732ac8SCy Schubert /**
92785732ac8SCy Schubert * fils_kek - key for encryption (required for FILS)
92885732ac8SCy Schubert */
92985732ac8SCy Schubert u8 fils_kek[WPA_KEK_MAX_LEN];
93085732ac8SCy Schubert
93185732ac8SCy Schubert /**
93285732ac8SCy Schubert * fils_kek_len - Length of the fils_kek in octets (required for FILS)
93385732ac8SCy Schubert */
93485732ac8SCy Schubert size_t fils_kek_len;
93585732ac8SCy Schubert };
93685732ac8SCy Schubert
937*a90b9d01SCy Schubert struct wpa_driver_mld_params {
938*a90b9d01SCy Schubert /**
939*a90b9d01SCy Schubert * mld_addr - AP's MLD address
940*a90b9d01SCy Schubert */
941*a90b9d01SCy Schubert const u8 *mld_addr;
942*a90b9d01SCy Schubert
943*a90b9d01SCy Schubert /**
944*a90b9d01SCy Schubert * valid_links - The valid links including the association link
945*a90b9d01SCy Schubert */
946*a90b9d01SCy Schubert u16 valid_links;
947*a90b9d01SCy Schubert
948*a90b9d01SCy Schubert /**
949*a90b9d01SCy Schubert * assoc_link_id - The link on which the association is performed
950*a90b9d01SCy Schubert */
951*a90b9d01SCy Schubert u8 assoc_link_id;
952*a90b9d01SCy Schubert
953*a90b9d01SCy Schubert /**
954*a90b9d01SCy Schubert * mld_links - Link information
955*a90b9d01SCy Schubert *
956*a90b9d01SCy Schubert * Should include information on all the requested links for association
957*a90b9d01SCy Schubert * including the link on which the association should take place.
958*a90b9d01SCy Schubert * For the association link, the ies and ies_len should be NULL and
959*a90b9d01SCy Schubert * 0 respectively.
960*a90b9d01SCy Schubert */
961*a90b9d01SCy Schubert struct {
962*a90b9d01SCy Schubert int freq;
963*a90b9d01SCy Schubert const u8 *bssid;
964*a90b9d01SCy Schubert const u8 *ies;
965*a90b9d01SCy Schubert size_t ies_len;
966*a90b9d01SCy Schubert int error;
967*a90b9d01SCy Schubert bool disabled;
968*a90b9d01SCy Schubert } mld_links[MAX_NUM_MLD_LINKS];
969*a90b9d01SCy Schubert };
970*a90b9d01SCy Schubert
97185732ac8SCy Schubert /**
97239beb93cSSam Leffler * struct wpa_driver_associate_params - Association parameters
97339beb93cSSam Leffler * Data for struct wpa_driver_ops::associate().
97439beb93cSSam Leffler */
97539beb93cSSam Leffler struct wpa_driver_associate_params {
97639beb93cSSam Leffler /**
97739beb93cSSam Leffler * bssid - BSSID of the selected AP
97839beb93cSSam Leffler * This can be %NULL, if ap_scan=2 mode is used and the driver is
97939beb93cSSam Leffler * responsible for selecting with which BSS to associate. */
98039beb93cSSam Leffler const u8 *bssid;
98139beb93cSSam Leffler
98239beb93cSSam Leffler /**
9835b9c547cSRui Paulo * bssid_hint - BSSID of a proposed AP
9845b9c547cSRui Paulo *
9855b9c547cSRui Paulo * This indicates which BSS has been found a suitable candidate for
9865b9c547cSRui Paulo * initial association for drivers that use driver/firmwate-based BSS
9875b9c547cSRui Paulo * selection. Unlike the @bssid parameter, @bssid_hint does not limit
9885b9c547cSRui Paulo * the driver from selecting other BSSes in the ESS.
9895b9c547cSRui Paulo */
9905b9c547cSRui Paulo const u8 *bssid_hint;
9915b9c547cSRui Paulo
9925b9c547cSRui Paulo /**
99339beb93cSSam Leffler * ssid - The selected SSID
99439beb93cSSam Leffler */
99539beb93cSSam Leffler const u8 *ssid;
996e28a4053SRui Paulo
997e28a4053SRui Paulo /**
998e28a4053SRui Paulo * ssid_len - Length of the SSID (1..32)
999e28a4053SRui Paulo */
100039beb93cSSam Leffler size_t ssid_len;
100139beb93cSSam Leffler
100239beb93cSSam Leffler /**
10035b9c547cSRui Paulo * freq - channel parameters
100439beb93cSSam Leffler */
10055b9c547cSRui Paulo struct hostapd_freq_params freq;
10065b9c547cSRui Paulo
10075b9c547cSRui Paulo /**
10085b9c547cSRui Paulo * freq_hint - Frequency of the channel the proposed AP is using
10095b9c547cSRui Paulo *
10105b9c547cSRui Paulo * This provides a channel on which a suitable BSS has been found as a
10115b9c547cSRui Paulo * hint for the driver. Unlike the @freq parameter, @freq_hint does not
10125b9c547cSRui Paulo * limit the driver from selecting other channels for
10135b9c547cSRui Paulo * driver/firmware-based BSS selection.
10145b9c547cSRui Paulo */
10155b9c547cSRui Paulo int freq_hint;
101639beb93cSSam Leffler
101739beb93cSSam Leffler /**
1018f05cddf9SRui Paulo * bg_scan_period - Background scan period in seconds, 0 to disable
1019f05cddf9SRui Paulo * background scan, or -1 to indicate no change to default driver
1020f05cddf9SRui Paulo * configuration
1021f05cddf9SRui Paulo */
1022f05cddf9SRui Paulo int bg_scan_period;
1023f05cddf9SRui Paulo
1024f05cddf9SRui Paulo /**
10255b9c547cSRui Paulo * beacon_int - Beacon interval for IBSS or 0 to use driver default
10265b9c547cSRui Paulo */
10275b9c547cSRui Paulo int beacon_int;
10285b9c547cSRui Paulo
10295b9c547cSRui Paulo /**
103039beb93cSSam Leffler * wpa_ie - WPA information element for (Re)Association Request
103139beb93cSSam Leffler * WPA information element to be included in (Re)Association
103239beb93cSSam Leffler * Request (including information element id and length). Use
103339beb93cSSam Leffler * of this WPA IE is optional. If the driver generates the WPA
103485732ac8SCy Schubert * IE, it can use pairwise_suite, group_suite, group_mgmt_suite, and
103539beb93cSSam Leffler * key_mgmt_suite to select proper algorithms. In this case,
103639beb93cSSam Leffler * the driver has to notify wpa_supplicant about the used WPA
103739beb93cSSam Leffler * IE by generating an event that the interface code will
103839beb93cSSam Leffler * convert into EVENT_ASSOCINFO data (see below).
103939beb93cSSam Leffler *
104039beb93cSSam Leffler * When using WPA2/IEEE 802.11i, wpa_ie is used for RSN IE
104139beb93cSSam Leffler * instead. The driver can determine which version is used by
104239beb93cSSam Leffler * looking at the first byte of the IE (0xdd for WPA, 0x30 for
104339beb93cSSam Leffler * WPA2/RSN).
104439beb93cSSam Leffler *
104539beb93cSSam Leffler * When using WPS, wpa_ie is used for WPS IE instead of WPA/RSN IE.
104639beb93cSSam Leffler */
104739beb93cSSam Leffler const u8 *wpa_ie;
1048e28a4053SRui Paulo
104939beb93cSSam Leffler /**
105039beb93cSSam Leffler * wpa_ie_len - length of the wpa_ie
105139beb93cSSam Leffler */
105239beb93cSSam Leffler size_t wpa_ie_len;
105339beb93cSSam Leffler
1054e28a4053SRui Paulo /**
1055f05cddf9SRui Paulo * wpa_proto - Bitfield of WPA_PROTO_* values to indicate WPA/WPA2
1056f05cddf9SRui Paulo */
1057f05cddf9SRui Paulo unsigned int wpa_proto;
1058f05cddf9SRui Paulo
1059f05cddf9SRui Paulo /**
10605b9c547cSRui Paulo * pairwise_suite - Selected pairwise cipher suite (WPA_CIPHER_*)
1061e28a4053SRui Paulo *
1062e28a4053SRui Paulo * This is usually ignored if @wpa_ie is used.
1063e28a4053SRui Paulo */
10645b9c547cSRui Paulo unsigned int pairwise_suite;
1065e28a4053SRui Paulo
1066e28a4053SRui Paulo /**
10675b9c547cSRui Paulo * group_suite - Selected group cipher suite (WPA_CIPHER_*)
1068e28a4053SRui Paulo *
1069e28a4053SRui Paulo * This is usually ignored if @wpa_ie is used.
1070e28a4053SRui Paulo */
10715b9c547cSRui Paulo unsigned int group_suite;
1072e28a4053SRui Paulo
1073e28a4053SRui Paulo /**
107485732ac8SCy Schubert * mgmt_group_suite - Selected group management cipher suite (WPA_CIPHER_*)
107585732ac8SCy Schubert *
107685732ac8SCy Schubert * This is usually ignored if @wpa_ie is used.
107785732ac8SCy Schubert */
107885732ac8SCy Schubert unsigned int mgmt_group_suite;
107985732ac8SCy Schubert
108085732ac8SCy Schubert /**
10815b9c547cSRui Paulo * key_mgmt_suite - Selected key management suite (WPA_KEY_MGMT_*)
1082e28a4053SRui Paulo *
1083e28a4053SRui Paulo * This is usually ignored if @wpa_ie is used.
1084e28a4053SRui Paulo */
10855b9c547cSRui Paulo unsigned int key_mgmt_suite;
108639beb93cSSam Leffler
108739beb93cSSam Leffler /**
1088*a90b9d01SCy Schubert * allowed_key_mgmts - Bitfield of allowed key management suites
1089*a90b9d01SCy Schubert * (WPA_KEY_MGMT_*) other than @key_mgmt_suite for the current
1090*a90b9d01SCy Schubert * connection
1091*a90b9d01SCy Schubert *
1092*a90b9d01SCy Schubert * SME in the driver may choose key_mgmt from this list for the initial
1093*a90b9d01SCy Schubert * connection or roaming. The driver which doesn't support this
1094*a90b9d01SCy Schubert * ignores this parameter.
1095*a90b9d01SCy Schubert */
1096*a90b9d01SCy Schubert unsigned int allowed_key_mgmts;
1097*a90b9d01SCy Schubert
1098*a90b9d01SCy Schubert /**
109939beb93cSSam Leffler * auth_alg - Allowed authentication algorithms
1100e28a4053SRui Paulo * Bit field of WPA_AUTH_ALG_*
110139beb93cSSam Leffler */
110239beb93cSSam Leffler int auth_alg;
110339beb93cSSam Leffler
110439beb93cSSam Leffler /**
110539beb93cSSam Leffler * mode - Operation mode (infra/ibss) IEEE80211_MODE_*
110639beb93cSSam Leffler */
110739beb93cSSam Leffler int mode;
110839beb93cSSam Leffler
110939beb93cSSam Leffler /**
111039beb93cSSam Leffler * wep_key - WEP keys for static WEP configuration
111139beb93cSSam Leffler */
111239beb93cSSam Leffler const u8 *wep_key[4];
111339beb93cSSam Leffler
111439beb93cSSam Leffler /**
111539beb93cSSam Leffler * wep_key_len - WEP key length for static WEP configuration
111639beb93cSSam Leffler */
111739beb93cSSam Leffler size_t wep_key_len[4];
111839beb93cSSam Leffler
111939beb93cSSam Leffler /**
112039beb93cSSam Leffler * wep_tx_keyidx - WEP TX key index for static WEP configuration
112139beb93cSSam Leffler */
112239beb93cSSam Leffler int wep_tx_keyidx;
112339beb93cSSam Leffler
112439beb93cSSam Leffler /**
112539beb93cSSam Leffler * mgmt_frame_protection - IEEE 802.11w management frame protection
112639beb93cSSam Leffler */
1127e28a4053SRui Paulo enum mfp_options mgmt_frame_protection;
112839beb93cSSam Leffler
112939beb93cSSam Leffler /**
113039beb93cSSam Leffler * passphrase - RSN passphrase for PSK
113139beb93cSSam Leffler *
113239beb93cSSam Leffler * This value is made available only for WPA/WPA2-Personal (PSK) and
11334bc52338SCy Schubert * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK. This
11344bc52338SCy Schubert * is the 8..63 character ASCII passphrase, if available. Please note
11354bc52338SCy Schubert * that this can be %NULL if passphrase was not used to generate the
11364bc52338SCy Schubert * PSK. In that case, the psk field must be used to fetch the PSK.
113739beb93cSSam Leffler */
113839beb93cSSam Leffler const char *passphrase;
113939beb93cSSam Leffler
114039beb93cSSam Leffler /**
114139beb93cSSam Leffler * psk - RSN PSK (alternative for passphrase for PSK)
114239beb93cSSam Leffler *
114339beb93cSSam Leffler * This value is made available only for WPA/WPA2-Personal (PSK) and
11444bc52338SCy Schubert * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK. This
11454bc52338SCy Schubert * is the 32-octet (256-bit) PSK, if available. The driver wrapper
11464bc52338SCy Schubert * should be prepared to handle %NULL value as an error.
114739beb93cSSam Leffler */
114839beb93cSSam Leffler const u8 *psk;
1149e28a4053SRui Paulo
1150e28a4053SRui Paulo /**
1151*a90b9d01SCy Schubert * sae_password - Password for SAE authentication
1152*a90b9d01SCy Schubert *
1153*a90b9d01SCy Schubert * This value is made available only for WPA3-Personal (SAE) and only
1154*a90b9d01SCy Schubert * for drivers that set WPA_DRIVER_FLAGS2_SAE_OFFLOAD.
1155*a90b9d01SCy Schubert */
1156*a90b9d01SCy Schubert const char *sae_password;
1157*a90b9d01SCy Schubert
1158*a90b9d01SCy Schubert /**
1159*a90b9d01SCy Schubert * sae_password_id - Password Identifier for SAE authentication
1160*a90b9d01SCy Schubert *
1161*a90b9d01SCy Schubert * This value is made available only for WPA3-Personal (SAE) and only
1162*a90b9d01SCy Schubert * for drivers that set WPA_DRIVER_FLAGS2_SAE_OFFLOAD. If %NULL, SAE
1163*a90b9d01SCy Schubert * password identifier is not used.
1164*a90b9d01SCy Schubert */
1165*a90b9d01SCy Schubert const char *sae_password_id;
1166*a90b9d01SCy Schubert
1167*a90b9d01SCy Schubert /**
1168e28a4053SRui Paulo * drop_unencrypted - Enable/disable unencrypted frame filtering
1169e28a4053SRui Paulo *
1170e28a4053SRui Paulo * Configure the driver to drop all non-EAPOL frames (both receive and
1171e28a4053SRui Paulo * transmit paths). Unencrypted EAPOL frames (ethertype 0x888e) must
1172e28a4053SRui Paulo * still be allowed for key negotiation.
1173e28a4053SRui Paulo */
1174e28a4053SRui Paulo int drop_unencrypted;
1175e28a4053SRui Paulo
1176e28a4053SRui Paulo /**
1177e28a4053SRui Paulo * prev_bssid - Previously used BSSID in this ESS
1178e28a4053SRui Paulo *
1179e28a4053SRui Paulo * When not %NULL, this is a request to use reassociation instead of
1180e28a4053SRui Paulo * association.
1181e28a4053SRui Paulo */
1182e28a4053SRui Paulo const u8 *prev_bssid;
1183f05cddf9SRui Paulo
1184f05cddf9SRui Paulo /**
1185f05cddf9SRui Paulo * wps - WPS mode
1186f05cddf9SRui Paulo *
1187f05cddf9SRui Paulo * If the driver needs to do special configuration for WPS association,
1188f05cddf9SRui Paulo * this variable provides more information on what type of association
1189*a90b9d01SCy Schubert * is being requested. Most drivers should not need to use this.
1190f05cddf9SRui Paulo */
1191f05cddf9SRui Paulo enum wps_mode wps;
1192f05cddf9SRui Paulo
1193f05cddf9SRui Paulo /**
1194f05cddf9SRui Paulo * p2p - Whether this connection is a P2P group
1195f05cddf9SRui Paulo */
1196f05cddf9SRui Paulo int p2p;
1197f05cddf9SRui Paulo
1198f05cddf9SRui Paulo /**
1199f05cddf9SRui Paulo * uapsd - UAPSD parameters for the network
1200f05cddf9SRui Paulo * -1 = do not change defaults
1201f05cddf9SRui Paulo * AP mode: 1 = enabled, 0 = disabled
1202f05cddf9SRui Paulo * STA mode: bits 0..3 UAPSD enabled for VO,VI,BK,BE
1203f05cddf9SRui Paulo */
1204f05cddf9SRui Paulo int uapsd;
1205f05cddf9SRui Paulo
1206f05cddf9SRui Paulo /**
1207f05cddf9SRui Paulo * fixed_bssid - Whether to force this BSSID in IBSS mode
1208f05cddf9SRui Paulo * 1 = Fix this BSSID and prevent merges.
1209f05cddf9SRui Paulo * 0 = Do not fix BSSID.
1210f05cddf9SRui Paulo */
1211f05cddf9SRui Paulo int fixed_bssid;
1212f05cddf9SRui Paulo
1213f05cddf9SRui Paulo /**
12145b9c547cSRui Paulo * fixed_freq - Fix control channel in IBSS mode
12155b9c547cSRui Paulo * 0 = don't fix control channel (default)
12165b9c547cSRui Paulo * 1 = fix control channel; this prevents IBSS merging with another
12175b9c547cSRui Paulo * channel
12185b9c547cSRui Paulo */
12195b9c547cSRui Paulo int fixed_freq;
12205b9c547cSRui Paulo
12215b9c547cSRui Paulo /**
1222f05cddf9SRui Paulo * disable_ht - Disable HT (IEEE 802.11n) for this connection
1223f05cddf9SRui Paulo */
1224f05cddf9SRui Paulo int disable_ht;
1225f05cddf9SRui Paulo
1226f05cddf9SRui Paulo /**
12275b9c547cSRui Paulo * htcaps - HT Capabilities over-rides
12285b9c547cSRui Paulo *
12295b9c547cSRui Paulo * Only bits set in the mask will be used, and not all values are used
12305b9c547cSRui Paulo * by the kernel anyway. Currently, MCS, MPDU and MSDU fields are used.
12315b9c547cSRui Paulo *
12325b9c547cSRui Paulo * Pointer to struct ieee80211_ht_capabilities.
1233f05cddf9SRui Paulo */
12345b9c547cSRui Paulo const u8 *htcaps;
12355b9c547cSRui Paulo
12365b9c547cSRui Paulo /**
12375b9c547cSRui Paulo * htcaps_mask - HT Capabilities over-rides mask
12385b9c547cSRui Paulo *
12395b9c547cSRui Paulo * Pointer to struct ieee80211_ht_capabilities.
12405b9c547cSRui Paulo */
12415b9c547cSRui Paulo const u8 *htcaps_mask;
12425b9c547cSRui Paulo
12435b9c547cSRui Paulo #ifdef CONFIG_VHT_OVERRIDES
12445b9c547cSRui Paulo /**
12455b9c547cSRui Paulo * disable_vht - Disable VHT for this connection
12465b9c547cSRui Paulo */
12475b9c547cSRui Paulo int disable_vht;
12485b9c547cSRui Paulo
12495b9c547cSRui Paulo /**
12505b9c547cSRui Paulo * VHT capability overrides.
12515b9c547cSRui Paulo */
12525b9c547cSRui Paulo const struct ieee80211_vht_capabilities *vhtcaps;
12535b9c547cSRui Paulo const struct ieee80211_vht_capabilities *vhtcaps_mask;
12545b9c547cSRui Paulo #endif /* CONFIG_VHT_OVERRIDES */
12555b9c547cSRui Paulo
1256c1d255d3SCy Schubert #ifdef CONFIG_HE_OVERRIDES
1257c1d255d3SCy Schubert /**
1258c1d255d3SCy Schubert * disable_he - Disable HE for this connection
1259c1d255d3SCy Schubert */
1260c1d255d3SCy Schubert int disable_he;
1261c1d255d3SCy Schubert #endif /* CONFIG_HE_OVERRIDES */
1262c1d255d3SCy Schubert
12635b9c547cSRui Paulo /**
12645b9c547cSRui Paulo * req_key_mgmt_offload - Request key management offload for connection
12655b9c547cSRui Paulo *
12665b9c547cSRui Paulo * Request key management offload for this connection if the device
12675b9c547cSRui Paulo * supports it.
12685b9c547cSRui Paulo */
12695b9c547cSRui Paulo int req_key_mgmt_offload;
12705b9c547cSRui Paulo
12715b9c547cSRui Paulo /**
1272206b73d0SCy Schubert * req_handshake_offload - Request EAPOL handshake offload
1273206b73d0SCy Schubert *
1274206b73d0SCy Schubert * Request EAPOL handshake offload for this connection if the device
1275206b73d0SCy Schubert * supports it.
1276206b73d0SCy Schubert */
1277206b73d0SCy Schubert int req_handshake_offload;
1278206b73d0SCy Schubert
1279206b73d0SCy Schubert /**
12805b9c547cSRui Paulo * Flag for indicating whether this association includes support for
12815b9c547cSRui Paulo * RRM (Radio Resource Measurements)
12825b9c547cSRui Paulo */
12835b9c547cSRui Paulo int rrm_used;
1284780fb4a2SCy Schubert
1285780fb4a2SCy Schubert /**
1286780fb4a2SCy Schubert * pbss - If set, connect to a PCP in a PBSS. Otherwise, connect to an
1287780fb4a2SCy Schubert * AP as usual. Valid for DMG network only.
1288780fb4a2SCy Schubert */
1289780fb4a2SCy Schubert int pbss;
129085732ac8SCy Schubert
129185732ac8SCy Schubert /**
129285732ac8SCy Schubert * fils_kek - KEK for FILS association frame protection (AES-SIV)
129385732ac8SCy Schubert */
129485732ac8SCy Schubert const u8 *fils_kek;
129585732ac8SCy Schubert
129685732ac8SCy Schubert /**
129785732ac8SCy Schubert * fils_kek_len: Length of fils_kek in bytes
129885732ac8SCy Schubert */
129985732ac8SCy Schubert size_t fils_kek_len;
130085732ac8SCy Schubert
130185732ac8SCy Schubert /**
130285732ac8SCy Schubert * fils_nonces - Nonces for FILS association frame protection
130385732ac8SCy Schubert * (AES-SIV AAD)
130485732ac8SCy Schubert */
130585732ac8SCy Schubert const u8 *fils_nonces;
130685732ac8SCy Schubert
130785732ac8SCy Schubert /**
130885732ac8SCy Schubert * fils_nonces_len: Length of fils_nonce in bytes
130985732ac8SCy Schubert */
131085732ac8SCy Schubert size_t fils_nonces_len;
131185732ac8SCy Schubert
131285732ac8SCy Schubert /**
131385732ac8SCy Schubert * fils_erp_username - Username part of keyName-NAI
131485732ac8SCy Schubert */
131585732ac8SCy Schubert const u8 *fils_erp_username;
131685732ac8SCy Schubert
131785732ac8SCy Schubert /**
131885732ac8SCy Schubert * fils_erp_username_len - Length of fils_erp_username in bytes
131985732ac8SCy Schubert */
132085732ac8SCy Schubert size_t fils_erp_username_len;
132185732ac8SCy Schubert
132285732ac8SCy Schubert /**
132385732ac8SCy Schubert * fils_erp_realm - Realm/domain name to use in FILS ERP
132485732ac8SCy Schubert */
132585732ac8SCy Schubert const u8 *fils_erp_realm;
132685732ac8SCy Schubert
132785732ac8SCy Schubert /**
132885732ac8SCy Schubert * fils_erp_realm_len - Length of fils_erp_realm in bytes
132985732ac8SCy Schubert */
133085732ac8SCy Schubert size_t fils_erp_realm_len;
133185732ac8SCy Schubert
133285732ac8SCy Schubert /**
133385732ac8SCy Schubert * fils_erp_next_seq_num - The next sequence number to use in FILS ERP
133485732ac8SCy Schubert * messages
133585732ac8SCy Schubert */
133685732ac8SCy Schubert u16 fils_erp_next_seq_num;
133785732ac8SCy Schubert
133885732ac8SCy Schubert /**
133985732ac8SCy Schubert * fils_erp_rrk - Re-authentication root key (rRK) for the keyName-NAI
134085732ac8SCy Schubert * specified by fils_erp_username@fils_erp_realm.
134185732ac8SCy Schubert */
134285732ac8SCy Schubert const u8 *fils_erp_rrk;
134385732ac8SCy Schubert
134485732ac8SCy Schubert /**
134585732ac8SCy Schubert * fils_erp_rrk_len - Length of fils_erp_rrk in bytes
134685732ac8SCy Schubert */
134785732ac8SCy Schubert size_t fils_erp_rrk_len;
1348c1d255d3SCy Schubert
1349c1d255d3SCy Schubert /**
1350c1d255d3SCy Schubert * sae_pwe - SAE mechanism for PWE derivation
1351c1d255d3SCy Schubert * 0 = hunting-and-pecking loop only
1352c1d255d3SCy Schubert * 1 = hash-to-element only
1353c1d255d3SCy Schubert * 2 = both hunting-and-pecking loop and hash-to-element enabled
1354c1d255d3SCy Schubert */
1355*a90b9d01SCy Schubert enum sae_pwe sae_pwe;
1356*a90b9d01SCy Schubert
1357*a90b9d01SCy Schubert /**
1358*a90b9d01SCy Schubert * disable_eht - Disable EHT for this connection
1359*a90b9d01SCy Schubert */
1360*a90b9d01SCy Schubert int disable_eht;
1361*a90b9d01SCy Schubert
1362*a90b9d01SCy Schubert /*
1363*a90b9d01SCy Schubert * mld_params - MLD association parameters
1364*a90b9d01SCy Schubert */
1365*a90b9d01SCy Schubert struct wpa_driver_mld_params mld_params;
1366f05cddf9SRui Paulo };
1367f05cddf9SRui Paulo
1368f05cddf9SRui Paulo enum hide_ssid {
1369f05cddf9SRui Paulo NO_SSID_HIDING,
1370f05cddf9SRui Paulo HIDDEN_SSID_ZERO_LEN,
1371f05cddf9SRui Paulo HIDDEN_SSID_ZERO_CONTENTS
1372f05cddf9SRui Paulo };
1373f05cddf9SRui Paulo
1374206b73d0SCy Schubert enum ch_switch_state {
1375206b73d0SCy Schubert CH_SW_STARTED,
1376206b73d0SCy Schubert CH_SW_FINISHED
1377206b73d0SCy Schubert };
1378206b73d0SCy Schubert
13795b9c547cSRui Paulo struct wowlan_triggers {
13805b9c547cSRui Paulo u8 any;
13815b9c547cSRui Paulo u8 disconnect;
13825b9c547cSRui Paulo u8 magic_pkt;
13835b9c547cSRui Paulo u8 gtk_rekey_failure;
13845b9c547cSRui Paulo u8 eap_identity_req;
13855b9c547cSRui Paulo u8 four_way_handshake;
13865b9c547cSRui Paulo u8 rfkill_release;
13875b9c547cSRui Paulo };
13885b9c547cSRui Paulo
1389*a90b9d01SCy Schubert struct unsol_bcast_probe_resp {
1390*a90b9d01SCy Schubert /**
1391*a90b9d01SCy Schubert * Unsolicited broadcast Probe Response interval in TUs
1392*a90b9d01SCy Schubert */
1393*a90b9d01SCy Schubert unsigned int unsol_bcast_probe_resp_interval;
1394*a90b9d01SCy Schubert
1395*a90b9d01SCy Schubert /**
1396*a90b9d01SCy Schubert * Unsolicited broadcast Probe Response template data
1397*a90b9d01SCy Schubert */
1398*a90b9d01SCy Schubert u8 *unsol_bcast_probe_resp_tmpl;
1399*a90b9d01SCy Schubert
1400*a90b9d01SCy Schubert /**
1401*a90b9d01SCy Schubert * Unsolicited broadcast Probe Response template length
1402*a90b9d01SCy Schubert */
1403*a90b9d01SCy Schubert size_t unsol_bcast_probe_resp_tmpl_len;
1404*a90b9d01SCy Schubert };
1405*a90b9d01SCy Schubert
1406f05cddf9SRui Paulo struct wpa_driver_ap_params {
1407f05cddf9SRui Paulo /**
1408f05cddf9SRui Paulo * head - Beacon head from IEEE 802.11 header to IEs before TIM IE
1409f05cddf9SRui Paulo */
14105b9c547cSRui Paulo u8 *head;
1411f05cddf9SRui Paulo
1412f05cddf9SRui Paulo /**
1413f05cddf9SRui Paulo * head_len - Length of the head buffer in octets
1414f05cddf9SRui Paulo */
1415f05cddf9SRui Paulo size_t head_len;
1416f05cddf9SRui Paulo
1417f05cddf9SRui Paulo /**
1418f05cddf9SRui Paulo * tail - Beacon tail following TIM IE
1419f05cddf9SRui Paulo */
14205b9c547cSRui Paulo u8 *tail;
1421f05cddf9SRui Paulo
1422f05cddf9SRui Paulo /**
1423f05cddf9SRui Paulo * tail_len - Length of the tail buffer in octets
1424f05cddf9SRui Paulo */
1425f05cddf9SRui Paulo size_t tail_len;
1426f05cddf9SRui Paulo
1427f05cddf9SRui Paulo /**
1428f05cddf9SRui Paulo * dtim_period - DTIM period
1429f05cddf9SRui Paulo */
1430f05cddf9SRui Paulo int dtim_period;
1431f05cddf9SRui Paulo
1432f05cddf9SRui Paulo /**
1433f05cddf9SRui Paulo * beacon_int - Beacon interval
1434f05cddf9SRui Paulo */
1435f05cddf9SRui Paulo int beacon_int;
1436f05cddf9SRui Paulo
1437f05cddf9SRui Paulo /**
1438f05cddf9SRui Paulo * basic_rates: -1 terminated array of basic rates in 100 kbps
1439f05cddf9SRui Paulo *
1440f05cddf9SRui Paulo * This parameter can be used to set a specific basic rate set for the
1441f05cddf9SRui Paulo * BSS. If %NULL, default basic rate set is used.
1442f05cddf9SRui Paulo */
1443f05cddf9SRui Paulo int *basic_rates;
1444f05cddf9SRui Paulo
1445f05cddf9SRui Paulo /**
144685732ac8SCy Schubert * beacon_rate: Beacon frame data rate
144785732ac8SCy Schubert *
144885732ac8SCy Schubert * This parameter can be used to set a specific Beacon frame data rate
144985732ac8SCy Schubert * for the BSS. The interpretation of this value depends on the
1450c1d255d3SCy Schubert * rate_type (legacy: in 100 kbps units, HT: HT-MCS, VHT: VHT-MCS,
1451c1d255d3SCy Schubert * HE: HE-MCS). If beacon_rate == 0 and rate_type == 0
1452c1d255d3SCy Schubert * (BEACON_RATE_LEGACY), the default Beacon frame data rate is used.
145385732ac8SCy Schubert */
145485732ac8SCy Schubert unsigned int beacon_rate;
145585732ac8SCy Schubert
145685732ac8SCy Schubert /**
1457c1d255d3SCy Schubert * beacon_rate_type: Beacon data rate type (legacy/HT/VHT/HE)
145885732ac8SCy Schubert */
145985732ac8SCy Schubert enum beacon_rate_type rate_type;
146085732ac8SCy Schubert
146185732ac8SCy Schubert /**
1462f05cddf9SRui Paulo * proberesp - Probe Response template
1463f05cddf9SRui Paulo *
1464f05cddf9SRui Paulo * This is used by drivers that reply to Probe Requests internally in
1465f05cddf9SRui Paulo * AP mode and require the full Probe Response template.
1466f05cddf9SRui Paulo */
14675b9c547cSRui Paulo u8 *proberesp;
1468f05cddf9SRui Paulo
1469f05cddf9SRui Paulo /**
1470f05cddf9SRui Paulo * proberesp_len - Length of the proberesp buffer in octets
1471f05cddf9SRui Paulo */
1472f05cddf9SRui Paulo size_t proberesp_len;
1473f05cddf9SRui Paulo
1474f05cddf9SRui Paulo /**
1475f05cddf9SRui Paulo * ssid - The SSID to use in Beacon/Probe Response frames
1476f05cddf9SRui Paulo */
1477f05cddf9SRui Paulo const u8 *ssid;
1478f05cddf9SRui Paulo
1479f05cddf9SRui Paulo /**
1480f05cddf9SRui Paulo * ssid_len - Length of the SSID (1..32)
1481f05cddf9SRui Paulo */
1482f05cddf9SRui Paulo size_t ssid_len;
1483f05cddf9SRui Paulo
1484f05cddf9SRui Paulo /**
1485f05cddf9SRui Paulo * hide_ssid - Whether to hide the SSID
1486f05cddf9SRui Paulo */
1487f05cddf9SRui Paulo enum hide_ssid hide_ssid;
1488f05cddf9SRui Paulo
1489f05cddf9SRui Paulo /**
1490f05cddf9SRui Paulo * pairwise_ciphers - WPA_CIPHER_* bitfield
1491f05cddf9SRui Paulo */
1492f05cddf9SRui Paulo unsigned int pairwise_ciphers;
1493f05cddf9SRui Paulo
1494f05cddf9SRui Paulo /**
1495f05cddf9SRui Paulo * group_cipher - WPA_CIPHER_*
1496f05cddf9SRui Paulo */
1497f05cddf9SRui Paulo unsigned int group_cipher;
1498f05cddf9SRui Paulo
1499f05cddf9SRui Paulo /**
1500f05cddf9SRui Paulo * key_mgmt_suites - WPA_KEY_MGMT_* bitfield
1501f05cddf9SRui Paulo */
1502f05cddf9SRui Paulo unsigned int key_mgmt_suites;
1503f05cddf9SRui Paulo
1504f05cddf9SRui Paulo /**
1505f05cddf9SRui Paulo * auth_algs - WPA_AUTH_ALG_* bitfield
1506f05cddf9SRui Paulo */
1507f05cddf9SRui Paulo unsigned int auth_algs;
1508f05cddf9SRui Paulo
1509f05cddf9SRui Paulo /**
1510f05cddf9SRui Paulo * wpa_version - WPA_PROTO_* bitfield
1511f05cddf9SRui Paulo */
1512f05cddf9SRui Paulo unsigned int wpa_version;
1513f05cddf9SRui Paulo
1514f05cddf9SRui Paulo /**
1515f05cddf9SRui Paulo * privacy - Whether privacy is used in the BSS
1516f05cddf9SRui Paulo */
1517f05cddf9SRui Paulo int privacy;
1518f05cddf9SRui Paulo
1519f05cddf9SRui Paulo /**
1520f05cddf9SRui Paulo * beacon_ies - WPS/P2P IE(s) for Beacon frames
1521f05cddf9SRui Paulo *
1522f05cddf9SRui Paulo * This is used to add IEs like WPS IE and P2P IE by drivers that do
1523f05cddf9SRui Paulo * not use the full Beacon template.
1524f05cddf9SRui Paulo */
1525f05cddf9SRui Paulo const struct wpabuf *beacon_ies;
1526f05cddf9SRui Paulo
1527f05cddf9SRui Paulo /**
1528f05cddf9SRui Paulo * proberesp_ies - P2P/WPS IE(s) for Probe Response frames
1529f05cddf9SRui Paulo *
1530f05cddf9SRui Paulo * This is used to add IEs like WPS IE and P2P IE by drivers that
1531f05cddf9SRui Paulo * reply to Probe Request frames internally.
1532f05cddf9SRui Paulo */
1533f05cddf9SRui Paulo const struct wpabuf *proberesp_ies;
1534f05cddf9SRui Paulo
1535f05cddf9SRui Paulo /**
1536f05cddf9SRui Paulo * assocresp_ies - WPS IE(s) for (Re)Association Response frames
1537f05cddf9SRui Paulo *
1538f05cddf9SRui Paulo * This is used to add IEs like WPS IE by drivers that reply to
1539f05cddf9SRui Paulo * (Re)Association Request frames internally.
1540f05cddf9SRui Paulo */
1541f05cddf9SRui Paulo const struct wpabuf *assocresp_ies;
1542f05cddf9SRui Paulo
1543f05cddf9SRui Paulo /**
1544f05cddf9SRui Paulo * isolate - Whether to isolate frames between associated stations
1545f05cddf9SRui Paulo *
1546f05cddf9SRui Paulo * If this is non-zero, the AP is requested to disable forwarding of
1547f05cddf9SRui Paulo * frames between associated stations.
1548f05cddf9SRui Paulo */
1549f05cddf9SRui Paulo int isolate;
1550f05cddf9SRui Paulo
1551f05cddf9SRui Paulo /**
1552f05cddf9SRui Paulo * cts_protect - Whether CTS protection is enabled
1553f05cddf9SRui Paulo */
1554f05cddf9SRui Paulo int cts_protect;
1555f05cddf9SRui Paulo
1556f05cddf9SRui Paulo /**
1557f05cddf9SRui Paulo * preamble - Whether short preamble is enabled
1558f05cddf9SRui Paulo */
1559f05cddf9SRui Paulo int preamble;
1560f05cddf9SRui Paulo
1561f05cddf9SRui Paulo /**
1562f05cddf9SRui Paulo * short_slot_time - Whether short slot time is enabled
1563f05cddf9SRui Paulo *
1564f05cddf9SRui Paulo * 0 = short slot time disable, 1 = short slot time enabled, -1 = do
1565f05cddf9SRui Paulo * not set (e.g., when 802.11g mode is not in use)
1566f05cddf9SRui Paulo */
1567f05cddf9SRui Paulo int short_slot_time;
1568f05cddf9SRui Paulo
1569f05cddf9SRui Paulo /**
1570f05cddf9SRui Paulo * ht_opmode - HT operation mode or -1 if HT not in use
1571f05cddf9SRui Paulo */
1572f05cddf9SRui Paulo int ht_opmode;
1573f05cddf9SRui Paulo
1574f05cddf9SRui Paulo /**
1575f05cddf9SRui Paulo * interworking - Whether Interworking is enabled
1576f05cddf9SRui Paulo */
1577f05cddf9SRui Paulo int interworking;
1578f05cddf9SRui Paulo
1579f05cddf9SRui Paulo /**
1580f05cddf9SRui Paulo * hessid - Homogeneous ESS identifier or %NULL if not set
1581f05cddf9SRui Paulo */
1582f05cddf9SRui Paulo const u8 *hessid;
1583f05cddf9SRui Paulo
1584f05cddf9SRui Paulo /**
1585f05cddf9SRui Paulo * access_network_type - Access Network Type (0..15)
1586f05cddf9SRui Paulo *
1587f05cddf9SRui Paulo * This is used for filtering Probe Request frames when Interworking is
1588f05cddf9SRui Paulo * enabled.
1589f05cddf9SRui Paulo */
1590f05cddf9SRui Paulo u8 access_network_type;
1591f05cddf9SRui Paulo
1592f05cddf9SRui Paulo /**
1593f05cddf9SRui Paulo * ap_max_inactivity - Timeout in seconds to detect STA's inactivity
1594f05cddf9SRui Paulo *
1595f05cddf9SRui Paulo * This is used by driver which advertises this capability.
1596f05cddf9SRui Paulo */
1597f05cddf9SRui Paulo int ap_max_inactivity;
1598f05cddf9SRui Paulo
1599f05cddf9SRui Paulo /**
16005b9c547cSRui Paulo * ctwindow - Client Traffic Window (in TUs)
16015b9c547cSRui Paulo */
16025b9c547cSRui Paulo u8 p2p_go_ctwindow;
16035b9c547cSRui Paulo
16045b9c547cSRui Paulo /**
1605f05cddf9SRui Paulo * disable_dgaf - Whether group-addressed frames are disabled
1606f05cddf9SRui Paulo */
1607f05cddf9SRui Paulo int disable_dgaf;
16085b9c547cSRui Paulo
16095b9c547cSRui Paulo /**
16105b9c547cSRui Paulo * osen - Whether OSEN security is enabled
16115b9c547cSRui Paulo */
16125b9c547cSRui Paulo int osen;
16135b9c547cSRui Paulo
16145b9c547cSRui Paulo /**
16155b9c547cSRui Paulo * freq - Channel parameters for dynamic bandwidth changes
16165b9c547cSRui Paulo */
16175b9c547cSRui Paulo struct hostapd_freq_params *freq;
16185b9c547cSRui Paulo
16195b9c547cSRui Paulo /**
16205b9c547cSRui Paulo * reenable - Whether this is to re-enable beaconing
16215b9c547cSRui Paulo */
16225b9c547cSRui Paulo int reenable;
1623780fb4a2SCy Schubert
1624780fb4a2SCy Schubert /**
1625780fb4a2SCy Schubert * pbss - Whether to start a PCP (in PBSS) instead of an AP in
1626780fb4a2SCy Schubert * infrastructure BSS. Valid only for DMG network.
1627780fb4a2SCy Schubert */
1628780fb4a2SCy Schubert int pbss;
162985732ac8SCy Schubert
163085732ac8SCy Schubert /**
163185732ac8SCy Schubert * multicast_to_unicast - Whether to use multicast_to_unicast
163285732ac8SCy Schubert *
163385732ac8SCy Schubert * If this is non-zero, the AP is requested to perform multicast to
163485732ac8SCy Schubert * unicast conversion for ARP, IPv4, and IPv6 frames (possibly within
163585732ac8SCy Schubert * 802.1Q). If enabled, such frames are to be sent to each station
163685732ac8SCy Schubert * separately, with the DA replaced by their own MAC address rather
163785732ac8SCy Schubert * than the group address.
163885732ac8SCy Schubert *
163985732ac8SCy Schubert * Note that this may break certain expectations of the receiver, such
164085732ac8SCy Schubert * as the ability to drop unicast IP packets received within multicast
164185732ac8SCy Schubert * L2 frames, or the ability to not send ICMP destination unreachable
164285732ac8SCy Schubert * messages for packets received in L2 multicast (which is required,
164385732ac8SCy Schubert * but the receiver can't tell the difference if this new option is
164485732ac8SCy Schubert * enabled.)
164585732ac8SCy Schubert *
164685732ac8SCy Schubert * This also doesn't implement the 802.11 DMS (directed multicast
164785732ac8SCy Schubert * service).
164885732ac8SCy Schubert */
164985732ac8SCy Schubert int multicast_to_unicast;
16504bc52338SCy Schubert
16514bc52338SCy Schubert /**
16524bc52338SCy Schubert * ftm_responder - Whether FTM responder is enabled
16534bc52338SCy Schubert */
16544bc52338SCy Schubert int ftm_responder;
16554bc52338SCy Schubert
16564bc52338SCy Schubert /**
16574bc52338SCy Schubert * lci - Binary data, the content of an LCI report IE with type 8 as
16584bc52338SCy Schubert * defined in IEEE Std 802.11-2016, 9.4.2.22.10
16594bc52338SCy Schubert */
16604bc52338SCy Schubert const struct wpabuf *lci;
16614bc52338SCy Schubert
16624bc52338SCy Schubert /**
16634bc52338SCy Schubert * civic - Binary data, the content of a measurement report IE with
16644bc52338SCy Schubert * type 11 as defined in IEEE Std 802.11-2016, 9.4.2.22.13
16654bc52338SCy Schubert */
16664bc52338SCy Schubert const struct wpabuf *civic;
1667c1d255d3SCy Schubert
1668c1d255d3SCy Schubert /**
1669c1d255d3SCy Schubert * he_spr_ctrl - Spatial Reuse control field of SPR element
1670c1d255d3SCy Schubert */
1671c1d255d3SCy Schubert u8 he_spr_ctrl;
1672c1d255d3SCy Schubert
1673c1d255d3SCy Schubert /**
1674c1d255d3SCy Schubert * he_spr_non_srg_obss_pd_max_offset - Non-SRG Maximum TX power offset
1675c1d255d3SCy Schubert */
1676c1d255d3SCy Schubert u8 he_spr_non_srg_obss_pd_max_offset;
1677c1d255d3SCy Schubert
1678c1d255d3SCy Schubert /**
1679c1d255d3SCy Schubert * he_spr_srg_obss_pd_min_offset - Minimum TX power offset
1680c1d255d3SCy Schubert */
1681c1d255d3SCy Schubert u8 he_spr_srg_obss_pd_min_offset;
1682c1d255d3SCy Schubert
1683c1d255d3SCy Schubert /**
1684c1d255d3SCy Schubert * he_spr_srg_obss_pd_max_offset - Maximum TX power offset
1685c1d255d3SCy Schubert */
1686c1d255d3SCy Schubert u8 he_spr_srg_obss_pd_max_offset;
1687c1d255d3SCy Schubert
1688c1d255d3SCy Schubert /**
1689c1d255d3SCy Schubert * he_spr_bss_color_bitmap - BSS color values used by members of the
1690c1d255d3SCy Schubert * SRG.
1691c1d255d3SCy Schubert */
1692c1d255d3SCy Schubert u8 he_spr_bss_color_bitmap[8];
1693c1d255d3SCy Schubert
1694c1d255d3SCy Schubert /**
1695c1d255d3SCy Schubert * he_spr_partial_bssid_bitmap - Partial BSSID values used by members
1696c1d255d3SCy Schubert * of the SRG.
1697c1d255d3SCy Schubert */
1698c1d255d3SCy Schubert u8 he_spr_partial_bssid_bitmap[8];
1699c1d255d3SCy Schubert
1700c1d255d3SCy Schubert /**
1701c1d255d3SCy Schubert * he_bss_color - Whether the BSS Color is disabled
1702c1d255d3SCy Schubert */
1703c1d255d3SCy Schubert int he_bss_color_disabled;
1704c1d255d3SCy Schubert
1705c1d255d3SCy Schubert /**
1706c1d255d3SCy Schubert * he_bss_color_partial - The BSS Color AID equation
1707c1d255d3SCy Schubert */
1708c1d255d3SCy Schubert int he_bss_color_partial;
1709c1d255d3SCy Schubert
1710c1d255d3SCy Schubert /**
1711c1d255d3SCy Schubert * he_bss_color - The BSS Color of the AP
1712c1d255d3SCy Schubert */
1713c1d255d3SCy Schubert int he_bss_color;
1714c1d255d3SCy Schubert
1715c1d255d3SCy Schubert /**
1716c1d255d3SCy Schubert * twt_responder - Whether Target Wait Time responder is enabled
1717c1d255d3SCy Schubert */
1718c1d255d3SCy Schubert int twt_responder;
1719c1d255d3SCy Schubert
1720c1d255d3SCy Schubert /**
1721c1d255d3SCy Schubert * sae_pwe - SAE mechanism for PWE derivation
1722c1d255d3SCy Schubert * 0 = hunting-and-pecking loop only
1723c1d255d3SCy Schubert * 1 = hash-to-element only
1724c1d255d3SCy Schubert * 2 = both hunting-and-pecking loop and hash-to-element enabled
1725c1d255d3SCy Schubert */
1726*a90b9d01SCy Schubert enum sae_pwe sae_pwe;
1727c1d255d3SCy Schubert
1728c1d255d3SCy Schubert /**
1729c1d255d3SCy Schubert * FILS Discovery frame minimum interval in TUs
1730c1d255d3SCy Schubert */
1731c1d255d3SCy Schubert u32 fd_min_int;
1732c1d255d3SCy Schubert
1733c1d255d3SCy Schubert /**
1734c1d255d3SCy Schubert * FILS Discovery frame maximum interval in TUs (0 = FD frame disabled)
1735c1d255d3SCy Schubert */
1736c1d255d3SCy Schubert u32 fd_max_int;
1737c1d255d3SCy Schubert
1738c1d255d3SCy Schubert /**
1739c1d255d3SCy Schubert * FILS Discovery frame template data
1740c1d255d3SCy Schubert */
1741c1d255d3SCy Schubert u8 *fd_frame_tmpl;
1742c1d255d3SCy Schubert
1743c1d255d3SCy Schubert /**
1744c1d255d3SCy Schubert * FILS Discovery frame template length
1745c1d255d3SCy Schubert */
1746c1d255d3SCy Schubert size_t fd_frame_tmpl_len;
1747c1d255d3SCy Schubert
1748c1d255d3SCy Schubert /**
1749*a90b9d01SCy Schubert * mbssid_tx_iface - Transmitting interface of the MBSSID set
1750c1d255d3SCy Schubert */
1751*a90b9d01SCy Schubert const char *mbssid_tx_iface;
1752c1d255d3SCy Schubert
1753c1d255d3SCy Schubert /**
1754*a90b9d01SCy Schubert * mbssid_index - The index of this BSS in the MBSSID set
1755c1d255d3SCy Schubert */
1756*a90b9d01SCy Schubert unsigned int mbssid_index;
1757c1d255d3SCy Schubert
1758c1d255d3SCy Schubert /**
1759*a90b9d01SCy Schubert * mbssid_elem - Buffer containing all MBSSID elements
1760c1d255d3SCy Schubert */
1761*a90b9d01SCy Schubert u8 *mbssid_elem;
1762*a90b9d01SCy Schubert
1763*a90b9d01SCy Schubert /**
1764*a90b9d01SCy Schubert * mbssid_elem_len - Total length of all MBSSID elements
1765*a90b9d01SCy Schubert */
1766*a90b9d01SCy Schubert size_t mbssid_elem_len;
1767*a90b9d01SCy Schubert
1768*a90b9d01SCy Schubert /**
1769*a90b9d01SCy Schubert * mbssid_elem_count - The number of MBSSID elements
1770*a90b9d01SCy Schubert */
1771*a90b9d01SCy Schubert u8 mbssid_elem_count;
1772*a90b9d01SCy Schubert
1773*a90b9d01SCy Schubert /**
1774*a90b9d01SCy Schubert * mbssid_elem_offset - Offsets to elements in mbssid_elem.
1775*a90b9d01SCy Schubert * Kernel will use these offsets to generate multiple BSSID beacons.
1776*a90b9d01SCy Schubert */
1777*a90b9d01SCy Schubert u8 **mbssid_elem_offset;
1778*a90b9d01SCy Schubert
1779*a90b9d01SCy Schubert /**
1780*a90b9d01SCy Schubert * ema - Enhanced MBSSID advertisements support.
1781*a90b9d01SCy Schubert */
1782*a90b9d01SCy Schubert bool ema;
1783*a90b9d01SCy Schubert
1784*a90b9d01SCy Schubert /**
1785*a90b9d01SCy Schubert * punct_bitmap - Preamble puncturing bitmap
1786*a90b9d01SCy Schubert * Each bit corresponds to a 20 MHz subchannel, the lowest bit for the
1787*a90b9d01SCy Schubert * channel with the lowest frequency. A bit set to 1 indicates that the
1788*a90b9d01SCy Schubert * subchannel is punctured, otherwise active.
1789*a90b9d01SCy Schubert */
1790*a90b9d01SCy Schubert u16 punct_bitmap;
1791*a90b9d01SCy Schubert
1792*a90b9d01SCy Schubert /**
1793*a90b9d01SCy Schubert * rnr_elem - This buffer contains all of reduced neighbor report (RNR)
1794*a90b9d01SCy Schubert * elements
1795*a90b9d01SCy Schubert */
1796*a90b9d01SCy Schubert u8 *rnr_elem;
1797*a90b9d01SCy Schubert
1798*a90b9d01SCy Schubert /**
1799*a90b9d01SCy Schubert * rnr_elem_len - Length of rnr_elem buffer
1800*a90b9d01SCy Schubert */
1801*a90b9d01SCy Schubert size_t rnr_elem_len;
1802*a90b9d01SCy Schubert
1803*a90b9d01SCy Schubert /**
1804*a90b9d01SCy Schubert * rnr_elem_count - Number of RNR elements
1805*a90b9d01SCy Schubert */
1806*a90b9d01SCy Schubert unsigned int rnr_elem_count;
1807*a90b9d01SCy Schubert
1808*a90b9d01SCy Schubert /**
1809*a90b9d01SCy Schubert * rnr_elem_offset - The offsets to the elements in rnr_elem.
1810*a90b9d01SCy Schubert * The driver will use these to include RNR elements in EMA beacons.
1811*a90b9d01SCy Schubert */
1812*a90b9d01SCy Schubert u8 **rnr_elem_offset;
1813*a90b9d01SCy Schubert
1814*a90b9d01SCy Schubert /* Unsolicited broadcast Probe Response data */
1815*a90b9d01SCy Schubert struct unsol_bcast_probe_resp ubpr;
1816*a90b9d01SCy Schubert
1817*a90b9d01SCy Schubert /**
1818*a90b9d01SCy Schubert * allowed_freqs - List of allowed 20 MHz channel center frequencies in
1819*a90b9d01SCy Schubert * MHz for AP operation. Drivers which support this parameter will
1820*a90b9d01SCy Schubert * generate a new list based on this provided list by filtering out
1821*a90b9d01SCy Schubert * channels that cannot be used at that time due to regulatory or other
1822*a90b9d01SCy Schubert * constraints. The resulting list is used as the list of all allowed
1823*a90b9d01SCy Schubert * channels whenever performing operations like ACS and DFS.
1824*a90b9d01SCy Schubert */
1825*a90b9d01SCy Schubert int *allowed_freqs;
1826*a90b9d01SCy Schubert
1827*a90b9d01SCy Schubert /*
1828*a90b9d01SCy Schubert * mld_ap - Whether operating as an AP MLD
1829*a90b9d01SCy Schubert */
1830*a90b9d01SCy Schubert bool mld_ap;
1831*a90b9d01SCy Schubert
1832*a90b9d01SCy Schubert /**
1833*a90b9d01SCy Schubert * mld_link_id - Link id for MLD BSS's
1834*a90b9d01SCy Schubert */
1835*a90b9d01SCy Schubert u8 mld_link_id;
1836*a90b9d01SCy Schubert
1837*a90b9d01SCy Schubert /**
1838*a90b9d01SCy Schubert * psk - PSK passed to the driver for 4-way handshake offload
1839*a90b9d01SCy Schubert */
1840*a90b9d01SCy Schubert u8 psk[PMK_LEN];
1841*a90b9d01SCy Schubert
1842*a90b9d01SCy Schubert /**
1843*a90b9d01SCy Schubert * psk_len - PSK length in bytes (0 = not set)
1844*a90b9d01SCy Schubert */
1845*a90b9d01SCy Schubert size_t psk_len;
1846*a90b9d01SCy Schubert
1847*a90b9d01SCy Schubert /**
1848*a90b9d01SCy Schubert * sae_password - SAE password for SAE offload
1849*a90b9d01SCy Schubert */
1850*a90b9d01SCy Schubert const char *sae_password;
18515b9c547cSRui Paulo };
18525b9c547cSRui Paulo
18535b9c547cSRui Paulo struct wpa_driver_mesh_bss_params {
18545b9c547cSRui Paulo #define WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS 0x00000001
1855780fb4a2SCy Schubert #define WPA_DRIVER_MESH_CONF_FLAG_PEER_LINK_TIMEOUT 0x00000002
1856780fb4a2SCy Schubert #define WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS 0x00000004
1857780fb4a2SCy Schubert #define WPA_DRIVER_MESH_CONF_FLAG_HT_OP_MODE 0x00000008
185885732ac8SCy Schubert #define WPA_DRIVER_MESH_CONF_FLAG_RSSI_THRESHOLD 0x00000010
185932a95656SCy Schubert #define WPA_DRIVER_MESH_CONF_FLAG_FORWARDING 0x00000020
18605b9c547cSRui Paulo /*
18615b9c547cSRui Paulo * TODO: Other mesh configuration parameters would go here.
18625b9c547cSRui Paulo * See NL80211_MESHCONF_* for all the mesh config parameters.
18635b9c547cSRui Paulo */
18645b9c547cSRui Paulo unsigned int flags;
1865780fb4a2SCy Schubert int auto_plinks;
18665b9c547cSRui Paulo int peer_link_timeout;
1867780fb4a2SCy Schubert int max_peer_links;
186885732ac8SCy Schubert int rssi_threshold;
186932a95656SCy Schubert int forwarding;
1870780fb4a2SCy Schubert u16 ht_opmode;
18715b9c547cSRui Paulo };
18725b9c547cSRui Paulo
18735b9c547cSRui Paulo struct wpa_driver_mesh_join_params {
18745b9c547cSRui Paulo const u8 *meshid;
18755b9c547cSRui Paulo int meshid_len;
18765b9c547cSRui Paulo const int *basic_rates;
18775b9c547cSRui Paulo const u8 *ies;
18785b9c547cSRui Paulo int ie_len;
18795b9c547cSRui Paulo struct hostapd_freq_params freq;
18805b9c547cSRui Paulo int beacon_int;
1881780fb4a2SCy Schubert int dtim_period;
18825b9c547cSRui Paulo struct wpa_driver_mesh_bss_params conf;
18835b9c547cSRui Paulo #define WPA_DRIVER_MESH_FLAG_USER_MPM 0x00000001
18845b9c547cSRui Paulo #define WPA_DRIVER_MESH_FLAG_DRIVER_MPM 0x00000002
18855b9c547cSRui Paulo #define WPA_DRIVER_MESH_FLAG_SAE_AUTH 0x00000004
18865b9c547cSRui Paulo #define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008
18875b9c547cSRui Paulo unsigned int flags;
1888c1d255d3SCy Schubert bool handle_dfs;
1889c1d255d3SCy Schubert };
1890c1d255d3SCy Schubert
1891c1d255d3SCy Schubert struct wpa_driver_set_key_params {
1892c1d255d3SCy Schubert /**
1893c1d255d3SCy Schubert * ifname - Interface name (for multi-SSID/VLAN support) */
1894c1d255d3SCy Schubert const char *ifname;
1895c1d255d3SCy Schubert
1896c1d255d3SCy Schubert /**
1897c1d255d3SCy Schubert * alg - Encryption algorithm
1898c1d255d3SCy Schubert *
1899c1d255d3SCy Schubert * (%WPA_ALG_NONE, %WPA_ALG_WEP, %WPA_ALG_TKIP, %WPA_ALG_CCMP,
1900c1d255d3SCy Schubert * %WPA_ALG_BIP_AES_CMAC_128, %WPA_ALG_GCMP, %WPA_ALG_GCMP_256,
1901c1d255d3SCy Schubert * %WPA_ALG_CCMP_256, %WPA_ALG_BIP_GMAC_128, %WPA_ALG_BIP_GMAC_256,
1902c1d255d3SCy Schubert * %WPA_ALG_BIP_CMAC_256);
1903c1d255d3SCy Schubert * %WPA_ALG_NONE clears the key. */
1904c1d255d3SCy Schubert enum wpa_alg alg;
1905c1d255d3SCy Schubert
1906c1d255d3SCy Schubert /**
1907c1d255d3SCy Schubert * addr - Address of the peer STA
1908c1d255d3SCy Schubert *
1909c1d255d3SCy Schubert * (BSSID of the current AP when setting pairwise key in station mode),
1910c1d255d3SCy Schubert * ff:ff:ff:ff:ff:ff for broadcast keys, %NULL for default keys that
1911c1d255d3SCy Schubert * are used both for broadcast and unicast; when clearing keys, %NULL
1912c1d255d3SCy Schubert * is used to indicate that both the broadcast-only and default key of
1913c1d255d3SCy Schubert * the specified key index is to be cleared */
1914c1d255d3SCy Schubert const u8 *addr;
1915c1d255d3SCy Schubert
1916c1d255d3SCy Schubert /**
1917c1d255d3SCy Schubert * key_idx - Key index
1918c1d255d3SCy Schubert *
1919c1d255d3SCy Schubert * (0..3), usually 0 for unicast keys; 4..5 for IGTK; 6..7 for BIGTK */
1920c1d255d3SCy Schubert int key_idx;
1921c1d255d3SCy Schubert
1922c1d255d3SCy Schubert /**
1923c1d255d3SCy Schubert * set_tx - Configure this key as the default Tx key
1924c1d255d3SCy Schubert *
1925c1d255d3SCy Schubert * Only used when driver does not support separate unicast/individual
1926c1d255d3SCy Schubert * key */
1927c1d255d3SCy Schubert int set_tx;
1928c1d255d3SCy Schubert
1929c1d255d3SCy Schubert /**
1930c1d255d3SCy Schubert * seq - Sequence number/packet number
1931c1d255d3SCy Schubert *
1932c1d255d3SCy Schubert * seq_len octets, the next packet number to be used for in replay
1933c1d255d3SCy Schubert * protection; configured for Rx keys (in most cases, this is only used
1934c1d255d3SCy Schubert * with broadcast keys and set to zero for unicast keys); %NULL if not
1935c1d255d3SCy Schubert * set */
1936c1d255d3SCy Schubert const u8 *seq;
1937c1d255d3SCy Schubert
1938c1d255d3SCy Schubert /**
1939c1d255d3SCy Schubert * seq_len - Length of the seq, depends on the algorithm
1940c1d255d3SCy Schubert *
1941c1d255d3SCy Schubert * TKIP: 6 octets, CCMP/GCMP: 6 octets, IGTK: 6 octets */
1942c1d255d3SCy Schubert size_t seq_len;
1943c1d255d3SCy Schubert
1944c1d255d3SCy Schubert /**
1945c1d255d3SCy Schubert * key - Key buffer
1946c1d255d3SCy Schubert *
1947c1d255d3SCy Schubert * TKIP: 16-byte temporal key, 8-byte Tx Mic key, 8-byte Rx Mic Key */
1948c1d255d3SCy Schubert const u8 *key;
1949c1d255d3SCy Schubert
1950c1d255d3SCy Schubert /**
1951c1d255d3SCy Schubert * key_len - Length of the key buffer in octets
1952c1d255d3SCy Schubert *
1953c1d255d3SCy Schubert * WEP: 5 or 13, TKIP: 32, CCMP/GCMP: 16, IGTK: 16 */
1954c1d255d3SCy Schubert size_t key_len;
1955c1d255d3SCy Schubert
1956c1d255d3SCy Schubert /**
1957c1d255d3SCy Schubert * vlan_id - VLAN index (0..4095) for VLAN offload cases */
1958c1d255d3SCy Schubert int vlan_id;
1959c1d255d3SCy Schubert
1960c1d255d3SCy Schubert /**
1961c1d255d3SCy Schubert * key_flag - Additional key flags
1962c1d255d3SCy Schubert *
1963c1d255d3SCy Schubert * %KEY_FLAG_MODIFY
1964c1d255d3SCy Schubert * Set when an already installed key must be updated.
1965c1d255d3SCy Schubert * So far the only use-case is changing RX/TX status for
1966c1d255d3SCy Schubert * pairwise keys. Must not be set when deleting a key.
1967c1d255d3SCy Schubert * %KEY_FLAG_DEFAULT
1968c1d255d3SCy Schubert * Set when the key is also a default key. Must not be set when
1969c1d255d3SCy Schubert * deleting a key.
1970c1d255d3SCy Schubert * %KEY_FLAG_RX
1971c1d255d3SCy Schubert * The key is valid for RX. Must not be set when deleting a key.
1972c1d255d3SCy Schubert * %KEY_FLAG_TX
1973c1d255d3SCy Schubert * The key is valid for TX. Must not be set when deleting a key.
1974c1d255d3SCy Schubert * %KEY_FLAG_GROUP
1975c1d255d3SCy Schubert * The key is a broadcast or group key.
1976c1d255d3SCy Schubert * %KEY_FLAG_PAIRWISE
1977c1d255d3SCy Schubert * The key is a pairwise key.
1978c1d255d3SCy Schubert * %KEY_FLAG_PMK
1979c1d255d3SCy Schubert * The key is a Pairwise Master Key (PMK).
1980c1d255d3SCy Schubert *
1981c1d255d3SCy Schubert * Valid and pre-defined combinations are:
1982c1d255d3SCy Schubert * %KEY_FLAG_GROUP_RX_TX
1983c1d255d3SCy Schubert * WEP key not to be installed as default key.
1984c1d255d3SCy Schubert * %KEY_FLAG_GROUP_RX_TX_DEFAULT
1985c1d255d3SCy Schubert * Default WEP or WPA-NONE key.
1986c1d255d3SCy Schubert * %KEY_FLAG_GROUP_RX
1987c1d255d3SCy Schubert * GTK key valid for RX only.
1988c1d255d3SCy Schubert * %KEY_FLAG_GROUP_TX_DEFAULT
1989c1d255d3SCy Schubert * GTK key valid for TX only, immediately taking over TX.
1990c1d255d3SCy Schubert * %KEY_FLAG_PAIRWISE_RX_TX
1991c1d255d3SCy Schubert * Pairwise key immediately becoming the active pairwise key.
1992c1d255d3SCy Schubert * %KEY_FLAG_PAIRWISE_RX
1993c1d255d3SCy Schubert * Pairwise key not yet valid for TX. (Only usable when Extended
1994c1d255d3SCy Schubert * Key ID is supported by the driver.)
1995c1d255d3SCy Schubert * %KEY_FLAG_PAIRWISE_RX_TX_MODIFY
1996c1d255d3SCy Schubert * Enable TX for a pairwise key installed with
1997c1d255d3SCy Schubert * KEY_FLAG_PAIRWISE_RX.
1998c1d255d3SCy Schubert *
1999c1d255d3SCy Schubert * Not a valid standalone key type but pre-defined to be combined
2000c1d255d3SCy Schubert * with other key_flags:
2001c1d255d3SCy Schubert * %KEY_FLAG_RX_TX
2002c1d255d3SCy Schubert * RX/TX key. */
2003c1d255d3SCy Schubert enum key_flag key_flag;
2004*a90b9d01SCy Schubert
2005*a90b9d01SCy Schubert /**
2006*a90b9d01SCy Schubert * link_id - MLO Link ID
2007*a90b9d01SCy Schubert *
2008*a90b9d01SCy Schubert * Set to a valid Link ID (0-14) when applicable, otherwise -1. */
2009*a90b9d01SCy Schubert int link_id;
2010c1d255d3SCy Schubert };
2011c1d255d3SCy Schubert
2012c1d255d3SCy Schubert enum wpa_driver_if_type {
2013c1d255d3SCy Schubert /**
2014c1d255d3SCy Schubert * WPA_IF_STATION - Station mode interface
2015c1d255d3SCy Schubert */
2016c1d255d3SCy Schubert WPA_IF_STATION,
2017c1d255d3SCy Schubert
2018c1d255d3SCy Schubert /**
2019c1d255d3SCy Schubert * WPA_IF_AP_VLAN - AP mode VLAN interface
2020c1d255d3SCy Schubert *
2021c1d255d3SCy Schubert * This interface shares its address and Beacon frame with the main
2022c1d255d3SCy Schubert * BSS.
2023c1d255d3SCy Schubert */
2024c1d255d3SCy Schubert WPA_IF_AP_VLAN,
2025c1d255d3SCy Schubert
2026c1d255d3SCy Schubert /**
2027c1d255d3SCy Schubert * WPA_IF_AP_BSS - AP mode BSS interface
2028c1d255d3SCy Schubert *
2029c1d255d3SCy Schubert * This interface has its own address and Beacon frame.
2030c1d255d3SCy Schubert */
2031c1d255d3SCy Schubert WPA_IF_AP_BSS,
2032c1d255d3SCy Schubert
2033c1d255d3SCy Schubert /**
2034c1d255d3SCy Schubert * WPA_IF_P2P_GO - P2P Group Owner
2035c1d255d3SCy Schubert */
2036c1d255d3SCy Schubert WPA_IF_P2P_GO,
2037c1d255d3SCy Schubert
2038c1d255d3SCy Schubert /**
2039c1d255d3SCy Schubert * WPA_IF_P2P_CLIENT - P2P Client
2040c1d255d3SCy Schubert */
2041c1d255d3SCy Schubert WPA_IF_P2P_CLIENT,
2042c1d255d3SCy Schubert
2043c1d255d3SCy Schubert /**
2044c1d255d3SCy Schubert * WPA_IF_P2P_GROUP - P2P Group interface (will become either
2045c1d255d3SCy Schubert * WPA_IF_P2P_GO or WPA_IF_P2P_CLIENT, but the role is not yet known)
2046c1d255d3SCy Schubert */
2047c1d255d3SCy Schubert WPA_IF_P2P_GROUP,
2048c1d255d3SCy Schubert
2049c1d255d3SCy Schubert /**
2050*a90b9d01SCy Schubert * WPA_IF_P2P_DEVICE - P2P Device interface is used to identify the
2051c1d255d3SCy Schubert * abstracted P2P Device function in the driver
2052c1d255d3SCy Schubert */
2053c1d255d3SCy Schubert WPA_IF_P2P_DEVICE,
2054c1d255d3SCy Schubert
2055c1d255d3SCy Schubert /*
2056c1d255d3SCy Schubert * WPA_IF_MESH - Mesh interface
2057c1d255d3SCy Schubert */
2058c1d255d3SCy Schubert WPA_IF_MESH,
2059c1d255d3SCy Schubert
2060c1d255d3SCy Schubert /*
2061c1d255d3SCy Schubert * WPA_IF_TDLS - TDLS offchannel interface (used for pref freq only)
2062c1d255d3SCy Schubert */
2063c1d255d3SCy Schubert WPA_IF_TDLS,
2064c1d255d3SCy Schubert
2065c1d255d3SCy Schubert /*
2066c1d255d3SCy Schubert * WPA_IF_IBSS - IBSS interface (used for pref freq only)
2067c1d255d3SCy Schubert */
2068c1d255d3SCy Schubert WPA_IF_IBSS,
2069c1d255d3SCy Schubert
2070c1d255d3SCy Schubert /*
2071c1d255d3SCy Schubert * WPA_IF_NAN - NAN Device
2072c1d255d3SCy Schubert */
2073c1d255d3SCy Schubert WPA_IF_NAN,
2074c1d255d3SCy Schubert
2075c1d255d3SCy Schubert /* keep last */
2076c1d255d3SCy Schubert WPA_IF_MAX
207739beb93cSSam Leffler };
207839beb93cSSam Leffler
207939beb93cSSam Leffler /**
208039beb93cSSam Leffler * struct wpa_driver_capa - Driver capability information
208139beb93cSSam Leffler */
208239beb93cSSam Leffler struct wpa_driver_capa {
208339beb93cSSam Leffler #define WPA_DRIVER_CAPA_KEY_MGMT_WPA 0x00000001
208439beb93cSSam Leffler #define WPA_DRIVER_CAPA_KEY_MGMT_WPA2 0x00000002
208539beb93cSSam Leffler #define WPA_DRIVER_CAPA_KEY_MGMT_WPA_PSK 0x00000004
208639beb93cSSam Leffler #define WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK 0x00000008
208739beb93cSSam Leffler #define WPA_DRIVER_CAPA_KEY_MGMT_WPA_NONE 0x00000010
208839beb93cSSam Leffler #define WPA_DRIVER_CAPA_KEY_MGMT_FT 0x00000020
208939beb93cSSam Leffler #define WPA_DRIVER_CAPA_KEY_MGMT_FT_PSK 0x00000040
2090f05cddf9SRui Paulo #define WPA_DRIVER_CAPA_KEY_MGMT_WAPI_PSK 0x00000080
20915b9c547cSRui Paulo #define WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B 0x00000100
20925b9c547cSRui Paulo #define WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B_192 0x00000200
209385732ac8SCy Schubert #define WPA_DRIVER_CAPA_KEY_MGMT_OWE 0x00000400
209485732ac8SCy Schubert #define WPA_DRIVER_CAPA_KEY_MGMT_DPP 0x00000800
209585732ac8SCy Schubert #define WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA256 0x00001000
209685732ac8SCy Schubert #define WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA384 0x00002000
209785732ac8SCy Schubert #define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA256 0x00004000
209885732ac8SCy Schubert #define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA384 0x00008000
20994bc52338SCy Schubert #define WPA_DRIVER_CAPA_KEY_MGMT_SAE 0x00010000
2100c1d255d3SCy Schubert #define WPA_DRIVER_CAPA_KEY_MGMT_802_1X_SHA256 0x00020000
2101c1d255d3SCy Schubert #define WPA_DRIVER_CAPA_KEY_MGMT_PSK_SHA256 0x00040000
2102c1d255d3SCy Schubert #define WPA_DRIVER_CAPA_KEY_MGMT_TPK_HANDSHAKE 0x00080000
2103c1d255d3SCy Schubert #define WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE 0x00100000
2104c1d255d3SCy Schubert #define WPA_DRIVER_CAPA_KEY_MGMT_FT_802_1X_SHA384 0x00200000
2105c1d255d3SCy Schubert #define WPA_DRIVER_CAPA_KEY_MGMT_CCKM 0x00400000
2106c1d255d3SCy Schubert #define WPA_DRIVER_CAPA_KEY_MGMT_OSEN 0x00800000
2107*a90b9d01SCy Schubert #define WPA_DRIVER_CAPA_KEY_MGMT_SAE_EXT_KEY 0x01000000
2108*a90b9d01SCy Schubert #define WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE_EXT_KEY 0x02000000
21095b9c547cSRui Paulo /** Bitfield of supported key management suites */
211039beb93cSSam Leffler unsigned int key_mgmt;
2111c1d255d3SCy Schubert unsigned int key_mgmt_iftype[WPA_IF_MAX];
211239beb93cSSam Leffler
211339beb93cSSam Leffler #define WPA_DRIVER_CAPA_ENC_WEP40 0x00000001
211439beb93cSSam Leffler #define WPA_DRIVER_CAPA_ENC_WEP104 0x00000002
211539beb93cSSam Leffler #define WPA_DRIVER_CAPA_ENC_TKIP 0x00000004
211639beb93cSSam Leffler #define WPA_DRIVER_CAPA_ENC_CCMP 0x00000008
2117f05cddf9SRui Paulo #define WPA_DRIVER_CAPA_ENC_WEP128 0x00000010
2118f05cddf9SRui Paulo #define WPA_DRIVER_CAPA_ENC_GCMP 0x00000020
21195b9c547cSRui Paulo #define WPA_DRIVER_CAPA_ENC_GCMP_256 0x00000040
21205b9c547cSRui Paulo #define WPA_DRIVER_CAPA_ENC_CCMP_256 0x00000080
21215b9c547cSRui Paulo #define WPA_DRIVER_CAPA_ENC_BIP 0x00000100
21225b9c547cSRui Paulo #define WPA_DRIVER_CAPA_ENC_BIP_GMAC_128 0x00000200
21235b9c547cSRui Paulo #define WPA_DRIVER_CAPA_ENC_BIP_GMAC_256 0x00000400
21245b9c547cSRui Paulo #define WPA_DRIVER_CAPA_ENC_BIP_CMAC_256 0x00000800
21255b9c547cSRui Paulo #define WPA_DRIVER_CAPA_ENC_GTK_NOT_USED 0x00001000
21265b9c547cSRui Paulo /** Bitfield of supported cipher suites */
212739beb93cSSam Leffler unsigned int enc;
212839beb93cSSam Leffler
212939beb93cSSam Leffler #define WPA_DRIVER_AUTH_OPEN 0x00000001
213039beb93cSSam Leffler #define WPA_DRIVER_AUTH_SHARED 0x00000002
213139beb93cSSam Leffler #define WPA_DRIVER_AUTH_LEAP 0x00000004
21325b9c547cSRui Paulo /** Bitfield of supported IEEE 802.11 authentication algorithms */
213339beb93cSSam Leffler unsigned int auth;
213439beb93cSSam Leffler
21355b9c547cSRui Paulo /** Driver generated WPA/RSN IE */
213639beb93cSSam Leffler #define WPA_DRIVER_FLAGS_DRIVER_IE 0x00000001
21375b9c547cSRui Paulo /** Driver needs static WEP key setup after association command */
213839beb93cSSam Leffler #define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC 0x00000002
21395b9c547cSRui Paulo /** Driver takes care of all DFS operations */
21405b9c547cSRui Paulo #define WPA_DRIVER_FLAGS_DFS_OFFLOAD 0x00000004
21415b9c547cSRui Paulo /** Driver takes care of RSN 4-way handshake internally; PMK is configured with
2142c1d255d3SCy Schubert * struct wpa_driver_ops::set_key using key_flag = KEY_FLAG_PMK */
21434bc52338SCy Schubert #define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X 0x00000008
21445b9c547cSRui Paulo /** Driver is for a wired Ethernet interface */
2145e28a4053SRui Paulo #define WPA_DRIVER_FLAGS_WIRED 0x00000010
21465b9c547cSRui Paulo /** Driver provides separate commands for authentication and association (SME in
2147e28a4053SRui Paulo * wpa_supplicant). */
2148e28a4053SRui Paulo #define WPA_DRIVER_FLAGS_SME 0x00000020
21495b9c547cSRui Paulo /** Driver supports AP mode */
2150e28a4053SRui Paulo #define WPA_DRIVER_FLAGS_AP 0x00000040
21515b9c547cSRui Paulo /** Driver needs static WEP key setup after association has been completed */
2152e28a4053SRui Paulo #define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE 0x00000080
21535b9c547cSRui Paulo /** Driver supports dynamic HT 20/40 MHz channel changes during BSS lifetime */
21545b9c547cSRui Paulo #define WPA_DRIVER_FLAGS_HT_2040_COEX 0x00000100
21555b9c547cSRui Paulo /** Driver supports concurrent P2P operations */
2156f05cddf9SRui Paulo #define WPA_DRIVER_FLAGS_P2P_CONCURRENT 0x00000200
21575b9c547cSRui Paulo /**
2158f05cddf9SRui Paulo * Driver uses the initial interface as a dedicated management interface, i.e.,
2159f05cddf9SRui Paulo * it cannot be used for P2P group operations or non-P2P purposes.
2160f05cddf9SRui Paulo */
2161f05cddf9SRui Paulo #define WPA_DRIVER_FLAGS_P2P_DEDICATED_INTERFACE 0x00000400
21625b9c547cSRui Paulo /** This interface is P2P capable (P2P GO or P2P Client) */
2163f05cddf9SRui Paulo #define WPA_DRIVER_FLAGS_P2P_CAPABLE 0x00000800
21645b9c547cSRui Paulo /** Driver supports station and key removal when stopping an AP */
21655b9c547cSRui Paulo #define WPA_DRIVER_FLAGS_AP_TEARDOWN_SUPPORT 0x00001000
21665b9c547cSRui Paulo /**
2167f05cddf9SRui Paulo * Driver uses the initial interface for P2P management interface and non-P2P
2168f05cddf9SRui Paulo * purposes (e.g., connect to infra AP), but this interface cannot be used for
2169f05cddf9SRui Paulo * P2P group operations.
2170f05cddf9SRui Paulo */
2171f05cddf9SRui Paulo #define WPA_DRIVER_FLAGS_P2P_MGMT_AND_NON_P2P 0x00002000
21725b9c547cSRui Paulo /**
21734b72b91aSCy Schubert * Driver is known to use valid error codes, i.e., when it indicates that
2174f05cddf9SRui Paulo * something (e.g., association) fails, there was indeed a failure and the
2175f05cddf9SRui Paulo * operation does not end up getting completed successfully later.
2176f05cddf9SRui Paulo */
21774b72b91aSCy Schubert #define WPA_DRIVER_FLAGS_VALID_ERROR_CODES 0x00004000
21785b9c547cSRui Paulo /** Driver supports off-channel TX */
2179f05cddf9SRui Paulo #define WPA_DRIVER_FLAGS_OFFCHANNEL_TX 0x00008000
21805b9c547cSRui Paulo /** Driver indicates TX status events for EAPOL Data frames */
2181f05cddf9SRui Paulo #define WPA_DRIVER_FLAGS_EAPOL_TX_STATUS 0x00010000
21825b9c547cSRui Paulo /** Driver indicates TX status events for Deauth/Disassoc frames */
2183f05cddf9SRui Paulo #define WPA_DRIVER_FLAGS_DEAUTH_TX_STATUS 0x00020000
21845b9c547cSRui Paulo /** Driver supports roaming (BSS selection) in firmware */
2185f05cddf9SRui Paulo #define WPA_DRIVER_FLAGS_BSS_SELECTION 0x00040000
21865b9c547cSRui Paulo /** Driver supports operating as a TDLS peer */
2187f05cddf9SRui Paulo #define WPA_DRIVER_FLAGS_TDLS_SUPPORT 0x00080000
21885b9c547cSRui Paulo /** Driver requires external TDLS setup/teardown/discovery */
2189f05cddf9SRui Paulo #define WPA_DRIVER_FLAGS_TDLS_EXTERNAL_SETUP 0x00100000
21905b9c547cSRui Paulo /** Driver indicates support for Probe Response offloading in AP mode */
2191f05cddf9SRui Paulo #define WPA_DRIVER_FLAGS_PROBE_RESP_OFFLOAD 0x00200000
21925b9c547cSRui Paulo /** Driver supports U-APSD in AP mode */
2193f05cddf9SRui Paulo #define WPA_DRIVER_FLAGS_AP_UAPSD 0x00400000
21945b9c547cSRui Paulo /** Driver supports inactivity timer in AP mode */
2195f05cddf9SRui Paulo #define WPA_DRIVER_FLAGS_INACTIVITY_TIMER 0x00800000
21965b9c547cSRui Paulo /** Driver expects user space implementation of MLME in AP mode */
2197f05cddf9SRui Paulo #define WPA_DRIVER_FLAGS_AP_MLME 0x01000000
21985b9c547cSRui Paulo /** Driver supports SAE with user space SME */
2199f05cddf9SRui Paulo #define WPA_DRIVER_FLAGS_SAE 0x02000000
22005b9c547cSRui Paulo /** Driver makes use of OBSS scan mechanism in wpa_supplicant */
2201f05cddf9SRui Paulo #define WPA_DRIVER_FLAGS_OBSS_SCAN 0x04000000
22025b9c547cSRui Paulo /** Driver supports IBSS (Ad-hoc) mode */
22035b9c547cSRui Paulo #define WPA_DRIVER_FLAGS_IBSS 0x08000000
22045b9c547cSRui Paulo /** Driver supports radar detection */
22055b9c547cSRui Paulo #define WPA_DRIVER_FLAGS_RADAR 0x10000000
22065b9c547cSRui Paulo /** Driver supports a dedicated interface for P2P Device */
22075b9c547cSRui Paulo #define WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE 0x20000000
22085b9c547cSRui Paulo /** Driver supports QoS Mapping */
22095b9c547cSRui Paulo #define WPA_DRIVER_FLAGS_QOS_MAPPING 0x40000000
22105b9c547cSRui Paulo /** Driver supports CSA in AP mode */
22115b9c547cSRui Paulo #define WPA_DRIVER_FLAGS_AP_CSA 0x80000000
22125b9c547cSRui Paulo /** Driver supports mesh */
22135b9c547cSRui Paulo #define WPA_DRIVER_FLAGS_MESH 0x0000000100000000ULL
22145b9c547cSRui Paulo /** Driver support ACS offload */
22155b9c547cSRui Paulo #define WPA_DRIVER_FLAGS_ACS_OFFLOAD 0x0000000200000000ULL
22165b9c547cSRui Paulo /** Driver supports key management offload */
22175b9c547cSRui Paulo #define WPA_DRIVER_FLAGS_KEY_MGMT_OFFLOAD 0x0000000400000000ULL
22185b9c547cSRui Paulo /** Driver supports TDLS channel switching */
22195b9c547cSRui Paulo #define WPA_DRIVER_FLAGS_TDLS_CHANNEL_SWITCH 0x0000000800000000ULL
22205b9c547cSRui Paulo /** Driver supports IBSS with HT datarates */
22215b9c547cSRui Paulo #define WPA_DRIVER_FLAGS_HT_IBSS 0x0000001000000000ULL
22225b9c547cSRui Paulo /** Driver supports IBSS with VHT datarates */
22235b9c547cSRui Paulo #define WPA_DRIVER_FLAGS_VHT_IBSS 0x0000002000000000ULL
2224325151a3SRui Paulo /** Driver supports automatic band selection */
2225325151a3SRui Paulo #define WPA_DRIVER_FLAGS_SUPPORT_HW_MODE_ANY 0x0000004000000000ULL
2226780fb4a2SCy Schubert /** Driver supports simultaneous off-channel operations */
2227780fb4a2SCy Schubert #define WPA_DRIVER_FLAGS_OFFCHANNEL_SIMULTANEOUS 0x0000008000000000ULL
2228780fb4a2SCy Schubert /** Driver supports full AP client state */
2229780fb4a2SCy Schubert #define WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE 0x0000010000000000ULL
2230780fb4a2SCy Schubert /** Driver supports P2P Listen offload */
2231780fb4a2SCy Schubert #define WPA_DRIVER_FLAGS_P2P_LISTEN_OFFLOAD 0x0000020000000000ULL
223285732ac8SCy Schubert /** Driver supports FILS */
223385732ac8SCy Schubert #define WPA_DRIVER_FLAGS_SUPPORT_FILS 0x0000040000000000ULL
223485732ac8SCy Schubert /** Driver supports Beacon frame TX rate configuration (legacy rates) */
223585732ac8SCy Schubert #define WPA_DRIVER_FLAGS_BEACON_RATE_LEGACY 0x0000080000000000ULL
223685732ac8SCy Schubert /** Driver supports Beacon frame TX rate configuration (HT rates) */
223785732ac8SCy Schubert #define WPA_DRIVER_FLAGS_BEACON_RATE_HT 0x0000100000000000ULL
223885732ac8SCy Schubert /** Driver supports Beacon frame TX rate configuration (VHT rates) */
223985732ac8SCy Schubert #define WPA_DRIVER_FLAGS_BEACON_RATE_VHT 0x0000200000000000ULL
224085732ac8SCy Schubert /** Driver supports mgmt_tx with random TX address in non-connected state */
224185732ac8SCy Schubert #define WPA_DRIVER_FLAGS_MGMT_TX_RANDOM_TA 0x0000400000000000ULL
224285732ac8SCy Schubert /** Driver supports mgmt_tx with random TX addr in connected state */
224385732ac8SCy Schubert #define WPA_DRIVER_FLAGS_MGMT_TX_RANDOM_TA_CONNECTED 0x0000800000000000ULL
224485732ac8SCy Schubert /** Driver supports better BSS reporting with sched_scan in connected mode */
224585732ac8SCy Schubert #define WPA_DRIVER_FLAGS_SCHED_SCAN_RELATIVE_RSSI 0x0001000000000000ULL
224685732ac8SCy Schubert /** Driver supports HE capabilities */
224785732ac8SCy Schubert #define WPA_DRIVER_FLAGS_HE_CAPABILITIES 0x0002000000000000ULL
224885732ac8SCy Schubert /** Driver supports FILS shared key offload */
224985732ac8SCy Schubert #define WPA_DRIVER_FLAGS_FILS_SK_OFFLOAD 0x0004000000000000ULL
225085732ac8SCy Schubert /** Driver supports all OCE STA specific mandatory features */
225185732ac8SCy Schubert #define WPA_DRIVER_FLAGS_OCE_STA 0x0008000000000000ULL
225285732ac8SCy Schubert /** Driver supports all OCE AP specific mandatory features */
225385732ac8SCy Schubert #define WPA_DRIVER_FLAGS_OCE_AP 0x0010000000000000ULL
225485732ac8SCy Schubert /**
225585732ac8SCy Schubert * Driver supports all OCE STA-CFON specific mandatory features only.
225685732ac8SCy Schubert * If a driver sets this bit but not the %WPA_DRIVER_FLAGS_OCE_AP, the
225785732ac8SCy Schubert * userspace shall assume that this driver may not support all OCE AP
225885732ac8SCy Schubert * functionality but can support only OCE STA-CFON functionality.
225985732ac8SCy Schubert */
226085732ac8SCy Schubert #define WPA_DRIVER_FLAGS_OCE_STA_CFON 0x0020000000000000ULL
226185732ac8SCy Schubert /** Driver supports MFP-optional in the connect command */
226285732ac8SCy Schubert #define WPA_DRIVER_FLAGS_MFP_OPTIONAL 0x0040000000000000ULL
226385732ac8SCy Schubert /** Driver is a self-managed regulatory device */
226485732ac8SCy Schubert #define WPA_DRIVER_FLAGS_SELF_MANAGED_REGULATORY 0x0080000000000000ULL
22654bc52338SCy Schubert /** Driver supports FTM responder functionality */
22664bc52338SCy Schubert #define WPA_DRIVER_FLAGS_FTM_RESPONDER 0x0100000000000000ULL
22674bc52338SCy Schubert /** Driver support 4-way handshake offload for WPA-Personal */
22684bc52338SCy Schubert #define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK 0x0200000000000000ULL
2269c1d255d3SCy Schubert /** Driver supports a separate control port TX for EAPOL frames */
2270c1d255d3SCy Schubert #define WPA_DRIVER_FLAGS_CONTROL_PORT 0x0400000000000000ULL
2271c1d255d3SCy Schubert /** Driver supports VLAN offload */
2272c1d255d3SCy Schubert #define WPA_DRIVER_FLAGS_VLAN_OFFLOAD 0x0800000000000000ULL
2273c1d255d3SCy Schubert /** Driver supports UPDATE_FT_IES command */
2274c1d255d3SCy Schubert #define WPA_DRIVER_FLAGS_UPDATE_FT_IES 0x1000000000000000ULL
2275c1d255d3SCy Schubert /** Driver can correctly rekey PTKs without Extended Key ID */
2276c1d255d3SCy Schubert #define WPA_DRIVER_FLAGS_SAFE_PTK0_REKEYS 0x2000000000000000ULL
2277c1d255d3SCy Schubert /** Driver supports Beacon protection */
2278c1d255d3SCy Schubert #define WPA_DRIVER_FLAGS_BEACON_PROTECTION 0x4000000000000000ULL
2279c1d255d3SCy Schubert /** Driver supports Extended Key ID */
2280c1d255d3SCy Schubert #define WPA_DRIVER_FLAGS_EXTENDED_KEY_ID 0x8000000000000000ULL
22815b9c547cSRui Paulo u64 flags;
2282e28a4053SRui Paulo
2283c1d255d3SCy Schubert /** Driver supports a separate control port RX for EAPOL frames */
2284c1d255d3SCy Schubert #define WPA_DRIVER_FLAGS2_CONTROL_PORT_RX 0x0000000000000001ULL
2285c1d255d3SCy Schubert /** Driver supports TX status reports for EAPOL frames through control port */
2286c1d255d3SCy Schubert #define WPA_DRIVER_FLAGS2_CONTROL_PORT_TX_STATUS 0x0000000000000002ULL
2287*a90b9d01SCy Schubert /** Driver supports secure LTF in AP mode */
2288*a90b9d01SCy Schubert #define WPA_DRIVER_FLAGS2_SEC_LTF_AP 0x0000000000000004ULL
2289*a90b9d01SCy Schubert /** Driver supports secure RTT measurement exchange in AP mode */
2290*a90b9d01SCy Schubert #define WPA_DRIVER_FLAGS2_SEC_RTT_AP 0x0000000000000008ULL
2291c1d255d3SCy Schubert /**
2292c1d255d3SCy Schubert * Driver supports protection of range negotiation and measurement management
2293*a90b9d01SCy Schubert * frames in AP mode
2294c1d255d3SCy Schubert */
2295*a90b9d01SCy Schubert #define WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_AP 0x0000000000000010ULL
2296c1d255d3SCy Schubert /** Driver supports Beacon frame TX rate configuration (HE rates) */
2297c1d255d3SCy Schubert #define WPA_DRIVER_FLAGS2_BEACON_RATE_HE 0x0000000000000020ULL
2298c1d255d3SCy Schubert /** Driver supports Beacon protection only in client mode */
2299c1d255d3SCy Schubert #define WPA_DRIVER_FLAGS2_BEACON_PROTECTION_CLIENT 0x0000000000000040ULL
2300c1d255d3SCy Schubert /** Driver supports Operating Channel Validation */
2301c1d255d3SCy Schubert #define WPA_DRIVER_FLAGS2_OCV 0x0000000000000080ULL
2302c1d255d3SCy Schubert /** Driver expects user space implementation of SME in AP mode */
2303c1d255d3SCy Schubert #define WPA_DRIVER_FLAGS2_AP_SME 0x0000000000000100ULL
2304*a90b9d01SCy Schubert /** Driver handles SA Query procedures in AP mode */
2305*a90b9d01SCy Schubert #define WPA_DRIVER_FLAGS2_SA_QUERY_OFFLOAD_AP 0x0000000000000200ULL
2306*a90b9d01SCy Schubert /** Driver supports background radar/CAC detection */
2307*a90b9d01SCy Schubert #define WPA_DRIVER_FLAGS2_RADAR_BACKGROUND 0x0000000000000400ULL
2308*a90b9d01SCy Schubert /** Driver supports secure LTF in STA mode */
2309*a90b9d01SCy Schubert #define WPA_DRIVER_FLAGS2_SEC_LTF_STA 0x0000000000000800ULL
2310*a90b9d01SCy Schubert /** Driver supports secure RTT measurement exchange in STA mode */
2311*a90b9d01SCy Schubert #define WPA_DRIVER_FLAGS2_SEC_RTT_STA 0x0000000000001000ULL
2312*a90b9d01SCy Schubert /**
2313*a90b9d01SCy Schubert * Driver supports protection of range negotiation and measurement management
2314*a90b9d01SCy Schubert * frames in STA mode
2315*a90b9d01SCy Schubert */
2316*a90b9d01SCy Schubert #define WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_STA 0x0000000000002000ULL
2317*a90b9d01SCy Schubert /** Driver supports MLO in station/AP mode */
2318*a90b9d01SCy Schubert #define WPA_DRIVER_FLAGS2_MLO 0x0000000000004000ULL
2319*a90b9d01SCy Schubert /** Driver supports minimal scan request probe content */
2320*a90b9d01SCy Schubert #define WPA_DRIVER_FLAGS2_SCAN_MIN_PREQ 0x0000000000008000ULL
2321*a90b9d01SCy Schubert /** Driver supports SAE authentication offload in STA mode */
2322*a90b9d01SCy Schubert #define WPA_DRIVER_FLAGS2_SAE_OFFLOAD_STA 0x0000000000010000ULL
2323*a90b9d01SCy Schubert /** Driver support AP_PSK authentication offload */
2324*a90b9d01SCy Schubert #define WPA_DRIVER_FLAGS2_4WAY_HANDSHAKE_AP_PSK 0x0000000000020000ULL
2325*a90b9d01SCy Schubert /** Driver supports OWE STA offload */
2326*a90b9d01SCy Schubert #define WPA_DRIVER_FLAGS2_OWE_OFFLOAD_STA 0x0000000000040000ULL
2327*a90b9d01SCy Schubert /** Driver supports OWE AP offload */
2328*a90b9d01SCy Schubert #define WPA_DRIVER_FLAGS2_OWE_OFFLOAD_AP 0x0000000000080000ULL
2329*a90b9d01SCy Schubert /** Driver support AP SAE authentication offload */
2330*a90b9d01SCy Schubert #define WPA_DRIVER_FLAGS2_SAE_OFFLOAD_AP 0x0000000000100000ULL
2331*a90b9d01SCy Schubert /** Driver supports TWT responder in HT and VHT modes */
2332*a90b9d01SCy Schubert #define WPA_DRIVER_FLAGS2_HT_VHT_TWT_RESPONDER 0x0000000000200000ULL
2333c1d255d3SCy Schubert u64 flags2;
2334c1d255d3SCy Schubert
2335780fb4a2SCy Schubert #define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \
2336780fb4a2SCy Schubert (drv_flags & WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE)
2337780fb4a2SCy Schubert
23385b9c547cSRui Paulo unsigned int wmm_ac_supported:1;
23395b9c547cSRui Paulo
23405b9c547cSRui Paulo unsigned int mac_addr_rand_scan_supported:1;
23415b9c547cSRui Paulo unsigned int mac_addr_rand_sched_scan_supported:1;
23425b9c547cSRui Paulo
23435b9c547cSRui Paulo /** Maximum number of supported active probe SSIDs */
2344e28a4053SRui Paulo int max_scan_ssids;
23455b9c547cSRui Paulo
23465b9c547cSRui Paulo /** Maximum number of supported active probe SSIDs for sched_scan */
2347f05cddf9SRui Paulo int max_sched_scan_ssids;
23485b9c547cSRui Paulo
2349780fb4a2SCy Schubert /** Maximum number of supported scan plans for scheduled scan */
2350780fb4a2SCy Schubert unsigned int max_sched_scan_plans;
2351780fb4a2SCy Schubert
2352780fb4a2SCy Schubert /** Maximum interval in a scan plan. In seconds */
2353780fb4a2SCy Schubert u32 max_sched_scan_plan_interval;
2354780fb4a2SCy Schubert
2355780fb4a2SCy Schubert /** Maximum number of iterations in a single scan plan */
2356780fb4a2SCy Schubert u32 max_sched_scan_plan_iterations;
2357780fb4a2SCy Schubert
23585b9c547cSRui Paulo /** Whether sched_scan (offloaded scanning) is supported */
2359f05cddf9SRui Paulo int sched_scan_supported;
23605b9c547cSRui Paulo
23615b9c547cSRui Paulo /** Maximum number of supported match sets for sched_scan */
2362f05cddf9SRui Paulo int max_match_sets;
2363e28a4053SRui Paulo
2364e28a4053SRui Paulo /**
2365e28a4053SRui Paulo * max_remain_on_chan - Maximum remain-on-channel duration in msec
2366e28a4053SRui Paulo */
2367e28a4053SRui Paulo unsigned int max_remain_on_chan;
2368f05cddf9SRui Paulo
2369f05cddf9SRui Paulo /**
2370f05cddf9SRui Paulo * max_stations - Maximum number of associated stations the driver
2371f05cddf9SRui Paulo * supports in AP mode
2372f05cddf9SRui Paulo */
2373f05cddf9SRui Paulo unsigned int max_stations;
2374f05cddf9SRui Paulo
2375f05cddf9SRui Paulo /**
2376f05cddf9SRui Paulo * probe_resp_offloads - Bitmap of supported protocols by the driver
2377f05cddf9SRui Paulo * for Probe Response offloading.
2378f05cddf9SRui Paulo */
23795b9c547cSRui Paulo /** Driver Probe Response offloading support for WPS ver. 1 */
2380f05cddf9SRui Paulo #define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS 0x00000001
23815b9c547cSRui Paulo /** Driver Probe Response offloading support for WPS ver. 2 */
2382f05cddf9SRui Paulo #define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS2 0x00000002
23835b9c547cSRui Paulo /** Driver Probe Response offloading support for P2P */
2384f05cddf9SRui Paulo #define WPA_DRIVER_PROBE_RESP_OFFLOAD_P2P 0x00000004
23855b9c547cSRui Paulo /** Driver Probe Response offloading support for IEEE 802.11u (Interworking) */
2386f05cddf9SRui Paulo #define WPA_DRIVER_PROBE_RESP_OFFLOAD_INTERWORKING 0x00000008
2387f05cddf9SRui Paulo unsigned int probe_resp_offloads;
23885b9c547cSRui Paulo
23895b9c547cSRui Paulo unsigned int max_acl_mac_addrs;
23905b9c547cSRui Paulo
23915b9c547cSRui Paulo /**
23925b9c547cSRui Paulo * Number of supported concurrent channels
23935b9c547cSRui Paulo */
23945b9c547cSRui Paulo unsigned int num_multichan_concurrent;
23955b9c547cSRui Paulo
23965b9c547cSRui Paulo /**
23975b9c547cSRui Paulo * extended_capa - extended capabilities in driver/device
23985b9c547cSRui Paulo *
23995b9c547cSRui Paulo * Must be allocated and freed by driver and the pointers must be
24005b9c547cSRui Paulo * valid for the lifetime of the driver, i.e., freed in deinit()
24015b9c547cSRui Paulo */
24025b9c547cSRui Paulo const u8 *extended_capa, *extended_capa_mask;
24035b9c547cSRui Paulo unsigned int extended_capa_len;
24045b9c547cSRui Paulo
24055b9c547cSRui Paulo struct wowlan_triggers wowlan_triggers;
24065b9c547cSRui Paulo
24075b9c547cSRui Paulo /** Driver adds the DS Params Set IE in Probe Request frames */
24085b9c547cSRui Paulo #define WPA_DRIVER_FLAGS_DS_PARAM_SET_IE_IN_PROBES 0x00000001
24095b9c547cSRui Paulo /** Driver adds the WFA TPC IE in Probe Request frames */
24105b9c547cSRui Paulo #define WPA_DRIVER_FLAGS_WFA_TPC_IE_IN_PROBES 0x00000002
24115b9c547cSRui Paulo /** Driver handles quiet period requests */
24125b9c547cSRui Paulo #define WPA_DRIVER_FLAGS_QUIET 0x00000004
24135b9c547cSRui Paulo /**
24145b9c547cSRui Paulo * Driver is capable of inserting the current TX power value into the body of
24155b9c547cSRui Paulo * transmitted frames.
24165b9c547cSRui Paulo * Background: Some Action frames include a TPC Report IE. This IE contains a
24175b9c547cSRui Paulo * TX power field, which has to be updated by lower layers. One such Action
24185b9c547cSRui Paulo * frame is Link Measurement Report (part of RRM). Another is TPC Report (part
24195b9c547cSRui Paulo * of spectrum management). Note that this insertion takes place at a fixed
24205b9c547cSRui Paulo * offset, namely the 6th byte in the Action frame body.
24215b9c547cSRui Paulo */
24225b9c547cSRui Paulo #define WPA_DRIVER_FLAGS_TX_POWER_INSERTION 0x00000008
2423780fb4a2SCy Schubert /**
2424780fb4a2SCy Schubert * Driver supports RRM. With this support, the driver will accept to use RRM in
2425780fb4a2SCy Schubert * (Re)Association Request frames, without supporting quiet period.
2426780fb4a2SCy Schubert */
2427780fb4a2SCy Schubert #define WPA_DRIVER_FLAGS_SUPPORT_RRM 0x00000010
2428780fb4a2SCy Schubert
242985732ac8SCy Schubert /** Driver supports setting the scan dwell time */
243085732ac8SCy Schubert #define WPA_DRIVER_FLAGS_SUPPORT_SET_SCAN_DWELL 0x00000020
243185732ac8SCy Schubert /** Driver supports Beacon Report Measurement */
243285732ac8SCy Schubert #define WPA_DRIVER_FLAGS_SUPPORT_BEACON_REPORT 0x00000040
243385732ac8SCy Schubert
24345b9c547cSRui Paulo u32 rrm_flags;
2435325151a3SRui Paulo
2436325151a3SRui Paulo /* Driver concurrency capabilities */
2437325151a3SRui Paulo unsigned int conc_capab;
2438325151a3SRui Paulo /* Maximum number of concurrent channels on 2.4 GHz */
2439325151a3SRui Paulo unsigned int max_conc_chan_2_4;
2440325151a3SRui Paulo /* Maximum number of concurrent channels on 5 GHz */
2441325151a3SRui Paulo unsigned int max_conc_chan_5_0;
2442780fb4a2SCy Schubert
2443780fb4a2SCy Schubert /* Maximum number of supported CSA counters */
2444780fb4a2SCy Schubert u16 max_csa_counters;
2445*a90b9d01SCy Schubert
2446*a90b9d01SCy Schubert /* Maximum number of supported AKM suites in commands */
2447*a90b9d01SCy Schubert unsigned int max_num_akms;
2448*a90b9d01SCy Schubert
2449*a90b9d01SCy Schubert /* Maximum number of interfaces supported for MBSSID advertisement */
2450*a90b9d01SCy Schubert unsigned int mbssid_max_interfaces;
2451*a90b9d01SCy Schubert /* Maximum profile periodicity for enhanced MBSSID advertisement */
2452*a90b9d01SCy Schubert unsigned int ema_max_periodicity;
245339beb93cSSam Leffler };
245439beb93cSSam Leffler
245539beb93cSSam Leffler
2456e28a4053SRui Paulo struct hostapd_data;
245739beb93cSSam Leffler
2458*a90b9d01SCy Schubert enum guard_interval {
2459*a90b9d01SCy Schubert GUARD_INTERVAL_0_4 = 1,
2460*a90b9d01SCy Schubert GUARD_INTERVAL_0_8 = 2,
2461*a90b9d01SCy Schubert GUARD_INTERVAL_1_6 = 3,
2462*a90b9d01SCy Schubert GUARD_INTERVAL_3_2 = 4,
2463*a90b9d01SCy Schubert };
2464*a90b9d01SCy Schubert
246585732ac8SCy Schubert #define STA_DRV_DATA_TX_MCS BIT(0)
246685732ac8SCy Schubert #define STA_DRV_DATA_RX_MCS BIT(1)
246785732ac8SCy Schubert #define STA_DRV_DATA_TX_VHT_MCS BIT(2)
246885732ac8SCy Schubert #define STA_DRV_DATA_RX_VHT_MCS BIT(3)
246985732ac8SCy Schubert #define STA_DRV_DATA_TX_VHT_NSS BIT(4)
247085732ac8SCy Schubert #define STA_DRV_DATA_RX_VHT_NSS BIT(5)
247185732ac8SCy Schubert #define STA_DRV_DATA_TX_SHORT_GI BIT(6)
247285732ac8SCy Schubert #define STA_DRV_DATA_RX_SHORT_GI BIT(7)
247385732ac8SCy Schubert #define STA_DRV_DATA_LAST_ACK_RSSI BIT(8)
24744b72b91aSCy Schubert #define STA_DRV_DATA_CONN_TIME BIT(9)
2475*a90b9d01SCy Schubert #define STA_DRV_DATA_TX_HE_MCS BIT(10)
2476*a90b9d01SCy Schubert #define STA_DRV_DATA_RX_HE_MCS BIT(11)
2477*a90b9d01SCy Schubert #define STA_DRV_DATA_TX_HE_NSS BIT(12)
2478*a90b9d01SCy Schubert #define STA_DRV_DATA_RX_HE_NSS BIT(13)
2479*a90b9d01SCy Schubert #define STA_DRV_DATA_TX_HE_DCM BIT(14)
2480*a90b9d01SCy Schubert #define STA_DRV_DATA_RX_HE_DCM BIT(15)
2481*a90b9d01SCy Schubert #define STA_DRV_DATA_TX_HE_GI BIT(16)
2482*a90b9d01SCy Schubert #define STA_DRV_DATA_RX_HE_GI BIT(17)
248385732ac8SCy Schubert
2484e28a4053SRui Paulo struct hostap_sta_driver_data {
2485780fb4a2SCy Schubert unsigned long rx_packets, tx_packets;
2486780fb4a2SCy Schubert unsigned long long rx_bytes, tx_bytes;
2487206b73d0SCy Schubert unsigned long long rx_airtime, tx_airtime;
2488*a90b9d01SCy Schubert unsigned long long beacons_count;
2489780fb4a2SCy Schubert int bytes_64bit; /* whether 64-bit byte counters are supported */
2490*a90b9d01SCy Schubert unsigned long current_tx_rate; /* in kbps */
2491*a90b9d01SCy Schubert unsigned long current_rx_rate; /* in kbps */
2492e28a4053SRui Paulo unsigned long inactive_msec;
24934b72b91aSCy Schubert unsigned long connected_sec;
249485732ac8SCy Schubert unsigned long flags; /* bitfield of STA_DRV_DATA_* */
2495e28a4053SRui Paulo unsigned long num_ps_buf_frames;
2496e28a4053SRui Paulo unsigned long tx_retry_failed;
2497e28a4053SRui Paulo unsigned long tx_retry_count;
249885732ac8SCy Schubert s8 last_ack_rssi;
2499206b73d0SCy Schubert unsigned long backlog_packets;
2500206b73d0SCy Schubert unsigned long backlog_bytes;
2501*a90b9d01SCy Schubert unsigned long fcs_error_count;
2502*a90b9d01SCy Schubert unsigned long beacon_loss_count;
2503*a90b9d01SCy Schubert unsigned long expected_throughput;
2504*a90b9d01SCy Schubert unsigned long rx_drop_misc;
2505*a90b9d01SCy Schubert unsigned long rx_mpdus;
2506*a90b9d01SCy Schubert int signal; /* dBm; or -WPA_INVALID_NOISE */
2507*a90b9d01SCy Schubert u8 rx_hemcs;
2508*a90b9d01SCy Schubert u8 tx_hemcs;
250985732ac8SCy Schubert u8 rx_vhtmcs;
251085732ac8SCy Schubert u8 tx_vhtmcs;
251185732ac8SCy Schubert u8 rx_mcs;
251285732ac8SCy Schubert u8 tx_mcs;
2513*a90b9d01SCy Schubert u8 rx_he_nss;
2514*a90b9d01SCy Schubert u8 tx_he_nss;
251585732ac8SCy Schubert u8 rx_vht_nss;
251685732ac8SCy Schubert u8 tx_vht_nss;
2517*a90b9d01SCy Schubert s8 avg_signal; /* dBm */
2518*a90b9d01SCy Schubert s8 avg_beacon_signal; /* dBm */
2519*a90b9d01SCy Schubert s8 avg_ack_signal; /* dBm */
2520*a90b9d01SCy Schubert enum guard_interval rx_guard_interval, tx_guard_interval;
2521*a90b9d01SCy Schubert u8 rx_dcm, tx_dcm;
252239beb93cSSam Leffler };
252339beb93cSSam Leffler
2524e28a4053SRui Paulo struct hostapd_sta_add_params {
2525e28a4053SRui Paulo const u8 *addr;
2526e28a4053SRui Paulo u16 aid;
2527e28a4053SRui Paulo u16 capability;
2528e28a4053SRui Paulo const u8 *supp_rates;
2529e28a4053SRui Paulo size_t supp_rates_len;
2530e28a4053SRui Paulo u16 listen_interval;
2531e28a4053SRui Paulo const struct ieee80211_ht_capabilities *ht_capabilities;
25325b9c547cSRui Paulo const struct ieee80211_vht_capabilities *vht_capabilities;
25335b9c547cSRui Paulo int vht_opmode_enabled;
25345b9c547cSRui Paulo u8 vht_opmode;
2535206b73d0SCy Schubert const struct ieee80211_he_capabilities *he_capab;
2536206b73d0SCy Schubert size_t he_capab_len;
2537c1d255d3SCy Schubert const struct ieee80211_he_6ghz_band_cap *he_6ghz_capab;
2538*a90b9d01SCy Schubert const struct ieee80211_eht_capabilities *eht_capab;
2539*a90b9d01SCy Schubert size_t eht_capab_len;
2540f05cddf9SRui Paulo u32 flags; /* bitmask of WPA_STA_* flags */
25415b9c547cSRui Paulo u32 flags_mask; /* unset bits in flags */
25425b9c547cSRui Paulo #ifdef CONFIG_MESH
25435b9c547cSRui Paulo enum mesh_plink_state plink_state;
2544780fb4a2SCy Schubert u16 peer_aid;
25455b9c547cSRui Paulo #endif /* CONFIG_MESH */
2546f05cddf9SRui Paulo int set; /* Set STA parameters instead of add */
2547f05cddf9SRui Paulo u8 qosinfo;
25485b9c547cSRui Paulo const u8 *ext_capab;
25495b9c547cSRui Paulo size_t ext_capab_len;
25505b9c547cSRui Paulo const u8 *supp_channels;
25515b9c547cSRui Paulo size_t supp_channels_len;
25525b9c547cSRui Paulo const u8 *supp_oper_classes;
25535b9c547cSRui Paulo size_t supp_oper_classes_len;
2554780fb4a2SCy Schubert int support_p2p_ps;
2555*a90b9d01SCy Schubert
2556*a90b9d01SCy Schubert bool mld_link_sta;
2557*a90b9d01SCy Schubert s8 mld_link_id;
2558*a90b9d01SCy Schubert const u8 *mld_link_addr;
255939beb93cSSam Leffler };
256039beb93cSSam Leffler
25615b9c547cSRui Paulo struct mac_address {
25625b9c547cSRui Paulo u8 addr[ETH_ALEN];
25635b9c547cSRui Paulo };
25645b9c547cSRui Paulo
25655b9c547cSRui Paulo struct hostapd_acl_params {
25665b9c547cSRui Paulo u8 acl_policy;
25675b9c547cSRui Paulo unsigned int num_mac_acl;
25685b9c547cSRui Paulo struct mac_address mac_acl[0];
256939beb93cSSam Leffler };
257039beb93cSSam Leffler
2571e28a4053SRui Paulo struct wpa_init_params {
2572f05cddf9SRui Paulo void *global_priv;
2573e28a4053SRui Paulo const u8 *bssid;
2574e28a4053SRui Paulo const char *ifname;
25755b9c547cSRui Paulo const char *driver_params;
2576e28a4053SRui Paulo int use_pae_group_addr;
2577e28a4053SRui Paulo char **bridge;
2578e28a4053SRui Paulo size_t num_bridge;
2579e28a4053SRui Paulo
2580e28a4053SRui Paulo u8 *own_addr; /* buffer for writing own MAC address */
2581e28a4053SRui Paulo };
2582e28a4053SRui Paulo
2583e28a4053SRui Paulo
2584e28a4053SRui Paulo struct wpa_bss_params {
2585e28a4053SRui Paulo /** Interface name (for multi-SSID/VLAN support) */
2586e28a4053SRui Paulo const char *ifname;
2587e28a4053SRui Paulo /** Whether IEEE 802.1X or WPA/WPA2 is enabled */
2588e28a4053SRui Paulo int enabled;
2589e28a4053SRui Paulo
2590e28a4053SRui Paulo int wpa;
2591e28a4053SRui Paulo int ieee802_1x;
2592e28a4053SRui Paulo int wpa_group;
2593e28a4053SRui Paulo int wpa_pairwise;
2594e28a4053SRui Paulo int wpa_key_mgmt;
2595e28a4053SRui Paulo int rsn_preauth;
2596f05cddf9SRui Paulo enum mfp_options ieee80211w;
2597e28a4053SRui Paulo };
2598e28a4053SRui Paulo
2599e28a4053SRui Paulo #define WPA_STA_AUTHORIZED BIT(0)
2600e28a4053SRui Paulo #define WPA_STA_WMM BIT(1)
2601e28a4053SRui Paulo #define WPA_STA_SHORT_PREAMBLE BIT(2)
2602e28a4053SRui Paulo #define WPA_STA_MFP BIT(3)
2603f05cddf9SRui Paulo #define WPA_STA_TDLS_PEER BIT(4)
26045b9c547cSRui Paulo #define WPA_STA_AUTHENTICATED BIT(5)
2605780fb4a2SCy Schubert #define WPA_STA_ASSOCIATED BIT(6)
2606f05cddf9SRui Paulo
2607f05cddf9SRui Paulo enum tdls_oper {
2608f05cddf9SRui Paulo TDLS_DISCOVERY_REQ,
2609f05cddf9SRui Paulo TDLS_SETUP,
2610f05cddf9SRui Paulo TDLS_TEARDOWN,
2611f05cddf9SRui Paulo TDLS_ENABLE_LINK,
2612f05cddf9SRui Paulo TDLS_DISABLE_LINK,
2613f05cddf9SRui Paulo TDLS_ENABLE,
2614f05cddf9SRui Paulo TDLS_DISABLE
2615f05cddf9SRui Paulo };
2616f05cddf9SRui Paulo
2617f05cddf9SRui Paulo enum wnm_oper {
2618f05cddf9SRui Paulo WNM_SLEEP_ENTER_CONFIRM,
2619f05cddf9SRui Paulo WNM_SLEEP_ENTER_FAIL,
2620f05cddf9SRui Paulo WNM_SLEEP_EXIT_CONFIRM,
2621f05cddf9SRui Paulo WNM_SLEEP_EXIT_FAIL,
2622f05cddf9SRui Paulo WNM_SLEEP_TFS_REQ_IE_ADD, /* STA requests driver to add TFS req IE */
2623f05cddf9SRui Paulo WNM_SLEEP_TFS_REQ_IE_NONE, /* STA requests empty TFS req IE */
2624f05cddf9SRui Paulo WNM_SLEEP_TFS_REQ_IE_SET, /* AP requests driver to set TFS req IE for
2625f05cddf9SRui Paulo * a STA */
2626f05cddf9SRui Paulo WNM_SLEEP_TFS_RESP_IE_ADD, /* AP requests driver to add TFS resp IE
2627f05cddf9SRui Paulo * for a STA */
2628f05cddf9SRui Paulo WNM_SLEEP_TFS_RESP_IE_NONE, /* AP requests empty TFS resp IE */
2629f05cddf9SRui Paulo WNM_SLEEP_TFS_RESP_IE_SET, /* AP requests driver to set TFS resp IE
2630f05cddf9SRui Paulo * for a STA */
2631f05cddf9SRui Paulo WNM_SLEEP_TFS_IE_DEL /* AP delete the TFS IE */
2632f05cddf9SRui Paulo };
2633f05cddf9SRui Paulo
263485732ac8SCy Schubert /* enum smps_mode - SMPS mode definitions */
263585732ac8SCy Schubert enum smps_mode {
263685732ac8SCy Schubert SMPS_AUTOMATIC,
263785732ac8SCy Schubert SMPS_OFF,
263885732ac8SCy Schubert SMPS_DYNAMIC,
263985732ac8SCy Schubert SMPS_STATIC,
264085732ac8SCy Schubert
264185732ac8SCy Schubert /* Keep last */
264285732ac8SCy Schubert SMPS_INVALID,
264385732ac8SCy Schubert };
264485732ac8SCy Schubert
264585732ac8SCy Schubert #define WPA_INVALID_NOISE 9999
264685732ac8SCy Schubert
2647f05cddf9SRui Paulo /**
2648f05cddf9SRui Paulo * struct wpa_signal_info - Information about channel signal quality
264985732ac8SCy Schubert * @frequency: control frequency
265085732ac8SCy Schubert * @above_threshold: true if the above threshold was crossed
265185732ac8SCy Schubert * (relevant for a CQM event)
2652*a90b9d01SCy Schubert * @data: STA information
265385732ac8SCy Schubert * @current_noise: %WPA_INVALID_NOISE if not supported
265485732ac8SCy Schubert * @chanwidth: channel width
265585732ac8SCy Schubert * @center_frq1: center frequency for the first segment
265685732ac8SCy Schubert * @center_frq2: center frequency for the second segment (if relevant)
2657f05cddf9SRui Paulo */
2658f05cddf9SRui Paulo struct wpa_signal_info {
2659f05cddf9SRui Paulo u32 frequency;
2660f05cddf9SRui Paulo int above_threshold;
2661*a90b9d01SCy Schubert struct hostap_sta_driver_data data;
2662f05cddf9SRui Paulo int current_noise;
26635b9c547cSRui Paulo enum chan_width chanwidth;
26645b9c547cSRui Paulo int center_frq1;
26655b9c547cSRui Paulo int center_frq2;
2666f05cddf9SRui Paulo };
266739beb93cSSam Leffler
2668*a90b9d01SCy Schubert struct wpa_mlo_signal_info {
2669*a90b9d01SCy Schubert u16 valid_links;
2670*a90b9d01SCy Schubert struct wpa_signal_info links[MAX_NUM_MLD_LINKS];
2671*a90b9d01SCy Schubert };
2672*a90b9d01SCy Schubert
267339beb93cSSam Leffler /**
26744bc52338SCy Schubert * struct wpa_channel_info - Information about the current channel
26754bc52338SCy Schubert * @frequency: Center frequency of the primary 20 MHz channel
26764bc52338SCy Schubert * @chanwidth: Width of the current operating channel
26774bc52338SCy Schubert * @sec_channel: Location of the secondary 20 MHz channel (either +1 or -1).
26784bc52338SCy Schubert * This field is only filled in when using a 40 MHz channel.
26794bc52338SCy Schubert * @center_frq1: Center frequency of frequency segment 0
26804bc52338SCy Schubert * @center_frq2: Center frequency of frequency segment 1 (for 80+80 channels)
26814bc52338SCy Schubert * @seg1_idx: Frequency segment 1 index when using a 80+80 channel. This is
26824bc52338SCy Schubert * derived from center_frq2 for convenience.
26834bc52338SCy Schubert */
26844bc52338SCy Schubert struct wpa_channel_info {
26854bc52338SCy Schubert u32 frequency;
26864bc52338SCy Schubert enum chan_width chanwidth;
26874bc52338SCy Schubert int sec_channel;
26884bc52338SCy Schubert int center_frq1;
26894bc52338SCy Schubert int center_frq2;
26904bc52338SCy Schubert u8 seg1_idx;
26914bc52338SCy Schubert };
26924bc52338SCy Schubert
26934bc52338SCy Schubert /**
26945b9c547cSRui Paulo * struct beacon_data - Beacon data
26955b9c547cSRui Paulo * @head: Head portion of Beacon frame (before TIM IE)
26965b9c547cSRui Paulo * @tail: Tail portion of Beacon frame (after TIM IE)
26975b9c547cSRui Paulo * @beacon_ies: Extra information element(s) to add into Beacon frames or %NULL
26985b9c547cSRui Paulo * @proberesp_ies: Extra information element(s) to add into Probe Response
26995b9c547cSRui Paulo * frames or %NULL
27005b9c547cSRui Paulo * @assocresp_ies: Extra information element(s) to add into (Re)Association
27015b9c547cSRui Paulo * Response frames or %NULL
27025b9c547cSRui Paulo * @probe_resp: Probe Response frame template
27035b9c547cSRui Paulo * @head_len: Length of @head
27045b9c547cSRui Paulo * @tail_len: Length of @tail
27055b9c547cSRui Paulo * @beacon_ies_len: Length of beacon_ies in octets
27065b9c547cSRui Paulo * @proberesp_ies_len: Length of proberesp_ies in octets
27075b9c547cSRui Paulo * @proberesp_ies_len: Length of proberesp_ies in octets
27085b9c547cSRui Paulo * @probe_resp_len: Length of probe response template (@probe_resp)
27095b9c547cSRui Paulo */
27105b9c547cSRui Paulo struct beacon_data {
27115b9c547cSRui Paulo u8 *head, *tail;
27125b9c547cSRui Paulo u8 *beacon_ies;
27135b9c547cSRui Paulo u8 *proberesp_ies;
27145b9c547cSRui Paulo u8 *assocresp_ies;
27155b9c547cSRui Paulo u8 *probe_resp;
27165b9c547cSRui Paulo
27175b9c547cSRui Paulo size_t head_len, tail_len;
27185b9c547cSRui Paulo size_t beacon_ies_len;
27195b9c547cSRui Paulo size_t proberesp_ies_len;
27205b9c547cSRui Paulo size_t assocresp_ies_len;
27215b9c547cSRui Paulo size_t probe_resp_len;
27225b9c547cSRui Paulo };
27235b9c547cSRui Paulo
27245b9c547cSRui Paulo /**
27255b9c547cSRui Paulo * struct csa_settings - Settings for channel switch command
27265b9c547cSRui Paulo * @cs_count: Count in Beacon frames (TBTT) to perform the switch
27275b9c547cSRui Paulo * @block_tx: 1 - block transmission for CSA period
27285b9c547cSRui Paulo * @freq_params: Next channel frequency parameter
27295b9c547cSRui Paulo * @beacon_csa: Beacon/probe resp/asooc resp info for CSA period
27305b9c547cSRui Paulo * @beacon_after: Next beacon/probe resp/asooc resp info
27315b9c547cSRui Paulo * @counter_offset_beacon: Offset to the count field in beacon's tail
27325b9c547cSRui Paulo * @counter_offset_presp: Offset to the count field in probe resp.
2733*a90b9d01SCy Schubert * @punct_bitmap - Preamble puncturing bitmap
2734*a90b9d01SCy Schubert * @link_id: Link ID to determine the link for MLD; -1 for non-MLD
2735*a90b9d01SCy Schubert * @ubpr: Unsolicited broadcast Probe Response frame data
27365b9c547cSRui Paulo */
27375b9c547cSRui Paulo struct csa_settings {
27385b9c547cSRui Paulo u8 cs_count;
27395b9c547cSRui Paulo u8 block_tx;
27405b9c547cSRui Paulo
27415b9c547cSRui Paulo struct hostapd_freq_params freq_params;
27425b9c547cSRui Paulo struct beacon_data beacon_csa;
27435b9c547cSRui Paulo struct beacon_data beacon_after;
27445b9c547cSRui Paulo
2745780fb4a2SCy Schubert u16 counter_offset_beacon[2];
2746780fb4a2SCy Schubert u16 counter_offset_presp[2];
2747*a90b9d01SCy Schubert
2748*a90b9d01SCy Schubert u16 punct_bitmap;
2749*a90b9d01SCy Schubert int link_id;
2750*a90b9d01SCy Schubert
2751*a90b9d01SCy Schubert struct unsol_bcast_probe_resp ubpr;
2752*a90b9d01SCy Schubert };
2753*a90b9d01SCy Schubert
2754*a90b9d01SCy Schubert /**
2755*a90b9d01SCy Schubert * struct cca_settings - Settings for color switch command
2756*a90b9d01SCy Schubert * @cca_count: Count in Beacon frames (TBTT) to perform the switch
2757*a90b9d01SCy Schubert * @cca_color: The new color that we are switching to
2758*a90b9d01SCy Schubert * @beacon_cca: Beacon/Probe Response/(Re)Association Response frame info for
2759*a90b9d01SCy Schubert * color switch period
2760*a90b9d01SCy Schubert * @beacon_after: Next Beacon/Probe Response/(Re)Association Response frame info
2761*a90b9d01SCy Schubert * @counter_offset_beacon: Offset to the count field in Beacon frame tail
2762*a90b9d01SCy Schubert * @counter_offset_presp: Offset to the count field in Probe Response frame
2763*a90b9d01SCy Schubert * @ubpr: Unsolicited broadcast Probe Response frame data
2764*a90b9d01SCy Schubert * @link_id: If >= 0 indicates the link of the AP MLD to configure
2765*a90b9d01SCy Schubert */
2766*a90b9d01SCy Schubert struct cca_settings {
2767*a90b9d01SCy Schubert u8 cca_count;
2768*a90b9d01SCy Schubert u8 cca_color;
2769*a90b9d01SCy Schubert
2770*a90b9d01SCy Schubert struct beacon_data beacon_cca;
2771*a90b9d01SCy Schubert struct beacon_data beacon_after;
2772*a90b9d01SCy Schubert
2773*a90b9d01SCy Schubert u16 counter_offset_beacon;
2774*a90b9d01SCy Schubert u16 counter_offset_presp;
2775*a90b9d01SCy Schubert
2776*a90b9d01SCy Schubert struct unsol_bcast_probe_resp ubpr;
2777*a90b9d01SCy Schubert
2778*a90b9d01SCy Schubert int link_id;
27795b9c547cSRui Paulo };
27805b9c547cSRui Paulo
27815b9c547cSRui Paulo /* TDLS peer capabilities for send_tdls_mgmt() */
27825b9c547cSRui Paulo enum tdls_peer_capability {
27835b9c547cSRui Paulo TDLS_PEER_HT = BIT(0),
27845b9c547cSRui Paulo TDLS_PEER_VHT = BIT(1),
27855b9c547cSRui Paulo TDLS_PEER_WMM = BIT(2),
2786c1d255d3SCy Schubert TDLS_PEER_HE = BIT(3),
27875b9c547cSRui Paulo };
27885b9c547cSRui Paulo
27895b9c547cSRui Paulo /* valid info in the wmm_params struct */
27905b9c547cSRui Paulo enum wmm_params_valid_info {
27915b9c547cSRui Paulo WMM_PARAMS_UAPSD_QUEUES_INFO = BIT(0),
27925b9c547cSRui Paulo };
27935b9c547cSRui Paulo
27945b9c547cSRui Paulo /**
27955b9c547cSRui Paulo * struct wmm_params - WMM parameterss configured for this association
27965b9c547cSRui Paulo * @info_bitmap: Bitmap of valid wmm_params info; indicates what fields
27975b9c547cSRui Paulo * of the struct contain valid information.
27985b9c547cSRui Paulo * @uapsd_queues: Bitmap of ACs configured for uapsd (valid only if
27995b9c547cSRui Paulo * %WMM_PARAMS_UAPSD_QUEUES_INFO is set)
28005b9c547cSRui Paulo */
28015b9c547cSRui Paulo struct wmm_params {
28025b9c547cSRui Paulo u8 info_bitmap;
28035b9c547cSRui Paulo u8 uapsd_queues;
28045b9c547cSRui Paulo };
28055b9c547cSRui Paulo
28065b9c547cSRui Paulo #ifdef CONFIG_MACSEC
28075b9c547cSRui Paulo struct macsec_init_params {
2808c1d255d3SCy Schubert bool always_include_sci;
2809c1d255d3SCy Schubert bool use_es;
2810c1d255d3SCy Schubert bool use_scb;
28115b9c547cSRui Paulo };
28125b9c547cSRui Paulo #endif /* CONFIG_MACSEC */
28135b9c547cSRui Paulo
28145b9c547cSRui Paulo enum drv_br_port_attr {
28155b9c547cSRui Paulo DRV_BR_PORT_ATTR_PROXYARP,
28165b9c547cSRui Paulo DRV_BR_PORT_ATTR_HAIRPIN_MODE,
2817*a90b9d01SCy Schubert DRV_BR_PORT_ATTR_MCAST2UCAST,
28185b9c547cSRui Paulo };
28195b9c547cSRui Paulo
28205b9c547cSRui Paulo enum drv_br_net_param {
28215b9c547cSRui Paulo DRV_BR_NET_PARAM_GARP_ACCEPT,
2822325151a3SRui Paulo DRV_BR_MULTICAST_SNOOPING,
28235b9c547cSRui Paulo };
28245b9c547cSRui Paulo
28255b9c547cSRui Paulo struct drv_acs_params {
28265b9c547cSRui Paulo /* Selected mode (HOSTAPD_MODE_*) */
28275b9c547cSRui Paulo enum hostapd_hw_mode hw_mode;
28285b9c547cSRui Paulo
28295b9c547cSRui Paulo /* Indicates whether HT is enabled */
28305b9c547cSRui Paulo int ht_enabled;
28315b9c547cSRui Paulo
28325b9c547cSRui Paulo /* Indicates whether HT40 is enabled */
28335b9c547cSRui Paulo int ht40_enabled;
2834325151a3SRui Paulo
2835325151a3SRui Paulo /* Indicates whether VHT is enabled */
2836325151a3SRui Paulo int vht_enabled;
2837325151a3SRui Paulo
2838325151a3SRui Paulo /* Configured ACS channel width */
2839325151a3SRui Paulo u16 ch_width;
2840325151a3SRui Paulo
2841c1d255d3SCy Schubert /* ACS frequency list info */
2842325151a3SRui Paulo const int *freq_list;
2843c1d255d3SCy Schubert
2844c1d255d3SCy Schubert /* Indicates whether EDMG is enabled */
2845c1d255d3SCy Schubert int edmg_enabled;
2846*a90b9d01SCy Schubert
2847*a90b9d01SCy Schubert /* Indicates whether EHT is enabled */
2848*a90b9d01SCy Schubert bool eht_enabled;
2849*a90b9d01SCy Schubert
2850*a90b9d01SCy Schubert /* Indicates the link if MLO case; -1 otherwise */
2851*a90b9d01SCy Schubert int link_id;
28525b9c547cSRui Paulo };
28535b9c547cSRui Paulo
285485732ac8SCy Schubert struct wpa_bss_trans_info {
285585732ac8SCy Schubert u8 mbo_transition_reason;
285685732ac8SCy Schubert u8 n_candidates;
285785732ac8SCy Schubert u8 *bssid;
285885732ac8SCy Schubert };
285985732ac8SCy Schubert
286085732ac8SCy Schubert struct wpa_bss_candidate_info {
286185732ac8SCy Schubert u8 num;
286285732ac8SCy Schubert struct candidate_list {
286385732ac8SCy Schubert u8 bssid[ETH_ALEN];
286485732ac8SCy Schubert u8 is_accept;
286585732ac8SCy Schubert u32 reject_reason;
286685732ac8SCy Schubert } *candidates;
286785732ac8SCy Schubert };
286885732ac8SCy Schubert
286985732ac8SCy Schubert struct wpa_pmkid_params {
287085732ac8SCy Schubert const u8 *bssid;
287185732ac8SCy Schubert const u8 *ssid;
287285732ac8SCy Schubert size_t ssid_len;
287385732ac8SCy Schubert const u8 *fils_cache_id;
287485732ac8SCy Schubert const u8 *pmkid;
287585732ac8SCy Schubert const u8 *pmk;
287685732ac8SCy Schubert size_t pmk_len;
2877c1d255d3SCy Schubert u32 pmk_lifetime;
2878c1d255d3SCy Schubert u8 pmk_reauth_threshold;
287985732ac8SCy Schubert };
288085732ac8SCy Schubert
288185732ac8SCy Schubert /* Mask used to specify which connection parameters have to be updated */
288285732ac8SCy Schubert enum wpa_drv_update_connect_params_mask {
288385732ac8SCy Schubert WPA_DRV_UPDATE_ASSOC_IES = BIT(0),
288485732ac8SCy Schubert WPA_DRV_UPDATE_FILS_ERP_INFO = BIT(1),
288585732ac8SCy Schubert WPA_DRV_UPDATE_AUTH_TYPE = BIT(2),
288685732ac8SCy Schubert };
288785732ac8SCy Schubert
288885732ac8SCy Schubert /**
288985732ac8SCy Schubert * struct external_auth - External authentication trigger parameters
289085732ac8SCy Schubert *
289185732ac8SCy Schubert * These are used across the external authentication request and event
289285732ac8SCy Schubert * interfaces.
289385732ac8SCy Schubert * @action: Action type / trigger for external authentication. Only significant
289485732ac8SCy Schubert * for the event interface.
289585732ac8SCy Schubert * @bssid: BSSID of the peer with which the authentication has to happen. Used
289685732ac8SCy Schubert * by both the request and event interface.
289785732ac8SCy Schubert * @ssid: SSID of the AP. Used by both the request and event interface.
289885732ac8SCy Schubert * @ssid_len: SSID length in octets.
289985732ac8SCy Schubert * @key_mgmt_suite: AKM suite of the respective authentication. Optional for
290085732ac8SCy Schubert * the request interface.
290185732ac8SCy Schubert * @status: Status code, %WLAN_STATUS_SUCCESS for successful authentication,
290285732ac8SCy Schubert * use %WLAN_STATUS_UNSPECIFIED_FAILURE if wpa_supplicant cannot give
290385732ac8SCy Schubert * the real status code for failures. Used only for the request interface
290485732ac8SCy Schubert * from user space to the driver.
29054bc52338SCy Schubert * @pmkid: Generated PMKID as part of external auth exchange (e.g., SAE).
2906*a90b9d01SCy Schubert * @mld_addr: AP's MLD address or %NULL if MLO is not used
290785732ac8SCy Schubert */
290885732ac8SCy Schubert struct external_auth {
290985732ac8SCy Schubert enum {
291085732ac8SCy Schubert EXT_AUTH_START,
291185732ac8SCy Schubert EXT_AUTH_ABORT,
291285732ac8SCy Schubert } action;
29134bc52338SCy Schubert const u8 *bssid;
29144bc52338SCy Schubert const u8 *ssid;
291585732ac8SCy Schubert size_t ssid_len;
291685732ac8SCy Schubert unsigned int key_mgmt_suite;
291785732ac8SCy Schubert u16 status;
29184bc52338SCy Schubert const u8 *pmkid;
2919*a90b9d01SCy Schubert const u8 *mld_addr;
2920*a90b9d01SCy Schubert };
2921*a90b9d01SCy Schubert
2922*a90b9d01SCy Schubert #define WPAS_MAX_PASN_PEERS 10
2923*a90b9d01SCy Schubert
2924*a90b9d01SCy Schubert enum pasn_status {
2925*a90b9d01SCy Schubert PASN_STATUS_SUCCESS = 0,
2926*a90b9d01SCy Schubert PASN_STATUS_FAILURE = 1,
2927*a90b9d01SCy Schubert };
2928*a90b9d01SCy Schubert
2929*a90b9d01SCy Schubert /**
2930*a90b9d01SCy Schubert * struct pasn_peer - PASN peer parameters
2931*a90b9d01SCy Schubert *
2932*a90b9d01SCy Schubert * Used to process the PASN authentication event from the driver to
2933*a90b9d01SCy Schubert * userspace and to send a response back.
2934*a90b9d01SCy Schubert * @own_addr: Own MAC address specified by the driver to use for PASN
2935*a90b9d01SCy Schubert * handshake.
2936*a90b9d01SCy Schubert * @peer_addr: MAC address of the peer with which PASN authentication is to be
2937*a90b9d01SCy Schubert * performed.
2938*a90b9d01SCy Schubert * @network_id: Unique id for the network.
2939*a90b9d01SCy Schubert * This identifier is used as a unique identifier for each network
2940*a90b9d01SCy Schubert * block when using the control interface. Each network is allocated an
2941*a90b9d01SCy Schubert * id when it is being created, either when reading the configuration
2942*a90b9d01SCy Schubert * file or when a new network is added through the control interface.
2943*a90b9d01SCy Schubert * @akmp: Authentication key management protocol type supported.
2944*a90b9d01SCy Schubert * @cipher: Cipher suite.
2945*a90b9d01SCy Schubert * @group: Finite cyclic group. Default group used is 19 (ECC).
2946*a90b9d01SCy Schubert * @ltf_keyseed_required: Indicates whether LTF keyseed generation is required
2947*a90b9d01SCy Schubert * @status: PASN response status, %PASN_STATUS_SUCCESS for successful
2948*a90b9d01SCy Schubert * authentication, use %PASN_STATUS_FAILURE if PASN authentication
2949*a90b9d01SCy Schubert * fails or if wpa_supplicant fails to set the security ranging context to
2950*a90b9d01SCy Schubert * the driver
2951*a90b9d01SCy Schubert */
2952*a90b9d01SCy Schubert struct pasn_peer {
2953*a90b9d01SCy Schubert u8 own_addr[ETH_ALEN];
2954*a90b9d01SCy Schubert u8 peer_addr[ETH_ALEN];
2955*a90b9d01SCy Schubert int network_id;
2956*a90b9d01SCy Schubert int akmp;
2957*a90b9d01SCy Schubert int cipher;
2958*a90b9d01SCy Schubert int group;
2959*a90b9d01SCy Schubert bool ltf_keyseed_required;
2960*a90b9d01SCy Schubert enum pasn_status status;
2961*a90b9d01SCy Schubert };
2962*a90b9d01SCy Schubert
2963*a90b9d01SCy Schubert /**
2964*a90b9d01SCy Schubert * struct pasn_auth - PASN authentication trigger parameters
2965*a90b9d01SCy Schubert *
2966*a90b9d01SCy Schubert * These are used across the PASN authentication event from the driver to
2967*a90b9d01SCy Schubert * userspace and to send a response to it.
2968*a90b9d01SCy Schubert * @action: Action type. Only significant for the event interface.
2969*a90b9d01SCy Schubert * @num_peers: The number of peers for which the PASN handshake is requested
2970*a90b9d01SCy Schubert * for.
2971*a90b9d01SCy Schubert * @peer: Holds the peer details.
2972*a90b9d01SCy Schubert */
2973*a90b9d01SCy Schubert struct pasn_auth {
2974*a90b9d01SCy Schubert enum {
2975*a90b9d01SCy Schubert PASN_ACTION_AUTH,
2976*a90b9d01SCy Schubert PASN_ACTION_DELETE_SECURE_RANGING_CONTEXT,
2977*a90b9d01SCy Schubert } action;
2978*a90b9d01SCy Schubert unsigned int num_peers;
2979*a90b9d01SCy Schubert struct pasn_peer peer[WPAS_MAX_PASN_PEERS];
2980*a90b9d01SCy Schubert };
2981*a90b9d01SCy Schubert
2982*a90b9d01SCy Schubert /**
2983*a90b9d01SCy Schubert * struct secure_ranging_params - Parameters required to set secure ranging
2984*a90b9d01SCy Schubert * context for a peer.
2985*a90b9d01SCy Schubert *
2986*a90b9d01SCy Schubert * @action: Add or delete a security context to the driver.
2987*a90b9d01SCy Schubert * @own_addr: Own MAC address used during key derivation.
2988*a90b9d01SCy Schubert * @peer_addr: Address of the peer device.
2989*a90b9d01SCy Schubert * @cipher: Cipher suite.
2990*a90b9d01SCy Schubert * @tk_len: Length of temporal key.
2991*a90b9d01SCy Schubert * @tk: Temporal key buffer.
2992*a90b9d01SCy Schubert * @ltf_keyseed_len: Length of LTF keyseed.
2993*a90b9d01SCy Schubert * @ltf_keyeed: LTF keyseed buffer.
2994*a90b9d01SCy Schubert */
2995*a90b9d01SCy Schubert struct secure_ranging_params {
2996*a90b9d01SCy Schubert u32 action;
2997*a90b9d01SCy Schubert const u8 *own_addr;
2998*a90b9d01SCy Schubert const u8 *peer_addr;
2999*a90b9d01SCy Schubert u32 cipher;
3000*a90b9d01SCy Schubert u8 tk_len;
3001*a90b9d01SCy Schubert const u8 *tk;
3002*a90b9d01SCy Schubert u8 ltf_keyseed_len;
3003*a90b9d01SCy Schubert const u8 *ltf_keyseed;
300485732ac8SCy Schubert };
30055b9c547cSRui Paulo
3006c1d255d3SCy Schubert /* enum nested_attr - Used to specify if subcommand uses nested attributes */
3007c1d255d3SCy Schubert enum nested_attr {
3008c1d255d3SCy Schubert NESTED_ATTR_NOT_USED = 0,
3009c1d255d3SCy Schubert NESTED_ATTR_USED = 1,
3010c1d255d3SCy Schubert NESTED_ATTR_UNSPECIFIED = 2,
3011c1d255d3SCy Schubert };
3012c1d255d3SCy Schubert
3013*a90b9d01SCy Schubert /* Preferred channel list information */
3014*a90b9d01SCy Schubert
3015*a90b9d01SCy Schubert /* GO role */
3016*a90b9d01SCy Schubert #define WEIGHTED_PCL_GO BIT(0)
3017*a90b9d01SCy Schubert /* P2P Client role */
3018*a90b9d01SCy Schubert #define WEIGHTED_PCL_CLI BIT(1)
3019*a90b9d01SCy Schubert /* Must be considered for operating channel */
3020*a90b9d01SCy Schubert #define WEIGHTED_PCL_MUST_CONSIDER BIT(2)
3021*a90b9d01SCy Schubert /* Should be excluded in GO negotiation */
3022*a90b9d01SCy Schubert #define WEIGHTED_PCL_EXCLUDE BIT(3)
3023*a90b9d01SCy Schubert
3024*a90b9d01SCy Schubert /* Preferred channel list with weight */
3025*a90b9d01SCy Schubert struct weighted_pcl {
3026*a90b9d01SCy Schubert u32 freq; /* MHz */
3027*a90b9d01SCy Schubert u8 weight;
3028*a90b9d01SCy Schubert u32 flag; /* bitmap for WEIGHTED_PCL_* */
3029*a90b9d01SCy Schubert };
3030*a90b9d01SCy Schubert
3031*a90b9d01SCy Schubert struct driver_sta_mlo_info {
3032*a90b9d01SCy Schubert bool default_map;
3033*a90b9d01SCy Schubert u16 req_links; /* bitmap of requested link IDs */
3034*a90b9d01SCy Schubert u16 valid_links; /* bitmap of accepted link IDs */
3035*a90b9d01SCy Schubert u8 assoc_link_id;
3036*a90b9d01SCy Schubert u8 ap_mld_addr[ETH_ALEN];
3037*a90b9d01SCy Schubert struct {
3038*a90b9d01SCy Schubert u8 addr[ETH_ALEN];
3039*a90b9d01SCy Schubert u8 bssid[ETH_ALEN];
3040*a90b9d01SCy Schubert unsigned int freq;
3041*a90b9d01SCy Schubert struct t2lm_mapping t2lmap;
3042*a90b9d01SCy Schubert } links[MAX_NUM_MLD_LINKS];
3043*a90b9d01SCy Schubert };
3044*a90b9d01SCy Schubert
30455b9c547cSRui Paulo /**
304639beb93cSSam Leffler * struct wpa_driver_ops - Driver interface API definition
304739beb93cSSam Leffler *
304839beb93cSSam Leffler * This structure defines the API that each driver interface needs to implement
304939beb93cSSam Leffler * for core wpa_supplicant code. All driver specific functionality is captured
305039beb93cSSam Leffler * in this wrapper.
305139beb93cSSam Leffler */
305239beb93cSSam Leffler struct wpa_driver_ops {
305339beb93cSSam Leffler /** Name of the driver interface */
305439beb93cSSam Leffler const char *name;
305539beb93cSSam Leffler /** One line description of the driver interface */
305639beb93cSSam Leffler const char *desc;
305739beb93cSSam Leffler
305839beb93cSSam Leffler /**
305939beb93cSSam Leffler * get_bssid - Get the current BSSID
306039beb93cSSam Leffler * @priv: private driver interface data
306139beb93cSSam Leffler * @bssid: buffer for BSSID (ETH_ALEN = 6 bytes)
306239beb93cSSam Leffler *
306339beb93cSSam Leffler * Returns: 0 on success, -1 on failure
306439beb93cSSam Leffler *
306539beb93cSSam Leffler * Query kernel driver for the current BSSID and copy it to bssid.
306639beb93cSSam Leffler * Setting bssid to 00:00:00:00:00:00 is recommended if the STA is not
306739beb93cSSam Leffler * associated.
306839beb93cSSam Leffler */
306939beb93cSSam Leffler int (*get_bssid)(void *priv, u8 *bssid);
307039beb93cSSam Leffler
307139beb93cSSam Leffler /**
307239beb93cSSam Leffler * get_ssid - Get the current SSID
307339beb93cSSam Leffler * @priv: private driver interface data
307439beb93cSSam Leffler * @ssid: buffer for SSID (at least 32 bytes)
307539beb93cSSam Leffler *
307639beb93cSSam Leffler * Returns: Length of the SSID on success, -1 on failure
307739beb93cSSam Leffler *
307839beb93cSSam Leffler * Query kernel driver for the current SSID and copy it to ssid.
307939beb93cSSam Leffler * Returning zero is recommended if the STA is not associated.
308039beb93cSSam Leffler *
308139beb93cSSam Leffler * Note: SSID is an array of octets, i.e., it is not nul terminated and
308239beb93cSSam Leffler * can, at least in theory, contain control characters (including nul)
308339beb93cSSam Leffler * and as such, should be processed as binary data, not a printable
308439beb93cSSam Leffler * string.
308539beb93cSSam Leffler */
308639beb93cSSam Leffler int (*get_ssid)(void *priv, u8 *ssid);
308739beb93cSSam Leffler
308839beb93cSSam Leffler /**
308939beb93cSSam Leffler * set_key - Configure encryption key
309039beb93cSSam Leffler * @priv: private driver interface data
3091c1d255d3SCy Schubert * @params: Key parameters
309239beb93cSSam Leffler * Returns: 0 on success, -1 on failure
309339beb93cSSam Leffler *
309439beb93cSSam Leffler * Configure the given key for the kernel driver. If the driver
309539beb93cSSam Leffler * supports separate individual keys (4 default keys + 1 individual),
309639beb93cSSam Leffler * addr can be used to determine whether the key is default or
309739beb93cSSam Leffler * individual. If only 4 keys are supported, the default key with key
309839beb93cSSam Leffler * index 0 is used as the individual key. STA must be configured to use
309939beb93cSSam Leffler * it as the default Tx key (set_tx is set) and accept Rx for all the
310039beb93cSSam Leffler * key indexes. In most cases, WPA uses only key indexes 1 and 2 for
310139beb93cSSam Leffler * broadcast keys, so key index 0 is available for this kind of
310239beb93cSSam Leffler * configuration.
310339beb93cSSam Leffler *
310439beb93cSSam Leffler * Please note that TKIP keys include separate TX and RX MIC keys and
310539beb93cSSam Leffler * some drivers may expect them in different order than wpa_supplicant
310639beb93cSSam Leffler * is using. If the TX/RX keys are swapped, all TKIP encrypted packets
3107f05cddf9SRui Paulo * will trigger Michael MIC errors. This can be fixed by changing the
3108*a90b9d01SCy Schubert * order of MIC keys by swapping the bytes 16..23 and 24..31 of the key
310939beb93cSSam Leffler * in driver_*.c set_key() implementation, see driver_ndis.c for an
311039beb93cSSam Leffler * example on how this can be done.
311139beb93cSSam Leffler */
3112c1d255d3SCy Schubert int (*set_key)(void *priv, struct wpa_driver_set_key_params *params);
311339beb93cSSam Leffler
311439beb93cSSam Leffler /**
311539beb93cSSam Leffler * init - Initialize driver interface
311639beb93cSSam Leffler * @ctx: context to be used when calling wpa_supplicant functions,
311739beb93cSSam Leffler * e.g., wpa_supplicant_event()
311839beb93cSSam Leffler * @ifname: interface name, e.g., wlan0
311939beb93cSSam Leffler *
312039beb93cSSam Leffler * Returns: Pointer to private data, %NULL on failure
312139beb93cSSam Leffler *
312239beb93cSSam Leffler * Initialize driver interface, including event processing for kernel
312339beb93cSSam Leffler * driver events (e.g., associated, scan results, Michael MIC failure).
312439beb93cSSam Leffler * This function can allocate a private configuration data area for
312539beb93cSSam Leffler * @ctx, file descriptor, interface name, etc. information that may be
312639beb93cSSam Leffler * needed in future driver operations. If this is not used, non-NULL
312739beb93cSSam Leffler * value will need to be returned because %NULL is used to indicate
312839beb93cSSam Leffler * failure. The returned value will be used as 'void *priv' data for
312939beb93cSSam Leffler * all other driver_ops functions.
313039beb93cSSam Leffler *
313139beb93cSSam Leffler * The main event loop (eloop.c) of wpa_supplicant can be used to
313239beb93cSSam Leffler * register callback for read sockets (eloop_register_read_sock()).
313339beb93cSSam Leffler *
313439beb93cSSam Leffler * See below for more information about events and
313539beb93cSSam Leffler * wpa_supplicant_event() function.
313639beb93cSSam Leffler */
313739beb93cSSam Leffler void * (*init)(void *ctx, const char *ifname);
313839beb93cSSam Leffler
313939beb93cSSam Leffler /**
314039beb93cSSam Leffler * deinit - Deinitialize driver interface
314139beb93cSSam Leffler * @priv: private driver interface data from init()
314239beb93cSSam Leffler *
314339beb93cSSam Leffler * Shut down driver interface and processing of driver events. Free
314439beb93cSSam Leffler * private data buffer if one was allocated in init() handler.
314539beb93cSSam Leffler */
314639beb93cSSam Leffler void (*deinit)(void *priv);
314739beb93cSSam Leffler
314839beb93cSSam Leffler /**
314939beb93cSSam Leffler * set_param - Set driver configuration parameters
315039beb93cSSam Leffler * @priv: private driver interface data from init()
315139beb93cSSam Leffler * @param: driver specific configuration parameters
315239beb93cSSam Leffler *
315339beb93cSSam Leffler * Returns: 0 on success, -1 on failure
315439beb93cSSam Leffler *
315539beb93cSSam Leffler * Optional handler for notifying driver interface about configuration
315639beb93cSSam Leffler * parameters (driver_param).
315739beb93cSSam Leffler */
315839beb93cSSam Leffler int (*set_param)(void *priv, const char *param);
315939beb93cSSam Leffler
316039beb93cSSam Leffler /**
316139beb93cSSam Leffler * set_countermeasures - Enable/disable TKIP countermeasures
316239beb93cSSam Leffler * @priv: private driver interface data
316339beb93cSSam Leffler * @enabled: 1 = countermeasures enabled, 0 = disabled
316439beb93cSSam Leffler *
316539beb93cSSam Leffler * Returns: 0 on success, -1 on failure
316639beb93cSSam Leffler *
316739beb93cSSam Leffler * Configure TKIP countermeasures. When these are enabled, the driver
316839beb93cSSam Leffler * should drop all received and queued frames that are using TKIP.
316939beb93cSSam Leffler */
317039beb93cSSam Leffler int (*set_countermeasures)(void *priv, int enabled);
317139beb93cSSam Leffler
317239beb93cSSam Leffler /**
317339beb93cSSam Leffler * deauthenticate - Request driver to deauthenticate
317439beb93cSSam Leffler * @priv: private driver interface data
317539beb93cSSam Leffler * @addr: peer address (BSSID of the AP)
317639beb93cSSam Leffler * @reason_code: 16-bit reason code to be sent in the deauthentication
317739beb93cSSam Leffler * frame
317839beb93cSSam Leffler *
317939beb93cSSam Leffler * Returns: 0 on success, -1 on failure
318039beb93cSSam Leffler */
3181206b73d0SCy Schubert int (*deauthenticate)(void *priv, const u8 *addr, u16 reason_code);
318239beb93cSSam Leffler
318339beb93cSSam Leffler /**
318439beb93cSSam Leffler * associate - Request driver to associate
318539beb93cSSam Leffler * @priv: private driver interface data
318639beb93cSSam Leffler * @params: association parameters
318739beb93cSSam Leffler *
318839beb93cSSam Leffler * Returns: 0 on success, -1 on failure
318939beb93cSSam Leffler */
319039beb93cSSam Leffler int (*associate)(void *priv,
319139beb93cSSam Leffler struct wpa_driver_associate_params *params);
319239beb93cSSam Leffler
319339beb93cSSam Leffler /**
319439beb93cSSam Leffler * add_pmkid - Add PMKSA cache entry to the driver
319539beb93cSSam Leffler * @priv: private driver interface data
319685732ac8SCy Schubert * @params: PMKSA parameters
319739beb93cSSam Leffler *
319839beb93cSSam Leffler * Returns: 0 on success, -1 on failure
319939beb93cSSam Leffler *
320039beb93cSSam Leffler * This function is called when a new PMK is received, as a result of
320185732ac8SCy Schubert * either normal authentication or RSN pre-authentication. The PMKSA
320285732ac8SCy Schubert * parameters are either a set of bssid, pmkid, and pmk; or a set of
320385732ac8SCy Schubert * ssid, fils_cache_id, pmkid, and pmk.
320439beb93cSSam Leffler *
320539beb93cSSam Leffler * If the driver generates RSN IE, i.e., it does not use wpa_ie in
320639beb93cSSam Leffler * associate(), add_pmkid() can be used to add new PMKSA cache entries
320739beb93cSSam Leffler * in the driver. If the driver uses wpa_ie from wpa_supplicant, this
320839beb93cSSam Leffler * driver_ops function does not need to be implemented. Likewise, if
320939beb93cSSam Leffler * the driver does not support WPA, this function is not needed.
321039beb93cSSam Leffler */
321185732ac8SCy Schubert int (*add_pmkid)(void *priv, struct wpa_pmkid_params *params);
321239beb93cSSam Leffler
321339beb93cSSam Leffler /**
321439beb93cSSam Leffler * remove_pmkid - Remove PMKSA cache entry to the driver
321539beb93cSSam Leffler * @priv: private driver interface data
321685732ac8SCy Schubert * @params: PMKSA parameters
321739beb93cSSam Leffler *
321839beb93cSSam Leffler * Returns: 0 on success, -1 on failure
321939beb93cSSam Leffler *
322039beb93cSSam Leffler * This function is called when the supplicant drops a PMKSA cache
322185732ac8SCy Schubert * entry for any reason. The PMKSA parameters are either a set of
322285732ac8SCy Schubert * bssid and pmkid; or a set of ssid, fils_cache_id, and pmkid.
322339beb93cSSam Leffler *
322439beb93cSSam Leffler * If the driver generates RSN IE, i.e., it does not use wpa_ie in
322539beb93cSSam Leffler * associate(), remove_pmkid() can be used to synchronize PMKSA caches
322639beb93cSSam Leffler * between the driver and wpa_supplicant. If the driver uses wpa_ie
322739beb93cSSam Leffler * from wpa_supplicant, this driver_ops function does not need to be
322839beb93cSSam Leffler * implemented. Likewise, if the driver does not support WPA, this
322939beb93cSSam Leffler * function is not needed.
323039beb93cSSam Leffler */
323185732ac8SCy Schubert int (*remove_pmkid)(void *priv, struct wpa_pmkid_params *params);
323239beb93cSSam Leffler
323339beb93cSSam Leffler /**
323439beb93cSSam Leffler * flush_pmkid - Flush PMKSA cache
323539beb93cSSam Leffler * @priv: private driver interface data
323639beb93cSSam Leffler *
323739beb93cSSam Leffler * Returns: 0 on success, -1 on failure
323839beb93cSSam Leffler *
323939beb93cSSam Leffler * This function is called when the supplicant drops all PMKSA cache
324039beb93cSSam Leffler * entries for any reason.
324139beb93cSSam Leffler *
324239beb93cSSam Leffler * If the driver generates RSN IE, i.e., it does not use wpa_ie in
324339beb93cSSam Leffler * associate(), remove_pmkid() can be used to synchronize PMKSA caches
324439beb93cSSam Leffler * between the driver and wpa_supplicant. If the driver uses wpa_ie
324539beb93cSSam Leffler * from wpa_supplicant, this driver_ops function does not need to be
324639beb93cSSam Leffler * implemented. Likewise, if the driver does not support WPA, this
324739beb93cSSam Leffler * function is not needed.
324839beb93cSSam Leffler */
324939beb93cSSam Leffler int (*flush_pmkid)(void *priv);
325039beb93cSSam Leffler
325139beb93cSSam Leffler /**
32523157ba21SRui Paulo * get_capa - Get driver capabilities
325339beb93cSSam Leffler * @priv: private driver interface data
325439beb93cSSam Leffler *
325539beb93cSSam Leffler * Returns: 0 on success, -1 on failure
325639beb93cSSam Leffler *
325739beb93cSSam Leffler * Get driver/firmware/hardware capabilities.
325839beb93cSSam Leffler */
325939beb93cSSam Leffler int (*get_capa)(void *priv, struct wpa_driver_capa *capa);
326039beb93cSSam Leffler
326139beb93cSSam Leffler /**
326239beb93cSSam Leffler * poll - Poll driver for association information
326339beb93cSSam Leffler * @priv: private driver interface data
326439beb93cSSam Leffler *
3265*a90b9d01SCy Schubert * This is an optional callback that can be used when the driver does
3266*a90b9d01SCy Schubert * not provide event mechanism for association events. This is called
3267*a90b9d01SCy Schubert * when receiving WPA/RSN EAPOL-Key messages that require association
326839beb93cSSam Leffler * information. The driver interface is supposed to generate associnfo
326939beb93cSSam Leffler * event before returning from this callback function. In addition, the
327039beb93cSSam Leffler * driver interface should generate an association event after having
327139beb93cSSam Leffler * sent out associnfo.
327239beb93cSSam Leffler */
327339beb93cSSam Leffler void (*poll)(void *priv);
327439beb93cSSam Leffler
327539beb93cSSam Leffler /**
3276780fb4a2SCy Schubert * get_ifindex - Get interface index
3277780fb4a2SCy Schubert * @priv: private driver interface data
3278780fb4a2SCy Schubert *
3279780fb4a2SCy Schubert * Returns: Interface index
3280780fb4a2SCy Schubert */
3281780fb4a2SCy Schubert unsigned int (*get_ifindex)(void *priv);
3282780fb4a2SCy Schubert
3283780fb4a2SCy Schubert /**
328439beb93cSSam Leffler * get_ifname - Get interface name
328539beb93cSSam Leffler * @priv: private driver interface data
328639beb93cSSam Leffler *
328739beb93cSSam Leffler * Returns: Pointer to the interface name. This can differ from the
328839beb93cSSam Leffler * interface name used in init() call. Init() is called first.
328939beb93cSSam Leffler *
329039beb93cSSam Leffler * This optional function can be used to allow the driver interface to
329139beb93cSSam Leffler * replace the interface name with something else, e.g., based on an
329239beb93cSSam Leffler * interface mapping from a more descriptive name.
329339beb93cSSam Leffler */
329439beb93cSSam Leffler const char * (*get_ifname)(void *priv);
329539beb93cSSam Leffler
329639beb93cSSam Leffler /**
329739beb93cSSam Leffler * get_mac_addr - Get own MAC address
329839beb93cSSam Leffler * @priv: private driver interface data
329939beb93cSSam Leffler *
330039beb93cSSam Leffler * Returns: Pointer to own MAC address or %NULL on failure
330139beb93cSSam Leffler *
330239beb93cSSam Leffler * This optional function can be used to get the own MAC address of the
330339beb93cSSam Leffler * device from the driver interface code. This is only needed if the
330439beb93cSSam Leffler * l2_packet implementation for the OS does not provide easy access to
330539beb93cSSam Leffler * a MAC address. */
330639beb93cSSam Leffler const u8 * (*get_mac_addr)(void *priv);
330739beb93cSSam Leffler
330839beb93cSSam Leffler /**
330939beb93cSSam Leffler * set_operstate - Sets device operating state to DORMANT or UP
331039beb93cSSam Leffler * @priv: private driver interface data
331139beb93cSSam Leffler * @state: 0 = dormant, 1 = up
331239beb93cSSam Leffler * Returns: 0 on success, -1 on failure
331339beb93cSSam Leffler *
331439beb93cSSam Leffler * This is an optional function that can be used on operating systems
331539beb93cSSam Leffler * that support a concept of controlling network device state from user
331639beb93cSSam Leffler * space applications. This function, if set, gets called with
331739beb93cSSam Leffler * state = 1 when authentication has been completed and with state = 0
331839beb93cSSam Leffler * when connection is lost.
331939beb93cSSam Leffler */
332039beb93cSSam Leffler int (*set_operstate)(void *priv, int state);
332139beb93cSSam Leffler
332239beb93cSSam Leffler /**
332339beb93cSSam Leffler * mlme_setprotection - MLME-SETPROTECTION.request primitive
332439beb93cSSam Leffler * @priv: Private driver interface data
332539beb93cSSam Leffler * @addr: Address of the station for which to set protection (may be
332639beb93cSSam Leffler * %NULL for group keys)
332739beb93cSSam Leffler * @protect_type: MLME_SETPROTECTION_PROTECT_TYPE_*
332839beb93cSSam Leffler * @key_type: MLME_SETPROTECTION_KEY_TYPE_*
332939beb93cSSam Leffler * Returns: 0 on success, -1 on failure
333039beb93cSSam Leffler *
333139beb93cSSam Leffler * This is an optional function that can be used to set the driver to
333239beb93cSSam Leffler * require protection for Tx and/or Rx frames. This uses the layer
333339beb93cSSam Leffler * interface defined in IEEE 802.11i-2004 clause 10.3.22.1
333439beb93cSSam Leffler * (MLME-SETPROTECTION.request). Many drivers do not use explicit
333539beb93cSSam Leffler * set protection operation; instead, they set protection implicitly
333639beb93cSSam Leffler * based on configured keys.
333739beb93cSSam Leffler */
333839beb93cSSam Leffler int (*mlme_setprotection)(void *priv, const u8 *addr, int protect_type,
333939beb93cSSam Leffler int key_type);
334039beb93cSSam Leffler
334139beb93cSSam Leffler /**
334239beb93cSSam Leffler * get_hw_feature_data - Get hardware support data (channels and rates)
334339beb93cSSam Leffler * @priv: Private driver interface data
334439beb93cSSam Leffler * @num_modes: Variable for returning the number of returned modes
334539beb93cSSam Leffler * flags: Variable for returning hardware feature flags
334685732ac8SCy Schubert * @dfs: Variable for returning DFS region (HOSTAPD_DFS_REGION_*)
334739beb93cSSam Leffler * Returns: Pointer to allocated hardware data on success or %NULL on
334839beb93cSSam Leffler * failure. Caller is responsible for freeing this.
334939beb93cSSam Leffler */
3350e28a4053SRui Paulo struct hostapd_hw_modes * (*get_hw_feature_data)(void *priv,
335139beb93cSSam Leffler u16 *num_modes,
335285732ac8SCy Schubert u16 *flags, u8 *dfs);
335339beb93cSSam Leffler
335439beb93cSSam Leffler /**
335539beb93cSSam Leffler * send_mlme - Send management frame from MLME
335639beb93cSSam Leffler * @priv: Private driver interface data
335739beb93cSSam Leffler * @data: IEEE 802.11 management frame with IEEE 802.11 header
335839beb93cSSam Leffler * @data_len: Size of the management frame
3359f05cddf9SRui Paulo * @noack: Do not wait for this frame to be acked (disable retries)
3360325151a3SRui Paulo * @freq: Frequency (in MHz) to send the frame on, or 0 to let the
3361325151a3SRui Paulo * driver decide
3362780fb4a2SCy Schubert * @csa_offs: Array of CSA offsets or %NULL
3363780fb4a2SCy Schubert * @csa_offs_len: Number of elements in csa_offs
3364c1d255d3SCy Schubert * @no_encrypt: Do not encrypt frame even if appropriate key exists
3365c1d255d3SCy Schubert * (used only for testing purposes)
3366c1d255d3SCy Schubert * @wait: Time to wait off-channel for a response (in ms), or zero
3367*a90b9d01SCy Schubert * @link_id: Link ID to use for TX, or -1 if not set
336839beb93cSSam Leffler * Returns: 0 on success, -1 on failure
336939beb93cSSam Leffler */
3370f05cddf9SRui Paulo int (*send_mlme)(void *priv, const u8 *data, size_t data_len,
3371780fb4a2SCy Schubert int noack, unsigned int freq, const u16 *csa_offs,
3372c1d255d3SCy Schubert size_t csa_offs_len, int no_encrypt,
3373*a90b9d01SCy Schubert unsigned int wait, int link_id);
337439beb93cSSam Leffler
337539beb93cSSam Leffler /**
337639beb93cSSam Leffler * update_ft_ies - Update FT (IEEE 802.11r) IEs
337739beb93cSSam Leffler * @priv: Private driver interface data
337839beb93cSSam Leffler * @md: Mobility domain (2 octets) (also included inside ies)
337939beb93cSSam Leffler * @ies: FT IEs (MDIE, FTIE, ...) or %NULL to remove IEs
338039beb93cSSam Leffler * @ies_len: Length of FT IEs in bytes
338139beb93cSSam Leffler * Returns: 0 on success, -1 on failure
338239beb93cSSam Leffler *
338339beb93cSSam Leffler * The supplicant uses this callback to let the driver know that keying
338439beb93cSSam Leffler * material for FT is available and that the driver can use the
338539beb93cSSam Leffler * provided IEs in the next message in FT authentication sequence.
338639beb93cSSam Leffler *
338739beb93cSSam Leffler * This function is only needed for driver that support IEEE 802.11r
338839beb93cSSam Leffler * (Fast BSS Transition).
338939beb93cSSam Leffler */
339039beb93cSSam Leffler int (*update_ft_ies)(void *priv, const u8 *md, const u8 *ies,
339139beb93cSSam Leffler size_t ies_len);
339239beb93cSSam Leffler
339339beb93cSSam Leffler /**
3394*a90b9d01SCy Schubert * get_scan_results - Fetch the latest scan results
3395*a90b9d01SCy Schubert * @priv: Private driver interface data
3396*a90b9d01SCy Schubert * @bssid: Return results only for the specified BSSID, %NULL for all
3397*a90b9d01SCy Schubert *
3398*a90b9d01SCy Schubert * Returns: Allocated buffer of scan results (caller is responsible for
3399*a90b9d01SCy Schubert * freeing the data structure) on success, NULL on failure
3400*a90b9d01SCy Schubert */
3401*a90b9d01SCy Schubert struct wpa_scan_results * (*get_scan_results)(void *priv,
3402*a90b9d01SCy Schubert const u8 *bssid);
3403*a90b9d01SCy Schubert
3404*a90b9d01SCy Schubert /**
340539beb93cSSam Leffler * get_scan_results2 - Fetch the latest scan results
340639beb93cSSam Leffler * @priv: private driver interface data
340739beb93cSSam Leffler *
340839beb93cSSam Leffler * Returns: Allocated buffer of scan results (caller is responsible for
340939beb93cSSam Leffler * freeing the data structure) on success, NULL on failure
341039beb93cSSam Leffler */
341139beb93cSSam Leffler struct wpa_scan_results * (*get_scan_results2)(void *priv);
341239beb93cSSam Leffler
341339beb93cSSam Leffler /**
341439beb93cSSam Leffler * set_country - Set country
341539beb93cSSam Leffler * @priv: Private driver interface data
341639beb93cSSam Leffler * @alpha2: country to which to switch to
341739beb93cSSam Leffler * Returns: 0 on success, -1 on failure
341839beb93cSSam Leffler *
341939beb93cSSam Leffler * This function is for drivers which support some form
342039beb93cSSam Leffler * of setting a regulatory domain.
342139beb93cSSam Leffler */
342239beb93cSSam Leffler int (*set_country)(void *priv, const char *alpha2);
342339beb93cSSam Leffler
342439beb93cSSam Leffler /**
34255b9c547cSRui Paulo * get_country - Get country
34265b9c547cSRui Paulo * @priv: Private driver interface data
34275b9c547cSRui Paulo * @alpha2: Buffer for returning country code (at least 3 octets)
34285b9c547cSRui Paulo * Returns: 0 on success, -1 on failure
34295b9c547cSRui Paulo */
34305b9c547cSRui Paulo int (*get_country)(void *priv, char *alpha2);
34315b9c547cSRui Paulo
34325b9c547cSRui Paulo /**
343339beb93cSSam Leffler * global_init - Global driver initialization
3434780fb4a2SCy Schubert * @ctx: wpa_global pointer
343539beb93cSSam Leffler * Returns: Pointer to private data (global), %NULL on failure
343639beb93cSSam Leffler *
343739beb93cSSam Leffler * This optional function is called to initialize the driver wrapper
343839beb93cSSam Leffler * for global data, i.e., data that applies to all interfaces. If this
343939beb93cSSam Leffler * function is implemented, global_deinit() will also need to be
344039beb93cSSam Leffler * implemented to free the private data. The driver will also likely
344139beb93cSSam Leffler * use init2() function instead of init() to get the pointer to global
344239beb93cSSam Leffler * data available to per-interface initializer.
344339beb93cSSam Leffler */
3444780fb4a2SCy Schubert void * (*global_init)(void *ctx);
344539beb93cSSam Leffler
344639beb93cSSam Leffler /**
344739beb93cSSam Leffler * global_deinit - Global driver deinitialization
344839beb93cSSam Leffler * @priv: private driver global data from global_init()
344939beb93cSSam Leffler *
345039beb93cSSam Leffler * Terminate any global driver related functionality and free the
345139beb93cSSam Leffler * global data structure.
345239beb93cSSam Leffler */
345339beb93cSSam Leffler void (*global_deinit)(void *priv);
345439beb93cSSam Leffler
345539beb93cSSam Leffler /**
345639beb93cSSam Leffler * init2 - Initialize driver interface (with global data)
345739beb93cSSam Leffler * @ctx: context to be used when calling wpa_supplicant functions,
345839beb93cSSam Leffler * e.g., wpa_supplicant_event()
345939beb93cSSam Leffler * @ifname: interface name, e.g., wlan0
346039beb93cSSam Leffler * @global_priv: private driver global data from global_init()
346139beb93cSSam Leffler * Returns: Pointer to private data, %NULL on failure
346239beb93cSSam Leffler *
346339beb93cSSam Leffler * This function can be used instead of init() if the driver wrapper
346439beb93cSSam Leffler * uses global data.
346539beb93cSSam Leffler */
346639beb93cSSam Leffler void * (*init2)(void *ctx, const char *ifname, void *global_priv);
346739beb93cSSam Leffler
346839beb93cSSam Leffler /**
346939beb93cSSam Leffler * get_interfaces - Get information about available interfaces
347039beb93cSSam Leffler * @global_priv: private driver global data from global_init()
347139beb93cSSam Leffler * Returns: Allocated buffer of interface information (caller is
347239beb93cSSam Leffler * responsible for freeing the data structure) on success, NULL on
347339beb93cSSam Leffler * failure
347439beb93cSSam Leffler */
347539beb93cSSam Leffler struct wpa_interface_info * (*get_interfaces)(void *global_priv);
3476e28a4053SRui Paulo
3477e28a4053SRui Paulo /**
3478e28a4053SRui Paulo * scan2 - Request the driver to initiate scan
3479e28a4053SRui Paulo * @priv: private driver interface data
3480e28a4053SRui Paulo * @params: Scan parameters
3481e28a4053SRui Paulo *
3482e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3483e28a4053SRui Paulo *
3484e28a4053SRui Paulo * Once the scan results are ready, the driver should report scan
3485e28a4053SRui Paulo * results event for wpa_supplicant which will eventually request the
3486e28a4053SRui Paulo * results with wpa_driver_get_scan_results2().
3487e28a4053SRui Paulo */
3488e28a4053SRui Paulo int (*scan2)(void *priv, struct wpa_driver_scan_params *params);
3489e28a4053SRui Paulo
3490e28a4053SRui Paulo /**
3491e28a4053SRui Paulo * authenticate - Request driver to authenticate
3492e28a4053SRui Paulo * @priv: private driver interface data
3493e28a4053SRui Paulo * @params: authentication parameters
3494e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3495e28a4053SRui Paulo *
3496e28a4053SRui Paulo * This is an optional function that can be used with drivers that
3497e28a4053SRui Paulo * support separate authentication and association steps, i.e., when
3498e28a4053SRui Paulo * wpa_supplicant can act as the SME. If not implemented, associate()
3499e28a4053SRui Paulo * function is expected to take care of IEEE 802.11 authentication,
3500e28a4053SRui Paulo * too.
3501e28a4053SRui Paulo */
3502e28a4053SRui Paulo int (*authenticate)(void *priv,
3503e28a4053SRui Paulo struct wpa_driver_auth_params *params);
3504e28a4053SRui Paulo
3505e28a4053SRui Paulo /**
3506f05cddf9SRui Paulo * set_ap - Set Beacon and Probe Response information for AP mode
3507e28a4053SRui Paulo * @priv: Private driver interface data
3508f05cddf9SRui Paulo * @params: Parameters to use in AP mode
3509e28a4053SRui Paulo *
3510f05cddf9SRui Paulo * This function is used to configure Beacon template and/or extra IEs
3511f05cddf9SRui Paulo * to add for Beacon and Probe Response frames for the driver in
3512e28a4053SRui Paulo * AP mode. The driver is responsible for building the full Beacon
3513e28a4053SRui Paulo * frame by concatenating the head part with TIM IE generated by the
3514f05cddf9SRui Paulo * driver/firmware and finishing with the tail part. Depending on the
3515f05cddf9SRui Paulo * driver architectue, this can be done either by using the full
3516f05cddf9SRui Paulo * template or the set of additional IEs (e.g., WPS and P2P IE).
3517f05cddf9SRui Paulo * Similarly, Probe Response processing depends on the driver design.
3518f05cddf9SRui Paulo * If the driver (or firmware) takes care of replying to Probe Request
3519f05cddf9SRui Paulo * frames, the extra IEs provided here needs to be added to the Probe
3520f05cddf9SRui Paulo * Response frames.
3521f05cddf9SRui Paulo *
3522f05cddf9SRui Paulo * Returns: 0 on success, -1 on failure
3523e28a4053SRui Paulo */
3524f05cddf9SRui Paulo int (*set_ap)(void *priv, struct wpa_driver_ap_params *params);
3525e28a4053SRui Paulo
3526e28a4053SRui Paulo /**
35275b9c547cSRui Paulo * set_acl - Set ACL in AP mode
35285b9c547cSRui Paulo * @priv: Private driver interface data
35295b9c547cSRui Paulo * @params: Parameters to configure ACL
35305b9c547cSRui Paulo * Returns: 0 on success, -1 on failure
35315b9c547cSRui Paulo *
35325b9c547cSRui Paulo * This is used only for the drivers which support MAC address ACL.
35335b9c547cSRui Paulo */
35345b9c547cSRui Paulo int (*set_acl)(void *priv, struct hostapd_acl_params *params);
35355b9c547cSRui Paulo
35365b9c547cSRui Paulo /**
3537e28a4053SRui Paulo * hapd_init - Initialize driver interface (hostapd only)
3538e28a4053SRui Paulo * @hapd: Pointer to hostapd context
3539e28a4053SRui Paulo * @params: Configuration for the driver wrapper
3540e28a4053SRui Paulo * Returns: Pointer to private data, %NULL on failure
3541e28a4053SRui Paulo *
3542e28a4053SRui Paulo * This function is used instead of init() or init2() when the driver
3543f05cddf9SRui Paulo * wrapper is used with hostapd.
3544e28a4053SRui Paulo */
3545e28a4053SRui Paulo void * (*hapd_init)(struct hostapd_data *hapd,
3546e28a4053SRui Paulo struct wpa_init_params *params);
3547e28a4053SRui Paulo
3548e28a4053SRui Paulo /**
3549e28a4053SRui Paulo * hapd_deinit - Deinitialize driver interface (hostapd only)
3550e28a4053SRui Paulo * @priv: Private driver interface data from hapd_init()
3551e28a4053SRui Paulo */
3552e28a4053SRui Paulo void (*hapd_deinit)(void *priv);
3553e28a4053SRui Paulo
3554e28a4053SRui Paulo /**
3555e28a4053SRui Paulo * set_ieee8021x - Enable/disable IEEE 802.1X support (AP only)
3556e28a4053SRui Paulo * @priv: Private driver interface data
3557e28a4053SRui Paulo * @params: BSS parameters
3558e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3559e28a4053SRui Paulo *
3560e28a4053SRui Paulo * This is an optional function to configure the kernel driver to
3561e28a4053SRui Paulo * enable/disable IEEE 802.1X support and set WPA/WPA2 parameters. This
3562e28a4053SRui Paulo * can be left undefined (set to %NULL) if IEEE 802.1X support is
3563f05cddf9SRui Paulo * always enabled and the driver uses set_ap() to set WPA/RSN IE
3564e28a4053SRui Paulo * for Beacon frames.
3565f05cddf9SRui Paulo *
3566f05cddf9SRui Paulo * DEPRECATED - use set_ap() instead
3567e28a4053SRui Paulo */
3568e28a4053SRui Paulo int (*set_ieee8021x)(void *priv, struct wpa_bss_params *params);
3569e28a4053SRui Paulo
3570e28a4053SRui Paulo /**
3571e28a4053SRui Paulo * set_privacy - Enable/disable privacy (AP only)
3572e28a4053SRui Paulo * @priv: Private driver interface data
3573e28a4053SRui Paulo * @enabled: 1 = privacy enabled, 0 = disabled
3574e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3575e28a4053SRui Paulo *
3576e28a4053SRui Paulo * This is an optional function to configure privacy field in the
3577e28a4053SRui Paulo * kernel driver for Beacon frames. This can be left undefined (set to
3578f05cddf9SRui Paulo * %NULL) if the driver uses the Beacon template from set_ap().
3579f05cddf9SRui Paulo *
3580f05cddf9SRui Paulo * DEPRECATED - use set_ap() instead
3581e28a4053SRui Paulo */
3582e28a4053SRui Paulo int (*set_privacy)(void *priv, int enabled);
3583e28a4053SRui Paulo
3584e28a4053SRui Paulo /**
3585e28a4053SRui Paulo * get_seqnum - Fetch the current TSC/packet number (AP only)
3586e28a4053SRui Paulo * @ifname: The interface name (main or virtual)
3587e28a4053SRui Paulo * @priv: Private driver interface data
3588e28a4053SRui Paulo * @addr: MAC address of the station or %NULL for group keys
3589e28a4053SRui Paulo * @idx: Key index
3590*a90b9d01SCy Schubert * @link_id: Link ID for a group key, or -1 if not set
3591e28a4053SRui Paulo * @seq: Buffer for returning the latest used TSC/packet number
3592e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3593e28a4053SRui Paulo *
3594e28a4053SRui Paulo * This function is used to fetch the last used TSC/packet number for
3595f05cddf9SRui Paulo * a TKIP, CCMP, GCMP, or BIP/IGTK key. It is mainly used with group
3596f05cddf9SRui Paulo * keys, so there is no strict requirement on implementing support for
3597f05cddf9SRui Paulo * unicast keys (i.e., addr != %NULL).
3598e28a4053SRui Paulo */
3599e28a4053SRui Paulo int (*get_seqnum)(const char *ifname, void *priv, const u8 *addr,
3600*a90b9d01SCy Schubert int idx, int link_id, u8 *seq);
3601e28a4053SRui Paulo
3602e28a4053SRui Paulo /**
3603e28a4053SRui Paulo * flush - Flush all association stations (AP only)
3604e28a4053SRui Paulo * @priv: Private driver interface data
3605*a90b9d01SCy Schubert * @link_id: In case of MLO, valid link ID on which all associated
3606*a90b9d01SCy Schubert * stations will be flushed, -1 otherwise.
3607e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3608e28a4053SRui Paulo *
3609e28a4053SRui Paulo * This function requests the driver to disassociate all associated
3610e28a4053SRui Paulo * stations. This function does not need to be implemented if the
3611e28a4053SRui Paulo * driver does not process association frames internally.
3612e28a4053SRui Paulo */
3613*a90b9d01SCy Schubert int (*flush)(void *priv, int link_id);
3614e28a4053SRui Paulo
3615e28a4053SRui Paulo /**
3616e28a4053SRui Paulo * set_generic_elem - Add IEs into Beacon/Probe Response frames (AP)
3617e28a4053SRui Paulo * @priv: Private driver interface data
3618e28a4053SRui Paulo * @elem: Information elements
3619e28a4053SRui Paulo * @elem_len: Length of the elem buffer in octets
3620e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3621e28a4053SRui Paulo *
3622e28a4053SRui Paulo * This is an optional function to add information elements in the
3623e28a4053SRui Paulo * kernel driver for Beacon and Probe Response frames. This can be left
3624e28a4053SRui Paulo * undefined (set to %NULL) if the driver uses the Beacon template from
3625f05cddf9SRui Paulo * set_ap().
3626f05cddf9SRui Paulo *
3627f05cddf9SRui Paulo * DEPRECATED - use set_ap() instead
3628e28a4053SRui Paulo */
3629e28a4053SRui Paulo int (*set_generic_elem)(void *priv, const u8 *elem, size_t elem_len);
3630e28a4053SRui Paulo
3631e28a4053SRui Paulo /**
3632f05cddf9SRui Paulo * read_sta_data - Fetch station data
3633e28a4053SRui Paulo * @priv: Private driver interface data
3634e28a4053SRui Paulo * @data: Buffer for returning station information
3635e28a4053SRui Paulo * @addr: MAC address of the station
3636e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3637e28a4053SRui Paulo */
3638e28a4053SRui Paulo int (*read_sta_data)(void *priv, struct hostap_sta_driver_data *data,
3639e28a4053SRui Paulo const u8 *addr);
3640e28a4053SRui Paulo
3641e28a4053SRui Paulo /**
3642c1d255d3SCy Schubert * tx_control_port - Send a frame over the 802.1X controlled port
3643c1d255d3SCy Schubert * @priv: Private driver interface data
3644c1d255d3SCy Schubert * @dest: Destination MAC address
3645c1d255d3SCy Schubert * @proto: Ethertype in host byte order
3646c1d255d3SCy Schubert * @buf: Frame payload starting from IEEE 802.1X header
3647c1d255d3SCy Schubert * @len: Frame payload length
3648c1d255d3SCy Schubert * @no_encrypt: Do not encrypt frame
3649*a90b9d01SCy Schubert * @link_id: Link ID to use for TX, or -1 if not set
3650c1d255d3SCy Schubert *
3651c1d255d3SCy Schubert * Returns 0 on success, else an error
3652c1d255d3SCy Schubert *
3653c1d255d3SCy Schubert * This is like a normal Ethernet send except that the driver is aware
3654c1d255d3SCy Schubert * (by other means than the Ethertype) that this frame is special,
3655c1d255d3SCy Schubert * and more importantly it gains an ordering between the transmission of
3656c1d255d3SCy Schubert * the frame and other driver management operations such as key
3657c1d255d3SCy Schubert * installations. This can be used to work around known limitations in
3658c1d255d3SCy Schubert * IEEE 802.11 protocols such as race conditions between rekeying 4-way
3659c1d255d3SCy Schubert * handshake message 4/4 and a PTK being overwritten.
3660c1d255d3SCy Schubert *
3661c1d255d3SCy Schubert * This function is only used for a given interface if the driver
3662c1d255d3SCy Schubert * instance reports WPA_DRIVER_FLAGS_CONTROL_PORT capability. Otherwise,
3663c1d255d3SCy Schubert * API users will fall back to sending the frame via a normal socket.
3664c1d255d3SCy Schubert */
3665c1d255d3SCy Schubert int (*tx_control_port)(void *priv, const u8 *dest,
3666c1d255d3SCy Schubert u16 proto, const u8 *buf, size_t len,
3667*a90b9d01SCy Schubert int no_encrypt, int link_id);
3668c1d255d3SCy Schubert
3669c1d255d3SCy Schubert /**
3670e28a4053SRui Paulo * hapd_send_eapol - Send an EAPOL packet (AP only)
3671e28a4053SRui Paulo * @priv: private driver interface data
3672e28a4053SRui Paulo * @addr: Destination MAC address
3673e28a4053SRui Paulo * @data: EAPOL packet starting with IEEE 802.1X header
3674e28a4053SRui Paulo * @data_len: Length of the EAPOL packet in octets
3675e28a4053SRui Paulo * @encrypt: Whether the frame should be encrypted
3676e28a4053SRui Paulo * @own_addr: Source MAC address
3677f05cddf9SRui Paulo * @flags: WPA_STA_* flags for the destination station
3678*a90b9d01SCy Schubert * @link_id: Link ID to use for TX, or -1 if not set
3679e28a4053SRui Paulo *
3680e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3681e28a4053SRui Paulo */
3682e28a4053SRui Paulo int (*hapd_send_eapol)(void *priv, const u8 *addr, const u8 *data,
3683e28a4053SRui Paulo size_t data_len, int encrypt,
3684*a90b9d01SCy Schubert const u8 *own_addr, u32 flags, int link_id);
3685e28a4053SRui Paulo
3686e28a4053SRui Paulo /**
3687e28a4053SRui Paulo * sta_deauth - Deauthenticate a station (AP only)
3688e28a4053SRui Paulo * @priv: Private driver interface data
3689e28a4053SRui Paulo * @own_addr: Source address and BSSID for the Deauthentication frame
3690e28a4053SRui Paulo * @addr: MAC address of the station to deauthenticate
3691*a90b9d01SCy Schubert * @reason: Reason code for the Deauthentication frame
3692*a90b9d01SCy Schubert * @link_id: Link ID to use for Deauthentication frame, or -1 if not set
3693e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3694e28a4053SRui Paulo *
3695e28a4053SRui Paulo * This function requests a specific station to be deauthenticated and
3696e28a4053SRui Paulo * a Deauthentication frame to be sent to it.
3697e28a4053SRui Paulo */
3698e28a4053SRui Paulo int (*sta_deauth)(void *priv, const u8 *own_addr, const u8 *addr,
3699*a90b9d01SCy Schubert u16 reason, int link_id);
3700e28a4053SRui Paulo
3701e28a4053SRui Paulo /**
3702e28a4053SRui Paulo * sta_disassoc - Disassociate a station (AP only)
3703e28a4053SRui Paulo * @priv: Private driver interface data
3704e28a4053SRui Paulo * @own_addr: Source address and BSSID for the Disassociation frame
3705e28a4053SRui Paulo * @addr: MAC address of the station to disassociate
3706e28a4053SRui Paulo * @reason: Reason code for the Disassociation frame
3707e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3708e28a4053SRui Paulo *
3709e28a4053SRui Paulo * This function requests a specific station to be disassociated and
3710e28a4053SRui Paulo * a Disassociation frame to be sent to it.
3711e28a4053SRui Paulo */
3712e28a4053SRui Paulo int (*sta_disassoc)(void *priv, const u8 *own_addr, const u8 *addr,
3713206b73d0SCy Schubert u16 reason);
3714e28a4053SRui Paulo
3715e28a4053SRui Paulo /**
3716e28a4053SRui Paulo * sta_remove - Remove a station entry (AP only)
3717e28a4053SRui Paulo * @priv: Private driver interface data
3718e28a4053SRui Paulo * @addr: MAC address of the station to be removed
3719e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3720e28a4053SRui Paulo */
3721e28a4053SRui Paulo int (*sta_remove)(void *priv, const u8 *addr);
3722e28a4053SRui Paulo
3723e28a4053SRui Paulo /**
3724e28a4053SRui Paulo * hapd_get_ssid - Get the current SSID (AP only)
3725e28a4053SRui Paulo * @priv: Private driver interface data
3726e28a4053SRui Paulo * @buf: Buffer for returning the SSID
3727e28a4053SRui Paulo * @len: Maximum length of the buffer
3728e28a4053SRui Paulo * Returns: Length of the SSID on success, -1 on failure
3729e28a4053SRui Paulo *
3730e28a4053SRui Paulo * This function need not be implemented if the driver uses Beacon
3731f05cddf9SRui Paulo * template from set_ap() and does not reply to Probe Request frames.
3732e28a4053SRui Paulo */
3733e28a4053SRui Paulo int (*hapd_get_ssid)(void *priv, u8 *buf, int len);
3734e28a4053SRui Paulo
3735e28a4053SRui Paulo /**
3736e28a4053SRui Paulo * hapd_set_ssid - Set SSID (AP only)
3737e28a4053SRui Paulo * @priv: Private driver interface data
3738e28a4053SRui Paulo * @buf: SSID
3739e28a4053SRui Paulo * @len: Length of the SSID in octets
3740e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3741f05cddf9SRui Paulo *
3742f05cddf9SRui Paulo * DEPRECATED - use set_ap() instead
3743e28a4053SRui Paulo */
3744e28a4053SRui Paulo int (*hapd_set_ssid)(void *priv, const u8 *buf, int len);
3745e28a4053SRui Paulo
3746e28a4053SRui Paulo /**
3747e28a4053SRui Paulo * hapd_set_countermeasures - Enable/disable TKIP countermeasures (AP)
3748e28a4053SRui Paulo * @priv: Private driver interface data
3749e28a4053SRui Paulo * @enabled: 1 = countermeasures enabled, 0 = disabled
3750e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3751e28a4053SRui Paulo *
3752e28a4053SRui Paulo * This need not be implemented if the driver does not take care of
3753e28a4053SRui Paulo * association processing.
3754e28a4053SRui Paulo */
3755e28a4053SRui Paulo int (*hapd_set_countermeasures)(void *priv, int enabled);
3756e28a4053SRui Paulo
3757e28a4053SRui Paulo /**
3758e28a4053SRui Paulo * sta_add - Add a station entry
3759e28a4053SRui Paulo * @priv: Private driver interface data
3760e28a4053SRui Paulo * @params: Station parameters
3761e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3762e28a4053SRui Paulo *
3763780fb4a2SCy Schubert * This function is used to add or set (params->set 1) a station
3764780fb4a2SCy Schubert * entry in the driver. Adding STA entries is used only if the driver
3765e28a4053SRui Paulo * does not take care of association processing.
3766f05cddf9SRui Paulo *
3767780fb4a2SCy Schubert * With drivers that don't support full AP client state, this function
3768780fb4a2SCy Schubert * is used to add a station entry to the driver once the station has
3769780fb4a2SCy Schubert * completed association.
3770780fb4a2SCy Schubert *
3771780fb4a2SCy Schubert * With TDLS, this function is used to add or set (params->set 1)
3772780fb4a2SCy Schubert * TDLS peer entries (even with drivers that do not support full AP
3773780fb4a2SCy Schubert * client state).
3774e28a4053SRui Paulo */
3775e28a4053SRui Paulo int (*sta_add)(void *priv, struct hostapd_sta_add_params *params);
3776e28a4053SRui Paulo
3777e28a4053SRui Paulo /**
3778e28a4053SRui Paulo * get_inact_sec - Get station inactivity duration (AP only)
3779e28a4053SRui Paulo * @priv: Private driver interface data
3780e28a4053SRui Paulo * @addr: Station address
3781e28a4053SRui Paulo * Returns: Number of seconds station has been inactive, -1 on failure
3782e28a4053SRui Paulo */
3783e28a4053SRui Paulo int (*get_inact_sec)(void *priv, const u8 *addr);
3784e28a4053SRui Paulo
3785e28a4053SRui Paulo /**
3786e28a4053SRui Paulo * sta_clear_stats - Clear station statistics (AP only)
3787e28a4053SRui Paulo * @priv: Private driver interface data
3788e28a4053SRui Paulo * @addr: Station address
3789e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3790e28a4053SRui Paulo */
3791e28a4053SRui Paulo int (*sta_clear_stats)(void *priv, const u8 *addr);
3792e28a4053SRui Paulo
3793e28a4053SRui Paulo /**
3794e28a4053SRui Paulo * set_freq - Set channel/frequency (AP only)
3795e28a4053SRui Paulo * @priv: Private driver interface data
3796e28a4053SRui Paulo * @freq: Channel parameters
3797e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3798e28a4053SRui Paulo */
3799e28a4053SRui Paulo int (*set_freq)(void *priv, struct hostapd_freq_params *freq);
3800e28a4053SRui Paulo
3801e28a4053SRui Paulo /**
3802e28a4053SRui Paulo * set_rts - Set RTS threshold
3803e28a4053SRui Paulo * @priv: Private driver interface data
3804e28a4053SRui Paulo * @rts: RTS threshold in octets
3805e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3806e28a4053SRui Paulo */
3807e28a4053SRui Paulo int (*set_rts)(void *priv, int rts);
3808e28a4053SRui Paulo
3809e28a4053SRui Paulo /**
3810e28a4053SRui Paulo * set_frag - Set fragmentation threshold
3811e28a4053SRui Paulo * @priv: Private driver interface data
3812e28a4053SRui Paulo * @frag: Fragmentation threshold in octets
3813e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3814e28a4053SRui Paulo */
3815e28a4053SRui Paulo int (*set_frag)(void *priv, int frag);
3816e28a4053SRui Paulo
3817e28a4053SRui Paulo /**
3818e28a4053SRui Paulo * sta_set_flags - Set station flags (AP only)
3819e28a4053SRui Paulo * @priv: Private driver interface data
3820e28a4053SRui Paulo * @addr: Station address
3821e28a4053SRui Paulo * @total_flags: Bitmap of all WPA_STA_* flags currently set
3822e28a4053SRui Paulo * @flags_or: Bitmap of WPA_STA_* flags to add
3823e28a4053SRui Paulo * @flags_and: Bitmap of WPA_STA_* flags to us as a mask
3824e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3825e28a4053SRui Paulo */
3826e28a4053SRui Paulo int (*sta_set_flags)(void *priv, const u8 *addr,
3827325151a3SRui Paulo unsigned int total_flags, unsigned int flags_or,
3828325151a3SRui Paulo unsigned int flags_and);
3829e28a4053SRui Paulo
3830e28a4053SRui Paulo /**
3831206b73d0SCy Schubert * sta_set_airtime_weight - Set station airtime weight (AP only)
3832206b73d0SCy Schubert * @priv: Private driver interface data
3833206b73d0SCy Schubert * @addr: Station address
3834206b73d0SCy Schubert * @weight: New weight for station airtime assignment
3835206b73d0SCy Schubert * Returns: 0 on success, -1 on failure
3836206b73d0SCy Schubert */
3837206b73d0SCy Schubert int (*sta_set_airtime_weight)(void *priv, const u8 *addr,
3838206b73d0SCy Schubert unsigned int weight);
3839206b73d0SCy Schubert
3840206b73d0SCy Schubert /**
3841e28a4053SRui Paulo * set_tx_queue_params - Set TX queue parameters
3842e28a4053SRui Paulo * @priv: Private driver interface data
3843f05cddf9SRui Paulo * @queue: Queue number (0 = VO, 1 = VI, 2 = BE, 3 = BK)
3844e28a4053SRui Paulo * @aifs: AIFS
3845e28a4053SRui Paulo * @cw_min: cwMin
3846e28a4053SRui Paulo * @cw_max: cwMax
3847e28a4053SRui Paulo * @burst_time: Maximum length for bursting in 0.1 msec units
3848*a90b9d01SCy Schubert * @link_id: Link ID to use, or -1 for non MLD.
3849e28a4053SRui Paulo */
3850e28a4053SRui Paulo int (*set_tx_queue_params)(void *priv, int queue, int aifs, int cw_min,
3851*a90b9d01SCy Schubert int cw_max, int burst_time, int link_id);
3852e28a4053SRui Paulo
3853e28a4053SRui Paulo /**
3854e28a4053SRui Paulo * if_add - Add a virtual interface
3855e28a4053SRui Paulo * @priv: Private driver interface data
3856e28a4053SRui Paulo * @type: Interface type
3857e28a4053SRui Paulo * @ifname: Interface name for the new virtual interface
3858e28a4053SRui Paulo * @addr: Local address to use for the interface or %NULL to use the
3859e28a4053SRui Paulo * parent interface address
3860e28a4053SRui Paulo * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces
3861e28a4053SRui Paulo * @drv_priv: Pointer for overwriting the driver context or %NULL if
3862e28a4053SRui Paulo * not allowed (applies only to %WPA_IF_AP_BSS type)
3863e28a4053SRui Paulo * @force_ifname: Buffer for returning an interface name that the
3864e28a4053SRui Paulo * driver ended up using if it differs from the requested ifname
3865e28a4053SRui Paulo * @if_addr: Buffer for returning the allocated interface address
3866e28a4053SRui Paulo * (this may differ from the requested addr if the driver cannot
3867e28a4053SRui Paulo * change interface address)
3868f05cddf9SRui Paulo * @bridge: Bridge interface to use or %NULL if no bridge configured
38695b9c547cSRui Paulo * @use_existing: Whether to allow existing interface to be used
3870780fb4a2SCy Schubert * @setup_ap: Whether to setup AP for %WPA_IF_AP_BSS interfaces
3871e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3872e28a4053SRui Paulo */
3873e28a4053SRui Paulo int (*if_add)(void *priv, enum wpa_driver_if_type type,
3874e28a4053SRui Paulo const char *ifname, const u8 *addr, void *bss_ctx,
3875f05cddf9SRui Paulo void **drv_priv, char *force_ifname, u8 *if_addr,
3876780fb4a2SCy Schubert const char *bridge, int use_existing, int setup_ap);
3877e28a4053SRui Paulo
3878e28a4053SRui Paulo /**
3879e28a4053SRui Paulo * if_remove - Remove a virtual interface
3880e28a4053SRui Paulo * @priv: Private driver interface data
3881e28a4053SRui Paulo * @type: Interface type
3882e28a4053SRui Paulo * @ifname: Interface name of the virtual interface to be removed
3883e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3884e28a4053SRui Paulo */
3885e28a4053SRui Paulo int (*if_remove)(void *priv, enum wpa_driver_if_type type,
3886e28a4053SRui Paulo const char *ifname);
3887e28a4053SRui Paulo
3888e28a4053SRui Paulo /**
3889e28a4053SRui Paulo * set_sta_vlan - Bind a station into a specific interface (AP only)
3890e28a4053SRui Paulo * @priv: Private driver interface data
3891e28a4053SRui Paulo * @ifname: Interface (main or virtual BSS or VLAN)
3892e28a4053SRui Paulo * @addr: MAC address of the associated station
3893e28a4053SRui Paulo * @vlan_id: VLAN ID
3894*a90b9d01SCy Schubert * @link_id: The link ID or -1 for non-MLO
3895e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3896e28a4053SRui Paulo *
3897e28a4053SRui Paulo * This function is used to bind a station to a specific virtual
3898e28a4053SRui Paulo * interface. It is only used if when virtual interfaces are supported,
3899e28a4053SRui Paulo * e.g., to assign stations to different VLAN interfaces based on
3900e28a4053SRui Paulo * information from a RADIUS server. This allows separate broadcast
3901e28a4053SRui Paulo * domains to be used with a single BSS.
3902e28a4053SRui Paulo */
3903e28a4053SRui Paulo int (*set_sta_vlan)(void *priv, const u8 *addr, const char *ifname,
3904*a90b9d01SCy Schubert int vlan_id, int link_id);
3905e28a4053SRui Paulo
3906e28a4053SRui Paulo /**
3907e28a4053SRui Paulo * commit - Optional commit changes handler (AP only)
3908e28a4053SRui Paulo * @priv: driver private data
3909e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3910e28a4053SRui Paulo *
3911e28a4053SRui Paulo * This optional handler function can be registered if the driver
3912e28a4053SRui Paulo * interface implementation needs to commit changes (e.g., by setting
3913e28a4053SRui Paulo * network interface up) at the end of initial configuration. If set,
3914e28a4053SRui Paulo * this handler will be called after initial setup has been completed.
3915e28a4053SRui Paulo */
3916e28a4053SRui Paulo int (*commit)(void *priv);
3917e28a4053SRui Paulo
3918e28a4053SRui Paulo /**
3919e28a4053SRui Paulo * set_radius_acl_auth - Notification of RADIUS ACL change
3920e28a4053SRui Paulo * @priv: Private driver interface data
3921e28a4053SRui Paulo * @mac: MAC address of the station
3922e28a4053SRui Paulo * @accepted: Whether the station was accepted
3923e28a4053SRui Paulo * @session_timeout: Session timeout for the station
3924e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3925e28a4053SRui Paulo */
3926e28a4053SRui Paulo int (*set_radius_acl_auth)(void *priv, const u8 *mac, int accepted,
3927e28a4053SRui Paulo u32 session_timeout);
3928e28a4053SRui Paulo
3929e28a4053SRui Paulo /**
3930e28a4053SRui Paulo * set_radius_acl_expire - Notification of RADIUS ACL expiration
3931e28a4053SRui Paulo * @priv: Private driver interface data
3932e28a4053SRui Paulo * @mac: MAC address of the station
3933e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3934e28a4053SRui Paulo */
3935e28a4053SRui Paulo int (*set_radius_acl_expire)(void *priv, const u8 *mac);
3936e28a4053SRui Paulo
3937e28a4053SRui Paulo /**
3938e28a4053SRui Paulo * set_ap_wps_ie - Add WPS IE(s) into Beacon/Probe Response frames (AP)
3939e28a4053SRui Paulo * @priv: Private driver interface data
3940e28a4053SRui Paulo * @beacon: WPS IE(s) for Beacon frames or %NULL to remove extra IE(s)
3941e28a4053SRui Paulo * @proberesp: WPS IE(s) for Probe Response frames or %NULL to remove
3942e28a4053SRui Paulo * extra IE(s)
3943f05cddf9SRui Paulo * @assocresp: WPS IE(s) for (Re)Association Response frames or %NULL
3944f05cddf9SRui Paulo * to remove extra IE(s)
3945e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3946e28a4053SRui Paulo *
3947e28a4053SRui Paulo * This is an optional function to add WPS IE in the kernel driver for
3948e28a4053SRui Paulo * Beacon and Probe Response frames. This can be left undefined (set
3949f05cddf9SRui Paulo * to %NULL) if the driver uses the Beacon template from set_ap()
3950f05cddf9SRui Paulo * and does not process Probe Request frames. If the driver takes care
3951f05cddf9SRui Paulo * of (Re)Association frame processing, the assocresp buffer includes
3952f05cddf9SRui Paulo * WPS IE(s) that need to be added to (Re)Association Response frames
3953f05cddf9SRui Paulo * whenever a (Re)Association Request frame indicated use of WPS.
3954f05cddf9SRui Paulo *
3955f05cddf9SRui Paulo * This will also be used to add P2P IE(s) into Beacon/Probe Response
3956f05cddf9SRui Paulo * frames when operating as a GO. The driver is responsible for adding
3957f05cddf9SRui Paulo * timing related attributes (e.g., NoA) in addition to the IEs
3958f05cddf9SRui Paulo * included here by appending them after these buffers. This call is
3959f05cddf9SRui Paulo * also used to provide Probe Response IEs for P2P Listen state
3960f05cddf9SRui Paulo * operations for drivers that generate the Probe Response frames
3961f05cddf9SRui Paulo * internally.
3962f05cddf9SRui Paulo *
3963f05cddf9SRui Paulo * DEPRECATED - use set_ap() instead
3964e28a4053SRui Paulo */
3965e28a4053SRui Paulo int (*set_ap_wps_ie)(void *priv, const struct wpabuf *beacon,
3966f05cddf9SRui Paulo const struct wpabuf *proberesp,
3967f05cddf9SRui Paulo const struct wpabuf *assocresp);
3968e28a4053SRui Paulo
3969e28a4053SRui Paulo /**
3970e28a4053SRui Paulo * set_supp_port - Set IEEE 802.1X Supplicant Port status
3971e28a4053SRui Paulo * @priv: Private driver interface data
3972e28a4053SRui Paulo * @authorized: Whether the port is authorized
3973e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3974e28a4053SRui Paulo */
3975e28a4053SRui Paulo int (*set_supp_port)(void *priv, int authorized);
3976e28a4053SRui Paulo
3977e28a4053SRui Paulo /**
3978e28a4053SRui Paulo * set_wds_sta - Bind a station into a 4-address WDS (AP only)
3979e28a4053SRui Paulo * @priv: Private driver interface data
3980e28a4053SRui Paulo * @addr: MAC address of the associated station
3981e28a4053SRui Paulo * @aid: Association ID
3982e28a4053SRui Paulo * @val: 1 = bind to 4-address WDS; 0 = unbind
3983f05cddf9SRui Paulo * @bridge_ifname: Bridge interface to use for the WDS station or %NULL
3984f05cddf9SRui Paulo * to indicate that bridge is not to be used
39855b9c547cSRui Paulo * @ifname_wds: Buffer to return the interface name for the new WDS
39865b9c547cSRui Paulo * station or %NULL to indicate name is not returned.
3987e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
3988e28a4053SRui Paulo */
3989f05cddf9SRui Paulo int (*set_wds_sta)(void *priv, const u8 *addr, int aid, int val,
39905b9c547cSRui Paulo const char *bridge_ifname, char *ifname_wds);
3991e28a4053SRui Paulo
3992e28a4053SRui Paulo /**
3993e28a4053SRui Paulo * send_action - Transmit an Action frame
3994e28a4053SRui Paulo * @priv: Private driver interface data
3995e28a4053SRui Paulo * @freq: Frequency (in MHz) of the channel
3996f05cddf9SRui Paulo * @wait: Time to wait off-channel for a response (in ms), or zero
3997e28a4053SRui Paulo * @dst: Destination MAC address (Address 1)
3998e28a4053SRui Paulo * @src: Source MAC address (Address 2)
3999e28a4053SRui Paulo * @bssid: BSSID (Address 3)
4000e28a4053SRui Paulo * @data: Frame body
4001e28a4053SRui Paulo * @data_len: data length in octets
4002f05cddf9SRui Paulo @ @no_cck: Whether CCK rates must not be used to transmit this frame
4003e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
4004e28a4053SRui Paulo *
4005e28a4053SRui Paulo * This command can be used to request the driver to transmit an action
4006f05cddf9SRui Paulo * frame to the specified destination.
4007f05cddf9SRui Paulo *
4008f05cddf9SRui Paulo * If the %WPA_DRIVER_FLAGS_OFFCHANNEL_TX flag is set, the frame will
4009f05cddf9SRui Paulo * be transmitted on the given channel and the device will wait for a
4010f05cddf9SRui Paulo * response on that channel for the given wait time.
4011f05cddf9SRui Paulo *
4012f05cddf9SRui Paulo * If the flag is not set, the wait time will be ignored. In this case,
4013f05cddf9SRui Paulo * if a remain-on-channel duration is in progress, the frame must be
4014f05cddf9SRui Paulo * transmitted on that channel; alternatively the frame may be sent on
4015f05cddf9SRui Paulo * the current operational channel (if in associated state in station
4016f05cddf9SRui Paulo * mode or while operating as an AP.)
401785732ac8SCy Schubert *
401885732ac8SCy Schubert * If @src differs from the device MAC address, use of a random
401985732ac8SCy Schubert * transmitter address is requested for this message exchange.
4020e28a4053SRui Paulo */
4021f05cddf9SRui Paulo int (*send_action)(void *priv, unsigned int freq, unsigned int wait,
4022e28a4053SRui Paulo const u8 *dst, const u8 *src, const u8 *bssid,
4023f05cddf9SRui Paulo const u8 *data, size_t data_len, int no_cck);
4024f05cddf9SRui Paulo
4025f05cddf9SRui Paulo /**
4026f05cddf9SRui Paulo * send_action_cancel_wait - Cancel action frame TX wait
4027f05cddf9SRui Paulo * @priv: Private driver interface data
4028f05cddf9SRui Paulo *
4029f05cddf9SRui Paulo * This command cancels the wait time associated with sending an action
4030f05cddf9SRui Paulo * frame. It is only available when %WPA_DRIVER_FLAGS_OFFCHANNEL_TX is
4031f05cddf9SRui Paulo * set in the driver flags.
4032f05cddf9SRui Paulo */
4033f05cddf9SRui Paulo void (*send_action_cancel_wait)(void *priv);
4034e28a4053SRui Paulo
4035e28a4053SRui Paulo /**
4036e28a4053SRui Paulo * remain_on_channel - Remain awake on a channel
4037e28a4053SRui Paulo * @priv: Private driver interface data
4038e28a4053SRui Paulo * @freq: Frequency (in MHz) of the channel
4039e28a4053SRui Paulo * @duration: Duration in milliseconds
4040e28a4053SRui Paulo * Returns: 0 on success, -1 on failure
4041e28a4053SRui Paulo *
4042e28a4053SRui Paulo * This command is used to request the driver to remain awake on the
4043e28a4053SRui Paulo * specified channel for the specified duration and report received
40445b9c547cSRui Paulo * Action frames with EVENT_RX_MGMT events. Optionally, received
4045e28a4053SRui Paulo * Probe Request frames may also be requested to be reported by calling
4046e28a4053SRui Paulo * probe_req_report(). These will be reported with EVENT_RX_PROBE_REQ.
4047e28a4053SRui Paulo *
4048e28a4053SRui Paulo * The driver may not be at the requested channel when this function
4049e28a4053SRui Paulo * returns, i.e., the return code is only indicating whether the
4050e28a4053SRui Paulo * request was accepted. The caller will need to wait until the
4051e28a4053SRui Paulo * EVENT_REMAIN_ON_CHANNEL event indicates that the driver has
4052e28a4053SRui Paulo * completed the channel change. This may take some time due to other
4053e28a4053SRui Paulo * need for the radio and the caller should be prepared to timing out
4054e28a4053SRui Paulo * its wait since there are no guarantees on when this request can be
4055e28a4053SRui Paulo * executed.
4056e28a4053SRui Paulo */
4057e28a4053SRui Paulo int (*remain_on_channel)(void *priv, unsigned int freq,
4058e28a4053SRui Paulo unsigned int duration);
4059e28a4053SRui Paulo
4060e28a4053SRui Paulo /**
4061e28a4053SRui Paulo * cancel_remain_on_channel - Cancel remain-on-channel operation
4062e28a4053SRui Paulo * @priv: Private driver interface data
4063e28a4053SRui Paulo *
4064e28a4053SRui Paulo * This command can be used to cancel a remain-on-channel operation
4065e28a4053SRui Paulo * before its originally requested duration has passed. This could be
4066e28a4053SRui Paulo * used, e.g., when remain_on_channel() is used to request extra time
4067e28a4053SRui Paulo * to receive a response to an Action frame and the response is
4068e28a4053SRui Paulo * received when there is still unneeded time remaining on the
4069e28a4053SRui Paulo * remain-on-channel operation.
4070e28a4053SRui Paulo */
4071e28a4053SRui Paulo int (*cancel_remain_on_channel)(void *priv);
4072e28a4053SRui Paulo
4073e28a4053SRui Paulo /**
4074e28a4053SRui Paulo * probe_req_report - Request Probe Request frames to be indicated
4075e28a4053SRui Paulo * @priv: Private driver interface data
4076e28a4053SRui Paulo * @report: Whether to report received Probe Request frames
4077e28a4053SRui Paulo * Returns: 0 on success, -1 on failure (or if not supported)
4078e28a4053SRui Paulo *
4079e28a4053SRui Paulo * This command can be used to request the driver to indicate when
4080e28a4053SRui Paulo * Probe Request frames are received with EVENT_RX_PROBE_REQ events.
4081e28a4053SRui Paulo * Since this operation may require extra resources, e.g., due to less
4082e28a4053SRui Paulo * optimal hardware/firmware RX filtering, many drivers may disable
4083e28a4053SRui Paulo * Probe Request reporting at least in station mode. This command is
4084e28a4053SRui Paulo * used to notify the driver when the Probe Request frames need to be
4085e28a4053SRui Paulo * reported, e.g., during remain-on-channel operations.
4086e28a4053SRui Paulo */
4087e28a4053SRui Paulo int (*probe_req_report)(void *priv, int report);
4088e28a4053SRui Paulo
4089e28a4053SRui Paulo /**
4090e28a4053SRui Paulo * deinit_ap - Deinitialize AP mode
4091e28a4053SRui Paulo * @priv: Private driver interface data
4092e28a4053SRui Paulo * Returns: 0 on success, -1 on failure (or if not supported)
4093e28a4053SRui Paulo *
4094e28a4053SRui Paulo * This optional function can be used to disable AP mode related
40955b9c547cSRui Paulo * configuration. If the interface was not dynamically added,
40965b9c547cSRui Paulo * change the driver mode to station mode to allow normal station
40975b9c547cSRui Paulo * operations like scanning to be completed.
4098e28a4053SRui Paulo */
4099e28a4053SRui Paulo int (*deinit_ap)(void *priv);
4100e28a4053SRui Paulo
4101e28a4053SRui Paulo /**
4102f05cddf9SRui Paulo * deinit_p2p_cli - Deinitialize P2P client mode
4103f05cddf9SRui Paulo * @priv: Private driver interface data
4104f05cddf9SRui Paulo * Returns: 0 on success, -1 on failure (or if not supported)
4105f05cddf9SRui Paulo *
41065b9c547cSRui Paulo * This optional function can be used to disable P2P client mode. If the
41075b9c547cSRui Paulo * interface was not dynamically added, change the interface type back
41085b9c547cSRui Paulo * to station mode.
4109f05cddf9SRui Paulo */
4110f05cddf9SRui Paulo int (*deinit_p2p_cli)(void *priv);
4111f05cddf9SRui Paulo
4112f05cddf9SRui Paulo /**
4113e28a4053SRui Paulo * suspend - Notification on system suspend/hibernate event
4114e28a4053SRui Paulo * @priv: Private driver interface data
4115e28a4053SRui Paulo */
4116e28a4053SRui Paulo void (*suspend)(void *priv);
4117e28a4053SRui Paulo
4118e28a4053SRui Paulo /**
4119e28a4053SRui Paulo * resume - Notification on system resume/thaw event
4120e28a4053SRui Paulo * @priv: Private driver interface data
4121e28a4053SRui Paulo */
4122e28a4053SRui Paulo void (*resume)(void *priv);
4123e28a4053SRui Paulo
4124e28a4053SRui Paulo /**
4125e28a4053SRui Paulo * signal_monitor - Set signal monitoring parameters
4126e28a4053SRui Paulo * @priv: Private driver interface data
4127e28a4053SRui Paulo * @threshold: Threshold value for signal change events; 0 = disabled
4128e28a4053SRui Paulo * @hysteresis: Minimum change in signal strength before indicating a
4129e28a4053SRui Paulo * new event
4130e28a4053SRui Paulo * Returns: 0 on success, -1 on failure (or if not supported)
4131e28a4053SRui Paulo *
4132e28a4053SRui Paulo * This function can be used to configure monitoring of signal strength
4133e28a4053SRui Paulo * with the current AP. Whenever signal strength drops below the
4134e28a4053SRui Paulo * %threshold value or increases above it, EVENT_SIGNAL_CHANGE event
4135e28a4053SRui Paulo * should be generated assuming the signal strength has changed at
4136e28a4053SRui Paulo * least %hysteresis from the previously indicated signal change event.
4137e28a4053SRui Paulo */
4138e28a4053SRui Paulo int (*signal_monitor)(void *priv, int threshold, int hysteresis);
4139e28a4053SRui Paulo
4140e28a4053SRui Paulo /**
4141f05cddf9SRui Paulo * get_noa - Get current Notice of Absence attribute payload
4142f05cddf9SRui Paulo * @priv: Private driver interface data
4143f05cddf9SRui Paulo * @buf: Buffer for returning NoA
4144f05cddf9SRui Paulo * @buf_len: Buffer length in octets
4145f05cddf9SRui Paulo * Returns: Number of octets used in buf, 0 to indicate no NoA is being
4146f05cddf9SRui Paulo * advertized, or -1 on failure
4147f05cddf9SRui Paulo *
4148f05cddf9SRui Paulo * This function is used to fetch the current Notice of Absence
4149f05cddf9SRui Paulo * attribute value from GO.
4150f05cddf9SRui Paulo */
4151f05cddf9SRui Paulo int (*get_noa)(void *priv, u8 *buf, size_t buf_len);
4152f05cddf9SRui Paulo
4153f05cddf9SRui Paulo /**
4154f05cddf9SRui Paulo * set_noa - Set Notice of Absence parameters for GO (testing)
4155f05cddf9SRui Paulo * @priv: Private driver interface data
4156f05cddf9SRui Paulo * @count: Count
4157f05cddf9SRui Paulo * @start: Start time in ms from next TBTT
4158f05cddf9SRui Paulo * @duration: Duration in ms
4159f05cddf9SRui Paulo * Returns: 0 on success or -1 on failure
4160f05cddf9SRui Paulo *
4161f05cddf9SRui Paulo * This function is used to set Notice of Absence parameters for GO. It
4162f05cddf9SRui Paulo * is used only for testing. To disable NoA, all parameters are set to
4163f05cddf9SRui Paulo * 0.
4164f05cddf9SRui Paulo */
4165f05cddf9SRui Paulo int (*set_noa)(void *priv, u8 count, int start, int duration);
4166f05cddf9SRui Paulo
4167f05cddf9SRui Paulo /**
4168f05cddf9SRui Paulo * set_p2p_powersave - Set P2P power save options
4169f05cddf9SRui Paulo * @priv: Private driver interface data
4170f05cddf9SRui Paulo * @legacy_ps: 0 = disable, 1 = enable, 2 = maximum PS, -1 = no change
4171f05cddf9SRui Paulo * @opp_ps: 0 = disable, 1 = enable, -1 = no change
4172f05cddf9SRui Paulo * @ctwindow: 0.. = change (msec), -1 = no change
4173f05cddf9SRui Paulo * Returns: 0 on success or -1 on failure
4174f05cddf9SRui Paulo */
4175f05cddf9SRui Paulo int (*set_p2p_powersave)(void *priv, int legacy_ps, int opp_ps,
4176f05cddf9SRui Paulo int ctwindow);
4177f05cddf9SRui Paulo
4178f05cddf9SRui Paulo /**
4179f05cddf9SRui Paulo * ampdu - Enable/disable aggregation
4180f05cddf9SRui Paulo * @priv: Private driver interface data
4181f05cddf9SRui Paulo * @ampdu: 1/0 = enable/disable A-MPDU aggregation
4182f05cddf9SRui Paulo * Returns: 0 on success or -1 on failure
4183f05cddf9SRui Paulo */
4184f05cddf9SRui Paulo int (*ampdu)(void *priv, int ampdu);
4185f05cddf9SRui Paulo
4186f05cddf9SRui Paulo /**
4187f05cddf9SRui Paulo * get_radio_name - Get physical radio name for the device
4188f05cddf9SRui Paulo * @priv: Private driver interface data
4189f05cddf9SRui Paulo * Returns: Radio name or %NULL if not known
4190f05cddf9SRui Paulo *
4191f05cddf9SRui Paulo * The returned data must not be modified by the caller. It is assumed
4192f05cddf9SRui Paulo * that any interface that has the same radio name as another is
4193f05cddf9SRui Paulo * sharing the same physical radio. This information can be used to
4194f05cddf9SRui Paulo * share scan results etc. information between the virtual interfaces
4195f05cddf9SRui Paulo * to speed up various operations.
4196f05cddf9SRui Paulo */
4197f05cddf9SRui Paulo const char * (*get_radio_name)(void *priv);
4198f05cddf9SRui Paulo
4199f05cddf9SRui Paulo /**
4200f05cddf9SRui Paulo * send_tdls_mgmt - for sending TDLS management packets
4201f05cddf9SRui Paulo * @priv: private driver interface data
4202f05cddf9SRui Paulo * @dst: Destination (peer) MAC address
4203f05cddf9SRui Paulo * @action_code: TDLS action code for the mssage
4204f05cddf9SRui Paulo * @dialog_token: Dialog Token to use in the message (if needed)
4205f05cddf9SRui Paulo * @status_code: Status Code or Reason Code to use (if needed)
42065b9c547cSRui Paulo * @peer_capab: TDLS peer capability (TDLS_PEER_* bitfield)
42075b9c547cSRui Paulo * @initiator: Is the current end the TDLS link initiator
4208f05cddf9SRui Paulo * @buf: TDLS IEs to add to the message
4209f05cddf9SRui Paulo * @len: Length of buf in octets
4210*a90b9d01SCy Schubert * @link_id: If >= 0 indicates the link of the AP MLD to specify the
4211*a90b9d01SCy Schubert * operating channel on which to send a TDLS Discovery Response frame.
4212f05cddf9SRui Paulo * Returns: 0 on success, negative (<0) on failure
4213f05cddf9SRui Paulo *
4214f05cddf9SRui Paulo * This optional function can be used to send packet to driver which is
4215f05cddf9SRui Paulo * responsible for receiving and sending all TDLS packets.
4216f05cddf9SRui Paulo */
4217f05cddf9SRui Paulo int (*send_tdls_mgmt)(void *priv, const u8 *dst, u8 action_code,
42185b9c547cSRui Paulo u8 dialog_token, u16 status_code, u32 peer_capab,
4219*a90b9d01SCy Schubert int initiator, const u8 *buf, size_t len,
4220*a90b9d01SCy Schubert int link_id);
4221f05cddf9SRui Paulo
4222f05cddf9SRui Paulo /**
4223f05cddf9SRui Paulo * tdls_oper - Ask the driver to perform high-level TDLS operations
4224f05cddf9SRui Paulo * @priv: Private driver interface data
4225f05cddf9SRui Paulo * @oper: TDLS high-level operation. See %enum tdls_oper
4226f05cddf9SRui Paulo * @peer: Destination (peer) MAC address
4227f05cddf9SRui Paulo * Returns: 0 on success, negative (<0) on failure
4228f05cddf9SRui Paulo *
4229f05cddf9SRui Paulo * This optional function can be used to send high-level TDLS commands
4230f05cddf9SRui Paulo * to the driver.
4231f05cddf9SRui Paulo */
4232f05cddf9SRui Paulo int (*tdls_oper)(void *priv, enum tdls_oper oper, const u8 *peer);
4233f05cddf9SRui Paulo
4234f05cddf9SRui Paulo /**
4235f05cddf9SRui Paulo * wnm_oper - Notify driver of the WNM frame reception
4236f05cddf9SRui Paulo * @priv: Private driver interface data
4237f05cddf9SRui Paulo * @oper: WNM operation. See %enum wnm_oper
4238f05cddf9SRui Paulo * @peer: Destination (peer) MAC address
4239f05cddf9SRui Paulo * @buf: Buffer for the driver to fill in (for getting IE)
4240f05cddf9SRui Paulo * @buf_len: Return the len of buf
4241f05cddf9SRui Paulo * Returns: 0 on success, negative (<0) on failure
4242f05cddf9SRui Paulo */
4243f05cddf9SRui Paulo int (*wnm_oper)(void *priv, enum wnm_oper oper, const u8 *peer,
4244f05cddf9SRui Paulo u8 *buf, u16 *buf_len);
4245f05cddf9SRui Paulo
4246f05cddf9SRui Paulo /**
42475b9c547cSRui Paulo * set_qos_map - Set QoS Map
42485b9c547cSRui Paulo * @priv: Private driver interface data
42495b9c547cSRui Paulo * @qos_map_set: QoS Map
42505b9c547cSRui Paulo * @qos_map_set_len: Length of QoS Map
42515b9c547cSRui Paulo */
42525b9c547cSRui Paulo int (*set_qos_map)(void *priv, const u8 *qos_map_set,
42535b9c547cSRui Paulo u8 qos_map_set_len);
42545b9c547cSRui Paulo
42555b9c547cSRui Paulo /**
42565b9c547cSRui Paulo * br_add_ip_neigh - Add a neigh to the bridge ip neigh table
42575b9c547cSRui Paulo * @priv: Private driver interface data
42585b9c547cSRui Paulo * @version: IP version of the IP address, 4 or 6
42595b9c547cSRui Paulo * @ipaddr: IP address for the neigh entry
42605b9c547cSRui Paulo * @prefixlen: IP address prefix length
42615b9c547cSRui Paulo * @addr: Corresponding MAC address
42625b9c547cSRui Paulo * Returns: 0 on success, negative (<0) on failure
42635b9c547cSRui Paulo */
42645b9c547cSRui Paulo int (*br_add_ip_neigh)(void *priv, u8 version, const u8 *ipaddr,
42655b9c547cSRui Paulo int prefixlen, const u8 *addr);
42665b9c547cSRui Paulo
42675b9c547cSRui Paulo /**
42685b9c547cSRui Paulo * br_delete_ip_neigh - Remove a neigh from the bridge ip neigh table
42695b9c547cSRui Paulo * @priv: Private driver interface data
42705b9c547cSRui Paulo * @version: IP version of the IP address, 4 or 6
42715b9c547cSRui Paulo * @ipaddr: IP address for the neigh entry
42725b9c547cSRui Paulo * Returns: 0 on success, negative (<0) on failure
42735b9c547cSRui Paulo */
42745b9c547cSRui Paulo int (*br_delete_ip_neigh)(void *priv, u8 version, const u8 *ipaddr);
42755b9c547cSRui Paulo
42765b9c547cSRui Paulo /**
42775b9c547cSRui Paulo * br_port_set_attr - Set a bridge port attribute
42785b9c547cSRui Paulo * @attr: Bridge port attribute to set
42795b9c547cSRui Paulo * @val: Value to be set
42805b9c547cSRui Paulo * Returns: 0 on success, negative (<0) on failure
42815b9c547cSRui Paulo */
42825b9c547cSRui Paulo int (*br_port_set_attr)(void *priv, enum drv_br_port_attr attr,
42835b9c547cSRui Paulo unsigned int val);
42845b9c547cSRui Paulo
42855b9c547cSRui Paulo /**
42865b9c547cSRui Paulo * br_port_set_attr - Set a bridge network parameter
42875b9c547cSRui Paulo * @param: Bridge parameter to set
42885b9c547cSRui Paulo * @val: Value to be set
42895b9c547cSRui Paulo * Returns: 0 on success, negative (<0) on failure
42905b9c547cSRui Paulo */
42915b9c547cSRui Paulo int (*br_set_net_param)(void *priv, enum drv_br_net_param param,
42925b9c547cSRui Paulo unsigned int val);
42935b9c547cSRui Paulo
42945b9c547cSRui Paulo /**
4295c1d255d3SCy Schubert * get_wowlan - Get wake-on-wireless status
4296c1d255d3SCy Schubert * @priv: Private driver interface data
4297c1d255d3SCy Schubert */
4298c1d255d3SCy Schubert int (*get_wowlan)(void *priv);
4299c1d255d3SCy Schubert
4300c1d255d3SCy Schubert /**
43015b9c547cSRui Paulo * set_wowlan - Set wake-on-wireless triggers
43025b9c547cSRui Paulo * @priv: Private driver interface data
43035b9c547cSRui Paulo * @triggers: wowlan triggers
43045b9c547cSRui Paulo */
43055b9c547cSRui Paulo int (*set_wowlan)(void *priv, const struct wowlan_triggers *triggers);
43065b9c547cSRui Paulo
43075b9c547cSRui Paulo /**
4308f05cddf9SRui Paulo * signal_poll - Get current connection information
4309f05cddf9SRui Paulo * @priv: Private driver interface data
4310f05cddf9SRui Paulo * @signal_info: Connection info structure
4311f05cddf9SRui Paulo */
4312f05cddf9SRui Paulo int (*signal_poll)(void *priv, struct wpa_signal_info *signal_info);
4313f05cddf9SRui Paulo
4314f05cddf9SRui Paulo /**
4315*a90b9d01SCy Schubert * mlo_signal_poll - Get current MLO connection information
4316*a90b9d01SCy Schubert * @priv: Private driver interface data
4317*a90b9d01SCy Schubert * @mlo_signal_info: MLO connection info structure
4318*a90b9d01SCy Schubert */
4319*a90b9d01SCy Schubert int (*mlo_signal_poll)(void *priv,
4320*a90b9d01SCy Schubert struct wpa_mlo_signal_info *mlo_signal_info);
4321*a90b9d01SCy Schubert
4322*a90b9d01SCy Schubert /**
43234bc52338SCy Schubert * channel_info - Get parameters of the current operating channel
43244bc52338SCy Schubert * @priv: Private driver interface data
43254bc52338SCy Schubert * @channel_info: Channel info structure
43264bc52338SCy Schubert * Returns: 0 on success, negative (<0) on failure
43274bc52338SCy Schubert */
43284bc52338SCy Schubert int (*channel_info)(void *priv, struct wpa_channel_info *channel_info);
43294bc52338SCy Schubert
43304bc52338SCy Schubert /**
4331f05cddf9SRui Paulo * set_authmode - Set authentication algorithm(s) for static WEP
4332f05cddf9SRui Paulo * @priv: Private driver interface data
4333f05cddf9SRui Paulo * @authmode: 1=Open System, 2=Shared Key, 3=both
4334f05cddf9SRui Paulo * Returns: 0 on success, -1 on failure
4335f05cddf9SRui Paulo *
4336f05cddf9SRui Paulo * This function can be used to set authentication algorithms for AP
4337f05cddf9SRui Paulo * mode when static WEP is used. If the driver uses user space MLME/SME
4338f05cddf9SRui Paulo * implementation, there is no need to implement this function.
4339f05cddf9SRui Paulo *
4340f05cddf9SRui Paulo * DEPRECATED - use set_ap() instead
4341f05cddf9SRui Paulo */
4342f05cddf9SRui Paulo int (*set_authmode)(void *priv, int authmode);
4343f05cddf9SRui Paulo
43445b9c547cSRui Paulo #ifdef ANDROID
43455b9c547cSRui Paulo /**
43465b9c547cSRui Paulo * driver_cmd - Execute driver-specific command
43475b9c547cSRui Paulo * @priv: Private driver interface data
43485b9c547cSRui Paulo * @cmd: Command to execute
43495b9c547cSRui Paulo * @buf: Return buffer
43505b9c547cSRui Paulo * @buf_len: Buffer length
43515b9c547cSRui Paulo * Returns: 0 on success, -1 on failure
43525b9c547cSRui Paulo */
43535b9c547cSRui Paulo int (*driver_cmd)(void *priv, char *cmd, char *buf, size_t buf_len);
43545b9c547cSRui Paulo #endif /* ANDROID */
43555b9c547cSRui Paulo
43565b9c547cSRui Paulo /**
43575b9c547cSRui Paulo * vendor_cmd - Execute vendor specific command
43585b9c547cSRui Paulo * @priv: Private driver interface data
43595b9c547cSRui Paulo * @vendor_id: Vendor id
43605b9c547cSRui Paulo * @subcmd: Vendor command id
4361c1d255d3SCy Schubert * @nested_attr_flag: Specifies if vendor subcommand uses nested
4362c1d255d3SCy Schubert * attributes or not
43635b9c547cSRui Paulo * @data: Vendor command parameters (%NULL if no parameters)
43645b9c547cSRui Paulo * @data_len: Data length
43655b9c547cSRui Paulo * @buf: Return buffer (%NULL to ignore reply)
43665b9c547cSRui Paulo * Returns: 0 on success, negative (<0) on failure
43675b9c547cSRui Paulo *
43685b9c547cSRui Paulo * This function handles vendor specific commands that are passed to
43695b9c547cSRui Paulo * the driver/device. The command is identified by vendor id and
4370c1d255d3SCy Schubert * command id. The nested_attr_flag specifies whether the subcommand
4371c1d255d3SCy Schubert * uses nested attributes or not. Parameters can be passed
4372c1d255d3SCy Schubert * as argument to the command in the data buffer. Reply (if any) will be
4373c1d255d3SCy Schubert * filled in the supplied return buffer.
43745b9c547cSRui Paulo *
43755b9c547cSRui Paulo * The exact driver behavior is driver interface and vendor specific. As
43765b9c547cSRui Paulo * an example, this will be converted to a vendor specific cfg80211
43775b9c547cSRui Paulo * command in case of the nl80211 driver interface.
43785b9c547cSRui Paulo */
43795b9c547cSRui Paulo int (*vendor_cmd)(void *priv, unsigned int vendor_id,
43805b9c547cSRui Paulo unsigned int subcmd, const u8 *data, size_t data_len,
4381c1d255d3SCy Schubert enum nested_attr nested_attr_flag,
43825b9c547cSRui Paulo struct wpabuf *buf);
43835b9c547cSRui Paulo
4384f05cddf9SRui Paulo /**
4385f05cddf9SRui Paulo * set_rekey_info - Set rekey information
4386f05cddf9SRui Paulo * @priv: Private driver interface data
4387f05cddf9SRui Paulo * @kek: Current KEK
43885b9c547cSRui Paulo * @kek_len: KEK length in octets
4389f05cddf9SRui Paulo * @kck: Current KCK
43905b9c547cSRui Paulo * @kck_len: KCK length in octets
4391f05cddf9SRui Paulo * @replay_ctr: Current EAPOL-Key Replay Counter
4392f05cddf9SRui Paulo *
4393f05cddf9SRui Paulo * This optional function can be used to provide information for the
4394f05cddf9SRui Paulo * driver/firmware to process EAPOL-Key frames in Group Key Handshake
4395f05cddf9SRui Paulo * while the host (including wpa_supplicant) is sleeping.
4396f05cddf9SRui Paulo */
43975b9c547cSRui Paulo void (*set_rekey_info)(void *priv, const u8 *kek, size_t kek_len,
43985b9c547cSRui Paulo const u8 *kck, size_t kck_len,
4399f05cddf9SRui Paulo const u8 *replay_ctr);
4400f05cddf9SRui Paulo
4401f05cddf9SRui Paulo /**
4402f05cddf9SRui Paulo * sta_assoc - Station association indication
4403f05cddf9SRui Paulo * @priv: Private driver interface data
4404f05cddf9SRui Paulo * @own_addr: Source address and BSSID for association frame
4405f05cddf9SRui Paulo * @addr: MAC address of the station to associate
4406f05cddf9SRui Paulo * @reassoc: flag to indicate re-association
4407f05cddf9SRui Paulo * @status: association response status code
4408f05cddf9SRui Paulo * @ie: assoc response ie buffer
4409f05cddf9SRui Paulo * @len: ie buffer length
4410f05cddf9SRui Paulo * Returns: 0 on success, -1 on failure
4411f05cddf9SRui Paulo *
4412f05cddf9SRui Paulo * This function indicates the driver to send (Re)Association
4413f05cddf9SRui Paulo * Response frame to the station.
4414f05cddf9SRui Paulo */
4415f05cddf9SRui Paulo int (*sta_assoc)(void *priv, const u8 *own_addr, const u8 *addr,
4416f05cddf9SRui Paulo int reassoc, u16 status, const u8 *ie, size_t len);
4417f05cddf9SRui Paulo
4418f05cddf9SRui Paulo /**
4419f05cddf9SRui Paulo * sta_auth - Station authentication indication
442085732ac8SCy Schubert * @priv: private driver interface data
442185732ac8SCy Schubert * @params: Station authentication parameters
4422f05cddf9SRui Paulo *
442385732ac8SCy Schubert * Returns: 0 on success, -1 on failure
4424f05cddf9SRui Paulo */
442585732ac8SCy Schubert int (*sta_auth)(void *priv,
442685732ac8SCy Schubert struct wpa_driver_sta_auth_params *params);
4427f05cddf9SRui Paulo
4428f05cddf9SRui Paulo /**
4429f05cddf9SRui Paulo * add_tspec - Add traffic stream
4430f05cddf9SRui Paulo * @priv: Private driver interface data
4431f05cddf9SRui Paulo * @addr: MAC address of the station to associate
4432f05cddf9SRui Paulo * @tspec_ie: tspec ie buffer
4433f05cddf9SRui Paulo * @tspec_ielen: tspec ie length
4434f05cddf9SRui Paulo * Returns: 0 on success, -1 on failure
4435f05cddf9SRui Paulo *
4436f05cddf9SRui Paulo * This function adds the traffic steam for the station
4437f05cddf9SRui Paulo * and fills the medium_time in tspec_ie.
4438f05cddf9SRui Paulo */
4439f05cddf9SRui Paulo int (*add_tspec)(void *priv, const u8 *addr, u8 *tspec_ie,
4440f05cddf9SRui Paulo size_t tspec_ielen);
4441f05cddf9SRui Paulo
4442f05cddf9SRui Paulo /**
4443f05cddf9SRui Paulo * add_sta_node - Add a station node in the driver
4444f05cddf9SRui Paulo * @priv: Private driver interface data
4445f05cddf9SRui Paulo * @addr: MAC address of the station to add
4446f05cddf9SRui Paulo * @auth_alg: authentication algorithm used by the station
4447f05cddf9SRui Paulo * Returns: 0 on success, -1 on failure
4448f05cddf9SRui Paulo *
4449f05cddf9SRui Paulo * This function adds the station node in the driver, when
4450f05cddf9SRui Paulo * the station gets added by FT-over-DS.
4451f05cddf9SRui Paulo */
4452f05cddf9SRui Paulo int (*add_sta_node)(void *priv, const u8 *addr, u16 auth_alg);
4453f05cddf9SRui Paulo
4454f05cddf9SRui Paulo /**
4455f05cddf9SRui Paulo * sched_scan - Request the driver to initiate scheduled scan
4456f05cddf9SRui Paulo * @priv: Private driver interface data
4457f05cddf9SRui Paulo * @params: Scan parameters
4458f05cddf9SRui Paulo * Returns: 0 on success, -1 on failure
4459f05cddf9SRui Paulo *
4460f05cddf9SRui Paulo * This operation should be used for scheduled scan offload to
4461f05cddf9SRui Paulo * the hardware. Every time scan results are available, the
4462f05cddf9SRui Paulo * driver should report scan results event for wpa_supplicant
4463f05cddf9SRui Paulo * which will eventually request the results with
4464f05cddf9SRui Paulo * wpa_driver_get_scan_results2(). This operation is optional
4465f05cddf9SRui Paulo * and if not provided or if it returns -1, we fall back to
4466f05cddf9SRui Paulo * normal host-scheduled scans.
4467f05cddf9SRui Paulo */
4468780fb4a2SCy Schubert int (*sched_scan)(void *priv, struct wpa_driver_scan_params *params);
4469f05cddf9SRui Paulo
4470f05cddf9SRui Paulo /**
4471f05cddf9SRui Paulo * stop_sched_scan - Request the driver to stop a scheduled scan
4472f05cddf9SRui Paulo * @priv: Private driver interface data
4473f05cddf9SRui Paulo * Returns: 0 on success, -1 on failure
4474f05cddf9SRui Paulo *
4475f05cddf9SRui Paulo * This should cause the scheduled scan to be stopped and
4476f05cddf9SRui Paulo * results should stop being sent. Must be supported if
4477f05cddf9SRui Paulo * sched_scan is supported.
4478f05cddf9SRui Paulo */
4479f05cddf9SRui Paulo int (*stop_sched_scan)(void *priv);
4480f05cddf9SRui Paulo
4481f05cddf9SRui Paulo /**
4482f05cddf9SRui Paulo * poll_client - Probe (null data or such) the given station
4483f05cddf9SRui Paulo * @priv: Private driver interface data
4484f05cddf9SRui Paulo * @own_addr: MAC address of sending interface
4485f05cddf9SRui Paulo * @addr: MAC address of the station to probe
4486f05cddf9SRui Paulo * @qos: Indicates whether station is QoS station
4487f05cddf9SRui Paulo *
4488f05cddf9SRui Paulo * This function is used to verify whether an associated station is
4489f05cddf9SRui Paulo * still present. This function does not need to be implemented if the
4490f05cddf9SRui Paulo * driver provides such inactivity polling mechanism.
4491f05cddf9SRui Paulo */
4492f05cddf9SRui Paulo void (*poll_client)(void *priv, const u8 *own_addr,
4493f05cddf9SRui Paulo const u8 *addr, int qos);
4494f05cddf9SRui Paulo
4495f05cddf9SRui Paulo /**
4496f05cddf9SRui Paulo * radio_disable - Disable/enable radio
4497f05cddf9SRui Paulo * @priv: Private driver interface data
4498f05cddf9SRui Paulo * @disabled: 1=disable 0=enable radio
4499f05cddf9SRui Paulo * Returns: 0 on success, -1 on failure
4500f05cddf9SRui Paulo *
4501f05cddf9SRui Paulo * This optional command is for testing purposes. It can be used to
4502f05cddf9SRui Paulo * disable the radio on a testbed device to simulate out-of-radio-range
4503f05cddf9SRui Paulo * conditions.
4504f05cddf9SRui Paulo */
4505f05cddf9SRui Paulo int (*radio_disable)(void *priv, int disabled);
4506f05cddf9SRui Paulo
4507f05cddf9SRui Paulo /**
4508f05cddf9SRui Paulo * switch_channel - Announce channel switch and migrate the GO to the
4509f05cddf9SRui Paulo * given frequency
4510f05cddf9SRui Paulo * @priv: Private driver interface data
45115b9c547cSRui Paulo * @settings: Settings for CSA period and new channel
4512f05cddf9SRui Paulo * Returns: 0 on success, -1 on failure
4513f05cddf9SRui Paulo *
4514f05cddf9SRui Paulo * This function is used to move the GO to the legacy STA channel to
4515f05cddf9SRui Paulo * avoid frequency conflict in single channel concurrency.
4516f05cddf9SRui Paulo */
45175b9c547cSRui Paulo int (*switch_channel)(void *priv, struct csa_settings *settings);
45185b9c547cSRui Paulo
45195b9c547cSRui Paulo /**
4520*a90b9d01SCy Schubert * switch_color - Announce color switch and migrate the BSS to the
4521*a90b9d01SCy Schubert * given color
4522*a90b9d01SCy Schubert * @priv: Private driver interface data
4523*a90b9d01SCy Schubert * @settings: Settings for CCA period and new color
4524*a90b9d01SCy Schubert * Returns: 0 on success, -1 on failure
4525*a90b9d01SCy Schubert *
4526*a90b9d01SCy Schubert * This function is used to move the BSS to its new color.
4527*a90b9d01SCy Schubert */
4528*a90b9d01SCy Schubert int (*switch_color)(void *priv, struct cca_settings *settings);
4529*a90b9d01SCy Schubert
4530*a90b9d01SCy Schubert /**
45315b9c547cSRui Paulo * add_tx_ts - Add traffic stream
45325b9c547cSRui Paulo * @priv: Private driver interface data
45335b9c547cSRui Paulo * @tsid: Traffic stream ID
45345b9c547cSRui Paulo * @addr: Receiver address
45355b9c547cSRui Paulo * @user_prio: User priority of the traffic stream
45365b9c547cSRui Paulo * @admitted_time: Admitted time for this TS in units of
45375b9c547cSRui Paulo * 32 microsecond periods (per second).
45385b9c547cSRui Paulo * Returns: 0 on success, -1 on failure
45395b9c547cSRui Paulo */
45405b9c547cSRui Paulo int (*add_tx_ts)(void *priv, u8 tsid, const u8 *addr, u8 user_prio,
45415b9c547cSRui Paulo u16 admitted_time);
45425b9c547cSRui Paulo
45435b9c547cSRui Paulo /**
45445b9c547cSRui Paulo * del_tx_ts - Delete traffic stream
45455b9c547cSRui Paulo * @priv: Private driver interface data
45465b9c547cSRui Paulo * @tsid: Traffic stream ID
45475b9c547cSRui Paulo * @addr: Receiver address
45485b9c547cSRui Paulo * Returns: 0 on success, -1 on failure
45495b9c547cSRui Paulo */
45505b9c547cSRui Paulo int (*del_tx_ts)(void *priv, u8 tsid, const u8 *addr);
45515b9c547cSRui Paulo
45525b9c547cSRui Paulo /**
45535b9c547cSRui Paulo * Enable channel-switching with TDLS peer
45545b9c547cSRui Paulo * @priv: Private driver interface data
45555b9c547cSRui Paulo * @addr: MAC address of the TDLS peer
45565b9c547cSRui Paulo * @oper_class: Operating class of the switch channel
45575b9c547cSRui Paulo * @params: Channel specification
45585b9c547cSRui Paulo * Returns: 0 on success, -1 on failure
45595b9c547cSRui Paulo *
45605b9c547cSRui Paulo * The function indicates to driver that it can start switching to a
45615b9c547cSRui Paulo * different channel with a specified TDLS peer. The switching is
45625b9c547cSRui Paulo * assumed on until canceled with tdls_disable_channel_switch().
45635b9c547cSRui Paulo */
45645b9c547cSRui Paulo int (*tdls_enable_channel_switch)(
45655b9c547cSRui Paulo void *priv, const u8 *addr, u8 oper_class,
45665b9c547cSRui Paulo const struct hostapd_freq_params *params);
45675b9c547cSRui Paulo
45685b9c547cSRui Paulo /**
45695b9c547cSRui Paulo * Disable channel switching with TDLS peer
45705b9c547cSRui Paulo * @priv: Private driver interface data
45715b9c547cSRui Paulo * @addr: MAC address of the TDLS peer
45725b9c547cSRui Paulo * Returns: 0 on success, -1 on failure
45735b9c547cSRui Paulo *
45745b9c547cSRui Paulo * This function indicates to the driver that it should stop switching
45755b9c547cSRui Paulo * with a given TDLS peer.
45765b9c547cSRui Paulo */
45775b9c547cSRui Paulo int (*tdls_disable_channel_switch)(void *priv, const u8 *addr);
45785b9c547cSRui Paulo
45795b9c547cSRui Paulo /**
45805b9c547cSRui Paulo * start_dfs_cac - Listen for radar interference on the channel
45815b9c547cSRui Paulo * @priv: Private driver interface data
45825b9c547cSRui Paulo * @freq: Channel parameters
45835b9c547cSRui Paulo * Returns: 0 on success, -1 on failure
45845b9c547cSRui Paulo */
45855b9c547cSRui Paulo int (*start_dfs_cac)(void *priv, struct hostapd_freq_params *freq);
45865b9c547cSRui Paulo
45875b9c547cSRui Paulo /**
45885b9c547cSRui Paulo * stop_ap - Removes beacon from AP
45895b9c547cSRui Paulo * @priv: Private driver interface data
4590*a90b9d01SCy Schubert * @link_id: Link ID of the specified link; -1 for non-MLD
45915b9c547cSRui Paulo * Returns: 0 on success, -1 on failure (or if not supported)
45925b9c547cSRui Paulo *
45935b9c547cSRui Paulo * This optional function can be used to disable AP mode related
45945b9c547cSRui Paulo * configuration. Unlike deinit_ap, it does not change to station
45955b9c547cSRui Paulo * mode.
45965b9c547cSRui Paulo */
4597*a90b9d01SCy Schubert int (*stop_ap)(void *priv, int link_id);
45985b9c547cSRui Paulo
45995b9c547cSRui Paulo /**
46005b9c547cSRui Paulo * get_survey - Retrieve survey data
46015b9c547cSRui Paulo * @priv: Private driver interface data
46025b9c547cSRui Paulo * @freq: If set, survey data for the specified frequency is only
46035b9c547cSRui Paulo * being requested. If not set, all survey data is requested.
46045b9c547cSRui Paulo * Returns: 0 on success, -1 on failure
46055b9c547cSRui Paulo *
46065b9c547cSRui Paulo * Use this to retrieve:
46075b9c547cSRui Paulo *
46085b9c547cSRui Paulo * - the observed channel noise floor
46095b9c547cSRui Paulo * - the amount of time we have spent on the channel
46105b9c547cSRui Paulo * - the amount of time during which we have spent on the channel that
46115b9c547cSRui Paulo * the radio has determined the medium is busy and we cannot
46125b9c547cSRui Paulo * transmit
46135b9c547cSRui Paulo * - the amount of time we have spent receiving data
46145b9c547cSRui Paulo * - the amount of time we have spent transmitting data
46155b9c547cSRui Paulo *
46165b9c547cSRui Paulo * This data can be used for spectrum heuristics. One example is
46175b9c547cSRui Paulo * Automatic Channel Selection (ACS). The channel survey data is
46185b9c547cSRui Paulo * kept on a linked list on the channel data, one entry is added
46195b9c547cSRui Paulo * for each survey. The min_nf of the channel is updated for each
46205b9c547cSRui Paulo * survey.
46215b9c547cSRui Paulo */
46225b9c547cSRui Paulo int (*get_survey)(void *priv, unsigned int freq);
46235b9c547cSRui Paulo
46245b9c547cSRui Paulo /**
46255b9c547cSRui Paulo * status - Get driver interface status information
46265b9c547cSRui Paulo * @priv: Private driver interface data
46274bc52338SCy Schubert * @buf: Buffer for printing the status information
46285b9c547cSRui Paulo * @buflen: Maximum length of the buffer
46295b9c547cSRui Paulo * Returns: Length of written status information or -1 on failure
46305b9c547cSRui Paulo */
46315b9c547cSRui Paulo int (*status)(void *priv, char *buf, size_t buflen);
46325b9c547cSRui Paulo
46335b9c547cSRui Paulo /**
46345b9c547cSRui Paulo * roaming - Set roaming policy for driver-based BSS selection
46355b9c547cSRui Paulo * @priv: Private driver interface data
46365b9c547cSRui Paulo * @allowed: Whether roaming within ESS is allowed
46375b9c547cSRui Paulo * @bssid: Forced BSSID if roaming is disabled or %NULL if not set
46385b9c547cSRui Paulo * Returns: Length of written status information or -1 on failure
46395b9c547cSRui Paulo *
46405b9c547cSRui Paulo * This optional callback can be used to update roaming policy from the
46415b9c547cSRui Paulo * associate() command (bssid being set there indicates that the driver
46425b9c547cSRui Paulo * should not roam before getting this roaming() call to allow roaming.
46435b9c547cSRui Paulo * If the driver does not indicate WPA_DRIVER_FLAGS_BSS_SELECTION
46445b9c547cSRui Paulo * capability, roaming policy is handled within wpa_supplicant and there
46455b9c547cSRui Paulo * is no need to implement or react to this callback.
46465b9c547cSRui Paulo */
46475b9c547cSRui Paulo int (*roaming)(void *priv, int allowed, const u8 *bssid);
46485b9c547cSRui Paulo
46495b9c547cSRui Paulo /**
465085732ac8SCy Schubert * disable_fils - Enable/disable FILS feature
465185732ac8SCy Schubert * @priv: Private driver interface data
465285732ac8SCy Schubert * @disable: 0-enable and 1-disable FILS feature
465385732ac8SCy Schubert * Returns: 0 on success, -1 on failure
465485732ac8SCy Schubert *
465585732ac8SCy Schubert * This callback can be used to configure driver and below layers to
465685732ac8SCy Schubert * enable/disable all FILS features.
465785732ac8SCy Schubert */
465885732ac8SCy Schubert int (*disable_fils)(void *priv, int disable);
465985732ac8SCy Schubert
466085732ac8SCy Schubert /**
46615b9c547cSRui Paulo * set_mac_addr - Set MAC address
46625b9c547cSRui Paulo * @priv: Private driver interface data
46635b9c547cSRui Paulo * @addr: MAC address to use or %NULL for setting back to permanent
46645b9c547cSRui Paulo * Returns: 0 on success, -1 on failure
46655b9c547cSRui Paulo */
46665b9c547cSRui Paulo int (*set_mac_addr)(void *priv, const u8 *addr);
46675b9c547cSRui Paulo
46685b9c547cSRui Paulo #ifdef CONFIG_MACSEC
46695b9c547cSRui Paulo int (*macsec_init)(void *priv, struct macsec_init_params *params);
46705b9c547cSRui Paulo
46715b9c547cSRui Paulo int (*macsec_deinit)(void *priv);
46725b9c547cSRui Paulo
46735b9c547cSRui Paulo /**
467485732ac8SCy Schubert * macsec_get_capability - Inform MKA of this driver's capability
467585732ac8SCy Schubert * @priv: Private driver interface data
467685732ac8SCy Schubert * @cap: Driver's capability
467785732ac8SCy Schubert * Returns: 0 on success, -1 on failure
467885732ac8SCy Schubert */
467985732ac8SCy Schubert int (*macsec_get_capability)(void *priv, enum macsec_cap *cap);
468085732ac8SCy Schubert
468185732ac8SCy Schubert /**
46825b9c547cSRui Paulo * enable_protect_frames - Set protect frames status
46835b9c547cSRui Paulo * @priv: Private driver interface data
4684c1d255d3SCy Schubert * @enabled: true = protect frames enabled
4685c1d255d3SCy Schubert * false = protect frames disabled
46865b9c547cSRui Paulo * Returns: 0 on success, -1 on failure (or if not supported)
46875b9c547cSRui Paulo */
4688c1d255d3SCy Schubert int (*enable_protect_frames)(void *priv, bool enabled);
46895b9c547cSRui Paulo
46905b9c547cSRui Paulo /**
469185732ac8SCy Schubert * enable_encrypt - Set encryption status
469285732ac8SCy Schubert * @priv: Private driver interface data
4693c1d255d3SCy Schubert * @enabled: true = encrypt outgoing traffic
4694c1d255d3SCy Schubert * false = integrity-only protection on outgoing traffic
469585732ac8SCy Schubert * Returns: 0 on success, -1 on failure (or if not supported)
469685732ac8SCy Schubert */
4697c1d255d3SCy Schubert int (*enable_encrypt)(void *priv, bool enabled);
469885732ac8SCy Schubert
469985732ac8SCy Schubert /**
47005b9c547cSRui Paulo * set_replay_protect - Set replay protect status and window size
47015b9c547cSRui Paulo * @priv: Private driver interface data
4702c1d255d3SCy Schubert * @enabled: true = replay protect enabled
4703c1d255d3SCy Schubert * false = replay protect disabled
47045b9c547cSRui Paulo * @window: replay window size, valid only when replay protect enabled
47055b9c547cSRui Paulo * Returns: 0 on success, -1 on failure (or if not supported)
47065b9c547cSRui Paulo */
4707c1d255d3SCy Schubert int (*set_replay_protect)(void *priv, bool enabled, u32 window);
47085b9c547cSRui Paulo
47095b9c547cSRui Paulo /**
4710*a90b9d01SCy Schubert * set_offload - Set MACsec hardware offload
4711*a90b9d01SCy Schubert * @priv: Private driver interface data
4712*a90b9d01SCy Schubert * @offload: 0 = MACSEC_OFFLOAD_OFF
4713*a90b9d01SCy Schubert * 1 = MACSEC_OFFLOAD_PHY
4714*a90b9d01SCy Schubert * 2 = MACSEC_OFFLOAD_MAC
4715*a90b9d01SCy Schubert * Returns: 0 on success, -1 on failure (or if not supported)
4716*a90b9d01SCy Schubert */
4717*a90b9d01SCy Schubert int (*set_offload)(void *priv, u8 offload);
4718*a90b9d01SCy Schubert
4719*a90b9d01SCy Schubert /**
47205b9c547cSRui Paulo * set_current_cipher_suite - Set current cipher suite
47215b9c547cSRui Paulo * @priv: Private driver interface data
47225b9c547cSRui Paulo * @cs: EUI64 identifier
47235b9c547cSRui Paulo * Returns: 0 on success, -1 on failure (or if not supported)
47245b9c547cSRui Paulo */
4725780fb4a2SCy Schubert int (*set_current_cipher_suite)(void *priv, u64 cs);
47265b9c547cSRui Paulo
47275b9c547cSRui Paulo /**
47285b9c547cSRui Paulo * enable_controlled_port - Set controlled port status
47295b9c547cSRui Paulo * @priv: Private driver interface data
4730c1d255d3SCy Schubert * @enabled: true = controlled port enabled
4731c1d255d3SCy Schubert * false = controlled port disabled
47325b9c547cSRui Paulo * Returns: 0 on success, -1 on failure (or if not supported)
47335b9c547cSRui Paulo */
4734c1d255d3SCy Schubert int (*enable_controlled_port)(void *priv, bool enabled);
47355b9c547cSRui Paulo
47365b9c547cSRui Paulo /**
47375b9c547cSRui Paulo * get_receive_lowest_pn - Get receive lowest pn
47385b9c547cSRui Paulo * @priv: Private driver interface data
473985732ac8SCy Schubert * @sa: secure association
47405b9c547cSRui Paulo * Returns: 0 on success, -1 on failure (or if not supported)
47415b9c547cSRui Paulo */
474285732ac8SCy Schubert int (*get_receive_lowest_pn)(void *priv, struct receive_sa *sa);
47435b9c547cSRui Paulo
47445b9c547cSRui Paulo /**
47455b9c547cSRui Paulo * get_transmit_next_pn - Get transmit next pn
47465b9c547cSRui Paulo * @priv: Private driver interface data
474785732ac8SCy Schubert * @sa: secure association
47485b9c547cSRui Paulo * Returns: 0 on success, -1 on failure (or if not supported)
47495b9c547cSRui Paulo */
475085732ac8SCy Schubert int (*get_transmit_next_pn)(void *priv, struct transmit_sa *sa);
47515b9c547cSRui Paulo
47525b9c547cSRui Paulo /**
47535b9c547cSRui Paulo * set_transmit_next_pn - Set transmit next pn
47545b9c547cSRui Paulo * @priv: Private driver interface data
475585732ac8SCy Schubert * @sa: secure association
47565b9c547cSRui Paulo * Returns: 0 on success, -1 on failure (or if not supported)
47575b9c547cSRui Paulo */
475885732ac8SCy Schubert int (*set_transmit_next_pn)(void *priv, struct transmit_sa *sa);
47595b9c547cSRui Paulo
47605b9c547cSRui Paulo /**
47614bc52338SCy Schubert * set_receive_lowest_pn - Set receive lowest PN
47624bc52338SCy Schubert * @priv: Private driver interface data
47634bc52338SCy Schubert * @sa: secure association
47644bc52338SCy Schubert * Returns: 0 on success, -1 on failure (or if not supported)
47654bc52338SCy Schubert */
47664bc52338SCy Schubert int (*set_receive_lowest_pn)(void *priv, struct receive_sa *sa);
47674bc52338SCy Schubert
47684bc52338SCy Schubert /**
47695b9c547cSRui Paulo * create_receive_sc - create secure channel for receiving
47705b9c547cSRui Paulo * @priv: Private driver interface data
477185732ac8SCy Schubert * @sc: secure channel
47725b9c547cSRui Paulo * @conf_offset: confidentiality offset (0, 30, or 50)
47735b9c547cSRui Paulo * @validation: frame validation policy (0 = Disabled, 1 = Checked,
47745b9c547cSRui Paulo * 2 = Strict)
47755b9c547cSRui Paulo * Returns: 0 on success, -1 on failure (or if not supported)
47765b9c547cSRui Paulo */
477785732ac8SCy Schubert int (*create_receive_sc)(void *priv, struct receive_sc *sc,
477885732ac8SCy Schubert unsigned int conf_offset,
47795b9c547cSRui Paulo int validation);
47805b9c547cSRui Paulo
47815b9c547cSRui Paulo /**
47825b9c547cSRui Paulo * delete_receive_sc - delete secure connection for receiving
47835b9c547cSRui Paulo * @priv: private driver interface data from init()
478485732ac8SCy Schubert * @sc: secure channel
47855b9c547cSRui Paulo * Returns: 0 on success, -1 on failure
47865b9c547cSRui Paulo */
478785732ac8SCy Schubert int (*delete_receive_sc)(void *priv, struct receive_sc *sc);
47885b9c547cSRui Paulo
47895b9c547cSRui Paulo /**
47905b9c547cSRui Paulo * create_receive_sa - create secure association for receive
47915b9c547cSRui Paulo * @priv: private driver interface data from init()
479285732ac8SCy Schubert * @sa: secure association
47935b9c547cSRui Paulo * Returns: 0 on success, -1 on failure
47945b9c547cSRui Paulo */
479585732ac8SCy Schubert int (*create_receive_sa)(void *priv, struct receive_sa *sa);
479685732ac8SCy Schubert
479785732ac8SCy Schubert /**
479885732ac8SCy Schubert * delete_receive_sa - Delete secure association for receive
479985732ac8SCy Schubert * @priv: Private driver interface data from init()
480085732ac8SCy Schubert * @sa: Secure association
480185732ac8SCy Schubert * Returns: 0 on success, -1 on failure
480285732ac8SCy Schubert */
480385732ac8SCy Schubert int (*delete_receive_sa)(void *priv, struct receive_sa *sa);
48045b9c547cSRui Paulo
48055b9c547cSRui Paulo /**
48065b9c547cSRui Paulo * enable_receive_sa - enable the SA for receive
48075b9c547cSRui Paulo * @priv: private driver interface data from init()
480885732ac8SCy Schubert * @sa: secure association
48095b9c547cSRui Paulo * Returns: 0 on success, -1 on failure
48105b9c547cSRui Paulo */
481185732ac8SCy Schubert int (*enable_receive_sa)(void *priv, struct receive_sa *sa);
48125b9c547cSRui Paulo
48135b9c547cSRui Paulo /**
48145b9c547cSRui Paulo * disable_receive_sa - disable SA for receive
48155b9c547cSRui Paulo * @priv: private driver interface data from init()
481685732ac8SCy Schubert * @sa: secure association
48175b9c547cSRui Paulo * Returns: 0 on success, -1 on failure
48185b9c547cSRui Paulo */
481985732ac8SCy Schubert int (*disable_receive_sa)(void *priv, struct receive_sa *sa);
48205b9c547cSRui Paulo
48215b9c547cSRui Paulo /**
48225b9c547cSRui Paulo * create_transmit_sc - create secure connection for transmit
48235b9c547cSRui Paulo * @priv: private driver interface data from init()
482485732ac8SCy Schubert * @sc: secure channel
482585732ac8SCy Schubert * @conf_offset: confidentiality offset (0, 30, or 50)
48265b9c547cSRui Paulo * Returns: 0 on success, -1 on failure
48275b9c547cSRui Paulo */
482885732ac8SCy Schubert int (*create_transmit_sc)(void *priv, struct transmit_sc *sc,
482985732ac8SCy Schubert unsigned int conf_offset);
48305b9c547cSRui Paulo
48315b9c547cSRui Paulo /**
48325b9c547cSRui Paulo * delete_transmit_sc - delete secure connection for transmit
48335b9c547cSRui Paulo * @priv: private driver interface data from init()
483485732ac8SCy Schubert * @sc: secure channel
48355b9c547cSRui Paulo * Returns: 0 on success, -1 on failure
48365b9c547cSRui Paulo */
483785732ac8SCy Schubert int (*delete_transmit_sc)(void *priv, struct transmit_sc *sc);
48385b9c547cSRui Paulo
48395b9c547cSRui Paulo /**
48405b9c547cSRui Paulo * create_transmit_sa - create secure association for transmit
48415b9c547cSRui Paulo * @priv: private driver interface data from init()
484285732ac8SCy Schubert * @sa: secure association
48435b9c547cSRui Paulo * Returns: 0 on success, -1 on failure
48445b9c547cSRui Paulo */
484585732ac8SCy Schubert int (*create_transmit_sa)(void *priv, struct transmit_sa *sa);
484685732ac8SCy Schubert
484785732ac8SCy Schubert /**
484885732ac8SCy Schubert * delete_transmit_sa - Delete secure association for transmit
484985732ac8SCy Schubert * @priv: Private driver interface data from init()
485085732ac8SCy Schubert * @sa: Secure association
485185732ac8SCy Schubert * Returns: 0 on success, -1 on failure
485285732ac8SCy Schubert */
485385732ac8SCy Schubert int (*delete_transmit_sa)(void *priv, struct transmit_sa *sa);
48545b9c547cSRui Paulo
48555b9c547cSRui Paulo /**
48565b9c547cSRui Paulo * enable_transmit_sa - enable SA for transmit
48575b9c547cSRui Paulo * @priv: private driver interface data from init()
485885732ac8SCy Schubert * @sa: secure association
48595b9c547cSRui Paulo * Returns: 0 on success, -1 on failure
48605b9c547cSRui Paulo */
486185732ac8SCy Schubert int (*enable_transmit_sa)(void *priv, struct transmit_sa *sa);
48625b9c547cSRui Paulo
48635b9c547cSRui Paulo /**
48645b9c547cSRui Paulo * disable_transmit_sa - disable SA for transmit
48655b9c547cSRui Paulo * @priv: private driver interface data from init()
486685732ac8SCy Schubert * @sa: secure association
48675b9c547cSRui Paulo * Returns: 0 on success, -1 on failure
48685b9c547cSRui Paulo */
486985732ac8SCy Schubert int (*disable_transmit_sa)(void *priv, struct transmit_sa *sa);
48705b9c547cSRui Paulo #endif /* CONFIG_MACSEC */
48715b9c547cSRui Paulo
48725b9c547cSRui Paulo /**
48735b9c547cSRui Paulo * init_mesh - Driver specific initialization for mesh
48745b9c547cSRui Paulo * @priv: Private driver interface data
48755b9c547cSRui Paulo * Returns: 0 on success, -1 on failure
48765b9c547cSRui Paulo */
48775b9c547cSRui Paulo int (*init_mesh)(void *priv);
48785b9c547cSRui Paulo
48795b9c547cSRui Paulo /**
48805b9c547cSRui Paulo * join_mesh - Join a mesh network
48815b9c547cSRui Paulo * @priv: Private driver interface data
48825b9c547cSRui Paulo * @params: Mesh configuration parameters
48835b9c547cSRui Paulo * Returns: 0 on success, -1 on failure
48845b9c547cSRui Paulo */
48855b9c547cSRui Paulo int (*join_mesh)(void *priv,
48865b9c547cSRui Paulo struct wpa_driver_mesh_join_params *params);
48875b9c547cSRui Paulo
48885b9c547cSRui Paulo /**
48895b9c547cSRui Paulo * leave_mesh - Leave a mesh network
48905b9c547cSRui Paulo * @priv: Private driver interface data
48915b9c547cSRui Paulo * Returns 0 on success, -1 on failure
48925b9c547cSRui Paulo */
48935b9c547cSRui Paulo int (*leave_mesh)(void *priv);
48945b9c547cSRui Paulo
48955b9c547cSRui Paulo /**
4896206b73d0SCy Schubert * probe_mesh_link - Inject a frame over direct mesh link to a given
4897206b73d0SCy Schubert * peer skipping the next_hop lookup from mpath table.
4898206b73d0SCy Schubert * @priv: Private driver interface data
4899206b73d0SCy Schubert * @addr: Peer MAC address
4900206b73d0SCy Schubert * @eth: Ethernet frame to be sent
4901206b73d0SCy Schubert * @len: Ethernet frame lengtn in bytes
4902206b73d0SCy Schubert * Returns 0 on success, -1 on failure
4903206b73d0SCy Schubert */
4904206b73d0SCy Schubert int (*probe_mesh_link)(void *priv, const u8 *addr, const u8 *eth,
4905206b73d0SCy Schubert size_t len);
4906206b73d0SCy Schubert
4907206b73d0SCy Schubert /**
49085b9c547cSRui Paulo * do_acs - Automatically select channel
49095b9c547cSRui Paulo * @priv: Private driver interface data
49105b9c547cSRui Paulo * @params: Parameters for ACS
49115b9c547cSRui Paulo * Returns 0 on success, -1 on failure
49125b9c547cSRui Paulo *
49135b9c547cSRui Paulo * This command can be used to offload ACS to the driver if the driver
49145b9c547cSRui Paulo * indicates support for such offloading (WPA_DRIVER_FLAGS_ACS_OFFLOAD).
49155b9c547cSRui Paulo */
49165b9c547cSRui Paulo int (*do_acs)(void *priv, struct drv_acs_params *params);
4917325151a3SRui Paulo
4918325151a3SRui Paulo /**
4919c1d255d3SCy Schubert * set_band - Notify driver of band(s) selection
4920325151a3SRui Paulo * @priv: Private driver interface data
4921c1d255d3SCy Schubert * @band_mask: The selected band(s) bit mask (from enum set_band)
4922325151a3SRui Paulo * Returns 0 on success, -1 on failure
4923325151a3SRui Paulo */
4924c1d255d3SCy Schubert int (*set_band)(void *priv, u32 band_mask);
4925325151a3SRui Paulo
4926325151a3SRui Paulo /**
4927325151a3SRui Paulo * get_pref_freq_list - Get preferred frequency list for an interface
4928325151a3SRui Paulo * @priv: Private driver interface data
4929325151a3SRui Paulo * @if_type: Interface type
4930325151a3SRui Paulo * @num: Number of channels
4931*a90b9d01SCy Schubert * @freq_list: Weighted preferred channel list
4932325151a3SRui Paulo * Returns 0 on success, -1 on failure
4933325151a3SRui Paulo *
4934325151a3SRui Paulo * This command can be used to query the preferred frequency list from
4935*a90b9d01SCy Schubert * the driver specific to a particular interface type. The freq_list
4936*a90b9d01SCy Schubert * array needs to have room for *num entries. *num will be updated to
4937*a90b9d01SCy Schubert * indicate the number of entries fetched from the driver.
4938325151a3SRui Paulo */
4939325151a3SRui Paulo int (*get_pref_freq_list)(void *priv, enum wpa_driver_if_type if_type,
4940*a90b9d01SCy Schubert unsigned int *num,
4941*a90b9d01SCy Schubert struct weighted_pcl *freq_list);
4942325151a3SRui Paulo
4943325151a3SRui Paulo /**
4944325151a3SRui Paulo * set_prob_oper_freq - Indicate probable P2P operating channel
4945325151a3SRui Paulo * @priv: Private driver interface data
4946325151a3SRui Paulo * @freq: Channel frequency in MHz
4947325151a3SRui Paulo * Returns 0 on success, -1 on failure
4948325151a3SRui Paulo *
4949325151a3SRui Paulo * This command can be used to inform the driver of the operating
4950325151a3SRui Paulo * frequency that an ongoing P2P group formation is likely to come up
4951325151a3SRui Paulo * on. Local device is assuming P2P Client role.
4952325151a3SRui Paulo */
4953325151a3SRui Paulo int (*set_prob_oper_freq)(void *priv, unsigned int freq);
4954780fb4a2SCy Schubert
4955780fb4a2SCy Schubert /**
4956780fb4a2SCy Schubert * abort_scan - Request the driver to abort an ongoing scan
4957780fb4a2SCy Schubert * @priv: Private driver interface data
495885732ac8SCy Schubert * @scan_cookie: Cookie identifying the scan request. This is used only
495985732ac8SCy Schubert * when the vendor interface QCA_NL80211_VENDOR_SUBCMD_TRIGGER_SCAN
496085732ac8SCy Schubert * was used to trigger scan. Otherwise, 0 is used.
4961780fb4a2SCy Schubert * Returns 0 on success, -1 on failure
4962780fb4a2SCy Schubert */
496385732ac8SCy Schubert int (*abort_scan)(void *priv, u64 scan_cookie);
4964780fb4a2SCy Schubert
4965780fb4a2SCy Schubert /**
4966780fb4a2SCy Schubert * configure_data_frame_filters - Request to configure frame filters
4967780fb4a2SCy Schubert * @priv: Private driver interface data
4968780fb4a2SCy Schubert * @filter_flags: The type of frames to filter (bitfield of
4969780fb4a2SCy Schubert * WPA_DATA_FRAME_FILTER_FLAG_*)
4970780fb4a2SCy Schubert * Returns: 0 on success or -1 on failure
4971780fb4a2SCy Schubert */
4972780fb4a2SCy Schubert int (*configure_data_frame_filters)(void *priv, u32 filter_flags);
4973780fb4a2SCy Schubert
4974780fb4a2SCy Schubert /**
4975780fb4a2SCy Schubert * get_ext_capab - Get extended capabilities for the specified interface
4976780fb4a2SCy Schubert * @priv: Private driver interface data
4977780fb4a2SCy Schubert * @type: Interface type for which to get extended capabilities
4978780fb4a2SCy Schubert * @ext_capab: Extended capabilities fetched
4979780fb4a2SCy Schubert * @ext_capab_mask: Extended capabilities mask
4980780fb4a2SCy Schubert * @ext_capab_len: Length of the extended capabilities
4981780fb4a2SCy Schubert * Returns: 0 on success or -1 on failure
4982780fb4a2SCy Schubert */
4983780fb4a2SCy Schubert int (*get_ext_capab)(void *priv, enum wpa_driver_if_type type,
4984780fb4a2SCy Schubert const u8 **ext_capab, const u8 **ext_capab_mask,
4985780fb4a2SCy Schubert unsigned int *ext_capab_len);
4986780fb4a2SCy Schubert
4987780fb4a2SCy Schubert /**
4988*a90b9d01SCy Schubert * get_mld_capab - Get MLD capabilities for the specified interface
4989*a90b9d01SCy Schubert * @priv: Private driver interface data
4990*a90b9d01SCy Schubert * @type: Interface type for which to get MLD capabilities
4991*a90b9d01SCy Schubert * @eml_capa: EML capabilities
4992*a90b9d01SCy Schubert * @mld_capa_and_ops: MLD Capabilities and Operations
4993*a90b9d01SCy Schubert * Returns: 0 on success or -1 on failure
4994*a90b9d01SCy Schubert */
4995*a90b9d01SCy Schubert int (*get_mld_capab)(void *priv, enum wpa_driver_if_type type,
4996*a90b9d01SCy Schubert u16 *eml_capa, u16 *mld_capa_and_ops);
4997*a90b9d01SCy Schubert
4998*a90b9d01SCy Schubert /**
4999780fb4a2SCy Schubert * p2p_lo_start - Start offloading P2P listen to device
5000780fb4a2SCy Schubert * @priv: Private driver interface data
5001780fb4a2SCy Schubert * @freq: Listening frequency (MHz) for P2P listen
5002780fb4a2SCy Schubert * @period: Length of the listen operation in milliseconds
5003780fb4a2SCy Schubert * @interval: Interval for running the listen operation in milliseconds
5004780fb4a2SCy Schubert * @count: Number of times to run the listen operation
5005780fb4a2SCy Schubert * @device_types: Device primary and secondary types
5006780fb4a2SCy Schubert * @dev_types_len: Number of bytes for device_types
5007780fb4a2SCy Schubert * @ies: P2P IE and WSC IE for Probe Response frames
5008780fb4a2SCy Schubert * @ies_len: Length of ies in bytes
5009780fb4a2SCy Schubert * Returns: 0 on success or -1 on failure
5010780fb4a2SCy Schubert */
5011780fb4a2SCy Schubert int (*p2p_lo_start)(void *priv, unsigned int freq,
5012780fb4a2SCy Schubert unsigned int period, unsigned int interval,
5013780fb4a2SCy Schubert unsigned int count,
5014780fb4a2SCy Schubert const u8 *device_types, size_t dev_types_len,
5015780fb4a2SCy Schubert const u8 *ies, size_t ies_len);
5016780fb4a2SCy Schubert
5017780fb4a2SCy Schubert /**
5018780fb4a2SCy Schubert * p2p_lo_stop - Stop P2P listen offload
5019780fb4a2SCy Schubert * @priv: Private driver interface data
5020780fb4a2SCy Schubert * Returns: 0 on success or -1 on failure
5021780fb4a2SCy Schubert */
5022780fb4a2SCy Schubert int (*p2p_lo_stop)(void *priv);
5023780fb4a2SCy Schubert
5024780fb4a2SCy Schubert /**
5025780fb4a2SCy Schubert * set_default_scan_ies - Set default scan IEs
5026780fb4a2SCy Schubert * @priv: Private driver interface data
5027780fb4a2SCy Schubert * @ies: Scan default IEs buffer
5028780fb4a2SCy Schubert * @ies_len: Length of IEs in bytes
5029780fb4a2SCy Schubert * Returns: 0 on success or -1 on failure
5030780fb4a2SCy Schubert *
5031780fb4a2SCy Schubert * The driver can use these by default when there are no scan IEs coming
5032780fb4a2SCy Schubert * in the subsequent scan requests. Also in case of one or more of IEs
5033780fb4a2SCy Schubert * given in set_default_scan_ies() are missing in the subsequent scan
5034780fb4a2SCy Schubert * request, the driver should merge the missing scan IEs in the scan
5035780fb4a2SCy Schubert * request from the IEs set by set_default_scan_ies() in the Probe
5036780fb4a2SCy Schubert * Request frames sent.
5037780fb4a2SCy Schubert */
5038780fb4a2SCy Schubert int (*set_default_scan_ies)(void *priv, const u8 *ies, size_t ies_len);
5039780fb4a2SCy Schubert
504085732ac8SCy Schubert /**
504185732ac8SCy Schubert * set_tdls_mode - Set TDLS trigger mode to the host driver
504285732ac8SCy Schubert * @priv: Private driver interface data
504385732ac8SCy Schubert * @tdls_external_control: Represents if TDLS external trigger control
504485732ac8SCy Schubert * mode is enabled/disabled.
504585732ac8SCy Schubert *
504685732ac8SCy Schubert * This optional callback can be used to configure the TDLS external
504785732ac8SCy Schubert * trigger control mode to the host driver.
504885732ac8SCy Schubert */
504985732ac8SCy Schubert int (*set_tdls_mode)(void *priv, int tdls_external_control);
505039beb93cSSam Leffler
505185732ac8SCy Schubert /**
505285732ac8SCy Schubert * get_bss_transition_status - Get candidate BSS's transition status
505385732ac8SCy Schubert * @priv: Private driver interface data
505485732ac8SCy Schubert * @params: Candidate BSS list
505585732ac8SCy Schubert *
505685732ac8SCy Schubert * Get the accept or reject reason code for a list of BSS transition
505785732ac8SCy Schubert * candidates.
505885732ac8SCy Schubert */
505985732ac8SCy Schubert struct wpa_bss_candidate_info *
506085732ac8SCy Schubert (*get_bss_transition_status)(void *priv,
506185732ac8SCy Schubert struct wpa_bss_trans_info *params);
506285732ac8SCy Schubert /**
506385732ac8SCy Schubert * ignore_assoc_disallow - Configure driver to ignore assoc_disallow
506485732ac8SCy Schubert * @priv: Private driver interface data
506585732ac8SCy Schubert * @ignore_disallow: 0 to not ignore, 1 to ignore
506685732ac8SCy Schubert * Returns: 0 on success, -1 on failure
506785732ac8SCy Schubert */
506885732ac8SCy Schubert int (*ignore_assoc_disallow)(void *priv, int ignore_disallow);
506985732ac8SCy Schubert
507085732ac8SCy Schubert /**
5071c1d255d3SCy Schubert * set_bssid_tmp_disallow - Set disallowed BSSIDs to the driver
507285732ac8SCy Schubert * @priv: Private driver interface data
5073c1d255d3SCy Schubert * @num_bssid: Number of temporarily disallowed BSSIDs
5074c1d255d3SCy Schubert * @bssids: List of temporarily disallowed BSSIDs
507585732ac8SCy Schubert */
5076c1d255d3SCy Schubert int (*set_bssid_tmp_disallow)(void *priv, unsigned int num_bssid,
507785732ac8SCy Schubert const u8 *bssid);
507885732ac8SCy Schubert
507985732ac8SCy Schubert /**
508085732ac8SCy Schubert * update_connect_params - Update the connection parameters
508185732ac8SCy Schubert * @priv: Private driver interface data
508285732ac8SCy Schubert * @params: Association parameters
508385732ac8SCy Schubert * @mask: Bit mask indicating which parameters in @params have to be
508485732ac8SCy Schubert * updated
508585732ac8SCy Schubert * Returns: 0 on success, -1 on failure
508685732ac8SCy Schubert *
508785732ac8SCy Schubert * Update the connection parameters when in connected state so that the
508885732ac8SCy Schubert * driver uses the updated parameters for subsequent roaming. This is
508985732ac8SCy Schubert * used only with drivers that implement internal BSS selection and
509085732ac8SCy Schubert * roaming.
509185732ac8SCy Schubert */
509285732ac8SCy Schubert int (*update_connect_params)(
509385732ac8SCy Schubert void *priv, struct wpa_driver_associate_params *params,
509485732ac8SCy Schubert enum wpa_drv_update_connect_params_mask mask);
509585732ac8SCy Schubert
509685732ac8SCy Schubert /**
509785732ac8SCy Schubert * send_external_auth_status - Indicate the status of external
509885732ac8SCy Schubert * authentication processing to the host driver.
509985732ac8SCy Schubert * @priv: Private driver interface data
510085732ac8SCy Schubert * @params: Status of authentication processing.
510185732ac8SCy Schubert * Returns: 0 on success, -1 on failure
510285732ac8SCy Schubert */
510385732ac8SCy Schubert int (*send_external_auth_status)(void *priv,
510485732ac8SCy Schubert struct external_auth *params);
51054bc52338SCy Schubert
51064bc52338SCy Schubert /**
51074bc52338SCy Schubert * set_4addr_mode - Set 4-address mode
51084bc52338SCy Schubert * @priv: Private driver interface data
51094bc52338SCy Schubert * @bridge_ifname: Bridge interface name
51104bc52338SCy Schubert * @val: 0 - disable 4addr mode, 1 - enable 4addr mode
51114bc52338SCy Schubert * Returns: 0 on success, < 0 on failure
51124bc52338SCy Schubert */
51134bc52338SCy Schubert int (*set_4addr_mode)(void *priv, const char *bridge_ifname, int val);
5114206b73d0SCy Schubert
5115206b73d0SCy Schubert /**
5116206b73d0SCy Schubert * update_dh_ie - Update DH IE
5117206b73d0SCy Schubert * @priv: Private driver interface data
5118206b73d0SCy Schubert * @peer_mac: Peer MAC address
5119206b73d0SCy Schubert * @reason_code: Reacon code
5120206b73d0SCy Schubert * @ie: DH IE
5121206b73d0SCy Schubert * @ie_len: DH IE length in bytes
5122206b73d0SCy Schubert * Returns: 0 on success, -1 on failure
5123206b73d0SCy Schubert *
5124206b73d0SCy Schubert * This callback is used to let the driver know the DH processing result
5125206b73d0SCy Schubert * and DH IE for a pending association.
5126206b73d0SCy Schubert */
5127206b73d0SCy Schubert int (*update_dh_ie)(void *priv, const u8 *peer_mac, u16 reason_code,
5128206b73d0SCy Schubert const u8 *ie, size_t ie_len);
5129c1d255d3SCy Schubert
5130c1d255d3SCy Schubert /**
5131c1d255d3SCy Schubert * dpp_listen - Notify driver about start/stop of DPP listen
5132c1d255d3SCy Schubert * @priv: Private driver interface data
5133c1d255d3SCy Schubert * @enable: Whether listen state is enabled (or disabled)
5134c1d255d3SCy Schubert * Returns: 0 on success, -1 on failure
5135c1d255d3SCy Schubert *
5136c1d255d3SCy Schubert * This optional callback can be used to update RX frame filtering to
5137c1d255d3SCy Schubert * explicitly allow reception of broadcast Public Action frames.
5138c1d255d3SCy Schubert */
5139c1d255d3SCy Schubert int (*dpp_listen)(void *priv, bool enable);
5140c1d255d3SCy Schubert
5141*a90b9d01SCy Schubert /**
5142*a90b9d01SCy Schubert * set_secure_ranging_ctx - Add or delete secure ranging parameters of
5143*a90b9d01SCy Schubert * the specified peer to the driver.
5144*a90b9d01SCy Schubert * @priv: Private driver interface data
5145*a90b9d01SCy Schubert * @params: Secure ranging parameters
5146*a90b9d01SCy Schubert * Returns: 0 on success, -1 on failure
5147*a90b9d01SCy Schubert *
5148*a90b9d01SCy Schubert */
5149*a90b9d01SCy Schubert int (*set_secure_ranging_ctx)(void *priv,
5150*a90b9d01SCy Schubert struct secure_ranging_params *params);
5151*a90b9d01SCy Schubert
5152*a90b9d01SCy Schubert /**
5153*a90b9d01SCy Schubert * send_pasn_resp - Send PASN response for a set of peers to the
5154*a90b9d01SCy Schubert * driver.
5155*a90b9d01SCy Schubert * @priv: Private driver interface data
5156*a90b9d01SCy Schubert * @params: Parameters holding peers and respective status.
5157*a90b9d01SCy Schubert * Returns: 0 on success, -1 on failure
5158*a90b9d01SCy Schubert */
5159*a90b9d01SCy Schubert int (*send_pasn_resp)(void *priv, struct pasn_auth *params);
5160*a90b9d01SCy Schubert
5161*a90b9d01SCy Schubert /**
5162*a90b9d01SCy Schubert * get_sta_mlo_info - Get the current multi-link association info
5163*a90b9d01SCy Schubert * @priv: Private driver interface data
5164*a90b9d01SCy Schubert * @mlo: Pointer to fill multi-link association info
5165*a90b9d01SCy Schubert * Returns: 0 on success, -1 on failure
5166*a90b9d01SCy Schubert *
5167*a90b9d01SCy Schubert * This callback is used to fetch multi-link of the current association.
5168*a90b9d01SCy Schubert */
5169*a90b9d01SCy Schubert int (*get_sta_mlo_info)(void *priv,
5170*a90b9d01SCy Schubert struct driver_sta_mlo_info *mlo_info);
5171*a90b9d01SCy Schubert
5172*a90b9d01SCy Schubert /**
5173*a90b9d01SCy Schubert * link_add - Add a link to the AP MLD interface
5174*a90b9d01SCy Schubert * @priv: Private driver interface data
5175*a90b9d01SCy Schubert * @link_id: The link ID
5176*a90b9d01SCy Schubert * @addr: The MAC address to use for the link
5177*a90b9d01SCy Schubert * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces
5178*a90b9d01SCy Schubert * Returns: 0 on success, negative value on failure
5179*a90b9d01SCy Schubert */
5180*a90b9d01SCy Schubert int (*link_add)(void *priv, u8 link_id, const u8 *addr, void *bss_ctx);
5181*a90b9d01SCy Schubert
5182*a90b9d01SCy Schubert /**
5183*a90b9d01SCy Schubert * link_remove - Remove a link from the AP MLD interface
5184*a90b9d01SCy Schubert * @priv: Private driver interface data
5185*a90b9d01SCy Schubert * @type: Interface type
5186*a90b9d01SCy Schubert * @ifname: Interface name of the virtual interface from where the link
5187*a90b9d01SCy Schubert * is to be removed.
5188*a90b9d01SCy Schubert * @link_id: Valid link ID to remove
5189*a90b9d01SCy Schubert * Returns: 0 on success, -1 on failure
5190*a90b9d01SCy Schubert */
5191*a90b9d01SCy Schubert int (*link_remove)(void *priv, enum wpa_driver_if_type type,
5192*a90b9d01SCy Schubert const char *ifname, u8 link_id);
5193*a90b9d01SCy Schubert
5194*a90b9d01SCy Schubert /**
5195*a90b9d01SCy Schubert * is_drv_shared - Check whether the driver interface is shared
5196*a90b9d01SCy Schubert * @priv: Private driver interface data from init()
5197*a90b9d01SCy Schubert * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces
5198*a90b9d01SCy Schubert *
5199*a90b9d01SCy Schubert * Checks whether the driver interface is being used by other partner
5200*a90b9d01SCy Schubert * BSS(s) or not. This is used to decide whether the driver interface
5201*a90b9d01SCy Schubert * needs to be deinitilized when one interface is getting deinitialized.
5202*a90b9d01SCy Schubert *
5203*a90b9d01SCy Schubert * Returns: true if it is being used or else false.
5204*a90b9d01SCy Schubert */
5205*a90b9d01SCy Schubert bool (*is_drv_shared)(void *priv, void *bss_ctx);
5206*a90b9d01SCy Schubert
5207*a90b9d01SCy Schubert /**
5208*a90b9d01SCy Schubert * link_sta_remove - Remove a link STA from an MLD STA
5209*a90b9d01SCy Schubert * @priv: Private driver interface data
5210*a90b9d01SCy Schubert * @link_id: The link ID which the link STA is using
5211*a90b9d01SCy Schubert * @addr: The MLD MAC address of the MLD STA
5212*a90b9d01SCy Schubert * Returns: 0 on success, negative value on failure
5213*a90b9d01SCy Schubert */
5214*a90b9d01SCy Schubert int (*link_sta_remove)(void *priv, u8 link_id, const u8 *addr);
5215*a90b9d01SCy Schubert
5216c1d255d3SCy Schubert #ifdef CONFIG_TESTING_OPTIONS
5217c1d255d3SCy Schubert int (*register_frame)(void *priv, u16 type,
5218c1d255d3SCy Schubert const u8 *match, size_t match_len,
5219c1d255d3SCy Schubert bool multicast);
5220c1d255d3SCy Schubert #endif /* CONFIG_TESTING_OPTIONS */
522185732ac8SCy Schubert };
522239beb93cSSam Leffler
522339beb93cSSam Leffler /**
522439beb93cSSam Leffler * enum wpa_event_type - Event type for wpa_supplicant_event() calls
522539beb93cSSam Leffler */
5226e28a4053SRui Paulo enum wpa_event_type {
522739beb93cSSam Leffler /**
522839beb93cSSam Leffler * EVENT_ASSOC - Association completed
522939beb93cSSam Leffler *
523039beb93cSSam Leffler * This event needs to be delivered when the driver completes IEEE
523139beb93cSSam Leffler * 802.11 association or reassociation successfully.
523239beb93cSSam Leffler * wpa_driver_ops::get_bssid() is expected to provide the current BSSID
523339beb93cSSam Leffler * after this event has been generated. In addition, optional
523439beb93cSSam Leffler * EVENT_ASSOCINFO may be generated just before EVENT_ASSOC to provide
523539beb93cSSam Leffler * more information about the association. If the driver interface gets
523639beb93cSSam Leffler * both of these events at the same time, it can also include the
523739beb93cSSam Leffler * assoc_info data in EVENT_ASSOC call.
523839beb93cSSam Leffler */
523939beb93cSSam Leffler EVENT_ASSOC,
524039beb93cSSam Leffler
524139beb93cSSam Leffler /**
524239beb93cSSam Leffler * EVENT_DISASSOC - Association lost
524339beb93cSSam Leffler *
524439beb93cSSam Leffler * This event should be called when association is lost either due to
524539beb93cSSam Leffler * receiving deauthenticate or disassociate frame from the AP or when
5246e28a4053SRui Paulo * sending either of these frames to the current AP. If the driver
5247e28a4053SRui Paulo * supports separate deauthentication event, EVENT_DISASSOC should only
5248e28a4053SRui Paulo * be used for disassociation and EVENT_DEAUTH for deauthentication.
5249e28a4053SRui Paulo * In AP mode, union wpa_event_data::disassoc_info is required.
525039beb93cSSam Leffler */
525139beb93cSSam Leffler EVENT_DISASSOC,
525239beb93cSSam Leffler
525339beb93cSSam Leffler /**
525439beb93cSSam Leffler * EVENT_MICHAEL_MIC_FAILURE - Michael MIC (TKIP) detected
525539beb93cSSam Leffler *
525639beb93cSSam Leffler * This event must be delivered when a Michael MIC error is detected by
525739beb93cSSam Leffler * the local driver. Additional data for event processing is
525839beb93cSSam Leffler * provided with union wpa_event_data::michael_mic_failure. This
5259*a90b9d01SCy Schubert * information is used to request new encryption key and to initiate
526039beb93cSSam Leffler * TKIP countermeasures if needed.
526139beb93cSSam Leffler */
526239beb93cSSam Leffler EVENT_MICHAEL_MIC_FAILURE,
526339beb93cSSam Leffler
526439beb93cSSam Leffler /**
526539beb93cSSam Leffler * EVENT_SCAN_RESULTS - Scan results available
526639beb93cSSam Leffler *
526739beb93cSSam Leffler * This event must be called whenever scan results are available to be
526839beb93cSSam Leffler * fetched with struct wpa_driver_ops::get_scan_results(). This event
526939beb93cSSam Leffler * is expected to be used some time after struct wpa_driver_ops::scan()
527039beb93cSSam Leffler * is called. If the driver provides an unsolicited event when the scan
527139beb93cSSam Leffler * has been completed, this event can be used to trigger
527239beb93cSSam Leffler * EVENT_SCAN_RESULTS call. If such event is not available from the
527339beb93cSSam Leffler * driver, the driver wrapper code is expected to use a registered
527439beb93cSSam Leffler * timeout to generate EVENT_SCAN_RESULTS call after the time that the
5275e28a4053SRui Paulo * scan is expected to be completed. Optional information about
5276e28a4053SRui Paulo * completed scan can be provided with union wpa_event_data::scan_info.
527739beb93cSSam Leffler */
527839beb93cSSam Leffler EVENT_SCAN_RESULTS,
527939beb93cSSam Leffler
528039beb93cSSam Leffler /**
528139beb93cSSam Leffler * EVENT_ASSOCINFO - Report optional extra information for association
528239beb93cSSam Leffler *
528339beb93cSSam Leffler * This event can be used to report extra association information for
528439beb93cSSam Leffler * EVENT_ASSOC processing. This extra information includes IEs from
528539beb93cSSam Leffler * association frames and Beacon/Probe Response frames in union
528639beb93cSSam Leffler * wpa_event_data::assoc_info. EVENT_ASSOCINFO must be send just before
528739beb93cSSam Leffler * EVENT_ASSOC. Alternatively, the driver interface can include
528839beb93cSSam Leffler * assoc_info data in the EVENT_ASSOC call if it has all the
528939beb93cSSam Leffler * information available at the same point.
529039beb93cSSam Leffler */
529139beb93cSSam Leffler EVENT_ASSOCINFO,
529239beb93cSSam Leffler
529339beb93cSSam Leffler /**
529439beb93cSSam Leffler * EVENT_INTERFACE_STATUS - Report interface status changes
529539beb93cSSam Leffler *
529639beb93cSSam Leffler * This optional event can be used to report changes in interface
529739beb93cSSam Leffler * status (interface added/removed) using union
529839beb93cSSam Leffler * wpa_event_data::interface_status. This can be used to trigger
529939beb93cSSam Leffler * wpa_supplicant to stop and re-start processing for the interface,
530039beb93cSSam Leffler * e.g., when a cardbus card is ejected/inserted.
530139beb93cSSam Leffler */
530239beb93cSSam Leffler EVENT_INTERFACE_STATUS,
530339beb93cSSam Leffler
530439beb93cSSam Leffler /**
530539beb93cSSam Leffler * EVENT_PMKID_CANDIDATE - Report a candidate AP for pre-authentication
530639beb93cSSam Leffler *
530739beb93cSSam Leffler * This event can be used to inform wpa_supplicant about candidates for
530839beb93cSSam Leffler * RSN (WPA2) pre-authentication. If wpa_supplicant is not responsible
530939beb93cSSam Leffler * for scan request (ap_scan=2 mode), this event is required for
531039beb93cSSam Leffler * pre-authentication. If wpa_supplicant is performing scan request
531139beb93cSSam Leffler * (ap_scan=1), this event is optional since scan results can be used
531239beb93cSSam Leffler * to add pre-authentication candidates. union
531339beb93cSSam Leffler * wpa_event_data::pmkid_candidate is used to report the BSSID of the
531439beb93cSSam Leffler * candidate and priority of the candidate, e.g., based on the signal
531539beb93cSSam Leffler * strength, in order to try to pre-authenticate first with candidates
531639beb93cSSam Leffler * that are most likely targets for re-association.
531739beb93cSSam Leffler *
531839beb93cSSam Leffler * EVENT_PMKID_CANDIDATE can be called whenever the driver has updates
531939beb93cSSam Leffler * on the candidate list. In addition, it can be called for the current
532039beb93cSSam Leffler * AP and APs that have existing PMKSA cache entries. wpa_supplicant
532139beb93cSSam Leffler * will automatically skip pre-authentication in cases where a valid
532239beb93cSSam Leffler * PMKSA exists. When more than one candidate exists, this event should
532339beb93cSSam Leffler * be generated once for each candidate.
532439beb93cSSam Leffler *
532539beb93cSSam Leffler * Driver will be notified about successful pre-authentication with
532639beb93cSSam Leffler * struct wpa_driver_ops::add_pmkid() calls.
532739beb93cSSam Leffler */
532839beb93cSSam Leffler EVENT_PMKID_CANDIDATE,
532939beb93cSSam Leffler
533039beb93cSSam Leffler /**
5331f05cddf9SRui Paulo * EVENT_TDLS - Request TDLS operation
5332f05cddf9SRui Paulo *
5333f05cddf9SRui Paulo * This event can be used to request a TDLS operation to be performed.
5334f05cddf9SRui Paulo */
5335f05cddf9SRui Paulo EVENT_TDLS,
5336f05cddf9SRui Paulo
5337f05cddf9SRui Paulo /**
533839beb93cSSam Leffler * EVENT_FT_RESPONSE - Report FT (IEEE 802.11r) response IEs
533939beb93cSSam Leffler *
534039beb93cSSam Leffler * The driver is expected to report the received FT IEs from
534139beb93cSSam Leffler * FT authentication sequence from the AP. The FT IEs are included in
534239beb93cSSam Leffler * the extra information in union wpa_event_data::ft_ies.
534339beb93cSSam Leffler */
5344e28a4053SRui Paulo EVENT_FT_RESPONSE,
5345e28a4053SRui Paulo
5346e28a4053SRui Paulo /**
5347e28a4053SRui Paulo * EVENT_IBSS_RSN_START - Request RSN authentication in IBSS
5348e28a4053SRui Paulo *
5349e28a4053SRui Paulo * The driver can use this event to inform wpa_supplicant about a STA
5350e28a4053SRui Paulo * in an IBSS with which protected frames could be exchanged. This
5351e28a4053SRui Paulo * event starts RSN authentication with the other STA to authenticate
5352e28a4053SRui Paulo * the STA and set up encryption keys with it.
5353e28a4053SRui Paulo */
5354e28a4053SRui Paulo EVENT_IBSS_RSN_START,
5355e28a4053SRui Paulo
5356e28a4053SRui Paulo /**
5357e28a4053SRui Paulo * EVENT_AUTH - Authentication result
5358e28a4053SRui Paulo *
5359e28a4053SRui Paulo * This event should be called when authentication attempt has been
5360e28a4053SRui Paulo * completed. This is only used if the driver supports separate
5361e28a4053SRui Paulo * authentication step (struct wpa_driver_ops::authenticate).
5362e28a4053SRui Paulo * Information about authentication result is included in
5363e28a4053SRui Paulo * union wpa_event_data::auth.
5364e28a4053SRui Paulo */
5365e28a4053SRui Paulo EVENT_AUTH,
5366e28a4053SRui Paulo
5367e28a4053SRui Paulo /**
5368e28a4053SRui Paulo * EVENT_DEAUTH - Authentication lost
5369e28a4053SRui Paulo *
5370e28a4053SRui Paulo * This event should be called when authentication is lost either due
5371e28a4053SRui Paulo * to receiving deauthenticate frame from the AP or when sending that
5372e28a4053SRui Paulo * frame to the current AP.
5373e28a4053SRui Paulo * In AP mode, union wpa_event_data::deauth_info is required.
5374e28a4053SRui Paulo */
5375e28a4053SRui Paulo EVENT_DEAUTH,
5376e28a4053SRui Paulo
5377e28a4053SRui Paulo /**
5378e28a4053SRui Paulo * EVENT_ASSOC_REJECT - Association rejected
5379e28a4053SRui Paulo *
5380e28a4053SRui Paulo * This event should be called when (re)association attempt has been
5381f05cddf9SRui Paulo * rejected by the AP. Information about the association response is
5382e28a4053SRui Paulo * included in union wpa_event_data::assoc_reject.
5383e28a4053SRui Paulo */
5384e28a4053SRui Paulo EVENT_ASSOC_REJECT,
5385e28a4053SRui Paulo
5386e28a4053SRui Paulo /**
5387e28a4053SRui Paulo * EVENT_AUTH_TIMED_OUT - Authentication timed out
5388e28a4053SRui Paulo */
5389e28a4053SRui Paulo EVENT_AUTH_TIMED_OUT,
5390e28a4053SRui Paulo
5391e28a4053SRui Paulo /**
5392e28a4053SRui Paulo * EVENT_ASSOC_TIMED_OUT - Association timed out
5393e28a4053SRui Paulo */
5394e28a4053SRui Paulo EVENT_ASSOC_TIMED_OUT,
5395e28a4053SRui Paulo
5396e28a4053SRui Paulo /**
5397e28a4053SRui Paulo * EVENT_WPS_BUTTON_PUSHED - Report hardware push button press for WPS
5398e28a4053SRui Paulo */
5399e28a4053SRui Paulo EVENT_WPS_BUTTON_PUSHED,
5400e28a4053SRui Paulo
5401e28a4053SRui Paulo /**
5402e28a4053SRui Paulo * EVENT_TX_STATUS - Report TX status
5403e28a4053SRui Paulo */
5404e28a4053SRui Paulo EVENT_TX_STATUS,
5405e28a4053SRui Paulo
5406e28a4053SRui Paulo /**
5407e28a4053SRui Paulo * EVENT_RX_FROM_UNKNOWN - Report RX from unknown STA
5408e28a4053SRui Paulo */
5409e28a4053SRui Paulo EVENT_RX_FROM_UNKNOWN,
5410e28a4053SRui Paulo
5411e28a4053SRui Paulo /**
5412e28a4053SRui Paulo * EVENT_RX_MGMT - Report RX of a management frame
5413e28a4053SRui Paulo */
5414e28a4053SRui Paulo EVENT_RX_MGMT,
5415e28a4053SRui Paulo
5416e28a4053SRui Paulo /**
5417e28a4053SRui Paulo * EVENT_REMAIN_ON_CHANNEL - Remain-on-channel duration started
5418e28a4053SRui Paulo *
5419e28a4053SRui Paulo * This event is used to indicate when the driver has started the
5420e28a4053SRui Paulo * requested remain-on-channel duration. Information about the
5421e28a4053SRui Paulo * operation is included in union wpa_event_data::remain_on_channel.
5422e28a4053SRui Paulo */
5423e28a4053SRui Paulo EVENT_REMAIN_ON_CHANNEL,
5424e28a4053SRui Paulo
5425e28a4053SRui Paulo /**
5426e28a4053SRui Paulo * EVENT_CANCEL_REMAIN_ON_CHANNEL - Remain-on-channel timed out
5427e28a4053SRui Paulo *
5428e28a4053SRui Paulo * This event is used to indicate when the driver has completed
5429e28a4053SRui Paulo * remain-on-channel duration, i.e., may noot be available on the
5430e28a4053SRui Paulo * requested channel anymore. Information about the
5431e28a4053SRui Paulo * operation is included in union wpa_event_data::remain_on_channel.
5432e28a4053SRui Paulo */
5433e28a4053SRui Paulo EVENT_CANCEL_REMAIN_ON_CHANNEL,
5434e28a4053SRui Paulo
5435e28a4053SRui Paulo /**
5436e28a4053SRui Paulo * EVENT_RX_PROBE_REQ - Indicate received Probe Request frame
5437e28a4053SRui Paulo *
5438e28a4053SRui Paulo * This event is used to indicate when a Probe Request frame has been
5439e28a4053SRui Paulo * received. Information about the received frame is included in
5440e28a4053SRui Paulo * union wpa_event_data::rx_probe_req. The driver is required to report
5441e28a4053SRui Paulo * these events only after successfully completed probe_req_report()
5442e28a4053SRui Paulo * commands to request the events (i.e., report parameter is non-zero)
5443e28a4053SRui Paulo * in station mode. In AP mode, Probe Request frames should always be
5444e28a4053SRui Paulo * reported.
5445e28a4053SRui Paulo */
5446e28a4053SRui Paulo EVENT_RX_PROBE_REQ,
5447e28a4053SRui Paulo
5448e28a4053SRui Paulo /**
5449e28a4053SRui Paulo * EVENT_NEW_STA - New wired device noticed
5450e28a4053SRui Paulo *
5451e28a4053SRui Paulo * This event is used to indicate that a new device has been detected
5452e28a4053SRui Paulo * in a network that does not use association-like functionality (i.e.,
5453e28a4053SRui Paulo * mainly wired Ethernet). This can be used to start EAPOL
5454e28a4053SRui Paulo * authenticator when receiving a frame from a device. The address of
5455e28a4053SRui Paulo * the device is included in union wpa_event_data::new_sta.
5456e28a4053SRui Paulo */
5457e28a4053SRui Paulo EVENT_NEW_STA,
5458e28a4053SRui Paulo
5459e28a4053SRui Paulo /**
5460e28a4053SRui Paulo * EVENT_EAPOL_RX - Report received EAPOL frame
5461e28a4053SRui Paulo *
5462e28a4053SRui Paulo * When in AP mode with hostapd, this event is required to be used to
54635b9c547cSRui Paulo * deliver the receive EAPOL frames from the driver.
5464e28a4053SRui Paulo */
5465e28a4053SRui Paulo EVENT_EAPOL_RX,
5466e28a4053SRui Paulo
5467e28a4053SRui Paulo /**
5468e28a4053SRui Paulo * EVENT_SIGNAL_CHANGE - Indicate change in signal strength
5469e28a4053SRui Paulo *
5470e28a4053SRui Paulo * This event is used to indicate changes in the signal strength
5471e28a4053SRui Paulo * observed in frames received from the current AP if signal strength
5472e28a4053SRui Paulo * monitoring has been enabled with signal_monitor().
5473e28a4053SRui Paulo */
5474f05cddf9SRui Paulo EVENT_SIGNAL_CHANGE,
5475f05cddf9SRui Paulo
5476f05cddf9SRui Paulo /**
5477f05cddf9SRui Paulo * EVENT_INTERFACE_ENABLED - Notify that interface was enabled
5478f05cddf9SRui Paulo *
5479f05cddf9SRui Paulo * This event is used to indicate that the interface was enabled after
5480f05cddf9SRui Paulo * having been previously disabled, e.g., due to rfkill.
5481f05cddf9SRui Paulo */
5482f05cddf9SRui Paulo EVENT_INTERFACE_ENABLED,
5483f05cddf9SRui Paulo
5484f05cddf9SRui Paulo /**
5485f05cddf9SRui Paulo * EVENT_INTERFACE_DISABLED - Notify that interface was disabled
5486f05cddf9SRui Paulo *
5487f05cddf9SRui Paulo * This event is used to indicate that the interface was disabled,
5488f05cddf9SRui Paulo * e.g., due to rfkill.
5489f05cddf9SRui Paulo */
5490f05cddf9SRui Paulo EVENT_INTERFACE_DISABLED,
5491f05cddf9SRui Paulo
5492f05cddf9SRui Paulo /**
5493f05cddf9SRui Paulo * EVENT_CHANNEL_LIST_CHANGED - Channel list changed
5494f05cddf9SRui Paulo *
5495f05cddf9SRui Paulo * This event is used to indicate that the channel list has changed,
5496f05cddf9SRui Paulo * e.g., because of a regulatory domain change triggered by scan
5497f05cddf9SRui Paulo * results including an AP advertising a country code.
5498f05cddf9SRui Paulo */
5499f05cddf9SRui Paulo EVENT_CHANNEL_LIST_CHANGED,
5500f05cddf9SRui Paulo
5501f05cddf9SRui Paulo /**
5502f05cddf9SRui Paulo * EVENT_INTERFACE_UNAVAILABLE - Notify that interface is unavailable
5503f05cddf9SRui Paulo *
5504f05cddf9SRui Paulo * This event is used to indicate that the driver cannot maintain this
5505f05cddf9SRui Paulo * interface in its operation mode anymore. The most likely use for
5506f05cddf9SRui Paulo * this is to indicate that AP mode operation is not available due to
5507f05cddf9SRui Paulo * operating channel would need to be changed to a DFS channel when
5508f05cddf9SRui Paulo * the driver does not support radar detection and another virtual
5509f05cddf9SRui Paulo * interfaces caused the operating channel to change. Other similar
5510f05cddf9SRui Paulo * resource conflicts could also trigger this for station mode
55115b9c547cSRui Paulo * interfaces. This event can be propagated when channel switching
55125b9c547cSRui Paulo * fails.
5513f05cddf9SRui Paulo */
5514f05cddf9SRui Paulo EVENT_INTERFACE_UNAVAILABLE,
5515f05cddf9SRui Paulo
5516f05cddf9SRui Paulo /**
5517f05cddf9SRui Paulo * EVENT_BEST_CHANNEL
5518f05cddf9SRui Paulo *
5519f05cddf9SRui Paulo * Driver generates this event whenever it detects a better channel
5520f05cddf9SRui Paulo * (e.g., based on RSSI or channel use). This information can be used
5521f05cddf9SRui Paulo * to improve channel selection for a new AP/P2P group.
5522f05cddf9SRui Paulo */
5523f05cddf9SRui Paulo EVENT_BEST_CHANNEL,
5524f05cddf9SRui Paulo
5525f05cddf9SRui Paulo /**
5526f05cddf9SRui Paulo * EVENT_UNPROT_DEAUTH - Unprotected Deauthentication frame received
5527f05cddf9SRui Paulo *
5528f05cddf9SRui Paulo * This event should be called when a Deauthentication frame is dropped
5529f05cddf9SRui Paulo * due to it not being protected (MFP/IEEE 802.11w).
5530f05cddf9SRui Paulo * union wpa_event_data::unprot_deauth is required to provide more
5531f05cddf9SRui Paulo * details of the frame.
5532f05cddf9SRui Paulo */
5533f05cddf9SRui Paulo EVENT_UNPROT_DEAUTH,
5534f05cddf9SRui Paulo
5535f05cddf9SRui Paulo /**
5536f05cddf9SRui Paulo * EVENT_UNPROT_DISASSOC - Unprotected Disassociation frame received
5537f05cddf9SRui Paulo *
5538f05cddf9SRui Paulo * This event should be called when a Disassociation frame is dropped
5539f05cddf9SRui Paulo * due to it not being protected (MFP/IEEE 802.11w).
5540f05cddf9SRui Paulo * union wpa_event_data::unprot_disassoc is required to provide more
5541f05cddf9SRui Paulo * details of the frame.
5542f05cddf9SRui Paulo */
5543f05cddf9SRui Paulo EVENT_UNPROT_DISASSOC,
5544f05cddf9SRui Paulo
5545f05cddf9SRui Paulo /**
5546f05cddf9SRui Paulo * EVENT_STATION_LOW_ACK
5547f05cddf9SRui Paulo *
5548f05cddf9SRui Paulo * Driver generates this event whenever it detected that a particular
5549f05cddf9SRui Paulo * station was lost. Detection can be through massive transmission
5550f05cddf9SRui Paulo * failures for example.
5551f05cddf9SRui Paulo */
5552f05cddf9SRui Paulo EVENT_STATION_LOW_ACK,
5553f05cddf9SRui Paulo
5554f05cddf9SRui Paulo /**
5555f05cddf9SRui Paulo * EVENT_IBSS_PEER_LOST - IBSS peer not reachable anymore
5556f05cddf9SRui Paulo */
5557f05cddf9SRui Paulo EVENT_IBSS_PEER_LOST,
5558f05cddf9SRui Paulo
5559f05cddf9SRui Paulo /**
5560f05cddf9SRui Paulo * EVENT_DRIVER_GTK_REKEY - Device/driver did GTK rekey
5561f05cddf9SRui Paulo *
5562f05cddf9SRui Paulo * This event carries the new replay counter to notify wpa_supplicant
5563f05cddf9SRui Paulo * of the current EAPOL-Key Replay Counter in case the driver/firmware
5564f05cddf9SRui Paulo * completed Group Key Handshake while the host (including
5565f05cddf9SRui Paulo * wpa_supplicant was sleeping).
5566f05cddf9SRui Paulo */
5567f05cddf9SRui Paulo EVENT_DRIVER_GTK_REKEY,
5568f05cddf9SRui Paulo
5569f05cddf9SRui Paulo /**
5570f05cddf9SRui Paulo * EVENT_SCHED_SCAN_STOPPED - Scheduled scan was stopped
5571f05cddf9SRui Paulo */
5572f05cddf9SRui Paulo EVENT_SCHED_SCAN_STOPPED,
5573f05cddf9SRui Paulo
5574f05cddf9SRui Paulo /**
5575f05cddf9SRui Paulo * EVENT_DRIVER_CLIENT_POLL_OK - Station responded to poll
5576f05cddf9SRui Paulo *
5577f05cddf9SRui Paulo * This event indicates that the station responded to the poll
5578f05cddf9SRui Paulo * initiated with @poll_client.
5579f05cddf9SRui Paulo */
5580f05cddf9SRui Paulo EVENT_DRIVER_CLIENT_POLL_OK,
5581f05cddf9SRui Paulo
5582f05cddf9SRui Paulo /**
5583f05cddf9SRui Paulo * EVENT_EAPOL_TX_STATUS - notify of EAPOL TX status
5584f05cddf9SRui Paulo */
5585f05cddf9SRui Paulo EVENT_EAPOL_TX_STATUS,
5586f05cddf9SRui Paulo
5587f05cddf9SRui Paulo /**
5588f05cddf9SRui Paulo * EVENT_CH_SWITCH - AP or GO decided to switch channels
5589f05cddf9SRui Paulo *
5590f05cddf9SRui Paulo * Described in wpa_event_data.ch_switch
5591f05cddf9SRui Paulo * */
5592f05cddf9SRui Paulo EVENT_CH_SWITCH,
5593f05cddf9SRui Paulo
5594f05cddf9SRui Paulo /**
5595206b73d0SCy Schubert * EVENT_CH_SWITCH_STARTED - AP or GO started to switch channels
5596206b73d0SCy Schubert *
5597206b73d0SCy Schubert * This is a pre-switch event indicating the shortly following switch
5598206b73d0SCy Schubert * of operating channels.
5599206b73d0SCy Schubert *
5600206b73d0SCy Schubert * Described in wpa_event_data.ch_switch
5601206b73d0SCy Schubert */
5602206b73d0SCy Schubert EVENT_CH_SWITCH_STARTED,
5603206b73d0SCy Schubert /**
5604f05cddf9SRui Paulo * EVENT_WNM - Request WNM operation
5605f05cddf9SRui Paulo *
5606f05cddf9SRui Paulo * This event can be used to request a WNM operation to be performed.
5607f05cddf9SRui Paulo */
56085b9c547cSRui Paulo EVENT_WNM,
56095b9c547cSRui Paulo
56105b9c547cSRui Paulo /**
56115b9c547cSRui Paulo * EVENT_CONNECT_FAILED_REASON - Connection failure reason in AP mode
56125b9c547cSRui Paulo *
56135b9c547cSRui Paulo * This event indicates that the driver reported a connection failure
56145b9c547cSRui Paulo * with the specified client (for example, max client reached, etc.) in
56155b9c547cSRui Paulo * AP mode.
56165b9c547cSRui Paulo */
56175b9c547cSRui Paulo EVENT_CONNECT_FAILED_REASON,
56185b9c547cSRui Paulo
56195b9c547cSRui Paulo /**
56205b9c547cSRui Paulo * EVENT_DFS_RADAR_DETECTED - Notify of radar detection
56215b9c547cSRui Paulo *
56225b9c547cSRui Paulo * A radar has been detected on the supplied frequency, hostapd should
56235b9c547cSRui Paulo * react accordingly (e.g., change channel).
56245b9c547cSRui Paulo */
56255b9c547cSRui Paulo EVENT_DFS_RADAR_DETECTED,
56265b9c547cSRui Paulo
56275b9c547cSRui Paulo /**
56285b9c547cSRui Paulo * EVENT_DFS_CAC_FINISHED - Notify that channel availability check has been completed
56295b9c547cSRui Paulo *
56305b9c547cSRui Paulo * After a successful CAC, the channel can be marked clear and used.
56315b9c547cSRui Paulo */
56325b9c547cSRui Paulo EVENT_DFS_CAC_FINISHED,
56335b9c547cSRui Paulo
56345b9c547cSRui Paulo /**
56355b9c547cSRui Paulo * EVENT_DFS_CAC_ABORTED - Notify that channel availability check has been aborted
56365b9c547cSRui Paulo *
56375b9c547cSRui Paulo * The CAC was not successful, and the channel remains in the previous
563885732ac8SCy Schubert * state. This may happen due to a radar being detected or other
56395b9c547cSRui Paulo * external influences.
56405b9c547cSRui Paulo */
56415b9c547cSRui Paulo EVENT_DFS_CAC_ABORTED,
56425b9c547cSRui Paulo
56435b9c547cSRui Paulo /**
56445b9c547cSRui Paulo * EVENT_DFS_NOP_FINISHED - Notify that non-occupancy period is over
56455b9c547cSRui Paulo *
56465b9c547cSRui Paulo * The channel which was previously unavailable is now available again.
56475b9c547cSRui Paulo */
56485b9c547cSRui Paulo EVENT_DFS_NOP_FINISHED,
56495b9c547cSRui Paulo
56505b9c547cSRui Paulo /**
56515b9c547cSRui Paulo * EVENT_SURVEY - Received survey data
56525b9c547cSRui Paulo *
56535b9c547cSRui Paulo * This event gets triggered when a driver query is issued for survey
56545b9c547cSRui Paulo * data and the requested data becomes available. The returned data is
56555b9c547cSRui Paulo * stored in struct survey_results. The results provide at most one
56565b9c547cSRui Paulo * survey entry for each frequency and at minimum will provide one
56575b9c547cSRui Paulo * survey entry for one frequency. The survey data can be os_malloc()'d
56585b9c547cSRui Paulo * and then os_free()'d, so the event callback must only copy data.
56595b9c547cSRui Paulo */
56605b9c547cSRui Paulo EVENT_SURVEY,
56615b9c547cSRui Paulo
56625b9c547cSRui Paulo /**
56635b9c547cSRui Paulo * EVENT_SCAN_STARTED - Scan started
56645b9c547cSRui Paulo *
56655b9c547cSRui Paulo * This indicates that driver has started a scan operation either based
56665b9c547cSRui Paulo * on a request from wpa_supplicant/hostapd or from another application.
56675b9c547cSRui Paulo * EVENT_SCAN_RESULTS is used to indicate when the scan has been
56685b9c547cSRui Paulo * completed (either successfully or by getting cancelled).
56695b9c547cSRui Paulo */
56705b9c547cSRui Paulo EVENT_SCAN_STARTED,
56715b9c547cSRui Paulo
56725b9c547cSRui Paulo /**
56735b9c547cSRui Paulo * EVENT_AVOID_FREQUENCIES - Received avoid frequency range
56745b9c547cSRui Paulo *
56755b9c547cSRui Paulo * This event indicates a set of frequency ranges that should be avoided
56765b9c547cSRui Paulo * to reduce issues due to interference or internal co-existence
56775b9c547cSRui Paulo * information in the driver.
56785b9c547cSRui Paulo */
56795b9c547cSRui Paulo EVENT_AVOID_FREQUENCIES,
56805b9c547cSRui Paulo
56815b9c547cSRui Paulo /**
56825b9c547cSRui Paulo * EVENT_NEW_PEER_CANDIDATE - new (unknown) mesh peer notification
56835b9c547cSRui Paulo */
56845b9c547cSRui Paulo EVENT_NEW_PEER_CANDIDATE,
56855b9c547cSRui Paulo
56865b9c547cSRui Paulo /**
56875b9c547cSRui Paulo * EVENT_ACS_CHANNEL_SELECTED - Received selected channels by ACS
56885b9c547cSRui Paulo *
56895b9c547cSRui Paulo * Indicates a pair of primary and secondary channels chosen by ACS
56905b9c547cSRui Paulo * in device.
56915b9c547cSRui Paulo */
56925b9c547cSRui Paulo EVENT_ACS_CHANNEL_SELECTED,
56935b9c547cSRui Paulo
56945b9c547cSRui Paulo /**
56955b9c547cSRui Paulo * EVENT_DFS_CAC_STARTED - Notify that channel availability check has
56965b9c547cSRui Paulo * been started.
56975b9c547cSRui Paulo *
56985b9c547cSRui Paulo * This event indicates that channel availability check has been started
56995b9c547cSRui Paulo * on a DFS frequency by a driver that supports DFS Offload.
57005b9c547cSRui Paulo */
57015b9c547cSRui Paulo EVENT_DFS_CAC_STARTED,
5702780fb4a2SCy Schubert
5703780fb4a2SCy Schubert /**
5704780fb4a2SCy Schubert * EVENT_P2P_LO_STOP - Notify that P2P listen offload is stopped
5705780fb4a2SCy Schubert */
5706780fb4a2SCy Schubert EVENT_P2P_LO_STOP,
570785732ac8SCy Schubert
570885732ac8SCy Schubert /**
570985732ac8SCy Schubert * EVENT_BEACON_LOSS - Beacon loss detected
571085732ac8SCy Schubert *
571185732ac8SCy Schubert * This event indicates that no Beacon frames has been received from
571285732ac8SCy Schubert * the current AP. This may indicate that the AP is not anymore in
571385732ac8SCy Schubert * range.
571485732ac8SCy Schubert */
571585732ac8SCy Schubert EVENT_BEACON_LOSS,
571685732ac8SCy Schubert
571785732ac8SCy Schubert /**
571885732ac8SCy Schubert * EVENT_DFS_PRE_CAC_EXPIRED - Notify that channel availability check
571985732ac8SCy Schubert * done previously (Pre-CAC) on the channel has expired. This would
572085732ac8SCy Schubert * normally be on a non-ETSI DFS regulatory domain. DFS state of the
572185732ac8SCy Schubert * channel will be moved from available to usable. A new CAC has to be
572285732ac8SCy Schubert * performed before start operating on this channel.
572385732ac8SCy Schubert */
572485732ac8SCy Schubert EVENT_DFS_PRE_CAC_EXPIRED,
572585732ac8SCy Schubert
572685732ac8SCy Schubert /**
572785732ac8SCy Schubert * EVENT_EXTERNAL_AUTH - This event interface is used by host drivers
572885732ac8SCy Schubert * that do not define separate commands for authentication and
572985732ac8SCy Schubert * association (~WPA_DRIVER_FLAGS_SME) but offload the 802.11
573085732ac8SCy Schubert * authentication to wpa_supplicant. This event carries all the
573185732ac8SCy Schubert * necessary information from the host driver for the authentication to
573285732ac8SCy Schubert * happen.
573385732ac8SCy Schubert */
573485732ac8SCy Schubert EVENT_EXTERNAL_AUTH,
573585732ac8SCy Schubert
573685732ac8SCy Schubert /**
573785732ac8SCy Schubert * EVENT_PORT_AUTHORIZED - Notification that a connection is authorized
573885732ac8SCy Schubert *
573985732ac8SCy Schubert * This event should be indicated when the driver completes the 4-way
574085732ac8SCy Schubert * handshake. This event should be preceded by an EVENT_ASSOC that
574185732ac8SCy Schubert * indicates the completion of IEEE 802.11 association.
574285732ac8SCy Schubert */
574385732ac8SCy Schubert EVENT_PORT_AUTHORIZED,
574485732ac8SCy Schubert
574585732ac8SCy Schubert /**
574685732ac8SCy Schubert * EVENT_STATION_OPMODE_CHANGED - Notify STA's HT/VHT operation mode
574785732ac8SCy Schubert * change event.
574885732ac8SCy Schubert */
574985732ac8SCy Schubert EVENT_STATION_OPMODE_CHANGED,
575085732ac8SCy Schubert
575185732ac8SCy Schubert /**
575285732ac8SCy Schubert * EVENT_INTERFACE_MAC_CHANGED - Notify that interface MAC changed
575385732ac8SCy Schubert *
575485732ac8SCy Schubert * This event is emitted when the MAC changes while the interface is
575585732ac8SCy Schubert * enabled. When an interface was disabled and becomes enabled, it
575685732ac8SCy Schubert * must be always assumed that the MAC possibly changed.
575785732ac8SCy Schubert */
575885732ac8SCy Schubert EVENT_INTERFACE_MAC_CHANGED,
575985732ac8SCy Schubert
576085732ac8SCy Schubert /**
576185732ac8SCy Schubert * EVENT_WDS_STA_INTERFACE_STATUS - Notify WDS STA interface status
576285732ac8SCy Schubert *
576385732ac8SCy Schubert * This event is emitted when an interface is added/removed for WDS STA.
576485732ac8SCy Schubert */
576585732ac8SCy Schubert EVENT_WDS_STA_INTERFACE_STATUS,
5766206b73d0SCy Schubert
5767206b73d0SCy Schubert /**
5768206b73d0SCy Schubert * EVENT_UPDATE_DH - Notification of updated DH information
5769206b73d0SCy Schubert */
5770206b73d0SCy Schubert EVENT_UPDATE_DH,
5771c1d255d3SCy Schubert
5772c1d255d3SCy Schubert /**
5773c1d255d3SCy Schubert * EVENT_UNPROT_BEACON - Unprotected Beacon frame received
5774c1d255d3SCy Schubert *
5775c1d255d3SCy Schubert * This event should be called when a Beacon frame is dropped due to it
5776c1d255d3SCy Schubert * not being protected correctly. union wpa_event_data::unprot_beacon
5777c1d255d3SCy Schubert * is required to provide more details of the frame.
5778c1d255d3SCy Schubert */
5779c1d255d3SCy Schubert EVENT_UNPROT_BEACON,
5780*a90b9d01SCy Schubert
5781*a90b9d01SCy Schubert /**
5782*a90b9d01SCy Schubert * EVENT_TX_WAIT_EXPIRE - TX wait timed out
5783*a90b9d01SCy Schubert *
5784*a90b9d01SCy Schubert * This event is used to indicate when the driver has completed
5785*a90b9d01SCy Schubert * wait for a response frame based on a TX request that specified a
5786*a90b9d01SCy Schubert * non-zero wait time and that has not been explicitly cancelled.
5787*a90b9d01SCy Schubert */
5788*a90b9d01SCy Schubert EVENT_TX_WAIT_EXPIRE,
5789*a90b9d01SCy Schubert
5790*a90b9d01SCy Schubert /**
5791*a90b9d01SCy Schubert * EVENT_BSS_COLOR_COLLISION - Notification of a BSS color collision
5792*a90b9d01SCy Schubert */
5793*a90b9d01SCy Schubert EVENT_BSS_COLOR_COLLISION,
5794*a90b9d01SCy Schubert
5795*a90b9d01SCy Schubert /**
5796*a90b9d01SCy Schubert * EVENT_CCA_STARTED_NOTIFY - Notification that CCA has started
5797*a90b9d01SCy Schubert */
5798*a90b9d01SCy Schubert EVENT_CCA_STARTED_NOTIFY,
5799*a90b9d01SCy Schubert
5800*a90b9d01SCy Schubert /**
5801*a90b9d01SCy Schubert * EVENT_CCA_ABORTED_NOTIFY - Notification that CCA has aborted
5802*a90b9d01SCy Schubert */
5803*a90b9d01SCy Schubert EVENT_CCA_ABORTED_NOTIFY,
5804*a90b9d01SCy Schubert
5805*a90b9d01SCy Schubert /**
5806*a90b9d01SCy Schubert * EVENT_CCA_NOTIFY - Notification that CCA has completed
5807*a90b9d01SCy Schubert */
5808*a90b9d01SCy Schubert EVENT_CCA_NOTIFY,
5809*a90b9d01SCy Schubert
5810*a90b9d01SCy Schubert /**
5811*a90b9d01SCy Schubert * EVENT_PASN_AUTH - This event is used by the driver that requests
5812*a90b9d01SCy Schubert * PASN authentication and secure ranging context for multiple peers.
5813*a90b9d01SCy Schubert */
5814*a90b9d01SCy Schubert EVENT_PASN_AUTH,
5815*a90b9d01SCy Schubert
5816*a90b9d01SCy Schubert /**
5817*a90b9d01SCy Schubert * EVENT_LINK_CH_SWITCH - MLD AP link decided to switch channels
5818*a90b9d01SCy Schubert *
5819*a90b9d01SCy Schubert * Described in wpa_event_data.ch_switch.
5820*a90b9d01SCy Schubert *
5821*a90b9d01SCy Schubert */
5822*a90b9d01SCy Schubert EVENT_LINK_CH_SWITCH,
5823*a90b9d01SCy Schubert
5824*a90b9d01SCy Schubert /**
5825*a90b9d01SCy Schubert * EVENT_LINK_CH_SWITCH_STARTED - MLD AP link started to switch channels
5826*a90b9d01SCy Schubert *
5827*a90b9d01SCy Schubert * This is a pre-switch event indicating the shortly following switch
5828*a90b9d01SCy Schubert * of operating channels.
5829*a90b9d01SCy Schubert *
5830*a90b9d01SCy Schubert * Described in wpa_event_data.ch_switch.
5831*a90b9d01SCy Schubert */
5832*a90b9d01SCy Schubert EVENT_LINK_CH_SWITCH_STARTED,
5833*a90b9d01SCy Schubert
5834*a90b9d01SCy Schubert /**
5835*a90b9d01SCy Schubert * EVENT_TID_LINK_MAP - MLD event to set TID-to-link mapping
5836*a90b9d01SCy Schubert *
5837*a90b9d01SCy Schubert * This event is used by the driver to indicate the received TID-to-link
5838*a90b9d01SCy Schubert * mapping response from the associated AP MLD.
5839*a90b9d01SCy Schubert *
5840*a90b9d01SCy Schubert * Described in wpa_event_data.t2l_map_info.
5841*a90b9d01SCy Schubert */
5842*a90b9d01SCy Schubert EVENT_TID_LINK_MAP,
5843*a90b9d01SCy Schubert
5844*a90b9d01SCy Schubert /**
5845*a90b9d01SCy Schubert * EVENT_LINK_RECONFIG - Notification that AP links removed
5846*a90b9d01SCy Schubert */
5847*a90b9d01SCy Schubert EVENT_LINK_RECONFIG,
5848e28a4053SRui Paulo };
584939beb93cSSam Leffler
585039beb93cSSam Leffler
585139beb93cSSam Leffler /**
58525b9c547cSRui Paulo * struct freq_survey - Channel survey info
58535b9c547cSRui Paulo *
58545b9c547cSRui Paulo * @ifidx: Interface index in which this survey was observed
58555b9c547cSRui Paulo * @freq: Center of frequency of the surveyed channel
58565b9c547cSRui Paulo * @nf: Channel noise floor in dBm
58575b9c547cSRui Paulo * @channel_time: Amount of time in ms the radio spent on the channel
58585b9c547cSRui Paulo * @channel_time_busy: Amount of time in ms the radio detected some signal
58595b9c547cSRui Paulo * that indicated to the radio the channel was not clear
58605b9c547cSRui Paulo * @channel_time_rx: Amount of time the radio spent receiving data
58615b9c547cSRui Paulo * @channel_time_tx: Amount of time the radio spent transmitting data
58625b9c547cSRui Paulo * @filled: bitmask indicating which fields have been reported, see
58635b9c547cSRui Paulo * SURVEY_HAS_* defines.
58645b9c547cSRui Paulo * @list: Internal list pointers
58655b9c547cSRui Paulo */
58665b9c547cSRui Paulo struct freq_survey {
58675b9c547cSRui Paulo u32 ifidx;
58685b9c547cSRui Paulo unsigned int freq;
58695b9c547cSRui Paulo s8 nf;
58705b9c547cSRui Paulo u64 channel_time;
58715b9c547cSRui Paulo u64 channel_time_busy;
58725b9c547cSRui Paulo u64 channel_time_rx;
58735b9c547cSRui Paulo u64 channel_time_tx;
58745b9c547cSRui Paulo unsigned int filled;
58755b9c547cSRui Paulo struct dl_list list;
58765b9c547cSRui Paulo };
58775b9c547cSRui Paulo
58785b9c547cSRui Paulo #define SURVEY_HAS_NF BIT(0)
58795b9c547cSRui Paulo #define SURVEY_HAS_CHAN_TIME BIT(1)
58805b9c547cSRui Paulo #define SURVEY_HAS_CHAN_TIME_BUSY BIT(2)
58815b9c547cSRui Paulo #define SURVEY_HAS_CHAN_TIME_RX BIT(3)
58825b9c547cSRui Paulo #define SURVEY_HAS_CHAN_TIME_TX BIT(4)
58835b9c547cSRui Paulo
5884c1d255d3SCy Schubert /**
5885c1d255d3SCy Schubert * enum sta_connect_fail_reason_codes - STA connect failure reason code values
5886c1d255d3SCy Schubert * @STA_CONNECT_FAIL_REASON_UNSPECIFIED: No reason code specified for
5887c1d255d3SCy Schubert * connection failure.
5888c1d255d3SCy Schubert * @STA_CONNECT_FAIL_REASON_NO_BSS_FOUND: No Probe Response frame received
5889c1d255d3SCy Schubert * for unicast Probe Request frame.
5890c1d255d3SCy Schubert * @STA_CONNECT_FAIL_REASON_AUTH_TX_FAIL: STA failed to send auth request.
5891c1d255d3SCy Schubert * @STA_CONNECT_FAIL_REASON_AUTH_NO_ACK_RECEIVED: AP didn't send ACK for
5892c1d255d3SCy Schubert * auth request.
5893c1d255d3SCy Schubert * @STA_CONNECT_FAIL_REASON_AUTH_NO_RESP_RECEIVED: Auth response is not
5894c1d255d3SCy Schubert * received from AP.
5895c1d255d3SCy Schubert * @STA_CONNECT_FAIL_REASON_ASSOC_REQ_TX_FAIL: STA failed to send
5896c1d255d3SCy Schubert * Association Request frame.
5897c1d255d3SCy Schubert * @STA_CONNECT_FAIL_REASON_ASSOC_NO_ACK_RECEIVED: AP didn't send ACK for
5898c1d255d3SCy Schubert * Association Request frame.
5899c1d255d3SCy Schubert * @STA_CONNECT_FAIL_REASON_ASSOC_NO_RESP_RECEIVED: Association Response
5900c1d255d3SCy Schubert * frame is not received from AP.
5901c1d255d3SCy Schubert */
5902c1d255d3SCy Schubert enum sta_connect_fail_reason_codes {
5903c1d255d3SCy Schubert STA_CONNECT_FAIL_REASON_UNSPECIFIED = 0,
5904c1d255d3SCy Schubert STA_CONNECT_FAIL_REASON_NO_BSS_FOUND = 1,
5905c1d255d3SCy Schubert STA_CONNECT_FAIL_REASON_AUTH_TX_FAIL = 2,
5906c1d255d3SCy Schubert STA_CONNECT_FAIL_REASON_AUTH_NO_ACK_RECEIVED = 3,
5907c1d255d3SCy Schubert STA_CONNECT_FAIL_REASON_AUTH_NO_RESP_RECEIVED = 4,
5908c1d255d3SCy Schubert STA_CONNECT_FAIL_REASON_ASSOC_REQ_TX_FAIL = 5,
5909c1d255d3SCy Schubert STA_CONNECT_FAIL_REASON_ASSOC_NO_ACK_RECEIVED = 6,
5910c1d255d3SCy Schubert STA_CONNECT_FAIL_REASON_ASSOC_NO_RESP_RECEIVED = 7,
5911c1d255d3SCy Schubert };
59125b9c547cSRui Paulo
59135b9c547cSRui Paulo /**
591439beb93cSSam Leffler * union wpa_event_data - Additional data for wpa_supplicant_event() calls
591539beb93cSSam Leffler */
591639beb93cSSam Leffler union wpa_event_data {
591739beb93cSSam Leffler /**
591839beb93cSSam Leffler * struct assoc_info - Data for EVENT_ASSOC and EVENT_ASSOCINFO events
591939beb93cSSam Leffler *
592039beb93cSSam Leffler * This structure is optional for EVENT_ASSOC calls and required for
592139beb93cSSam Leffler * EVENT_ASSOCINFO calls. By using EVENT_ASSOC with this data, the
592239beb93cSSam Leffler * driver interface does not need to generate separate EVENT_ASSOCINFO
592339beb93cSSam Leffler * calls.
592439beb93cSSam Leffler */
592539beb93cSSam Leffler struct assoc_info {
592639beb93cSSam Leffler /**
5927f05cddf9SRui Paulo * reassoc - Flag to indicate association or reassociation
5928f05cddf9SRui Paulo */
5929f05cddf9SRui Paulo int reassoc;
5930f05cddf9SRui Paulo
5931f05cddf9SRui Paulo /**
593239beb93cSSam Leffler * req_ies - (Re)Association Request IEs
593339beb93cSSam Leffler *
593439beb93cSSam Leffler * If the driver generates WPA/RSN IE, this event data must be
593539beb93cSSam Leffler * returned for WPA handshake to have needed information. If
593639beb93cSSam Leffler * wpa_supplicant-generated WPA/RSN IE is used, this
593739beb93cSSam Leffler * information event is optional.
593839beb93cSSam Leffler *
593939beb93cSSam Leffler * This should start with the first IE (fixed fields before IEs
594039beb93cSSam Leffler * are not included).
594139beb93cSSam Leffler */
5942e28a4053SRui Paulo const u8 *req_ies;
594339beb93cSSam Leffler
594439beb93cSSam Leffler /**
594539beb93cSSam Leffler * req_ies_len - Length of req_ies in bytes
594639beb93cSSam Leffler */
594739beb93cSSam Leffler size_t req_ies_len;
594839beb93cSSam Leffler
594939beb93cSSam Leffler /**
595039beb93cSSam Leffler * resp_ies - (Re)Association Response IEs
595139beb93cSSam Leffler *
595239beb93cSSam Leffler * Optional association data from the driver. This data is not
595339beb93cSSam Leffler * required WPA, but may be useful for some protocols and as
595439beb93cSSam Leffler * such, should be reported if this is available to the driver
595539beb93cSSam Leffler * interface.
595639beb93cSSam Leffler *
595739beb93cSSam Leffler * This should start with the first IE (fixed fields before IEs
595839beb93cSSam Leffler * are not included).
595939beb93cSSam Leffler */
5960e28a4053SRui Paulo const u8 *resp_ies;
596139beb93cSSam Leffler
596239beb93cSSam Leffler /**
596339beb93cSSam Leffler * resp_ies_len - Length of resp_ies in bytes
596439beb93cSSam Leffler */
596539beb93cSSam Leffler size_t resp_ies_len;
596639beb93cSSam Leffler
596739beb93cSSam Leffler /**
596885732ac8SCy Schubert * resp_frame - (Re)Association Response frame
596985732ac8SCy Schubert */
597085732ac8SCy Schubert const u8 *resp_frame;
597185732ac8SCy Schubert
597285732ac8SCy Schubert /**
597385732ac8SCy Schubert * resp_frame_len - (Re)Association Response frame length
597485732ac8SCy Schubert */
597585732ac8SCy Schubert size_t resp_frame_len;
597685732ac8SCy Schubert
597785732ac8SCy Schubert /**
597839beb93cSSam Leffler * beacon_ies - Beacon or Probe Response IEs
597939beb93cSSam Leffler *
598039beb93cSSam Leffler * Optional Beacon/ProbeResp data: IEs included in Beacon or
598139beb93cSSam Leffler * Probe Response frames from the current AP (i.e., the one
598239beb93cSSam Leffler * that the client just associated with). This information is
598339beb93cSSam Leffler * used to update WPA/RSN IE for the AP. If this field is not
598439beb93cSSam Leffler * set, the results from previous scan will be used. If no
598539beb93cSSam Leffler * data for the new AP is found, scan results will be requested
598639beb93cSSam Leffler * again (without scan request). At this point, the driver is
598739beb93cSSam Leffler * expected to provide WPA/RSN IE for the AP (if WPA/WPA2 is
598839beb93cSSam Leffler * used).
598939beb93cSSam Leffler *
599039beb93cSSam Leffler * This should start with the first IE (fixed fields before IEs
599139beb93cSSam Leffler * are not included).
599239beb93cSSam Leffler */
5993e28a4053SRui Paulo const u8 *beacon_ies;
599439beb93cSSam Leffler
599539beb93cSSam Leffler /**
599639beb93cSSam Leffler * beacon_ies_len - Length of beacon_ies */
599739beb93cSSam Leffler size_t beacon_ies_len;
5998e28a4053SRui Paulo
5999e28a4053SRui Paulo /**
6000e28a4053SRui Paulo * freq - Frequency of the operational channel in MHz
6001e28a4053SRui Paulo */
6002e28a4053SRui Paulo unsigned int freq;
6003e28a4053SRui Paulo
6004e28a4053SRui Paulo /**
60055b9c547cSRui Paulo * wmm_params - WMM parameters used in this association.
60065b9c547cSRui Paulo */
60075b9c547cSRui Paulo struct wmm_params wmm_params;
60085b9c547cSRui Paulo
60095b9c547cSRui Paulo /**
6010e28a4053SRui Paulo * addr - Station address (for AP mode)
6011e28a4053SRui Paulo */
6012e28a4053SRui Paulo const u8 *addr;
60135b9c547cSRui Paulo
60145b9c547cSRui Paulo /**
60155b9c547cSRui Paulo * The following is the key management offload information
60165b9c547cSRui Paulo * @authorized
60175b9c547cSRui Paulo * @key_replay_ctr
60185b9c547cSRui Paulo * @key_replay_ctr_len
60195b9c547cSRui Paulo * @ptk_kck
60205b9c547cSRui Paulo * @ptk_kek_len
60215b9c547cSRui Paulo * @ptk_kek
60225b9c547cSRui Paulo * @ptk_kek_len
60235b9c547cSRui Paulo */
60245b9c547cSRui Paulo
60255b9c547cSRui Paulo /**
60265b9c547cSRui Paulo * authorized - Status of key management offload,
60275b9c547cSRui Paulo * 1 = successful
60285b9c547cSRui Paulo */
60295b9c547cSRui Paulo int authorized;
60305b9c547cSRui Paulo
60315b9c547cSRui Paulo /**
60325b9c547cSRui Paulo * key_replay_ctr - Key replay counter value last used
60335b9c547cSRui Paulo * in a valid EAPOL-Key frame
60345b9c547cSRui Paulo */
60355b9c547cSRui Paulo const u8 *key_replay_ctr;
60365b9c547cSRui Paulo
60375b9c547cSRui Paulo /**
60385b9c547cSRui Paulo * key_replay_ctr_len - The length of key_replay_ctr
60395b9c547cSRui Paulo */
60405b9c547cSRui Paulo size_t key_replay_ctr_len;
60415b9c547cSRui Paulo
60425b9c547cSRui Paulo /**
60435b9c547cSRui Paulo * ptk_kck - The derived PTK KCK
60445b9c547cSRui Paulo */
60455b9c547cSRui Paulo const u8 *ptk_kck;
60465b9c547cSRui Paulo
60475b9c547cSRui Paulo /**
60485b9c547cSRui Paulo * ptk_kek_len - The length of ptk_kck
60495b9c547cSRui Paulo */
60505b9c547cSRui Paulo size_t ptk_kck_len;
60515b9c547cSRui Paulo
60525b9c547cSRui Paulo /**
60535b9c547cSRui Paulo * ptk_kek - The derived PTK KEK
605485732ac8SCy Schubert * This is used in key management offload and also in FILS SK
605585732ac8SCy Schubert * offload.
60565b9c547cSRui Paulo */
60575b9c547cSRui Paulo const u8 *ptk_kek;
60585b9c547cSRui Paulo
60595b9c547cSRui Paulo /**
60605b9c547cSRui Paulo * ptk_kek_len - The length of ptk_kek
60615b9c547cSRui Paulo */
60625b9c547cSRui Paulo size_t ptk_kek_len;
6063780fb4a2SCy Schubert
6064780fb4a2SCy Schubert /**
6065780fb4a2SCy Schubert * subnet_status - The subnet status:
6066780fb4a2SCy Schubert * 0 = unknown, 1 = unchanged, 2 = changed
6067780fb4a2SCy Schubert */
6068780fb4a2SCy Schubert u8 subnet_status;
606985732ac8SCy Schubert
607085732ac8SCy Schubert /**
607185732ac8SCy Schubert * The following information is used in FILS SK offload
607285732ac8SCy Schubert * @fils_erp_next_seq_num
607385732ac8SCy Schubert * @fils_pmk
607485732ac8SCy Schubert * @fils_pmk_len
607585732ac8SCy Schubert * @fils_pmkid
607685732ac8SCy Schubert */
607785732ac8SCy Schubert
607885732ac8SCy Schubert /**
607985732ac8SCy Schubert * fils_erp_next_seq_num - The next sequence number to use in
608085732ac8SCy Schubert * FILS ERP messages
608185732ac8SCy Schubert */
608285732ac8SCy Schubert u16 fils_erp_next_seq_num;
608385732ac8SCy Schubert
608485732ac8SCy Schubert /**
608585732ac8SCy Schubert * fils_pmk - A new PMK if generated in case of FILS
608685732ac8SCy Schubert * authentication
608785732ac8SCy Schubert */
608885732ac8SCy Schubert const u8 *fils_pmk;
608985732ac8SCy Schubert
609085732ac8SCy Schubert /**
609185732ac8SCy Schubert * fils_pmk_len - Length of fils_pmk
609285732ac8SCy Schubert */
609385732ac8SCy Schubert size_t fils_pmk_len;
609485732ac8SCy Schubert
609585732ac8SCy Schubert /**
609685732ac8SCy Schubert * fils_pmkid - PMKID used or generated in FILS authentication
609785732ac8SCy Schubert */
609885732ac8SCy Schubert const u8 *fils_pmkid;
6099*a90b9d01SCy Schubert
6100*a90b9d01SCy Schubert /**
6101*a90b9d01SCy Schubert * link_addr - Link address of the STA
6102*a90b9d01SCy Schubert */
6103*a90b9d01SCy Schubert const u8 *link_addr;
6104*a90b9d01SCy Schubert
6105*a90b9d01SCy Schubert /**
6106*a90b9d01SCy Schubert * assoc_link_id - Association link id of the MLO association or
6107*a90b9d01SCy Schubert * -1 if MLO is not used
6108*a90b9d01SCy Schubert */
6109*a90b9d01SCy Schubert int assoc_link_id;
611039beb93cSSam Leffler } assoc_info;
611139beb93cSSam Leffler
611239beb93cSSam Leffler /**
6113e28a4053SRui Paulo * struct disassoc_info - Data for EVENT_DISASSOC events
6114e28a4053SRui Paulo */
6115e28a4053SRui Paulo struct disassoc_info {
6116e28a4053SRui Paulo /**
6117e28a4053SRui Paulo * addr - Station address (for AP mode)
6118e28a4053SRui Paulo */
6119e28a4053SRui Paulo const u8 *addr;
6120e28a4053SRui Paulo
6121e28a4053SRui Paulo /**
6122e28a4053SRui Paulo * reason_code - Reason Code (host byte order) used in
6123e28a4053SRui Paulo * Deauthentication frame
6124e28a4053SRui Paulo */
6125e28a4053SRui Paulo u16 reason_code;
6126f05cddf9SRui Paulo
6127f05cddf9SRui Paulo /**
6128f05cddf9SRui Paulo * ie - Optional IE(s) in Disassociation frame
6129f05cddf9SRui Paulo */
6130f05cddf9SRui Paulo const u8 *ie;
6131f05cddf9SRui Paulo
6132f05cddf9SRui Paulo /**
6133f05cddf9SRui Paulo * ie_len - Length of ie buffer in octets
6134f05cddf9SRui Paulo */
6135f05cddf9SRui Paulo size_t ie_len;
6136f05cddf9SRui Paulo
6137f05cddf9SRui Paulo /**
6138f05cddf9SRui Paulo * locally_generated - Whether the frame was locally generated
6139f05cddf9SRui Paulo */
6140f05cddf9SRui Paulo int locally_generated;
6141e28a4053SRui Paulo } disassoc_info;
6142e28a4053SRui Paulo
6143e28a4053SRui Paulo /**
6144e28a4053SRui Paulo * struct deauth_info - Data for EVENT_DEAUTH events
6145e28a4053SRui Paulo */
6146e28a4053SRui Paulo struct deauth_info {
6147e28a4053SRui Paulo /**
6148e28a4053SRui Paulo * addr - Station address (for AP mode)
6149e28a4053SRui Paulo */
6150e28a4053SRui Paulo const u8 *addr;
6151e28a4053SRui Paulo
6152e28a4053SRui Paulo /**
6153e28a4053SRui Paulo * reason_code - Reason Code (host byte order) used in
6154e28a4053SRui Paulo * Deauthentication frame
6155e28a4053SRui Paulo */
6156e28a4053SRui Paulo u16 reason_code;
6157f05cddf9SRui Paulo
6158f05cddf9SRui Paulo /**
6159f05cddf9SRui Paulo * ie - Optional IE(s) in Deauthentication frame
6160f05cddf9SRui Paulo */
6161f05cddf9SRui Paulo const u8 *ie;
6162f05cddf9SRui Paulo
6163f05cddf9SRui Paulo /**
6164f05cddf9SRui Paulo * ie_len - Length of ie buffer in octets
6165f05cddf9SRui Paulo */
6166f05cddf9SRui Paulo size_t ie_len;
6167f05cddf9SRui Paulo
6168f05cddf9SRui Paulo /**
6169f05cddf9SRui Paulo * locally_generated - Whether the frame was locally generated
6170f05cddf9SRui Paulo */
6171f05cddf9SRui Paulo int locally_generated;
6172e28a4053SRui Paulo } deauth_info;
6173e28a4053SRui Paulo
6174e28a4053SRui Paulo /**
617539beb93cSSam Leffler * struct michael_mic_failure - Data for EVENT_MICHAEL_MIC_FAILURE
617639beb93cSSam Leffler */
617739beb93cSSam Leffler struct michael_mic_failure {
617839beb93cSSam Leffler int unicast;
6179e28a4053SRui Paulo const u8 *src;
618039beb93cSSam Leffler } michael_mic_failure;
618139beb93cSSam Leffler
618239beb93cSSam Leffler /**
618339beb93cSSam Leffler * struct interface_status - Data for EVENT_INTERFACE_STATUS
618439beb93cSSam Leffler */
618539beb93cSSam Leffler struct interface_status {
6186780fb4a2SCy Schubert unsigned int ifindex;
618739beb93cSSam Leffler char ifname[100];
618839beb93cSSam Leffler enum {
618939beb93cSSam Leffler EVENT_INTERFACE_ADDED, EVENT_INTERFACE_REMOVED
619039beb93cSSam Leffler } ievent;
619139beb93cSSam Leffler } interface_status;
619239beb93cSSam Leffler
619339beb93cSSam Leffler /**
619439beb93cSSam Leffler * struct pmkid_candidate - Data for EVENT_PMKID_CANDIDATE
619539beb93cSSam Leffler */
619639beb93cSSam Leffler struct pmkid_candidate {
619739beb93cSSam Leffler /** BSSID of the PMKID candidate */
619839beb93cSSam Leffler u8 bssid[ETH_ALEN];
619939beb93cSSam Leffler /** Smaller the index, higher the priority */
620039beb93cSSam Leffler int index;
620139beb93cSSam Leffler /** Whether RSN IE includes pre-authenticate flag */
620239beb93cSSam Leffler int preauth;
620339beb93cSSam Leffler } pmkid_candidate;
620439beb93cSSam Leffler
620539beb93cSSam Leffler /**
6206f05cddf9SRui Paulo * struct tdls - Data for EVENT_TDLS
6207f05cddf9SRui Paulo */
6208f05cddf9SRui Paulo struct tdls {
6209f05cddf9SRui Paulo u8 peer[ETH_ALEN];
6210f05cddf9SRui Paulo enum {
6211f05cddf9SRui Paulo TDLS_REQUEST_SETUP,
62125b9c547cSRui Paulo TDLS_REQUEST_TEARDOWN,
62135b9c547cSRui Paulo TDLS_REQUEST_DISCOVER,
6214f05cddf9SRui Paulo } oper;
6215f05cddf9SRui Paulo u16 reason_code; /* for teardown */
6216f05cddf9SRui Paulo } tdls;
6217f05cddf9SRui Paulo
6218f05cddf9SRui Paulo /**
6219f05cddf9SRui Paulo * struct wnm - Data for EVENT_WNM
6220f05cddf9SRui Paulo */
6221f05cddf9SRui Paulo struct wnm {
6222f05cddf9SRui Paulo u8 addr[ETH_ALEN];
6223f05cddf9SRui Paulo enum {
6224f05cddf9SRui Paulo WNM_OPER_SLEEP,
6225f05cddf9SRui Paulo } oper;
6226f05cddf9SRui Paulo enum {
6227f05cddf9SRui Paulo WNM_SLEEP_ENTER,
6228f05cddf9SRui Paulo WNM_SLEEP_EXIT
6229f05cddf9SRui Paulo } sleep_action;
6230f05cddf9SRui Paulo int sleep_intval;
6231f05cddf9SRui Paulo u16 reason_code;
6232f05cddf9SRui Paulo u8 *buf;
6233f05cddf9SRui Paulo u16 buf_len;
6234f05cddf9SRui Paulo } wnm;
6235f05cddf9SRui Paulo
6236f05cddf9SRui Paulo /**
623739beb93cSSam Leffler * struct ft_ies - FT information elements (EVENT_FT_RESPONSE)
623839beb93cSSam Leffler *
623939beb93cSSam Leffler * During FT (IEEE 802.11r) authentication sequence, the driver is
624039beb93cSSam Leffler * expected to use this event to report received FT IEs (MDIE, FTIE,
624139beb93cSSam Leffler * RSN IE, TIE, possible resource request) to the supplicant. The FT
624239beb93cSSam Leffler * IEs for the next message will be delivered through the
624339beb93cSSam Leffler * struct wpa_driver_ops::update_ft_ies() callback.
624439beb93cSSam Leffler */
624539beb93cSSam Leffler struct ft_ies {
624639beb93cSSam Leffler const u8 *ies;
624739beb93cSSam Leffler size_t ies_len;
624839beb93cSSam Leffler int ft_action;
624939beb93cSSam Leffler u8 target_ap[ETH_ALEN];
6250e28a4053SRui Paulo /** Optional IE(s), e.g., WMM TSPEC(s), for RIC-Request */
6251e28a4053SRui Paulo const u8 *ric_ies;
6252e28a4053SRui Paulo /** Length of ric_ies buffer in octets */
6253e28a4053SRui Paulo size_t ric_ies_len;
625439beb93cSSam Leffler } ft_ies;
6255e28a4053SRui Paulo
6256e28a4053SRui Paulo /**
6257e28a4053SRui Paulo * struct ibss_rsn_start - Data for EVENT_IBSS_RSN_START
6258e28a4053SRui Paulo */
6259e28a4053SRui Paulo struct ibss_rsn_start {
6260e28a4053SRui Paulo u8 peer[ETH_ALEN];
6261e28a4053SRui Paulo } ibss_rsn_start;
6262e28a4053SRui Paulo
6263e28a4053SRui Paulo /**
6264e28a4053SRui Paulo * struct auth_info - Data for EVENT_AUTH events
6265e28a4053SRui Paulo */
6266e28a4053SRui Paulo struct auth_info {
6267e28a4053SRui Paulo u8 peer[ETH_ALEN];
6268f05cddf9SRui Paulo u8 bssid[ETH_ALEN];
6269e28a4053SRui Paulo u16 auth_type;
6270f05cddf9SRui Paulo u16 auth_transaction;
6271e28a4053SRui Paulo u16 status_code;
6272e28a4053SRui Paulo const u8 *ies;
6273e28a4053SRui Paulo size_t ies_len;
6274e28a4053SRui Paulo } auth;
6275e28a4053SRui Paulo
6276e28a4053SRui Paulo /**
6277e28a4053SRui Paulo * struct assoc_reject - Data for EVENT_ASSOC_REJECT events
6278e28a4053SRui Paulo */
6279e28a4053SRui Paulo struct assoc_reject {
6280e28a4053SRui Paulo /**
6281f05cddf9SRui Paulo * bssid - BSSID of the AP that rejected association
6282f05cddf9SRui Paulo */
6283f05cddf9SRui Paulo const u8 *bssid;
6284f05cddf9SRui Paulo
6285f05cddf9SRui Paulo /**
6286e28a4053SRui Paulo * resp_ies - (Re)Association Response IEs
6287e28a4053SRui Paulo *
6288e28a4053SRui Paulo * Optional association data from the driver. This data is not
6289e28a4053SRui Paulo * required WPA, but may be useful for some protocols and as
6290e28a4053SRui Paulo * such, should be reported if this is available to the driver
6291e28a4053SRui Paulo * interface.
6292e28a4053SRui Paulo *
6293e28a4053SRui Paulo * This should start with the first IE (fixed fields before IEs
6294e28a4053SRui Paulo * are not included).
6295e28a4053SRui Paulo */
6296f05cddf9SRui Paulo const u8 *resp_ies;
6297e28a4053SRui Paulo
6298e28a4053SRui Paulo /**
6299e28a4053SRui Paulo * resp_ies_len - Length of resp_ies in bytes
6300e28a4053SRui Paulo */
6301e28a4053SRui Paulo size_t resp_ies_len;
6302e28a4053SRui Paulo
6303e28a4053SRui Paulo /**
6304e28a4053SRui Paulo * status_code - Status Code from (Re)association Response
6305e28a4053SRui Paulo */
6306e28a4053SRui Paulo u16 status_code;
6307780fb4a2SCy Schubert
6308780fb4a2SCy Schubert /**
6309780fb4a2SCy Schubert * timed_out - Whether failure is due to timeout (etc.) rather
6310780fb4a2SCy Schubert * than explicit rejection response from the AP.
6311780fb4a2SCy Schubert */
6312780fb4a2SCy Schubert int timed_out;
631385732ac8SCy Schubert
631485732ac8SCy Schubert /**
631585732ac8SCy Schubert * timeout_reason - Reason for the timeout
631685732ac8SCy Schubert */
631785732ac8SCy Schubert const char *timeout_reason;
631885732ac8SCy Schubert
631985732ac8SCy Schubert /**
632085732ac8SCy Schubert * fils_erp_next_seq_num - The next sequence number to use in
632185732ac8SCy Schubert * FILS ERP messages
632285732ac8SCy Schubert */
632385732ac8SCy Schubert u16 fils_erp_next_seq_num;
6324c1d255d3SCy Schubert
6325c1d255d3SCy Schubert /**
6326c1d255d3SCy Schubert * reason_code - Connection failure reason code from the driver
6327c1d255d3SCy Schubert */
6328c1d255d3SCy Schubert enum sta_connect_fail_reason_codes reason_code;
6329e28a4053SRui Paulo } assoc_reject;
6330e28a4053SRui Paulo
6331e28a4053SRui Paulo struct timeout_event {
6332e28a4053SRui Paulo u8 addr[ETH_ALEN];
6333e28a4053SRui Paulo } timeout_event;
6334e28a4053SRui Paulo
6335e28a4053SRui Paulo /**
6336e28a4053SRui Paulo * struct tx_status - Data for EVENT_TX_STATUS events
6337e28a4053SRui Paulo */
6338e28a4053SRui Paulo struct tx_status {
6339e28a4053SRui Paulo u16 type;
6340e28a4053SRui Paulo u16 stype;
6341e28a4053SRui Paulo const u8 *dst;
6342e28a4053SRui Paulo const u8 *data;
6343e28a4053SRui Paulo size_t data_len;
6344e28a4053SRui Paulo int ack;
6345*a90b9d01SCy Schubert int link_id;
6346e28a4053SRui Paulo } tx_status;
6347e28a4053SRui Paulo
6348e28a4053SRui Paulo /**
6349e28a4053SRui Paulo * struct rx_from_unknown - Data for EVENT_RX_FROM_UNKNOWN events
6350e28a4053SRui Paulo */
6351e28a4053SRui Paulo struct rx_from_unknown {
6352f05cddf9SRui Paulo const u8 *bssid;
6353f05cddf9SRui Paulo const u8 *addr;
6354f05cddf9SRui Paulo int wds;
6355e28a4053SRui Paulo } rx_from_unknown;
6356e28a4053SRui Paulo
6357e28a4053SRui Paulo /**
6358e28a4053SRui Paulo * struct rx_mgmt - Data for EVENT_RX_MGMT events
6359e28a4053SRui Paulo */
6360e28a4053SRui Paulo struct rx_mgmt {
6361e28a4053SRui Paulo const u8 *frame;
6362e28a4053SRui Paulo size_t frame_len;
6363e28a4053SRui Paulo u32 datarate;
6364e28a4053SRui Paulo
6365e28a4053SRui Paulo /**
63665b9c547cSRui Paulo * drv_priv - Pointer to store driver private BSS information
63675b9c547cSRui Paulo *
63685b9c547cSRui Paulo * If not set to NULL, this is used for comparison with
63695b9c547cSRui Paulo * hostapd_data->drv_priv to determine which BSS should process
63705b9c547cSRui Paulo * the frame.
6371e28a4053SRui Paulo */
63725b9c547cSRui Paulo void *drv_priv;
6373e28a4053SRui Paulo
6374e28a4053SRui Paulo /**
6375*a90b9d01SCy Schubert * ctx - Pointer to store ctx of private BSS information
6376*a90b9d01SCy Schubert *
6377*a90b9d01SCy Schubert * If not set to NULL, this is used for forwarding the packet
6378*a90b9d01SCy Schubert * to right link BSS of ML BSS.
6379*a90b9d01SCy Schubert */
6380*a90b9d01SCy Schubert void *ctx;
6381*a90b9d01SCy Schubert
6382*a90b9d01SCy Schubert /**
6383e28a4053SRui Paulo * freq - Frequency (in MHz) on which the frame was received
6384e28a4053SRui Paulo */
6385e28a4053SRui Paulo int freq;
63865b9c547cSRui Paulo
63875b9c547cSRui Paulo /**
63885b9c547cSRui Paulo * ssi_signal - Signal strength in dBm (or 0 if not available)
63895b9c547cSRui Paulo */
63905b9c547cSRui Paulo int ssi_signal;
6391*a90b9d01SCy Schubert
6392*a90b9d01SCy Schubert /**
6393*a90b9d01SCy Schubert * link_id - MLO link on which the frame was received or -1 for
6394*a90b9d01SCy Schubert * non MLD.
6395*a90b9d01SCy Schubert */
6396*a90b9d01SCy Schubert int link_id;
63975b9c547cSRui Paulo } rx_mgmt;
6398e28a4053SRui Paulo
6399e28a4053SRui Paulo /**
6400e28a4053SRui Paulo * struct remain_on_channel - Data for EVENT_REMAIN_ON_CHANNEL events
6401e28a4053SRui Paulo *
6402e28a4053SRui Paulo * This is also used with EVENT_CANCEL_REMAIN_ON_CHANNEL events.
6403e28a4053SRui Paulo */
6404e28a4053SRui Paulo struct remain_on_channel {
6405e28a4053SRui Paulo /**
6406e28a4053SRui Paulo * freq - Channel frequency in MHz
6407e28a4053SRui Paulo */
6408e28a4053SRui Paulo unsigned int freq;
6409e28a4053SRui Paulo
6410e28a4053SRui Paulo /**
6411e28a4053SRui Paulo * duration - Duration to remain on the channel in milliseconds
6412e28a4053SRui Paulo */
6413e28a4053SRui Paulo unsigned int duration;
6414e28a4053SRui Paulo } remain_on_channel;
6415e28a4053SRui Paulo
6416e28a4053SRui Paulo /**
6417e28a4053SRui Paulo * struct scan_info - Optional data for EVENT_SCAN_RESULTS events
6418e28a4053SRui Paulo * @aborted: Whether the scan was aborted
6419e28a4053SRui Paulo * @freqs: Scanned frequencies in MHz (%NULL = all channels scanned)
6420e28a4053SRui Paulo * @num_freqs: Number of entries in freqs array
6421e28a4053SRui Paulo * @ssids: Scanned SSIDs (%NULL or zero-length SSID indicates wildcard
6422e28a4053SRui Paulo * SSID)
6423e28a4053SRui Paulo * @num_ssids: Number of entries in ssids array
6424780fb4a2SCy Schubert * @external_scan: Whether the scan info is for an external scan
6425780fb4a2SCy Schubert * @nl_scan_event: 1 if the source of this scan event is a normal scan,
6426780fb4a2SCy Schubert * 0 if the source of the scan event is a vendor scan
642785732ac8SCy Schubert * @scan_start_tsf: Time when the scan started in terms of TSF of the
642885732ac8SCy Schubert * BSS that the interface that requested the scan is connected to
642985732ac8SCy Schubert * (if available).
643085732ac8SCy Schubert * @scan_start_tsf_bssid: The BSSID according to which %scan_start_tsf
643185732ac8SCy Schubert * is set.
6432*a90b9d01SCy Schubert * @scan_cookie: Unique identification representing the corresponding
6433*a90b9d01SCy Schubert * scan request. 0 if no unique identification is available.
6434e28a4053SRui Paulo */
6435e28a4053SRui Paulo struct scan_info {
6436e28a4053SRui Paulo int aborted;
6437e28a4053SRui Paulo const int *freqs;
6438e28a4053SRui Paulo size_t num_freqs;
6439e28a4053SRui Paulo struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS];
6440e28a4053SRui Paulo size_t num_ssids;
6441780fb4a2SCy Schubert int external_scan;
6442780fb4a2SCy Schubert int nl_scan_event;
644385732ac8SCy Schubert u64 scan_start_tsf;
644485732ac8SCy Schubert u8 scan_start_tsf_bssid[ETH_ALEN];
6445*a90b9d01SCy Schubert u64 scan_cookie;
6446e28a4053SRui Paulo } scan_info;
6447e28a4053SRui Paulo
6448e28a4053SRui Paulo /**
6449e28a4053SRui Paulo * struct rx_probe_req - Data for EVENT_RX_PROBE_REQ events
6450e28a4053SRui Paulo */
6451e28a4053SRui Paulo struct rx_probe_req {
6452e28a4053SRui Paulo /**
6453e28a4053SRui Paulo * sa - Source address of the received Probe Request frame
6454e28a4053SRui Paulo */
6455e28a4053SRui Paulo const u8 *sa;
6456e28a4053SRui Paulo
6457e28a4053SRui Paulo /**
6458f05cddf9SRui Paulo * da - Destination address of the received Probe Request frame
6459f05cddf9SRui Paulo * or %NULL if not available
6460f05cddf9SRui Paulo */
6461f05cddf9SRui Paulo const u8 *da;
6462f05cddf9SRui Paulo
6463f05cddf9SRui Paulo /**
6464f05cddf9SRui Paulo * bssid - BSSID of the received Probe Request frame or %NULL
6465f05cddf9SRui Paulo * if not available
6466f05cddf9SRui Paulo */
6467f05cddf9SRui Paulo const u8 *bssid;
6468f05cddf9SRui Paulo
6469f05cddf9SRui Paulo /**
6470e28a4053SRui Paulo * ie - IEs from the Probe Request body
6471e28a4053SRui Paulo */
6472e28a4053SRui Paulo const u8 *ie;
6473e28a4053SRui Paulo
6474e28a4053SRui Paulo /**
6475e28a4053SRui Paulo * ie_len - Length of ie buffer in octets
6476e28a4053SRui Paulo */
6477e28a4053SRui Paulo size_t ie_len;
6478f05cddf9SRui Paulo
6479f05cddf9SRui Paulo /**
6480f05cddf9SRui Paulo * signal - signal strength in dBm (or 0 if not available)
6481f05cddf9SRui Paulo */
6482f05cddf9SRui Paulo int ssi_signal;
6483e28a4053SRui Paulo } rx_probe_req;
6484e28a4053SRui Paulo
6485e28a4053SRui Paulo /**
6486e28a4053SRui Paulo * struct new_sta - Data for EVENT_NEW_STA events
6487e28a4053SRui Paulo */
6488e28a4053SRui Paulo struct new_sta {
6489e28a4053SRui Paulo const u8 *addr;
6490e28a4053SRui Paulo } new_sta;
6491e28a4053SRui Paulo
6492e28a4053SRui Paulo /**
6493e28a4053SRui Paulo * struct eapol_rx - Data for EVENT_EAPOL_RX events
6494e28a4053SRui Paulo */
6495e28a4053SRui Paulo struct eapol_rx {
6496e28a4053SRui Paulo const u8 *src;
6497e28a4053SRui Paulo const u8 *data;
6498e28a4053SRui Paulo size_t data_len;
6499*a90b9d01SCy Schubert enum frame_encryption encrypted;
6500*a90b9d01SCy Schubert int link_id;
6501e28a4053SRui Paulo } eapol_rx;
6502e28a4053SRui Paulo
6503e28a4053SRui Paulo /**
6504f05cddf9SRui Paulo * signal_change - Data for EVENT_SIGNAL_CHANGE events
6505e28a4053SRui Paulo */
6506f05cddf9SRui Paulo struct wpa_signal_info signal_change;
6507f05cddf9SRui Paulo
6508f05cddf9SRui Paulo /**
6509f05cddf9SRui Paulo * struct best_channel - Data for EVENT_BEST_CHANNEL events
6510f05cddf9SRui Paulo * @freq_24: Best 2.4 GHz band channel frequency in MHz
6511f05cddf9SRui Paulo * @freq_5: Best 5 GHz band channel frequency in MHz
6512f05cddf9SRui Paulo * @freq_overall: Best channel frequency in MHz
6513f05cddf9SRui Paulo *
6514f05cddf9SRui Paulo * 0 can be used to indicate no preference in either band.
6515f05cddf9SRui Paulo */
6516f05cddf9SRui Paulo struct best_channel {
6517f05cddf9SRui Paulo int freq_24;
6518f05cddf9SRui Paulo int freq_5;
6519f05cddf9SRui Paulo int freq_overall;
6520f05cddf9SRui Paulo } best_chan;
6521f05cddf9SRui Paulo
6522f05cddf9SRui Paulo struct unprot_deauth {
6523f05cddf9SRui Paulo const u8 *sa;
6524f05cddf9SRui Paulo const u8 *da;
6525f05cddf9SRui Paulo u16 reason_code;
6526f05cddf9SRui Paulo } unprot_deauth;
6527f05cddf9SRui Paulo
6528f05cddf9SRui Paulo struct unprot_disassoc {
6529f05cddf9SRui Paulo const u8 *sa;
6530f05cddf9SRui Paulo const u8 *da;
6531f05cddf9SRui Paulo u16 reason_code;
6532f05cddf9SRui Paulo } unprot_disassoc;
6533f05cddf9SRui Paulo
6534f05cddf9SRui Paulo /**
6535f05cddf9SRui Paulo * struct low_ack - Data for EVENT_STATION_LOW_ACK events
6536f05cddf9SRui Paulo * @addr: station address
653785732ac8SCy Schubert * @num_packets: Number of packets lost (consecutive packets not
653885732ac8SCy Schubert * acknowledged)
6539f05cddf9SRui Paulo */
6540f05cddf9SRui Paulo struct low_ack {
6541f05cddf9SRui Paulo u8 addr[ETH_ALEN];
654285732ac8SCy Schubert u32 num_packets;
6543f05cddf9SRui Paulo } low_ack;
6544f05cddf9SRui Paulo
6545f05cddf9SRui Paulo /**
6546f05cddf9SRui Paulo * struct ibss_peer_lost - Data for EVENT_IBSS_PEER_LOST
6547f05cddf9SRui Paulo */
6548f05cddf9SRui Paulo struct ibss_peer_lost {
6549f05cddf9SRui Paulo u8 peer[ETH_ALEN];
6550f05cddf9SRui Paulo } ibss_peer_lost;
6551f05cddf9SRui Paulo
6552f05cddf9SRui Paulo /**
6553f05cddf9SRui Paulo * struct driver_gtk_rekey - Data for EVENT_DRIVER_GTK_REKEY
6554f05cddf9SRui Paulo */
6555f05cddf9SRui Paulo struct driver_gtk_rekey {
6556f05cddf9SRui Paulo const u8 *bssid;
6557f05cddf9SRui Paulo const u8 *replay_ctr;
6558f05cddf9SRui Paulo } driver_gtk_rekey;
6559f05cddf9SRui Paulo
6560f05cddf9SRui Paulo /**
6561f05cddf9SRui Paulo * struct client_poll - Data for EVENT_DRIVER_CLIENT_POLL_OK events
6562f05cddf9SRui Paulo * @addr: station address
6563f05cddf9SRui Paulo */
6564f05cddf9SRui Paulo struct client_poll {
6565f05cddf9SRui Paulo u8 addr[ETH_ALEN];
6566f05cddf9SRui Paulo } client_poll;
6567f05cddf9SRui Paulo
6568f05cddf9SRui Paulo /**
6569f05cddf9SRui Paulo * struct eapol_tx_status
6570f05cddf9SRui Paulo * @dst: Original destination
6571f05cddf9SRui Paulo * @data: Data starting with IEEE 802.1X header (!)
6572f05cddf9SRui Paulo * @data_len: Length of data
6573f05cddf9SRui Paulo * @ack: Indicates ack or lost frame
6574*a90b9d01SCy Schubert * @link_id: MLD link id used to transmit the frame or -1 for non MLO
6575f05cddf9SRui Paulo *
6576f05cddf9SRui Paulo * This corresponds to hapd_send_eapol if the frame sent
6577f05cddf9SRui Paulo * there isn't just reported as EVENT_TX_STATUS.
6578f05cddf9SRui Paulo */
6579f05cddf9SRui Paulo struct eapol_tx_status {
6580f05cddf9SRui Paulo const u8 *dst;
6581f05cddf9SRui Paulo const u8 *data;
6582f05cddf9SRui Paulo int data_len;
6583f05cddf9SRui Paulo int ack;
6584*a90b9d01SCy Schubert int link_id;
6585f05cddf9SRui Paulo } eapol_tx_status;
6586f05cddf9SRui Paulo
6587f05cddf9SRui Paulo /**
6588f05cddf9SRui Paulo * struct ch_switch
6589f05cddf9SRui Paulo * @freq: Frequency of new channel in MHz
6590f05cddf9SRui Paulo * @ht_enabled: Whether this is an HT channel
6591f05cddf9SRui Paulo * @ch_offset: Secondary channel offset
65925b9c547cSRui Paulo * @ch_width: Channel width
65935b9c547cSRui Paulo * @cf1: Center frequency 1
65945b9c547cSRui Paulo * @cf2: Center frequency 2
6595*a90b9d01SCy Schubert * @link_id: Link ID of the MLO link
6596*a90b9d01SCy Schubert * @punct_bitmap: Puncturing bitmap
6597f05cddf9SRui Paulo */
6598f05cddf9SRui Paulo struct ch_switch {
6599f05cddf9SRui Paulo int freq;
6600f05cddf9SRui Paulo int ht_enabled;
6601f05cddf9SRui Paulo int ch_offset;
66025b9c547cSRui Paulo enum chan_width ch_width;
66035b9c547cSRui Paulo int cf1;
66045b9c547cSRui Paulo int cf2;
6605*a90b9d01SCy Schubert int link_id;
6606*a90b9d01SCy Schubert u16 punct_bitmap;
6607f05cddf9SRui Paulo } ch_switch;
66085b9c547cSRui Paulo
66095b9c547cSRui Paulo /**
66105b9c547cSRui Paulo * struct connect_failed - Data for EVENT_CONNECT_FAILED_REASON
66115b9c547cSRui Paulo * @addr: Remote client address
66125b9c547cSRui Paulo * @code: Reason code for connection failure
66135b9c547cSRui Paulo */
66145b9c547cSRui Paulo struct connect_failed_reason {
66155b9c547cSRui Paulo u8 addr[ETH_ALEN];
66165b9c547cSRui Paulo enum {
66175b9c547cSRui Paulo MAX_CLIENT_REACHED,
66185b9c547cSRui Paulo BLOCKED_CLIENT
66195b9c547cSRui Paulo } code;
66205b9c547cSRui Paulo } connect_failed_reason;
66215b9c547cSRui Paulo
66225b9c547cSRui Paulo /**
66235b9c547cSRui Paulo * struct dfs_event - Data for radar detected events
66245b9c547cSRui Paulo * @freq: Frequency of the channel in MHz
6625*a90b9d01SCy Schubert * @link_id: If >= 0, Link ID of the MLO link
66265b9c547cSRui Paulo */
66275b9c547cSRui Paulo struct dfs_event {
66285b9c547cSRui Paulo int freq;
66295b9c547cSRui Paulo int ht_enabled;
66305b9c547cSRui Paulo int chan_offset;
66315b9c547cSRui Paulo enum chan_width chan_width;
66325b9c547cSRui Paulo int cf1;
66335b9c547cSRui Paulo int cf2;
6634*a90b9d01SCy Schubert int link_id;
66355b9c547cSRui Paulo } dfs_event;
66365b9c547cSRui Paulo
66375b9c547cSRui Paulo /**
66385b9c547cSRui Paulo * survey_results - Survey result data for EVENT_SURVEY
66395b9c547cSRui Paulo * @freq_filter: Requested frequency survey filter, 0 if request
66405b9c547cSRui Paulo * was for all survey data
66415b9c547cSRui Paulo * @survey_list: Linked list of survey data (struct freq_survey)
66425b9c547cSRui Paulo */
66435b9c547cSRui Paulo struct survey_results {
66445b9c547cSRui Paulo unsigned int freq_filter;
66455b9c547cSRui Paulo struct dl_list survey_list; /* struct freq_survey */
66465b9c547cSRui Paulo } survey_results;
66475b9c547cSRui Paulo
66485b9c547cSRui Paulo /**
66495b9c547cSRui Paulo * channel_list_changed - Data for EVENT_CHANNEL_LIST_CHANGED
66505b9c547cSRui Paulo * @initiator: Initiator of the regulatory change
66515b9c547cSRui Paulo * @type: Regulatory change type
66525b9c547cSRui Paulo * @alpha2: Country code (or "" if not available)
6653*a90b9d01SCy Schubert * @beacon_hint_before: Data for frequency attributes before beacon hint
6654*a90b9d01SCy Schubert * event if initiator == REGDOM_BEACON_HINT
6655*a90b9d01SCy Schubert * @beacon_hint_after: Data for frequency attributes after beacon hint
6656*a90b9d01SCy Schubert * event if initiator == REGDOM_BEACON_HINT
66575b9c547cSRui Paulo */
66585b9c547cSRui Paulo struct channel_list_changed {
66595b9c547cSRui Paulo enum reg_change_initiator initiator;
66605b9c547cSRui Paulo enum reg_type type;
66615b9c547cSRui Paulo char alpha2[3];
6662*a90b9d01SCy Schubert struct frequency_attrs {
6663*a90b9d01SCy Schubert unsigned int freq;
6664*a90b9d01SCy Schubert unsigned int max_tx_power;
6665*a90b9d01SCy Schubert bool disabled;
6666*a90b9d01SCy Schubert bool no_ir;
6667*a90b9d01SCy Schubert bool radar;
6668*a90b9d01SCy Schubert } beacon_hint_before, beacon_hint_after;
66695b9c547cSRui Paulo } channel_list_changed;
66705b9c547cSRui Paulo
66715b9c547cSRui Paulo /**
66725b9c547cSRui Paulo * freq_range - List of frequency ranges
66735b9c547cSRui Paulo *
66745b9c547cSRui Paulo * This is used as the data with EVENT_AVOID_FREQUENCIES.
66755b9c547cSRui Paulo */
66765b9c547cSRui Paulo struct wpa_freq_range_list freq_range;
66775b9c547cSRui Paulo
66785b9c547cSRui Paulo /**
66795b9c547cSRui Paulo * struct mesh_peer
66805b9c547cSRui Paulo *
66815b9c547cSRui Paulo * @peer: Peer address
66825b9c547cSRui Paulo * @ies: Beacon IEs
66835b9c547cSRui Paulo * @ie_len: Length of @ies
66845b9c547cSRui Paulo *
66855b9c547cSRui Paulo * Notification of new candidate mesh peer.
66865b9c547cSRui Paulo */
66875b9c547cSRui Paulo struct mesh_peer {
66885b9c547cSRui Paulo const u8 *peer;
66895b9c547cSRui Paulo const u8 *ies;
66905b9c547cSRui Paulo size_t ie_len;
66915b9c547cSRui Paulo } mesh_peer;
66925b9c547cSRui Paulo
66935b9c547cSRui Paulo /**
66945b9c547cSRui Paulo * struct acs_selected_channels - Data for EVENT_ACS_CHANNEL_SELECTED
6695c1d255d3SCy Schubert * @pri_freq: Selected primary frequency
6696c1d255d3SCy Schubert * @sec_freq: Selected secondary frequency
6697c1d255d3SCy Schubert * @edmg_channel: Selected EDMG channel
6698325151a3SRui Paulo * @vht_seg0_center_ch: VHT mode Segment0 center channel
6699c1d255d3SCy Schubert * The value is the index of the channel center frequency for
6700c1d255d3SCy Schubert * 20 MHz, 40 MHz, and 80 MHz channels. The value is the center
6701c1d255d3SCy Schubert * frequency index of the primary 80 MHz segment for 160 MHz and
6702c1d255d3SCy Schubert * 80+80 MHz channels.
6703325151a3SRui Paulo * @vht_seg1_center_ch: VHT mode Segment1 center channel
6704c1d255d3SCy Schubert * The value is zero for 20 MHz, 40 MHz, and 80 MHz channels. The
6705c1d255d3SCy Schubert * value is the index of the channel center frequency for 160 MHz
6706c1d255d3SCy Schubert * channels and the center frequency index of the secondary 80 MHz
6707c1d255d3SCy Schubert * segment for 80+80 MHz channels.
6708325151a3SRui Paulo * @ch_width: Selected Channel width by driver. Driver may choose to
6709325151a3SRui Paulo * change hostapd configured ACS channel width due driver internal
6710325151a3SRui Paulo * channel restrictions.
6711*a90b9d01SCy Schubert * @hw_mode: Selected band (used with hw_mode=any)
6712*a90b9d01SCy Schubert * @puncture_bitmap: Indicate the puncturing channels
6713*a90b9d01SCy Schubert * @link_id: Indicate the link id if operating as AP MLD; -1 otherwise
67145b9c547cSRui Paulo */
67155b9c547cSRui Paulo struct acs_selected_channels {
6716c1d255d3SCy Schubert unsigned int pri_freq;
6717c1d255d3SCy Schubert unsigned int sec_freq;
6718c1d255d3SCy Schubert u8 edmg_channel;
6719325151a3SRui Paulo u8 vht_seg0_center_ch;
6720325151a3SRui Paulo u8 vht_seg1_center_ch;
6721325151a3SRui Paulo u16 ch_width;
6722325151a3SRui Paulo enum hostapd_hw_mode hw_mode;
6723*a90b9d01SCy Schubert u16 puncture_bitmap;
6724*a90b9d01SCy Schubert int link_id;
67255b9c547cSRui Paulo } acs_selected_channels;
6726780fb4a2SCy Schubert
6727780fb4a2SCy Schubert /**
6728780fb4a2SCy Schubert * struct p2p_lo_stop - Reason code for P2P Listen offload stop event
6729780fb4a2SCy Schubert * @reason_code: Reason for stopping offload
6730780fb4a2SCy Schubert * P2P_LO_STOPPED_REASON_COMPLETE: Listen offload finished as
6731780fb4a2SCy Schubert * scheduled.
6732780fb4a2SCy Schubert * P2P_LO_STOPPED_REASON_RECV_STOP_CMD: Host requested offload to
6733780fb4a2SCy Schubert * be stopped.
6734780fb4a2SCy Schubert * P2P_LO_STOPPED_REASON_INVALID_PARAM: Invalid listen offload
6735780fb4a2SCy Schubert * parameters.
6736780fb4a2SCy Schubert * P2P_LO_STOPPED_REASON_NOT_SUPPORTED: Listen offload not
6737780fb4a2SCy Schubert * supported by device.
6738780fb4a2SCy Schubert */
6739780fb4a2SCy Schubert struct p2p_lo_stop {
6740780fb4a2SCy Schubert enum {
6741780fb4a2SCy Schubert P2P_LO_STOPPED_REASON_COMPLETE = 0,
6742780fb4a2SCy Schubert P2P_LO_STOPPED_REASON_RECV_STOP_CMD,
6743780fb4a2SCy Schubert P2P_LO_STOPPED_REASON_INVALID_PARAM,
6744780fb4a2SCy Schubert P2P_LO_STOPPED_REASON_NOT_SUPPORTED,
6745780fb4a2SCy Schubert } reason_code;
6746780fb4a2SCy Schubert } p2p_lo_stop;
674785732ac8SCy Schubert
674885732ac8SCy Schubert /* For EVENT_EXTERNAL_AUTH */
674985732ac8SCy Schubert struct external_auth external_auth;
675085732ac8SCy Schubert
675185732ac8SCy Schubert /**
675285732ac8SCy Schubert * struct sta_opmode - Station's operation mode change event
675385732ac8SCy Schubert * @addr: The station MAC address
675485732ac8SCy Schubert * @smps_mode: SMPS mode of the station
675585732ac8SCy Schubert * @chan_width: Channel width of the station
675685732ac8SCy Schubert * @rx_nss: RX_NSS of the station
675785732ac8SCy Schubert *
675885732ac8SCy Schubert * This is used as data with EVENT_STATION_OPMODE_CHANGED.
675985732ac8SCy Schubert */
676085732ac8SCy Schubert struct sta_opmode {
676185732ac8SCy Schubert const u8 *addr;
676285732ac8SCy Schubert enum smps_mode smps_mode;
676385732ac8SCy Schubert enum chan_width chan_width;
676485732ac8SCy Schubert u8 rx_nss;
676585732ac8SCy Schubert } sta_opmode;
676685732ac8SCy Schubert
676785732ac8SCy Schubert /**
676885732ac8SCy Schubert * struct wds_sta_interface - Data for EVENT_WDS_STA_INTERFACE_STATUS.
676985732ac8SCy Schubert */
677085732ac8SCy Schubert struct wds_sta_interface {
677185732ac8SCy Schubert const u8 *sta_addr;
677285732ac8SCy Schubert const char *ifname;
677385732ac8SCy Schubert enum {
677485732ac8SCy Schubert INTERFACE_ADDED,
677585732ac8SCy Schubert INTERFACE_REMOVED
677685732ac8SCy Schubert } istatus;
677785732ac8SCy Schubert } wds_sta_interface;
6778206b73d0SCy Schubert
6779206b73d0SCy Schubert /**
6780206b73d0SCy Schubert * struct update_dh - Data for EVENT_UPDATE_DH
6781206b73d0SCy Schubert */
6782206b73d0SCy Schubert struct update_dh {
6783206b73d0SCy Schubert const u8 *peer;
6784206b73d0SCy Schubert const u8 *ie;
6785206b73d0SCy Schubert size_t ie_len;
6786*a90b9d01SCy Schubert int assoc_link_id;
6787*a90b9d01SCy Schubert const u8 *link_addr;
6788206b73d0SCy Schubert } update_dh;
6789c1d255d3SCy Schubert
6790c1d255d3SCy Schubert /**
6791c1d255d3SCy Schubert * struct unprot_beacon - Data for EVENT_UNPROT_BEACON
6792c1d255d3SCy Schubert */
6793c1d255d3SCy Schubert struct unprot_beacon {
6794c1d255d3SCy Schubert const u8 *sa;
6795c1d255d3SCy Schubert } unprot_beacon;
6796*a90b9d01SCy Schubert
6797*a90b9d01SCy Schubert /**
6798*a90b9d01SCy Schubert * struct bss_color_collision - Data for EVENT_BSS_COLOR_COLLISION
6799*a90b9d01SCy Schubert */
6800*a90b9d01SCy Schubert struct bss_color_collision {
6801*a90b9d01SCy Schubert u64 bitmap;
6802*a90b9d01SCy Schubert int link_id;
6803*a90b9d01SCy Schubert } bss_color_collision;
6804*a90b9d01SCy Schubert
6805*a90b9d01SCy Schubert /**
6806*a90b9d01SCy Schubert * struct pasn_auth - Data for EVENT_PASN_AUTH
6807*a90b9d01SCy Schubert */
6808*a90b9d01SCy Schubert struct pasn_auth pasn_auth;
6809*a90b9d01SCy Schubert
6810*a90b9d01SCy Schubert /**
6811*a90b9d01SCy Schubert * struct port_authorized - Data for EVENT_PORT_AUTHORIZED
6812*a90b9d01SCy Schubert * @td_bitmap: For STA mode, transition disable bitmap, if received in
6813*a90b9d01SCy Schubert * EAPOL-Key msg 3/4
6814*a90b9d01SCy Schubert * @td_bitmap_len: For STA mode, length of td_bitmap
6815*a90b9d01SCy Schubert * @sta_addr: For AP mode, the MAC address of the associated STA
6816*a90b9d01SCy Schubert *
6817*a90b9d01SCy Schubert * This event is used to indicate that the port is authorized and
6818*a90b9d01SCy Schubert * open for normal data in STA and AP modes when 4-way handshake is
6819*a90b9d01SCy Schubert * offloaded to the driver.
6820*a90b9d01SCy Schubert */
6821*a90b9d01SCy Schubert struct port_authorized {
6822*a90b9d01SCy Schubert const u8 *td_bitmap;
6823*a90b9d01SCy Schubert size_t td_bitmap_len;
6824*a90b9d01SCy Schubert const u8 *sta_addr;
6825*a90b9d01SCy Schubert } port_authorized;
6826*a90b9d01SCy Schubert
6827*a90b9d01SCy Schubert /**
6828*a90b9d01SCy Schubert * struct tid_link_map_info - Data for EVENT_TID_LINK_MAP
6829*a90b9d01SCy Schubert */
6830*a90b9d01SCy Schubert struct tid_link_map_info {
6831*a90b9d01SCy Schubert bool default_map;
6832*a90b9d01SCy Schubert u8 valid_links;
6833*a90b9d01SCy Schubert struct t2lm_mapping t2lmap[MAX_NUM_MLD_LINKS];
6834*a90b9d01SCy Schubert } t2l_map_info;
683539beb93cSSam Leffler };
683639beb93cSSam Leffler
683739beb93cSSam Leffler /**
683839beb93cSSam Leffler * wpa_supplicant_event - Report a driver event for wpa_supplicant
683939beb93cSSam Leffler * @ctx: Context pointer (wpa_s); this is the ctx variable registered
684039beb93cSSam Leffler * with struct wpa_driver_ops::init()
684139beb93cSSam Leffler * @event: event type (defined above)
684239beb93cSSam Leffler * @data: possible extra data for the event
684339beb93cSSam Leffler *
684439beb93cSSam Leffler * Driver wrapper code should call this function whenever an event is received
684539beb93cSSam Leffler * from the driver.
684639beb93cSSam Leffler */
6847e28a4053SRui Paulo void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
684839beb93cSSam Leffler union wpa_event_data *data);
684939beb93cSSam Leffler
6850780fb4a2SCy Schubert /**
6851780fb4a2SCy Schubert * wpa_supplicant_event_global - Report a driver event for wpa_supplicant
6852780fb4a2SCy Schubert * @ctx: Context pointer (wpa_s); this is the ctx variable registered
6853780fb4a2SCy Schubert * with struct wpa_driver_ops::init()
6854780fb4a2SCy Schubert * @event: event type (defined above)
6855780fb4a2SCy Schubert * @data: possible extra data for the event
6856780fb4a2SCy Schubert *
6857780fb4a2SCy Schubert * Same as wpa_supplicant_event(), but we search for the interface in
6858780fb4a2SCy Schubert * wpa_global.
6859780fb4a2SCy Schubert */
6860780fb4a2SCy Schubert void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
6861780fb4a2SCy Schubert union wpa_event_data *data);
6862e28a4053SRui Paulo
6863e28a4053SRui Paulo /*
6864e28a4053SRui Paulo * The following inline functions are provided for convenience to simplify
6865e28a4053SRui Paulo * event indication for some of the common events.
686639beb93cSSam Leffler */
686739beb93cSSam Leffler
drv_event_assoc(void * ctx,const u8 * addr,const u8 * req_ies,size_t req_ielen,const u8 * resp_ies,size_t resp_ielen,const u8 * link_addr,int assoc_link_id,int reassoc)6868*a90b9d01SCy Schubert static inline void drv_event_assoc(void *ctx, const u8 *addr, const u8 *req_ies,
6869*a90b9d01SCy Schubert size_t req_ielen, const u8 *resp_ies,
6870*a90b9d01SCy Schubert size_t resp_ielen, const u8 *link_addr,
6871*a90b9d01SCy Schubert int assoc_link_id, int reassoc)
6872e28a4053SRui Paulo {
6873e28a4053SRui Paulo union wpa_event_data event;
6874e28a4053SRui Paulo os_memset(&event, 0, sizeof(event));
6875f05cddf9SRui Paulo event.assoc_info.reassoc = reassoc;
6876*a90b9d01SCy Schubert event.assoc_info.req_ies = req_ies;
6877*a90b9d01SCy Schubert event.assoc_info.req_ies_len = req_ielen;
6878*a90b9d01SCy Schubert event.assoc_info.resp_ies = resp_ies;
6879*a90b9d01SCy Schubert event.assoc_info.resp_ies_len = resp_ielen;
6880e28a4053SRui Paulo event.assoc_info.addr = addr;
6881*a90b9d01SCy Schubert event.assoc_info.link_addr = link_addr;
6882*a90b9d01SCy Schubert event.assoc_info.assoc_link_id = assoc_link_id;
6883e28a4053SRui Paulo wpa_supplicant_event(ctx, EVENT_ASSOC, &event);
6884e28a4053SRui Paulo }
688539beb93cSSam Leffler
drv_event_disassoc(void * ctx,const u8 * addr)6886e28a4053SRui Paulo static inline void drv_event_disassoc(void *ctx, const u8 *addr)
6887e28a4053SRui Paulo {
6888e28a4053SRui Paulo union wpa_event_data event;
6889e28a4053SRui Paulo os_memset(&event, 0, sizeof(event));
6890e28a4053SRui Paulo event.disassoc_info.addr = addr;
6891e28a4053SRui Paulo wpa_supplicant_event(ctx, EVENT_DISASSOC, &event);
6892e28a4053SRui Paulo }
6893e28a4053SRui Paulo
drv_event_eapol_rx(void * ctx,const u8 * src,const u8 * data,size_t data_len)6894e28a4053SRui Paulo static inline void drv_event_eapol_rx(void *ctx, const u8 *src, const u8 *data,
6895e28a4053SRui Paulo size_t data_len)
6896e28a4053SRui Paulo {
6897e28a4053SRui Paulo union wpa_event_data event;
6898e28a4053SRui Paulo os_memset(&event, 0, sizeof(event));
6899e28a4053SRui Paulo event.eapol_rx.src = src;
6900e28a4053SRui Paulo event.eapol_rx.data = data;
6901e28a4053SRui Paulo event.eapol_rx.data_len = data_len;
6902*a90b9d01SCy Schubert event.eapol_rx.encrypted = FRAME_ENCRYPTION_UNKNOWN;
6903*a90b9d01SCy Schubert event.eapol_rx.link_id = -1;
6904*a90b9d01SCy Schubert wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event);
6905*a90b9d01SCy Schubert }
6906*a90b9d01SCy Schubert
drv_event_eapol_rx2(void * ctx,const u8 * src,const u8 * data,size_t data_len,enum frame_encryption encrypted,int link_id)6907*a90b9d01SCy Schubert static inline void drv_event_eapol_rx2(void *ctx, const u8 *src, const u8 *data,
6908*a90b9d01SCy Schubert size_t data_len,
6909*a90b9d01SCy Schubert enum frame_encryption encrypted,
6910*a90b9d01SCy Schubert int link_id)
6911*a90b9d01SCy Schubert {
6912*a90b9d01SCy Schubert union wpa_event_data event;
6913*a90b9d01SCy Schubert os_memset(&event, 0, sizeof(event));
6914*a90b9d01SCy Schubert event.eapol_rx.src = src;
6915*a90b9d01SCy Schubert event.eapol_rx.data = data;
6916*a90b9d01SCy Schubert event.eapol_rx.data_len = data_len;
6917*a90b9d01SCy Schubert event.eapol_rx.encrypted = encrypted;
6918*a90b9d01SCy Schubert event.eapol_rx.link_id = link_id;
6919e28a4053SRui Paulo wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event);
6920e28a4053SRui Paulo }
692139beb93cSSam Leffler
6922f05cddf9SRui Paulo /* driver_common.c */
6923f05cddf9SRui Paulo void wpa_scan_results_free(struct wpa_scan_results *res);
6924f05cddf9SRui Paulo
6925f05cddf9SRui Paulo /* Convert wpa_event_type to a string for logging */
6926f05cddf9SRui Paulo const char * event_to_string(enum wpa_event_type event);
6927f05cddf9SRui Paulo
69285b9c547cSRui Paulo /* Convert chan_width to a string for logging and control interfaces */
69295b9c547cSRui Paulo const char * channel_width_to_string(enum chan_width width);
69305b9c547cSRui Paulo
69314bc52338SCy Schubert int channel_width_to_int(enum chan_width width);
69324bc52338SCy Schubert
69335b9c547cSRui Paulo int ht_supported(const struct hostapd_hw_modes *mode);
69345b9c547cSRui Paulo int vht_supported(const struct hostapd_hw_modes *mode);
6935*a90b9d01SCy Schubert bool he_supported(const struct hostapd_hw_modes *hw_mode,
6936*a90b9d01SCy Schubert enum ieee80211_op_mode op_mode);
69375b9c547cSRui Paulo
69385b9c547cSRui Paulo struct wowlan_triggers *
69395b9c547cSRui Paulo wpa_get_wowlan_triggers(const char *wowlan_triggers,
69405b9c547cSRui Paulo const struct wpa_driver_capa *capa);
6941780fb4a2SCy Schubert /* Convert driver flag to string */
6942780fb4a2SCy Schubert const char * driver_flag_to_string(u64 flag);
6943c1d255d3SCy Schubert const char * driver_flag2_to_string(u64 flag2);
69445b9c547cSRui Paulo
69455b9c547cSRui Paulo /* NULL terminated array of linked in driver wrappers */
6946325151a3SRui Paulo extern const struct wpa_driver_ops *const wpa_drivers[];
69475b9c547cSRui Paulo
6948780fb4a2SCy Schubert
6949780fb4a2SCy Schubert /* Available drivers */
6950780fb4a2SCy Schubert
6951780fb4a2SCy Schubert #ifdef CONFIG_DRIVER_WEXT
6952780fb4a2SCy Schubert extern const struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */
6953780fb4a2SCy Schubert #endif /* CONFIG_DRIVER_WEXT */
6954780fb4a2SCy Schubert #ifdef CONFIG_DRIVER_NL80211
6955780fb4a2SCy Schubert /* driver_nl80211.c */
6956780fb4a2SCy Schubert extern const struct wpa_driver_ops wpa_driver_nl80211_ops;
6957780fb4a2SCy Schubert #endif /* CONFIG_DRIVER_NL80211 */
6958780fb4a2SCy Schubert #ifdef CONFIG_DRIVER_HOSTAP
6959780fb4a2SCy Schubert extern const struct wpa_driver_ops wpa_driver_hostap_ops; /* driver_hostap.c */
6960780fb4a2SCy Schubert #endif /* CONFIG_DRIVER_HOSTAP */
6961780fb4a2SCy Schubert #ifdef CONFIG_DRIVER_BSD
6962780fb4a2SCy Schubert extern const struct wpa_driver_ops wpa_driver_bsd_ops; /* driver_bsd.c */
6963780fb4a2SCy Schubert #endif /* CONFIG_DRIVER_BSD */
6964780fb4a2SCy Schubert #ifdef CONFIG_DRIVER_OPENBSD
6965780fb4a2SCy Schubert /* driver_openbsd.c */
6966780fb4a2SCy Schubert extern const struct wpa_driver_ops wpa_driver_openbsd_ops;
6967780fb4a2SCy Schubert #endif /* CONFIG_DRIVER_OPENBSD */
6968780fb4a2SCy Schubert #ifdef CONFIG_DRIVER_NDIS
6969780fb4a2SCy Schubert extern struct wpa_driver_ops wpa_driver_ndis_ops; /* driver_ndis.c */
6970780fb4a2SCy Schubert #endif /* CONFIG_DRIVER_NDIS */
6971780fb4a2SCy Schubert #ifdef CONFIG_DRIVER_WIRED
6972780fb4a2SCy Schubert extern const struct wpa_driver_ops wpa_driver_wired_ops; /* driver_wired.c */
6973780fb4a2SCy Schubert #endif /* CONFIG_DRIVER_WIRED */
6974780fb4a2SCy Schubert #ifdef CONFIG_DRIVER_MACSEC_QCA
6975780fb4a2SCy Schubert /* driver_macsec_qca.c */
6976780fb4a2SCy Schubert extern const struct wpa_driver_ops wpa_driver_macsec_qca_ops;
6977780fb4a2SCy Schubert #endif /* CONFIG_DRIVER_MACSEC_QCA */
697885732ac8SCy Schubert #ifdef CONFIG_DRIVER_MACSEC_LINUX
697985732ac8SCy Schubert /* driver_macsec_linux.c */
698085732ac8SCy Schubert extern const struct wpa_driver_ops wpa_driver_macsec_linux_ops;
698185732ac8SCy Schubert #endif /* CONFIG_DRIVER_MACSEC_LINUX */
6982780fb4a2SCy Schubert #ifdef CONFIG_DRIVER_ROBOSWITCH
6983780fb4a2SCy Schubert /* driver_roboswitch.c */
6984780fb4a2SCy Schubert extern const struct wpa_driver_ops wpa_driver_roboswitch_ops;
6985780fb4a2SCy Schubert #endif /* CONFIG_DRIVER_ROBOSWITCH */
6986780fb4a2SCy Schubert #ifdef CONFIG_DRIVER_ATHEROS
6987780fb4a2SCy Schubert /* driver_atheros.c */
6988780fb4a2SCy Schubert extern const struct wpa_driver_ops wpa_driver_atheros_ops;
6989780fb4a2SCy Schubert #endif /* CONFIG_DRIVER_ATHEROS */
6990780fb4a2SCy Schubert #ifdef CONFIG_DRIVER_NONE
6991780fb4a2SCy Schubert extern const struct wpa_driver_ops wpa_driver_none_ops; /* driver_none.c */
6992780fb4a2SCy Schubert #endif /* CONFIG_DRIVER_NONE */
6993780fb4a2SCy Schubert
699439beb93cSSam Leffler #endif /* DRIVER_H */
6995