Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2770180pxb; Mon, 18 Oct 2021 01:10:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJV3GN65iUUIeIRLEwyVVmZK3qiYxge5EQO4/npNG5KBE5ktq/bcCSnedd7wB7TJg85rdS X-Received: by 2002:a17:906:9414:: with SMTP id q20mr28693349ejx.241.1634544649918; Mon, 18 Oct 2021 01:10:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634544649; cv=none; d=google.com; s=arc-20160816; b=FNiZ8vrLp99jtxzbQhek4vk9TbNeD2NtTGGodECsnEyGMlK83aIG+acFcVtjAhzqI4 WTXtECzKDfMt2In4emOp9JVrlQOcxu25gNghwKTxFxPLWRR3P2KmWQAf0ZIQMEo9OyYR RCqweOUSl7jzbc+xhTo5xq5QvkNNJG12pl/8U+Of0/66jFkJ9mmFOitp3E8LHCBKPXbq i3i3kOFYAcQO7wV5MrO3Ge1sX+eRakTCv7pVpl8V8NhQwPn0TJ5Ot5NrHKJX8UHU55X1 n29f0DDXL3iu4zsDMfyNaGF+79bY2kEqymMI42oYlD7ZZWQcvP64nbRxarv7bgUDb9Ac UPiw== 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=0Y/Rd0P1dMzd4dmTI/MNwSmzigMoY+8ky+Ytoh4axaQ=; b=DEvAl3gPYMvjc9Fu+ribhozWW+mJW1Vdsj8Tr88uIixkKX2ien3zmUnG90WMbwog65 1jkH801OHhV3sVo+wyyXSGxKv8r9HmRIqjjYXKarU1RVjNo8nxWG/G9pXClP8yTs0CkM RyATIYuu/cqXBzViNtJ2qqBD6IIKGra/enPoyKlcL4QDVPUIiWilcNbsnBFHX/Xy02Sk 6I0gXChKiwB5kNFmvUP3QE7TsYg93s9THatzlw17AlCMz7cyFIPaHuVnCtsxEaTB6V2A 79YU6LuMFLC5cCtWV/EyUpQ2fTlM27kdOWYRwdrtNJ1LlowUy5S/jZNjA2t40hgkH9uP NFVQ== 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 d18si18480607edr.105.2021.10.18.01.10.34; Mon, 18 Oct 2021 01:10:49 -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 S231126AbhJRIMJ (ORCPT + 64 others); Mon, 18 Oct 2021 04:12:09 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:51780 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S230525AbhJRIMJ (ORCPT ); Mon, 18 Oct 2021 04:12:09 -0400 X-UUID: 74a68fb476254d3d9bf6b1cb2f333255-20211018 X-UUID: 74a68fb476254d3d9bf6b1cb2f333255-20211018 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 559937839; Mon, 18 Oct 2021 16:09:56 +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; Mon, 18 Oct 2021 16:09:55 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkexhb02.mediatek.inc (172.21.101.103) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 18 Oct 2021 16:09:54 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 18 Oct 2021 16:09:54 +0800 From: Shayne Chen To: Felix Fietkau CC: linux-wireless , Lorenzo Bianconi , Ryder Lee , "Evelyn Tsai" , linux-mediatek , Shayne Chen Subject: [PATCH v3 2/4] mt76: mt7915: rework mt7915_mcu_sta_muru_tlv() Date: Mon, 18 Oct 2021 16:09:39 +0800 Message-ID: <20211018080941.11443-2-shayne.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20211018080941.11443-1-shayne.chen@mediatek.com> References: <20211018080941.11443-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 Re-order and modify conditions for MU DL/UL and ofdma DL fields, and also clean up some unnecessary zero settings. Signed-off-by: Shayne Chen --- .../net/wireless/mediatek/mt76/mt7915/mcu.c | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c index 8ba60b66e4a9..4c687380120e 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c @@ -1520,22 +1520,37 @@ mt7915_mcu_sta_muru_tlv(struct sk_buff *skb, struct ieee80211_sta *sta, struct sta_rec_muru *muru; struct tlv *tlv; - if (!sta->vht_cap.vht_supported && !sta->he_cap.has_he) + if (vif->type != NL80211_IFTYPE_STATION && + vif->type != NL80211_IFTYPE_AP) + return; + + if (!sta->vht_cap.vht_supported) return; tlv = mt7915_mcu_add_tlv(skb, STA_REC_MURU, sizeof(*muru)); muru = (struct sta_rec_muru *)tlv; - muru->cfg.ofdma_dl_en = true; - /* A non-AP HE station must support MU beamformee */ - muru->cfg.mimo_dl_en = (vif->type == NL80211_IFTYPE_STATION && - vif->bss_conf.he_support) || - mvif->cap.he_mu_ebfer || + muru->cfg.mimo_dl_en = mvif->cap.he_mu_ebfer || mvif->cap.vht_mu_ebfer || mvif->cap.vht_mu_ebfee; + + muru->mimo_dl.vht_mu_bfee = + !!(sta->vht_cap.cap & IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE); + + if (!sta->he_cap.has_he) + return; + + muru->mimo_dl.partial_bw_dl_mimo = + HE_PHY(CAP6_PARTIAL_BANDWIDTH_DL_MUMIMO, elem->phy_cap_info[6]); + muru->cfg.mimo_ul_en = true; + muru->mimo_ul.full_ul_mimo = + HE_PHY(CAP2_UL_MU_FULL_MU_MIMO, elem->phy_cap_info[2]); + muru->mimo_ul.partial_ul_mimo = + HE_PHY(CAP2_UL_MU_PARTIAL_MU_MIMO, elem->phy_cap_info[2]); + muru->cfg.ofdma_dl_en = true; muru->ofdma_dl.punc_pream_rx = HE_PHY(CAP1_PREAMBLE_PUNC_RX_MASK, elem->phy_cap_info[1]); muru->ofdma_dl.he_20m_in_40m_2g = @@ -1544,9 +1559,6 @@ mt7915_mcu_sta_muru_tlv(struct sk_buff *skb, struct ieee80211_sta *sta, HE_PHY(CAP8_20MHZ_IN_160MHZ_HE_PPDU, elem->phy_cap_info[8]); muru->ofdma_dl.he_80m_in_160m = HE_PHY(CAP8_80MHZ_IN_160MHZ_HE_PPDU, elem->phy_cap_info[8]); - muru->ofdma_dl.lt16_sigb = 0; - muru->ofdma_dl.rx_su_comp_sigb = 0; - muru->ofdma_dl.rx_su_non_comp_sigb = 0; muru->ofdma_ul.t_frame_dur = HE_MAC(CAP1_TF_MAC_PAD_DUR_MASK, elem->mac_cap_info[1]); @@ -1554,18 +1566,6 @@ mt7915_mcu_sta_muru_tlv(struct sk_buff *skb, struct ieee80211_sta *sta, HE_MAC(CAP2_MU_CASCADING, elem->mac_cap_info[2]); muru->ofdma_ul.uo_ra = HE_MAC(CAP3_OFDMA_RA, elem->mac_cap_info[3]); - muru->ofdma_ul.he_2x996_tone = 0; - muru->ofdma_ul.rx_t_frame_11ac = 0; - - muru->mimo_dl.vht_mu_bfee = - !!(sta->vht_cap.cap & IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE); - muru->mimo_dl.partial_bw_dl_mimo = - HE_PHY(CAP6_PARTIAL_BANDWIDTH_DL_MUMIMO, elem->phy_cap_info[6]); - - muru->mimo_ul.full_ul_mimo = - HE_PHY(CAP2_UL_MU_FULL_MU_MIMO, elem->phy_cap_info[2]); - muru->mimo_ul.partial_ul_mimo = - HE_PHY(CAP2_UL_MU_PARTIAL_MU_MIMO, elem->phy_cap_info[2]); } static void -- 2.29.2