2008-02-27 20:34:43 -05:00
|
|
|
/*
|
|
|
|
* WPA Supplicant - driver interface definition
|
2010-01-02 06:57:44 -05:00
|
|
|
* Copyright (c) 2003-2010, Jouni Malinen <j@w1.fi>
|
2008-02-27 20:34:43 -05:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* Alternatively, this software may be distributed under the terms of BSD
|
|
|
|
* license.
|
|
|
|
*
|
|
|
|
* See README and COPYING for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DRIVER_H
|
|
|
|
#define DRIVER_H
|
|
|
|
|
2009-11-23 09:58:32 -05:00
|
|
|
#define WPA_SUPPLICANT_DRIVER_VERSION 4
|
2008-02-27 20:34:43 -05:00
|
|
|
|
2009-11-29 10:51:55 -05:00
|
|
|
#include "common/defs.h"
|
2008-02-27 20:34:43 -05:00
|
|
|
|
2009-04-09 06:40:12 -04:00
|
|
|
#define HOSTAPD_CHAN_DISABLED 0x00000001
|
|
|
|
#define HOSTAPD_CHAN_PASSIVE_SCAN 0x00000002
|
|
|
|
#define HOSTAPD_CHAN_NO_IBSS 0x00000004
|
|
|
|
#define HOSTAPD_CHAN_RADAR 0x00000008
|
|
|
|
|
|
|
|
struct hostapd_channel_data {
|
|
|
|
short chan; /* channel number (IEEE 802.11) */
|
|
|
|
short freq; /* frequency in MHz */
|
|
|
|
int flag; /* flag for hostapd use (HOSTAPD_CHAN_*) */
|
|
|
|
u8 max_tx_power; /* maximum transmit power in dBm */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct hostapd_hw_modes {
|
2009-12-26 03:35:08 -05:00
|
|
|
enum hostapd_hw_mode mode;
|
2009-04-09 06:40:12 -04:00
|
|
|
int num_channels;
|
|
|
|
struct hostapd_channel_data *channels;
|
|
|
|
int num_rates;
|
2009-12-09 14:57:50 -05:00
|
|
|
int *rates; /* array of rates in 100 kbps units */
|
2009-04-09 06:40:12 -04:00
|
|
|
u16 ht_capab;
|
2009-11-05 05:38:47 -05:00
|
|
|
u8 mcs_set[16];
|
2009-11-29 05:21:26 -05:00
|
|
|
u8 a_mpdu_params;
|
2009-04-09 06:40:12 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-02-27 20:34:43 -05:00
|
|
|
#define AUTH_ALG_OPEN_SYSTEM 0x01
|
|
|
|
#define AUTH_ALG_SHARED_KEY 0x02
|
|
|
|
#define AUTH_ALG_LEAP 0x04
|
2009-03-20 16:26:41 -04:00
|
|
|
#define AUTH_ALG_FT 0x08
|
2008-02-27 20:34:43 -05:00
|
|
|
|
|
|
|
#define IEEE80211_MODE_INFRA 0
|
|
|
|
#define IEEE80211_MODE_IBSS 1
|
2009-04-16 09:22:40 -04:00
|
|
|
#define IEEE80211_MODE_AP 2
|
2008-02-27 20:34:43 -05:00
|
|
|
|
|
|
|
#define IEEE80211_CAP_ESS 0x0001
|
|
|
|
#define IEEE80211_CAP_IBSS 0x0002
|
|
|
|
#define IEEE80211_CAP_PRIVACY 0x0010
|
|
|
|
|
2009-02-18 06:40:38 -05:00
|
|
|
#define WPA_SCAN_QUAL_INVALID BIT(0)
|
|
|
|
#define WPA_SCAN_NOISE_INVALID BIT(1)
|
|
|
|
#define WPA_SCAN_LEVEL_INVALID BIT(2)
|
|
|
|
#define WPA_SCAN_LEVEL_DBM BIT(3)
|
2009-12-02 09:45:31 -05:00
|
|
|
#define WPA_SCAN_AUTHENTICATED BIT(4)
|
|
|
|
#define WPA_SCAN_ASSOCIATED BIT(5)
|
2009-02-18 06:40:38 -05:00
|
|
|
|
2008-02-27 20:34:43 -05:00
|
|
|
/**
|
|
|
|
* struct wpa_scan_res - Scan result for an BSS/IBSS
|
2009-02-18 06:40:38 -05:00
|
|
|
* @flags: information flags about the BSS/IBSS (WPA_SCAN_*)
|
2008-02-27 20:34:43 -05:00
|
|
|
* @bssid: BSSID
|
|
|
|
* @freq: frequency of the channel in MHz (e.g., 2412 = channel 1)
|
|
|
|
* @beacon_int: beacon interval in TUs (host byte order)
|
|
|
|
* @caps: capability information field in host byte order
|
|
|
|
* @qual: signal quality
|
|
|
|
* @noise: noise level
|
|
|
|
* @level: signal level
|
|
|
|
* @tsf: Timestamp
|
2009-10-01 10:53:22 -04:00
|
|
|
* @age: Age of the information in milliseconds (i.e., how many milliseconds
|
|
|
|
* ago the last Beacon or Probe Response frame was received)
|
2008-02-27 20:34:43 -05:00
|
|
|
* @ie_len: length of the following IE field in octets
|
|
|
|
*
|
|
|
|
* This structure is used as a generic format for scan results from the
|
|
|
|
* driver. Each driver interface implementation is responsible for converting
|
|
|
|
* the driver or OS specific scan results into this format.
|
|
|
|
*
|
|
|
|
* If the driver does not support reporting all IEs, the IE data structure is
|
|
|
|
* constructed of the IEs that are available. This field will also need to
|
|
|
|
* include SSID in IE format. All drivers are encouraged to be extended to
|
|
|
|
* report all IEs to make it easier to support future additions.
|
|
|
|
*/
|
|
|
|
struct wpa_scan_res {
|
2009-02-18 06:40:38 -05:00
|
|
|
unsigned int flags;
|
2008-02-27 20:34:43 -05:00
|
|
|
u8 bssid[ETH_ALEN];
|
|
|
|
int freq;
|
|
|
|
u16 beacon_int;
|
|
|
|
u16 caps;
|
|
|
|
int qual;
|
|
|
|
int noise;
|
|
|
|
int level;
|
|
|
|
u64 tsf;
|
2009-10-01 10:53:22 -04:00
|
|
|
unsigned int age;
|
2008-02-27 20:34:43 -05:00
|
|
|
size_t ie_len;
|
|
|
|
/* followed by ie_len octets of IEs */
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct wpa_scan_results - Scan results
|
|
|
|
* @res: Array of pointers to allocated variable length scan result entries
|
|
|
|
* @num: Number of entries in the scan result array
|
|
|
|
*/
|
|
|
|
struct wpa_scan_results {
|
|
|
|
struct wpa_scan_res **res;
|
|
|
|
size_t num;
|
|
|
|
};
|
|
|
|
|
2008-12-24 13:25:19 -05:00
|
|
|
/**
|
|
|
|
* struct wpa_interface_info - Network interface information
|
|
|
|
* @next: Pointer to the next interface or NULL if this is the last one
|
|
|
|
* @ifname: Interface name that can be used with init() or init2()
|
|
|
|
* @desc: Human readable adapter description (e.g., vendor/model) or NULL if
|
|
|
|
* not available
|
2009-12-27 10:13:15 -05:00
|
|
|
* @drv_name: struct wpa_driver_ops::name (note: unlike other strings, this one
|
2008-12-24 13:25:19 -05:00
|
|
|
* is not an allocated copy, i.e., get_interfaces() caller will not free
|
|
|
|
* this)
|
|
|
|
*/
|
|
|
|
struct wpa_interface_info {
|
|
|
|
struct wpa_interface_info *next;
|
|
|
|
char *ifname;
|
|
|
|
char *desc;
|
|
|
|
const char *drv_name;
|
|
|
|
};
|
|
|
|
|
2009-02-14 10:01:32 -05:00
|
|
|
#define WPAS_MAX_SCAN_SSIDS 4
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct wpa_driver_scan_params - Scan parameters
|
|
|
|
* Data for struct wpa_driver_ops::scan2().
|
|
|
|
*/
|
|
|
|
struct wpa_driver_scan_params {
|
|
|
|
/**
|
|
|
|
* ssids - SSIDs to scan for
|
|
|
|
*/
|
|
|
|
struct wpa_driver_scan_ssid {
|
|
|
|
/**
|
|
|
|
* ssid - specific SSID to scan for (ProbeReq)
|
|
|
|
* %NULL or zero-length SSID is used to indicate active scan
|
2009-02-14 15:21:17 -05:00
|
|
|
* with wildcard SSID.
|
2009-02-14 10:01:32 -05:00
|
|
|
*/
|
|
|
|
const u8 *ssid;
|
|
|
|
/**
|
|
|
|
* ssid_len: Length of the SSID in octets
|
|
|
|
*/
|
|
|
|
size_t ssid_len;
|
|
|
|
} ssids[WPAS_MAX_SCAN_SSIDS];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* num_ssids - Number of entries in ssids array
|
|
|
|
* Zero indicates a request for a passive scan.
|
|
|
|
*/
|
|
|
|
size_t num_ssids;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* extra_ies - Extra IE(s) to add into Probe Request or %NULL
|
|
|
|
*/
|
|
|
|
const u8 *extra_ies;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* extra_ies_len - Length of extra_ies in octets
|
|
|
|
*/
|
|
|
|
size_t extra_ies_len;
|
2009-03-26 15:55:01 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* freqs - Array of frequencies to scan or %NULL for all frequencies
|
|
|
|
*
|
|
|
|
* The frequency is set in MHz. The array is zero-terminated.
|
|
|
|
*/
|
|
|
|
int *freqs;
|
2009-02-14 10:01:32 -05:00
|
|
|
};
|
|
|
|
|
2009-03-20 16:26:41 -04:00
|
|
|
/**
|
|
|
|
* struct wpa_driver_auth_params - Authentication parameters
|
|
|
|
* Data for struct wpa_driver_ops::authenticate().
|
|
|
|
*/
|
|
|
|
struct wpa_driver_auth_params {
|
|
|
|
int freq;
|
|
|
|
const u8 *bssid;
|
|
|
|
const u8 *ssid;
|
|
|
|
size_t ssid_len;
|
|
|
|
int auth_alg;
|
|
|
|
const u8 *ie;
|
|
|
|
size_t ie_len;
|
2009-04-04 09:58:16 -04:00
|
|
|
const u8 *wep_key[4];
|
|
|
|
size_t wep_key_len[4];
|
|
|
|
int wep_tx_keyidx;
|
2009-03-20 16:26:41 -04:00
|
|
|
};
|
|
|
|
|
2008-02-27 20:34:43 -05:00
|
|
|
/**
|
|
|
|
* struct wpa_driver_associate_params - Association parameters
|
|
|
|
* Data for struct wpa_driver_ops::associate().
|
|
|
|
*/
|
|
|
|
struct wpa_driver_associate_params {
|
|
|
|
/**
|
|
|
|
* bssid - BSSID of the selected AP
|
|
|
|
* This can be %NULL, if ap_scan=2 mode is used and the driver is
|
|
|
|
* responsible for selecting with which BSS to associate. */
|
|
|
|
const u8 *bssid;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ssid - The selected SSID
|
|
|
|
*/
|
|
|
|
const u8 *ssid;
|
|
|
|
size_t ssid_len;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* freq - Frequency of the channel the selected AP is using
|
|
|
|
* Frequency that the selected AP is using (in MHz as
|
|
|
|
* reported in the scan results)
|
|
|
|
*/
|
|
|
|
int freq;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* wpa_ie - WPA information element for (Re)Association Request
|
|
|
|
* WPA information element to be included in (Re)Association
|
|
|
|
* Request (including information element id and length). Use
|
|
|
|
* of this WPA IE is optional. If the driver generates the WPA
|
|
|
|
* IE, it can use pairwise_suite, group_suite, and
|
|
|
|
* key_mgmt_suite to select proper algorithms. In this case,
|
|
|
|
* the driver has to notify wpa_supplicant about the used WPA
|
|
|
|
* IE by generating an event that the interface code will
|
|
|
|
* convert into EVENT_ASSOCINFO data (see below).
|
|
|
|
*
|
|
|
|
* When using WPA2/IEEE 802.11i, wpa_ie is used for RSN IE
|
|
|
|
* instead. The driver can determine which version is used by
|
|
|
|
* looking at the first byte of the IE (0xdd for WPA, 0x30 for
|
|
|
|
* WPA2/RSN).
|
2008-11-23 12:34:26 -05:00
|
|
|
*
|
|
|
|
* When using WPS, wpa_ie is used for WPS IE instead of WPA/RSN IE.
|
2008-02-27 20:34:43 -05:00
|
|
|
*/
|
|
|
|
const u8 *wpa_ie;
|
|
|
|
/**
|
|
|
|
* wpa_ie_len - length of the wpa_ie
|
|
|
|
*/
|
|
|
|
size_t wpa_ie_len;
|
|
|
|
|
|
|
|
/* The selected pairwise/group cipher and key management
|
|
|
|
* suites. These are usually ignored if @wpa_ie is used. */
|
2009-12-26 03:35:08 -05:00
|
|
|
enum wpa_cipher pairwise_suite;
|
|
|
|
enum wpa_cipher group_suite;
|
|
|
|
enum wpa_key_mgmt key_mgmt_suite;
|
2008-02-27 20:34:43 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* auth_alg - Allowed authentication algorithms
|
|
|
|
* Bit field of AUTH_ALG_*
|
|
|
|
*/
|
|
|
|
int auth_alg;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* mode - Operation mode (infra/ibss) IEEE80211_MODE_*
|
|
|
|
*/
|
|
|
|
int mode;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* wep_key - WEP keys for static WEP configuration
|
|
|
|
*/
|
|
|
|
const u8 *wep_key[4];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* wep_key_len - WEP key length for static WEP configuration
|
|
|
|
*/
|
|
|
|
size_t wep_key_len[4];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* wep_tx_keyidx - WEP TX key index for static WEP configuration
|
|
|
|
*/
|
|
|
|
int wep_tx_keyidx;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* mgmt_frame_protection - IEEE 802.11w management frame protection
|
|
|
|
*/
|
|
|
|
enum {
|
|
|
|
NO_MGMT_FRAME_PROTECTION,
|
|
|
|
MGMT_FRAME_PROTECTION_OPTIONAL,
|
|
|
|
MGMT_FRAME_PROTECTION_REQUIRED
|
|
|
|
} mgmt_frame_protection;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ft_ies - IEEE 802.11r / FT information elements
|
|
|
|
* If the supplicant is using IEEE 802.11r (FT) and has the needed keys
|
|
|
|
* for fast transition, this parameter is set to include the IEs that
|
|
|
|
* are to be sent in the next FT Authentication Request message.
|
|
|
|
* update_ft_ies() handler is called to update the IEs for further
|
|
|
|
* FT messages in the sequence.
|
|
|
|
*
|
|
|
|
* The driver should use these IEs only if the target AP is advertising
|
|
|
|
* the same mobility domain as the one included in the MDIE here.
|
|
|
|
*
|
|
|
|
* In ap_scan=2 mode, the driver can use these IEs when moving to a new
|
|
|
|
* AP after the initial association. These IEs can only be used if the
|
|
|
|
* target AP is advertising support for FT and is using the same MDIE
|
|
|
|
* and SSID as the current AP.
|
|
|
|
*
|
|
|
|
* The driver is responsible for reporting the FT IEs received from the
|
|
|
|
* AP's response using wpa_supplicant_event() with EVENT_FT_RESPONSE
|
|
|
|
* type. update_ft_ies() handler will then be called with the FT IEs to
|
|
|
|
* include in the next frame in the authentication sequence.
|
|
|
|
*/
|
|
|
|
const u8 *ft_ies;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ft_ies_len - Length of ft_ies in bytes
|
|
|
|
*/
|
|
|
|
size_t ft_ies_len;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ft_md - FT Mobility domain (6 octets) (also included inside ft_ies)
|
|
|
|
*
|
|
|
|
* This value is provided to allow the driver interface easier access
|
|
|
|
* to the current mobility domain. This value is set to %NULL if no
|
|
|
|
* mobility domain is currently active.
|
|
|
|
*/
|
|
|
|
const u8 *ft_md;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* passphrase - RSN passphrase for PSK
|
|
|
|
*
|
|
|
|
* This value is made available only for WPA/WPA2-Personal (PSK) and
|
|
|
|
* only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE. This is
|
|
|
|
* the 8..63 character ASCII passphrase, if available. Please note that
|
|
|
|
* this can be %NULL if passphrase was not used to generate the PSK. In
|
|
|
|
* that case, the psk field must be used to fetch the PSK.
|
|
|
|
*/
|
|
|
|
const char *passphrase;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* psk - RSN PSK (alternative for passphrase for PSK)
|
|
|
|
*
|
|
|
|
* This value is made available only for WPA/WPA2-Personal (PSK) and
|
|
|
|
* only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE. This is
|
|
|
|
* the 32-octet (256-bit) PSK, if available. The driver wrapper should
|
|
|
|
* be prepared to handle %NULL value as an error.
|
|
|
|
*/
|
|
|
|
const u8 *psk;
|
2009-03-24 14:06:02 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* drop_unencrypted - Enable/disable unencrypted frame filtering
|
|
|
|
*
|
|
|
|
* Configure the driver to drop all non-EAPOL frames (both receive and
|
|
|
|
* transmit paths). Unencrypted EAPOL frames (ethertype 0x888e) must
|
|
|
|
* still be allowed for key negotiation.
|
|
|
|
*/
|
|
|
|
int drop_unencrypted;
|
2009-11-17 12:25:05 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* prev_bssid - Previously used BSSID in this ESS
|
|
|
|
*
|
|
|
|
* When not %NULL, this is a request to use reassociation instead of
|
|
|
|
* association.
|
|
|
|
*/
|
|
|
|
const u8 *prev_bssid;
|
2008-02-27 20:34:43 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct wpa_driver_capa - Driver capability information
|
|
|
|
*/
|
|
|
|
struct wpa_driver_capa {
|
|
|
|
#define WPA_DRIVER_CAPA_KEY_MGMT_WPA 0x00000001
|
|
|
|
#define WPA_DRIVER_CAPA_KEY_MGMT_WPA2 0x00000002
|
|
|
|
#define WPA_DRIVER_CAPA_KEY_MGMT_WPA_PSK 0x00000004
|
|
|
|
#define WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK 0x00000008
|
|
|
|
#define WPA_DRIVER_CAPA_KEY_MGMT_WPA_NONE 0x00000010
|
|
|
|
#define WPA_DRIVER_CAPA_KEY_MGMT_FT 0x00000020
|
|
|
|
#define WPA_DRIVER_CAPA_KEY_MGMT_FT_PSK 0x00000040
|
|
|
|
unsigned int key_mgmt;
|
|
|
|
|
|
|
|
#define WPA_DRIVER_CAPA_ENC_WEP40 0x00000001
|
|
|
|
#define WPA_DRIVER_CAPA_ENC_WEP104 0x00000002
|
|
|
|
#define WPA_DRIVER_CAPA_ENC_TKIP 0x00000004
|
|
|
|
#define WPA_DRIVER_CAPA_ENC_CCMP 0x00000008
|
|
|
|
unsigned int enc;
|
|
|
|
|
|
|
|
#define WPA_DRIVER_AUTH_OPEN 0x00000001
|
|
|
|
#define WPA_DRIVER_AUTH_SHARED 0x00000002
|
|
|
|
#define WPA_DRIVER_AUTH_LEAP 0x00000004
|
|
|
|
unsigned int auth;
|
|
|
|
|
|
|
|
/* Driver generated WPA/RSN IE */
|
|
|
|
#define WPA_DRIVER_FLAGS_DRIVER_IE 0x00000001
|
2009-09-15 03:48:30 -04:00
|
|
|
/* Driver needs static WEP key setup after association command */
|
2008-02-27 20:34:43 -05:00
|
|
|
#define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC 0x00000002
|
|
|
|
#define WPA_DRIVER_FLAGS_USER_SPACE_MLME 0x00000004
|
|
|
|
/* Driver takes care of RSN 4-way handshake internally; PMK is configured with
|
|
|
|
* struct wpa_driver_ops::set_key using alg = WPA_ALG_PMK */
|
|
|
|
#define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE 0x00000008
|
2009-03-07 15:05:43 -05:00
|
|
|
#define WPA_DRIVER_FLAGS_WIRED 0x00000010
|
2009-03-20 16:26:41 -04:00
|
|
|
/* Driver provides separate commands for authentication and association (SME in
|
|
|
|
* wpa_supplicant). */
|
|
|
|
#define WPA_DRIVER_FLAGS_SME 0x00000020
|
2009-03-25 05:38:47 -04:00
|
|
|
/* Driver supports AP mode */
|
|
|
|
#define WPA_DRIVER_FLAGS_AP 0x00000040
|
2009-09-15 03:48:30 -04:00
|
|
|
/* Driver needs static WEP key setup after association has been completed */
|
|
|
|
#define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE 0x00000080
|
2008-02-27 20:34:43 -05:00
|
|
|
unsigned int flags;
|
2009-02-12 14:49:57 -05:00
|
|
|
|
|
|
|
int max_scan_ssids;
|
2008-02-27 20:34:43 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-04-09 06:40:12 -04:00
|
|
|
struct hostapd_data;
|
|
|
|
|
|
|
|
struct hostap_sta_driver_data {
|
|
|
|
unsigned long rx_packets, tx_packets, rx_bytes, tx_bytes;
|
|
|
|
unsigned long current_tx_rate;
|
|
|
|
unsigned long inactive_msec;
|
|
|
|
unsigned long flags;
|
|
|
|
unsigned long num_ps_buf_frames;
|
|
|
|
unsigned long tx_retry_failed;
|
|
|
|
unsigned long tx_retry_count;
|
|
|
|
int last_rssi;
|
|
|
|
int last_ack_rssi;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct hostapd_sta_add_params {
|
|
|
|
const u8 *addr;
|
|
|
|
u16 aid;
|
|
|
|
u16 capability;
|
|
|
|
const u8 *supp_rates;
|
|
|
|
size_t supp_rates_len;
|
|
|
|
u16 listen_interval;
|
2009-11-29 06:04:21 -05:00
|
|
|
const struct ieee80211_ht_capabilities *ht_capabilities;
|
2009-04-09 06:40:12 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct hostapd_freq_params {
|
|
|
|
int mode;
|
|
|
|
int freq;
|
|
|
|
int channel;
|
|
|
|
int ht_enabled;
|
|
|
|
int sec_channel_offset; /* 0 = HT40 disabled, -1 = HT40 enabled,
|
|
|
|
* secondary channel below primary, 1 = HT40
|
|
|
|
* enabled, secondary channel above primary */
|
|
|
|
};
|
|
|
|
|
2009-12-09 09:49:28 -05:00
|
|
|
enum wpa_driver_if_type {
|
|
|
|
/**
|
|
|
|
* WPA_IF_STATION - Station mode interface
|
|
|
|
*/
|
|
|
|
WPA_IF_STATION,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* WPA_IF_AP_VLAN - AP mode VLAN interface
|
|
|
|
*
|
|
|
|
* This interface shares its address and Beacon frame with the main
|
|
|
|
* BSS.
|
|
|
|
*/
|
|
|
|
WPA_IF_AP_VLAN,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* WPA_IF_AP_BSS - AP mode BSS interface
|
|
|
|
*
|
|
|
|
* This interface has its own address and Beacon frame.
|
|
|
|
*/
|
|
|
|
WPA_IF_AP_BSS,
|
2009-04-09 06:40:12 -04:00
|
|
|
};
|
|
|
|
|
2009-04-09 16:28:21 -04:00
|
|
|
struct wpa_init_params {
|
|
|
|
const u8 *bssid;
|
|
|
|
const char *ifname;
|
|
|
|
const u8 *ssid;
|
|
|
|
size_t ssid_len;
|
|
|
|
const char *test_socket;
|
|
|
|
int use_pae_group_addr;
|
|
|
|
char **bridge;
|
|
|
|
size_t num_bridge;
|
2009-04-17 04:55:51 -04:00
|
|
|
|
|
|
|
u8 *own_addr; /* buffer for writing own MAC address */
|
2009-04-09 16:28:21 -04:00
|
|
|
};
|
|
|
|
|
2009-04-09 06:40:12 -04:00
|
|
|
|
2009-12-12 16:32:44 -05:00
|
|
|
struct wpa_bss_params {
|
|
|
|
/** Interface name (for multi-SSID/VLAN support) */
|
|
|
|
const char *ifname;
|
|
|
|
/** Whether IEEE 802.1X or WPA/WPA2 is enabled */
|
|
|
|
int enabled;
|
2009-12-12 16:50:29 -05:00
|
|
|
|
|
|
|
int wpa;
|
|
|
|
int ieee802_1x;
|
|
|
|
int wpa_group;
|
|
|
|
int wpa_pairwise;
|
|
|
|
int wpa_key_mgmt;
|
|
|
|
int rsn_preauth;
|
2009-12-12 16:32:44 -05:00
|
|
|
};
|
|
|
|
|
2009-12-13 04:35:39 -05:00
|
|
|
#define WPA_STA_AUTHORIZED BIT(0)
|
|
|
|
#define WPA_STA_WMM BIT(1)
|
|
|
|
#define WPA_STA_SHORT_PREAMBLE BIT(2)
|
|
|
|
#define WPA_STA_MFP BIT(3)
|
2009-12-12 16:32:44 -05:00
|
|
|
|
2008-02-27 20:34:43 -05:00
|
|
|
/**
|
|
|
|
* struct wpa_driver_ops - Driver interface API definition
|
|
|
|
*
|
|
|
|
* This structure defines the API that each driver interface needs to implement
|
|
|
|
* for core wpa_supplicant code. All driver specific functionality is captured
|
|
|
|
* in this wrapper.
|
|
|
|
*/
|
|
|
|
struct wpa_driver_ops {
|
|
|
|
/** Name of the driver interface */
|
|
|
|
const char *name;
|
|
|
|
/** One line description of the driver interface */
|
|
|
|
const char *desc;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* get_bssid - Get the current BSSID
|
|
|
|
* @priv: private driver interface data
|
|
|
|
* @bssid: buffer for BSSID (ETH_ALEN = 6 bytes)
|
|
|
|
*
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* Query kernel driver for the current BSSID and copy it to bssid.
|
|
|
|
* Setting bssid to 00:00:00:00:00:00 is recommended if the STA is not
|
|
|
|
* associated.
|
|
|
|
*/
|
|
|
|
int (*get_bssid)(void *priv, u8 *bssid);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* get_ssid - Get the current SSID
|
|
|
|
* @priv: private driver interface data
|
|
|
|
* @ssid: buffer for SSID (at least 32 bytes)
|
|
|
|
*
|
|
|
|
* Returns: Length of the SSID on success, -1 on failure
|
|
|
|
*
|
|
|
|
* Query kernel driver for the current SSID and copy it to ssid.
|
|
|
|
* Returning zero is recommended if the STA is not associated.
|
|
|
|
*
|
|
|
|
* Note: SSID is an array of octets, i.e., it is not nul terminated and
|
|
|
|
* can, at least in theory, contain control characters (including nul)
|
|
|
|
* and as such, should be processed as binary data, not a printable
|
|
|
|
* string.
|
|
|
|
*/
|
|
|
|
int (*get_ssid)(void *priv, u8 *ssid);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* set_key - Configure encryption key
|
2009-11-23 09:58:32 -05:00
|
|
|
* @ifname: Interface name (for multi-SSID/VLAN support)
|
2008-02-27 20:34:43 -05:00
|
|
|
* @priv: private driver interface data
|
|
|
|
* @alg: encryption algorithm (%WPA_ALG_NONE, %WPA_ALG_WEP,
|
|
|
|
* %WPA_ALG_TKIP, %WPA_ALG_CCMP, %WPA_ALG_IGTK, %WPA_ALG_PMK);
|
|
|
|
* %WPA_ALG_NONE clears the key.
|
|
|
|
* @addr: address of the peer STA or ff:ff:ff:ff:ff:ff for
|
|
|
|
* broadcast/default keys
|
|
|
|
* @key_idx: key index (0..3), usually 0 for unicast keys; 0..4095 for
|
|
|
|
* IGTK
|
|
|
|
* @set_tx: configure this key as the default Tx key (only used when
|
|
|
|
* driver does not support separate unicast/individual key
|
|
|
|
* @seq: sequence number/packet number, seq_len octets, the next
|
|
|
|
* packet number to be used for in replay protection; configured
|
|
|
|
* for Rx keys (in most cases, this is only used with broadcast
|
|
|
|
* keys and set to zero for unicast keys)
|
|
|
|
* @seq_len: length of the seq, depends on the algorithm:
|
|
|
|
* TKIP: 6 octets, CCMP: 6 octets, IGTK: 6 octets
|
|
|
|
* @key: key buffer; TKIP: 16-byte temporal key, 8-byte Tx Mic key,
|
|
|
|
* 8-byte Rx Mic Key
|
|
|
|
* @key_len: length of the key buffer in octets (WEP: 5 or 13,
|
|
|
|
* TKIP: 32, CCMP: 16, IGTK: 16)
|
|
|
|
*
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* Configure the given key for the kernel driver. If the driver
|
|
|
|
* supports separate individual keys (4 default keys + 1 individual),
|
|
|
|
* addr can be used to determine whether the key is default or
|
|
|
|
* individual. If only 4 keys are supported, the default key with key
|
|
|
|
* index 0 is used as the individual key. STA must be configured to use
|
|
|
|
* it as the default Tx key (set_tx is set) and accept Rx for all the
|
|
|
|
* key indexes. In most cases, WPA uses only key indexes 1 and 2 for
|
|
|
|
* broadcast keys, so key index 0 is available for this kind of
|
|
|
|
* configuration.
|
|
|
|
*
|
|
|
|
* Please note that TKIP keys include separate TX and RX MIC keys and
|
|
|
|
* some drivers may expect them in different order than wpa_supplicant
|
|
|
|
* is using. If the TX/RX keys are swapped, all TKIP encrypted packets
|
|
|
|
* will tricker Michael MIC errors. This can be fixed by changing the
|
|
|
|
* order of MIC keys by swapping te bytes 16..23 and 24..31 of the key
|
|
|
|
* in driver_*.c set_key() implementation, see driver_ndis.c for an
|
|
|
|
* example on how this can be done.
|
|
|
|
*/
|
2009-12-26 03:35:08 -05:00
|
|
|
int (*set_key)(const char *ifname, void *priv, enum wpa_alg alg,
|
2009-11-23 09:58:32 -05:00
|
|
|
const u8 *addr, int key_idx, int set_tx,
|
|
|
|
const u8 *seq, size_t seq_len,
|
2008-02-27 20:34:43 -05:00
|
|
|
const u8 *key, size_t key_len);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* init - Initialize driver interface
|
|
|
|
* @ctx: context to be used when calling wpa_supplicant functions,
|
|
|
|
* e.g., wpa_supplicant_event()
|
|
|
|
* @ifname: interface name, e.g., wlan0
|
|
|
|
*
|
|
|
|
* Returns: Pointer to private data, %NULL on failure
|
|
|
|
*
|
|
|
|
* Initialize driver interface, including event processing for kernel
|
|
|
|
* driver events (e.g., associated, scan results, Michael MIC failure).
|
|
|
|
* This function can allocate a private configuration data area for
|
|
|
|
* @ctx, file descriptor, interface name, etc. information that may be
|
|
|
|
* needed in future driver operations. If this is not used, non-NULL
|
|
|
|
* value will need to be returned because %NULL is used to indicate
|
|
|
|
* failure. The returned value will be used as 'void *priv' data for
|
|
|
|
* all other driver_ops functions.
|
|
|
|
*
|
|
|
|
* The main event loop (eloop.c) of wpa_supplicant can be used to
|
|
|
|
* register callback for read sockets (eloop_register_read_sock()).
|
|
|
|
*
|
|
|
|
* See below for more information about events and
|
|
|
|
* wpa_supplicant_event() function.
|
|
|
|
*/
|
|
|
|
void * (*init)(void *ctx, const char *ifname);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* deinit - Deinitialize driver interface
|
|
|
|
* @priv: private driver interface data from init()
|
|
|
|
*
|
|
|
|
* Shut down driver interface and processing of driver events. Free
|
|
|
|
* private data buffer if one was allocated in init() handler.
|
|
|
|
*/
|
|
|
|
void (*deinit)(void *priv);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* set_param - Set driver configuration parameters
|
|
|
|
* @priv: private driver interface data from init()
|
|
|
|
* @param: driver specific configuration parameters
|
|
|
|
*
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* Optional handler for notifying driver interface about configuration
|
|
|
|
* parameters (driver_param).
|
|
|
|
*/
|
|
|
|
int (*set_param)(void *priv, const char *param);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* set_countermeasures - Enable/disable TKIP countermeasures
|
|
|
|
* @priv: private driver interface data
|
|
|
|
* @enabled: 1 = countermeasures enabled, 0 = disabled
|
|
|
|
*
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* Configure TKIP countermeasures. When these are enabled, the driver
|
|
|
|
* should drop all received and queued frames that are using TKIP.
|
|
|
|
*/
|
|
|
|
int (*set_countermeasures)(void *priv, int enabled);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* deauthenticate - Request driver to deauthenticate
|
|
|
|
* @priv: private driver interface data
|
|
|
|
* @addr: peer address (BSSID of the AP)
|
|
|
|
* @reason_code: 16-bit reason code to be sent in the deauthentication
|
|
|
|
* frame
|
|
|
|
*
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*/
|
|
|
|
int (*deauthenticate)(void *priv, const u8 *addr, int reason_code);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* disassociate - Request driver to disassociate
|
|
|
|
* @priv: private driver interface data
|
|
|
|
* @addr: peer address (BSSID of the AP)
|
|
|
|
* @reason_code: 16-bit reason code to be sent in the disassociation
|
|
|
|
* frame
|
|
|
|
*
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*/
|
|
|
|
int (*disassociate)(void *priv, const u8 *addr, int reason_code);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* associate - Request driver to associate
|
|
|
|
* @priv: private driver interface data
|
|
|
|
* @params: association parameters
|
|
|
|
*
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*/
|
|
|
|
int (*associate)(void *priv,
|
|
|
|
struct wpa_driver_associate_params *params);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* add_pmkid - Add PMKSA cache entry to the driver
|
|
|
|
* @priv: private driver interface data
|
|
|
|
* @bssid: BSSID for the PMKSA cache entry
|
|
|
|
* @pmkid: PMKID for the PMKSA cache entry
|
|
|
|
*
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This function is called when a new PMK is received, as a result of
|
|
|
|
* either normal authentication or RSN pre-authentication.
|
|
|
|
*
|
|
|
|
* If the driver generates RSN IE, i.e., it does not use wpa_ie in
|
|
|
|
* associate(), add_pmkid() can be used to add new PMKSA cache entries
|
|
|
|
* in the driver. If the driver uses wpa_ie from wpa_supplicant, this
|
|
|
|
* driver_ops function does not need to be implemented. Likewise, if
|
|
|
|
* the driver does not support WPA, this function is not needed.
|
|
|
|
*/
|
|
|
|
int (*add_pmkid)(void *priv, const u8 *bssid, const u8 *pmkid);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* remove_pmkid - Remove PMKSA cache entry to the driver
|
|
|
|
* @priv: private driver interface data
|
|
|
|
* @bssid: BSSID for the PMKSA cache entry
|
|
|
|
* @pmkid: PMKID for the PMKSA cache entry
|
|
|
|
*
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This function is called when the supplicant drops a PMKSA cache
|
|
|
|
* entry for any reason.
|
|
|
|
*
|
|
|
|
* If the driver generates RSN IE, i.e., it does not use wpa_ie in
|
|
|
|
* associate(), remove_pmkid() can be used to synchronize PMKSA caches
|
|
|
|
* between the driver and wpa_supplicant. If the driver uses wpa_ie
|
|
|
|
* from wpa_supplicant, this driver_ops function does not need to be
|
|
|
|
* implemented. Likewise, if the driver does not support WPA, this
|
|
|
|
* function is not needed.
|
|
|
|
*/
|
|
|
|
int (*remove_pmkid)(void *priv, const u8 *bssid, const u8 *pmkid);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* flush_pmkid - Flush PMKSA cache
|
|
|
|
* @priv: private driver interface data
|
|
|
|
*
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This function is called when the supplicant drops all PMKSA cache
|
|
|
|
* entries for any reason.
|
|
|
|
*
|
|
|
|
* If the driver generates RSN IE, i.e., it does not use wpa_ie in
|
|
|
|
* associate(), remove_pmkid() can be used to synchronize PMKSA caches
|
|
|
|
* between the driver and wpa_supplicant. If the driver uses wpa_ie
|
|
|
|
* from wpa_supplicant, this driver_ops function does not need to be
|
|
|
|
* implemented. Likewise, if the driver does not support WPA, this
|
|
|
|
* function is not needed.
|
|
|
|
*/
|
|
|
|
int (*flush_pmkid)(void *priv);
|
|
|
|
|
|
|
|
/**
|
2009-04-03 09:35:46 -04:00
|
|
|
* get_capa - Get driver capabilities
|
2008-02-27 20:34:43 -05:00
|
|
|
* @priv: private driver interface data
|
|
|
|
*
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* Get driver/firmware/hardware capabilities.
|
|
|
|
*/
|
|
|
|
int (*get_capa)(void *priv, struct wpa_driver_capa *capa);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* poll - Poll driver for association information
|
|
|
|
* @priv: private driver interface data
|
|
|
|
*
|
|
|
|
* This is an option callback that can be used when the driver does not
|
|
|
|
* provide event mechanism for association events. This is called when
|
|
|
|
* receiving WPA EAPOL-Key messages that require association
|
|
|
|
* information. The driver interface is supposed to generate associnfo
|
|
|
|
* event before returning from this callback function. In addition, the
|
|
|
|
* driver interface should generate an association event after having
|
|
|
|
* sent out associnfo.
|
|
|
|
*/
|
|
|
|
void (*poll)(void *priv);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* get_ifname - Get interface name
|
|
|
|
* @priv: private driver interface data
|
|
|
|
*
|
|
|
|
* Returns: Pointer to the interface name. This can differ from the
|
2008-11-18 09:30:32 -05:00
|
|
|
* interface name used in init() call. Init() is called first.
|
2008-02-27 20:34:43 -05:00
|
|
|
*
|
|
|
|
* This optional function can be used to allow the driver interface to
|
|
|
|
* replace the interface name with something else, e.g., based on an
|
|
|
|
* interface mapping from a more descriptive name.
|
|
|
|
*/
|
|
|
|
const char * (*get_ifname)(void *priv);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* get_mac_addr - Get own MAC address
|
|
|
|
* @priv: private driver interface data
|
|
|
|
*
|
|
|
|
* Returns: Pointer to own MAC address or %NULL on failure
|
|
|
|
*
|
|
|
|
* This optional function can be used to get the own MAC address of the
|
|
|
|
* device from the driver interface code. This is only needed if the
|
|
|
|
* l2_packet implementation for the OS does not provide easy access to
|
|
|
|
* a MAC address. */
|
|
|
|
const u8 * (*get_mac_addr)(void *priv);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* send_eapol - Optional function for sending EAPOL packets
|
|
|
|
* @priv: private driver interface data
|
|
|
|
* @dest: Destination MAC address
|
|
|
|
* @proto: Ethertype
|
|
|
|
* @data: EAPOL packet starting with IEEE 802.1X header
|
|
|
|
* @data_len: Size of the EAPOL packet
|
|
|
|
*
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This optional function can be used to override l2_packet operations
|
|
|
|
* with driver specific functionality. If this function pointer is set,
|
|
|
|
* l2_packet module is not used at all and the driver interface code is
|
|
|
|
* responsible for receiving and sending all EAPOL packets. The
|
2010-01-03 10:44:40 -05:00
|
|
|
* received EAPOL packets are sent to core code with EVENT_EAPOL_RX
|
|
|
|
* event. The driver interface is required to implement get_mac_addr()
|
|
|
|
* handler if send_eapol() is used.
|
2008-02-27 20:34:43 -05:00
|
|
|
*/
|
|
|
|
int (*send_eapol)(void *priv, const u8 *dest, u16 proto,
|
|
|
|
const u8 *data, size_t data_len);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* set_operstate - Sets device operating state to DORMANT or UP
|
|
|
|
* @priv: private driver interface data
|
|
|
|
* @state: 0 = dormant, 1 = up
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This is an optional function that can be used on operating systems
|
|
|
|
* that support a concept of controlling network device state from user
|
|
|
|
* space applications. This function, if set, gets called with
|
|
|
|
* state = 1 when authentication has been completed and with state = 0
|
|
|
|
* when connection is lost.
|
|
|
|
*/
|
|
|
|
int (*set_operstate)(void *priv, int state);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* mlme_setprotection - MLME-SETPROTECTION.request primitive
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @addr: Address of the station for which to set protection (may be
|
|
|
|
* %NULL for group keys)
|
|
|
|
* @protect_type: MLME_SETPROTECTION_PROTECT_TYPE_*
|
|
|
|
* @key_type: MLME_SETPROTECTION_KEY_TYPE_*
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This is an optional function that can be used to set the driver to
|
|
|
|
* require protection for Tx and/or Rx frames. This uses the layer
|
|
|
|
* interface defined in IEEE 802.11i-2004 clause 10.3.22.1
|
|
|
|
* (MLME-SETPROTECTION.request). Many drivers do not use explicit
|
|
|
|
* set protection operation; instead, they set protection implicitly
|
|
|
|
* based on configured keys.
|
|
|
|
*/
|
|
|
|
int (*mlme_setprotection)(void *priv, const u8 *addr, int protect_type,
|
|
|
|
int key_type);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* get_hw_feature_data - Get hardware support data (channels and rates)
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @num_modes: Variable for returning the number of returned modes
|
|
|
|
* flags: Variable for returning hardware feature flags
|
|
|
|
* Returns: Pointer to allocated hardware data on success or %NULL on
|
|
|
|
* failure. Caller is responsible for freeing this.
|
|
|
|
*
|
|
|
|
* This function is only needed for drivers that export MLME
|
|
|
|
* (management frame processing) to wpa_supplicant.
|
|
|
|
*/
|
2009-04-03 12:04:20 -04:00
|
|
|
struct hostapd_hw_modes * (*get_hw_feature_data)(void *priv,
|
|
|
|
u16 *num_modes,
|
|
|
|
u16 *flags);
|
2008-02-27 20:34:43 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* set_channel - Set channel
|
|
|
|
* @priv: Private driver interface data
|
2009-04-03 12:04:20 -04:00
|
|
|
* @phymode: HOSTAPD_MODE_IEEE80211B, ..
|
2008-02-27 20:34:43 -05:00
|
|
|
* @chan: IEEE 802.11 channel number
|
|
|
|
* @freq: Frequency of the channel in MHz
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This function is only needed for drivers that export MLME
|
|
|
|
* (management frame processing) to wpa_supplicant.
|
|
|
|
*/
|
2009-12-26 03:35:08 -05:00
|
|
|
int (*set_channel)(void *priv, enum hostapd_hw_mode phymode, int chan,
|
2008-02-27 20:34:43 -05:00
|
|
|
int freq);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* set_ssid - Set SSID
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @ssid: SSID
|
|
|
|
* @ssid_len: SSID length
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This function is only needed for drivers that export MLME
|
|
|
|
* (management frame processing) to wpa_supplicant.
|
|
|
|
*/
|
|
|
|
int (*set_ssid)(void *priv, const u8 *ssid, size_t ssid_len);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* set_bssid - Set BSSID
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @bssid: BSSID
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This function is only needed for drivers that export MLME
|
|
|
|
* (management frame processing) to wpa_supplicant.
|
|
|
|
*/
|
|
|
|
int (*set_bssid)(void *priv, const u8 *bssid);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* send_mlme - Send management frame from MLME
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @data: IEEE 802.11 management frame with IEEE 802.11 header
|
|
|
|
* @data_len: Size of the management frame
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This function is only needed for drivers that export MLME
|
|
|
|
* (management frame processing) to wpa_supplicant.
|
|
|
|
*/
|
|
|
|
int (*send_mlme)(void *priv, const u8 *data, size_t data_len);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* mlme_add_sta - Add a STA entry into the driver/netstack
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @addr: MAC address of the STA (e.g., BSSID of the AP)
|
|
|
|
* @supp_rates: Supported rate set (from (Re)AssocResp); in IEEE 802.11
|
|
|
|
* format (one octet per rate, 1 = 0.5 Mbps)
|
|
|
|
* @supp_rates_len: Number of entries in supp_rates
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This function is only needed for drivers that export MLME
|
|
|
|
* (management frame processing) to wpa_supplicant. When the MLME code
|
|
|
|
* completes association with an AP, this function is called to
|
|
|
|
* configure the driver/netstack with a STA entry for data frame
|
|
|
|
* processing (TX rate control, encryption/decryption).
|
|
|
|
*/
|
|
|
|
int (*mlme_add_sta)(void *priv, const u8 *addr, const u8 *supp_rates,
|
|
|
|
size_t supp_rates_len);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* mlme_remove_sta - Remove a STA entry from the driver/netstack
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @addr: MAC address of the STA (e.g., BSSID of the AP)
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This function is only needed for drivers that export MLME
|
|
|
|
* (management frame processing) to wpa_supplicant.
|
|
|
|
*/
|
|
|
|
int (*mlme_remove_sta)(void *priv, const u8 *addr);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* update_ft_ies - Update FT (IEEE 802.11r) IEs
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @md: Mobility domain (2 octets) (also included inside ies)
|
|
|
|
* @ies: FT IEs (MDIE, FTIE, ...) or %NULL to remove IEs
|
|
|
|
* @ies_len: Length of FT IEs in bytes
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* The supplicant uses this callback to let the driver know that keying
|
|
|
|
* material for FT is available and that the driver can use the
|
|
|
|
* provided IEs in the next message in FT authentication sequence.
|
|
|
|
*
|
|
|
|
* This function is only needed for driver that support IEEE 802.11r
|
|
|
|
* (Fast BSS Transition).
|
|
|
|
*/
|
|
|
|
int (*update_ft_ies)(void *priv, const u8 *md, const u8 *ies,
|
|
|
|
size_t ies_len);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* send_ft_action - Send FT Action frame (IEEE 802.11r)
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @action: Action field value
|
|
|
|
* @target_ap: Target AP address
|
|
|
|
* @ies: FT IEs (MDIE, FTIE, ...) (FT Request action frame body)
|
|
|
|
* @ies_len: Length of FT IEs in bytes
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* The supplicant uses this callback to request the driver to transmit
|
|
|
|
* an FT Action frame (action category 6) for over-the-DS fast BSS
|
|
|
|
* transition.
|
|
|
|
*/
|
|
|
|
int (*send_ft_action)(void *priv, u8 action, const u8 *target_ap,
|
|
|
|
const u8 *ies, size_t ies_len);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* get_scan_results2 - Fetch the latest scan results
|
|
|
|
* @priv: private driver interface data
|
|
|
|
*
|
|
|
|
* Returns: Allocated buffer of scan results (caller is responsible for
|
|
|
|
* freeing the data structure) on success, NULL on failure
|
|
|
|
*/
|
|
|
|
struct wpa_scan_results * (*get_scan_results2)(void *priv);
|
|
|
|
|
2008-12-09 15:11:14 -05:00
|
|
|
/**
|
|
|
|
* set_country - Set country
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @alpha2: country to which to switch to
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This function is for drivers which support some form
|
|
|
|
* of setting a regulatory domain.
|
|
|
|
*/
|
|
|
|
int (*set_country)(void *priv, const char *alpha2);
|
2008-12-22 15:24:31 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* global_init - Global driver initialization
|
|
|
|
* Returns: Pointer to private data (global), %NULL on failure
|
|
|
|
*
|
|
|
|
* This optional function is called to initialize the driver wrapper
|
|
|
|
* for global data, i.e., data that applies to all interfaces. If this
|
|
|
|
* function is implemented, global_deinit() will also need to be
|
|
|
|
* implemented to free the private data. The driver will also likely
|
|
|
|
* use init2() function instead of init() to get the pointer to global
|
|
|
|
* data available to per-interface initializer.
|
|
|
|
*/
|
|
|
|
void * (*global_init)(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* global_deinit - Global driver deinitialization
|
|
|
|
* @priv: private driver global data from global_init()
|
|
|
|
*
|
|
|
|
* Terminate any global driver related functionality and free the
|
|
|
|
* global data structure.
|
|
|
|
*/
|
|
|
|
void (*global_deinit)(void *priv);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* init2 - Initialize driver interface (with global data)
|
|
|
|
* @ctx: context to be used when calling wpa_supplicant functions,
|
|
|
|
* e.g., wpa_supplicant_event()
|
|
|
|
* @ifname: interface name, e.g., wlan0
|
|
|
|
* @global_priv: private driver global data from global_init()
|
|
|
|
* Returns: Pointer to private data, %NULL on failure
|
|
|
|
*
|
|
|
|
* This function can be used instead of init() if the driver wrapper
|
|
|
|
* uses global data.
|
|
|
|
*/
|
|
|
|
void * (*init2)(void *ctx, const char *ifname, void *global_priv);
|
2008-12-24 13:25:19 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* get_interfaces - Get information about available interfaces
|
|
|
|
* @global_priv: private driver global data from global_init()
|
|
|
|
* Returns: Allocated buffer of interface information (caller is
|
|
|
|
* responsible for freeing the data structure) on success, NULL on
|
|
|
|
* failure
|
|
|
|
*/
|
|
|
|
struct wpa_interface_info * (*get_interfaces)(void *global_priv);
|
2009-02-14 10:01:32 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* scan2 - Request the driver to initiate scan
|
|
|
|
* @priv: private driver interface data
|
|
|
|
* @params: Scan parameters
|
|
|
|
*
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* Once the scan results are ready, the driver should report scan
|
|
|
|
* results event for wpa_supplicant which will eventually request the
|
|
|
|
* results with wpa_driver_get_scan_results2().
|
|
|
|
*/
|
|
|
|
int (*scan2)(void *priv, struct wpa_driver_scan_params *params);
|
2009-03-20 16:26:41 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* authenticate - Request driver to authenticate
|
|
|
|
* @priv: private driver interface data
|
|
|
|
* @params: authentication parameters
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This is an optional function that can be used with drivers that
|
|
|
|
* support separate authentication and association steps, i.e., when
|
|
|
|
* wpa_supplicant can act as the SME. If not implemented, associate()
|
|
|
|
* function is expected to take care of IEEE 802.11 authentication,
|
|
|
|
* too.
|
|
|
|
*/
|
2009-04-02 09:09:48 -04:00
|
|
|
int (*authenticate)(void *priv,
|
|
|
|
struct wpa_driver_auth_params *params);
|
|
|
|
|
2009-12-09 18:21:01 -05:00
|
|
|
/**
|
|
|
|
* set_beacon - Set Beacon frame template
|
|
|
|
* @iface: Interface name (main interface or virtual BSS)
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @head: Beacon head from IEEE 802.11 header to IEs before TIM IE
|
|
|
|
* @head_len: Length of the head buffer in octets
|
|
|
|
* @tail: Beacon tail following TIM IE
|
|
|
|
* @tail_len: Length of the tail buffer in octets
|
|
|
|
* @dtim_period: DTIM period
|
|
|
|
* @beacon_int: Beacon interval
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This function is used to configure Beacon template for the driver in
|
|
|
|
* AP mode. The driver is responsible for building the full Beacon
|
|
|
|
* frame by concatenating the head part with TIM IE generated by the
|
|
|
|
* driver/firmware and finishing with the tail part.
|
|
|
|
*/
|
2009-11-23 08:26:05 -05:00
|
|
|
int (*set_beacon)(const char *ifname, void *priv,
|
|
|
|
const u8 *head, size_t head_len,
|
|
|
|
const u8 *tail, size_t tail_len, int dtim_period,
|
|
|
|
int beacon_int);
|
2009-04-09 06:40:12 -04:00
|
|
|
|
2009-12-09 18:21:01 -05:00
|
|
|
/**
|
|
|
|
* hapd_init - Initialize driver interface (hostapd only)
|
|
|
|
* @hapd: Pointer to hostapd context
|
|
|
|
* @params: Configuration for the driver wrapper
|
|
|
|
* Returns: Pointer to private data, %NULL on failure
|
|
|
|
*
|
|
|
|
* This function is used instead of init() or init2() when the driver
|
|
|
|
* wrapper is used withh hostapd.
|
|
|
|
*/
|
2009-04-09 16:28:21 -04:00
|
|
|
void * (*hapd_init)(struct hostapd_data *hapd,
|
|
|
|
struct wpa_init_params *params);
|
2009-12-09 18:21:01 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* hapd_deinit - Deinitialize driver interface (hostapd only)
|
|
|
|
* @priv: Private driver interface data from hapd_init()
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
void (*hapd_deinit)(void *priv);
|
|
|
|
|
|
|
|
/**
|
2009-12-09 18:21:01 -05:00
|
|
|
* set_ieee8021x - Enable/disable IEEE 802.1X support (AP only)
|
|
|
|
* @priv: Private driver interface data
|
2009-12-12 16:32:44 -05:00
|
|
|
* @params: BSS parameters
|
2009-04-09 06:40:12 -04:00
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
2009-12-09 18:21:01 -05:00
|
|
|
* This is an optional function to configure the kernel driver to
|
2009-12-12 16:32:44 -05:00
|
|
|
* enable/disable IEEE 802.1X support and set WPA/WPA2 parameters. This
|
|
|
|
* can be left undefined (set to %NULL) if IEEE 802.1X support is
|
|
|
|
* always enabled and the driver uses set_beacon() to set WPA/RSN IE
|
|
|
|
* for Beacon frames.
|
2009-04-09 06:40:12 -04:00
|
|
|
*/
|
2009-12-12 16:32:44 -05:00
|
|
|
int (*set_ieee8021x)(void *priv, struct wpa_bss_params *params);
|
2009-04-09 06:40:12 -04:00
|
|
|
|
|
|
|
/**
|
2009-12-09 18:21:01 -05:00
|
|
|
* set_privacy - Enable/disable privacy (AP only)
|
|
|
|
* @priv: Private driver interface data
|
2009-04-09 06:40:12 -04:00
|
|
|
* @enabled: 1 = privacy enabled, 0 = disabled
|
2009-12-09 18:21:01 -05:00
|
|
|
* Returns: 0 on success, -1 on failure
|
2009-04-09 06:40:12 -04:00
|
|
|
*
|
2009-12-09 18:21:01 -05:00
|
|
|
* This is an optional function to configure privacy field in the
|
|
|
|
* kernel driver for Beacon frames. This can be left undefined (set to
|
|
|
|
* %NULL) if the driver uses the Beacon template from set_beacon().
|
2009-04-09 06:40:12 -04:00
|
|
|
*/
|
|
|
|
int (*set_privacy)(const char *ifname, void *priv, int enabled);
|
|
|
|
|
2009-12-09 18:21:01 -05:00
|
|
|
/**
|
|
|
|
* get_seqnum - Fetch the current TSC/packet number (AP only)
|
|
|
|
* @ifname: The interface name (main or virtual)
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @addr: MAC address of the station or %NULL for group keys
|
|
|
|
* @idx: Key index
|
|
|
|
* @seq: Buffer for returning the latest used TSC/packet number
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This function is used to fetch the last used TSC/packet number for
|
2009-12-10 17:15:54 -05:00
|
|
|
* a TKIP, CCMP, or BIP/IGTK key. It is mainly used with group keys, so
|
|
|
|
* there is no strict requirement on implementing support for unicast
|
|
|
|
* keys (i.e., addr != %NULL).
|
2009-12-09 18:21:01 -05:00
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*get_seqnum)(const char *ifname, void *priv, const u8 *addr,
|
|
|
|
int idx, u8 *seq);
|
2009-12-09 18:21:01 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* flush - Flush all association stations (AP only)
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This function requests the driver to disassociate all associated
|
|
|
|
* stations. This function does not need to be implemented if the
|
|
|
|
* driver does not process association frames internally.
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*flush)(void *priv);
|
2009-12-09 18:21:01 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* set_generic_elem - Add IEs into Beacon/Probe Response frames (AP)
|
|
|
|
* @ifname: The interface name (main or virtual BSS)
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @elem: Information elements
|
|
|
|
* @elem_len: Length of the elem buffer in octets
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This is an optional function to add information elements in the
|
|
|
|
* kernel driver for Beacon and Probe Response frames. This can be left
|
|
|
|
* undefined (set to %NULL) if the driver uses the Beacon template from
|
|
|
|
* set_beacon().
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*set_generic_elem)(const char *ifname, void *priv, const u8 *elem,
|
|
|
|
size_t elem_len);
|
|
|
|
|
2009-12-09 18:21:01 -05:00
|
|
|
/**
|
|
|
|
* read_sta_data - Fetch station data (AP only)
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @data: Buffer for returning station information
|
|
|
|
* @addr: MAC address of the station
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*read_sta_data)(void *priv, struct hostap_sta_driver_data *data,
|
|
|
|
const u8 *addr);
|
2009-12-09 18:21:01 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* hapd_send_eapol - Send an EAPOL packet (AP only)
|
|
|
|
* @priv: private driver interface data
|
|
|
|
* @addr: Destination MAC address
|
|
|
|
* @data: EAPOL packet starting with IEEE 802.1X header
|
|
|
|
* @data_len: Length of the EAPOL packet in octets
|
|
|
|
* @encrypt: Whether the frame should be encrypted
|
|
|
|
* @own_addr: Source MAC address
|
|
|
|
*
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*hapd_send_eapol)(void *priv, const u8 *addr, const u8 *data,
|
|
|
|
size_t data_len, int encrypt,
|
|
|
|
const u8 *own_addr);
|
2009-12-09 18:21:01 -05:00
|
|
|
|
2009-12-10 14:11:33 -05:00
|
|
|
/**
|
|
|
|
* sta_deauth - Deauthenticate a station (AP only)
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @own_addr: Source address and BSSID for the Deauthentication frame
|
|
|
|
* @addr: MAC address of the station to deauthenticate
|
|
|
|
* @reason: Reason code for the Deauthentiation frame
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This function requests a specific station to be deauthenticated and
|
|
|
|
* a Deauthentication frame to be sent to it.
|
|
|
|
*/
|
2009-04-17 04:37:22 -04:00
|
|
|
int (*sta_deauth)(void *priv, const u8 *own_addr, const u8 *addr,
|
|
|
|
int reason);
|
2009-12-10 14:11:33 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* sta_disassoc - Disassociate a station (AP only)
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @own_addr: Source address and BSSID for the Disassociation frame
|
|
|
|
* @addr: MAC address of the station to disassociate
|
|
|
|
* @reason: Reason code for the Disassociation frame
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This function requests a specific station to be disassociated and
|
|
|
|
* a Disassociation frame to be sent to it.
|
|
|
|
*/
|
2009-04-17 04:37:22 -04:00
|
|
|
int (*sta_disassoc)(void *priv, const u8 *own_addr, const u8 *addr,
|
|
|
|
int reason);
|
2009-12-10 14:11:33 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* sta_remove - Remove a station entry (AP only)
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @addr: MAC address of the station to be removed
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*sta_remove)(void *priv, const u8 *addr);
|
2009-12-10 14:11:33 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* hapd_get_ssid - Get the current SSID (AP only)
|
|
|
|
* @ifname: Interface (master or virtual BSS)
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @buf: Buffer for returning the SSID
|
|
|
|
* @len: Maximum length of the buffer
|
|
|
|
* Returns: Length of the SSID on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This function need not be implemented if the driver uses Beacon
|
|
|
|
* template from set_beacon() and does not reply to Probe Request
|
|
|
|
* frames.
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*hapd_get_ssid)(const char *ifname, void *priv, u8 *buf, int len);
|
2009-12-10 14:11:33 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* hapd_set_ssid - Set SSID (AP only)
|
|
|
|
* @ifname: Interface (master or virtual BSS)
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @buf: SSID
|
|
|
|
* @len: Length of the SSID in octets
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*hapd_set_ssid)(const char *ifname, void *priv, const u8 *buf,
|
|
|
|
int len);
|
2009-12-10 14:11:33 -05:00
|
|
|
/**
|
|
|
|
* hapd_set_countermeasures - Enable/disable TKIP countermeasures (AP)
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @enabled: 1 = countermeasures enabled, 0 = disabled
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This need not be implemented if the driver does not take care of
|
|
|
|
* association processing.
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*hapd_set_countermeasures)(void *priv, int enabled);
|
2009-12-10 14:11:33 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* sta_add - Add a station entry
|
|
|
|
* @ifname: Interface (master or virtual)
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @params: Station parameters
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This function is used to add a station entry to the driver once the
|
|
|
|
* station has completed association. This is only used if the driver
|
|
|
|
* does not take care of association processing.
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*sta_add)(const char *ifname, void *priv,
|
|
|
|
struct hostapd_sta_add_params *params);
|
2009-12-10 14:11:33 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* get_inact_sec - Get station inactivity duration (AP only)
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @addr: Station address
|
|
|
|
* Returns: Number of seconds station has been inactive, -1 on failure
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*get_inact_sec)(void *priv, const u8 *addr);
|
2009-12-10 14:11:33 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* sta_clear_stats - Clear station statistics (AP only)
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @addr: Station address
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*sta_clear_stats)(void *priv, const u8 *addr);
|
|
|
|
|
2009-12-10 14:11:33 -05:00
|
|
|
/**
|
|
|
|
* set_freq - Set channel/frequency (AP only)
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @freq: Channel parameters
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*set_freq)(void *priv, struct hostapd_freq_params *freq);
|
2009-12-10 14:11:33 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* set_rts - Set RTS threshold
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @rts: RTS threshold in octets
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*set_rts)(void *priv, int rts);
|
2009-12-10 14:11:33 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* set_frag - Set fragmentation threshold
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @frag: Fragmentation threshold in octets
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*set_frag)(void *priv, int frag);
|
|
|
|
|
2009-12-10 14:11:33 -05:00
|
|
|
/**
|
|
|
|
* sta_set_flags - Set station flags (AP only)
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @addr: Station address
|
2009-12-13 04:35:39 -05:00
|
|
|
* @total_flags: Bitmap of all WPA_STA_* flags currently set
|
|
|
|
* @flags_or: Bitmap of WPA_STA_* flags to add
|
|
|
|
* @flags_and: Bitmap of WPA_STA_* flags to us as a mask
|
2009-12-10 14:11:33 -05:00
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*sta_set_flags)(void *priv, const u8 *addr,
|
|
|
|
int total_flags, int flags_or, int flags_and);
|
2009-12-10 14:11:33 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* set_rate_sets - Set supported and basic rate sets (AP only)
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @supp_rates: -1 terminated array of supported rates in 100 kbps
|
|
|
|
* @basic_rates: -1 terminated array of basic rates in 100 kbps
|
|
|
|
* @mode: hardware mode (HOSTAPD_MODE_*)
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*set_rate_sets)(void *priv, int *supp_rates, int *basic_rates,
|
|
|
|
int mode);
|
|
|
|
|
2009-12-10 14:11:33 -05:00
|
|
|
/**
|
|
|
|
* set_cts_protect - Set CTS protection mode (AP only)
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @value: Whether CTS protection is enabled
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*set_cts_protect)(void *priv, int value);
|
2009-12-10 14:11:33 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* set_preamble - Set preamble mode (AP only)
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @value: Whether short preamble is enabled
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*set_preamble)(void *priv, int value);
|
2009-12-10 14:11:33 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* set_short_slot_time - Set short slot time (AP only)
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @value: Whether short slot time is enabled
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*set_short_slot_time)(void *priv, int value);
|
2009-12-10 14:11:33 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* set_tx_queue_params - Set TX queue parameters
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @queue: Queue number
|
|
|
|
* @aifs: AIFS
|
|
|
|
* @cw_min: cwMin
|
|
|
|
* @cw_max: cwMax
|
|
|
|
* @burst_time: Maximum length for bursting in 0.1 msec units
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*set_tx_queue_params)(void *priv, int queue, int aifs, int cw_min,
|
|
|
|
int cw_max, int burst_time);
|
2009-12-10 14:11:33 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* valid_bss_mask - Validate BSSID mask
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @addr: Address
|
|
|
|
* @mask: Mask
|
|
|
|
* Returns: 0 if mask is valid, -1 if mask is not valid, 1 if mask can
|
|
|
|
* be used, but the main interface address must be the first address in
|
|
|
|
* the block if mask is applied
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*valid_bss_mask)(void *priv, const u8 *addr, const u8 *mask);
|
2009-12-09 09:49:28 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* if_add - Add a virtual interface
|
|
|
|
* @iface: Parent interface name
|
2009-12-09 18:21:01 -05:00
|
|
|
* @priv: Private driver interface data
|
2009-12-09 09:49:28 -05:00
|
|
|
* @type: Interface type
|
|
|
|
* @ifname: Interface name for the new virtual interface
|
|
|
|
* @addr: Local address to use for the interface or %NULL to use the
|
|
|
|
* parent interface address
|
2009-12-13 11:54:11 -05:00
|
|
|
* @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces
|
2009-12-09 09:49:28 -05:00
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*if_add)(const char *iface, void *priv,
|
2009-12-09 09:49:28 -05:00
|
|
|
enum wpa_driver_if_type type, const char *ifname,
|
2009-12-13 11:54:11 -05:00
|
|
|
const u8 *addr, void *bss_ctx);
|
2009-12-09 09:49:28 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* if_remove - Remove a virtual interface
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @type: Interface type
|
|
|
|
* @ifname: Interface name of the virtual interface to be removed
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*/
|
|
|
|
int (*if_remove)(void *priv, enum wpa_driver_if_type type,
|
|
|
|
const char *ifname);
|
2009-12-10 14:11:33 -05:00
|
|
|
|
2009-12-09 18:21:01 -05:00
|
|
|
/**
|
|
|
|
* set_sta_vlan - Bind a station into a specific interface (AP only)
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @ifname: Interface (main or virtual BSS or VLAN)
|
|
|
|
* @addr: MAC address of the associated station
|
|
|
|
* @vlan_id: VLAN ID
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This function is used to bind a station to a specific virtual
|
|
|
|
* interface. It is only used if when virtual interfaces are supported,
|
|
|
|
* e.g., to assign stations to different VLAN interfaces based on
|
|
|
|
* information from a RADIUS server. This allows separate broadcast
|
|
|
|
* domains to be used with a single BSS.
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*set_sta_vlan)(void *priv, const u8 *addr, const char *ifname,
|
|
|
|
int vlan_id);
|
2009-12-09 18:21:01 -05:00
|
|
|
|
2009-04-09 06:40:12 -04:00
|
|
|
/**
|
2009-12-09 18:21:01 -05:00
|
|
|
* commit - Optional commit changes handler (AP only)
|
2009-04-09 06:40:12 -04:00
|
|
|
* @priv: driver private data
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This optional handler function can be registered if the driver
|
|
|
|
* interface implementation needs to commit changes (e.g., by setting
|
|
|
|
* network interface up) at the end of initial configuration. If set,
|
|
|
|
* this handler will be called after initial setup has been completed.
|
|
|
|
*/
|
|
|
|
int (*commit)(void *priv);
|
|
|
|
|
2009-12-10 14:11:33 -05:00
|
|
|
/**
|
|
|
|
* send_ether - Send an ethernet packet (AP only)
|
|
|
|
* @priv: private driver interface data
|
|
|
|
* @dst: Destination MAC address
|
|
|
|
* @src: Source MAC address
|
|
|
|
* @proto: Ethertype
|
|
|
|
* @data: EAPOL packet starting with IEEE 802.1X header
|
|
|
|
* @data_len: Length of the EAPOL packet in octets
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*send_ether)(void *priv, const u8 *dst, const u8 *src, u16 proto,
|
|
|
|
const u8 *data, size_t data_len);
|
|
|
|
|
2009-12-10 14:11:33 -05:00
|
|
|
/**
|
|
|
|
* set_radius_acl_auth - Notification of RADIUS ACL change
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @mac: MAC address of the station
|
|
|
|
* @accepted: Whether the station was accepted
|
|
|
|
* @session_timeout: Session timeout for the station
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*set_radius_acl_auth)(void *priv, const u8 *mac, int accepted,
|
|
|
|
u32 session_timeout);
|
2009-12-10 14:11:33 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* set_radius_acl_expire - Notification of RADIUS ACL expiration
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @mac: MAC address of the station
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*set_radius_acl_expire)(void *priv, const u8 *mac);
|
|
|
|
|
2009-12-10 14:11:33 -05:00
|
|
|
/**
|
|
|
|
* set_ht_params - Set HT parameters (AP only)
|
|
|
|
* @ifname: The interface name (main or virtual BSS)
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @ht_capab: HT Capabilities IE
|
|
|
|
* @ht_capab_len: Length of ht_capab in octets
|
|
|
|
* @ht_oper: HT Operation IE
|
|
|
|
* @ht_oper_len: Length of ht_oper in octets
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*/
|
2009-04-09 06:40:12 -04:00
|
|
|
int (*set_ht_params)(const char *ifname, void *priv,
|
|
|
|
const u8 *ht_capab, size_t ht_capab_len,
|
|
|
|
const u8 *ht_oper, size_t ht_oper_len);
|
|
|
|
|
2009-12-09 18:21:01 -05:00
|
|
|
/**
|
2009-12-24 12:46:06 -05:00
|
|
|
* set_ap_wps_ie - Add WPS IE into Beacon/Probe Response frames (AP)
|
2009-12-09 18:21:01 -05:00
|
|
|
* @ifname: The interface name (main or virtual BSS)
|
|
|
|
* @priv: Private driver interface data
|
2009-12-24 12:46:06 -05:00
|
|
|
* @beacon: WPS IE for Beacon frames
|
|
|
|
* @proberesp: WPS IE for Probe Response frames
|
2009-12-09 18:21:01 -05:00
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This is an optional function to add WPS IE in the kernel driver for
|
2009-12-24 12:46:06 -05:00
|
|
|
* Beacon and Probe Response frames. This can be left undefined (set
|
|
|
|
* to %NULL) if the driver uses the Beacon template from set_beacon()
|
|
|
|
* and does not process Probe Request frames.
|
2009-12-09 18:21:01 -05:00
|
|
|
*/
|
2009-12-24 12:46:06 -05:00
|
|
|
int (*set_ap_wps_ie)(const char *ifname, void *priv,
|
|
|
|
const struct wpabuf *beacon,
|
|
|
|
const struct wpabuf *proberesp);
|
2009-04-22 09:01:37 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* set_supp_port - Set IEEE 802.1X Supplicant Port status
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @authorized: Whether the port is authorized
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*/
|
|
|
|
int (*set_supp_port)(void *priv, int authorized);
|
2009-12-24 04:46:22 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* set_wds_sta - Bind a station into a 4-address WDS (AP only)
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @addr: MAC address of the associated station
|
|
|
|
* @aid: Association ID
|
|
|
|
* @val: 1 = bind to 4-address WDS; 0 = unbind
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*/
|
|
|
|
int (*set_wds_sta)(void *priv, const u8 *addr, int aid, int val);
|
2010-01-03 06:30:22 -05:00
|
|
|
|
2010-01-03 06:57:51 -05:00
|
|
|
/**
|
|
|
|
* send_action - Transmit an Action frame
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @freq: Frequency (in MHz) of the channel
|
|
|
|
* @dst: Destination MAC address
|
|
|
|
* @src: Source MAC address
|
|
|
|
* @data: Frame body
|
|
|
|
* @data_len: data length in octets
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This command can be used to request the driver to transmit an action
|
|
|
|
* frame to the specified destination. If a remain-on-channel duration
|
|
|
|
* is in progress, the frame is transmitted on that channel. Otherwise,
|
|
|
|
* the frame is transmitted on the current operational channel if in
|
|
|
|
* associated state in station mode or if operating as an AP. If none
|
|
|
|
* of these conditions is in effect, send_action() cannot be used.
|
|
|
|
*/
|
|
|
|
int (*send_action)(void *priv, unsigned int freq,
|
|
|
|
const u8 *dst, const u8 *src,
|
|
|
|
const u8 *data, size_t data_len);
|
|
|
|
|
2010-01-03 06:42:06 -05:00
|
|
|
/**
|
|
|
|
* alloc_interface_addr - Allocate a virtual interface address
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @addr: Buffer for returning the address
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This command pre-allocates an interface address for a new virtual
|
|
|
|
* interface. This can be used before creating a virtual interface if
|
|
|
|
* the interface mode (e.g., AP vs. station) is not yet known, but the
|
|
|
|
* address of the virtual interface is already needed. This helps with
|
|
|
|
* drivers that cannot change interface mode without destroying and
|
|
|
|
* re-creating the interface.
|
|
|
|
*
|
|
|
|
* The allocated address can be used in a bss_add() call to request a
|
|
|
|
* specific bssid.
|
|
|
|
*/
|
|
|
|
int (*alloc_interface_addr)(void *priv, u8 *addr);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* release_interface_addr - Release a virtual interface address
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @addr: Address to be freed from alloc_interface_addr()
|
|
|
|
*
|
|
|
|
* This command is used to release a virtual interface address that was
|
|
|
|
* allocated with alloc_interface_addr(), but has not yet been used
|
|
|
|
* with bss_add() to actually create the interface. This allows the
|
|
|
|
* driver to release the pending allocation for a new interface.
|
|
|
|
*/
|
|
|
|
void (*release_interface_addr)(void *priv, const u8 *addr);
|
|
|
|
|
2010-01-03 06:57:51 -05:00
|
|
|
/**
|
|
|
|
* remain_on_channel - Remain awake on a channel
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @freq: Frequency (in MHz) of the channel
|
|
|
|
* @duration: Duration in milliseconds
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This command is used to request the driver to remain awake on the
|
|
|
|
* specified channel for the specified duration and report received
|
|
|
|
* Action frames with EVENT_RX_ACTION events. Optionally, received
|
|
|
|
* Probe Request frames may also be requested to be reported by calling
|
|
|
|
* probe_req_report(). These will be reported with EVENT_RX_PROBE_REQ.
|
|
|
|
*
|
|
|
|
* The driver may not be at the requested channel when this function
|
|
|
|
* returns, i.e., the return code is only indicating whether the
|
|
|
|
* request was accepted. The caller will need to wait until the
|
|
|
|
* EVENT_REMAIN_ON_CHANNEL event indicates that the driver has
|
|
|
|
* completed the channel change. This may take some time due to other
|
|
|
|
* need for the radio and the caller should be prepared to timing out
|
|
|
|
* its wait since there are no guarantees on when this request can be
|
|
|
|
* executed.
|
|
|
|
*/
|
|
|
|
int (*remain_on_channel)(void *priv, unsigned int freq,
|
|
|
|
unsigned int duration);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* cancel_remain_on_channel - Cancel remain-on-channel operation
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
*
|
|
|
|
* This command can be used to cancel a remain-on-channel operation
|
|
|
|
* before its originally requested duration has passed. This could be
|
|
|
|
* used, e.g., when remain_on_channel() is used to request extra time
|
|
|
|
* to receive a response to an Action frame and the response is
|
|
|
|
* received when there is still unneeded time remaining on the
|
|
|
|
* remain-on-channel operation.
|
|
|
|
*/
|
|
|
|
int (*cancel_remain_on_channel)(void *priv);
|
|
|
|
|
2010-01-03 06:30:22 -05:00
|
|
|
/**
|
|
|
|
* probe_req_report - Request Probe Request frames to be indicated
|
|
|
|
* @priv: Private driver interface data
|
|
|
|
* @report: Whether to report received Probe Request frames
|
|
|
|
* Returns: 0 on success, -1 on failure (or if not supported)
|
|
|
|
*
|
|
|
|
* This command can be used to request the driver to indicate when
|
|
|
|
* Probe Request frames are received with EVENT_RX_PROBE_REQ events.
|
|
|
|
* Since this operation may require extra resources, e.g., due to less
|
|
|
|
* optimal hardware/firmware RX filtering, many drivers may disable
|
|
|
|
* Probe Request reporting at least in station mode. This command is
|
|
|
|
* used to notify the driver when the Probe Request frames need to be
|
|
|
|
* reported, e.g., during remain-on-channel operations.
|
|
|
|
*/
|
|
|
|
int (*probe_req_report)(void *priv, int report);
|
2008-02-27 20:34:43 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* enum wpa_event_type - Event type for wpa_supplicant_event() calls
|
|
|
|
*/
|
2010-01-03 06:10:12 -05:00
|
|
|
enum wpa_event_type {
|
2008-02-27 20:34:43 -05:00
|
|
|
/**
|
|
|
|
* EVENT_ASSOC - Association completed
|
|
|
|
*
|
|
|
|
* This event needs to be delivered when the driver completes IEEE
|
|
|
|
* 802.11 association or reassociation successfully.
|
|
|
|
* wpa_driver_ops::get_bssid() is expected to provide the current BSSID
|
|
|
|
* after this event has been generated. In addition, optional
|
|
|
|
* EVENT_ASSOCINFO may be generated just before EVENT_ASSOC to provide
|
|
|
|
* more information about the association. If the driver interface gets
|
|
|
|
* both of these events at the same time, it can also include the
|
|
|
|
* assoc_info data in EVENT_ASSOC call.
|
|
|
|
*/
|
|
|
|
EVENT_ASSOC,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* EVENT_DISASSOC - Association lost
|
|
|
|
*
|
|
|
|
* This event should be called when association is lost either due to
|
|
|
|
* receiving deauthenticate or disassociate frame from the AP or when
|
2009-03-20 16:26:41 -04:00
|
|
|
* sending either of these frames to the current AP. If the driver
|
|
|
|
* supports separate deauthentication event, EVENT_DISASSOC should only
|
|
|
|
* be used for disassociation and EVENT_DEAUTH for deauthentication.
|
2008-02-27 20:34:43 -05:00
|
|
|
*/
|
|
|
|
EVENT_DISASSOC,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* EVENT_MICHAEL_MIC_FAILURE - Michael MIC (TKIP) detected
|
|
|
|
*
|
|
|
|
* This event must be delivered when a Michael MIC error is detected by
|
|
|
|
* the local driver. Additional data for event processing is
|
|
|
|
* provided with union wpa_event_data::michael_mic_failure. This
|
|
|
|
* information is used to request new encyption key and to initiate
|
|
|
|
* TKIP countermeasures if needed.
|
|
|
|
*/
|
|
|
|
EVENT_MICHAEL_MIC_FAILURE,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* EVENT_SCAN_RESULTS - Scan results available
|
|
|
|
*
|
|
|
|
* This event must be called whenever scan results are available to be
|
|
|
|
* fetched with struct wpa_driver_ops::get_scan_results(). This event
|
|
|
|
* is expected to be used some time after struct wpa_driver_ops::scan()
|
|
|
|
* is called. If the driver provides an unsolicited event when the scan
|
|
|
|
* has been completed, this event can be used to trigger
|
|
|
|
* EVENT_SCAN_RESULTS call. If such event is not available from the
|
|
|
|
* driver, the driver wrapper code is expected to use a registered
|
|
|
|
* timeout to generate EVENT_SCAN_RESULTS call after the time that the
|
2010-01-02 06:57:44 -05:00
|
|
|
* scan is expected to be completed. Optional information about
|
|
|
|
* completed scan can be provided with union wpa_event_data::scan_info.
|
2008-02-27 20:34:43 -05:00
|
|
|
*/
|
|
|
|
EVENT_SCAN_RESULTS,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* EVENT_ASSOCINFO - Report optional extra information for association
|
|
|
|
*
|
|
|
|
* This event can be used to report extra association information for
|
|
|
|
* EVENT_ASSOC processing. This extra information includes IEs from
|
|
|
|
* association frames and Beacon/Probe Response frames in union
|
|
|
|
* wpa_event_data::assoc_info. EVENT_ASSOCINFO must be send just before
|
|
|
|
* EVENT_ASSOC. Alternatively, the driver interface can include
|
|
|
|
* assoc_info data in the EVENT_ASSOC call if it has all the
|
|
|
|
* information available at the same point.
|
|
|
|
*/
|
|
|
|
EVENT_ASSOCINFO,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* EVENT_INTERFACE_STATUS - Report interface status changes
|
|
|
|
*
|
|
|
|
* This optional event can be used to report changes in interface
|
|
|
|
* status (interface added/removed) using union
|
|
|
|
* wpa_event_data::interface_status. This can be used to trigger
|
|
|
|
* wpa_supplicant to stop and re-start processing for the interface,
|
|
|
|
* e.g., when a cardbus card is ejected/inserted.
|
|
|
|
*/
|
|
|
|
EVENT_INTERFACE_STATUS,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* EVENT_PMKID_CANDIDATE - Report a candidate AP for pre-authentication
|
|
|
|
*
|
|
|
|
* This event can be used to inform wpa_supplicant about candidates for
|
|
|
|
* RSN (WPA2) pre-authentication. If wpa_supplicant is not responsible
|
|
|
|
* for scan request (ap_scan=2 mode), this event is required for
|
|
|
|
* pre-authentication. If wpa_supplicant is performing scan request
|
|
|
|
* (ap_scan=1), this event is optional since scan results can be used
|
|
|
|
* to add pre-authentication candidates. union
|
|
|
|
* wpa_event_data::pmkid_candidate is used to report the BSSID of the
|
|
|
|
* candidate and priority of the candidate, e.g., based on the signal
|
|
|
|
* strength, in order to try to pre-authenticate first with candidates
|
|
|
|
* that are most likely targets for re-association.
|
|
|
|
*
|
|
|
|
* EVENT_PMKID_CANDIDATE can be called whenever the driver has updates
|
|
|
|
* on the candidate list. In addition, it can be called for the current
|
|
|
|
* AP and APs that have existing PMKSA cache entries. wpa_supplicant
|
|
|
|
* will automatically skip pre-authentication in cases where a valid
|
|
|
|
* PMKSA exists. When more than one candidate exists, this event should
|
|
|
|
* be generated once for each candidate.
|
|
|
|
*
|
|
|
|
* Driver will be notified about successful pre-authentication with
|
|
|
|
* struct wpa_driver_ops::add_pmkid() calls.
|
|
|
|
*/
|
|
|
|
EVENT_PMKID_CANDIDATE,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* EVENT_STKSTART - Request STK handshake (MLME-STKSTART.request)
|
|
|
|
*
|
|
|
|
* This event can be used to inform wpa_supplicant about desire to set
|
|
|
|
* up secure direct link connection between two stations as defined in
|
|
|
|
* IEEE 802.11e with a new PeerKey mechanism that replaced the original
|
|
|
|
* STAKey negotiation. The caller will need to set peer address for the
|
|
|
|
* event.
|
|
|
|
*/
|
|
|
|
EVENT_STKSTART,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* EVENT_FT_RESPONSE - Report FT (IEEE 802.11r) response IEs
|
|
|
|
*
|
|
|
|
* The driver is expected to report the received FT IEs from
|
|
|
|
* FT authentication sequence from the AP. The FT IEs are included in
|
|
|
|
* the extra information in union wpa_event_data::ft_ies.
|
|
|
|
*/
|
2009-01-14 18:21:55 -05:00
|
|
|
EVENT_FT_RESPONSE,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* EVENT_IBSS_RSN_START - Request RSN authentication in IBSS
|
|
|
|
*
|
|
|
|
* The driver can use this event to inform wpa_supplicant about a STA
|
|
|
|
* in an IBSS with which protected frames could be exchanged. This
|
|
|
|
* event starts RSN authentication with the other STA to authenticate
|
|
|
|
* the STA and set up encryption keys with it.
|
|
|
|
*/
|
2009-03-20 16:26:41 -04:00
|
|
|
EVENT_IBSS_RSN_START,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* EVENT_AUTH - Authentication result
|
|
|
|
*
|
|
|
|
* This event should be called when authentication attempt has been
|
|
|
|
* completed. This is only used if the driver supports separate
|
|
|
|
* authentication step (struct wpa_driver_ops::authenticate).
|
|
|
|
* Information about authentication result is included in
|
|
|
|
* union wpa_event_data::auth.
|
|
|
|
*/
|
|
|
|
EVENT_AUTH,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* EVENT_DEAUTH - Authentication lost
|
|
|
|
*
|
|
|
|
* This event should be called when authentication is lost either due
|
|
|
|
* to receiving deauthenticate frame from the AP or when sending that
|
|
|
|
* frame to the current AP.
|
|
|
|
*/
|
2009-04-01 10:10:36 -04:00
|
|
|
EVENT_DEAUTH,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* EVENT_ASSOC_REJECT - Association rejected
|
|
|
|
*
|
|
|
|
* This event should be called when (re)association attempt has been
|
|
|
|
* rejected by the AP. Information about authentication result is
|
|
|
|
* included in union wpa_event_data::assoc_reject.
|
|
|
|
*/
|
2009-04-23 17:08:24 -04:00
|
|
|
EVENT_ASSOC_REJECT,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* EVENT_AUTH_TIMED_OUT - Authentication timed out
|
|
|
|
*/
|
|
|
|
EVENT_AUTH_TIMED_OUT,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* EVENT_ASSOC_TIMED_OUT - Association timed out
|
|
|
|
*/
|
2009-12-12 15:43:26 -05:00
|
|
|
EVENT_ASSOC_TIMED_OUT,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* EVENT_FT_RRB_RX - FT (IEEE 802.11r) RRB frame received
|
|
|
|
*/
|
2009-12-13 14:21:10 -05:00
|
|
|
EVENT_FT_RRB_RX,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* EVENT_WPS_BUTTON_PUSHED - Report hardware push button press for WPS
|
|
|
|
*/
|
2009-12-13 16:05:39 -05:00
|
|
|
EVENT_WPS_BUTTON_PUSHED,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* EVENT_TX_STATUS - Report TX status
|
|
|
|
*/
|
|
|
|
EVENT_TX_STATUS,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* EVENT_RX_FROM_UNKNOWN - Report RX from unknown STA
|
|
|
|
*/
|
|
|
|
EVENT_RX_FROM_UNKNOWN,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* EVENT_RX_MGMT - Report RX of a management frame
|
|
|
|
*/
|
2010-01-03 04:50:26 -05:00
|
|
|
EVENT_RX_MGMT,
|
|
|
|
|
2010-01-03 06:57:51 -05:00
|
|
|
/**
|
|
|
|
* EVENT_RX_ACTION - Action frame received
|
|
|
|
*
|
|
|
|
* This event is used to indicate when an Action frame has been
|
|
|
|
* received. Information about the received frame is included in
|
|
|
|
* union wpa_event_data::rx_action.
|
|
|
|
*/
|
|
|
|
EVENT_RX_ACTION,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* EVENT_REMAIN_ON_CHANNEL - Remain-on-channel duration started
|
|
|
|
*
|
|
|
|
* This event is used to indicate when the driver has started the
|
|
|
|
* requested remain-on-channel duration. Information about the
|
|
|
|
* operation is included in union wpa_event_data::remain_on_channel.
|
|
|
|
*/
|
|
|
|
EVENT_REMAIN_ON_CHANNEL,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* EVENT_CANCEL_REMAIN_ON_CHANNEL - Remain-on-channel timed out
|
|
|
|
*
|
|
|
|
* This event is used to indicate when the driver has completed
|
|
|
|
* remain-on-channel duration, i.e., may noot be available on the
|
|
|
|
* requested channel anymore. Information about the
|
|
|
|
* operation is included in union wpa_event_data::remain_on_channel.
|
|
|
|
*/
|
|
|
|
EVENT_CANCEL_REMAIN_ON_CHANNEL,
|
|
|
|
|
2010-01-03 04:50:26 -05:00
|
|
|
/**
|
|
|
|
* EVENT_MLME_RX - Report reception of frame for MLME (test use only)
|
|
|
|
*
|
|
|
|
* This event is used only by driver_test.c and userspace MLME.
|
|
|
|
*/
|
2010-01-03 05:11:44 -05:00
|
|
|
EVENT_MLME_RX,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* EVENT_RX_PROBE_REQ - Indicate received Probe Request frame
|
|
|
|
*
|
|
|
|
* This event is used to indicate when a Probe Request frame has been
|
|
|
|
* received. Information about the received frame is included in
|
2010-01-03 06:30:22 -05:00
|
|
|
* union wpa_event_data::rx_probe_req. The driver is required to report
|
|
|
|
* these events only after successfully completed probe_req_report()
|
|
|
|
* commands to request the events (i.e., report parameter is non-zero)
|
|
|
|
* in station mode. In AP mode, Probe Request frames should always be
|
|
|
|
* reported.
|
2010-01-03 05:11:44 -05:00
|
|
|
*/
|
2010-01-03 09:46:18 -05:00
|
|
|
EVENT_RX_PROBE_REQ,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* EVENT_NEW_STA - New wired device noticed
|
|
|
|
*
|
|
|
|
* This event is used to indicate that a new device has been detected
|
|
|
|
* in a network that does not use association-like functionality (i.e.,
|
|
|
|
* mainly wired Ethernet). This can be used to start EAPOL
|
|
|
|
* authenticator when receiving a frame from a device. The address of
|
|
|
|
* the device is included in union wpa_event_data::new_sta.
|
|
|
|
*/
|
2010-01-03 10:44:40 -05:00
|
|
|
EVENT_NEW_STA,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* EVENT_EAPOL_RX - Report received EAPOL frame
|
|
|
|
*
|
|
|
|
* When in AP mode with hostapd, this event is required to be used to
|
|
|
|
* deliver the receive EAPOL frames from the driver. With
|
|
|
|
* %wpa_supplicant, this event is used only if the send_eapol() handler
|
|
|
|
* is used to override the use of l2_packet for EAPOL frame TX.
|
|
|
|
*/
|
|
|
|
EVENT_EAPOL_RX
|
2010-01-03 06:10:12 -05:00
|
|
|
};
|
2008-02-27 20:34:43 -05:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* union wpa_event_data - Additional data for wpa_supplicant_event() calls
|
|
|
|
*/
|
|
|
|
union wpa_event_data {
|
|
|
|
/**
|
|
|
|
* struct assoc_info - Data for EVENT_ASSOC and EVENT_ASSOCINFO events
|
|
|
|
*
|
|
|
|
* This structure is optional for EVENT_ASSOC calls and required for
|
|
|
|
* EVENT_ASSOCINFO calls. By using EVENT_ASSOC with this data, the
|
|
|
|
* driver interface does not need to generate separate EVENT_ASSOCINFO
|
|
|
|
* calls.
|
|
|
|
*/
|
|
|
|
struct assoc_info {
|
|
|
|
/**
|
|
|
|
* req_ies - (Re)Association Request IEs
|
|
|
|
*
|
|
|
|
* If the driver generates WPA/RSN IE, this event data must be
|
|
|
|
* returned for WPA handshake to have needed information. If
|
|
|
|
* wpa_supplicant-generated WPA/RSN IE is used, this
|
|
|
|
* information event is optional.
|
|
|
|
*
|
|
|
|
* This should start with the first IE (fixed fields before IEs
|
|
|
|
* are not included).
|
|
|
|
*/
|
|
|
|
u8 *req_ies;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* req_ies_len - Length of req_ies in bytes
|
|
|
|
*/
|
|
|
|
size_t req_ies_len;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* resp_ies - (Re)Association Response IEs
|
|
|
|
*
|
|
|
|
* Optional association data from the driver. This data is not
|
|
|
|
* required WPA, but may be useful for some protocols and as
|
|
|
|
* such, should be reported if this is available to the driver
|
|
|
|
* interface.
|
|
|
|
*
|
|
|
|
* This should start with the first IE (fixed fields before IEs
|
|
|
|
* are not included).
|
|
|
|
*/
|
|
|
|
u8 *resp_ies;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* resp_ies_len - Length of resp_ies in bytes
|
|
|
|
*/
|
|
|
|
size_t resp_ies_len;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* beacon_ies - Beacon or Probe Response IEs
|
|
|
|
*
|
|
|
|
* Optional Beacon/ProbeResp data: IEs included in Beacon or
|
|
|
|
* Probe Response frames from the current AP (i.e., the one
|
|
|
|
* that the client just associated with). This information is
|
|
|
|
* used to update WPA/RSN IE for the AP. If this field is not
|
|
|
|
* set, the results from previous scan will be used. If no
|
|
|
|
* data for the new AP is found, scan results will be requested
|
|
|
|
* again (without scan request). At this point, the driver is
|
|
|
|
* expected to provide WPA/RSN IE for the AP (if WPA/WPA2 is
|
|
|
|
* used).
|
|
|
|
*
|
|
|
|
* This should start with the first IE (fixed fields before IEs
|
|
|
|
* are not included).
|
|
|
|
*/
|
|
|
|
u8 *beacon_ies;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* beacon_ies_len - Length of beacon_ies */
|
|
|
|
size_t beacon_ies_len;
|
2009-12-28 06:23:13 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* freq - Frequency of the operational channel in MHz
|
|
|
|
*/
|
|
|
|
unsigned int freq;
|
2008-02-27 20:34:43 -05:00
|
|
|
} assoc_info;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct michael_mic_failure - Data for EVENT_MICHAEL_MIC_FAILURE
|
|
|
|
*/
|
|
|
|
struct michael_mic_failure {
|
|
|
|
int unicast;
|
2009-04-16 09:22:40 -04:00
|
|
|
const u8 *src;
|
2008-02-27 20:34:43 -05:00
|
|
|
} michael_mic_failure;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct interface_status - Data for EVENT_INTERFACE_STATUS
|
|
|
|
*/
|
|
|
|
struct interface_status {
|
|
|
|
char ifname[100];
|
|
|
|
enum {
|
|
|
|
EVENT_INTERFACE_ADDED, EVENT_INTERFACE_REMOVED
|
|
|
|
} ievent;
|
|
|
|
} interface_status;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct pmkid_candidate - Data for EVENT_PMKID_CANDIDATE
|
|
|
|
*/
|
|
|
|
struct pmkid_candidate {
|
|
|
|
/** BSSID of the PMKID candidate */
|
|
|
|
u8 bssid[ETH_ALEN];
|
|
|
|
/** Smaller the index, higher the priority */
|
|
|
|
int index;
|
|
|
|
/** Whether RSN IE includes pre-authenticate flag */
|
|
|
|
int preauth;
|
|
|
|
} pmkid_candidate;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct stkstart - Data for EVENT_STKSTART
|
|
|
|
*/
|
|
|
|
struct stkstart {
|
|
|
|
u8 peer[ETH_ALEN];
|
|
|
|
} stkstart;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct ft_ies - FT information elements (EVENT_FT_RESPONSE)
|
|
|
|
*
|
|
|
|
* During FT (IEEE 802.11r) authentication sequence, the driver is
|
|
|
|
* expected to use this event to report received FT IEs (MDIE, FTIE,
|
|
|
|
* RSN IE, TIE, possible resource request) to the supplicant. The FT
|
|
|
|
* IEs for the next message will be delivered through the
|
|
|
|
* struct wpa_driver_ops::update_ft_ies() callback.
|
|
|
|
*/
|
|
|
|
struct ft_ies {
|
|
|
|
const u8 *ies;
|
|
|
|
size_t ies_len;
|
|
|
|
int ft_action;
|
|
|
|
u8 target_ap[ETH_ALEN];
|
2009-03-09 14:45:17 -04:00
|
|
|
/** Optional IE(s), e.g., WMM TSPEC(s), for RIC-Request */
|
|
|
|
const u8 *ric_ies;
|
|
|
|
/** Length of ric_ies buffer in octets */
|
|
|
|
size_t ric_ies_len;
|
2008-02-27 20:34:43 -05:00
|
|
|
} ft_ies;
|
2009-01-14 18:21:55 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* struct ibss_rsn_start - Data for EVENT_IBSS_RSN_START
|
|
|
|
*/
|
|
|
|
struct ibss_rsn_start {
|
|
|
|
u8 peer[ETH_ALEN];
|
|
|
|
} ibss_rsn_start;
|
2009-03-20 16:26:41 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* struct auth_info - Data for EVENT_AUTH events
|
|
|
|
*/
|
|
|
|
struct auth_info {
|
|
|
|
u8 peer[ETH_ALEN];
|
|
|
|
u16 auth_type;
|
|
|
|
u16 status_code;
|
|
|
|
const u8 *ies;
|
|
|
|
size_t ies_len;
|
|
|
|
} auth;
|
2009-04-01 10:10:36 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* struct assoc_reject - Data for EVENT_ASSOC_REJECT events
|
|
|
|
*/
|
|
|
|
struct assoc_reject {
|
|
|
|
/**
|
|
|
|
* resp_ies - (Re)Association Response IEs
|
|
|
|
*
|
|
|
|
* Optional association data from the driver. This data is not
|
|
|
|
* required WPA, but may be useful for some protocols and as
|
|
|
|
* such, should be reported if this is available to the driver
|
|
|
|
* interface.
|
|
|
|
*
|
|
|
|
* This should start with the first IE (fixed fields before IEs
|
|
|
|
* are not included).
|
|
|
|
*/
|
|
|
|
u8 *resp_ies;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* resp_ies_len - Length of resp_ies in bytes
|
|
|
|
*/
|
|
|
|
size_t resp_ies_len;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* status_code - Status Code from (Re)association Response
|
|
|
|
*/
|
|
|
|
u16 status_code;
|
|
|
|
} assoc_reject;
|
2009-04-23 17:08:24 -04:00
|
|
|
|
|
|
|
struct timeout_event {
|
|
|
|
u8 addr[ETH_ALEN];
|
|
|
|
} timeout_event;
|
2009-12-12 15:43:26 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* struct ft_rrb_rx - Data for EVENT_FT_RRB_RX events
|
|
|
|
*/
|
|
|
|
struct ft_rrb_rx {
|
|
|
|
const u8 *src;
|
|
|
|
const u8 *data;
|
|
|
|
size_t data_len;
|
|
|
|
} ft_rrb_rx;
|
2009-12-13 16:05:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* struct tx_status - Data for EVENT_TX_STATUS events
|
|
|
|
*/
|
|
|
|
struct tx_status {
|
|
|
|
u16 type;
|
|
|
|
u16 stype;
|
|
|
|
const u8 *dst;
|
|
|
|
const u8 *data;
|
|
|
|
size_t data_len;
|
|
|
|
int ack;
|
|
|
|
} tx_status;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct rx_from_unknown - Data for EVENT_RX_FROM_UNKNOWN events
|
|
|
|
*/
|
|
|
|
struct rx_from_unknown {
|
2010-01-03 05:17:20 -05:00
|
|
|
const u8 *frame;
|
2009-12-13 16:05:39 -05:00
|
|
|
size_t len;
|
|
|
|
} rx_from_unknown;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct rx_mgmt - Data for EVENT_RX_MGMT events
|
|
|
|
*/
|
|
|
|
struct rx_mgmt {
|
2009-12-13 16:25:30 -05:00
|
|
|
const u8 *frame;
|
2009-12-13 16:05:39 -05:00
|
|
|
size_t frame_len;
|
2010-01-03 05:37:02 -05:00
|
|
|
u32 datarate;
|
|
|
|
u32 ssi_signal;
|
2009-12-13 16:05:39 -05:00
|
|
|
} rx_mgmt;
|
2010-01-02 06:57:44 -05:00
|
|
|
|
2010-01-03 06:57:51 -05:00
|
|
|
/**
|
|
|
|
* struct rx_action - Data for EVENT_RX_ACTION events
|
|
|
|
*/
|
|
|
|
struct rx_action {
|
|
|
|
/**
|
|
|
|
* sa - Source address of the received Action frame
|
|
|
|
*/
|
|
|
|
const u8 *sa;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* category - Action frame category
|
|
|
|
*/
|
|
|
|
u8 category;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* data - Action frame body after category field
|
|
|
|
*/
|
|
|
|
const u8 *data;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* len - Length of data in octets
|
|
|
|
*/
|
|
|
|
size_t len;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* freq - Frequency (in MHz) on which the frame was received
|
|
|
|
*/
|
|
|
|
int freq;
|
|
|
|
} rx_action;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct remain_on_channel - Data for EVENT_REMAIN_ON_CHANNEL events
|
|
|
|
*
|
|
|
|
* This is also used with EVENT_CANCEL_REMAIN_ON_CHANNEL events.
|
|
|
|
*/
|
|
|
|
struct remain_on_channel {
|
|
|
|
/**
|
|
|
|
* freq - Channel frequency in MHz
|
|
|
|
*/
|
|
|
|
unsigned int freq;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* duration - Duration to remain on the channel in milliseconds
|
|
|
|
*/
|
|
|
|
unsigned int duration;
|
|
|
|
} remain_on_channel;
|
|
|
|
|
2010-01-02 06:57:44 -05:00
|
|
|
/**
|
|
|
|
* struct scan_info - Optional data for EVENT_SCAN_RESULTS events
|
|
|
|
* @aborted: Whether the scan was aborted
|
|
|
|
* @freqs: Scanned frequencies in MHz (%NULL = all channels scanned)
|
|
|
|
* @num_freqs: Number of entries in freqs array
|
|
|
|
* @ssids: Scanned SSIDs (%NULL or zero-length SSID indicates wildcard
|
|
|
|
* SSID)
|
|
|
|
* @num_ssids: Number of entries in ssids array
|
|
|
|
*/
|
|
|
|
struct scan_info {
|
|
|
|
int aborted;
|
|
|
|
const int *freqs;
|
|
|
|
size_t num_freqs;
|
|
|
|
struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS];
|
|
|
|
size_t num_ssids;
|
|
|
|
} scan_info;
|
2010-01-03 04:50:26 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* struct mlme_rx - Data for EVENT_MLME_RX events
|
|
|
|
*/
|
|
|
|
struct mlme_rx {
|
|
|
|
const u8 *buf;
|
|
|
|
size_t len;
|
|
|
|
int freq;
|
|
|
|
int channel;
|
|
|
|
int ssi;
|
|
|
|
} mlme_rx;
|
2010-01-03 05:11:44 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* struct rx_probe_req - Data for EVENT_RX_PROBE_REQ events
|
|
|
|
*/
|
|
|
|
struct rx_probe_req {
|
|
|
|
/**
|
|
|
|
* sa - Source address of the received Probe Request frame
|
|
|
|
*/
|
|
|
|
const u8 *sa;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ie - IEs from the Probe Request body
|
|
|
|
*/
|
|
|
|
const u8 *ie;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ie_len - Length of ie buffer in octets
|
|
|
|
*/
|
|
|
|
size_t ie_len;
|
|
|
|
} rx_probe_req;
|
2010-01-03 09:46:18 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* struct new_sta - Data for EVENT_NEW_STA events
|
|
|
|
*/
|
|
|
|
struct new_sta {
|
|
|
|
const u8 *addr;
|
|
|
|
} new_sta;
|
2010-01-03 10:44:40 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* struct eapol_rx - Data for EVENT_EAPOL_RX events
|
|
|
|
*/
|
|
|
|
struct eapol_rx {
|
|
|
|
const u8 *src;
|
|
|
|
const u8 *data;
|
|
|
|
size_t data_len;
|
|
|
|
} eapol_rx;
|
2008-02-27 20:34:43 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* wpa_supplicant_event - Report a driver event for wpa_supplicant
|
|
|
|
* @ctx: Context pointer (wpa_s); this is the ctx variable registered
|
|
|
|
* with struct wpa_driver_ops::init()
|
|
|
|
* @event: event type (defined above)
|
|
|
|
* @data: possible extra data for the event
|
|
|
|
*
|
|
|
|
* Driver wrapper code should call this function whenever an event is received
|
|
|
|
* from the driver.
|
|
|
|
*/
|
2010-01-03 06:10:12 -05:00
|
|
|
void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
|
2008-02-27 20:34:43 -05:00
|
|
|
union wpa_event_data *data);
|
|
|
|
|
|
|
|
const u8 * wpa_scan_get_ie(const struct wpa_scan_res *res, u8 ie);
|
|
|
|
const u8 * wpa_scan_get_vendor_ie(const struct wpa_scan_res *res,
|
|
|
|
u32 vendor_type);
|
2008-11-29 15:06:34 -05:00
|
|
|
struct wpabuf * wpa_scan_get_vendor_ie_multi(const struct wpa_scan_res *res,
|
|
|
|
u32 vendor_type);
|
2008-02-27 20:34:43 -05:00
|
|
|
int wpa_scan_get_max_rate(const struct wpa_scan_res *res);
|
|
|
|
void wpa_scan_results_free(struct wpa_scan_results *res);
|
|
|
|
void wpa_scan_sort_results(struct wpa_scan_results *res);
|
|
|
|
|
2009-04-09 06:40:12 -04:00
|
|
|
/* hostapd functions for driver wrappers */
|
|
|
|
|
|
|
|
int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
|
|
|
|
const u8 *ie, size_t ielen);
|
|
|
|
void hostapd_notif_disassoc(struct hostapd_data *hapd, const u8 *addr);
|
|
|
|
|
2008-02-27 20:34:43 -05:00
|
|
|
#endif /* DRIVER_H */
|