}
static inline int
-hostapd_set_ieee8021x(const char *ifname, struct hostapd_data *hapd,
- int enabled)
+hostapd_set_ieee8021x(struct hostapd_data *hapd, struct wpa_bss_params *params)
{
if (hapd->driver == NULL || hapd->driver->set_ieee8021x == NULL)
return 0;
- return hapd->driver->set_ieee8021x(ifname, hapd->drv_priv, enabled);
+ return hapd->driver->set_ieee8021x(hapd->drv_priv, params);
}
static inline int
}
if (hapd->conf->ieee802_1x || hapd->conf->wpa)
- hostapd_set_ieee8021x(hapd->conf->iface, hapd, 1);
+ hostapd_set_drv_ieee8021x(hapd, hapd->conf->iface, 1);
+ else
+ hostapd_set_drv_ieee8021x(hapd, hapd->conf->iface, 0);
hostapd_config_free(oldconf);
return 0;
}
+
+
+int hostapd_set_drv_ieee8021x(struct hostapd_data *hapd, const char *ifname,
+ int enabled)
+{
+ struct wpa_bss_params params;
+ os_memset(¶ms, 0, sizeof(params));
+ params.ifname = ifname;
+ params.enabled = enabled;
+ return hostapd_set_ieee8021x(hapd, ¶ms);
+}
void (*cb)(void *ctx, const u8 *sa,
const u8 *ie, size_t ie_len),
void *ctx);
+int hostapd_set_drv_ieee8021x(struct hostapd_data *hapd, const char *ifname,
+ int enabled);
int eap_server_register_methods(void);
NULL, 0, key->key[key->idx], key->len[key->idx]))
printf("Could not set dynamic VLAN WEP encryption key.\n");
- hostapd_set_ieee8021x(ifname, hapd, 1);
+ hostapd_set_drv_ieee8021x(hapd, ifname, 1);
return key;
}
return -1;
if ((hapd->conf->ieee802_1x || hapd->conf->wpa) &&
- hostapd_set_ieee8021x(hapd->conf->iface, hapd, 1))
+ hostapd_set_drv_ieee8021x(hapd, hapd->conf->iface, 1))
return -1;
#ifndef CONFIG_NO_RADIUS
if (hapd->driver != NULL &&
(hapd->conf->ieee802_1x || hapd->conf->wpa))
- hostapd_set_ieee8021x(hapd->conf->iface, hapd, 0);
+ hostapd_set_drv_ieee8021x(hapd, hapd->conf->iface, 0);
eapol_auth_deinit(hapd->eapol_auth);
hapd->eapol_auth = NULL;
};
+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;
+};
+
+
/**
* struct wpa_driver_ops - Driver interface API definition
*
/**
* 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)
}
static int
-madwifi_set_ieee8021x(const char *ifname, void *priv, int enabled)
+madwifi_set_ieee8021x(void *priv, struct wpa_bss_params *params)
{
struct madwifi_driver_data *drv = priv;
struct hostapd_data *hapd = drv->hapd;
struct hostapd_bss_config *conf = hapd->conf;
+ int enabled = params->enabled;
wpa_printf(MSG_DEBUG, "%s: enabled=%d", __func__, enabled);
}
static int
-bsd_set_ieee8021x(const char *ifname, void *priv, int enabled)
+bsd_set_ieee8021x(void *priv, struct wpa_bss_params *params)
{
struct bsd_driver_data *drv = priv;
struct hostapd_data *hapd = drv->hapd;
struct hostapd_bss_config *conf = hapd->conf;
+ int enabled = params->enabled;
wpa_printf(MSG_DEBUG, "%s: enabled=%d", __func__, enabled);
}
-static int hostap_set_ieee8021x(const char *ifname, void *priv, int enabled)
+static int hostap_set_ieee8021x(void *priv, struct wpa_bss_params *params)
{
struct hostap_driver_data *drv = priv;
+ int enabled = params->enabled;
/* enable kernel driver support for IEEE 802.1X */
if (hostap_ioctl_prism2param(drv, PRISM2_PARAM_IEEE_802_1X, enabled)) {
}
static int
-madwifi_set_ieee8021x(const char *ifname, void *priv, int enabled)
+madwifi_set_ieee8021x(void *priv, struct wpa_bss_params *params)
{
struct madwifi_driver_data *drv = priv;
struct hostapd_data *hapd = drv->hapd;
struct hostapd_bss_config *conf = hapd->conf;
+ int enabled = params->enabled;
wpa_printf(MSG_DEBUG, "%s: enabled=%d", __func__, enabled);