Browse Source

Fix MCS set field to be based on driver info

Instead of using hardcoded Rx MCS bitmask (indexes 0..15 enabled),
use the real information from the driver capabilities.
Jouni Malinen 15 years ago
parent
commit
08eb154db5
3 changed files with 10 additions and 3 deletions
  1. 2 3
      hostapd/ieee802_11.c
  2. 1 0
      src/drivers/driver.h
  3. 7 0
      src/drivers/driver_nl80211.c

+ 2 - 3
hostapd/ieee802_11.c

@@ -120,9 +120,8 @@ u8 * hostapd_eid_ht_capabilities_info(struct hostapd_data *hapd, u8 *eid)
 		    MAX_RX_AMPDU_FACTOR_64KB);
 		    MAX_RX_AMPDU_FACTOR_64KB);
 
 
 	cap->capabilities_info = host_to_le16(hapd->iconf->ht_capab);
 	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);
  	pos += sizeof(*cap);
 
 

+ 1 - 0
src/drivers/driver.h

@@ -51,6 +51,7 @@ struct hostapd_hw_modes {
 	int num_rates;
 	int num_rates;
 	struct hostapd_rate_data *rates;
 	struct hostapd_rate_data *rates;
 	u16 ht_capab;
 	u16 ht_capab;
+	u8 mcs_set[16];
 };
 };
 
 
 
 

+ 7 - 0
src/drivers/driver_nl80211.c

@@ -2229,6 +2229,13 @@ static int phy_info_handler(struct nl_msg *msg, void *arg)
 				tb_band[NL80211_BAND_ATTR_HT_CAPA]);
 				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_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_parse(tb_freq, NL80211_FREQUENCY_ATTR_MAX, nla_data(nl_freq),
 				  nla_len(nl_freq), freq_policy);
 				  nla_len(nl_freq), freq_policy);