public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: greearb@candelatech.com
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH 07/11] mt76: mt7915: fix rate rix and flags in txs path
Date: Tue, 4 Jan 2022 12:15:58 +0100	[thread overview]
Message-ID: <YdQsbsb9ayaBUvyO@localhost.localdomain> (raw)
In-Reply-To: <20211118164056.2965-7-greearb@candelatech.com>

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

> From: Ben Greear <greearb@candelatech.com>
> 
> Do not initialize rix to -1, build the rix and set flags
> based on the mcs, nss, and mode.
> 
> Signed-off-by: Ben Greear <greearb@candelatech.com>
> ---
>  drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 16 +++++++++++++---
>  1 file changed, 13 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
> index edf33540658e..300928edd0d7 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
> @@ -1571,7 +1571,7 @@ mt7915_mac_add_txs_skb(struct mt7915_dev *dev, struct mt76_wcid *wcid, int pid,
>  	struct ieee80211_supported_band *sband;
>  	struct mt76_dev *mdev = &dev->mt76;
>  	struct mt76_phy *mphy;
> -	struct ieee80211_tx_info *info;
> +	struct ieee80211_tx_info *info = NULL;
>  	struct sk_buff_head list;
>  	struct rate_info rate = {};
>  	struct sk_buff *skb = NULL;
> @@ -1596,8 +1596,6 @@ mt7915_mac_add_txs_skb(struct mt7915_dev *dev, struct mt76_wcid *wcid, int pid,
>  		info->status.ampdu_len = 1;
>  		info->status.ampdu_ack_len = !!(info->flags &
>  						IEEE80211_TX_STAT_ACK);
> -
> -		info->status.rates[0].idx = -1;
>  	}
>  
>  	txrate = FIELD_GET(MT_TXS0_TX_RATE, txs);
> @@ -1627,6 +1625,8 @@ mt7915_mac_add_txs_skb(struct mt7915_dev *dev, struct mt76_wcid *wcid, int pid,
>  
>  		rate.mcs = mt76_get_rate(mphy->dev, sband, rate.mcs, cck);
>  		rate.legacy = sband->bitrates[rate.mcs].bitrate;
> +		if (info)
> +			info->status.rates[0].idx = rate.mcs;

can it be NULL?

>  		break;
>  	case MT_PHY_TYPE_HT:
>  	case MT_PHY_TYPE_HT_GF:
> @@ -1637,6 +1637,10 @@ mt7915_mac_add_txs_skb(struct mt7915_dev *dev, struct mt76_wcid *wcid, int pid,
>  		rate.flags = RATE_INFO_FLAGS_MCS;
>  		if (wcid->rate_short_gi)
>  			rate.flags |= RATE_INFO_FLAGS_SHORT_GI;
> +		if (info) {
> +			info->status.rates[0].idx = rate.mcs + rate.nss * 8;
> +			info->status.rates[0].flags |= IEEE80211_TX_RC_MCS;
> +		}
>  		break;
>  	case MT_PHY_TYPE_VHT:
>  		if (rate.mcs > 9)
> @@ -1645,6 +1649,10 @@ mt7915_mac_add_txs_skb(struct mt7915_dev *dev, struct mt76_wcid *wcid, int pid,
>  		rate.flags = RATE_INFO_FLAGS_VHT_MCS;
>  		if (wcid->rate_short_gi)
>  			rate.flags |= RATE_INFO_FLAGS_SHORT_GI;
> +		if (info) {
> +			info->status.rates[0].idx = (rate.nss << 4) | rate.mcs;

ieee80211_rate_set_vht()

> +			info->status.rates[0].flags |= IEEE80211_TX_RC_VHT_MCS;
> +		}
>  		break;
>  	case MT_PHY_TYPE_HE_SU:
>  	case MT_PHY_TYPE_HE_EXT_SU:
> @@ -1656,6 +1664,8 @@ mt7915_mac_add_txs_skb(struct mt7915_dev *dev, struct mt76_wcid *wcid, int pid,
>  		rate.he_gi = wcid->rate_he_gi;
>  		rate.he_dcm = FIELD_GET(MT_TX_RATE_DCM, txrate);
>  		rate.flags = RATE_INFO_FLAGS_HE_MCS;
> +		if (info)
> +			info->status.rates[0].idx = (rate.nss << 4) | rate.mcs;
>  		break;
>  	default:
>  		WARN_ON_ONCE(true);
> -- 
> 2.20.1
> 

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

  reply	other threads:[~2022-01-04 11:16 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-18 16:40 [PATCH 01/11] mt76: mt7915: add comments about rx descriptor parsing greearb
2021-11-18 16:40 ` [PATCH 02/11] mt76: mt7915: print out hw revision greearb
2021-11-18 16:59   ` Ryder Lee
2021-11-18 16:40 ` [PATCH 03/11] mt76: mt7915: support enabling rx group-5 status greearb
2022-01-04 10:39   ` Lorenzo Bianconi
2021-11-18 16:40 ` [PATCH 04/11] mt76: mt7915: use nss for calculating rx-chains greearb
2021-12-03  9:16   ` Felix Fietkau
2021-12-03 15:33     ` Ben Greear
2021-11-18 16:40 ` [PATCH 05/11] mt76: mt7915: ethtool group-5 rx stats information greearb
2022-01-04 10:58   ` Lorenzo Bianconi
2021-11-18 16:40 ` [PATCH 06/11] mt76: mt7915: ethtool counters for driver rx path greearb
2021-11-18 16:40 ` [PATCH 07/11] mt76: mt7915: fix rate rix and flags in txs path greearb
2022-01-04 11:15   ` Lorenzo Bianconi [this message]
2021-11-18 16:40 ` [PATCH 08/11] mt76: mt7915: add ethtool tx/rx pkts/bytes greearb
2021-11-18 16:40 ` [PATCH 09/11] mt76: mt7915: add rx-ppdu-size-out-of-range ethtool counter greearb
2021-11-18 16:40 ` [PATCH 10/11] mt76: mt7915: ethtool and mib rx stats greearb
2021-11-18 16:40 ` [PATCH 11/11] mt76: mt7915: poll mib counters every 200ms greearb
2021-11-18 17:01   ` Ryder Lee
2021-11-19 16:33 ` [PATCH 01/11] mt76: mt7915: add comments about rx descriptor parsing Lorenzo Bianconi
2021-11-19 16:41   ` Ben Greear

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=YdQsbsb9ayaBUvyO@localhost.localdomain \
    --to=lorenzo@kernel.org \
    --cc=greearb@candelatech.com \
    --cc=linux-wireless@vger.kernel.org \
    /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