diff --git a/sys/dev/rtwn/rtl8192c/r92c_tx.c b/sys/dev/rtwn/rtl8192c/r92c_tx.c --- a/sys/dev/rtwn/rtl8192c/r92c_tx.c +++ b/sys/dev/rtwn/rtl8192c/r92c_tx.c @@ -171,15 +171,12 @@ 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 --- a/sys/dev/rtwn/rtl8812a/r12a_tx.c +++ b/sys/dev/rtwn/rtl8812a/r12a_tx.c @@ -199,15 +199,14 @@ 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); }