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)
This commit is contained in:
Sam Leffler 2009-06-27 20:06:56 +00:00
parent ad8dacbb91
commit 3c3e9d336d
7 changed files with 31 additions and 7 deletions

View File

@ -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;
}

View File

@ -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 {

View File

@ -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;

View File

@ -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

View File

@ -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);
}
}
/*

View File

@ -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) {

View File

@ -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) \