Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 May 2011 15:30:23 +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: r221603 - in head/sys/dev/ath/ath_hal: . ar5416 ar9001 ar9002
Message-ID:  <201105071530.p47FUNuu004425@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Sat May  7 15:30:23 2011
New Revision: 221603
URL: http://svn.freebsd.org/changeset/base/221603

Log:
  Do a HAL capabilities sync pass based on the Atheros HAL.
  
  * Shuffle some of the capability numbers around to match the
    Atheros HAL capability IDs, just for consistency.
  
  * Add some new capabilities to FreeBSD from the Atheros
    HAL which will be be shortly used when new chipsets are added
    (HAL SGI-20 support is for Kiwi/AR9287 support); for
    TX aggregation (MBSSID aggregate support, WDS aggregation
    support); CST/GTT support for carrier sense/TX timeout.

Modified:
  head/sys/dev/ath/ath_hal/ah.c
  head/sys/dev/ath/ath_hal/ah.h
  head/sys/dev/ath/ath_hal/ah_internal.h
  head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
  head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c
  head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c
  head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c
  head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
  head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c

Modified: head/sys/dev/ath/ath_hal/ah.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ah.c	Sat May  7 14:32:16 2011	(r221602)
+++ head/sys/dev/ath/ath_hal/ah.c	Sat May  7 15:30:23 2011	(r221603)
@@ -585,19 +585,49 @@ ath_hal_getcapability(struct ath_hal *ah
 		return HAL_ENOTSUPP;
 	case HAL_CAP_11D:
 		return HAL_OK;
-	case HAL_CAP_RXORN_FATAL:	/* HAL_INT_RXORN treated as fatal  */
-		return AH_PRIVATE(ah)->ah_rxornIsFatal ? HAL_OK : HAL_ENOTSUPP;
+
 	case HAL_CAP_HT:
 		return pCap->halHTSupport ? HAL_OK : HAL_ENOTSUPP;
+	case HAL_CAP_GTXTO:
+		return pCap->halGTTSupport ? HAL_OK : HAL_ENOTSUPP;
+	case HAL_CAP_FAST_CC:
+		return pCap->halFastCCSupport ? HAL_OK : HAL_ENOTSUPP;
 	case HAL_CAP_TX_CHAINMASK:	/* mask of TX chains supported */
 		*result = pCap->halTxChainMask;
 		return HAL_OK;
 	case HAL_CAP_RX_CHAINMASK:	/* mask of RX chains supported */
 		*result = pCap->halRxChainMask;
 		return HAL_OK;
+	case HAL_CAP_NUM_GPIO_PINS:
+		*result = pCap->halNumGpioPins;
+		return HAL_OK;
+	case HAL_CAP_CST:
+		return pCap->halCSTSupport ? HAL_OK : HAL_ENOTSUPP;
+	case HAL_CAP_RTS_AGGR_LIMIT:
+		*result = pCap->halRtsAggrLimit;
+		return HAL_OK;
+	case HAL_CAP_4ADDR_AGGR:
+		return pCap->hal4AddrAggrSupport ? HAL_OK : HAL_ENOTSUPP;
+	case HAL_CAP_AUTO_SLEEP:
+		return pCap->halAutoSleepSupport ? HAL_OK : HAL_ENOTSUPP;
+	case HAL_CAP_MBSSID_AGGR_SUPPORT:
+		return pCap->halMbssidAggrSupport ? HAL_OK : HAL_ENOTSUPP;
+	case HAL_CAP_SPLIT_4KB_TRANS:	/* hardware handles descriptors straddling 4k page boundary */
+		return pCap->hal4kbSplitTransSupport ? HAL_OK : HAL_ENOTSUPP;
+	case HAL_CAP_REG_FLAG:
+		*result = AH_PRIVATE(ah)->ah_currentRDext;
+		return HAL_OK;
+	case HAL_CAP_BT_COEX:
+		return pCap->halBtCoexSupport ? HAL_OK : HAL_ENOTSUPP;
+	case HAL_CAP_HT20_SGI:
+		return pCap->halHTSGI20Support ? HAL_OK : HAL_ENOTSUPP;
 	case HAL_CAP_RXTSTAMP_PREC:	/* rx desc tstamp precision (bits) */
 		*result = pCap->halTstampPrecision;
 		return HAL_OK;
+
+	/* FreeBSD-specific entries for now */
+	case HAL_CAP_RXORN_FATAL:	/* HAL_INT_RXORN treated as fatal  */
+		return AH_PRIVATE(ah)->ah_rxornIsFatal ? HAL_OK : HAL_ENOTSUPP;
 	case HAL_CAP_INTRMASK:		/* mask of supported interrupts */
 		*result = pCap->halIntrMask;
 		return HAL_OK;
@@ -614,10 +644,6 @@ ath_hal_getcapability(struct ath_hal *ah
 		default:
 			return HAL_ENOTSUPP;
 		}
-	case HAL_CAP_SPLIT_4KB_TRANS:	/* hardware handles descriptors straddling 4k page boundary */
-		return pCap->hal4kbSplitTransSupport ? HAL_OK : HAL_ENOTSUPP;
-	case HAL_CAP_HAS_PSPOLL:	/* hardware has ps-poll support */
-		return pCap->halHasPsPollSupport ? HAL_OK : HAL_ENOTSUPP;
 	case HAL_CAP_RXDESC_SELFLINK:	/* hardware supports self-linked final RX descriptors correctly */
 		return pCap->halHasRxSelfLinkedTail ? HAL_OK : HAL_ENOTSUPP;
 	default:

Modified: head/sys/dev/ath/ath_hal/ah.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ah.h	Sat May  7 14:32:16 2011	(r221602)
+++ head/sys/dev/ath/ath_hal/ah.h	Sat May  7 15:30:23 2011	(r221603)
@@ -110,27 +110,40 @@ typedef enum {
 	HAL_CAP_TPC_CTS		= 27,	/* cts txpower with per-packet tpc */
 	HAL_CAP_11D		= 28,   /* 11d beacon support for changing cc */
 
-	/* The following are currently different IDs to the Atheros HAL */
-	HAL_CAP_INTMIT		= 29,	/* interference mitigation */
-	HAL_CAP_RXORN_FATAL	= 30,	/* HAL_INT_RXORN treated as fatal */
-	HAL_CAP_HT		= 31,   /* hardware can support HT */
-	HAL_CAP_TX_CHAINMASK	= 32,	/* mask of TX chains supported */
-	HAL_CAP_RX_CHAINMASK	= 33,	/* mask of RX chains supported */
-	HAL_CAP_RXTSTAMP_PREC	= 34,	/* rx desc tstamp precision (bits) */
-	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_CAP_STREAMS		= 39,	/* how many 802.11n spatial streams are available */
-	HAL_CAP_SPLIT_4KB_TRANS	= 40,	/* hardware supports descriptors straddling a 4k page boundary */
-	HAL_CAP_HAS_PSPOLL	= 41,	/* hardware has ps-poll support */
-	HAL_CAP_RXDESC_SELFLINK	= 42,	/* support a self-linked tail RX descriptor */
-	HAL_CAP_GTXTO		= 43,	/* hardware supports global tx timeout */
+	HAL_CAP_HT		= 30,   /* hardware can support HT */
+	HAL_CAP_GTXTO		= 31,	/* hardware supports global tx timeout */
+	HAL_CAP_FAST_CC		= 32,	/* hardware supports fast channel change */
+	HAL_CAP_TX_CHAINMASK	= 33,	/* mask of TX chains supported */
+	HAL_CAP_RX_CHAINMASK	= 34,	/* mask of RX chains supported */
+	HAL_CAP_NUM_GPIO_PINS	= 36,	/* number of GPIO pins */
 
-	/* The following are back to normal, shared with the Atheros HAL */
+	HAL_CAP_CST		= 38,	/* hardware supports carrier sense timeout */
+
+	HAL_CAP_RTS_AGGR_LIMIT	= 42,	/* aggregation limit with RTS */
+	HAL_CAP_4ADDR_AGGR	= 43,	/* hardware is capable of 4addr aggregation */
+
+	HAL_CAP_AUTO_SLEEP	= 48,	/* hardware can go to network sleep
+					   automatically after waking up to receive TIM */
+	HAL_CAP_MBSSID_AGGR_SUPPORT	= 49, /* Support for mBSSID Aggregation */
+	HAL_CAP_SPLIT_4KB_TRANS	= 50,	/* hardware supports descriptors straddling a 4k page boundary */
+	HAL_CAP_REG_FLAG	= 51,	/* Regulatory domain flags */
+
+	HAL_CAP_BT_COEX		= 60,	/* hardware is capable of bluetooth coexistence */
+
+	HAL_CAP_HT20_SGI	= 96,	/* hardware supports HT20 short GI */
+
+	HAL_CAP_RXTSTAMP_PREC	= 100,	/* rx desc tstamp precision (bits) */
 
 	/* The following are private to the FreeBSD HAL (224 onward) */
 
+	HAL_CAP_INTMIT		= 229,	/* interference mitigation */
+	HAL_CAP_RXORN_FATAL	= 230,	/* HAL_INT_RXORN treated as fatal */
+	HAL_CAP_BB_HANG		= 235,	/* can baseband hang */
+	HAL_CAP_MAC_HANG	= 236,	/* can MAC hang */
+	HAL_CAP_INTRMASK	= 237,	/* bitmask of supported interrupts */
+	HAL_CAP_BSSIDMATCH	= 238,	/* hardware has disable bssid match */
+	HAL_CAP_STREAMS		= 239,	/* how many 802.11n spatial streams are available */
+	HAL_CAP_RXDESC_SELFLINK	= 242,	/* support a self-linked tail RX descriptor */
 } HAL_CAPABILITY_TYPE;
 
 /* 

Modified: head/sys/dev/ath/ath_hal/ah_internal.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ah_internal.h	Sat May  7 14:32:16 2011	(r221602)
+++ head/sys/dev/ath/ath_hal/ah_internal.h	Sat May  7 15:30:23 2011	(r221603)
@@ -184,6 +184,7 @@ typedef struct {
 			halChanHalfRate			: 1,
 			halChanQuarterRate		: 1,
 			halHTSupport			: 1,
+			halHTSGI20Support		: 1,
 			halRfSilentSupport		: 1,
 			halHwPhyCounterSupport		: 1,
 			halWowSupport			: 1,
@@ -197,13 +198,13 @@ typedef struct {
 			halCSTSupport			: 1,
 			halRifsRxSupport		: 1,
 			halRifsTxSupport		: 1,
+			hal4AddrAggrSupport		: 1,
 			halExtChanDfsSupport		: 1,
 			halForcePpmSupport		: 1,
 			halEnhancedPmSupport		: 1,
 			halMbssidAggrSupport		: 1,
 			halBssidMatchSupport		: 1,
 			hal4kbSplitTransSupport		: 1,
-			halHasPsPollSupport		: 1,
 			halHasRxSelfLinkedTail		: 1;
 	uint32_t	halWirelessModes;
 	uint16_t	halTotalQueues;

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c	Sat May  7 14:32:16 2011	(r221602)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c	Sat May  7 15:30:23 2011	(r221603)
@@ -812,6 +812,7 @@ ar5416FillCapabilityInfo(struct ath_hal 
 	pCap->halBssIdMaskSupport = AH_TRUE;
 	pCap->halMcastKeySrchSupport = AH_FALSE;
 	pCap->halTsfAddSupport = AH_TRUE;
+	pCap->hal4AddrAggrSupport = AH_FALSE;	/* Broken in Owl */
 
 	if (ath_hal_eepromGet(ah, AR_EEP_MAXQCU, &val) == HAL_OK)
 		pCap->halTotalQueues = val;
@@ -862,10 +863,12 @@ ar5416FillCapabilityInfo(struct ath_hal 
 	pCap->halTxStreams = 2;
 	pCap->halRxStreams = 2;
 	pCap->halRtsAggrLimit = 8*1024;		/* Owl 2.0 limit */
-	pCap->halMbssidAggrSupport = AH_TRUE;
+	pCap->halMbssidAggrSupport = AH_FALSE;	/* Broken on Owl */
 	pCap->halForcePpmSupport = AH_TRUE;
 	pCap->halEnhancedPmSupport = AH_TRUE;
 	pCap->halBssidMatchSupport = AH_TRUE;
+	pCap->halGTTSupport = AH_TRUE;
+	pCap->halCSTSupport = AH_TRUE;
 
 	if (ath_hal_eepromGetFlag(ah, AR_EEP_RFKILL) &&
 	    ath_hal_eepromGet(ah, AR_EEP_RFSILENT, &ahpriv->ah_rfsilent) == HAL_OK) {

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c	Sat May  7 14:32:16 2011	(r221602)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c	Sat May  7 15:30:23 2011	(r221603)
@@ -278,8 +278,6 @@ ar5416GetCapability(struct ath_hal *ah, 
         uint32_t capability, uint32_t *result)
 {
 	switch (type) {
-	case HAL_CAP_GTXTO:
-		return HAL_OK;		/* All AR5416+ supports Global TX Timeout */
 	case HAL_CAP_BB_HANG:
 		switch (capability) {
 		case HAL_BB_HANG_RIFS:

Modified: head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c	Sat May  7 14:32:16 2011	(r221602)
+++ head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c	Sat May  7 15:30:23 2011	(r221603)
@@ -290,6 +290,14 @@ ar9130FillCapabilityInfo(struct ath_hal 
 	pCap->halRtsAggrLimit = 64*1024;	/* 802.11n max */
 	pCap->halExtChanDfsSupport = AH_TRUE;
 	pCap->halAutoSleepSupport = AH_FALSE;	/* XXX? */
+	/*
+	 * MBSSID aggregation is broken in Howl v1.1, v1.2, v1.3
+	 * and works fine in v1.4.
+	 * XXX todo, enable it for v1.4.
+	 */
+	pCap->halMbssidAggrSupport = AH_FALSE;
+	pCap->hal4AddrAggrSupport = AH_TRUE;
+
 	return AH_TRUE;
 }
 

Modified: head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c	Sat May  7 14:32:16 2011	(r221602)
+++ head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c	Sat May  7 15:30:23 2011	(r221603)
@@ -294,6 +294,9 @@ ar9160FillCapabilityInfo(struct ath_hal 
 	pCap->halRtsAggrLimit = 64*1024;	/* 802.11n max */
 	pCap->halExtChanDfsSupport = AH_TRUE;
 	pCap->halAutoSleepSupport = AH_FALSE;	/* XXX? */
+	pCap->halMbssidAggrSupport = AH_TRUE;
+	pCap->hal4AddrAggrSupport = AH_TRUE;
+
 	/* AR9160 is a 2x2 stream device */
 	pCap->halTxStreams = 2;
 	pCap->halRxStreams = 2;

Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c	Sat May  7 14:32:16 2011	(r221602)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c	Sat May  7 15:30:23 2011	(r221603)
@@ -784,8 +784,11 @@ ar9280FillCapabilityInfo(struct ath_hal 
 	pCap->hal4kbSplitTransSupport = AH_FALSE;
 	/* Disable this so Block-ACK works correctly */
 	pCap->halHasRxSelfLinkedTail = AH_FALSE;
+	pCap->halMbssidAggrSupport = AH_TRUE;
+	pCap->hal4AddrAggrSupport = AH_TRUE;
+
 	if (AR_SREV_MERLIN_20_OR_LATER(ah))
-		pCap->halHasPsPollSupport = AH_TRUE;
+		pCap->halPSPollBroken = AH_FALSE;
 	pCap->halRxStbcSupport = 1;
 	pCap->halTxStbcSupport = 1;
 

Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c	Sat May  7 14:32:16 2011	(r221602)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c	Sat May  7 15:30:23 2011	(r221603)
@@ -395,8 +395,11 @@ ar9285FillCapabilityInfo(struct ath_hal 
 	pCap->hal4kbSplitTransSupport = AH_FALSE;
 	/* Disable this so Block-ACK works correctly */
 	pCap->halHasRxSelfLinkedTail = AH_FALSE;
+	pCap->halMbssidAggrSupport = AH_TRUE;  
+	pCap->hal4AddrAggrSupport = AH_TRUE;
+
 	if (AR_SREV_KITE_12_OR_LATER(ah))
-		pCap->halHasPsPollSupport = AH_TRUE;
+		pCap->halPSPollBroken = AH_FALSE;
 
 	pCap->halRxStbcSupport = 1;
 	pCap->halTxStbcSupport = 1;



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