]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix AP mode HT Capabilities IE to use A-MPDU Parameters from the driver
authorJouni Malinen <j@w1.fi>
Sun, 29 Nov 2009 10:21:26 +0000 (12:21 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 29 Nov 2009 10:21:26 +0000 (12:21 +0200)
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
src/drivers/driver.h
src/drivers/driver_nl80211.c

index acd052eecd50774519d14ba286d88595eae2838d..eec5e65ad44d55ef4744cbca33ff84d853c37fe4 100644 (file)
@@ -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);
 
index 9c6c1085957912774dba8ea6d79ab4a75c7dd9e6..3fd8145bbcdbd83c6a77b3787dc1622cb9415bd3 100644 (file)
@@ -52,6 +52,7 @@ struct hostapd_hw_modes {
        struct hostapd_rate_data *rates;
        u16 ht_capab;
        u8 mcs_set[16];
+       u8 a_mpdu_params;
 };
 
 
index ad279a19da57b61313c74b624d23997b4cd8d260..466e460a8a87ad9d0a5f1a0a3b6819c83ab01413 100644 (file)
@@ -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;