#include "driver_i.h"
+static int hostapd_sta_flags_to_drv(int flags)
+{
+ int res = 0;
+ if (flags & WLAN_STA_AUTHORIZED)
+ res |= WPA_STA_AUTHORIZED;
+ if (flags & WLAN_STA_WMM)
+ res |= WPA_STA_WMM;
+ if (flags & WLAN_STA_SHORT_PREAMBLE)
+ res |= WPA_STA_SHORT_PREAMBLE;
+ if (flags & WLAN_STA_MFP)
+ res |= WPA_STA_MFP;
+ return res;
+}
+
+
static int hostapd_set_ap_wps_ie(struct hostapd_data *hapd,
const struct wpabuf *beacon,
const struct wpabuf *proberesp)
}
+static int hostapd_set_sta_flags(struct hostapd_data *hapd,
+ struct sta_info *sta)
+{
+ int set_flags, total_flags, flags_and, flags_or;
+ total_flags = hostapd_sta_flags_to_drv(sta->flags);
+ set_flags = WPA_STA_SHORT_PREAMBLE | WPA_STA_WMM | WPA_STA_MFP;
+ if (!hapd->conf->ieee802_1x && !hapd->conf->wpa &&
+ sta->flags & WLAN_STA_AUTHORIZED)
+ set_flags |= WPA_STA_AUTHORIZED;
+ flags_or = total_flags & set_flags;
+ flags_and = total_flags | ~set_flags;
+ return hostapd_sta_set_flags(hapd, sta->addr, total_flags,
+ flags_or, flags_and);
+}
+
+
void hostapd_set_driver_ops(struct hostapd_driver_ops *ops)
{
ops->set_ap_wps_ie = hostapd_set_ap_wps_ie;
ops->set_key = hostapd_set_key;
ops->read_sta_data = hostapd_read_sta_data;
ops->sta_clear_stats = hostapd_sta_clear_stats;
+ ops->set_sta_flags = hostapd_set_sta_flags;
}
}
return hostapd_set_ieee8021x(hapd, ¶ms);
}
-
-
-int hostapd_sta_flags_to_drv(int flags)
-{
- int res = 0;
- if (flags & WLAN_STA_AUTHORIZED)
- res |= WPA_STA_AUTHORIZED;
- if (flags & WLAN_STA_WMM)
- res |= WPA_STA_WMM;
- if (flags & WLAN_STA_SHORT_PREAMBLE)
- res |= WPA_STA_SHORT_PREAMBLE;
- if (flags & WLAN_STA_MFP)
- res |= WPA_STA_MFP;
- return res;
-}
struct hostap_sta_driver_data *data,
const u8 *addr);
int (*sta_clear_stats)(struct hostapd_data *hapd, const u8 *addr);
+ int (*set_sta_flags)(struct hostapd_data *hapd, struct sta_info *sta);
};
/**
void *ctx);
int hostapd_set_drv_ieee8021x(struct hostapd_data *hapd, const char *ifname,
int enabled);
-int hostapd_sta_flags_to_drv(int flags);
int eap_server_register_methods(void);
void hostapd_set_driver_ops(struct hostapd_driver_ops *ops);
struct sta_info *sta;
int new_assoc = 1;
struct ieee80211_ht_capabilities ht_cap;
- int set_flags, total_flags, flags_and, flags_or;
if (!ok) {
hostapd_logger(hapd, mgmt->da, HOSTAPD_MODULE_IEEE80211,
ap_sta_bind_vlan(hapd, sta, 0);
}
- total_flags = hostapd_sta_flags_to_drv(sta->flags);
- set_flags = WPA_STA_SHORT_PREAMBLE | WPA_STA_WMM | WPA_STA_MFP;
- if (!hapd->conf->ieee802_1x && !hapd->conf->wpa &&
- sta->flags & WLAN_STA_AUTHORIZED)
- set_flags |= WPA_STA_AUTHORIZED;
- flags_or = total_flags & set_flags;
- flags_and = total_flags | ~set_flags;
- hostapd_sta_set_flags(hapd, sta->addr, total_flags,
- flags_or, flags_and);
+ hapd->drv.set_sta_flags(hapd, sta);
if (sta->auth_alg == WLAN_AUTH_FT)
wpa_auth_sm_event(sta->wpa_sm, WPA_ASSOC_FT);