summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2011-10-18 03:01:41 +0000
committeradrian <adrian@FreeBSD.org>2011-10-18 03:01:41 +0000
commit3b5040418ab03aa9220c3d7d07dd6b6ab587e521 (patch)
tree26e74e102e8cdb25bb1cdc527b1da44d3babd8c0
parent9000cf77a50a5af5a2aa2db12323d0f91963afe5 (diff)
downloadFreeBSD-src-3b5040418ab03aa9220c3d7d07dd6b6ab587e521.zip
FreeBSD-src-3b5040418ab03aa9220c3d7d07dd6b6ab587e521.tar.gz
Implement the first part of the BB read workaround.
The AR5008/AR9001 series NICs have a bug where BB register reads will occasionally be corrupted. This could cause issues with things such as ANI, which adjust operational parameters based on the BB radio register reads. This was introduced in the AR5008 chip and fixed with the first released AR9002 series NIC (AR9280v2.) A followup commit will implement the acutal WAR when reading BB registers. I'm still not sure how I'll implement it - whether it should be done in the osdep layer, or whether it should just live in the AR5416 HAL. Either way, they can use this capability bit to determine whether to implement the WAR or not. Thankyou to various sources inside Atheros who have helped me track down what this particular issue is. Obtained from: Atheros
-rw-r--r--sys/dev/ath/ath_hal/ah.c2
-rw-r--r--sys/dev/ath/ath_hal/ah.h1
-rw-r--r--sys/dev/ath/ath_hal/ah_internal.h3
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar5416_attach.c6
-rw-r--r--sys/dev/ath/ath_hal/ar9001/ar9130_attach.c2
-rw-r--r--sys/dev/ath/ath_hal/ar9001/ar9160_attach.c2
6 files changed, 15 insertions, 1 deletions
diff --git a/sys/dev/ath/ath_hal/ah.c b/sys/dev/ath/ath_hal/ah.c
index 4055079..383ae8f 100644
--- a/sys/dev/ath/ath_hal/ah.c
+++ b/sys/dev/ath/ath_hal/ah.c
@@ -659,6 +659,8 @@ ath_hal_getcapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type,
return pCap->halHasRxSelfLinkedTail ? HAL_OK : HAL_ENOTSUPP;
case HAL_CAP_LONG_RXDESC_TSF: /* 32 bit TSF in RX descriptor? */
return pCap->halHasLongRxDescTsf ? HAL_OK : HAL_ENOTSUPP;
+ case HAL_CAP_BB_READ_WAR: /* Baseband read WAR */
+ return pCap->halHasBBReadWar? 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 f4254c1..61a2cfa 100644
--- a/sys/dev/ath/ath_hal/ah.h
+++ b/sys/dev/ath/ath_hal/ah.h
@@ -149,6 +149,7 @@ typedef enum {
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_CAP_LONG_RXDESC_TSF = 243, /* hardware supports 32bit TSF in RX descriptor */
+ HAL_CAP_BB_READ_WAR = 244, /* baseband read WAR */
} HAL_CAPABILITY_TYPE;
/*
diff --git a/sys/dev/ath/ath_hal/ah_internal.h b/sys/dev/ath/ath_hal/ah_internal.h
index 521b57e..4378c83 100644
--- a/sys/dev/ath/ath_hal/ah_internal.h
+++ b/sys/dev/ath/ath_hal/ah_internal.h
@@ -209,7 +209,8 @@ typedef struct {
hal4kbSplitTransSupport : 1,
halHasRxSelfLinkedTail : 1,
halSupportsFastClock5GHz : 1, /* Hardware supports 5ghz fast clock; check eeprom/channel before using */
- halHasLongRxDescTsf : 1;
+ halHasLongRxDescTsf : 1,
+ halHasBBReadWar : 1;
uint32_t halWirelessModes;
uint16_t halTotalQueues;
uint16_t halKeyCacheSize;
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c b/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
index 9a33f7c..c87ffb5 100644
--- a/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
+++ b/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
@@ -892,6 +892,12 @@ ar5416FillCapabilityInfo(struct ath_hal *ah)
pCap->halEnhancedDfsSupport = AH_FALSE;
/* Hardware supports 32 bit TSF values in the RX descriptor */
pCap->halHasLongRxDescTsf = AH_TRUE;
+ /*
+ * BB Read WAR: this is only for AR5008/AR9001 NICs
+ * It is also set individually in the AR91xx attach functions.
+ */
+ if (AR_SREV_OWL(ah))
+ pCap->halHasBBReadWar = 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/ath_hal/ar9001/ar9130_attach.c b/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c
index 2a3f3f0..e880d56 100644
--- a/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c
+++ b/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c
@@ -298,6 +298,8 @@ ar9130FillCapabilityInfo(struct ath_hal *ah)
*/
pCap->halMbssidAggrSupport = AH_FALSE;
pCap->hal4AddrAggrSupport = AH_TRUE;
+ /* BB Read WAR */
+ pCap->halHasBBReadWar = AH_TRUE;
return 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 f7ac7c4..4775ab0 100644
--- a/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c
+++ b/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c
@@ -320,6 +320,8 @@ ar9160FillCapabilityInfo(struct ath_hal *ah)
pCap->halAutoSleepSupport = AH_FALSE; /* XXX? */
pCap->halMbssidAggrSupport = AH_TRUE;
pCap->hal4AddrAggrSupport = AH_TRUE;
+ /* BB Read WAR */
+ pCap->halHasBBReadWar = AH_TRUE;
/* AR9160 is a 2x2 stream device */
pCap->halTxStreams = 2;
OpenPOWER on IntegriCloud