diff --git a/hostapd/ieee802_11.c b/hostapd/ieee802_11.c index acd052eec..eec5e65ad 100644 --- a/hostapd/ieee802_11.c +++ b/hostapd/ieee802_11.c @@ -116,12 +116,7 @@ u8 * hostapd_eid_ht_capabilities(struct hostapd_data *hapd, u8 *eid) cap = (struct ieee80211_ht_capabilities *) pos; os_memset(cap, 0, sizeof(*cap)); cap->ht_capabilities_info = host_to_le16(hapd->iconf->ht_capab); - - /* FIX: from driver */ - SET_2BIT_U8(&cap->a_mpdu_params, - MAC_HT_PARAM_INFO_MAX_RX_AMPDU_FACTOR_OFFSET, - MAX_RX_AMPDU_FACTOR_64KB); - + cap->a_mpdu_params = hapd->iface->current_mode->a_mpdu_params; os_memcpy(cap->supported_mcs_set, hapd->iface->current_mode->mcs_set, 16); diff --git a/src/drivers/driver.h b/src/drivers/driver.h index 9c6c10859..3fd8145bb 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -52,6 +52,7 @@ struct hostapd_hw_modes { struct hostapd_rate_data *rates; u16 ht_capab; u8 mcs_set[16]; + u8 a_mpdu_params; }; diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index ad279a19d..466e460a8 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -2186,6 +2186,18 @@ 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_AMPDU_FACTOR]) { + mode->a_mpdu_params |= nla_get_u8( + tb_band[NL80211_BAND_ATTR_HT_AMPDU_FACTOR]) & + 0x03; + } + + if (tb_band[NL80211_BAND_ATTR_HT_AMPDU_DENSITY]) { + mode->a_mpdu_params |= nla_get_u8( + tb_band[NL80211_BAND_ATTR_HT_AMPDU_DENSITY]) << + 2; + } + if (tb_band[NL80211_BAND_ATTR_HT_MCS_SET] && nla_len(tb_band[NL80211_BAND_ATTR_HT_MCS_SET])) { u8 *mcs;