diff options
author | sam <sam@FreeBSD.org> | 2009-06-27 20:06:56 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2009-06-27 20:06:56 +0000 |
commit | 6c6387b0e87b31a0793232918daa3bcaeddd3482 (patch) | |
tree | 25b459afed5e852eaeb9aea5f1aab43bc321c461 | |
parent | 053703e8be8764474fabc397d09fab1b408e36b1 (diff) | |
download | FreeBSD-src-6c6387b0e87b31a0793232918daa3bcaeddd3482.zip FreeBSD-src-6c6387b0e87b31a0793232918daa3bcaeddd3482.tar.gz |
Add HAL_RX_FILTER_BSSID support (to disable bssid match):
o add HAL_CAP_BSSIDMATCH to identify parts that have the support for
disabling bssid match
o honor capability for set/get rx filter
o use HAL_CAP_BSSIDMATCH in driver to decide whether to use the bssid
match disable or fall back to promisc mode
Reviewed by: rpaulo
Approved by: re (rwatson)
-rw-r--r-- | sys/dev/ath/ath_hal/ah.c | 2 | ||||
-rw-r--r-- | sys/dev/ath/ath_hal/ah.h | 2 | ||||
-rw-r--r-- | sys/dev/ath/ath_hal/ah_internal.h | 3 | ||||
-rw-r--r-- | sys/dev/ath/ath_hal/ar5212/ar5212_attach.c | 12 | ||||
-rw-r--r-- | sys/dev/ath/ath_hal/ar5212/ar5212_recv.c | 16 | ||||
-rw-r--r-- | sys/dev/ath/ath_hal/ar5416/ar5416_attach.c | 1 | ||||
-rw-r--r-- | sys/dev/ath/if_athvar.h | 2 |
7 files changed, 31 insertions, 7 deletions
diff --git a/sys/dev/ath/ath_hal/ah.c b/sys/dev/ath/ath_hal/ah.c index 616e19b..cff9613 100644 --- a/sys/dev/ath/ath_hal/ah.c +++ b/sys/dev/ath/ath_hal/ah.c @@ -503,6 +503,8 @@ ath_hal_getcapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type, case HAL_CAP_INTRMASK: /* mask of supported interrupts */ *result = pCap->halIntrMask; return HAL_OK; + case HAL_CAP_BSSIDMATCH: /* hardware has disable bssid match */ + return pCap->halBssidMatchSupport ? HAL_OK : HAL_ENOTSUPP; default: return HAL_EINVAL; } diff --git a/sys/dev/ath/ath_hal/ah.h b/sys/dev/ath/ath_hal/ah.h index ba55a2d..f7434f8 100644 --- a/sys/dev/ath/ath_hal/ah.h +++ b/sys/dev/ath/ath_hal/ah.h @@ -110,6 +110,7 @@ typedef enum { HAL_CAP_BB_HANG = 35, /* can baseband hang */ HAL_CAP_MAC_HANG = 36, /* can MAC hang */ HAL_CAP_INTRMASK = 37, /* bitmask of supported interrupts */ + HAL_CAP_BSSIDMATCH = 38, /* hardware has disable bssid match */ } HAL_CAPABILITY_TYPE; /* @@ -296,6 +297,7 @@ typedef enum { HAL_RX_FILTER_PHYERR = 0x00000100, /* Allow phy errors */ HAL_RX_FILTER_PHYRADAR = 0x00000200, /* Allow phy radar errors */ HAL_RX_FILTER_COMPBAR = 0x00000400, /* Allow compressed BAR */ + HAL_RX_FILTER_BSSID = 0x00000800, /* Disable BSSID match */ } HAL_RX_FILTER; typedef enum { diff --git a/sys/dev/ath/ath_hal/ah_internal.h b/sys/dev/ath/ath_hal/ah_internal.h index 087a8e3..8f7ba65 100644 --- a/sys/dev/ath/ath_hal/ah_internal.h +++ b/sys/dev/ath/ath_hal/ah_internal.h @@ -193,7 +193,8 @@ typedef struct { halExtChanDfsSupport : 1, halForcePpmSupport : 1, halEnhancedPmSupport : 1, - halMbssidAggrSupport : 1; + halMbssidAggrSupport : 1, + halBssidMatchSupport : 1; uint32_t halWirelessModes; uint16_t halTotalQueues; uint16_t halKeyCacheSize; diff --git a/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c b/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c index 60e1521..ace6989 100644 --- a/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c +++ b/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c @@ -833,11 +833,15 @@ ar5212FillCapabilityInfo(struct ath_hal *ah) ahpriv->ah_rxornIsFatal = (AH_PRIVATE(ah)->ah_macVersion < AR_SREV_VERSION_VENICE); - /* h/w phy counters first appeared in Hainan */ - pCap->halHwPhyCounterSupport = - (AH_PRIVATE(ah)->ah_macVersion == AR_SREV_VERSION_VENICE && + /* enable features that first appeared in Hainan */ + if ((AH_PRIVATE(ah)->ah_macVersion == AR_SREV_VERSION_VENICE && AH_PRIVATE(ah)->ah_macRev == AR_SREV_HAINAN) || - AH_PRIVATE(ah)->ah_macVersion > AR_SREV_VERSION_VENICE; + AH_PRIVATE(ah)->ah_macVersion > AR_SREV_VERSION_VENICE) { + /* h/w phy counters */ + pCap->halHwPhyCounterSupport = AH_TRUE; + /* bssid match disable */ + pCap->halBssidMatchSupport = AH_TRUE; + } pCap->halTstampPrecision = 15; pCap->halIntrMask = HAL_INT_COMMON diff --git a/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c b/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c index 22bc112..f6d5b33 100644 --- a/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c +++ b/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5212_recv.c,v 1.4 2008/11/10 04:08:03 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" @@ -163,6 +163,9 @@ ar5212GetRxFilter(struct ath_hal *ah) bits |= HAL_RX_FILTER_PHYRADAR; if (phybits & (AR_PHY_ERR_OFDM_TIMING|AR_PHY_ERR_CCK_TIMING)) bits |= HAL_RX_FILTER_PHYERR; + if (AH_PRIVATE(ah)->ah_caps.halBssidMatchSupport && + (OS_REG_READ(ah, AR_MISC_MODE) & AR_MISC_MODE_BSSID_MATCH_FORCE)) + bits |= HAL_RX_FILTER_BSSID; return bits; } @@ -175,7 +178,8 @@ ar5212SetRxFilter(struct ath_hal *ah, uint32_t bits) uint32_t phybits; OS_REG_WRITE(ah, AR_RX_FILTER, - bits &~ (HAL_RX_FILTER_PHYRADAR|HAL_RX_FILTER_PHYERR)); + bits &~ (HAL_RX_FILTER_PHYRADAR|HAL_RX_FILTER_PHYERR| + HAL_RX_FILTER_BSSID)); phybits = 0; if (bits & HAL_RX_FILTER_PHYRADAR) phybits |= AR_PHY_ERR_RADAR; @@ -189,6 +193,14 @@ ar5212SetRxFilter(struct ath_hal *ah, uint32_t bits) OS_REG_WRITE(ah, AR_RXCFG, OS_REG_READ(ah, AR_RXCFG) &~ AR_RXCFG_ZLFDMA); } + if (AH_PRIVATE(ah)->ah_caps.halBssidMatchSupport) { + uint32_t miscbits = OS_REG_READ(ah, AR_MISC_MODE); + if (bits & HAL_RX_FILTER_BSSID) + miscbits |= AR_MISC_MODE_BSSID_MATCH_FORCE; + else + miscbits &= ~AR_MISC_MODE_BSSID_MATCH_FORCE; + OS_REG_WRITE(ah, AR_MISC_MODE, miscbits); + } } /* diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c b/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c index 01859d0..e59a099 100644 --- a/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c +++ b/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c @@ -811,6 +811,7 @@ ar5416FillCapabilityInfo(struct ath_hal *ah) pCap->halMbssidAggrSupport = AH_TRUE; pCap->halForcePpmSupport = AH_TRUE; pCap->halEnhancedPmSupport = AH_TRUE; + pCap->halBssidMatchSupport = AH_TRUE; if (ath_hal_eepromGetFlag(ah, AR_EEP_RFKILL) && ath_hal_eepromGet(ah, AR_EEP_RFSILENT, &ahpriv->ah_rfsilent) == HAL_OK) { diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h index 9d9e459..6a1ece2 100644 --- a/sys/dev/ath/if_athvar.h +++ b/sys/dev/ath/if_athvar.h @@ -590,6 +590,8 @@ void ath_intr(void *); (ath_hal_getcapability(_ah, HAL_CAP_FASTFRAME, 0, NULL) == HAL_OK) #define ath_hal_hasbssidmask(_ah) \ (ath_hal_getcapability(_ah, HAL_CAP_BSSIDMASK, 0, NULL) == HAL_OK) +#define ath_hal_hasbssidmatch(_ah) \ + (ath_hal_getcapability(_ah, HAL_CAP_BSSIDMATCH, 0, NULL) == HAL_OK) #define ath_hal_hastsfadjust(_ah) \ (ath_hal_getcapability(_ah, HAL_CAP_TSF_ADJUST, 0, NULL) == HAL_OK) #define ath_hal_gettsfadjust(_ah) \ |