summaryrefslogtreecommitdiffstats
path: root/sys/dev/ath/if_ath.c
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2013-05-21 18:02:54 +0000
committeradrian <adrian@FreeBSD.org>2013-05-21 18:02:54 +0000
commitc283b0b0aedb8f9857faaa84acf02ecc01957958 (patch)
treeb437eb21d7076d263e6e3a1eacf56014dd3110d9 /sys/dev/ath/if_ath.c
parent075c3eda472bf38f7728bc1b95cd32b998c524b9 (diff)
downloadFreeBSD-src-c283b0b0aedb8f9857faaa84acf02ecc01957958.zip
FreeBSD-src-c283b0b0aedb8f9857faaa84acf02ecc01957958.tar.gz
Enable the use of TDMA on an 802.11n channel (with aggregation disabled,
of course.) There's a few things that needed to happen: * In case someone decides to set the beacon transmission rate to be at an MCS rate, use the MCS-aware version of the duration calculation to figure out how long the received beacon frame was. * If TxOP enforcing is available on the hardware and we're doing TDMA, enable it after a reset and set the TDMA guard interval to zero. This seems to behave fine. TODO: * Although I haven't yet seen packet loss, the PHY errors that would be triggered (specifically Transmit-Override-Receive) aren't enabled by the 11n HAL. I'll have to do some work to enable these PHY errors for debugging. What broke: * My recent changes to the TX queue handling has resulted in the driver not keeping the hardware queue properly filled when doing non-aggregate traffic. I have a patch to commit soon which fixes this situation (albeit by reminding me about how my ath driver locking isn't working out, sigh.) So if you want to test this without updating to the next set of patches that I commit, just bump the sysctl dev.ath.X.hwq_limit from 2 to 32. Tested: * AR5416 <-> AR5416, with ampdu disabled, HT40, 5GHz, MCS12+Short-GI. I saw 30mbit/sec in both directions using a bidirectional UDP test.
Diffstat (limited to 'sys/dev/ath/if_ath.c')
-rw-r--r--sys/dev/ath/if_ath.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c
index 4744d75..6f5d9bf 100644
--- a/sys/dev/ath/if_ath.c
+++ b/sys/dev/ath/if_ath.c
@@ -670,6 +670,7 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
sc->sc_hastsfadd = ath_hal_hastsfadjust(ah);
sc->sc_rxslink = ath_hal_self_linked_final_rxdesc(ah);
sc->sc_rxtsf32 = ath_hal_has_long_rxdesc_tsf(ah);
+ sc->sc_hasenforcetxop = ath_hal_hasenforcetxop(ah);
if (ath_hal_hasfastframes(ah))
ic->ic_caps |= IEEE80211_C_FF;
wmodes = ath_hal_getwirelessmodes(ah);
@@ -1586,6 +1587,15 @@ ath_resume(struct ath_softc *sc)
/* Let spectral at in case spectral is enabled */
ath_spectral_enable(sc, ic->ic_curchan);
+ /*
+ * If we're doing TDMA, enforce the TXOP limitation for chips that
+ * support it.
+ */
+ if (sc->sc_hasenforcetxop && sc->sc_tdma)
+ ath_hal_setenforcetxop(sc->sc_ah, 1);
+ else
+ ath_hal_setenforcetxop(sc->sc_ah, 0);
+
/* Restore the LED configuration */
ath_led_config(sc);
ath_hal_setledstate(ah, HAL_LED_INIT);
@@ -2034,6 +2044,15 @@ ath_init(void *arg)
ath_spectral_enable(sc, ic->ic_curchan);
/*
+ * If we're doing TDMA, enforce the TXOP limitation for chips that
+ * support it.
+ */
+ if (sc->sc_hasenforcetxop && sc->sc_tdma)
+ ath_hal_setenforcetxop(sc->sc_ah, 1);
+ else
+ ath_hal_setenforcetxop(sc->sc_ah, 0);
+
+ /*
* Likewise this is set during reset so update
* state cached in the driver.
*/
@@ -2348,6 +2367,15 @@ ath_reset(struct ifnet *ifp, ATH_RESET_TYPE reset_type)
/* Let spectral at in case spectral is enabled */
ath_spectral_enable(sc, ic->ic_curchan);
+ /*
+ * If we're doing TDMA, enforce the TXOP limitation for chips that
+ * support it.
+ */
+ if (sc->sc_hasenforcetxop && sc->sc_tdma)
+ ath_hal_setenforcetxop(sc->sc_ah, 1);
+ else
+ ath_hal_setenforcetxop(sc->sc_ah, 0);
+
if (ath_startrecv(sc) != 0) /* restart recv */
if_printf(ifp, "%s: unable to start recv logic\n", __func__);
/*
@@ -4869,6 +4897,15 @@ ath_chan_set(struct ath_softc *sc, struct ieee80211_channel *chan)
ath_spectral_enable(sc, chan);
/*
+ * If we're doing TDMA, enforce the TXOP limitation for chips
+ * that support it.
+ */
+ if (sc->sc_hasenforcetxop && sc->sc_tdma)
+ ath_hal_setenforcetxop(sc->sc_ah, 1);
+ else
+ ath_hal_setenforcetxop(sc->sc_ah, 0);
+
+ /*
* Re-enable rx framework.
*/
if (ath_startrecv(sc) != 0) {
OpenPOWER on IntegriCloud