Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp99390pxb; Fri, 15 Oct 2021 01:18:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUa7PmSTCQ8IiCfe1HcNW1tmgx4xVGi9OZJinbZywp9JTyklqSCNwccSWM55mFyx90stdW X-Received: by 2002:a17:902:c10c:b0:13f:68b4:4abe with SMTP id 12-20020a170902c10c00b0013f68b44abemr9854308pli.8.1634285900270; Fri, 15 Oct 2021 01:18:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634285900; cv=none; d=google.com; s=arc-20160816; b=vQZXC4p5wJMPPP+YPvRMaYX4hPdp/SOXyO4eCstIEtWhDd/p2dLi939ayrEZluUZl8 fWAkqJstjzZKn22gSEXp4UCIZ26et9b1zVbbeOrIUzkMQo5SsMHqj6gRLkRROesbiBnu 5QPmlg2utAU0+meNRSQpaQ007zUhdMFdbjj14Jcv6o3T/I05wZwLzHJ+2Vxm1MjtIOb5 7BsdKHLL7iEkDkUwyTM8nOUhEEHa7U2Wpm5V0OQizMPw/95mRlHtc5dna7N+glfGPNQQ p9m+0Yf/xztTlonqexy33seHXIjYOna7bL9IOtBYozRX9AWcicLYjkIJVOe2JTGQmc+U zjfg== 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=Ozw/lAlLxNljMHIxZMkgzrM4ZYcQyH6AqH1WWHG4GlI=; b=AUN6bNdRz5rFLKs83oDIOzki7JRf8mIImu26qZub11I9XPV+gw9XtVS0Ys+72o2TNB nIVfvKwiplqBmF//A7Ymbd7yGusdVzjNTm/hkrSjanJXZx5AF4xTgnoOylE/hzg+9Wvi HZn3scBrfbescs6F9ujFyHzEdiPQGgrOEiCArDgMIYVJpuQaQGYTm2smSl6qYb4mIHRS emM5Wye1p1NfQ66LQl2Vk1ruBHc24E9NbMRpX9vyoBha8L2r50cPOjhtJq4XngZnmBAG AaCtPzeCKzEG0qmEGz1RxDVQKUlSjiEC9zjS4a1J8DV6ZvfZ8uvrza+21WplwmQbIJzo 5A6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g16si1199675pfv.6.2021.10.15.01.17.47; Fri, 15 Oct 2021 01:18:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234238AbhJODeJ (ORCPT + 63 others); Thu, 14 Oct 2021 23:34:09 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:60900 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S234202AbhJODeH (ORCPT ); Thu, 14 Oct 2021 23:34:07 -0400 X-UUID: f8665bdf621b4500ae73f60555f52a3a-20211015 X-UUID: f8665bdf621b4500ae73f60555f52a3a-20211015 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 146707043; Fri, 15 Oct 2021 11:31:58 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.3; Fri, 15 Oct 2021 11:31:56 +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; Fri, 15 Oct 2021 11:31:56 +0800 From: Shayne Chen To: Felix Fietkau CC: linux-wireless , Lorenzo Bianconi , Ryder Lee , "Evelyn Tsai" , linux-mediatek , Shayne Chen Subject: [PATCH v2 2/2] mt76: mt7915: fix missing HE phy cap Date: Fri, 15 Oct 2021 11:31:45 +0800 Message-ID: <20211015033145.8738-2-shayne.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20211015033145.8738-1-shayne.chen@mediatek.com> References: <20211015033145.8738-1-shayne.chen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Fix missing HE phy cap related to vif and starec setting. Signed-off-by: Shayne Chen --- drivers/net/wireless/mediatek/mt76/mt7915/init.c | 12 +++++++++--- drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 8 ++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c index 7f76907..bf81580 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c @@ -629,7 +629,6 @@ mt7915_set_stream_he_txbf_caps(struct ieee80211_sta_he_cap *he_cap, int vif, int nss) { struct ieee80211_he_cap_elem *elem = &he_cap->he_cap_elem; - struct ieee80211_he_mcs_nss_supp *mcs = &he_cap->he_mcs_nss_supp; u8 c; #ifdef CONFIG_MAC80211_MESH @@ -681,8 +680,11 @@ mt7915_set_stream_he_txbf_caps(struct ieee80211_sta_he_cap *he_cap, elem->phy_cap_info[3] |= IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER; elem->phy_cap_info[4] |= IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER; - /* num_snd_dim */ - c = (nss - 1) | (max_t(int, le16_to_cpu(mcs->tx_mcs_160), 1) << 3); + /* 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; elem->phy_cap_info[5] |= c; c = IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMER_FB | @@ -790,7 +792,11 @@ mt7915_init_he_caps(struct mt7915_phy *phy, enum nl80211_band band, IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_QPSK | IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_QPSK; he_cap_elem->phy_cap_info[6] |= + IEEE80211_HE_PHY_CAP6_PARTIAL_BW_EXT_RANGE | IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT; + he_cap_elem->phy_cap_info[9] |= + IEEE80211_HE_PHY_CAP9_TX_1024_QAM_LESS_THAN_242_TONE_RU | + IEEE80211_HE_PHY_CAP9_RX_1024_QAM_LESS_THAN_242_TONE_RU; break; case NL80211_IFTYPE_STATION: he_cap_elem->mac_cap_info[1] |= diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c index e4da804..fd532b4 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c @@ -1396,6 +1396,10 @@ mt7915_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta, IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ) cap |= STA_REC_HE_CAP_LE_EQ_80M_RX_STBC; + if (elem->phy_cap_info[6] & + IEEE80211_HE_PHY_CAP6_TRIG_CQI_FB) + cap |= STA_REC_HE_CAP_TRIG_CQI_FK; + if (elem->phy_cap_info[6] & IEEE80211_HE_PHY_CAP6_PARTIAL_BW_EXT_RANGE) cap |= STA_REC_HE_CAP_PARTIAL_BW_EXT_RANGE; @@ -1420,10 +1424,6 @@ mt7915_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta, IEEE80211_HE_PHY_CAP8_HE_ER_SU_1XLTF_AND_08_US_GI) cap |= STA_REC_HE_CAP_ER_SU_PPDU_1LTF_8US_GI; - if (elem->phy_cap_info[9] & - IEEE80211_HE_PHY_CAP9_NON_TRIGGERED_CQI_FEEDBACK) - cap |= STA_REC_HE_CAP_TRIG_CQI_FK; - if (elem->phy_cap_info[9] & IEEE80211_HE_PHY_CAP9_TX_1024_QAM_LESS_THAN_242_TONE_RU) cap |= STA_REC_HE_CAP_TX_1024QAM_UNDER_RU242; -- 2.25.1