summaryrefslogtreecommitdiffstats
path: root/sys/dev/ath/ath_hal
diff options
context:
space:
mode:
authorrpaulo <rpaulo@FreeBSD.org>2010-03-02 12:59:42 +0000
committerrpaulo <rpaulo@FreeBSD.org>2010-03-02 12:59:42 +0000
commitdaccf654120791da2a3532d71d7c523ad28ea18a (patch)
treee628ccb0357e719dd69ac3485b0801f0b2b23941 /sys/dev/ath/ath_hal
parent8518ff96531e520a5c1c3439875e6831a19fcda9 (diff)
downloadFreeBSD-src-daccf654120791da2a3532d71d7c523ad28ea18a.zip
FreeBSD-src-daccf654120791da2a3532d71d7c523ad28ea18a.tar.gz
Couple of suggestions from Sam regarding latest commit:
o rename the new variables to comply with the naming scheme o move the new variables to an AR5212 specific struct o use ahp when available o revert to previous ts_flags check
Diffstat (limited to 'sys/dev/ath/ath_hal')
-rw-r--r--sys/dev/ath/ath_hal/ah_internal.h2
-rw-r--r--sys/dev/ath/ath_hal/ar5212/ar5212.h3
-rw-r--r--sys/dev/ath/ath_hal/ar5212/ar5212_attach.c6
-rw-r--r--sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c7
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar5416_reset.c3
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c3
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar9285_attach.c2
7 files changed, 13 insertions, 13 deletions
diff --git a/sys/dev/ath/ath_hal/ah_internal.h b/sys/dev/ath/ath_hal/ah_internal.h
index d284dfd..8f7ba65 100644
--- a/sys/dev/ath/ath_hal/ah_internal.h
+++ b/sys/dev/ath/ath_hal/ah_internal.h
@@ -281,8 +281,6 @@ struct ath_hal_private {
uint16_t ah_maxPowerLevel; /* calculated max tx power */
u_int ah_tpScale; /* tx power scale factor */
uint32_t ah_11nCompat; /* 11n compat controls */
- uint8_t ah_txtrig_level; /* current Tx trigger level */
- uint8_t ah_max_txtrig_level; /* max tx trigger level */
/*
* State for regulatory domain handling.
diff --git a/sys/dev/ath/ath_hal/ar5212/ar5212.h b/sys/dev/ath/ath_hal/ar5212/ar5212.h
index 4f60c3b..6590eb4 100644
--- a/sys/dev/ath/ath_hal/ar5212/ar5212.h
+++ b/sys/dev/ath/ath_hal/ar5212/ar5212.h
@@ -327,6 +327,9 @@ struct ath_hal_5212 {
uint16_t *ah_pcdacTable;
u_int ah_pcdacTableSize;
uint16_t ah_ratesArray[16];
+
+ uint8_t ah_txTrigLev; /* current Tx trigger level */
+ uint8_t ah_maxTxTrigLev; /* max tx trigger level */
};
#define AH5212(_ah) ((struct ath_hal_5212 *)(_ah))
diff --git a/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c b/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
index 67fe360..7857122 100644
--- a/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
+++ b/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
@@ -149,9 +149,6 @@ static const struct ath_hal_private ar5212hal = {{
.ah_getInterrupts = ar5212GetInterrupts,
.ah_setInterrupts = ar5212SetInterrupts },
- .ah_txtrig_level = INIT_TX_FIFO_THRESHOLD,
- .ah_max_txtrig_level = MAX_TX_FIFO_THRESHOLD,
-
.ah_getChannelEdges = ar5212GetChannelEdges,
.ah_getWirelessModes = ar5212GetWirelessModes,
.ah_eepromRead = ar5212EepromRead,
@@ -251,6 +248,9 @@ ar5212InitState(struct ath_hal_5212 *ahp, uint16_t devid, HAL_SOFTC sc,
ahp->ah_acktimeout = (u_int) -1;
ahp->ah_ctstimeout = (u_int) -1;
ahp->ah_sifstime = (u_int) -1;
+ ahp->ah_txTrigLev = INIT_TX_FIFO_THRESHOLD,
+ ahp->ah_maxTxTrigLev = MAX_TX_FIFO_THRESHOLD,
+
OS_MEMCPY(&ahp->ah_bssidmask, defbssidmask, IEEE80211_ADDR_LEN);
#undef N
}
diff --git a/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c b/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c
index 45404cf..ed9de14 100644
--- a/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c
+++ b/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c
@@ -48,8 +48,7 @@ ar5212UpdateTxTrigLevel(struct ath_hal *ah, HAL_BOOL bIncTrigLevel)
uint32_t txcfg, curLevel, newLevel;
HAL_INT omask;
- if (AH_PRIVATE(ah)->ah_txtrig_level >=
- AH_PRIVATE(ah)->ah_max_txtrig_level)
+ if (ahp->ah_txTrigLev >= ahp->ah_maxTxTrigLev)
return AH_FALSE;
/*
@@ -61,7 +60,7 @@ ar5212UpdateTxTrigLevel(struct ath_hal *ah, HAL_BOOL bIncTrigLevel)
curLevel = MS(txcfg, AR_FTRIG);
newLevel = curLevel;
if (bIncTrigLevel) { /* increase the trigger level */
- if (curLevel < AH_PRIVATE(ah)->ah_max_txtrig_level)
+ if (curLevel < ahp->ah_maxTxTrigLev)
newLevel++;
} else if (curLevel > MIN_TX_FIFO_THRESHOLD)
newLevel--;
@@ -70,7 +69,7 @@ ar5212UpdateTxTrigLevel(struct ath_hal *ah, HAL_BOOL bIncTrigLevel)
OS_REG_WRITE(ah, AR_TXCFG,
(txcfg &~ AR_FTRIG) | SM(newLevel, AR_FTRIG));
- AH_PRIVATE(ah)->ah_txtrig_level = newLevel;
+ ahp->ah_txTrigLev = newLevel;
/* re-enable chip interrupts */
ah->ah_setInterrupts(ah, omask);
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c b/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
index 2950817..d506a6a 100644
--- a/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
+++ b/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
@@ -436,6 +436,7 @@ ar5416ChannelChange(struct ath_hal *ah, const structu ieee80211_channel *chan)
static void
ar5416InitDMA(struct ath_hal *ah)
{
+ struct ath_hal_5212 *ahp = AH5212(ah);
/*
* set AHB_MODE not to do cacheline prefetches
@@ -457,7 +458,7 @@ ar5416InitDMA(struct ath_hal *ah)
/* restore TX trigger level */
OS_REG_WRITE(ah, AR_TXCFG,
(OS_REG_READ(ah, AR_TXCFG) &~ AR_FTRIG) |
- SM(AH_PRIVATE(ah)->ah_txtrig_level, AR_FTRIG));
+ SM(ahp->ah_txTrigLev, AR_FTRIG));
/*
* Setup receive FIFO threshold to hold off TX activities
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c b/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c
index 9805935..47277a1 100644
--- a/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c
+++ b/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c
@@ -568,8 +568,7 @@ ar5416ProcTxDesc(struct ath_hal *ah,
/* handle tx trigger level changes internally */
if ((ts->ts_status & HAL_TXERR_FIFO) ||
- (ts->ts_flags & HAL_TX_DATA_UNDERRUN) ||
- (ts->ts_flags & HAL_TX_DELIM_UNDERRUN))
+ (ts->ts_flags & (HAL_TX_DATA_UNDERRUN | HAL_TX_DELIM_UNDERRUN)))
ar5212UpdateTxTrigLevel(ah, AH_TRUE);
return HAL_OK;
diff --git a/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c b/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c
index 6d4f25e..946133a 100644
--- a/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c
+++ b/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c
@@ -122,7 +122,7 @@ ar9285Attach(uint16_t devid, HAL_SOFTC sc,
AH5416(ah)->ah_rx_chainmask = AR9285_DEFAULT_RXCHAINMASK;
AH5416(ah)->ah_tx_chainmask = AR9285_DEFAULT_TXCHAINMASK;
- AH_PRIVATE(ah)->ah_max_txtrig_level = MAX_TX_FIFO_THRESHOLD >> 1;
+ ahp->ah_maxTxTrigLev = MAX_TX_FIFO_THRESHOLD >> 1;
if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON)) {
/* reset chip */
OpenPOWER on IntegriCloud