aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2024-11-25 23:20:42 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2024-12-03 22:10:49 +0000
commite1eff81ea99c1000ad74436a54c54ec9e777282a (patch)
tree789c8d381fed33b98b3ef74784f6102ceaedb1df
parent931d6a8f7bd6cfdb0edcc582dfbf6f9a7c45a812 (diff)
rtwn: use ieee80211_ht_check_tx_shortgi_20() and ieee80211_ht_check_tx_shortgi_40()
Use the new net80211 routines rather than rolling our own. Differential Revision: https://reviews.freebsd.org/D47751 Reviewed by: bz
-rw-r--r--sys/dev/rtwn/rtl8192c/r92c_tx.c11
-rw-r--r--sys/dev/rtwn/rtl8812a/r12a_tx.c13
2 files changed, 10 insertions, 14 deletions
diff --git a/sys/dev/rtwn/rtl8192c/r92c_tx.c b/sys/dev/rtwn/rtl8192c/r92c_tx.c
index 15beca776b61..5c8b2e114727 100644
--- a/sys/dev/rtwn/rtl8192c/r92c_tx.c
+++ b/sys/dev/rtwn/rtl8192c/r92c_tx.c
@@ -171,15 +171,12 @@ static void
r92c_tx_set_sgi(struct rtwn_softc *sc, void *buf, struct ieee80211_node *ni)
{
struct r92c_tx_desc *txd = (struct r92c_tx_desc *)buf;
- struct ieee80211vap *vap = ni->ni_vap;
- if ((vap->iv_flags_ht & IEEE80211_FHT_SHORTGI20) && /* HT20 */
- (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20))
+ if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)
+ && ieee80211_ht_check_tx_shortgi_40(ni))
txd->txdw5 |= htole32(R92C_TXDW5_SGI);
- else if (ni->ni_chan != IEEE80211_CHAN_ANYC && /* HT40 */
- IEEE80211_IS_CHAN_HT40(ni->ni_chan) &&
- (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40) &&
- (vap->iv_flags_ht & IEEE80211_FHT_SHORTGI40))
+ else if (IEEE80211_IS_CHAN_HT20(ni->ni_chan)
+ && ieee80211_ht_check_tx_shortgi_20(ni))
txd->txdw5 |= htole32(R92C_TXDW5_SGI);
}
diff --git a/sys/dev/rtwn/rtl8812a/r12a_tx.c b/sys/dev/rtwn/rtl8812a/r12a_tx.c
index 9e0d8e85c0cf..7a8a7d3679b1 100644
--- a/sys/dev/rtwn/rtl8812a/r12a_tx.c
+++ b/sys/dev/rtwn/rtl8812a/r12a_tx.c
@@ -199,15 +199,14 @@ static void
r12a_tx_set_sgi(struct rtwn_softc *sc, void *buf, struct ieee80211_node *ni)
{
struct r12a_tx_desc *txd = (struct r12a_tx_desc *)buf;
- struct ieee80211vap *vap = ni->ni_vap;
- if ((vap->iv_flags_ht & IEEE80211_FHT_SHORTGI20) && /* HT20 */
- (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20))
+ /* TODO: VHT 20/40/80 checks */
+
+ if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)
+ && ieee80211_ht_check_tx_shortgi_40(ni))
txd->txdw5 |= htole32(R12A_TXDW5_DATA_SHORT);
- else if (ni->ni_chan != IEEE80211_CHAN_ANYC && /* HT40 */
- IEEE80211_IS_CHAN_HT40(ni->ni_chan) &&
- (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40) &&
- (vap->iv_flags_ht & IEEE80211_FHT_SHORTGI40))
+ else if (IEEE80211_IS_CHAN_HT20(ni->ni_chan)
+ && ieee80211_ht_check_tx_shortgi_20(ni))
txd->txdw5 |= htole32(R12A_TXDW5_DATA_SHORT);
}