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: 7111351 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@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 B5D019F1CD for ; Wed, 2 Sep 2015 11:21:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BE0BE2035E for ; Wed, 2 Sep 2015 11:21:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 225112035B for ; Wed, 2 Sep 2015 11:21:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752853AbbIBLU6 (ORCPT ); Wed, 2 Sep 2015 07:20:58 -0400 Received: from mail-lb0-f173.google.com ([209.85.217.173]:35460 "EHLO mail-lb0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752138AbbIBLU5 (ORCPT ); Wed, 2 Sep 2015 07:20:57 -0400 Received: by lbpo4 with SMTP id o4so4003004lbp.2 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=E3UHcliI/RyG/Gx1X+6yWmH/z9uZAG5JJ5nYjrWYDQSRiUTPjyjCZ1Jof6GKQMRIkW TWvKtgYjaFbX0mMSiMDIiaUL6o96C8ZTadKXyXELmEMPakTJlRdzp+cneUBhq4lzEsYZ EXvO2pk0QLQGKmV1vUvEhxnA4Qz0ytx8OQ625UmgrNNzvXmKh/J/cEfFeonctiHsRYUO PY1Dyou3/ZsfsNjl8DvN2ZYvXgjjM0KbO45/4hDPbBnt1qXkBKHynw4aUdY1pEI00QcI RU0TMPAzl0NzLNuvRgtx8vEFFKMpGFutvU32NepXgvcyYoqaNJwF9wvbu6AGx7sU3ZPN 4w9w== X-Gm-Message-State: ALoCoQmQdHQNRLZrM3nwEYhJ9t2mSAuA/9ViCFM/Njk3Iyb3l1Bcs5E3I2Axao4WCHIQhOsMCd+HAP8oNuFRhnGryiRZNjczSTK6rbKefj+CWw9xLYWgcPJ5kcRnEujaXVzrMVZrP0/A 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 Cc: linux-wireless@vger.kernel.org, Bartosz Markowski 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 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 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;