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.
This commit is contained in:
Jouni Malinen 2009-11-05 12:38:47 +02:00 committed by Jouni Malinen
parent 5a641ae01e
commit 08eb154db5
3 changed files with 10 additions and 3 deletions

View 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);

View file

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

View 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);