hostapd: Pass VHT capabilities to driver wrapper

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Johannes Berg 2012-12-28 17:30:30 +02:00 committed by Jouni Malinen
parent 89b800d726
commit a9a1d0f08a
6 changed files with 25 additions and 0 deletions

View file

@ -338,6 +338,7 @@ int hostapd_sta_add(struct hostapd_data *hapd,
const u8 *supp_rates, size_t supp_rates_len, const u8 *supp_rates, size_t supp_rates_len,
u16 listen_interval, u16 listen_interval,
const struct ieee80211_ht_capabilities *ht_capab, const struct ieee80211_ht_capabilities *ht_capab,
const struct ieee80211_vht_capabilities *vht_capab,
u32 flags, u8 qosinfo) u32 flags, u8 qosinfo)
{ {
struct hostapd_sta_add_params params; struct hostapd_sta_add_params params;
@ -355,6 +356,7 @@ int hostapd_sta_add(struct hostapd_data *hapd,
params.supp_rates_len = supp_rates_len; params.supp_rates_len = supp_rates_len;
params.listen_interval = listen_interval; params.listen_interval = listen_interval;
params.ht_capabilities = ht_capab; params.ht_capabilities = ht_capab;
params.vht_capabilities = vht_capab;
params.flags = hostapd_sta_flags_to_drv(flags); params.flags = hostapd_sta_flags_to_drv(flags);
params.qosinfo = qosinfo; params.qosinfo = qosinfo;
return hapd->driver->sta_add(hapd->drv_priv, &params); return hapd->driver->sta_add(hapd->drv_priv, &params);

View file

@ -13,6 +13,7 @@ enum wpa_driver_if_type;
struct wpa_bss_params; struct wpa_bss_params;
struct wpa_driver_scan_params; struct wpa_driver_scan_params;
struct ieee80211_ht_capabilities; struct ieee80211_ht_capabilities;
struct ieee80211_vht_capabilities;
u32 hostapd_sta_flags_to_drv(u32 flags); u32 hostapd_sta_flags_to_drv(u32 flags);
int hostapd_build_ap_extra_ies(struct hostapd_data *hapd, int hostapd_build_ap_extra_ies(struct hostapd_data *hapd,
@ -37,6 +38,7 @@ int hostapd_sta_add(struct hostapd_data *hapd,
const u8 *supp_rates, size_t supp_rates_len, const u8 *supp_rates, size_t supp_rates_len,
u16 listen_interval, u16 listen_interval,
const struct ieee80211_ht_capabilities *ht_capab, const struct ieee80211_ht_capabilities *ht_capab,
const struct ieee80211_vht_capabilities *vht_capab,
u32 flags, u8 qosinfo); u32 flags, u8 qosinfo);
int hostapd_set_privacy(struct hostapd_data *hapd, int enabled); int hostapd_set_privacy(struct hostapd_data *hapd, int enabled);
int hostapd_set_generic_elem(struct hostapd_data *hapd, const u8 *elem, int hostapd_set_generic_elem(struct hostapd_data *hapd, const u8 *elem,

View file

@ -1708,6 +1708,7 @@ static void handle_assoc_cb(struct hostapd_data *hapd,
struct sta_info *sta; struct sta_info *sta;
int new_assoc = 1; int new_assoc = 1;
struct ieee80211_ht_capabilities ht_cap; struct ieee80211_ht_capabilities ht_cap;
struct ieee80211_vht_capabilities vht_cap;
if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_resp) : if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_resp) :
sizeof(mgmt->u.assoc_resp))) { sizeof(mgmt->u.assoc_resp))) {
@ -1780,11 +1781,16 @@ static void handle_assoc_cb(struct hostapd_data *hapd,
if (sta->flags & WLAN_STA_HT) if (sta->flags & WLAN_STA_HT)
hostapd_get_ht_capab(hapd, sta->ht_capabilities, &ht_cap); hostapd_get_ht_capab(hapd, sta->ht_capabilities, &ht_cap);
#endif /* CONFIG_IEEE80211N */ #endif /* CONFIG_IEEE80211N */
#ifdef CONFIG_IEEE80211AC
if (sta->flags & WLAN_STA_VHT)
hostapd_get_vht_capab(hapd, sta->vht_capabilities, &vht_cap);
#endif /* CONFIG_IEEE80211AC */
if (hostapd_sta_add(hapd, sta->addr, sta->aid, sta->capability, if (hostapd_sta_add(hapd, sta->addr, sta->aid, sta->capability,
sta->supported_rates, sta->supported_rates_len, sta->supported_rates, sta->supported_rates_len,
sta->listen_interval, sta->listen_interval,
sta->flags & WLAN_STA_HT ? &ht_cap : NULL, sta->flags & WLAN_STA_HT ? &ht_cap : NULL,
sta->flags & WLAN_STA_VHT ? &vht_cap : NULL,
sta->flags, sta->qosinfo)) { sta->flags, sta->qosinfo)) {
hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
HOSTAPD_LEVEL_NOTICE, HOSTAPD_LEVEL_NOTICE,

View file

@ -53,6 +53,9 @@ void ieee802_11_send_sa_query_req(struct hostapd_data *hapd,
void hostapd_get_ht_capab(struct hostapd_data *hapd, void hostapd_get_ht_capab(struct hostapd_data *hapd,
struct ieee80211_ht_capabilities *ht_cap, struct ieee80211_ht_capabilities *ht_cap,
struct ieee80211_ht_capabilities *neg_ht_cap); struct ieee80211_ht_capabilities *neg_ht_cap);
void hostapd_get_vht_capab(struct hostapd_data *hapd,
struct ieee80211_vht_capabilities *vht_cap,
struct ieee80211_vht_capabilities *neg_vht_cap);
u16 copy_sta_ht_capab(struct hostapd_data *hapd, struct sta_info *sta, u16 copy_sta_ht_capab(struct hostapd_data *hapd, struct sta_info *sta,
const u8 *ht_capab, size_t ht_capab_len); const u8 *ht_capab, size_t ht_capab_len);
void update_ht_state(struct hostapd_data *hapd, struct sta_info *sta); void update_ht_state(struct hostapd_data *hapd, struct sta_info *sta);

View file

@ -108,3 +108,14 @@ u16 copy_sta_vht_capab(struct hostapd_data *hapd, struct sta_info *sta,
return WLAN_STATUS_SUCCESS; return WLAN_STATUS_SUCCESS;
} }
void hostapd_get_vht_capab(struct hostapd_data *hapd,
struct ieee80211_vht_capabilities *vht_cap,
struct ieee80211_vht_capabilities *neg_vht_cap)
{
if (vht_cap == NULL)
return;
os_memcpy(neg_vht_cap, vht_cap, sizeof(*neg_vht_cap));
/* TODO: mask own capabilities, like get_ht_capab() */
}

View file

@ -898,6 +898,7 @@ struct hostapd_sta_add_params {
size_t supp_rates_len; size_t supp_rates_len;
u16 listen_interval; u16 listen_interval;
const struct ieee80211_ht_capabilities *ht_capabilities; const struct ieee80211_ht_capabilities *ht_capabilities;
const struct ieee80211_vht_capabilities *vht_capabilities;
u32 flags; /* bitmask of WPA_STA_* flags */ u32 flags; /* bitmask of WPA_STA_* flags */
int set; /* Set STA parameters instead of add */ int set; /* Set STA parameters instead of add */
u8 qosinfo; u8 qosinfo;