Browse Source

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.
Jouni Malinen 15 years ago
parent
commit
be8eb8ab3e
3 changed files with 14 additions and 6 deletions
  1. 1 6
      hostapd/ieee802_11.c
  2. 1 0
      src/drivers/driver.h
  3. 12 0
      src/drivers/driver_nl80211.c

+ 1 - 6
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);
 

+ 1 - 0
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;
 };
 
 

+ 12 - 0
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;