From patchwork Wed Sep 2 11:20:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Markowski X-Patchwork-Id: 7111371 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A80989F1CD for ; Wed, 2 Sep 2015 11:21:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B6B8B20652 for ; Wed, 2 Sep 2015 11:21:37 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E93512062D for ; Wed, 2 Sep 2015 11:21:36 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZX66W-0003HB-Iu; Wed, 02 Sep 2015 11:21:24 +0000 Received: from mail-lb0-x22a.google.com ([2a00:1450:4010:c04::22a]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZX66T-0003E9-UG for ath10k@lists.infradead.org; Wed, 02 Sep 2015 11:21:23 +0000 Received: by lbcao8 with SMTP id ao8so3979882lbc.3 for ; Wed, 02 Sep 2015 04:20:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id; bh=2BQZfH4Aksh4mT5P4UTe3YU76QSzOtgMAB2y/6O6HTo=; b=NiaR8zEQdYhqIa7kmU7F7EGwOhUgX9M8OXqbIL0df0YwG+pNuTuhigDMKPWrqcMOn3 hmiD6Zk0F9kEeMJJGz+hzPuALLmg3tTcMkFWe1A+EPQ3jWyBu/CbU9Q/gQo3SomrX1eh WbKttr2j2W5IUMo+bfHqfR+JlwaXMvAnd1tBQ= 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=2BQZfH4Aksh4mT5P4UTe3YU76QSzOtgMAB2y/6O6HTo=; b=kjNpTU05u7xwxBmUSwp93ktx6XXZfF4DYCrhZSmE9w3w+WlcDC9qLMLgTcZN4boMmc wg/HzbAT2E7korDotl+THg63QzfKbKUu6H1aGZBjddTc7kLhjolvoA35lkqA3LNBBQXR 2WsaR29Mzs6wcLAVHWeHM7nTNyNssL1ADcCNNALgCLwW6Fo7yAtroZtOZ1gQIlCbmsxS OHXb/uT9O7TDlyCoa0jT18zzyr5fpbD5Xl0CDTuVQFVei/nbiTwt8JeKWz9mabhLamp9 sC1hqAF77jpq9n2UlXTs+oPuTcZwU9K7dSGpmFhZORXEXNp4Ua048+dr8KJmTmqpm7i2 A9OA== X-Gm-Message-State: ALoCoQmO65B3Hw1BpEw7IEm96Gd/75k062Gf+tI05qHNrkh8mPLPLleuqRgSxBkUIN9VdAKpwVIso14kmB24hrTfPxIUkD04/ORAZcX4Hab6F1UvRoBvpR22OkPFGI2gVUTbKEVVacUUKLXxgn7k+tvi1rly6EgGjIrrX7eAF+UNSqOlR2NydDZE5c2M2kwnepQ6ot4JZ/3z X-Received: by 10.112.184.137 with SMTP id eu9mr3266739lbc.21.1441192855492; Wed, 02 Sep 2015 04:20:55 -0700 (PDT) Received: from uw000975.eu.tieto.com ([91.198.246.10]) by smtp.gmail.com with ESMTPSA id yf5sm5480047lab.1.2015.09.02.04.20.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Sep 2015 04:20:54 -0700 (PDT) From: Bartosz Markowski To: ath10k@lists.infradead.org Subject: [PATCH 1/2] ath10k: fix beamformee VHT STS capability Date: Wed, 2 Sep 2015 13:20:19 +0200 Message-Id: <1441192820-8403-1-git-send-email-bartosz.markowski@tieto.com> X-Mailer: git-send-email 2.1.2 X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150902_042122_214764_25F292D9 X-CRM114-Status: GOOD ( 15.31 ) X-Spam-Score: -2.7 (--) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, Bartosz Markowski MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 The VHT STS CAP shall be reported by firmware to host, like in case of QCA99x0. For QCA6174 hw family this isn't set for some reason. So for this particular chips, let's assume it has the ability to support VHT NDP in up to 4 STSs (which is true by the way). Change the published beamformee STS cap accordingly to 3 or to what the firmware reports. Assumption so far, it suppose to be the num_rf_chains-1, was completely wrong. Signed-off-by: Bartosz Markowski --- drivers/net/wireless/ath/ath10k/mac.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 9bca37820848..25c20d18021a 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -4064,17 +4064,35 @@ static u32 get_nss_from_chainmask(u16 chain_mask) return 1; } +static int ath10k_mac_get_vht_cap_bf_sts(struct ath10k *ar) +{ + int nsts = ar->vht_cap_info; + nsts &= IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK; + nsts >>= IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT; + + /* If firmware does not deliver to host number of space-time + * streams supported, assume it support up to 4 BF STS and return + * the value for VHT CAP: nsts-1) + * */ + if (nsts == 0) + return 3; + + return nsts; +} + static int ath10k_mac_set_txbf_conf(struct ath10k_vif *arvif) { u32 value = 0; struct ath10k *ar = arvif->ar; + int nsts; if (ath10k_wmi_get_txbf_conf_scheme(ar) != WMI_TXBF_CONF_BEFORE_ASSOC) return 0; + nsts = ath10k_mac_get_vht_cap_bf_sts(ar); if (ar->vht_cap_info & (IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE | IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE)) - value |= SM((ar->num_rf_chains - 1), WMI_TXBF_STS_CAP_OFFSET); + value |= SM(nsts, WMI_TXBF_STS_CAP_OFFSET); if (ar->vht_cap_info & (IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE | IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE)) @@ -6803,7 +6821,7 @@ static struct ieee80211_sta_vht_cap ath10k_create_vht_cap(struct ath10k *ar) if (ar->vht_cap_info & (IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE | IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE)) { - val = ar->num_rf_chains - 1; + val = ath10k_mac_get_vht_cap_bf_sts(ar); val <<= IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT; val &= IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK;