From be8eb8ab3ee42aa66930aea827bdcb05a2172276 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 29 Nov 2009 12:21:26 +0200 Subject: [PATCH] Fix AP mode HT Capabilities IE to use A-MPDU Parameters from the driver Instead of using hardcoded maximum A-MPDU length of 64 kB and no restrictions on minimum MPDU Start Spacing, use the correct values reported by the driver. --- hostapd/ieee802_11.c | 7 +------ src/drivers/driver.h | 1 + src/drivers/driver_nl80211.c | 12 ++++++++++++ 3 files changed, 14 insertions(+), 6 deletions(-) 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;