From patchwork Wed Sep 2 11:20:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Markowski X-Patchwork-Id: 7111361 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 1A611BEEC1 for ; Wed, 2 Sep 2015 11:21:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3D8D22038D for ; Wed, 2 Sep 2015 11:21:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 53F1C20376 for ; Wed, 2 Sep 2015 11:21:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753157AbbIBLVA (ORCPT ); Wed, 2 Sep 2015 07:21:00 -0400 Received: from mail-la0-f49.google.com ([209.85.215.49]:34728 "EHLO mail-la0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752622AbbIBLU6 (ORCPT ); Wed, 2 Sep 2015 07:20:58 -0400 Received: by laeb10 with SMTP id b10so4731427lae.1 for ; Wed, 02 Sep 2015 04:20:56 -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:in-reply-to:references; bh=3vbBMXJ8ja22CwxibSkRvpHzJpQsN6yvifDgfSjaSxk=; b=IQAn32lEunpmkYE0DeHzAExgpX7DLv/5W33yy/DG2Ea0iybt3Vdlr4xwlPwGbCcn+J Crv2lZuKQJAVH2qytksNCHydf+xYZf4ok2Elu5qTyLuqLJTUZgmzuSBD00AkocrHckil 6gHXUWjrUDfCjoL/iDPi4zXNVK6x30UfNjlXc= 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:in-reply-to :references; bh=3vbBMXJ8ja22CwxibSkRvpHzJpQsN6yvifDgfSjaSxk=; b=KtivPCEsNaTRPs7ILzvF+U3LdDRZfghW/j7wJ2qT+2+DyQKLzBydik7fKwDlFNF/K2 7wbASJOQX/1tfUVil05sNlFOdTRUoudvAXvJkezQ6eJLrFJbgrvhU99Is3tKcaq8zBEf E4W7BsQZbAmku7JTXHu7g2zl0V23JRV98w7zQ2oCXcih1S3jp5M3XFTGENWz2+Hc4iKw oJ87iTygt+WSPj5WjLn1mWf1ZrszS+f8tyLPTi4WhYsLfpGn7AuJmkz6QH6UGrhWWmlx Wj+9Tm3pA4fQ/sp0ulVZ/bajbkM4DMdjKHZyOlGo8Ql08C1J4KSIK5bm5AQ6z7GjfnDp sqZA== X-Gm-Message-State: ALoCoQkj3pbl+QgCOwkPAYeTSuHvQl3mWLeEUeAPyn5Ocr03wCKiFHn7MYSnZ2ZY4MnACGlp+jmBcuqtA5uBzZSD08EEJGuehhXfTnBhqLBraanrjZmJVG5rJKGtuAld7lDfHzQMYjZk X-Received: by 10.112.161.40 with SMTP id xp8mr15271872lbb.71.1441192856521; Wed, 02 Sep 2015 04:20:56 -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.55 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Sep 2015 04:20:56 -0700 (PDT) From: Bartosz Markowski To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Bartosz Markowski Subject: [PATCH 2/2] ath10k: fix beamformer VHT sounding dimensions capability Date: Wed, 2 Sep 2015 13:20:20 +0200 Message-Id: <1441192820-8403-2-git-send-email-bartosz.markowski@tieto.com> X-Mailer: git-send-email 2.1.2 In-Reply-To: <1441192820-8403-1-git-send-email-bartosz.markowski@tieto.com> References: <1441192820-8403-1-git-send-email-bartosz.markowski@tieto.com> 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 Similarly to the VHT STS, this is supposed to be propagated by firmware. In case it's not, use the default value, but as last resort. Signed-off-by: Bartosz Markowski --- drivers/net/wireless/ath/ath10k/mac.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 25c20d18021a..db3be8f794e4 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -4080,11 +4080,27 @@ static int ath10k_mac_get_vht_cap_bf_sts(struct ath10k *ar) return nsts; } +static int ath10k_mac_get_vht_cap_bf_sound_dim(struct ath10k *ar) +{ + int sound_dim = ar->vht_cap_info; + sound_dim &= IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK; + sound_dim >>=IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT; + + /* If the sounding dimension is not advertised by the firmware, + * let's use a default value of 1 + */ + if (sound_dim == 0) + return 1; + + return sound_dim; +} + static int ath10k_mac_set_txbf_conf(struct ath10k_vif *arvif) { u32 value = 0; struct ath10k *ar = arvif->ar; int nsts; + int sound_dim; if (ath10k_wmi_get_txbf_conf_scheme(ar) != WMI_TXBF_CONF_BEFORE_ASSOC) return 0; @@ -4094,9 +4110,10 @@ static int ath10k_mac_set_txbf_conf(struct ath10k_vif *arvif) IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE)) value |= SM(nsts, WMI_TXBF_STS_CAP_OFFSET); + sound_dim = ath10k_mac_get_vht_cap_bf_sound_dim(ar); if (ar->vht_cap_info & (IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE | IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE)) - value |= SM((ar->num_rf_chains - 1), WMI_BF_SOUND_DIM_OFFSET); + value |= SM(sound_dim, WMI_BF_SOUND_DIM_OFFSET); if (!value) return 0; @@ -6830,7 +6847,7 @@ static struct ieee80211_sta_vht_cap ath10k_create_vht_cap(struct ath10k *ar) if (ar->vht_cap_info & (IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE | IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE)) { - val = ar->num_rf_chains - 1; + val = ath10k_mac_get_vht_cap_bf_sound_dim(ar); val <<= IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT; val &= IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK;