Commit 021af945 authored by Shayne Chen's avatar Shayne Chen Committed by Felix Fietkau

wifi: mt76: mt7996: add eht rx rate support

Add support to report eht rx rate.
Note that extended fields for eht in mt76_rx_status will make the struct
size exceed the cb size, so make nss and band share the same u8.
Signed-off-by: default avatarShayne Chen <shayne.chen@mediatek.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent dda423dd
...@@ -1067,9 +1067,14 @@ mt76_rx_convert(struct mt76_dev *dev, struct sk_buff *skb, ...@@ -1067,9 +1067,14 @@ mt76_rx_convert(struct mt76_dev *dev, struct sk_buff *skb,
status->enc_flags = mstat.enc_flags; status->enc_flags = mstat.enc_flags;
status->encoding = mstat.encoding; status->encoding = mstat.encoding;
status->bw = mstat.bw; status->bw = mstat.bw;
if (status->encoding == RX_ENC_EHT) {
status->eht.ru = mstat.eht.ru;
status->eht.gi = mstat.eht.gi;
} else {
status->he_ru = mstat.he_ru; status->he_ru = mstat.he_ru;
status->he_gi = mstat.he_gi; status->he_gi = mstat.he_gi;
status->he_dcm = mstat.he_dcm; status->he_dcm = mstat.he_dcm;
}
status->rate_idx = mstat.rate_idx; status->rate_idx = mstat.rate_idx;
status->nss = mstat.nss; status->nss = mstat.nss;
status->band = mstat.band; status->band = mstat.band;
......
...@@ -621,12 +621,22 @@ struct mt76_rx_status { ...@@ -621,12 +621,22 @@ struct mt76_rx_status {
u16 freq; u16 freq;
u32 flag; u32 flag;
u8 enc_flags; u8 enc_flags;
u8 encoding:2, bw:3, he_ru:3; u8 encoding:3, bw:4;
u8 he_gi:2, he_dcm:1; union {
struct {
u8 he_ru:3;
u8 he_gi:2;
u8 he_dcm:1;
};
struct {
u8 ru:4;
u8 gi:2;
} eht;
};
u8 amsdu:1, first_amsdu:1, last_amsdu:1; u8 amsdu:1, first_amsdu:1, last_amsdu:1;
u8 rate_idx; u8 rate_idx;
u8 nss; u8 nss:5, band:3;
u8 band;
s8 signal; s8 signal;
u8 chains; u8 chains;
s8 chain_signal[IEEE80211_MAX_CHAINS]; s8 chain_signal[IEEE80211_MAX_CHAINS];
......
...@@ -572,11 +572,12 @@ mt7996_mac_fill_rx_rate(struct mt7996_dev *dev, ...@@ -572,11 +572,12 @@ mt7996_mac_fill_rx_rate(struct mt7996_dev *dev,
case MT_PHY_TYPE_EHT_SU: case MT_PHY_TYPE_EHT_SU:
case MT_PHY_TYPE_EHT_TRIG: case MT_PHY_TYPE_EHT_TRIG:
case MT_PHY_TYPE_EHT_MU: case MT_PHY_TYPE_EHT_MU:
/* TODO: currently report rx rate with HE rate */
status->nss = nss; status->nss = nss;
status->encoding = RX_ENC_HE; status->encoding = RX_ENC_EHT;
bw = min_t(int, bw, IEEE80211_STA_RX_BW_160); i &= GENMASK(3, 0);
i = min_t(int, i & 0xf, 11);
if (gi <= NL80211_RATE_INFO_EHT_GI_3_2)
status->eht.gi = gi;
break; break;
default: default:
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment