diff options
author | Adrian Chadd <adrian@FreeBSD.org> | 2024-12-04 06:26:09 +0000 |
---|---|---|
committer | Adrian Chadd <adrian@FreeBSD.org> | 2024-12-14 02:17:40 +0000 |
commit | 7b71689c9ccd71d9683e6d55d42e090e292d13d2 (patch) | |
tree | 92a2860316cd392c2376b4b3c3ff4461a3cf1907 | |
parent | 7722d5e214772be22ef20bee46afeed2e9f78858 (diff) |
rtwn: update RTL8812AU/RTL8821AU receive path to include VHT info
* RX frames with short-GI can be either HT or VHT
* Add placeholders for RX VHT rate, PHY type, etc
Differential Revision: https://reviews.freebsd.org/D47902
-rw-r--r-- | sys/dev/rtwn/rtl8812a/r12a_rx.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sys/dev/rtwn/rtl8812a/r12a_rx.c b/sys/dev/rtwn/rtl8812a/r12a_rx.c index 482e4ee38c81..805775033fd1 100644 --- a/sys/dev/rtwn/rtl8812a/r12a_rx.c +++ b/sys/dev/rtwn/rtl8812a/r12a_rx.c @@ -246,7 +246,8 @@ r12a_get_rx_stats(struct rtwn_softc *sc, struct ieee80211_rx_stats *rxs, rxs->c_pktflags |= IEEE80211_RX_F_AMPDU_MORE; } - if ((rxdw4 & R12A_RXDW4_SPLCP) && RTWN_RATE_IS_HT(rate)) + if ((rxdw4 & R12A_RXDW4_SPLCP) && + (RTWN_RATE_IS_HT(rate) || RTWN_RATE_IS_VHT(rate))) rxs->c_pktflags |= IEEE80211_RX_F_SHORTGI; switch (MS(rxdw4, R12A_RXDW4_BW)) { @@ -277,11 +278,14 @@ r12a_get_rx_stats(struct rtwn_softc *sc, struct ieee80211_rx_stats *rxs, rxs->c_phytype = IEEE80211_RX_FP_11A; else rxs->c_phytype = IEEE80211_RX_FP_11G; - } else { + } else if (RTWN_RATE_IS_HT(rate)) { if (is5ghz) rxs->c_phytype = IEEE80211_RX_FP_11NA; else rxs->c_phytype = IEEE80211_RX_FP_11NG; + } else if (RTWN_RATE_IS_VHT(rate)) { + /* TODO: there's no FP_VHT_5GHZ yet */ + rxs->c_phytype = IEEE80211_RX_FP_11NA; } } @@ -292,11 +296,15 @@ r12a_get_rx_stats(struct rtwn_softc *sc, struct ieee80211_rx_stats *rxs, rxs->c_pktflags |= IEEE80211_RX_F_CCK; else rxs->c_pktflags |= IEEE80211_RX_F_OFDM; - } else { /* MCS0~15. */ - /* TODO: VHT rates */ + } else if (RTWN_RATE_IS_HT(rate)) { /* MCS0~15. */ rxs->c_rate = IEEE80211_RATE_MCS | RTWN_RIDX_TO_MCS(rate); rxs->c_pktflags |= IEEE80211_RX_F_HT; + } else if (RTWN_RATE_IS_VHT(rate)) { + /* XXX: need to revisit VHT rate representation */ + rxs->c_vhtnss = (rate - RTWN_RIDX_VHT_MCS_SHIFT) / 10; + rxs->c_rate = (rate - RTWN_RIDX_VHT_MCS_SHIFT) % 10; + rxs->c_pktflags |= IEEE80211_RX_F_VHT; } /* |