Public Attributes
wpa_driver_ops Struct Reference

#include <driver.h>

List of all members.

Public Attributes

int(* add_pmkid )(void *priv, const u8 *bssid, const u8 *pmkid)
int(* associate )(void *priv, struct wpa_driver_associate_params *params)
int(* authenticate )(void *priv, struct wpa_driver_auth_params *params)
int(* cancel_remain_on_channel )(void *priv)
int(* commit )(void *priv)
int(* deauthenticate )(void *priv, const u8 *addr, int reason_code)
void(* deinit )(void *priv)
int(* deinit_ap )(void *priv)
const char * desc
int(* disable_11b_rates )(void *priv, int disabled)
int(* disassociate )(void *priv, const u8 *addr, int reason_code)
int(* flush )(void *priv)
int(* flush_pmkid )(void *priv)
int(* get_bssid )(void *priv, u8 *bssid)
int(* get_capa )(void *priv, struct wpa_driver_capa *capa)
struct hostapd_hw_modes *(* get_hw_feature_data )(void *priv, u16 *num_modes, u16 *flags)
const char *(* get_ifname )(void *priv)
int(* get_inact_sec )(void *priv, const u8 *addr)
struct wpa_interface_info *(* get_interfaces )(void *global_priv)
const u8 *(* get_mac_addr )(void *priv)
struct wpa_scan_results *(* get_scan_results2 )(void *priv)
int(* get_seqnum )(const char *ifname, void *priv, const u8 *addr, int idx, u8 *seq)
int(* get_ssid )(void *priv, u8 *ssid)
void(* global_deinit )(void *priv)
void *(* global_init )(void)
void(* hapd_deinit )(void *priv)
int(* hapd_get_ssid )(void *priv, u8 *buf, int len)
void *(* hapd_init )(struct hostapd_data *hapd, struct wpa_init_params *params)
int(* hapd_send_eapol )(void *priv, const u8 *addr, const u8 *data, size_t data_len, int encrypt, const u8 *own_addr)
int(* hapd_set_countermeasures )(void *priv, int enabled)
int(* hapd_set_ssid )(void *priv, const u8 *buf, int len)
int(* if_add )(void *priv, enum wpa_driver_if_type type, const char *ifname, const u8 *addr, void *bss_ctx, void **drv_priv, char *force_ifname, u8 *if_addr)
int(* if_remove )(void *priv, enum wpa_driver_if_type type, const char *ifname)
void *(* init )(void *ctx, const char *ifname)
void *(* init2 )(void *ctx, const char *ifname, void *global_priv)
int(* mlme_add_sta )(void *priv, const u8 *addr, const u8 *supp_rates, size_t supp_rates_len)
int(* mlme_remove_sta )(void *priv, const u8 *addr)
int(* mlme_setprotection )(void *priv, const u8 *addr, int protect_type, int key_type)
const char * name
void(* poll )(void *priv)
int(* probe_req_report )(void *priv, int report)
int(* read_sta_data )(void *priv, struct hostap_sta_driver_data *data, const u8 *addr)
int(* remain_on_channel )(void *priv, unsigned int freq, unsigned int duration)
int(* remove_pmkid )(void *priv, const u8 *bssid, const u8 *pmkid)
void(* resume )(void *priv)
int(* scan2 )(void *priv, struct wpa_driver_scan_params *params)
int(* send_action )(void *priv, unsigned int freq, const u8 *dst, const u8 *src, const u8 *bssid, const u8 *data, size_t data_len)
int(* send_eapol )(void *priv, const u8 *dest, u16 proto, const u8 *data, size_t data_len)
int(* send_ether )(void *priv, const u8 *dst, const u8 *src, u16 proto, const u8 *data, size_t data_len)
int(* send_frame )(void *priv, const u8 *data, size_t data_len, int encrypt)
int(* send_ft_action )(void *priv, u8 action, const u8 *target_ap, const u8 *ies, size_t ies_len)
int(* send_mlme )(void *priv, const u8 *data, size_t data_len)
int(* set_ap_wps_ie )(void *priv, const struct wpabuf *beacon, const struct wpabuf *proberesp)
int(* set_beacon )(void *priv, const u8 *head, size_t head_len, const u8 *tail, size_t tail_len, int dtim_period, int beacon_int)
int(* set_bssid )(void *priv, const u8 *bssid)
int(* set_channel )(void *priv, enum hostapd_hw_mode phymode, int chan, int freq)
int(* set_countermeasures )(void *priv, int enabled)
int(* set_country )(void *priv, const char *alpha2)
int(* set_cts_protect )(void *priv, int value)
int(* set_frag )(void *priv, int frag)
int(* set_freq )(void *priv, struct hostapd_freq_params *freq)
int(* set_generic_elem )(void *priv, const u8 *elem, size_t elem_len)
int(* set_ht_params )(void *priv, const u8 *ht_capab, size_t ht_capab_len, const u8 *ht_oper, size_t ht_oper_len)
int(* set_ieee8021x )(void *priv, struct wpa_bss_params *params)
int(* set_key )(const char *ifname, void *priv, enum wpa_alg alg, const u8 *addr, int key_idx, int set_tx, const u8 *seq, size_t seq_len, const u8 *key, size_t key_len)
int(* set_operstate )(void *priv, int state)
int(* set_param )(void *priv, const char *param)
int(* set_preamble )(void *priv, int value)
int(* set_privacy )(void *priv, int enabled)
int(* set_radius_acl_auth )(void *priv, const u8 *mac, int accepted, u32 session_timeout)
int(* set_radius_acl_expire )(void *priv, const u8 *mac)
int(* set_rate_sets )(void *priv, int *supp_rates, int *basic_rates, int mode)
int(* set_rts )(void *priv, int rts)
int(* set_short_slot_time )(void *priv, int value)
int(* set_ssid )(void *priv, const u8 *ssid, size_t ssid_len)
int(* set_sta_vlan )(void *priv, const u8 *addr, const char *ifname, int vlan_id)
int(* set_supp_port )(void *priv, int authorized)
int(* set_tx_queue_params )(void *priv, int queue, int aifs, int cw_min, int cw_max, int burst_time)
int(* set_wds_sta )(void *priv, const u8 *addr, int aid, int val)
int(* signal_monitor )(void *priv, int threshold, int hysteresis)
int(* sta_add )(void *priv, struct hostapd_sta_add_params *params)
int(* sta_clear_stats )(void *priv, const u8 *addr)
int(* sta_deauth )(void *priv, const u8 *own_addr, const u8 *addr, int reason)
int(* sta_disassoc )(void *priv, const u8 *own_addr, const u8 *addr, int reason)
int(* sta_remove )(void *priv, const u8 *addr)
int(* sta_set_flags )(void *priv, const u8 *addr, int total_flags, int flags_or, int flags_and)
void(* suspend )(void *priv)
int(* update_ft_ies )(void *priv, const u8 *md, const u8 *ies, size_t ies_len)
int(* valid_bss_mask )(void *priv, const u8 *addr, const u8 *mask)

Detailed Description

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.

Definition at line 614 of file driver.h.


Member Data Documentation

int(* wpa_driver_ops::add_pmkid)(void *priv, const u8 *bssid, const u8 *pmkid)

add_pmkid - Add PMKSA cache entry to the driver : private driver interface data : BSSID for the PMKSA cache entry : 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.

Definition at line 806 of file driver.h.

int(* wpa_driver_ops::associate)(void *priv, struct wpa_driver_associate_params *params)

associate - Request driver to associate : private driver interface data : association parameters

Returns: 0 on success, -1 on failure

Definition at line 786 of file driver.h.

int(* wpa_driver_ops::authenticate)(void *priv, struct wpa_driver_auth_params *params)

authenticate - Request driver to authenticate : private driver interface data : 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.

Definition at line 1165 of file driver.h.

cancel_remain_on_channel - Cancel remain-on-channel operation : 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.

Definition at line 1687 of file driver.h.

int(* wpa_driver_ops::commit)(void *priv)

commit - Optional commit changes handler (AP only) : 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.

Definition at line 1548 of file driver.h.

int(* wpa_driver_ops::deauthenticate)(void *priv, const u8 *addr, int reason_code)

deauthenticate - Request driver to deauthenticate : private driver interface data : peer address (BSSID of the AP) : 16-bit reason code to be sent in the deauthentication frame

Returns: 0 on success, -1 on failure

Definition at line 766 of file driver.h.

void(* wpa_driver_ops::deinit)(void *priv)

deinit - Deinitialize driver interface : 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.

Definition at line 731 of file driver.h.

int(* wpa_driver_ops::deinit_ap)(void *priv)

deinit_ap - Deinitialize AP mode : Private driver interface data Returns: 0 on success, -1 on failure (or if not supported)

This optional function can be used to disable AP mode related configuration and change the driver mode to station mode to allow normal station operations like scanning to be completed.

Definition at line 1727 of file driver.h.

const char* wpa_driver_ops::desc

One line description of the driver interface

Definition at line 618 of file driver.h.

int(* wpa_driver_ops::disable_11b_rates)(void *priv, int disabled)

disable_11b_rates - Set whether IEEE 802.11b rates are used for TX : Private driver interface data : Whether IEEE 802.11b rates are disabled Returns: 0 on success, -1 on failure (or if not supported)

This command is used to disable IEEE 802.11b rates (1, 2, 5.5, and 11 Mbps) as TX rates for data and management frames. This can be used to optimize channel use when there is no need to support IEEE 802.11b-only devices.

Definition at line 1716 of file driver.h.

int(* wpa_driver_ops::disassociate)(void *priv, const u8 *addr, int reason_code)

disassociate - Request driver to disassociate : private driver interface data : peer address (BSSID of the AP) : 16-bit reason code to be sent in the disassociation frame

Returns: 0 on success, -1 on failure

Definition at line 777 of file driver.h.

int(* wpa_driver_ops::flush)(void *priv)

flush - Flush all association stations (AP only) : 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.

Definition at line 1258 of file driver.h.

int(* wpa_driver_ops::flush_pmkid)(void *priv)

flush_pmkid - Flush PMKSA cache : 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.

Definition at line 844 of file driver.h.

int(* wpa_driver_ops::get_bssid)(void *priv, u8 *bssid)

get_bssid - Get the current BSSID : private driver interface data : 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.

Definition at line 631 of file driver.h.

int(* wpa_driver_ops::get_capa)(void *priv, struct wpa_driver_capa *capa)

get_capa - Get driver capabilities : private driver interface data

Returns: 0 on success, -1 on failure

Get driver/firmware/hardware capabilities.

Definition at line 854 of file driver.h.

struct hostapd_hw_modes*(* wpa_driver_ops::get_hw_feature_data)(void *priv, u16 *num_modes, u16 *flags) [read]

get_hw_feature_data - Get hardware support data (channels and rates) : Private driver interface data : 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 or hostapd.

Definition at line 960 of file driver.h.

const char*(* wpa_driver_ops::get_ifname)(void *priv)

get_ifname - Get interface name : private driver interface data

Returns: Pointer to the interface name. This can differ from the interface name used in init() call. Init() is called first.

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.

Definition at line 881 of file driver.h.

int(* wpa_driver_ops::get_inact_sec)(void *priv, const u8 *addr)

get_inact_sec - Get station inactivity duration (AP only) : Private driver interface data : Station address Returns: Number of seconds station has been inactive, -1 on failure

Definition at line 1386 of file driver.h.

struct wpa_interface_info*(* wpa_driver_ops::get_interfaces)(void *global_priv) [read]

get_interfaces - Get information about available interfaces : 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

Definition at line 1138 of file driver.h.

const u8*(* wpa_driver_ops::get_mac_addr)(void *priv)

get_mac_addr - Get own MAC address : 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.

Definition at line 893 of file driver.h.

struct wpa_scan_results*(* wpa_driver_ops::get_scan_results2)(void *priv) [read]

get_scan_results2 - Fetch the latest scan results : private driver interface data

Returns: Allocated buffer of scan results (caller is responsible for freeing the data structure) on success, NULL on failure

Definition at line 1083 of file driver.h.

int(* wpa_driver_ops::get_seqnum)(const char *ifname, void *priv, const u8 *addr, int idx, u8 *seq)

get_seqnum - Fetch the current TSC/packet number (AP only) : The interface name (main or virtual) : Private driver interface data : MAC address of the station or NULL for group keys : Key index : 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 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).

Definition at line 1246 of file driver.h.

int(* wpa_driver_ops::get_ssid)(void *priv, u8 *ssid)

get_ssid - Get the current SSID : private driver interface data : 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.

Definition at line 648 of file driver.h.

void(* wpa_driver_ops::global_deinit)(void *priv)

global_deinit - Global driver deinitialization : private driver global data from global_init()

Terminate any global driver related functionality and free the global data structure.

Definition at line 1116 of file driver.h.

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.

Definition at line 1107 of file driver.h.

void(* wpa_driver_ops::hapd_deinit)(void *priv)

hapd_deinit - Deinitialize driver interface (hostapd only) : Private driver interface data from hapd_init()

Definition at line 1204 of file driver.h.

int(* wpa_driver_ops::hapd_get_ssid)(void *priv, u8 *buf, int len)

hapd_get_ssid - Get the current SSID (AP only) : Private driver interface data : Buffer for returning the SSID : 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.

Definition at line 1346 of file driver.h.

void*(* wpa_driver_ops::hapd_init)(struct hostapd_data *hapd, struct wpa_init_params *params)

hapd_init - Initialize driver interface (hostapd only) : Pointer to hostapd context : 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.

Definition at line 1197 of file driver.h.

int(* wpa_driver_ops::hapd_send_eapol)(void *priv, const u8 *addr, const u8 *data, size_t data_len, int encrypt, const u8 *own_addr)

hapd_send_eapol - Send an EAPOL packet (AP only) : private driver interface data : Destination MAC address : EAPOL packet starting with IEEE 802.1X header : Length of the EAPOL packet in octets : Whether the frame should be encrypted : Source MAC address

Returns: 0 on success, -1 on failure

Definition at line 1295 of file driver.h.

int(* wpa_driver_ops::hapd_set_countermeasures)(void *priv, int enabled)

hapd_set_countermeasures - Enable/disable TKIP countermeasures (AP) : Private driver interface data : 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.

Definition at line 1366 of file driver.h.

int(* wpa_driver_ops::hapd_set_ssid)(void *priv, const u8 *buf, int len)

hapd_set_ssid - Set SSID (AP only) : Private driver interface data : SSID : Length of the SSID in octets Returns: 0 on success, -1 on failure

Definition at line 1355 of file driver.h.

int(* wpa_driver_ops::if_add)(void *priv, enum wpa_driver_if_type type, const char *ifname, const u8 *addr, void *bss_ctx, void **drv_priv, char *force_ifname, u8 *if_addr)

if_add - Add a virtual interface : Private driver interface data : Interface type : Interface name for the new virtual interface : Local address to use for the interface or NULL to use the parent interface address : BSS context for WPA_IF_AP_BSS interfaces : Pointer for overwriting the driver context or NULL if not allowed (applies only to WPA_IF_AP_BSS type) : Buffer for returning an interface name that the driver ended up using if it differs from the requested ifname : Buffer for returning the allocated interface address (this may differ from the requested addr if the driver cannot change interface address) Returns: 0 on success, -1 on failure

Definition at line 1507 of file driver.h.

int(* wpa_driver_ops::if_remove)(void *priv, enum wpa_driver_if_type type, const char *ifname)

if_remove - Remove a virtual interface : Private driver interface data : Interface type : Interface name of the virtual interface to be removed Returns: 0 on success, -1 on failure

Definition at line 1518 of file driver.h.

void*(* wpa_driver_ops::init)(void *ctx, const char *ifname)

init - Initialize driver interface : context to be used when calling wpa_supplicant functions, e.g., wpa_supplicant_event() : 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 , 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.

Definition at line 722 of file driver.h.

void*(* wpa_driver_ops::init2)(void *ctx, const char *ifname, void *global_priv)

init2 - Initialize driver interface (with global data) : context to be used when calling wpa_supplicant functions, e.g., wpa_supplicant_event() : interface name, e.g., wlan0 : 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.

Definition at line 1129 of file driver.h.

int(* wpa_driver_ops::mlme_add_sta)(void *priv, const u8 *addr, const u8 *supp_rates, size_t supp_rates_len)

mlme_add_sta - Add a STA entry into the driver/netstack : Private driver interface data : MAC address of the STA (e.g., BSSID of the AP) : Supported rate set (from (Re)AssocResp); in IEEE 802.11 format (one octet per rate, 1 = 0.5 Mbps) : 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).

Definition at line 1028 of file driver.h.

int(* wpa_driver_ops::mlme_remove_sta)(void *priv, const u8 *addr)

mlme_remove_sta - Remove a STA entry from the driver/netstack : Private driver interface data : 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.

Definition at line 1040 of file driver.h.

int(* wpa_driver_ops::mlme_setprotection)(void *priv, const u8 *addr, int protect_type, int key_type)

mlme_setprotection - MLME-SETPROTECTION.request primitive : Private driver interface data : Address of the station for which to set protection (may be NULL for group keys) : MLME_SETPROTECTION_PROTECT_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.

Definition at line 946 of file driver.h.

const char* wpa_driver_ops::name

Name of the driver interface

Definition at line 616 of file driver.h.

void(* wpa_driver_ops::poll)(void *priv)

poll - Poll driver for association information : 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.

Definition at line 868 of file driver.h.

int(* wpa_driver_ops::probe_req_report)(void *priv, int report)

probe_req_report - Request Probe Request frames to be indicated : Private driver interface data : 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.

Definition at line 1703 of file driver.h.

int(* wpa_driver_ops::read_sta_data)(void *priv, struct hostap_sta_driver_data *data, const u8 *addr)

read_sta_data - Fetch station data (AP only) : Private driver interface data : Buffer for returning station information : MAC address of the station Returns: 0 on success, -1 on failure

Definition at line 1281 of file driver.h.

int(* wpa_driver_ops::remain_on_channel)(void *priv, unsigned int freq, unsigned int duration)

remain_on_channel - Remain awake on a channel : Private driver interface data : Frequency (in MHz) of the channel : 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.

Definition at line 1673 of file driver.h.

int(* wpa_driver_ops::remove_pmkid)(void *priv, const u8 *bssid, const u8 *pmkid)

remove_pmkid - Remove PMKSA cache entry to the driver : private driver interface data : BSSID for the PMKSA cache entry : 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.

Definition at line 826 of file driver.h.

void(* wpa_driver_ops::resume)(void *priv)

resume - Notification on system resume/thaw event : Private driver interface data

Definition at line 1739 of file driver.h.

int(* wpa_driver_ops::scan2)(void *priv, struct wpa_driver_scan_params *params)

scan2 - Request the driver to initiate scan : private driver interface data : 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().

Definition at line 1151 of file driver.h.

int(* wpa_driver_ops::send_action)(void *priv, unsigned int freq, const u8 *dst, const u8 *src, const u8 *bssid, const u8 *data, size_t data_len)

send_action - Transmit an Action frame : Private driver interface data : Frequency (in MHz) of the channel : Destination MAC address (Address 1) : Source MAC address (Address 2) : BSSID (Address 3) : Frame body : 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.

Definition at line 1647 of file driver.h.

int(* wpa_driver_ops::send_eapol)(void *priv, const u8 *dest, u16 proto, const u8 *data, size_t data_len)

send_eapol - Optional function for sending EAPOL packets : private driver interface data : Destination MAC address : Ethertype : EAPOL packet starting with IEEE 802.1X header : 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 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.

Definition at line 913 of file driver.h.

int(* wpa_driver_ops::send_ether)(void *priv, const u8 *dst, const u8 *src, u16 proto, const u8 *data, size_t data_len)

send_ether - Send an ethernet packet (AP only) : private driver interface data : Destination MAC address : Source MAC address : Ethertype : EAPOL packet starting with IEEE 802.1X header : Length of the EAPOL packet in octets Returns: 0 on success, -1 on failure

Definition at line 1560 of file driver.h.

int(* wpa_driver_ops::send_frame)(void *priv, const u8 *data, size_t data_len, int encrypt)

send_frame - Send IEEE 802.11 frame (testing use only) : Private driver interface data : IEEE 802.11 frame with IEEE 802.11 header : Size of the frame : Whether to encrypt the frame (if keys are set) Returns: 0 on success, -1 on failure

This function is only used for debugging purposes and is not required to be implemented for normal operations.

Definition at line 1768 of file driver.h.

int(* wpa_driver_ops::send_ft_action)(void *priv, u8 action, const u8 *target_ap, const u8 *ies, size_t ies_len)

send_ft_action - Send FT Action frame (IEEE 802.11r) : Private driver interface data : Action field value : Target AP address : FT IEs (MDIE, FTIE, ...) (FT Request action frame body) : 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.

Definition at line 1073 of file driver.h.

int(* wpa_driver_ops::send_mlme)(void *priv, const u8 *data, size_t data_len)

send_mlme - Send management frame from MLME : Private driver interface data : IEEE 802.11 management frame with IEEE 802.11 header : 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.

Definition at line 1011 of file driver.h.

int(* wpa_driver_ops::set_ap_wps_ie)(void *priv, const struct wpabuf *beacon, const struct wpabuf *proberesp)

set_ap_wps_ie - Add WPS IE(s) into Beacon/Probe Response frames (AP) : Private driver interface data : WPS IE(s) for Beacon frames or NULL to remove extra IE(s) : WPS IE(s) for Probe Response frames or NULL to remove extra IE(s) Returns: 0 on success, -1 on failure

This is an optional function to add WPS IE 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() and does not process Probe Request frames.

Definition at line 1608 of file driver.h.

int(* wpa_driver_ops::set_beacon)(void *priv, const u8 *head, size_t head_len, const u8 *tail, size_t tail_len, int dtim_period, int beacon_int)

set_beacon - Set Beacon frame template : Private driver interface data : Beacon head from IEEE 802.11 header to IEs before TIM IE : Length of the head buffer in octets : Beacon tail following TIM IE : Length of the tail buffer in octets : DTIM period : 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.

Definition at line 1184 of file driver.h.

int(* wpa_driver_ops::set_bssid)(void *priv, const u8 *bssid)

set_bssid - Set BSSID : Private driver interface data : BSSID Returns: 0 on success, -1 on failure

This function is only needed for drivers that export MLME (management frame processing) to wpa_supplicant.

Definition at line 999 of file driver.h.

int(* wpa_driver_ops::set_channel)(void *priv, enum hostapd_hw_mode phymode, int chan, int freq)

set_channel - Set channel : Private driver interface data : HOSTAPD_MODE_IEEE80211B, .. : IEEE 802.11 channel number : 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.

Definition at line 975 of file driver.h.

int(* wpa_driver_ops::set_countermeasures)(void *priv, int enabled)

set_countermeasures - Enable/disable TKIP countermeasures : private driver interface data : 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.

Definition at line 755 of file driver.h.

int(* wpa_driver_ops::set_country)(void *priv, const char *alpha2)

set_country - Set country : Private driver interface data : 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.

Definition at line 1094 of file driver.h.

int(* wpa_driver_ops::set_cts_protect)(void *priv, int value)

set_cts_protect - Set CTS protection mode (AP only) : Private driver interface data : Whether CTS protection is enabled Returns: 0 on success, -1 on failure

Definition at line 1449 of file driver.h.

int(* wpa_driver_ops::set_frag)(void *priv, int frag)

set_frag - Set fragmentation threshold : Private driver interface data : Fragmentation threshold in octets Returns: 0 on success, -1 on failure

Definition at line 1418 of file driver.h.

int(* wpa_driver_ops::set_freq)(void *priv, struct hostapd_freq_params *freq)

set_freq - Set channel/frequency (AP only) : Private driver interface data : Channel parameters Returns: 0 on success, -1 on failure

Definition at line 1402 of file driver.h.

int(* wpa_driver_ops::set_generic_elem)(void *priv, const u8 *elem, size_t elem_len)

set_generic_elem - Add IEs into Beacon/Probe Response frames (AP) : Private driver interface data : Information elements : 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().

Definition at line 1272 of file driver.h.

int(* wpa_driver_ops::set_ht_params)(void *priv, const u8 *ht_capab, size_t ht_capab_len, const u8 *ht_oper, size_t ht_oper_len)

set_ht_params - Set HT parameters (AP only) : Private driver interface data : HT Capabilities IE : Length of ht_capab in octets : HT Operation IE : Length of ht_oper in octets Returns: 0 on success, -1 on failure

Definition at line 1591 of file driver.h.

int(* wpa_driver_ops::set_ieee8021x)(void *priv, struct wpa_bss_params *params)

set_ieee8021x - Enable/disable IEEE 802.1X support (AP only) : Private driver interface data : BSS parameters Returns: 0 on success, -1 on failure

This is an optional function to configure the kernel driver to 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.

Definition at line 1218 of file driver.h.

int(* wpa_driver_ops::set_key)(const char *ifname, void *priv, enum wpa_alg alg, const u8 *addr, int key_idx, int set_tx, const u8 *seq, size_t seq_len, const u8 *key, size_t key_len)

set_key - Configure encryption key : Interface name (for multi-SSID/VLAN support) : private driver interface data : 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. : address of the peer STA or ff:ff:ff:ff:ff:ff for broadcast/default keys : key index (0..3), usually 0 for unicast keys; 0..4095 for IGTK : configure this key as the default Tx key (only used when driver does not support separate unicast/individual key : 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) : length of the seq, depends on the algorithm: TKIP: 6 octets, CCMP: 6 octets, IGTK: 6 octets : key buffer; TKIP: 16-byte temporal key, 8-byte Tx Mic key, 8-byte Rx Mic Key : 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.

Definition at line 694 of file driver.h.

int(* wpa_driver_ops::set_operstate)(void *priv, int state)

set_operstate - Sets device operating state to DORMANT or UP : private driver interface data : 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.

Definition at line 928 of file driver.h.

int(* wpa_driver_ops::set_param)(void *priv, const char *param)

set_param - Set driver configuration parameters : private driver interface data from init()

Parameters:
driver specific configuration parameters

Returns: 0 on success, -1 on failure

Optional handler for notifying driver interface about configuration parameters (driver_param).

Definition at line 743 of file driver.h.

int(* wpa_driver_ops::set_preamble)(void *priv, int value)

set_preamble - Set preamble mode (AP only) : Private driver interface data : Whether short preamble is enabled Returns: 0 on success, -1 on failure

Definition at line 1457 of file driver.h.

int(* wpa_driver_ops::set_privacy)(void *priv, int enabled)

set_privacy - Enable/disable privacy (AP only) : Private driver interface data : 1 = privacy enabled, 0 = disabled Returns: 0 on success, -1 on failure

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().

Definition at line 1230 of file driver.h.

int(* wpa_driver_ops::set_radius_acl_auth)(void *priv, const u8 *mac, int accepted, u32 session_timeout)

set_radius_acl_auth - Notification of RADIUS ACL change : Private driver interface data : MAC address of the station : Whether the station was accepted : Session timeout for the station Returns: 0 on success, -1 on failure

Definition at line 1571 of file driver.h.

int(* wpa_driver_ops::set_radius_acl_expire)(void *priv, const u8 *mac)

set_radius_acl_expire - Notification of RADIUS ACL expiration : Private driver interface data : MAC address of the station Returns: 0 on success, -1 on failure

Definition at line 1580 of file driver.h.

int(* wpa_driver_ops::set_rate_sets)(void *priv, int *supp_rates, int *basic_rates, int mode)

set_rate_sets - Set supported and basic rate sets (AP only) : Private driver interface data : -1 terminated array of supported rates in 100 kbps : -1 terminated array of basic rates in 100 kbps : hardware mode (HOSTAPD_MODE_*) Returns: 0 on success, -1 on failure

Definition at line 1440 of file driver.h.

int(* wpa_driver_ops::set_rts)(void *priv, int rts)

set_rts - Set RTS threshold : Private driver interface data : RTS threshold in octets Returns: 0 on success, -1 on failure

Definition at line 1410 of file driver.h.

int(* wpa_driver_ops::set_short_slot_time)(void *priv, int value)

set_short_slot_time - Set short slot time (AP only) : Private driver interface data : Whether short slot time is enabled Returns: 0 on success, -1 on failure

Definition at line 1465 of file driver.h.

int(* wpa_driver_ops::set_ssid)(void *priv, const u8 *ssid, size_t ssid_len)

set_ssid - Set SSID : Private driver interface data : SSID : 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.

Definition at line 988 of file driver.h.

int(* wpa_driver_ops::set_sta_vlan)(void *priv, const u8 *addr, const char *ifname, int vlan_id)

set_sta_vlan - Bind a station into a specific interface (AP only) : Private driver interface data : Interface (main or virtual BSS or VLAN) : MAC address of the associated station : 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.

Definition at line 1535 of file driver.h.

int(* wpa_driver_ops::set_supp_port)(void *priv, int authorized)

set_supp_port - Set IEEE 802.1X Supplicant Port status : Private driver interface data : Whether the port is authorized Returns: 0 on success, -1 on failure

Definition at line 1617 of file driver.h.

int(* wpa_driver_ops::set_tx_queue_params)(void *priv, int queue, int aifs, int cw_min, int cw_max, int burst_time)

set_tx_queue_params - Set TX queue parameters : Private driver interface data : Queue number : AIFS : cwMin : cwMax : Maximum length for bursting in 0.1 msec units

Definition at line 1476 of file driver.h.

int(* wpa_driver_ops::set_wds_sta)(void *priv, const u8 *addr, int aid, int val)

set_wds_sta - Bind a station into a 4-address WDS (AP only) : Private driver interface data : MAC address of the associated station : Association ID : 1 = bind to 4-address WDS; 0 = unbind Returns: 0 on success, -1 on failure

Definition at line 1627 of file driver.h.

int(* wpa_driver_ops::signal_monitor)(void *priv, int threshold, int hysteresis)

signal_monitor - Set signal monitoring parameters : Private driver interface data : Threshold value for signal change events; 0 = disabled : Minimum change in signal strength before indicating a new event Returns: 0 on success, -1 on failure (or if not supported)

This function can be used to configure monitoring of signal strength with the current AP. Whenever signal strength drops below the threshold value or increases above it, EVENT_SIGNAL_CHANGE event should be generated assuming the signal strength has changed at least hysteresis from the previously indicated signal change event.

Definition at line 1755 of file driver.h.

int(* wpa_driver_ops::sta_add)(void *priv, struct hostapd_sta_add_params *params)

sta_add - Add a station entry : Private driver interface data : 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.

Definition at line 1378 of file driver.h.

int(* wpa_driver_ops::sta_clear_stats)(void *priv, const u8 *addr)

sta_clear_stats - Clear station statistics (AP only) : Private driver interface data : Station address Returns: 0 on success, -1 on failure

Definition at line 1394 of file driver.h.

int(* wpa_driver_ops::sta_deauth)(void *priv, const u8 *own_addr, const u8 *addr, int reason)

sta_deauth - Deauthenticate a station (AP only) : Private driver interface data : Source address and BSSID for the Deauthentication frame : MAC address of the station to deauthenticate : 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.

Definition at line 1310 of file driver.h.

int(* wpa_driver_ops::sta_disassoc)(void *priv, const u8 *own_addr, const u8 *addr, int reason)

sta_disassoc - Disassociate a station (AP only) : Private driver interface data : Source address and BSSID for the Disassociation frame : MAC address of the station to disassociate : 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.

Definition at line 1324 of file driver.h.

int(* wpa_driver_ops::sta_remove)(void *priv, const u8 *addr)

sta_remove - Remove a station entry (AP only) : Private driver interface data : MAC address of the station to be removed Returns: 0 on success, -1 on failure

Definition at line 1333 of file driver.h.

int(* wpa_driver_ops::sta_set_flags)(void *priv, const u8 *addr, int total_flags, int flags_or, int flags_and)

sta_set_flags - Set station flags (AP only) : Private driver interface data : Station address : Bitmap of all WPA_STA_* flags currently set : Bitmap of WPA_STA_* flags to add : Bitmap of WPA_STA_* flags to us as a mask Returns: 0 on success, -1 on failure

Definition at line 1429 of file driver.h.

void(* wpa_driver_ops::suspend)(void *priv)

suspend - Notification on system suspend/hibernate event : Private driver interface data

Definition at line 1733 of file driver.h.

int(* wpa_driver_ops::update_ft_ies)(void *priv, const u8 *md, const u8 *ies, size_t ies_len)

update_ft_ies - Update FT (IEEE 802.11r) IEs : Private driver interface data : Mobility domain (2 octets) (also included inside ies) : FT IEs (MDIE, FTIE, ...) or NULL to remove IEs : 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).

Definition at line 1057 of file driver.h.

int(* wpa_driver_ops::valid_bss_mask)(void *priv, const u8 *addr, const u8 *mask)

valid_bss_mask - Validate BSSID mask : Private driver interface data : Address : 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

Definition at line 1488 of file driver.h.


The documentation for this struct was generated from the following file:


wpa_supplicant_node
Author(s): Package maintained by Blaise Gassend
autogenerated on Thu Apr 24 2014 15:33:26