From patchwork Thu Feb 26 10:11:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 5890401 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C0B4BBF440 for ; Thu, 26 Feb 2015 10:12:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BF2C22013D for ; Thu, 26 Feb 2015 10:12:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 33C862010E for ; Thu, 26 Feb 2015 10:12:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752761AbbBZKMf (ORCPT ); Thu, 26 Feb 2015 05:12:35 -0500 Received: from mail-lb0-f172.google.com ([209.85.217.172]:33283 "EHLO mail-lb0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751216AbbBZKMe (ORCPT ); Thu, 26 Feb 2015 05:12:34 -0500 Received: by lbvp9 with SMTP id p9so9799199lbv.0 for ; Thu, 26 Feb 2015 02:12:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id; bh=v/WxOC6k4klQ+8GDW+aUyQ7ZJVT6rEQYMI2XYPWuihI=; b=HIQzeR8GUszbqaV9WVdjCdwW1Vxg2/AohALHBJBG6RyidSxnsMoZd8Qs6YOr6arc7b 2GSLv4KigUFTNYrSy72TLuZszJvq+SebMsl5IMhu62e2UIYLX56WJNhRQ3TOrBQ9B+Tl T1XUjG1ZNi516NMyiTqG0NvpG0kSd7T+iT/kc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=v/WxOC6k4klQ+8GDW+aUyQ7ZJVT6rEQYMI2XYPWuihI=; b=WO0wje0rV7c/J6IomIkhg8yngH0cXe3xkV11YVLPe9FuxPblcEF0o5xpme3uEzZGOH FPUu6fqxSwqXAwstf8Iux6n+L6Qkxd0YxFOzwz34bTQMG3nj5uLN1+vsww96HunjtNCE 2ecVooH2Z8bL61AdRc/kpP8K35zfrYWvJA68kgau/ANpvYgaAyt1rr6ixFKGOeqb9i11 752gv+ief/E285vuL/InwcVnGQPWpTiWfKoEw0nJgN6XFDRJE1FJmzjCgtehnyaV9BgW CijbYMti9JmQg2Zfzya3G7k78A0AuCOcdnt79/2s+tnSGI8/iVhpPP9aJGYPLVkL59Kp wjNQ== X-Gm-Message-State: ALoCoQl0xHy41kyvCpNrcqBMjEFvnTocna86/Mkgid/A42YNjhqsmh5uQW5eEeUtaPr8VSkOvGWnML6/TG4nrkvRNCYD6zGWhq/ZcDdWJj2nzdwxsOIg5vzz5c70cHgaLbnrMAMcvP2H X-Received: by 10.112.162.232 with SMTP id yd8mr1593715lbb.41.1424945552709; Thu, 26 Feb 2015 02:12:32 -0800 (PST) Received: from bob.homerouter.cpe (apn-77-113-114-198.dynamic.gprs.plus.pl. [77.113.114.198]) by mx.google.com with ESMTPSA id la5sm98630lac.0.2015.02.26.02.12.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Feb 2015 02:12:32 -0800 (PST) From: Michal Kazior To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Michal Kazior Subject: [PATCH] ath10k: fix TxBF VHT capabilities for 2+ RF-chain devices Date: Thu, 26 Feb 2015 11:11:22 +0100 Message-Id: <1424945482-9765-1-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.5.3 X-DomainID: tieto.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Firmware doesn't report a complete and ready-to-use vht cap. Instead the driver is supposed to fill in the missing bits related to number of chains. This effectively increases Compressed Steering Number and Number of Sounding Dimensions in AssocReq frames for devices with more than one RF chain and should improve TxBF performance. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/mac.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 0f39af7..383250e 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -5263,11 +5263,30 @@ static struct ieee80211_sta_vht_cap ath10k_create_vht_cap(struct ath10k *ar) { struct ieee80211_sta_vht_cap vht_cap = {0}; u16 mcs_map; + u32 val; int i; vht_cap.vht_supported = 1; vht_cap.cap = ar->vht_cap_info; + if (ar->vht_cap_info & (IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE | + IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE)) { + val = ar->num_rf_chains - 1; + val <<= IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT; + val &= IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK; + + vht_cap.cap |= val; + } + + if (ar->vht_cap_info & (IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE | + IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE)) { + val = ar->num_rf_chains - 1; + val <<= IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT; + val &= IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK; + + vht_cap.cap |= val; + } + mcs_map = 0; for (i = 0; i < 8; i++) { if (i < ar->num_rf_chains)