Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Jun 2009 19:06:08 +0000 (UTC)
From:      Sam Leffler <sam@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r194994 - in projects/mesh11s/sys/dev/ath: . ath_hal ath_hal/ar5212 ath_hal/ar5416
Message-ID:  <200906251906.n5PJ68DZ061749@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sam
Date: Thu Jun 25 19:06:08 2009
New Revision: 194994
URL: http://svn.freebsd.org/changeset/base/194994

Log:
  Complete HAL_RX_FILTER_BSSID support:
  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 (still need to investigate
    whether we can use the bssid mask instead)

Modified:
  projects/mesh11s/sys/dev/ath/ath_hal/ah.c
  projects/mesh11s/sys/dev/ath/ath_hal/ah.h
  projects/mesh11s/sys/dev/ath/ath_hal/ah_internal.h
  projects/mesh11s/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
  projects/mesh11s/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c
  projects/mesh11s/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
  projects/mesh11s/sys/dev/ath/if_ath.c
  projects/mesh11s/sys/dev/ath/if_athvar.h

Modified: projects/mesh11s/sys/dev/ath/ath_hal/ah.c
==============================================================================
--- projects/mesh11s/sys/dev/ath/ath_hal/ah.c	Thu Jun 25 18:54:56 2009	(r194993)
+++ projects/mesh11s/sys/dev/ath/ath_hal/ah.c	Thu Jun 25 19:06:08 2009	(r194994)
@@ -503,6 +503,8 @@ ath_hal_getcapability(struct ath_hal *ah
 	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->halBsssidMatchSupport ? HAL_OK : HAL_ENOTSUPP;
 	default:
 		return HAL_EINVAL;
 	}

Modified: projects/mesh11s/sys/dev/ath/ath_hal/ah.h
==============================================================================
--- projects/mesh11s/sys/dev/ath/ath_hal/ah.h	Thu Jun 25 18:54:56 2009	(r194993)
+++ projects/mesh11s/sys/dev/ath/ath_hal/ah.h	Thu Jun 25 19:06:08 2009	(r194994)
@@ -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;
 
 /* 

Modified: projects/mesh11s/sys/dev/ath/ath_hal/ah_internal.h
==============================================================================
--- projects/mesh11s/sys/dev/ath/ath_hal/ah_internal.h	Thu Jun 25 18:54:56 2009	(r194993)
+++ projects/mesh11s/sys/dev/ath/ath_hal/ah_internal.h	Thu Jun 25 19:06:08 2009	(r194994)
@@ -193,7 +193,8 @@ typedef struct {
 			halExtChanDfsSupport		: 1,
 			halForcePpmSupport		: 1,
 			halEnhancedPmSupport		: 1,
-			halMbssidAggrSupport		: 1;
+			halMbssidAggrSupport		: 1,
+			halBsssidMatchSupport		: 1;
 	uint32_t	halWirelessModes;
 	uint16_t	halTotalQueues;
 	uint16_t	halKeyCacheSize;

Modified: projects/mesh11s/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
==============================================================================
--- projects/mesh11s/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c	Thu Jun 25 18:54:56 2009	(r194993)
+++ projects/mesh11s/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c	Thu Jun 25 19:06:08 2009	(r194994)
@@ -833,11 +833,15 @@ ar5212FillCapabilityInfo(struct ath_hal 
 	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->halBssIdMaskSupport = AH_TRUE;
+	}
 
 	pCap->halTstampPrecision = 15;
 	pCap->halIntrMask = HAL_INT_COMMON

Modified: projects/mesh11s/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c
==============================================================================
--- projects/mesh11s/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c	Thu Jun 25 18:54:56 2009	(r194993)
+++ projects/mesh11s/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c	Thu Jun 25 19:06:08 2009	(r194994)
@@ -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.halBsssidMatchSupport &&
+	    (OS_REG_READ(ah, AR_MISC_MODE) & AR_MISC_MODE_BSSID_MATCH_FORCE))
+		bits |= HAL_RX_FILTER_BSSID;
 	return bits;
 }
 
@@ -173,7 +176,6 @@ void
 ar5212SetRxFilter(struct ath_hal *ah, uint32_t bits)
 {
 	uint32_t phybits;
-	uint32_t miscbits;
 
 	OS_REG_WRITE(ah, AR_RX_FILTER,
 	    bits &~ (HAL_RX_FILTER_PHYRADAR|HAL_RX_FILTER_PHYERR|
@@ -191,12 +193,14 @@ ar5212SetRxFilter(struct ath_hal *ah, ui
 		OS_REG_WRITE(ah, AR_RXCFG,
 			OS_REG_READ(ah, AR_RXCFG) &~ AR_RXCFG_ZLFDMA);
 	}
-	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);
+	if (AH_PRIVATE(ah)->ah_caps.halBsssidMatchSupport) {
+		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);
+	}
 }
 
 /*

Modified: projects/mesh11s/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
==============================================================================
--- projects/mesh11s/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c	Thu Jun 25 18:54:56 2009	(r194993)
+++ projects/mesh11s/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c	Thu Jun 25 19:06:08 2009	(r194994)
@@ -811,6 +811,7 @@ ar5416FillCapabilityInfo(struct ath_hal 
 	pCap->halMbssidAggrSupport = AH_TRUE;
 	pCap->halForcePpmSupport = AH_TRUE;
 	pCap->halEnhancedPmSupport = AH_TRUE;
+	pCap->halBsssidMatchSupport = AH_TRUE;
 
 	if (ath_hal_eepromGetFlag(ah, AR_EEP_RFKILL) &&
 	    ath_hal_eepromGet(ah, AR_EEP_RFSILENT, &ahpriv->ah_rfsilent) == HAL_OK) {

Modified: projects/mesh11s/sys/dev/ath/if_ath.c
==============================================================================
--- projects/mesh11s/sys/dev/ath/if_ath.c	Thu Jun 25 18:54:56 2009	(r194993)
+++ projects/mesh11s/sys/dev/ath/if_ath.c	Thu Jun 25 19:06:08 2009	(r194994)
@@ -656,6 +656,7 @@ ath_attach(u_int16_t devid, struct ath_s
 	if (ath_hal_hasbursting(ah))
 		ic->ic_caps |= IEEE80211_C_BURST;
 	sc->sc_hasbmask = ath_hal_hasbssidmask(ah);
+	sc->sc_hasbmatch = ath_hal_hasbssidmatch(ah);
 	sc->sc_hastsfadd = ath_hal_hastsfadjust(ah);
 	if (ath_hal_hasfastframes(ah))
 		ic->ic_caps |= IEEE80211_C_FF;
@@ -2379,8 +2380,13 @@ ath_calcrxfilter(struct ath_softc *sc)
 	if (ic->ic_opmode == IEEE80211_M_HOSTAP &&
 	    IEEE80211_IS_CHAN_ANYG(ic->ic_curchan))
 		rfilt |= HAL_RX_FILTER_BEACON;
-	if (ic->ic_opmode == IEEE80211_M_MBSS)
-		rfilt |= HAL_RX_FILTER_BEACON | HAL_RX_FILTER_BSSID;
+	if (ic->ic_opmode == IEEE80211_M_MBSS) {
+		rfilt |= HAL_RX_FILTER_BEACON;
+		if (sc->sc_hasbmatch)
+			rfilt |= HAL_RX_FILTER_BSSID;
+		else
+			rfilt |= HAL_RX_FILTER_PROM;
+	}
 	if (ic->ic_opmode == IEEE80211_M_MONITOR)
 		rfilt |= HAL_RX_FILTER_CONTROL;
 	DPRINTF(sc, ATH_DEBUG_MODE, "%s: RX filter 0x%x, %s if_flags 0x%x\n",

Modified: projects/mesh11s/sys/dev/ath/if_athvar.h
==============================================================================
--- projects/mesh11s/sys/dev/ath/if_athvar.h	Thu Jun 25 18:54:56 2009	(r194993)
+++ projects/mesh11s/sys/dev/ath/if_athvar.h	Thu Jun 25 19:06:08 2009	(r194994)
@@ -235,6 +235,7 @@ struct ath_softc {
 				sc_outdoor  : 1,/* outdoor operation */
 				sc_dturbo   : 1,/* dynamic turbo in use */
 				sc_hasbmask : 1,/* bssid mask support */
+				sc_hasbmatch: 1,/* bssid match disable support*/
 				sc_hastsfadd: 1,/* tsf adjust support */
 				sc_beacons  : 1,/* beacons running */
 				sc_swbmiss  : 1,/* sta mode using sw bmiss */
@@ -590,6 +591,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) \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906251906.n5PJ68DZ061749>