HT: Remove unneeded struct ht_cap_ie wrapper

It is simpler to just use the HT Capabilities IE payload structure
as-is.
This commit is contained in:
Jouni Malinen 2009-11-29 13:04:21 +02:00
parent 3a328c8133
commit fc4e2d9501
6 changed files with 14 additions and 27 deletions

View file

@ -217,7 +217,7 @@ static inline int
hostapd_sta_add(const char *ifname, struct hostapd_data *hapd, const u8 *addr, hostapd_sta_add(const char *ifname, struct hostapd_data *hapd, const u8 *addr,
u16 aid, u16 capability, const u8 *supp_rates, u16 aid, u16 capability, const u8 *supp_rates,
size_t supp_rates_len, int flags, u16 listen_interval, size_t supp_rates_len, int flags, u16 listen_interval,
const struct ht_cap_ie *ht_capabilities) const struct ieee80211_ht_capabilities *ht_capabilities)
{ {
struct hostapd_sta_add_params params; struct hostapd_sta_add_params params;

View file

@ -858,11 +858,7 @@ static void handle_assoc(struct hostapd_data *hapd,
elems.ht_capabilities_len >= elems.ht_capabilities_len >=
sizeof(struct ieee80211_ht_capabilities)) { sizeof(struct ieee80211_ht_capabilities)) {
sta->flags |= WLAN_STA_HT; sta->flags |= WLAN_STA_HT;
sta->ht_capabilities.id = WLAN_EID_HT_CAP; os_memcpy(&sta->ht_capabilities, elems.ht_capabilities,
sta->ht_capabilities.length =
sizeof(struct ieee80211_ht_capabilities);
os_memcpy(&sta->ht_capabilities.data,
elems.ht_capabilities,
sizeof(struct ieee80211_ht_capabilities)); sizeof(struct ieee80211_ht_capabilities));
} else } else
sta->flags &= ~WLAN_STA_HT; sta->flags &= ~WLAN_STA_HT;
@ -1037,7 +1033,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.ht_capabilities_info); sta->ht_capabilities.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) {
@ -1583,19 +1579,19 @@ static void handle_auth_cb(struct hostapd_data *hapd,
#ifdef CONFIG_IEEE80211N #ifdef CONFIG_IEEE80211N
static void static void
hostapd_get_ht_capab(struct hostapd_data *hapd, hostapd_get_ht_capab(struct hostapd_data *hapd,
struct ht_cap_ie *ht_cap_ie, struct ieee80211_ht_capabilities *ht_cap,
struct ht_cap_ie *neg_ht_cap_ie) struct ieee80211_ht_capabilities *neg_ht_cap)
{ {
u16 cap; u16 cap;
os_memcpy(neg_ht_cap_ie, ht_cap_ie, sizeof(struct ht_cap_ie)); os_memcpy(neg_ht_cap, ht_cap, sizeof(*neg_ht_cap));
cap = le_to_host16(neg_ht_cap_ie->data.ht_capabilities_info); cap = le_to_host16(neg_ht_cap->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.ht_capabilities_info = host_to_le16(cap); neg_ht_cap->ht_capabilities_info = host_to_le16(cap);
} }
#endif /* CONFIG_IEEE80211N */ #endif /* CONFIG_IEEE80211N */
@ -1608,9 +1604,9 @@ 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;
#ifdef CONFIG_IEEE80211N #ifdef CONFIG_IEEE80211N
struct ht_cap_ie ht_cap; struct ieee80211_ht_capabilities ht_cap;
#endif /* CONFIG_IEEE80211N */ #endif /* CONFIG_IEEE80211N */
struct ht_cap_ie *ht_cap_ptr = NULL; struct ieee80211_ht_capabilities *ht_cap_ptr = NULL;
int set_flags, flags_and, flags_or; int set_flags, flags_and, flags_or;
if (!ok) { if (!ok) {

View file

@ -80,7 +80,7 @@ struct sta_info {
int vlan_id; int vlan_id;
#ifdef CONFIG_IEEE80211N #ifdef CONFIG_IEEE80211N
struct ht_cap_ie ht_capabilities; /* IEEE 802.11n capabilities */ struct ieee80211_ht_capabilities ht_capabilities;
#endif /* CONFIG_IEEE80211N */ #endif /* CONFIG_IEEE80211N */
#ifdef CONFIG_IEEE80211W #ifdef CONFIG_IEEE80211W

View file

@ -379,12 +379,6 @@ struct ieee80211_ht_operation {
u8 basic_set[16]; u8 basic_set[16];
} STRUCT_PACKED; } STRUCT_PACKED;
struct ht_cap_ie {
u8 id;
u8 length;
struct ieee80211_ht_capabilities data;
} STRUCT_PACKED;
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma pack(pop) #pragma pack(pop)
#endif /* _MSC_VER */ #endif /* _MSC_VER */

View file

@ -443,7 +443,7 @@ struct hostapd_sta_add_params {
size_t supp_rates_len; size_t supp_rates_len;
int flags; int flags;
u16 listen_interval; u16 listen_interval;
const struct ht_cap_ie *ht_capabilities; const struct ieee80211_ht_capabilities *ht_capabilities;
}; };
struct hostapd_freq_params { struct hostapd_freq_params {

View file

@ -2600,14 +2600,11 @@ static int wpa_driver_nl80211_sta_add(const char *ifname, void *priv,
params->supp_rates); params->supp_rates);
NLA_PUT_U16(msg, NL80211_ATTR_STA_LISTEN_INTERVAL, NLA_PUT_U16(msg, NL80211_ATTR_STA_LISTEN_INTERVAL,
params->listen_interval); params->listen_interval);
#ifdef CONFIG_IEEE80211N
if (params->ht_capabilities) { if (params->ht_capabilities) {
NLA_PUT(msg, NL80211_ATTR_HT_CAPABILITY, NLA_PUT(msg, NL80211_ATTR_HT_CAPABILITY,
params->ht_capabilities->length, sizeof(*params->ht_capabilities),
&params->ht_capabilities->data); params->ht_capabilities);
} }
#endif /* CONFIG_IEEE80211N */
ret = send_and_recv_msgs(drv, msg, NULL, NULL); ret = send_and_recv_msgs(drv, msg, NULL, NULL);
if (ret) if (ret)