Replace hostapd_michael_mic_failure() with generic driver event
[libeap.git] / src / drivers / driver.h
index 4825cb5..228ce6b 100644 (file)
@@ -430,7 +430,6 @@ struct hostapd_sta_add_params {
        u16 capability;
        const u8 *supp_rates;
        size_t supp_rates_len;
-       int flags;
        u16 listen_interval;
        const struct ieee80211_ht_capabilities *ht_capabilities;
 };
@@ -481,6 +480,25 @@ struct wpa_init_params {
 };
 
 
+struct wpa_bss_params {
+       /** Interface name (for multi-SSID/VLAN support) */
+       const char *ifname;
+       /** Whether IEEE 802.1X or WPA/WPA2 is enabled */
+       int enabled;
+
+       int wpa;
+       int ieee802_1x;
+       int wpa_group;
+       int wpa_pairwise;
+       int wpa_key_mgmt;
+       int rsn_preauth;
+};
+
+#define WPA_STA_AUTHORIZED BIT(0)
+#define WPA_STA_WMM BIT(1)
+#define WPA_STA_SHORT_PREAMBLE BIT(2)
+#define WPA_STA_MFP BIT(3)
+
 /**
  * struct wpa_driver_ops - Driver interface API definition
  *
@@ -1084,16 +1102,17 @@ struct wpa_driver_ops {
 
        /**
         * set_ieee8021x - Enable/disable IEEE 802.1X support (AP only)
-        * @ifname: Interface name (for multi-SSID/VLAN support)
         * @priv: Private driver interface data
-        * @enabled: 1 = enable, 0 = disable
+        * @params: BSS parameters
         * Returns: 0 on success, -1 on failure
         *
         * This is an optional function to configure the kernel driver to
-        * enable/disable 802.1X support. This can be left undefined (set to
-        * %NULL) if IEEE 802.1X support is always enabled.
+        * 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.
         */
-       int (*set_ieee8021x)(const char *ifname, void *priv, int enabled);
+       int (*set_ieee8021x)(void *priv, struct wpa_bss_params *params);
 
        /**
         * set_privacy - Enable/disable privacy (AP only)
@@ -1305,9 +1324,9 @@ struct wpa_driver_ops {
         * sta_set_flags - Set station flags (AP only)
         * @priv: Private driver interface data
         * @addr: Station address
-        * @total_flags: Bitmap of all WLAN_STA_* flags currently set
-        * @flags_or: Bitmap of WLAN_STA_* flags to add
-        * @flags_and: Bitmap of WLAN_STA_* flags to us as a mask
+        * @total_flags: Bitmap of all WPA_STA_* flags currently set
+        * @flags_or: Bitmap of WPA_STA_* flags to add
+        * @flags_and: Bitmap of WPA_STA_* flags to us as a mask
         * Returns: 0 on success, -1 on failure
         */
        int (*sta_set_flags)(void *priv, const u8 *addr,
@@ -1379,11 +1398,12 @@ struct wpa_driver_ops {
         * @ifname: Interface name for the new virtual interface
         * @addr: Local address to use for the interface or %NULL to use the
         *      parent interface address
+        * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces
         * Returns: 0 on success, -1 on failure
         */
        int (*if_add)(const char *iface, void *priv,
                      enum wpa_driver_if_type type, const char *ifname,
-                     const u8 *addr);
+                     const u8 *addr, void *bss_ctx);
 
        /**
         * if_remove - Remove a virtual interface
@@ -1949,7 +1969,6 @@ void hostapd_mgmt_rx(struct hostapd_data *hapd, u8 *buf, size_t len,
                     u16 stype, struct hostapd_frame_info *fi);
 void hostapd_mgmt_tx_cb(struct hostapd_data *hapd, u8 *buf, size_t len,
                        u16 stype, int ok);
-void hostapd_michael_mic_failure(struct hostapd_data *hapd, const u8 *addr);
 struct hostapd_data * hostapd_sta_get_bss(struct hostapd_data *hapd,
                                          const u8 *addr);
 void hostapd_probe_req_rx(struct hostapd_data *hapd, const u8 *sa,