+
+ /**
+ * set_country - Set country
+ * @priv: Private driver interface data
+ * @alpha2: country to which to switch to
+ * Returns: 0 on success, -1 on failure
+ *
+ * This function is for drivers which support some form
+ * of setting a regulatory domain.
+ */
+ int (*set_country)(void *priv, const char *alpha2);
+
+ /**
+ * global_init - Global driver initialization
+ * Returns: Pointer to private data (global), %NULL on failure
+ *
+ * This optional function is called to initialize the driver wrapper
+ * for global data, i.e., data that applies to all interfaces. If this
+ * function is implemented, global_deinit() will also need to be
+ * implemented to free the private data. The driver will also likely
+ * use init2() function instead of init() to get the pointer to global
+ * data available to per-interface initializer.
+ */
+ void * (*global_init)(void);
+
+ /**
+ * global_deinit - Global driver deinitialization
+ * @priv: private driver global data from global_init()
+ *
+ * Terminate any global driver related functionality and free the
+ * global data structure.
+ */
+ void (*global_deinit)(void *priv);
+
+ /**
+ * init2 - Initialize driver interface (with global data)
+ * @ctx: context to be used when calling wpa_supplicant functions,
+ * e.g., wpa_supplicant_event()
+ * @ifname: interface name, e.g., wlan0
+ * @global_priv: private driver global data from global_init()
+ * Returns: Pointer to private data, %NULL on failure
+ *
+ * This function can be used instead of init() if the driver wrapper
+ * uses global data.
+ */
+ void * (*init2)(void *ctx, const char *ifname, void *global_priv);
+
+ /**
+ * get_interfaces - Get information about available interfaces
+ * @global_priv: private driver global data from global_init()
+ * Returns: Allocated buffer of interface information (caller is
+ * responsible for freeing the data structure) on success, NULL on
+ * failure
+ */
+ struct wpa_interface_info * (*get_interfaces)(void *global_priv);
+
+ /**
+ * scan2 - Request the driver to initiate scan
+ * @priv: private driver interface data
+ * @params: Scan parameters
+ *
+ * Returns: 0 on success, -1 on failure
+ *
+ * Once the scan results are ready, the driver should report scan
+ * results event for wpa_supplicant which will eventually request the
+ * results with wpa_driver_get_scan_results2().
+ */
+ int (*scan2)(void *priv, struct wpa_driver_scan_params *params);
+
+ /**
+ * authenticate - Request driver to authenticate
+ * @priv: private driver interface data
+ * @params: authentication parameters
+ * Returns: 0 on success, -1 on failure
+ *
+ * This is an optional function that can be used with drivers that
+ * support separate authentication and association steps, i.e., when
+ * wpa_supplicant can act as the SME. If not implemented, associate()
+ * function is expected to take care of IEEE 802.11 authentication,
+ * too.
+ */
+ int (*authenticate)(void *priv,
+ struct wpa_driver_auth_params *params);
+
+ int (*set_beacon)(void *priv, const u8 *head, size_t head_len,
+ const u8 *tail, size_t tail_len, int dtim_period);
+
+ int (*set_beacon_int)(void *priv, int value);
+
+ void * (*hapd_init)(struct hostapd_data *hapd,
+ struct wpa_init_params *params);
+ void (*hapd_deinit)(void *priv);
+
+ /**
+ * set_8021x - enable/disable IEEE 802.1X support
+ * @ifname: Interface name (for multi-SSID/VLAN support)
+ * @priv: driver private data
+ * @enabled: 1 = enable, 0 = disable
+ *
+ * Returns: 0 on success, -1 on failure
+ *
+ * Configure the kernel driver to enable/disable 802.1X support.
+ * This may be an empty function if 802.1X support is always enabled.
+ */
+ int (*set_ieee8021x)(const char *ifname, void *priv, int enabled);
+
+ /**
+ * set_privacy - enable/disable privacy
+ * @priv: driver private data
+ * @enabled: 1 = privacy enabled, 0 = disabled
+ *
+ * Return: 0 on success, -1 on failure
+ *
+ * Configure privacy.
+ */
+ int (*set_privacy)(const char *ifname, void *priv, int enabled);
+
+ int (*hapd_set_key)(const char *ifname, void *priv, 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 (*get_seqnum)(const char *ifname, void *priv, const u8 *addr,
+ int idx, u8 *seq);
+ int (*get_seqnum_igtk)(const char *ifname, void *priv, const u8 *addr,
+ int idx, u8 *seq);
+ int (*flush)(void *priv);
+ int (*set_generic_elem)(const char *ifname, void *priv, const u8 *elem,
+ size_t elem_len);
+
+ int (*read_sta_data)(void *priv, struct hostap_sta_driver_data *data,
+ const u8 *addr);
+ int (*hapd_send_eapol)(void *priv, const u8 *addr, const u8 *data,
+ size_t data_len, int encrypt,
+ const u8 *own_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 (*hapd_get_ssid)(const char *ifname, void *priv, u8 *buf, int len);
+ int (*hapd_set_ssid)(const char *ifname, void *priv, const u8 *buf,
+ int len);
+ int (*hapd_set_countermeasures)(void *priv, int enabled);
+ int (*sta_add)(const char *ifname, void *priv,
+ struct hostapd_sta_add_params *params);
+ int (*get_inact_sec)(void *priv, const u8 *addr);
+ int (*sta_clear_stats)(void *priv, const u8 *addr);
+
+ int (*set_freq)(void *priv, struct hostapd_freq_params *freq);
+ int (*set_rts)(void *priv, int rts);
+ int (*set_frag)(void *priv, int frag);
+
+ int (*sta_set_flags)(void *priv, const u8 *addr,
+ int total_flags, int flags_or, int flags_and);
+ int (*set_rate_sets)(void *priv, int *supp_rates, int *basic_rates,
+ int mode);
+ int (*hapd_set_beacon)(const char *ifname, void *priv,
+ const u8 *head, size_t head_len,
+ const u8 *tail, size_t tail_len,
+ int dtim_period);
+
+ /* Configure internal bridge:
+ * 0 = disabled, i.e., client separation is enabled (no bridging of
+ * packets between associated STAs
+ * 1 = enabled, i.e., bridge packets between associated STAs (default)
+ */
+ int (*set_internal_bridge)(void *priv, int value);
+ int (*set_cts_protect)(void *priv, int value);
+ int (*set_preamble)(void *priv, int value);
+ int (*set_short_slot_time)(void *priv, int value);
+ int (*set_tx_queue_params)(void *priv, int queue, int aifs, int cw_min,
+ int cw_max, int burst_time);
+ int (*bss_add)(void *priv, const char *ifname, const u8 *bssid);
+ int (*bss_remove)(void *priv, const char *ifname);
+ int (*valid_bss_mask)(void *priv, const u8 *addr, const u8 *mask);
+ int (*if_add)(const char *iface, void *priv,
+ enum hostapd_driver_if_type type, char *ifname,
+ const u8 *addr);
+ int (*if_update)(void *priv, enum hostapd_driver_if_type type,
+ char *ifname, const u8 *addr);
+ int (*if_remove)(void *priv, enum hostapd_driver_if_type type,
+ const char *ifname, const u8 *addr);
+ int (*set_sta_vlan)(void *priv, const u8 *addr, const char *ifname,
+ int vlan_id);
+ /**
+ * commit - Optional commit changes handler
+ * @priv: driver private data
+ * Returns: 0 on success, -1 on failure
+ *
+ * This optional handler function can be registered if the driver
+ * interface implementation needs to commit changes (e.g., by setting
+ * network interface up) at the end of initial configuration. If set,
+ * this handler will be called after initial setup has been completed.
+ */
+ int (*commit)(void *priv);
+
+ int (*send_ether)(void *priv, const u8 *dst, const u8 *src, u16 proto,
+ const u8 *data, size_t data_len);
+
+ 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_ht_params)(const char *ifname, void *priv,
+ const u8 *ht_capab, size_t ht_capab_len,
+ const u8 *ht_oper, size_t ht_oper_len);
+
+ int (*set_wps_beacon_ie)(const char *ifname, void *priv,
+ const u8 *ie, size_t len);
+ int (*set_wps_probe_resp_ie)(const char *ifname, void *priv,
+ const u8 *ie, size_t len);
+
+ /**
+ * set_supp_port - Set IEEE 802.1X Supplicant Port status
+ * @priv: Private driver interface data
+ * @authorized: Whether the port is authorized
+ * Returns: 0 on success, -1 on failure
+ */
+ int (*set_supp_port)(void *priv, int authorized);