Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3632371ybv; Tue, 25 Feb 2020 04:44:00 -0800 (PST) X-Google-Smtp-Source: APXvYqxwSC4FgFTx6/B2F3j8ICZXs4YJlyEfyWbiXshjmnSdn5VAwIrBoQQzjW0wfCdDAQb0cJcA X-Received: by 2002:a05:6808:a8a:: with SMTP id q10mr3240726oij.66.1582634640779; Tue, 25 Feb 2020 04:44:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582634640; cv=none; d=google.com; s=arc-20160816; b=fhyMX6qDhavQDqQaP1HOIofmZ8kLfDPGht4LIsl6vUZv/pIYc2L2kdq4o8T3uRPpnN b30HNtsKrsWM8kG39ACijsSahMycJa1jtpQz2GZowtdxbkiSOeYt9OTaX9r/EfrcofZQ QTNAfpjkpnG8K1th2j4QU/hV6dLBrab2ygdjd3vPhQyL2E+z+juj0W9iSushkHuNrreO XoIMo3bL2FQatFbVY23Dqs90rb46wJYzMKmaHybJ6XDsaixtqZhLscsN1tnV2oqf584/ MhtC3k4UtZGZa/tP0U2zgmwI21NzPz6y9P1pZWOWS5rXBmkobbHXnFfqsscth/0MyWhu zI5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=APmM0hXCPyAiDiGHqejETCBeGW6vdN2aMw2cyCbrYHk=; b=Wrpk6gdXBkB6621fS6SHAX9DxS5yYk3vFQ6eqczSuCwwxvPPd4tRMsZXXW4cF6F/nw NVXts+yXmk8BUtFcOcldMwzoZgPZJqS/w4+cAw2vtwSzJTjSAdZvpX+sxCrl+TBpTuzU vWyBtIDL3DDHVin0xXfsq1LimembYor6mrMSa3T0r677szWhbKhXWjY2lH03tShElanX df2H/sIFYsvS6QA/sSx9GnL7HrgKBK8Vx4RE/BDISqeIbQ1waMaUm6bTQP/Dexl6sGaC nnf9qQdNa8CZc/gNb+AVbL6wPga2VN4nj48nkxjHCIlRECcB0gPfjjZjjt/z9wvUvTGl rK4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=X3QaB0HG; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5si7951734ote.187.2020.02.25.04.43.40; Tue, 25 Feb 2020 04:44:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=X3QaB0HG; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729928AbgBYM2u (ORCPT + 99 others); Tue, 25 Feb 2020 07:28:50 -0500 Received: from nbd.name ([46.4.11.11]:53754 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729444AbgBYM2u (ORCPT ); Tue, 25 Feb 2020 07:28:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject :To:From:Sender:Reply-To:Cc:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=APmM0hXCPyAiDiGHqejETCBeGW6vdN2aMw2cyCbrYHk=; b=X3QaB0HG1QtqIhI92Pkay0p6Jt zQNYG/BDOvYunc5P2dVdq+WRQSoDIBrNtrEoim/Zi23HdayKnyjwxofN3GAEPvo3CLNpR8rgtSNHw OTjOST9y0/ks74I/pBD+kvUdaGLPyTi9+PXB7xvgzucqX/tr5Au0TUSs39/X29ApBt7U=; Received: from [80.255.7.116] (helo=maeck.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1j6ZKS-0006CL-Vp for linux-wireless@vger.kernel.org; Tue, 25 Feb 2020 13:28:49 +0100 Received: by maeck.local (Postfix, from userid 501) id F01327E3F8B9; Tue, 25 Feb 2020 13:28:47 +0100 (CET) From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 1/3] mt76: mt7615: fix antenna mask initialization in DBDC mode Date: Tue, 25 Feb 2020 13:28:45 +0100 Message-Id: <20200225122847.40846-1-nbd@nbd.name> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Update wiphy available antenna mask, and fix chainmask setting on 3x3 hardware Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7615/init.c | 4 ++++ drivers/net/wireless/mediatek/mt76/mt7615/main.c | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/init.c b/drivers/net/wireless/mediatek/mt76/mt7615/init.c index 889eb72ad6bd..4c41e4048161 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/init.c @@ -350,6 +350,8 @@ mt7615_cap_dbdc_enable(struct mt7615_dev *dev) else dev->mphy.antenna_mask = dev->chainmask >> 1; dev->phy.chainmask = dev->mphy.antenna_mask; + dev->mphy.hw->wiphy->available_antennas_rx = dev->phy.chainmask; + dev->mphy.hw->wiphy->available_antennas_tx = dev->phy.chainmask; mt76_set_stream_caps(&dev->mt76, true); } @@ -361,6 +363,8 @@ mt7615_cap_dbdc_disable(struct mt7615_dev *dev) IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ; dev->mphy.antenna_mask = dev->chainmask; dev->phy.chainmask = dev->chainmask; + dev->mphy.hw->wiphy->available_antennas_rx = dev->chainmask; + dev->mphy.hw->wiphy->available_antennas_tx = dev->chainmask; mt76_set_stream_caps(&dev->mt76, true); } diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/main.c b/drivers/net/wireless/mediatek/mt76/mt7615/main.c index 01194ed79869..7edd5e739b2d 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c @@ -686,7 +686,13 @@ mt7615_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant) mutex_lock(&dev->mt76.mutex); phy->mt76->antenna_mask = tx_ant; - phy->chainmask = ext_phy ? tx_ant << 2 : tx_ant; + if (ext_phy) { + if (dev->chainmask == 0xf) + tx_ant <<= 2; + else + tx_ant <<= 1; + } + phy->chainmask = tx_ant; mt76_set_stream_caps(&dev->mt76, true); -- 2.24.0