Fix MCS set field to be based on driver info
authorJouni Malinen <jouni.malinen@atheros.com>
Thu, 5 Nov 2009 10:38:47 +0000 (12:38 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 5 Nov 2009 10:38:47 +0000 (12:38 +0200)
Instead of using hardcoded Rx MCS bitmask (indexes 0..15 enabled),
use the real information from the driver capabilities.

hostapd/ieee802_11.c
src/drivers/driver.h
src/drivers/driver_nl80211.c

index 6bad2d2..8132a6e 100644 (file)
@@ -120,9 +120,8 @@ u8 * hostapd_eid_ht_capabilities_info(struct hostapd_data *hapd, u8 *eid)
                    MAX_RX_AMPDU_FACTOR_64KB);
 
        cap->capabilities_info = host_to_le16(hapd->iconf->ht_capab);
-
-       cap->supported_mcs_set[0] = 0xff;
-       cap->supported_mcs_set[1] = 0xff;
+       os_memcpy(cap->supported_mcs_set, hapd->iface->current_mode->mcs_set,
+                 16);
 
        pos += sizeof(*cap);
 
index 9b44f13..89400cd 100644 (file)
@@ -51,6 +51,7 @@ struct hostapd_hw_modes {
        int num_rates;
        struct hostapd_rate_data *rates;
        u16 ht_capab;
+       u8 mcs_set[16];
 };
 
 
index 626d74f..d11141d 100644 (file)
@@ -2229,6 +2229,13 @@ static int phy_info_handler(struct nl_msg *msg, void *arg)
                                tb_band[NL80211_BAND_ATTR_HT_CAPA]);
                }
 
+               if (tb_band[NL80211_BAND_ATTR_HT_MCS_SET] &&
+                   nla_len(tb_band[NL80211_BAND_ATTR_HT_MCS_SET])) {
+                       u8 *mcs;
+                       mcs = nla_data(tb_band[NL80211_BAND_ATTR_HT_MCS_SET]);
+                       os_memcpy(mode->mcs_set, mcs, 16);
+               }
+
                nla_for_each_nested(nl_freq, tb_band[NL80211_BAND_ATTR_FREQS], rem_freq) {
                        nla_parse(tb_freq, NL80211_FREQUENCY_ATTR_MAX, nla_data(nl_freq),
                                  nla_len(nl_freq), freq_policy);