Date: Wed, 5 Aug 2015 19:32:36 +0000 (UTC) From: Adrian Chadd <adrian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286337 - head/sys/contrib/dev/ath/ath_hal/ar9300 Message-ID: <201508051932.t75JWa43099865@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: adrian Date: Wed Aug 5 19:32:35 2015 New Revision: 286337 URL: https://svnweb.freebsd.org/changeset/base/286337 Log: 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> Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Wed Aug 5 19:05:12 2015 (r286336) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Wed Aug 5 19:32:35 2015 (r286337) @@ -940,6 +940,13 @@ ar9300_get_capability(struct ath_hal *ah 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 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201508051932.t75JWa43099865>