diff options
author | adrian <adrian@FreeBSD.org> | 2016-06-08 16:10:34 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2016-06-08 16:10:34 +0000 |
commit | 586c614ab06987a9e3d1288cd2f978127f7a64c6 (patch) | |
tree | 9a24a419117408e085fe09d1ab6715995b0fa945 /sys/contrib | |
parent | 94cde17e1ab2998db1f99095c181f45f17833568 (diff) | |
download | FreeBSD-src-586c614ab06987a9e3d1288cd2f978127f7a64c6.zip FreeBSD-src-586c614ab06987a9e3d1288cd2f978127f7a64c6.tar.gz |
[ath_hal] correctly initialise the CAB queue default value
* Allow readyTime to just be programmed in directly
* The beacon interval and all of the beacon timing sysctl's are in TU,
not TSF. So, we were doing the wrong math on the CAB programming
in the first place.
Diffstat (limited to 'sys/contrib')
-rw-r--r-- | sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c index 530b29a..047bcd2 100644 --- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c +++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c @@ -422,11 +422,29 @@ ar9300_reset_tx_queue(struct ath_hal *ah, u_int q) | AR_Q_MISC_CBR_INCR_DIS1 | AR_Q_MISC_CBR_INCR_DIS0); - value = TU_TO_USEC(qi->tqi_readyTime) - - (ah->ah_config.ah_sw_beacon_response_time - - ah->ah_config.ah_dma_beacon_response_time) - - ah->ah_config.ah_additional_swba_backoff; - OS_REG_WRITE(ah, AR_QRDYTIMECFG(q), value | AR_Q_RDYTIMECFG_EN); + if (qi->tqi_readyTime) { + OS_REG_WRITE(ah, AR_QRDYTIMECFG(q), + SM(qi->tqi_readyTime, AR_Q_RDYTIMECFG_DURATION) | + AR_Q_RDYTIMECFG_EN); + } else { + + value = (ahp->ah_beaconInterval * 50 / 100) + - ah->ah_config.ah_additional_swba_backoff + - ah->ah_config.ah_sw_beacon_response_time + + ah->ah_config.ah_dma_beacon_response_time; + /* + * XXX Ensure it isn't too low - nothing lower + * XXX than 10 TU + */ + if (value < 10) + value = 10; + HALDEBUG(ah, HAL_DEBUG_TXQUEUE, + "%s: defaulting to rdytime = %d uS\n", + __func__, value); + OS_REG_WRITE(ah, AR_QRDYTIMECFG(q), + SM(TU_TO_USEC(value), AR_Q_RDYTIMECFG_DURATION) | + AR_Q_RDYTIMECFG_EN); + } OS_REG_WRITE(ah, AR_DMISC(q), OS_REG_READ(ah, AR_DMISC(q)) | (AR_D_MISC_ARB_LOCKOUT_CNTRL_GLOBAL << |