Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1544483pxb; Tue, 8 Feb 2022 21:46:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJyuwmqxE/FDGUmImPkEA6QimELoZrCm9uAGuox1A5JN2hC8kXIlMZeHTaSyN7hkSEZwFDEc X-Received: by 2002:a17:902:6942:: with SMTP id k2mr843809plt.133.1644385598890; Tue, 08 Feb 2022 21:46:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644385598; cv=none; d=google.com; s=arc-20160816; b=MS/5prAH9PkkvT7wTf3GT4VUB4GhJhDJB5cyfFKqsE8sjw1my1PzWkE2jV24HUc8lm 96PiGIPYkkMPuLT9z6M42EcxCjXen8ltPk2hDejYT8tlxXTkjjpPyzz47PCmRRszTYSL 9H+godRHaxrhBM+C2cuDEkJ5b2l7FF/wWY4luWhKIyoE+ebuQ+mi0/mDvvAyP9icFnXL If0MPeG3bvcFiNjd8gMsc5AQDDiIBupDJ0g6mtAu2Juf+1ljUsJcN/7AyA+oHCUvCcvE uPBI5yG3ruNc/IF/VNko2wIP1FhAtXerZ7WavuwNpzNW30XMbNOJHYRp+r3vdSPOc3xc nl7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=6iyKMsNb9nQaSwjZ16phaexrMLShklU8MunpsOUTfMg=; b=J85eJgmHbphGGQkQnuvp654LRu1ast68Fk0UeSAj2nQqvh5EMovJxCACxqj5woI/ud TrTNM4hEErN7KS32aTLLiWaEVer8Ssrt/fk3RSlGlASNlB0gQRSLxDd21t0gXLUle8No Lp6c5qcuh7byOxRpOEh/sIRdYxc138MrTfIEVKlvuNN54uX2uEatFOmZlBN7VTkBybbv 90h8JKPEQFm5rgh5kNHGckDxUWxZ/+KbZuEUMz19IpG7N7FiT1A0LzSlFC3tiEdLQylb zcvWfOQ4U1sJzulkb0Xppsj0eMNGGeP05Weusrm4wUmJDH+puDYhBXK5JIL/kFC78gKF 0WAg== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id v10si7676306plo.134.2022.02.08.21.46.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 21:46:38 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 24F5FC0045C2; Tue, 8 Feb 2022 21:42:19 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380486AbiBHPeo (ORCPT + 72 others); Tue, 8 Feb 2022 10:34:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357075AbiBHPeo (ORCPT ); Tue, 8 Feb 2022 10:34:44 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49EFFC0613CB for ; Tue, 8 Feb 2022 07:34:39 -0800 (PST) X-UUID: 7cadfdc8148043b29c8b8020f1d6a982-20220208 X-UUID: 7cadfdc8148043b29c8b8020f1d6a982-20220208 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1156196781; Tue, 08 Feb 2022 23:34:36 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 8 Feb 2022 23:34:34 +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; Tue, 8 Feb 2022 23:34:34 +0800 From: Deren Wu To: Felix Fietkau , Lorenzo Bianconi CC: Sean Wang , Soul Huang , YN Chen , Leon Yen , Eric-SY Chang , Deren Wu , KM Lin , Robin Chiu , CH Yeh , Posh Sun , Eric Liang , Stella Chang , Evelyn Tsai , Ryder Lee , Shayne Chen , linux-wireless , linux-mediatek , Deren Wu Subject: [PATCH] mt76: mt7921s: fix missing fc type/sub-type for 802.11 pkts Date: Tue, 8 Feb 2022 23:34:23 +0800 Message-ID: <33dd8e4b7f7f72d191e8eca88b33b32dbf2595d2.1644313224.git.deren.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, SPF_HELO_PASS,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: 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 --- 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