Fixed HT Capabilities Info byte order processing for big endian CPUs

This commit is contained in:
Jouni Malinen 2008-11-24 16:06:18 +02:00 committed by Jouni Malinen
parent fc14f56759
commit 8725598c46
2 changed files with 10 additions and 8 deletions

View file

@ -963,16 +963,18 @@ 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) {
if ((sta->ht_capabilities.data.capabilities_info & u16 ht_capab = le_to_host16(
HT_CAP_INFO_GREEN_FIELD) == 0) { sta->ht_capabilities.data.capabilities_info);
wpa_printf(MSG_DEBUG, "HT: STA " MACSTR " HT Capabilities "
"Info: 0x%04x", MAC2STR(sta->addr), ht_capab);
if ((ht_capab & HT_CAP_INFO_GREEN_FIELD) == 0) {
hapd->iface->num_sta_ht_no_gf++; hapd->iface->num_sta_ht_no_gf++;
wpa_printf(MSG_DEBUG, "%s STA " MACSTR " - no " wpa_printf(MSG_DEBUG, "%s STA " MACSTR " - no "
"greenfield, num of non-gf stations %d", "greenfield, num of non-gf stations %d",
__func__, MAC2STR(sta->addr), __func__, MAC2STR(sta->addr),
hapd->iface->num_sta_ht_no_gf); hapd->iface->num_sta_ht_no_gf);
} }
if ((sta->ht_capabilities.data.capabilities_info & if ((ht_capab & HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET) == 0) {
HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET) == 0) {
hapd->iface->num_sta_ht_20mhz++; hapd->iface->num_sta_ht_20mhz++;
wpa_printf(MSG_DEBUG, "%s STA " MACSTR " - 20 MHz HT, " wpa_printf(MSG_DEBUG, "%s STA " MACSTR " - 20 MHz HT, "
"num of 20MHz HT STAs %d", "num of 20MHz HT STAs %d",

View file

@ -156,11 +156,11 @@ void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta)
#ifdef CONFIG_IEEE80211N #ifdef CONFIG_IEEE80211N
if (sta->flags & WLAN_STA_HT) { if (sta->flags & WLAN_STA_HT) {
if ((sta->ht_capabilities.data.capabilities_info & u16 ht_capab = le_to_host16(
HT_CAP_INFO_GREEN_FIELD) == 0) sta->ht_capabilities.data.capabilities_info);
if ((ht_capab & HT_CAP_INFO_GREEN_FIELD) == 0)
hapd->iface->num_sta_ht_no_gf--; hapd->iface->num_sta_ht_no_gf--;
if ((sta->ht_capabilities.data.capabilities_info & if ((ht_capab & HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET) == 0)
HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET) == 0)
hapd->iface->num_sta_ht_20mhz--; hapd->iface->num_sta_ht_20mhz--;
} else } else
hapd->iface->num_sta_no_ht--; hapd->iface->num_sta_no_ht--;