From patchwork Thu Mar 27 06:58:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilan Peer X-Patchwork-Id: 334229 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0AB52140087 for ; Thu, 27 Mar 2014 17:57:00 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 9CB789C12D; Thu, 27 Mar 2014 02:56:22 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8U-KHKFRQrND; Thu, 27 Mar 2014 02:56:22 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 071369C137; Thu, 27 Mar 2014 02:56:03 -0400 (EDT) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 001709C0DA for ; Thu, 27 Mar 2014 02:55:59 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tpr--tX85uTg for ; Thu, 27 Mar 2014 02:55:59 -0400 (EDT) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id C15749C0DF for ; Thu, 27 Mar 2014 02:55:44 -0400 (EDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 26 Mar 2014 23:55:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,739,1389772800"; d="scan'208";a="481144720" Received: from unknown (HELO ipeer-e6430-1.jer.intel.com) ([10.12.217.170]) by orsmga001.jf.intel.com with ESMTP; 26 Mar 2014 23:55:43 -0700 From: Ilan Peer To: hostap@lists.shmoo.com Subject: [PATCH] wpa_supplicant: override ht amdpu size if vht ampdu was overridden Date: Thu, 27 Mar 2014 08:58:32 +0200 Message-Id: <1395903514-843-5-git-send-email-ilan.peer@intel.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1395903514-843-1-git-send-email-ilan.peer@intel.com> References: <1395903514-843-1-git-send-email-ilan.peer@intel.com> Cc: Eliad Peller X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.11 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com From: Eliad Peller 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 --- wpa_supplicant/wpa_supplicant.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 |= \