Search Linux Wireless

[PATCH 09/15] mt76: mt7915: fix rate rix and flags in txs path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ben Greear <greearb@xxxxxxxxxxxxxxx>

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@xxxxxxxxxxxxxxx>
---
 drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
index 138059278ac0..7ca06b8c9671 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
@@ -1541,8 +1541,6 @@ mt7915_mac_parse_txs(struct mt7915_dev *dev, struct mt76_wcid *wcid,
 	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);
 
 	rate->mcs = FIELD_GET(MT_TX_RATE_IDX, txrate);
@@ -1575,6 +1573,7 @@ mt7915_mac_parse_txs(struct mt7915_dev *dev, struct mt76_wcid *wcid,
 
 		rate->mcs = mt76_get_rate(mphy->dev, sband, rate->mcs, cck);
 		rate->legacy = sband->bitrates[rate->mcs].bitrate;
+		info->status.rates[0].idx = rate->mcs;
 		break;
 	case MT_PHY_TYPE_HT:
 	case MT_PHY_TYPE_HT_GF:
@@ -1585,6 +1584,8 @@ mt7915_mac_parse_txs(struct mt7915_dev *dev, struct mt76_wcid *wcid,
 		rate->flags = RATE_INFO_FLAGS_MCS;
 		if (wcid->rate_short_gi)
 			rate->flags |= RATE_INFO_FLAGS_SHORT_GI;
+		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)
@@ -1593,6 +1594,8 @@ mt7915_mac_parse_txs(struct mt7915_dev *dev, struct mt76_wcid *wcid,
 		rate->flags = RATE_INFO_FLAGS_VHT_MCS;
 		if (wcid->rate_short_gi)
 			rate->flags |= RATE_INFO_FLAGS_SHORT_GI;
+		info->status.rates[0].idx = (rate->nss << 4) | rate->mcs;
+		info->status.rates[0].flags |= IEEE80211_TX_RC_VHT_MCS;
 		break;
 	case MT_PHY_TYPE_HE_SU:
 	case MT_PHY_TYPE_HE_EXT_SU:
@@ -1604,6 +1607,7 @@ mt7915_mac_parse_txs(struct mt7915_dev *dev, struct mt76_wcid *wcid,
 		rate->he_gi = wcid->rate_he_gi;
 		rate->he_dcm = FIELD_GET(MT_TX_RATE_DCM, txrate);
 		rate->flags = RATE_INFO_FLAGS_HE_MCS;
+		info->status.rates[0].idx = (rate->nss << 4) | rate->mcs;
 		break;
 	default:
 		WARN_ON_ONCE(true);
-- 
2.20.1




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux