atheros: Fix auth_alg configuration for static WEP

When IEEE 802.1X is not enabled, driver_atheros.c needs to know how
to set authentication algorithms for static WEP.
This commit is contained in:
Ken Zhu 2011-05-20 18:27:53 +03:00 committed by Jouni Malinen
parent 6d28fb9627
commit 41fd1d9e9a
4 changed files with 44 additions and 0 deletions

View file

@ -1357,6 +1357,23 @@ atheros_commit(void *priv)
return linux_set_iface_flags(drv->ioctl_sock, drv->iface, 1);
}
static int atheros_set_authmode(void *priv, int auth_algs)
{
int authmode;
if ((auth_algs & WPA_AUTH_ALG_OPEN) &&
(auth_algs & WPA_AUTH_ALG_SHARED))
authmode = IEEE80211_AUTH_AUTO;
else if (auth_algs & WPA_AUTH_ALG_OPEN)
authmode = IEEE80211_AUTH_OPEN;
else if (auth_algs & WPA_AUTH_ALG_SHARED)
authmode = IEEE80211_AUTH_SHARED;
else
return -1;
return set80211param(priv, IEEE80211_PARAM_AUTHMODE, authmode);
}
const struct wpa_driver_ops wpa_driver_atheros_ops = {
.name = "atheros",
.hapd_init = atheros_init,
@ -1378,4 +1395,5 @@ const struct wpa_driver_ops wpa_driver_atheros_ops = {
.sta_clear_stats = atheros_sta_clear_stats,
.commit = atheros_commit,
.set_ap_wps_ie = atheros_set_ap_wps_ie,
.set_authmode = atheros_set_authmode,
};