Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp800662pxm; Thu, 3 Mar 2022 05:03:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJwy4z3J9fx4zPxsRzN9agbhFdJtsWU8GHsyRZBEUeGRz3CiJ6Wt27u+8JNIRL5T89QKfYJJ X-Received: by 2002:a17:90a:eb0b:b0:1be:ddea:29ef with SMTP id j11-20020a17090aeb0b00b001beddea29efmr5166455pjz.126.1646312624425; Thu, 03 Mar 2022 05:03:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646312624; cv=none; d=google.com; s=arc-20160816; b=J+cCLX1p/eA5cIoBDYXfVJCvl60eEe7wVjjgS+hq4EpqsfujJsc/ZE0DU++7e4fzeR AgsroxZRpmqBxc1AbZoZS1HAMcqFRzCfJO15vqZvJq2XXzSxU5ST1nz5PDMrRw984ltJ 38YQAnKLxcWhXuSd0PRM4GvXYeIVdPCeiylmNhqZiBAZXCPAC1buGeMxZ6i8womog4Y6 OHFMdGMM8OGlQhS52XnHMvge8PCieVtueTf2ehaemS8+ZAwTKpWhWSgbxWvfOEOHOI1e HSLh4WV6jJOqV+6e/4i1TEt0SFibS8X57I/lPiqaY1jUhMD/MNWNrFVE8/hnlLPnCByi Rdog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=xNw3nkmbRRRCmtGzOcNRmU9GI55TDDRFyQ5GkgKtaYE=; b=x9SIa3z7MsC/rS6/nyBlGRaRqsq0ZT4AONfECDuVXfQWkUC3lzXyjRESj4TQ88LunM NlS7pqF+V2akWWILBbiJllTcv0Ymk7fgxfSa6STyyl8cOiGldXyxstI+17Nvr/A0uyDD z5XpIB8d+pJAIMmx/Ot/FyDPwfceHWj61tXLQZR4SLVsw51uZNKpdA6lrpPxYMV6cT3l We/CcX1fxwe/iAynBJ9ly7v92nySPg1iBJsoBH7o8/2ZNiMHgo0RRSI7Ij6Lhc8SgJ5C 4qlX+p8vRosqflmt8BCuxZoLBsHuaQNPrjEvLyEYuZSJG8vWSv0yjK8x9FQIPHdLHm3s F94Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j18-20020a63fc12000000b00373e12c3979si2014198pgi.461.2022.03.03.05.03.32; Thu, 03 Mar 2022 05:03:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232648AbiCCLIm (ORCPT + 72 others); Thu, 3 Mar 2022 06:08:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231479AbiCCLIj (ORCPT ); Thu, 3 Mar 2022 06:08:39 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFB797C16D for ; Thu, 3 Mar 2022 03:07:52 -0800 (PST) X-UUID: 7e50b30389314d7ca44e324dfa6e6dac-20220303 X-UUID: 7e50b30389314d7ca44e324dfa6e6dac-20220303 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 485856713; Thu, 03 Mar 2022 19:07:46 +0800 Received: from mtkexhb02.mediatek.inc (172.21.101.103) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Thu, 3 Mar 2022 19:07:44 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkexhb02.mediatek.inc (172.21.101.103) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 3 Mar 2022 19:07:44 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 3 Mar 2022 19:07:44 +0800 From: Shayne Chen To: Felix Fietkau CC: linux-wireless , Lorenzo Bianconi , Ryder Lee , Evelyn Tsai , Bo Jiao , linux-mediatek , Peter Chiu , Shayne Chen Subject: [PATCH 3/3] mt76: mt7915: fix phy cap in mt7915_set_stream_he_txbf_caps() Date: Thu, 3 Mar 2022 19:05:35 +0800 Message-ID: <20220303110535.30640-3-shayne.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20220303110535.30640-1-shayne.chen@mediatek.com> References: <20220303110535.30640-1-shayne.chen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Peter Chiu This patch fixes performance issue of beamforming tx on bandwidth 160MHz. Fixes: 99ad32a4ca3a ("mt76: mt7915: add support for MT7986") Signed-off-by: Peter Chiu Signed-off-by: Shayne Chen --- .../net/wireless/mediatek/mt76/mt7915/init.c | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c index 553d1f5..94a5ea6 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c @@ -727,11 +727,18 @@ void mt7915_set_stream_vht_txbf_caps(struct mt7915_phy *phy) } static void -mt7915_set_stream_he_txbf_caps(struct ieee80211_sta_he_cap *he_cap, +mt7915_set_stream_he_txbf_caps(struct mt7915_dev *dev, + struct ieee80211_sta_he_cap *he_cap, int vif, int nss) { struct ieee80211_he_cap_elem *elem = &he_cap->he_cap_elem; - u8 c; + u8 c, nss_160; + + /* Can do 1/2 of NSS streams in 160Mhz mode for mt7915 */ + if (is_mt7915(&dev->mt76) && !dev->dbdc_support) + nss_160 = nss / 2; + else + nss_160 = nss; #ifdef CONFIG_MAC80211_MESH if (vif == NL80211_IFTYPE_MESH_POINT) @@ -785,13 +792,21 @@ mt7915_set_stream_he_txbf_caps(struct ieee80211_sta_he_cap *he_cap, /* num_snd_dim * for mt7915, max supported nss is 2 for bw > 80MHz */ - c = (nss - 1) | - IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_2; + c = FIELD_PREP(IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK, + nss - 1) | + FIELD_PREP(IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_MASK, + nss_160 - 1); elem->phy_cap_info[5] |= c; c = IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMING_FB | IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMING_PARTIAL_BW_FB; elem->phy_cap_info[6] |= c; + + if (!is_mt7915(&dev->mt76)) { + c = IEEE80211_HE_PHY_CAP7_STBC_TX_ABOVE_80MHZ | + IEEE80211_HE_PHY_CAP7_STBC_RX_ABOVE_80MHZ; + elem->phy_cap_info[7] |= c; + } } static void @@ -953,7 +968,7 @@ mt7915_init_he_caps(struct mt7915_phy *phy, enum nl80211_band band, he_mcs->rx_mcs_80p80 = cpu_to_le16(mcs_map_160); he_mcs->tx_mcs_80p80 = cpu_to_le16(mcs_map_160); - mt7915_set_stream_he_txbf_caps(he_cap, i, nss); + mt7915_set_stream_he_txbf_caps(dev, he_cap, i, nss); memset(he_cap->ppe_thres, 0, sizeof(he_cap->ppe_thres)); if (he_cap_elem->phy_cap_info[6] & -- 2.25.1