From patchwork Fri Mar 24 07:57:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: c_vnaral@qti.qualcomm.com X-Patchwork-Id: 9642345 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2B9FD60327 for ; Fri, 24 Mar 2017 07:58:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 135612841F for ; Fri, 24 Mar 2017 07:58:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0774C28446; Fri, 24 Mar 2017 07:58:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8678A2841F for ; Fri, 24 Mar 2017 07:58:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=9kZiKXIJbdOJRyKLswBfd9y6q+bfpqD2Nlm5vnhf4zU=; b=K5Vocty3I8ncic 95g4DNrSsq3dy7ID9zVHA3AUOcIYgkLokYMCL7qvpMNa1MXa2VxPK8B0VCL+4zkyMVxB/dNZTlWYc 83D+zGPibWRK1aE5MXcy69y8zGCTuOOIk5OWwEEY0gTGAdyOJvzWDpp5FxMYXszmIf3gVMPz3a20T 4FacwZkKNTHzgl9mFp+6zTKtUHUaMv3fliFG5zuQeAef5iQVDzsS+yIVYtrochxcU8Y1mlpnS1Fxw 3U5qtQPVXFvm5xDQpeT3M9ewkTa0IHFJyEcQYYThg1A/l8/eugCMw2eU0ueMfC5ARK7z0Y2Nr8rPW CtuxwA7oGlUGm/njl1nQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1crK6m-0007aA-Df; Fri, 24 Mar 2017 07:58:04 +0000 Received: from wolverine01.qualcomm.com ([199.106.114.254]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1crK6j-0007Xy-4R for ath10k@lists.infradead.org; Fri, 24 Mar 2017 07:58:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1490342281; x=1521878281; h=from:to:cc:subject:date:message-id:mime-version; bh=NiKEpN+WP2/dajOFgWFAflLV4PXMXevrHK900FfOsUM=; b=DrGuYWLMjPwHGZwTSnGpW9PZiSh75w9RRYdaFfMQ/NYyJeTaXGa11bX2 gYDrS35bV1aIh79Io0uCQEYaZL29bcMacDGafIDQ5gmm7/LHRznBEBzD/ 125XNM3saxqPyMEymQI00cLjiMrO0ZwMmiTiDFy6R631wg1R/fGzeIiI6 k=; X-IronPort-AV: E=Sophos;i="5.36,214,1486454400"; d="scan'208";a="272395354" Received: from unknown (HELO ironmsg02-R.qualcomm.com) ([10.53.140.106]) by wolverine01.qualcomm.com with ESMTP; 24 Mar 2017 00:57:35 -0700 X-IronPort-AV: E=McAfee;i="5800,7501,8476"; a="925296196" X-MGA-submission: =?us-ascii?q?MDEJgUXC2hDFIwKr+qU/xHQ5EdT8ZryfCrL2gr?= =?us-ascii?q?DpQ/Jo3NQtllwIOPR8fRTpelGaXrKLE1AhiMHSYS12y6nSjja1lbfm7D?= =?us-ascii?q?4Cbmf0MG8RSEysA+BT1h8i1mIJUyII5hBCAU8FmaeNb8CcevwbcZ95bb?= =?us-ascii?q?YY?= Received: from nasanexm01b.na.qualcomm.com ([10.85.0.82]) by ironmsg02-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 24 Mar 2017 00:57:35 -0700 Received: from aphydexm01f.ap.qualcomm.com (10.252.127.15) by NASANEXM01B.na.qualcomm.com (10.85.0.82) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Fri, 24 Mar 2017 00:57:34 -0700 Received: from localhost (10.80.80.8) by aphydexm01f.ap.qualcomm.com (10.252.127.15) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Fri, 24 Mar 2017 13:27:29 +0530 From: To: Subject: [PATCH] ath10k: fix station nss computation Date: Fri, 24 Mar 2017 13:27:28 +0530 Message-ID: <1490342248-6213-1-git-send-email-c_vnaral@qti.qualcomm.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanexm01a.na.qualcomm.com (10.85.0.81) To aphydexm01f.ap.qualcomm.com (10.252.127.15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170324_005801_286699_A2A9EE7B X-CRM114-Status: UNSURE ( 8.57 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Venkateswara Rao Naralasetty , linux-wireless@vger.kernel.org Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Venkateswara Rao Naralasetty If station advertises diffferent NSS capabilities in Rx_mcs set of HT and VHT IEs in assoc req, the current NSS computation logic configures the NSS support only based on Rx_mcs set of HT capabilities in the driver. This is configuring the station NSS capabilities incorreclty in the target. For example, if station advertise Rx_mcs set as 2 spatial streams in HT capabilities and 1 spatial streams in VHT capabilities in assoc request, as per current logic we are calculating nss from HT capabilities and the driver sets peer_num_spatial_streams as 2 for the station which is configured in VHT 1*1. This patchs fix this issue by calculating the nss from VHT cap if station supports vht. Signed-off-by: Venkateswara Rao Naralasetty --- drivers/net/wireless/ath/ath10k/mac.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 87a9b55..389f369 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -2451,6 +2451,8 @@ static void ath10k_peer_assoc_h_vht(struct ath10k *ar, enum nl80211_band band; const u16 *vht_mcs_mask; u8 ampdu_factor; + u8 max_nss, vht_mcs; + int i; if (WARN_ON(ath10k_mac_vif_chan(vif, &def))) return; @@ -2489,6 +2491,18 @@ static void ath10k_peer_assoc_h_vht(struct ath10k *ar, if (sta->bandwidth == IEEE80211_STA_RX_BW_160) arg->peer_flags |= ar->wmi.peer_flags->bw160; + /* Calculate peer NSS capability from VHT capabilities if STA + * supports VHT. + */ + for (i = 0, max_nss = 0, vht_mcs = 0; i < NL80211_VHT_NSS_MAX; i++) { + vht_mcs = __le16_to_cpu(vht_cap->vht_mcs.rx_mcs_map) >> + (2 * i) & 3; + + if ((vht_mcs != IEEE80211_VHT_MCS_NOT_SUPPORTED) && + vht_mcs_mask[i]) + max_nss = i + 1; + } + arg->peer_num_spatial_streams = min(sta->rx_nss, max_nss); arg->peer_vht_rates.rx_max_rate = __le16_to_cpu(vht_cap->vht_mcs.rx_highest); arg->peer_vht_rates.rx_mcs_set =