1189251Ssam/*
2214734Srpaulo * Driver interface definition
3346981Scy * Copyright (c) 2003-2017, Jouni Malinen <j@w1.fi>
4189251Ssam *
5252726Srpaulo * This software may be distributed under the terms of the BSD license.
6252726Srpaulo * See README for more details.
7189251Ssam *
8214734Srpaulo * This file defines a driver interface used by both %wpa_supplicant and
9214734Srpaulo * hostapd. The first part of the file defines data structures used in various
10214734Srpaulo * driver operations. This is followed by the struct wpa_driver_ops that each
11214734Srpaulo * driver wrapper will beed to define with callback functions for requesting
12214734Srpaulo * driver operations. After this, there are definitions for driver event
13214734Srpaulo * reporting with wpa_supplicant_event() and some convenience helper functions
14214734Srpaulo * that can be used to report events.
15189251Ssam */
16189251Ssam
17189251Ssam#ifndef DRIVER_H
18189251Ssam#define DRIVER_H
19189251Ssam
20214734Srpaulo#define WPA_SUPPLICANT_DRIVER_VERSION 4
21189251Ssam
22214734Srpaulo#include "common/defs.h"
23289549Srpaulo#include "common/ieee802_11_defs.h"
24346981Scy#include "common/wpa_common.h"
25346981Scy#ifdef CONFIG_MACSEC
26346981Scy#include "pae/ieee802_1x_kay.h"
27346981Scy#endif /* CONFIG_MACSEC */
28281806Srpaulo#include "utils/list.h"
29189251Ssam
30214734Srpaulo#define HOSTAPD_CHAN_DISABLED 0x00000001
31281806Srpaulo#define HOSTAPD_CHAN_NO_IR 0x00000002
32214734Srpaulo#define HOSTAPD_CHAN_RADAR 0x00000008
33252726Srpaulo#define HOSTAPD_CHAN_HT40PLUS 0x00000010
34252726Srpaulo#define HOSTAPD_CHAN_HT40MINUS 0x00000020
35252726Srpaulo#define HOSTAPD_CHAN_HT40 0x00000040
36281806Srpaulo#define HOSTAPD_CHAN_SURVEY_LIST_INITIALIZED 0x00000080
37189251Ssam
38281806Srpaulo#define HOSTAPD_CHAN_DFS_UNKNOWN 0x00000000
39281806Srpaulo#define HOSTAPD_CHAN_DFS_USABLE 0x00000100
40281806Srpaulo#define HOSTAPD_CHAN_DFS_UNAVAILABLE 0x00000200
41281806Srpaulo#define HOSTAPD_CHAN_DFS_AVAILABLE 0x00000300
42281806Srpaulo#define HOSTAPD_CHAN_DFS_MASK 0x00000300
43281806Srpaulo
44281806Srpaulo#define HOSTAPD_CHAN_VHT_10_70 0x00000800
45281806Srpaulo#define HOSTAPD_CHAN_VHT_30_50 0x00001000
46281806Srpaulo#define HOSTAPD_CHAN_VHT_50_30 0x00002000
47281806Srpaulo#define HOSTAPD_CHAN_VHT_70_10 0x00004000
48281806Srpaulo
49281806Srpaulo#define HOSTAPD_CHAN_INDOOR_ONLY 0x00010000
50281806Srpaulo#define HOSTAPD_CHAN_GO_CONCURRENT 0x00020000
51281806Srpaulo
52337817Scy#define HOSTAPD_CHAN_VHT_10_150 0x00100000
53337817Scy#define HOSTAPD_CHAN_VHT_30_130 0x00200000
54337817Scy#define HOSTAPD_CHAN_VHT_50_110 0x00400000
55337817Scy#define HOSTAPD_CHAN_VHT_70_90  0x00800000
56337817Scy#define HOSTAPD_CHAN_VHT_90_70  0x01000000
57337817Scy#define HOSTAPD_CHAN_VHT_110_50 0x02000000
58337817Scy#define HOSTAPD_CHAN_VHT_130_30 0x04000000
59337817Scy#define HOSTAPD_CHAN_VHT_150_10 0x08000000
60337817Scy
61346981Scy/* Allowed bandwidth mask */
62346981Scyenum hostapd_chan_width_attr {
63346981Scy	HOSTAPD_CHAN_WIDTH_10   = BIT(0),
64346981Scy	HOSTAPD_CHAN_WIDTH_20   = BIT(1),
65346981Scy	HOSTAPD_CHAN_WIDTH_40P  = BIT(2),
66346981Scy	HOSTAPD_CHAN_WIDTH_40M  = BIT(3),
67346981Scy	HOSTAPD_CHAN_WIDTH_80   = BIT(4),
68346981Scy	HOSTAPD_CHAN_WIDTH_160  = BIT(5),
69346981Scy};
70346981Scy
71337817Scy/* Filter gratuitous ARP */
72337817Scy#define WPA_DATA_FRAME_FILTER_FLAG_ARP BIT(0)
73337817Scy/* Filter unsolicited Neighbor Advertisement */
74337817Scy#define WPA_DATA_FRAME_FILTER_FLAG_NA BIT(1)
75337817Scy/* Filter unicast IP packets encrypted using the GTK */
76337817Scy#define WPA_DATA_FRAME_FILTER_FLAG_GTK BIT(2)
77337817Scy
78346981Scy#define HOSTAPD_DFS_REGION_FCC	1
79346981Scy#define HOSTAPD_DFS_REGION_ETSI	2
80346981Scy#define HOSTAPD_DFS_REGION_JP	3
81346981Scy
82214734Srpaulo/**
83281806Srpaulo * enum reg_change_initiator - Regulatory change initiator
84281806Srpaulo */
85281806Srpauloenum reg_change_initiator {
86281806Srpaulo	REGDOM_SET_BY_CORE,
87281806Srpaulo	REGDOM_SET_BY_USER,
88281806Srpaulo	REGDOM_SET_BY_DRIVER,
89281806Srpaulo	REGDOM_SET_BY_COUNTRY_IE,
90281806Srpaulo	REGDOM_BEACON_HINT,
91281806Srpaulo};
92281806Srpaulo
93281806Srpaulo/**
94281806Srpaulo * enum reg_type - Regulatory change types
95281806Srpaulo */
96281806Srpauloenum reg_type {
97281806Srpaulo	REGDOM_TYPE_UNKNOWN,
98281806Srpaulo	REGDOM_TYPE_COUNTRY,
99281806Srpaulo	REGDOM_TYPE_WORLD,
100281806Srpaulo	REGDOM_TYPE_CUSTOM_WORLD,
101281806Srpaulo	REGDOM_TYPE_INTERSECTION,
102281806Srpaulo};
103281806Srpaulo
104281806Srpaulo/**
105351611Scy * struct hostapd_wmm_rule - WMM regulatory rule
106351611Scy * @min_cwmin: Lower bound of CW_min value
107351611Scy * @min_cwmax: Lower bound of CW_max value
108351611Scy * @min_aifs: Lower bound of AIFS value
109351611Scy * @max_txop: Upper bound of TXOP, value in units of 32 usec
110351611Scy */
111351611Scystruct hostapd_wmm_rule {
112351611Scy	int min_cwmin;
113351611Scy	int min_cwmax;
114351611Scy	int min_aifs;
115351611Scy	int max_txop;
116351611Scy};
117351611Scy
118351611Scy/**
119214734Srpaulo * struct hostapd_channel_data - Channel information
120214734Srpaulo */
121214734Srpaulostruct hostapd_channel_data {
122214734Srpaulo	/**
123214734Srpaulo	 * chan - Channel number (IEEE 802.11)
124214734Srpaulo	 */
125214734Srpaulo	short chan;
126214734Srpaulo
127214734Srpaulo	/**
128214734Srpaulo	 * freq - Frequency in MHz
129214734Srpaulo	 */
130252726Srpaulo	int freq;
131214734Srpaulo
132214734Srpaulo	/**
133214734Srpaulo	 * flag - Channel flags (HOSTAPD_CHAN_*)
134214734Srpaulo	 */
135214734Srpaulo	int flag;
136214734Srpaulo
137214734Srpaulo	/**
138346981Scy	 * allowed_bw - Allowed channel width bitmask
139346981Scy	 *
140346981Scy	 * See enum hostapd_chan_width_attr.
141346981Scy	 */
142346981Scy	u32 allowed_bw;
143346981Scy
144346981Scy	/**
145281806Srpaulo	 * max_tx_power - Regulatory transmit power limit in dBm
146214734Srpaulo	 */
147214734Srpaulo	u8 max_tx_power;
148281806Srpaulo
149281806Srpaulo	/**
150281806Srpaulo	 * survey_list - Linked list of surveys (struct freq_survey)
151281806Srpaulo	 */
152281806Srpaulo	struct dl_list survey_list;
153281806Srpaulo
154281806Srpaulo	/**
155281806Srpaulo	 * min_nf - Minimum observed noise floor, in dBm, based on all
156281806Srpaulo	 * surveyed channel data
157281806Srpaulo	 */
158281806Srpaulo	s8 min_nf;
159281806Srpaulo
160281806Srpaulo#ifdef CONFIG_ACS
161281806Srpaulo	/**
162281806Srpaulo	 * interference_factor - Computed interference factor on this
163281806Srpaulo	 * channel (used internally in src/ap/acs.c; driver wrappers do not
164281806Srpaulo	 * need to set this)
165281806Srpaulo	 */
166281806Srpaulo	long double interference_factor;
167281806Srpaulo#endif /* CONFIG_ACS */
168281806Srpaulo
169281806Srpaulo	/**
170281806Srpaulo	 * dfs_cac_ms - DFS CAC time in milliseconds
171281806Srpaulo	 */
172281806Srpaulo	unsigned int dfs_cac_ms;
173214734Srpaulo
174351611Scy	/**
175351611Scy	 * wmm_rules_valid - Indicates wmm_rules state
176351611Scy	 */
177351611Scy	int wmm_rules_valid;
178346981Scy
179351611Scy	/**
180351611Scy	 * wmm_rules - WMM regulatory rules
181351611Scy	 */
182351611Scy	struct hostapd_wmm_rule wmm_rules[WMM_AC_NUM];
183346981Scy};
184346981Scy
185351611Scy#define HE_MAX_MAC_CAPAB_SIZE	6
186351611Scy#define HE_MAX_PHY_CAPAB_SIZE	11
187351611Scy#define HE_MAX_MCS_CAPAB_SIZE	12
188351611Scy#define HE_MAX_PPET_CAPAB_SIZE	25
189351611Scy
190346981Scy/**
191346981Scy * struct he_capabilities - IEEE 802.11ax HE capabilities
192346981Scy */
193346981Scystruct he_capabilities {
194346981Scy	u8 he_supported;
195351611Scy	u8 phy_cap[HE_MAX_PHY_CAPAB_SIZE];
196351611Scy	u8 mac_cap[HE_MAX_MAC_CAPAB_SIZE];
197351611Scy	u8 mcs[HE_MAX_MCS_CAPAB_SIZE];
198351611Scy	u8 ppet[HE_MAX_PPET_CAPAB_SIZE];
199346981Scy};
200346981Scy
201252726Srpaulo#define HOSTAPD_MODE_FLAG_HT_INFO_KNOWN BIT(0)
202281806Srpaulo#define HOSTAPD_MODE_FLAG_VHT_INFO_KNOWN BIT(1)
203252726Srpaulo
204351611Scy
205351611Scyenum ieee80211_op_mode {
206351611Scy	IEEE80211_MODE_INFRA = 0,
207351611Scy	IEEE80211_MODE_IBSS = 1,
208351611Scy	IEEE80211_MODE_AP = 2,
209351611Scy	IEEE80211_MODE_MESH = 5,
210351611Scy
211351611Scy	/* only add new entries before IEEE80211_MODE_NUM */
212351611Scy	IEEE80211_MODE_NUM
213351611Scy};
214351611Scy
215214734Srpaulo/**
216214734Srpaulo * struct hostapd_hw_modes - Supported hardware mode information
217214734Srpaulo */
218214734Srpaulostruct hostapd_hw_modes {
219214734Srpaulo	/**
220214734Srpaulo	 * mode - Hardware mode
221214734Srpaulo	 */
222214734Srpaulo	enum hostapd_hw_mode mode;
223214734Srpaulo
224214734Srpaulo	/**
225214734Srpaulo	 * num_channels - Number of entries in the channels array
226214734Srpaulo	 */
227214734Srpaulo	int num_channels;
228214734Srpaulo
229214734Srpaulo	/**
230214734Srpaulo	 * channels - Array of supported channels
231214734Srpaulo	 */
232214734Srpaulo	struct hostapd_channel_data *channels;
233214734Srpaulo
234214734Srpaulo	/**
235214734Srpaulo	 * num_rates - Number of entries in the rates array
236214734Srpaulo	 */
237214734Srpaulo	int num_rates;
238214734Srpaulo
239214734Srpaulo	/**
240214734Srpaulo	 * rates - Array of supported rates in 100 kbps units
241214734Srpaulo	 */
242214734Srpaulo	int *rates;
243214734Srpaulo
244214734Srpaulo	/**
245214734Srpaulo	 * ht_capab - HT (IEEE 802.11n) capabilities
246214734Srpaulo	 */
247214734Srpaulo	u16 ht_capab;
248214734Srpaulo
249214734Srpaulo	/**
250214734Srpaulo	 * mcs_set - MCS (IEEE 802.11n) rate parameters
251214734Srpaulo	 */
252214734Srpaulo	u8 mcs_set[16];
253214734Srpaulo
254214734Srpaulo	/**
255214734Srpaulo	 * a_mpdu_params - A-MPDU (IEEE 802.11n) parameters
256214734Srpaulo	 */
257214734Srpaulo	u8 a_mpdu_params;
258252726Srpaulo
259252726Srpaulo	/**
260252726Srpaulo	 * vht_capab - VHT (IEEE 802.11ac) capabilities
261252726Srpaulo	 */
262252726Srpaulo	u32 vht_capab;
263252726Srpaulo
264252726Srpaulo	/**
265252726Srpaulo	 * vht_mcs_set - VHT MCS (IEEE 802.11ac) rate parameters
266252726Srpaulo	 */
267252726Srpaulo	u8 vht_mcs_set[8];
268252726Srpaulo
269252726Srpaulo	unsigned int flags; /* HOSTAPD_MODE_FLAG_* */
270346981Scy
271346981Scy	/**
272346981Scy	 * he_capab - HE (IEEE 802.11ax) capabilities
273346981Scy	 */
274351611Scy	struct he_capabilities he_capab[IEEE80211_MODE_NUM];
275214734Srpaulo};
276214734Srpaulo
277214734Srpaulo
278189251Ssam#define IEEE80211_CAP_ESS	0x0001
279189251Ssam#define IEEE80211_CAP_IBSS	0x0002
280189251Ssam#define IEEE80211_CAP_PRIVACY	0x0010
281281806Srpaulo#define IEEE80211_CAP_RRM	0x1000
282189251Ssam
283281806Srpaulo/* DMG (60 GHz) IEEE 802.11ad */
284281806Srpaulo/* type - bits 0..1 */
285281806Srpaulo#define IEEE80211_CAP_DMG_MASK	0x0003
286281806Srpaulo#define IEEE80211_CAP_DMG_IBSS	0x0001 /* Tx by: STA */
287281806Srpaulo#define IEEE80211_CAP_DMG_PBSS	0x0002 /* Tx by: PCP */
288281806Srpaulo#define IEEE80211_CAP_DMG_AP	0x0003 /* Tx by: AP */
289281806Srpaulo
290214734Srpaulo#define WPA_SCAN_QUAL_INVALID		BIT(0)
291214734Srpaulo#define WPA_SCAN_NOISE_INVALID		BIT(1)
292214734Srpaulo#define WPA_SCAN_LEVEL_INVALID		BIT(2)
293214734Srpaulo#define WPA_SCAN_LEVEL_DBM		BIT(3)
294214734Srpaulo#define WPA_SCAN_ASSOCIATED		BIT(5)
295189251Ssam
296189251Ssam/**
297189251Ssam * struct wpa_scan_res - Scan result for an BSS/IBSS
298214734Srpaulo * @flags: information flags about the BSS/IBSS (WPA_SCAN_*)
299189251Ssam * @bssid: BSSID
300189251Ssam * @freq: frequency of the channel in MHz (e.g., 2412 = channel 1)
301189251Ssam * @beacon_int: beacon interval in TUs (host byte order)
302189251Ssam * @caps: capability information field in host byte order
303189251Ssam * @qual: signal quality
304189251Ssam * @noise: noise level
305189251Ssam * @level: signal level
306189251Ssam * @tsf: Timestamp
307214734Srpaulo * @age: Age of the information in milliseconds (i.e., how many milliseconds
308214734Srpaulo * ago the last Beacon or Probe Response frame was received)
309281806Srpaulo * @est_throughput: Estimated throughput in kbps (this is calculated during
310281806Srpaulo * scan result processing if left zero by the driver wrapper)
311281806Srpaulo * @snr: Signal-to-noise ratio in dB (calculated during scan result processing)
312346981Scy * @parent_tsf: Time when the Beacon/Probe Response frame was received in terms
313346981Scy * of TSF of the BSS specified by %tsf_bssid.
314346981Scy * @tsf_bssid: The BSS that %parent_tsf TSF time refers to.
315189251Ssam * @ie_len: length of the following IE field in octets
316214734Srpaulo * @beacon_ie_len: length of the following Beacon IE field in octets
317189251Ssam *
318189251Ssam * This structure is used as a generic format for scan results from the
319189251Ssam * driver. Each driver interface implementation is responsible for converting
320189251Ssam * the driver or OS specific scan results into this format.
321189251Ssam *
322189251Ssam * If the driver does not support reporting all IEs, the IE data structure is
323189251Ssam * constructed of the IEs that are available. This field will also need to
324189251Ssam * include SSID in IE format. All drivers are encouraged to be extended to
325189251Ssam * report all IEs to make it easier to support future additions.
326281806Srpaulo *
327281806Srpaulo * This structure data is followed by ie_len octets of IEs from Probe Response
328281806Srpaulo * frame (or if the driver does not indicate source of IEs, these may also be
329281806Srpaulo * from Beacon frame). After the first set of IEs, another set of IEs may follow
330281806Srpaulo * (with beacon_ie_len octets of data) if the driver provides both IE sets.
331189251Ssam */
332189251Ssamstruct wpa_scan_res {
333214734Srpaulo	unsigned int flags;
334189251Ssam	u8 bssid[ETH_ALEN];
335189251Ssam	int freq;
336189251Ssam	u16 beacon_int;
337189251Ssam	u16 caps;
338189251Ssam	int qual;
339189251Ssam	int noise;
340189251Ssam	int level;
341189251Ssam	u64 tsf;
342214734Srpaulo	unsigned int age;
343281806Srpaulo	unsigned int est_throughput;
344281806Srpaulo	int snr;
345346981Scy	u64 parent_tsf;
346346981Scy	u8 tsf_bssid[ETH_ALEN];
347189251Ssam	size_t ie_len;
348214734Srpaulo	size_t beacon_ie_len;
349281806Srpaulo	/* Followed by ie_len + beacon_ie_len octets of IE data */
350189251Ssam};
351189251Ssam
352189251Ssam/**
353189251Ssam * struct wpa_scan_results - Scan results
354189251Ssam * @res: Array of pointers to allocated variable length scan result entries
355189251Ssam * @num: Number of entries in the scan result array
356281806Srpaulo * @fetch_time: Time when the results were fetched from the driver
357189251Ssam */
358189251Ssamstruct wpa_scan_results {
359189251Ssam	struct wpa_scan_res **res;
360189251Ssam	size_t num;
361281806Srpaulo	struct os_reltime fetch_time;
362189251Ssam};
363189251Ssam
364189251Ssam/**
365189251Ssam * struct wpa_interface_info - Network interface information
366189251Ssam * @next: Pointer to the next interface or NULL if this is the last one
367189251Ssam * @ifname: Interface name that can be used with init() or init2()
368189251Ssam * @desc: Human readable adapter description (e.g., vendor/model) or NULL if
369189251Ssam *	not available
370209158Srpaulo * @drv_name: struct wpa_driver_ops::name (note: unlike other strings, this one
371189251Ssam *	is not an allocated copy, i.e., get_interfaces() caller will not free
372189251Ssam *	this)
373189251Ssam */
374189251Ssamstruct wpa_interface_info {
375189251Ssam	struct wpa_interface_info *next;
376189251Ssam	char *ifname;
377189251Ssam	char *desc;
378189251Ssam	const char *drv_name;
379189251Ssam};
380189251Ssam
381252726Srpaulo#define WPAS_MAX_SCAN_SSIDS 16
382214734Srpaulo
383189251Ssam/**
384337817Scy * struct wpa_driver_scan_ssid - SSIDs to scan for
385337817Scy * @ssid - specific SSID to scan for (ProbeReq)
386337817Scy *	%NULL or zero-length SSID is used to indicate active scan
387337817Scy *	with wildcard SSID.
388337817Scy * @ssid_len - Length of the SSID in octets
389337817Scy */
390337817Scystruct wpa_driver_scan_ssid {
391337817Scy	const u8 *ssid;
392337817Scy	size_t ssid_len;
393337817Scy};
394337817Scy
395337817Scy/**
396214734Srpaulo * struct wpa_driver_scan_params - Scan parameters
397214734Srpaulo * Data for struct wpa_driver_ops::scan2().
398214734Srpaulo */
399214734Srpaulostruct wpa_driver_scan_params {
400214734Srpaulo	/**
401214734Srpaulo	 * ssids - SSIDs to scan for
402214734Srpaulo	 */
403337817Scy	struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS];
404214734Srpaulo
405214734Srpaulo	/**
406214734Srpaulo	 * num_ssids - Number of entries in ssids array
407214734Srpaulo	 * Zero indicates a request for a passive scan.
408214734Srpaulo	 */
409214734Srpaulo	size_t num_ssids;
410214734Srpaulo
411214734Srpaulo	/**
412214734Srpaulo	 * extra_ies - Extra IE(s) to add into Probe Request or %NULL
413214734Srpaulo	 */
414214734Srpaulo	const u8 *extra_ies;
415214734Srpaulo
416214734Srpaulo	/**
417214734Srpaulo	 * extra_ies_len - Length of extra_ies in octets
418214734Srpaulo	 */
419214734Srpaulo	size_t extra_ies_len;
420214734Srpaulo
421214734Srpaulo	/**
422214734Srpaulo	 * freqs - Array of frequencies to scan or %NULL for all frequencies
423214734Srpaulo	 *
424214734Srpaulo	 * The frequency is set in MHz. The array is zero-terminated.
425214734Srpaulo	 */
426214734Srpaulo	int *freqs;
427214734Srpaulo
428214734Srpaulo	/**
429214734Srpaulo	 * filter_ssids - Filter for reporting SSIDs
430214734Srpaulo	 *
431214734Srpaulo	 * This optional parameter can be used to request the driver wrapper to
432214734Srpaulo	 * filter scan results to include only the specified SSIDs. %NULL
433214734Srpaulo	 * indicates that no filtering is to be done. This can be used to
434214734Srpaulo	 * reduce memory needs for scan results in environments that have large
435214734Srpaulo	 * number of APs with different SSIDs.
436214734Srpaulo	 *
437214734Srpaulo	 * The driver wrapper is allowed to take this allocated buffer into its
438214734Srpaulo	 * own use by setting the pointer to %NULL. In that case, the driver
439214734Srpaulo	 * wrapper is responsible for freeing the buffer with os_free() once it
440214734Srpaulo	 * is not needed anymore.
441214734Srpaulo	 */
442214734Srpaulo	struct wpa_driver_scan_filter {
443289549Srpaulo		u8 ssid[SSID_MAX_LEN];
444214734Srpaulo		size_t ssid_len;
445214734Srpaulo	} *filter_ssids;
446214734Srpaulo
447214734Srpaulo	/**
448214734Srpaulo	 * num_filter_ssids - Number of entries in filter_ssids array
449214734Srpaulo	 */
450214734Srpaulo	size_t num_filter_ssids;
451252726Srpaulo
452252726Srpaulo	/**
453252726Srpaulo	 * filter_rssi - Filter by RSSI
454252726Srpaulo	 *
455252726Srpaulo	 * The driver may filter scan results in firmware to reduce host
456252726Srpaulo	 * wakeups and thereby save power. Specify the RSSI threshold in s32
457252726Srpaulo	 * dBm.
458252726Srpaulo	 */
459252726Srpaulo	s32 filter_rssi;
460252726Srpaulo
461252726Srpaulo	/**
462252726Srpaulo	 * p2p_probe - Used to disable CCK (802.11b) rates for P2P probes
463252726Srpaulo	 *
464252726Srpaulo	 * When set, the driver is expected to remove rates 1, 2, 5.5, and 11
465252726Srpaulo	 * Mbps from the support rates element(s) in the Probe Request frames
466252726Srpaulo	 * and not to transmit the frames at any of those rates.
467252726Srpaulo	 */
468281806Srpaulo	unsigned int p2p_probe:1;
469281806Srpaulo
470281806Srpaulo	/**
471281806Srpaulo	 * only_new_results - Request driver to report only new results
472281806Srpaulo	 *
473281806Srpaulo	 * This is used to request the driver to report only BSSes that have
474281806Srpaulo	 * been detected after this scan request has been started, i.e., to
475281806Srpaulo	 * flush old cached BSS entries.
476281806Srpaulo	 */
477281806Srpaulo	unsigned int only_new_results:1;
478281806Srpaulo
479281806Srpaulo	/**
480281806Srpaulo	 * low_priority - Requests driver to use a lower scan priority
481281806Srpaulo	 *
482281806Srpaulo	 * This is used to request the driver to use a lower scan priority
483281806Srpaulo	 * if it supports such a thing.
484281806Srpaulo	 */
485281806Srpaulo	unsigned int low_priority:1;
486281806Srpaulo
487281806Srpaulo	/**
488281806Srpaulo	 * mac_addr_rand - Requests driver to randomize MAC address
489281806Srpaulo	 */
490281806Srpaulo	unsigned int mac_addr_rand:1;
491281806Srpaulo
492281806Srpaulo	/**
493281806Srpaulo	 * mac_addr - MAC address used with randomization. The address cannot be
494281806Srpaulo	 * a multicast one, i.e., bit 0 of byte 0 should not be set.
495281806Srpaulo	 */
496281806Srpaulo	const u8 *mac_addr;
497281806Srpaulo
498281806Srpaulo	/**
499281806Srpaulo	 * mac_addr_mask - MAC address mask used with randomization.
500281806Srpaulo	 *
501281806Srpaulo	 * Bits that are 0 in the mask should be randomized. Bits that are 1 in
502281806Srpaulo	 * the mask should be taken as is from mac_addr. The mask should not
503281806Srpaulo	 * allow the generation of a multicast address, i.e., bit 0 of byte 0
504281806Srpaulo	 * must be set.
505281806Srpaulo	 */
506281806Srpaulo	const u8 *mac_addr_mask;
507281806Srpaulo
508337817Scy	/**
509337817Scy	 * sched_scan_plans - Scan plans for scheduled scan
510337817Scy	 *
511337817Scy	 * Each scan plan consists of the number of iterations to scan and the
512337817Scy	 * interval between scans. When a scan plan finishes (i.e., it was run
513337817Scy	 * for the specified number of iterations), the next scan plan is
514337817Scy	 * executed. The scan plans are executed in the order they appear in
515337817Scy	 * the array (lower index first). The last scan plan will run infinitely
516337817Scy	 * (until requested to stop), thus must not specify the number of
517337817Scy	 * iterations. All other scan plans must specify the number of
518337817Scy	 * iterations.
519337817Scy	 */
520337817Scy	struct sched_scan_plan {
521337817Scy		 u32 interval; /* In seconds */
522337817Scy		 u32 iterations; /* Zero to run infinitely */
523337817Scy	 } *sched_scan_plans;
524337817Scy
525337817Scy	/**
526337817Scy	 * sched_scan_plans_num - Number of scan plans in sched_scan_plans array
527337817Scy	 */
528337817Scy	 unsigned int sched_scan_plans_num;
529337817Scy
530337817Scy	/**
531346981Scy	 * sched_scan_start_delay - Delay to use before starting the first scan
532346981Scy	 *
533346981Scy	 * Delay (in seconds) before scheduling first scan plan cycle. The
534346981Scy	 * driver may ignore this parameter and start immediately (or at any
535346981Scy	 * other time), if this feature is not supported.
536346981Scy	 */
537346981Scy	 u32 sched_scan_start_delay;
538346981Scy
539346981Scy	/**
540337817Scy	 * bssid - Specific BSSID to scan for
541337817Scy	 *
542337817Scy	 * This optional parameter can be used to replace the default wildcard
543337817Scy	 * BSSID with a specific BSSID to scan for if results are needed from
544337817Scy	 * only a single BSS.
545337817Scy	 */
546337817Scy	const u8 *bssid;
547337817Scy
548346981Scy	/**
549346981Scy	 * scan_cookie - Unique identification representing the scan request
550346981Scy	 *
551346981Scy	 * This scan_cookie carries a unique identification representing the
552346981Scy	 * scan request if the host driver/kernel supports concurrent scan
553346981Scy	 * requests. This cookie is returned from the corresponding driver
554346981Scy	 * interface.
555346981Scy	 *
556346981Scy	 * Note: Unlike other parameters in this structure, scan_cookie is used
557346981Scy	 * only to return information instead of setting parameters for the
558346981Scy	 * scan.
559346981Scy	 */
560346981Scy	u64 scan_cookie;
561346981Scy
562346981Scy	 /**
563346981Scy	  * duration - Dwell time on each channel
564346981Scy	  *
565346981Scy	  * This optional parameter can be used to set the dwell time on each
566346981Scy	  * channel. In TUs.
567346981Scy	  */
568346981Scy	 u16 duration;
569346981Scy
570346981Scy	 /**
571346981Scy	  * duration_mandatory - Whether the specified duration is mandatory
572346981Scy	  *
573346981Scy	  * If this is set, the duration specified by the %duration field is
574346981Scy	  * mandatory (and the driver should reject the scan request if it is
575346981Scy	  * unable to comply with the specified duration), otherwise it is the
576346981Scy	  * maximum duration and the actual duration may be shorter.
577346981Scy	  */
578346981Scy	 unsigned int duration_mandatory:1;
579346981Scy
580346981Scy	/**
581346981Scy	 * relative_rssi_set - Whether relative RSSI parameters are set
582346981Scy	 */
583346981Scy	unsigned int relative_rssi_set:1;
584346981Scy
585346981Scy	/**
586346981Scy	 * relative_rssi - Relative RSSI for reporting better BSSs
587346981Scy	 *
588346981Scy	 * Amount of RSSI by which a BSS should be better than the current
589346981Scy	 * connected BSS to report the new BSS to user space.
590346981Scy	 */
591346981Scy	s8 relative_rssi;
592346981Scy
593346981Scy	/**
594346981Scy	 * relative_adjust_band - Band to which RSSI should be adjusted
595346981Scy	 *
596346981Scy	 * The relative_adjust_rssi should be added to the band specified
597346981Scy	 * by relative_adjust_band.
598346981Scy	 */
599346981Scy	enum set_band relative_adjust_band;
600346981Scy
601346981Scy	/**
602346981Scy	 * relative_adjust_rssi - RSSI to be added to relative_adjust_band
603346981Scy	 *
604346981Scy	 * An amount of relative_band_rssi should be added to the BSSs that
605346981Scy	 * belong to the band specified by relative_adjust_band while comparing
606346981Scy	 * with other bands for BSS reporting.
607346981Scy	 */
608346981Scy	s8 relative_adjust_rssi;
609346981Scy
610346981Scy	/**
611346981Scy	 * oce_scan
612346981Scy	 *
613346981Scy	 * Enable the following OCE scan features: (WFA OCE TechSpec v1.0)
614346981Scy	 * - Accept broadcast Probe Response frame.
615346981Scy	 * - Probe Request frame deferral and suppression.
616346981Scy	 * - Max Channel Time - driver fills FILS request params IE with
617346981Scy	 *   Maximum Channel Time.
618346981Scy	 * - Send 1st Probe Request frame in rate of minimum 5.5 Mbps.
619346981Scy	 */
620346981Scy	unsigned int oce_scan:1;
621346981Scy
622281806Srpaulo	/*
623281806Srpaulo	 * NOTE: Whenever adding new parameters here, please make sure
624281806Srpaulo	 * wpa_scan_clone_params() and wpa_scan_free_params() get updated with
625281806Srpaulo	 * matching changes.
626281806Srpaulo	 */
627214734Srpaulo};
628214734Srpaulo
629214734Srpaulo/**
630214734Srpaulo * struct wpa_driver_auth_params - Authentication parameters
631214734Srpaulo * Data for struct wpa_driver_ops::authenticate().
632214734Srpaulo */
633214734Srpaulostruct wpa_driver_auth_params {
634214734Srpaulo	int freq;
635214734Srpaulo	const u8 *bssid;
636214734Srpaulo	const u8 *ssid;
637214734Srpaulo	size_t ssid_len;
638214734Srpaulo	int auth_alg;
639214734Srpaulo	const u8 *ie;
640214734Srpaulo	size_t ie_len;
641214734Srpaulo	const u8 *wep_key[4];
642214734Srpaulo	size_t wep_key_len[4];
643214734Srpaulo	int wep_tx_keyidx;
644214734Srpaulo	int local_state_change;
645252726Srpaulo
646252726Srpaulo	/**
647252726Srpaulo	 * p2p - Whether this connection is a P2P group
648252726Srpaulo	 */
649252726Srpaulo	int p2p;
650252726Srpaulo
651281806Srpaulo	/**
652346981Scy	 * auth_data - Additional elements for Authentication frame
653281806Srpaulo	 *
654281806Srpaulo	 * This buffer starts with the Authentication transaction sequence
655346981Scy	 * number field. If no special handling of such elements is needed, this
656346981Scy	 * pointer is %NULL. This is used with SAE and FILS.
657281806Srpaulo	 */
658346981Scy	const u8 *auth_data;
659281806Srpaulo
660281806Srpaulo	/**
661346981Scy	 * auth_data_len - Length of auth_data buffer in octets
662281806Srpaulo	 */
663346981Scy	size_t auth_data_len;
664214734Srpaulo};
665214734Srpaulo
666281806Srpaulo/**
667281806Srpaulo * enum wps_mode - WPS mode
668281806Srpaulo */
669252726Srpauloenum wps_mode {
670281806Srpaulo	/**
671281806Srpaulo	 * WPS_MODE_NONE - No WPS provisioning being used
672281806Srpaulo	 */
673281806Srpaulo	WPS_MODE_NONE,
674281806Srpaulo
675281806Srpaulo	/**
676281806Srpaulo	 * WPS_MODE_OPEN - WPS provisioning with AP that is in open mode
677281806Srpaulo	 */
678281806Srpaulo	WPS_MODE_OPEN,
679281806Srpaulo
680281806Srpaulo	/**
681281806Srpaulo	 * WPS_MODE_PRIVACY - WPS provisioning with AP that is using protection
682281806Srpaulo	 */
683281806Srpaulo	WPS_MODE_PRIVACY
684252726Srpaulo};
685252726Srpaulo
686214734Srpaulo/**
687281806Srpaulo * struct hostapd_freq_params - Channel parameters
688281806Srpaulo */
689281806Srpaulostruct hostapd_freq_params {
690281806Srpaulo	/**
691281806Srpaulo	 * mode - Mode/band (HOSTAPD_MODE_IEEE80211A, ..)
692281806Srpaulo	 */
693281806Srpaulo	enum hostapd_hw_mode mode;
694281806Srpaulo
695281806Srpaulo	/**
696281806Srpaulo	 * freq - Primary channel center frequency in MHz
697281806Srpaulo	 */
698281806Srpaulo	int freq;
699281806Srpaulo
700281806Srpaulo	/**
701281806Srpaulo	 * channel - Channel number
702281806Srpaulo	 */
703281806Srpaulo	int channel;
704281806Srpaulo
705281806Srpaulo	/**
706281806Srpaulo	 * ht_enabled - Whether HT is enabled
707281806Srpaulo	 */
708281806Srpaulo	int ht_enabled;
709281806Srpaulo
710281806Srpaulo	/**
711281806Srpaulo	 * sec_channel_offset - Secondary channel offset for HT40
712281806Srpaulo	 *
713281806Srpaulo	 * 0 = HT40 disabled,
714281806Srpaulo	 * -1 = HT40 enabled, secondary channel below primary,
715281806Srpaulo	 * 1 = HT40 enabled, secondary channel above primary
716281806Srpaulo	 */
717281806Srpaulo	int sec_channel_offset;
718281806Srpaulo
719281806Srpaulo	/**
720281806Srpaulo	 * vht_enabled - Whether VHT is enabled
721281806Srpaulo	 */
722281806Srpaulo	int vht_enabled;
723281806Srpaulo
724281806Srpaulo	/**
725351611Scy	 * he_enabled - Whether HE is enabled
726351611Scy	 */
727351611Scy	int he_enabled;
728351611Scy
729351611Scy	/**
730281806Srpaulo	 * center_freq1 - Segment 0 center frequency in MHz
731281806Srpaulo	 *
732281806Srpaulo	 * Valid for both HT and VHT.
733281806Srpaulo	 */
734281806Srpaulo	int center_freq1;
735281806Srpaulo
736281806Srpaulo	/**
737281806Srpaulo	 * center_freq2 - Segment 1 center frequency in MHz
738281806Srpaulo	 *
739281806Srpaulo	 * Non-zero only for bandwidth 80 and an 80+80 channel
740281806Srpaulo	 */
741281806Srpaulo	int center_freq2;
742281806Srpaulo
743281806Srpaulo	/**
744281806Srpaulo	 * bandwidth - Channel bandwidth in MHz (20, 40, 80, 160)
745281806Srpaulo	 */
746281806Srpaulo	int bandwidth;
747281806Srpaulo};
748281806Srpaulo
749281806Srpaulo/**
750346981Scy * struct wpa_driver_sta_auth_params - Authentication parameters
751346981Scy * Data for struct wpa_driver_ops::sta_auth().
752346981Scy */
753346981Scystruct wpa_driver_sta_auth_params {
754346981Scy
755346981Scy	/**
756346981Scy	 * own_addr - Source address and BSSID for authentication frame
757346981Scy	 */
758346981Scy	const u8 *own_addr;
759346981Scy
760346981Scy	/**
761346981Scy	 * addr - MAC address of the station to associate
762346981Scy	 */
763346981Scy	const u8 *addr;
764346981Scy
765346981Scy	/**
766346981Scy	 * seq - authentication sequence number
767346981Scy	 */
768346981Scy	u16 seq;
769346981Scy
770346981Scy	/**
771346981Scy	 * status - authentication response status code
772346981Scy	 */
773346981Scy	u16 status;
774346981Scy
775346981Scy	/**
776346981Scy	 * ie - authentication frame ie buffer
777346981Scy	 */
778346981Scy	const u8 *ie;
779346981Scy
780346981Scy	/**
781346981Scy	 * len - ie buffer length
782346981Scy	 */
783346981Scy	size_t len;
784346981Scy
785346981Scy	/**
786346981Scy	 * fils_auth - Indicates whether FILS authentication is being performed
787346981Scy	 */
788346981Scy	int fils_auth;
789346981Scy
790346981Scy	/**
791346981Scy	 * fils_anonce - ANonce (required for FILS)
792346981Scy	 */
793346981Scy	u8 fils_anonce[WPA_NONCE_LEN];
794346981Scy
795346981Scy	/**
796346981Scy	 * fils_snonce - SNonce (required for FILS)
797346981Scy	*/
798346981Scy	u8 fils_snonce[WPA_NONCE_LEN];
799346981Scy
800346981Scy	/**
801346981Scy	 * fils_kek - key for encryption (required for FILS)
802346981Scy	 */
803346981Scy	u8 fils_kek[WPA_KEK_MAX_LEN];
804346981Scy
805346981Scy	/**
806346981Scy	 * fils_kek_len - Length of the fils_kek in octets (required for FILS)
807346981Scy	 */
808346981Scy	size_t fils_kek_len;
809346981Scy};
810346981Scy
811346981Scy/**
812189251Ssam * struct wpa_driver_associate_params - Association parameters
813189251Ssam * Data for struct wpa_driver_ops::associate().
814189251Ssam */
815189251Ssamstruct wpa_driver_associate_params {
816189251Ssam	/**
817189251Ssam	 * bssid - BSSID of the selected AP
818189251Ssam	 * This can be %NULL, if ap_scan=2 mode is used and the driver is
819189251Ssam	 * responsible for selecting with which BSS to associate. */
820189251Ssam	const u8 *bssid;
821189251Ssam
822189251Ssam	/**
823281806Srpaulo	 * bssid_hint - BSSID of a proposed AP
824281806Srpaulo	 *
825281806Srpaulo	 * This indicates which BSS has been found a suitable candidate for
826281806Srpaulo	 * initial association for drivers that use driver/firmwate-based BSS
827281806Srpaulo	 * selection. Unlike the @bssid parameter, @bssid_hint does not limit
828281806Srpaulo	 * the driver from selecting other BSSes in the ESS.
829281806Srpaulo	 */
830281806Srpaulo	const u8 *bssid_hint;
831281806Srpaulo
832281806Srpaulo	/**
833189251Ssam	 * ssid - The selected SSID
834189251Ssam	 */
835189251Ssam	const u8 *ssid;
836214734Srpaulo
837214734Srpaulo	/**
838214734Srpaulo	 * ssid_len - Length of the SSID (1..32)
839214734Srpaulo	 */
840189251Ssam	size_t ssid_len;
841189251Ssam
842189251Ssam	/**
843281806Srpaulo	 * freq - channel parameters
844189251Ssam	 */
845281806Srpaulo	struct hostapd_freq_params freq;
846189251Ssam
847189251Ssam	/**
848281806Srpaulo	 * freq_hint - Frequency of the channel the proposed AP is using
849281806Srpaulo	 *
850281806Srpaulo	 * This provides a channel on which a suitable BSS has been found as a
851281806Srpaulo	 * hint for the driver. Unlike the @freq parameter, @freq_hint does not
852281806Srpaulo	 * limit the driver from selecting other channels for
853281806Srpaulo	 * driver/firmware-based BSS selection.
854281806Srpaulo	 */
855281806Srpaulo	int freq_hint;
856281806Srpaulo
857281806Srpaulo	/**
858252726Srpaulo	 * bg_scan_period - Background scan period in seconds, 0 to disable
859252726Srpaulo	 * background scan, or -1 to indicate no change to default driver
860252726Srpaulo	 * configuration
861252726Srpaulo	 */
862252726Srpaulo	int bg_scan_period;
863252726Srpaulo
864252726Srpaulo	/**
865281806Srpaulo	 * beacon_int - Beacon interval for IBSS or 0 to use driver default
866281806Srpaulo	 */
867281806Srpaulo	int beacon_int;
868281806Srpaulo
869281806Srpaulo	/**
870189251Ssam	 * wpa_ie - WPA information element for (Re)Association Request
871189251Ssam	 * WPA information element to be included in (Re)Association
872189251Ssam	 * Request (including information element id and length). Use
873189251Ssam	 * of this WPA IE is optional. If the driver generates the WPA
874346981Scy	 * IE, it can use pairwise_suite, group_suite, group_mgmt_suite, and
875189251Ssam	 * key_mgmt_suite to select proper algorithms. In this case,
876189251Ssam	 * the driver has to notify wpa_supplicant about the used WPA
877189251Ssam	 * IE by generating an event that the interface code will
878189251Ssam	 * convert into EVENT_ASSOCINFO data (see below).
879189251Ssam	 *
880189251Ssam	 * When using WPA2/IEEE 802.11i, wpa_ie is used for RSN IE
881189251Ssam	 * instead. The driver can determine which version is used by
882189251Ssam	 * looking at the first byte of the IE (0xdd for WPA, 0x30 for
883189251Ssam	 * WPA2/RSN).
884189251Ssam	 *
885189251Ssam	 * When using WPS, wpa_ie is used for WPS IE instead of WPA/RSN IE.
886189251Ssam	 */
887189251Ssam	const u8 *wpa_ie;
888214734Srpaulo
889189251Ssam	/**
890189251Ssam	 * wpa_ie_len - length of the wpa_ie
891189251Ssam	 */
892189251Ssam	size_t wpa_ie_len;
893189251Ssam
894214734Srpaulo	/**
895252726Srpaulo	 * wpa_proto - Bitfield of WPA_PROTO_* values to indicate WPA/WPA2
896252726Srpaulo	 */
897252726Srpaulo	unsigned int wpa_proto;
898252726Srpaulo
899252726Srpaulo	/**
900281806Srpaulo	 * pairwise_suite - Selected pairwise cipher suite (WPA_CIPHER_*)
901214734Srpaulo	 *
902214734Srpaulo	 * This is usually ignored if @wpa_ie is used.
903214734Srpaulo	 */
904281806Srpaulo	unsigned int pairwise_suite;
905189251Ssam
906189251Ssam	/**
907281806Srpaulo	 * group_suite - Selected group cipher suite (WPA_CIPHER_*)
908214734Srpaulo	 *
909214734Srpaulo	 * This is usually ignored if @wpa_ie is used.
910214734Srpaulo	 */
911281806Srpaulo	unsigned int group_suite;
912214734Srpaulo
913214734Srpaulo	/**
914346981Scy	 * mgmt_group_suite - Selected group management cipher suite (WPA_CIPHER_*)
915346981Scy	 *
916346981Scy	 * This is usually ignored if @wpa_ie is used.
917346981Scy	 */
918346981Scy	unsigned int mgmt_group_suite;
919346981Scy
920346981Scy	/**
921281806Srpaulo	 * key_mgmt_suite - Selected key management suite (WPA_KEY_MGMT_*)
922214734Srpaulo	 *
923214734Srpaulo	 * This is usually ignored if @wpa_ie is used.
924214734Srpaulo	 */
925281806Srpaulo	unsigned int key_mgmt_suite;
926214734Srpaulo
927214734Srpaulo	/**
928189251Ssam	 * auth_alg - Allowed authentication algorithms
929214734Srpaulo	 * Bit field of WPA_AUTH_ALG_*
930189251Ssam	 */
931189251Ssam	int auth_alg;
932189251Ssam
933189251Ssam	/**
934189251Ssam	 * mode - Operation mode (infra/ibss) IEEE80211_MODE_*
935189251Ssam	 */
936189251Ssam	int mode;
937189251Ssam
938189251Ssam	/**
939189251Ssam	 * wep_key - WEP keys for static WEP configuration
940189251Ssam	 */
941189251Ssam	const u8 *wep_key[4];
942189251Ssam
943189251Ssam	/**
944189251Ssam	 * wep_key_len - WEP key length for static WEP configuration
945189251Ssam	 */
946189251Ssam	size_t wep_key_len[4];
947189251Ssam
948189251Ssam	/**
949189251Ssam	 * wep_tx_keyidx - WEP TX key index for static WEP configuration
950189251Ssam	 */
951189251Ssam	int wep_tx_keyidx;
952189251Ssam
953189251Ssam	/**
954189251Ssam	 * mgmt_frame_protection - IEEE 802.11w management frame protection
955189251Ssam	 */
956214734Srpaulo	enum mfp_options mgmt_frame_protection;
957189251Ssam
958189251Ssam	/**
959189251Ssam	 * passphrase - RSN passphrase for PSK
960189251Ssam	 *
961189251Ssam	 * This value is made available only for WPA/WPA2-Personal (PSK) and
962346981Scy	 * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK. This
963346981Scy	 * is the 8..63 character ASCII passphrase, if available. Please note
964346981Scy	 * that this can be %NULL if passphrase was not used to generate the
965346981Scy	 * PSK. In that case, the psk field must be used to fetch the PSK.
966189251Ssam	 */
967189251Ssam	const char *passphrase;
968189251Ssam
969189251Ssam	/**
970189251Ssam	 * psk - RSN PSK (alternative for passphrase for PSK)
971189251Ssam	 *
972189251Ssam	 * This value is made available only for WPA/WPA2-Personal (PSK) and
973346981Scy	 * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK. This
974346981Scy	 * is the 32-octet (256-bit) PSK, if available. The driver wrapper
975346981Scy	 * should be prepared to handle %NULL value as an error.
976189251Ssam	 */
977189251Ssam	const u8 *psk;
978214734Srpaulo
979214734Srpaulo	/**
980214734Srpaulo	 * drop_unencrypted - Enable/disable unencrypted frame filtering
981214734Srpaulo	 *
982214734Srpaulo	 * Configure the driver to drop all non-EAPOL frames (both receive and
983214734Srpaulo	 * transmit paths). Unencrypted EAPOL frames (ethertype 0x888e) must
984214734Srpaulo	 * still be allowed for key negotiation.
985214734Srpaulo	 */
986214734Srpaulo	int drop_unencrypted;
987214734Srpaulo
988214734Srpaulo	/**
989214734Srpaulo	 * prev_bssid - Previously used BSSID in this ESS
990214734Srpaulo	 *
991214734Srpaulo	 * When not %NULL, this is a request to use reassociation instead of
992214734Srpaulo	 * association.
993214734Srpaulo	 */
994214734Srpaulo	const u8 *prev_bssid;
995252726Srpaulo
996252726Srpaulo	/**
997252726Srpaulo	 * wps - WPS mode
998252726Srpaulo	 *
999252726Srpaulo	 * If the driver needs to do special configuration for WPS association,
1000252726Srpaulo	 * this variable provides more information on what type of association
1001252726Srpaulo	 * is being requested. Most drivers should not need ot use this.
1002252726Srpaulo	 */
1003252726Srpaulo	enum wps_mode wps;
1004252726Srpaulo
1005252726Srpaulo	/**
1006252726Srpaulo	 * p2p - Whether this connection is a P2P group
1007252726Srpaulo	 */
1008252726Srpaulo	int p2p;
1009252726Srpaulo
1010252726Srpaulo	/**
1011252726Srpaulo	 * uapsd - UAPSD parameters for the network
1012252726Srpaulo	 * -1 = do not change defaults
1013252726Srpaulo	 * AP mode: 1 = enabled, 0 = disabled
1014252726Srpaulo	 * STA mode: bits 0..3 UAPSD enabled for VO,VI,BK,BE
1015252726Srpaulo	 */
1016252726Srpaulo	int uapsd;
1017252726Srpaulo
1018252726Srpaulo	/**
1019252726Srpaulo	 * fixed_bssid - Whether to force this BSSID in IBSS mode
1020252726Srpaulo	 * 1 = Fix this BSSID and prevent merges.
1021252726Srpaulo	 * 0 = Do not fix BSSID.
1022252726Srpaulo	 */
1023252726Srpaulo	int fixed_bssid;
1024252726Srpaulo
1025252726Srpaulo	/**
1026281806Srpaulo	 * fixed_freq - Fix control channel in IBSS mode
1027281806Srpaulo	 * 0 = don't fix control channel (default)
1028281806Srpaulo	 * 1 = fix control channel; this prevents IBSS merging with another
1029281806Srpaulo	 *	channel
1030281806Srpaulo	 */
1031281806Srpaulo	int fixed_freq;
1032281806Srpaulo
1033281806Srpaulo	/**
1034252726Srpaulo	 * disable_ht - Disable HT (IEEE 802.11n) for this connection
1035252726Srpaulo	 */
1036252726Srpaulo	int disable_ht;
1037252726Srpaulo
1038252726Srpaulo	/**
1039281806Srpaulo	 * htcaps - HT Capabilities over-rides
1040281806Srpaulo	 *
1041281806Srpaulo	 * Only bits set in the mask will be used, and not all values are used
1042281806Srpaulo	 * by the kernel anyway. Currently, MCS, MPDU and MSDU fields are used.
1043281806Srpaulo	 *
1044281806Srpaulo	 * Pointer to struct ieee80211_ht_capabilities.
1045252726Srpaulo	 */
1046281806Srpaulo	const u8 *htcaps;
1047281806Srpaulo
1048281806Srpaulo	/**
1049281806Srpaulo	 * htcaps_mask - HT Capabilities over-rides mask
1050281806Srpaulo	 *
1051281806Srpaulo	 * Pointer to struct ieee80211_ht_capabilities.
1052281806Srpaulo	 */
1053281806Srpaulo	const u8 *htcaps_mask;
1054281806Srpaulo
1055281806Srpaulo#ifdef CONFIG_VHT_OVERRIDES
1056281806Srpaulo	/**
1057281806Srpaulo	 * disable_vht - Disable VHT for this connection
1058281806Srpaulo	 */
1059281806Srpaulo	int disable_vht;
1060281806Srpaulo
1061281806Srpaulo	/**
1062281806Srpaulo	 * VHT capability overrides.
1063281806Srpaulo	 */
1064281806Srpaulo	const struct ieee80211_vht_capabilities *vhtcaps;
1065281806Srpaulo	const struct ieee80211_vht_capabilities *vhtcaps_mask;
1066281806Srpaulo#endif /* CONFIG_VHT_OVERRIDES */
1067281806Srpaulo
1068281806Srpaulo	/**
1069281806Srpaulo	 * req_key_mgmt_offload - Request key management offload for connection
1070281806Srpaulo	 *
1071281806Srpaulo	 * Request key management offload for this connection if the device
1072281806Srpaulo	 * supports it.
1073281806Srpaulo	 */
1074281806Srpaulo	int req_key_mgmt_offload;
1075281806Srpaulo
1076281806Srpaulo	/**
1077351611Scy	 * req_handshake_offload - Request EAPOL handshake offload
1078351611Scy	 *
1079351611Scy	 * Request EAPOL handshake offload for this connection if the device
1080351611Scy	 * supports it.
1081351611Scy	 */
1082351611Scy	int req_handshake_offload;
1083351611Scy
1084351611Scy	/**
1085281806Srpaulo	 * Flag for indicating whether this association includes support for
1086281806Srpaulo	 * RRM (Radio Resource Measurements)
1087281806Srpaulo	 */
1088281806Srpaulo	int rrm_used;
1089337817Scy
1090337817Scy	/**
1091337817Scy	 * pbss - If set, connect to a PCP in a PBSS. Otherwise, connect to an
1092337817Scy	 * AP as usual. Valid for DMG network only.
1093337817Scy	 */
1094337817Scy	int pbss;
1095346981Scy
1096346981Scy	/**
1097346981Scy	 * fils_kek - KEK for FILS association frame protection (AES-SIV)
1098346981Scy	 */
1099346981Scy	const u8 *fils_kek;
1100346981Scy
1101346981Scy	/**
1102346981Scy	 * fils_kek_len: Length of fils_kek in bytes
1103346981Scy	 */
1104346981Scy	size_t fils_kek_len;
1105346981Scy
1106346981Scy	/**
1107346981Scy	 * fils_nonces - Nonces for FILS association frame protection
1108346981Scy	 * (AES-SIV AAD)
1109346981Scy	 */
1110346981Scy	const u8 *fils_nonces;
1111346981Scy
1112346981Scy	/**
1113346981Scy	 * fils_nonces_len: Length of fils_nonce in bytes
1114346981Scy	 */
1115346981Scy	size_t fils_nonces_len;
1116346981Scy
1117346981Scy	/**
1118346981Scy	 * fils_erp_username - Username part of keyName-NAI
1119346981Scy	 */
1120346981Scy	const u8 *fils_erp_username;
1121346981Scy
1122346981Scy	/**
1123346981Scy	 * fils_erp_username_len - Length of fils_erp_username in bytes
1124346981Scy	 */
1125346981Scy	size_t fils_erp_username_len;
1126346981Scy
1127346981Scy	/**
1128346981Scy	 * fils_erp_realm - Realm/domain name to use in FILS ERP
1129346981Scy	 */
1130346981Scy	const u8 *fils_erp_realm;
1131346981Scy
1132346981Scy	/**
1133346981Scy	 * fils_erp_realm_len - Length of fils_erp_realm in bytes
1134346981Scy	 */
1135346981Scy	size_t fils_erp_realm_len;
1136346981Scy
1137346981Scy	/**
1138346981Scy	 * fils_erp_next_seq_num - The next sequence number to use in FILS ERP
1139346981Scy	 * messages
1140346981Scy	 */
1141346981Scy	u16 fils_erp_next_seq_num;
1142346981Scy
1143346981Scy	/**
1144346981Scy	 * fils_erp_rrk - Re-authentication root key (rRK) for the keyName-NAI
1145346981Scy	 * specified by fils_erp_username@fils_erp_realm.
1146346981Scy	 */
1147346981Scy	const u8 *fils_erp_rrk;
1148346981Scy
1149346981Scy	/**
1150346981Scy	 * fils_erp_rrk_len - Length of fils_erp_rrk in bytes
1151346981Scy	 */
1152346981Scy	size_t fils_erp_rrk_len;
1153189251Ssam};
1154189251Ssam
1155252726Srpauloenum hide_ssid {
1156252726Srpaulo	NO_SSID_HIDING,
1157252726Srpaulo	HIDDEN_SSID_ZERO_LEN,
1158252726Srpaulo	HIDDEN_SSID_ZERO_CONTENTS
1159252726Srpaulo};
1160252726Srpaulo
1161351611Scyenum ch_switch_state {
1162351611Scy	CH_SW_STARTED,
1163351611Scy	CH_SW_FINISHED
1164351611Scy};
1165351611Scy
1166281806Srpaulostruct wowlan_triggers {
1167281806Srpaulo	u8 any;
1168281806Srpaulo	u8 disconnect;
1169281806Srpaulo	u8 magic_pkt;
1170281806Srpaulo	u8 gtk_rekey_failure;
1171281806Srpaulo	u8 eap_identity_req;
1172281806Srpaulo	u8 four_way_handshake;
1173281806Srpaulo	u8 rfkill_release;
1174281806Srpaulo};
1175281806Srpaulo
1176252726Srpaulostruct wpa_driver_ap_params {
1177252726Srpaulo	/**
1178252726Srpaulo	 * head - Beacon head from IEEE 802.11 header to IEs before TIM IE
1179252726Srpaulo	 */
1180281806Srpaulo	u8 *head;
1181252726Srpaulo
1182252726Srpaulo	/**
1183252726Srpaulo	 * head_len - Length of the head buffer in octets
1184252726Srpaulo	 */
1185252726Srpaulo	size_t head_len;
1186252726Srpaulo
1187252726Srpaulo	/**
1188252726Srpaulo	 * tail - Beacon tail following TIM IE
1189252726Srpaulo	 */
1190281806Srpaulo	u8 *tail;
1191252726Srpaulo
1192252726Srpaulo	/**
1193252726Srpaulo	 * tail_len - Length of the tail buffer in octets
1194252726Srpaulo	 */
1195252726Srpaulo	size_t tail_len;
1196252726Srpaulo
1197252726Srpaulo	/**
1198252726Srpaulo	 * dtim_period - DTIM period
1199252726Srpaulo	 */
1200252726Srpaulo	int dtim_period;
1201252726Srpaulo
1202252726Srpaulo	/**
1203252726Srpaulo	 * beacon_int - Beacon interval
1204252726Srpaulo	 */
1205252726Srpaulo	int beacon_int;
1206252726Srpaulo
1207252726Srpaulo	/**
1208252726Srpaulo	 * basic_rates: -1 terminated array of basic rates in 100 kbps
1209252726Srpaulo	 *
1210252726Srpaulo	 * This parameter can be used to set a specific basic rate set for the
1211252726Srpaulo	 * BSS. If %NULL, default basic rate set is used.
1212252726Srpaulo	 */
1213252726Srpaulo	int *basic_rates;
1214252726Srpaulo
1215252726Srpaulo	/**
1216346981Scy	 * beacon_rate: Beacon frame data rate
1217346981Scy	 *
1218346981Scy	 * This parameter can be used to set a specific Beacon frame data rate
1219346981Scy	 * for the BSS. The interpretation of this value depends on the
1220346981Scy	 * rate_type (legacy: in 100 kbps units, HT: HT-MCS, VHT: VHT-MCS). If
1221346981Scy	 * beacon_rate == 0 and rate_type == 0 (BEACON_RATE_LEGACY), the default
1222346981Scy	 * Beacon frame data rate is used.
1223346981Scy	 */
1224346981Scy	unsigned int beacon_rate;
1225346981Scy
1226346981Scy	/**
1227346981Scy	 * beacon_rate_type: Beacon data rate type (legacy/HT/VHT)
1228346981Scy	 */
1229346981Scy	enum beacon_rate_type rate_type;
1230346981Scy
1231346981Scy	/**
1232252726Srpaulo	 * proberesp - Probe Response template
1233252726Srpaulo	 *
1234252726Srpaulo	 * This is used by drivers that reply to Probe Requests internally in
1235252726Srpaulo	 * AP mode and require the full Probe Response template.
1236252726Srpaulo	 */
1237281806Srpaulo	u8 *proberesp;
1238252726Srpaulo
1239252726Srpaulo	/**
1240252726Srpaulo	 * proberesp_len - Length of the proberesp buffer in octets
1241252726Srpaulo	 */
1242252726Srpaulo	size_t proberesp_len;
1243252726Srpaulo
1244252726Srpaulo	/**
1245252726Srpaulo	 * ssid - The SSID to use in Beacon/Probe Response frames
1246252726Srpaulo	 */
1247252726Srpaulo	const u8 *ssid;
1248252726Srpaulo
1249252726Srpaulo	/**
1250252726Srpaulo	 * ssid_len - Length of the SSID (1..32)
1251252726Srpaulo	 */
1252252726Srpaulo	size_t ssid_len;
1253252726Srpaulo
1254252726Srpaulo	/**
1255252726Srpaulo	 * hide_ssid - Whether to hide the SSID
1256252726Srpaulo	 */
1257252726Srpaulo	enum hide_ssid hide_ssid;
1258252726Srpaulo
1259252726Srpaulo	/**
1260252726Srpaulo	 * pairwise_ciphers - WPA_CIPHER_* bitfield
1261252726Srpaulo	 */
1262252726Srpaulo	unsigned int pairwise_ciphers;
1263252726Srpaulo
1264252726Srpaulo	/**
1265252726Srpaulo	 * group_cipher - WPA_CIPHER_*
1266252726Srpaulo	 */
1267252726Srpaulo	unsigned int group_cipher;
1268252726Srpaulo
1269252726Srpaulo	/**
1270252726Srpaulo	 * key_mgmt_suites - WPA_KEY_MGMT_* bitfield
1271252726Srpaulo	 */
1272252726Srpaulo	unsigned int key_mgmt_suites;
1273252726Srpaulo
1274252726Srpaulo	/**
1275252726Srpaulo	 * auth_algs - WPA_AUTH_ALG_* bitfield
1276252726Srpaulo	 */
1277252726Srpaulo	unsigned int auth_algs;
1278252726Srpaulo
1279252726Srpaulo	/**
1280252726Srpaulo	 * wpa_version - WPA_PROTO_* bitfield
1281252726Srpaulo	 */
1282252726Srpaulo	unsigned int wpa_version;
1283252726Srpaulo
1284252726Srpaulo	/**
1285252726Srpaulo	 * privacy - Whether privacy is used in the BSS
1286252726Srpaulo	 */
1287252726Srpaulo	int privacy;
1288252726Srpaulo
1289252726Srpaulo	/**
1290252726Srpaulo	 * beacon_ies - WPS/P2P IE(s) for Beacon frames
1291252726Srpaulo	 *
1292252726Srpaulo	 * This is used to add IEs like WPS IE and P2P IE by drivers that do
1293252726Srpaulo	 * not use the full Beacon template.
1294252726Srpaulo	 */
1295252726Srpaulo	const struct wpabuf *beacon_ies;
1296252726Srpaulo
1297252726Srpaulo	/**
1298252726Srpaulo	 * proberesp_ies - P2P/WPS IE(s) for Probe Response frames
1299252726Srpaulo	 *
1300252726Srpaulo	 * This is used to add IEs like WPS IE and P2P IE by drivers that
1301252726Srpaulo	 * reply to Probe Request frames internally.
1302252726Srpaulo	 */
1303252726Srpaulo	const struct wpabuf *proberesp_ies;
1304252726Srpaulo
1305252726Srpaulo	/**
1306252726Srpaulo	 * assocresp_ies - WPS IE(s) for (Re)Association Response frames
1307252726Srpaulo	 *
1308252726Srpaulo	 * This is used to add IEs like WPS IE by drivers that reply to
1309252726Srpaulo	 * (Re)Association Request frames internally.
1310252726Srpaulo	 */
1311252726Srpaulo	const struct wpabuf *assocresp_ies;
1312252726Srpaulo
1313252726Srpaulo	/**
1314252726Srpaulo	 * isolate - Whether to isolate frames between associated stations
1315252726Srpaulo	 *
1316252726Srpaulo	 * If this is non-zero, the AP is requested to disable forwarding of
1317252726Srpaulo	 * frames between associated stations.
1318252726Srpaulo	 */
1319252726Srpaulo	int isolate;
1320252726Srpaulo
1321252726Srpaulo	/**
1322252726Srpaulo	 * cts_protect - Whether CTS protection is enabled
1323252726Srpaulo	 */
1324252726Srpaulo	int cts_protect;
1325252726Srpaulo
1326252726Srpaulo	/**
1327252726Srpaulo	 * preamble - Whether short preamble is enabled
1328252726Srpaulo	 */
1329252726Srpaulo	int preamble;
1330252726Srpaulo
1331252726Srpaulo	/**
1332252726Srpaulo	 * short_slot_time - Whether short slot time is enabled
1333252726Srpaulo	 *
1334252726Srpaulo	 * 0 = short slot time disable, 1 = short slot time enabled, -1 = do
1335252726Srpaulo	 * not set (e.g., when 802.11g mode is not in use)
1336252726Srpaulo	 */
1337252726Srpaulo	int short_slot_time;
1338252726Srpaulo
1339252726Srpaulo	/**
1340252726Srpaulo	 * ht_opmode - HT operation mode or -1 if HT not in use
1341252726Srpaulo	 */
1342252726Srpaulo	int ht_opmode;
1343252726Srpaulo
1344252726Srpaulo	/**
1345252726Srpaulo	 * interworking - Whether Interworking is enabled
1346252726Srpaulo	 */
1347252726Srpaulo	int interworking;
1348252726Srpaulo
1349252726Srpaulo	/**
1350252726Srpaulo	 * hessid - Homogeneous ESS identifier or %NULL if not set
1351252726Srpaulo	 */
1352252726Srpaulo	const u8 *hessid;
1353252726Srpaulo
1354252726Srpaulo	/**
1355252726Srpaulo	 * access_network_type - Access Network Type (0..15)
1356252726Srpaulo	 *
1357252726Srpaulo	 * This is used for filtering Probe Request frames when Interworking is
1358252726Srpaulo	 * enabled.
1359252726Srpaulo	 */
1360252726Srpaulo	u8 access_network_type;
1361252726Srpaulo
1362252726Srpaulo	/**
1363252726Srpaulo	 * ap_max_inactivity - Timeout in seconds to detect STA's inactivity
1364252726Srpaulo	 *
1365252726Srpaulo	 * This is used by driver which advertises this capability.
1366252726Srpaulo	 */
1367252726Srpaulo	int ap_max_inactivity;
1368252726Srpaulo
1369252726Srpaulo	/**
1370281806Srpaulo	 * ctwindow - Client Traffic Window (in TUs)
1371281806Srpaulo	 */
1372281806Srpaulo	u8 p2p_go_ctwindow;
1373281806Srpaulo
1374281806Srpaulo	/**
1375281806Srpaulo	 * smps_mode - SMPS mode
1376281806Srpaulo	 *
1377281806Srpaulo	 * SMPS mode to be used by the AP, specified as the relevant bits of
1378281806Srpaulo	 * ht_capab (i.e. HT_CAP_INFO_SMPS_*).
1379281806Srpaulo	 */
1380281806Srpaulo	unsigned int smps_mode;
1381281806Srpaulo
1382281806Srpaulo	/**
1383252726Srpaulo	 * disable_dgaf - Whether group-addressed frames are disabled
1384252726Srpaulo	 */
1385252726Srpaulo	int disable_dgaf;
1386281806Srpaulo
1387281806Srpaulo	/**
1388281806Srpaulo	 * osen - Whether OSEN security is enabled
1389281806Srpaulo	 */
1390281806Srpaulo	int osen;
1391281806Srpaulo
1392281806Srpaulo	/**
1393281806Srpaulo	 * freq - Channel parameters for dynamic bandwidth changes
1394281806Srpaulo	 */
1395281806Srpaulo	struct hostapd_freq_params *freq;
1396281806Srpaulo
1397281806Srpaulo	/**
1398281806Srpaulo	 * reenable - Whether this is to re-enable beaconing
1399281806Srpaulo	 */
1400281806Srpaulo	int reenable;
1401337817Scy
1402337817Scy	/**
1403337817Scy	 * pbss - Whether to start a PCP (in PBSS) instead of an AP in
1404337817Scy	 * infrastructure BSS. Valid only for DMG network.
1405337817Scy	 */
1406337817Scy	int pbss;
1407346981Scy
1408346981Scy	/**
1409346981Scy	 * multicast_to_unicast - Whether to use multicast_to_unicast
1410346981Scy	 *
1411346981Scy	 * If this is non-zero, the AP is requested to perform multicast to
1412346981Scy	 * unicast conversion for ARP, IPv4, and IPv6 frames (possibly within
1413346981Scy	 * 802.1Q). If enabled, such frames are to be sent to each station
1414346981Scy	 * separately, with the DA replaced by their own MAC address rather
1415346981Scy	 * than the group address.
1416346981Scy	 *
1417346981Scy	 * Note that this may break certain expectations of the receiver, such
1418346981Scy	 * as the ability to drop unicast IP packets received within multicast
1419346981Scy	 * L2 frames, or the ability to not send ICMP destination unreachable
1420346981Scy	 * messages for packets received in L2 multicast (which is required,
1421346981Scy	 * but the receiver can't tell the difference if this new option is
1422346981Scy	 * enabled.)
1423346981Scy	 *
1424346981Scy	 * This also doesn't implement the 802.11 DMS (directed multicast
1425346981Scy	 * service).
1426346981Scy	 */
1427346981Scy	int multicast_to_unicast;
1428346981Scy
1429346981Scy	/**
1430346981Scy	 * ftm_responder - Whether FTM responder is enabled
1431346981Scy	 */
1432346981Scy	int ftm_responder;
1433346981Scy
1434346981Scy	/**
1435346981Scy	 * lci - Binary data, the content of an LCI report IE with type 8 as
1436346981Scy	 * defined in IEEE Std 802.11-2016, 9.4.2.22.10
1437346981Scy	 */
1438346981Scy	const struct wpabuf *lci;
1439346981Scy
1440346981Scy	/**
1441346981Scy	 * civic - Binary data, the content of a measurement report IE with
1442346981Scy	 * type 11 as defined in IEEE Std 802.11-2016, 9.4.2.22.13
1443346981Scy	 */
1444346981Scy	const struct wpabuf *civic;
1445252726Srpaulo};
1446252726Srpaulo
1447281806Srpaulostruct wpa_driver_mesh_bss_params {
1448337817Scy#define WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS		0x00000001
1449337817Scy#define WPA_DRIVER_MESH_CONF_FLAG_PEER_LINK_TIMEOUT	0x00000002
1450337817Scy#define WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS	0x00000004
1451337817Scy#define WPA_DRIVER_MESH_CONF_FLAG_HT_OP_MODE		0x00000008
1452346981Scy#define WPA_DRIVER_MESH_CONF_FLAG_RSSI_THRESHOLD	0x00000010
1453281806Srpaulo	/*
1454281806Srpaulo	 * TODO: Other mesh configuration parameters would go here.
1455281806Srpaulo	 * See NL80211_MESHCONF_* for all the mesh config parameters.
1456281806Srpaulo	 */
1457281806Srpaulo	unsigned int flags;
1458337817Scy	int auto_plinks;
1459281806Srpaulo	int peer_link_timeout;
1460337817Scy	int max_peer_links;
1461346981Scy	int rssi_threshold;
1462337817Scy	u16 ht_opmode;
1463281806Srpaulo};
1464281806Srpaulo
1465281806Srpaulostruct wpa_driver_mesh_join_params {
1466281806Srpaulo	const u8 *meshid;
1467281806Srpaulo	int meshid_len;
1468281806Srpaulo	const int *basic_rates;
1469281806Srpaulo	const u8 *ies;
1470281806Srpaulo	int ie_len;
1471281806Srpaulo	struct hostapd_freq_params freq;
1472281806Srpaulo	int beacon_int;
1473337817Scy	int dtim_period;
1474281806Srpaulo	struct wpa_driver_mesh_bss_params conf;
1475281806Srpaulo#define WPA_DRIVER_MESH_FLAG_USER_MPM	0x00000001
1476281806Srpaulo#define WPA_DRIVER_MESH_FLAG_DRIVER_MPM	0x00000002
1477281806Srpaulo#define WPA_DRIVER_MESH_FLAG_SAE_AUTH	0x00000004
1478281806Srpaulo#define WPA_DRIVER_MESH_FLAG_AMPE	0x00000008
1479281806Srpaulo	unsigned int flags;
1480281806Srpaulo};
1481281806Srpaulo
1482189251Ssam/**
1483189251Ssam * struct wpa_driver_capa - Driver capability information
1484189251Ssam */
1485189251Ssamstruct wpa_driver_capa {
1486189251Ssam#define WPA_DRIVER_CAPA_KEY_MGMT_WPA		0x00000001
1487189251Ssam#define WPA_DRIVER_CAPA_KEY_MGMT_WPA2		0x00000002
1488189251Ssam#define WPA_DRIVER_CAPA_KEY_MGMT_WPA_PSK	0x00000004
1489189251Ssam#define WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK	0x00000008
1490189251Ssam#define WPA_DRIVER_CAPA_KEY_MGMT_WPA_NONE	0x00000010
1491189251Ssam#define WPA_DRIVER_CAPA_KEY_MGMT_FT		0x00000020
1492189251Ssam#define WPA_DRIVER_CAPA_KEY_MGMT_FT_PSK		0x00000040
1493252726Srpaulo#define WPA_DRIVER_CAPA_KEY_MGMT_WAPI_PSK	0x00000080
1494281806Srpaulo#define WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B	0x00000100
1495281806Srpaulo#define WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B_192	0x00000200
1496346981Scy#define WPA_DRIVER_CAPA_KEY_MGMT_OWE		0x00000400
1497346981Scy#define WPA_DRIVER_CAPA_KEY_MGMT_DPP		0x00000800
1498346981Scy#define WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA256    0x00001000
1499346981Scy#define WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA384    0x00002000
1500346981Scy#define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA256 0x00004000
1501346981Scy#define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA384 0x00008000
1502346981Scy#define WPA_DRIVER_CAPA_KEY_MGMT_SAE 		0x00010000
1503281806Srpaulo	/** Bitfield of supported key management suites */
1504189251Ssam	unsigned int key_mgmt;
1505189251Ssam
1506189251Ssam#define WPA_DRIVER_CAPA_ENC_WEP40	0x00000001
1507189251Ssam#define WPA_DRIVER_CAPA_ENC_WEP104	0x00000002
1508189251Ssam#define WPA_DRIVER_CAPA_ENC_TKIP	0x00000004
1509189251Ssam#define WPA_DRIVER_CAPA_ENC_CCMP	0x00000008
1510252726Srpaulo#define WPA_DRIVER_CAPA_ENC_WEP128	0x00000010
1511252726Srpaulo#define WPA_DRIVER_CAPA_ENC_GCMP	0x00000020
1512281806Srpaulo#define WPA_DRIVER_CAPA_ENC_GCMP_256	0x00000040
1513281806Srpaulo#define WPA_DRIVER_CAPA_ENC_CCMP_256	0x00000080
1514281806Srpaulo#define WPA_DRIVER_CAPA_ENC_BIP		0x00000100
1515281806Srpaulo#define WPA_DRIVER_CAPA_ENC_BIP_GMAC_128	0x00000200
1516281806Srpaulo#define WPA_DRIVER_CAPA_ENC_BIP_GMAC_256	0x00000400
1517281806Srpaulo#define WPA_DRIVER_CAPA_ENC_BIP_CMAC_256	0x00000800
1518281806Srpaulo#define WPA_DRIVER_CAPA_ENC_GTK_NOT_USED	0x00001000
1519281806Srpaulo	/** Bitfield of supported cipher suites */
1520189251Ssam	unsigned int enc;
1521189251Ssam
1522189251Ssam#define WPA_DRIVER_AUTH_OPEN		0x00000001
1523189251Ssam#define WPA_DRIVER_AUTH_SHARED		0x00000002
1524189251Ssam#define WPA_DRIVER_AUTH_LEAP		0x00000004
1525281806Srpaulo	/** Bitfield of supported IEEE 802.11 authentication algorithms */
1526189251Ssam	unsigned int auth;
1527189251Ssam
1528281806Srpaulo/** Driver generated WPA/RSN IE */
1529189251Ssam#define WPA_DRIVER_FLAGS_DRIVER_IE	0x00000001
1530281806Srpaulo/** Driver needs static WEP key setup after association command */
1531189251Ssam#define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC 0x00000002
1532281806Srpaulo/** Driver takes care of all DFS operations */
1533281806Srpaulo#define WPA_DRIVER_FLAGS_DFS_OFFLOAD			0x00000004
1534281806Srpaulo/** Driver takes care of RSN 4-way handshake internally; PMK is configured with
1535189251Ssam * struct wpa_driver_ops::set_key using alg = WPA_ALG_PMK */
1536346981Scy#define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X		0x00000008
1537281806Srpaulo/** Driver is for a wired Ethernet interface */
1538214734Srpaulo#define WPA_DRIVER_FLAGS_WIRED		0x00000010
1539281806Srpaulo/** Driver provides separate commands for authentication and association (SME in
1540214734Srpaulo * wpa_supplicant). */
1541214734Srpaulo#define WPA_DRIVER_FLAGS_SME		0x00000020
1542281806Srpaulo/** Driver supports AP mode */
1543214734Srpaulo#define WPA_DRIVER_FLAGS_AP		0x00000040
1544281806Srpaulo/** Driver needs static WEP key setup after association has been completed */
1545214734Srpaulo#define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE	0x00000080
1546281806Srpaulo/** Driver supports dynamic HT 20/40 MHz channel changes during BSS lifetime */
1547281806Srpaulo#define WPA_DRIVER_FLAGS_HT_2040_COEX			0x00000100
1548281806Srpaulo/** Driver supports concurrent P2P operations */
1549252726Srpaulo#define WPA_DRIVER_FLAGS_P2P_CONCURRENT	0x00000200
1550281806Srpaulo/**
1551252726Srpaulo * Driver uses the initial interface as a dedicated management interface, i.e.,
1552252726Srpaulo * it cannot be used for P2P group operations or non-P2P purposes.
1553252726Srpaulo */
1554252726Srpaulo#define WPA_DRIVER_FLAGS_P2P_DEDICATED_INTERFACE	0x00000400
1555281806Srpaulo/** This interface is P2P capable (P2P GO or P2P Client) */
1556252726Srpaulo#define WPA_DRIVER_FLAGS_P2P_CAPABLE	0x00000800
1557281806Srpaulo/** Driver supports station and key removal when stopping an AP */
1558281806Srpaulo#define WPA_DRIVER_FLAGS_AP_TEARDOWN_SUPPORT		0x00001000
1559281806Srpaulo/**
1560252726Srpaulo * Driver uses the initial interface for P2P management interface and non-P2P
1561252726Srpaulo * purposes (e.g., connect to infra AP), but this interface cannot be used for
1562252726Srpaulo * P2P group operations.
1563252726Srpaulo */
1564252726Srpaulo#define WPA_DRIVER_FLAGS_P2P_MGMT_AND_NON_P2P		0x00002000
1565281806Srpaulo/**
1566252726Srpaulo * Driver is known to use sane error codes, i.e., when it indicates that
1567252726Srpaulo * something (e.g., association) fails, there was indeed a failure and the
1568252726Srpaulo * operation does not end up getting completed successfully later.
1569252726Srpaulo */
1570252726Srpaulo#define WPA_DRIVER_FLAGS_SANE_ERROR_CODES		0x00004000
1571281806Srpaulo/** Driver supports off-channel TX */
1572252726Srpaulo#define WPA_DRIVER_FLAGS_OFFCHANNEL_TX			0x00008000
1573281806Srpaulo/** Driver indicates TX status events for EAPOL Data frames */
1574252726Srpaulo#define WPA_DRIVER_FLAGS_EAPOL_TX_STATUS		0x00010000
1575281806Srpaulo/** Driver indicates TX status events for Deauth/Disassoc frames */
1576252726Srpaulo#define WPA_DRIVER_FLAGS_DEAUTH_TX_STATUS		0x00020000
1577281806Srpaulo/** Driver supports roaming (BSS selection) in firmware */
1578252726Srpaulo#define WPA_DRIVER_FLAGS_BSS_SELECTION			0x00040000
1579281806Srpaulo/** Driver supports operating as a TDLS peer */
1580252726Srpaulo#define WPA_DRIVER_FLAGS_TDLS_SUPPORT			0x00080000
1581281806Srpaulo/** Driver requires external TDLS setup/teardown/discovery */
1582252726Srpaulo#define WPA_DRIVER_FLAGS_TDLS_EXTERNAL_SETUP		0x00100000
1583281806Srpaulo/** Driver indicates support for Probe Response offloading in AP mode */
1584252726Srpaulo#define WPA_DRIVER_FLAGS_PROBE_RESP_OFFLOAD		0x00200000
1585281806Srpaulo/** Driver supports U-APSD in AP mode */
1586252726Srpaulo#define WPA_DRIVER_FLAGS_AP_UAPSD			0x00400000
1587281806Srpaulo/** Driver supports inactivity timer in AP mode */
1588252726Srpaulo#define WPA_DRIVER_FLAGS_INACTIVITY_TIMER		0x00800000
1589281806Srpaulo/** Driver expects user space implementation of MLME in AP mode */
1590252726Srpaulo#define WPA_DRIVER_FLAGS_AP_MLME			0x01000000
1591281806Srpaulo/** Driver supports SAE with user space SME */
1592252726Srpaulo#define WPA_DRIVER_FLAGS_SAE				0x02000000
1593281806Srpaulo/** Driver makes use of OBSS scan mechanism in wpa_supplicant */
1594252726Srpaulo#define WPA_DRIVER_FLAGS_OBSS_SCAN			0x04000000
1595281806Srpaulo/** Driver supports IBSS (Ad-hoc) mode */
1596281806Srpaulo#define WPA_DRIVER_FLAGS_IBSS				0x08000000
1597281806Srpaulo/** Driver supports radar detection */
1598281806Srpaulo#define WPA_DRIVER_FLAGS_RADAR				0x10000000
1599281806Srpaulo/** Driver supports a dedicated interface for P2P Device */
1600281806Srpaulo#define WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE		0x20000000
1601281806Srpaulo/** Driver supports QoS Mapping */
1602281806Srpaulo#define WPA_DRIVER_FLAGS_QOS_MAPPING			0x40000000
1603281806Srpaulo/** Driver supports CSA in AP mode */
1604281806Srpaulo#define WPA_DRIVER_FLAGS_AP_CSA				0x80000000
1605281806Srpaulo/** Driver supports mesh */
1606281806Srpaulo#define WPA_DRIVER_FLAGS_MESH			0x0000000100000000ULL
1607281806Srpaulo/** Driver support ACS offload */
1608281806Srpaulo#define WPA_DRIVER_FLAGS_ACS_OFFLOAD		0x0000000200000000ULL
1609281806Srpaulo/** Driver supports key management offload */
1610281806Srpaulo#define WPA_DRIVER_FLAGS_KEY_MGMT_OFFLOAD	0x0000000400000000ULL
1611281806Srpaulo/** Driver supports TDLS channel switching */
1612281806Srpaulo#define WPA_DRIVER_FLAGS_TDLS_CHANNEL_SWITCH	0x0000000800000000ULL
1613281806Srpaulo/** Driver supports IBSS with HT datarates */
1614281806Srpaulo#define WPA_DRIVER_FLAGS_HT_IBSS		0x0000001000000000ULL
1615281806Srpaulo/** Driver supports IBSS with VHT datarates */
1616281806Srpaulo#define WPA_DRIVER_FLAGS_VHT_IBSS		0x0000002000000000ULL
1617289549Srpaulo/** Driver supports automatic band selection */
1618289549Srpaulo#define WPA_DRIVER_FLAGS_SUPPORT_HW_MODE_ANY	0x0000004000000000ULL
1619337817Scy/** Driver supports simultaneous off-channel operations */
1620337817Scy#define WPA_DRIVER_FLAGS_OFFCHANNEL_SIMULTANEOUS	0x0000008000000000ULL
1621337817Scy/** Driver supports full AP client state */
1622337817Scy#define WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE	0x0000010000000000ULL
1623337817Scy/** Driver supports P2P Listen offload */
1624337817Scy#define WPA_DRIVER_FLAGS_P2P_LISTEN_OFFLOAD     0x0000020000000000ULL
1625346981Scy/** Driver supports FILS */
1626346981Scy#define WPA_DRIVER_FLAGS_SUPPORT_FILS		0x0000040000000000ULL
1627346981Scy/** Driver supports Beacon frame TX rate configuration (legacy rates) */
1628346981Scy#define WPA_DRIVER_FLAGS_BEACON_RATE_LEGACY	0x0000080000000000ULL
1629346981Scy/** Driver supports Beacon frame TX rate configuration (HT rates) */
1630346981Scy#define WPA_DRIVER_FLAGS_BEACON_RATE_HT		0x0000100000000000ULL
1631346981Scy/** Driver supports Beacon frame TX rate configuration (VHT rates) */
1632346981Scy#define WPA_DRIVER_FLAGS_BEACON_RATE_VHT	0x0000200000000000ULL
1633346981Scy/** Driver supports mgmt_tx with random TX address in non-connected state */
1634346981Scy#define WPA_DRIVER_FLAGS_MGMT_TX_RANDOM_TA	0x0000400000000000ULL
1635346981Scy/** Driver supports mgmt_tx with random TX addr in connected state */
1636346981Scy#define WPA_DRIVER_FLAGS_MGMT_TX_RANDOM_TA_CONNECTED	0x0000800000000000ULL
1637346981Scy/** Driver supports better BSS reporting with sched_scan in connected mode */
1638346981Scy#define WPA_DRIVER_FLAGS_SCHED_SCAN_RELATIVE_RSSI	0x0001000000000000ULL
1639346981Scy/** Driver supports HE capabilities */
1640346981Scy#define WPA_DRIVER_FLAGS_HE_CAPABILITIES	0x0002000000000000ULL
1641346981Scy/** Driver supports FILS shared key offload */
1642346981Scy#define WPA_DRIVER_FLAGS_FILS_SK_OFFLOAD	0x0004000000000000ULL
1643346981Scy/** Driver supports all OCE STA specific mandatory features */
1644346981Scy#define WPA_DRIVER_FLAGS_OCE_STA		0x0008000000000000ULL
1645346981Scy/** Driver supports all OCE AP specific mandatory features */
1646346981Scy#define WPA_DRIVER_FLAGS_OCE_AP			0x0010000000000000ULL
1647346981Scy/**
1648346981Scy * Driver supports all OCE STA-CFON specific mandatory features only.
1649346981Scy * If a driver sets this bit but not the %WPA_DRIVER_FLAGS_OCE_AP, the
1650346981Scy * userspace shall assume that this driver may not support all OCE AP
1651346981Scy * functionality but can support only OCE STA-CFON functionality.
1652346981Scy */
1653346981Scy#define WPA_DRIVER_FLAGS_OCE_STA_CFON		0x0020000000000000ULL
1654346981Scy/** Driver supports MFP-optional in the connect command */
1655346981Scy#define WPA_DRIVER_FLAGS_MFP_OPTIONAL		0x0040000000000000ULL
1656346981Scy/** Driver is a self-managed regulatory device */
1657346981Scy#define WPA_DRIVER_FLAGS_SELF_MANAGED_REGULATORY       0x0080000000000000ULL
1658346981Scy/** Driver supports FTM responder functionality */
1659346981Scy#define WPA_DRIVER_FLAGS_FTM_RESPONDER		0x0100000000000000ULL
1660346981Scy/** Driver support 4-way handshake offload for WPA-Personal */
1661346981Scy#define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK	0x0200000000000000ULL
1662281806Srpaulo	u64 flags;
1663214734Srpaulo
1664337817Scy#define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \
1665337817Scy	(drv_flags & WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE)
1666337817Scy
1667281806Srpaulo#define WPA_DRIVER_SMPS_MODE_STATIC			0x00000001
1668281806Srpaulo#define WPA_DRIVER_SMPS_MODE_DYNAMIC			0x00000002
1669281806Srpaulo	unsigned int smps_modes;
1670281806Srpaulo
1671281806Srpaulo	unsigned int wmm_ac_supported:1;
1672281806Srpaulo
1673281806Srpaulo	unsigned int mac_addr_rand_scan_supported:1;
1674281806Srpaulo	unsigned int mac_addr_rand_sched_scan_supported:1;
1675281806Srpaulo
1676281806Srpaulo	/** Maximum number of supported active probe SSIDs */
1677214734Srpaulo	int max_scan_ssids;
1678281806Srpaulo
1679281806Srpaulo	/** Maximum number of supported active probe SSIDs for sched_scan */
1680252726Srpaulo	int max_sched_scan_ssids;
1681281806Srpaulo
1682337817Scy	/** Maximum number of supported scan plans for scheduled scan */
1683337817Scy	unsigned int max_sched_scan_plans;
1684337817Scy
1685337817Scy	/** Maximum interval in a scan plan. In seconds */
1686337817Scy	u32 max_sched_scan_plan_interval;
1687337817Scy
1688337817Scy	/** Maximum number of iterations in a single scan plan */
1689337817Scy	u32 max_sched_scan_plan_iterations;
1690337817Scy
1691281806Srpaulo	/** Whether sched_scan (offloaded scanning) is supported */
1692252726Srpaulo	int sched_scan_supported;
1693281806Srpaulo
1694281806Srpaulo	/** Maximum number of supported match sets for sched_scan */
1695252726Srpaulo	int max_match_sets;
1696214734Srpaulo
1697214734Srpaulo	/**
1698214734Srpaulo	 * max_remain_on_chan - Maximum remain-on-channel duration in msec
1699214734Srpaulo	 */
1700214734Srpaulo	unsigned int max_remain_on_chan;
1701252726Srpaulo
1702252726Srpaulo	/**
1703252726Srpaulo	 * max_stations - Maximum number of associated stations the driver
1704252726Srpaulo	 * supports in AP mode
1705252726Srpaulo	 */
1706252726Srpaulo	unsigned int max_stations;
1707252726Srpaulo
1708252726Srpaulo	/**
1709252726Srpaulo	 * probe_resp_offloads - Bitmap of supported protocols by the driver
1710252726Srpaulo	 * for Probe Response offloading.
1711252726Srpaulo	 */
1712281806Srpaulo/** Driver Probe Response offloading support for WPS ver. 1 */
1713252726Srpaulo#define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS		0x00000001
1714281806Srpaulo/** Driver Probe Response offloading support for WPS ver. 2 */
1715252726Srpaulo#define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS2		0x00000002
1716281806Srpaulo/** Driver Probe Response offloading support for P2P */
1717252726Srpaulo#define WPA_DRIVER_PROBE_RESP_OFFLOAD_P2P		0x00000004
1718281806Srpaulo/** Driver Probe Response offloading support for IEEE 802.11u (Interworking) */
1719252726Srpaulo#define WPA_DRIVER_PROBE_RESP_OFFLOAD_INTERWORKING	0x00000008
1720252726Srpaulo	unsigned int probe_resp_offloads;
1721281806Srpaulo
1722281806Srpaulo	unsigned int max_acl_mac_addrs;
1723281806Srpaulo
1724281806Srpaulo	/**
1725281806Srpaulo	 * Number of supported concurrent channels
1726281806Srpaulo	 */
1727281806Srpaulo	unsigned int num_multichan_concurrent;
1728281806Srpaulo
1729281806Srpaulo	/**
1730281806Srpaulo	 * extended_capa - extended capabilities in driver/device
1731281806Srpaulo	 *
1732281806Srpaulo	 * Must be allocated and freed by driver and the pointers must be
1733281806Srpaulo	 * valid for the lifetime of the driver, i.e., freed in deinit()
1734281806Srpaulo	 */
1735281806Srpaulo	const u8 *extended_capa, *extended_capa_mask;
1736281806Srpaulo	unsigned int extended_capa_len;
1737281806Srpaulo
1738281806Srpaulo	struct wowlan_triggers wowlan_triggers;
1739281806Srpaulo
1740281806Srpaulo/** Driver adds the DS Params Set IE in Probe Request frames */
1741281806Srpaulo#define WPA_DRIVER_FLAGS_DS_PARAM_SET_IE_IN_PROBES	0x00000001
1742281806Srpaulo/** Driver adds the WFA TPC IE in Probe Request frames */
1743281806Srpaulo#define WPA_DRIVER_FLAGS_WFA_TPC_IE_IN_PROBES		0x00000002
1744281806Srpaulo/** Driver handles quiet period requests */
1745281806Srpaulo#define WPA_DRIVER_FLAGS_QUIET				0x00000004
1746281806Srpaulo/**
1747281806Srpaulo * Driver is capable of inserting the current TX power value into the body of
1748281806Srpaulo * transmitted frames.
1749281806Srpaulo * Background: Some Action frames include a TPC Report IE. This IE contains a
1750281806Srpaulo * TX power field, which has to be updated by lower layers. One such Action
1751281806Srpaulo * frame is Link Measurement Report (part of RRM). Another is TPC Report (part
1752281806Srpaulo * of spectrum management). Note that this insertion takes place at a fixed
1753281806Srpaulo * offset, namely the 6th byte in the Action frame body.
1754281806Srpaulo */
1755281806Srpaulo#define WPA_DRIVER_FLAGS_TX_POWER_INSERTION		0x00000008
1756337817Scy/**
1757337817Scy * Driver supports RRM. With this support, the driver will accept to use RRM in
1758337817Scy * (Re)Association Request frames, without supporting quiet period.
1759337817Scy */
1760337817Scy#define WPA_DRIVER_FLAGS_SUPPORT_RRM			0x00000010
1761337817Scy
1762346981Scy/** Driver supports setting the scan dwell time */
1763346981Scy#define WPA_DRIVER_FLAGS_SUPPORT_SET_SCAN_DWELL		0x00000020
1764346981Scy/** Driver supports Beacon Report Measurement */
1765346981Scy#define WPA_DRIVER_FLAGS_SUPPORT_BEACON_REPORT		0x00000040
1766346981Scy
1767281806Srpaulo	u32 rrm_flags;
1768289549Srpaulo
1769289549Srpaulo	/* Driver concurrency capabilities */
1770289549Srpaulo	unsigned int conc_capab;
1771289549Srpaulo	/* Maximum number of concurrent channels on 2.4 GHz */
1772289549Srpaulo	unsigned int max_conc_chan_2_4;
1773289549Srpaulo	/* Maximum number of concurrent channels on 5 GHz */
1774289549Srpaulo	unsigned int max_conc_chan_5_0;
1775337817Scy
1776337817Scy	/* Maximum number of supported CSA counters */
1777337817Scy	u16 max_csa_counters;
1778189251Ssam};
1779189251Ssam
1780189251Ssam
1781214734Srpaulostruct hostapd_data;
1782189251Ssam
1783346981Scy#define STA_DRV_DATA_TX_MCS BIT(0)
1784346981Scy#define STA_DRV_DATA_RX_MCS BIT(1)
1785346981Scy#define STA_DRV_DATA_TX_VHT_MCS BIT(2)
1786346981Scy#define STA_DRV_DATA_RX_VHT_MCS BIT(3)
1787346981Scy#define STA_DRV_DATA_TX_VHT_NSS BIT(4)
1788346981Scy#define STA_DRV_DATA_RX_VHT_NSS BIT(5)
1789346981Scy#define STA_DRV_DATA_TX_SHORT_GI BIT(6)
1790346981Scy#define STA_DRV_DATA_RX_SHORT_GI BIT(7)
1791346981Scy#define STA_DRV_DATA_LAST_ACK_RSSI BIT(8)
1792346981Scy
1793214734Srpaulostruct hostap_sta_driver_data {
1794337817Scy	unsigned long rx_packets, tx_packets;
1795337817Scy	unsigned long long rx_bytes, tx_bytes;
1796351611Scy	unsigned long long rx_airtime, tx_airtime;
1797337817Scy	int bytes_64bit; /* whether 64-bit byte counters are supported */
1798214734Srpaulo	unsigned long current_tx_rate;
1799346981Scy	unsigned long current_rx_rate;
1800214734Srpaulo	unsigned long inactive_msec;
1801346981Scy	unsigned long flags; /* bitfield of STA_DRV_DATA_* */
1802214734Srpaulo	unsigned long num_ps_buf_frames;
1803214734Srpaulo	unsigned long tx_retry_failed;
1804214734Srpaulo	unsigned long tx_retry_count;
1805346981Scy	s8 last_ack_rssi;
1806351611Scy	unsigned long backlog_packets;
1807351611Scy	unsigned long backlog_bytes;
1808346981Scy	s8 signal;
1809346981Scy	u8 rx_vhtmcs;
1810346981Scy	u8 tx_vhtmcs;
1811346981Scy	u8 rx_mcs;
1812346981Scy	u8 tx_mcs;
1813346981Scy	u8 rx_vht_nss;
1814346981Scy	u8 tx_vht_nss;
1815189251Ssam};
1816189251Ssam
1817214734Srpaulostruct hostapd_sta_add_params {
1818214734Srpaulo	const u8 *addr;
1819214734Srpaulo	u16 aid;
1820214734Srpaulo	u16 capability;
1821214734Srpaulo	const u8 *supp_rates;
1822214734Srpaulo	size_t supp_rates_len;
1823214734Srpaulo	u16 listen_interval;
1824214734Srpaulo	const struct ieee80211_ht_capabilities *ht_capabilities;
1825281806Srpaulo	const struct ieee80211_vht_capabilities *vht_capabilities;
1826281806Srpaulo	int vht_opmode_enabled;
1827281806Srpaulo	u8 vht_opmode;
1828351611Scy	const struct ieee80211_he_capabilities *he_capab;
1829351611Scy	size_t he_capab_len;
1830252726Srpaulo	u32 flags; /* bitmask of WPA_STA_* flags */
1831281806Srpaulo	u32 flags_mask; /* unset bits in flags */
1832281806Srpaulo#ifdef CONFIG_MESH
1833281806Srpaulo	enum mesh_plink_state plink_state;
1834337817Scy	u16 peer_aid;
1835281806Srpaulo#endif /* CONFIG_MESH */
1836252726Srpaulo	int set; /* Set STA parameters instead of add */
1837252726Srpaulo	u8 qosinfo;
1838281806Srpaulo	const u8 *ext_capab;
1839281806Srpaulo	size_t ext_capab_len;
1840281806Srpaulo	const u8 *supp_channels;
1841281806Srpaulo	size_t supp_channels_len;
1842281806Srpaulo	const u8 *supp_oper_classes;
1843281806Srpaulo	size_t supp_oper_classes_len;
1844337817Scy	int support_p2p_ps;
1845214734Srpaulo};
1846189251Ssam
1847281806Srpaulostruct mac_address {
1848281806Srpaulo	u8 addr[ETH_ALEN];
1849189251Ssam};
1850189251Ssam
1851281806Srpaulostruct hostapd_acl_params {
1852281806Srpaulo	u8 acl_policy;
1853281806Srpaulo	unsigned int num_mac_acl;
1854281806Srpaulo	struct mac_address mac_acl[0];
1855281806Srpaulo};
1856281806Srpaulo
1857214734Srpauloenum wpa_driver_if_type {
1858214734Srpaulo	/**
1859214734Srpaulo	 * WPA_IF_STATION - Station mode interface
1860214734Srpaulo	 */
1861214734Srpaulo	WPA_IF_STATION,
1862189251Ssam
1863214734Srpaulo	/**
1864214734Srpaulo	 * WPA_IF_AP_VLAN - AP mode VLAN interface
1865214734Srpaulo	 *
1866214734Srpaulo	 * This interface shares its address and Beacon frame with the main
1867214734Srpaulo	 * BSS.
1868214734Srpaulo	 */
1869214734Srpaulo	WPA_IF_AP_VLAN,
1870214734Srpaulo
1871214734Srpaulo	/**
1872214734Srpaulo	 * WPA_IF_AP_BSS - AP mode BSS interface
1873214734Srpaulo	 *
1874214734Srpaulo	 * This interface has its own address and Beacon frame.
1875214734Srpaulo	 */
1876214734Srpaulo	WPA_IF_AP_BSS,
1877252726Srpaulo
1878252726Srpaulo	/**
1879252726Srpaulo	 * WPA_IF_P2P_GO - P2P Group Owner
1880252726Srpaulo	 */
1881252726Srpaulo	WPA_IF_P2P_GO,
1882252726Srpaulo
1883252726Srpaulo	/**
1884252726Srpaulo	 * WPA_IF_P2P_CLIENT - P2P Client
1885252726Srpaulo	 */
1886252726Srpaulo	WPA_IF_P2P_CLIENT,
1887252726Srpaulo
1888252726Srpaulo	/**
1889252726Srpaulo	 * WPA_IF_P2P_GROUP - P2P Group interface (will become either
1890252726Srpaulo	 * WPA_IF_P2P_GO or WPA_IF_P2P_CLIENT, but the role is not yet known)
1891252726Srpaulo	 */
1892281806Srpaulo	WPA_IF_P2P_GROUP,
1893281806Srpaulo
1894281806Srpaulo	/**
1895281806Srpaulo	 * WPA_IF_P2P_DEVICE - P2P Device interface is used to indentify the
1896281806Srpaulo	 * abstracted P2P Device function in the driver
1897281806Srpaulo	 */
1898281806Srpaulo	WPA_IF_P2P_DEVICE,
1899281806Srpaulo
1900281806Srpaulo	/*
1901281806Srpaulo	 * WPA_IF_MESH - Mesh interface
1902281806Srpaulo	 */
1903281806Srpaulo	WPA_IF_MESH,
1904289549Srpaulo
1905289549Srpaulo	/*
1906289549Srpaulo	 * WPA_IF_TDLS - TDLS offchannel interface (used for pref freq only)
1907289549Srpaulo	 */
1908289549Srpaulo	WPA_IF_TDLS,
1909289549Srpaulo
1910289549Srpaulo	/*
1911289549Srpaulo	 * WPA_IF_IBSS - IBSS interface (used for pref freq only)
1912289549Srpaulo	 */
1913289549Srpaulo	WPA_IF_IBSS,
1914189251Ssam};
1915189251Ssam
1916214734Srpaulostruct wpa_init_params {
1917252726Srpaulo	void *global_priv;
1918214734Srpaulo	const u8 *bssid;
1919214734Srpaulo	const char *ifname;
1920281806Srpaulo	const char *driver_params;
1921214734Srpaulo	int use_pae_group_addr;
1922214734Srpaulo	char **bridge;
1923214734Srpaulo	size_t num_bridge;
1924189251Ssam
1925214734Srpaulo	u8 *own_addr; /* buffer for writing own MAC address */
1926189251Ssam};
1927189251Ssam
1928189251Ssam
1929214734Srpaulostruct wpa_bss_params {
1930214734Srpaulo	/** Interface name (for multi-SSID/VLAN support) */
1931214734Srpaulo	const char *ifname;
1932214734Srpaulo	/** Whether IEEE 802.1X or WPA/WPA2 is enabled */
1933214734Srpaulo	int enabled;
1934214734Srpaulo
1935214734Srpaulo	int wpa;
1936214734Srpaulo	int ieee802_1x;
1937214734Srpaulo	int wpa_group;
1938214734Srpaulo	int wpa_pairwise;
1939214734Srpaulo	int wpa_key_mgmt;
1940214734Srpaulo	int rsn_preauth;
1941252726Srpaulo	enum mfp_options ieee80211w;
1942214734Srpaulo};
1943214734Srpaulo
1944214734Srpaulo#define WPA_STA_AUTHORIZED BIT(0)
1945214734Srpaulo#define WPA_STA_WMM BIT(1)
1946214734Srpaulo#define WPA_STA_SHORT_PREAMBLE BIT(2)
1947214734Srpaulo#define WPA_STA_MFP BIT(3)
1948252726Srpaulo#define WPA_STA_TDLS_PEER BIT(4)
1949281806Srpaulo#define WPA_STA_AUTHENTICATED BIT(5)
1950337817Scy#define WPA_STA_ASSOCIATED BIT(6)
1951214734Srpaulo
1952252726Srpauloenum tdls_oper {
1953252726Srpaulo	TDLS_DISCOVERY_REQ,
1954252726Srpaulo	TDLS_SETUP,
1955252726Srpaulo	TDLS_TEARDOWN,
1956252726Srpaulo	TDLS_ENABLE_LINK,
1957252726Srpaulo	TDLS_DISABLE_LINK,
1958252726Srpaulo	TDLS_ENABLE,
1959252726Srpaulo	TDLS_DISABLE
1960252726Srpaulo};
1961252726Srpaulo
1962252726Srpauloenum wnm_oper {
1963252726Srpaulo	WNM_SLEEP_ENTER_CONFIRM,
1964252726Srpaulo	WNM_SLEEP_ENTER_FAIL,
1965252726Srpaulo	WNM_SLEEP_EXIT_CONFIRM,
1966252726Srpaulo	WNM_SLEEP_EXIT_FAIL,
1967252726Srpaulo	WNM_SLEEP_TFS_REQ_IE_ADD,   /* STA requests driver to add TFS req IE */
1968252726Srpaulo	WNM_SLEEP_TFS_REQ_IE_NONE,  /* STA requests empty TFS req IE */
1969252726Srpaulo	WNM_SLEEP_TFS_REQ_IE_SET,   /* AP requests driver to set TFS req IE for
1970252726Srpaulo				     * a STA */
1971252726Srpaulo	WNM_SLEEP_TFS_RESP_IE_ADD,  /* AP requests driver to add TFS resp IE
1972252726Srpaulo				     * for a STA */
1973252726Srpaulo	WNM_SLEEP_TFS_RESP_IE_NONE, /* AP requests empty TFS resp IE */
1974252726Srpaulo	WNM_SLEEP_TFS_RESP_IE_SET,  /* AP requests driver to set TFS resp IE
1975252726Srpaulo				     * for a STA */
1976252726Srpaulo	WNM_SLEEP_TFS_IE_DEL        /* AP delete the TFS IE */
1977252726Srpaulo};
1978252726Srpaulo
1979346981Scy/* enum smps_mode - SMPS mode definitions */
1980346981Scyenum smps_mode {
1981346981Scy	SMPS_AUTOMATIC,
1982346981Scy	SMPS_OFF,
1983346981Scy	SMPS_DYNAMIC,
1984346981Scy	SMPS_STATIC,
1985346981Scy
1986346981Scy	/* Keep last */
1987346981Scy	SMPS_INVALID,
1988281806Srpaulo};
1989281806Srpaulo
1990346981Scy#define WPA_INVALID_NOISE 9999
1991346981Scy
1992252726Srpaulo/**
1993252726Srpaulo * struct wpa_signal_info - Information about channel signal quality
1994346981Scy * @frequency: control frequency
1995346981Scy * @above_threshold: true if the above threshold was crossed
1996346981Scy *	(relevant for a CQM event)
1997346981Scy * @current_signal: in dBm
1998346981Scy * @avg_signal: in dBm
1999346981Scy * @avg_beacon_signal: in dBm
2000346981Scy * @current_noise: %WPA_INVALID_NOISE if not supported
2001346981Scy * @current_txrate: current TX rate
2002346981Scy * @chanwidth: channel width
2003346981Scy * @center_frq1: center frequency for the first segment
2004346981Scy * @center_frq2: center frequency for the second segment (if relevant)
2005252726Srpaulo */
2006252726Srpaulostruct wpa_signal_info {
2007252726Srpaulo	u32 frequency;
2008252726Srpaulo	int above_threshold;
2009252726Srpaulo	int current_signal;
2010281806Srpaulo	int avg_signal;
2011289549Srpaulo	int avg_beacon_signal;
2012252726Srpaulo	int current_noise;
2013252726Srpaulo	int current_txrate;
2014281806Srpaulo	enum chan_width chanwidth;
2015281806Srpaulo	int center_frq1;
2016281806Srpaulo	int center_frq2;
2017252726Srpaulo};
2018252726Srpaulo
2019252726Srpaulo/**
2020346981Scy * struct wpa_channel_info - Information about the current channel
2021346981Scy * @frequency: Center frequency of the primary 20 MHz channel
2022346981Scy * @chanwidth: Width of the current operating channel
2023346981Scy * @sec_channel: Location of the secondary 20 MHz channel (either +1 or -1).
2024346981Scy *	This field is only filled in when using a 40 MHz channel.
2025346981Scy * @center_frq1: Center frequency of frequency segment 0
2026346981Scy * @center_frq2: Center frequency of frequency segment 1 (for 80+80 channels)
2027346981Scy * @seg1_idx: Frequency segment 1 index when using a 80+80 channel. This is
2028346981Scy *	derived from center_frq2 for convenience.
2029346981Scy */
2030346981Scystruct wpa_channel_info {
2031346981Scy	u32 frequency;
2032346981Scy	enum chan_width chanwidth;
2033346981Scy	int sec_channel;
2034346981Scy	int center_frq1;
2035346981Scy	int center_frq2;
2036346981Scy	u8 seg1_idx;
2037346981Scy};
2038346981Scy
2039346981Scy/**
2040281806Srpaulo * struct beacon_data - Beacon data
2041281806Srpaulo * @head: Head portion of Beacon frame (before TIM IE)
2042281806Srpaulo * @tail: Tail portion of Beacon frame (after TIM IE)
2043281806Srpaulo * @beacon_ies: Extra information element(s) to add into Beacon frames or %NULL
2044281806Srpaulo * @proberesp_ies: Extra information element(s) to add into Probe Response
2045281806Srpaulo *	frames or %NULL
2046281806Srpaulo * @assocresp_ies: Extra information element(s) to add into (Re)Association
2047281806Srpaulo *	Response frames or %NULL
2048281806Srpaulo * @probe_resp: Probe Response frame template
2049281806Srpaulo * @head_len: Length of @head
2050281806Srpaulo * @tail_len: Length of @tail
2051281806Srpaulo * @beacon_ies_len: Length of beacon_ies in octets
2052281806Srpaulo * @proberesp_ies_len: Length of proberesp_ies in octets
2053281806Srpaulo * @proberesp_ies_len: Length of proberesp_ies in octets
2054281806Srpaulo * @probe_resp_len: Length of probe response template (@probe_resp)
2055281806Srpaulo */
2056281806Srpaulostruct beacon_data {
2057281806Srpaulo	u8 *head, *tail;
2058281806Srpaulo	u8 *beacon_ies;
2059281806Srpaulo	u8 *proberesp_ies;
2060281806Srpaulo	u8 *assocresp_ies;
2061281806Srpaulo	u8 *probe_resp;
2062281806Srpaulo
2063281806Srpaulo	size_t head_len, tail_len;
2064281806Srpaulo	size_t beacon_ies_len;
2065281806Srpaulo	size_t proberesp_ies_len;
2066281806Srpaulo	size_t assocresp_ies_len;
2067281806Srpaulo	size_t probe_resp_len;
2068281806Srpaulo};
2069281806Srpaulo
2070281806Srpaulo/**
2071281806Srpaulo * struct csa_settings - Settings for channel switch command
2072281806Srpaulo * @cs_count: Count in Beacon frames (TBTT) to perform the switch
2073281806Srpaulo * @block_tx: 1 - block transmission for CSA period
2074281806Srpaulo * @freq_params: Next channel frequency parameter
2075281806Srpaulo * @beacon_csa: Beacon/probe resp/asooc resp info for CSA period
2076281806Srpaulo * @beacon_after: Next beacon/probe resp/asooc resp info
2077281806Srpaulo * @counter_offset_beacon: Offset to the count field in beacon's tail
2078281806Srpaulo * @counter_offset_presp: Offset to the count field in probe resp.
2079281806Srpaulo */
2080281806Srpaulostruct csa_settings {
2081281806Srpaulo	u8 cs_count;
2082281806Srpaulo	u8 block_tx;
2083281806Srpaulo
2084281806Srpaulo	struct hostapd_freq_params freq_params;
2085281806Srpaulo	struct beacon_data beacon_csa;
2086281806Srpaulo	struct beacon_data beacon_after;
2087281806Srpaulo
2088337817Scy	u16 counter_offset_beacon[2];
2089337817Scy	u16 counter_offset_presp[2];
2090281806Srpaulo};
2091281806Srpaulo
2092281806Srpaulo/* TDLS peer capabilities for send_tdls_mgmt() */
2093281806Srpauloenum tdls_peer_capability {
2094281806Srpaulo	TDLS_PEER_HT = BIT(0),
2095281806Srpaulo	TDLS_PEER_VHT = BIT(1),
2096281806Srpaulo	TDLS_PEER_WMM = BIT(2),
2097281806Srpaulo};
2098281806Srpaulo
2099281806Srpaulo/* valid info in the wmm_params struct */
2100281806Srpauloenum wmm_params_valid_info {
2101281806Srpaulo	WMM_PARAMS_UAPSD_QUEUES_INFO = BIT(0),
2102281806Srpaulo};
2103281806Srpaulo
2104281806Srpaulo/**
2105281806Srpaulo * struct wmm_params - WMM parameterss configured for this association
2106281806Srpaulo * @info_bitmap: Bitmap of valid wmm_params info; indicates what fields
2107281806Srpaulo *	of the struct contain valid information.
2108281806Srpaulo * @uapsd_queues: Bitmap of ACs configured for uapsd (valid only if
2109281806Srpaulo *	%WMM_PARAMS_UAPSD_QUEUES_INFO is set)
2110281806Srpaulo */
2111281806Srpaulostruct wmm_params {
2112281806Srpaulo	u8 info_bitmap;
2113281806Srpaulo	u8 uapsd_queues;
2114281806Srpaulo};
2115281806Srpaulo
2116281806Srpaulo#ifdef CONFIG_MACSEC
2117281806Srpaulostruct macsec_init_params {
2118281806Srpaulo	Boolean always_include_sci;
2119281806Srpaulo	Boolean use_es;
2120281806Srpaulo	Boolean use_scb;
2121281806Srpaulo};
2122281806Srpaulo#endif /* CONFIG_MACSEC */
2123281806Srpaulo
2124281806Srpauloenum drv_br_port_attr {
2125281806Srpaulo	DRV_BR_PORT_ATTR_PROXYARP,
2126281806Srpaulo	DRV_BR_PORT_ATTR_HAIRPIN_MODE,
2127281806Srpaulo};
2128281806Srpaulo
2129281806Srpauloenum drv_br_net_param {
2130281806Srpaulo	DRV_BR_NET_PARAM_GARP_ACCEPT,
2131289549Srpaulo	DRV_BR_MULTICAST_SNOOPING,
2132281806Srpaulo};
2133281806Srpaulo
2134281806Srpaulostruct drv_acs_params {
2135281806Srpaulo	/* Selected mode (HOSTAPD_MODE_*) */
2136281806Srpaulo	enum hostapd_hw_mode hw_mode;
2137281806Srpaulo
2138281806Srpaulo	/* Indicates whether HT is enabled */
2139281806Srpaulo	int ht_enabled;
2140281806Srpaulo
2141281806Srpaulo	/* Indicates whether HT40 is enabled */
2142281806Srpaulo	int ht40_enabled;
2143289549Srpaulo
2144289549Srpaulo	/* Indicates whether VHT is enabled */
2145289549Srpaulo	int vht_enabled;
2146289549Srpaulo
2147289549Srpaulo	/* Configured ACS channel width */
2148289549Srpaulo	u16 ch_width;
2149289549Srpaulo
2150289549Srpaulo	/* ACS channel list info */
2151289549Srpaulo	unsigned int ch_list_len;
2152289549Srpaulo	const u8 *ch_list;
2153289549Srpaulo	const int *freq_list;
2154281806Srpaulo};
2155281806Srpaulo
2156346981Scystruct wpa_bss_trans_info {
2157346981Scy	u8 mbo_transition_reason;
2158346981Scy	u8 n_candidates;
2159346981Scy	u8 *bssid;
2160346981Scy};
2161281806Srpaulo
2162346981Scystruct wpa_bss_candidate_info {
2163346981Scy	u8 num;
2164346981Scy	struct candidate_list {
2165346981Scy		u8 bssid[ETH_ALEN];
2166346981Scy		u8 is_accept;
2167346981Scy		u32 reject_reason;
2168346981Scy	} *candidates;
2169346981Scy};
2170346981Scy
2171346981Scystruct wpa_pmkid_params {
2172346981Scy	const u8 *bssid;
2173346981Scy	const u8 *ssid;
2174346981Scy	size_t ssid_len;
2175346981Scy	const u8 *fils_cache_id;
2176346981Scy	const u8 *pmkid;
2177346981Scy	const u8 *pmk;
2178346981Scy	size_t pmk_len;
2179346981Scy};
2180346981Scy
2181346981Scy/* Mask used to specify which connection parameters have to be updated */
2182346981Scyenum wpa_drv_update_connect_params_mask {
2183346981Scy	WPA_DRV_UPDATE_ASSOC_IES	= BIT(0),
2184346981Scy	WPA_DRV_UPDATE_FILS_ERP_INFO	= BIT(1),
2185346981Scy	WPA_DRV_UPDATE_AUTH_TYPE	= BIT(2),
2186346981Scy};
2187346981Scy
2188281806Srpaulo/**
2189346981Scy * struct external_auth - External authentication trigger parameters
2190346981Scy *
2191346981Scy * These are used across the external authentication request and event
2192346981Scy * interfaces.
2193346981Scy * @action: Action type / trigger for external authentication. Only significant
2194346981Scy *	for the event interface.
2195346981Scy * @bssid: BSSID of the peer with which the authentication has to happen. Used
2196346981Scy *	by both the request and event interface.
2197346981Scy * @ssid: SSID of the AP. Used by both the request and event interface.
2198346981Scy * @ssid_len: SSID length in octets.
2199346981Scy * @key_mgmt_suite: AKM suite of the respective authentication. Optional for
2200346981Scy *	the request interface.
2201346981Scy * @status: Status code, %WLAN_STATUS_SUCCESS for successful authentication,
2202346981Scy *	use %WLAN_STATUS_UNSPECIFIED_FAILURE if wpa_supplicant cannot give
2203346981Scy *	the real status code for failures. Used only for the request interface
2204346981Scy *	from user space to the driver.
2205346981Scy * @pmkid: Generated PMKID as part of external auth exchange (e.g., SAE).
2206346981Scy */
2207346981Scystruct external_auth {
2208346981Scy	enum {
2209346981Scy		EXT_AUTH_START,
2210346981Scy		EXT_AUTH_ABORT,
2211346981Scy	} action;
2212346981Scy	const u8 *bssid;
2213346981Scy	const u8 *ssid;
2214346981Scy	size_t ssid_len;
2215346981Scy	unsigned int key_mgmt_suite;
2216346981Scy	u16 status;
2217346981Scy	const u8 *pmkid;
2218346981Scy};
2219346981Scy
2220346981Scy/**
2221189251Ssam * struct wpa_driver_ops - Driver interface API definition
2222189251Ssam *
2223189251Ssam * This structure defines the API that each driver interface needs to implement
2224189251Ssam * for core wpa_supplicant code. All driver specific functionality is captured
2225189251Ssam * in this wrapper.
2226189251Ssam */
2227189251Ssamstruct wpa_driver_ops {
2228189251Ssam	/** Name of the driver interface */
2229189251Ssam	const char *name;
2230189251Ssam	/** One line description of the driver interface */
2231189251Ssam	const char *desc;
2232189251Ssam
2233189251Ssam	/**
2234189251Ssam	 * get_bssid - Get the current BSSID
2235189251Ssam	 * @priv: private driver interface data
2236189251Ssam	 * @bssid: buffer for BSSID (ETH_ALEN = 6 bytes)
2237189251Ssam	 *
2238189251Ssam	 * Returns: 0 on success, -1 on failure
2239189251Ssam	 *
2240189251Ssam	 * Query kernel driver for the current BSSID and copy it to bssid.
2241189251Ssam	 * Setting bssid to 00:00:00:00:00:00 is recommended if the STA is not
2242189251Ssam	 * associated.
2243189251Ssam	 */
2244189251Ssam	int (*get_bssid)(void *priv, u8 *bssid);
2245189251Ssam
2246189251Ssam	/**
2247189251Ssam	 * get_ssid - Get the current SSID
2248189251Ssam	 * @priv: private driver interface data
2249189251Ssam	 * @ssid: buffer for SSID (at least 32 bytes)
2250189251Ssam	 *
2251189251Ssam	 * Returns: Length of the SSID on success, -1 on failure
2252189251Ssam	 *
2253189251Ssam	 * Query kernel driver for the current SSID and copy it to ssid.
2254189251Ssam	 * Returning zero is recommended if the STA is not associated.
2255189251Ssam	 *
2256189251Ssam	 * Note: SSID is an array of octets, i.e., it is not nul terminated and
2257189251Ssam	 * can, at least in theory, contain control characters (including nul)
2258189251Ssam	 * and as such, should be processed as binary data, not a printable
2259189251Ssam	 * string.
2260189251Ssam	 */
2261189251Ssam	int (*get_ssid)(void *priv, u8 *ssid);
2262189251Ssam
2263189251Ssam	/**
2264189251Ssam	 * set_key - Configure encryption key
2265214734Srpaulo	 * @ifname: Interface name (for multi-SSID/VLAN support)
2266189251Ssam	 * @priv: private driver interface data
2267189251Ssam	 * @alg: encryption algorithm (%WPA_ALG_NONE, %WPA_ALG_WEP,
2268252726Srpaulo	 *	%WPA_ALG_TKIP, %WPA_ALG_CCMP, %WPA_ALG_IGTK, %WPA_ALG_PMK,
2269281806Srpaulo	 *	%WPA_ALG_GCMP, %WPA_ALG_GCMP_256, %WPA_ALG_CCMP_256,
2270281806Srpaulo	 *	%WPA_ALG_BIP_GMAC_128, %WPA_ALG_BIP_GMAC_256,
2271281806Srpaulo	 *	%WPA_ALG_BIP_CMAC_256);
2272189251Ssam	 *	%WPA_ALG_NONE clears the key.
2273252726Srpaulo	 * @addr: Address of the peer STA (BSSID of the current AP when setting
2274252726Srpaulo	 *	pairwise key in station mode), ff:ff:ff:ff:ff:ff for
2275252726Srpaulo	 *	broadcast keys, %NULL for default keys that are used both for
2276252726Srpaulo	 *	broadcast and unicast; when clearing keys, %NULL is used to
2277252726Srpaulo	 *	indicate that both the broadcast-only and default key of the
2278252726Srpaulo	 *	specified key index is to be cleared
2279189251Ssam	 * @key_idx: key index (0..3), usually 0 for unicast keys; 0..4095 for
2280189251Ssam	 *	IGTK
2281189251Ssam	 * @set_tx: configure this key as the default Tx key (only used when
2282189251Ssam	 *	driver does not support separate unicast/individual key
2283189251Ssam	 * @seq: sequence number/packet number, seq_len octets, the next
2284189251Ssam	 *	packet number to be used for in replay protection; configured
2285189251Ssam	 *	for Rx keys (in most cases, this is only used with broadcast
2286252726Srpaulo	 *	keys and set to zero for unicast keys); %NULL if not set
2287189251Ssam	 * @seq_len: length of the seq, depends on the algorithm:
2288252726Srpaulo	 *	TKIP: 6 octets, CCMP/GCMP: 6 octets, IGTK: 6 octets
2289189251Ssam	 * @key: key buffer; TKIP: 16-byte temporal key, 8-byte Tx Mic key,
2290189251Ssam	 *	8-byte Rx Mic Key
2291189251Ssam	 * @key_len: length of the key buffer in octets (WEP: 5 or 13,
2292252726Srpaulo	 *	TKIP: 32, CCMP/GCMP: 16, IGTK: 16)
2293189251Ssam	 *
2294189251Ssam	 * Returns: 0 on success, -1 on failure
2295189251Ssam	 *
2296189251Ssam	 * Configure the given key for the kernel driver. If the driver
2297189251Ssam	 * supports separate individual keys (4 default keys + 1 individual),
2298189251Ssam	 * addr can be used to determine whether the key is default or
2299189251Ssam	 * individual. If only 4 keys are supported, the default key with key
2300189251Ssam	 * index 0 is used as the individual key. STA must be configured to use
2301189251Ssam	 * it as the default Tx key (set_tx is set) and accept Rx for all the
2302189251Ssam	 * key indexes. In most cases, WPA uses only key indexes 1 and 2 for
2303189251Ssam	 * broadcast keys, so key index 0 is available for this kind of
2304189251Ssam	 * configuration.
2305189251Ssam	 *
2306189251Ssam	 * Please note that TKIP keys include separate TX and RX MIC keys and
2307189251Ssam	 * some drivers may expect them in different order than wpa_supplicant
2308189251Ssam	 * is using. If the TX/RX keys are swapped, all TKIP encrypted packets
2309252726Srpaulo	 * will trigger Michael MIC errors. This can be fixed by changing the
2310189251Ssam	 * order of MIC keys by swapping te bytes 16..23 and 24..31 of the key
2311189251Ssam	 * in driver_*.c set_key() implementation, see driver_ndis.c for an
2312189251Ssam	 * example on how this can be done.
2313189251Ssam	 */
2314214734Srpaulo	int (*set_key)(const char *ifname, void *priv, enum wpa_alg alg,
2315214734Srpaulo		       const u8 *addr, int key_idx, int set_tx,
2316214734Srpaulo		       const u8 *seq, size_t seq_len,
2317189251Ssam		       const u8 *key, size_t key_len);
2318189251Ssam
2319189251Ssam	/**
2320189251Ssam	 * init - Initialize driver interface
2321189251Ssam	 * @ctx: context to be used when calling wpa_supplicant functions,
2322189251Ssam	 * e.g., wpa_supplicant_event()
2323189251Ssam	 * @ifname: interface name, e.g., wlan0
2324189251Ssam	 *
2325189251Ssam	 * Returns: Pointer to private data, %NULL on failure
2326189251Ssam	 *
2327189251Ssam	 * Initialize driver interface, including event processing for kernel
2328189251Ssam	 * driver events (e.g., associated, scan results, Michael MIC failure).
2329189251Ssam	 * This function can allocate a private configuration data area for
2330189251Ssam	 * @ctx, file descriptor, interface name, etc. information that may be
2331189251Ssam	 * needed in future driver operations. If this is not used, non-NULL
2332189251Ssam	 * value will need to be returned because %NULL is used to indicate
2333189251Ssam	 * failure. The returned value will be used as 'void *priv' data for
2334189251Ssam	 * all other driver_ops functions.
2335189251Ssam	 *
2336189251Ssam	 * The main event loop (eloop.c) of wpa_supplicant can be used to
2337189251Ssam	 * register callback for read sockets (eloop_register_read_sock()).
2338189251Ssam	 *
2339189251Ssam	 * See below for more information about events and
2340189251Ssam	 * wpa_supplicant_event() function.
2341189251Ssam	 */
2342189251Ssam	void * (*init)(void *ctx, const char *ifname);
2343189251Ssam
2344189251Ssam	/**
2345189251Ssam	 * deinit - Deinitialize driver interface
2346189251Ssam	 * @priv: private driver interface data from init()
2347189251Ssam	 *
2348189251Ssam	 * Shut down driver interface and processing of driver events. Free
2349189251Ssam	 * private data buffer if one was allocated in init() handler.
2350189251Ssam	 */
2351189251Ssam	void (*deinit)(void *priv);
2352189251Ssam
2353189251Ssam	/**
2354189251Ssam	 * set_param - Set driver configuration parameters
2355189251Ssam	 * @priv: private driver interface data from init()
2356189251Ssam	 * @param: driver specific configuration parameters
2357189251Ssam	 *
2358189251Ssam	 * Returns: 0 on success, -1 on failure
2359189251Ssam	 *
2360189251Ssam	 * Optional handler for notifying driver interface about configuration
2361189251Ssam	 * parameters (driver_param).
2362189251Ssam	 */
2363189251Ssam	int (*set_param)(void *priv, const char *param);
2364189251Ssam
2365189251Ssam	/**
2366189251Ssam	 * set_countermeasures - Enable/disable TKIP countermeasures
2367189251Ssam	 * @priv: private driver interface data
2368189251Ssam	 * @enabled: 1 = countermeasures enabled, 0 = disabled
2369189251Ssam	 *
2370189251Ssam	 * Returns: 0 on success, -1 on failure
2371189251Ssam	 *
2372189251Ssam	 * Configure TKIP countermeasures. When these are enabled, the driver
2373189251Ssam	 * should drop all received and queued frames that are using TKIP.
2374189251Ssam	 */
2375189251Ssam	int (*set_countermeasures)(void *priv, int enabled);
2376189251Ssam
2377189251Ssam	/**
2378189251Ssam	 * deauthenticate - Request driver to deauthenticate
2379189251Ssam	 * @priv: private driver interface data
2380189251Ssam	 * @addr: peer address (BSSID of the AP)
2381189251Ssam	 * @reason_code: 16-bit reason code to be sent in the deauthentication
2382189251Ssam	 *	frame
2383189251Ssam	 *
2384189251Ssam	 * Returns: 0 on success, -1 on failure
2385189251Ssam	 */
2386351611Scy	int (*deauthenticate)(void *priv, const u8 *addr, u16 reason_code);
2387189251Ssam
2388189251Ssam	/**
2389189251Ssam	 * associate - Request driver to associate
2390189251Ssam	 * @priv: private driver interface data
2391189251Ssam	 * @params: association parameters
2392189251Ssam	 *
2393189251Ssam	 * Returns: 0 on success, -1 on failure
2394189251Ssam	 */
2395189251Ssam	int (*associate)(void *priv,
2396189251Ssam			 struct wpa_driver_associate_params *params);
2397189251Ssam
2398189251Ssam	/**
2399189251Ssam	 * add_pmkid - Add PMKSA cache entry to the driver
2400189251Ssam	 * @priv: private driver interface data
2401346981Scy	 * @params: PMKSA parameters
2402189251Ssam	 *
2403189251Ssam	 * Returns: 0 on success, -1 on failure
2404189251Ssam	 *
2405189251Ssam	 * This function is called when a new PMK is received, as a result of
2406346981Scy	 * either normal authentication or RSN pre-authentication. The PMKSA
2407346981Scy	 * parameters are either a set of bssid, pmkid, and pmk; or a set of
2408346981Scy	 * ssid, fils_cache_id, pmkid, and pmk.
2409189251Ssam	 *
2410189251Ssam	 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
2411189251Ssam	 * associate(), add_pmkid() can be used to add new PMKSA cache entries
2412189251Ssam	 * in the driver. If the driver uses wpa_ie from wpa_supplicant, this
2413189251Ssam	 * driver_ops function does not need to be implemented. Likewise, if
2414189251Ssam	 * the driver does not support WPA, this function is not needed.
2415189251Ssam	 */
2416346981Scy	int (*add_pmkid)(void *priv, struct wpa_pmkid_params *params);
2417189251Ssam
2418189251Ssam	/**
2419189251Ssam	 * remove_pmkid - Remove PMKSA cache entry to the driver
2420189251Ssam	 * @priv: private driver interface data
2421346981Scy	 * @params: PMKSA parameters
2422189251Ssam	 *
2423189251Ssam	 * Returns: 0 on success, -1 on failure
2424189251Ssam	 *
2425189251Ssam	 * This function is called when the supplicant drops a PMKSA cache
2426346981Scy	 * entry for any reason. The PMKSA parameters are either a set of
2427346981Scy	 * bssid and pmkid; or a set of ssid, fils_cache_id, and pmkid.
2428189251Ssam	 *
2429189251Ssam	 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
2430189251Ssam	 * associate(), remove_pmkid() can be used to synchronize PMKSA caches
2431189251Ssam	 * between the driver and wpa_supplicant. If the driver uses wpa_ie
2432189251Ssam	 * from wpa_supplicant, this driver_ops function does not need to be
2433189251Ssam	 * implemented. Likewise, if the driver does not support WPA, this
2434189251Ssam	 * function is not needed.
2435189251Ssam	 */
2436346981Scy	int (*remove_pmkid)(void *priv, struct wpa_pmkid_params *params);
2437189251Ssam
2438189251Ssam	/**
2439189251Ssam	 * flush_pmkid - Flush PMKSA cache
2440189251Ssam	 * @priv: private driver interface data
2441189251Ssam	 *
2442189251Ssam	 * Returns: 0 on success, -1 on failure
2443189251Ssam	 *
2444189251Ssam	 * This function is called when the supplicant drops all PMKSA cache
2445189251Ssam	 * entries for any reason.
2446189251Ssam	 *
2447189251Ssam	 * If the driver generates RSN IE, i.e., it does not use wpa_ie in
2448189251Ssam	 * associate(), remove_pmkid() can be used to synchronize PMKSA caches
2449189251Ssam	 * between the driver and wpa_supplicant. If the driver uses wpa_ie
2450189251Ssam	 * from wpa_supplicant, this driver_ops function does not need to be
2451189251Ssam	 * implemented. Likewise, if the driver does not support WPA, this
2452189251Ssam	 * function is not needed.
2453189251Ssam	 */
2454189251Ssam	int (*flush_pmkid)(void *priv);
2455189251Ssam
2456189251Ssam	/**
2457209158Srpaulo	 * get_capa - Get driver capabilities
2458189251Ssam	 * @priv: private driver interface data
2459189251Ssam	 *
2460189251Ssam	 * Returns: 0 on success, -1 on failure
2461189251Ssam	 *
2462189251Ssam	 * Get driver/firmware/hardware capabilities.
2463189251Ssam	 */
2464189251Ssam	int (*get_capa)(void *priv, struct wpa_driver_capa *capa);
2465189251Ssam
2466189251Ssam	/**
2467189251Ssam	 * poll - Poll driver for association information
2468189251Ssam	 * @priv: private driver interface data
2469189251Ssam	 *
2470189251Ssam	 * This is an option callback that can be used when the driver does not
2471189251Ssam	 * provide event mechanism for association events. This is called when
2472189251Ssam	 * receiving WPA EAPOL-Key messages that require association
2473189251Ssam	 * information. The driver interface is supposed to generate associnfo
2474189251Ssam	 * event before returning from this callback function. In addition, the
2475189251Ssam	 * driver interface should generate an association event after having
2476189251Ssam	 * sent out associnfo.
2477189251Ssam	 */
2478189251Ssam	void (*poll)(void *priv);
2479189251Ssam
2480189251Ssam	/**
2481337817Scy	 * get_ifindex - Get interface index
2482337817Scy	 * @priv: private driver interface data
2483337817Scy	 *
2484337817Scy	 * Returns: Interface index
2485337817Scy	 */
2486337817Scy	unsigned int (*get_ifindex)(void *priv);
2487337817Scy
2488337817Scy	/**
2489189251Ssam	 * get_ifname - Get interface name
2490189251Ssam	 * @priv: private driver interface data
2491189251Ssam	 *
2492189251Ssam	 * Returns: Pointer to the interface name. This can differ from the
2493189251Ssam	 * interface name used in init() call. Init() is called first.
2494189251Ssam	 *
2495189251Ssam	 * This optional function can be used to allow the driver interface to
2496189251Ssam	 * replace the interface name with something else, e.g., based on an
2497189251Ssam	 * interface mapping from a more descriptive name.
2498189251Ssam	 */
2499189251Ssam	const char * (*get_ifname)(void *priv);
2500189251Ssam
2501189251Ssam	/**
2502189251Ssam	 * get_mac_addr - Get own MAC address
2503189251Ssam	 * @priv: private driver interface data
2504189251Ssam	 *
2505189251Ssam	 * Returns: Pointer to own MAC address or %NULL on failure
2506189251Ssam	 *
2507189251Ssam	 * This optional function can be used to get the own MAC address of the
2508189251Ssam	 * device from the driver interface code. This is only needed if the
2509189251Ssam	 * l2_packet implementation for the OS does not provide easy access to
2510189251Ssam	 * a MAC address. */
2511189251Ssam	const u8 * (*get_mac_addr)(void *priv);
2512189251Ssam
2513189251Ssam	/**
2514189251Ssam	 * set_operstate - Sets device operating state to DORMANT or UP
2515189251Ssam	 * @priv: private driver interface data
2516189251Ssam	 * @state: 0 = dormant, 1 = up
2517189251Ssam	 * Returns: 0 on success, -1 on failure
2518189251Ssam	 *
2519189251Ssam	 * This is an optional function that can be used on operating systems
2520189251Ssam	 * that support a concept of controlling network device state from user
2521189251Ssam	 * space applications. This function, if set, gets called with
2522189251Ssam	 * state = 1 when authentication has been completed and with state = 0
2523189251Ssam	 * when connection is lost.
2524189251Ssam	 */
2525189251Ssam	int (*set_operstate)(void *priv, int state);
2526189251Ssam
2527189251Ssam	/**
2528189251Ssam	 * mlme_setprotection - MLME-SETPROTECTION.request primitive
2529189251Ssam	 * @priv: Private driver interface data
2530189251Ssam	 * @addr: Address of the station for which to set protection (may be
2531189251Ssam	 * %NULL for group keys)
2532189251Ssam	 * @protect_type: MLME_SETPROTECTION_PROTECT_TYPE_*
2533189251Ssam	 * @key_type: MLME_SETPROTECTION_KEY_TYPE_*
2534189251Ssam	 * Returns: 0 on success, -1 on failure
2535189251Ssam	 *
2536189251Ssam	 * This is an optional function that can be used to set the driver to
2537189251Ssam	 * require protection for Tx and/or Rx frames. This uses the layer
2538189251Ssam	 * interface defined in IEEE 802.11i-2004 clause 10.3.22.1
2539189251Ssam	 * (MLME-SETPROTECTION.request). Many drivers do not use explicit
2540189251Ssam	 * set protection operation; instead, they set protection implicitly
2541189251Ssam	 * based on configured keys.
2542189251Ssam	 */
2543189251Ssam	int (*mlme_setprotection)(void *priv, const u8 *addr, int protect_type,
2544189251Ssam				  int key_type);
2545189251Ssam
2546189251Ssam	/**
2547189251Ssam	 * get_hw_feature_data - Get hardware support data (channels and rates)
2548189251Ssam	 * @priv: Private driver interface data
2549189251Ssam	 * @num_modes: Variable for returning the number of returned modes
2550189251Ssam	 * flags: Variable for returning hardware feature flags
2551346981Scy	 * @dfs: Variable for returning DFS region (HOSTAPD_DFS_REGION_*)
2552189251Ssam	 * Returns: Pointer to allocated hardware data on success or %NULL on
2553189251Ssam	 * failure. Caller is responsible for freeing this.
2554189251Ssam	 */
2555214734Srpaulo	struct hostapd_hw_modes * (*get_hw_feature_data)(void *priv,
2556214734Srpaulo							 u16 *num_modes,
2557346981Scy							 u16 *flags, u8 *dfs);
2558189251Ssam
2559189251Ssam	/**
2560189251Ssam	 * send_mlme - Send management frame from MLME
2561189251Ssam	 * @priv: Private driver interface data
2562189251Ssam	 * @data: IEEE 802.11 management frame with IEEE 802.11 header
2563189251Ssam	 * @data_len: Size of the management frame
2564252726Srpaulo	 * @noack: Do not wait for this frame to be acked (disable retries)
2565289549Srpaulo	 * @freq: Frequency (in MHz) to send the frame on, or 0 to let the
2566289549Srpaulo	 * driver decide
2567337817Scy	 * @csa_offs: Array of CSA offsets or %NULL
2568337817Scy	 * @csa_offs_len: Number of elements in csa_offs
2569189251Ssam	 * Returns: 0 on success, -1 on failure
2570189251Ssam	 */
2571252726Srpaulo	int (*send_mlme)(void *priv, const u8 *data, size_t data_len,
2572337817Scy			 int noack, unsigned int freq, const u16 *csa_offs,
2573337817Scy			 size_t csa_offs_len);
2574189251Ssam
2575189251Ssam	/**
2576189251Ssam	 * update_ft_ies - Update FT (IEEE 802.11r) IEs
2577189251Ssam	 * @priv: Private driver interface data
2578189251Ssam	 * @md: Mobility domain (2 octets) (also included inside ies)
2579189251Ssam	 * @ies: FT IEs (MDIE, FTIE, ...) or %NULL to remove IEs
2580189251Ssam	 * @ies_len: Length of FT IEs in bytes
2581189251Ssam	 * Returns: 0 on success, -1 on failure
2582189251Ssam	 *
2583189251Ssam	 * The supplicant uses this callback to let the driver know that keying
2584189251Ssam	 * material for FT is available and that the driver can use the
2585189251Ssam	 * provided IEs in the next message in FT authentication sequence.
2586189251Ssam	 *
2587189251Ssam	 * This function is only needed for driver that support IEEE 802.11r
2588189251Ssam	 * (Fast BSS Transition).
2589189251Ssam	 */
2590189251Ssam	int (*update_ft_ies)(void *priv, const u8 *md, const u8 *ies,
2591189251Ssam			     size_t ies_len);
2592189251Ssam
2593189251Ssam	/**
2594189251Ssam	 * get_scan_results2 - Fetch the latest scan results
2595189251Ssam	 * @priv: private driver interface data
2596189251Ssam	 *
2597189251Ssam	 * Returns: Allocated buffer of scan results (caller is responsible for
2598189251Ssam	 * freeing the data structure) on success, NULL on failure
2599189251Ssam	 */
2600189251Ssam	 struct wpa_scan_results * (*get_scan_results2)(void *priv);
2601189251Ssam
2602189251Ssam	/**
2603189251Ssam	 * set_country - Set country
2604189251Ssam	 * @priv: Private driver interface data
2605189251Ssam	 * @alpha2: country to which to switch to
2606189251Ssam	 * Returns: 0 on success, -1 on failure
2607189251Ssam	 *
2608189251Ssam	 * This function is for drivers which support some form
2609189251Ssam	 * of setting a regulatory domain.
2610189251Ssam	 */
2611189251Ssam	int (*set_country)(void *priv, const char *alpha2);
2612189251Ssam
2613189251Ssam	/**
2614281806Srpaulo	 * get_country - Get country
2615281806Srpaulo	 * @priv: Private driver interface data
2616281806Srpaulo	 * @alpha2: Buffer for returning country code (at least 3 octets)
2617281806Srpaulo	 * Returns: 0 on success, -1 on failure
2618281806Srpaulo	 */
2619281806Srpaulo	int (*get_country)(void *priv, char *alpha2);
2620281806Srpaulo
2621281806Srpaulo	/**
2622189251Ssam	 * global_init - Global driver initialization
2623337817Scy	 * @ctx: wpa_global pointer
2624189251Ssam	 * Returns: Pointer to private data (global), %NULL on failure
2625189251Ssam	 *
2626189251Ssam	 * This optional function is called to initialize the driver wrapper
2627189251Ssam	 * for global data, i.e., data that applies to all interfaces. If this
2628189251Ssam	 * function is implemented, global_deinit() will also need to be
2629189251Ssam	 * implemented to free the private data. The driver will also likely
2630189251Ssam	 * use init2() function instead of init() to get the pointer to global
2631189251Ssam	 * data available to per-interface initializer.
2632189251Ssam	 */
2633337817Scy	void * (*global_init)(void *ctx);
2634189251Ssam
2635189251Ssam	/**
2636189251Ssam	 * global_deinit - Global driver deinitialization
2637189251Ssam	 * @priv: private driver global data from global_init()
2638189251Ssam	 *
2639189251Ssam	 * Terminate any global driver related functionality and free the
2640189251Ssam	 * global data structure.
2641189251Ssam	 */
2642189251Ssam	void (*global_deinit)(void *priv);
2643189251Ssam
2644189251Ssam	/**
2645189251Ssam	 * init2 - Initialize driver interface (with global data)
2646189251Ssam	 * @ctx: context to be used when calling wpa_supplicant functions,
2647189251Ssam	 * e.g., wpa_supplicant_event()
2648189251Ssam	 * @ifname: interface name, e.g., wlan0
2649189251Ssam	 * @global_priv: private driver global data from global_init()
2650189251Ssam	 * Returns: Pointer to private data, %NULL on failure
2651189251Ssam	 *
2652189251Ssam	 * This function can be used instead of init() if the driver wrapper
2653189251Ssam	 * uses global data.
2654189251Ssam	 */
2655189251Ssam	void * (*init2)(void *ctx, const char *ifname, void *global_priv);
2656189251Ssam
2657189251Ssam	/**
2658189251Ssam	 * get_interfaces - Get information about available interfaces
2659189251Ssam	 * @global_priv: private driver global data from global_init()
2660189251Ssam	 * Returns: Allocated buffer of interface information (caller is
2661189251Ssam	 * responsible for freeing the data structure) on success, NULL on
2662189251Ssam	 * failure
2663189251Ssam	 */
2664189251Ssam	struct wpa_interface_info * (*get_interfaces)(void *global_priv);
2665214734Srpaulo
2666214734Srpaulo	/**
2667214734Srpaulo	 * scan2 - Request the driver to initiate scan
2668214734Srpaulo	 * @priv: private driver interface data
2669214734Srpaulo	 * @params: Scan parameters
2670214734Srpaulo	 *
2671214734Srpaulo	 * Returns: 0 on success, -1 on failure
2672214734Srpaulo	 *
2673214734Srpaulo	 * Once the scan results are ready, the driver should report scan
2674214734Srpaulo	 * results event for wpa_supplicant which will eventually request the
2675214734Srpaulo	 * results with wpa_driver_get_scan_results2().
2676214734Srpaulo	 */
2677214734Srpaulo	int (*scan2)(void *priv, struct wpa_driver_scan_params *params);
2678214734Srpaulo
2679214734Srpaulo	/**
2680214734Srpaulo	 * authenticate - Request driver to authenticate
2681214734Srpaulo	 * @priv: private driver interface data
2682214734Srpaulo	 * @params: authentication parameters
2683214734Srpaulo	 * Returns: 0 on success, -1 on failure
2684214734Srpaulo	 *
2685214734Srpaulo	 * This is an optional function that can be used with drivers that
2686214734Srpaulo	 * support separate authentication and association steps, i.e., when
2687214734Srpaulo	 * wpa_supplicant can act as the SME. If not implemented, associate()
2688214734Srpaulo	 * function is expected to take care of IEEE 802.11 authentication,
2689214734Srpaulo	 * too.
2690214734Srpaulo	 */
2691214734Srpaulo	int (*authenticate)(void *priv,
2692214734Srpaulo			    struct wpa_driver_auth_params *params);
2693214734Srpaulo
2694214734Srpaulo	/**
2695252726Srpaulo	 * set_ap - Set Beacon and Probe Response information for AP mode
2696214734Srpaulo	 * @priv: Private driver interface data
2697252726Srpaulo	 * @params: Parameters to use in AP mode
2698214734Srpaulo	 *
2699252726Srpaulo	 * This function is used to configure Beacon template and/or extra IEs
2700252726Srpaulo	 * to add for Beacon and Probe Response frames for the driver in
2701214734Srpaulo	 * AP mode. The driver is responsible for building the full Beacon
2702214734Srpaulo	 * frame by concatenating the head part with TIM IE generated by the
2703252726Srpaulo	 * driver/firmware and finishing with the tail part. Depending on the
2704252726Srpaulo	 * driver architectue, this can be done either by using the full
2705252726Srpaulo	 * template or the set of additional IEs (e.g., WPS and P2P IE).
2706252726Srpaulo	 * Similarly, Probe Response processing depends on the driver design.
2707252726Srpaulo	 * If the driver (or firmware) takes care of replying to Probe Request
2708252726Srpaulo	 * frames, the extra IEs provided here needs to be added to the Probe
2709252726Srpaulo	 * Response frames.
2710252726Srpaulo	 *
2711252726Srpaulo	 * Returns: 0 on success, -1 on failure
2712214734Srpaulo	 */
2713252726Srpaulo	int (*set_ap)(void *priv, struct wpa_driver_ap_params *params);
2714214734Srpaulo
2715214734Srpaulo	/**
2716281806Srpaulo	 * set_acl - Set ACL in AP mode
2717281806Srpaulo	 * @priv: Private driver interface data
2718281806Srpaulo	 * @params: Parameters to configure ACL
2719281806Srpaulo	 * Returns: 0 on success, -1 on failure
2720281806Srpaulo	 *
2721281806Srpaulo	 * This is used only for the drivers which support MAC address ACL.
2722281806Srpaulo	 */
2723281806Srpaulo	int (*set_acl)(void *priv, struct hostapd_acl_params *params);
2724281806Srpaulo
2725281806Srpaulo	/**
2726214734Srpaulo	 * hapd_init - Initialize driver interface (hostapd only)
2727214734Srpaulo	 * @hapd: Pointer to hostapd context
2728214734Srpaulo	 * @params: Configuration for the driver wrapper
2729214734Srpaulo	 * Returns: Pointer to private data, %NULL on failure
2730214734Srpaulo	 *
2731214734Srpaulo	 * This function is used instead of init() or init2() when the driver
2732252726Srpaulo	 * wrapper is used with hostapd.
2733214734Srpaulo	 */
2734214734Srpaulo	void * (*hapd_init)(struct hostapd_data *hapd,
2735214734Srpaulo			    struct wpa_init_params *params);
2736214734Srpaulo
2737214734Srpaulo	/**
2738214734Srpaulo	 * hapd_deinit - Deinitialize driver interface (hostapd only)
2739214734Srpaulo	 * @priv: Private driver interface data from hapd_init()
2740214734Srpaulo	 */
2741214734Srpaulo	void (*hapd_deinit)(void *priv);
2742214734Srpaulo
2743214734Srpaulo	/**
2744214734Srpaulo	 * set_ieee8021x - Enable/disable IEEE 802.1X support (AP only)
2745214734Srpaulo	 * @priv: Private driver interface data
2746214734Srpaulo	 * @params: BSS parameters
2747214734Srpaulo	 * Returns: 0 on success, -1 on failure
2748214734Srpaulo	 *
2749214734Srpaulo	 * This is an optional function to configure the kernel driver to
2750214734Srpaulo	 * enable/disable IEEE 802.1X support and set WPA/WPA2 parameters. This
2751214734Srpaulo	 * can be left undefined (set to %NULL) if IEEE 802.1X support is
2752252726Srpaulo	 * always enabled and the driver uses set_ap() to set WPA/RSN IE
2753214734Srpaulo	 * for Beacon frames.
2754252726Srpaulo	 *
2755252726Srpaulo	 * DEPRECATED - use set_ap() instead
2756214734Srpaulo	 */
2757214734Srpaulo	int (*set_ieee8021x)(void *priv, struct wpa_bss_params *params);
2758214734Srpaulo
2759214734Srpaulo	/**
2760214734Srpaulo	 * set_privacy - Enable/disable privacy (AP only)
2761214734Srpaulo	 * @priv: Private driver interface data
2762214734Srpaulo	 * @enabled: 1 = privacy enabled, 0 = disabled
2763214734Srpaulo	 * Returns: 0 on success, -1 on failure
2764214734Srpaulo	 *
2765214734Srpaulo	 * This is an optional function to configure privacy field in the
2766214734Srpaulo	 * kernel driver for Beacon frames. This can be left undefined (set to
2767252726Srpaulo	 * %NULL) if the driver uses the Beacon template from set_ap().
2768252726Srpaulo	 *
2769252726Srpaulo	 * DEPRECATED - use set_ap() instead
2770214734Srpaulo	 */
2771214734Srpaulo	int (*set_privacy)(void *priv, int enabled);
2772214734Srpaulo
2773214734Srpaulo	/**
2774214734Srpaulo	 * get_seqnum - Fetch the current TSC/packet number (AP only)
2775214734Srpaulo	 * @ifname: The interface name (main or virtual)
2776214734Srpaulo	 * @priv: Private driver interface data
2777214734Srpaulo	 * @addr: MAC address of the station or %NULL for group keys
2778214734Srpaulo	 * @idx: Key index
2779214734Srpaulo	 * @seq: Buffer for returning the latest used TSC/packet number
2780214734Srpaulo	 * Returns: 0 on success, -1 on failure
2781214734Srpaulo	 *
2782214734Srpaulo	 * This function is used to fetch the last used TSC/packet number for
2783252726Srpaulo	 * a TKIP, CCMP, GCMP, or BIP/IGTK key. It is mainly used with group
2784252726Srpaulo	 * keys, so there is no strict requirement on implementing support for
2785252726Srpaulo	 * unicast keys (i.e., addr != %NULL).
2786214734Srpaulo	 */
2787214734Srpaulo	int (*get_seqnum)(const char *ifname, void *priv, const u8 *addr,
2788214734Srpaulo			  int idx, u8 *seq);
2789214734Srpaulo
2790214734Srpaulo	/**
2791214734Srpaulo	 * flush - Flush all association stations (AP only)
2792214734Srpaulo	 * @priv: Private driver interface data
2793214734Srpaulo	 * Returns: 0 on success, -1 on failure
2794214734Srpaulo	 *
2795214734Srpaulo	 * This function requests the driver to disassociate all associated
2796214734Srpaulo	 * stations. This function does not need to be implemented if the
2797214734Srpaulo	 * driver does not process association frames internally.
2798214734Srpaulo	 */
2799214734Srpaulo	int (*flush)(void *priv);
2800214734Srpaulo
2801214734Srpaulo	/**
2802214734Srpaulo	 * set_generic_elem - Add IEs into Beacon/Probe Response frames (AP)
2803214734Srpaulo	 * @priv: Private driver interface data
2804214734Srpaulo	 * @elem: Information elements
2805214734Srpaulo	 * @elem_len: Length of the elem buffer in octets
2806214734Srpaulo	 * Returns: 0 on success, -1 on failure
2807214734Srpaulo	 *
2808214734Srpaulo	 * This is an optional function to add information elements in the
2809214734Srpaulo	 * kernel driver for Beacon and Probe Response frames. This can be left
2810214734Srpaulo	 * undefined (set to %NULL) if the driver uses the Beacon template from
2811252726Srpaulo	 * set_ap().
2812252726Srpaulo	 *
2813252726Srpaulo	 * DEPRECATED - use set_ap() instead
2814214734Srpaulo	 */
2815214734Srpaulo	int (*set_generic_elem)(void *priv, const u8 *elem, size_t elem_len);
2816214734Srpaulo
2817214734Srpaulo	/**
2818252726Srpaulo	 * read_sta_data - Fetch station data
2819214734Srpaulo	 * @priv: Private driver interface data
2820214734Srpaulo	 * @data: Buffer for returning station information
2821214734Srpaulo	 * @addr: MAC address of the station
2822214734Srpaulo	 * Returns: 0 on success, -1 on failure
2823214734Srpaulo	 */
2824214734Srpaulo	int (*read_sta_data)(void *priv, struct hostap_sta_driver_data *data,
2825214734Srpaulo			     const u8 *addr);
2826214734Srpaulo
2827214734Srpaulo	/**
2828214734Srpaulo	 * hapd_send_eapol - Send an EAPOL packet (AP only)
2829214734Srpaulo	 * @priv: private driver interface data
2830214734Srpaulo	 * @addr: Destination MAC address
2831214734Srpaulo	 * @data: EAPOL packet starting with IEEE 802.1X header
2832214734Srpaulo	 * @data_len: Length of the EAPOL packet in octets
2833214734Srpaulo	 * @encrypt: Whether the frame should be encrypted
2834214734Srpaulo	 * @own_addr: Source MAC address
2835252726Srpaulo	 * @flags: WPA_STA_* flags for the destination station
2836214734Srpaulo	 *
2837214734Srpaulo	 * Returns: 0 on success, -1 on failure
2838214734Srpaulo	 */
2839214734Srpaulo	int (*hapd_send_eapol)(void *priv, const u8 *addr, const u8 *data,
2840214734Srpaulo			       size_t data_len, int encrypt,
2841252726Srpaulo			       const u8 *own_addr, u32 flags);
2842214734Srpaulo
2843214734Srpaulo	/**
2844214734Srpaulo	 * sta_deauth - Deauthenticate a station (AP only)
2845214734Srpaulo	 * @priv: Private driver interface data
2846214734Srpaulo	 * @own_addr: Source address and BSSID for the Deauthentication frame
2847214734Srpaulo	 * @addr: MAC address of the station to deauthenticate
2848214734Srpaulo	 * @reason: Reason code for the Deauthentiation frame
2849214734Srpaulo	 * Returns: 0 on success, -1 on failure
2850214734Srpaulo	 *
2851214734Srpaulo	 * This function requests a specific station to be deauthenticated and
2852214734Srpaulo	 * a Deauthentication frame to be sent to it.
2853214734Srpaulo	 */
2854214734Srpaulo	int (*sta_deauth)(void *priv, const u8 *own_addr, const u8 *addr,
2855351611Scy			  u16 reason);
2856214734Srpaulo
2857214734Srpaulo	/**
2858214734Srpaulo	 * sta_disassoc - Disassociate a station (AP only)
2859214734Srpaulo	 * @priv: Private driver interface data
2860214734Srpaulo	 * @own_addr: Source address and BSSID for the Disassociation frame
2861214734Srpaulo	 * @addr: MAC address of the station to disassociate
2862214734Srpaulo	 * @reason: Reason code for the Disassociation frame
2863214734Srpaulo	 * Returns: 0 on success, -1 on failure
2864214734Srpaulo	 *
2865214734Srpaulo	 * This function requests a specific station to be disassociated and
2866214734Srpaulo	 * a Disassociation frame to be sent to it.
2867214734Srpaulo	 */
2868214734Srpaulo	int (*sta_disassoc)(void *priv, const u8 *own_addr, const u8 *addr,
2869351611Scy			    u16 reason);
2870214734Srpaulo
2871214734Srpaulo	/**
2872214734Srpaulo	 * sta_remove - Remove a station entry (AP only)
2873214734Srpaulo	 * @priv: Private driver interface data
2874214734Srpaulo	 * @addr: MAC address of the station to be removed
2875214734Srpaulo	 * Returns: 0 on success, -1 on failure
2876214734Srpaulo	 */
2877214734Srpaulo	int (*sta_remove)(void *priv, const u8 *addr);
2878214734Srpaulo
2879214734Srpaulo	/**
2880214734Srpaulo	 * hapd_get_ssid - Get the current SSID (AP only)
2881214734Srpaulo	 * @priv: Private driver interface data
2882214734Srpaulo	 * @buf: Buffer for returning the SSID
2883214734Srpaulo	 * @len: Maximum length of the buffer
2884214734Srpaulo	 * Returns: Length of the SSID on success, -1 on failure
2885214734Srpaulo	 *
2886214734Srpaulo	 * This function need not be implemented if the driver uses Beacon
2887252726Srpaulo	 * template from set_ap() and does not reply to Probe Request frames.
2888214734Srpaulo	 */
2889214734Srpaulo	int (*hapd_get_ssid)(void *priv, u8 *buf, int len);
2890214734Srpaulo
2891214734Srpaulo	/**
2892214734Srpaulo	 * hapd_set_ssid - Set SSID (AP only)
2893214734Srpaulo	 * @priv: Private driver interface data
2894214734Srpaulo	 * @buf: SSID
2895214734Srpaulo	 * @len: Length of the SSID in octets
2896214734Srpaulo	 * Returns: 0 on success, -1 on failure
2897252726Srpaulo	 *
2898252726Srpaulo	 * DEPRECATED - use set_ap() instead
2899214734Srpaulo	 */
2900214734Srpaulo	int (*hapd_set_ssid)(void *priv, const u8 *buf, int len);
2901214734Srpaulo
2902214734Srpaulo	/**
2903214734Srpaulo	 * hapd_set_countermeasures - Enable/disable TKIP countermeasures (AP)
2904214734Srpaulo	 * @priv: Private driver interface data
2905214734Srpaulo	 * @enabled: 1 = countermeasures enabled, 0 = disabled
2906214734Srpaulo	 * Returns: 0 on success, -1 on failure
2907214734Srpaulo	 *
2908214734Srpaulo	 * This need not be implemented if the driver does not take care of
2909214734Srpaulo	 * association processing.
2910214734Srpaulo	 */
2911214734Srpaulo	int (*hapd_set_countermeasures)(void *priv, int enabled);
2912214734Srpaulo
2913214734Srpaulo	/**
2914214734Srpaulo	 * sta_add - Add a station entry
2915214734Srpaulo	 * @priv: Private driver interface data
2916214734Srpaulo	 * @params: Station parameters
2917214734Srpaulo	 * Returns: 0 on success, -1 on failure
2918214734Srpaulo	 *
2919337817Scy	 * This function is used to add or set (params->set 1) a station
2920337817Scy	 * entry in the driver. Adding STA entries is used only if the driver
2921214734Srpaulo	 * does not take care of association processing.
2922252726Srpaulo	 *
2923337817Scy	 * With drivers that don't support full AP client state, this function
2924337817Scy	 * is used to add a station entry to the driver once the station has
2925337817Scy	 * completed association.
2926337817Scy	 *
2927337817Scy	 * With TDLS, this function is used to add or set (params->set 1)
2928337817Scy	 * TDLS peer entries (even with drivers that do not support full AP
2929337817Scy	 * client state).
2930214734Srpaulo	 */
2931214734Srpaulo	int (*sta_add)(void *priv, struct hostapd_sta_add_params *params);
2932214734Srpaulo
2933214734Srpaulo	/**
2934214734Srpaulo	 * get_inact_sec - Get station inactivity duration (AP only)
2935214734Srpaulo	 * @priv: Private driver interface data
2936214734Srpaulo	 * @addr: Station address
2937214734Srpaulo	 * Returns: Number of seconds station has been inactive, -1 on failure
2938214734Srpaulo	 */
2939214734Srpaulo	int (*get_inact_sec)(void *priv, const u8 *addr);
2940214734Srpaulo
2941214734Srpaulo	/**
2942214734Srpaulo	 * sta_clear_stats - Clear station statistics (AP only)
2943214734Srpaulo	 * @priv: Private driver interface data
2944214734Srpaulo	 * @addr: Station address
2945214734Srpaulo	 * Returns: 0 on success, -1 on failure
2946214734Srpaulo	 */
2947214734Srpaulo	int (*sta_clear_stats)(void *priv, const u8 *addr);
2948214734Srpaulo
2949214734Srpaulo	/**
2950214734Srpaulo	 * set_freq - Set channel/frequency (AP only)
2951214734Srpaulo	 * @priv: Private driver interface data
2952214734Srpaulo	 * @freq: Channel parameters
2953214734Srpaulo	 * Returns: 0 on success, -1 on failure
2954214734Srpaulo	 */
2955214734Srpaulo	int (*set_freq)(void *priv, struct hostapd_freq_params *freq);
2956214734Srpaulo
2957214734Srpaulo	/**
2958214734Srpaulo	 * set_rts - Set RTS threshold
2959214734Srpaulo	 * @priv: Private driver interface data
2960214734Srpaulo	 * @rts: RTS threshold in octets
2961214734Srpaulo	 * Returns: 0 on success, -1 on failure
2962214734Srpaulo	 */
2963214734Srpaulo	int (*set_rts)(void *priv, int rts);
2964214734Srpaulo
2965214734Srpaulo	/**
2966214734Srpaulo	 * set_frag - Set fragmentation threshold
2967214734Srpaulo	 * @priv: Private driver interface data
2968214734Srpaulo	 * @frag: Fragmentation threshold in octets
2969214734Srpaulo	 * Returns: 0 on success, -1 on failure
2970214734Srpaulo	 */
2971214734Srpaulo	int (*set_frag)(void *priv, int frag);
2972214734Srpaulo
2973214734Srpaulo	/**
2974214734Srpaulo	 * sta_set_flags - Set station flags (AP only)
2975214734Srpaulo	 * @priv: Private driver interface data
2976214734Srpaulo	 * @addr: Station address
2977214734Srpaulo	 * @total_flags: Bitmap of all WPA_STA_* flags currently set
2978214734Srpaulo	 * @flags_or: Bitmap of WPA_STA_* flags to add
2979214734Srpaulo	 * @flags_and: Bitmap of WPA_STA_* flags to us as a mask
2980214734Srpaulo	 * Returns: 0 on success, -1 on failure
2981214734Srpaulo	 */
2982214734Srpaulo	int (*sta_set_flags)(void *priv, const u8 *addr,
2983289549Srpaulo			     unsigned int total_flags, unsigned int flags_or,
2984289549Srpaulo			     unsigned int flags_and);
2985214734Srpaulo
2986214734Srpaulo	/**
2987351611Scy	 * sta_set_airtime_weight - Set station airtime weight (AP only)
2988351611Scy	 * @priv: Private driver interface data
2989351611Scy	 * @addr: Station address
2990351611Scy	 * @weight: New weight for station airtime assignment
2991351611Scy	 * Returns: 0 on success, -1 on failure
2992351611Scy	 */
2993351611Scy	int (*sta_set_airtime_weight)(void *priv, const u8 *addr,
2994351611Scy				      unsigned int weight);
2995351611Scy
2996351611Scy	/**
2997214734Srpaulo	 * set_tx_queue_params - Set TX queue parameters
2998214734Srpaulo	 * @priv: Private driver interface data
2999252726Srpaulo	 * @queue: Queue number (0 = VO, 1 = VI, 2 = BE, 3 = BK)
3000214734Srpaulo	 * @aifs: AIFS
3001214734Srpaulo	 * @cw_min: cwMin
3002214734Srpaulo	 * @cw_max: cwMax
3003214734Srpaulo	 * @burst_time: Maximum length for bursting in 0.1 msec units
3004214734Srpaulo	 */
3005214734Srpaulo	int (*set_tx_queue_params)(void *priv, int queue, int aifs, int cw_min,
3006214734Srpaulo				   int cw_max, int burst_time);
3007214734Srpaulo
3008214734Srpaulo	/**
3009214734Srpaulo	 * if_add - Add a virtual interface
3010214734Srpaulo	 * @priv: Private driver interface data
3011214734Srpaulo	 * @type: Interface type
3012214734Srpaulo	 * @ifname: Interface name for the new virtual interface
3013214734Srpaulo	 * @addr: Local address to use for the interface or %NULL to use the
3014214734Srpaulo	 *	parent interface address
3015214734Srpaulo	 * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces
3016214734Srpaulo	 * @drv_priv: Pointer for overwriting the driver context or %NULL if
3017214734Srpaulo	 *	not allowed (applies only to %WPA_IF_AP_BSS type)
3018214734Srpaulo	 * @force_ifname: Buffer for returning an interface name that the
3019214734Srpaulo	 *	driver ended up using if it differs from the requested ifname
3020214734Srpaulo	 * @if_addr: Buffer for returning the allocated interface address
3021214734Srpaulo	 *	(this may differ from the requested addr if the driver cannot
3022214734Srpaulo	 *	change interface address)
3023252726Srpaulo	 * @bridge: Bridge interface to use or %NULL if no bridge configured
3024281806Srpaulo	 * @use_existing: Whether to allow existing interface to be used
3025337817Scy	 * @setup_ap: Whether to setup AP for %WPA_IF_AP_BSS interfaces
3026214734Srpaulo	 * Returns: 0 on success, -1 on failure
3027214734Srpaulo	 */
3028214734Srpaulo	int (*if_add)(void *priv, enum wpa_driver_if_type type,
3029214734Srpaulo		      const char *ifname, const u8 *addr, void *bss_ctx,
3030252726Srpaulo		      void **drv_priv, char *force_ifname, u8 *if_addr,
3031337817Scy		      const char *bridge, int use_existing, int setup_ap);
3032214734Srpaulo
3033214734Srpaulo	/**
3034214734Srpaulo	 * if_remove - Remove a virtual interface
3035214734Srpaulo	 * @priv: Private driver interface data
3036214734Srpaulo	 * @type: Interface type
3037214734Srpaulo	 * @ifname: Interface name of the virtual interface to be removed
3038214734Srpaulo	 * Returns: 0 on success, -1 on failure
3039214734Srpaulo	 */
3040214734Srpaulo	int (*if_remove)(void *priv, enum wpa_driver_if_type type,
3041214734Srpaulo			 const char *ifname);
3042214734Srpaulo
3043214734Srpaulo	/**
3044214734Srpaulo	 * set_sta_vlan - Bind a station into a specific interface (AP only)
3045214734Srpaulo	 * @priv: Private driver interface data
3046214734Srpaulo	 * @ifname: Interface (main or virtual BSS or VLAN)
3047214734Srpaulo	 * @addr: MAC address of the associated station
3048214734Srpaulo	 * @vlan_id: VLAN ID
3049214734Srpaulo	 * Returns: 0 on success, -1 on failure
3050214734Srpaulo	 *
3051214734Srpaulo	 * This function is used to bind a station to a specific virtual
3052214734Srpaulo	 * interface. It is only used if when virtual interfaces are supported,
3053214734Srpaulo	 * e.g., to assign stations to different VLAN interfaces based on
3054214734Srpaulo	 * information from a RADIUS server. This allows separate broadcast
3055214734Srpaulo	 * domains to be used with a single BSS.
3056214734Srpaulo	 */
3057214734Srpaulo	int (*set_sta_vlan)(void *priv, const u8 *addr, const char *ifname,
3058214734Srpaulo			    int vlan_id);
3059214734Srpaulo
3060214734Srpaulo	/**
3061214734Srpaulo	 * commit - Optional commit changes handler (AP only)
3062214734Srpaulo	 * @priv: driver private data
3063214734Srpaulo	 * Returns: 0 on success, -1 on failure
3064214734Srpaulo	 *
3065214734Srpaulo	 * This optional handler function can be registered if the driver
3066214734Srpaulo	 * interface implementation needs to commit changes (e.g., by setting
3067214734Srpaulo	 * network interface up) at the end of initial configuration. If set,
3068214734Srpaulo	 * this handler will be called after initial setup has been completed.
3069214734Srpaulo	 */
3070214734Srpaulo	int (*commit)(void *priv);
3071214734Srpaulo
3072214734Srpaulo	/**
3073214734Srpaulo	 * send_ether - Send an ethernet packet (AP only)
3074214734Srpaulo	 * @priv: private driver interface data
3075214734Srpaulo	 * @dst: Destination MAC address
3076214734Srpaulo	 * @src: Source MAC address
3077214734Srpaulo	 * @proto: Ethertype
3078214734Srpaulo	 * @data: EAPOL packet starting with IEEE 802.1X header
3079214734Srpaulo	 * @data_len: Length of the EAPOL packet in octets
3080214734Srpaulo	 * Returns: 0 on success, -1 on failure
3081214734Srpaulo	 */
3082214734Srpaulo	int (*send_ether)(void *priv, const u8 *dst, const u8 *src, u16 proto,
3083214734Srpaulo			  const u8 *data, size_t data_len);
3084214734Srpaulo
3085214734Srpaulo	/**
3086214734Srpaulo	 * set_radius_acl_auth - Notification of RADIUS ACL change
3087214734Srpaulo	 * @priv: Private driver interface data
3088214734Srpaulo	 * @mac: MAC address of the station
3089214734Srpaulo	 * @accepted: Whether the station was accepted
3090214734Srpaulo	 * @session_timeout: Session timeout for the station
3091214734Srpaulo	 * Returns: 0 on success, -1 on failure
3092214734Srpaulo	 */
3093281806Srpaulo	int (*set_radius_acl_auth)(void *priv, const u8 *mac, int accepted,
3094214734Srpaulo				   u32 session_timeout);
3095214734Srpaulo
3096214734Srpaulo	/**
3097214734Srpaulo	 * set_radius_acl_expire - Notification of RADIUS ACL expiration
3098214734Srpaulo	 * @priv: Private driver interface data
3099214734Srpaulo	 * @mac: MAC address of the station
3100214734Srpaulo	 * Returns: 0 on success, -1 on failure
3101214734Srpaulo	 */
3102214734Srpaulo	int (*set_radius_acl_expire)(void *priv, const u8 *mac);
3103214734Srpaulo
3104214734Srpaulo	/**
3105214734Srpaulo	 * set_ap_wps_ie - Add WPS IE(s) into Beacon/Probe Response frames (AP)
3106214734Srpaulo	 * @priv: Private driver interface data
3107214734Srpaulo	 * @beacon: WPS IE(s) for Beacon frames or %NULL to remove extra IE(s)
3108214734Srpaulo	 * @proberesp: WPS IE(s) for Probe Response frames or %NULL to remove
3109214734Srpaulo	 *	extra IE(s)
3110252726Srpaulo	 * @assocresp: WPS IE(s) for (Re)Association Response frames or %NULL
3111252726Srpaulo	 *	to remove extra IE(s)
3112214734Srpaulo	 * Returns: 0 on success, -1 on failure
3113214734Srpaulo	 *
3114214734Srpaulo	 * This is an optional function to add WPS IE in the kernel driver for
3115214734Srpaulo	 * Beacon and Probe Response frames. This can be left undefined (set
3116252726Srpaulo	 * to %NULL) if the driver uses the Beacon template from set_ap()
3117252726Srpaulo	 * and does not process Probe Request frames. If the driver takes care
3118252726Srpaulo	 * of (Re)Association frame processing, the assocresp buffer includes
3119252726Srpaulo	 * WPS IE(s) that need to be added to (Re)Association Response frames
3120252726Srpaulo	 * whenever a (Re)Association Request frame indicated use of WPS.
3121252726Srpaulo	 *
3122252726Srpaulo	 * This will also be used to add P2P IE(s) into Beacon/Probe Response
3123252726Srpaulo	 * frames when operating as a GO. The driver is responsible for adding
3124252726Srpaulo	 * timing related attributes (e.g., NoA) in addition to the IEs
3125252726Srpaulo	 * included here by appending them after these buffers. This call is
3126252726Srpaulo	 * also used to provide Probe Response IEs for P2P Listen state
3127252726Srpaulo	 * operations for drivers that generate the Probe Response frames
3128252726Srpaulo	 * internally.
3129252726Srpaulo	 *
3130252726Srpaulo	 * DEPRECATED - use set_ap() instead
3131214734Srpaulo	 */
3132214734Srpaulo	int (*set_ap_wps_ie)(void *priv, const struct wpabuf *beacon,
3133252726Srpaulo			     const struct wpabuf *proberesp,
3134252726Srpaulo			     const struct wpabuf *assocresp);
3135214734Srpaulo
3136214734Srpaulo	/**
3137214734Srpaulo	 * set_supp_port - Set IEEE 802.1X Supplicant Port status
3138214734Srpaulo	 * @priv: Private driver interface data
3139214734Srpaulo	 * @authorized: Whether the port is authorized
3140214734Srpaulo	 * Returns: 0 on success, -1 on failure
3141214734Srpaulo	 */
3142214734Srpaulo	int (*set_supp_port)(void *priv, int authorized);
3143214734Srpaulo
3144214734Srpaulo	/**
3145214734Srpaulo	 * set_wds_sta - Bind a station into a 4-address WDS (AP only)
3146214734Srpaulo	 * @priv: Private driver interface data
3147214734Srpaulo	 * @addr: MAC address of the associated station
3148214734Srpaulo	 * @aid: Association ID
3149214734Srpaulo	 * @val: 1 = bind to 4-address WDS; 0 = unbind
3150252726Srpaulo	 * @bridge_ifname: Bridge interface to use for the WDS station or %NULL
3151252726Srpaulo	 *	to indicate that bridge is not to be used
3152281806Srpaulo	 * @ifname_wds: Buffer to return the interface name for the new WDS
3153281806Srpaulo	 *	station or %NULL to indicate name is not returned.
3154214734Srpaulo	 * Returns: 0 on success, -1 on failure
3155214734Srpaulo	 */
3156252726Srpaulo	int (*set_wds_sta)(void *priv, const u8 *addr, int aid, int val,
3157281806Srpaulo			   const char *bridge_ifname, char *ifname_wds);
3158214734Srpaulo
3159214734Srpaulo	/**
3160214734Srpaulo	 * send_action - Transmit an Action frame
3161214734Srpaulo	 * @priv: Private driver interface data
3162214734Srpaulo	 * @freq: Frequency (in MHz) of the channel
3163252726Srpaulo	 * @wait: Time to wait off-channel for a response (in ms), or zero
3164214734Srpaulo	 * @dst: Destination MAC address (Address 1)
3165214734Srpaulo	 * @src: Source MAC address (Address 2)
3166214734Srpaulo	 * @bssid: BSSID (Address 3)
3167214734Srpaulo	 * @data: Frame body
3168214734Srpaulo	 * @data_len: data length in octets
3169252726Srpaulo	 @ @no_cck: Whether CCK rates must not be used to transmit this frame
3170214734Srpaulo	 * Returns: 0 on success, -1 on failure
3171214734Srpaulo	 *
3172214734Srpaulo	 * This command can be used to request the driver to transmit an action
3173252726Srpaulo	 * frame to the specified destination.
3174252726Srpaulo	 *
3175252726Srpaulo	 * If the %WPA_DRIVER_FLAGS_OFFCHANNEL_TX flag is set, the frame will
3176252726Srpaulo	 * be transmitted on the given channel and the device will wait for a
3177252726Srpaulo	 * response on that channel for the given wait time.
3178252726Srpaulo	 *
3179252726Srpaulo	 * If the flag is not set, the wait time will be ignored. In this case,
3180252726Srpaulo	 * if a remain-on-channel duration is in progress, the frame must be
3181252726Srpaulo	 * transmitted on that channel; alternatively the frame may be sent on
3182252726Srpaulo	 * the current operational channel (if in associated state in station
3183252726Srpaulo	 * mode or while operating as an AP.)
3184346981Scy	 *
3185346981Scy	 * If @src differs from the device MAC address, use of a random
3186346981Scy	 * transmitter address is requested for this message exchange.
3187214734Srpaulo	 */
3188252726Srpaulo	int (*send_action)(void *priv, unsigned int freq, unsigned int wait,
3189214734Srpaulo			   const u8 *dst, const u8 *src, const u8 *bssid,
3190252726Srpaulo			   const u8 *data, size_t data_len, int no_cck);
3191214734Srpaulo
3192214734Srpaulo	/**
3193252726Srpaulo	 * send_action_cancel_wait - Cancel action frame TX wait
3194252726Srpaulo	 * @priv: Private driver interface data
3195252726Srpaulo	 *
3196252726Srpaulo	 * This command cancels the wait time associated with sending an action
3197252726Srpaulo	 * frame. It is only available when %WPA_DRIVER_FLAGS_OFFCHANNEL_TX is
3198252726Srpaulo	 * set in the driver flags.
3199252726Srpaulo	 */
3200252726Srpaulo	void (*send_action_cancel_wait)(void *priv);
3201252726Srpaulo
3202252726Srpaulo	/**
3203214734Srpaulo	 * remain_on_channel - Remain awake on a channel
3204214734Srpaulo	 * @priv: Private driver interface data
3205214734Srpaulo	 * @freq: Frequency (in MHz) of the channel
3206214734Srpaulo	 * @duration: Duration in milliseconds
3207214734Srpaulo	 * Returns: 0 on success, -1 on failure
3208214734Srpaulo	 *
3209214734Srpaulo	 * This command is used to request the driver to remain awake on the
3210214734Srpaulo	 * specified channel for the specified duration and report received
3211281806Srpaulo	 * Action frames with EVENT_RX_MGMT events. Optionally, received
3212214734Srpaulo	 * Probe Request frames may also be requested to be reported by calling
3213214734Srpaulo	 * probe_req_report(). These will be reported with EVENT_RX_PROBE_REQ.
3214214734Srpaulo	 *
3215214734Srpaulo	 * The driver may not be at the requested channel when this function
3216214734Srpaulo	 * returns, i.e., the return code is only indicating whether the
3217214734Srpaulo	 * request was accepted. The caller will need to wait until the
3218214734Srpaulo	 * EVENT_REMAIN_ON_CHANNEL event indicates that the driver has
3219214734Srpaulo	 * completed the channel change. This may take some time due to other
3220214734Srpaulo	 * need for the radio and the caller should be prepared to timing out
3221214734Srpaulo	 * its wait since there are no guarantees on when this request can be
3222214734Srpaulo	 * executed.
3223214734Srpaulo	 */
3224214734Srpaulo	int (*remain_on_channel)(void *priv, unsigned int freq,
3225214734Srpaulo				 unsigned int duration);
3226214734Srpaulo
3227214734Srpaulo	/**
3228214734Srpaulo	 * cancel_remain_on_channel - Cancel remain-on-channel operation
3229214734Srpaulo	 * @priv: Private driver interface data
3230214734Srpaulo	 *
3231214734Srpaulo	 * This command can be used to cancel a remain-on-channel operation
3232214734Srpaulo	 * before its originally requested duration has passed. This could be
3233214734Srpaulo	 * used, e.g., when remain_on_channel() is used to request extra time
3234214734Srpaulo	 * to receive a response to an Action frame and the response is
3235214734Srpaulo	 * received when there is still unneeded time remaining on the
3236214734Srpaulo	 * remain-on-channel operation.
3237214734Srpaulo	 */
3238214734Srpaulo	int (*cancel_remain_on_channel)(void *priv);
3239214734Srpaulo
3240214734Srpaulo	/**
3241214734Srpaulo	 * probe_req_report - Request Probe Request frames to be indicated
3242214734Srpaulo	 * @priv: Private driver interface data
3243214734Srpaulo	 * @report: Whether to report received Probe Request frames
3244214734Srpaulo	 * Returns: 0 on success, -1 on failure (or if not supported)
3245214734Srpaulo	 *
3246214734Srpaulo	 * This command can be used to request the driver to indicate when
3247214734Srpaulo	 * Probe Request frames are received with EVENT_RX_PROBE_REQ events.
3248214734Srpaulo	 * Since this operation may require extra resources, e.g., due to less
3249214734Srpaulo	 * optimal hardware/firmware RX filtering, many drivers may disable
3250214734Srpaulo	 * Probe Request reporting at least in station mode. This command is
3251214734Srpaulo	 * used to notify the driver when the Probe Request frames need to be
3252214734Srpaulo	 * reported, e.g., during remain-on-channel operations.
3253214734Srpaulo	 */
3254214734Srpaulo	int (*probe_req_report)(void *priv, int report);
3255214734Srpaulo
3256214734Srpaulo	/**
3257252726Srpaulo	 * deinit_ap - Deinitialize AP mode
3258214734Srpaulo	 * @priv: Private driver interface data
3259214734Srpaulo	 * Returns: 0 on success, -1 on failure (or if not supported)
3260214734Srpaulo	 *
3261252726Srpaulo	 * This optional function can be used to disable AP mode related
3262281806Srpaulo	 * configuration. If the interface was not dynamically added,
3263281806Srpaulo	 * change the driver mode to station mode to allow normal station
3264281806Srpaulo	 * operations like scanning to be completed.
3265214734Srpaulo	 */
3266252726Srpaulo	int (*deinit_ap)(void *priv);
3267214734Srpaulo
3268214734Srpaulo	/**
3269252726Srpaulo	 * deinit_p2p_cli - Deinitialize P2P client mode
3270214734Srpaulo	 * @priv: Private driver interface data
3271214734Srpaulo	 * Returns: 0 on success, -1 on failure (or if not supported)
3272214734Srpaulo	 *
3273281806Srpaulo	 * This optional function can be used to disable P2P client mode. If the
3274281806Srpaulo	 * interface was not dynamically added, change the interface type back
3275281806Srpaulo	 * to station mode.
3276214734Srpaulo	 */
3277252726Srpaulo	int (*deinit_p2p_cli)(void *priv);
3278214734Srpaulo
3279214734Srpaulo	/**
3280214734Srpaulo	 * suspend - Notification on system suspend/hibernate event
3281214734Srpaulo	 * @priv: Private driver interface data
3282214734Srpaulo	 */
3283214734Srpaulo	void (*suspend)(void *priv);
3284214734Srpaulo
3285214734Srpaulo	/**
3286214734Srpaulo	 * resume - Notification on system resume/thaw event
3287214734Srpaulo	 * @priv: Private driver interface data
3288214734Srpaulo	 */
3289214734Srpaulo	void (*resume)(void *priv);
3290214734Srpaulo
3291214734Srpaulo	/**
3292214734Srpaulo	 * signal_monitor - Set signal monitoring parameters
3293214734Srpaulo	 * @priv: Private driver interface data
3294214734Srpaulo	 * @threshold: Threshold value for signal change events; 0 = disabled
3295214734Srpaulo	 * @hysteresis: Minimum change in signal strength before indicating a
3296214734Srpaulo	 *	new event
3297214734Srpaulo	 * Returns: 0 on success, -1 on failure (or if not supported)
3298214734Srpaulo	 *
3299214734Srpaulo	 * This function can be used to configure monitoring of signal strength
3300214734Srpaulo	 * with the current AP. Whenever signal strength drops below the
3301214734Srpaulo	 * %threshold value or increases above it, EVENT_SIGNAL_CHANGE event
3302214734Srpaulo	 * should be generated assuming the signal strength has changed at
3303214734Srpaulo	 * least %hysteresis from the previously indicated signal change event.
3304214734Srpaulo	 */
3305214734Srpaulo	int (*signal_monitor)(void *priv, int threshold, int hysteresis);
3306214734Srpaulo
3307214734Srpaulo	/**
3308214734Srpaulo	 * send_frame - Send IEEE 802.11 frame (testing use only)
3309214734Srpaulo	 * @priv: Private driver interface data
3310214734Srpaulo	 * @data: IEEE 802.11 frame with IEEE 802.11 header
3311214734Srpaulo	 * @data_len: Size of the frame
3312214734Srpaulo	 * @encrypt: Whether to encrypt the frame (if keys are set)
3313214734Srpaulo	 * Returns: 0 on success, -1 on failure
3314214734Srpaulo	 *
3315214734Srpaulo	 * This function is only used for debugging purposes and is not
3316214734Srpaulo	 * required to be implemented for normal operations.
3317214734Srpaulo	 */
3318214734Srpaulo	int (*send_frame)(void *priv, const u8 *data, size_t data_len,
3319214734Srpaulo			  int encrypt);
3320252726Srpaulo
3321252726Srpaulo	/**
3322252726Srpaulo	 * get_noa - Get current Notice of Absence attribute payload
3323252726Srpaulo	 * @priv: Private driver interface data
3324252726Srpaulo	 * @buf: Buffer for returning NoA
3325252726Srpaulo	 * @buf_len: Buffer length in octets
3326252726Srpaulo	 * Returns: Number of octets used in buf, 0 to indicate no NoA is being
3327252726Srpaulo	 * advertized, or -1 on failure
3328252726Srpaulo	 *
3329252726Srpaulo	 * This function is used to fetch the current Notice of Absence
3330252726Srpaulo	 * attribute value from GO.
3331252726Srpaulo	 */
3332252726Srpaulo	int (*get_noa)(void *priv, u8 *buf, size_t buf_len);
3333252726Srpaulo
3334252726Srpaulo	/**
3335252726Srpaulo	 * set_noa - Set Notice of Absence parameters for GO (testing)
3336252726Srpaulo	 * @priv: Private driver interface data
3337252726Srpaulo	 * @count: Count
3338252726Srpaulo	 * @start: Start time in ms from next TBTT
3339252726Srpaulo	 * @duration: Duration in ms
3340252726Srpaulo	 * Returns: 0 on success or -1 on failure
3341252726Srpaulo	 *
3342252726Srpaulo	 * This function is used to set Notice of Absence parameters for GO. It
3343252726Srpaulo	 * is used only for testing. To disable NoA, all parameters are set to
3344252726Srpaulo	 * 0.
3345252726Srpaulo	 */
3346252726Srpaulo	int (*set_noa)(void *priv, u8 count, int start, int duration);
3347252726Srpaulo
3348252726Srpaulo	/**
3349252726Srpaulo	 * set_p2p_powersave - Set P2P power save options
3350252726Srpaulo	 * @priv: Private driver interface data
3351252726Srpaulo	 * @legacy_ps: 0 = disable, 1 = enable, 2 = maximum PS, -1 = no change
3352252726Srpaulo	 * @opp_ps: 0 = disable, 1 = enable, -1 = no change
3353252726Srpaulo	 * @ctwindow: 0.. = change (msec), -1 = no change
3354252726Srpaulo	 * Returns: 0 on success or -1 on failure
3355252726Srpaulo	 */
3356252726Srpaulo	int (*set_p2p_powersave)(void *priv, int legacy_ps, int opp_ps,
3357252726Srpaulo				 int ctwindow);
3358252726Srpaulo
3359252726Srpaulo	/**
3360252726Srpaulo	 * ampdu - Enable/disable aggregation
3361252726Srpaulo	 * @priv: Private driver interface data
3362252726Srpaulo	 * @ampdu: 1/0 = enable/disable A-MPDU aggregation
3363252726Srpaulo	 * Returns: 0 on success or -1 on failure
3364252726Srpaulo	 */
3365252726Srpaulo	int (*ampdu)(void *priv, int ampdu);
3366252726Srpaulo
3367252726Srpaulo	/**
3368252726Srpaulo	 * get_radio_name - Get physical radio name for the device
3369252726Srpaulo	 * @priv: Private driver interface data
3370252726Srpaulo	 * Returns: Radio name or %NULL if not known
3371252726Srpaulo	 *
3372252726Srpaulo	 * The returned data must not be modified by the caller. It is assumed
3373252726Srpaulo	 * that any interface that has the same radio name as another is
3374252726Srpaulo	 * sharing the same physical radio. This information can be used to
3375252726Srpaulo	 * share scan results etc. information between the virtual interfaces
3376252726Srpaulo	 * to speed up various operations.
3377252726Srpaulo	 */
3378252726Srpaulo	const char * (*get_radio_name)(void *priv);
3379252726Srpaulo
3380252726Srpaulo	/**
3381252726Srpaulo	 * send_tdls_mgmt - for sending TDLS management packets
3382252726Srpaulo	 * @priv: private driver interface data
3383252726Srpaulo	 * @dst: Destination (peer) MAC address
3384252726Srpaulo	 * @action_code: TDLS action code for the mssage
3385252726Srpaulo	 * @dialog_token: Dialog Token to use in the message (if needed)
3386252726Srpaulo	 * @status_code: Status Code or Reason Code to use (if needed)
3387281806Srpaulo	 * @peer_capab: TDLS peer capability (TDLS_PEER_* bitfield)
3388281806Srpaulo	 * @initiator: Is the current end the TDLS link initiator
3389252726Srpaulo	 * @buf: TDLS IEs to add to the message
3390252726Srpaulo	 * @len: Length of buf in octets
3391252726Srpaulo	 * Returns: 0 on success, negative (<0) on failure
3392252726Srpaulo	 *
3393252726Srpaulo	 * This optional function can be used to send packet to driver which is
3394252726Srpaulo	 * responsible for receiving and sending all TDLS packets.
3395252726Srpaulo	 */
3396252726Srpaulo	int (*send_tdls_mgmt)(void *priv, const u8 *dst, u8 action_code,
3397281806Srpaulo			      u8 dialog_token, u16 status_code, u32 peer_capab,
3398281806Srpaulo			      int initiator, const u8 *buf, size_t len);
3399252726Srpaulo
3400252726Srpaulo	/**
3401252726Srpaulo	 * tdls_oper - Ask the driver to perform high-level TDLS operations
3402252726Srpaulo	 * @priv: Private driver interface data
3403252726Srpaulo	 * @oper: TDLS high-level operation. See %enum tdls_oper
3404252726Srpaulo	 * @peer: Destination (peer) MAC address
3405252726Srpaulo	 * Returns: 0 on success, negative (<0) on failure
3406252726Srpaulo	 *
3407252726Srpaulo	 * This optional function can be used to send high-level TDLS commands
3408252726Srpaulo	 * to the driver.
3409252726Srpaulo	 */
3410252726Srpaulo	int (*tdls_oper)(void *priv, enum tdls_oper oper, const u8 *peer);
3411252726Srpaulo
3412252726Srpaulo	/**
3413252726Srpaulo	 * wnm_oper - Notify driver of the WNM frame reception
3414252726Srpaulo	 * @priv: Private driver interface data
3415252726Srpaulo	 * @oper: WNM operation. See %enum wnm_oper
3416252726Srpaulo	 * @peer: Destination (peer) MAC address
3417252726Srpaulo	 * @buf: Buffer for the driver to fill in (for getting IE)
3418252726Srpaulo	 * @buf_len: Return the len of buf
3419252726Srpaulo	 * Returns: 0 on success, negative (<0) on failure
3420252726Srpaulo	 */
3421252726Srpaulo	int (*wnm_oper)(void *priv, enum wnm_oper oper, const u8 *peer,
3422252726Srpaulo			u8 *buf, u16 *buf_len);
3423252726Srpaulo
3424252726Srpaulo	/**
3425281806Srpaulo	 * set_qos_map - Set QoS Map
3426281806Srpaulo	 * @priv: Private driver interface data
3427281806Srpaulo	 * @qos_map_set: QoS Map
3428281806Srpaulo	 * @qos_map_set_len: Length of QoS Map
3429281806Srpaulo	 */
3430281806Srpaulo	int (*set_qos_map)(void *priv, const u8 *qos_map_set,
3431281806Srpaulo			   u8 qos_map_set_len);
3432281806Srpaulo
3433281806Srpaulo	/**
3434281806Srpaulo	 * br_add_ip_neigh - Add a neigh to the bridge ip neigh table
3435281806Srpaulo	 * @priv: Private driver interface data
3436281806Srpaulo	 * @version: IP version of the IP address, 4 or 6
3437281806Srpaulo	 * @ipaddr: IP address for the neigh entry
3438281806Srpaulo	 * @prefixlen: IP address prefix length
3439281806Srpaulo	 * @addr: Corresponding MAC address
3440281806Srpaulo	 * Returns: 0 on success, negative (<0) on failure
3441281806Srpaulo	 */
3442281806Srpaulo	int (*br_add_ip_neigh)(void *priv, u8 version, const u8 *ipaddr,
3443281806Srpaulo			       int prefixlen, const u8 *addr);
3444281806Srpaulo
3445281806Srpaulo	/**
3446281806Srpaulo	 * br_delete_ip_neigh - Remove a neigh from the bridge ip neigh table
3447281806Srpaulo	 * @priv: Private driver interface data
3448281806Srpaulo	 * @version: IP version of the IP address, 4 or 6
3449281806Srpaulo	 * @ipaddr: IP address for the neigh entry
3450281806Srpaulo	 * Returns: 0 on success, negative (<0) on failure
3451281806Srpaulo	 */
3452281806Srpaulo	int (*br_delete_ip_neigh)(void *priv, u8 version, const u8 *ipaddr);
3453281806Srpaulo
3454281806Srpaulo	/**
3455281806Srpaulo	 * br_port_set_attr - Set a bridge port attribute
3456281806Srpaulo	 * @attr: Bridge port attribute to set
3457281806Srpaulo	 * @val: Value to be set
3458281806Srpaulo	 * Returns: 0 on success, negative (<0) on failure
3459281806Srpaulo	 */
3460281806Srpaulo	int (*br_port_set_attr)(void *priv, enum drv_br_port_attr attr,
3461281806Srpaulo				unsigned int val);
3462281806Srpaulo
3463281806Srpaulo	/**
3464281806Srpaulo	 * br_port_set_attr - Set a bridge network parameter
3465281806Srpaulo	 * @param: Bridge parameter to set
3466281806Srpaulo	 * @val: Value to be set
3467281806Srpaulo	 * Returns: 0 on success, negative (<0) on failure
3468281806Srpaulo	 */
3469281806Srpaulo	int (*br_set_net_param)(void *priv, enum drv_br_net_param param,
3470281806Srpaulo				unsigned int val);
3471281806Srpaulo
3472281806Srpaulo	/**
3473281806Srpaulo	 * set_wowlan - Set wake-on-wireless triggers
3474281806Srpaulo	 * @priv: Private driver interface data
3475281806Srpaulo	 * @triggers: wowlan triggers
3476281806Srpaulo	 */
3477281806Srpaulo	int (*set_wowlan)(void *priv, const struct wowlan_triggers *triggers);
3478281806Srpaulo
3479281806Srpaulo	/**
3480252726Srpaulo	 * signal_poll - Get current connection information
3481252726Srpaulo	 * @priv: Private driver interface data
3482252726Srpaulo	 * @signal_info: Connection info structure
3483281806Srpaulo	 */
3484252726Srpaulo	int (*signal_poll)(void *priv, struct wpa_signal_info *signal_info);
3485252726Srpaulo
3486252726Srpaulo	/**
3487346981Scy	 * channel_info - Get parameters of the current operating channel
3488346981Scy	 * @priv: Private driver interface data
3489346981Scy	 * @channel_info: Channel info structure
3490346981Scy	 * Returns: 0 on success, negative (<0) on failure
3491346981Scy	 */
3492346981Scy	int (*channel_info)(void *priv, struct wpa_channel_info *channel_info);
3493346981Scy
3494346981Scy	/**
3495252726Srpaulo	 * set_authmode - Set authentication algorithm(s) for static WEP
3496252726Srpaulo	 * @priv: Private driver interface data
3497252726Srpaulo	 * @authmode: 1=Open System, 2=Shared Key, 3=both
3498252726Srpaulo	 * Returns: 0 on success, -1 on failure
3499252726Srpaulo	 *
3500252726Srpaulo	 * This function can be used to set authentication algorithms for AP
3501252726Srpaulo	 * mode when static WEP is used. If the driver uses user space MLME/SME
3502252726Srpaulo	 * implementation, there is no need to implement this function.
3503252726Srpaulo	 *
3504252726Srpaulo	 * DEPRECATED - use set_ap() instead
3505252726Srpaulo	 */
3506252726Srpaulo	int (*set_authmode)(void *priv, int authmode);
3507252726Srpaulo
3508281806Srpaulo#ifdef ANDROID
3509252726Srpaulo	/**
3510281806Srpaulo	 * driver_cmd - Execute driver-specific command
3511281806Srpaulo	 * @priv: Private driver interface data
3512281806Srpaulo	 * @cmd: Command to execute
3513281806Srpaulo	 * @buf: Return buffer
3514281806Srpaulo	 * @buf_len: Buffer length
3515281806Srpaulo	 * Returns: 0 on success, -1 on failure
3516281806Srpaulo	 */
3517281806Srpaulo	int (*driver_cmd)(void *priv, char *cmd, char *buf, size_t buf_len);
3518281806Srpaulo#endif /* ANDROID */
3519281806Srpaulo
3520281806Srpaulo	/**
3521281806Srpaulo	 * vendor_cmd - Execute vendor specific command
3522281806Srpaulo	 * @priv: Private driver interface data
3523281806Srpaulo	 * @vendor_id: Vendor id
3524281806Srpaulo	 * @subcmd: Vendor command id
3525281806Srpaulo	 * @data: Vendor command parameters (%NULL if no parameters)
3526281806Srpaulo	 * @data_len: Data length
3527281806Srpaulo	 * @buf: Return buffer (%NULL to ignore reply)
3528281806Srpaulo	 * Returns: 0 on success, negative (<0) on failure
3529281806Srpaulo	 *
3530281806Srpaulo	 * This function handles vendor specific commands that are passed to
3531281806Srpaulo	 * the driver/device. The command is identified by vendor id and
3532281806Srpaulo	 * command id. Parameters can be passed as argument to the command
3533281806Srpaulo	 * in the data buffer. Reply (if any) will be filled in the supplied
3534281806Srpaulo	 * return buffer.
3535281806Srpaulo	 *
3536281806Srpaulo	 * The exact driver behavior is driver interface and vendor specific. As
3537281806Srpaulo	 * an example, this will be converted to a vendor specific cfg80211
3538281806Srpaulo	 * command in case of the nl80211 driver interface.
3539281806Srpaulo	 */
3540281806Srpaulo	int (*vendor_cmd)(void *priv, unsigned int vendor_id,
3541281806Srpaulo			  unsigned int subcmd, const u8 *data, size_t data_len,
3542281806Srpaulo			  struct wpabuf *buf);
3543281806Srpaulo
3544281806Srpaulo	/**
3545252726Srpaulo	 * set_rekey_info - Set rekey information
3546252726Srpaulo	 * @priv: Private driver interface data
3547252726Srpaulo	 * @kek: Current KEK
3548281806Srpaulo	 * @kek_len: KEK length in octets
3549252726Srpaulo	 * @kck: Current KCK
3550281806Srpaulo	 * @kck_len: KCK length in octets
3551252726Srpaulo	 * @replay_ctr: Current EAPOL-Key Replay Counter
3552252726Srpaulo	 *
3553252726Srpaulo	 * This optional function can be used to provide information for the
3554252726Srpaulo	 * driver/firmware to process EAPOL-Key frames in Group Key Handshake
3555252726Srpaulo	 * while the host (including wpa_supplicant) is sleeping.
3556252726Srpaulo	 */
3557281806Srpaulo	void (*set_rekey_info)(void *priv, const u8 *kek, size_t kek_len,
3558281806Srpaulo			       const u8 *kck, size_t kck_len,
3559252726Srpaulo			       const u8 *replay_ctr);
3560252726Srpaulo
3561252726Srpaulo	/**
3562252726Srpaulo	 * sta_assoc - Station association indication
3563252726Srpaulo	 * @priv: Private driver interface data
3564252726Srpaulo	 * @own_addr: Source address and BSSID for association frame
3565252726Srpaulo	 * @addr: MAC address of the station to associate
3566252726Srpaulo	 * @reassoc: flag to indicate re-association
3567252726Srpaulo	 * @status: association response status code
3568252726Srpaulo	 * @ie: assoc response ie buffer
3569252726Srpaulo	 * @len: ie buffer length
3570252726Srpaulo	 * Returns: 0 on success, -1 on failure
3571252726Srpaulo	 *
3572252726Srpaulo	 * This function indicates the driver to send (Re)Association
3573252726Srpaulo	 * Response frame to the station.
3574252726Srpaulo	 */
3575252726Srpaulo	 int (*sta_assoc)(void *priv, const u8 *own_addr, const u8 *addr,
3576252726Srpaulo			  int reassoc, u16 status, const u8 *ie, size_t len);
3577252726Srpaulo
3578252726Srpaulo	/**
3579252726Srpaulo	 * sta_auth - Station authentication indication
3580346981Scy	 * @priv: private driver interface data
3581346981Scy	 * @params: Station authentication parameters
3582252726Srpaulo	 *
3583346981Scy	 * Returns: 0 on success, -1 on failure
3584252726Srpaulo	 */
3585346981Scy	 int (*sta_auth)(void *priv,
3586346981Scy			 struct wpa_driver_sta_auth_params *params);
3587252726Srpaulo
3588252726Srpaulo	/**
3589252726Srpaulo	 * add_tspec - Add traffic stream
3590252726Srpaulo	 * @priv: Private driver interface data
3591252726Srpaulo	 * @addr: MAC address of the station to associate
3592252726Srpaulo	 * @tspec_ie: tspec ie buffer
3593252726Srpaulo	 * @tspec_ielen: tspec ie length
3594252726Srpaulo	 * Returns: 0 on success, -1 on failure
3595252726Srpaulo	 *
3596252726Srpaulo	 * This function adds the traffic steam for the station
3597252726Srpaulo	 * and fills the medium_time in tspec_ie.
3598252726Srpaulo	 */
3599252726Srpaulo	 int (*add_tspec)(void *priv, const u8 *addr, u8 *tspec_ie,
3600252726Srpaulo			  size_t tspec_ielen);
3601252726Srpaulo
3602252726Srpaulo	/**
3603252726Srpaulo	 * add_sta_node - Add a station node in the driver
3604252726Srpaulo	 * @priv: Private driver interface data
3605252726Srpaulo	 * @addr: MAC address of the station to add
3606252726Srpaulo	 * @auth_alg: authentication algorithm used by the station
3607252726Srpaulo	 * Returns: 0 on success, -1 on failure
3608252726Srpaulo	 *
3609252726Srpaulo	 * This function adds the station node in the driver, when
3610252726Srpaulo	 * the station gets added by FT-over-DS.
3611252726Srpaulo	 */
3612252726Srpaulo	int (*add_sta_node)(void *priv, const u8 *addr, u16 auth_alg);
3613252726Srpaulo
3614252726Srpaulo	/**
3615252726Srpaulo	 * sched_scan - Request the driver to initiate scheduled scan
3616252726Srpaulo	 * @priv: Private driver interface data
3617252726Srpaulo	 * @params: Scan parameters
3618252726Srpaulo	 * Returns: 0 on success, -1 on failure
3619252726Srpaulo	 *
3620252726Srpaulo	 * This operation should be used for scheduled scan offload to
3621252726Srpaulo	 * the hardware. Every time scan results are available, the
3622252726Srpaulo	 * driver should report scan results event for wpa_supplicant
3623252726Srpaulo	 * which will eventually request the results with
3624252726Srpaulo	 * wpa_driver_get_scan_results2(). This operation is optional
3625252726Srpaulo	 * and if not provided or if it returns -1, we fall back to
3626252726Srpaulo	 * normal host-scheduled scans.
3627252726Srpaulo	 */
3628337817Scy	int (*sched_scan)(void *priv, struct wpa_driver_scan_params *params);
3629252726Srpaulo
3630252726Srpaulo	/**
3631252726Srpaulo	 * stop_sched_scan - Request the driver to stop a scheduled scan
3632252726Srpaulo	 * @priv: Private driver interface data
3633252726Srpaulo	 * Returns: 0 on success, -1 on failure
3634252726Srpaulo	 *
3635252726Srpaulo	 * This should cause the scheduled scan to be stopped and
3636252726Srpaulo	 * results should stop being sent. Must be supported if
3637252726Srpaulo	 * sched_scan is supported.
3638252726Srpaulo	 */
3639252726Srpaulo	int (*stop_sched_scan)(void *priv);
3640252726Srpaulo
3641252726Srpaulo	/**
3642252726Srpaulo	 * poll_client - Probe (null data or such) the given station
3643252726Srpaulo	 * @priv: Private driver interface data
3644252726Srpaulo	 * @own_addr: MAC address of sending interface
3645252726Srpaulo	 * @addr: MAC address of the station to probe
3646252726Srpaulo	 * @qos: Indicates whether station is QoS station
3647252726Srpaulo	 *
3648252726Srpaulo	 * This function is used to verify whether an associated station is
3649252726Srpaulo	 * still present. This function does not need to be implemented if the
3650252726Srpaulo	 * driver provides such inactivity polling mechanism.
3651252726Srpaulo	 */
3652252726Srpaulo	void (*poll_client)(void *priv, const u8 *own_addr,
3653252726Srpaulo			    const u8 *addr, int qos);
3654252726Srpaulo
3655252726Srpaulo	/**
3656252726Srpaulo	 * radio_disable - Disable/enable radio
3657252726Srpaulo	 * @priv: Private driver interface data
3658252726Srpaulo	 * @disabled: 1=disable 0=enable radio
3659252726Srpaulo	 * Returns: 0 on success, -1 on failure
3660252726Srpaulo	 *
3661252726Srpaulo	 * This optional command is for testing purposes. It can be used to
3662252726Srpaulo	 * disable the radio on a testbed device to simulate out-of-radio-range
3663252726Srpaulo	 * conditions.
3664252726Srpaulo	 */
3665252726Srpaulo	int (*radio_disable)(void *priv, int disabled);
3666252726Srpaulo
3667252726Srpaulo	/**
3668252726Srpaulo	 * switch_channel - Announce channel switch and migrate the GO to the
3669252726Srpaulo	 * given frequency
3670252726Srpaulo	 * @priv: Private driver interface data
3671281806Srpaulo	 * @settings: Settings for CSA period and new channel
3672252726Srpaulo	 * Returns: 0 on success, -1 on failure
3673252726Srpaulo	 *
3674252726Srpaulo	 * This function is used to move the GO to the legacy STA channel to
3675252726Srpaulo	 * avoid frequency conflict in single channel concurrency.
3676252726Srpaulo	 */
3677281806Srpaulo	int (*switch_channel)(void *priv, struct csa_settings *settings);
3678281806Srpaulo
3679281806Srpaulo	/**
3680281806Srpaulo	 * add_tx_ts - Add traffic stream
3681281806Srpaulo	 * @priv: Private driver interface data
3682281806Srpaulo	 * @tsid: Traffic stream ID
3683281806Srpaulo	 * @addr: Receiver address
3684281806Srpaulo	 * @user_prio: User priority of the traffic stream
3685281806Srpaulo	 * @admitted_time: Admitted time for this TS in units of
3686281806Srpaulo	 *	32 microsecond periods (per second).
3687281806Srpaulo	 * Returns: 0 on success, -1 on failure
3688281806Srpaulo	 */
3689281806Srpaulo	int (*add_tx_ts)(void *priv, u8 tsid, const u8 *addr, u8 user_prio,
3690281806Srpaulo			 u16 admitted_time);
3691281806Srpaulo
3692281806Srpaulo	/**
3693281806Srpaulo	 * del_tx_ts - Delete traffic stream
3694281806Srpaulo	 * @priv: Private driver interface data
3695281806Srpaulo	 * @tsid: Traffic stream ID
3696281806Srpaulo	 * @addr: Receiver address
3697281806Srpaulo	 * Returns: 0 on success, -1 on failure
3698281806Srpaulo	 */
3699281806Srpaulo	int (*del_tx_ts)(void *priv, u8 tsid, const u8 *addr);
3700281806Srpaulo
3701281806Srpaulo	/**
3702281806Srpaulo	 * Enable channel-switching with TDLS peer
3703281806Srpaulo	 * @priv: Private driver interface data
3704281806Srpaulo	 * @addr: MAC address of the TDLS peer
3705281806Srpaulo	 * @oper_class: Operating class of the switch channel
3706281806Srpaulo	 * @params: Channel specification
3707281806Srpaulo	 * Returns: 0 on success, -1 on failure
3708281806Srpaulo	 *
3709281806Srpaulo	 * The function indicates to driver that it can start switching to a
3710281806Srpaulo	 * different channel with a specified TDLS peer. The switching is
3711281806Srpaulo	 * assumed on until canceled with tdls_disable_channel_switch().
3712281806Srpaulo	 */
3713281806Srpaulo	int (*tdls_enable_channel_switch)(
3714281806Srpaulo		void *priv, const u8 *addr, u8 oper_class,
3715281806Srpaulo		const struct hostapd_freq_params *params);
3716281806Srpaulo
3717281806Srpaulo	/**
3718281806Srpaulo	 * Disable channel switching with TDLS peer
3719281806Srpaulo	 * @priv: Private driver interface data
3720281806Srpaulo	 * @addr: MAC address of the TDLS peer
3721281806Srpaulo	 * Returns: 0 on success, -1 on failure
3722281806Srpaulo	 *
3723281806Srpaulo	 * This function indicates to the driver that it should stop switching
3724281806Srpaulo	 * with a given TDLS peer.
3725281806Srpaulo	 */
3726281806Srpaulo	int (*tdls_disable_channel_switch)(void *priv, const u8 *addr);
3727281806Srpaulo
3728281806Srpaulo	/**
3729281806Srpaulo	 * start_dfs_cac - Listen for radar interference on the channel
3730281806Srpaulo	 * @priv: Private driver interface data
3731281806Srpaulo	 * @freq: Channel parameters
3732281806Srpaulo	 * Returns: 0 on success, -1 on failure
3733281806Srpaulo	 */
3734281806Srpaulo	int (*start_dfs_cac)(void *priv, struct hostapd_freq_params *freq);
3735281806Srpaulo
3736281806Srpaulo	/**
3737281806Srpaulo	 * stop_ap - Removes beacon from AP
3738281806Srpaulo	 * @priv: Private driver interface data
3739281806Srpaulo	 * Returns: 0 on success, -1 on failure (or if not supported)
3740281806Srpaulo	 *
3741281806Srpaulo	 * This optional function can be used to disable AP mode related
3742281806Srpaulo	 * configuration. Unlike deinit_ap, it does not change to station
3743281806Srpaulo	 * mode.
3744281806Srpaulo	 */
3745281806Srpaulo	int (*stop_ap)(void *priv);
3746281806Srpaulo
3747281806Srpaulo	/**
3748281806Srpaulo	 * get_survey - Retrieve survey data
3749281806Srpaulo	 * @priv: Private driver interface data
3750281806Srpaulo	 * @freq: If set, survey data for the specified frequency is only
3751281806Srpaulo	 *	being requested. If not set, all survey data is requested.
3752281806Srpaulo	 * Returns: 0 on success, -1 on failure
3753281806Srpaulo	 *
3754281806Srpaulo	 * Use this to retrieve:
3755281806Srpaulo	 *
3756281806Srpaulo	 * - the observed channel noise floor
3757281806Srpaulo	 * - the amount of time we have spent on the channel
3758281806Srpaulo	 * - the amount of time during which we have spent on the channel that
3759281806Srpaulo	 *   the radio has determined the medium is busy and we cannot
3760281806Srpaulo	 *   transmit
3761281806Srpaulo	 * - the amount of time we have spent receiving data
3762281806Srpaulo	 * - the amount of time we have spent transmitting data
3763281806Srpaulo	 *
3764281806Srpaulo	 * This data can be used for spectrum heuristics. One example is
3765281806Srpaulo	 * Automatic Channel Selection (ACS). The channel survey data is
3766281806Srpaulo	 * kept on a linked list on the channel data, one entry is added
3767281806Srpaulo	 * for each survey. The min_nf of the channel is updated for each
3768281806Srpaulo	 * survey.
3769281806Srpaulo	 */
3770281806Srpaulo	int (*get_survey)(void *priv, unsigned int freq);
3771281806Srpaulo
3772281806Srpaulo	/**
3773281806Srpaulo	 * status - Get driver interface status information
3774281806Srpaulo	 * @priv: Private driver interface data
3775346981Scy	 * @buf: Buffer for printing the status information
3776281806Srpaulo	 * @buflen: Maximum length of the buffer
3777281806Srpaulo	 * Returns: Length of written status information or -1 on failure
3778281806Srpaulo	 */
3779281806Srpaulo	int (*status)(void *priv, char *buf, size_t buflen);
3780281806Srpaulo
3781281806Srpaulo	/**
3782281806Srpaulo	 * roaming - Set roaming policy for driver-based BSS selection
3783281806Srpaulo	 * @priv: Private driver interface data
3784281806Srpaulo	 * @allowed: Whether roaming within ESS is allowed
3785281806Srpaulo	 * @bssid: Forced BSSID if roaming is disabled or %NULL if not set
3786281806Srpaulo	 * Returns: Length of written status information or -1 on failure
3787281806Srpaulo	 *
3788281806Srpaulo	 * This optional callback can be used to update roaming policy from the
3789281806Srpaulo	 * associate() command (bssid being set there indicates that the driver
3790281806Srpaulo	 * should not roam before getting this roaming() call to allow roaming.
3791281806Srpaulo	 * If the driver does not indicate WPA_DRIVER_FLAGS_BSS_SELECTION
3792281806Srpaulo	 * capability, roaming policy is handled within wpa_supplicant and there
3793281806Srpaulo	 * is no need to implement or react to this callback.
3794281806Srpaulo	 */
3795281806Srpaulo	int (*roaming)(void *priv, int allowed, const u8 *bssid);
3796281806Srpaulo
3797281806Srpaulo	/**
3798346981Scy	 * disable_fils - Enable/disable FILS feature
3799346981Scy	 * @priv: Private driver interface data
3800346981Scy	 * @disable: 0-enable and 1-disable FILS feature
3801346981Scy	 * Returns: 0 on success, -1 on failure
3802346981Scy	 *
3803346981Scy	 * This callback can be used to configure driver and below layers to
3804346981Scy	 * enable/disable all FILS features.
3805346981Scy	 */
3806346981Scy	int (*disable_fils)(void *priv, int disable);
3807346981Scy
3808346981Scy	/**
3809281806Srpaulo	 * set_mac_addr - Set MAC address
3810281806Srpaulo	 * @priv: Private driver interface data
3811281806Srpaulo	 * @addr: MAC address to use or %NULL for setting back to permanent
3812281806Srpaulo	 * Returns: 0 on success, -1 on failure
3813281806Srpaulo	 */
3814281806Srpaulo	int (*set_mac_addr)(void *priv, const u8 *addr);
3815281806Srpaulo
3816281806Srpaulo#ifdef CONFIG_MACSEC
3817281806Srpaulo	int (*macsec_init)(void *priv, struct macsec_init_params *params);
3818281806Srpaulo
3819281806Srpaulo	int (*macsec_deinit)(void *priv);
3820281806Srpaulo
3821281806Srpaulo	/**
3822346981Scy	 * macsec_get_capability - Inform MKA of this driver's capability
3823346981Scy	 * @priv: Private driver interface data
3824346981Scy	 * @cap: Driver's capability
3825346981Scy	 * Returns: 0 on success, -1 on failure
3826346981Scy	 */
3827346981Scy	int (*macsec_get_capability)(void *priv, enum macsec_cap *cap);
3828346981Scy
3829346981Scy	/**
3830281806Srpaulo	 * enable_protect_frames - Set protect frames status
3831281806Srpaulo	 * @priv: Private driver interface data
3832281806Srpaulo	 * @enabled: TRUE = protect frames enabled
3833281806Srpaulo	 *           FALSE = protect frames disabled
3834281806Srpaulo	 * Returns: 0 on success, -1 on failure (or if not supported)
3835281806Srpaulo	 */
3836281806Srpaulo	int (*enable_protect_frames)(void *priv, Boolean enabled);
3837281806Srpaulo
3838281806Srpaulo	/**
3839346981Scy	 * enable_encrypt - Set encryption status
3840346981Scy	 * @priv: Private driver interface data
3841346981Scy	 * @enabled: TRUE = encrypt outgoing traffic
3842346981Scy	 *           FALSE = integrity-only protection on outgoing traffic
3843346981Scy	 * Returns: 0 on success, -1 on failure (or if not supported)
3844346981Scy	 */
3845346981Scy	int (*enable_encrypt)(void *priv, Boolean enabled);
3846346981Scy
3847346981Scy	/**
3848281806Srpaulo	 * set_replay_protect - Set replay protect status and window size
3849281806Srpaulo	 * @priv: Private driver interface data
3850281806Srpaulo	 * @enabled: TRUE = replay protect enabled
3851281806Srpaulo	 *           FALSE = replay protect disabled
3852281806Srpaulo	 * @window: replay window size, valid only when replay protect enabled
3853281806Srpaulo	 * Returns: 0 on success, -1 on failure (or if not supported)
3854281806Srpaulo	 */
3855281806Srpaulo	int (*set_replay_protect)(void *priv, Boolean enabled, u32 window);
3856281806Srpaulo
3857281806Srpaulo	/**
3858281806Srpaulo	 * set_current_cipher_suite - Set current cipher suite
3859281806Srpaulo	 * @priv: Private driver interface data
3860281806Srpaulo	 * @cs: EUI64 identifier
3861281806Srpaulo	 * Returns: 0 on success, -1 on failure (or if not supported)
3862281806Srpaulo	 */
3863337817Scy	int (*set_current_cipher_suite)(void *priv, u64 cs);
3864281806Srpaulo
3865281806Srpaulo	/**
3866281806Srpaulo	 * enable_controlled_port - Set controlled port status
3867281806Srpaulo	 * @priv: Private driver interface data
3868281806Srpaulo	 * @enabled: TRUE = controlled port enabled
3869281806Srpaulo	 *           FALSE = controlled port disabled
3870281806Srpaulo	 * Returns: 0 on success, -1 on failure (or if not supported)
3871281806Srpaulo	 */
3872281806Srpaulo	int (*enable_controlled_port)(void *priv, Boolean enabled);
3873281806Srpaulo
3874281806Srpaulo	/**
3875281806Srpaulo	 * get_receive_lowest_pn - Get receive lowest pn
3876281806Srpaulo	 * @priv: Private driver interface data
3877346981Scy	 * @sa: secure association
3878281806Srpaulo	 * Returns: 0 on success, -1 on failure (or if not supported)
3879281806Srpaulo	 */
3880346981Scy	int (*get_receive_lowest_pn)(void *priv, struct receive_sa *sa);
3881281806Srpaulo
3882281806Srpaulo	/**
3883281806Srpaulo	 * get_transmit_next_pn - Get transmit next pn
3884281806Srpaulo	 * @priv: Private driver interface data
3885346981Scy	 * @sa: secure association
3886281806Srpaulo	 * Returns: 0 on success, -1 on failure (or if not supported)
3887281806Srpaulo	 */
3888346981Scy	int (*get_transmit_next_pn)(void *priv, struct transmit_sa *sa);
3889281806Srpaulo
3890281806Srpaulo	/**
3891281806Srpaulo	 * set_transmit_next_pn - Set transmit next pn
3892281806Srpaulo	 * @priv: Private driver interface data
3893346981Scy	 * @sa: secure association
3894281806Srpaulo	 * Returns: 0 on success, -1 on failure (or if not supported)
3895281806Srpaulo	 */
3896346981Scy	int (*set_transmit_next_pn)(void *priv, struct transmit_sa *sa);
3897281806Srpaulo
3898281806Srpaulo	/**
3899346981Scy	 * set_receive_lowest_pn - Set receive lowest PN
3900281806Srpaulo	 * @priv: Private driver interface data
3901346981Scy	 * @sa: secure association
3902281806Srpaulo	 * Returns: 0 on success, -1 on failure (or if not supported)
3903281806Srpaulo	 */
3904346981Scy	int (*set_receive_lowest_pn)(void *priv, struct receive_sa *sa);
3905281806Srpaulo
3906281806Srpaulo	/**
3907281806Srpaulo	 * create_receive_sc - create secure channel for receiving
3908281806Srpaulo	 * @priv: Private driver interface data
3909346981Scy	 * @sc: secure channel
3910281806Srpaulo	 * @conf_offset: confidentiality offset (0, 30, or 50)
3911281806Srpaulo	 * @validation: frame validation policy (0 = Disabled, 1 = Checked,
3912281806Srpaulo	 *	2 = Strict)
3913281806Srpaulo	 * Returns: 0 on success, -1 on failure (or if not supported)
3914281806Srpaulo	 */
3915346981Scy	int (*create_receive_sc)(void *priv, struct receive_sc *sc,
3916346981Scy				 unsigned int conf_offset,
3917281806Srpaulo				 int validation);
3918281806Srpaulo
3919281806Srpaulo	/**
3920281806Srpaulo	 * delete_receive_sc - delete secure connection for receiving
3921281806Srpaulo	 * @priv: private driver interface data from init()
3922346981Scy	 * @sc: secure channel
3923281806Srpaulo	 * Returns: 0 on success, -1 on failure
3924281806Srpaulo	 */
3925346981Scy	int (*delete_receive_sc)(void *priv, struct receive_sc *sc);
3926281806Srpaulo
3927281806Srpaulo	/**
3928281806Srpaulo	 * create_receive_sa - create secure association for receive
3929281806Srpaulo	 * @priv: private driver interface data from init()
3930346981Scy	 * @sa: secure association
3931281806Srpaulo	 * Returns: 0 on success, -1 on failure
3932281806Srpaulo	 */
3933346981Scy	int (*create_receive_sa)(void *priv, struct receive_sa *sa);
3934281806Srpaulo
3935281806Srpaulo	/**
3936346981Scy	 * delete_receive_sa - Delete secure association for receive
3937346981Scy	 * @priv: Private driver interface data from init()
3938346981Scy	 * @sa: Secure association
3939346981Scy	 * Returns: 0 on success, -1 on failure
3940346981Scy	 */
3941346981Scy	int (*delete_receive_sa)(void *priv, struct receive_sa *sa);
3942346981Scy
3943346981Scy	/**
3944281806Srpaulo	 * enable_receive_sa - enable the SA for receive
3945281806Srpaulo	 * @priv: private driver interface data from init()
3946346981Scy	 * @sa: secure association
3947281806Srpaulo	 * Returns: 0 on success, -1 on failure
3948281806Srpaulo	 */
3949346981Scy	int (*enable_receive_sa)(void *priv, struct receive_sa *sa);
3950281806Srpaulo
3951281806Srpaulo	/**
3952281806Srpaulo	 * disable_receive_sa - disable SA for receive
3953281806Srpaulo	 * @priv: private driver interface data from init()
3954346981Scy	 * @sa: secure association
3955281806Srpaulo	 * Returns: 0 on success, -1 on failure
3956281806Srpaulo	 */
3957346981Scy	int (*disable_receive_sa)(void *priv, struct receive_sa *sa);
3958281806Srpaulo
3959281806Srpaulo	/**
3960281806Srpaulo	 * create_transmit_sc - create secure connection for transmit
3961281806Srpaulo	 * @priv: private driver interface data from init()
3962346981Scy	 * @sc: secure channel
3963346981Scy	 * @conf_offset: confidentiality offset (0, 30, or 50)
3964281806Srpaulo	 * Returns: 0 on success, -1 on failure
3965281806Srpaulo	 */
3966346981Scy	int (*create_transmit_sc)(void *priv, struct transmit_sc *sc,
3967346981Scy				  unsigned int conf_offset);
3968281806Srpaulo
3969281806Srpaulo	/**
3970281806Srpaulo	 * delete_transmit_sc - delete secure connection for transmit
3971281806Srpaulo	 * @priv: private driver interface data from init()
3972346981Scy	 * @sc: secure channel
3973281806Srpaulo	 * Returns: 0 on success, -1 on failure
3974281806Srpaulo	 */
3975346981Scy	int (*delete_transmit_sc)(void *priv, struct transmit_sc *sc);
3976281806Srpaulo
3977281806Srpaulo	/**
3978281806Srpaulo	 * create_transmit_sa - create secure association for transmit
3979281806Srpaulo	 * @priv: private driver interface data from init()
3980346981Scy	 * @sa: secure association
3981281806Srpaulo	 * Returns: 0 on success, -1 on failure
3982281806Srpaulo	 */
3983346981Scy	int (*create_transmit_sa)(void *priv, struct transmit_sa *sa);
3984281806Srpaulo
3985281806Srpaulo	/**
3986346981Scy	 * delete_transmit_sa - Delete secure association for transmit
3987346981Scy	 * @priv: Private driver interface data from init()
3988346981Scy	 * @sa: Secure association
3989346981Scy	 * Returns: 0 on success, -1 on failure
3990346981Scy	 */
3991346981Scy	int (*delete_transmit_sa)(void *priv, struct transmit_sa *sa);
3992346981Scy
3993346981Scy	/**
3994281806Srpaulo	 * enable_transmit_sa - enable SA for transmit
3995281806Srpaulo	 * @priv: private driver interface data from init()
3996346981Scy	 * @sa: secure association
3997281806Srpaulo	 * Returns: 0 on success, -1 on failure
3998281806Srpaulo	 */
3999346981Scy	int (*enable_transmit_sa)(void *priv, struct transmit_sa *sa);
4000281806Srpaulo
4001281806Srpaulo	/**
4002281806Srpaulo	 * disable_transmit_sa - disable SA for transmit
4003281806Srpaulo	 * @priv: private driver interface data from init()
4004346981Scy	 * @sa: secure association
4005281806Srpaulo	 * Returns: 0 on success, -1 on failure
4006281806Srpaulo	 */
4007346981Scy	int (*disable_transmit_sa)(void *priv, struct transmit_sa *sa);
4008281806Srpaulo#endif /* CONFIG_MACSEC */
4009281806Srpaulo
4010281806Srpaulo	/**
4011281806Srpaulo	 * init_mesh - Driver specific initialization for mesh
4012281806Srpaulo	 * @priv: Private driver interface data
4013281806Srpaulo	 * Returns: 0 on success, -1 on failure
4014281806Srpaulo	 */
4015281806Srpaulo	int (*init_mesh)(void *priv);
4016281806Srpaulo
4017281806Srpaulo	/**
4018281806Srpaulo	 * join_mesh - Join a mesh network
4019281806Srpaulo	 * @priv: Private driver interface data
4020281806Srpaulo	 * @params: Mesh configuration parameters
4021281806Srpaulo	 * Returns: 0 on success, -1 on failure
4022281806Srpaulo	 */
4023281806Srpaulo	int (*join_mesh)(void *priv,
4024281806Srpaulo			 struct wpa_driver_mesh_join_params *params);
4025281806Srpaulo
4026281806Srpaulo	/**
4027281806Srpaulo	 * leave_mesh - Leave a mesh network
4028281806Srpaulo	 * @priv: Private driver interface data
4029281806Srpaulo	 * Returns 0 on success, -1 on failure
4030281806Srpaulo	 */
4031281806Srpaulo	int (*leave_mesh)(void *priv);
4032281806Srpaulo
4033281806Srpaulo	/**
4034351611Scy	 * probe_mesh_link - Inject a frame over direct mesh link to a given
4035351611Scy	 *	peer skipping the next_hop lookup from mpath table.
4036351611Scy	 * @priv: Private driver interface data
4037351611Scy	 * @addr: Peer MAC address
4038351611Scy	 * @eth: Ethernet frame to be sent
4039351611Scy	 * @len: Ethernet frame lengtn in bytes
4040351611Scy	 * Returns 0 on success, -1 on failure
4041351611Scy	 */
4042351611Scy	int (*probe_mesh_link)(void *priv, const u8 *addr, const u8 *eth,
4043351611Scy			       size_t len);
4044351611Scy
4045351611Scy	/**
4046281806Srpaulo	 * do_acs - Automatically select channel
4047281806Srpaulo	 * @priv: Private driver interface data
4048281806Srpaulo	 * @params: Parameters for ACS
4049281806Srpaulo	 * Returns 0 on success, -1 on failure
4050281806Srpaulo	 *
4051281806Srpaulo	 * This command can be used to offload ACS to the driver if the driver
4052281806Srpaulo	 * indicates support for such offloading (WPA_DRIVER_FLAGS_ACS_OFFLOAD).
4053281806Srpaulo	 */
4054281806Srpaulo	int (*do_acs)(void *priv, struct drv_acs_params *params);
4055289549Srpaulo
4056289549Srpaulo	/**
4057289549Srpaulo	 * set_band - Notify driver of band selection
4058289549Srpaulo	 * @priv: Private driver interface data
4059289549Srpaulo	 * @band: The selected band(s)
4060289549Srpaulo	 * Returns 0 on success, -1 on failure
4061289549Srpaulo	 */
4062289549Srpaulo	int (*set_band)(void *priv, enum set_band band);
4063289549Srpaulo
4064289549Srpaulo	/**
4065289549Srpaulo	 * get_pref_freq_list - Get preferred frequency list for an interface
4066289549Srpaulo	 * @priv: Private driver interface data
4067289549Srpaulo	 * @if_type: Interface type
4068289549Srpaulo	 * @num: Number of channels
4069289549Srpaulo	 * @freq_list: Preferred channel frequency list encoded in MHz values
4070289549Srpaulo	 * Returns 0 on success, -1 on failure
4071289549Srpaulo	 *
4072289549Srpaulo	 * This command can be used to query the preferred frequency list from
4073289549Srpaulo	 * the driver specific to a particular interface type.
4074289549Srpaulo	 */
4075289549Srpaulo	int (*get_pref_freq_list)(void *priv, enum wpa_driver_if_type if_type,
4076289549Srpaulo				  unsigned int *num, unsigned int *freq_list);
4077289549Srpaulo
4078289549Srpaulo	/**
4079289549Srpaulo	 * set_prob_oper_freq - Indicate probable P2P operating channel
4080289549Srpaulo	 * @priv: Private driver interface data
4081289549Srpaulo	 * @freq: Channel frequency in MHz
4082289549Srpaulo	 * Returns 0 on success, -1 on failure
4083289549Srpaulo	 *
4084289549Srpaulo	 * This command can be used to inform the driver of the operating
4085289549Srpaulo	 * frequency that an ongoing P2P group formation is likely to come up
4086289549Srpaulo	 * on. Local device is assuming P2P Client role.
4087289549Srpaulo	 */
4088289549Srpaulo	int (*set_prob_oper_freq)(void *priv, unsigned int freq);
4089337817Scy
4090337817Scy	/**
4091337817Scy	 * abort_scan - Request the driver to abort an ongoing scan
4092337817Scy	 * @priv: Private driver interface data
4093346981Scy	 * @scan_cookie: Cookie identifying the scan request. This is used only
4094346981Scy	 *	when the vendor interface QCA_NL80211_VENDOR_SUBCMD_TRIGGER_SCAN
4095346981Scy	 *	was used to trigger scan. Otherwise, 0 is used.
4096337817Scy	 * Returns 0 on success, -1 on failure
4097337817Scy	 */
4098346981Scy	int (*abort_scan)(void *priv, u64 scan_cookie);
4099337817Scy
4100337817Scy	/**
4101337817Scy	 * configure_data_frame_filters - Request to configure frame filters
4102337817Scy	 * @priv: Private driver interface data
4103337817Scy	 * @filter_flags: The type of frames to filter (bitfield of
4104337817Scy	 * WPA_DATA_FRAME_FILTER_FLAG_*)
4105337817Scy	 * Returns: 0 on success or -1 on failure
4106337817Scy	 */
4107337817Scy	int (*configure_data_frame_filters)(void *priv, u32 filter_flags);
4108337817Scy
4109337817Scy	/**
4110337817Scy	 * get_ext_capab - Get extended capabilities for the specified interface
4111337817Scy	 * @priv: Private driver interface data
4112337817Scy	 * @type: Interface type for which to get extended capabilities
4113337817Scy	 * @ext_capab: Extended capabilities fetched
4114337817Scy	 * @ext_capab_mask: Extended capabilities mask
4115337817Scy	 * @ext_capab_len: Length of the extended capabilities
4116337817Scy	 * Returns: 0 on success or -1 on failure
4117337817Scy	 */
4118337817Scy	int (*get_ext_capab)(void *priv, enum wpa_driver_if_type type,
4119337817Scy			     const u8 **ext_capab, const u8 **ext_capab_mask,
4120337817Scy			     unsigned int *ext_capab_len);
4121337817Scy
4122337817Scy	/**
4123337817Scy	 * p2p_lo_start - Start offloading P2P listen to device
4124337817Scy	 * @priv: Private driver interface data
4125337817Scy	 * @freq: Listening frequency (MHz) for P2P listen
4126337817Scy	 * @period: Length of the listen operation in milliseconds
4127337817Scy	 * @interval: Interval for running the listen operation in milliseconds
4128337817Scy	 * @count: Number of times to run the listen operation
4129337817Scy	 * @device_types: Device primary and secondary types
4130337817Scy	 * @dev_types_len: Number of bytes for device_types
4131337817Scy	 * @ies: P2P IE and WSC IE for Probe Response frames
4132337817Scy	 * @ies_len: Length of ies in bytes
4133337817Scy	 * Returns: 0 on success or -1 on failure
4134337817Scy	 */
4135337817Scy	int (*p2p_lo_start)(void *priv, unsigned int freq,
4136337817Scy			    unsigned int period, unsigned int interval,
4137337817Scy			    unsigned int count,
4138337817Scy			    const u8 *device_types, size_t dev_types_len,
4139337817Scy			    const u8 *ies, size_t ies_len);
4140337817Scy
4141337817Scy	/**
4142337817Scy	 * p2p_lo_stop - Stop P2P listen offload
4143337817Scy	 * @priv: Private driver interface data
4144337817Scy	 * Returns: 0 on success or -1 on failure
4145337817Scy	 */
4146337817Scy	int (*p2p_lo_stop)(void *priv);
4147337817Scy
4148337817Scy	/**
4149337817Scy	 * set_default_scan_ies - Set default scan IEs
4150337817Scy	 * @priv: Private driver interface data
4151337817Scy	 * @ies: Scan default IEs buffer
4152337817Scy	 * @ies_len: Length of IEs in bytes
4153337817Scy	 * Returns: 0 on success or -1 on failure
4154337817Scy	 *
4155337817Scy	 * The driver can use these by default when there are no scan IEs coming
4156337817Scy	 * in the subsequent scan requests. Also in case of one or more of IEs
4157337817Scy	 * given in set_default_scan_ies() are missing in the subsequent scan
4158337817Scy	 * request, the driver should merge the missing scan IEs in the scan
4159337817Scy	 * request from the IEs set by set_default_scan_ies() in the Probe
4160337817Scy	 * Request frames sent.
4161337817Scy	 */
4162337817Scy	int (*set_default_scan_ies)(void *priv, const u8 *ies, size_t ies_len);
4163337817Scy
4164346981Scy	/**
4165346981Scy	 * set_tdls_mode - Set TDLS trigger mode to the host driver
4166346981Scy	 * @priv: Private driver interface data
4167346981Scy	 * @tdls_external_control: Represents if TDLS external trigger control
4168346981Scy	 *  mode is enabled/disabled.
4169346981Scy	 *
4170346981Scy	 * This optional callback can be used to configure the TDLS external
4171346981Scy	 * trigger control mode to the host driver.
4172346981Scy	 */
4173346981Scy	int (*set_tdls_mode)(void *priv, int tdls_external_control);
4174346981Scy
4175346981Scy	/**
4176346981Scy	 * get_bss_transition_status - Get candidate BSS's transition status
4177346981Scy	 * @priv: Private driver interface data
4178346981Scy	 * @params: Candidate BSS list
4179346981Scy	 *
4180346981Scy	 * Get the accept or reject reason code for a list of BSS transition
4181346981Scy	 * candidates.
4182346981Scy	 */
4183346981Scy	struct wpa_bss_candidate_info *
4184346981Scy	(*get_bss_transition_status)(void *priv,
4185346981Scy				     struct wpa_bss_trans_info *params);
4186346981Scy	/**
4187346981Scy	 * ignore_assoc_disallow - Configure driver to ignore assoc_disallow
4188346981Scy	 * @priv: Private driver interface data
4189346981Scy	 * @ignore_disallow: 0 to not ignore, 1 to ignore
4190346981Scy	 * Returns: 0 on success, -1 on failure
4191346981Scy	 */
4192346981Scy	int (*ignore_assoc_disallow)(void *priv, int ignore_disallow);
4193346981Scy
4194346981Scy	/**
4195346981Scy	 * set_bssid_blacklist - Set blacklist of BSSIDs to the driver
4196346981Scy	 * @priv: Private driver interface data
4197346981Scy	 * @num_bssid: Number of blacklist BSSIDs
4198346981Scy	 * @bssids: List of blacklisted BSSIDs
4199346981Scy	 */
4200346981Scy	int (*set_bssid_blacklist)(void *priv, unsigned int num_bssid,
4201346981Scy				   const u8 *bssid);
4202346981Scy
4203346981Scy	/**
4204346981Scy	 * update_connect_params - Update the connection parameters
4205346981Scy	 * @priv: Private driver interface data
4206346981Scy	 * @params: Association parameters
4207346981Scy	 * @mask: Bit mask indicating which parameters in @params have to be
4208346981Scy	 *	updated
4209346981Scy	 * Returns: 0 on success, -1 on failure
4210346981Scy	 *
4211346981Scy	 * Update the connection parameters when in connected state so that the
4212346981Scy	 * driver uses the updated parameters for subsequent roaming. This is
4213346981Scy	 * used only with drivers that implement internal BSS selection and
4214346981Scy	 * roaming.
4215346981Scy	 */
4216346981Scy	int (*update_connect_params)(
4217346981Scy		void *priv, struct wpa_driver_associate_params *params,
4218346981Scy		enum wpa_drv_update_connect_params_mask mask);
4219346981Scy
4220346981Scy	/**
4221346981Scy	 * send_external_auth_status - Indicate the status of external
4222346981Scy	 * authentication processing to the host driver.
4223346981Scy	 * @priv: Private driver interface data
4224346981Scy	 * @params: Status of authentication processing.
4225346981Scy	 * Returns: 0 on success, -1 on failure
4226346981Scy	 */
4227346981Scy	int (*send_external_auth_status)(void *priv,
4228346981Scy					 struct external_auth *params);
4229346981Scy
4230346981Scy	/**
4231346981Scy	 * set_4addr_mode - Set 4-address mode
4232346981Scy	 * @priv: Private driver interface data
4233346981Scy	 * @bridge_ifname: Bridge interface name
4234346981Scy	 * @val: 0 - disable 4addr mode, 1 - enable 4addr mode
4235346981Scy	 * Returns: 0 on success, < 0 on failure
4236346981Scy	 */
4237346981Scy	int (*set_4addr_mode)(void *priv, const char *bridge_ifname, int val);
4238351611Scy
4239351611Scy	/**
4240351611Scy	 * update_dh_ie - Update DH IE
4241351611Scy	 * @priv: Private driver interface data
4242351611Scy	 * @peer_mac: Peer MAC address
4243351611Scy	 * @reason_code: Reacon code
4244351611Scy	 * @ie: DH IE
4245351611Scy	 * @ie_len: DH IE length in bytes
4246351611Scy	 * Returns: 0 on success, -1 on failure
4247351611Scy	 *
4248351611Scy	 * This callback is used to let the driver know the DH processing result
4249351611Scy	 * and DH IE for a pending association.
4250351611Scy	 */
4251351611Scy	int (*update_dh_ie)(void *priv, const u8 *peer_mac, u16 reason_code,
4252351611Scy			    const u8 *ie, size_t ie_len);
4253189251Ssam};
4254189251Ssam
4255189251Ssam/**
4256189251Ssam * enum wpa_event_type - Event type for wpa_supplicant_event() calls
4257189251Ssam */
4258214734Srpauloenum wpa_event_type {
4259189251Ssam	/**
4260189251Ssam	 * EVENT_ASSOC - Association completed
4261189251Ssam	 *
4262189251Ssam	 * This event needs to be delivered when the driver completes IEEE
4263189251Ssam	 * 802.11 association or reassociation successfully.
4264189251Ssam	 * wpa_driver_ops::get_bssid() is expected to provide the current BSSID
4265189251Ssam	 * after this event has been generated. In addition, optional
4266189251Ssam	 * EVENT_ASSOCINFO may be generated just before EVENT_ASSOC to provide
4267189251Ssam	 * more information about the association. If the driver interface gets
4268189251Ssam	 * both of these events at the same time, it can also include the
4269189251Ssam	 * assoc_info data in EVENT_ASSOC call.
4270189251Ssam	 */
4271189251Ssam	EVENT_ASSOC,
4272189251Ssam
4273189251Ssam	/**
4274189251Ssam	 * EVENT_DISASSOC - Association lost
4275189251Ssam	 *
4276189251Ssam	 * This event should be called when association is lost either due to
4277189251Ssam	 * receiving deauthenticate or disassociate frame from the AP or when
4278214734Srpaulo	 * sending either of these frames to the current AP. If the driver
4279214734Srpaulo	 * supports separate deauthentication event, EVENT_DISASSOC should only
4280214734Srpaulo	 * be used for disassociation and EVENT_DEAUTH for deauthentication.
4281214734Srpaulo	 * In AP mode, union wpa_event_data::disassoc_info is required.
4282189251Ssam	 */
4283189251Ssam	EVENT_DISASSOC,
4284189251Ssam
4285189251Ssam	/**
4286189251Ssam	 * EVENT_MICHAEL_MIC_FAILURE - Michael MIC (TKIP) detected
4287189251Ssam	 *
4288189251Ssam	 * This event must be delivered when a Michael MIC error is detected by
4289189251Ssam	 * the local driver. Additional data for event processing is
4290189251Ssam	 * provided with union wpa_event_data::michael_mic_failure. This
4291189251Ssam	 * information is used to request new encyption key and to initiate
4292189251Ssam	 * TKIP countermeasures if needed.
4293189251Ssam	 */
4294189251Ssam	EVENT_MICHAEL_MIC_FAILURE,
4295189251Ssam
4296189251Ssam	/**
4297189251Ssam	 * EVENT_SCAN_RESULTS - Scan results available
4298189251Ssam	 *
4299189251Ssam	 * This event must be called whenever scan results are available to be
4300189251Ssam	 * fetched with struct wpa_driver_ops::get_scan_results(). This event
4301189251Ssam	 * is expected to be used some time after struct wpa_driver_ops::scan()
4302189251Ssam	 * is called. If the driver provides an unsolicited event when the scan
4303189251Ssam	 * has been completed, this event can be used to trigger
4304189251Ssam	 * EVENT_SCAN_RESULTS call. If such event is not available from the
4305189251Ssam	 * driver, the driver wrapper code is expected to use a registered
4306189251Ssam	 * timeout to generate EVENT_SCAN_RESULTS call after the time that the
4307214734Srpaulo	 * scan is expected to be completed. Optional information about
4308214734Srpaulo	 * completed scan can be provided with union wpa_event_data::scan_info.
4309189251Ssam	 */
4310189251Ssam	EVENT_SCAN_RESULTS,
4311189251Ssam
4312189251Ssam	/**
4313189251Ssam	 * EVENT_ASSOCINFO - Report optional extra information for association
4314189251Ssam	 *
4315189251Ssam	 * This event can be used to report extra association information for
4316189251Ssam	 * EVENT_ASSOC processing. This extra information includes IEs from
4317189251Ssam	 * association frames and Beacon/Probe Response frames in union
4318189251Ssam	 * wpa_event_data::assoc_info. EVENT_ASSOCINFO must be send just before
4319189251Ssam	 * EVENT_ASSOC. Alternatively, the driver interface can include
4320189251Ssam	 * assoc_info data in the EVENT_ASSOC call if it has all the
4321189251Ssam	 * information available at the same point.
4322189251Ssam	 */
4323189251Ssam	EVENT_ASSOCINFO,
4324189251Ssam
4325189251Ssam	/**
4326189251Ssam	 * EVENT_INTERFACE_STATUS - Report interface status changes
4327189251Ssam	 *
4328189251Ssam	 * This optional event can be used to report changes in interface
4329189251Ssam	 * status (interface added/removed) using union
4330189251Ssam	 * wpa_event_data::interface_status. This can be used to trigger
4331189251Ssam	 * wpa_supplicant to stop and re-start processing for the interface,
4332189251Ssam	 * e.g., when a cardbus card is ejected/inserted.
4333189251Ssam	 */
4334189251Ssam	EVENT_INTERFACE_STATUS,
4335189251Ssam
4336189251Ssam	/**
4337189251Ssam	 * EVENT_PMKID_CANDIDATE - Report a candidate AP for pre-authentication
4338189251Ssam	 *
4339189251Ssam	 * This event can be used to inform wpa_supplicant about candidates for
4340189251Ssam	 * RSN (WPA2) pre-authentication. If wpa_supplicant is not responsible
4341189251Ssam	 * for scan request (ap_scan=2 mode), this event is required for
4342189251Ssam	 * pre-authentication. If wpa_supplicant is performing scan request
4343189251Ssam	 * (ap_scan=1), this event is optional since scan results can be used
4344189251Ssam	 * to add pre-authentication candidates. union
4345189251Ssam	 * wpa_event_data::pmkid_candidate is used to report the BSSID of the
4346189251Ssam	 * candidate and priority of the candidate, e.g., based on the signal
4347189251Ssam	 * strength, in order to try to pre-authenticate first with candidates
4348189251Ssam	 * that are most likely targets for re-association.
4349189251Ssam	 *
4350189251Ssam	 * EVENT_PMKID_CANDIDATE can be called whenever the driver has updates
4351189251Ssam	 * on the candidate list. In addition, it can be called for the current
4352189251Ssam	 * AP and APs that have existing PMKSA cache entries. wpa_supplicant
4353189251Ssam	 * will automatically skip pre-authentication in cases where a valid
4354189251Ssam	 * PMKSA exists. When more than one candidate exists, this event should
4355189251Ssam	 * be generated once for each candidate.
4356189251Ssam	 *
4357189251Ssam	 * Driver will be notified about successful pre-authentication with
4358189251Ssam	 * struct wpa_driver_ops::add_pmkid() calls.
4359189251Ssam	 */
4360189251Ssam	EVENT_PMKID_CANDIDATE,
4361189251Ssam
4362189251Ssam	/**
4363252726Srpaulo	 * EVENT_TDLS - Request TDLS operation
4364252726Srpaulo	 *
4365252726Srpaulo	 * This event can be used to request a TDLS operation to be performed.
4366252726Srpaulo	 */
4367252726Srpaulo	EVENT_TDLS,
4368252726Srpaulo
4369252726Srpaulo	/**
4370189251Ssam	 * EVENT_FT_RESPONSE - Report FT (IEEE 802.11r) response IEs
4371189251Ssam	 *
4372189251Ssam	 * The driver is expected to report the received FT IEs from
4373189251Ssam	 * FT authentication sequence from the AP. The FT IEs are included in
4374189251Ssam	 * the extra information in union wpa_event_data::ft_ies.
4375189251Ssam	 */
4376214734Srpaulo	EVENT_FT_RESPONSE,
4377189251Ssam
4378214734Srpaulo	/**
4379214734Srpaulo	 * EVENT_IBSS_RSN_START - Request RSN authentication in IBSS
4380214734Srpaulo	 *
4381214734Srpaulo	 * The driver can use this event to inform wpa_supplicant about a STA
4382214734Srpaulo	 * in an IBSS with which protected frames could be exchanged. This
4383214734Srpaulo	 * event starts RSN authentication with the other STA to authenticate
4384214734Srpaulo	 * the STA and set up encryption keys with it.
4385214734Srpaulo	 */
4386214734Srpaulo	EVENT_IBSS_RSN_START,
4387189251Ssam
4388214734Srpaulo	/**
4389214734Srpaulo	 * EVENT_AUTH - Authentication result
4390214734Srpaulo	 *
4391214734Srpaulo	 * This event should be called when authentication attempt has been
4392214734Srpaulo	 * completed. This is only used if the driver supports separate
4393214734Srpaulo	 * authentication step (struct wpa_driver_ops::authenticate).
4394214734Srpaulo	 * Information about authentication result is included in
4395214734Srpaulo	 * union wpa_event_data::auth.
4396214734Srpaulo	 */
4397214734Srpaulo	EVENT_AUTH,
4398214734Srpaulo
4399214734Srpaulo	/**
4400214734Srpaulo	 * EVENT_DEAUTH - Authentication lost
4401214734Srpaulo	 *
4402214734Srpaulo	 * This event should be called when authentication is lost either due
4403214734Srpaulo	 * to receiving deauthenticate frame from the AP or when sending that
4404214734Srpaulo	 * frame to the current AP.
4405214734Srpaulo	 * In AP mode, union wpa_event_data::deauth_info is required.
4406214734Srpaulo	 */
4407214734Srpaulo	EVENT_DEAUTH,
4408214734Srpaulo
4409214734Srpaulo	/**
4410214734Srpaulo	 * EVENT_ASSOC_REJECT - Association rejected
4411214734Srpaulo	 *
4412214734Srpaulo	 * This event should be called when (re)association attempt has been
4413252726Srpaulo	 * rejected by the AP. Information about the association response is
4414214734Srpaulo	 * included in union wpa_event_data::assoc_reject.
4415214734Srpaulo	 */
4416214734Srpaulo	EVENT_ASSOC_REJECT,
4417214734Srpaulo
4418214734Srpaulo	/**
4419214734Srpaulo	 * EVENT_AUTH_TIMED_OUT - Authentication timed out
4420214734Srpaulo	 */
4421214734Srpaulo	EVENT_AUTH_TIMED_OUT,
4422214734Srpaulo
4423214734Srpaulo	/**
4424214734Srpaulo	 * EVENT_ASSOC_TIMED_OUT - Association timed out
4425214734Srpaulo	 */
4426214734Srpaulo	EVENT_ASSOC_TIMED_OUT,
4427214734Srpaulo
4428214734Srpaulo	/**
4429214734Srpaulo	 * EVENT_WPS_BUTTON_PUSHED - Report hardware push button press for WPS
4430214734Srpaulo	 */
4431214734Srpaulo	EVENT_WPS_BUTTON_PUSHED,
4432214734Srpaulo
4433214734Srpaulo	/**
4434214734Srpaulo	 * EVENT_TX_STATUS - Report TX status
4435214734Srpaulo	 */
4436214734Srpaulo	EVENT_TX_STATUS,
4437214734Srpaulo
4438214734Srpaulo	/**
4439214734Srpaulo	 * EVENT_RX_FROM_UNKNOWN - Report RX from unknown STA
4440214734Srpaulo	 */
4441214734Srpaulo	EVENT_RX_FROM_UNKNOWN,
4442214734Srpaulo
4443214734Srpaulo	/**
4444214734Srpaulo	 * EVENT_RX_MGMT - Report RX of a management frame
4445214734Srpaulo	 */
4446214734Srpaulo	EVENT_RX_MGMT,
4447214734Srpaulo
4448214734Srpaulo	/**
4449214734Srpaulo	 * EVENT_REMAIN_ON_CHANNEL - Remain-on-channel duration started
4450214734Srpaulo	 *
4451214734Srpaulo	 * This event is used to indicate when the driver has started the
4452214734Srpaulo	 * requested remain-on-channel duration. Information about the
4453214734Srpaulo	 * operation is included in union wpa_event_data::remain_on_channel.
4454214734Srpaulo	 */
4455214734Srpaulo	EVENT_REMAIN_ON_CHANNEL,
4456214734Srpaulo
4457214734Srpaulo	/**
4458214734Srpaulo	 * EVENT_CANCEL_REMAIN_ON_CHANNEL - Remain-on-channel timed out
4459214734Srpaulo	 *
4460214734Srpaulo	 * This event is used to indicate when the driver has completed
4461214734Srpaulo	 * remain-on-channel duration, i.e., may noot be available on the
4462214734Srpaulo	 * requested channel anymore. Information about the
4463214734Srpaulo	 * operation is included in union wpa_event_data::remain_on_channel.
4464214734Srpaulo	 */
4465214734Srpaulo	EVENT_CANCEL_REMAIN_ON_CHANNEL,
4466214734Srpaulo
4467214734Srpaulo	/**
4468214734Srpaulo	 * EVENT_RX_PROBE_REQ - Indicate received Probe Request frame
4469214734Srpaulo	 *
4470214734Srpaulo	 * This event is used to indicate when a Probe Request frame has been
4471214734Srpaulo	 * received. Information about the received frame is included in
4472214734Srpaulo	 * union wpa_event_data::rx_probe_req. The driver is required to report
4473214734Srpaulo	 * these events only after successfully completed probe_req_report()
4474214734Srpaulo	 * commands to request the events (i.e., report parameter is non-zero)
4475214734Srpaulo	 * in station mode. In AP mode, Probe Request frames should always be
4476214734Srpaulo	 * reported.
4477214734Srpaulo	 */
4478214734Srpaulo	EVENT_RX_PROBE_REQ,
4479214734Srpaulo
4480214734Srpaulo	/**
4481214734Srpaulo	 * EVENT_NEW_STA - New wired device noticed
4482214734Srpaulo	 *
4483214734Srpaulo	 * This event is used to indicate that a new device has been detected
4484214734Srpaulo	 * in a network that does not use association-like functionality (i.e.,
4485214734Srpaulo	 * mainly wired Ethernet). This can be used to start EAPOL
4486214734Srpaulo	 * authenticator when receiving a frame from a device. The address of
4487214734Srpaulo	 * the device is included in union wpa_event_data::new_sta.
4488214734Srpaulo	 */
4489214734Srpaulo	EVENT_NEW_STA,
4490214734Srpaulo
4491214734Srpaulo	/**
4492214734Srpaulo	 * EVENT_EAPOL_RX - Report received EAPOL frame
4493214734Srpaulo	 *
4494214734Srpaulo	 * When in AP mode with hostapd, this event is required to be used to
4495281806Srpaulo	 * deliver the receive EAPOL frames from the driver.
4496214734Srpaulo	 */
4497214734Srpaulo	EVENT_EAPOL_RX,
4498214734Srpaulo
4499214734Srpaulo	/**
4500214734Srpaulo	 * EVENT_SIGNAL_CHANGE - Indicate change in signal strength
4501214734Srpaulo	 *
4502214734Srpaulo	 * This event is used to indicate changes in the signal strength
4503214734Srpaulo	 * observed in frames received from the current AP if signal strength
4504214734Srpaulo	 * monitoring has been enabled with signal_monitor().
4505214734Srpaulo	 */
4506252726Srpaulo	EVENT_SIGNAL_CHANGE,
4507252726Srpaulo
4508252726Srpaulo	/**
4509252726Srpaulo	 * EVENT_INTERFACE_ENABLED - Notify that interface was enabled
4510252726Srpaulo	 *
4511252726Srpaulo	 * This event is used to indicate that the interface was enabled after
4512252726Srpaulo	 * having been previously disabled, e.g., due to rfkill.
4513252726Srpaulo	 */
4514252726Srpaulo	EVENT_INTERFACE_ENABLED,
4515252726Srpaulo
4516252726Srpaulo	/**
4517252726Srpaulo	 * EVENT_INTERFACE_DISABLED - Notify that interface was disabled
4518252726Srpaulo	 *
4519252726Srpaulo	 * This event is used to indicate that the interface was disabled,
4520252726Srpaulo	 * e.g., due to rfkill.
4521252726Srpaulo	 */
4522252726Srpaulo	EVENT_INTERFACE_DISABLED,
4523252726Srpaulo
4524252726Srpaulo	/**
4525252726Srpaulo	 * EVENT_CHANNEL_LIST_CHANGED - Channel list changed
4526252726Srpaulo	 *
4527252726Srpaulo	 * This event is used to indicate that the channel list has changed,
4528252726Srpaulo	 * e.g., because of a regulatory domain change triggered by scan
4529252726Srpaulo	 * results including an AP advertising a country code.
4530252726Srpaulo	 */
4531252726Srpaulo	EVENT_CHANNEL_LIST_CHANGED,
4532252726Srpaulo
4533252726Srpaulo	/**
4534252726Srpaulo	 * EVENT_INTERFACE_UNAVAILABLE - Notify that interface is unavailable
4535252726Srpaulo	 *
4536252726Srpaulo	 * This event is used to indicate that the driver cannot maintain this
4537252726Srpaulo	 * interface in its operation mode anymore. The most likely use for
4538252726Srpaulo	 * this is to indicate that AP mode operation is not available due to
4539252726Srpaulo	 * operating channel would need to be changed to a DFS channel when
4540252726Srpaulo	 * the driver does not support radar detection and another virtual
4541252726Srpaulo	 * interfaces caused the operating channel to change. Other similar
4542252726Srpaulo	 * resource conflicts could also trigger this for station mode
4543281806Srpaulo	 * interfaces. This event can be propagated when channel switching
4544281806Srpaulo	 * fails.
4545252726Srpaulo	 */
4546252726Srpaulo	EVENT_INTERFACE_UNAVAILABLE,
4547252726Srpaulo
4548252726Srpaulo	/**
4549252726Srpaulo	 * EVENT_BEST_CHANNEL
4550252726Srpaulo	 *
4551252726Srpaulo	 * Driver generates this event whenever it detects a better channel
4552252726Srpaulo	 * (e.g., based on RSSI or channel use). This information can be used
4553252726Srpaulo	 * to improve channel selection for a new AP/P2P group.
4554252726Srpaulo	 */
4555252726Srpaulo	EVENT_BEST_CHANNEL,
4556252726Srpaulo
4557252726Srpaulo	/**
4558252726Srpaulo	 * EVENT_UNPROT_DEAUTH - Unprotected Deauthentication frame received
4559252726Srpaulo	 *
4560252726Srpaulo	 * This event should be called when a Deauthentication frame is dropped
4561252726Srpaulo	 * due to it not being protected (MFP/IEEE 802.11w).
4562252726Srpaulo	 * union wpa_event_data::unprot_deauth is required to provide more
4563252726Srpaulo	 * details of the frame.
4564252726Srpaulo	 */
4565252726Srpaulo	EVENT_UNPROT_DEAUTH,
4566252726Srpaulo
4567252726Srpaulo	/**
4568252726Srpaulo	 * EVENT_UNPROT_DISASSOC - Unprotected Disassociation frame received
4569252726Srpaulo	 *
4570252726Srpaulo	 * This event should be called when a Disassociation frame is dropped
4571252726Srpaulo	 * due to it not being protected (MFP/IEEE 802.11w).
4572252726Srpaulo	 * union wpa_event_data::unprot_disassoc is required to provide more
4573252726Srpaulo	 * details of the frame.
4574252726Srpaulo	 */
4575252726Srpaulo	EVENT_UNPROT_DISASSOC,
4576252726Srpaulo
4577252726Srpaulo	/**
4578252726Srpaulo	 * EVENT_STATION_LOW_ACK
4579252726Srpaulo	 *
4580252726Srpaulo	 * Driver generates this event whenever it detected that a particular
4581252726Srpaulo	 * station was lost. Detection can be through massive transmission
4582252726Srpaulo	 * failures for example.
4583252726Srpaulo	 */
4584252726Srpaulo	EVENT_STATION_LOW_ACK,
4585252726Srpaulo
4586252726Srpaulo	/**
4587252726Srpaulo	 * EVENT_IBSS_PEER_LOST - IBSS peer not reachable anymore
4588252726Srpaulo	 */
4589252726Srpaulo	EVENT_IBSS_PEER_LOST,
4590252726Srpaulo
4591252726Srpaulo	/**
4592252726Srpaulo	 * EVENT_DRIVER_GTK_REKEY - Device/driver did GTK rekey
4593252726Srpaulo	 *
4594252726Srpaulo	 * This event carries the new replay counter to notify wpa_supplicant
4595252726Srpaulo	 * of the current EAPOL-Key Replay Counter in case the driver/firmware
4596252726Srpaulo	 * completed Group Key Handshake while the host (including
4597252726Srpaulo	 * wpa_supplicant was sleeping).
4598252726Srpaulo	 */
4599252726Srpaulo	EVENT_DRIVER_GTK_REKEY,
4600252726Srpaulo
4601252726Srpaulo	/**
4602252726Srpaulo	 * EVENT_SCHED_SCAN_STOPPED - Scheduled scan was stopped
4603252726Srpaulo	 */
4604252726Srpaulo	EVENT_SCHED_SCAN_STOPPED,
4605252726Srpaulo
4606252726Srpaulo	/**
4607252726Srpaulo	 * EVENT_DRIVER_CLIENT_POLL_OK - Station responded to poll
4608252726Srpaulo	 *
4609252726Srpaulo	 * This event indicates that the station responded to the poll
4610252726Srpaulo	 * initiated with @poll_client.
4611252726Srpaulo	 */
4612252726Srpaulo	EVENT_DRIVER_CLIENT_POLL_OK,
4613252726Srpaulo
4614252726Srpaulo	/**
4615252726Srpaulo	 * EVENT_EAPOL_TX_STATUS - notify of EAPOL TX status
4616252726Srpaulo	 */
4617252726Srpaulo	EVENT_EAPOL_TX_STATUS,
4618252726Srpaulo
4619252726Srpaulo	/**
4620252726Srpaulo	 * EVENT_CH_SWITCH - AP or GO decided to switch channels
4621252726Srpaulo	 *
4622252726Srpaulo	 * Described in wpa_event_data.ch_switch
4623252726Srpaulo	 * */
4624252726Srpaulo	EVENT_CH_SWITCH,
4625252726Srpaulo
4626252726Srpaulo	/**
4627351611Scy	 * EVENT_CH_SWITCH_STARTED - AP or GO started to switch channels
4628351611Scy	 *
4629351611Scy	 * This is a pre-switch event indicating the shortly following switch
4630351611Scy	 * of operating channels.
4631351611Scy	 *
4632351611Scy	 * Described in wpa_event_data.ch_switch
4633351611Scy	 */
4634351611Scy	EVENT_CH_SWITCH_STARTED,
4635351611Scy	/**
4636252726Srpaulo	 * EVENT_WNM - Request WNM operation
4637252726Srpaulo	 *
4638252726Srpaulo	 * This event can be used to request a WNM operation to be performed.
4639252726Srpaulo	 */
4640281806Srpaulo	EVENT_WNM,
4641281806Srpaulo
4642281806Srpaulo	/**
4643281806Srpaulo	 * EVENT_CONNECT_FAILED_REASON - Connection failure reason in AP mode
4644281806Srpaulo	 *
4645281806Srpaulo	 * This event indicates that the driver reported a connection failure
4646281806Srpaulo	 * with the specified client (for example, max client reached, etc.) in
4647281806Srpaulo	 * AP mode.
4648281806Srpaulo	 */
4649281806Srpaulo	EVENT_CONNECT_FAILED_REASON,
4650281806Srpaulo
4651281806Srpaulo	/**
4652281806Srpaulo	 * EVENT_DFS_RADAR_DETECTED - Notify of radar detection
4653281806Srpaulo	 *
4654281806Srpaulo	 * A radar has been detected on the supplied frequency, hostapd should
4655281806Srpaulo	 * react accordingly (e.g., change channel).
4656281806Srpaulo	 */
4657281806Srpaulo	EVENT_DFS_RADAR_DETECTED,
4658281806Srpaulo
4659281806Srpaulo	/**
4660281806Srpaulo	 * EVENT_DFS_CAC_FINISHED - Notify that channel availability check has been completed
4661281806Srpaulo	 *
4662281806Srpaulo	 * After a successful CAC, the channel can be marked clear and used.
4663281806Srpaulo	 */
4664281806Srpaulo	EVENT_DFS_CAC_FINISHED,
4665281806Srpaulo
4666281806Srpaulo	/**
4667281806Srpaulo	 * EVENT_DFS_CAC_ABORTED - Notify that channel availability check has been aborted
4668281806Srpaulo	 *
4669281806Srpaulo	 * The CAC was not successful, and the channel remains in the previous
4670346981Scy	 * state. This may happen due to a radar being detected or other
4671281806Srpaulo	 * external influences.
4672281806Srpaulo	 */
4673281806Srpaulo	EVENT_DFS_CAC_ABORTED,
4674281806Srpaulo
4675281806Srpaulo	/**
4676281806Srpaulo	 * EVENT_DFS_NOP_FINISHED - Notify that non-occupancy period is over
4677281806Srpaulo	 *
4678281806Srpaulo	 * The channel which was previously unavailable is now available again.
4679281806Srpaulo	 */
4680281806Srpaulo	EVENT_DFS_NOP_FINISHED,
4681281806Srpaulo
4682281806Srpaulo	/**
4683281806Srpaulo	 * EVENT_SURVEY - Received survey data
4684281806Srpaulo	 *
4685281806Srpaulo	 * This event gets triggered when a driver query is issued for survey
4686281806Srpaulo	 * data and the requested data becomes available. The returned data is
4687281806Srpaulo	 * stored in struct survey_results. The results provide at most one
4688281806Srpaulo	 * survey entry for each frequency and at minimum will provide one
4689281806Srpaulo	 * survey entry for one frequency. The survey data can be os_malloc()'d
4690281806Srpaulo	 * and then os_free()'d, so the event callback must only copy data.
4691281806Srpaulo	 */
4692281806Srpaulo	EVENT_SURVEY,
4693281806Srpaulo
4694281806Srpaulo	/**
4695281806Srpaulo	 * EVENT_SCAN_STARTED - Scan started
4696281806Srpaulo	 *
4697281806Srpaulo	 * This indicates that driver has started a scan operation either based
4698281806Srpaulo	 * on a request from wpa_supplicant/hostapd or from another application.
4699281806Srpaulo	 * EVENT_SCAN_RESULTS is used to indicate when the scan has been
4700281806Srpaulo	 * completed (either successfully or by getting cancelled).
4701281806Srpaulo	 */
4702281806Srpaulo	EVENT_SCAN_STARTED,
4703281806Srpaulo
4704281806Srpaulo	/**
4705281806Srpaulo	 * EVENT_AVOID_FREQUENCIES - Received avoid frequency range
4706281806Srpaulo	 *
4707281806Srpaulo	 * This event indicates a set of frequency ranges that should be avoided
4708281806Srpaulo	 * to reduce issues due to interference or internal co-existence
4709281806Srpaulo	 * information in the driver.
4710281806Srpaulo	 */
4711281806Srpaulo	EVENT_AVOID_FREQUENCIES,
4712281806Srpaulo
4713281806Srpaulo	/**
4714281806Srpaulo	 * EVENT_NEW_PEER_CANDIDATE - new (unknown) mesh peer notification
4715281806Srpaulo	 */
4716281806Srpaulo	EVENT_NEW_PEER_CANDIDATE,
4717281806Srpaulo
4718281806Srpaulo	/**
4719281806Srpaulo	 * EVENT_ACS_CHANNEL_SELECTED - Received selected channels by ACS
4720281806Srpaulo	 *
4721281806Srpaulo	 * Indicates a pair of primary and secondary channels chosen by ACS
4722281806Srpaulo	 * in device.
4723281806Srpaulo	 */
4724281806Srpaulo	EVENT_ACS_CHANNEL_SELECTED,
4725281806Srpaulo
4726281806Srpaulo	/**
4727281806Srpaulo	 * EVENT_DFS_CAC_STARTED - Notify that channel availability check has
4728281806Srpaulo	 * been started.
4729281806Srpaulo	 *
4730281806Srpaulo	 * This event indicates that channel availability check has been started
4731281806Srpaulo	 * on a DFS frequency by a driver that supports DFS Offload.
4732281806Srpaulo	 */
4733281806Srpaulo	EVENT_DFS_CAC_STARTED,
4734337817Scy
4735337817Scy	/**
4736337817Scy	 * EVENT_P2P_LO_STOP - Notify that P2P listen offload is stopped
4737337817Scy	 */
4738337817Scy	EVENT_P2P_LO_STOP,
4739346981Scy
4740346981Scy	/**
4741346981Scy	 * EVENT_BEACON_LOSS - Beacon loss detected
4742346981Scy	 *
4743346981Scy	 * This event indicates that no Beacon frames has been received from
4744346981Scy	 * the current AP. This may indicate that the AP is not anymore in
4745346981Scy	 * range.
4746346981Scy	 */
4747346981Scy	EVENT_BEACON_LOSS,
4748346981Scy
4749346981Scy	/**
4750346981Scy	 * EVENT_DFS_PRE_CAC_EXPIRED - Notify that channel availability check
4751346981Scy	 * done previously (Pre-CAC) on the channel has expired. This would
4752346981Scy	 * normally be on a non-ETSI DFS regulatory domain. DFS state of the
4753346981Scy	 * channel will be moved from available to usable. A new CAC has to be
4754346981Scy	 * performed before start operating on this channel.
4755346981Scy	 */
4756346981Scy	EVENT_DFS_PRE_CAC_EXPIRED,
4757346981Scy
4758346981Scy	/**
4759346981Scy	 * EVENT_EXTERNAL_AUTH - This event interface is used by host drivers
4760346981Scy	 * that do not define separate commands for authentication and
4761346981Scy	 * association (~WPA_DRIVER_FLAGS_SME) but offload the 802.11
4762346981Scy	 * authentication to wpa_supplicant. This event carries all the
4763346981Scy	 * necessary information from the host driver for the authentication to
4764346981Scy	 * happen.
4765346981Scy	 */
4766346981Scy	EVENT_EXTERNAL_AUTH,
4767346981Scy
4768346981Scy	/**
4769346981Scy	 * EVENT_PORT_AUTHORIZED - Notification that a connection is authorized
4770346981Scy	 *
4771346981Scy	 * This event should be indicated when the driver completes the 4-way
4772346981Scy	 * handshake. This event should be preceded by an EVENT_ASSOC that
4773346981Scy	 * indicates the completion of IEEE 802.11 association.
4774346981Scy	 */
4775346981Scy	EVENT_PORT_AUTHORIZED,
4776346981Scy
4777346981Scy	/**
4778346981Scy	 * EVENT_STATION_OPMODE_CHANGED - Notify STA's HT/VHT operation mode
4779346981Scy	 * change event.
4780346981Scy	 */
4781346981Scy	EVENT_STATION_OPMODE_CHANGED,
4782346981Scy
4783346981Scy	/**
4784346981Scy	 * EVENT_INTERFACE_MAC_CHANGED - Notify that interface MAC changed
4785346981Scy	 *
4786346981Scy	 * This event is emitted when the MAC changes while the interface is
4787346981Scy	 * enabled. When an interface was disabled and becomes enabled, it
4788346981Scy	 * must be always assumed that the MAC possibly changed.
4789346981Scy	 */
4790346981Scy	EVENT_INTERFACE_MAC_CHANGED,
4791346981Scy
4792346981Scy	/**
4793346981Scy	 * EVENT_WDS_STA_INTERFACE_STATUS - Notify WDS STA interface status
4794346981Scy	 *
4795346981Scy	 * This event is emitted when an interface is added/removed for WDS STA.
4796346981Scy	 */
4797346981Scy	EVENT_WDS_STA_INTERFACE_STATUS,
4798351611Scy
4799351611Scy	/**
4800351611Scy	  * EVENT_UPDATE_DH - Notification of updated DH information
4801351611Scy	  */
4802351611Scy	EVENT_UPDATE_DH,
4803214734Srpaulo};
4804214734Srpaulo
4805214734Srpaulo
4806189251Ssam/**
4807281806Srpaulo * struct freq_survey - Channel survey info
4808281806Srpaulo *
4809281806Srpaulo * @ifidx: Interface index in which this survey was observed
4810281806Srpaulo * @freq: Center of frequency of the surveyed channel
4811281806Srpaulo * @nf: Channel noise floor in dBm
4812281806Srpaulo * @channel_time: Amount of time in ms the radio spent on the channel
4813281806Srpaulo * @channel_time_busy: Amount of time in ms the radio detected some signal
4814281806Srpaulo *     that indicated to the radio the channel was not clear
4815281806Srpaulo * @channel_time_rx: Amount of time the radio spent receiving data
4816281806Srpaulo * @channel_time_tx: Amount of time the radio spent transmitting data
4817281806Srpaulo * @filled: bitmask indicating which fields have been reported, see
4818281806Srpaulo *     SURVEY_HAS_* defines.
4819281806Srpaulo * @list: Internal list pointers
4820281806Srpaulo */
4821281806Srpaulostruct freq_survey {
4822281806Srpaulo	u32 ifidx;
4823281806Srpaulo	unsigned int freq;
4824281806Srpaulo	s8 nf;
4825281806Srpaulo	u64 channel_time;
4826281806Srpaulo	u64 channel_time_busy;
4827281806Srpaulo	u64 channel_time_rx;
4828281806Srpaulo	u64 channel_time_tx;
4829281806Srpaulo	unsigned int filled;
4830281806Srpaulo	struct dl_list list;
4831281806Srpaulo};
4832281806Srpaulo
4833281806Srpaulo#define SURVEY_HAS_NF BIT(0)
4834281806Srpaulo#define SURVEY_HAS_CHAN_TIME BIT(1)
4835281806Srpaulo#define SURVEY_HAS_CHAN_TIME_BUSY BIT(2)
4836281806Srpaulo#define SURVEY_HAS_CHAN_TIME_RX BIT(3)
4837281806Srpaulo#define SURVEY_HAS_CHAN_TIME_TX BIT(4)
4838281806Srpaulo
4839281806Srpaulo
4840281806Srpaulo/**
4841189251Ssam * union wpa_event_data - Additional data for wpa_supplicant_event() calls
4842189251Ssam */
4843189251Ssamunion wpa_event_data {
4844189251Ssam	/**
4845189251Ssam	 * struct assoc_info - Data for EVENT_ASSOC and EVENT_ASSOCINFO events
4846189251Ssam	 *
4847189251Ssam	 * This structure is optional for EVENT_ASSOC calls and required for
4848189251Ssam	 * EVENT_ASSOCINFO calls. By using EVENT_ASSOC with this data, the
4849189251Ssam	 * driver interface does not need to generate separate EVENT_ASSOCINFO
4850189251Ssam	 * calls.
4851189251Ssam	 */
4852189251Ssam	struct assoc_info {
4853189251Ssam		/**
4854252726Srpaulo		 * reassoc - Flag to indicate association or reassociation
4855252726Srpaulo		 */
4856252726Srpaulo		int reassoc;
4857252726Srpaulo
4858252726Srpaulo		/**
4859189251Ssam		 * req_ies - (Re)Association Request IEs
4860189251Ssam		 *
4861189251Ssam		 * If the driver generates WPA/RSN IE, this event data must be
4862189251Ssam		 * returned for WPA handshake to have needed information. If
4863189251Ssam		 * wpa_supplicant-generated WPA/RSN IE is used, this
4864189251Ssam		 * information event is optional.
4865189251Ssam		 *
4866189251Ssam		 * This should start with the first IE (fixed fields before IEs
4867189251Ssam		 * are not included).
4868189251Ssam		 */
4869214734Srpaulo		const u8 *req_ies;
4870189251Ssam
4871189251Ssam		/**
4872189251Ssam		 * req_ies_len - Length of req_ies in bytes
4873189251Ssam		 */
4874189251Ssam		size_t req_ies_len;
4875189251Ssam
4876189251Ssam		/**
4877189251Ssam		 * resp_ies - (Re)Association Response IEs
4878189251Ssam		 *
4879189251Ssam		 * Optional association data from the driver. This data is not
4880189251Ssam		 * required WPA, but may be useful for some protocols and as
4881189251Ssam		 * such, should be reported if this is available to the driver
4882189251Ssam		 * interface.
4883189251Ssam		 *
4884189251Ssam		 * This should start with the first IE (fixed fields before IEs
4885189251Ssam		 * are not included).
4886189251Ssam		 */
4887214734Srpaulo		const u8 *resp_ies;
4888189251Ssam
4889189251Ssam		/**
4890189251Ssam		 * resp_ies_len - Length of resp_ies in bytes
4891189251Ssam		 */
4892189251Ssam		size_t resp_ies_len;
4893189251Ssam
4894189251Ssam		/**
4895346981Scy		 * resp_frame - (Re)Association Response frame
4896346981Scy		 */
4897346981Scy		const u8 *resp_frame;
4898346981Scy
4899346981Scy		/**
4900346981Scy		 * resp_frame_len - (Re)Association Response frame length
4901346981Scy		 */
4902346981Scy		size_t resp_frame_len;
4903346981Scy
4904346981Scy		/**
4905189251Ssam		 * beacon_ies - Beacon or Probe Response IEs
4906189251Ssam		 *
4907189251Ssam		 * Optional Beacon/ProbeResp data: IEs included in Beacon or
4908189251Ssam		 * Probe Response frames from the current AP (i.e., the one
4909189251Ssam		 * that the client just associated with). This information is
4910189251Ssam		 * used to update WPA/RSN IE for the AP. If this field is not
4911189251Ssam		 * set, the results from previous scan will be used. If no
4912189251Ssam		 * data for the new AP is found, scan results will be requested
4913189251Ssam		 * again (without scan request). At this point, the driver is
4914189251Ssam		 * expected to provide WPA/RSN IE for the AP (if WPA/WPA2 is
4915189251Ssam		 * used).
4916189251Ssam		 *
4917189251Ssam		 * This should start with the first IE (fixed fields before IEs
4918189251Ssam		 * are not included).
4919189251Ssam		 */
4920214734Srpaulo		const u8 *beacon_ies;
4921189251Ssam
4922189251Ssam		/**
4923189251Ssam		 * beacon_ies_len - Length of beacon_ies */
4924189251Ssam		size_t beacon_ies_len;
4925214734Srpaulo
4926214734Srpaulo		/**
4927214734Srpaulo		 * freq - Frequency of the operational channel in MHz
4928214734Srpaulo		 */
4929214734Srpaulo		unsigned int freq;
4930214734Srpaulo
4931214734Srpaulo		/**
4932281806Srpaulo		 * wmm_params - WMM parameters used in this association.
4933281806Srpaulo		 */
4934281806Srpaulo		struct wmm_params wmm_params;
4935281806Srpaulo
4936281806Srpaulo		/**
4937214734Srpaulo		 * addr - Station address (for AP mode)
4938214734Srpaulo		 */
4939214734Srpaulo		const u8 *addr;
4940281806Srpaulo
4941281806Srpaulo		/**
4942281806Srpaulo		 * The following is the key management offload information
4943281806Srpaulo		 * @authorized
4944281806Srpaulo		 * @key_replay_ctr
4945281806Srpaulo		 * @key_replay_ctr_len
4946281806Srpaulo		 * @ptk_kck
4947281806Srpaulo		 * @ptk_kek_len
4948281806Srpaulo		 * @ptk_kek
4949281806Srpaulo		 * @ptk_kek_len
4950281806Srpaulo		 */
4951281806Srpaulo
4952281806Srpaulo		/**
4953281806Srpaulo		 * authorized - Status of key management offload,
4954281806Srpaulo		 * 1 = successful
4955281806Srpaulo		 */
4956281806Srpaulo		int authorized;
4957281806Srpaulo
4958281806Srpaulo		/**
4959281806Srpaulo		 * key_replay_ctr - Key replay counter value last used
4960281806Srpaulo		 * in a valid EAPOL-Key frame
4961281806Srpaulo		 */
4962281806Srpaulo		const u8 *key_replay_ctr;
4963281806Srpaulo
4964281806Srpaulo		/**
4965281806Srpaulo		 * key_replay_ctr_len - The length of key_replay_ctr
4966281806Srpaulo		 */
4967281806Srpaulo		size_t key_replay_ctr_len;
4968281806Srpaulo
4969281806Srpaulo		/**
4970281806Srpaulo		 * ptk_kck - The derived PTK KCK
4971281806Srpaulo		 */
4972281806Srpaulo		const u8 *ptk_kck;
4973281806Srpaulo
4974281806Srpaulo		/**
4975281806Srpaulo		 * ptk_kek_len - The length of ptk_kck
4976281806Srpaulo		 */
4977281806Srpaulo		size_t ptk_kck_len;
4978281806Srpaulo
4979281806Srpaulo		/**
4980281806Srpaulo		 * ptk_kek - The derived PTK KEK
4981346981Scy		 * This is used in key management offload and also in FILS SK
4982346981Scy		 * offload.
4983281806Srpaulo		 */
4984281806Srpaulo		const u8 *ptk_kek;
4985281806Srpaulo
4986281806Srpaulo		/**
4987281806Srpaulo		 * ptk_kek_len - The length of ptk_kek
4988281806Srpaulo		 */
4989281806Srpaulo		size_t ptk_kek_len;
4990337817Scy
4991337817Scy		/**
4992337817Scy		 * subnet_status - The subnet status:
4993337817Scy		 * 0 = unknown, 1 = unchanged, 2 = changed
4994337817Scy		 */
4995337817Scy		u8 subnet_status;
4996346981Scy
4997346981Scy		/**
4998346981Scy		 * The following information is used in FILS SK offload
4999346981Scy		 * @fils_erp_next_seq_num
5000346981Scy		 * @fils_pmk
5001346981Scy		 * @fils_pmk_len
5002346981Scy		 * @fils_pmkid
5003346981Scy		 */
5004346981Scy
5005346981Scy		/**
5006346981Scy		 * fils_erp_next_seq_num - The next sequence number to use in
5007346981Scy		 * FILS ERP messages
5008346981Scy		 */
5009346981Scy		u16 fils_erp_next_seq_num;
5010346981Scy
5011346981Scy		/**
5012346981Scy		 * fils_pmk - A new PMK if generated in case of FILS
5013346981Scy		 * authentication
5014346981Scy		 */
5015346981Scy		const u8 *fils_pmk;
5016346981Scy
5017346981Scy		/**
5018346981Scy		 * fils_pmk_len - Length of fils_pmk
5019346981Scy		 */
5020346981Scy		size_t fils_pmk_len;
5021346981Scy
5022346981Scy		/**
5023346981Scy		 * fils_pmkid - PMKID used or generated in FILS authentication
5024346981Scy		 */
5025346981Scy		const u8 *fils_pmkid;
5026189251Ssam	} assoc_info;
5027189251Ssam
5028189251Ssam	/**
5029214734Srpaulo	 * struct disassoc_info - Data for EVENT_DISASSOC events
5030214734Srpaulo	 */
5031214734Srpaulo	struct disassoc_info {
5032214734Srpaulo		/**
5033214734Srpaulo		 * addr - Station address (for AP mode)
5034214734Srpaulo		 */
5035214734Srpaulo		const u8 *addr;
5036214734Srpaulo
5037214734Srpaulo		/**
5038214734Srpaulo		 * reason_code - Reason Code (host byte order) used in
5039214734Srpaulo		 *	Deauthentication frame
5040214734Srpaulo		 */
5041214734Srpaulo		u16 reason_code;
5042252726Srpaulo
5043252726Srpaulo		/**
5044252726Srpaulo		 * ie - Optional IE(s) in Disassociation frame
5045252726Srpaulo		 */
5046252726Srpaulo		const u8 *ie;
5047252726Srpaulo
5048252726Srpaulo		/**
5049252726Srpaulo		 * ie_len - Length of ie buffer in octets
5050252726Srpaulo		 */
5051252726Srpaulo		size_t ie_len;
5052252726Srpaulo
5053252726Srpaulo		/**
5054252726Srpaulo		 * locally_generated - Whether the frame was locally generated
5055252726Srpaulo		 */
5056252726Srpaulo		int locally_generated;
5057214734Srpaulo	} disassoc_info;
5058214734Srpaulo
5059214734Srpaulo	/**
5060214734Srpaulo	 * struct deauth_info - Data for EVENT_DEAUTH events
5061214734Srpaulo	 */
5062214734Srpaulo	struct deauth_info {
5063214734Srpaulo		/**
5064214734Srpaulo		 * addr - Station address (for AP mode)
5065214734Srpaulo		 */
5066214734Srpaulo		const u8 *addr;
5067214734Srpaulo
5068214734Srpaulo		/**
5069214734Srpaulo		 * reason_code - Reason Code (host byte order) used in
5070214734Srpaulo		 *	Deauthentication frame
5071214734Srpaulo		 */
5072214734Srpaulo		u16 reason_code;
5073252726Srpaulo
5074252726Srpaulo		/**
5075252726Srpaulo		 * ie - Optional IE(s) in Deauthentication frame
5076252726Srpaulo		 */
5077252726Srpaulo		const u8 *ie;
5078252726Srpaulo
5079252726Srpaulo		/**
5080252726Srpaulo		 * ie_len - Length of ie buffer in octets
5081252726Srpaulo		 */
5082252726Srpaulo		size_t ie_len;
5083252726Srpaulo
5084252726Srpaulo		/**
5085252726Srpaulo		 * locally_generated - Whether the frame was locally generated
5086252726Srpaulo		 */
5087252726Srpaulo		int locally_generated;
5088214734Srpaulo	} deauth_info;
5089214734Srpaulo
5090214734Srpaulo	/**
5091189251Ssam	 * struct michael_mic_failure - Data for EVENT_MICHAEL_MIC_FAILURE
5092189251Ssam	 */
5093189251Ssam	struct michael_mic_failure {
5094189251Ssam		int unicast;
5095214734Srpaulo		const u8 *src;
5096189251Ssam	} michael_mic_failure;
5097189251Ssam
5098189251Ssam	/**
5099189251Ssam	 * struct interface_status - Data for EVENT_INTERFACE_STATUS
5100189251Ssam	 */
5101189251Ssam	struct interface_status {
5102337817Scy		unsigned int ifindex;
5103189251Ssam		char ifname[100];
5104189251Ssam		enum {
5105189251Ssam			EVENT_INTERFACE_ADDED, EVENT_INTERFACE_REMOVED
5106189251Ssam		} ievent;
5107189251Ssam	} interface_status;
5108189251Ssam
5109189251Ssam	/**
5110189251Ssam	 * struct pmkid_candidate - Data for EVENT_PMKID_CANDIDATE
5111189251Ssam	 */
5112189251Ssam	struct pmkid_candidate {
5113189251Ssam		/** BSSID of the PMKID candidate */
5114189251Ssam		u8 bssid[ETH_ALEN];
5115189251Ssam		/** Smaller the index, higher the priority */
5116189251Ssam		int index;
5117189251Ssam		/** Whether RSN IE includes pre-authenticate flag */
5118189251Ssam		int preauth;
5119189251Ssam	} pmkid_candidate;
5120189251Ssam
5121189251Ssam	/**
5122252726Srpaulo	 * struct tdls - Data for EVENT_TDLS
5123252726Srpaulo	 */
5124252726Srpaulo	struct tdls {
5125252726Srpaulo		u8 peer[ETH_ALEN];
5126252726Srpaulo		enum {
5127252726Srpaulo			TDLS_REQUEST_SETUP,
5128281806Srpaulo			TDLS_REQUEST_TEARDOWN,
5129281806Srpaulo			TDLS_REQUEST_DISCOVER,
5130252726Srpaulo		} oper;
5131252726Srpaulo		u16 reason_code; /* for teardown */
5132252726Srpaulo	} tdls;
5133252726Srpaulo
5134252726Srpaulo	/**
5135252726Srpaulo	 * struct wnm - Data for EVENT_WNM
5136252726Srpaulo	 */
5137252726Srpaulo	struct wnm {
5138252726Srpaulo		u8 addr[ETH_ALEN];
5139252726Srpaulo		enum {
5140252726Srpaulo			WNM_OPER_SLEEP,
5141252726Srpaulo		} oper;
5142252726Srpaulo		enum {
5143252726Srpaulo			WNM_SLEEP_ENTER,
5144252726Srpaulo			WNM_SLEEP_EXIT
5145252726Srpaulo		} sleep_action;
5146252726Srpaulo		int sleep_intval;
5147252726Srpaulo		u16 reason_code;
5148252726Srpaulo		u8 *buf;
5149252726Srpaulo		u16 buf_len;
5150252726Srpaulo	} wnm;
5151252726Srpaulo
5152252726Srpaulo	/**
5153189251Ssam	 * struct ft_ies - FT information elements (EVENT_FT_RESPONSE)
5154189251Ssam	 *
5155189251Ssam	 * During FT (IEEE 802.11r) authentication sequence, the driver is
5156189251Ssam	 * expected to use this event to report received FT IEs (MDIE, FTIE,
5157189251Ssam	 * RSN IE, TIE, possible resource request) to the supplicant. The FT
5158189251Ssam	 * IEs for the next message will be delivered through the
5159189251Ssam	 * struct wpa_driver_ops::update_ft_ies() callback.
5160189251Ssam	 */
5161189251Ssam	struct ft_ies {
5162189251Ssam		const u8 *ies;
5163189251Ssam		size_t ies_len;
5164189251Ssam		int ft_action;
5165189251Ssam		u8 target_ap[ETH_ALEN];
5166214734Srpaulo		/** Optional IE(s), e.g., WMM TSPEC(s), for RIC-Request */
5167214734Srpaulo		const u8 *ric_ies;
5168214734Srpaulo		/** Length of ric_ies buffer in octets */
5169214734Srpaulo		size_t ric_ies_len;
5170189251Ssam	} ft_ies;
5171214734Srpaulo
5172214734Srpaulo	/**
5173214734Srpaulo	 * struct ibss_rsn_start - Data for EVENT_IBSS_RSN_START
5174214734Srpaulo	 */
5175214734Srpaulo	struct ibss_rsn_start {
5176214734Srpaulo		u8 peer[ETH_ALEN];
5177214734Srpaulo	} ibss_rsn_start;
5178214734Srpaulo
5179214734Srpaulo	/**
5180214734Srpaulo	 * struct auth_info - Data for EVENT_AUTH events
5181214734Srpaulo	 */
5182214734Srpaulo	struct auth_info {
5183214734Srpaulo		u8 peer[ETH_ALEN];
5184252726Srpaulo		u8 bssid[ETH_ALEN];
5185214734Srpaulo		u16 auth_type;
5186252726Srpaulo		u16 auth_transaction;
5187214734Srpaulo		u16 status_code;
5188214734Srpaulo		const u8 *ies;
5189214734Srpaulo		size_t ies_len;
5190214734Srpaulo	} auth;
5191214734Srpaulo
5192214734Srpaulo	/**
5193214734Srpaulo	 * struct assoc_reject - Data for EVENT_ASSOC_REJECT events
5194214734Srpaulo	 */
5195214734Srpaulo	struct assoc_reject {
5196214734Srpaulo		/**
5197252726Srpaulo		 * bssid - BSSID of the AP that rejected association
5198252726Srpaulo		 */
5199252726Srpaulo		const u8 *bssid;
5200252726Srpaulo
5201252726Srpaulo		/**
5202214734Srpaulo		 * resp_ies - (Re)Association Response IEs
5203214734Srpaulo		 *
5204214734Srpaulo		 * Optional association data from the driver. This data is not
5205214734Srpaulo		 * required WPA, but may be useful for some protocols and as
5206214734Srpaulo		 * such, should be reported if this is available to the driver
5207214734Srpaulo		 * interface.
5208214734Srpaulo		 *
5209214734Srpaulo		 * This should start with the first IE (fixed fields before IEs
5210214734Srpaulo		 * are not included).
5211214734Srpaulo		 */
5212252726Srpaulo		const u8 *resp_ies;
5213214734Srpaulo
5214214734Srpaulo		/**
5215214734Srpaulo		 * resp_ies_len - Length of resp_ies in bytes
5216214734Srpaulo		 */
5217214734Srpaulo		size_t resp_ies_len;
5218214734Srpaulo
5219214734Srpaulo		/**
5220214734Srpaulo		 * status_code - Status Code from (Re)association Response
5221214734Srpaulo		 */
5222214734Srpaulo		u16 status_code;
5223337817Scy
5224337817Scy		/**
5225337817Scy		 * timed_out - Whether failure is due to timeout (etc.) rather
5226337817Scy		 * than explicit rejection response from the AP.
5227337817Scy		 */
5228337817Scy		int timed_out;
5229346981Scy
5230346981Scy		/**
5231346981Scy		 * timeout_reason - Reason for the timeout
5232346981Scy		 */
5233346981Scy		const char *timeout_reason;
5234346981Scy
5235346981Scy		/**
5236346981Scy		 * fils_erp_next_seq_num - The next sequence number to use in
5237346981Scy		 * FILS ERP messages
5238346981Scy		 */
5239346981Scy		u16 fils_erp_next_seq_num;
5240214734Srpaulo	} assoc_reject;
5241214734Srpaulo
5242214734Srpaulo	struct timeout_event {
5243214734Srpaulo		u8 addr[ETH_ALEN];
5244214734Srpaulo	} timeout_event;
5245214734Srpaulo
5246214734Srpaulo	/**
5247214734Srpaulo	 * struct tx_status - Data for EVENT_TX_STATUS events
5248214734Srpaulo	 */
5249214734Srpaulo	struct tx_status {
5250214734Srpaulo		u16 type;
5251214734Srpaulo		u16 stype;
5252214734Srpaulo		const u8 *dst;
5253214734Srpaulo		const u8 *data;
5254214734Srpaulo		size_t data_len;
5255214734Srpaulo		int ack;
5256214734Srpaulo	} tx_status;
5257214734Srpaulo
5258214734Srpaulo	/**
5259214734Srpaulo	 * struct rx_from_unknown - Data for EVENT_RX_FROM_UNKNOWN events
5260214734Srpaulo	 */
5261214734Srpaulo	struct rx_from_unknown {
5262252726Srpaulo		const u8 *bssid;
5263252726Srpaulo		const u8 *addr;
5264252726Srpaulo		int wds;
5265214734Srpaulo	} rx_from_unknown;
5266214734Srpaulo
5267214734Srpaulo	/**
5268214734Srpaulo	 * struct rx_mgmt - Data for EVENT_RX_MGMT events
5269214734Srpaulo	 */
5270214734Srpaulo	struct rx_mgmt {
5271214734Srpaulo		const u8 *frame;
5272214734Srpaulo		size_t frame_len;
5273214734Srpaulo		u32 datarate;
5274214734Srpaulo
5275214734Srpaulo		/**
5276281806Srpaulo		 * drv_priv - Pointer to store driver private BSS information
5277281806Srpaulo		 *
5278281806Srpaulo		 * If not set to NULL, this is used for comparison with
5279281806Srpaulo		 * hostapd_data->drv_priv to determine which BSS should process
5280281806Srpaulo		 * the frame.
5281214734Srpaulo		 */
5282281806Srpaulo		void *drv_priv;
5283214734Srpaulo
5284214734Srpaulo		/**
5285281806Srpaulo		 * freq - Frequency (in MHz) on which the frame was received
5286214734Srpaulo		 */
5287281806Srpaulo		int freq;
5288214734Srpaulo
5289214734Srpaulo		/**
5290281806Srpaulo		 * ssi_signal - Signal strength in dBm (or 0 if not available)
5291214734Srpaulo		 */
5292281806Srpaulo		int ssi_signal;
5293281806Srpaulo	} rx_mgmt;
5294214734Srpaulo
5295214734Srpaulo	/**
5296214734Srpaulo	 * struct remain_on_channel - Data for EVENT_REMAIN_ON_CHANNEL events
5297214734Srpaulo	 *
5298214734Srpaulo	 * This is also used with EVENT_CANCEL_REMAIN_ON_CHANNEL events.
5299214734Srpaulo	 */
5300214734Srpaulo	struct remain_on_channel {
5301214734Srpaulo		/**
5302214734Srpaulo		 * freq - Channel frequency in MHz
5303214734Srpaulo		 */
5304214734Srpaulo		unsigned int freq;
5305214734Srpaulo
5306214734Srpaulo		/**
5307214734Srpaulo		 * duration - Duration to remain on the channel in milliseconds
5308214734Srpaulo		 */
5309214734Srpaulo		unsigned int duration;
5310214734Srpaulo	} remain_on_channel;
5311214734Srpaulo
5312214734Srpaulo	/**
5313214734Srpaulo	 * struct scan_info - Optional data for EVENT_SCAN_RESULTS events
5314214734Srpaulo	 * @aborted: Whether the scan was aborted
5315214734Srpaulo	 * @freqs: Scanned frequencies in MHz (%NULL = all channels scanned)
5316214734Srpaulo	 * @num_freqs: Number of entries in freqs array
5317214734Srpaulo	 * @ssids: Scanned SSIDs (%NULL or zero-length SSID indicates wildcard
5318214734Srpaulo	 *	SSID)
5319214734Srpaulo	 * @num_ssids: Number of entries in ssids array
5320337817Scy	 * @external_scan: Whether the scan info is for an external scan
5321337817Scy	 * @nl_scan_event: 1 if the source of this scan event is a normal scan,
5322337817Scy	 * 	0 if the source of the scan event is a vendor scan
5323346981Scy	 * @scan_start_tsf: Time when the scan started in terms of TSF of the
5324346981Scy	 *	BSS that the interface that requested the scan is connected to
5325346981Scy	 *	(if available).
5326346981Scy	 * @scan_start_tsf_bssid: The BSSID according to which %scan_start_tsf
5327346981Scy	 *	is set.
5328214734Srpaulo	 */
5329214734Srpaulo	struct scan_info {
5330214734Srpaulo		int aborted;
5331214734Srpaulo		const int *freqs;
5332214734Srpaulo		size_t num_freqs;
5333214734Srpaulo		struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS];
5334214734Srpaulo		size_t num_ssids;
5335337817Scy		int external_scan;
5336337817Scy		int nl_scan_event;
5337346981Scy		u64 scan_start_tsf;
5338346981Scy		u8 scan_start_tsf_bssid[ETH_ALEN];
5339214734Srpaulo	} scan_info;
5340214734Srpaulo
5341214734Srpaulo	/**
5342214734Srpaulo	 * struct rx_probe_req - Data for EVENT_RX_PROBE_REQ events
5343214734Srpaulo	 */
5344214734Srpaulo	struct rx_probe_req {
5345214734Srpaulo		/**
5346214734Srpaulo		 * sa - Source address of the received Probe Request frame
5347214734Srpaulo		 */
5348214734Srpaulo		const u8 *sa;
5349214734Srpaulo
5350214734Srpaulo		/**
5351252726Srpaulo		 * da - Destination address of the received Probe Request frame
5352252726Srpaulo		 *	or %NULL if not available
5353252726Srpaulo		 */
5354252726Srpaulo		const u8 *da;
5355252726Srpaulo
5356252726Srpaulo		/**
5357252726Srpaulo		 * bssid - BSSID of the received Probe Request frame or %NULL
5358252726Srpaulo		 *	if not available
5359252726Srpaulo		 */
5360252726Srpaulo		const u8 *bssid;
5361252726Srpaulo
5362252726Srpaulo		/**
5363214734Srpaulo		 * ie - IEs from the Probe Request body
5364214734Srpaulo		 */
5365214734Srpaulo		const u8 *ie;
5366214734Srpaulo
5367214734Srpaulo		/**
5368214734Srpaulo		 * ie_len - Length of ie buffer in octets
5369214734Srpaulo		 */
5370214734Srpaulo		size_t ie_len;
5371252726Srpaulo
5372252726Srpaulo		/**
5373252726Srpaulo		 * signal - signal strength in dBm (or 0 if not available)
5374252726Srpaulo		 */
5375252726Srpaulo		int ssi_signal;
5376214734Srpaulo	} rx_probe_req;
5377214734Srpaulo
5378214734Srpaulo	/**
5379214734Srpaulo	 * struct new_sta - Data for EVENT_NEW_STA events
5380214734Srpaulo	 */
5381214734Srpaulo	struct new_sta {
5382214734Srpaulo		const u8 *addr;
5383214734Srpaulo	} new_sta;
5384214734Srpaulo
5385214734Srpaulo	/**
5386214734Srpaulo	 * struct eapol_rx - Data for EVENT_EAPOL_RX events
5387214734Srpaulo	 */
5388214734Srpaulo	struct eapol_rx {
5389214734Srpaulo		const u8 *src;
5390214734Srpaulo		const u8 *data;
5391214734Srpaulo		size_t data_len;
5392214734Srpaulo	} eapol_rx;
5393214734Srpaulo
5394214734Srpaulo	/**
5395252726Srpaulo	 * signal_change - Data for EVENT_SIGNAL_CHANGE events
5396214734Srpaulo	 */
5397252726Srpaulo	struct wpa_signal_info signal_change;
5398252726Srpaulo
5399252726Srpaulo	/**
5400252726Srpaulo	 * struct best_channel - Data for EVENT_BEST_CHANNEL events
5401252726Srpaulo	 * @freq_24: Best 2.4 GHz band channel frequency in MHz
5402252726Srpaulo	 * @freq_5: Best 5 GHz band channel frequency in MHz
5403252726Srpaulo	 * @freq_overall: Best channel frequency in MHz
5404252726Srpaulo	 *
5405252726Srpaulo	 * 0 can be used to indicate no preference in either band.
5406252726Srpaulo	 */
5407252726Srpaulo	struct best_channel {
5408252726Srpaulo		int freq_24;
5409252726Srpaulo		int freq_5;
5410252726Srpaulo		int freq_overall;
5411252726Srpaulo	} best_chan;
5412252726Srpaulo
5413252726Srpaulo	struct unprot_deauth {
5414252726Srpaulo		const u8 *sa;
5415252726Srpaulo		const u8 *da;
5416252726Srpaulo		u16 reason_code;
5417252726Srpaulo	} unprot_deauth;
5418252726Srpaulo
5419252726Srpaulo	struct unprot_disassoc {
5420252726Srpaulo		const u8 *sa;
5421252726Srpaulo		const u8 *da;
5422252726Srpaulo		u16 reason_code;
5423252726Srpaulo	} unprot_disassoc;
5424252726Srpaulo
5425252726Srpaulo	/**
5426252726Srpaulo	 * struct low_ack - Data for EVENT_STATION_LOW_ACK events
5427252726Srpaulo	 * @addr: station address
5428346981Scy	 * @num_packets: Number of packets lost (consecutive packets not
5429346981Scy	 * acknowledged)
5430252726Srpaulo	 */
5431252726Srpaulo	struct low_ack {
5432252726Srpaulo		u8 addr[ETH_ALEN];
5433346981Scy		u32 num_packets;
5434252726Srpaulo	} low_ack;
5435252726Srpaulo
5436252726Srpaulo	/**
5437252726Srpaulo	 * struct ibss_peer_lost - Data for EVENT_IBSS_PEER_LOST
5438252726Srpaulo	 */
5439252726Srpaulo	struct ibss_peer_lost {
5440252726Srpaulo		u8 peer[ETH_ALEN];
5441252726Srpaulo	} ibss_peer_lost;
5442252726Srpaulo
5443252726Srpaulo	/**
5444252726Srpaulo	 * struct driver_gtk_rekey - Data for EVENT_DRIVER_GTK_REKEY
5445252726Srpaulo	 */
5446252726Srpaulo	struct driver_gtk_rekey {
5447252726Srpaulo		const u8 *bssid;
5448252726Srpaulo		const u8 *replay_ctr;
5449252726Srpaulo	} driver_gtk_rekey;
5450252726Srpaulo
5451252726Srpaulo	/**
5452252726Srpaulo	 * struct client_poll - Data for EVENT_DRIVER_CLIENT_POLL_OK events
5453252726Srpaulo	 * @addr: station address
5454252726Srpaulo	 */
5455252726Srpaulo	struct client_poll {
5456252726Srpaulo		u8 addr[ETH_ALEN];
5457252726Srpaulo	} client_poll;
5458252726Srpaulo
5459252726Srpaulo	/**
5460252726Srpaulo	 * struct eapol_tx_status
5461252726Srpaulo	 * @dst: Original destination
5462252726Srpaulo	 * @data: Data starting with IEEE 802.1X header (!)
5463252726Srpaulo	 * @data_len: Length of data
5464252726Srpaulo	 * @ack: Indicates ack or lost frame
5465252726Srpaulo	 *
5466252726Srpaulo	 * This corresponds to hapd_send_eapol if the frame sent
5467252726Srpaulo	 * there isn't just reported as EVENT_TX_STATUS.
5468252726Srpaulo	 */
5469252726Srpaulo	struct eapol_tx_status {
5470252726Srpaulo		const u8 *dst;
5471252726Srpaulo		const u8 *data;
5472252726Srpaulo		int data_len;
5473252726Srpaulo		int ack;
5474252726Srpaulo	} eapol_tx_status;
5475252726Srpaulo
5476252726Srpaulo	/**
5477252726Srpaulo	 * struct ch_switch
5478252726Srpaulo	 * @freq: Frequency of new channel in MHz
5479252726Srpaulo	 * @ht_enabled: Whether this is an HT channel
5480252726Srpaulo	 * @ch_offset: Secondary channel offset
5481281806Srpaulo	 * @ch_width: Channel width
5482281806Srpaulo	 * @cf1: Center frequency 1
5483281806Srpaulo	 * @cf2: Center frequency 2
5484252726Srpaulo	 */
5485252726Srpaulo	struct ch_switch {
5486252726Srpaulo		int freq;
5487252726Srpaulo		int ht_enabled;
5488252726Srpaulo		int ch_offset;
5489281806Srpaulo		enum chan_width ch_width;
5490281806Srpaulo		int cf1;
5491281806Srpaulo		int cf2;
5492252726Srpaulo	} ch_switch;
5493281806Srpaulo
5494281806Srpaulo	/**
5495281806Srpaulo	 * struct connect_failed - Data for EVENT_CONNECT_FAILED_REASON
5496281806Srpaulo	 * @addr: Remote client address
5497281806Srpaulo	 * @code: Reason code for connection failure
5498281806Srpaulo	 */
5499281806Srpaulo	struct connect_failed_reason {
5500281806Srpaulo		u8 addr[ETH_ALEN];
5501281806Srpaulo		enum {
5502281806Srpaulo			MAX_CLIENT_REACHED,
5503281806Srpaulo			BLOCKED_CLIENT
5504281806Srpaulo		} code;
5505281806Srpaulo	} connect_failed_reason;
5506281806Srpaulo
5507281806Srpaulo	/**
5508281806Srpaulo	 * struct dfs_event - Data for radar detected events
5509281806Srpaulo	 * @freq: Frequency of the channel in MHz
5510281806Srpaulo	 */
5511281806Srpaulo	struct dfs_event {
5512281806Srpaulo		int freq;
5513281806Srpaulo		int ht_enabled;
5514281806Srpaulo		int chan_offset;
5515281806Srpaulo		enum chan_width chan_width;
5516281806Srpaulo		int cf1;
5517281806Srpaulo		int cf2;
5518281806Srpaulo	} dfs_event;
5519281806Srpaulo
5520281806Srpaulo	/**
5521281806Srpaulo	 * survey_results - Survey result data for EVENT_SURVEY
5522281806Srpaulo	 * @freq_filter: Requested frequency survey filter, 0 if request
5523281806Srpaulo	 *	was for all survey data
5524281806Srpaulo	 * @survey_list: Linked list of survey data (struct freq_survey)
5525281806Srpaulo	 */
5526281806Srpaulo	struct survey_results {
5527281806Srpaulo		unsigned int freq_filter;
5528281806Srpaulo		struct dl_list survey_list; /* struct freq_survey */
5529281806Srpaulo	} survey_results;
5530281806Srpaulo
5531281806Srpaulo	/**
5532281806Srpaulo	 * channel_list_changed - Data for EVENT_CHANNEL_LIST_CHANGED
5533281806Srpaulo	 * @initiator: Initiator of the regulatory change
5534281806Srpaulo	 * @type: Regulatory change type
5535281806Srpaulo	 * @alpha2: Country code (or "" if not available)
5536281806Srpaulo	 */
5537281806Srpaulo	struct channel_list_changed {
5538281806Srpaulo		enum reg_change_initiator initiator;
5539281806Srpaulo		enum reg_type type;
5540281806Srpaulo		char alpha2[3];
5541281806Srpaulo	} channel_list_changed;
5542281806Srpaulo
5543281806Srpaulo	/**
5544281806Srpaulo	 * freq_range - List of frequency ranges
5545281806Srpaulo	 *
5546281806Srpaulo	 * This is used as the data with EVENT_AVOID_FREQUENCIES.
5547281806Srpaulo	 */
5548281806Srpaulo	struct wpa_freq_range_list freq_range;
5549281806Srpaulo
5550281806Srpaulo	/**
5551281806Srpaulo	 * struct mesh_peer
5552281806Srpaulo	 *
5553281806Srpaulo	 * @peer: Peer address
5554281806Srpaulo	 * @ies: Beacon IEs
5555281806Srpaulo	 * @ie_len: Length of @ies
5556281806Srpaulo	 *
5557281806Srpaulo	 * Notification of new candidate mesh peer.
5558281806Srpaulo	 */
5559281806Srpaulo	struct mesh_peer {
5560281806Srpaulo		const u8 *peer;
5561281806Srpaulo		const u8 *ies;
5562281806Srpaulo		size_t ie_len;
5563281806Srpaulo	} mesh_peer;
5564281806Srpaulo
5565281806Srpaulo	/**
5566281806Srpaulo	 * struct acs_selected_channels - Data for EVENT_ACS_CHANNEL_SELECTED
5567281806Srpaulo	 * @pri_channel: Selected primary channel
5568281806Srpaulo	 * @sec_channel: Selected secondary channel
5569289549Srpaulo	 * @vht_seg0_center_ch: VHT mode Segment0 center channel
5570289549Srpaulo	 * @vht_seg1_center_ch: VHT mode Segment1 center channel
5571289549Srpaulo	 * @ch_width: Selected Channel width by driver. Driver may choose to
5572289549Srpaulo	 *	change hostapd configured ACS channel width due driver internal
5573289549Srpaulo	 *	channel restrictions.
5574289549Srpaulo	 * hw_mode: Selected band (used with hw_mode=any)
5575281806Srpaulo	 */
5576281806Srpaulo	struct acs_selected_channels {
5577281806Srpaulo		u8 pri_channel;
5578281806Srpaulo		u8 sec_channel;
5579289549Srpaulo		u8 vht_seg0_center_ch;
5580289549Srpaulo		u8 vht_seg1_center_ch;
5581289549Srpaulo		u16 ch_width;
5582289549Srpaulo		enum hostapd_hw_mode hw_mode;
5583281806Srpaulo	} acs_selected_channels;
5584337817Scy
5585337817Scy	/**
5586337817Scy	 * struct p2p_lo_stop - Reason code for P2P Listen offload stop event
5587337817Scy	 * @reason_code: Reason for stopping offload
5588337817Scy	 *	P2P_LO_STOPPED_REASON_COMPLETE: Listen offload finished as
5589337817Scy	 *	scheduled.
5590337817Scy	 *	P2P_LO_STOPPED_REASON_RECV_STOP_CMD: Host requested offload to
5591337817Scy	 *	be stopped.
5592337817Scy	 *	P2P_LO_STOPPED_REASON_INVALID_PARAM: Invalid listen offload
5593337817Scy	 *	parameters.
5594337817Scy	 *	P2P_LO_STOPPED_REASON_NOT_SUPPORTED: Listen offload not
5595337817Scy	 *	supported by device.
5596337817Scy	 */
5597337817Scy	struct p2p_lo_stop {
5598337817Scy		enum {
5599337817Scy			P2P_LO_STOPPED_REASON_COMPLETE = 0,
5600337817Scy			P2P_LO_STOPPED_REASON_RECV_STOP_CMD,
5601337817Scy			P2P_LO_STOPPED_REASON_INVALID_PARAM,
5602337817Scy			P2P_LO_STOPPED_REASON_NOT_SUPPORTED,
5603337817Scy		} reason_code;
5604337817Scy	} p2p_lo_stop;
5605346981Scy
5606346981Scy	/* For EVENT_EXTERNAL_AUTH */
5607346981Scy	struct external_auth external_auth;
5608346981Scy
5609346981Scy	/**
5610346981Scy	 * struct sta_opmode - Station's operation mode change event
5611346981Scy	 * @addr: The station MAC address
5612346981Scy	 * @smps_mode: SMPS mode of the station
5613346981Scy	 * @chan_width: Channel width of the station
5614346981Scy	 * @rx_nss: RX_NSS of the station
5615346981Scy	 *
5616346981Scy	 * This is used as data with EVENT_STATION_OPMODE_CHANGED.
5617346981Scy	 */
5618346981Scy	struct sta_opmode {
5619346981Scy		const u8 *addr;
5620346981Scy		enum smps_mode smps_mode;
5621346981Scy		enum chan_width chan_width;
5622346981Scy		u8 rx_nss;
5623346981Scy	} sta_opmode;
5624346981Scy
5625346981Scy	/**
5626346981Scy	 * struct wds_sta_interface - Data for EVENT_WDS_STA_INTERFACE_STATUS.
5627346981Scy	 */
5628346981Scy	struct wds_sta_interface {
5629346981Scy		const u8 *sta_addr;
5630346981Scy		const char *ifname;
5631346981Scy		enum {
5632346981Scy			INTERFACE_ADDED,
5633346981Scy			INTERFACE_REMOVED
5634346981Scy		} istatus;
5635346981Scy	} wds_sta_interface;
5636351611Scy
5637351611Scy	/**
5638351611Scy	 * struct update_dh - Data for EVENT_UPDATE_DH
5639351611Scy	 */
5640351611Scy	struct update_dh {
5641351611Scy		const u8 *peer;
5642351611Scy		const u8 *ie;
5643351611Scy		size_t ie_len;
5644351611Scy	} update_dh;
5645189251Ssam};
5646189251Ssam
5647189251Ssam/**
5648189251Ssam * wpa_supplicant_event - Report a driver event for wpa_supplicant
5649189251Ssam * @ctx: Context pointer (wpa_s); this is the ctx variable registered
5650189251Ssam *	with struct wpa_driver_ops::init()
5651189251Ssam * @event: event type (defined above)
5652189251Ssam * @data: possible extra data for the event
5653189251Ssam *
5654189251Ssam * Driver wrapper code should call this function whenever an event is received
5655189251Ssam * from the driver.
5656189251Ssam */
5657214734Srpaulovoid wpa_supplicant_event(void *ctx, enum wpa_event_type event,
5658189251Ssam			  union wpa_event_data *data);
5659189251Ssam
5660337817Scy/**
5661337817Scy * wpa_supplicant_event_global - Report a driver event for wpa_supplicant
5662337817Scy * @ctx: Context pointer (wpa_s); this is the ctx variable registered
5663337817Scy *	with struct wpa_driver_ops::init()
5664337817Scy * @event: event type (defined above)
5665337817Scy * @data: possible extra data for the event
5666337817Scy *
5667337817Scy * Same as wpa_supplicant_event(), but we search for the interface in
5668337817Scy * wpa_global.
5669337817Scy */
5670337817Scyvoid wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
5671337817Scy				 union wpa_event_data *data);
5672214734Srpaulo
5673214734Srpaulo/*
5674214734Srpaulo * The following inline functions are provided for convenience to simplify
5675214734Srpaulo * event indication for some of the common events.
5676189251Ssam */
5677189251Ssam
5678214734Srpaulostatic inline void drv_event_assoc(void *ctx, const u8 *addr, const u8 *ie,
5679252726Srpaulo				   size_t ielen, int reassoc)
5680214734Srpaulo{
5681214734Srpaulo	union wpa_event_data event;
5682214734Srpaulo	os_memset(&event, 0, sizeof(event));
5683252726Srpaulo	event.assoc_info.reassoc = reassoc;
5684214734Srpaulo	event.assoc_info.req_ies = ie;
5685214734Srpaulo	event.assoc_info.req_ies_len = ielen;
5686214734Srpaulo	event.assoc_info.addr = addr;
5687214734Srpaulo	wpa_supplicant_event(ctx, EVENT_ASSOC, &event);
5688214734Srpaulo}
5689189251Ssam
5690214734Srpaulostatic inline void drv_event_disassoc(void *ctx, const u8 *addr)
5691214734Srpaulo{
5692214734Srpaulo	union wpa_event_data event;
5693214734Srpaulo	os_memset(&event, 0, sizeof(event));
5694214734Srpaulo	event.disassoc_info.addr = addr;
5695214734Srpaulo	wpa_supplicant_event(ctx, EVENT_DISASSOC, &event);
5696214734Srpaulo}
5697189251Ssam
5698214734Srpaulostatic inline void drv_event_eapol_rx(void *ctx, const u8 *src, const u8 *data,
5699214734Srpaulo				      size_t data_len)
5700214734Srpaulo{
5701214734Srpaulo	union wpa_event_data event;
5702214734Srpaulo	os_memset(&event, 0, sizeof(event));
5703214734Srpaulo	event.eapol_rx.src = src;
5704214734Srpaulo	event.eapol_rx.data = data;
5705214734Srpaulo	event.eapol_rx.data_len = data_len;
5706214734Srpaulo	wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event);
5707214734Srpaulo}
5708214734Srpaulo
5709252726Srpaulo/* driver_common.c */
5710252726Srpaulovoid wpa_scan_results_free(struct wpa_scan_results *res);
5711252726Srpaulo
5712252726Srpaulo/* Convert wpa_event_type to a string for logging */
5713252726Srpauloconst char * event_to_string(enum wpa_event_type event);
5714252726Srpaulo
5715281806Srpaulo/* Convert chan_width to a string for logging and control interfaces */
5716281806Srpauloconst char * channel_width_to_string(enum chan_width width);
5717281806Srpaulo
5718346981Scyint channel_width_to_int(enum chan_width width);
5719346981Scy
5720281806Srpauloint ht_supported(const struct hostapd_hw_modes *mode);
5721281806Srpauloint vht_supported(const struct hostapd_hw_modes *mode);
5722281806Srpaulo
5723281806Srpaulostruct wowlan_triggers *
5724281806Srpaulowpa_get_wowlan_triggers(const char *wowlan_triggers,
5725281806Srpaulo			const struct wpa_driver_capa *capa);
5726337817Scy/* Convert driver flag to string */
5727337817Scyconst char * driver_flag_to_string(u64 flag);
5728281806Srpaulo
5729281806Srpaulo/* NULL terminated array of linked in driver wrappers */
5730289549Srpauloextern const struct wpa_driver_ops *const wpa_drivers[];
5731281806Srpaulo
5732337817Scy
5733337817Scy/* Available drivers */
5734337817Scy
5735337817Scy#ifdef CONFIG_DRIVER_WEXT
5736337817Scyextern const struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */
5737337817Scy#endif /* CONFIG_DRIVER_WEXT */
5738337817Scy#ifdef CONFIG_DRIVER_NL80211
5739337817Scy/* driver_nl80211.c */
5740337817Scyextern const struct wpa_driver_ops wpa_driver_nl80211_ops;
5741337817Scy#endif /* CONFIG_DRIVER_NL80211 */
5742337817Scy#ifdef CONFIG_DRIVER_HOSTAP
5743337817Scyextern const struct wpa_driver_ops wpa_driver_hostap_ops; /* driver_hostap.c */
5744337817Scy#endif /* CONFIG_DRIVER_HOSTAP */
5745337817Scy#ifdef CONFIG_DRIVER_BSD
5746337817Scyextern const struct wpa_driver_ops wpa_driver_bsd_ops; /* driver_bsd.c */
5747337817Scy#endif /* CONFIG_DRIVER_BSD */
5748337817Scy#ifdef CONFIG_DRIVER_OPENBSD
5749337817Scy/* driver_openbsd.c */
5750337817Scyextern const struct wpa_driver_ops wpa_driver_openbsd_ops;
5751337817Scy#endif /* CONFIG_DRIVER_OPENBSD */
5752337817Scy#ifdef CONFIG_DRIVER_NDIS
5753337817Scyextern struct wpa_driver_ops wpa_driver_ndis_ops; /* driver_ndis.c */
5754337817Scy#endif /* CONFIG_DRIVER_NDIS */
5755337817Scy#ifdef CONFIG_DRIVER_WIRED
5756337817Scyextern const struct wpa_driver_ops wpa_driver_wired_ops; /* driver_wired.c */
5757337817Scy#endif /* CONFIG_DRIVER_WIRED */
5758337817Scy#ifdef CONFIG_DRIVER_MACSEC_QCA
5759337817Scy/* driver_macsec_qca.c */
5760337817Scyextern const struct wpa_driver_ops wpa_driver_macsec_qca_ops;
5761337817Scy#endif /* CONFIG_DRIVER_MACSEC_QCA */
5762346981Scy#ifdef CONFIG_DRIVER_MACSEC_LINUX
5763346981Scy/* driver_macsec_linux.c */
5764346981Scyextern const struct wpa_driver_ops wpa_driver_macsec_linux_ops;
5765346981Scy#endif /* CONFIG_DRIVER_MACSEC_LINUX */
5766337817Scy#ifdef CONFIG_DRIVER_ROBOSWITCH
5767337817Scy/* driver_roboswitch.c */
5768337817Scyextern const struct wpa_driver_ops wpa_driver_roboswitch_ops;
5769337817Scy#endif /* CONFIG_DRIVER_ROBOSWITCH */
5770337817Scy#ifdef CONFIG_DRIVER_ATHEROS
5771337817Scy/* driver_atheros.c */
5772337817Scyextern const struct wpa_driver_ops wpa_driver_atheros_ops;
5773337817Scy#endif /* CONFIG_DRIVER_ATHEROS */
5774337817Scy#ifdef CONFIG_DRIVER_NONE
5775337817Scyextern const struct wpa_driver_ops wpa_driver_none_ops; /* driver_none.c */
5776337817Scy#endif /* CONFIG_DRIVER_NONE */
5777337817Scy
5778189251Ssam#endif /* DRIVER_H */
5779