16d49e1aeSJan Lentfer /* 2*3ff40c12SJohn Marino * Driver interface definition 3*3ff40c12SJohn Marino * Copyright (c) 2003-2014, Jouni Malinen <j@w1.fi> 46d49e1aeSJan Lentfer * 5*3ff40c12SJohn Marino * This software may be distributed under the terms of the BSD license. 6*3ff40c12SJohn Marino * See README for more details. 76d49e1aeSJan Lentfer * 8*3ff40c12SJohn Marino * This file defines a driver interface used by both %wpa_supplicant and 9*3ff40c12SJohn Marino * hostapd. The first part of the file defines data structures used in various 10*3ff40c12SJohn Marino * driver operations. This is followed by the struct wpa_driver_ops that each 11*3ff40c12SJohn Marino * driver wrapper will beed to define with callback functions for requesting 12*3ff40c12SJohn Marino * driver operations. After this, there are definitions for driver event 13*3ff40c12SJohn Marino * reporting with wpa_supplicant_event() and some convenience helper functions 14*3ff40c12SJohn Marino * that can be used to report events. 156d49e1aeSJan Lentfer */ 166d49e1aeSJan Lentfer 176d49e1aeSJan Lentfer #ifndef DRIVER_H 186d49e1aeSJan Lentfer #define DRIVER_H 196d49e1aeSJan Lentfer 20*3ff40c12SJohn Marino #define WPA_SUPPLICANT_DRIVER_VERSION 4 216d49e1aeSJan Lentfer 22*3ff40c12SJohn Marino #include "common/defs.h" 23*3ff40c12SJohn Marino #include "utils/list.h" 246d49e1aeSJan Lentfer 25*3ff40c12SJohn Marino #define HOSTAPD_CHAN_DISABLED 0x00000001 26*3ff40c12SJohn Marino #define HOSTAPD_CHAN_PASSIVE_SCAN 0x00000002 27*3ff40c12SJohn Marino #define HOSTAPD_CHAN_NO_IBSS 0x00000004 28*3ff40c12SJohn Marino #define HOSTAPD_CHAN_RADAR 0x00000008 29*3ff40c12SJohn Marino #define HOSTAPD_CHAN_HT40PLUS 0x00000010 30*3ff40c12SJohn Marino #define HOSTAPD_CHAN_HT40MINUS 0x00000020 31*3ff40c12SJohn Marino #define HOSTAPD_CHAN_HT40 0x00000040 32*3ff40c12SJohn Marino #define HOSTAPD_CHAN_SURVEY_LIST_INITIALIZED 0x00000080 33*3ff40c12SJohn Marino 34*3ff40c12SJohn Marino #define HOSTAPD_CHAN_DFS_UNKNOWN 0x00000000 35*3ff40c12SJohn Marino #define HOSTAPD_CHAN_DFS_USABLE 0x00000100 36*3ff40c12SJohn Marino #define HOSTAPD_CHAN_DFS_UNAVAILABLE 0x00000200 37*3ff40c12SJohn Marino #define HOSTAPD_CHAN_DFS_AVAILABLE 0x00000300 38*3ff40c12SJohn Marino #define HOSTAPD_CHAN_DFS_MASK 0x00000300 39*3ff40c12SJohn Marino 40*3ff40c12SJohn Marino #define HOSTAPD_CHAN_VHT_10_70 0x00000800 41*3ff40c12SJohn Marino #define HOSTAPD_CHAN_VHT_30_50 0x00001000 42*3ff40c12SJohn Marino #define HOSTAPD_CHAN_VHT_50_30 0x00002000 43*3ff40c12SJohn Marino #define HOSTAPD_CHAN_VHT_70_10 0x00004000 44*3ff40c12SJohn Marino 45*3ff40c12SJohn Marino enum reg_change_initiator { 46*3ff40c12SJohn Marino REGDOM_SET_BY_CORE, 47*3ff40c12SJohn Marino REGDOM_SET_BY_USER, 48*3ff40c12SJohn Marino REGDOM_SET_BY_DRIVER, 49*3ff40c12SJohn Marino REGDOM_SET_BY_COUNTRY_IE, 50*3ff40c12SJohn Marino REGDOM_BEACON_HINT, 51*3ff40c12SJohn Marino }; 52*3ff40c12SJohn Marino 53*3ff40c12SJohn Marino /** 54*3ff40c12SJohn Marino * struct hostapd_channel_data - Channel information 55*3ff40c12SJohn Marino */ 56*3ff40c12SJohn Marino struct hostapd_channel_data { 57*3ff40c12SJohn Marino /** 58*3ff40c12SJohn Marino * chan - Channel number (IEEE 802.11) 59*3ff40c12SJohn Marino */ 60*3ff40c12SJohn Marino short chan; 61*3ff40c12SJohn Marino 62*3ff40c12SJohn Marino /** 63*3ff40c12SJohn Marino * freq - Frequency in MHz 64*3ff40c12SJohn Marino */ 65*3ff40c12SJohn Marino int freq; 66*3ff40c12SJohn Marino 67*3ff40c12SJohn Marino /** 68*3ff40c12SJohn Marino * flag - Channel flags (HOSTAPD_CHAN_*) 69*3ff40c12SJohn Marino */ 70*3ff40c12SJohn Marino int flag; 71*3ff40c12SJohn Marino 72*3ff40c12SJohn Marino /** 73*3ff40c12SJohn Marino * max_tx_power - Regulatory transmit power limit in dBm 74*3ff40c12SJohn Marino */ 75*3ff40c12SJohn Marino u8 max_tx_power; 76*3ff40c12SJohn Marino 77*3ff40c12SJohn Marino /* 78*3ff40c12SJohn Marino * survey_list - Linked list of surveys 79*3ff40c12SJohn Marino */ 80*3ff40c12SJohn Marino struct dl_list survey_list; 81*3ff40c12SJohn Marino 82*3ff40c12SJohn Marino /** 83*3ff40c12SJohn Marino * min_nf - Minimum observed noise floor, in dBm, based on all 84*3ff40c12SJohn Marino * surveyed channel data 85*3ff40c12SJohn Marino */ 86*3ff40c12SJohn Marino s8 min_nf; 87*3ff40c12SJohn Marino 88*3ff40c12SJohn Marino #ifdef CONFIG_ACS 89*3ff40c12SJohn Marino /** 90*3ff40c12SJohn Marino * interference_factor - Computed interference factor on this 91*3ff40c12SJohn Marino * channel (used internally in src/ap/acs.c; driver wrappers do not 92*3ff40c12SJohn Marino * need to set this) 93*3ff40c12SJohn Marino */ 94*3ff40c12SJohn Marino long double interference_factor; 95*3ff40c12SJohn Marino #endif /* CONFIG_ACS */ 96*3ff40c12SJohn Marino }; 97*3ff40c12SJohn Marino 98*3ff40c12SJohn Marino #define HOSTAPD_MODE_FLAG_HT_INFO_KNOWN BIT(0) 99*3ff40c12SJohn Marino #define HOSTAPD_MODE_FLAG_VHT_INFO_KNOWN BIT(1) 100*3ff40c12SJohn Marino 101*3ff40c12SJohn Marino /** 102*3ff40c12SJohn Marino * struct hostapd_hw_modes - Supported hardware mode information 103*3ff40c12SJohn Marino */ 104*3ff40c12SJohn Marino struct hostapd_hw_modes { 105*3ff40c12SJohn Marino /** 106*3ff40c12SJohn Marino * mode - Hardware mode 107*3ff40c12SJohn Marino */ 108*3ff40c12SJohn Marino enum hostapd_hw_mode mode; 109*3ff40c12SJohn Marino 110*3ff40c12SJohn Marino /** 111*3ff40c12SJohn Marino * num_channels - Number of entries in the channels array 112*3ff40c12SJohn Marino */ 113*3ff40c12SJohn Marino int num_channels; 114*3ff40c12SJohn Marino 115*3ff40c12SJohn Marino /** 116*3ff40c12SJohn Marino * channels - Array of supported channels 117*3ff40c12SJohn Marino */ 118*3ff40c12SJohn Marino struct hostapd_channel_data *channels; 119*3ff40c12SJohn Marino 120*3ff40c12SJohn Marino /** 121*3ff40c12SJohn Marino * num_rates - Number of entries in the rates array 122*3ff40c12SJohn Marino */ 123*3ff40c12SJohn Marino int num_rates; 124*3ff40c12SJohn Marino 125*3ff40c12SJohn Marino /** 126*3ff40c12SJohn Marino * rates - Array of supported rates in 100 kbps units 127*3ff40c12SJohn Marino */ 128*3ff40c12SJohn Marino int *rates; 129*3ff40c12SJohn Marino 130*3ff40c12SJohn Marino /** 131*3ff40c12SJohn Marino * ht_capab - HT (IEEE 802.11n) capabilities 132*3ff40c12SJohn Marino */ 133*3ff40c12SJohn Marino u16 ht_capab; 134*3ff40c12SJohn Marino 135*3ff40c12SJohn Marino /** 136*3ff40c12SJohn Marino * mcs_set - MCS (IEEE 802.11n) rate parameters 137*3ff40c12SJohn Marino */ 138*3ff40c12SJohn Marino u8 mcs_set[16]; 139*3ff40c12SJohn Marino 140*3ff40c12SJohn Marino /** 141*3ff40c12SJohn Marino * a_mpdu_params - A-MPDU (IEEE 802.11n) parameters 142*3ff40c12SJohn Marino */ 143*3ff40c12SJohn Marino u8 a_mpdu_params; 144*3ff40c12SJohn Marino 145*3ff40c12SJohn Marino /** 146*3ff40c12SJohn Marino * vht_capab - VHT (IEEE 802.11ac) capabilities 147*3ff40c12SJohn Marino */ 148*3ff40c12SJohn Marino u32 vht_capab; 149*3ff40c12SJohn Marino 150*3ff40c12SJohn Marino /** 151*3ff40c12SJohn Marino * vht_mcs_set - VHT MCS (IEEE 802.11ac) rate parameters 152*3ff40c12SJohn Marino */ 153*3ff40c12SJohn Marino u8 vht_mcs_set[8]; 154*3ff40c12SJohn Marino 155*3ff40c12SJohn Marino unsigned int flags; /* HOSTAPD_MODE_FLAG_* */ 156*3ff40c12SJohn Marino }; 157*3ff40c12SJohn Marino 1586d49e1aeSJan Lentfer 1596d49e1aeSJan Lentfer #define IEEE80211_MODE_INFRA 0 1606d49e1aeSJan Lentfer #define IEEE80211_MODE_IBSS 1 161*3ff40c12SJohn Marino #define IEEE80211_MODE_AP 2 1626d49e1aeSJan Lentfer 1636d49e1aeSJan Lentfer #define IEEE80211_CAP_ESS 0x0001 1646d49e1aeSJan Lentfer #define IEEE80211_CAP_IBSS 0x0002 1656d49e1aeSJan Lentfer #define IEEE80211_CAP_PRIVACY 0x0010 1666d49e1aeSJan Lentfer 167*3ff40c12SJohn Marino /* DMG (60 GHz) IEEE 802.11ad */ 168*3ff40c12SJohn Marino /* type - bits 0..1 */ 169*3ff40c12SJohn Marino #define IEEE80211_CAP_DMG_MASK 0x0003 170*3ff40c12SJohn Marino #define IEEE80211_CAP_DMG_IBSS 0x0001 /* Tx by: STA */ 171*3ff40c12SJohn Marino #define IEEE80211_CAP_DMG_PBSS 0x0002 /* Tx by: PCP */ 172*3ff40c12SJohn Marino #define IEEE80211_CAP_DMG_AP 0x0003 /* Tx by: AP */ 1736d49e1aeSJan Lentfer 174*3ff40c12SJohn Marino #define WPA_SCAN_QUAL_INVALID BIT(0) 175*3ff40c12SJohn Marino #define WPA_SCAN_NOISE_INVALID BIT(1) 176*3ff40c12SJohn Marino #define WPA_SCAN_LEVEL_INVALID BIT(2) 177*3ff40c12SJohn Marino #define WPA_SCAN_LEVEL_DBM BIT(3) 178*3ff40c12SJohn Marino #define WPA_SCAN_AUTHENTICATED BIT(4) 179*3ff40c12SJohn Marino #define WPA_SCAN_ASSOCIATED BIT(5) 1806d49e1aeSJan Lentfer 1816d49e1aeSJan Lentfer /** 1826d49e1aeSJan Lentfer * struct wpa_scan_res - Scan result for an BSS/IBSS 183*3ff40c12SJohn Marino * @flags: information flags about the BSS/IBSS (WPA_SCAN_*) 1846d49e1aeSJan Lentfer * @bssid: BSSID 1856d49e1aeSJan Lentfer * @freq: frequency of the channel in MHz (e.g., 2412 = channel 1) 1866d49e1aeSJan Lentfer * @beacon_int: beacon interval in TUs (host byte order) 1876d49e1aeSJan Lentfer * @caps: capability information field in host byte order 1886d49e1aeSJan Lentfer * @qual: signal quality 1896d49e1aeSJan Lentfer * @noise: noise level 1906d49e1aeSJan Lentfer * @level: signal level 1916d49e1aeSJan Lentfer * @tsf: Timestamp 192*3ff40c12SJohn Marino * @age: Age of the information in milliseconds (i.e., how many milliseconds 193*3ff40c12SJohn Marino * ago the last Beacon or Probe Response frame was received) 1946d49e1aeSJan Lentfer * @ie_len: length of the following IE field in octets 195*3ff40c12SJohn Marino * @beacon_ie_len: length of the following Beacon IE field in octets 1966d49e1aeSJan Lentfer * 1976d49e1aeSJan Lentfer * This structure is used as a generic format for scan results from the 1986d49e1aeSJan Lentfer * driver. Each driver interface implementation is responsible for converting 1996d49e1aeSJan Lentfer * the driver or OS specific scan results into this format. 2006d49e1aeSJan Lentfer * 2016d49e1aeSJan Lentfer * If the driver does not support reporting all IEs, the IE data structure is 2026d49e1aeSJan Lentfer * constructed of the IEs that are available. This field will also need to 2036d49e1aeSJan Lentfer * include SSID in IE format. All drivers are encouraged to be extended to 2046d49e1aeSJan Lentfer * report all IEs to make it easier to support future additions. 2056d49e1aeSJan Lentfer */ 2066d49e1aeSJan Lentfer struct wpa_scan_res { 207*3ff40c12SJohn Marino unsigned int flags; 2086d49e1aeSJan Lentfer u8 bssid[ETH_ALEN]; 2096d49e1aeSJan Lentfer int freq; 2106d49e1aeSJan Lentfer u16 beacon_int; 2116d49e1aeSJan Lentfer u16 caps; 2126d49e1aeSJan Lentfer int qual; 2136d49e1aeSJan Lentfer int noise; 2146d49e1aeSJan Lentfer int level; 2156d49e1aeSJan Lentfer u64 tsf; 216*3ff40c12SJohn Marino unsigned int age; 2176d49e1aeSJan Lentfer size_t ie_len; 218*3ff40c12SJohn Marino size_t beacon_ie_len; 219*3ff40c12SJohn Marino /* 220*3ff40c12SJohn Marino * Followed by ie_len octets of IEs from Probe Response frame (or if 221*3ff40c12SJohn Marino * the driver does not indicate source of IEs, these may also be from 222*3ff40c12SJohn Marino * Beacon frame). After the first set of IEs, another set of IEs may 223*3ff40c12SJohn Marino * follow (with beacon_ie_len octets of data) if the driver provides 224*3ff40c12SJohn Marino * both IE sets. 225*3ff40c12SJohn Marino */ 2266d49e1aeSJan Lentfer }; 2276d49e1aeSJan Lentfer 2286d49e1aeSJan Lentfer /** 2296d49e1aeSJan Lentfer * struct wpa_scan_results - Scan results 2306d49e1aeSJan Lentfer * @res: Array of pointers to allocated variable length scan result entries 2316d49e1aeSJan Lentfer * @num: Number of entries in the scan result array 232*3ff40c12SJohn Marino * @fetch_time: Time when the results were fetched from the driver 2336d49e1aeSJan Lentfer */ 2346d49e1aeSJan Lentfer struct wpa_scan_results { 2356d49e1aeSJan Lentfer struct wpa_scan_res **res; 2366d49e1aeSJan Lentfer size_t num; 237*3ff40c12SJohn Marino struct os_reltime fetch_time; 2386d49e1aeSJan Lentfer }; 2396d49e1aeSJan Lentfer 2406d49e1aeSJan Lentfer /** 2416d49e1aeSJan Lentfer * struct wpa_interface_info - Network interface information 2426d49e1aeSJan Lentfer * @next: Pointer to the next interface or NULL if this is the last one 2436d49e1aeSJan Lentfer * @ifname: Interface name that can be used with init() or init2() 2446d49e1aeSJan Lentfer * @desc: Human readable adapter description (e.g., vendor/model) or NULL if 2456d49e1aeSJan Lentfer * not available 2466d49e1aeSJan Lentfer * @drv_name: struct wpa_driver_ops::name (note: unlike other strings, this one 2476d49e1aeSJan Lentfer * is not an allocated copy, i.e., get_interfaces() caller will not free 2486d49e1aeSJan Lentfer * this) 2496d49e1aeSJan Lentfer */ 2506d49e1aeSJan Lentfer struct wpa_interface_info { 2516d49e1aeSJan Lentfer struct wpa_interface_info *next; 2526d49e1aeSJan Lentfer char *ifname; 2536d49e1aeSJan Lentfer char *desc; 2546d49e1aeSJan Lentfer const char *drv_name; 2556d49e1aeSJan Lentfer }; 2566d49e1aeSJan Lentfer 257*3ff40c12SJohn Marino #define WPAS_MAX_SCAN_SSIDS 16 258*3ff40c12SJohn Marino 259*3ff40c12SJohn Marino /** 260*3ff40c12SJohn Marino * struct wpa_driver_scan_params - Scan parameters 261*3ff40c12SJohn Marino * Data for struct wpa_driver_ops::scan2(). 262*3ff40c12SJohn Marino */ 263*3ff40c12SJohn Marino struct wpa_driver_scan_params { 264*3ff40c12SJohn Marino /** 265*3ff40c12SJohn Marino * ssids - SSIDs to scan for 266*3ff40c12SJohn Marino */ 267*3ff40c12SJohn Marino struct wpa_driver_scan_ssid { 268*3ff40c12SJohn Marino /** 269*3ff40c12SJohn Marino * ssid - specific SSID to scan for (ProbeReq) 270*3ff40c12SJohn Marino * %NULL or zero-length SSID is used to indicate active scan 271*3ff40c12SJohn Marino * with wildcard SSID. 272*3ff40c12SJohn Marino */ 273*3ff40c12SJohn Marino const u8 *ssid; 274*3ff40c12SJohn Marino /** 275*3ff40c12SJohn Marino * ssid_len: Length of the SSID in octets 276*3ff40c12SJohn Marino */ 277*3ff40c12SJohn Marino size_t ssid_len; 278*3ff40c12SJohn Marino } ssids[WPAS_MAX_SCAN_SSIDS]; 279*3ff40c12SJohn Marino 280*3ff40c12SJohn Marino /** 281*3ff40c12SJohn Marino * num_ssids - Number of entries in ssids array 282*3ff40c12SJohn Marino * Zero indicates a request for a passive scan. 283*3ff40c12SJohn Marino */ 284*3ff40c12SJohn Marino size_t num_ssids; 285*3ff40c12SJohn Marino 286*3ff40c12SJohn Marino /** 287*3ff40c12SJohn Marino * extra_ies - Extra IE(s) to add into Probe Request or %NULL 288*3ff40c12SJohn Marino */ 289*3ff40c12SJohn Marino const u8 *extra_ies; 290*3ff40c12SJohn Marino 291*3ff40c12SJohn Marino /** 292*3ff40c12SJohn Marino * extra_ies_len - Length of extra_ies in octets 293*3ff40c12SJohn Marino */ 294*3ff40c12SJohn Marino size_t extra_ies_len; 295*3ff40c12SJohn Marino 296*3ff40c12SJohn Marino /** 297*3ff40c12SJohn Marino * freqs - Array of frequencies to scan or %NULL for all frequencies 298*3ff40c12SJohn Marino * 299*3ff40c12SJohn Marino * The frequency is set in MHz. The array is zero-terminated. 300*3ff40c12SJohn Marino */ 301*3ff40c12SJohn Marino int *freqs; 302*3ff40c12SJohn Marino 303*3ff40c12SJohn Marino /** 304*3ff40c12SJohn Marino * filter_ssids - Filter for reporting SSIDs 305*3ff40c12SJohn Marino * 306*3ff40c12SJohn Marino * This optional parameter can be used to request the driver wrapper to 307*3ff40c12SJohn Marino * filter scan results to include only the specified SSIDs. %NULL 308*3ff40c12SJohn Marino * indicates that no filtering is to be done. This can be used to 309*3ff40c12SJohn Marino * reduce memory needs for scan results in environments that have large 310*3ff40c12SJohn Marino * number of APs with different SSIDs. 311*3ff40c12SJohn Marino * 312*3ff40c12SJohn Marino * The driver wrapper is allowed to take this allocated buffer into its 313*3ff40c12SJohn Marino * own use by setting the pointer to %NULL. In that case, the driver 314*3ff40c12SJohn Marino * wrapper is responsible for freeing the buffer with os_free() once it 315*3ff40c12SJohn Marino * is not needed anymore. 316*3ff40c12SJohn Marino */ 317*3ff40c12SJohn Marino struct wpa_driver_scan_filter { 318*3ff40c12SJohn Marino u8 ssid[32]; 319*3ff40c12SJohn Marino size_t ssid_len; 320*3ff40c12SJohn Marino } *filter_ssids; 321*3ff40c12SJohn Marino 322*3ff40c12SJohn Marino /** 323*3ff40c12SJohn Marino * num_filter_ssids - Number of entries in filter_ssids array 324*3ff40c12SJohn Marino */ 325*3ff40c12SJohn Marino size_t num_filter_ssids; 326*3ff40c12SJohn Marino 327*3ff40c12SJohn Marino /** 328*3ff40c12SJohn Marino * filter_rssi - Filter by RSSI 329*3ff40c12SJohn Marino * 330*3ff40c12SJohn Marino * The driver may filter scan results in firmware to reduce host 331*3ff40c12SJohn Marino * wakeups and thereby save power. Specify the RSSI threshold in s32 332*3ff40c12SJohn Marino * dBm. 333*3ff40c12SJohn Marino */ 334*3ff40c12SJohn Marino s32 filter_rssi; 335*3ff40c12SJohn Marino 336*3ff40c12SJohn Marino /** 337*3ff40c12SJohn Marino * p2p_probe - Used to disable CCK (802.11b) rates for P2P probes 338*3ff40c12SJohn Marino * 339*3ff40c12SJohn Marino * When set, the driver is expected to remove rates 1, 2, 5.5, and 11 340*3ff40c12SJohn Marino * Mbps from the support rates element(s) in the Probe Request frames 341*3ff40c12SJohn Marino * and not to transmit the frames at any of those rates. 342*3ff40c12SJohn Marino */ 343*3ff40c12SJohn Marino u8 p2p_probe; 344*3ff40c12SJohn Marino 345*3ff40c12SJohn Marino /** 346*3ff40c12SJohn Marino * only_new_results - Request driver to report only new results 347*3ff40c12SJohn Marino * 348*3ff40c12SJohn Marino * This is used to request the driver to report only BSSes that have 349*3ff40c12SJohn Marino * been detected after this scan request has been started, i.e., to 350*3ff40c12SJohn Marino * flush old cached BSS entries. 351*3ff40c12SJohn Marino */ 352*3ff40c12SJohn Marino int only_new_results; 353*3ff40c12SJohn Marino 354*3ff40c12SJohn Marino /* 355*3ff40c12SJohn Marino * NOTE: Whenever adding new parameters here, please make sure 356*3ff40c12SJohn Marino * wpa_scan_clone_params() and wpa_scan_free_params() get updated with 357*3ff40c12SJohn Marino * matching changes. 358*3ff40c12SJohn Marino */ 359*3ff40c12SJohn Marino }; 360*3ff40c12SJohn Marino 361*3ff40c12SJohn Marino /** 362*3ff40c12SJohn Marino * struct wpa_driver_auth_params - Authentication parameters 363*3ff40c12SJohn Marino * Data for struct wpa_driver_ops::authenticate(). 364*3ff40c12SJohn Marino */ 365*3ff40c12SJohn Marino struct wpa_driver_auth_params { 366*3ff40c12SJohn Marino int freq; 367*3ff40c12SJohn Marino const u8 *bssid; 368*3ff40c12SJohn Marino const u8 *ssid; 369*3ff40c12SJohn Marino size_t ssid_len; 370*3ff40c12SJohn Marino int auth_alg; 371*3ff40c12SJohn Marino const u8 *ie; 372*3ff40c12SJohn Marino size_t ie_len; 373*3ff40c12SJohn Marino const u8 *wep_key[4]; 374*3ff40c12SJohn Marino size_t wep_key_len[4]; 375*3ff40c12SJohn Marino int wep_tx_keyidx; 376*3ff40c12SJohn Marino int local_state_change; 377*3ff40c12SJohn Marino 378*3ff40c12SJohn Marino /** 379*3ff40c12SJohn Marino * p2p - Whether this connection is a P2P group 380*3ff40c12SJohn Marino */ 381*3ff40c12SJohn Marino int p2p; 382*3ff40c12SJohn Marino 383*3ff40c12SJohn Marino const u8 *sae_data; 384*3ff40c12SJohn Marino size_t sae_data_len; 385*3ff40c12SJohn Marino 386*3ff40c12SJohn Marino }; 387*3ff40c12SJohn Marino 388*3ff40c12SJohn Marino enum wps_mode { 389*3ff40c12SJohn Marino WPS_MODE_NONE /* no WPS provisioning being used */, 390*3ff40c12SJohn Marino WPS_MODE_OPEN /* WPS provisioning with AP that is in open mode */, 391*3ff40c12SJohn Marino WPS_MODE_PRIVACY /* WPS provisioning with AP that is using protection 392*3ff40c12SJohn Marino */ 393*3ff40c12SJohn Marino }; 394*3ff40c12SJohn Marino 3956d49e1aeSJan Lentfer /** 3966d49e1aeSJan Lentfer * struct wpa_driver_associate_params - Association parameters 3976d49e1aeSJan Lentfer * Data for struct wpa_driver_ops::associate(). 3986d49e1aeSJan Lentfer */ 3996d49e1aeSJan Lentfer struct wpa_driver_associate_params { 4006d49e1aeSJan Lentfer /** 4016d49e1aeSJan Lentfer * bssid - BSSID of the selected AP 4026d49e1aeSJan Lentfer * This can be %NULL, if ap_scan=2 mode is used and the driver is 4036d49e1aeSJan Lentfer * responsible for selecting with which BSS to associate. */ 4046d49e1aeSJan Lentfer const u8 *bssid; 4056d49e1aeSJan Lentfer 4066d49e1aeSJan Lentfer /** 4076d49e1aeSJan Lentfer * ssid - The selected SSID 4086d49e1aeSJan Lentfer */ 4096d49e1aeSJan Lentfer const u8 *ssid; 410*3ff40c12SJohn Marino 411*3ff40c12SJohn Marino /** 412*3ff40c12SJohn Marino * ssid_len - Length of the SSID (1..32) 413*3ff40c12SJohn Marino */ 4146d49e1aeSJan Lentfer size_t ssid_len; 4156d49e1aeSJan Lentfer 4166d49e1aeSJan Lentfer /** 4176d49e1aeSJan Lentfer * freq - Frequency of the channel the selected AP is using 4186d49e1aeSJan Lentfer * Frequency that the selected AP is using (in MHz as 4196d49e1aeSJan Lentfer * reported in the scan results) 4206d49e1aeSJan Lentfer */ 4216d49e1aeSJan Lentfer int freq; 4226d49e1aeSJan Lentfer 4236d49e1aeSJan Lentfer /** 424*3ff40c12SJohn Marino * bg_scan_period - Background scan period in seconds, 0 to disable 425*3ff40c12SJohn Marino * background scan, or -1 to indicate no change to default driver 426*3ff40c12SJohn Marino * configuration 427*3ff40c12SJohn Marino */ 428*3ff40c12SJohn Marino int bg_scan_period; 429*3ff40c12SJohn Marino 430*3ff40c12SJohn Marino /** 4316d49e1aeSJan Lentfer * wpa_ie - WPA information element for (Re)Association Request 4326d49e1aeSJan Lentfer * WPA information element to be included in (Re)Association 4336d49e1aeSJan Lentfer * Request (including information element id and length). Use 4346d49e1aeSJan Lentfer * of this WPA IE is optional. If the driver generates the WPA 4356d49e1aeSJan Lentfer * IE, it can use pairwise_suite, group_suite, and 4366d49e1aeSJan Lentfer * key_mgmt_suite to select proper algorithms. In this case, 4376d49e1aeSJan Lentfer * the driver has to notify wpa_supplicant about the used WPA 4386d49e1aeSJan Lentfer * IE by generating an event that the interface code will 4396d49e1aeSJan Lentfer * convert into EVENT_ASSOCINFO data (see below). 4406d49e1aeSJan Lentfer * 4416d49e1aeSJan Lentfer * When using WPA2/IEEE 802.11i, wpa_ie is used for RSN IE 4426d49e1aeSJan Lentfer * instead. The driver can determine which version is used by 4436d49e1aeSJan Lentfer * looking at the first byte of the IE (0xdd for WPA, 0x30 for 4446d49e1aeSJan Lentfer * WPA2/RSN). 4456d49e1aeSJan Lentfer * 4466d49e1aeSJan Lentfer * When using WPS, wpa_ie is used for WPS IE instead of WPA/RSN IE. 4476d49e1aeSJan Lentfer */ 4486d49e1aeSJan Lentfer const u8 *wpa_ie; 449*3ff40c12SJohn Marino 4506d49e1aeSJan Lentfer /** 4516d49e1aeSJan Lentfer * wpa_ie_len - length of the wpa_ie 4526d49e1aeSJan Lentfer */ 4536d49e1aeSJan Lentfer size_t wpa_ie_len; 4546d49e1aeSJan Lentfer 455*3ff40c12SJohn Marino /** 456*3ff40c12SJohn Marino * wpa_proto - Bitfield of WPA_PROTO_* values to indicate WPA/WPA2 457*3ff40c12SJohn Marino */ 458*3ff40c12SJohn Marino unsigned int wpa_proto; 459*3ff40c12SJohn Marino 460*3ff40c12SJohn Marino /** 461*3ff40c12SJohn Marino * pairwise_suite - Selected pairwise cipher suite (WPA_CIPHER_*) 462*3ff40c12SJohn Marino * 463*3ff40c12SJohn Marino * This is usually ignored if @wpa_ie is used. 464*3ff40c12SJohn Marino */ 465*3ff40c12SJohn Marino unsigned int pairwise_suite; 466*3ff40c12SJohn Marino 467*3ff40c12SJohn Marino /** 468*3ff40c12SJohn Marino * group_suite - Selected group cipher suite (WPA_CIPHER_*) 469*3ff40c12SJohn Marino * 470*3ff40c12SJohn Marino * This is usually ignored if @wpa_ie is used. 471*3ff40c12SJohn Marino */ 472*3ff40c12SJohn Marino unsigned int group_suite; 473*3ff40c12SJohn Marino 474*3ff40c12SJohn Marino /** 475*3ff40c12SJohn Marino * key_mgmt_suite - Selected key management suite (WPA_KEY_MGMT_*) 476*3ff40c12SJohn Marino * 477*3ff40c12SJohn Marino * This is usually ignored if @wpa_ie is used. 478*3ff40c12SJohn Marino */ 479*3ff40c12SJohn Marino unsigned int key_mgmt_suite; 4806d49e1aeSJan Lentfer 4816d49e1aeSJan Lentfer /** 4826d49e1aeSJan Lentfer * auth_alg - Allowed authentication algorithms 483*3ff40c12SJohn Marino * Bit field of WPA_AUTH_ALG_* 4846d49e1aeSJan Lentfer */ 4856d49e1aeSJan Lentfer int auth_alg; 4866d49e1aeSJan Lentfer 4876d49e1aeSJan Lentfer /** 4886d49e1aeSJan Lentfer * mode - Operation mode (infra/ibss) IEEE80211_MODE_* 4896d49e1aeSJan Lentfer */ 4906d49e1aeSJan Lentfer int mode; 4916d49e1aeSJan Lentfer 4926d49e1aeSJan Lentfer /** 4936d49e1aeSJan Lentfer * wep_key - WEP keys for static WEP configuration 4946d49e1aeSJan Lentfer */ 4956d49e1aeSJan Lentfer const u8 *wep_key[4]; 4966d49e1aeSJan Lentfer 4976d49e1aeSJan Lentfer /** 4986d49e1aeSJan Lentfer * wep_key_len - WEP key length for static WEP configuration 4996d49e1aeSJan Lentfer */ 5006d49e1aeSJan Lentfer size_t wep_key_len[4]; 5016d49e1aeSJan Lentfer 5026d49e1aeSJan Lentfer /** 5036d49e1aeSJan Lentfer * wep_tx_keyidx - WEP TX key index for static WEP configuration 5046d49e1aeSJan Lentfer */ 5056d49e1aeSJan Lentfer int wep_tx_keyidx; 5066d49e1aeSJan Lentfer 5076d49e1aeSJan Lentfer /** 5086d49e1aeSJan Lentfer * mgmt_frame_protection - IEEE 802.11w management frame protection 5096d49e1aeSJan Lentfer */ 510*3ff40c12SJohn Marino enum mfp_options mgmt_frame_protection; 5116d49e1aeSJan Lentfer 5126d49e1aeSJan Lentfer /** 5136d49e1aeSJan Lentfer * ft_ies - IEEE 802.11r / FT information elements 5146d49e1aeSJan Lentfer * If the supplicant is using IEEE 802.11r (FT) and has the needed keys 5156d49e1aeSJan Lentfer * for fast transition, this parameter is set to include the IEs that 5166d49e1aeSJan Lentfer * are to be sent in the next FT Authentication Request message. 5176d49e1aeSJan Lentfer * update_ft_ies() handler is called to update the IEs for further 5186d49e1aeSJan Lentfer * FT messages in the sequence. 5196d49e1aeSJan Lentfer * 5206d49e1aeSJan Lentfer * The driver should use these IEs only if the target AP is advertising 5216d49e1aeSJan Lentfer * the same mobility domain as the one included in the MDIE here. 5226d49e1aeSJan Lentfer * 5236d49e1aeSJan Lentfer * In ap_scan=2 mode, the driver can use these IEs when moving to a new 5246d49e1aeSJan Lentfer * AP after the initial association. These IEs can only be used if the 5256d49e1aeSJan Lentfer * target AP is advertising support for FT and is using the same MDIE 5266d49e1aeSJan Lentfer * and SSID as the current AP. 5276d49e1aeSJan Lentfer * 5286d49e1aeSJan Lentfer * The driver is responsible for reporting the FT IEs received from the 5296d49e1aeSJan Lentfer * AP's response using wpa_supplicant_event() with EVENT_FT_RESPONSE 5306d49e1aeSJan Lentfer * type. update_ft_ies() handler will then be called with the FT IEs to 5316d49e1aeSJan Lentfer * include in the next frame in the authentication sequence. 5326d49e1aeSJan Lentfer */ 5336d49e1aeSJan Lentfer const u8 *ft_ies; 5346d49e1aeSJan Lentfer 5356d49e1aeSJan Lentfer /** 5366d49e1aeSJan Lentfer * ft_ies_len - Length of ft_ies in bytes 5376d49e1aeSJan Lentfer */ 5386d49e1aeSJan Lentfer size_t ft_ies_len; 5396d49e1aeSJan Lentfer 5406d49e1aeSJan Lentfer /** 5416d49e1aeSJan Lentfer * ft_md - FT Mobility domain (6 octets) (also included inside ft_ies) 5426d49e1aeSJan Lentfer * 5436d49e1aeSJan Lentfer * This value is provided to allow the driver interface easier access 5446d49e1aeSJan Lentfer * to the current mobility domain. This value is set to %NULL if no 5456d49e1aeSJan Lentfer * mobility domain is currently active. 5466d49e1aeSJan Lentfer */ 5476d49e1aeSJan Lentfer const u8 *ft_md; 5486d49e1aeSJan Lentfer 5496d49e1aeSJan Lentfer /** 5506d49e1aeSJan Lentfer * passphrase - RSN passphrase for PSK 5516d49e1aeSJan Lentfer * 5526d49e1aeSJan Lentfer * This value is made available only for WPA/WPA2-Personal (PSK) and 5536d49e1aeSJan Lentfer * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE. This is 5546d49e1aeSJan Lentfer * the 8..63 character ASCII passphrase, if available. Please note that 5556d49e1aeSJan Lentfer * this can be %NULL if passphrase was not used to generate the PSK. In 5566d49e1aeSJan Lentfer * that case, the psk field must be used to fetch the PSK. 5576d49e1aeSJan Lentfer */ 5586d49e1aeSJan Lentfer const char *passphrase; 5596d49e1aeSJan Lentfer 5606d49e1aeSJan Lentfer /** 5616d49e1aeSJan Lentfer * psk - RSN PSK (alternative for passphrase for PSK) 5626d49e1aeSJan Lentfer * 5636d49e1aeSJan Lentfer * This value is made available only for WPA/WPA2-Personal (PSK) and 5646d49e1aeSJan Lentfer * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE. This is 5656d49e1aeSJan Lentfer * the 32-octet (256-bit) PSK, if available. The driver wrapper should 5666d49e1aeSJan Lentfer * be prepared to handle %NULL value as an error. 5676d49e1aeSJan Lentfer */ 5686d49e1aeSJan Lentfer const u8 *psk; 569*3ff40c12SJohn Marino 570*3ff40c12SJohn Marino /** 571*3ff40c12SJohn Marino * drop_unencrypted - Enable/disable unencrypted frame filtering 572*3ff40c12SJohn Marino * 573*3ff40c12SJohn Marino * Configure the driver to drop all non-EAPOL frames (both receive and 574*3ff40c12SJohn Marino * transmit paths). Unencrypted EAPOL frames (ethertype 0x888e) must 575*3ff40c12SJohn Marino * still be allowed for key negotiation. 576*3ff40c12SJohn Marino */ 577*3ff40c12SJohn Marino int drop_unencrypted; 578*3ff40c12SJohn Marino 579*3ff40c12SJohn Marino /** 580*3ff40c12SJohn Marino * prev_bssid - Previously used BSSID in this ESS 581*3ff40c12SJohn Marino * 582*3ff40c12SJohn Marino * When not %NULL, this is a request to use reassociation instead of 583*3ff40c12SJohn Marino * association. 584*3ff40c12SJohn Marino */ 585*3ff40c12SJohn Marino const u8 *prev_bssid; 586*3ff40c12SJohn Marino 587*3ff40c12SJohn Marino /** 588*3ff40c12SJohn Marino * wps - WPS mode 589*3ff40c12SJohn Marino * 590*3ff40c12SJohn Marino * If the driver needs to do special configuration for WPS association, 591*3ff40c12SJohn Marino * this variable provides more information on what type of association 592*3ff40c12SJohn Marino * is being requested. Most drivers should not need ot use this. 593*3ff40c12SJohn Marino */ 594*3ff40c12SJohn Marino enum wps_mode wps; 595*3ff40c12SJohn Marino 596*3ff40c12SJohn Marino /** 597*3ff40c12SJohn Marino * p2p - Whether this connection is a P2P group 598*3ff40c12SJohn Marino */ 599*3ff40c12SJohn Marino int p2p; 600*3ff40c12SJohn Marino 601*3ff40c12SJohn Marino /** 602*3ff40c12SJohn Marino * uapsd - UAPSD parameters for the network 603*3ff40c12SJohn Marino * -1 = do not change defaults 604*3ff40c12SJohn Marino * AP mode: 1 = enabled, 0 = disabled 605*3ff40c12SJohn Marino * STA mode: bits 0..3 UAPSD enabled for VO,VI,BK,BE 606*3ff40c12SJohn Marino */ 607*3ff40c12SJohn Marino int uapsd; 608*3ff40c12SJohn Marino 609*3ff40c12SJohn Marino /** 610*3ff40c12SJohn Marino * fixed_bssid - Whether to force this BSSID in IBSS mode 611*3ff40c12SJohn Marino * 1 = Fix this BSSID and prevent merges. 612*3ff40c12SJohn Marino * 0 = Do not fix BSSID. 613*3ff40c12SJohn Marino */ 614*3ff40c12SJohn Marino int fixed_bssid; 615*3ff40c12SJohn Marino 616*3ff40c12SJohn Marino /** 617*3ff40c12SJohn Marino * disable_ht - Disable HT (IEEE 802.11n) for this connection 618*3ff40c12SJohn Marino */ 619*3ff40c12SJohn Marino int disable_ht; 620*3ff40c12SJohn Marino 621*3ff40c12SJohn Marino /** 622*3ff40c12SJohn Marino * HT Capabilities over-rides. Only bits set in the mask will be used, 623*3ff40c12SJohn Marino * and not all values are used by the kernel anyway. Currently, MCS, 624*3ff40c12SJohn Marino * MPDU and MSDU fields are used. 625*3ff40c12SJohn Marino */ 626*3ff40c12SJohn Marino const u8 *htcaps; /* struct ieee80211_ht_capabilities * */ 627*3ff40c12SJohn Marino const u8 *htcaps_mask; /* struct ieee80211_ht_capabilities * */ 628*3ff40c12SJohn Marino 629*3ff40c12SJohn Marino #ifdef CONFIG_VHT_OVERRIDES 630*3ff40c12SJohn Marino /** 631*3ff40c12SJohn Marino * disable_vht - Disable VHT for this connection 632*3ff40c12SJohn Marino */ 633*3ff40c12SJohn Marino int disable_vht; 634*3ff40c12SJohn Marino 635*3ff40c12SJohn Marino /** 636*3ff40c12SJohn Marino * VHT capability overrides. 637*3ff40c12SJohn Marino */ 638*3ff40c12SJohn Marino const struct ieee80211_vht_capabilities *vhtcaps; 639*3ff40c12SJohn Marino const struct ieee80211_vht_capabilities *vhtcaps_mask; 640*3ff40c12SJohn Marino #endif /* CONFIG_VHT_OVERRIDES */ 641*3ff40c12SJohn Marino }; 642*3ff40c12SJohn Marino 643*3ff40c12SJohn Marino enum hide_ssid { 644*3ff40c12SJohn Marino NO_SSID_HIDING, 645*3ff40c12SJohn Marino HIDDEN_SSID_ZERO_LEN, 646*3ff40c12SJohn Marino HIDDEN_SSID_ZERO_CONTENTS 647*3ff40c12SJohn Marino }; 648*3ff40c12SJohn Marino 649*3ff40c12SJohn Marino struct wpa_driver_ap_params { 650*3ff40c12SJohn Marino /** 651*3ff40c12SJohn Marino * head - Beacon head from IEEE 802.11 header to IEs before TIM IE 652*3ff40c12SJohn Marino */ 653*3ff40c12SJohn Marino u8 *head; 654*3ff40c12SJohn Marino 655*3ff40c12SJohn Marino /** 656*3ff40c12SJohn Marino * head_len - Length of the head buffer in octets 657*3ff40c12SJohn Marino */ 658*3ff40c12SJohn Marino size_t head_len; 659*3ff40c12SJohn Marino 660*3ff40c12SJohn Marino /** 661*3ff40c12SJohn Marino * tail - Beacon tail following TIM IE 662*3ff40c12SJohn Marino */ 663*3ff40c12SJohn Marino u8 *tail; 664*3ff40c12SJohn Marino 665*3ff40c12SJohn Marino /** 666*3ff40c12SJohn Marino * tail_len - Length of the tail buffer in octets 667*3ff40c12SJohn Marino */ 668*3ff40c12SJohn Marino size_t tail_len; 669*3ff40c12SJohn Marino 670*3ff40c12SJohn Marino /** 671*3ff40c12SJohn Marino * dtim_period - DTIM period 672*3ff40c12SJohn Marino */ 673*3ff40c12SJohn Marino int dtim_period; 674*3ff40c12SJohn Marino 675*3ff40c12SJohn Marino /** 676*3ff40c12SJohn Marino * beacon_int - Beacon interval 677*3ff40c12SJohn Marino */ 678*3ff40c12SJohn Marino int beacon_int; 679*3ff40c12SJohn Marino 680*3ff40c12SJohn Marino /** 681*3ff40c12SJohn Marino * basic_rates: -1 terminated array of basic rates in 100 kbps 682*3ff40c12SJohn Marino * 683*3ff40c12SJohn Marino * This parameter can be used to set a specific basic rate set for the 684*3ff40c12SJohn Marino * BSS. If %NULL, default basic rate set is used. 685*3ff40c12SJohn Marino */ 686*3ff40c12SJohn Marino int *basic_rates; 687*3ff40c12SJohn Marino 688*3ff40c12SJohn Marino /** 689*3ff40c12SJohn Marino * proberesp - Probe Response template 690*3ff40c12SJohn Marino * 691*3ff40c12SJohn Marino * This is used by drivers that reply to Probe Requests internally in 692*3ff40c12SJohn Marino * AP mode and require the full Probe Response template. 693*3ff40c12SJohn Marino */ 694*3ff40c12SJohn Marino u8 *proberesp; 695*3ff40c12SJohn Marino 696*3ff40c12SJohn Marino /** 697*3ff40c12SJohn Marino * proberesp_len - Length of the proberesp buffer in octets 698*3ff40c12SJohn Marino */ 699*3ff40c12SJohn Marino size_t proberesp_len; 700*3ff40c12SJohn Marino 701*3ff40c12SJohn Marino /** 702*3ff40c12SJohn Marino * ssid - The SSID to use in Beacon/Probe Response frames 703*3ff40c12SJohn Marino */ 704*3ff40c12SJohn Marino const u8 *ssid; 705*3ff40c12SJohn Marino 706*3ff40c12SJohn Marino /** 707*3ff40c12SJohn Marino * ssid_len - Length of the SSID (1..32) 708*3ff40c12SJohn Marino */ 709*3ff40c12SJohn Marino size_t ssid_len; 710*3ff40c12SJohn Marino 711*3ff40c12SJohn Marino /** 712*3ff40c12SJohn Marino * hide_ssid - Whether to hide the SSID 713*3ff40c12SJohn Marino */ 714*3ff40c12SJohn Marino enum hide_ssid hide_ssid; 715*3ff40c12SJohn Marino 716*3ff40c12SJohn Marino /** 717*3ff40c12SJohn Marino * pairwise_ciphers - WPA_CIPHER_* bitfield 718*3ff40c12SJohn Marino */ 719*3ff40c12SJohn Marino unsigned int pairwise_ciphers; 720*3ff40c12SJohn Marino 721*3ff40c12SJohn Marino /** 722*3ff40c12SJohn Marino * group_cipher - WPA_CIPHER_* 723*3ff40c12SJohn Marino */ 724*3ff40c12SJohn Marino unsigned int group_cipher; 725*3ff40c12SJohn Marino 726*3ff40c12SJohn Marino /** 727*3ff40c12SJohn Marino * key_mgmt_suites - WPA_KEY_MGMT_* bitfield 728*3ff40c12SJohn Marino */ 729*3ff40c12SJohn Marino unsigned int key_mgmt_suites; 730*3ff40c12SJohn Marino 731*3ff40c12SJohn Marino /** 732*3ff40c12SJohn Marino * auth_algs - WPA_AUTH_ALG_* bitfield 733*3ff40c12SJohn Marino */ 734*3ff40c12SJohn Marino unsigned int auth_algs; 735*3ff40c12SJohn Marino 736*3ff40c12SJohn Marino /** 737*3ff40c12SJohn Marino * wpa_version - WPA_PROTO_* bitfield 738*3ff40c12SJohn Marino */ 739*3ff40c12SJohn Marino unsigned int wpa_version; 740*3ff40c12SJohn Marino 741*3ff40c12SJohn Marino /** 742*3ff40c12SJohn Marino * privacy - Whether privacy is used in the BSS 743*3ff40c12SJohn Marino */ 744*3ff40c12SJohn Marino int privacy; 745*3ff40c12SJohn Marino 746*3ff40c12SJohn Marino /** 747*3ff40c12SJohn Marino * beacon_ies - WPS/P2P IE(s) for Beacon frames 748*3ff40c12SJohn Marino * 749*3ff40c12SJohn Marino * This is used to add IEs like WPS IE and P2P IE by drivers that do 750*3ff40c12SJohn Marino * not use the full Beacon template. 751*3ff40c12SJohn Marino */ 752*3ff40c12SJohn Marino const struct wpabuf *beacon_ies; 753*3ff40c12SJohn Marino 754*3ff40c12SJohn Marino /** 755*3ff40c12SJohn Marino * proberesp_ies - P2P/WPS IE(s) for Probe Response frames 756*3ff40c12SJohn Marino * 757*3ff40c12SJohn Marino * This is used to add IEs like WPS IE and P2P IE by drivers that 758*3ff40c12SJohn Marino * reply to Probe Request frames internally. 759*3ff40c12SJohn Marino */ 760*3ff40c12SJohn Marino const struct wpabuf *proberesp_ies; 761*3ff40c12SJohn Marino 762*3ff40c12SJohn Marino /** 763*3ff40c12SJohn Marino * assocresp_ies - WPS IE(s) for (Re)Association Response frames 764*3ff40c12SJohn Marino * 765*3ff40c12SJohn Marino * This is used to add IEs like WPS IE by drivers that reply to 766*3ff40c12SJohn Marino * (Re)Association Request frames internally. 767*3ff40c12SJohn Marino */ 768*3ff40c12SJohn Marino const struct wpabuf *assocresp_ies; 769*3ff40c12SJohn Marino 770*3ff40c12SJohn Marino /** 771*3ff40c12SJohn Marino * isolate - Whether to isolate frames between associated stations 772*3ff40c12SJohn Marino * 773*3ff40c12SJohn Marino * If this is non-zero, the AP is requested to disable forwarding of 774*3ff40c12SJohn Marino * frames between associated stations. 775*3ff40c12SJohn Marino */ 776*3ff40c12SJohn Marino int isolate; 777*3ff40c12SJohn Marino 778*3ff40c12SJohn Marino /** 779*3ff40c12SJohn Marino * cts_protect - Whether CTS protection is enabled 780*3ff40c12SJohn Marino */ 781*3ff40c12SJohn Marino int cts_protect; 782*3ff40c12SJohn Marino 783*3ff40c12SJohn Marino /** 784*3ff40c12SJohn Marino * preamble - Whether short preamble is enabled 785*3ff40c12SJohn Marino */ 786*3ff40c12SJohn Marino int preamble; 787*3ff40c12SJohn Marino 788*3ff40c12SJohn Marino /** 789*3ff40c12SJohn Marino * short_slot_time - Whether short slot time is enabled 790*3ff40c12SJohn Marino * 791*3ff40c12SJohn Marino * 0 = short slot time disable, 1 = short slot time enabled, -1 = do 792*3ff40c12SJohn Marino * not set (e.g., when 802.11g mode is not in use) 793*3ff40c12SJohn Marino */ 794*3ff40c12SJohn Marino int short_slot_time; 795*3ff40c12SJohn Marino 796*3ff40c12SJohn Marino /** 797*3ff40c12SJohn Marino * ht_opmode - HT operation mode or -1 if HT not in use 798*3ff40c12SJohn Marino */ 799*3ff40c12SJohn Marino int ht_opmode; 800*3ff40c12SJohn Marino 801*3ff40c12SJohn Marino /** 802*3ff40c12SJohn Marino * interworking - Whether Interworking is enabled 803*3ff40c12SJohn Marino */ 804*3ff40c12SJohn Marino int interworking; 805*3ff40c12SJohn Marino 806*3ff40c12SJohn Marino /** 807*3ff40c12SJohn Marino * hessid - Homogeneous ESS identifier or %NULL if not set 808*3ff40c12SJohn Marino */ 809*3ff40c12SJohn Marino const u8 *hessid; 810*3ff40c12SJohn Marino 811*3ff40c12SJohn Marino /** 812*3ff40c12SJohn Marino * access_network_type - Access Network Type (0..15) 813*3ff40c12SJohn Marino * 814*3ff40c12SJohn Marino * This is used for filtering Probe Request frames when Interworking is 815*3ff40c12SJohn Marino * enabled. 816*3ff40c12SJohn Marino */ 817*3ff40c12SJohn Marino u8 access_network_type; 818*3ff40c12SJohn Marino 819*3ff40c12SJohn Marino /** 820*3ff40c12SJohn Marino * ap_max_inactivity - Timeout in seconds to detect STA's inactivity 821*3ff40c12SJohn Marino * 822*3ff40c12SJohn Marino * This is used by driver which advertises this capability. 823*3ff40c12SJohn Marino */ 824*3ff40c12SJohn Marino int ap_max_inactivity; 825*3ff40c12SJohn Marino 826*3ff40c12SJohn Marino /** 827*3ff40c12SJohn Marino * disable_dgaf - Whether group-addressed frames are disabled 828*3ff40c12SJohn Marino */ 829*3ff40c12SJohn Marino int disable_dgaf; 8306d49e1aeSJan Lentfer }; 8316d49e1aeSJan Lentfer 8326d49e1aeSJan Lentfer /** 8336d49e1aeSJan Lentfer * struct wpa_driver_capa - Driver capability information 8346d49e1aeSJan Lentfer */ 8356d49e1aeSJan Lentfer struct wpa_driver_capa { 8366d49e1aeSJan Lentfer #define WPA_DRIVER_CAPA_KEY_MGMT_WPA 0x00000001 8376d49e1aeSJan Lentfer #define WPA_DRIVER_CAPA_KEY_MGMT_WPA2 0x00000002 8386d49e1aeSJan Lentfer #define WPA_DRIVER_CAPA_KEY_MGMT_WPA_PSK 0x00000004 8396d49e1aeSJan Lentfer #define WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK 0x00000008 8406d49e1aeSJan Lentfer #define WPA_DRIVER_CAPA_KEY_MGMT_WPA_NONE 0x00000010 8416d49e1aeSJan Lentfer #define WPA_DRIVER_CAPA_KEY_MGMT_FT 0x00000020 8426d49e1aeSJan Lentfer #define WPA_DRIVER_CAPA_KEY_MGMT_FT_PSK 0x00000040 843*3ff40c12SJohn Marino #define WPA_DRIVER_CAPA_KEY_MGMT_WAPI_PSK 0x00000080 8446d49e1aeSJan Lentfer unsigned int key_mgmt; 8456d49e1aeSJan Lentfer 8466d49e1aeSJan Lentfer #define WPA_DRIVER_CAPA_ENC_WEP40 0x00000001 8476d49e1aeSJan Lentfer #define WPA_DRIVER_CAPA_ENC_WEP104 0x00000002 8486d49e1aeSJan Lentfer #define WPA_DRIVER_CAPA_ENC_TKIP 0x00000004 8496d49e1aeSJan Lentfer #define WPA_DRIVER_CAPA_ENC_CCMP 0x00000008 850*3ff40c12SJohn Marino #define WPA_DRIVER_CAPA_ENC_WEP128 0x00000010 851*3ff40c12SJohn Marino #define WPA_DRIVER_CAPA_ENC_GCMP 0x00000020 852*3ff40c12SJohn Marino #define WPA_DRIVER_CAPA_ENC_GCMP_256 0x00000040 853*3ff40c12SJohn Marino #define WPA_DRIVER_CAPA_ENC_CCMP_256 0x00000080 854*3ff40c12SJohn Marino #define WPA_DRIVER_CAPA_ENC_BIP 0x00000100 855*3ff40c12SJohn Marino #define WPA_DRIVER_CAPA_ENC_BIP_GMAC_128 0x00000200 856*3ff40c12SJohn Marino #define WPA_DRIVER_CAPA_ENC_BIP_GMAC_256 0x00000400 857*3ff40c12SJohn Marino #define WPA_DRIVER_CAPA_ENC_BIP_CMAC_256 0x00000800 8586d49e1aeSJan Lentfer unsigned int enc; 8596d49e1aeSJan Lentfer 8606d49e1aeSJan Lentfer #define WPA_DRIVER_AUTH_OPEN 0x00000001 8616d49e1aeSJan Lentfer #define WPA_DRIVER_AUTH_SHARED 0x00000002 8626d49e1aeSJan Lentfer #define WPA_DRIVER_AUTH_LEAP 0x00000004 8636d49e1aeSJan Lentfer unsigned int auth; 8646d49e1aeSJan Lentfer 8656d49e1aeSJan Lentfer /* Driver generated WPA/RSN IE */ 8666d49e1aeSJan Lentfer #define WPA_DRIVER_FLAGS_DRIVER_IE 0x00000001 867*3ff40c12SJohn Marino /* Driver needs static WEP key setup after association command */ 8686d49e1aeSJan Lentfer #define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC 0x00000002 869*3ff40c12SJohn Marino /* unused: 0x00000004 */ 8706d49e1aeSJan Lentfer /* Driver takes care of RSN 4-way handshake internally; PMK is configured with 8716d49e1aeSJan Lentfer * struct wpa_driver_ops::set_key using alg = WPA_ALG_PMK */ 8726d49e1aeSJan Lentfer #define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE 0x00000008 873*3ff40c12SJohn Marino #define WPA_DRIVER_FLAGS_WIRED 0x00000010 874*3ff40c12SJohn Marino /* Driver provides separate commands for authentication and association (SME in 875*3ff40c12SJohn Marino * wpa_supplicant). */ 876*3ff40c12SJohn Marino #define WPA_DRIVER_FLAGS_SME 0x00000020 877*3ff40c12SJohn Marino /* Driver supports AP mode */ 878*3ff40c12SJohn Marino #define WPA_DRIVER_FLAGS_AP 0x00000040 879*3ff40c12SJohn Marino /* Driver needs static WEP key setup after association has been completed */ 880*3ff40c12SJohn Marino #define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE 0x00000080 881*3ff40c12SJohn Marino /* unused: 0x00000100 */ 882*3ff40c12SJohn Marino /* Driver supports concurrent P2P operations */ 883*3ff40c12SJohn Marino #define WPA_DRIVER_FLAGS_P2P_CONCURRENT 0x00000200 884*3ff40c12SJohn Marino /* 885*3ff40c12SJohn Marino * Driver uses the initial interface as a dedicated management interface, i.e., 886*3ff40c12SJohn Marino * it cannot be used for P2P group operations or non-P2P purposes. 887*3ff40c12SJohn Marino */ 888*3ff40c12SJohn Marino #define WPA_DRIVER_FLAGS_P2P_DEDICATED_INTERFACE 0x00000400 889*3ff40c12SJohn Marino /* This interface is P2P capable (P2P GO or P2P Client) */ 890*3ff40c12SJohn Marino #define WPA_DRIVER_FLAGS_P2P_CAPABLE 0x00000800 891*3ff40c12SJohn Marino /* unused: 0x00001000 */ 892*3ff40c12SJohn Marino /* 893*3ff40c12SJohn Marino * Driver uses the initial interface for P2P management interface and non-P2P 894*3ff40c12SJohn Marino * purposes (e.g., connect to infra AP), but this interface cannot be used for 895*3ff40c12SJohn Marino * P2P group operations. 896*3ff40c12SJohn Marino */ 897*3ff40c12SJohn Marino #define WPA_DRIVER_FLAGS_P2P_MGMT_AND_NON_P2P 0x00002000 898*3ff40c12SJohn Marino /* 899*3ff40c12SJohn Marino * Driver is known to use sane error codes, i.e., when it indicates that 900*3ff40c12SJohn Marino * something (e.g., association) fails, there was indeed a failure and the 901*3ff40c12SJohn Marino * operation does not end up getting completed successfully later. 902*3ff40c12SJohn Marino */ 903*3ff40c12SJohn Marino #define WPA_DRIVER_FLAGS_SANE_ERROR_CODES 0x00004000 904*3ff40c12SJohn Marino /* Driver supports off-channel TX */ 905*3ff40c12SJohn Marino #define WPA_DRIVER_FLAGS_OFFCHANNEL_TX 0x00008000 906*3ff40c12SJohn Marino /* Driver indicates TX status events for EAPOL Data frames */ 907*3ff40c12SJohn Marino #define WPA_DRIVER_FLAGS_EAPOL_TX_STATUS 0x00010000 908*3ff40c12SJohn Marino /* Driver indicates TX status events for Deauth/Disassoc frames */ 909*3ff40c12SJohn Marino #define WPA_DRIVER_FLAGS_DEAUTH_TX_STATUS 0x00020000 910*3ff40c12SJohn Marino /* Driver supports roaming (BSS selection) in firmware */ 911*3ff40c12SJohn Marino #define WPA_DRIVER_FLAGS_BSS_SELECTION 0x00040000 912*3ff40c12SJohn Marino /* Driver supports operating as a TDLS peer */ 913*3ff40c12SJohn Marino #define WPA_DRIVER_FLAGS_TDLS_SUPPORT 0x00080000 914*3ff40c12SJohn Marino /* Driver requires external TDLS setup/teardown/discovery */ 915*3ff40c12SJohn Marino #define WPA_DRIVER_FLAGS_TDLS_EXTERNAL_SETUP 0x00100000 916*3ff40c12SJohn Marino /* Driver indicates support for Probe Response offloading in AP mode */ 917*3ff40c12SJohn Marino #define WPA_DRIVER_FLAGS_PROBE_RESP_OFFLOAD 0x00200000 918*3ff40c12SJohn Marino /* Driver supports U-APSD in AP mode */ 919*3ff40c12SJohn Marino #define WPA_DRIVER_FLAGS_AP_UAPSD 0x00400000 920*3ff40c12SJohn Marino /* Driver supports inactivity timer in AP mode */ 921*3ff40c12SJohn Marino #define WPA_DRIVER_FLAGS_INACTIVITY_TIMER 0x00800000 922*3ff40c12SJohn Marino /* Driver expects user space implementation of MLME in AP mode */ 923*3ff40c12SJohn Marino #define WPA_DRIVER_FLAGS_AP_MLME 0x01000000 924*3ff40c12SJohn Marino /* Driver supports SAE with user space SME */ 925*3ff40c12SJohn Marino #define WPA_DRIVER_FLAGS_SAE 0x02000000 926*3ff40c12SJohn Marino /* Driver makes use of OBSS scan mechanism in wpa_supplicant */ 927*3ff40c12SJohn Marino #define WPA_DRIVER_FLAGS_OBSS_SCAN 0x04000000 928*3ff40c12SJohn Marino /* Driver supports IBSS (Ad-hoc) mode */ 929*3ff40c12SJohn Marino #define WPA_DRIVER_FLAGS_IBSS 0x08000000 930*3ff40c12SJohn Marino /* Driver supports radar detection */ 931*3ff40c12SJohn Marino #define WPA_DRIVER_FLAGS_RADAR 0x10000000 932*3ff40c12SJohn Marino /* Driver supports a dedicated interface for P2P Device */ 933*3ff40c12SJohn Marino #define WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE 0x20000000 934*3ff40c12SJohn Marino /* Driver supports QoS Mapping */ 935*3ff40c12SJohn Marino #define WPA_DRIVER_FLAGS_QOS_MAPPING 0x40000000 936*3ff40c12SJohn Marino /* Driver supports CSA in AP mode */ 937*3ff40c12SJohn Marino #define WPA_DRIVER_FLAGS_AP_CSA 0x80000000 9386d49e1aeSJan Lentfer unsigned int flags; 939*3ff40c12SJohn Marino 940*3ff40c12SJohn Marino int max_scan_ssids; 941*3ff40c12SJohn Marino int max_sched_scan_ssids; 942*3ff40c12SJohn Marino int sched_scan_supported; 943*3ff40c12SJohn Marino int max_match_sets; 944*3ff40c12SJohn Marino 945*3ff40c12SJohn Marino /** 946*3ff40c12SJohn Marino * max_remain_on_chan - Maximum remain-on-channel duration in msec 947*3ff40c12SJohn Marino */ 948*3ff40c12SJohn Marino unsigned int max_remain_on_chan; 949*3ff40c12SJohn Marino 950*3ff40c12SJohn Marino /** 951*3ff40c12SJohn Marino * max_stations - Maximum number of associated stations the driver 952*3ff40c12SJohn Marino * supports in AP mode 953*3ff40c12SJohn Marino */ 954*3ff40c12SJohn Marino unsigned int max_stations; 955*3ff40c12SJohn Marino 956*3ff40c12SJohn Marino /** 957*3ff40c12SJohn Marino * probe_resp_offloads - Bitmap of supported protocols by the driver 958*3ff40c12SJohn Marino * for Probe Response offloading. 959*3ff40c12SJohn Marino */ 960*3ff40c12SJohn Marino /* Driver Probe Response offloading support for WPS ver. 1 */ 961*3ff40c12SJohn Marino #define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS 0x00000001 962*3ff40c12SJohn Marino /* Driver Probe Response offloading support for WPS ver. 2 */ 963*3ff40c12SJohn Marino #define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS2 0x00000002 964*3ff40c12SJohn Marino /* Driver Probe Response offloading support for P2P */ 965*3ff40c12SJohn Marino #define WPA_DRIVER_PROBE_RESP_OFFLOAD_P2P 0x00000004 966*3ff40c12SJohn Marino /* Driver Probe Response offloading support for IEEE 802.11u (Interworking) */ 967*3ff40c12SJohn Marino #define WPA_DRIVER_PROBE_RESP_OFFLOAD_INTERWORKING 0x00000008 968*3ff40c12SJohn Marino unsigned int probe_resp_offloads; 969*3ff40c12SJohn Marino 970*3ff40c12SJohn Marino unsigned int max_acl_mac_addrs; 971*3ff40c12SJohn Marino 972*3ff40c12SJohn Marino /** 973*3ff40c12SJohn Marino * Number of supported concurrent channels 974*3ff40c12SJohn Marino */ 975*3ff40c12SJohn Marino unsigned int num_multichan_concurrent; 976*3ff40c12SJohn Marino 977*3ff40c12SJohn Marino /** 978*3ff40c12SJohn Marino * extended_capa - extended capabilities in driver/device 979*3ff40c12SJohn Marino * 980*3ff40c12SJohn Marino * Must be allocated and freed by driver and the pointers must be 981*3ff40c12SJohn Marino * valid for the lifetime of the driver, i.e., freed in deinit() 982*3ff40c12SJohn Marino */ 983*3ff40c12SJohn Marino const u8 *extended_capa, *extended_capa_mask; 984*3ff40c12SJohn Marino unsigned int extended_capa_len; 9856d49e1aeSJan Lentfer }; 9866d49e1aeSJan Lentfer 9876d49e1aeSJan Lentfer 988*3ff40c12SJohn Marino struct hostapd_data; 9896d49e1aeSJan Lentfer 990*3ff40c12SJohn Marino struct hostap_sta_driver_data { 991*3ff40c12SJohn Marino unsigned long rx_packets, tx_packets, rx_bytes, tx_bytes; 992*3ff40c12SJohn Marino unsigned long current_tx_rate; 993*3ff40c12SJohn Marino unsigned long inactive_msec; 994*3ff40c12SJohn Marino unsigned long flags; 995*3ff40c12SJohn Marino unsigned long num_ps_buf_frames; 996*3ff40c12SJohn Marino unsigned long tx_retry_failed; 997*3ff40c12SJohn Marino unsigned long tx_retry_count; 998*3ff40c12SJohn Marino int last_rssi; 999*3ff40c12SJohn Marino int last_ack_rssi; 10006d49e1aeSJan Lentfer }; 10016d49e1aeSJan Lentfer 1002*3ff40c12SJohn Marino struct hostapd_sta_add_params { 1003*3ff40c12SJohn Marino const u8 *addr; 1004*3ff40c12SJohn Marino u16 aid; 1005*3ff40c12SJohn Marino u16 capability; 1006*3ff40c12SJohn Marino const u8 *supp_rates; 1007*3ff40c12SJohn Marino size_t supp_rates_len; 1008*3ff40c12SJohn Marino u16 listen_interval; 1009*3ff40c12SJohn Marino const struct ieee80211_ht_capabilities *ht_capabilities; 1010*3ff40c12SJohn Marino const struct ieee80211_vht_capabilities *vht_capabilities; 1011*3ff40c12SJohn Marino u32 flags; /* bitmask of WPA_STA_* flags */ 1012*3ff40c12SJohn Marino int set; /* Set STA parameters instead of add */ 1013*3ff40c12SJohn Marino u8 qosinfo; 1014*3ff40c12SJohn Marino const u8 *ext_capab; 1015*3ff40c12SJohn Marino size_t ext_capab_len; 1016*3ff40c12SJohn Marino const u8 *supp_channels; 1017*3ff40c12SJohn Marino size_t supp_channels_len; 1018*3ff40c12SJohn Marino const u8 *supp_oper_classes; 1019*3ff40c12SJohn Marino size_t supp_oper_classes_len; 10206d49e1aeSJan Lentfer }; 10216d49e1aeSJan Lentfer 1022*3ff40c12SJohn Marino struct hostapd_freq_params { 1023*3ff40c12SJohn Marino int mode; 1024*3ff40c12SJohn Marino int freq; 10256d49e1aeSJan Lentfer int channel; 1026*3ff40c12SJohn Marino /* for HT */ 1027*3ff40c12SJohn Marino int ht_enabled; 1028*3ff40c12SJohn Marino int sec_channel_offset; /* 0 = HT40 disabled, -1 = HT40 enabled, 1029*3ff40c12SJohn Marino * secondary channel below primary, 1 = HT40 1030*3ff40c12SJohn Marino * enabled, secondary channel above primary */ 1031*3ff40c12SJohn Marino 1032*3ff40c12SJohn Marino /* for VHT */ 1033*3ff40c12SJohn Marino int vht_enabled; 1034*3ff40c12SJohn Marino 1035*3ff40c12SJohn Marino /* valid for both HT and VHT, center_freq2 is non-zero 1036*3ff40c12SJohn Marino * only for bandwidth 80 and an 80+80 channel */ 1037*3ff40c12SJohn Marino int center_freq1, center_freq2; 1038*3ff40c12SJohn Marino int bandwidth; 10396d49e1aeSJan Lentfer }; 10406d49e1aeSJan Lentfer 1041*3ff40c12SJohn Marino struct mac_address { 1042*3ff40c12SJohn Marino u8 addr[ETH_ALEN]; 1043*3ff40c12SJohn Marino }; 1044*3ff40c12SJohn Marino 1045*3ff40c12SJohn Marino struct hostapd_acl_params { 1046*3ff40c12SJohn Marino u8 acl_policy; 1047*3ff40c12SJohn Marino unsigned int num_mac_acl; 1048*3ff40c12SJohn Marino struct mac_address mac_acl[0]; 1049*3ff40c12SJohn Marino }; 1050*3ff40c12SJohn Marino 1051*3ff40c12SJohn Marino enum wpa_driver_if_type { 1052*3ff40c12SJohn Marino /** 1053*3ff40c12SJohn Marino * WPA_IF_STATION - Station mode interface 1054*3ff40c12SJohn Marino */ 1055*3ff40c12SJohn Marino WPA_IF_STATION, 1056*3ff40c12SJohn Marino 1057*3ff40c12SJohn Marino /** 1058*3ff40c12SJohn Marino * WPA_IF_AP_VLAN - AP mode VLAN interface 1059*3ff40c12SJohn Marino * 1060*3ff40c12SJohn Marino * This interface shares its address and Beacon frame with the main 1061*3ff40c12SJohn Marino * BSS. 1062*3ff40c12SJohn Marino */ 1063*3ff40c12SJohn Marino WPA_IF_AP_VLAN, 1064*3ff40c12SJohn Marino 1065*3ff40c12SJohn Marino /** 1066*3ff40c12SJohn Marino * WPA_IF_AP_BSS - AP mode BSS interface 1067*3ff40c12SJohn Marino * 1068*3ff40c12SJohn Marino * This interface has its own address and Beacon frame. 1069*3ff40c12SJohn Marino */ 1070*3ff40c12SJohn Marino WPA_IF_AP_BSS, 1071*3ff40c12SJohn Marino 1072*3ff40c12SJohn Marino /** 1073*3ff40c12SJohn Marino * WPA_IF_P2P_GO - P2P Group Owner 1074*3ff40c12SJohn Marino */ 1075*3ff40c12SJohn Marino WPA_IF_P2P_GO, 1076*3ff40c12SJohn Marino 1077*3ff40c12SJohn Marino /** 1078*3ff40c12SJohn Marino * WPA_IF_P2P_CLIENT - P2P Client 1079*3ff40c12SJohn Marino */ 1080*3ff40c12SJohn Marino WPA_IF_P2P_CLIENT, 1081*3ff40c12SJohn Marino 1082*3ff40c12SJohn Marino /** 1083*3ff40c12SJohn Marino * WPA_IF_P2P_GROUP - P2P Group interface (will become either 1084*3ff40c12SJohn Marino * WPA_IF_P2P_GO or WPA_IF_P2P_CLIENT, but the role is not yet known) 1085*3ff40c12SJohn Marino */ 1086*3ff40c12SJohn Marino WPA_IF_P2P_GROUP, 1087*3ff40c12SJohn Marino 1088*3ff40c12SJohn Marino /** 1089*3ff40c12SJohn Marino * WPA_IF_P2P_DEVICE - P2P Device interface is used to indentify the 1090*3ff40c12SJohn Marino * abstracted P2P Device function in the driver 1091*3ff40c12SJohn Marino */ 1092*3ff40c12SJohn Marino WPA_IF_P2P_DEVICE 1093*3ff40c12SJohn Marino }; 1094*3ff40c12SJohn Marino 1095*3ff40c12SJohn Marino struct wpa_init_params { 1096*3ff40c12SJohn Marino void *global_priv; 1097*3ff40c12SJohn Marino const u8 *bssid; 1098*3ff40c12SJohn Marino const char *ifname; 1099*3ff40c12SJohn Marino const u8 *ssid; 1100*3ff40c12SJohn Marino size_t ssid_len; 1101*3ff40c12SJohn Marino const char *test_socket; 1102*3ff40c12SJohn Marino int use_pae_group_addr; 1103*3ff40c12SJohn Marino char **bridge; 1104*3ff40c12SJohn Marino size_t num_bridge; 1105*3ff40c12SJohn Marino 1106*3ff40c12SJohn Marino u8 *own_addr; /* buffer for writing own MAC address */ 1107*3ff40c12SJohn Marino }; 1108*3ff40c12SJohn Marino 1109*3ff40c12SJohn Marino 1110*3ff40c12SJohn Marino struct wpa_bss_params { 1111*3ff40c12SJohn Marino /** Interface name (for multi-SSID/VLAN support) */ 1112*3ff40c12SJohn Marino const char *ifname; 1113*3ff40c12SJohn Marino /** Whether IEEE 802.1X or WPA/WPA2 is enabled */ 1114*3ff40c12SJohn Marino int enabled; 1115*3ff40c12SJohn Marino 1116*3ff40c12SJohn Marino int wpa; 1117*3ff40c12SJohn Marino int ieee802_1x; 1118*3ff40c12SJohn Marino int wpa_group; 1119*3ff40c12SJohn Marino int wpa_pairwise; 1120*3ff40c12SJohn Marino int wpa_key_mgmt; 1121*3ff40c12SJohn Marino int rsn_preauth; 1122*3ff40c12SJohn Marino enum mfp_options ieee80211w; 1123*3ff40c12SJohn Marino }; 1124*3ff40c12SJohn Marino 1125*3ff40c12SJohn Marino #define WPA_STA_AUTHORIZED BIT(0) 1126*3ff40c12SJohn Marino #define WPA_STA_WMM BIT(1) 1127*3ff40c12SJohn Marino #define WPA_STA_SHORT_PREAMBLE BIT(2) 1128*3ff40c12SJohn Marino #define WPA_STA_MFP BIT(3) 1129*3ff40c12SJohn Marino #define WPA_STA_TDLS_PEER BIT(4) 1130*3ff40c12SJohn Marino 1131*3ff40c12SJohn Marino enum tdls_oper { 1132*3ff40c12SJohn Marino TDLS_DISCOVERY_REQ, 1133*3ff40c12SJohn Marino TDLS_SETUP, 1134*3ff40c12SJohn Marino TDLS_TEARDOWN, 1135*3ff40c12SJohn Marino TDLS_ENABLE_LINK, 1136*3ff40c12SJohn Marino TDLS_DISABLE_LINK, 1137*3ff40c12SJohn Marino TDLS_ENABLE, 1138*3ff40c12SJohn Marino TDLS_DISABLE 1139*3ff40c12SJohn Marino }; 1140*3ff40c12SJohn Marino 1141*3ff40c12SJohn Marino enum wnm_oper { 1142*3ff40c12SJohn Marino WNM_SLEEP_ENTER_CONFIRM, 1143*3ff40c12SJohn Marino WNM_SLEEP_ENTER_FAIL, 1144*3ff40c12SJohn Marino WNM_SLEEP_EXIT_CONFIRM, 1145*3ff40c12SJohn Marino WNM_SLEEP_EXIT_FAIL, 1146*3ff40c12SJohn Marino WNM_SLEEP_TFS_REQ_IE_ADD, /* STA requests driver to add TFS req IE */ 1147*3ff40c12SJohn Marino WNM_SLEEP_TFS_REQ_IE_NONE, /* STA requests empty TFS req IE */ 1148*3ff40c12SJohn Marino WNM_SLEEP_TFS_REQ_IE_SET, /* AP requests driver to set TFS req IE for 1149*3ff40c12SJohn Marino * a STA */ 1150*3ff40c12SJohn Marino WNM_SLEEP_TFS_RESP_IE_ADD, /* AP requests driver to add TFS resp IE 1151*3ff40c12SJohn Marino * for a STA */ 1152*3ff40c12SJohn Marino WNM_SLEEP_TFS_RESP_IE_NONE, /* AP requests empty TFS resp IE */ 1153*3ff40c12SJohn Marino WNM_SLEEP_TFS_RESP_IE_SET, /* AP requests driver to set TFS resp IE 1154*3ff40c12SJohn Marino * for a STA */ 1155*3ff40c12SJohn Marino WNM_SLEEP_TFS_IE_DEL /* AP delete the TFS IE */ 1156*3ff40c12SJohn Marino }; 1157*3ff40c12SJohn Marino 1158*3ff40c12SJohn Marino /* enum chan_width - Channel width definitions */ 1159*3ff40c12SJohn Marino enum chan_width { 1160*3ff40c12SJohn Marino CHAN_WIDTH_20_NOHT, 1161*3ff40c12SJohn Marino CHAN_WIDTH_20, 1162*3ff40c12SJohn Marino CHAN_WIDTH_40, 1163*3ff40c12SJohn Marino CHAN_WIDTH_80, 1164*3ff40c12SJohn Marino CHAN_WIDTH_80P80, 1165*3ff40c12SJohn Marino CHAN_WIDTH_160, 1166*3ff40c12SJohn Marino CHAN_WIDTH_UNKNOWN 1167*3ff40c12SJohn Marino }; 1168*3ff40c12SJohn Marino 1169*3ff40c12SJohn Marino /** 1170*3ff40c12SJohn Marino * struct wpa_signal_info - Information about channel signal quality 1171*3ff40c12SJohn Marino */ 1172*3ff40c12SJohn Marino struct wpa_signal_info { 1173*3ff40c12SJohn Marino u32 frequency; 1174*3ff40c12SJohn Marino int above_threshold; 1175*3ff40c12SJohn Marino int current_signal; 1176*3ff40c12SJohn Marino int avg_signal; 1177*3ff40c12SJohn Marino int current_noise; 1178*3ff40c12SJohn Marino int current_txrate; 1179*3ff40c12SJohn Marino enum chan_width chanwidth; 1180*3ff40c12SJohn Marino int center_frq1; 1181*3ff40c12SJohn Marino int center_frq2; 1182*3ff40c12SJohn Marino }; 1183*3ff40c12SJohn Marino 1184*3ff40c12SJohn Marino /** 1185*3ff40c12SJohn Marino * struct beacon_data - Beacon data 1186*3ff40c12SJohn Marino * @head: Head portion of Beacon frame (before TIM IE) 1187*3ff40c12SJohn Marino * @tail: Tail portion of Beacon frame (after TIM IE) 1188*3ff40c12SJohn Marino * @beacon_ies: Extra information element(s) to add into Beacon frames or %NULL 1189*3ff40c12SJohn Marino * @proberesp_ies: Extra information element(s) to add into Probe Response 1190*3ff40c12SJohn Marino * frames or %NULL 1191*3ff40c12SJohn Marino * @assocresp_ies: Extra information element(s) to add into (Re)Association 1192*3ff40c12SJohn Marino * Response frames or %NULL 1193*3ff40c12SJohn Marino * @probe_resp: Probe Response frame template 1194*3ff40c12SJohn Marino * @head_len: Length of @head 1195*3ff40c12SJohn Marino * @tail_len: Length of @tail 1196*3ff40c12SJohn Marino * @beacon_ies_len: Length of beacon_ies in octets 1197*3ff40c12SJohn Marino * @proberesp_ies_len: Length of proberesp_ies in octets 1198*3ff40c12SJohn Marino * @proberesp_ies_len: Length of proberesp_ies in octets 1199*3ff40c12SJohn Marino * @probe_resp_len: Length of probe response template (@probe_resp) 1200*3ff40c12SJohn Marino */ 1201*3ff40c12SJohn Marino struct beacon_data { 1202*3ff40c12SJohn Marino u8 *head, *tail; 1203*3ff40c12SJohn Marino u8 *beacon_ies; 1204*3ff40c12SJohn Marino u8 *proberesp_ies; 1205*3ff40c12SJohn Marino u8 *assocresp_ies; 1206*3ff40c12SJohn Marino u8 *probe_resp; 1207*3ff40c12SJohn Marino 1208*3ff40c12SJohn Marino size_t head_len, tail_len; 1209*3ff40c12SJohn Marino size_t beacon_ies_len; 1210*3ff40c12SJohn Marino size_t proberesp_ies_len; 1211*3ff40c12SJohn Marino size_t assocresp_ies_len; 1212*3ff40c12SJohn Marino size_t probe_resp_len; 1213*3ff40c12SJohn Marino }; 1214*3ff40c12SJohn Marino 1215*3ff40c12SJohn Marino /** 1216*3ff40c12SJohn Marino * struct csa_settings - Settings for channel switch command 1217*3ff40c12SJohn Marino * @cs_count: Count in Beacon frames (TBTT) to perform the switch 1218*3ff40c12SJohn Marino * @block_tx: 1 - block transmission for CSA period 1219*3ff40c12SJohn Marino * @freq_params: Next channel frequency parameter 1220*3ff40c12SJohn Marino * @beacon_csa: Beacon/probe resp/asooc resp info for CSA period 1221*3ff40c12SJohn Marino * @beacon_after: Next beacon/probe resp/asooc resp info 1222*3ff40c12SJohn Marino * @counter_offset_beacon: Offset to the count field in beacon's tail 1223*3ff40c12SJohn Marino * @counter_offset_presp: Offset to the count field in probe resp. 1224*3ff40c12SJohn Marino */ 1225*3ff40c12SJohn Marino struct csa_settings { 1226*3ff40c12SJohn Marino u8 cs_count; 1227*3ff40c12SJohn Marino u8 block_tx; 1228*3ff40c12SJohn Marino 1229*3ff40c12SJohn Marino struct hostapd_freq_params freq_params; 1230*3ff40c12SJohn Marino struct beacon_data beacon_csa; 1231*3ff40c12SJohn Marino struct beacon_data beacon_after; 1232*3ff40c12SJohn Marino 1233*3ff40c12SJohn Marino u16 counter_offset_beacon; 1234*3ff40c12SJohn Marino u16 counter_offset_presp; 1235*3ff40c12SJohn Marino }; 12366d49e1aeSJan Lentfer 12376d49e1aeSJan Lentfer /** 12386d49e1aeSJan Lentfer * struct wpa_driver_ops - Driver interface API definition 12396d49e1aeSJan Lentfer * 12406d49e1aeSJan Lentfer * This structure defines the API that each driver interface needs to implement 12416d49e1aeSJan Lentfer * for core wpa_supplicant code. All driver specific functionality is captured 12426d49e1aeSJan Lentfer * in this wrapper. 12436d49e1aeSJan Lentfer */ 12446d49e1aeSJan Lentfer struct wpa_driver_ops { 12456d49e1aeSJan Lentfer /** Name of the driver interface */ 12466d49e1aeSJan Lentfer const char *name; 12476d49e1aeSJan Lentfer /** One line description of the driver interface */ 12486d49e1aeSJan Lentfer const char *desc; 12496d49e1aeSJan Lentfer 12506d49e1aeSJan Lentfer /** 12516d49e1aeSJan Lentfer * get_bssid - Get the current BSSID 12526d49e1aeSJan Lentfer * @priv: private driver interface data 12536d49e1aeSJan Lentfer * @bssid: buffer for BSSID (ETH_ALEN = 6 bytes) 12546d49e1aeSJan Lentfer * 12556d49e1aeSJan Lentfer * Returns: 0 on success, -1 on failure 12566d49e1aeSJan Lentfer * 12576d49e1aeSJan Lentfer * Query kernel driver for the current BSSID and copy it to bssid. 12586d49e1aeSJan Lentfer * Setting bssid to 00:00:00:00:00:00 is recommended if the STA is not 12596d49e1aeSJan Lentfer * associated. 12606d49e1aeSJan Lentfer */ 12616d49e1aeSJan Lentfer int (*get_bssid)(void *priv, u8 *bssid); 12626d49e1aeSJan Lentfer 12636d49e1aeSJan Lentfer /** 12646d49e1aeSJan Lentfer * get_ssid - Get the current SSID 12656d49e1aeSJan Lentfer * @priv: private driver interface data 12666d49e1aeSJan Lentfer * @ssid: buffer for SSID (at least 32 bytes) 12676d49e1aeSJan Lentfer * 12686d49e1aeSJan Lentfer * Returns: Length of the SSID on success, -1 on failure 12696d49e1aeSJan Lentfer * 12706d49e1aeSJan Lentfer * Query kernel driver for the current SSID and copy it to ssid. 12716d49e1aeSJan Lentfer * Returning zero is recommended if the STA is not associated. 12726d49e1aeSJan Lentfer * 12736d49e1aeSJan Lentfer * Note: SSID is an array of octets, i.e., it is not nul terminated and 12746d49e1aeSJan Lentfer * can, at least in theory, contain control characters (including nul) 12756d49e1aeSJan Lentfer * and as such, should be processed as binary data, not a printable 12766d49e1aeSJan Lentfer * string. 12776d49e1aeSJan Lentfer */ 12786d49e1aeSJan Lentfer int (*get_ssid)(void *priv, u8 *ssid); 12796d49e1aeSJan Lentfer 12806d49e1aeSJan Lentfer /** 12816d49e1aeSJan Lentfer * set_key - Configure encryption key 1282*3ff40c12SJohn Marino * @ifname: Interface name (for multi-SSID/VLAN support) 12836d49e1aeSJan Lentfer * @priv: private driver interface data 12846d49e1aeSJan Lentfer * @alg: encryption algorithm (%WPA_ALG_NONE, %WPA_ALG_WEP, 1285*3ff40c12SJohn Marino * %WPA_ALG_TKIP, %WPA_ALG_CCMP, %WPA_ALG_IGTK, %WPA_ALG_PMK, 1286*3ff40c12SJohn Marino * %WPA_ALG_GCMP, %WPA_ALG_GCMP_256, %WPA_ALG_CCMP_256, 1287*3ff40c12SJohn Marino * %WPA_ALG_BIP_GMAC_128, %WPA_ALG_BIP_GMAC_256, 1288*3ff40c12SJohn Marino * %WPA_ALG_BIP_CMAC_256); 12896d49e1aeSJan Lentfer * %WPA_ALG_NONE clears the key. 1290*3ff40c12SJohn Marino * @addr: Address of the peer STA (BSSID of the current AP when setting 1291*3ff40c12SJohn Marino * pairwise key in station mode), ff:ff:ff:ff:ff:ff for 1292*3ff40c12SJohn Marino * broadcast keys, %NULL for default keys that are used both for 1293*3ff40c12SJohn Marino * broadcast and unicast; when clearing keys, %NULL is used to 1294*3ff40c12SJohn Marino * indicate that both the broadcast-only and default key of the 1295*3ff40c12SJohn Marino * specified key index is to be cleared 12966d49e1aeSJan Lentfer * @key_idx: key index (0..3), usually 0 for unicast keys; 0..4095 for 12976d49e1aeSJan Lentfer * IGTK 12986d49e1aeSJan Lentfer * @set_tx: configure this key as the default Tx key (only used when 12996d49e1aeSJan Lentfer * driver does not support separate unicast/individual key 13006d49e1aeSJan Lentfer * @seq: sequence number/packet number, seq_len octets, the next 13016d49e1aeSJan Lentfer * packet number to be used for in replay protection; configured 13026d49e1aeSJan Lentfer * for Rx keys (in most cases, this is only used with broadcast 1303*3ff40c12SJohn Marino * keys and set to zero for unicast keys); %NULL if not set 13046d49e1aeSJan Lentfer * @seq_len: length of the seq, depends on the algorithm: 1305*3ff40c12SJohn Marino * TKIP: 6 octets, CCMP/GCMP: 6 octets, IGTK: 6 octets 13066d49e1aeSJan Lentfer * @key: key buffer; TKIP: 16-byte temporal key, 8-byte Tx Mic key, 13076d49e1aeSJan Lentfer * 8-byte Rx Mic Key 13086d49e1aeSJan Lentfer * @key_len: length of the key buffer in octets (WEP: 5 or 13, 1309*3ff40c12SJohn Marino * TKIP: 32, CCMP/GCMP: 16, IGTK: 16) 13106d49e1aeSJan Lentfer * 13116d49e1aeSJan Lentfer * Returns: 0 on success, -1 on failure 13126d49e1aeSJan Lentfer * 13136d49e1aeSJan Lentfer * Configure the given key for the kernel driver. If the driver 13146d49e1aeSJan Lentfer * supports separate individual keys (4 default keys + 1 individual), 13156d49e1aeSJan Lentfer * addr can be used to determine whether the key is default or 13166d49e1aeSJan Lentfer * individual. If only 4 keys are supported, the default key with key 13176d49e1aeSJan Lentfer * index 0 is used as the individual key. STA must be configured to use 13186d49e1aeSJan Lentfer * it as the default Tx key (set_tx is set) and accept Rx for all the 13196d49e1aeSJan Lentfer * key indexes. In most cases, WPA uses only key indexes 1 and 2 for 13206d49e1aeSJan Lentfer * broadcast keys, so key index 0 is available for this kind of 13216d49e1aeSJan Lentfer * configuration. 13226d49e1aeSJan Lentfer * 13236d49e1aeSJan Lentfer * Please note that TKIP keys include separate TX and RX MIC keys and 13246d49e1aeSJan Lentfer * some drivers may expect them in different order than wpa_supplicant 13256d49e1aeSJan Lentfer * is using. If the TX/RX keys are swapped, all TKIP encrypted packets 1326*3ff40c12SJohn Marino * will trigger Michael MIC errors. This can be fixed by changing the 13276d49e1aeSJan Lentfer * order of MIC keys by swapping te bytes 16..23 and 24..31 of the key 13286d49e1aeSJan Lentfer * in driver_*.c set_key() implementation, see driver_ndis.c for an 13296d49e1aeSJan Lentfer * example on how this can be done. 13306d49e1aeSJan Lentfer */ 1331*3ff40c12SJohn Marino int (*set_key)(const char *ifname, void *priv, enum wpa_alg alg, 1332*3ff40c12SJohn Marino const u8 *addr, int key_idx, int set_tx, 1333*3ff40c12SJohn Marino const u8 *seq, size_t seq_len, 13346d49e1aeSJan Lentfer const u8 *key, size_t key_len); 13356d49e1aeSJan Lentfer 13366d49e1aeSJan Lentfer /** 13376d49e1aeSJan Lentfer * init - Initialize driver interface 13386d49e1aeSJan Lentfer * @ctx: context to be used when calling wpa_supplicant functions, 13396d49e1aeSJan Lentfer * e.g., wpa_supplicant_event() 13406d49e1aeSJan Lentfer * @ifname: interface name, e.g., wlan0 13416d49e1aeSJan Lentfer * 13426d49e1aeSJan Lentfer * Returns: Pointer to private data, %NULL on failure 13436d49e1aeSJan Lentfer * 13446d49e1aeSJan Lentfer * Initialize driver interface, including event processing for kernel 13456d49e1aeSJan Lentfer * driver events (e.g., associated, scan results, Michael MIC failure). 13466d49e1aeSJan Lentfer * This function can allocate a private configuration data area for 13476d49e1aeSJan Lentfer * @ctx, file descriptor, interface name, etc. information that may be 13486d49e1aeSJan Lentfer * needed in future driver operations. If this is not used, non-NULL 13496d49e1aeSJan Lentfer * value will need to be returned because %NULL is used to indicate 13506d49e1aeSJan Lentfer * failure. The returned value will be used as 'void *priv' data for 13516d49e1aeSJan Lentfer * all other driver_ops functions. 13526d49e1aeSJan Lentfer * 13536d49e1aeSJan Lentfer * The main event loop (eloop.c) of wpa_supplicant can be used to 13546d49e1aeSJan Lentfer * register callback for read sockets (eloop_register_read_sock()). 13556d49e1aeSJan Lentfer * 13566d49e1aeSJan Lentfer * See below for more information about events and 13576d49e1aeSJan Lentfer * wpa_supplicant_event() function. 13586d49e1aeSJan Lentfer */ 13596d49e1aeSJan Lentfer void * (*init)(void *ctx, const char *ifname); 13606d49e1aeSJan Lentfer 13616d49e1aeSJan Lentfer /** 13626d49e1aeSJan Lentfer * deinit - Deinitialize driver interface 13636d49e1aeSJan Lentfer * @priv: private driver interface data from init() 13646d49e1aeSJan Lentfer * 13656d49e1aeSJan Lentfer * Shut down driver interface and processing of driver events. Free 13666d49e1aeSJan Lentfer * private data buffer if one was allocated in init() handler. 13676d49e1aeSJan Lentfer */ 13686d49e1aeSJan Lentfer void (*deinit)(void *priv); 13696d49e1aeSJan Lentfer 13706d49e1aeSJan Lentfer /** 13716d49e1aeSJan Lentfer * set_param - Set driver configuration parameters 13726d49e1aeSJan Lentfer * @priv: private driver interface data from init() 13736d49e1aeSJan Lentfer * @param: driver specific configuration parameters 13746d49e1aeSJan Lentfer * 13756d49e1aeSJan Lentfer * Returns: 0 on success, -1 on failure 13766d49e1aeSJan Lentfer * 13776d49e1aeSJan Lentfer * Optional handler for notifying driver interface about configuration 13786d49e1aeSJan Lentfer * parameters (driver_param). 13796d49e1aeSJan Lentfer */ 13806d49e1aeSJan Lentfer int (*set_param)(void *priv, const char *param); 13816d49e1aeSJan Lentfer 13826d49e1aeSJan Lentfer /** 13836d49e1aeSJan Lentfer * set_countermeasures - Enable/disable TKIP countermeasures 13846d49e1aeSJan Lentfer * @priv: private driver interface data 13856d49e1aeSJan Lentfer * @enabled: 1 = countermeasures enabled, 0 = disabled 13866d49e1aeSJan Lentfer * 13876d49e1aeSJan Lentfer * Returns: 0 on success, -1 on failure 13886d49e1aeSJan Lentfer * 13896d49e1aeSJan Lentfer * Configure TKIP countermeasures. When these are enabled, the driver 13906d49e1aeSJan Lentfer * should drop all received and queued frames that are using TKIP. 13916d49e1aeSJan Lentfer */ 13926d49e1aeSJan Lentfer int (*set_countermeasures)(void *priv, int enabled); 13936d49e1aeSJan Lentfer 13946d49e1aeSJan Lentfer /** 13956d49e1aeSJan Lentfer * deauthenticate - Request driver to deauthenticate 13966d49e1aeSJan Lentfer * @priv: private driver interface data 13976d49e1aeSJan Lentfer * @addr: peer address (BSSID of the AP) 13986d49e1aeSJan Lentfer * @reason_code: 16-bit reason code to be sent in the deauthentication 13996d49e1aeSJan Lentfer * frame 14006d49e1aeSJan Lentfer * 14016d49e1aeSJan Lentfer * Returns: 0 on success, -1 on failure 14026d49e1aeSJan Lentfer */ 14036d49e1aeSJan Lentfer int (*deauthenticate)(void *priv, const u8 *addr, int reason_code); 14046d49e1aeSJan Lentfer 14056d49e1aeSJan Lentfer /** 14066d49e1aeSJan Lentfer * associate - Request driver to associate 14076d49e1aeSJan Lentfer * @priv: private driver interface data 14086d49e1aeSJan Lentfer * @params: association parameters 14096d49e1aeSJan Lentfer * 14106d49e1aeSJan Lentfer * Returns: 0 on success, -1 on failure 14116d49e1aeSJan Lentfer */ 14126d49e1aeSJan Lentfer int (*associate)(void *priv, 14136d49e1aeSJan Lentfer struct wpa_driver_associate_params *params); 14146d49e1aeSJan Lentfer 14156d49e1aeSJan Lentfer /** 14166d49e1aeSJan Lentfer * add_pmkid - Add PMKSA cache entry to the driver 14176d49e1aeSJan Lentfer * @priv: private driver interface data 14186d49e1aeSJan Lentfer * @bssid: BSSID for the PMKSA cache entry 14196d49e1aeSJan Lentfer * @pmkid: PMKID for the PMKSA cache entry 14206d49e1aeSJan Lentfer * 14216d49e1aeSJan Lentfer * Returns: 0 on success, -1 on failure 14226d49e1aeSJan Lentfer * 14236d49e1aeSJan Lentfer * This function is called when a new PMK is received, as a result of 14246d49e1aeSJan Lentfer * either normal authentication or RSN pre-authentication. 14256d49e1aeSJan Lentfer * 14266d49e1aeSJan Lentfer * If the driver generates RSN IE, i.e., it does not use wpa_ie in 14276d49e1aeSJan Lentfer * associate(), add_pmkid() can be used to add new PMKSA cache entries 14286d49e1aeSJan Lentfer * in the driver. If the driver uses wpa_ie from wpa_supplicant, this 14296d49e1aeSJan Lentfer * driver_ops function does not need to be implemented. Likewise, if 14306d49e1aeSJan Lentfer * the driver does not support WPA, this function is not needed. 14316d49e1aeSJan Lentfer */ 14326d49e1aeSJan Lentfer int (*add_pmkid)(void *priv, const u8 *bssid, const u8 *pmkid); 14336d49e1aeSJan Lentfer 14346d49e1aeSJan Lentfer /** 14356d49e1aeSJan Lentfer * remove_pmkid - Remove PMKSA cache entry to the driver 14366d49e1aeSJan Lentfer * @priv: private driver interface data 14376d49e1aeSJan Lentfer * @bssid: BSSID for the PMKSA cache entry 14386d49e1aeSJan Lentfer * @pmkid: PMKID for the PMKSA cache entry 14396d49e1aeSJan Lentfer * 14406d49e1aeSJan Lentfer * Returns: 0 on success, -1 on failure 14416d49e1aeSJan Lentfer * 14426d49e1aeSJan Lentfer * This function is called when the supplicant drops a PMKSA cache 14436d49e1aeSJan Lentfer * entry for any reason. 14446d49e1aeSJan Lentfer * 14456d49e1aeSJan Lentfer * If the driver generates RSN IE, i.e., it does not use wpa_ie in 14466d49e1aeSJan Lentfer * associate(), remove_pmkid() can be used to synchronize PMKSA caches 14476d49e1aeSJan Lentfer * between the driver and wpa_supplicant. If the driver uses wpa_ie 14486d49e1aeSJan Lentfer * from wpa_supplicant, this driver_ops function does not need to be 14496d49e1aeSJan Lentfer * implemented. Likewise, if the driver does not support WPA, this 14506d49e1aeSJan Lentfer * function is not needed. 14516d49e1aeSJan Lentfer */ 14526d49e1aeSJan Lentfer int (*remove_pmkid)(void *priv, const u8 *bssid, const u8 *pmkid); 14536d49e1aeSJan Lentfer 14546d49e1aeSJan Lentfer /** 14556d49e1aeSJan Lentfer * flush_pmkid - Flush PMKSA cache 14566d49e1aeSJan Lentfer * @priv: private driver interface data 14576d49e1aeSJan Lentfer * 14586d49e1aeSJan Lentfer * Returns: 0 on success, -1 on failure 14596d49e1aeSJan Lentfer * 14606d49e1aeSJan Lentfer * This function is called when the supplicant drops all PMKSA cache 14616d49e1aeSJan Lentfer * entries for any reason. 14626d49e1aeSJan Lentfer * 14636d49e1aeSJan Lentfer * If the driver generates RSN IE, i.e., it does not use wpa_ie in 14646d49e1aeSJan Lentfer * associate(), remove_pmkid() can be used to synchronize PMKSA caches 14656d49e1aeSJan Lentfer * between the driver and wpa_supplicant. If the driver uses wpa_ie 14666d49e1aeSJan Lentfer * from wpa_supplicant, this driver_ops function does not need to be 14676d49e1aeSJan Lentfer * implemented. Likewise, if the driver does not support WPA, this 14686d49e1aeSJan Lentfer * function is not needed. 14696d49e1aeSJan Lentfer */ 14706d49e1aeSJan Lentfer int (*flush_pmkid)(void *priv); 14716d49e1aeSJan Lentfer 14726d49e1aeSJan Lentfer /** 14736d49e1aeSJan Lentfer * get_capa - Get driver capabilities 14746d49e1aeSJan Lentfer * @priv: private driver interface data 14756d49e1aeSJan Lentfer * 14766d49e1aeSJan Lentfer * Returns: 0 on success, -1 on failure 14776d49e1aeSJan Lentfer * 14786d49e1aeSJan Lentfer * Get driver/firmware/hardware capabilities. 14796d49e1aeSJan Lentfer */ 14806d49e1aeSJan Lentfer int (*get_capa)(void *priv, struct wpa_driver_capa *capa); 14816d49e1aeSJan Lentfer 14826d49e1aeSJan Lentfer /** 14836d49e1aeSJan Lentfer * poll - Poll driver for association information 14846d49e1aeSJan Lentfer * @priv: private driver interface data 14856d49e1aeSJan Lentfer * 14866d49e1aeSJan Lentfer * This is an option callback that can be used when the driver does not 14876d49e1aeSJan Lentfer * provide event mechanism for association events. This is called when 14886d49e1aeSJan Lentfer * receiving WPA EAPOL-Key messages that require association 14896d49e1aeSJan Lentfer * information. The driver interface is supposed to generate associnfo 14906d49e1aeSJan Lentfer * event before returning from this callback function. In addition, the 14916d49e1aeSJan Lentfer * driver interface should generate an association event after having 14926d49e1aeSJan Lentfer * sent out associnfo. 14936d49e1aeSJan Lentfer */ 14946d49e1aeSJan Lentfer void (*poll)(void *priv); 14956d49e1aeSJan Lentfer 14966d49e1aeSJan Lentfer /** 14976d49e1aeSJan Lentfer * get_ifname - Get interface name 14986d49e1aeSJan Lentfer * @priv: private driver interface data 14996d49e1aeSJan Lentfer * 15006d49e1aeSJan Lentfer * Returns: Pointer to the interface name. This can differ from the 15016d49e1aeSJan Lentfer * interface name used in init() call. Init() is called first. 15026d49e1aeSJan Lentfer * 15036d49e1aeSJan Lentfer * This optional function can be used to allow the driver interface to 15046d49e1aeSJan Lentfer * replace the interface name with something else, e.g., based on an 15056d49e1aeSJan Lentfer * interface mapping from a more descriptive name. 15066d49e1aeSJan Lentfer */ 15076d49e1aeSJan Lentfer const char * (*get_ifname)(void *priv); 15086d49e1aeSJan Lentfer 15096d49e1aeSJan Lentfer /** 15106d49e1aeSJan Lentfer * get_mac_addr - Get own MAC address 15116d49e1aeSJan Lentfer * @priv: private driver interface data 15126d49e1aeSJan Lentfer * 15136d49e1aeSJan Lentfer * Returns: Pointer to own MAC address or %NULL on failure 15146d49e1aeSJan Lentfer * 15156d49e1aeSJan Lentfer * This optional function can be used to get the own MAC address of the 15166d49e1aeSJan Lentfer * device from the driver interface code. This is only needed if the 15176d49e1aeSJan Lentfer * l2_packet implementation for the OS does not provide easy access to 15186d49e1aeSJan Lentfer * a MAC address. */ 15196d49e1aeSJan Lentfer const u8 * (*get_mac_addr)(void *priv); 15206d49e1aeSJan Lentfer 15216d49e1aeSJan Lentfer /** 15226d49e1aeSJan Lentfer * send_eapol - Optional function for sending EAPOL packets 15236d49e1aeSJan Lentfer * @priv: private driver interface data 15246d49e1aeSJan Lentfer * @dest: Destination MAC address 15256d49e1aeSJan Lentfer * @proto: Ethertype 15266d49e1aeSJan Lentfer * @data: EAPOL packet starting with IEEE 802.1X header 15276d49e1aeSJan Lentfer * @data_len: Size of the EAPOL packet 15286d49e1aeSJan Lentfer * 15296d49e1aeSJan Lentfer * Returns: 0 on success, -1 on failure 15306d49e1aeSJan Lentfer * 15316d49e1aeSJan Lentfer * This optional function can be used to override l2_packet operations 15326d49e1aeSJan Lentfer * with driver specific functionality. If this function pointer is set, 15336d49e1aeSJan Lentfer * l2_packet module is not used at all and the driver interface code is 15346d49e1aeSJan Lentfer * responsible for receiving and sending all EAPOL packets. The 1535*3ff40c12SJohn Marino * received EAPOL packets are sent to core code with EVENT_EAPOL_RX 1536*3ff40c12SJohn Marino * event. The driver interface is required to implement get_mac_addr() 1537*3ff40c12SJohn Marino * handler if send_eapol() is used. 15386d49e1aeSJan Lentfer */ 15396d49e1aeSJan Lentfer int (*send_eapol)(void *priv, const u8 *dest, u16 proto, 15406d49e1aeSJan Lentfer const u8 *data, size_t data_len); 15416d49e1aeSJan Lentfer 15426d49e1aeSJan Lentfer /** 15436d49e1aeSJan Lentfer * set_operstate - Sets device operating state to DORMANT or UP 15446d49e1aeSJan Lentfer * @priv: private driver interface data 15456d49e1aeSJan Lentfer * @state: 0 = dormant, 1 = up 15466d49e1aeSJan Lentfer * Returns: 0 on success, -1 on failure 15476d49e1aeSJan Lentfer * 15486d49e1aeSJan Lentfer * This is an optional function that can be used on operating systems 15496d49e1aeSJan Lentfer * that support a concept of controlling network device state from user 15506d49e1aeSJan Lentfer * space applications. This function, if set, gets called with 15516d49e1aeSJan Lentfer * state = 1 when authentication has been completed and with state = 0 15526d49e1aeSJan Lentfer * when connection is lost. 15536d49e1aeSJan Lentfer */ 15546d49e1aeSJan Lentfer int (*set_operstate)(void *priv, int state); 15556d49e1aeSJan Lentfer 15566d49e1aeSJan Lentfer /** 15576d49e1aeSJan Lentfer * mlme_setprotection - MLME-SETPROTECTION.request primitive 15586d49e1aeSJan Lentfer * @priv: Private driver interface data 15596d49e1aeSJan Lentfer * @addr: Address of the station for which to set protection (may be 15606d49e1aeSJan Lentfer * %NULL for group keys) 15616d49e1aeSJan Lentfer * @protect_type: MLME_SETPROTECTION_PROTECT_TYPE_* 15626d49e1aeSJan Lentfer * @key_type: MLME_SETPROTECTION_KEY_TYPE_* 15636d49e1aeSJan Lentfer * Returns: 0 on success, -1 on failure 15646d49e1aeSJan Lentfer * 15656d49e1aeSJan Lentfer * This is an optional function that can be used to set the driver to 15666d49e1aeSJan Lentfer * require protection for Tx and/or Rx frames. This uses the layer 15676d49e1aeSJan Lentfer * interface defined in IEEE 802.11i-2004 clause 10.3.22.1 15686d49e1aeSJan Lentfer * (MLME-SETPROTECTION.request). Many drivers do not use explicit 15696d49e1aeSJan Lentfer * set protection operation; instead, they set protection implicitly 15706d49e1aeSJan Lentfer * based on configured keys. 15716d49e1aeSJan Lentfer */ 15726d49e1aeSJan Lentfer int (*mlme_setprotection)(void *priv, const u8 *addr, int protect_type, 15736d49e1aeSJan Lentfer int key_type); 15746d49e1aeSJan Lentfer 15756d49e1aeSJan Lentfer /** 15766d49e1aeSJan Lentfer * get_hw_feature_data - Get hardware support data (channels and rates) 15776d49e1aeSJan Lentfer * @priv: Private driver interface data 15786d49e1aeSJan Lentfer * @num_modes: Variable for returning the number of returned modes 15796d49e1aeSJan Lentfer * flags: Variable for returning hardware feature flags 15806d49e1aeSJan Lentfer * Returns: Pointer to allocated hardware data on success or %NULL on 15816d49e1aeSJan Lentfer * failure. Caller is responsible for freeing this. 15826d49e1aeSJan Lentfer */ 1583*3ff40c12SJohn Marino struct hostapd_hw_modes * (*get_hw_feature_data)(void *priv, 15846d49e1aeSJan Lentfer u16 *num_modes, 15856d49e1aeSJan Lentfer u16 *flags); 15866d49e1aeSJan Lentfer 15876d49e1aeSJan Lentfer /** 15886d49e1aeSJan Lentfer * send_mlme - Send management frame from MLME 15896d49e1aeSJan Lentfer * @priv: Private driver interface data 15906d49e1aeSJan Lentfer * @data: IEEE 802.11 management frame with IEEE 802.11 header 15916d49e1aeSJan Lentfer * @data_len: Size of the management frame 1592*3ff40c12SJohn Marino * @noack: Do not wait for this frame to be acked (disable retries) 15936d49e1aeSJan Lentfer * Returns: 0 on success, -1 on failure 15946d49e1aeSJan Lentfer */ 1595*3ff40c12SJohn Marino int (*send_mlme)(void *priv, const u8 *data, size_t data_len, 1596*3ff40c12SJohn Marino int noack); 15976d49e1aeSJan Lentfer 15986d49e1aeSJan Lentfer /** 15996d49e1aeSJan Lentfer * update_ft_ies - Update FT (IEEE 802.11r) IEs 16006d49e1aeSJan Lentfer * @priv: Private driver interface data 16016d49e1aeSJan Lentfer * @md: Mobility domain (2 octets) (also included inside ies) 16026d49e1aeSJan Lentfer * @ies: FT IEs (MDIE, FTIE, ...) or %NULL to remove IEs 16036d49e1aeSJan Lentfer * @ies_len: Length of FT IEs in bytes 16046d49e1aeSJan Lentfer * Returns: 0 on success, -1 on failure 16056d49e1aeSJan Lentfer * 16066d49e1aeSJan Lentfer * The supplicant uses this callback to let the driver know that keying 16076d49e1aeSJan Lentfer * material for FT is available and that the driver can use the 16086d49e1aeSJan Lentfer * provided IEs in the next message in FT authentication sequence. 16096d49e1aeSJan Lentfer * 16106d49e1aeSJan Lentfer * This function is only needed for driver that support IEEE 802.11r 16116d49e1aeSJan Lentfer * (Fast BSS Transition). 16126d49e1aeSJan Lentfer */ 16136d49e1aeSJan Lentfer int (*update_ft_ies)(void *priv, const u8 *md, const u8 *ies, 16146d49e1aeSJan Lentfer size_t ies_len); 16156d49e1aeSJan Lentfer 16166d49e1aeSJan Lentfer /** 16176d49e1aeSJan Lentfer * send_ft_action - Send FT Action frame (IEEE 802.11r) 16186d49e1aeSJan Lentfer * @priv: Private driver interface data 16196d49e1aeSJan Lentfer * @action: Action field value 16206d49e1aeSJan Lentfer * @target_ap: Target AP address 16216d49e1aeSJan Lentfer * @ies: FT IEs (MDIE, FTIE, ...) (FT Request action frame body) 16226d49e1aeSJan Lentfer * @ies_len: Length of FT IEs in bytes 16236d49e1aeSJan Lentfer * Returns: 0 on success, -1 on failure 16246d49e1aeSJan Lentfer * 16256d49e1aeSJan Lentfer * The supplicant uses this callback to request the driver to transmit 16266d49e1aeSJan Lentfer * an FT Action frame (action category 6) for over-the-DS fast BSS 16276d49e1aeSJan Lentfer * transition. 16286d49e1aeSJan Lentfer */ 16296d49e1aeSJan Lentfer int (*send_ft_action)(void *priv, u8 action, const u8 *target_ap, 16306d49e1aeSJan Lentfer const u8 *ies, size_t ies_len); 16316d49e1aeSJan Lentfer 16326d49e1aeSJan Lentfer /** 16336d49e1aeSJan Lentfer * get_scan_results2 - Fetch the latest scan results 16346d49e1aeSJan Lentfer * @priv: private driver interface data 16356d49e1aeSJan Lentfer * 16366d49e1aeSJan Lentfer * Returns: Allocated buffer of scan results (caller is responsible for 16376d49e1aeSJan Lentfer * freeing the data structure) on success, NULL on failure 16386d49e1aeSJan Lentfer */ 16396d49e1aeSJan Lentfer struct wpa_scan_results * (*get_scan_results2)(void *priv); 16406d49e1aeSJan Lentfer 16416d49e1aeSJan Lentfer /** 16426d49e1aeSJan Lentfer * set_country - Set country 16436d49e1aeSJan Lentfer * @priv: Private driver interface data 16446d49e1aeSJan Lentfer * @alpha2: country to which to switch to 16456d49e1aeSJan Lentfer * Returns: 0 on success, -1 on failure 16466d49e1aeSJan Lentfer * 16476d49e1aeSJan Lentfer * This function is for drivers which support some form 16486d49e1aeSJan Lentfer * of setting a regulatory domain. 16496d49e1aeSJan Lentfer */ 16506d49e1aeSJan Lentfer int (*set_country)(void *priv, const char *alpha2); 16516d49e1aeSJan Lentfer 16526d49e1aeSJan Lentfer /** 1653*3ff40c12SJohn Marino * get_country - Get country 1654*3ff40c12SJohn Marino * @priv: Private driver interface data 1655*3ff40c12SJohn Marino * @alpha2: Buffer for returning country code (at least 3 octets) 1656*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 1657*3ff40c12SJohn Marino */ 1658*3ff40c12SJohn Marino int (*get_country)(void *priv, char *alpha2); 1659*3ff40c12SJohn Marino 1660*3ff40c12SJohn Marino /** 16616d49e1aeSJan Lentfer * global_init - Global driver initialization 16626d49e1aeSJan Lentfer * Returns: Pointer to private data (global), %NULL on failure 16636d49e1aeSJan Lentfer * 16646d49e1aeSJan Lentfer * This optional function is called to initialize the driver wrapper 16656d49e1aeSJan Lentfer * for global data, i.e., data that applies to all interfaces. If this 16666d49e1aeSJan Lentfer * function is implemented, global_deinit() will also need to be 16676d49e1aeSJan Lentfer * implemented to free the private data. The driver will also likely 16686d49e1aeSJan Lentfer * use init2() function instead of init() to get the pointer to global 16696d49e1aeSJan Lentfer * data available to per-interface initializer. 16706d49e1aeSJan Lentfer */ 16716d49e1aeSJan Lentfer void * (*global_init)(void); 16726d49e1aeSJan Lentfer 16736d49e1aeSJan Lentfer /** 16746d49e1aeSJan Lentfer * global_deinit - Global driver deinitialization 16756d49e1aeSJan Lentfer * @priv: private driver global data from global_init() 16766d49e1aeSJan Lentfer * 16776d49e1aeSJan Lentfer * Terminate any global driver related functionality and free the 16786d49e1aeSJan Lentfer * global data structure. 16796d49e1aeSJan Lentfer */ 16806d49e1aeSJan Lentfer void (*global_deinit)(void *priv); 16816d49e1aeSJan Lentfer 16826d49e1aeSJan Lentfer /** 16836d49e1aeSJan Lentfer * init2 - Initialize driver interface (with global data) 16846d49e1aeSJan Lentfer * @ctx: context to be used when calling wpa_supplicant functions, 16856d49e1aeSJan Lentfer * e.g., wpa_supplicant_event() 16866d49e1aeSJan Lentfer * @ifname: interface name, e.g., wlan0 16876d49e1aeSJan Lentfer * @global_priv: private driver global data from global_init() 16886d49e1aeSJan Lentfer * Returns: Pointer to private data, %NULL on failure 16896d49e1aeSJan Lentfer * 16906d49e1aeSJan Lentfer * This function can be used instead of init() if the driver wrapper 16916d49e1aeSJan Lentfer * uses global data. 16926d49e1aeSJan Lentfer */ 16936d49e1aeSJan Lentfer void * (*init2)(void *ctx, const char *ifname, void *global_priv); 16946d49e1aeSJan Lentfer 16956d49e1aeSJan Lentfer /** 16966d49e1aeSJan Lentfer * get_interfaces - Get information about available interfaces 16976d49e1aeSJan Lentfer * @global_priv: private driver global data from global_init() 16986d49e1aeSJan Lentfer * Returns: Allocated buffer of interface information (caller is 16996d49e1aeSJan Lentfer * responsible for freeing the data structure) on success, NULL on 17006d49e1aeSJan Lentfer * failure 17016d49e1aeSJan Lentfer */ 17026d49e1aeSJan Lentfer struct wpa_interface_info * (*get_interfaces)(void *global_priv); 1703*3ff40c12SJohn Marino 1704*3ff40c12SJohn Marino /** 1705*3ff40c12SJohn Marino * scan2 - Request the driver to initiate scan 1706*3ff40c12SJohn Marino * @priv: private driver interface data 1707*3ff40c12SJohn Marino * @params: Scan parameters 1708*3ff40c12SJohn Marino * 1709*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 1710*3ff40c12SJohn Marino * 1711*3ff40c12SJohn Marino * Once the scan results are ready, the driver should report scan 1712*3ff40c12SJohn Marino * results event for wpa_supplicant which will eventually request the 1713*3ff40c12SJohn Marino * results with wpa_driver_get_scan_results2(). 1714*3ff40c12SJohn Marino */ 1715*3ff40c12SJohn Marino int (*scan2)(void *priv, struct wpa_driver_scan_params *params); 1716*3ff40c12SJohn Marino 1717*3ff40c12SJohn Marino /** 1718*3ff40c12SJohn Marino * authenticate - Request driver to authenticate 1719*3ff40c12SJohn Marino * @priv: private driver interface data 1720*3ff40c12SJohn Marino * @params: authentication parameters 1721*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 1722*3ff40c12SJohn Marino * 1723*3ff40c12SJohn Marino * This is an optional function that can be used with drivers that 1724*3ff40c12SJohn Marino * support separate authentication and association steps, i.e., when 1725*3ff40c12SJohn Marino * wpa_supplicant can act as the SME. If not implemented, associate() 1726*3ff40c12SJohn Marino * function is expected to take care of IEEE 802.11 authentication, 1727*3ff40c12SJohn Marino * too. 1728*3ff40c12SJohn Marino */ 1729*3ff40c12SJohn Marino int (*authenticate)(void *priv, 1730*3ff40c12SJohn Marino struct wpa_driver_auth_params *params); 1731*3ff40c12SJohn Marino 1732*3ff40c12SJohn Marino /** 1733*3ff40c12SJohn Marino * set_ap - Set Beacon and Probe Response information for AP mode 1734*3ff40c12SJohn Marino * @priv: Private driver interface data 1735*3ff40c12SJohn Marino * @params: Parameters to use in AP mode 1736*3ff40c12SJohn Marino * 1737*3ff40c12SJohn Marino * This function is used to configure Beacon template and/or extra IEs 1738*3ff40c12SJohn Marino * to add for Beacon and Probe Response frames for the driver in 1739*3ff40c12SJohn Marino * AP mode. The driver is responsible for building the full Beacon 1740*3ff40c12SJohn Marino * frame by concatenating the head part with TIM IE generated by the 1741*3ff40c12SJohn Marino * driver/firmware and finishing with the tail part. Depending on the 1742*3ff40c12SJohn Marino * driver architectue, this can be done either by using the full 1743*3ff40c12SJohn Marino * template or the set of additional IEs (e.g., WPS and P2P IE). 1744*3ff40c12SJohn Marino * Similarly, Probe Response processing depends on the driver design. 1745*3ff40c12SJohn Marino * If the driver (or firmware) takes care of replying to Probe Request 1746*3ff40c12SJohn Marino * frames, the extra IEs provided here needs to be added to the Probe 1747*3ff40c12SJohn Marino * Response frames. 1748*3ff40c12SJohn Marino * 1749*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 1750*3ff40c12SJohn Marino */ 1751*3ff40c12SJohn Marino int (*set_ap)(void *priv, struct wpa_driver_ap_params *params); 1752*3ff40c12SJohn Marino 1753*3ff40c12SJohn Marino /** 1754*3ff40c12SJohn Marino * set_acl - Set ACL in AP mode 1755*3ff40c12SJohn Marino * @priv: Private driver interface data 1756*3ff40c12SJohn Marino * @params: Parameters to configure ACL 1757*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 1758*3ff40c12SJohn Marino * 1759*3ff40c12SJohn Marino * This is used only for the drivers which support MAC address ACL. 1760*3ff40c12SJohn Marino */ 1761*3ff40c12SJohn Marino int (*set_acl)(void *priv, struct hostapd_acl_params *params); 1762*3ff40c12SJohn Marino 1763*3ff40c12SJohn Marino /** 1764*3ff40c12SJohn Marino * hapd_init - Initialize driver interface (hostapd only) 1765*3ff40c12SJohn Marino * @hapd: Pointer to hostapd context 1766*3ff40c12SJohn Marino * @params: Configuration for the driver wrapper 1767*3ff40c12SJohn Marino * Returns: Pointer to private data, %NULL on failure 1768*3ff40c12SJohn Marino * 1769*3ff40c12SJohn Marino * This function is used instead of init() or init2() when the driver 1770*3ff40c12SJohn Marino * wrapper is used with hostapd. 1771*3ff40c12SJohn Marino */ 1772*3ff40c12SJohn Marino void * (*hapd_init)(struct hostapd_data *hapd, 1773*3ff40c12SJohn Marino struct wpa_init_params *params); 1774*3ff40c12SJohn Marino 1775*3ff40c12SJohn Marino /** 1776*3ff40c12SJohn Marino * hapd_deinit - Deinitialize driver interface (hostapd only) 1777*3ff40c12SJohn Marino * @priv: Private driver interface data from hapd_init() 1778*3ff40c12SJohn Marino */ 1779*3ff40c12SJohn Marino void (*hapd_deinit)(void *priv); 1780*3ff40c12SJohn Marino 1781*3ff40c12SJohn Marino /** 1782*3ff40c12SJohn Marino * set_ieee8021x - Enable/disable IEEE 802.1X support (AP only) 1783*3ff40c12SJohn Marino * @priv: Private driver interface data 1784*3ff40c12SJohn Marino * @params: BSS parameters 1785*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 1786*3ff40c12SJohn Marino * 1787*3ff40c12SJohn Marino * This is an optional function to configure the kernel driver to 1788*3ff40c12SJohn Marino * enable/disable IEEE 802.1X support and set WPA/WPA2 parameters. This 1789*3ff40c12SJohn Marino * can be left undefined (set to %NULL) if IEEE 802.1X support is 1790*3ff40c12SJohn Marino * always enabled and the driver uses set_ap() to set WPA/RSN IE 1791*3ff40c12SJohn Marino * for Beacon frames. 1792*3ff40c12SJohn Marino * 1793*3ff40c12SJohn Marino * DEPRECATED - use set_ap() instead 1794*3ff40c12SJohn Marino */ 1795*3ff40c12SJohn Marino int (*set_ieee8021x)(void *priv, struct wpa_bss_params *params); 1796*3ff40c12SJohn Marino 1797*3ff40c12SJohn Marino /** 1798*3ff40c12SJohn Marino * set_privacy - Enable/disable privacy (AP only) 1799*3ff40c12SJohn Marino * @priv: Private driver interface data 1800*3ff40c12SJohn Marino * @enabled: 1 = privacy enabled, 0 = disabled 1801*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 1802*3ff40c12SJohn Marino * 1803*3ff40c12SJohn Marino * This is an optional function to configure privacy field in the 1804*3ff40c12SJohn Marino * kernel driver for Beacon frames. This can be left undefined (set to 1805*3ff40c12SJohn Marino * %NULL) if the driver uses the Beacon template from set_ap(). 1806*3ff40c12SJohn Marino * 1807*3ff40c12SJohn Marino * DEPRECATED - use set_ap() instead 1808*3ff40c12SJohn Marino */ 1809*3ff40c12SJohn Marino int (*set_privacy)(void *priv, int enabled); 1810*3ff40c12SJohn Marino 1811*3ff40c12SJohn Marino /** 1812*3ff40c12SJohn Marino * get_seqnum - Fetch the current TSC/packet number (AP only) 1813*3ff40c12SJohn Marino * @ifname: The interface name (main or virtual) 1814*3ff40c12SJohn Marino * @priv: Private driver interface data 1815*3ff40c12SJohn Marino * @addr: MAC address of the station or %NULL for group keys 1816*3ff40c12SJohn Marino * @idx: Key index 1817*3ff40c12SJohn Marino * @seq: Buffer for returning the latest used TSC/packet number 1818*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 1819*3ff40c12SJohn Marino * 1820*3ff40c12SJohn Marino * This function is used to fetch the last used TSC/packet number for 1821*3ff40c12SJohn Marino * a TKIP, CCMP, GCMP, or BIP/IGTK key. It is mainly used with group 1822*3ff40c12SJohn Marino * keys, so there is no strict requirement on implementing support for 1823*3ff40c12SJohn Marino * unicast keys (i.e., addr != %NULL). 1824*3ff40c12SJohn Marino */ 1825*3ff40c12SJohn Marino int (*get_seqnum)(const char *ifname, void *priv, const u8 *addr, 1826*3ff40c12SJohn Marino int idx, u8 *seq); 1827*3ff40c12SJohn Marino 1828*3ff40c12SJohn Marino /** 1829*3ff40c12SJohn Marino * flush - Flush all association stations (AP only) 1830*3ff40c12SJohn Marino * @priv: Private driver interface data 1831*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 1832*3ff40c12SJohn Marino * 1833*3ff40c12SJohn Marino * This function requests the driver to disassociate all associated 1834*3ff40c12SJohn Marino * stations. This function does not need to be implemented if the 1835*3ff40c12SJohn Marino * driver does not process association frames internally. 1836*3ff40c12SJohn Marino */ 1837*3ff40c12SJohn Marino int (*flush)(void *priv); 1838*3ff40c12SJohn Marino 1839*3ff40c12SJohn Marino /** 1840*3ff40c12SJohn Marino * set_generic_elem - Add IEs into Beacon/Probe Response frames (AP) 1841*3ff40c12SJohn Marino * @priv: Private driver interface data 1842*3ff40c12SJohn Marino * @elem: Information elements 1843*3ff40c12SJohn Marino * @elem_len: Length of the elem buffer in octets 1844*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 1845*3ff40c12SJohn Marino * 1846*3ff40c12SJohn Marino * This is an optional function to add information elements in the 1847*3ff40c12SJohn Marino * kernel driver for Beacon and Probe Response frames. This can be left 1848*3ff40c12SJohn Marino * undefined (set to %NULL) if the driver uses the Beacon template from 1849*3ff40c12SJohn Marino * set_ap(). 1850*3ff40c12SJohn Marino * 1851*3ff40c12SJohn Marino * DEPRECATED - use set_ap() instead 1852*3ff40c12SJohn Marino */ 1853*3ff40c12SJohn Marino int (*set_generic_elem)(void *priv, const u8 *elem, size_t elem_len); 1854*3ff40c12SJohn Marino 1855*3ff40c12SJohn Marino /** 1856*3ff40c12SJohn Marino * read_sta_data - Fetch station data 1857*3ff40c12SJohn Marino * @priv: Private driver interface data 1858*3ff40c12SJohn Marino * @data: Buffer for returning station information 1859*3ff40c12SJohn Marino * @addr: MAC address of the station 1860*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 1861*3ff40c12SJohn Marino */ 1862*3ff40c12SJohn Marino int (*read_sta_data)(void *priv, struct hostap_sta_driver_data *data, 1863*3ff40c12SJohn Marino const u8 *addr); 1864*3ff40c12SJohn Marino 1865*3ff40c12SJohn Marino /** 1866*3ff40c12SJohn Marino * hapd_send_eapol - Send an EAPOL packet (AP only) 1867*3ff40c12SJohn Marino * @priv: private driver interface data 1868*3ff40c12SJohn Marino * @addr: Destination MAC address 1869*3ff40c12SJohn Marino * @data: EAPOL packet starting with IEEE 802.1X header 1870*3ff40c12SJohn Marino * @data_len: Length of the EAPOL packet in octets 1871*3ff40c12SJohn Marino * @encrypt: Whether the frame should be encrypted 1872*3ff40c12SJohn Marino * @own_addr: Source MAC address 1873*3ff40c12SJohn Marino * @flags: WPA_STA_* flags for the destination station 1874*3ff40c12SJohn Marino * 1875*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 1876*3ff40c12SJohn Marino */ 1877*3ff40c12SJohn Marino int (*hapd_send_eapol)(void *priv, const u8 *addr, const u8 *data, 1878*3ff40c12SJohn Marino size_t data_len, int encrypt, 1879*3ff40c12SJohn Marino const u8 *own_addr, u32 flags); 1880*3ff40c12SJohn Marino 1881*3ff40c12SJohn Marino /** 1882*3ff40c12SJohn Marino * sta_deauth - Deauthenticate a station (AP only) 1883*3ff40c12SJohn Marino * @priv: Private driver interface data 1884*3ff40c12SJohn Marino * @own_addr: Source address and BSSID for the Deauthentication frame 1885*3ff40c12SJohn Marino * @addr: MAC address of the station to deauthenticate 1886*3ff40c12SJohn Marino * @reason: Reason code for the Deauthentiation frame 1887*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 1888*3ff40c12SJohn Marino * 1889*3ff40c12SJohn Marino * This function requests a specific station to be deauthenticated and 1890*3ff40c12SJohn Marino * a Deauthentication frame to be sent to it. 1891*3ff40c12SJohn Marino */ 1892*3ff40c12SJohn Marino int (*sta_deauth)(void *priv, const u8 *own_addr, const u8 *addr, 1893*3ff40c12SJohn Marino int reason); 1894*3ff40c12SJohn Marino 1895*3ff40c12SJohn Marino /** 1896*3ff40c12SJohn Marino * sta_disassoc - Disassociate a station (AP only) 1897*3ff40c12SJohn Marino * @priv: Private driver interface data 1898*3ff40c12SJohn Marino * @own_addr: Source address and BSSID for the Disassociation frame 1899*3ff40c12SJohn Marino * @addr: MAC address of the station to disassociate 1900*3ff40c12SJohn Marino * @reason: Reason code for the Disassociation frame 1901*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 1902*3ff40c12SJohn Marino * 1903*3ff40c12SJohn Marino * This function requests a specific station to be disassociated and 1904*3ff40c12SJohn Marino * a Disassociation frame to be sent to it. 1905*3ff40c12SJohn Marino */ 1906*3ff40c12SJohn Marino int (*sta_disassoc)(void *priv, const u8 *own_addr, const u8 *addr, 1907*3ff40c12SJohn Marino int reason); 1908*3ff40c12SJohn Marino 1909*3ff40c12SJohn Marino /** 1910*3ff40c12SJohn Marino * sta_remove - Remove a station entry (AP only) 1911*3ff40c12SJohn Marino * @priv: Private driver interface data 1912*3ff40c12SJohn Marino * @addr: MAC address of the station to be removed 1913*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 1914*3ff40c12SJohn Marino */ 1915*3ff40c12SJohn Marino int (*sta_remove)(void *priv, const u8 *addr); 1916*3ff40c12SJohn Marino 1917*3ff40c12SJohn Marino /** 1918*3ff40c12SJohn Marino * hapd_get_ssid - Get the current SSID (AP only) 1919*3ff40c12SJohn Marino * @priv: Private driver interface data 1920*3ff40c12SJohn Marino * @buf: Buffer for returning the SSID 1921*3ff40c12SJohn Marino * @len: Maximum length of the buffer 1922*3ff40c12SJohn Marino * Returns: Length of the SSID on success, -1 on failure 1923*3ff40c12SJohn Marino * 1924*3ff40c12SJohn Marino * This function need not be implemented if the driver uses Beacon 1925*3ff40c12SJohn Marino * template from set_ap() and does not reply to Probe Request frames. 1926*3ff40c12SJohn Marino */ 1927*3ff40c12SJohn Marino int (*hapd_get_ssid)(void *priv, u8 *buf, int len); 1928*3ff40c12SJohn Marino 1929*3ff40c12SJohn Marino /** 1930*3ff40c12SJohn Marino * hapd_set_ssid - Set SSID (AP only) 1931*3ff40c12SJohn Marino * @priv: Private driver interface data 1932*3ff40c12SJohn Marino * @buf: SSID 1933*3ff40c12SJohn Marino * @len: Length of the SSID in octets 1934*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 1935*3ff40c12SJohn Marino * 1936*3ff40c12SJohn Marino * DEPRECATED - use set_ap() instead 1937*3ff40c12SJohn Marino */ 1938*3ff40c12SJohn Marino int (*hapd_set_ssid)(void *priv, const u8 *buf, int len); 1939*3ff40c12SJohn Marino 1940*3ff40c12SJohn Marino /** 1941*3ff40c12SJohn Marino * hapd_set_countermeasures - Enable/disable TKIP countermeasures (AP) 1942*3ff40c12SJohn Marino * @priv: Private driver interface data 1943*3ff40c12SJohn Marino * @enabled: 1 = countermeasures enabled, 0 = disabled 1944*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 1945*3ff40c12SJohn Marino * 1946*3ff40c12SJohn Marino * This need not be implemented if the driver does not take care of 1947*3ff40c12SJohn Marino * association processing. 1948*3ff40c12SJohn Marino */ 1949*3ff40c12SJohn Marino int (*hapd_set_countermeasures)(void *priv, int enabled); 1950*3ff40c12SJohn Marino 1951*3ff40c12SJohn Marino /** 1952*3ff40c12SJohn Marino * sta_add - Add a station entry 1953*3ff40c12SJohn Marino * @priv: Private driver interface data 1954*3ff40c12SJohn Marino * @params: Station parameters 1955*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 1956*3ff40c12SJohn Marino * 1957*3ff40c12SJohn Marino * This function is used to add a station entry to the driver once the 1958*3ff40c12SJohn Marino * station has completed association. This is only used if the driver 1959*3ff40c12SJohn Marino * does not take care of association processing. 1960*3ff40c12SJohn Marino * 1961*3ff40c12SJohn Marino * With TDLS, this function is also used to add or set (params->set 1) 1962*3ff40c12SJohn Marino * TDLS peer entries. 1963*3ff40c12SJohn Marino */ 1964*3ff40c12SJohn Marino int (*sta_add)(void *priv, struct hostapd_sta_add_params *params); 1965*3ff40c12SJohn Marino 1966*3ff40c12SJohn Marino /** 1967*3ff40c12SJohn Marino * get_inact_sec - Get station inactivity duration (AP only) 1968*3ff40c12SJohn Marino * @priv: Private driver interface data 1969*3ff40c12SJohn Marino * @addr: Station address 1970*3ff40c12SJohn Marino * Returns: Number of seconds station has been inactive, -1 on failure 1971*3ff40c12SJohn Marino */ 1972*3ff40c12SJohn Marino int (*get_inact_sec)(void *priv, const u8 *addr); 1973*3ff40c12SJohn Marino 1974*3ff40c12SJohn Marino /** 1975*3ff40c12SJohn Marino * sta_clear_stats - Clear station statistics (AP only) 1976*3ff40c12SJohn Marino * @priv: Private driver interface data 1977*3ff40c12SJohn Marino * @addr: Station address 1978*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 1979*3ff40c12SJohn Marino */ 1980*3ff40c12SJohn Marino int (*sta_clear_stats)(void *priv, const u8 *addr); 1981*3ff40c12SJohn Marino 1982*3ff40c12SJohn Marino /** 1983*3ff40c12SJohn Marino * set_freq - Set channel/frequency (AP only) 1984*3ff40c12SJohn Marino * @priv: Private driver interface data 1985*3ff40c12SJohn Marino * @freq: Channel parameters 1986*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 1987*3ff40c12SJohn Marino */ 1988*3ff40c12SJohn Marino int (*set_freq)(void *priv, struct hostapd_freq_params *freq); 1989*3ff40c12SJohn Marino 1990*3ff40c12SJohn Marino /** 1991*3ff40c12SJohn Marino * set_rts - Set RTS threshold 1992*3ff40c12SJohn Marino * @priv: Private driver interface data 1993*3ff40c12SJohn Marino * @rts: RTS threshold in octets 1994*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 1995*3ff40c12SJohn Marino */ 1996*3ff40c12SJohn Marino int (*set_rts)(void *priv, int rts); 1997*3ff40c12SJohn Marino 1998*3ff40c12SJohn Marino /** 1999*3ff40c12SJohn Marino * set_frag - Set fragmentation threshold 2000*3ff40c12SJohn Marino * @priv: Private driver interface data 2001*3ff40c12SJohn Marino * @frag: Fragmentation threshold in octets 2002*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 2003*3ff40c12SJohn Marino */ 2004*3ff40c12SJohn Marino int (*set_frag)(void *priv, int frag); 2005*3ff40c12SJohn Marino 2006*3ff40c12SJohn Marino /** 2007*3ff40c12SJohn Marino * sta_set_flags - Set station flags (AP only) 2008*3ff40c12SJohn Marino * @priv: Private driver interface data 2009*3ff40c12SJohn Marino * @addr: Station address 2010*3ff40c12SJohn Marino * @total_flags: Bitmap of all WPA_STA_* flags currently set 2011*3ff40c12SJohn Marino * @flags_or: Bitmap of WPA_STA_* flags to add 2012*3ff40c12SJohn Marino * @flags_and: Bitmap of WPA_STA_* flags to us as a mask 2013*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 2014*3ff40c12SJohn Marino */ 2015*3ff40c12SJohn Marino int (*sta_set_flags)(void *priv, const u8 *addr, 2016*3ff40c12SJohn Marino int total_flags, int flags_or, int flags_and); 2017*3ff40c12SJohn Marino 2018*3ff40c12SJohn Marino /** 2019*3ff40c12SJohn Marino * set_tx_queue_params - Set TX queue parameters 2020*3ff40c12SJohn Marino * @priv: Private driver interface data 2021*3ff40c12SJohn Marino * @queue: Queue number (0 = VO, 1 = VI, 2 = BE, 3 = BK) 2022*3ff40c12SJohn Marino * @aifs: AIFS 2023*3ff40c12SJohn Marino * @cw_min: cwMin 2024*3ff40c12SJohn Marino * @cw_max: cwMax 2025*3ff40c12SJohn Marino * @burst_time: Maximum length for bursting in 0.1 msec units 2026*3ff40c12SJohn Marino */ 2027*3ff40c12SJohn Marino int (*set_tx_queue_params)(void *priv, int queue, int aifs, int cw_min, 2028*3ff40c12SJohn Marino int cw_max, int burst_time); 2029*3ff40c12SJohn Marino 2030*3ff40c12SJohn Marino /** 2031*3ff40c12SJohn Marino * if_add - Add a virtual interface 2032*3ff40c12SJohn Marino * @priv: Private driver interface data 2033*3ff40c12SJohn Marino * @type: Interface type 2034*3ff40c12SJohn Marino * @ifname: Interface name for the new virtual interface 2035*3ff40c12SJohn Marino * @addr: Local address to use for the interface or %NULL to use the 2036*3ff40c12SJohn Marino * parent interface address 2037*3ff40c12SJohn Marino * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces 2038*3ff40c12SJohn Marino * @drv_priv: Pointer for overwriting the driver context or %NULL if 2039*3ff40c12SJohn Marino * not allowed (applies only to %WPA_IF_AP_BSS type) 2040*3ff40c12SJohn Marino * @force_ifname: Buffer for returning an interface name that the 2041*3ff40c12SJohn Marino * driver ended up using if it differs from the requested ifname 2042*3ff40c12SJohn Marino * @if_addr: Buffer for returning the allocated interface address 2043*3ff40c12SJohn Marino * (this may differ from the requested addr if the driver cannot 2044*3ff40c12SJohn Marino * change interface address) 2045*3ff40c12SJohn Marino * @bridge: Bridge interface to use or %NULL if no bridge configured 2046*3ff40c12SJohn Marino * @use_existing: Whether to allow existing interface to be used 2047*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 2048*3ff40c12SJohn Marino */ 2049*3ff40c12SJohn Marino int (*if_add)(void *priv, enum wpa_driver_if_type type, 2050*3ff40c12SJohn Marino const char *ifname, const u8 *addr, void *bss_ctx, 2051*3ff40c12SJohn Marino void **drv_priv, char *force_ifname, u8 *if_addr, 2052*3ff40c12SJohn Marino const char *bridge, int use_existing); 2053*3ff40c12SJohn Marino 2054*3ff40c12SJohn Marino /** 2055*3ff40c12SJohn Marino * if_remove - Remove a virtual interface 2056*3ff40c12SJohn Marino * @priv: Private driver interface data 2057*3ff40c12SJohn Marino * @type: Interface type 2058*3ff40c12SJohn Marino * @ifname: Interface name of the virtual interface to be removed 2059*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 2060*3ff40c12SJohn Marino */ 2061*3ff40c12SJohn Marino int (*if_remove)(void *priv, enum wpa_driver_if_type type, 2062*3ff40c12SJohn Marino const char *ifname); 2063*3ff40c12SJohn Marino 2064*3ff40c12SJohn Marino /** 2065*3ff40c12SJohn Marino * set_sta_vlan - Bind a station into a specific interface (AP only) 2066*3ff40c12SJohn Marino * @priv: Private driver interface data 2067*3ff40c12SJohn Marino * @ifname: Interface (main or virtual BSS or VLAN) 2068*3ff40c12SJohn Marino * @addr: MAC address of the associated station 2069*3ff40c12SJohn Marino * @vlan_id: VLAN ID 2070*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 2071*3ff40c12SJohn Marino * 2072*3ff40c12SJohn Marino * This function is used to bind a station to a specific virtual 2073*3ff40c12SJohn Marino * interface. It is only used if when virtual interfaces are supported, 2074*3ff40c12SJohn Marino * e.g., to assign stations to different VLAN interfaces based on 2075*3ff40c12SJohn Marino * information from a RADIUS server. This allows separate broadcast 2076*3ff40c12SJohn Marino * domains to be used with a single BSS. 2077*3ff40c12SJohn Marino */ 2078*3ff40c12SJohn Marino int (*set_sta_vlan)(void *priv, const u8 *addr, const char *ifname, 2079*3ff40c12SJohn Marino int vlan_id); 2080*3ff40c12SJohn Marino 2081*3ff40c12SJohn Marino /** 2082*3ff40c12SJohn Marino * commit - Optional commit changes handler (AP only) 2083*3ff40c12SJohn Marino * @priv: driver private data 2084*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 2085*3ff40c12SJohn Marino * 2086*3ff40c12SJohn Marino * This optional handler function can be registered if the driver 2087*3ff40c12SJohn Marino * interface implementation needs to commit changes (e.g., by setting 2088*3ff40c12SJohn Marino * network interface up) at the end of initial configuration. If set, 2089*3ff40c12SJohn Marino * this handler will be called after initial setup has been completed. 2090*3ff40c12SJohn Marino */ 2091*3ff40c12SJohn Marino int (*commit)(void *priv); 2092*3ff40c12SJohn Marino 2093*3ff40c12SJohn Marino /** 2094*3ff40c12SJohn Marino * send_ether - Send an ethernet packet (AP only) 2095*3ff40c12SJohn Marino * @priv: private driver interface data 2096*3ff40c12SJohn Marino * @dst: Destination MAC address 2097*3ff40c12SJohn Marino * @src: Source MAC address 2098*3ff40c12SJohn Marino * @proto: Ethertype 2099*3ff40c12SJohn Marino * @data: EAPOL packet starting with IEEE 802.1X header 2100*3ff40c12SJohn Marino * @data_len: Length of the EAPOL packet in octets 2101*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 2102*3ff40c12SJohn Marino */ 2103*3ff40c12SJohn Marino int (*send_ether)(void *priv, const u8 *dst, const u8 *src, u16 proto, 2104*3ff40c12SJohn Marino const u8 *data, size_t data_len); 2105*3ff40c12SJohn Marino 2106*3ff40c12SJohn Marino /** 2107*3ff40c12SJohn Marino * set_radius_acl_auth - Notification of RADIUS ACL change 2108*3ff40c12SJohn Marino * @priv: Private driver interface data 2109*3ff40c12SJohn Marino * @mac: MAC address of the station 2110*3ff40c12SJohn Marino * @accepted: Whether the station was accepted 2111*3ff40c12SJohn Marino * @session_timeout: Session timeout for the station 2112*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 2113*3ff40c12SJohn Marino */ 2114*3ff40c12SJohn Marino int (*set_radius_acl_auth)(void *priv, const u8 *mac, int accepted, 2115*3ff40c12SJohn Marino u32 session_timeout); 2116*3ff40c12SJohn Marino 2117*3ff40c12SJohn Marino /** 2118*3ff40c12SJohn Marino * set_radius_acl_expire - Notification of RADIUS ACL expiration 2119*3ff40c12SJohn Marino * @priv: Private driver interface data 2120*3ff40c12SJohn Marino * @mac: MAC address of the station 2121*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 2122*3ff40c12SJohn Marino */ 2123*3ff40c12SJohn Marino int (*set_radius_acl_expire)(void *priv, const u8 *mac); 2124*3ff40c12SJohn Marino 2125*3ff40c12SJohn Marino /** 2126*3ff40c12SJohn Marino * set_ap_wps_ie - Add WPS IE(s) into Beacon/Probe Response frames (AP) 2127*3ff40c12SJohn Marino * @priv: Private driver interface data 2128*3ff40c12SJohn Marino * @beacon: WPS IE(s) for Beacon frames or %NULL to remove extra IE(s) 2129*3ff40c12SJohn Marino * @proberesp: WPS IE(s) for Probe Response frames or %NULL to remove 2130*3ff40c12SJohn Marino * extra IE(s) 2131*3ff40c12SJohn Marino * @assocresp: WPS IE(s) for (Re)Association Response frames or %NULL 2132*3ff40c12SJohn Marino * to remove extra IE(s) 2133*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 2134*3ff40c12SJohn Marino * 2135*3ff40c12SJohn Marino * This is an optional function to add WPS IE in the kernel driver for 2136*3ff40c12SJohn Marino * Beacon and Probe Response frames. This can be left undefined (set 2137*3ff40c12SJohn Marino * to %NULL) if the driver uses the Beacon template from set_ap() 2138*3ff40c12SJohn Marino * and does not process Probe Request frames. If the driver takes care 2139*3ff40c12SJohn Marino * of (Re)Association frame processing, the assocresp buffer includes 2140*3ff40c12SJohn Marino * WPS IE(s) that need to be added to (Re)Association Response frames 2141*3ff40c12SJohn Marino * whenever a (Re)Association Request frame indicated use of WPS. 2142*3ff40c12SJohn Marino * 2143*3ff40c12SJohn Marino * This will also be used to add P2P IE(s) into Beacon/Probe Response 2144*3ff40c12SJohn Marino * frames when operating as a GO. The driver is responsible for adding 2145*3ff40c12SJohn Marino * timing related attributes (e.g., NoA) in addition to the IEs 2146*3ff40c12SJohn Marino * included here by appending them after these buffers. This call is 2147*3ff40c12SJohn Marino * also used to provide Probe Response IEs for P2P Listen state 2148*3ff40c12SJohn Marino * operations for drivers that generate the Probe Response frames 2149*3ff40c12SJohn Marino * internally. 2150*3ff40c12SJohn Marino * 2151*3ff40c12SJohn Marino * DEPRECATED - use set_ap() instead 2152*3ff40c12SJohn Marino */ 2153*3ff40c12SJohn Marino int (*set_ap_wps_ie)(void *priv, const struct wpabuf *beacon, 2154*3ff40c12SJohn Marino const struct wpabuf *proberesp, 2155*3ff40c12SJohn Marino const struct wpabuf *assocresp); 2156*3ff40c12SJohn Marino 2157*3ff40c12SJohn Marino /** 2158*3ff40c12SJohn Marino * set_supp_port - Set IEEE 802.1X Supplicant Port status 2159*3ff40c12SJohn Marino * @priv: Private driver interface data 2160*3ff40c12SJohn Marino * @authorized: Whether the port is authorized 2161*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 2162*3ff40c12SJohn Marino */ 2163*3ff40c12SJohn Marino int (*set_supp_port)(void *priv, int authorized); 2164*3ff40c12SJohn Marino 2165*3ff40c12SJohn Marino /** 2166*3ff40c12SJohn Marino * set_wds_sta - Bind a station into a 4-address WDS (AP only) 2167*3ff40c12SJohn Marino * @priv: Private driver interface data 2168*3ff40c12SJohn Marino * @addr: MAC address of the associated station 2169*3ff40c12SJohn Marino * @aid: Association ID 2170*3ff40c12SJohn Marino * @val: 1 = bind to 4-address WDS; 0 = unbind 2171*3ff40c12SJohn Marino * @bridge_ifname: Bridge interface to use for the WDS station or %NULL 2172*3ff40c12SJohn Marino * to indicate that bridge is not to be used 2173*3ff40c12SJohn Marino * @ifname_wds: Buffer to return the interface name for the new WDS 2174*3ff40c12SJohn Marino * station or %NULL to indicate name is not returned. 2175*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 2176*3ff40c12SJohn Marino */ 2177*3ff40c12SJohn Marino int (*set_wds_sta)(void *priv, const u8 *addr, int aid, int val, 2178*3ff40c12SJohn Marino const char *bridge_ifname, char *ifname_wds); 2179*3ff40c12SJohn Marino 2180*3ff40c12SJohn Marino /** 2181*3ff40c12SJohn Marino * send_action - Transmit an Action frame 2182*3ff40c12SJohn Marino * @priv: Private driver interface data 2183*3ff40c12SJohn Marino * @freq: Frequency (in MHz) of the channel 2184*3ff40c12SJohn Marino * @wait: Time to wait off-channel for a response (in ms), or zero 2185*3ff40c12SJohn Marino * @dst: Destination MAC address (Address 1) 2186*3ff40c12SJohn Marino * @src: Source MAC address (Address 2) 2187*3ff40c12SJohn Marino * @bssid: BSSID (Address 3) 2188*3ff40c12SJohn Marino * @data: Frame body 2189*3ff40c12SJohn Marino * @data_len: data length in octets 2190*3ff40c12SJohn Marino @ @no_cck: Whether CCK rates must not be used to transmit this frame 2191*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 2192*3ff40c12SJohn Marino * 2193*3ff40c12SJohn Marino * This command can be used to request the driver to transmit an action 2194*3ff40c12SJohn Marino * frame to the specified destination. 2195*3ff40c12SJohn Marino * 2196*3ff40c12SJohn Marino * If the %WPA_DRIVER_FLAGS_OFFCHANNEL_TX flag is set, the frame will 2197*3ff40c12SJohn Marino * be transmitted on the given channel and the device will wait for a 2198*3ff40c12SJohn Marino * response on that channel for the given wait time. 2199*3ff40c12SJohn Marino * 2200*3ff40c12SJohn Marino * If the flag is not set, the wait time will be ignored. In this case, 2201*3ff40c12SJohn Marino * if a remain-on-channel duration is in progress, the frame must be 2202*3ff40c12SJohn Marino * transmitted on that channel; alternatively the frame may be sent on 2203*3ff40c12SJohn Marino * the current operational channel (if in associated state in station 2204*3ff40c12SJohn Marino * mode or while operating as an AP.) 2205*3ff40c12SJohn Marino */ 2206*3ff40c12SJohn Marino int (*send_action)(void *priv, unsigned int freq, unsigned int wait, 2207*3ff40c12SJohn Marino const u8 *dst, const u8 *src, const u8 *bssid, 2208*3ff40c12SJohn Marino const u8 *data, size_t data_len, int no_cck); 2209*3ff40c12SJohn Marino 2210*3ff40c12SJohn Marino /** 2211*3ff40c12SJohn Marino * send_action_cancel_wait - Cancel action frame TX wait 2212*3ff40c12SJohn Marino * @priv: Private driver interface data 2213*3ff40c12SJohn Marino * 2214*3ff40c12SJohn Marino * This command cancels the wait time associated with sending an action 2215*3ff40c12SJohn Marino * frame. It is only available when %WPA_DRIVER_FLAGS_OFFCHANNEL_TX is 2216*3ff40c12SJohn Marino * set in the driver flags. 2217*3ff40c12SJohn Marino */ 2218*3ff40c12SJohn Marino void (*send_action_cancel_wait)(void *priv); 2219*3ff40c12SJohn Marino 2220*3ff40c12SJohn Marino /** 2221*3ff40c12SJohn Marino * remain_on_channel - Remain awake on a channel 2222*3ff40c12SJohn Marino * @priv: Private driver interface data 2223*3ff40c12SJohn Marino * @freq: Frequency (in MHz) of the channel 2224*3ff40c12SJohn Marino * @duration: Duration in milliseconds 2225*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 2226*3ff40c12SJohn Marino * 2227*3ff40c12SJohn Marino * This command is used to request the driver to remain awake on the 2228*3ff40c12SJohn Marino * specified channel for the specified duration and report received 2229*3ff40c12SJohn Marino * Action frames with EVENT_RX_MGMT events. Optionally, received 2230*3ff40c12SJohn Marino * Probe Request frames may also be requested to be reported by calling 2231*3ff40c12SJohn Marino * probe_req_report(). These will be reported with EVENT_RX_PROBE_REQ. 2232*3ff40c12SJohn Marino * 2233*3ff40c12SJohn Marino * The driver may not be at the requested channel when this function 2234*3ff40c12SJohn Marino * returns, i.e., the return code is only indicating whether the 2235*3ff40c12SJohn Marino * request was accepted. The caller will need to wait until the 2236*3ff40c12SJohn Marino * EVENT_REMAIN_ON_CHANNEL event indicates that the driver has 2237*3ff40c12SJohn Marino * completed the channel change. This may take some time due to other 2238*3ff40c12SJohn Marino * need for the radio and the caller should be prepared to timing out 2239*3ff40c12SJohn Marino * its wait since there are no guarantees on when this request can be 2240*3ff40c12SJohn Marino * executed. 2241*3ff40c12SJohn Marino */ 2242*3ff40c12SJohn Marino int (*remain_on_channel)(void *priv, unsigned int freq, 2243*3ff40c12SJohn Marino unsigned int duration); 2244*3ff40c12SJohn Marino 2245*3ff40c12SJohn Marino /** 2246*3ff40c12SJohn Marino * cancel_remain_on_channel - Cancel remain-on-channel operation 2247*3ff40c12SJohn Marino * @priv: Private driver interface data 2248*3ff40c12SJohn Marino * 2249*3ff40c12SJohn Marino * This command can be used to cancel a remain-on-channel operation 2250*3ff40c12SJohn Marino * before its originally requested duration has passed. This could be 2251*3ff40c12SJohn Marino * used, e.g., when remain_on_channel() is used to request extra time 2252*3ff40c12SJohn Marino * to receive a response to an Action frame and the response is 2253*3ff40c12SJohn Marino * received when there is still unneeded time remaining on the 2254*3ff40c12SJohn Marino * remain-on-channel operation. 2255*3ff40c12SJohn Marino */ 2256*3ff40c12SJohn Marino int (*cancel_remain_on_channel)(void *priv); 2257*3ff40c12SJohn Marino 2258*3ff40c12SJohn Marino /** 2259*3ff40c12SJohn Marino * probe_req_report - Request Probe Request frames to be indicated 2260*3ff40c12SJohn Marino * @priv: Private driver interface data 2261*3ff40c12SJohn Marino * @report: Whether to report received Probe Request frames 2262*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure (or if not supported) 2263*3ff40c12SJohn Marino * 2264*3ff40c12SJohn Marino * This command can be used to request the driver to indicate when 2265*3ff40c12SJohn Marino * Probe Request frames are received with EVENT_RX_PROBE_REQ events. 2266*3ff40c12SJohn Marino * Since this operation may require extra resources, e.g., due to less 2267*3ff40c12SJohn Marino * optimal hardware/firmware RX filtering, many drivers may disable 2268*3ff40c12SJohn Marino * Probe Request reporting at least in station mode. This command is 2269*3ff40c12SJohn Marino * used to notify the driver when the Probe Request frames need to be 2270*3ff40c12SJohn Marino * reported, e.g., during remain-on-channel operations. 2271*3ff40c12SJohn Marino */ 2272*3ff40c12SJohn Marino int (*probe_req_report)(void *priv, int report); 2273*3ff40c12SJohn Marino 2274*3ff40c12SJohn Marino /** 2275*3ff40c12SJohn Marino * deinit_ap - Deinitialize AP mode 2276*3ff40c12SJohn Marino * @priv: Private driver interface data 2277*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure (or if not supported) 2278*3ff40c12SJohn Marino * 2279*3ff40c12SJohn Marino * This optional function can be used to disable AP mode related 2280*3ff40c12SJohn Marino * configuration. If the interface was not dynamically added, 2281*3ff40c12SJohn Marino * change the driver mode to station mode to allow normal station 2282*3ff40c12SJohn Marino * operations like scanning to be completed. 2283*3ff40c12SJohn Marino */ 2284*3ff40c12SJohn Marino int (*deinit_ap)(void *priv); 2285*3ff40c12SJohn Marino 2286*3ff40c12SJohn Marino /** 2287*3ff40c12SJohn Marino * deinit_p2p_cli - Deinitialize P2P client mode 2288*3ff40c12SJohn Marino * @priv: Private driver interface data 2289*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure (or if not supported) 2290*3ff40c12SJohn Marino * 2291*3ff40c12SJohn Marino * This optional function can be used to disable P2P client mode. If the 2292*3ff40c12SJohn Marino * interface was not dynamically added, change the interface type back 2293*3ff40c12SJohn Marino * to station mode. 2294*3ff40c12SJohn Marino */ 2295*3ff40c12SJohn Marino int (*deinit_p2p_cli)(void *priv); 2296*3ff40c12SJohn Marino 2297*3ff40c12SJohn Marino /** 2298*3ff40c12SJohn Marino * suspend - Notification on system suspend/hibernate event 2299*3ff40c12SJohn Marino * @priv: Private driver interface data 2300*3ff40c12SJohn Marino */ 2301*3ff40c12SJohn Marino void (*suspend)(void *priv); 2302*3ff40c12SJohn Marino 2303*3ff40c12SJohn Marino /** 2304*3ff40c12SJohn Marino * resume - Notification on system resume/thaw event 2305*3ff40c12SJohn Marino * @priv: Private driver interface data 2306*3ff40c12SJohn Marino */ 2307*3ff40c12SJohn Marino void (*resume)(void *priv); 2308*3ff40c12SJohn Marino 2309*3ff40c12SJohn Marino /** 2310*3ff40c12SJohn Marino * signal_monitor - Set signal monitoring parameters 2311*3ff40c12SJohn Marino * @priv: Private driver interface data 2312*3ff40c12SJohn Marino * @threshold: Threshold value for signal change events; 0 = disabled 2313*3ff40c12SJohn Marino * @hysteresis: Minimum change in signal strength before indicating a 2314*3ff40c12SJohn Marino * new event 2315*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure (or if not supported) 2316*3ff40c12SJohn Marino * 2317*3ff40c12SJohn Marino * This function can be used to configure monitoring of signal strength 2318*3ff40c12SJohn Marino * with the current AP. Whenever signal strength drops below the 2319*3ff40c12SJohn Marino * %threshold value or increases above it, EVENT_SIGNAL_CHANGE event 2320*3ff40c12SJohn Marino * should be generated assuming the signal strength has changed at 2321*3ff40c12SJohn Marino * least %hysteresis from the previously indicated signal change event. 2322*3ff40c12SJohn Marino */ 2323*3ff40c12SJohn Marino int (*signal_monitor)(void *priv, int threshold, int hysteresis); 2324*3ff40c12SJohn Marino 2325*3ff40c12SJohn Marino /** 2326*3ff40c12SJohn Marino * send_frame - Send IEEE 802.11 frame (testing use only) 2327*3ff40c12SJohn Marino * @priv: Private driver interface data 2328*3ff40c12SJohn Marino * @data: IEEE 802.11 frame with IEEE 802.11 header 2329*3ff40c12SJohn Marino * @data_len: Size of the frame 2330*3ff40c12SJohn Marino * @encrypt: Whether to encrypt the frame (if keys are set) 2331*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 2332*3ff40c12SJohn Marino * 2333*3ff40c12SJohn Marino * This function is only used for debugging purposes and is not 2334*3ff40c12SJohn Marino * required to be implemented for normal operations. 2335*3ff40c12SJohn Marino */ 2336*3ff40c12SJohn Marino int (*send_frame)(void *priv, const u8 *data, size_t data_len, 2337*3ff40c12SJohn Marino int encrypt); 2338*3ff40c12SJohn Marino 2339*3ff40c12SJohn Marino /** 2340*3ff40c12SJohn Marino * shared_freq - Get operating frequency of shared interface(s) 2341*3ff40c12SJohn Marino * @priv: Private driver interface data 2342*3ff40c12SJohn Marino * Returns: Operating frequency in MHz, 0 if no shared operation in 2343*3ff40c12SJohn Marino * use, or -1 on failure 2344*3ff40c12SJohn Marino * 2345*3ff40c12SJohn Marino * This command can be used to request the current operating frequency 2346*3ff40c12SJohn Marino * of any virtual interface that shares the same radio to provide 2347*3ff40c12SJohn Marino * information for channel selection for other virtual interfaces. 2348*3ff40c12SJohn Marino */ 2349*3ff40c12SJohn Marino int (*shared_freq)(void *priv); 2350*3ff40c12SJohn Marino 2351*3ff40c12SJohn Marino /** 2352*3ff40c12SJohn Marino * get_noa - Get current Notice of Absence attribute payload 2353*3ff40c12SJohn Marino * @priv: Private driver interface data 2354*3ff40c12SJohn Marino * @buf: Buffer for returning NoA 2355*3ff40c12SJohn Marino * @buf_len: Buffer length in octets 2356*3ff40c12SJohn Marino * Returns: Number of octets used in buf, 0 to indicate no NoA is being 2357*3ff40c12SJohn Marino * advertized, or -1 on failure 2358*3ff40c12SJohn Marino * 2359*3ff40c12SJohn Marino * This function is used to fetch the current Notice of Absence 2360*3ff40c12SJohn Marino * attribute value from GO. 2361*3ff40c12SJohn Marino */ 2362*3ff40c12SJohn Marino int (*get_noa)(void *priv, u8 *buf, size_t buf_len); 2363*3ff40c12SJohn Marino 2364*3ff40c12SJohn Marino /** 2365*3ff40c12SJohn Marino * set_noa - Set Notice of Absence parameters for GO (testing) 2366*3ff40c12SJohn Marino * @priv: Private driver interface data 2367*3ff40c12SJohn Marino * @count: Count 2368*3ff40c12SJohn Marino * @start: Start time in ms from next TBTT 2369*3ff40c12SJohn Marino * @duration: Duration in ms 2370*3ff40c12SJohn Marino * Returns: 0 on success or -1 on failure 2371*3ff40c12SJohn Marino * 2372*3ff40c12SJohn Marino * This function is used to set Notice of Absence parameters for GO. It 2373*3ff40c12SJohn Marino * is used only for testing. To disable NoA, all parameters are set to 2374*3ff40c12SJohn Marino * 0. 2375*3ff40c12SJohn Marino */ 2376*3ff40c12SJohn Marino int (*set_noa)(void *priv, u8 count, int start, int duration); 2377*3ff40c12SJohn Marino 2378*3ff40c12SJohn Marino /** 2379*3ff40c12SJohn Marino * set_p2p_powersave - Set P2P power save options 2380*3ff40c12SJohn Marino * @priv: Private driver interface data 2381*3ff40c12SJohn Marino * @legacy_ps: 0 = disable, 1 = enable, 2 = maximum PS, -1 = no change 2382*3ff40c12SJohn Marino * @opp_ps: 0 = disable, 1 = enable, -1 = no change 2383*3ff40c12SJohn Marino * @ctwindow: 0.. = change (msec), -1 = no change 2384*3ff40c12SJohn Marino * Returns: 0 on success or -1 on failure 2385*3ff40c12SJohn Marino */ 2386*3ff40c12SJohn Marino int (*set_p2p_powersave)(void *priv, int legacy_ps, int opp_ps, 2387*3ff40c12SJohn Marino int ctwindow); 2388*3ff40c12SJohn Marino 2389*3ff40c12SJohn Marino /** 2390*3ff40c12SJohn Marino * ampdu - Enable/disable aggregation 2391*3ff40c12SJohn Marino * @priv: Private driver interface data 2392*3ff40c12SJohn Marino * @ampdu: 1/0 = enable/disable A-MPDU aggregation 2393*3ff40c12SJohn Marino * Returns: 0 on success or -1 on failure 2394*3ff40c12SJohn Marino */ 2395*3ff40c12SJohn Marino int (*ampdu)(void *priv, int ampdu); 2396*3ff40c12SJohn Marino 2397*3ff40c12SJohn Marino /** 2398*3ff40c12SJohn Marino * get_radio_name - Get physical radio name for the device 2399*3ff40c12SJohn Marino * @priv: Private driver interface data 2400*3ff40c12SJohn Marino * Returns: Radio name or %NULL if not known 2401*3ff40c12SJohn Marino * 2402*3ff40c12SJohn Marino * The returned data must not be modified by the caller. It is assumed 2403*3ff40c12SJohn Marino * that any interface that has the same radio name as another is 2404*3ff40c12SJohn Marino * sharing the same physical radio. This information can be used to 2405*3ff40c12SJohn Marino * share scan results etc. information between the virtual interfaces 2406*3ff40c12SJohn Marino * to speed up various operations. 2407*3ff40c12SJohn Marino */ 2408*3ff40c12SJohn Marino const char * (*get_radio_name)(void *priv); 2409*3ff40c12SJohn Marino 2410*3ff40c12SJohn Marino /** 2411*3ff40c12SJohn Marino * send_tdls_mgmt - for sending TDLS management packets 2412*3ff40c12SJohn Marino * @priv: private driver interface data 2413*3ff40c12SJohn Marino * @dst: Destination (peer) MAC address 2414*3ff40c12SJohn Marino * @action_code: TDLS action code for the mssage 2415*3ff40c12SJohn Marino * @dialog_token: Dialog Token to use in the message (if needed) 2416*3ff40c12SJohn Marino * @status_code: Status Code or Reason Code to use (if needed) 2417*3ff40c12SJohn Marino * @buf: TDLS IEs to add to the message 2418*3ff40c12SJohn Marino * @len: Length of buf in octets 2419*3ff40c12SJohn Marino * Returns: 0 on success, negative (<0) on failure 2420*3ff40c12SJohn Marino * 2421*3ff40c12SJohn Marino * This optional function can be used to send packet to driver which is 2422*3ff40c12SJohn Marino * responsible for receiving and sending all TDLS packets. 2423*3ff40c12SJohn Marino */ 2424*3ff40c12SJohn Marino int (*send_tdls_mgmt)(void *priv, const u8 *dst, u8 action_code, 2425*3ff40c12SJohn Marino u8 dialog_token, u16 status_code, 2426*3ff40c12SJohn Marino const u8 *buf, size_t len); 2427*3ff40c12SJohn Marino 2428*3ff40c12SJohn Marino /** 2429*3ff40c12SJohn Marino * tdls_oper - Ask the driver to perform high-level TDLS operations 2430*3ff40c12SJohn Marino * @priv: Private driver interface data 2431*3ff40c12SJohn Marino * @oper: TDLS high-level operation. See %enum tdls_oper 2432*3ff40c12SJohn Marino * @peer: Destination (peer) MAC address 2433*3ff40c12SJohn Marino * Returns: 0 on success, negative (<0) on failure 2434*3ff40c12SJohn Marino * 2435*3ff40c12SJohn Marino * This optional function can be used to send high-level TDLS commands 2436*3ff40c12SJohn Marino * to the driver. 2437*3ff40c12SJohn Marino */ 2438*3ff40c12SJohn Marino int (*tdls_oper)(void *priv, enum tdls_oper oper, const u8 *peer); 2439*3ff40c12SJohn Marino 2440*3ff40c12SJohn Marino /** 2441*3ff40c12SJohn Marino * wnm_oper - Notify driver of the WNM frame reception 2442*3ff40c12SJohn Marino * @priv: Private driver interface data 2443*3ff40c12SJohn Marino * @oper: WNM operation. See %enum wnm_oper 2444*3ff40c12SJohn Marino * @peer: Destination (peer) MAC address 2445*3ff40c12SJohn Marino * @buf: Buffer for the driver to fill in (for getting IE) 2446*3ff40c12SJohn Marino * @buf_len: Return the len of buf 2447*3ff40c12SJohn Marino * Returns: 0 on success, negative (<0) on failure 2448*3ff40c12SJohn Marino */ 2449*3ff40c12SJohn Marino int (*wnm_oper)(void *priv, enum wnm_oper oper, const u8 *peer, 2450*3ff40c12SJohn Marino u8 *buf, u16 *buf_len); 2451*3ff40c12SJohn Marino 2452*3ff40c12SJohn Marino /** 2453*3ff40c12SJohn Marino * set_qos_map - Set QoS Map 2454*3ff40c12SJohn Marino * @priv: Private driver interface data 2455*3ff40c12SJohn Marino * @qos_map_set: QoS Map 2456*3ff40c12SJohn Marino * @qos_map_set_len: Length of QoS Map 2457*3ff40c12SJohn Marino */ 2458*3ff40c12SJohn Marino int (*set_qos_map)(void *priv, const u8 *qos_map_set, 2459*3ff40c12SJohn Marino u8 qos_map_set_len); 2460*3ff40c12SJohn Marino 2461*3ff40c12SJohn Marino /** 2462*3ff40c12SJohn Marino * signal_poll - Get current connection information 2463*3ff40c12SJohn Marino * @priv: Private driver interface data 2464*3ff40c12SJohn Marino * @signal_info: Connection info structure 2465*3ff40c12SJohn Marino */ 2466*3ff40c12SJohn Marino int (*signal_poll)(void *priv, struct wpa_signal_info *signal_info); 2467*3ff40c12SJohn Marino 2468*3ff40c12SJohn Marino /** 2469*3ff40c12SJohn Marino * set_authmode - Set authentication algorithm(s) for static WEP 2470*3ff40c12SJohn Marino * @priv: Private driver interface data 2471*3ff40c12SJohn Marino * @authmode: 1=Open System, 2=Shared Key, 3=both 2472*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 2473*3ff40c12SJohn Marino * 2474*3ff40c12SJohn Marino * This function can be used to set authentication algorithms for AP 2475*3ff40c12SJohn Marino * mode when static WEP is used. If the driver uses user space MLME/SME 2476*3ff40c12SJohn Marino * implementation, there is no need to implement this function. 2477*3ff40c12SJohn Marino * 2478*3ff40c12SJohn Marino * DEPRECATED - use set_ap() instead 2479*3ff40c12SJohn Marino */ 2480*3ff40c12SJohn Marino int (*set_authmode)(void *priv, int authmode); 2481*3ff40c12SJohn Marino 2482*3ff40c12SJohn Marino #ifdef ANDROID 2483*3ff40c12SJohn Marino /** 2484*3ff40c12SJohn Marino * driver_cmd - Execute driver-specific command 2485*3ff40c12SJohn Marino * @priv: Private driver interface data 2486*3ff40c12SJohn Marino * @cmd: Command to execute 2487*3ff40c12SJohn Marino * @buf: Return buffer 2488*3ff40c12SJohn Marino * @buf_len: Buffer length 2489*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 2490*3ff40c12SJohn Marino */ 2491*3ff40c12SJohn Marino int (*driver_cmd)(void *priv, char *cmd, char *buf, size_t buf_len); 2492*3ff40c12SJohn Marino #endif /* ANDROID */ 2493*3ff40c12SJohn Marino 2494*3ff40c12SJohn Marino /** 2495*3ff40c12SJohn Marino * set_rekey_info - Set rekey information 2496*3ff40c12SJohn Marino * @priv: Private driver interface data 2497*3ff40c12SJohn Marino * @kek: Current KEK 2498*3ff40c12SJohn Marino * @kck: Current KCK 2499*3ff40c12SJohn Marino * @replay_ctr: Current EAPOL-Key Replay Counter 2500*3ff40c12SJohn Marino * 2501*3ff40c12SJohn Marino * This optional function can be used to provide information for the 2502*3ff40c12SJohn Marino * driver/firmware to process EAPOL-Key frames in Group Key Handshake 2503*3ff40c12SJohn Marino * while the host (including wpa_supplicant) is sleeping. 2504*3ff40c12SJohn Marino */ 2505*3ff40c12SJohn Marino void (*set_rekey_info)(void *priv, const u8 *kek, const u8 *kck, 2506*3ff40c12SJohn Marino const u8 *replay_ctr); 2507*3ff40c12SJohn Marino 2508*3ff40c12SJohn Marino /** 2509*3ff40c12SJohn Marino * sta_assoc - Station association indication 2510*3ff40c12SJohn Marino * @priv: Private driver interface data 2511*3ff40c12SJohn Marino * @own_addr: Source address and BSSID for association frame 2512*3ff40c12SJohn Marino * @addr: MAC address of the station to associate 2513*3ff40c12SJohn Marino * @reassoc: flag to indicate re-association 2514*3ff40c12SJohn Marino * @status: association response status code 2515*3ff40c12SJohn Marino * @ie: assoc response ie buffer 2516*3ff40c12SJohn Marino * @len: ie buffer length 2517*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 2518*3ff40c12SJohn Marino * 2519*3ff40c12SJohn Marino * This function indicates the driver to send (Re)Association 2520*3ff40c12SJohn Marino * Response frame to the station. 2521*3ff40c12SJohn Marino */ 2522*3ff40c12SJohn Marino int (*sta_assoc)(void *priv, const u8 *own_addr, const u8 *addr, 2523*3ff40c12SJohn Marino int reassoc, u16 status, const u8 *ie, size_t len); 2524*3ff40c12SJohn Marino 2525*3ff40c12SJohn Marino /** 2526*3ff40c12SJohn Marino * sta_auth - Station authentication indication 2527*3ff40c12SJohn Marino * @priv: Private driver interface data 2528*3ff40c12SJohn Marino * @own_addr: Source address and BSSID for authentication frame 2529*3ff40c12SJohn Marino * @addr: MAC address of the station to associate 2530*3ff40c12SJohn Marino * @seq: authentication sequence number 2531*3ff40c12SJohn Marino * @status: authentication response status code 2532*3ff40c12SJohn Marino * @ie: authentication frame ie buffer 2533*3ff40c12SJohn Marino * @len: ie buffer length 2534*3ff40c12SJohn Marino * 2535*3ff40c12SJohn Marino * This function indicates the driver to send Authentication frame 2536*3ff40c12SJohn Marino * to the station. 2537*3ff40c12SJohn Marino */ 2538*3ff40c12SJohn Marino int (*sta_auth)(void *priv, const u8 *own_addr, const u8 *addr, 2539*3ff40c12SJohn Marino u16 seq, u16 status, const u8 *ie, size_t len); 2540*3ff40c12SJohn Marino 2541*3ff40c12SJohn Marino /** 2542*3ff40c12SJohn Marino * add_tspec - Add traffic stream 2543*3ff40c12SJohn Marino * @priv: Private driver interface data 2544*3ff40c12SJohn Marino * @addr: MAC address of the station to associate 2545*3ff40c12SJohn Marino * @tspec_ie: tspec ie buffer 2546*3ff40c12SJohn Marino * @tspec_ielen: tspec ie length 2547*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 2548*3ff40c12SJohn Marino * 2549*3ff40c12SJohn Marino * This function adds the traffic steam for the station 2550*3ff40c12SJohn Marino * and fills the medium_time in tspec_ie. 2551*3ff40c12SJohn Marino */ 2552*3ff40c12SJohn Marino int (*add_tspec)(void *priv, const u8 *addr, u8 *tspec_ie, 2553*3ff40c12SJohn Marino size_t tspec_ielen); 2554*3ff40c12SJohn Marino 2555*3ff40c12SJohn Marino /** 2556*3ff40c12SJohn Marino * add_sta_node - Add a station node in the driver 2557*3ff40c12SJohn Marino * @priv: Private driver interface data 2558*3ff40c12SJohn Marino * @addr: MAC address of the station to add 2559*3ff40c12SJohn Marino * @auth_alg: authentication algorithm used by the station 2560*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 2561*3ff40c12SJohn Marino * 2562*3ff40c12SJohn Marino * This function adds the station node in the driver, when 2563*3ff40c12SJohn Marino * the station gets added by FT-over-DS. 2564*3ff40c12SJohn Marino */ 2565*3ff40c12SJohn Marino int (*add_sta_node)(void *priv, const u8 *addr, u16 auth_alg); 2566*3ff40c12SJohn Marino 2567*3ff40c12SJohn Marino /** 2568*3ff40c12SJohn Marino * sched_scan - Request the driver to initiate scheduled scan 2569*3ff40c12SJohn Marino * @priv: Private driver interface data 2570*3ff40c12SJohn Marino * @params: Scan parameters 2571*3ff40c12SJohn Marino * @interval: Interval between scan cycles in milliseconds 2572*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 2573*3ff40c12SJohn Marino * 2574*3ff40c12SJohn Marino * This operation should be used for scheduled scan offload to 2575*3ff40c12SJohn Marino * the hardware. Every time scan results are available, the 2576*3ff40c12SJohn Marino * driver should report scan results event for wpa_supplicant 2577*3ff40c12SJohn Marino * which will eventually request the results with 2578*3ff40c12SJohn Marino * wpa_driver_get_scan_results2(). This operation is optional 2579*3ff40c12SJohn Marino * and if not provided or if it returns -1, we fall back to 2580*3ff40c12SJohn Marino * normal host-scheduled scans. 2581*3ff40c12SJohn Marino */ 2582*3ff40c12SJohn Marino int (*sched_scan)(void *priv, struct wpa_driver_scan_params *params, 2583*3ff40c12SJohn Marino u32 interval); 2584*3ff40c12SJohn Marino 2585*3ff40c12SJohn Marino /** 2586*3ff40c12SJohn Marino * stop_sched_scan - Request the driver to stop a scheduled scan 2587*3ff40c12SJohn Marino * @priv: Private driver interface data 2588*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 2589*3ff40c12SJohn Marino * 2590*3ff40c12SJohn Marino * This should cause the scheduled scan to be stopped and 2591*3ff40c12SJohn Marino * results should stop being sent. Must be supported if 2592*3ff40c12SJohn Marino * sched_scan is supported. 2593*3ff40c12SJohn Marino */ 2594*3ff40c12SJohn Marino int (*stop_sched_scan)(void *priv); 2595*3ff40c12SJohn Marino 2596*3ff40c12SJohn Marino /** 2597*3ff40c12SJohn Marino * poll_client - Probe (null data or such) the given station 2598*3ff40c12SJohn Marino * @priv: Private driver interface data 2599*3ff40c12SJohn Marino * @own_addr: MAC address of sending interface 2600*3ff40c12SJohn Marino * @addr: MAC address of the station to probe 2601*3ff40c12SJohn Marino * @qos: Indicates whether station is QoS station 2602*3ff40c12SJohn Marino * 2603*3ff40c12SJohn Marino * This function is used to verify whether an associated station is 2604*3ff40c12SJohn Marino * still present. This function does not need to be implemented if the 2605*3ff40c12SJohn Marino * driver provides such inactivity polling mechanism. 2606*3ff40c12SJohn Marino */ 2607*3ff40c12SJohn Marino void (*poll_client)(void *priv, const u8 *own_addr, 2608*3ff40c12SJohn Marino const u8 *addr, int qos); 2609*3ff40c12SJohn Marino 2610*3ff40c12SJohn Marino /** 2611*3ff40c12SJohn Marino * radio_disable - Disable/enable radio 2612*3ff40c12SJohn Marino * @priv: Private driver interface data 2613*3ff40c12SJohn Marino * @disabled: 1=disable 0=enable radio 2614*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 2615*3ff40c12SJohn Marino * 2616*3ff40c12SJohn Marino * This optional command is for testing purposes. It can be used to 2617*3ff40c12SJohn Marino * disable the radio on a testbed device to simulate out-of-radio-range 2618*3ff40c12SJohn Marino * conditions. 2619*3ff40c12SJohn Marino */ 2620*3ff40c12SJohn Marino int (*radio_disable)(void *priv, int disabled); 2621*3ff40c12SJohn Marino 2622*3ff40c12SJohn Marino /** 2623*3ff40c12SJohn Marino * switch_channel - Announce channel switch and migrate the GO to the 2624*3ff40c12SJohn Marino * given frequency 2625*3ff40c12SJohn Marino * @priv: Private driver interface data 2626*3ff40c12SJohn Marino * @settings: Settings for CSA period and new channel 2627*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 2628*3ff40c12SJohn Marino * 2629*3ff40c12SJohn Marino * This function is used to move the GO to the legacy STA channel to 2630*3ff40c12SJohn Marino * avoid frequency conflict in single channel concurrency. 2631*3ff40c12SJohn Marino */ 2632*3ff40c12SJohn Marino int (*switch_channel)(void *priv, struct csa_settings *settings); 2633*3ff40c12SJohn Marino 2634*3ff40c12SJohn Marino /** 2635*3ff40c12SJohn Marino * start_dfs_cac - Listen for radar interference on the channel 2636*3ff40c12SJohn Marino * @priv: Private driver interface data 2637*3ff40c12SJohn Marino * @freq: Channel parameters 2638*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 2639*3ff40c12SJohn Marino */ 2640*3ff40c12SJohn Marino int (*start_dfs_cac)(void *priv, struct hostapd_freq_params *freq); 2641*3ff40c12SJohn Marino 2642*3ff40c12SJohn Marino /** 2643*3ff40c12SJohn Marino * stop_ap - Removes beacon from AP 2644*3ff40c12SJohn Marino * @priv: Private driver interface data 2645*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure (or if not supported) 2646*3ff40c12SJohn Marino * 2647*3ff40c12SJohn Marino * This optional function can be used to disable AP mode related 2648*3ff40c12SJohn Marino * configuration. Unlike deinit_ap, it does not change to station 2649*3ff40c12SJohn Marino * mode. 2650*3ff40c12SJohn Marino */ 2651*3ff40c12SJohn Marino int (*stop_ap)(void *priv); 2652*3ff40c12SJohn Marino 2653*3ff40c12SJohn Marino /** 2654*3ff40c12SJohn Marino * get_survey - Retrieve survey data 2655*3ff40c12SJohn Marino * @priv: Private driver interface data 2656*3ff40c12SJohn Marino * @freq: If set, survey data for the specified frequency is only 2657*3ff40c12SJohn Marino * being requested. If not set, all survey data is requested. 2658*3ff40c12SJohn Marino * Returns: 0 on success, -1 on failure 2659*3ff40c12SJohn Marino * 2660*3ff40c12SJohn Marino * Use this to retrieve: 2661*3ff40c12SJohn Marino * 2662*3ff40c12SJohn Marino * - the observed channel noise floor 2663*3ff40c12SJohn Marino * - the amount of time we have spent on the channel 2664*3ff40c12SJohn Marino * - the amount of time during which we have spent on the channel that 2665*3ff40c12SJohn Marino * the radio has determined the medium is busy and we cannot 2666*3ff40c12SJohn Marino * transmit 2667*3ff40c12SJohn Marino * - the amount of time we have spent receiving data 2668*3ff40c12SJohn Marino * - the amount of time we have spent transmitting data 2669*3ff40c12SJohn Marino * 2670*3ff40c12SJohn Marino * This data can be used for spectrum heuristics. One example is 2671*3ff40c12SJohn Marino * Automatic Channel Selection (ACS). The channel survey data is 2672*3ff40c12SJohn Marino * kept on a linked list on the channel data, one entry is added 2673*3ff40c12SJohn Marino * for each survey. The min_nf of the channel is updated for each 2674*3ff40c12SJohn Marino * survey. 2675*3ff40c12SJohn Marino */ 2676*3ff40c12SJohn Marino int (*get_survey)(void *priv, unsigned int freq); 2677*3ff40c12SJohn Marino 2678*3ff40c12SJohn Marino /** 2679*3ff40c12SJohn Marino * status - Get driver interface status information 2680*3ff40c12SJohn Marino * @priv: Private driver interface data 2681*3ff40c12SJohn Marino * @buf: Buffer for printing tou the status information 2682*3ff40c12SJohn Marino * @buflen: Maximum length of the buffer 2683*3ff40c12SJohn Marino * Returns: Length of written status information or -1 on failure 2684*3ff40c12SJohn Marino */ 2685*3ff40c12SJohn Marino int (*status)(void *priv, char *buf, size_t buflen); 26866d49e1aeSJan Lentfer }; 26876d49e1aeSJan Lentfer 26886d49e1aeSJan Lentfer 26896d49e1aeSJan Lentfer /** 26906d49e1aeSJan Lentfer * enum wpa_event_type - Event type for wpa_supplicant_event() calls 26916d49e1aeSJan Lentfer */ 2692*3ff40c12SJohn Marino enum wpa_event_type { 26936d49e1aeSJan Lentfer /** 26946d49e1aeSJan Lentfer * EVENT_ASSOC - Association completed 26956d49e1aeSJan Lentfer * 26966d49e1aeSJan Lentfer * This event needs to be delivered when the driver completes IEEE 26976d49e1aeSJan Lentfer * 802.11 association or reassociation successfully. 26986d49e1aeSJan Lentfer * wpa_driver_ops::get_bssid() is expected to provide the current BSSID 26996d49e1aeSJan Lentfer * after this event has been generated. In addition, optional 27006d49e1aeSJan Lentfer * EVENT_ASSOCINFO may be generated just before EVENT_ASSOC to provide 27016d49e1aeSJan Lentfer * more information about the association. If the driver interface gets 27026d49e1aeSJan Lentfer * both of these events at the same time, it can also include the 27036d49e1aeSJan Lentfer * assoc_info data in EVENT_ASSOC call. 27046d49e1aeSJan Lentfer */ 27056d49e1aeSJan Lentfer EVENT_ASSOC, 27066d49e1aeSJan Lentfer 27076d49e1aeSJan Lentfer /** 27086d49e1aeSJan Lentfer * EVENT_DISASSOC - Association lost 27096d49e1aeSJan Lentfer * 27106d49e1aeSJan Lentfer * This event should be called when association is lost either due to 27116d49e1aeSJan Lentfer * receiving deauthenticate or disassociate frame from the AP or when 2712*3ff40c12SJohn Marino * sending either of these frames to the current AP. If the driver 2713*3ff40c12SJohn Marino * supports separate deauthentication event, EVENT_DISASSOC should only 2714*3ff40c12SJohn Marino * be used for disassociation and EVENT_DEAUTH for deauthentication. 2715*3ff40c12SJohn Marino * In AP mode, union wpa_event_data::disassoc_info is required. 27166d49e1aeSJan Lentfer */ 27176d49e1aeSJan Lentfer EVENT_DISASSOC, 27186d49e1aeSJan Lentfer 27196d49e1aeSJan Lentfer /** 27206d49e1aeSJan Lentfer * EVENT_MICHAEL_MIC_FAILURE - Michael MIC (TKIP) detected 27216d49e1aeSJan Lentfer * 27226d49e1aeSJan Lentfer * This event must be delivered when a Michael MIC error is detected by 27236d49e1aeSJan Lentfer * the local driver. Additional data for event processing is 27246d49e1aeSJan Lentfer * provided with union wpa_event_data::michael_mic_failure. This 27256d49e1aeSJan Lentfer * information is used to request new encyption key and to initiate 27266d49e1aeSJan Lentfer * TKIP countermeasures if needed. 27276d49e1aeSJan Lentfer */ 27286d49e1aeSJan Lentfer EVENT_MICHAEL_MIC_FAILURE, 27296d49e1aeSJan Lentfer 27306d49e1aeSJan Lentfer /** 27316d49e1aeSJan Lentfer * EVENT_SCAN_RESULTS - Scan results available 27326d49e1aeSJan Lentfer * 27336d49e1aeSJan Lentfer * This event must be called whenever scan results are available to be 27346d49e1aeSJan Lentfer * fetched with struct wpa_driver_ops::get_scan_results(). This event 27356d49e1aeSJan Lentfer * is expected to be used some time after struct wpa_driver_ops::scan() 27366d49e1aeSJan Lentfer * is called. If the driver provides an unsolicited event when the scan 27376d49e1aeSJan Lentfer * has been completed, this event can be used to trigger 27386d49e1aeSJan Lentfer * EVENT_SCAN_RESULTS call. If such event is not available from the 27396d49e1aeSJan Lentfer * driver, the driver wrapper code is expected to use a registered 27406d49e1aeSJan Lentfer * timeout to generate EVENT_SCAN_RESULTS call after the time that the 2741*3ff40c12SJohn Marino * scan is expected to be completed. Optional information about 2742*3ff40c12SJohn Marino * completed scan can be provided with union wpa_event_data::scan_info. 27436d49e1aeSJan Lentfer */ 27446d49e1aeSJan Lentfer EVENT_SCAN_RESULTS, 27456d49e1aeSJan Lentfer 27466d49e1aeSJan Lentfer /** 27476d49e1aeSJan Lentfer * EVENT_ASSOCINFO - Report optional extra information for association 27486d49e1aeSJan Lentfer * 27496d49e1aeSJan Lentfer * This event can be used to report extra association information for 27506d49e1aeSJan Lentfer * EVENT_ASSOC processing. This extra information includes IEs from 27516d49e1aeSJan Lentfer * association frames and Beacon/Probe Response frames in union 27526d49e1aeSJan Lentfer * wpa_event_data::assoc_info. EVENT_ASSOCINFO must be send just before 27536d49e1aeSJan Lentfer * EVENT_ASSOC. Alternatively, the driver interface can include 27546d49e1aeSJan Lentfer * assoc_info data in the EVENT_ASSOC call if it has all the 27556d49e1aeSJan Lentfer * information available at the same point. 27566d49e1aeSJan Lentfer */ 27576d49e1aeSJan Lentfer EVENT_ASSOCINFO, 27586d49e1aeSJan Lentfer 27596d49e1aeSJan Lentfer /** 27606d49e1aeSJan Lentfer * EVENT_INTERFACE_STATUS - Report interface status changes 27616d49e1aeSJan Lentfer * 27626d49e1aeSJan Lentfer * This optional event can be used to report changes in interface 27636d49e1aeSJan Lentfer * status (interface added/removed) using union 27646d49e1aeSJan Lentfer * wpa_event_data::interface_status. This can be used to trigger 27656d49e1aeSJan Lentfer * wpa_supplicant to stop and re-start processing for the interface, 27666d49e1aeSJan Lentfer * e.g., when a cardbus card is ejected/inserted. 27676d49e1aeSJan Lentfer */ 27686d49e1aeSJan Lentfer EVENT_INTERFACE_STATUS, 27696d49e1aeSJan Lentfer 27706d49e1aeSJan Lentfer /** 27716d49e1aeSJan Lentfer * EVENT_PMKID_CANDIDATE - Report a candidate AP for pre-authentication 27726d49e1aeSJan Lentfer * 27736d49e1aeSJan Lentfer * This event can be used to inform wpa_supplicant about candidates for 27746d49e1aeSJan Lentfer * RSN (WPA2) pre-authentication. If wpa_supplicant is not responsible 27756d49e1aeSJan Lentfer * for scan request (ap_scan=2 mode), this event is required for 27766d49e1aeSJan Lentfer * pre-authentication. If wpa_supplicant is performing scan request 27776d49e1aeSJan Lentfer * (ap_scan=1), this event is optional since scan results can be used 27786d49e1aeSJan Lentfer * to add pre-authentication candidates. union 27796d49e1aeSJan Lentfer * wpa_event_data::pmkid_candidate is used to report the BSSID of the 27806d49e1aeSJan Lentfer * candidate and priority of the candidate, e.g., based on the signal 27816d49e1aeSJan Lentfer * strength, in order to try to pre-authenticate first with candidates 27826d49e1aeSJan Lentfer * that are most likely targets for re-association. 27836d49e1aeSJan Lentfer * 27846d49e1aeSJan Lentfer * EVENT_PMKID_CANDIDATE can be called whenever the driver has updates 27856d49e1aeSJan Lentfer * on the candidate list. In addition, it can be called for the current 27866d49e1aeSJan Lentfer * AP and APs that have existing PMKSA cache entries. wpa_supplicant 27876d49e1aeSJan Lentfer * will automatically skip pre-authentication in cases where a valid 27886d49e1aeSJan Lentfer * PMKSA exists. When more than one candidate exists, this event should 27896d49e1aeSJan Lentfer * be generated once for each candidate. 27906d49e1aeSJan Lentfer * 27916d49e1aeSJan Lentfer * Driver will be notified about successful pre-authentication with 27926d49e1aeSJan Lentfer * struct wpa_driver_ops::add_pmkid() calls. 27936d49e1aeSJan Lentfer */ 27946d49e1aeSJan Lentfer EVENT_PMKID_CANDIDATE, 27956d49e1aeSJan Lentfer 27966d49e1aeSJan Lentfer /** 27976d49e1aeSJan Lentfer * EVENT_STKSTART - Request STK handshake (MLME-STKSTART.request) 27986d49e1aeSJan Lentfer * 27996d49e1aeSJan Lentfer * This event can be used to inform wpa_supplicant about desire to set 28006d49e1aeSJan Lentfer * up secure direct link connection between two stations as defined in 28016d49e1aeSJan Lentfer * IEEE 802.11e with a new PeerKey mechanism that replaced the original 28026d49e1aeSJan Lentfer * STAKey negotiation. The caller will need to set peer address for the 28036d49e1aeSJan Lentfer * event. 28046d49e1aeSJan Lentfer */ 28056d49e1aeSJan Lentfer EVENT_STKSTART, 28066d49e1aeSJan Lentfer 28076d49e1aeSJan Lentfer /** 2808*3ff40c12SJohn Marino * EVENT_TDLS - Request TDLS operation 2809*3ff40c12SJohn Marino * 2810*3ff40c12SJohn Marino * This event can be used to request a TDLS operation to be performed. 2811*3ff40c12SJohn Marino */ 2812*3ff40c12SJohn Marino EVENT_TDLS, 2813*3ff40c12SJohn Marino 2814*3ff40c12SJohn Marino /** 28156d49e1aeSJan Lentfer * EVENT_FT_RESPONSE - Report FT (IEEE 802.11r) response IEs 28166d49e1aeSJan Lentfer * 28176d49e1aeSJan Lentfer * The driver is expected to report the received FT IEs from 28186d49e1aeSJan Lentfer * FT authentication sequence from the AP. The FT IEs are included in 28196d49e1aeSJan Lentfer * the extra information in union wpa_event_data::ft_ies. 28206d49e1aeSJan Lentfer */ 2821*3ff40c12SJohn Marino EVENT_FT_RESPONSE, 2822*3ff40c12SJohn Marino 2823*3ff40c12SJohn Marino /** 2824*3ff40c12SJohn Marino * EVENT_IBSS_RSN_START - Request RSN authentication in IBSS 2825*3ff40c12SJohn Marino * 2826*3ff40c12SJohn Marino * The driver can use this event to inform wpa_supplicant about a STA 2827*3ff40c12SJohn Marino * in an IBSS with which protected frames could be exchanged. This 2828*3ff40c12SJohn Marino * event starts RSN authentication with the other STA to authenticate 2829*3ff40c12SJohn Marino * the STA and set up encryption keys with it. 2830*3ff40c12SJohn Marino */ 2831*3ff40c12SJohn Marino EVENT_IBSS_RSN_START, 2832*3ff40c12SJohn Marino 2833*3ff40c12SJohn Marino /** 2834*3ff40c12SJohn Marino * EVENT_AUTH - Authentication result 2835*3ff40c12SJohn Marino * 2836*3ff40c12SJohn Marino * This event should be called when authentication attempt has been 2837*3ff40c12SJohn Marino * completed. This is only used if the driver supports separate 2838*3ff40c12SJohn Marino * authentication step (struct wpa_driver_ops::authenticate). 2839*3ff40c12SJohn Marino * Information about authentication result is included in 2840*3ff40c12SJohn Marino * union wpa_event_data::auth. 2841*3ff40c12SJohn Marino */ 2842*3ff40c12SJohn Marino EVENT_AUTH, 2843*3ff40c12SJohn Marino 2844*3ff40c12SJohn Marino /** 2845*3ff40c12SJohn Marino * EVENT_DEAUTH - Authentication lost 2846*3ff40c12SJohn Marino * 2847*3ff40c12SJohn Marino * This event should be called when authentication is lost either due 2848*3ff40c12SJohn Marino * to receiving deauthenticate frame from the AP or when sending that 2849*3ff40c12SJohn Marino * frame to the current AP. 2850*3ff40c12SJohn Marino * In AP mode, union wpa_event_data::deauth_info is required. 2851*3ff40c12SJohn Marino */ 2852*3ff40c12SJohn Marino EVENT_DEAUTH, 2853*3ff40c12SJohn Marino 2854*3ff40c12SJohn Marino /** 2855*3ff40c12SJohn Marino * EVENT_ASSOC_REJECT - Association rejected 2856*3ff40c12SJohn Marino * 2857*3ff40c12SJohn Marino * This event should be called when (re)association attempt has been 2858*3ff40c12SJohn Marino * rejected by the AP. Information about the association response is 2859*3ff40c12SJohn Marino * included in union wpa_event_data::assoc_reject. 2860*3ff40c12SJohn Marino */ 2861*3ff40c12SJohn Marino EVENT_ASSOC_REJECT, 2862*3ff40c12SJohn Marino 2863*3ff40c12SJohn Marino /** 2864*3ff40c12SJohn Marino * EVENT_AUTH_TIMED_OUT - Authentication timed out 2865*3ff40c12SJohn Marino */ 2866*3ff40c12SJohn Marino EVENT_AUTH_TIMED_OUT, 2867*3ff40c12SJohn Marino 2868*3ff40c12SJohn Marino /** 2869*3ff40c12SJohn Marino * EVENT_ASSOC_TIMED_OUT - Association timed out 2870*3ff40c12SJohn Marino */ 2871*3ff40c12SJohn Marino EVENT_ASSOC_TIMED_OUT, 2872*3ff40c12SJohn Marino 2873*3ff40c12SJohn Marino /** 2874*3ff40c12SJohn Marino * EVENT_FT_RRB_RX - FT (IEEE 802.11r) RRB frame received 2875*3ff40c12SJohn Marino */ 2876*3ff40c12SJohn Marino EVENT_FT_RRB_RX, 2877*3ff40c12SJohn Marino 2878*3ff40c12SJohn Marino /** 2879*3ff40c12SJohn Marino * EVENT_WPS_BUTTON_PUSHED - Report hardware push button press for WPS 2880*3ff40c12SJohn Marino */ 2881*3ff40c12SJohn Marino EVENT_WPS_BUTTON_PUSHED, 2882*3ff40c12SJohn Marino 2883*3ff40c12SJohn Marino /** 2884*3ff40c12SJohn Marino * EVENT_TX_STATUS - Report TX status 2885*3ff40c12SJohn Marino */ 2886*3ff40c12SJohn Marino EVENT_TX_STATUS, 2887*3ff40c12SJohn Marino 2888*3ff40c12SJohn Marino /** 2889*3ff40c12SJohn Marino * EVENT_RX_FROM_UNKNOWN - Report RX from unknown STA 2890*3ff40c12SJohn Marino */ 2891*3ff40c12SJohn Marino EVENT_RX_FROM_UNKNOWN, 2892*3ff40c12SJohn Marino 2893*3ff40c12SJohn Marino /** 2894*3ff40c12SJohn Marino * EVENT_RX_MGMT - Report RX of a management frame 2895*3ff40c12SJohn Marino */ 2896*3ff40c12SJohn Marino EVENT_RX_MGMT, 2897*3ff40c12SJohn Marino 2898*3ff40c12SJohn Marino /** 2899*3ff40c12SJohn Marino * EVENT_REMAIN_ON_CHANNEL - Remain-on-channel duration started 2900*3ff40c12SJohn Marino * 2901*3ff40c12SJohn Marino * This event is used to indicate when the driver has started the 2902*3ff40c12SJohn Marino * requested remain-on-channel duration. Information about the 2903*3ff40c12SJohn Marino * operation is included in union wpa_event_data::remain_on_channel. 2904*3ff40c12SJohn Marino */ 2905*3ff40c12SJohn Marino EVENT_REMAIN_ON_CHANNEL, 2906*3ff40c12SJohn Marino 2907*3ff40c12SJohn Marino /** 2908*3ff40c12SJohn Marino * EVENT_CANCEL_REMAIN_ON_CHANNEL - Remain-on-channel timed out 2909*3ff40c12SJohn Marino * 2910*3ff40c12SJohn Marino * This event is used to indicate when the driver has completed 2911*3ff40c12SJohn Marino * remain-on-channel duration, i.e., may noot be available on the 2912*3ff40c12SJohn Marino * requested channel anymore. Information about the 2913*3ff40c12SJohn Marino * operation is included in union wpa_event_data::remain_on_channel. 2914*3ff40c12SJohn Marino */ 2915*3ff40c12SJohn Marino EVENT_CANCEL_REMAIN_ON_CHANNEL, 2916*3ff40c12SJohn Marino 2917*3ff40c12SJohn Marino /** 2918*3ff40c12SJohn Marino * EVENT_MLME_RX - Report reception of frame for MLME (test use only) 2919*3ff40c12SJohn Marino * 2920*3ff40c12SJohn Marino * This event is used only by driver_test.c and userspace MLME. 2921*3ff40c12SJohn Marino */ 2922*3ff40c12SJohn Marino EVENT_MLME_RX, 2923*3ff40c12SJohn Marino 2924*3ff40c12SJohn Marino /** 2925*3ff40c12SJohn Marino * EVENT_RX_PROBE_REQ - Indicate received Probe Request frame 2926*3ff40c12SJohn Marino * 2927*3ff40c12SJohn Marino * This event is used to indicate when a Probe Request frame has been 2928*3ff40c12SJohn Marino * received. Information about the received frame is included in 2929*3ff40c12SJohn Marino * union wpa_event_data::rx_probe_req. The driver is required to report 2930*3ff40c12SJohn Marino * these events only after successfully completed probe_req_report() 2931*3ff40c12SJohn Marino * commands to request the events (i.e., report parameter is non-zero) 2932*3ff40c12SJohn Marino * in station mode. In AP mode, Probe Request frames should always be 2933*3ff40c12SJohn Marino * reported. 2934*3ff40c12SJohn Marino */ 2935*3ff40c12SJohn Marino EVENT_RX_PROBE_REQ, 2936*3ff40c12SJohn Marino 2937*3ff40c12SJohn Marino /** 2938*3ff40c12SJohn Marino * EVENT_NEW_STA - New wired device noticed 2939*3ff40c12SJohn Marino * 2940*3ff40c12SJohn Marino * This event is used to indicate that a new device has been detected 2941*3ff40c12SJohn Marino * in a network that does not use association-like functionality (i.e., 2942*3ff40c12SJohn Marino * mainly wired Ethernet). This can be used to start EAPOL 2943*3ff40c12SJohn Marino * authenticator when receiving a frame from a device. The address of 2944*3ff40c12SJohn Marino * the device is included in union wpa_event_data::new_sta. 2945*3ff40c12SJohn Marino */ 2946*3ff40c12SJohn Marino EVENT_NEW_STA, 2947*3ff40c12SJohn Marino 2948*3ff40c12SJohn Marino /** 2949*3ff40c12SJohn Marino * EVENT_EAPOL_RX - Report received EAPOL frame 2950*3ff40c12SJohn Marino * 2951*3ff40c12SJohn Marino * When in AP mode with hostapd, this event is required to be used to 2952*3ff40c12SJohn Marino * deliver the receive EAPOL frames from the driver. With 2953*3ff40c12SJohn Marino * %wpa_supplicant, this event is used only if the send_eapol() handler 2954*3ff40c12SJohn Marino * is used to override the use of l2_packet for EAPOL frame TX. 2955*3ff40c12SJohn Marino */ 2956*3ff40c12SJohn Marino EVENT_EAPOL_RX, 2957*3ff40c12SJohn Marino 2958*3ff40c12SJohn Marino /** 2959*3ff40c12SJohn Marino * EVENT_SIGNAL_CHANGE - Indicate change in signal strength 2960*3ff40c12SJohn Marino * 2961*3ff40c12SJohn Marino * This event is used to indicate changes in the signal strength 2962*3ff40c12SJohn Marino * observed in frames received from the current AP if signal strength 2963*3ff40c12SJohn Marino * monitoring has been enabled with signal_monitor(). 2964*3ff40c12SJohn Marino */ 2965*3ff40c12SJohn Marino EVENT_SIGNAL_CHANGE, 2966*3ff40c12SJohn Marino 2967*3ff40c12SJohn Marino /** 2968*3ff40c12SJohn Marino * EVENT_INTERFACE_ENABLED - Notify that interface was enabled 2969*3ff40c12SJohn Marino * 2970*3ff40c12SJohn Marino * This event is used to indicate that the interface was enabled after 2971*3ff40c12SJohn Marino * having been previously disabled, e.g., due to rfkill. 2972*3ff40c12SJohn Marino */ 2973*3ff40c12SJohn Marino EVENT_INTERFACE_ENABLED, 2974*3ff40c12SJohn Marino 2975*3ff40c12SJohn Marino /** 2976*3ff40c12SJohn Marino * EVENT_INTERFACE_DISABLED - Notify that interface was disabled 2977*3ff40c12SJohn Marino * 2978*3ff40c12SJohn Marino * This event is used to indicate that the interface was disabled, 2979*3ff40c12SJohn Marino * e.g., due to rfkill. 2980*3ff40c12SJohn Marino */ 2981*3ff40c12SJohn Marino EVENT_INTERFACE_DISABLED, 2982*3ff40c12SJohn Marino 2983*3ff40c12SJohn Marino /** 2984*3ff40c12SJohn Marino * EVENT_CHANNEL_LIST_CHANGED - Channel list changed 2985*3ff40c12SJohn Marino * 2986*3ff40c12SJohn Marino * This event is used to indicate that the channel list has changed, 2987*3ff40c12SJohn Marino * e.g., because of a regulatory domain change triggered by scan 2988*3ff40c12SJohn Marino * results including an AP advertising a country code. 2989*3ff40c12SJohn Marino */ 2990*3ff40c12SJohn Marino EVENT_CHANNEL_LIST_CHANGED, 2991*3ff40c12SJohn Marino 2992*3ff40c12SJohn Marino /** 2993*3ff40c12SJohn Marino * EVENT_INTERFACE_UNAVAILABLE - Notify that interface is unavailable 2994*3ff40c12SJohn Marino * 2995*3ff40c12SJohn Marino * This event is used to indicate that the driver cannot maintain this 2996*3ff40c12SJohn Marino * interface in its operation mode anymore. The most likely use for 2997*3ff40c12SJohn Marino * this is to indicate that AP mode operation is not available due to 2998*3ff40c12SJohn Marino * operating channel would need to be changed to a DFS channel when 2999*3ff40c12SJohn Marino * the driver does not support radar detection and another virtual 3000*3ff40c12SJohn Marino * interfaces caused the operating channel to change. Other similar 3001*3ff40c12SJohn Marino * resource conflicts could also trigger this for station mode 3002*3ff40c12SJohn Marino * interfaces. 3003*3ff40c12SJohn Marino */ 3004*3ff40c12SJohn Marino EVENT_INTERFACE_UNAVAILABLE, 3005*3ff40c12SJohn Marino 3006*3ff40c12SJohn Marino /** 3007*3ff40c12SJohn Marino * EVENT_BEST_CHANNEL 3008*3ff40c12SJohn Marino * 3009*3ff40c12SJohn Marino * Driver generates this event whenever it detects a better channel 3010*3ff40c12SJohn Marino * (e.g., based on RSSI or channel use). This information can be used 3011*3ff40c12SJohn Marino * to improve channel selection for a new AP/P2P group. 3012*3ff40c12SJohn Marino */ 3013*3ff40c12SJohn Marino EVENT_BEST_CHANNEL, 3014*3ff40c12SJohn Marino 3015*3ff40c12SJohn Marino /** 3016*3ff40c12SJohn Marino * EVENT_UNPROT_DEAUTH - Unprotected Deauthentication frame received 3017*3ff40c12SJohn Marino * 3018*3ff40c12SJohn Marino * This event should be called when a Deauthentication frame is dropped 3019*3ff40c12SJohn Marino * due to it not being protected (MFP/IEEE 802.11w). 3020*3ff40c12SJohn Marino * union wpa_event_data::unprot_deauth is required to provide more 3021*3ff40c12SJohn Marino * details of the frame. 3022*3ff40c12SJohn Marino */ 3023*3ff40c12SJohn Marino EVENT_UNPROT_DEAUTH, 3024*3ff40c12SJohn Marino 3025*3ff40c12SJohn Marino /** 3026*3ff40c12SJohn Marino * EVENT_UNPROT_DISASSOC - Unprotected Disassociation frame received 3027*3ff40c12SJohn Marino * 3028*3ff40c12SJohn Marino * This event should be called when a Disassociation frame is dropped 3029*3ff40c12SJohn Marino * due to it not being protected (MFP/IEEE 802.11w). 3030*3ff40c12SJohn Marino * union wpa_event_data::unprot_disassoc is required to provide more 3031*3ff40c12SJohn Marino * details of the frame. 3032*3ff40c12SJohn Marino */ 3033*3ff40c12SJohn Marino EVENT_UNPROT_DISASSOC, 3034*3ff40c12SJohn Marino 3035*3ff40c12SJohn Marino /** 3036*3ff40c12SJohn Marino * EVENT_STATION_LOW_ACK 3037*3ff40c12SJohn Marino * 3038*3ff40c12SJohn Marino * Driver generates this event whenever it detected that a particular 3039*3ff40c12SJohn Marino * station was lost. Detection can be through massive transmission 3040*3ff40c12SJohn Marino * failures for example. 3041*3ff40c12SJohn Marino */ 3042*3ff40c12SJohn Marino EVENT_STATION_LOW_ACK, 3043*3ff40c12SJohn Marino 3044*3ff40c12SJohn Marino /** 3045*3ff40c12SJohn Marino * EVENT_IBSS_PEER_LOST - IBSS peer not reachable anymore 3046*3ff40c12SJohn Marino */ 3047*3ff40c12SJohn Marino EVENT_IBSS_PEER_LOST, 3048*3ff40c12SJohn Marino 3049*3ff40c12SJohn Marino /** 3050*3ff40c12SJohn Marino * EVENT_DRIVER_GTK_REKEY - Device/driver did GTK rekey 3051*3ff40c12SJohn Marino * 3052*3ff40c12SJohn Marino * This event carries the new replay counter to notify wpa_supplicant 3053*3ff40c12SJohn Marino * of the current EAPOL-Key Replay Counter in case the driver/firmware 3054*3ff40c12SJohn Marino * completed Group Key Handshake while the host (including 3055*3ff40c12SJohn Marino * wpa_supplicant was sleeping). 3056*3ff40c12SJohn Marino */ 3057*3ff40c12SJohn Marino EVENT_DRIVER_GTK_REKEY, 3058*3ff40c12SJohn Marino 3059*3ff40c12SJohn Marino /** 3060*3ff40c12SJohn Marino * EVENT_SCHED_SCAN_STOPPED - Scheduled scan was stopped 3061*3ff40c12SJohn Marino */ 3062*3ff40c12SJohn Marino EVENT_SCHED_SCAN_STOPPED, 3063*3ff40c12SJohn Marino 3064*3ff40c12SJohn Marino /** 3065*3ff40c12SJohn Marino * EVENT_DRIVER_CLIENT_POLL_OK - Station responded to poll 3066*3ff40c12SJohn Marino * 3067*3ff40c12SJohn Marino * This event indicates that the station responded to the poll 3068*3ff40c12SJohn Marino * initiated with @poll_client. 3069*3ff40c12SJohn Marino */ 3070*3ff40c12SJohn Marino EVENT_DRIVER_CLIENT_POLL_OK, 3071*3ff40c12SJohn Marino 3072*3ff40c12SJohn Marino /** 3073*3ff40c12SJohn Marino * EVENT_EAPOL_TX_STATUS - notify of EAPOL TX status 3074*3ff40c12SJohn Marino */ 3075*3ff40c12SJohn Marino EVENT_EAPOL_TX_STATUS, 3076*3ff40c12SJohn Marino 3077*3ff40c12SJohn Marino /** 3078*3ff40c12SJohn Marino * EVENT_CH_SWITCH - AP or GO decided to switch channels 3079*3ff40c12SJohn Marino * 3080*3ff40c12SJohn Marino * Described in wpa_event_data.ch_switch 3081*3ff40c12SJohn Marino * */ 3082*3ff40c12SJohn Marino EVENT_CH_SWITCH, 3083*3ff40c12SJohn Marino 3084*3ff40c12SJohn Marino /** 3085*3ff40c12SJohn Marino * EVENT_WNM - Request WNM operation 3086*3ff40c12SJohn Marino * 3087*3ff40c12SJohn Marino * This event can be used to request a WNM operation to be performed. 3088*3ff40c12SJohn Marino */ 3089*3ff40c12SJohn Marino EVENT_WNM, 3090*3ff40c12SJohn Marino 3091*3ff40c12SJohn Marino /** 3092*3ff40c12SJohn Marino * EVENT_CONNECT_FAILED_REASON - Connection failure reason in AP mode 3093*3ff40c12SJohn Marino * 3094*3ff40c12SJohn Marino * This event indicates that the driver reported a connection failure 3095*3ff40c12SJohn Marino * with the specified client (for example, max client reached, etc.) in 3096*3ff40c12SJohn Marino * AP mode. 3097*3ff40c12SJohn Marino */ 3098*3ff40c12SJohn Marino EVENT_CONNECT_FAILED_REASON, 3099*3ff40c12SJohn Marino 3100*3ff40c12SJohn Marino /** 3101*3ff40c12SJohn Marino * EVENT_RADAR_DETECTED - Notify of radar detection 3102*3ff40c12SJohn Marino * 3103*3ff40c12SJohn Marino * A radar has been detected on the supplied frequency, hostapd should 3104*3ff40c12SJohn Marino * react accordingly (e.g., change channel). 3105*3ff40c12SJohn Marino */ 3106*3ff40c12SJohn Marino EVENT_DFS_RADAR_DETECTED, 3107*3ff40c12SJohn Marino 3108*3ff40c12SJohn Marino /** 3109*3ff40c12SJohn Marino * EVENT_CAC_FINISHED - Notify that channel availability check has been completed 3110*3ff40c12SJohn Marino * 3111*3ff40c12SJohn Marino * After a successful CAC, the channel can be marked clear and used. 3112*3ff40c12SJohn Marino */ 3113*3ff40c12SJohn Marino EVENT_DFS_CAC_FINISHED, 3114*3ff40c12SJohn Marino 3115*3ff40c12SJohn Marino /** 3116*3ff40c12SJohn Marino * EVENT_CAC_ABORTED - Notify that channel availability check has been aborted 3117*3ff40c12SJohn Marino * 3118*3ff40c12SJohn Marino * The CAC was not successful, and the channel remains in the previous 3119*3ff40c12SJohn Marino * state. This may happen due to a radar beeing detected or other 3120*3ff40c12SJohn Marino * external influences. 3121*3ff40c12SJohn Marino */ 3122*3ff40c12SJohn Marino EVENT_DFS_CAC_ABORTED, 3123*3ff40c12SJohn Marino 3124*3ff40c12SJohn Marino /** 3125*3ff40c12SJohn Marino * EVENT_DFS_CAC_NOP_FINISHED - Notify that non-occupancy period is over 3126*3ff40c12SJohn Marino * 3127*3ff40c12SJohn Marino * The channel which was previously unavailable is now available again. 3128*3ff40c12SJohn Marino */ 3129*3ff40c12SJohn Marino EVENT_DFS_NOP_FINISHED, 3130*3ff40c12SJohn Marino 3131*3ff40c12SJohn Marino /** 3132*3ff40c12SJohn Marino * EVENT_SURVEY - Received survey data 3133*3ff40c12SJohn Marino * 3134*3ff40c12SJohn Marino * This event gets triggered when a driver query is issued for survey 3135*3ff40c12SJohn Marino * data and the requested data becomes available. The returned data is 3136*3ff40c12SJohn Marino * stored in struct survey_results. The results provide at most one 3137*3ff40c12SJohn Marino * survey entry for each frequency and at minimum will provide one 3138*3ff40c12SJohn Marino * survey entry for one frequency. The survey data can be os_malloc()'d 3139*3ff40c12SJohn Marino * and then os_free()'d, so the event callback must only copy data. 3140*3ff40c12SJohn Marino */ 3141*3ff40c12SJohn Marino EVENT_SURVEY, 3142*3ff40c12SJohn Marino 3143*3ff40c12SJohn Marino /** 3144*3ff40c12SJohn Marino * EVENT_SCAN_STARTED - Scan started 3145*3ff40c12SJohn Marino * 3146*3ff40c12SJohn Marino * This indicates that driver has started a scan operation either based 3147*3ff40c12SJohn Marino * on a request from wpa_supplicant/hostapd or from another application. 3148*3ff40c12SJohn Marino * EVENT_SCAN_RESULTS is used to indicate when the scan has been 3149*3ff40c12SJohn Marino * completed (either successfully or by getting cancelled). 3150*3ff40c12SJohn Marino */ 3151*3ff40c12SJohn Marino EVENT_SCAN_STARTED, 3152*3ff40c12SJohn Marino 3153*3ff40c12SJohn Marino /** 3154*3ff40c12SJohn Marino * EVENT_AVOID_FREQUENCIES - Received avoid frequency range 3155*3ff40c12SJohn Marino * 3156*3ff40c12SJohn Marino * This event indicates a set of frequency ranges that should be avoided 3157*3ff40c12SJohn Marino * to reduce issues due to interference or internal co-existence 3158*3ff40c12SJohn Marino * information in the driver. 3159*3ff40c12SJohn Marino */ 3160*3ff40c12SJohn Marino EVENT_AVOID_FREQUENCIES 3161*3ff40c12SJohn Marino }; 3162*3ff40c12SJohn Marino 3163*3ff40c12SJohn Marino 3164*3ff40c12SJohn Marino /** 3165*3ff40c12SJohn Marino * struct freq_survey - Channel survey info 3166*3ff40c12SJohn Marino * 3167*3ff40c12SJohn Marino * @ifidx: Interface index in which this survey was observed 3168*3ff40c12SJohn Marino * @freq: Center of frequency of the surveyed channel 3169*3ff40c12SJohn Marino * @nf: Channel noise floor in dBm 3170*3ff40c12SJohn Marino * @channel_time: Amount of time in ms the radio spent on the channel 3171*3ff40c12SJohn Marino * @channel_time_busy: Amount of time in ms the radio detected some signal 3172*3ff40c12SJohn Marino * that indicated to the radio the channel was not clear 3173*3ff40c12SJohn Marino * @channel_time_rx: Amount of time the radio spent receiving data 3174*3ff40c12SJohn Marino * @channel_time_tx: Amount of time the radio spent transmitting data 3175*3ff40c12SJohn Marino * @filled: bitmask indicating which fields have been reported, see 3176*3ff40c12SJohn Marino * SURVEY_HAS_* defines. 3177*3ff40c12SJohn Marino * @list: Internal list pointers 3178*3ff40c12SJohn Marino */ 3179*3ff40c12SJohn Marino struct freq_survey { 3180*3ff40c12SJohn Marino u32 ifidx; 3181*3ff40c12SJohn Marino unsigned int freq; 3182*3ff40c12SJohn Marino s8 nf; 3183*3ff40c12SJohn Marino u64 channel_time; 3184*3ff40c12SJohn Marino u64 channel_time_busy; 3185*3ff40c12SJohn Marino u64 channel_time_rx; 3186*3ff40c12SJohn Marino u64 channel_time_tx; 3187*3ff40c12SJohn Marino unsigned int filled; 3188*3ff40c12SJohn Marino struct dl_list list; 3189*3ff40c12SJohn Marino }; 3190*3ff40c12SJohn Marino 3191*3ff40c12SJohn Marino #define SURVEY_HAS_NF BIT(0) 3192*3ff40c12SJohn Marino #define SURVEY_HAS_CHAN_TIME BIT(1) 3193*3ff40c12SJohn Marino #define SURVEY_HAS_CHAN_TIME_BUSY BIT(2) 3194*3ff40c12SJohn Marino #define SURVEY_HAS_CHAN_TIME_RX BIT(3) 3195*3ff40c12SJohn Marino #define SURVEY_HAS_CHAN_TIME_TX BIT(4) 31966d49e1aeSJan Lentfer 31976d49e1aeSJan Lentfer 31986d49e1aeSJan Lentfer /** 31996d49e1aeSJan Lentfer * union wpa_event_data - Additional data for wpa_supplicant_event() calls 32006d49e1aeSJan Lentfer */ 32016d49e1aeSJan Lentfer union wpa_event_data { 32026d49e1aeSJan Lentfer /** 32036d49e1aeSJan Lentfer * struct assoc_info - Data for EVENT_ASSOC and EVENT_ASSOCINFO events 32046d49e1aeSJan Lentfer * 32056d49e1aeSJan Lentfer * This structure is optional for EVENT_ASSOC calls and required for 32066d49e1aeSJan Lentfer * EVENT_ASSOCINFO calls. By using EVENT_ASSOC with this data, the 32076d49e1aeSJan Lentfer * driver interface does not need to generate separate EVENT_ASSOCINFO 32086d49e1aeSJan Lentfer * calls. 32096d49e1aeSJan Lentfer */ 32106d49e1aeSJan Lentfer struct assoc_info { 32116d49e1aeSJan Lentfer /** 3212*3ff40c12SJohn Marino * reassoc - Flag to indicate association or reassociation 3213*3ff40c12SJohn Marino */ 3214*3ff40c12SJohn Marino int reassoc; 3215*3ff40c12SJohn Marino 3216*3ff40c12SJohn Marino /** 32176d49e1aeSJan Lentfer * req_ies - (Re)Association Request IEs 32186d49e1aeSJan Lentfer * 32196d49e1aeSJan Lentfer * If the driver generates WPA/RSN IE, this event data must be 32206d49e1aeSJan Lentfer * returned for WPA handshake to have needed information. If 32216d49e1aeSJan Lentfer * wpa_supplicant-generated WPA/RSN IE is used, this 32226d49e1aeSJan Lentfer * information event is optional. 32236d49e1aeSJan Lentfer * 32246d49e1aeSJan Lentfer * This should start with the first IE (fixed fields before IEs 32256d49e1aeSJan Lentfer * are not included). 32266d49e1aeSJan Lentfer */ 3227*3ff40c12SJohn Marino const u8 *req_ies; 32286d49e1aeSJan Lentfer 32296d49e1aeSJan Lentfer /** 32306d49e1aeSJan Lentfer * req_ies_len - Length of req_ies in bytes 32316d49e1aeSJan Lentfer */ 32326d49e1aeSJan Lentfer size_t req_ies_len; 32336d49e1aeSJan Lentfer 32346d49e1aeSJan Lentfer /** 32356d49e1aeSJan Lentfer * resp_ies - (Re)Association Response IEs 32366d49e1aeSJan Lentfer * 32376d49e1aeSJan Lentfer * Optional association data from the driver. This data is not 32386d49e1aeSJan Lentfer * required WPA, but may be useful for some protocols and as 32396d49e1aeSJan Lentfer * such, should be reported if this is available to the driver 32406d49e1aeSJan Lentfer * interface. 32416d49e1aeSJan Lentfer * 32426d49e1aeSJan Lentfer * This should start with the first IE (fixed fields before IEs 32436d49e1aeSJan Lentfer * are not included). 32446d49e1aeSJan Lentfer */ 3245*3ff40c12SJohn Marino const u8 *resp_ies; 32466d49e1aeSJan Lentfer 32476d49e1aeSJan Lentfer /** 32486d49e1aeSJan Lentfer * resp_ies_len - Length of resp_ies in bytes 32496d49e1aeSJan Lentfer */ 32506d49e1aeSJan Lentfer size_t resp_ies_len; 32516d49e1aeSJan Lentfer 32526d49e1aeSJan Lentfer /** 32536d49e1aeSJan Lentfer * beacon_ies - Beacon or Probe Response IEs 32546d49e1aeSJan Lentfer * 32556d49e1aeSJan Lentfer * Optional Beacon/ProbeResp data: IEs included in Beacon or 32566d49e1aeSJan Lentfer * Probe Response frames from the current AP (i.e., the one 32576d49e1aeSJan Lentfer * that the client just associated with). This information is 32586d49e1aeSJan Lentfer * used to update WPA/RSN IE for the AP. If this field is not 32596d49e1aeSJan Lentfer * set, the results from previous scan will be used. If no 32606d49e1aeSJan Lentfer * data for the new AP is found, scan results will be requested 32616d49e1aeSJan Lentfer * again (without scan request). At this point, the driver is 32626d49e1aeSJan Lentfer * expected to provide WPA/RSN IE for the AP (if WPA/WPA2 is 32636d49e1aeSJan Lentfer * used). 32646d49e1aeSJan Lentfer * 32656d49e1aeSJan Lentfer * This should start with the first IE (fixed fields before IEs 32666d49e1aeSJan Lentfer * are not included). 32676d49e1aeSJan Lentfer */ 3268*3ff40c12SJohn Marino const u8 *beacon_ies; 32696d49e1aeSJan Lentfer 32706d49e1aeSJan Lentfer /** 32716d49e1aeSJan Lentfer * beacon_ies_len - Length of beacon_ies */ 32726d49e1aeSJan Lentfer size_t beacon_ies_len; 3273*3ff40c12SJohn Marino 3274*3ff40c12SJohn Marino /** 3275*3ff40c12SJohn Marino * freq - Frequency of the operational channel in MHz 3276*3ff40c12SJohn Marino */ 3277*3ff40c12SJohn Marino unsigned int freq; 3278*3ff40c12SJohn Marino 3279*3ff40c12SJohn Marino /** 3280*3ff40c12SJohn Marino * addr - Station address (for AP mode) 3281*3ff40c12SJohn Marino */ 3282*3ff40c12SJohn Marino const u8 *addr; 32836d49e1aeSJan Lentfer } assoc_info; 32846d49e1aeSJan Lentfer 32856d49e1aeSJan Lentfer /** 3286*3ff40c12SJohn Marino * struct disassoc_info - Data for EVENT_DISASSOC events 3287*3ff40c12SJohn Marino */ 3288*3ff40c12SJohn Marino struct disassoc_info { 3289*3ff40c12SJohn Marino /** 3290*3ff40c12SJohn Marino * addr - Station address (for AP mode) 3291*3ff40c12SJohn Marino */ 3292*3ff40c12SJohn Marino const u8 *addr; 3293*3ff40c12SJohn Marino 3294*3ff40c12SJohn Marino /** 3295*3ff40c12SJohn Marino * reason_code - Reason Code (host byte order) used in 3296*3ff40c12SJohn Marino * Deauthentication frame 3297*3ff40c12SJohn Marino */ 3298*3ff40c12SJohn Marino u16 reason_code; 3299*3ff40c12SJohn Marino 3300*3ff40c12SJohn Marino /** 3301*3ff40c12SJohn Marino * ie - Optional IE(s) in Disassociation frame 3302*3ff40c12SJohn Marino */ 3303*3ff40c12SJohn Marino const u8 *ie; 3304*3ff40c12SJohn Marino 3305*3ff40c12SJohn Marino /** 3306*3ff40c12SJohn Marino * ie_len - Length of ie buffer in octets 3307*3ff40c12SJohn Marino */ 3308*3ff40c12SJohn Marino size_t ie_len; 3309*3ff40c12SJohn Marino 3310*3ff40c12SJohn Marino /** 3311*3ff40c12SJohn Marino * locally_generated - Whether the frame was locally generated 3312*3ff40c12SJohn Marino */ 3313*3ff40c12SJohn Marino int locally_generated; 3314*3ff40c12SJohn Marino } disassoc_info; 3315*3ff40c12SJohn Marino 3316*3ff40c12SJohn Marino /** 3317*3ff40c12SJohn Marino * struct deauth_info - Data for EVENT_DEAUTH events 3318*3ff40c12SJohn Marino */ 3319*3ff40c12SJohn Marino struct deauth_info { 3320*3ff40c12SJohn Marino /** 3321*3ff40c12SJohn Marino * addr - Station address (for AP mode) 3322*3ff40c12SJohn Marino */ 3323*3ff40c12SJohn Marino const u8 *addr; 3324*3ff40c12SJohn Marino 3325*3ff40c12SJohn Marino /** 3326*3ff40c12SJohn Marino * reason_code - Reason Code (host byte order) used in 3327*3ff40c12SJohn Marino * Deauthentication frame 3328*3ff40c12SJohn Marino */ 3329*3ff40c12SJohn Marino u16 reason_code; 3330*3ff40c12SJohn Marino 3331*3ff40c12SJohn Marino /** 3332*3ff40c12SJohn Marino * ie - Optional IE(s) in Deauthentication frame 3333*3ff40c12SJohn Marino */ 3334*3ff40c12SJohn Marino const u8 *ie; 3335*3ff40c12SJohn Marino 3336*3ff40c12SJohn Marino /** 3337*3ff40c12SJohn Marino * ie_len - Length of ie buffer in octets 3338*3ff40c12SJohn Marino */ 3339*3ff40c12SJohn Marino size_t ie_len; 3340*3ff40c12SJohn Marino 3341*3ff40c12SJohn Marino /** 3342*3ff40c12SJohn Marino * locally_generated - Whether the frame was locally generated 3343*3ff40c12SJohn Marino */ 3344*3ff40c12SJohn Marino int locally_generated; 3345*3ff40c12SJohn Marino } deauth_info; 3346*3ff40c12SJohn Marino 3347*3ff40c12SJohn Marino /** 33486d49e1aeSJan Lentfer * struct michael_mic_failure - Data for EVENT_MICHAEL_MIC_FAILURE 33496d49e1aeSJan Lentfer */ 33506d49e1aeSJan Lentfer struct michael_mic_failure { 33516d49e1aeSJan Lentfer int unicast; 3352*3ff40c12SJohn Marino const u8 *src; 33536d49e1aeSJan Lentfer } michael_mic_failure; 33546d49e1aeSJan Lentfer 33556d49e1aeSJan Lentfer /** 33566d49e1aeSJan Lentfer * struct interface_status - Data for EVENT_INTERFACE_STATUS 33576d49e1aeSJan Lentfer */ 33586d49e1aeSJan Lentfer struct interface_status { 33596d49e1aeSJan Lentfer char ifname[100]; 33606d49e1aeSJan Lentfer enum { 33616d49e1aeSJan Lentfer EVENT_INTERFACE_ADDED, EVENT_INTERFACE_REMOVED 33626d49e1aeSJan Lentfer } ievent; 33636d49e1aeSJan Lentfer } interface_status; 33646d49e1aeSJan Lentfer 33656d49e1aeSJan Lentfer /** 33666d49e1aeSJan Lentfer * struct pmkid_candidate - Data for EVENT_PMKID_CANDIDATE 33676d49e1aeSJan Lentfer */ 33686d49e1aeSJan Lentfer struct pmkid_candidate { 33696d49e1aeSJan Lentfer /** BSSID of the PMKID candidate */ 33706d49e1aeSJan Lentfer u8 bssid[ETH_ALEN]; 33716d49e1aeSJan Lentfer /** Smaller the index, higher the priority */ 33726d49e1aeSJan Lentfer int index; 33736d49e1aeSJan Lentfer /** Whether RSN IE includes pre-authenticate flag */ 33746d49e1aeSJan Lentfer int preauth; 33756d49e1aeSJan Lentfer } pmkid_candidate; 33766d49e1aeSJan Lentfer 33776d49e1aeSJan Lentfer /** 33786d49e1aeSJan Lentfer * struct stkstart - Data for EVENT_STKSTART 33796d49e1aeSJan Lentfer */ 33806d49e1aeSJan Lentfer struct stkstart { 33816d49e1aeSJan Lentfer u8 peer[ETH_ALEN]; 33826d49e1aeSJan Lentfer } stkstart; 33836d49e1aeSJan Lentfer 33846d49e1aeSJan Lentfer /** 3385*3ff40c12SJohn Marino * struct tdls - Data for EVENT_TDLS 3386*3ff40c12SJohn Marino */ 3387*3ff40c12SJohn Marino struct tdls { 3388*3ff40c12SJohn Marino u8 peer[ETH_ALEN]; 3389*3ff40c12SJohn Marino enum { 3390*3ff40c12SJohn Marino TDLS_REQUEST_SETUP, 3391*3ff40c12SJohn Marino TDLS_REQUEST_TEARDOWN 3392*3ff40c12SJohn Marino } oper; 3393*3ff40c12SJohn Marino u16 reason_code; /* for teardown */ 3394*3ff40c12SJohn Marino } tdls; 3395*3ff40c12SJohn Marino 3396*3ff40c12SJohn Marino /** 3397*3ff40c12SJohn Marino * struct wnm - Data for EVENT_WNM 3398*3ff40c12SJohn Marino */ 3399*3ff40c12SJohn Marino struct wnm { 3400*3ff40c12SJohn Marino u8 addr[ETH_ALEN]; 3401*3ff40c12SJohn Marino enum { 3402*3ff40c12SJohn Marino WNM_OPER_SLEEP, 3403*3ff40c12SJohn Marino } oper; 3404*3ff40c12SJohn Marino enum { 3405*3ff40c12SJohn Marino WNM_SLEEP_ENTER, 3406*3ff40c12SJohn Marino WNM_SLEEP_EXIT 3407*3ff40c12SJohn Marino } sleep_action; 3408*3ff40c12SJohn Marino int sleep_intval; 3409*3ff40c12SJohn Marino u16 reason_code; 3410*3ff40c12SJohn Marino u8 *buf; 3411*3ff40c12SJohn Marino u16 buf_len; 3412*3ff40c12SJohn Marino } wnm; 3413*3ff40c12SJohn Marino 3414*3ff40c12SJohn Marino /** 34156d49e1aeSJan Lentfer * struct ft_ies - FT information elements (EVENT_FT_RESPONSE) 34166d49e1aeSJan Lentfer * 34176d49e1aeSJan Lentfer * During FT (IEEE 802.11r) authentication sequence, the driver is 34186d49e1aeSJan Lentfer * expected to use this event to report received FT IEs (MDIE, FTIE, 34196d49e1aeSJan Lentfer * RSN IE, TIE, possible resource request) to the supplicant. The FT 34206d49e1aeSJan Lentfer * IEs for the next message will be delivered through the 34216d49e1aeSJan Lentfer * struct wpa_driver_ops::update_ft_ies() callback. 34226d49e1aeSJan Lentfer */ 34236d49e1aeSJan Lentfer struct ft_ies { 34246d49e1aeSJan Lentfer const u8 *ies; 34256d49e1aeSJan Lentfer size_t ies_len; 34266d49e1aeSJan Lentfer int ft_action; 34276d49e1aeSJan Lentfer u8 target_ap[ETH_ALEN]; 3428*3ff40c12SJohn Marino /** Optional IE(s), e.g., WMM TSPEC(s), for RIC-Request */ 3429*3ff40c12SJohn Marino const u8 *ric_ies; 3430*3ff40c12SJohn Marino /** Length of ric_ies buffer in octets */ 3431*3ff40c12SJohn Marino size_t ric_ies_len; 34326d49e1aeSJan Lentfer } ft_ies; 3433*3ff40c12SJohn Marino 3434*3ff40c12SJohn Marino /** 3435*3ff40c12SJohn Marino * struct ibss_rsn_start - Data for EVENT_IBSS_RSN_START 3436*3ff40c12SJohn Marino */ 3437*3ff40c12SJohn Marino struct ibss_rsn_start { 3438*3ff40c12SJohn Marino u8 peer[ETH_ALEN]; 3439*3ff40c12SJohn Marino } ibss_rsn_start; 3440*3ff40c12SJohn Marino 3441*3ff40c12SJohn Marino /** 3442*3ff40c12SJohn Marino * struct auth_info - Data for EVENT_AUTH events 3443*3ff40c12SJohn Marino */ 3444*3ff40c12SJohn Marino struct auth_info { 3445*3ff40c12SJohn Marino u8 peer[ETH_ALEN]; 3446*3ff40c12SJohn Marino u8 bssid[ETH_ALEN]; 3447*3ff40c12SJohn Marino u16 auth_type; 3448*3ff40c12SJohn Marino u16 auth_transaction; 3449*3ff40c12SJohn Marino u16 status_code; 3450*3ff40c12SJohn Marino const u8 *ies; 3451*3ff40c12SJohn Marino size_t ies_len; 3452*3ff40c12SJohn Marino } auth; 3453*3ff40c12SJohn Marino 3454*3ff40c12SJohn Marino /** 3455*3ff40c12SJohn Marino * struct assoc_reject - Data for EVENT_ASSOC_REJECT events 3456*3ff40c12SJohn Marino */ 3457*3ff40c12SJohn Marino struct assoc_reject { 3458*3ff40c12SJohn Marino /** 3459*3ff40c12SJohn Marino * bssid - BSSID of the AP that rejected association 3460*3ff40c12SJohn Marino */ 3461*3ff40c12SJohn Marino const u8 *bssid; 3462*3ff40c12SJohn Marino 3463*3ff40c12SJohn Marino /** 3464*3ff40c12SJohn Marino * resp_ies - (Re)Association Response IEs 3465*3ff40c12SJohn Marino * 3466*3ff40c12SJohn Marino * Optional association data from the driver. This data is not 3467*3ff40c12SJohn Marino * required WPA, but may be useful for some protocols and as 3468*3ff40c12SJohn Marino * such, should be reported if this is available to the driver 3469*3ff40c12SJohn Marino * interface. 3470*3ff40c12SJohn Marino * 3471*3ff40c12SJohn Marino * This should start with the first IE (fixed fields before IEs 3472*3ff40c12SJohn Marino * are not included). 3473*3ff40c12SJohn Marino */ 3474*3ff40c12SJohn Marino const u8 *resp_ies; 3475*3ff40c12SJohn Marino 3476*3ff40c12SJohn Marino /** 3477*3ff40c12SJohn Marino * resp_ies_len - Length of resp_ies in bytes 3478*3ff40c12SJohn Marino */ 3479*3ff40c12SJohn Marino size_t resp_ies_len; 3480*3ff40c12SJohn Marino 3481*3ff40c12SJohn Marino /** 3482*3ff40c12SJohn Marino * status_code - Status Code from (Re)association Response 3483*3ff40c12SJohn Marino */ 3484*3ff40c12SJohn Marino u16 status_code; 3485*3ff40c12SJohn Marino } assoc_reject; 3486*3ff40c12SJohn Marino 3487*3ff40c12SJohn Marino struct timeout_event { 3488*3ff40c12SJohn Marino u8 addr[ETH_ALEN]; 3489*3ff40c12SJohn Marino } timeout_event; 3490*3ff40c12SJohn Marino 3491*3ff40c12SJohn Marino /** 3492*3ff40c12SJohn Marino * struct ft_rrb_rx - Data for EVENT_FT_RRB_RX events 3493*3ff40c12SJohn Marino */ 3494*3ff40c12SJohn Marino struct ft_rrb_rx { 3495*3ff40c12SJohn Marino const u8 *src; 3496*3ff40c12SJohn Marino const u8 *data; 3497*3ff40c12SJohn Marino size_t data_len; 3498*3ff40c12SJohn Marino } ft_rrb_rx; 3499*3ff40c12SJohn Marino 3500*3ff40c12SJohn Marino /** 3501*3ff40c12SJohn Marino * struct tx_status - Data for EVENT_TX_STATUS events 3502*3ff40c12SJohn Marino */ 3503*3ff40c12SJohn Marino struct tx_status { 3504*3ff40c12SJohn Marino u16 type; 3505*3ff40c12SJohn Marino u16 stype; 3506*3ff40c12SJohn Marino const u8 *dst; 3507*3ff40c12SJohn Marino const u8 *data; 3508*3ff40c12SJohn Marino size_t data_len; 3509*3ff40c12SJohn Marino int ack; 3510*3ff40c12SJohn Marino } tx_status; 3511*3ff40c12SJohn Marino 3512*3ff40c12SJohn Marino /** 3513*3ff40c12SJohn Marino * struct rx_from_unknown - Data for EVENT_RX_FROM_UNKNOWN events 3514*3ff40c12SJohn Marino */ 3515*3ff40c12SJohn Marino struct rx_from_unknown { 3516*3ff40c12SJohn Marino const u8 *bssid; 3517*3ff40c12SJohn Marino const u8 *addr; 3518*3ff40c12SJohn Marino int wds; 3519*3ff40c12SJohn Marino } rx_from_unknown; 3520*3ff40c12SJohn Marino 3521*3ff40c12SJohn Marino /** 3522*3ff40c12SJohn Marino * struct rx_mgmt - Data for EVENT_RX_MGMT events 3523*3ff40c12SJohn Marino */ 3524*3ff40c12SJohn Marino struct rx_mgmt { 3525*3ff40c12SJohn Marino const u8 *frame; 3526*3ff40c12SJohn Marino size_t frame_len; 3527*3ff40c12SJohn Marino u32 datarate; 3528*3ff40c12SJohn Marino 3529*3ff40c12SJohn Marino /** 3530*3ff40c12SJohn Marino * freq - Frequency (in MHz) on which the frame was received 3531*3ff40c12SJohn Marino */ 3532*3ff40c12SJohn Marino int freq; 3533*3ff40c12SJohn Marino 3534*3ff40c12SJohn Marino /** 3535*3ff40c12SJohn Marino * ssi_signal - Signal strength in dBm (or 0 if not available) 3536*3ff40c12SJohn Marino */ 3537*3ff40c12SJohn Marino int ssi_signal; 3538*3ff40c12SJohn Marino } rx_mgmt; 3539*3ff40c12SJohn Marino 3540*3ff40c12SJohn Marino /** 3541*3ff40c12SJohn Marino * struct remain_on_channel - Data for EVENT_REMAIN_ON_CHANNEL events 3542*3ff40c12SJohn Marino * 3543*3ff40c12SJohn Marino * This is also used with EVENT_CANCEL_REMAIN_ON_CHANNEL events. 3544*3ff40c12SJohn Marino */ 3545*3ff40c12SJohn Marino struct remain_on_channel { 3546*3ff40c12SJohn Marino /** 3547*3ff40c12SJohn Marino * freq - Channel frequency in MHz 3548*3ff40c12SJohn Marino */ 3549*3ff40c12SJohn Marino unsigned int freq; 3550*3ff40c12SJohn Marino 3551*3ff40c12SJohn Marino /** 3552*3ff40c12SJohn Marino * duration - Duration to remain on the channel in milliseconds 3553*3ff40c12SJohn Marino */ 3554*3ff40c12SJohn Marino unsigned int duration; 3555*3ff40c12SJohn Marino } remain_on_channel; 3556*3ff40c12SJohn Marino 3557*3ff40c12SJohn Marino /** 3558*3ff40c12SJohn Marino * struct scan_info - Optional data for EVENT_SCAN_RESULTS events 3559*3ff40c12SJohn Marino * @aborted: Whether the scan was aborted 3560*3ff40c12SJohn Marino * @freqs: Scanned frequencies in MHz (%NULL = all channels scanned) 3561*3ff40c12SJohn Marino * @num_freqs: Number of entries in freqs array 3562*3ff40c12SJohn Marino * @ssids: Scanned SSIDs (%NULL or zero-length SSID indicates wildcard 3563*3ff40c12SJohn Marino * SSID) 3564*3ff40c12SJohn Marino * @num_ssids: Number of entries in ssids array 3565*3ff40c12SJohn Marino */ 3566*3ff40c12SJohn Marino struct scan_info { 3567*3ff40c12SJohn Marino int aborted; 3568*3ff40c12SJohn Marino const int *freqs; 3569*3ff40c12SJohn Marino size_t num_freqs; 3570*3ff40c12SJohn Marino struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS]; 3571*3ff40c12SJohn Marino size_t num_ssids; 3572*3ff40c12SJohn Marino } scan_info; 3573*3ff40c12SJohn Marino 3574*3ff40c12SJohn Marino /** 3575*3ff40c12SJohn Marino * struct mlme_rx - Data for EVENT_MLME_RX events 3576*3ff40c12SJohn Marino */ 3577*3ff40c12SJohn Marino struct mlme_rx { 3578*3ff40c12SJohn Marino const u8 *buf; 3579*3ff40c12SJohn Marino size_t len; 3580*3ff40c12SJohn Marino int freq; 3581*3ff40c12SJohn Marino int channel; 3582*3ff40c12SJohn Marino int ssi; 3583*3ff40c12SJohn Marino } mlme_rx; 3584*3ff40c12SJohn Marino 3585*3ff40c12SJohn Marino /** 3586*3ff40c12SJohn Marino * struct rx_probe_req - Data for EVENT_RX_PROBE_REQ events 3587*3ff40c12SJohn Marino */ 3588*3ff40c12SJohn Marino struct rx_probe_req { 3589*3ff40c12SJohn Marino /** 3590*3ff40c12SJohn Marino * sa - Source address of the received Probe Request frame 3591*3ff40c12SJohn Marino */ 3592*3ff40c12SJohn Marino const u8 *sa; 3593*3ff40c12SJohn Marino 3594*3ff40c12SJohn Marino /** 3595*3ff40c12SJohn Marino * da - Destination address of the received Probe Request frame 3596*3ff40c12SJohn Marino * or %NULL if not available 3597*3ff40c12SJohn Marino */ 3598*3ff40c12SJohn Marino const u8 *da; 3599*3ff40c12SJohn Marino 3600*3ff40c12SJohn Marino /** 3601*3ff40c12SJohn Marino * bssid - BSSID of the received Probe Request frame or %NULL 3602*3ff40c12SJohn Marino * if not available 3603*3ff40c12SJohn Marino */ 3604*3ff40c12SJohn Marino const u8 *bssid; 3605*3ff40c12SJohn Marino 3606*3ff40c12SJohn Marino /** 3607*3ff40c12SJohn Marino * ie - IEs from the Probe Request body 3608*3ff40c12SJohn Marino */ 3609*3ff40c12SJohn Marino const u8 *ie; 3610*3ff40c12SJohn Marino 3611*3ff40c12SJohn Marino /** 3612*3ff40c12SJohn Marino * ie_len - Length of ie buffer in octets 3613*3ff40c12SJohn Marino */ 3614*3ff40c12SJohn Marino size_t ie_len; 3615*3ff40c12SJohn Marino 3616*3ff40c12SJohn Marino /** 3617*3ff40c12SJohn Marino * signal - signal strength in dBm (or 0 if not available) 3618*3ff40c12SJohn Marino */ 3619*3ff40c12SJohn Marino int ssi_signal; 3620*3ff40c12SJohn Marino } rx_probe_req; 3621*3ff40c12SJohn Marino 3622*3ff40c12SJohn Marino /** 3623*3ff40c12SJohn Marino * struct new_sta - Data for EVENT_NEW_STA events 3624*3ff40c12SJohn Marino */ 3625*3ff40c12SJohn Marino struct new_sta { 3626*3ff40c12SJohn Marino const u8 *addr; 3627*3ff40c12SJohn Marino } new_sta; 3628*3ff40c12SJohn Marino 3629*3ff40c12SJohn Marino /** 3630*3ff40c12SJohn Marino * struct eapol_rx - Data for EVENT_EAPOL_RX events 3631*3ff40c12SJohn Marino */ 3632*3ff40c12SJohn Marino struct eapol_rx { 3633*3ff40c12SJohn Marino const u8 *src; 3634*3ff40c12SJohn Marino const u8 *data; 3635*3ff40c12SJohn Marino size_t data_len; 3636*3ff40c12SJohn Marino } eapol_rx; 3637*3ff40c12SJohn Marino 3638*3ff40c12SJohn Marino /** 3639*3ff40c12SJohn Marino * signal_change - Data for EVENT_SIGNAL_CHANGE events 3640*3ff40c12SJohn Marino */ 3641*3ff40c12SJohn Marino struct wpa_signal_info signal_change; 3642*3ff40c12SJohn Marino 3643*3ff40c12SJohn Marino /** 3644*3ff40c12SJohn Marino * struct best_channel - Data for EVENT_BEST_CHANNEL events 3645*3ff40c12SJohn Marino * @freq_24: Best 2.4 GHz band channel frequency in MHz 3646*3ff40c12SJohn Marino * @freq_5: Best 5 GHz band channel frequency in MHz 3647*3ff40c12SJohn Marino * @freq_overall: Best channel frequency in MHz 3648*3ff40c12SJohn Marino * 3649*3ff40c12SJohn Marino * 0 can be used to indicate no preference in either band. 3650*3ff40c12SJohn Marino */ 3651*3ff40c12SJohn Marino struct best_channel { 3652*3ff40c12SJohn Marino int freq_24; 3653*3ff40c12SJohn Marino int freq_5; 3654*3ff40c12SJohn Marino int freq_overall; 3655*3ff40c12SJohn Marino } best_chan; 3656*3ff40c12SJohn Marino 3657*3ff40c12SJohn Marino struct unprot_deauth { 3658*3ff40c12SJohn Marino const u8 *sa; 3659*3ff40c12SJohn Marino const u8 *da; 3660*3ff40c12SJohn Marino u16 reason_code; 3661*3ff40c12SJohn Marino } unprot_deauth; 3662*3ff40c12SJohn Marino 3663*3ff40c12SJohn Marino struct unprot_disassoc { 3664*3ff40c12SJohn Marino const u8 *sa; 3665*3ff40c12SJohn Marino const u8 *da; 3666*3ff40c12SJohn Marino u16 reason_code; 3667*3ff40c12SJohn Marino } unprot_disassoc; 3668*3ff40c12SJohn Marino 3669*3ff40c12SJohn Marino /** 3670*3ff40c12SJohn Marino * struct low_ack - Data for EVENT_STATION_LOW_ACK events 3671*3ff40c12SJohn Marino * @addr: station address 3672*3ff40c12SJohn Marino */ 3673*3ff40c12SJohn Marino struct low_ack { 3674*3ff40c12SJohn Marino u8 addr[ETH_ALEN]; 3675*3ff40c12SJohn Marino } low_ack; 3676*3ff40c12SJohn Marino 3677*3ff40c12SJohn Marino /** 3678*3ff40c12SJohn Marino * struct ibss_peer_lost - Data for EVENT_IBSS_PEER_LOST 3679*3ff40c12SJohn Marino */ 3680*3ff40c12SJohn Marino struct ibss_peer_lost { 3681*3ff40c12SJohn Marino u8 peer[ETH_ALEN]; 3682*3ff40c12SJohn Marino } ibss_peer_lost; 3683*3ff40c12SJohn Marino 3684*3ff40c12SJohn Marino /** 3685*3ff40c12SJohn Marino * struct driver_gtk_rekey - Data for EVENT_DRIVER_GTK_REKEY 3686*3ff40c12SJohn Marino */ 3687*3ff40c12SJohn Marino struct driver_gtk_rekey { 3688*3ff40c12SJohn Marino const u8 *bssid; 3689*3ff40c12SJohn Marino const u8 *replay_ctr; 3690*3ff40c12SJohn Marino } driver_gtk_rekey; 3691*3ff40c12SJohn Marino 3692*3ff40c12SJohn Marino /** 3693*3ff40c12SJohn Marino * struct client_poll - Data for EVENT_DRIVER_CLIENT_POLL_OK events 3694*3ff40c12SJohn Marino * @addr: station address 3695*3ff40c12SJohn Marino */ 3696*3ff40c12SJohn Marino struct client_poll { 3697*3ff40c12SJohn Marino u8 addr[ETH_ALEN]; 3698*3ff40c12SJohn Marino } client_poll; 3699*3ff40c12SJohn Marino 3700*3ff40c12SJohn Marino /** 3701*3ff40c12SJohn Marino * struct eapol_tx_status 3702*3ff40c12SJohn Marino * @dst: Original destination 3703*3ff40c12SJohn Marino * @data: Data starting with IEEE 802.1X header (!) 3704*3ff40c12SJohn Marino * @data_len: Length of data 3705*3ff40c12SJohn Marino * @ack: Indicates ack or lost frame 3706*3ff40c12SJohn Marino * 3707*3ff40c12SJohn Marino * This corresponds to hapd_send_eapol if the frame sent 3708*3ff40c12SJohn Marino * there isn't just reported as EVENT_TX_STATUS. 3709*3ff40c12SJohn Marino */ 3710*3ff40c12SJohn Marino struct eapol_tx_status { 3711*3ff40c12SJohn Marino const u8 *dst; 3712*3ff40c12SJohn Marino const u8 *data; 3713*3ff40c12SJohn Marino int data_len; 3714*3ff40c12SJohn Marino int ack; 3715*3ff40c12SJohn Marino } eapol_tx_status; 3716*3ff40c12SJohn Marino 3717*3ff40c12SJohn Marino /** 3718*3ff40c12SJohn Marino * struct ch_switch 3719*3ff40c12SJohn Marino * @freq: Frequency of new channel in MHz 3720*3ff40c12SJohn Marino * @ht_enabled: Whether this is an HT channel 3721*3ff40c12SJohn Marino * @ch_offset: Secondary channel offset 3722*3ff40c12SJohn Marino * @ch_width: Channel width 3723*3ff40c12SJohn Marino * @cf1: Center frequency 1 3724*3ff40c12SJohn Marino * @cf2: Center frequency 2 3725*3ff40c12SJohn Marino */ 3726*3ff40c12SJohn Marino struct ch_switch { 3727*3ff40c12SJohn Marino int freq; 3728*3ff40c12SJohn Marino int ht_enabled; 3729*3ff40c12SJohn Marino int ch_offset; 3730*3ff40c12SJohn Marino enum chan_width ch_width; 3731*3ff40c12SJohn Marino int cf1; 3732*3ff40c12SJohn Marino int cf2; 3733*3ff40c12SJohn Marino } ch_switch; 3734*3ff40c12SJohn Marino 3735*3ff40c12SJohn Marino /** 3736*3ff40c12SJohn Marino * struct connect_failed - Data for EVENT_CONNECT_FAILED_REASON 3737*3ff40c12SJohn Marino * @addr: Remote client address 3738*3ff40c12SJohn Marino * @code: Reason code for connection failure 3739*3ff40c12SJohn Marino */ 3740*3ff40c12SJohn Marino struct connect_failed_reason { 3741*3ff40c12SJohn Marino u8 addr[ETH_ALEN]; 3742*3ff40c12SJohn Marino enum { 3743*3ff40c12SJohn Marino MAX_CLIENT_REACHED, 3744*3ff40c12SJohn Marino BLOCKED_CLIENT 3745*3ff40c12SJohn Marino } code; 3746*3ff40c12SJohn Marino } connect_failed_reason; 3747*3ff40c12SJohn Marino 3748*3ff40c12SJohn Marino /** 3749*3ff40c12SJohn Marino * struct dfs_event - Data for radar detected events 3750*3ff40c12SJohn Marino * @freq: Frequency of the channel in MHz 3751*3ff40c12SJohn Marino */ 3752*3ff40c12SJohn Marino struct dfs_event { 3753*3ff40c12SJohn Marino int freq; 3754*3ff40c12SJohn Marino int ht_enabled; 3755*3ff40c12SJohn Marino int chan_offset; 3756*3ff40c12SJohn Marino enum chan_width chan_width; 3757*3ff40c12SJohn Marino int cf1; 3758*3ff40c12SJohn Marino int cf2; 3759*3ff40c12SJohn Marino } dfs_event; 3760*3ff40c12SJohn Marino 3761*3ff40c12SJohn Marino /** 3762*3ff40c12SJohn Marino * survey_results - Survey result data for EVENT_SURVEY 3763*3ff40c12SJohn Marino * @freq_filter: Requested frequency survey filter, 0 if request 3764*3ff40c12SJohn Marino * was for all survey data 3765*3ff40c12SJohn Marino * @survey_list: Linked list of survey data 3766*3ff40c12SJohn Marino */ 3767*3ff40c12SJohn Marino struct survey_results { 3768*3ff40c12SJohn Marino unsigned int freq_filter; 3769*3ff40c12SJohn Marino struct dl_list survey_list; /* struct freq_survey */ 3770*3ff40c12SJohn Marino } survey_results; 3771*3ff40c12SJohn Marino 3772*3ff40c12SJohn Marino /** 3773*3ff40c12SJohn Marino * channel_list_changed - Data for EVENT_CHANNEL_LIST_CHANGED 3774*3ff40c12SJohn Marino * @initiator: Initiator of the regulatory change 3775*3ff40c12SJohn Marino */ 3776*3ff40c12SJohn Marino struct channel_list_changed { 3777*3ff40c12SJohn Marino enum reg_change_initiator initiator; 3778*3ff40c12SJohn Marino } channel_list_changed; 3779*3ff40c12SJohn Marino 3780*3ff40c12SJohn Marino /** 3781*3ff40c12SJohn Marino * freq_range - List of frequency ranges 3782*3ff40c12SJohn Marino * 3783*3ff40c12SJohn Marino * This is used as the data with EVENT_AVOID_FREQUENCIES. 3784*3ff40c12SJohn Marino */ 3785*3ff40c12SJohn Marino struct wpa_freq_range_list freq_range; 37866d49e1aeSJan Lentfer }; 37876d49e1aeSJan Lentfer 37886d49e1aeSJan Lentfer /** 37896d49e1aeSJan Lentfer * wpa_supplicant_event - Report a driver event for wpa_supplicant 37906d49e1aeSJan Lentfer * @ctx: Context pointer (wpa_s); this is the ctx variable registered 37916d49e1aeSJan Lentfer * with struct wpa_driver_ops::init() 37926d49e1aeSJan Lentfer * @event: event type (defined above) 37936d49e1aeSJan Lentfer * @data: possible extra data for the event 37946d49e1aeSJan Lentfer * 37956d49e1aeSJan Lentfer * Driver wrapper code should call this function whenever an event is received 37966d49e1aeSJan Lentfer * from the driver. 37976d49e1aeSJan Lentfer */ 3798*3ff40c12SJohn Marino void wpa_supplicant_event(void *ctx, enum wpa_event_type event, 37996d49e1aeSJan Lentfer union wpa_event_data *data); 38006d49e1aeSJan Lentfer 3801*3ff40c12SJohn Marino 3802*3ff40c12SJohn Marino /* 3803*3ff40c12SJohn Marino * The following inline functions are provided for convenience to simplify 3804*3ff40c12SJohn Marino * event indication for some of the common events. 38056d49e1aeSJan Lentfer */ 38066d49e1aeSJan Lentfer 3807*3ff40c12SJohn Marino static inline void drv_event_assoc(void *ctx, const u8 *addr, const u8 *ie, 3808*3ff40c12SJohn Marino size_t ielen, int reassoc) 3809*3ff40c12SJohn Marino { 3810*3ff40c12SJohn Marino union wpa_event_data event; 3811*3ff40c12SJohn Marino os_memset(&event, 0, sizeof(event)); 3812*3ff40c12SJohn Marino event.assoc_info.reassoc = reassoc; 3813*3ff40c12SJohn Marino event.assoc_info.req_ies = ie; 3814*3ff40c12SJohn Marino event.assoc_info.req_ies_len = ielen; 3815*3ff40c12SJohn Marino event.assoc_info.addr = addr; 3816*3ff40c12SJohn Marino wpa_supplicant_event(ctx, EVENT_ASSOC, &event); 3817*3ff40c12SJohn Marino } 38186d49e1aeSJan Lentfer 3819*3ff40c12SJohn Marino static inline void drv_event_disassoc(void *ctx, const u8 *addr) 3820*3ff40c12SJohn Marino { 3821*3ff40c12SJohn Marino union wpa_event_data event; 3822*3ff40c12SJohn Marino os_memset(&event, 0, sizeof(event)); 3823*3ff40c12SJohn Marino event.disassoc_info.addr = addr; 3824*3ff40c12SJohn Marino wpa_supplicant_event(ctx, EVENT_DISASSOC, &event); 3825*3ff40c12SJohn Marino } 3826*3ff40c12SJohn Marino 3827*3ff40c12SJohn Marino static inline void drv_event_eapol_rx(void *ctx, const u8 *src, const u8 *data, 3828*3ff40c12SJohn Marino size_t data_len) 3829*3ff40c12SJohn Marino { 3830*3ff40c12SJohn Marino union wpa_event_data event; 3831*3ff40c12SJohn Marino os_memset(&event, 0, sizeof(event)); 3832*3ff40c12SJohn Marino event.eapol_rx.src = src; 3833*3ff40c12SJohn Marino event.eapol_rx.data = data; 3834*3ff40c12SJohn Marino event.eapol_rx.data_len = data_len; 3835*3ff40c12SJohn Marino wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event); 3836*3ff40c12SJohn Marino } 3837*3ff40c12SJohn Marino 3838*3ff40c12SJohn Marino /* driver_common.c */ 38396d49e1aeSJan Lentfer void wpa_scan_results_free(struct wpa_scan_results *res); 3840*3ff40c12SJohn Marino 3841*3ff40c12SJohn Marino /* Convert wpa_event_type to a string for logging */ 3842*3ff40c12SJohn Marino const char * event_to_string(enum wpa_event_type event); 3843*3ff40c12SJohn Marino 3844*3ff40c12SJohn Marino /* NULL terminated array of linked in driver wrappers */ 3845*3ff40c12SJohn Marino extern struct wpa_driver_ops *wpa_drivers[]; 38466d49e1aeSJan Lentfer 38476d49e1aeSJan Lentfer #endif /* DRIVER_H */ 3848