summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2011-05-30 15:06:57 +0000
committeradrian <adrian@FreeBSD.org>2011-05-30 15:06:57 +0000
commitf2b5d7ad5d88199d76734d5c404b92cf6223a1e7 (patch)
treed9d9c4374bcc5bc1f1b80892416df4bae21de412
parent696ed40549067ce83a10a81ffbd8a81f74dba608 (diff)
downloadFreeBSD-src-f2b5d7ad5d88199d76734d5c404b92cf6223a1e7.zip
FreeBSD-src-f2b5d7ad5d88199d76734d5c404b92cf6223a1e7.tar.gz
Enable setting the short-GI bit when TX'ing HT rates but only if the
hardware supports it. Since ni->ni_htcap in hostap mode is what the remote end has advertised, not what has been negotiated/decided, we need to check ourselves what the current channel width is and what the hardware supports before enabling short-GI. It's important that short-GI isn't enabled when it isn't negotiated and when the hardware doesn't support it (ie, short-gi for 20mhz channels on any chip < AR9287.) I've quickly verified this on the AR9285 in 11n mode.
-rw-r--r--sys/dev/ath/if_ath_tx_ht.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/sys/dev/ath/if_ath_tx_ht.c b/sys/dev/ath/if_ath_tx_ht.c
index f4ade31..348a1499 100644
--- a/sys/dev/ath/if_ath_tx_ht.c
+++ b/sys/dev/ath/if_ath_tx_ht.c
@@ -136,15 +136,23 @@ ath_rateseries_setup(struct ath_softc *sc, struct ieee80211_node *ni,
*/
if (ni->ni_chw == 40)
series[i].RateFlags |= HAL_RATESERIES_2040;
-#if 0
+
/*
- * The hardware only supports short-gi in 40mhz mode -
- * if later hardware supports it in 20mhz mode, be sure
- * to add the relevant check here.
+ * Set short-GI only if the node has advertised it
+ * the channel width is suitable, and we support it.
+ * We don't currently have a "negotiated" set of bits -
+ * ni_htcap is what the remote end sends, not what this
+ * node is capable of.
*/
- if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40)
+ if (ni->ni_chw == 40 &&
+ ic->ic_htcaps & IEEE80211_HTCAP_SHORTGI40 &&
+ ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40)
+ series[i].RateFlags |= HAL_RATESERIES_HALFGI;
+
+ if (ni->ni_chw == 20 &&
+ ic->ic_htcaps & IEEE80211_HTCAP_SHORTGI20 &&
+ ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20)
series[i].RateFlags |= HAL_RATESERIES_HALFGI;
-#endif
series[i].Rate = rt->info[rix[i]].rateCode;
OpenPOWER on IntegriCloud