public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: nbd@nbd.name, linux-wireless@vger.kernel.org,
	lorenzo.bianconi@redhat.com, sean.wang@mediatek.com,
	Deren.Wu@mediatek.com
Subject: Re: [PATCH 3/5] mt76: mt7921: report tx rate directly from tx status
Date: Thu, 19 Aug 2021 17:27:37 +0200	[thread overview]
Message-ID: <YR54aQ2Rih62lZYj@lore-desk> (raw)
In-Reply-To: <87a6ldbi20.fsf@tynnyri.adurom.net>

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

On Aug 19, Kalle Valo wrote:
> Lorenzo Bianconi <lorenzo@kernel.org> writes:
> 
> > Report tx rate from tx status packets instead of receiving periodic mcu
> > event. This improves flexibility, accuracy and AQL performance, and
> > simplifies code flow for better readability.
> >
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> 
> [...]
> 
> > +		/* We don't support reading GI info from txs packets.
> > +		 * For accurate tx status reporting and AQL improvement,
> > +		 * we need to make sure that flags match so polling GI
> > +		 * from per-sta counters directly.
> > +		 */
> > +		rate = &msta->wcid.rate;
> > +		addr = MT_WTBL_LMAC_OFFS(idx, 0) + 7 * 4;
> 
> Magic values.

ack, I reused what was already in mt7921_mac_sta_poll(), but I can add some
definitions :)

> 
> > +		val = mt76_rr(dev, addr);
> > +
> > +		switch (rate->bw) {
> > +		case RATE_INFO_BW_160:
> > +			bw = IEEE80211_STA_RX_BW_160;
> > +			break;
> > +		case RATE_INFO_BW_80:
> > +			bw = IEEE80211_STA_RX_BW_80;
> > +			break;
> > +		case RATE_INFO_BW_40:
> > +			bw = IEEE80211_STA_RX_BW_40;
> > +			break;
> > +		default:
> > +			bw = IEEE80211_STA_RX_BW_20;
> > +			break;
> > +		}
> > +
> > +		if (rate->flags & RATE_INFO_FLAGS_HE_MCS) {
> > +			u8 offs = 24 + 2 * bw;
> > +
> > +			rate->he_gi = (val & (0x3 << offs)) >> offs;
> 
> Ditto.

same here, I just reused the code from mt7915, I will fix it.

Regards,
Lorenzo

> 
> -- 
> https://patchwork.kernel.org/project/linux-wireless/list/
> 
> https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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

  reply	other threads:[~2021-08-19 15:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18  9:09 [PATCH 0/5] add tx status reporting to mt7921 driver Lorenzo Bianconi
2021-08-18  9:09 ` [PATCH 1/5] mt76: mt7921: start reworking tx rate reporting Lorenzo Bianconi
2021-08-18  9:09 ` [PATCH 2/5] mt76: mt7921: add support for tx status reporting Lorenzo Bianconi
2021-08-18  9:09 ` [PATCH 3/5] mt76: mt7921: report tx rate directly from tx status Lorenzo Bianconi
2021-08-19 14:55   ` Kalle Valo
2021-08-19 15:27     ` Lorenzo Bianconi [this message]
2021-08-21 13:53       ` Kalle Valo
2021-08-18  9:09 ` [PATCH 4/5] mt76: mt7921: remove mcu rate reporting code Lorenzo Bianconi
2021-08-18  9:10 ` [PATCH 5/5] mt76: mt7921: remove mt7921_sta_stats Lorenzo Bianconi

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=YR54aQ2Rih62lZYj@lore-desk \
    --to=lorenzo@kernel.org \
    --cc=Deren.Wu@mediatek.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=nbd@nbd.name \
    --cc=sean.wang@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