Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137777238
D47751.id147403.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D47751.id147403.diff
View Options
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,16 +171,21 @@
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))
- 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))
- txd->txdw5 |= htole32(R92C_TXDW5_SGI);
+ /*
+ * Only enable short-GI if we're transmitting in that
+ * width to that node.
+ *
+ * Specifically, do not enable shortgi for 20MHz if
+ * we're attempting to transmit at 40MHz.
+ */
+ if (ieee80211_ht_check_tx_ht40(ni)) {
+ if (ieee80211_ht_check_tx_shortgi_40(ni))
+ txd->txdw5 |= htole32(R92C_TXDW5_SGI);
+ } else if (ieee80211_ht_check_tx_ht(ni)) {
+ if (ieee80211_ht_check_tx_shortgi_20(ni))
+ txd->txdw5 |= htole32(R92C_TXDW5_SGI);
+ }
}
void
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,16 +199,23 @@
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))
- 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))
- txd->txdw5 |= htole32(R12A_TXDW5_DATA_SHORT);
+ /* TODO: VHT 20/40/80 checks */
+
+ /*
+ * Only enable short-GI if we're transmitting in that
+ * width to that node.
+ *
+ * Specifically, do not enable shortgi for 20MHz if
+ * we're attempting to transmit at 40MHz.
+ */
+ if (ieee80211_ht_check_tx_ht40(ni)) {
+ if (ieee80211_ht_check_tx_shortgi_40(ni))
+ txd->txdw5 |= htole32(R12A_TXDW5_DATA_SHORT);
+ } else if (ieee80211_ht_check_tx_ht(ni)) {
+ if (ieee80211_ht_check_tx_shortgi_20(ni))
+ txd->txdw5 |= htole32(R12A_TXDW5_DATA_SHORT);
+ }
}
static void
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 26, 6:15 PM (15 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26221850
Default Alt Text
D47751.id147403.diff (2 KB)
Attached To
Mode
D47751: rtwn: use ieee80211_ht_check_tx_shortgi_20() and ieee80211_ht_check_tx_shortgi_40()
Attached
Detach File
Event Timeline
Log In to Comment