wpa_supplicant / hostapd 2.0
Data Fields

wpa_driver_ops Struct Reference

Driver interface API definition. More...

#include <driver.h>

Data Fields

const char * name
const char * desc
int(* get_bssid )(void *priv, u8 *bssid)
 Get the current BSSID.
int(* get_ssid )(void *priv, u8 *ssid)
 Get the current SSID.
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)
 Configure encryption key.
void *(* init )(void *ctx, const char *ifname)
 Initialize driver interface.
void(* deinit )(void *priv)
 Deinitialize driver interface.
int(* set_param )(void *priv, const char *param)
 Set driver configuration parameters.
int(* set_countermeasures )(void *priv, int enabled)
 Enable/disable TKIP countermeasures.
int(* deauthenticate )(void *priv, const u8 *addr, int reason_code)
 Request driver to deauthenticate.
int(* disassociate )(void *priv, const u8 *addr, int reason_code)
 Request driver to disassociate.
int(* associate )(void *priv, struct wpa_driver_associate_params *params)
 Request driver to associate.
int(* add_pmkid )(void *priv, const u8 *bssid, const u8 *pmkid)
 Add PMKSA cache entry to the driver.
int(* remove_pmkid )(void *priv, const u8 *bssid, const u8 *pmkid)
 Remove PMKSA cache entry to the driver.
int(* flush_pmkid )(void *priv)
 Flush PMKSA cache.
int(* get_capa )(void *priv, struct wpa_driver_capa *capa)
 Get driver capabilities.
void(* poll )(void *priv)
 Poll driver for association information.
const char *(* get_ifname )(void *priv)
 Get interface name.
const u8 *(* get_mac_addr )(void *priv)
 Get own MAC address.
int(* send_eapol )(void *priv, const u8 *dest, u16 proto, const u8 *data, size_t data_len)
 Optional function for sending EAPOL packets.
int(* set_operstate )(void *priv, int state)
 Sets device operating state to DORMANT or UP.
int(* mlme_setprotection )(void *priv, const u8 *addr, int protect_type, int key_type)
 MLME-SETPROTECTION.request primitive.
struct hostapd_hw_modes *(* get_hw_feature_data )(void *priv, u16 *num_modes, u16 *flags)
 Get hardware support data (channels and rates)
int(* send_mlme )(void *priv, const u8 *data, size_t data_len, int noack)
 Send management frame from MLME.
int(* update_ft_ies )(void *priv, const u8 *md, const u8 *ies, size_t ies_len)
 Update FT (IEEE 802.11r) IEs.
int(* send_ft_action )(void *priv, u8 action, const u8 *target_ap, const u8 *ies, size_t ies_len)
 Send FT Action frame (IEEE 802.11r)
struct wpa_scan_results *(* get_scan_results2 )(void *priv)
 Fetch the latest scan results.
int(* set_country )(void *priv, const char *alpha2)
 Set country.
void *(* global_init )(void)
 Global driver initialization.
void(* global_deinit )(void *priv)
 Global driver deinitialization.
void *(* init2 )(void *ctx, const char *ifname, void *global_priv)
 Initialize driver interface (with global data)
struct wpa_interface_info *(* get_interfaces )(void *global_priv)
 Get information about available interfaces.
int(* scan2 )(void *priv, struct wpa_driver_scan_params *params)
 Request the driver to initiate scan.
int(* authenticate )(void *priv, struct wpa_driver_auth_params *params)
 Request driver to authenticate.
int(* set_ap )(void *priv, struct wpa_driver_ap_params *params)
 Set Beacon and Probe Response information for AP mode.
void *(* hapd_init )(struct hostapd_data *hapd, struct wpa_init_params *params)
 Initialize driver interface (hostapd only)
void(* hapd_deinit )(void *priv)
 Deinitialize driver interface (hostapd only)
int(* set_ieee8021x )(void *priv, struct wpa_bss_params *params)
 Enable/disable IEEE 802.1X support (AP only)
int(* set_privacy )(void *priv, int enabled)
 Enable/disable privacy (AP only)
int(* get_seqnum )(const char *ifname, void *priv, const u8 *addr, int idx, u8 *seq)
 Fetch the current TSC/packet number (AP only)
int(* flush )(void *priv)
 Flush all association stations (AP only)
int(* set_generic_elem )(void *priv, const u8 *elem, size_t elem_len)
 Add IEs into Beacon/Probe Response frames (AP)
int(* read_sta_data )(void *priv, struct hostap_sta_driver_data *data, const u8 *addr)
 Fetch station data (AP only)
int(* hapd_send_eapol )(void *priv, const u8 *addr, const u8 *data, size_t data_len, int encrypt, const u8 *own_addr, u32 flags)
 Send an EAPOL packet (AP only)
int(* sta_deauth )(void *priv, const u8 *own_addr, const u8 *addr, int reason)
 Deauthenticate a station (AP only)
int(* sta_disassoc )(void *priv, const u8 *own_addr, const u8 *addr, int reason)
 Disassociate a station (AP only)
int(* sta_remove )(void *priv, const u8 *addr)
 Remove a station entry (AP only)
int(* hapd_get_ssid )(void *priv, u8 *buf, int len)
 Get the current SSID (AP only)
int(* hapd_set_ssid )(void *priv, const u8 *buf, int len)
 Set SSID (AP only)
int(* hapd_set_countermeasures )(void *priv, int enabled)
 Enable/disable TKIP countermeasures (AP)
int(* sta_add )(void *priv, struct hostapd_sta_add_params *params)
 Add a station entry.
int(* get_inact_sec )(void *priv, const u8 *addr)
 Get station inactivity duration (AP only)
int(* sta_clear_stats )(void *priv, const u8 *addr)
 Clear station statistics (AP only)
int(* set_freq )(void *priv, struct hostapd_freq_params *freq)
 Set channel/frequency (AP only)
int(* set_rts )(void *priv, int rts)
 Set RTS threshold.
int(* set_frag )(void *priv, int frag)
 Set fragmentation threshold.
int(* sta_set_flags )(void *priv, const u8 *addr, int total_flags, int flags_or, int flags_and)
 Set station flags (AP only)
int(* set_tx_queue_params )(void *priv, int queue, int aifs, int cw_min, int cw_max, int burst_time)
 Set TX queue parameters.
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, const char *bridge)
 Add a virtual interface.
int(* if_remove )(void *priv, enum wpa_driver_if_type type, const char *ifname)
 Remove a virtual interface.
int(* set_sta_vlan )(void *priv, const u8 *addr, const char *ifname, int vlan_id)
 Bind a station into a specific interface (AP only)
int(* commit )(void *priv)
 Optional commit changes handler (AP only)
int(* send_ether )(void *priv, const u8 *dst, const u8 *src, u16 proto, const u8 *data, size_t data_len)
 Send an ethernet packet (AP only)
int(* set_radius_acl_auth )(void *priv, const u8 *mac, int accepted, u32 session_timeout)
 Notification of RADIUS ACL change.
int(* set_radius_acl_expire )(void *priv, const u8 *mac)
 Notification of RADIUS ACL expiration.
int(* set_ap_wps_ie )(void *priv, const struct wpabuf *beacon, const struct wpabuf *proberesp, const struct wpabuf *assocresp)
 Add WPS IE(s) into Beacon/Probe Response frames (AP)
int(* set_supp_port )(void *priv, int authorized)
 Set IEEE 802.1X Supplicant Port status.
int(* set_wds_sta )(void *priv, const u8 *addr, int aid, int val, const char *bridge_ifname)
 Bind a station into a 4-address WDS (AP only)
int(* send_action )(void *priv, unsigned int freq, unsigned int wait, const u8 *dst, const u8 *src, const u8 *bssid, const u8 *data, size_t data_len, int no_cck)
 Transmit an Action frame.
void(* send_action_cancel_wait )(void *priv)
 Cancel action frame TX wait.
int(* remain_on_channel )(void *priv, unsigned int freq, unsigned int duration)
 Remain awake on a channel.
int(* cancel_remain_on_channel )(void *priv)
 Cancel remain-on-channel operation.
int(* probe_req_report )(void *priv, int report)
 Request Probe Request frames to be indicated.
int(* deinit_ap )(void *priv)
 Deinitialize AP mode.
int(* deinit_p2p_cli )(void *priv)
 Deinitialize P2P client mode.
void(* suspend )(void *priv)
 Notification on system suspend/hibernate event.
void(* resume )(void *priv)
 Notification on system resume/thaw event.
int(* signal_monitor )(void *priv, int threshold, int hysteresis)
 Set signal monitoring parameters.
int(* send_frame )(void *priv, const u8 *data, size_t data_len, int encrypt)
 Send IEEE 802.11 frame (testing use only)
int(* shared_freq )(void *priv)
 Get operating frequency of shared interface(s)
int(* get_noa )(void *priv, u8 *buf, size_t buf_len)
 Get current Notice of Absence attribute payload.
int(* set_noa )(void *priv, u8 count, int start, int duration)
 Set Notice of Absence parameters for GO (testing)
int(* set_p2p_powersave )(void *priv, int legacy_ps, int opp_ps, int ctwindow)
 Set P2P power save options.
int(* ampdu )(void *priv, int ampdu)
 Enable/disable aggregation.
const char *(* get_radio_name )(void *priv)
 Get physical radio name for the device.
int(* p2p_find )(void *priv, unsigned int timeout, int type)
 Start P2P Device Discovery.
int(* p2p_stop_find )(void *priv)
 Stop P2P Device Discovery.
int(* p2p_listen )(void *priv, unsigned int timeout)
 Start P2P Listen state for specified duration.
int(* p2p_connect )(void *priv, const u8 *peer_addr, int wps_method, int go_intent, const u8 *own_interface_addr, unsigned int force_freq, int persistent_group)
 Start P2P group formation (GO negotiation)
int(* wps_success_cb )(void *priv, const u8 *peer_addr)
 Report successfully completed WPS provisioning.
int(* p2p_group_formation_failed )(void *priv)
 Report failed WPS provisioning.
int(* p2p_set_params )(void *priv, const struct p2p_params *params)
 Set P2P parameters.
int(* p2p_prov_disc_req )(void *priv, const u8 *peer_addr, u16 config_methods, int join)
 Send Provision Discovery Request.
u64(* p2p_sd_request )(void *priv, const u8 *dst, const struct wpabuf *tlvs)
 Schedule a service discovery query.
int(* p2p_sd_cancel_request )(void *priv, u64 req)
 Cancel a pending service discovery query.
int(* p2p_sd_response )(void *priv, int freq, const u8 *dst, u8 dialog_token, const struct wpabuf *resp_tlvs)
 Send response to a service discovery query.
int(* p2p_service_update )(void *priv)
 Indicate a change in local services.
int(* p2p_reject )(void *priv, const u8 *addr)
 Reject peer device (explicitly block connections)
int(* p2p_invite )(void *priv, const u8 *peer, int role, const u8 *bssid, const u8 *ssid, size_t ssid_len, const u8 *go_dev_addr, int persistent_group)
 Invite a P2P Device into a group.
int(* send_tdls_mgmt )(void *priv, const u8 *dst, u8 action_code, u8 dialog_token, u16 status_code, const u8 *buf, size_t len)
 for sending TDLS management packets
int(* tdls_oper )(void *priv, enum tdls_oper oper, const u8 *peer)
 Ask the driver to perform high-level TDLS operations.
int(* signal_poll )(void *priv, struct wpa_signal_info *signal_info)
 Get current connection information.
int(* set_authmode )(void *priv, int authmode)
 Set authentication algorithm(s) for static WEP.
void(* set_rekey_info )(void *priv, const u8 *kek, const u8 *kck, const u8 *replay_ctr)
 Set rekey information.
int(* sta_assoc )(void *priv, const u8 *own_addr, const u8 *addr, int reassoc, u16 status, const u8 *ie, size_t len)
 Station association indication.
int(* sta_auth )(void *priv, const u8 *own_addr, const u8 *addr, u16 seq, u16 status, const u8 *ie, size_t len)
 Station authentication indication.
int(* add_tspec )(void *priv, const u8 *addr, u8 *tspec_ie, size_t tspec_ielen)
 Add traffic stream.
int(* add_sta_node )(void *priv, const u8 *addr, u16 auth_alg)
 Add a station node in the driver.
int(* sched_scan )(void *priv, struct wpa_driver_scan_params *params, u32 interval)
 Request the driver to initiate scheduled scan.
int(* stop_sched_scan )(void *priv)
 Request the driver to stop a scheduled scan.
void(* poll_client )(void *priv, const u8 *own_addr, const u8 *addr, int qos)
 Probe (null data or such) the given station.
int(* radio_disable )(void *priv, int disabled)
 Disable/enable radio.

Detailed Description

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.


Field Documentation

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

Add PMKSA cache entry to the driver.

Parameters:
privprivate driver interface data
bssidBSSID for the PMKSA cache entry
pmkidPMKID 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(* wpa_driver_ops::add_sta_node)(void *priv, const u8 *addr, u16 auth_alg)

Add a station node in the driver.

Parameters:
privPrivate driver interface data
addrMAC address of the station to add
auth_algauthentication algorithm used by the station
Returns:
0 on success, -1 on failure

This function adds the station node in the driver, when the station gets added by FT-over-DS.

int(* wpa_driver_ops::add_tspec)(void *priv, const u8 *addr, u8 *tspec_ie, size_t tspec_ielen)

Add traffic stream.

Parameters:
privPrivate driver interface data
addrMAC address of the station to associate
tspec_ietspec ie buffer
tspec_ielentspec ie length
Returns:
0 on success, -1 on failure

This function adds the traffic steam for the station and fills the medium_time in tspec_ie.

int(* wpa_driver_ops::ampdu)(void *priv, int ampdu)

Enable/disable aggregation.

Parameters:
privPrivate driver interface data
ampdu1/0 = enable/disable A-MPDU aggregation
Returns:
0 on success or -1 on failure
int(* wpa_driver_ops::associate)(void *priv, struct wpa_driver_associate_params *params)

Request driver to associate.

Parameters:
privprivate driver interface data
paramsassociation parameters
Returns:
0 on success, -1 on failure
int(* wpa_driver_ops::authenticate)(void *priv, struct wpa_driver_auth_params *params)

Request driver to authenticate.

Parameters:
privprivate driver interface data
paramsauthentication 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.

Cancel remain-on-channel operation.

Parameters:
privPrivate 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(* wpa_driver_ops::commit)(void *priv)

Optional commit changes handler (AP only)

Parameters:
privdriver 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(* wpa_driver_ops::deauthenticate)(void *priv, const u8 *addr, int reason_code)

Request driver to deauthenticate.

Parameters:
privprivate driver interface data
addrpeer address (BSSID of the AP)
reason_code16-bit reason code to be sent in the deauthentication frame
Returns:
0 on success, -1 on failure
void(* wpa_driver_ops::deinit)(void *priv)

Deinitialize driver interface.

Parameters:
privprivate 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.

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

Deinitialize AP mode.

Parameters:
privPrivate 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.

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

Deinitialize P2P client mode.

Parameters:
privPrivate driver interface data
Returns:
0 on success, -1 on failure (or if not supported)

This optional function can be used to disable P2P client mode. It can be used to change the interface type back to station mode.

const char* wpa_driver_ops::desc

One line description of the driver interface

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

Request driver to disassociate.

Parameters:
privprivate driver interface data
addrpeer address (BSSID of the AP)
reason_code16-bit reason code to be sent in the disassociation frame
Returns:
0 on success, -1 on failure
int(* wpa_driver_ops::flush)(void *priv)

Flush all association stations (AP only)

Parameters:
privPrivate 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.

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

Flush PMKSA cache.

Parameters:
privprivate 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(* wpa_driver_ops::get_bssid)(void *priv, u8 *bssid)

Get the current BSSID.

Parameters:
privprivate driver interface data
bssidbuffer 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(* wpa_driver_ops::get_capa)(void *priv, struct wpa_driver_capa *capa)

Get driver capabilities.

Parameters:
privprivate driver interface data
Returns:
0 on success, -1 on failure

Get driver/firmware/hardware capabilities.

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

Get hardware support data (channels and rates)

Parameters:
privPrivate driver interface data
num_modesVariable 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.
const char*(* wpa_driver_ops::get_ifname)(void *priv)

Get interface name.

Parameters:
privprivate 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.

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

Get station inactivity duration (AP only)

Parameters:
privPrivate driver interface data
addrStation address
Returns:
Number of seconds station has been inactive, -1 on failure
struct wpa_interface_info*(* wpa_driver_ops::get_interfaces)(void *global_priv) [read]

Get information about available interfaces.

Parameters:
global_privprivate 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
const u8*(* wpa_driver_ops::get_mac_addr)(void *priv)

Get own MAC address.

Parameters:
privprivate 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.

int(* wpa_driver_ops::get_noa)(void *priv, u8 *buf, size_t buf_len)

Get current Notice of Absence attribute payload.

Parameters:
privPrivate driver interface data
bufBuffer for returning NoA
buf_lenBuffer length in octets
Returns:
Number of octets used in buf, 0 to indicate no NoA is being advertized, or -1 on failure

This function is used to fetch the current Notice of Absence attribute value from GO.

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

Get physical radio name for the device.

Parameters:
privPrivate driver interface data
Returns:
Radio name or NULL if not known

The returned data must not be modified by the caller. It is assumed that any interface that has the same radio name as another is sharing the same physical radio. This information can be used to share scan results etc. information between the virtual interfaces to speed up various operations.

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

Fetch the latest scan results.

Parameters:
privprivate driver interface data
Returns:
Allocated buffer of scan results (caller is responsible for freeing the data structure) on success, NULL on failure
int(* wpa_driver_ops::get_seqnum)(const char *ifname, void *priv, const u8 *addr, int idx, u8 *seq)

Fetch the current TSC/packet number (AP only)

Parameters:
ifnameThe interface name (main or virtual)
privPrivate driver interface data
addrMAC address of the station or NULL for group keys
idxKey index
seqBuffer 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).

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

Get the current SSID.

Parameters:
privprivate driver interface data
ssidbuffer 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.

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

Global driver deinitialization.

Parameters:
privprivate driver global data from global_init()

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

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(* wpa_driver_ops::hapd_deinit)(void *priv)

Deinitialize driver interface (hostapd only)

Parameters:
privPrivate driver interface data from hapd_init()
int(* wpa_driver_ops::hapd_get_ssid)(void *priv, u8 *buf, int len)

Get the current SSID (AP only)

Parameters:
privPrivate driver interface data
bufBuffer for returning the SSID
lenMaximum 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_ap() and does not reply to Probe Request frames.

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

Initialize driver interface (hostapd only)

Parameters:
hapdPointer to hostapd context
paramsConfiguration 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 with hostapd.

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, u32 flags)

Send an EAPOL packet (AP only)

Parameters:
privprivate driver interface data
addrDestination MAC address
dataEAPOL packet starting with IEEE 802.1X header
data_lenLength of the EAPOL packet in octets
encryptWhether the frame should be encrypted
own_addrSource MAC address
flagsWPA_STA_* flags for the destination station
Returns:
0 on success, -1 on failure
int(* wpa_driver_ops::hapd_set_countermeasures)(void *priv, int enabled)

Enable/disable TKIP countermeasures (AP)

Parameters:
privPrivate driver interface data
enabled1 = 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.

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

Set SSID (AP only)

Parameters:
privPrivate driver interface data
bufSSID
lenLength of the SSID in octets
Returns:
0 on success, -1 on failure

DEPRECATED - use set_ap() instead

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, const char *bridge)

Add a virtual interface.

Parameters:
privPrivate driver interface data
typeInterface type
ifnameInterface name for the new virtual interface
addrLocal address to use for the interface or NULL to use the parent interface address
bss_ctxBSS context for WPA_IF_AP_BSS interfaces
drv_privPointer for overwriting the driver context or NULL if not allowed (applies only to WPA_IF_AP_BSS type)
force_ifnameBuffer for returning an interface name that the driver ended up using if it differs from the requested ifname
if_addrBuffer for returning the allocated interface address (this may differ from the requested addr if the driver cannot change interface address)
bridgeBridge interface to use or NULL if no bridge configured
Returns:
0 on success, -1 on failure
int(* wpa_driver_ops::if_remove)(void *priv, enum wpa_driver_if_type type, const char *ifname)

Remove a virtual interface.

Parameters:
privPrivate driver interface data
typeInterface type
ifnameInterface name of the virtual interface to be removed
Returns:
0 on success, -1 on failure
void*(* wpa_driver_ops::init)(void *ctx, const char *ifname)

Initialize driver interface.

Parameters:
ctxcontext to be used when calling wpa_supplicant functions, e.g., wpa_supplicant_event()
ifnameinterface 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

Parameters:
ctxfile 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*(* wpa_driver_ops::init2)(void *ctx, const char *ifname, void *global_priv)

Initialize driver interface (with global data)

Parameters:
ctxcontext to be used when calling wpa_supplicant functions, e.g., wpa_supplicant_event()
ifnameinterface name, e.g., wlan0
global_privprivate 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.

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

MLME-SETPROTECTION.request primitive.

Parameters:
privPrivate driver interface data
addrAddress of the station for which to set protection (may be NULL for group keys)
protect_typeMLME_SETPROTECTION_PROTECT_TYPE_*
key_typeMLME_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.

const char* wpa_driver_ops::name

Name of the driver interface

int(* wpa_driver_ops::p2p_connect)(void *priv, const u8 *peer_addr, int wps_method, int go_intent, const u8 *own_interface_addr, unsigned int force_freq, int persistent_group)

Start P2P group formation (GO negotiation)

Parameters:
privPrivate driver interface data
peer_addrMAC address of the peer P2P client
wps_methodenum p2p_wps_method value indicating config method
go_intentLocal GO intent value (1..15)
own_interface_addrIntended interface address to use with the group
force_freqThe only allowed channel frequency in MHz or 0
persistent_groupWhether to create persistent group
Returns:
0 on success, -1 on failure

This function is only used if the driver implements P2P management, i.e., if it sets WPA_DRIVER_FLAGS_P2P_MGMT in struct wpa_driver_capa.

int(* wpa_driver_ops::p2p_find)(void *priv, unsigned int timeout, int type)

Start P2P Device Discovery.

Parameters:
privPrivate driver interface data
timeoutTimeout for find operation in seconds or 0 for no timeout
typeDevice Discovery type (enum p2p_discovery_type)
Returns:
0 on success, -1 on failure

This function is only used if the driver implements P2P management, i.e., if it sets WPA_DRIVER_FLAGS_P2P_MGMT in struct wpa_driver_capa.

Report failed WPS provisioning.

Parameters:
privPrivate driver interface data
Returns:
0 on success, -1 on failure

This function is used to report failed group formation. This can happen either due to failed WPS provisioning or due to 15 second timeout during the provisioning phase.

This function is only used if the driver implements P2P management, i.e., if it sets WPA_DRIVER_FLAGS_P2P_MGMT in struct wpa_driver_capa.

int(* wpa_driver_ops::p2p_invite)(void *priv, const u8 *peer, int role, const u8 *bssid, const u8 *ssid, size_t ssid_len, const u8 *go_dev_addr, int persistent_group)

Invite a P2P Device into a group.

Parameters:
privPrivate driver interface data
peerDevice Address of the peer P2P Device
roleLocal role in the group
bssidGroup BSSID or NULL if not known
ssidGroup SSID
ssid_lenLength of ssid in octets
go_dev_addrForced GO Device Address or NULL if none
persistent_groupWhether this is to reinvoke a persistent group
Returns:
0 on success, -1 on failure
int(* wpa_driver_ops::p2p_listen)(void *priv, unsigned int timeout)

Start P2P Listen state for specified duration.

Parameters:
privPrivate driver interface data
timeoutListen state duration in milliseconds
Returns:
0 on success, -1 on failure

This function can be used to request the P2P module to keep the device discoverable on the listen channel for an extended set of time. At least in its current form, this is mainly used for testing purposes and may not be of much use for normal P2P operations.

This function is only used if the driver implements P2P management, i.e., if it sets WPA_DRIVER_FLAGS_P2P_MGMT in struct wpa_driver_capa.

int(* wpa_driver_ops::p2p_prov_disc_req)(void *priv, const u8 *peer_addr, u16 config_methods, int join)

Send Provision Discovery Request.

Parameters:
privPrivate driver interface data
peer_addrMAC address of the peer P2P client
config_methodsWPS Config Methods value (only one bit set)
Returns:
0 on success, -1 on failure

This function can be used to request a discovered P2P peer to display a PIN (config_methods = WPS_CONFIG_DISPLAY) or be prepared to enter a PIN from us (config_methods = WPS_CONFIG_KEYPAD). The Provision Discovery Request frame is transmitted once immediately and if no response is received, the frame will be sent again whenever the target device is discovered during device dsicovery (start with a p2p_find() call). Response from the peer is indicated with the EVENT_P2P_PROV_DISC_RESPONSE event.

This function is only used if the driver implements P2P management, i.e., if it sets WPA_DRIVER_FLAGS_P2P_MGMT in struct wpa_driver_capa.

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

Reject peer device (explicitly block connections)

Parameters:
privPrivate driver interface data
addrMAC address of the peer
Returns:
0 on success, -1 on failure
int(* wpa_driver_ops::p2p_sd_cancel_request)(void *priv, u64 req)

Cancel a pending service discovery query.

Parameters:
privPrivate driver interface data
reqQuery reference from p2p_sd_request()
Returns:
0 on success, -1 on failure

This function is only used if the driver implements P2P management, i.e., if it sets WPA_DRIVER_FLAGS_P2P_MGMT in struct wpa_driver_capa.

u64(* wpa_driver_ops::p2p_sd_request)(void *priv, const u8 *dst, const struct wpabuf *tlvs)

Schedule a service discovery query.

Parameters:
privPrivate driver interface data
dstDestination peer or NULL to apply for all peers
tlvsP2P Service Query TLV(s)
Returns:
Reference to the query or 0 on failure

Response to the query is indicated with the EVENT_P2P_SD_RESPONSE driver event.

This function is only used if the driver implements P2P management, i.e., if it sets WPA_DRIVER_FLAGS_P2P_MGMT in struct wpa_driver_capa.

int(* wpa_driver_ops::p2p_sd_response)(void *priv, int freq, const u8 *dst, u8 dialog_token, const struct wpabuf *resp_tlvs)

Send response to a service discovery query.

Parameters:
privPrivate driver interface data
freqFrequency from EVENT_P2P_SD_REQUEST event
dstDestination address from EVENT_P2P_SD_REQUEST event
dialog_tokenDialog token from EVENT_P2P_SD_REQUEST event
resp_tlvsP2P Service Response TLV(s)
Returns:
0 on success, -1 on failure

This function is called as a response to the request indicated with the EVENT_P2P_SD_REQUEST driver event.

This function is only used if the driver implements P2P management, i.e., if it sets WPA_DRIVER_FLAGS_P2P_MGMT in struct wpa_driver_capa.

Indicate a change in local services.

Parameters:
privPrivate driver interface data
Returns:
0 on success, -1 on failure

This function needs to be called whenever there is a change in availability of the local services. This will increment the Service Update Indicator value which will be used in SD Request and Response frames.

This function is only used if the driver implements P2P management, i.e., if it sets WPA_DRIVER_FLAGS_P2P_MGMT in struct wpa_driver_capa.

int(* wpa_driver_ops::p2p_set_params)(void *priv, const struct p2p_params *params)

Set P2P parameters.

Parameters:
privPrivate driver interface data
paramsP2P parameters
Returns:
0 on success, -1 on failure

This function is only used if the driver implements P2P management, i.e., if it sets WPA_DRIVER_FLAGS_P2P_MGMT in struct wpa_driver_capa.

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

Stop P2P Device Discovery.

Parameters:
privPrivate driver interface data
Returns:
0 on success, -1 on failure

This function is only used if the driver implements P2P management, i.e., if it sets WPA_DRIVER_FLAGS_P2P_MGMT in struct wpa_driver_capa.

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

Poll driver for association information.

Parameters:
privprivate 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(* wpa_driver_ops::poll_client)(void *priv, const u8 *own_addr, const u8 *addr, int qos)

Probe (null data or such) the given station.

Parameters:
privPrivate driver interface data
own_addrMAC address of sending interface
addrMAC address of the station to probe
qosIndicates whether station is QoS station

This function is used to verify whether an associated station is still present. This function does not need to be implemented if the driver provides such inactivity polling mechanism.

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

Request Probe Request frames to be indicated.

Parameters:
privPrivate driver interface data
reportWhether 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(* wpa_driver_ops::radio_disable)(void *priv, int disabled)

Disable/enable radio.

Parameters:
privPrivate driver interface data
disabled1=disable 0=enable radio
Returns:
0 on success, -1 on failure

This optional command is for testing purposes. It can be used to disable the radio on a testbed device to simulate out-of-radio-range conditions.

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

Fetch station data (AP only)

Parameters:
privPrivate driver interface data
dataBuffer for returning station information
addrMAC address of the station
Returns:
0 on success, -1 on failure
int(* wpa_driver_ops::remain_on_channel)(void *priv, unsigned int freq, unsigned int duration)

Remain awake on a channel.

Parameters:
privPrivate driver interface data
freqFrequency (in MHz) of the channel
durationDuration 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(* wpa_driver_ops::remove_pmkid)(void *priv, const u8 *bssid, const u8 *pmkid)

Remove PMKSA cache entry to the driver.

Parameters:
privprivate driver interface data
bssidBSSID for the PMKSA cache entry
pmkidPMKID 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.

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

Notification on system resume/thaw event.

Parameters:
privPrivate driver interface data
int(* wpa_driver_ops::scan2)(void *priv, struct wpa_driver_scan_params *params)

Request the driver to initiate scan.

Parameters:
privprivate driver interface data
paramsScan 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(* wpa_driver_ops::sched_scan)(void *priv, struct wpa_driver_scan_params *params, u32 interval)

Request the driver to initiate scheduled scan.

Parameters:
privPrivate driver interface data
paramsScan parameters
intervalInterval between scan cycles in milliseconds
Returns:
0 on success, -1 on failure

This operation should be used for scheduled scan offload to the hardware. Every time scan results are available, the driver should report scan results event for wpa_supplicant which will eventually request the results with wpa_driver_get_scan_results2(). This operation is optional and if not provided or if it returns -1, we fall back to normal host-scheduled scans.

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

Transmit an Action frame.

Parameters:
privPrivate driver interface data
freqFrequency (in MHz) of the channel
waitTime to wait off-channel for a response (in ms), or zero
dstDestination MAC address (Address 1)
srcSource MAC address (Address 2)
bssidBSSID (Address 3)
dataFrame body
data_lendata length in octets @ : Whether CCK rates must not be used to transmit this frame
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 the WPA_DRIVER_FLAGS_OFFCHANNEL_TX flag is set, the frame will be transmitted on the given channel and the device will wait for a response on that channel for the given wait time.

If the flag is not set, the wait time will be ignored. In this case, if a remain-on-channel duration is in progress, the frame must be transmitted on that channel; alternatively the frame may be sent on the current operational channel (if in associated state in station mode or while operating as an AP.)

Cancel action frame TX wait.

Parameters:
privPrivate driver interface data

This command cancels the wait time associated with sending an action frame. It is only available when WPA_DRIVER_FLAGS_OFFCHANNEL_TX is set in the driver flags.

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

Optional function for sending EAPOL packets.

Parameters:
privprivate driver interface data
destDestination MAC address
protoEthertype
dataEAPOL packet starting with IEEE 802.1X header
data_lenSize 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.

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

Send an ethernet packet (AP only)

Parameters:
privprivate driver interface data
dstDestination MAC address
srcSource MAC address
protoEthertype
dataEAPOL packet starting with IEEE 802.1X header
data_lenLength of the EAPOL packet in octets
Returns:
0 on success, -1 on failure
int(* wpa_driver_ops::send_frame)(void *priv, const u8 *data, size_t data_len, int encrypt)

Send IEEE 802.11 frame (testing use only)

Parameters:
privPrivate driver interface data
dataIEEE 802.11 frame with IEEE 802.11 header
data_lenSize of the frame
encryptWhether 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.

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 frame (IEEE 802.11r)

Parameters:
privPrivate driver interface data
actionAction field value
target_apTarget AP address
iesFT IEs (MDIE, FTIE, ...) (FT Request action frame body)
ies_lenLength 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(* wpa_driver_ops::send_mlme)(void *priv, const u8 *data, size_t data_len, int noack)

Send management frame from MLME.

Parameters:
privPrivate driver interface data
dataIEEE 802.11 management frame with IEEE 802.11 header
data_lenSize of the management frame
noackDo not wait for this frame to be acked (disable retries)
Returns:
0 on success, -1 on failure
int(* wpa_driver_ops::send_tdls_mgmt)(void *priv, const u8 *dst, u8 action_code, u8 dialog_token, u16 status_code, const u8 *buf, size_t len)

for sending TDLS management packets

Parameters:
privprivate driver interface data
dstDestination (peer) MAC address
action_codeTDLS action code for the mssage
dialog_tokenDialog Token to use in the message (if needed)
status_codeStatus Code or Reason Code to use (if needed)
bufTDLS IEs to add to the message
lenLength of buf in octets
Returns:
0 on success, negative (<0) on failure

This optional function can be used to send packet to driver which is responsible for receiving and sending all TDLS packets.

int(* wpa_driver_ops::set_ap)(void *priv, struct wpa_driver_ap_params *params)

Set Beacon and Probe Response information for AP mode.

Parameters:
privPrivate driver interface data
paramsParameters to use in AP mode

This function is used to configure Beacon template and/or extra IEs to add for Beacon and Probe Response frames 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. Depending on the driver architectue, this can be done either by using the full template or the set of additional IEs (e.g., WPS and P2P IE). Similarly, Probe Response processing depends on the driver design. If the driver (or firmware) takes care of replying to Probe Request frames, the extra IEs provided here needs to be added to the Probe Response frames.

Returns:
0 on success, -1 on failure
int(* wpa_driver_ops::set_ap_wps_ie)(void *priv, const struct wpabuf *beacon, const struct wpabuf *proberesp, const struct wpabuf *assocresp)

Add WPS IE(s) into Beacon/Probe Response frames (AP)

Parameters:
privPrivate driver interface data
beaconWPS IE(s) for Beacon frames or NULL to remove extra IE(s)
proberespWPS IE(s) for Probe Response frames or NULL to remove extra IE(s)
assocrespWPS IE(s) for (Re)Association 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_ap() and does not process Probe Request frames. If the driver takes care of (Re)Association frame processing, the assocresp buffer includes WPS IE(s) that need to be added to (Re)Association Response frames whenever a (Re)Association Request frame indicated use of WPS.

This will also be used to add P2P IE(s) into Beacon/Probe Response frames when operating as a GO. The driver is responsible for adding timing related attributes (e.g., NoA) in addition to the IEs included here by appending them after these buffers. This call is also used to provide Probe Response IEs for P2P Listen state operations for drivers that generate the Probe Response frames internally.

DEPRECATED - use set_ap() instead

int(* wpa_driver_ops::set_authmode)(void *priv, int authmode)

Set authentication algorithm(s) for static WEP.

Parameters:
privPrivate driver interface data
authmode1=Open System, 2=Shared Key, 3=both
Returns:
0 on success, -1 on failure

This function can be used to set authentication algorithms for AP mode when static WEP is used. If the driver uses user space MLME/SME implementation, there is no need to implement this function.

DEPRECATED - use set_ap() instead

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

Enable/disable TKIP countermeasures.

Parameters:
privprivate driver interface data
enabled1 = 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(* wpa_driver_ops::set_country)(void *priv, const char *alpha2)

Set country.

Parameters:
privPrivate driver interface data
alpha2country 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(* wpa_driver_ops::set_frag)(void *priv, int frag)

Set fragmentation threshold.

Parameters:
privPrivate driver interface data
fragFragmentation threshold in octets
Returns:
0 on success, -1 on failure
int(* wpa_driver_ops::set_freq)(void *priv, struct hostapd_freq_params *freq)

Set channel/frequency (AP only)

Parameters:
privPrivate driver interface data
freqChannel parameters
Returns:
0 on success, -1 on failure
int(* wpa_driver_ops::set_generic_elem)(void *priv, const u8 *elem, size_t elem_len)

Add IEs into Beacon/Probe Response frames (AP)

Parameters:
privPrivate driver interface data
elemInformation elements
elem_lenLength 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_ap().

DEPRECATED - use set_ap() instead

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

Enable/disable IEEE 802.1X support (AP only)

Parameters:
privPrivate driver interface data
paramsBSS 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_ap() to set WPA/RSN IE for Beacon frames.

DEPRECATED - use set_ap() instead

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)

Configure encryption key.

Parameters:
ifnameInterface name (for multi-SSID/VLAN support)
privprivate driver interface data
algencryption 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.
addrAddress of the peer STA (BSSID of the current AP when setting pairwise key in station mode), ff:ff:ff:ff:ff:ff for broadcast keys, NULL for default keys that are used both for broadcast and unicast; when clearing keys, NULL is used to indicate that both the broadcast-only and default key of the specified key index is to be cleared
key_idxkey index (0..3), usually 0 for unicast keys; 0..4095 for IGTK
set_txconfigure this key as the default Tx key (only used when driver does not support separate unicast/individual key
seqsequence 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); NULL if not set
seq_lenlength of the seq, depends on the algorithm: TKIP: 6 octets, CCMP: 6 octets, IGTK: 6 octets
keykey buffer; TKIP: 16-byte temporal key, 8-byte Tx Mic key, 8-byte Rx Mic Key
key_lenlength 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 trigger 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.

int(* wpa_driver_ops::set_noa)(void *priv, u8 count, int start, int duration)

Set Notice of Absence parameters for GO (testing)

Parameters:
privPrivate driver interface data
countCount
startStart time in ms from next TBTT
durationDuration in ms
Returns:
0 on success or -1 on failure

This function is used to set Notice of Absence parameters for GO. It is used only for testing. To disable NoA, all parameters are set to 0.

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

Sets device operating state to DORMANT or UP.

Parameters:
privprivate driver interface data
state0 = 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(* wpa_driver_ops::set_p2p_powersave)(void *priv, int legacy_ps, int opp_ps, int ctwindow)

Set P2P power save options.

Parameters:
privPrivate driver interface data
legacy_ps0 = disable, 1 = enable, 2 = maximum PS, -1 = no change
opp_ps0 = disable, 1 = enable, -1 = no change
ctwindow0.. = change (msec), -1 = no change
Returns:
0 on success or -1 on failure
int(* wpa_driver_ops::set_param)(void *priv, const char *param)

Set driver configuration parameters.

Parameters:
privprivate driver interface data from init()
paramdriver specific configuration parameters
Returns:
0 on success, -1 on failure

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

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

Enable/disable privacy (AP only)

Parameters:
privPrivate driver interface data
enabled1 = 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_ap().

DEPRECATED - use set_ap() instead

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

Notification of RADIUS ACL change.

Parameters:
privPrivate driver interface data
macMAC address of the station
acceptedWhether the station was accepted
session_timeoutSession timeout for the station
Returns:
0 on success, -1 on failure
int(* wpa_driver_ops::set_radius_acl_expire)(void *priv, const u8 *mac)

Notification of RADIUS ACL expiration.

Parameters:
privPrivate driver interface data
macMAC address of the station
Returns:
0 on success, -1 on failure
void(* wpa_driver_ops::set_rekey_info)(void *priv, const u8 *kek, const u8 *kck, const u8 *replay_ctr)

Set rekey information.

Parameters:
privPrivate driver interface data
kekCurrent KEK
kckCurrent KCK
replay_ctrCurrent EAPOL-Key Replay Counter

This optional function can be used to provide information for the driver/firmware to process EAPOL-Key frames in Group Key Handshake while the host (including wpa_supplicant) is sleeping.

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

Set RTS threshold.

Parameters:
privPrivate driver interface data
rtsRTS threshold in octets
Returns:
0 on success, -1 on failure
int(* wpa_driver_ops::set_sta_vlan)(void *priv, const u8 *addr, const char *ifname, int vlan_id)

Bind a station into a specific interface (AP only)

Parameters:
privPrivate driver interface data
ifnameInterface (main or virtual BSS or VLAN)
addrMAC address of the associated station
vlan_idVLAN 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.

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

Set IEEE 802.1X Supplicant Port status.

Parameters:
privPrivate driver interface data
authorizedWhether the port is authorized
Returns:
0 on success, -1 on failure
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 parameters.

Parameters:
privPrivate driver interface data
queueQueue number (0 = VO, 1 = VI, 2 = BE, 3 = BK)
aifsAIFS
cw_mincwMin
cw_maxcwMax
burst_timeMaximum length for bursting in 0.1 msec units
int(* wpa_driver_ops::set_wds_sta)(void *priv, const u8 *addr, int aid, int val, const char *bridge_ifname)

Bind a station into a 4-address WDS (AP only)

Parameters:
privPrivate driver interface data
addrMAC address of the associated station
aidAssociation ID
val1 = bind to 4-address WDS; 0 = unbind
bridge_ifnameBridge interface to use for the WDS station or NULL to indicate that bridge is not to be used
Returns:
0 on success, -1 on failure
int(* wpa_driver_ops::shared_freq)(void *priv)

Get operating frequency of shared interface(s)

Parameters:
privPrivate driver interface data
Returns:
Operating frequency in MHz, 0 if no shared operation in use, or -1 on failure

This command can be used to request the current operating frequency of any virtual interface that shares the same radio to provide information for channel selection for other virtual interfaces.

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

Set signal monitoring parameters.

Parameters:
privPrivate driver interface data
thresholdThreshold value for signal change events; 0 = disabled
hysteresisMinimum 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.

int(* wpa_driver_ops::signal_poll)(void *priv, struct wpa_signal_info *signal_info)

Get current connection information.

Parameters:
privPrivate driver interface data
signal_infoConnection info structure
int(* wpa_driver_ops::sta_add)(void *priv, struct hostapd_sta_add_params *params)

Add a station entry.

Parameters:
privPrivate driver interface data
paramsStation 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.

With TDLS, this function is also used to add or set (params->set 1) TDLS peer entries.

int(* wpa_driver_ops::sta_assoc)(void *priv, const u8 *own_addr, const u8 *addr, int reassoc, u16 status, const u8 *ie, size_t len)

Station association indication.

Parameters:
privPrivate driver interface data
own_addrSource address and BSSID for association frame
addrMAC address of the station to associate
reassocflag to indicate re-association
statusassociation response status code
ieassoc response ie buffer
lenie buffer length
Returns:
0 on success, -1 on failure

This function indicates the driver to send (Re)Association Response frame to the station.

int(* wpa_driver_ops::sta_auth)(void *priv, const u8 *own_addr, const u8 *addr, u16 seq, u16 status, const u8 *ie, size_t len)

Station authentication indication.

Parameters:
privPrivate driver interface data
own_addrSource address and BSSID for authentication frame
addrMAC address of the station to associate
seqauthentication sequence number
statusauthentication response status code
ieauthentication frame ie buffer
lenie buffer length

This function indicates the driver to send Authentication frame to the station.

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

Clear station statistics (AP only)

Parameters:
privPrivate driver interface data
addrStation address
Returns:
0 on success, -1 on failure
int(* wpa_driver_ops::sta_deauth)(void *priv, const u8 *own_addr, const u8 *addr, int reason)

Deauthenticate a station (AP only)

Parameters:
privPrivate driver interface data
own_addrSource address and BSSID for the Deauthentication frame
addrMAC address of the station to deauthenticate
reasonReason 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.

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

Disassociate a station (AP only)

Parameters:
privPrivate driver interface data
own_addrSource address and BSSID for the Disassociation frame
addrMAC address of the station to disassociate
reasonReason 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.

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

Remove a station entry (AP only)

Parameters:
privPrivate driver interface data
addrMAC address of the station to be removed
Returns:
0 on success, -1 on failure
int(* wpa_driver_ops::sta_set_flags)(void *priv, const u8 *addr, int total_flags, int flags_or, int flags_and)

Set station flags (AP only)

Parameters:
privPrivate driver interface data
addrStation address
total_flagsBitmap of all WPA_STA_* flags currently set
flags_orBitmap of WPA_STA_* flags to add
flags_andBitmap of WPA_STA_* flags to us as a mask
Returns:
0 on success, -1 on failure
int(* wpa_driver_ops::stop_sched_scan)(void *priv)

Request the driver to stop a scheduled scan.

Parameters:
privPrivate driver interface data
Returns:
0 on success, -1 on failure

This should cause the scheduled scan to be stopped and results should stop being sent. Must be supported if sched_scan is supported.

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

Notification on system suspend/hibernate event.

Parameters:
privPrivate driver interface data
int(* wpa_driver_ops::tdls_oper)(void *priv, enum tdls_oper oper, const u8 *peer)

Ask the driver to perform high-level TDLS operations.

Parameters:
privPrivate driver interface data
operTDLS high-level operation. See enum tdls_oper
peerDestination (peer) MAC address
Returns:
0 on success, negative (<0) on failure

This optional function can be used to send high-level TDLS commands to the driver.

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

Update FT (IEEE 802.11r) IEs.

Parameters:
privPrivate driver interface data
mdMobility domain (2 octets) (also included inside ies)
iesFT IEs (MDIE, FTIE, ...) or NULL to remove IEs
ies_lenLength 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(* wpa_driver_ops::wps_success_cb)(void *priv, const u8 *peer_addr)

Report successfully completed WPS provisioning.

Parameters:
privPrivate driver interface data
peer_addrPeer address
Returns:
0 on success, -1 on failure

This function is used to report successfully completed WPS provisioning during group formation in both GO/Registrar and client/Enrollee roles.

This function is only used if the driver implements P2P management, i.e., if it sets WPA_DRIVER_FLAGS_P2P_MGMT in struct wpa_driver_capa.


The documentation for this struct was generated from the following file:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines