From nobody Sat Dec 07 07:14:54 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Y4zsV4yzTz5gflK; Sat, 07 Dec 2024 07:14:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y4zsV3vXmz49ff; Sat, 7 Dec 2024 07:14:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733555694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jj1WnZKG2SwFYDhTULZc3Lp+TKOIvz4kGcQR87z7ihc=; b=dzUL3IPpXyHwP+BDnYYuceloTMPBi2Q6bJlqFU+18tshF8UTsQuohBdCWNlK945OjG1LV+ 31jwFBmr2b1ldHfIJd4NECh4LMXaaSKGZXV+7LmYJEPfILQGIRWoYlUagBvTFKpeRrWTiG E/rTJabBsB9nC2uI1P8JEkxTdzpEHRaQt9tftfJM2+cZgTtSy1w6h+40mhlh1ffayUi9Rl YZJ8QCR3F77XP2tgyRv5SHAscDyubOyVPEJTAJmjOz3EQzrm2HNXLFBjUUqKwOHKM3ouf8 YAEVi0mRaciCpipqsMlpjoV8/C6Qm/JFe6juq+OSK8JYrFQZhRW5j1WsV7Cvaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733555694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jj1WnZKG2SwFYDhTULZc3Lp+TKOIvz4kGcQR87z7ihc=; b=E4eNV+ZAvx7UbB/g84Qs1DKXlFQuUPrT5GuLF5ZBS98ORUHMSUqGsyLUnoIdd1Zojhvbv3 gzKJXj2fNMa4hKLu5RsJqIgUJckb4kU1/AbBZlDdfMACFl6GQnhl/nps2rcK9WGzrzpIVC SjS21gK1RPHGzaZX6YIwf/M9S7LPlLH2QqnVlC4dB1C7m2R4Fkm5zuqbmXXn8lRuXH1Hej 9Iitxts8U9UWN/72Ag1tJZxj9HBsHuId+BbxMxKg+C8FGZ1wrLGEynIzUyII8gHCcdKSHO JZfPtiTkGaFIdCObeJqXMUpPU/ss2iz2Dpn8Y4kNsSSnxvKKPK/5nS5oVSOaZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733555694; a=rsa-sha256; cv=none; b=ohLcW2wq3QIfbbga6eLvHfOzDJRvPDN9gL+ws/0tXn7oBq9yGVvi7aG53uMbcPXiUw6T07 LEqO2IRNy8FTC8S83MOOuAfqeBBrqTJquaqn8WM1wPavR3S4GLh2Hn9bmVEJtQ8P3OSTcc pgOL591nxVfoUdnOjpVDMsDoU8dGV9TTwFMtAhNJ0/sMBw/W3BvRso2EedeLy8XM5i7L9p 7Cu/Zo1W4yU+LN8jplcuFLlgkvSYTJxgM3gJmsLOt1gowZLTZjwWRpI/ArNTy43hA98cjs Cnz8lLPQLOhW2p5TBIPdodtkh+7qqXEj7/rPtWqjh2F0uJcFTAtK12b4Fh257Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Y4zsV3WBfz1Cq8; Sat, 7 Dec 2024 07:14:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4B77EsPP058355; Sat, 7 Dec 2024 07:14:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B77Eswu058352; Sat, 7 Dec 2024 07:14:54 GMT (envelope-from git) Date: Sat, 7 Dec 2024 07:14:54 GMT Message-Id: <202412070714.4B77Eswu058352@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 3d69926189f5 - main - rtwn: expand the ridx numbers to include VHT; add accessor macros List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3d69926189f5ee72b3c762d27661a45d883909a2 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=3d69926189f5ee72b3c762d27661a45d883909a2 commit 3d69926189f5ee72b3c762d27661a45d883909a2 Author: Adrian Chadd AuthorDate: 2024-12-04 04:45:48 +0000 Commit: Adrian Chadd CommitDate: 2024-12-07 07:13:50 +0000 rtwn: expand the ridx numbers to include VHT; add accessor macros * expand the ridx field all the way through 4x4 11n (MCS0..MCS31) * and then expand it through VHT 4x4 (MCS0..9 for each stream) * add accessor macros to check if the rate is HT, VHT * use accessor macros to check if the rate is HT rather than comparing it against OFDM54 or RIDX_HT_MCS(0); the values aobve HT MCS will be VHT, and we don't want to trigger on those! * add a couple of appropriate TODO VHT bits in the TX path Locally tested: * RTL8192CU, STA mode * RTL8188EU, STA mode * RTL8821AU, STA mode * RTL8192EU, STA mode Differential Revision: https://reviews.freebsd.org/D47896 --- sys/dev/rtwn/if_rtwn_ridx.h | 35 ++++++++++++++++++++++++++++++----- sys/dev/rtwn/rtl8188e/r88e_chan.c | 2 +- sys/dev/rtwn/rtl8188e/r88e_rx.c | 5 ++--- sys/dev/rtwn/rtl8192c/r92c_chan.c | 4 ++-- sys/dev/rtwn/rtl8192c/r92c_fw.c | 4 ++-- sys/dev/rtwn/rtl8192c/r92c_rx.c | 8 ++++---- sys/dev/rtwn/rtl8192c/r92c_tx.c | 4 ++-- sys/dev/rtwn/rtl8192e/r92e_chan.c | 2 +- sys/dev/rtwn/rtl8812a/r12a_rx.c | 13 ++++++------- sys/dev/rtwn/rtl8812a/r12a_tx.c | 6 ++++-- 10 files changed, 54 insertions(+), 29 deletions(-) diff --git a/sys/dev/rtwn/if_rtwn_ridx.h b/sys/dev/rtwn/if_rtwn_ridx.h index dd93f2db4ccf..6193f9ee2cad 100644 --- a/sys/dev/rtwn/if_rtwn_ridx.h +++ b/sys/dev/rtwn/if_rtwn_ridx.h @@ -22,6 +22,11 @@ #define IF_RTWN_RIDX_H /* HW rate indices. */ + +/* + * Note - these are also used as offsets into the TX power table + * array. + */ #define RTWN_RIDX_CCK1 0 #define RTWN_RIDX_CCK2 1 #define RTWN_RIDX_CCK55 2 @@ -37,13 +42,34 @@ #define RTWN_RIDX_HT_MCS_SHIFT 12 #define RTWN_RIDX_HT_MCS(i) (RTWN_RIDX_HT_MCS_SHIFT + (i)) +#define RTWN_RIDX_TO_MCS(ridx) ((ridx) - RTWN_RIDX_HT_MCS_SHIFT) + +/* HT supports up to MCS31, so goes from 12 -> 43 */ + +#define RTWN_RIDX_LEGACY_HT_COUNT 44 + +/* + * VHT supports MCS0..9 for up to 4 spatial streams, so + * goes from 44 -> 83. + */ +#define RTWN_RIDX_VHT_MCS_SHIFT 44 +#define RTWN_RIDX_VHT_MCS(s, i) (RTWN_RIDX_VHT_MCS_SHIFT + ((10*s) + i)) + +/* + * The total amount of rate indexes, CCK, OFDM, HT MCS0..31, + * VHT MCS0..9 for 1-4 streams. + */ +#define RTWN_RIDX_COUNT 84 -#define RTWN_RIDX_COUNT 28 #define RTWN_RIDX_UNKNOWN (uint8_t)-1 -#define RTWN_RATE_IS_CCK(rate) ((rate) <= RTWN_RIDX_CCK11) +#define RTWN_RATE_IS_CCK(rate) ((rate) <= RTWN_RIDX_CCK11) #define RTWN_RATE_IS_OFDM(rate) \ - ((rate) >= RTWN_RIDX_OFDM6 && (rate) != RTWN_RIDX_UNKNOWN) + ((rate) >= RTWN_RIDX_OFDM6 && (rate) <= RTWN_RIDX_OFDM54) +#define RTWN_RATE_IS_HT(rate) \ + ((rate) >= RTWN_RIDX_HT_MCS_SHIFT && (rate) < RTWN_RIDX_VHT_MCS_SHIFT) +#define RTWN_RATE_IS_VHT(rate) \ + ((rate) >= RTWN_RIDX_VHT_MCS_SHIFT && (rate) <= RTWN_RIDX_COUNT) static const uint8_t ridx2rate[] = { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 }; @@ -80,8 +106,7 @@ rtwn_ctl_mcsrate(const struct ieee80211_rate_table *rt, uint8_t ridx) uint8_t cix, rate; /* Check if we are using MCS rate. */ - KASSERT(ridx >= RTWN_RIDX_HT_MCS(0) && ridx != RTWN_RIDX_UNKNOWN, - ("bad mcs rate index %d", ridx)); + KASSERT(RTWN_RATE_IS_HT(ridx), ("bad mcs rate index %d", ridx)); rate = (ridx - RTWN_RIDX_HT_MCS(0)) | IEEE80211_RATE_MCS; cix = rt->info[rt->rateCodeToIndex[rate]].ctlRateIndex; diff --git a/sys/dev/rtwn/rtl8188e/r88e_chan.c b/sys/dev/rtwn/rtl8188e/r88e_chan.c index c072b3554083..51474bc1b819 100644 --- a/sys/dev/rtwn/rtl8188e/r88e_chan.c +++ b/sys/dev/rtwn/rtl8188e/r88e_chan.c @@ -99,7 +99,7 @@ r88e_get_txpower(struct rtwn_softc *sc, int chain, /* XXX net80211 regulatory */ max_mcs = RTWN_RIDX_HT_MCS(sc->ntxchains * 8 - 1); - KASSERT(max_mcs <= RTWN_RIDX_COUNT, ("increase ridx limit\n")); + KASSERT(max_mcs <= RTWN_RIDX_LEGACY_HT_COUNT, ("increase ridx limit\n")); /* Compute per-CCK rate Tx power. */ cckpow = rt->cck_tx_pwr[group]; diff --git a/sys/dev/rtwn/rtl8188e/r88e_rx.c b/sys/dev/rtwn/rtl8188e/r88e_rx.c index 826076c8071c..287869885b86 100644 --- a/sys/dev/rtwn/rtl8188e/r88e_rx.c +++ b/sys/dev/rtwn/rtl8188e/r88e_rx.c @@ -120,9 +120,8 @@ r88e_ratectl_tx_complete(struct rtwn_softc *sc, uint8_t *buf, int len) txs.flags = IEEE80211_RATECTL_STATUS_LONG_RETRY | IEEE80211_RATECTL_STATUS_FINAL_RATE; txs.long_retries = ntries; - if (rpt->final_rate > RTWN_RIDX_OFDM54) { /* MCS */ - txs.final_rate = - rpt->final_rate - RTWN_RIDX_HT_MCS_SHIFT; + if (RTWN_RATE_IS_HT(rpt->final_rate)) { /* MCS */ + txs.final_rate = RTWN_RIDX_TO_MCS(rpt->final_rate); txs.final_rate |= IEEE80211_RATE_MCS; } else txs.final_rate = ridx2rate[rpt->final_rate]; diff --git a/sys/dev/rtwn/rtl8192c/r92c_chan.c b/sys/dev/rtwn/rtl8192c/r92c_chan.c index 0edb32a97b4d..55d73c934f1e 100644 --- a/sys/dev/rtwn/rtl8192c/r92c_chan.c +++ b/sys/dev/rtwn/rtl8192c/r92c_chan.c @@ -97,13 +97,13 @@ r92c_get_txpower(struct rtwn_softc *sc, int chain, /* XXX net80211 regulatory */ max_mcs = RTWN_RIDX_HT_MCS(sc->ntxchains * 8 - 1); - KASSERT(max_mcs <= RTWN_RIDX_COUNT, ("increase ridx limit\n")); + KASSERT(max_mcs <= RTWN_RIDX_LEGACY_HT_COUNT, ("increase ridx limit\n")); if (rs->regulatory == 0) { for (ridx = RTWN_RIDX_CCK1; ridx <= RTWN_RIDX_CCK11; ridx++) power[ridx] = base[chain].pwr[0][ridx]; } - for (ridx = RTWN_RIDX_OFDM6; ridx < RTWN_RIDX_COUNT; ridx++) { + for (ridx = RTWN_RIDX_OFDM6; ridx < RTWN_RIDX_LEGACY_HT_COUNT; ridx++) { if (rs->regulatory == 3) { power[ridx] = base[chain].pwr[0][ridx]; /* Apply vendor limits. */ diff --git a/sys/dev/rtwn/rtl8192c/r92c_fw.c b/sys/dev/rtwn/rtl8192c/r92c_fw.c index 5ab56a5f454e..e611e5addeb3 100644 --- a/sys/dev/rtwn/rtl8192c/r92c_fw.c +++ b/sys/dev/rtwn/rtl8192c/r92c_fw.c @@ -195,9 +195,9 @@ r92c_send_ra_cmd(struct rtwn_softc *sc, int macid, uint32_t rates, #endif /* Set rates mask for unicast frames. */ - if (maxrate >= RTWN_RIDX_HT_MCS(0)) + if (RTWN_RATE_IS_HT(maxrate)) mode = R92C_RAID_11GN; - else if (maxrate >= RTWN_RIDX_OFDM6) + else if (RTWN_RATE_IS_OFDM(maxrate)) mode = R92C_RAID_11BG; else mode = R92C_RAID_11B; diff --git a/sys/dev/rtwn/rtl8192c/r92c_rx.c b/sys/dev/rtwn/rtl8192c/r92c_rx.c index 72f726a24550..9af3b1ebc2c9 100644 --- a/sys/dev/rtwn/rtl8192c/r92c_rx.c +++ b/sys/dev/rtwn/rtl8192c/r92c_rx.c @@ -121,7 +121,7 @@ r92c_get_rx_stats(struct rtwn_softc *sc, struct ieee80211_rx_stats *rxs, rxs->c_pktflags |= IEEE80211_RX_F_AMPDU; else if (rxdw1 & R92C_RXDW1_AMPDU_MORE) rxs->c_pktflags |= IEEE80211_RX_F_AMPDU_MORE; - if ((rxdw3 & R92C_RXDW3_SPLCP) && rate >= RTWN_RIDX_HT_MCS(0)) + if ((rxdw3 & R92C_RXDW3_SPLCP) && RTWN_RATE_IS_HT(rate)) rxs->c_pktflags |= IEEE80211_RX_F_SHORTGI; if (rxdw3 & R92C_RXDW3_HT40) @@ -131,13 +131,13 @@ r92c_get_rx_stats(struct rtwn_softc *sc, struct ieee80211_rx_stats *rxs, if (RTWN_RATE_IS_CCK(rate)) rxs->c_phytype = IEEE80211_RX_FP_11B; - else if (rate < RTWN_RIDX_HT_MCS(0)) + else if (RTWN_RATE_IS_OFDM(rate)) rxs->c_phytype = IEEE80211_RX_FP_11G; else rxs->c_phytype = IEEE80211_RX_FP_11NG; /* Map HW rate index to 802.11 rate. */ - if (rate < RTWN_RIDX_HT_MCS(0)) { + if (RTWN_RATE_IS_CCK(rate) || RTWN_RATE_IS_OFDM(rate)) { rxs->c_rate = ridx2rate[rate]; if (RTWN_RATE_IS_CCK(rate)) rxs->c_pktflags |= IEEE80211_RX_F_CCK; @@ -145,7 +145,7 @@ r92c_get_rx_stats(struct rtwn_softc *sc, struct ieee80211_rx_stats *rxs, rxs->c_pktflags |= IEEE80211_RX_F_OFDM; } else { /* MCS0~15. */ rxs->c_rate = - IEEE80211_RATE_MCS | (rate - RTWN_RIDX_HT_MCS_SHIFT); + IEEE80211_RATE_MCS | (RTWN_RIDX_TO_MCS(rate)); rxs->c_pktflags |= IEEE80211_RX_F_HT; } } diff --git a/sys/dev/rtwn/rtl8192c/r92c_tx.c b/sys/dev/rtwn/rtl8192c/r92c_tx.c index 8a4c6581832b..9583a7e1119e 100644 --- a/sys/dev/rtwn/rtl8192c/r92c_tx.c +++ b/sys/dev/rtwn/rtl8192c/r92c_tx.c @@ -95,7 +95,7 @@ r92c_tx_protection(struct rtwn_softc *sc, struct r92c_tx_desc *txd, if (mode == IEEE80211_PROT_CTSONLY || mode == IEEE80211_PROT_RTSCTS) { - if (ridx >= RTWN_RIDX_HT_MCS(0)) + if (RTWN_RATE_IS_HT(ridx)) rate = rtwn_ctl_mcsrate(ic->ic_rt, ridx); else rate = ieee80211_ctl_rate(ic->ic_rt, ridx2rate[ridx]); @@ -314,7 +314,7 @@ r92c_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni, txd->txdw4 |= htole32(R92C_TXDW4_DATA_SHPRE); prot = IEEE80211_PROT_NONE; - if (ridx >= RTWN_RIDX_HT_MCS(0)) { + if (RTWN_RATE_IS_HT(ridx)) { r92c_tx_set_ht40(sc, txd, ni); r92c_tx_set_sgi(sc, txd, ni); prot = ic->ic_htprotmode; diff --git a/sys/dev/rtwn/rtl8192e/r92e_chan.c b/sys/dev/rtwn/rtl8192e/r92e_chan.c index b28462873c09..c6e911309cd2 100644 --- a/sys/dev/rtwn/rtl8192e/r92e_chan.c +++ b/sys/dev/rtwn/rtl8192e/r92e_chan.c @@ -137,7 +137,7 @@ r92e_get_txpower(struct rtwn_softc *sc, int chain, struct ieee80211_channel *c, if (sc->sc_debug & RTWN_DEBUG_TXPWR) { /* Dump per-rate Tx power values. */ printf("Tx power for chain %d:\n", chain); - for (ridx = RTWN_RIDX_CCK1; ridx < RTWN_RIDX_COUNT; ridx++) + for (ridx = RTWN_RIDX_CCK1; ridx < RTWN_RIDX_LEGACY_HT_COUNT; ridx++) printf("Rate %d = %u\n", ridx, power[ridx]); } #endif diff --git a/sys/dev/rtwn/rtl8812a/r12a_rx.c b/sys/dev/rtwn/rtl8812a/r12a_rx.c index 763397636ac9..482e4ee38c81 100644 --- a/sys/dev/rtwn/rtl8812a/r12a_rx.c +++ b/sys/dev/rtwn/rtl8812a/r12a_rx.c @@ -107,9 +107,8 @@ r12a_ratectl_tx_complete(struct rtwn_softc *sc, uint8_t *buf, int len) txs.flags = IEEE80211_RATECTL_STATUS_LONG_RETRY | IEEE80211_RATECTL_STATUS_FINAL_RATE; txs.long_retries = ntries; - if (rpt->final_rate > RTWN_RIDX_OFDM54) { /* MCS */ - txs.final_rate = - rpt->final_rate - RTWN_RIDX_HT_MCS_SHIFT; + if (RTWN_RATE_IS_HT(rpt->final_rate)) { /* MCS */ + txs.final_rate = RTWN_RIDX_TO_MCS(rpt->final_rate); txs.final_rate |= IEEE80211_RATE_MCS; } else txs.final_rate = ridx2rate[rpt->final_rate]; @@ -247,7 +246,7 @@ 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) && rate >= RTWN_RIDX_HT_MCS(0)) + if ((rxdw4 & R12A_RXDW4_SPLCP) && RTWN_RATE_IS_HT(rate)) rxs->c_pktflags |= IEEE80211_RX_F_SHORTGI; switch (MS(rxdw4, R12A_RXDW4_BW)) { @@ -273,7 +272,7 @@ r12a_get_rx_stats(struct rtwn_softc *sc, struct ieee80211_rx_stats *rxs, /* XXX check with RTL8812AU */ is5ghz = (physt->cfosho[2] != 0x01); - if (rate < RTWN_RIDX_HT_MCS(0)) { + if (RTWN_RATE_IS_CCK(rate) || RTWN_RATE_IS_OFDM(rate)) { if (is5ghz) rxs->c_phytype = IEEE80211_RX_FP_11A; else @@ -287,7 +286,7 @@ r12a_get_rx_stats(struct rtwn_softc *sc, struct ieee80211_rx_stats *rxs, } /* Map HW rate index to 802.11 rate. */ - if (rate < RTWN_RIDX_HT_MCS(0)) { + if (RTWN_RATE_IS_CCK(rate) || RTWN_RATE_IS_OFDM(rate)) { rxs->c_rate = ridx2rate[rate]; if (RTWN_RATE_IS_CCK(rate)) rxs->c_pktflags |= IEEE80211_RX_F_CCK; @@ -296,7 +295,7 @@ r12a_get_rx_stats(struct rtwn_softc *sc, struct ieee80211_rx_stats *rxs, } else { /* MCS0~15. */ /* TODO: VHT rates */ rxs->c_rate = - IEEE80211_RATE_MCS | (rate - RTWN_RIDX_HT_MCS_SHIFT); + IEEE80211_RATE_MCS | RTWN_RIDX_TO_MCS(rate); rxs->c_pktflags |= IEEE80211_RX_F_HT; } diff --git a/sys/dev/rtwn/rtl8812a/r12a_tx.c b/sys/dev/rtwn/rtl8812a/r12a_tx.c index 8b16be17f8eb..822416a09618 100644 --- a/sys/dev/rtwn/rtl8812a/r12a_tx.c +++ b/sys/dev/rtwn/rtl8812a/r12a_tx.c @@ -103,7 +103,8 @@ r12a_tx_protection(struct rtwn_softc *sc, struct r12a_tx_desc *txd, if (mode == IEEE80211_PROT_CTSONLY || mode == IEEE80211_PROT_RTSCTS) { - if (ridx >= RTWN_RIDX_HT_MCS(0)) + /* TODO: VHT */ + if (RTWN_RATE_IS_HT(ridx)) rate = rtwn_ctl_mcsrate(ic->ic_rt, ridx); else rate = ieee80211_ctl_rate(ic->ic_rt, ridx2rate[ridx]); @@ -325,7 +326,8 @@ r12a_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni, txd->txdw5 |= htole32(R12A_TXDW5_DATA_SHORT); prot = IEEE80211_PROT_NONE; - if (ridx >= RTWN_RIDX_HT_MCS(0)) { + /* TODO: VHT */ + if (RTWN_RATE_IS_HT(ridx)) { r12a_tx_set_ht40(sc, txd, ni); r12a_tx_set_sgi(sc, txd, ni); r12a_tx_set_ldpc(sc, txd, ni);