aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2024-12-02 07:13:40 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2024-12-07 00:22:32 +0000
commit3513560909981a349c6edfca44fa2656b7eefeb5 (patch)
tree0f97e13c84499cbab555806f8fb1bc24c4d816e9
parentc1ad5b4b10c5e426d3d782b7216a038187419a1e (diff)
rtwn: use ieee80211_ht_check_tx_ht40() to transmit HT40 frames
Using ieee80211_ht_check_tx_ht40() means that not only the bss and node channel are checked, but the ni_chw value is also now correctly checked. Differential Revision: https://reviews.freebsd.org/D47862
-rw-r--r--sys/dev/rtwn/rtl8192c/r92c_tx.c3
-rw-r--r--sys/dev/rtwn/rtl8812a/r12a_tx.c7
2 files changed, 4 insertions, 6 deletions
diff --git a/sys/dev/rtwn/rtl8192c/r92c_tx.c b/sys/dev/rtwn/rtl8192c/r92c_tx.c
index a3e92e1b7ebb..8a4c6581832b 100644
--- a/sys/dev/rtwn/rtl8192c/r92c_tx.c
+++ b/sys/dev/rtwn/rtl8192c/r92c_tx.c
@@ -66,8 +66,7 @@ r92c_tx_set_ht40(struct rtwn_softc *sc, void *buf, struct ieee80211_node *ni)
{
struct r92c_tx_desc *txd = (struct r92c_tx_desc *)buf;
- if (ni->ni_chan != IEEE80211_CHAN_ANYC &&
- IEEE80211_IS_CHAN_HT40(ni->ni_chan)) {
+ if (ieee80211_ht_check_tx_ht40(ni)) {
int extc_offset;
extc_offset = r92c_tx_get_sco(sc, ni->ni_chan);
diff --git a/sys/dev/rtwn/rtl8812a/r12a_tx.c b/sys/dev/rtwn/rtl8812a/r12a_tx.c
index e6b5111063f7..8b16be17f8eb 100644
--- a/sys/dev/rtwn/rtl8812a/r12a_tx.c
+++ b/sys/dev/rtwn/rtl8812a/r12a_tx.c
@@ -59,7 +59,7 @@
static int
r12a_get_primary_channel(struct rtwn_softc *sc, struct ieee80211_channel *c)
{
- /* XXX 80 MHz */
+ /* XXX VHT80; VHT40 */
if (IEEE80211_IS_CHAN_HT40U(c))
return (R12A_TXDW5_PRIM_CHAN_20_80_2);
else
@@ -71,9 +71,8 @@ r12a_tx_set_ht40(struct rtwn_softc *sc, void *buf, struct ieee80211_node *ni)
{
struct r12a_tx_desc *txd = (struct r12a_tx_desc *)buf;
- /* XXX 80 Mhz */
- if (ni->ni_chan != IEEE80211_CHAN_ANYC &&
- IEEE80211_IS_CHAN_HT40(ni->ni_chan)) {
+ /* XXX VHT80; VHT40; VHT20 */
+ if (ieee80211_ht_check_tx_ht40(ni)) {
int prim_chan;
prim_chan = r12a_get_primary_channel(sc, ni->ni_chan);