diff options
author | adrian <adrian@FreeBSD.org> | 2015-08-05 19:32:35 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2015-08-05 19:32:35 +0000 |
commit | fcfcc402dc66efb2746bd3968b0683ab9c6b5bbc (patch) | |
tree | bc0a4e4c3f1b524ac926693576ca9368b731a914 /sys/contrib | |
parent | 002d9943c1aeb0c7faafe52f7a6f2116120034d4 (diff) | |
download | FreeBSD-src-fcfcc402dc66efb2746bd3968b0683ab9c6b5bbc.zip FreeBSD-src-fcfcc402dc66efb2746bd3968b0683ab9c6b5bbc.tar.gz |
Add TXOP enforce support to the AR9300 HAL.
This is required for (more) correct TDMA support. Without it, the
code tries to calculate the required guard interval based on the
current rate, and since this is an 11n NIC and people try using
11n, it calls ath_hal_computetxtime() on an 11n rate which then
panics.
This doesn't fix TDMA slave mode on AR9300 - it just makes it
have one less bug.
Reported by: Berislav Purgar <bpurgar@gmail.com>
Diffstat (limited to 'sys/contrib')
-rw-r--r-- | sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c index e9caa43..6972200 100644 --- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c +++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c @@ -940,6 +940,13 @@ ar9300_get_capability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type, return HAL_OK; } return HAL_EINVAL; + case HAL_CAP_ENFORCE_TXOP: + if (capability == 0) + return (HAL_OK); + if (capability != 1) + return (HAL_ENOTSUPP); + (*result) = !! (ahp->ah_misc_mode & AR_PCU_TXOP_TBTT_LIMIT_ENA); + return (HAL_OK); default: return ath_hal_getcapability(ah, type, capability, result); } @@ -1041,6 +1048,18 @@ ar9300_set_capability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type, OS_REG_WRITE(ah, AR_DATABUF, ahp->rx_buf_size); return AH_TRUE; + case HAL_CAP_ENFORCE_TXOP: + if (capability != 1) + return AH_FALSE; + if (setting) { + ahp->ah_misc_mode |= AR_PCU_TXOP_TBTT_LIMIT_ENA; + OS_REG_SET_BIT(ah, AR_PCU_MISC, AR_PCU_TXOP_TBTT_LIMIT_ENA); + } else { + ahp->ah_misc_mode &= ~AR_PCU_TXOP_TBTT_LIMIT_ENA; + OS_REG_CLR_BIT(ah, AR_PCU_MISC, AR_PCU_TXOP_TBTT_LIMIT_ENA); + } + return AH_TRUE; + /* fall thru... */ default: return ath_hal_setcapability(ah, type, capability, setting, status); |