All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@codeaurora.org>
To: Lorenzo Bianconi <lorenzo@kernel.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:55:19 +0300	[thread overview]
Message-ID: <87a6ldbi20.fsf@tynnyri.adurom.net> (raw)
In-Reply-To: <1aa7b946cac8bb1c3d3ad3eaa41a7c610d122d92.1629277624.git.lorenzo@kernel.org> (Lorenzo Bianconi's message of "Wed, 18 Aug 2021 11:09:58 +0200")

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.

> +		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.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

  reply	other threads:[~2021-08-19 14:55 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 [this message]
2021-08-19 15:27     ` Lorenzo Bianconi
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=87a6ldbi20.fsf@tynnyri.adurom.net \
    --to=kvalo@codeaurora.org \
    --cc=Deren.Wu@mediatek.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=lorenzo@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.