aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2024-12-16 02:05:13 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2025-01-05 17:21:53 +0000
commit93411b39fff24ab4c9bf2b0395c7789b1a1c7a42 (patch)
tree7c6634abc4272d5637328e50bae238e7ac785eeb
parent48b9d78a0a9d795cfdeb56895a27309aadd50c77 (diff)
rtwn: calculate control rate for VHT rate frames
If the passed in rate is a VHT rate, use rtwn_ctl_vhtrate() to find a suitable rate for RTS/CTS. Differential Revision: https://reviews.freebsd.org/D48295 Reviewed by: bz, cy, emaste
-rw-r--r--sys/dev/rtwn/rtl8812a/r12a_tx.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/rtwn/rtl8812a/r12a_tx.c b/sys/dev/rtwn/rtl8812a/r12a_tx.c
index cc686668e4a2..582e6e0ddaf4 100644
--- a/sys/dev/rtwn/rtl8812a/r12a_tx.c
+++ b/sys/dev/rtwn/rtl8812a/r12a_tx.c
@@ -103,11 +103,17 @@ r12a_tx_protection(struct rtwn_softc *sc, struct r12a_tx_desc *txd,
if (mode == IEEE80211_PROT_CTSONLY ||
mode == IEEE80211_PROT_RTSCTS) {
- /* TODO: VHT */
- if (RTWN_RATE_IS_HT(ridx))
+ /*
+ * Note: this code assumes basic rates for protection for
+ * both 802.11abg and 802.11n rates.
+ */
+ if (RTWN_RATE_IS_VHT(ridx))
+ rate = rtwn_ctl_vhtrate(ic->ic_rt, ridx);
+ else if (RTWN_RATE_IS_HT(ridx))
rate = rtwn_ctl_mcsrate(ic->ic_rt, ridx);
else
rate = ieee80211_ctl_rate(ic->ic_rt, ridx2rate[ridx]);
+ /* Map basic rate back to ridx */
ridx = rate2ridx(IEEE80211_RV(rate));
txd->txdw4 |= htole32(SM(R12A_TXDW4_RTSRATE, ridx));