public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: Deren Wu <Deren.Wu@mediatek.com>
Cc: Felix Fietkau <nbd@nbd.name>, Sean Wang <sean.wang@mediatek.com>,
	Soul Huang <Soul.Huang@mediatek.com>,
	YN Chen <YN.Chen@mediatek.com>, Leon Yen <Leon.Yen@mediatek.com>,
	Eric-SY Chang <Eric-SY.Chang@mediatek.com>,
	KM Lin <km.lin@mediatek.com>,
	Robin Chiu <robin.chiu@mediatek.com>,
	CH Yeh <ch.yeh@mediatek.com>, Posh Sun <posh.sun@mediatek.com>,
	Eric Liang <Eric.Liang@mediatek.com>,
	Stella Chang <Stella.Chang@mediatek.com>,
	Evelyn Tsai <evelyn.tsai@mediatek.com>,
	Ryder Lee <ryder.lee@mediatek.com>,
	Shayne Chen <shayne.chen@mediatek.com>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	linux-mediatek <linux-mediatek@lists.infradead.org>
Subject: Re: [PATCH] mt76: mt7921s: fix missing fc type/sub-type for 802.11 pkts
Date: Wed, 9 Feb 2022 00:35:52 +0100	[thread overview]
Message-ID: <YgL+WITtN7um1Rlt@lore-desk> (raw)
In-Reply-To: <YgL+HfN/xaiA40yc@lore-desk>

[-- Attachment #1: Type: text/plain, Size: 2641 bytes --]

> > 
> > For non-mmio devices, should set fc values to proper txwi config
> > 
> > Fixes: 48fab5bbef40 ("mt76: mt7921: introduce mt7921s support")
> > Co-developed-by: Leon Yen <Leon.Yen@mediatek.com>
> > Signed-off-by: Leon Yen <Leon.Yen@mediatek.com>
> > Signed-off-by: Deren Wu <deren.wu@mediatek.com>
> > ---
> >  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) {
> 
> Nit: we do need is_mmio variable since it is used just here.

s/do need/do not need/

> 
> Regards,
> Lorenzo
> 
> > +		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
> > 



[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2022-02-08 23:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08 15:34 [PATCH] mt76: mt7921s: fix missing fc type/sub-type for 802.11 pkts Deren Wu
2022-02-08 23:34 ` Lorenzo Bianconi
2022-02-08 23:35   ` Lorenzo Bianconi [this message]
     [not found] <33dd8e4b7f7f72d191e8eca88b33b32dbf2595d2.1644313224.git.deren.wu@mediatek.comk--annotate>
2022-02-08 19:18 ` sean.wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YgL+WITtN7um1Rlt@lore-desk \
    --to=lorenzo.bianconi@redhat.com \
    --cc=Deren.Wu@mediatek.com \
    --cc=Eric-SY.Chang@mediatek.com \
    --cc=Eric.Liang@mediatek.com \
    --cc=Leon.Yen@mediatek.com \
    --cc=Soul.Huang@mediatek.com \
    --cc=Stella.Chang@mediatek.com \
    --cc=YN.Chen@mediatek.com \
    --cc=ch.yeh@mediatek.com \
    --cc=evelyn.tsai@mediatek.com \
    --cc=km.lin@mediatek.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nbd@nbd.name \
    --cc=posh.sun@mediatek.com \
    --cc=robin.chiu@mediatek.com \
    --cc=ryder.lee@mediatek.com \
    --cc=sean.wang@mediatek.com \
    --cc=shayne.chen@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox