Rename HT Capabilities IE fields to match with IEEE Std 802.11n-2009

This commit is contained in:
Jouni Malinen 2009-11-29 12:02:29 +02:00
parent 15ef92d3cc
commit a49148fd55
4 changed files with 31 additions and 25 deletions

View File

@ -2,7 +2,7 @@
* hostapd / IEEE 802.11 Management: Beacon and Probe Request/Response * hostapd / IEEE 802.11 Management: Beacon and Probe Request/Response
* Copyright (c) 2002-2004, Instant802 Networks, Inc. * Copyright (c) 2002-2004, Instant802 Networks, Inc.
* Copyright (c) 2005-2006, Devicescape Software, Inc. * Copyright (c) 2005-2006, Devicescape Software, Inc.
* Copyright (c) 2008, Jouni Malinen <j@w1.fi> * Copyright (c) 2008-2009, Jouni Malinen <j@w1.fi>
* Copyright (c) 2007-2008, Intel Corporation * Copyright (c) 2007-2008, Intel Corporation
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -301,7 +301,7 @@ void handle_probe_req(struct hostapd_data *hapd, struct ieee80211_mgmt *mgmt,
/* Wi-Fi Alliance WMM */ /* Wi-Fi Alliance WMM */
pos = hostapd_eid_wmm(hapd, pos); pos = hostapd_eid_wmm(hapd, pos);
pos = hostapd_eid_ht_capabilities_info(hapd, pos); pos = hostapd_eid_ht_capabilities(hapd, pos);
pos = hostapd_eid_ht_operation(hapd, pos); pos = hostapd_eid_ht_operation(hapd, pos);
#ifdef CONFIG_WPS #ifdef CONFIG_WPS
@ -402,7 +402,7 @@ void ieee802_11_set_beacon(struct hostapd_data *hapd)
if (hapd->iconf->ieee80211n) { if (hapd->iconf->ieee80211n) {
u8 *ht_capab, *ht_oper; u8 *ht_capab, *ht_oper;
ht_capab = tailpos; ht_capab = tailpos;
tailpos = hostapd_eid_ht_capabilities_info(hapd, tailpos); tailpos = hostapd_eid_ht_capabilities(hapd, tailpos);
ht_oper = tailpos; ht_oper = tailpos;
tailpos = hostapd_eid_ht_operation(hapd, tailpos); tailpos = hostapd_eid_ht_operation(hapd, tailpos);

View File

@ -1,6 +1,6 @@
/* /*
* hostapd / IEEE 802.11 Management * hostapd / IEEE 802.11 Management
* Copyright (c) 2002-2008, Jouni Malinen <j@w1.fi> * Copyright (c) 2002-2009, Jouni Malinen <j@w1.fi>
* Copyright (c) 2007-2008, Intel Corporation * Copyright (c) 2007-2008, Intel Corporation
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -101,10 +101,10 @@ u8 * hostapd_eid_ext_supp_rates(struct hostapd_data *hapd, u8 *eid)
} }
u8 * hostapd_eid_ht_capabilities_info(struct hostapd_data *hapd, u8 *eid) u8 * hostapd_eid_ht_capabilities(struct hostapd_data *hapd, u8 *eid)
{ {
#ifdef CONFIG_IEEE80211N #ifdef CONFIG_IEEE80211N
struct ieee80211_ht_capability *cap; struct ieee80211_ht_capabilities *cap;
u8 *pos = eid; u8 *pos = eid;
if (!hapd->iconf->ieee80211n) if (!hapd->iconf->ieee80211n)
@ -113,16 +113,22 @@ u8 * hostapd_eid_ht_capabilities_info(struct hostapd_data *hapd, u8 *eid)
*pos++ = WLAN_EID_HT_CAP; *pos++ = WLAN_EID_HT_CAP;
*pos++ = sizeof(*cap); *pos++ = sizeof(*cap);
cap = (struct ieee80211_ht_capability *) pos; cap = (struct ieee80211_ht_capabilities *) pos;
os_memset(cap, 0, sizeof(*cap)); os_memset(cap, 0, sizeof(*cap));
SET_2BIT_U8(&cap->mac_ht_params_info, cap->ht_capabilities_info = host_to_le16(hapd->iconf->ht_capab);
/* FIX: from driver */
SET_2BIT_U8(&cap->a_mpdu_params,
MAC_HT_PARAM_INFO_MAX_RX_AMPDU_FACTOR_OFFSET, MAC_HT_PARAM_INFO_MAX_RX_AMPDU_FACTOR_OFFSET,
MAX_RX_AMPDU_FACTOR_64KB); MAX_RX_AMPDU_FACTOR_64KB);
cap->capabilities_info = host_to_le16(hapd->iconf->ht_capab);
os_memcpy(cap->supported_mcs_set, hapd->iface->current_mode->mcs_set, os_memcpy(cap->supported_mcs_set, hapd->iface->current_mode->mcs_set,
16); 16);
/* TODO: ht_extended_capabilities (now fully disabled) */
/* TODO: tx_bf_capability_info (now fully disabled) */
/* TODO: asel_capabilities (now fully disabled) */
pos += sizeof(*cap); pos += sizeof(*cap);
return pos; return pos;
@ -855,14 +861,14 @@ static void handle_assoc(struct hostapd_data *hapd,
os_memset(&sta->ht_capabilities, 0, sizeof(sta->ht_capabilities)); os_memset(&sta->ht_capabilities, 0, sizeof(sta->ht_capabilities));
if (elems.ht_capabilities && if (elems.ht_capabilities &&
elems.ht_capabilities_len >= elems.ht_capabilities_len >=
sizeof(struct ieee80211_ht_capability)) { sizeof(struct ieee80211_ht_capabilities)) {
sta->flags |= WLAN_STA_HT; sta->flags |= WLAN_STA_HT;
sta->ht_capabilities.id = WLAN_EID_HT_CAP; sta->ht_capabilities.id = WLAN_EID_HT_CAP;
sta->ht_capabilities.length = sta->ht_capabilities.length =
sizeof(struct ieee80211_ht_capability); sizeof(struct ieee80211_ht_capabilities);
os_memcpy(&sta->ht_capabilities.data, os_memcpy(&sta->ht_capabilities.data,
elems.ht_capabilities, elems.ht_capabilities,
sizeof(struct ieee80211_ht_capability)); sizeof(struct ieee80211_ht_capabilities));
} else } else
sta->flags &= ~WLAN_STA_HT; sta->flags &= ~WLAN_STA_HT;
#endif /* CONFIG_IEEE80211N */ #endif /* CONFIG_IEEE80211N */
@ -1036,7 +1042,7 @@ static void handle_assoc(struct hostapd_data *hapd,
#ifdef CONFIG_IEEE80211N #ifdef CONFIG_IEEE80211N
if (sta->flags & WLAN_STA_HT) { if (sta->flags & WLAN_STA_HT) {
u16 ht_capab = le_to_host16( u16 ht_capab = le_to_host16(
sta->ht_capabilities.data.capabilities_info); sta->ht_capabilities.data.ht_capabilities_info);
wpa_printf(MSG_DEBUG, "HT: STA " MACSTR " HT Capabilities " wpa_printf(MSG_DEBUG, "HT: STA " MACSTR " HT Capabilities "
"Info: 0x%04x", MAC2STR(sta->addr), ht_capab); "Info: 0x%04x", MAC2STR(sta->addr), ht_capab);
if ((ht_capab & HT_CAP_INFO_GREEN_FIELD) == 0) { if ((ht_capab & HT_CAP_INFO_GREEN_FIELD) == 0) {
@ -1147,7 +1153,7 @@ static void handle_assoc(struct hostapd_data *hapd,
if (sta->flags & WLAN_STA_WMM) if (sta->flags & WLAN_STA_WMM)
p = hostapd_eid_wmm(hapd, p); p = hostapd_eid_wmm(hapd, p);
p = hostapd_eid_ht_capabilities_info(hapd, p); p = hostapd_eid_ht_capabilities(hapd, p);
p = hostapd_eid_ht_operation(hapd, p); p = hostapd_eid_ht_operation(hapd, p);
#ifdef CONFIG_IEEE80211R #ifdef CONFIG_IEEE80211R
@ -1588,13 +1594,13 @@ hostapd_get_ht_capab(struct hostapd_data *hapd,
u16 cap; u16 cap;
os_memcpy(neg_ht_cap_ie, ht_cap_ie, sizeof(struct ht_cap_ie)); os_memcpy(neg_ht_cap_ie, ht_cap_ie, sizeof(struct ht_cap_ie));
cap = le_to_host16(neg_ht_cap_ie->data.capabilities_info); cap = le_to_host16(neg_ht_cap_ie->data.ht_capabilities_info);
cap &= hapd->iconf->ht_capab; cap &= hapd->iconf->ht_capab;
cap |= (hapd->iconf->ht_capab & HT_CAP_INFO_SMPS_DISABLED); cap |= (hapd->iconf->ht_capab & HT_CAP_INFO_SMPS_DISABLED);
/* FIXME: Rx STBC needs to be handled specially */ /* FIXME: Rx STBC needs to be handled specially */
cap |= (hapd->iconf->ht_capab & HT_CAP_INFO_RX_STBC_MASK); cap |= (hapd->iconf->ht_capab & HT_CAP_INFO_RX_STBC_MASK);
neg_ht_cap_ie->data.capabilities_info = host_to_le16(cap); neg_ht_cap_ie->data.ht_capabilities_info = host_to_le16(cap);
} }
#endif /* CONFIG_IEEE80211N */ #endif /* CONFIG_IEEE80211N */

View File

@ -52,7 +52,7 @@ u16 hostapd_own_capab_info(struct hostapd_data *hapd, struct sta_info *sta,
int probe); int probe);
u8 * hostapd_eid_supp_rates(struct hostapd_data *hapd, u8 *eid); u8 * hostapd_eid_supp_rates(struct hostapd_data *hapd, u8 *eid);
u8 * hostapd_eid_ext_supp_rates(struct hostapd_data *hapd, u8 *eid); u8 * hostapd_eid_ext_supp_rates(struct hostapd_data *hapd, u8 *eid);
u8 * hostapd_eid_ht_capabilities_info(struct hostapd_data *hapd, u8 *eid); u8 * hostapd_eid_ht_capabilities(struct hostapd_data *hapd, u8 *eid);
u8 * hostapd_eid_ht_operation(struct hostapd_data *hapd, u8 *eid); u8 * hostapd_eid_ht_operation(struct hostapd_data *hapd, u8 *eid);
int hostapd_ht_operation_update(struct hostapd_iface *iface); int hostapd_ht_operation_update(struct hostapd_iface *iface);
void ieee802_11_send_sa_query_req(struct hostapd_data *hapd, void ieee802_11_send_sa_query_req(struct hostapd_data *hapd,

View File

@ -1,6 +1,6 @@
/* /*
* IEEE 802.11 Frame type definitions * IEEE 802.11 Frame type definitions
* Copyright (c) 2002-2007, Jouni Malinen <j@w1.fi> * Copyright (c) 2002-2009, Jouni Malinen <j@w1.fi>
* Copyright (c) 2007-2008 Intel Corporation * Copyright (c) 2007-2008 Intel Corporation
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -392,13 +392,13 @@ enum {
}; };
struct ieee80211_ht_capability { struct ieee80211_ht_capabilities {
le16 capabilities_info; le16 ht_capabilities_info;
u8 mac_ht_params_info; u8 a_mpdu_params;
u8 supported_mcs_set[16]; u8 supported_mcs_set[16];
le16 extended_ht_capability_info; le16 ht_extended_capabilities;
le32 tx_BF_capability_info; le32 tx_bf_capability_info;
u8 antenna_selection_info; u8 asel_capabilities;
} STRUCT_PACKED; } STRUCT_PACKED;
@ -517,7 +517,7 @@ struct ieee80211_ht_operation {
struct ht_cap_ie { struct ht_cap_ie {
u8 id; u8 id;
u8 length; u8 length;
struct ieee80211_ht_capability data; struct ieee80211_ht_capabilities data;
} STRUCT_PACKED; } STRUCT_PACKED;