diff mbox

wpa_supplicant: override ht amdpu size if vht ampdu was overridden

Message ID 1395903514-843-5-git-send-email-ilan.peer@intel.com
State Accepted
Headers show

Commit Message

Peer, Ilan March 27, 2014, 6:58 a.m. UTC
From: Eliad Peller <eliad@wizery.com>

According to the spec, if the max ampdu vhtcap is <= 3, we
have to adjust the max ampdu htcap to the same value. Otherwise
it should be set to 3.

Take care of it when the max vht ampdu value was overridden.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
---
 wpa_supplicant/wpa_supplicant.c |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comments

Jouni Malinen March 27, 2014, 2:44 p.m. UTC | #1
On Thu, Mar 27, 2014 at 08:58:32AM +0200, Ilan Peer wrote:
> According to the spec, if the max ampdu vhtcap is <= 3, we
> have to adjust the max ampdu htcap to the same value. Otherwise
> it should be set to 3.
> 
> Take care of it when the max vht ampdu value was overridden.

Thanks, applied.
diff mbox

Patch

diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index dce1c00..14b084a 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -2957,6 +2957,10 @@  void wpa_supplicant_apply_vht_overrides(
 {
 	struct ieee80211_vht_capabilities *vhtcaps;
 	struct ieee80211_vht_capabilities *vhtcaps_mask;
+#ifdef CONFIG_HT_OVERRIDES
+	int max_ampdu;
+	const u32 max_ampdu_mask = VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MAX;
+#endif
 
 	if (!ssid)
 		return;
@@ -2972,6 +2976,20 @@  void wpa_supplicant_apply_vht_overrides(
 	vhtcaps->vht_capabilities_info = ssid->vht_capa;
 	vhtcaps_mask->vht_capabilities_info = ssid->vht_capa_mask;
 
+#ifdef CONFIG_HT_OVERRIDES
+	/* if max ampdu is <= 3, we have to make the ht cap the same */
+	if (ssid->vht_capa_mask & max_ampdu_mask) {
+		max_ampdu = (ssid->vht_capa & max_ampdu_mask) >>
+			    find_first_bit(max_ampdu_mask);
+
+		max_ampdu = max_ampdu < 3 ? max_ampdu : 3;
+		wpa_set_ampdu_factor(wpa_s,
+				     (void *)params->htcaps,
+				     (void *)params->htcaps_mask,
+				     max_ampdu);
+	}
+#endif
+
 #define OVERRIDE_MCS(i)							\
 	if (ssid->vht_tx_mcs_nss_ ##i >= 0) {				\
 		vhtcaps_mask->vht_supported_mcs_set.tx_map |=		\