summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2011-02-01 03:51:35 +0000
committeradrian <adrian@FreeBSD.org>2011-02-01 03:51:35 +0000
commit1fe70193d4e3f0a0848d6c0af73aaf439d094bf9 (patch)
tree63dbce536aa201a035a67f322306e49d87aec7ad
parentc4f814b2fb3f8ace6692b76e2395e15fe63cca70 (diff)
downloadFreeBSD-src-1fe70193d4e3f0a0848d6c0af73aaf439d094bf9.zip
FreeBSD-src-1fe70193d4e3f0a0848d6c0af73aaf439d094bf9.tar.gz
Add a new capability which reports the number of spatial streams a device supports.
The higher levels (net80211, if_ath, ath_rate) need this to make correct choices about what MCS capabilities to advertise and what MCS rates are able to be TXed. In summary: * AR5416 - 2/3 antennas, 2x2 streams * AR9160 - 2/3 antennas, 2x2 streams * AR9220 - 2 antennas, 2x2 sstraems * AR9280 - 2 antennas, 2x2 streams * AR9285 - 2 antennas but with antenna diversity, 1x1 stream
-rw-r--r--sys/dev/ath/ath_hal/ah.c11
-rw-r--r--sys/dev/ath/ath_hal/ah.h1
-rw-r--r--sys/dev/ath/ath_hal/ah_internal.h2
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar5416_attach.c3
-rw-r--r--sys/dev/ath/ath_hal/ar9001/ar9160_attach.c4
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9280_attach.c4
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9285_attach.c4
7 files changed, 29 insertions, 0 deletions
diff --git a/sys/dev/ath/ath_hal/ah.c b/sys/dev/ath/ath_hal/ah.c
index 031caa2..ef4f256 100644
--- a/sys/dev/ath/ath_hal/ah.c
+++ b/sys/dev/ath/ath_hal/ah.c
@@ -583,6 +583,17 @@ ath_hal_getcapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type,
return HAL_OK;
case HAL_CAP_BSSIDMATCH: /* hardware has disable bssid match */
return pCap->halBssidMatchSupport ? HAL_OK : HAL_ENOTSUPP;
+ case HAL_CAP_STREAMS: /* number of 11n spatial streams */
+ switch (capability) {
+ case 0: /* TX */
+ *result = pCap->halTxStreams;
+ return HAL_OK;
+ case 1: /* RX */
+ *result = pCap->halRxStreams;
+ return HAL_OK;
+ default:
+ return 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 cb1af32..6358a72 100644
--- a/sys/dev/ath/ath_hal/ah.h
+++ b/sys/dev/ath/ath_hal/ah.h
@@ -111,6 +111,7 @@ typedef enum {
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_CAPABILITY_TYPE;
/*
diff --git a/sys/dev/ath/ath_hal/ah_internal.h b/sys/dev/ath/ath_hal/ah_internal.h
index 46f252f..f8c157d 100644
--- a/sys/dev/ath/ath_hal/ah_internal.h
+++ b/sys/dev/ath/ath_hal/ah_internal.h
@@ -209,6 +209,8 @@ typedef struct {
uint8_t halNumAntCfg2GHz;
uint8_t halNumAntCfg5GHz;
uint32_t halIntrMask;
+ uint8_t halTxStreams;
+ uint8_t halRxStreams;
} HAL_CAPABILITIES;
struct regDomain;
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c b/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
index 5307cd7..4977462 100644
--- a/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
+++ b/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
@@ -819,6 +819,9 @@ ar5416FillCapabilityInfo(struct ath_hal *ah)
pCap->halTxChainMask = ath_hal_eepromGet(ah, AR_EEP_TXMASK, AH_NULL);
/* XXX CB71 uses GPIO 0 to indicate 3 rx chains */
pCap->halRxChainMask = ath_hal_eepromGet(ah, AR_EEP_RXMASK, AH_NULL);
+ /* AR5416 may have 3 antennas but is a 2x2 stream device */
+ pCap->halTxStreams = 2;
+ pCap->halRxStreams = 2;
pCap->halRtsAggrLimit = 8*1024; /* Owl 2.0 limit */
pCap->halMbssidAggrSupport = AH_TRUE;
pCap->halForcePpmSupport = AH_TRUE;
diff --git a/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c b/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c
index 7ea4467..4674a79 100644
--- a/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c
+++ b/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c
@@ -290,6 +290,10 @@ ar9160FillCapabilityInfo(struct ath_hal *ah)
pCap->halRtsAggrLimit = 64*1024; /* 802.11n max */
pCap->halExtChanDfsSupport = AH_TRUE;
pCap->halAutoSleepSupport = AH_FALSE; /* XXX? */
+ /* AR9160 is a 2x2 stream device */
+ pCap->halTxStreams = 2;
+ pCap->halRxStreams = 2;
+
return AH_TRUE;
}
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c b/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
index 8302f3d..589a923 100644
--- a/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
+++ b/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
@@ -684,6 +684,10 @@ ar9280FillCapabilityInfo(struct ath_hal *ah)
#if 0
pCap->halWowMatchPatternDword = AH_TRUE;
#endif
+ /* AR9280 is a 2x2 stream device */
+ pCap->halTxStreams = 2;
+ pCap->halRxStreams = 2;
+
pCap->halCSTSupport = AH_TRUE;
pCap->halRifsRxSupport = AH_TRUE;
pCap->halRifsTxSupport = AH_TRUE;
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c b/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
index f8383b8..2b9468e 100644
--- a/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
+++ b/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
@@ -370,6 +370,10 @@ ar9285FillCapabilityInfo(struct ath_hal *ah)
#if 0
pCap->halWowMatchPatternDword = AH_TRUE;
#endif
+ /* AR9285 has 2 antennas but is a 1x1 stream device */
+ pCap->halTxStreams = 2;
+ pCap->halRxStreams = 2;
+
pCap->halCSTSupport = AH_TRUE;
pCap->halRifsRxSupport = AH_TRUE;
pCap->halRifsTxSupport = AH_TRUE;
OpenPOWER on IntegriCloud