Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1313428pxb; Tue, 8 Feb 2022 14:26:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxGk+S8LAgS4vzhD8Vg+W/cK7ysh7IBYneRKKHp9Z9JNF+YB1xwXqgXA1JYhS0FxUoYPw/u X-Received: by 2002:a17:903:22c2:: with SMTP id y2mr6510715plg.132.1644359162454; Tue, 08 Feb 2022 14:26:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644359162; cv=none; d=google.com; s=arc-20160816; b=1DdNc7//2XAuMMlt4+2MRusGnYfjjr+udVz2bA5Th4h08Z1Vexm29Un+puUQ/quW2m iJswgTXHUG/RcHCSs6xnQkSetXna6wFGRi11GLjOPt8BzUTB9tzd0oBn2KGrMnFKfPnW Mgzpv27uwvK/EUxnVZK8X+1D/oE+R6uuCICGgreZm4gtPY/DDgiQz/0y8s/zW8QWKGN5 PwpttdqZP9Uj5rn1oHfU0+2L0OdlKMBFQ+z1cui0/a/y4TPIeM70xqCkli2abNMeR9ZY ZMXD4Deu1S092M2gnVPTe3l4prcEfKG6+lSfjo+7GxUZ6OezenQRNz52MhdbpZFHajuW Y72w== 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=cVhTjMEauBVJtWcuGSl2Xs6t7rAQesjOrLQ4g+K3ytM=; b=bCPSEqO/Msu0/++Y1FIUMnLVvb3KXMYG7CavEMMeFpz0cWTNznmBDZBLThLe4GZnn/ GF9t9TF+7j8O45VRTsEEZ+LbHJ7vKHRYmdmVxhXt//aMoya7TEXpc65R04RQ313mo8Nt Vm+Cu9Dg9rSMbwro0QWf1teuPTY61/I5V6a7z5mkmDVHCmrr2WNtmbKK6GyiY4GYmymk BIJBuol3ywa2w6nM0jfnzClADi6cLwf5Oeh2Q/4MagaQRluhUCxF60N+lThVia5rmTWO 2IM2U+2njy3CRzItwsXVtLZeYvEKm/tcQrP/0TTt8K+txbA2y29FxkyeKo0H44gOmejR nP2A== 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 f2si14695076pfe.346.2022.02.08.14.25.47; Tue, 08 Feb 2022 14:26:02 -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 S1385911AbiBHTTG (ORCPT + 73 others); Tue, 8 Feb 2022 14:19:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353717AbiBHTTF (ORCPT ); Tue, 8 Feb 2022 14:19:05 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BC28C0612C0 for ; Tue, 8 Feb 2022 11:19:01 -0800 (PST) X-UUID: 4cc068cecd114a8aa1ef598b28bb9f87-20220209 X-UUID: 4cc068cecd114a8aa1ef598b28bb9f87-20220209 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1214468679; Wed, 09 Feb 2022 03:18:58 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) 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; Wed, 9 Feb 2022 03:18:57 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 9 Feb 2022 03:18:56 +0800 From: To: CC: , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH] mt76: mt7921s: fix missing fc type/sub-type for 802.11 pkts Date: Wed, 9 Feb 2022 03:18:55 +0800 Message-ID: <1644347935-20006-1-git-send-email-sean.wang@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <33dd8e4b7f7f72d191e8eca88b33b32dbf2595d2.1644313224.git.deren.wu@mediatek.comk--annotate> References: <33dd8e4b7f7f72d191e8eca88b33b32dbf2595d2.1644313224.git.deren.wu@mediatek.comk--annotate> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,MAY_BE_FORGED, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,T_SPF_TEMPERROR,UNPARSEABLE_RELAY autolearn=no 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: Sean Wang >from: Deren Wu > >For non-mmio devices, should set fc values to proper txwi config > >Fixes: 48fab5bbef40 ("mt76: mt7921: introduce mt7921s support") >Co-developed-by: Leon Yen >Signed-off-by: Leon Yen >Signed-off-by: Deren Wu Tested-by: Sean Wang >--- > drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 13 ++++++++++--- drivers/net/wireless/mediatek/mt76/mt7921/mac.h | 3 +++ > 2 files changed, 13 insertions(+), 3 deletions(-) > >diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c >index d17558349a17..e403f0225b77 100644 >--- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c >+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c >@@ -852,6 +852,7 @@ mt7921_mac_write_txwi_80211(struct mt7921_dev *dev, __le32 *txwi, > __le16 fc = hdr->frame_control; > u8 fc_type, fc_stype; > u32 val; >+ bool is_mmio = mt76_is_mmio(&dev->mt76); > > if (ieee80211_is_action(fc) && > mgmt->u.action.category == WLAN_CATEGORY_BACK && @@ -912,9 +913,15 @@ mt7921_mac_write_txwi_80211(struct mt7921_dev *dev, __le32 *txwi, > txwi[3] |= cpu_to_le32(val); > } > >- val = FIELD_PREP(MT_TXD7_TYPE, fc_type) | >- FIELD_PREP(MT_TXD7_SUB_TYPE, fc_stype); >- txwi[7] |= cpu_to_le32(val); >+ if (is_mmio) { >+ val = FIELD_PREP(MT_TXD7_TYPE, fc_type) | >+ FIELD_PREP(MT_TXD7_SUB_TYPE, fc_stype); >+ txwi[7] |= cpu_to_le32(val); >+ } else { >+ val = FIELD_PREP(MT_TXD8_L_TYPE, fc_type) | >+ FIELD_PREP(MT_TXD8_L_SUB_TYPE, fc_stype); >+ txwi[8] |= cpu_to_le32(val); >+ } > } > > void mt7921_mac_write_txwi(struct mt7921_dev *dev, __le32 *txwi, diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.h b/drivers/net/wireless/mediatek/mt76/mt7921/mac.h >index 544a1c33126a..12e1cf8abe6e 100644 >--- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.h >+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.h >@@ -284,6 +284,9 @@ enum tx_mcu_port_q_idx { > #define MT_TXD7_HW_AMSDU BIT(10) > #define MT_TXD7_TX_TIME GENMASK(9, 0) > >+#define MT_TXD8_L_TYPE GENMASK(5, 4) >+#define MT_TXD8_L_SUB_TYPE GENMASK(3, 0) >+ > #define MT_TX_RATE_STBC BIT(13) > #define MT_TX_RATE_NSS GENMASK(12, 10) > #define MT_TX_RATE_MODE GENMASK(9, 6) >-- >2.18.0 > >