Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1586051pxb; Tue, 8 Feb 2022 23:11:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJwTlEoo9F/QkNOOxf5FAyvohgfyRoNJSVLIX5+XGB8aBeoJ0xuH3U8LvvkL3x02HTS3pKCa X-Received: by 2002:a05:6a00:2d8:: with SMTP id b24mr714943pft.23.1644390708509; Tue, 08 Feb 2022 23:11:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644390708; cv=none; d=google.com; s=arc-20160816; b=HxPG5fwZu5WJl6LJHAcWsshHKnZEeC0ddwsWPWDP8Ah+XKCsTI2V2t6CYfF3tJ/CYY xuQI+VCY315fDvP0wRdr83JLrFxFZe6vKoXCW3YNb1BRK8ZOV96on1FhANVeFuTyXqrB VcowWTY8mx10CO2Q9Bn6936tp3aFr5cP/QS0qrb9wCVHGHQmtMjt4CA26sOjNd1ZIoVU 4AO8G2EpUoPdRBXBxJvOSytEet5mWiWj8AUMPto4VtCOcGANTN8YG8K8O9ox5qtNUtwt KKDHOhdL2TntGHiU1rUuQdU0jws/09tSUfgchyhbrxk6bDN5zqXirun9Czh5a8XYj72V FUaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=4gUWiq+74QlIEUtV8k6AMm5Mexy3uHfwzxBHghknuDU=; b=kAaMLjTj0dWv7FL7kPl281F0f+/TRj9YkCLyJVWryGTLO43GBE0J5bp/L2wDUG5oOo KA8Iox6IwvQ2rymSIcAqU89ChfVELDYazOOXUMlOdYRJgU0fiWonHnmaZo2wDPOAcEgM VMLU0ymoDOs/O+G+rEKJmpEjMnmcUeIbdNN3tVSj8Yr+pzUbpuTGfhBkQhs3o1E8o9u/ u6GxK9JJdmelxcNRYyWIRpiNj+hWEI22I4CqvkQ+v2u5hCNVnMC6ndm1j4iu22zVviao UoCTGsF3GgenQE+6x3ZLy0T5PMNqAP7wEoPjXAQTxa8OwngXbHPYLSMj3S1LBDZ4q0tC U4QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="fhe/Ya0t"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d5si15110415plr.451.2022.02.08.23.11.29; Tue, 08 Feb 2022 23:11:48 -0800 (PST) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="fhe/Ya0t"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237374AbiBHXgC (ORCPT + 73 others); Tue, 8 Feb 2022 18:36:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237371AbiBHXgB (ORCPT ); Tue, 8 Feb 2022 18:36:01 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AC792C061577 for ; Tue, 8 Feb 2022 15:36:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644363359; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4gUWiq+74QlIEUtV8k6AMm5Mexy3uHfwzxBHghknuDU=; b=fhe/Ya0tUCjBUAj1kZoFKxg+UKrYZcmImR7d9D2OmJRFw8dDhTYg77fVsgBTqiEq6sY/B0 WV27O9rengJBGhmqgl9JcnJfQ6j2FBtvXhn/4cp6jmvbyUbNTaOOjRzD8pTeI/oC8MSeGu WlE/FPHRwZjlMshfjrGhJx2y1cIpq+Q= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-410-hi5JV4uIPqyfMx5GZ26yFQ-1; Tue, 08 Feb 2022 18:35:56 -0500 X-MC-Unique: hi5JV4uIPqyfMx5GZ26yFQ-1 Received: by mail-qv1-f69.google.com with SMTP id gg10-20020a056214252a00b0041eeb1c2684so390266qvb.21 for ; Tue, 08 Feb 2022 15:35:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=4gUWiq+74QlIEUtV8k6AMm5Mexy3uHfwzxBHghknuDU=; b=k6VqFlhyrhX1v/HSqaPmu8g2Cwu/7p420uKXAcqQOEDFfAlmdv5N1K7iWo500cLEps sy9tmuzW2AeiGisMO2IDmwTJHNR4aTTb18eekttalXcIcyN2U0X/mblvlbWo/KRx82mR /RU+fQFQ6GjgRF26zEMJJNK8A5Qd35r6f7VXqK8hjsDMa7jjlLuMsRHtHm4UFivI0D3a KIBmQPA8BuhQxmEjLYfOm0G0ySdUJ/tfgupIyWgrzWlg8Fm/PAnBHeC9hUB57b7WR9nl wTI8S68fWyT4lT69/IJ6KyAQu0smzlhm3HF2MfKTCFMqmZV/ud2gnGoSN56xXiY2MN/q DhdA== X-Gm-Message-State: AOAM533qEg6gGgtfWZxZAtmXqSzKPBZy336nAHgZ/tqudJjiq+ezXzIQ UPU+eXcPgSL5UJsNRuWsBELABa3NomCDhoyMBX1lKtXcZ0zhNskPPPSZHESe5e++pdVIJjheID8 dmUkNQNIi4cZR26r7wTyG6aqcjIA= X-Received: by 2002:ad4:5cae:: with SMTP id q14mr4879606qvh.126.1644363355988; Tue, 08 Feb 2022 15:35:55 -0800 (PST) X-Received: by 2002:ad4:5cae:: with SMTP id q14mr4879592qvh.126.1644363355806; Tue, 08 Feb 2022 15:35:55 -0800 (PST) Received: from localhost (net-37-182-17-113.cust.vodafonedsl.it. [37.182.17.113]) by smtp.gmail.com with ESMTPSA id u63sm7555887qkh.43.2022.02.08.15.35.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 15:35:55 -0800 (PST) Date: Wed, 9 Feb 2022 00:35:52 +0100 From: Lorenzo Bianconi To: Deren Wu Cc: Felix Fietkau , Sean Wang , Soul Huang , YN Chen , Leon Yen , Eric-SY Chang , KM Lin , Robin Chiu , CH Yeh , Posh Sun , Eric Liang , Stella Chang , Evelyn Tsai , Ryder Lee , Shayne Chen , linux-wireless , linux-mediatek Subject: Re: [PATCH] mt76: mt7921s: fix missing fc type/sub-type for 802.11 pkts Message-ID: References: <33dd8e4b7f7f72d191e8eca88b33b32dbf2595d2.1644313224.git.deren.wu@mediatek.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="FsvhqALiCu0TIavk" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 --FsvhqALiCu0TIavk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > >=20 > > For non-mmio devices, should set fc values to proper txwi config > >=20 > > 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(-) > >=20 > > 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 =3D hdr->frame_control; > > u8 fc_type, fc_stype; > > u32 val; > > + bool is_mmio =3D mt76_is_mmio(&dev->mt76); > > =20 > > if (ieee80211_is_action(fc) && > > mgmt->u.action.category =3D=3D WLAN_CATEGORY_BACK && > > @@ -912,9 +913,15 @@ mt7921_mac_write_txwi_80211(struct mt7921_dev *dev= , __le32 *txwi, > > txwi[3] |=3D cpu_to_le32(val); > > } > > =20 > > - val =3D FIELD_PREP(MT_TXD7_TYPE, fc_type) | > > - FIELD_PREP(MT_TXD7_SUB_TYPE, fc_stype); > > - txwi[7] |=3D cpu_to_le32(val); > > + if (is_mmio) { >=20 > Nit: we do need is_mmio variable since it is used just here. s/do need/do not need/ >=20 > Regards, > Lorenzo >=20 > > + val =3D FIELD_PREP(MT_TXD7_TYPE, fc_type) | > > + FIELD_PREP(MT_TXD7_SUB_TYPE, fc_stype); > > + txwi[7] |=3D cpu_to_le32(val); > > + } else { > > + val =3D FIELD_PREP(MT_TXD8_L_TYPE, fc_type) | > > + FIELD_PREP(MT_TXD8_L_SUB_TYPE, fc_stype); > > + txwi[8] |=3D cpu_to_le32(val); > > + } > > } > > =20 > > 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) > > =20 > > +#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) > > --=20 > > 2.18.0 > >=20 --FsvhqALiCu0TIavk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCYgL+WAAKCRA6cBh0uS2t rJd1AQCPuX2XQPFZEKJ9O+QfqtnV7HMWbS3JtgXJCN9E4HTMGQEAlxJO/0yDjJu3 cNFZLPa4lTc5Ii9D7zo9QnsZHgeHogA= =5SV3 -----END PGP SIGNATURE----- --FsvhqALiCu0TIavk--