Change the MIB cycle count API to return HAL_BOOL, rather than uint32_t,

to return whether it was successful.

Add placeholder (blank) methods for previous chips, for both it and
the 11n extension channel busy call.
This commit is contained in:
Adrian Chadd 2012-05-01 14:48:51 +00:00
parent 2fe3761e69
commit 352f07f66d
15 changed files with 83 additions and 15 deletions

View File

@ -1034,8 +1034,8 @@ struct ath_hal {
struct ath_desc *);
void __ahdecl(*ah_set11nBurstDuration)(struct ath_hal *,
struct ath_desc *, u_int);
uint32_t __ahdecl(*ah_get_mib_cycle_counts_pct) (struct ath_hal *,
uint32_t *, uint32_t *, uint32_t *, uint32_t *);
HAL_BOOL __ahdecl(*ah_getMibCycleCounts) (struct ath_hal *,
HAL_SURVEY_SAMPLE *);
uint32_t __ahdecl(*ah_get11nExtBusy)(struct ath_hal *);
void __ahdecl(*ah_set11nMac2040)(struct ath_hal *,

View File

@ -249,6 +249,9 @@ extern HAL_BOOL ar5210SetCapability(struct ath_hal *, HAL_CAPABILITY_TYPE,
extern HAL_BOOL ar5210GetDiagState(struct ath_hal *ah, int request,
const void *args, uint32_t argsize,
void **result, uint32_t *resultsize);
extern uint32_t ar5210Get11nExtBusy(struct ath_hal *);
extern HAL_BOOL ar5210GetMibCycleCounts(struct ath_hal *,
HAL_SURVEY_SAMPLE *);
extern u_int ar5210GetKeyCacheSize(struct ath_hal *);
extern HAL_BOOL ar5210IsKeyCacheEntryValid(struct ath_hal *, uint16_t);

View File

@ -129,8 +129,10 @@ static const struct ath_hal_private ar5210hal = {{
.ah_getAckCTSRate = ar5210GetAckCTSRate,
.ah_setCTSTimeout = ar5210SetCTSTimeout,
.ah_getCTSTimeout = ar5210GetCTSTimeout,
.ah_setDecompMask = ar5210SetDecompMask,
.ah_setCoverageClass = ar5210SetCoverageClass,
.ah_setDecompMask = ar5210SetDecompMask,
.ah_setCoverageClass = ar5210SetCoverageClass,
.ah_get11nExtBusy = ar5210Get11nExtBusy,
.ah_getMibCycleCounts = ar5210GetMibCycleCounts,
/* Key Cache Functions */
.ah_getKeyCacheSize = ar5210GetKeyCacheSize,

View File

@ -646,3 +646,24 @@ ar5210GetDiagState(struct ath_hal *ah, int request,
return ath_hal_getdiagstate(ah, request,
args, argsize, result, resultsize);
}
/*
* Return what percentage of the extension channel is busy.
* This is always disabled for AR5210 series NICs.
*/
uint32_t
ar5210Get11nExtBusy(struct ath_hal *ah)
{
return (0);
}
/*
* There's no channel survey support for the AR5210.
*/
HAL_BOOL
ar5210GetMibCycleCounts(struct ath_hal *ah, HAL_SURVEY_SAMPLE *hsample)
{
return (AH_FALSE);
}

View File

@ -276,6 +276,9 @@ extern HAL_BOOL ar5211SetCapability(struct ath_hal *, HAL_CAPABILITY_TYPE,
extern HAL_BOOL ar5211GetDiagState(struct ath_hal *ah, int request,
const void *args, uint32_t argsize,
void **result, uint32_t *resultsize);
extern uint32_t ar5211Get11nExtBusy(struct ath_hal *);
extern HAL_BOOL ar5211GetMibCycleCounts(struct ath_hal *,
HAL_SURVEY_SAMPLE *);
extern u_int ar5211GetKeyCacheSize(struct ath_hal *);
extern HAL_BOOL ar5211IsKeyCacheEntryValid(struct ath_hal *, uint16_t);

View File

@ -129,8 +129,10 @@ static const struct ath_hal_private ar5211hal = {{
.ah_getAckCTSRate = ar5211GetAckCTSRate,
.ah_setCTSTimeout = ar5211SetCTSTimeout,
.ah_getCTSTimeout = ar5211GetCTSTimeout,
.ah_setDecompMask = ar5211SetDecompMask,
.ah_setCoverageClass = ar5211SetCoverageClass,
.ah_setDecompMask = ar5211SetDecompMask,
.ah_setCoverageClass = ar5211SetCoverageClass,
.ah_get11nExtBusy = ar5211Get11nExtBusy,
.ah_getMibCycleCounts = ar5211GetMibCycleCounts,
/* Key Cache Functions */
.ah_getKeyCacheSize = ar5211GetKeyCacheSize,

View File

@ -688,3 +688,24 @@ ar5211GetDiagState(struct ath_hal *ah, int request,
}
return AH_FALSE;
}
/*
* Return what percentage of the extension channel is busy.
* This is always disabled for AR5211 series NICs.
*/
uint32_t
ar5211Get11nExtBusy(struct ath_hal *ah)
{
return (0);
}
/*
* There's no channel survey support for the AR5211.
*/
HAL_BOOL
ar5211GetMibCycleCounts(struct ath_hal *ah, HAL_SURVEY_SAMPLE *hsample)
{
return (AH_FALSE);
}

View File

@ -511,6 +511,8 @@ extern HAL_BOOL ar5212GetDiagState(struct ath_hal *ah, int request,
void **result, uint32_t *resultsize);
extern HAL_STATUS ar5212SetQuiet(struct ath_hal *ah, uint32_t period,
uint32_t duration, uint32_t nextStart, HAL_QUIET_FLAG flag);
extern HAL_BOOL ar5212GetMibCycleCounts(struct ath_hal *,
HAL_SURVEY_SAMPLE *);
extern HAL_BOOL ar5212SetPowerMode(struct ath_hal *ah, HAL_POWER_MODE mode,
int setChip);

View File

@ -125,9 +125,10 @@ static const struct ath_hal_private ar5212hal = {{
.ah_getAckCTSRate = ar5212GetAckCTSRate,
.ah_setCTSTimeout = ar5212SetCTSTimeout,
.ah_getCTSTimeout = ar5212GetCTSTimeout,
.ah_setDecompMask = ar5212SetDecompMask,
.ah_setCoverageClass = ar5212SetCoverageClass,
.ah_setDecompMask = ar5212SetDecompMask,
.ah_setCoverageClass = ar5212SetCoverageClass,
.ah_setQuiet = ar5212SetQuiet,
.ah_getMibCycleCounts = ar5212GetMibCycleCounts,
/* DFS Functions */
.ah_enableDfs = ar5212EnableDfs,

View File

@ -1248,3 +1248,13 @@ ar5212Get11nExtBusy(struct ath_hal *ah)
{
return 0;
}
/*
* There's no channel survey support for the AR5211.
*/
HAL_BOOL
ar5212GetMibCycleCounts(struct ath_hal *ah, HAL_SURVEY_SAMPLE *hsample)
{
return (AH_FALSE);
}

View File

@ -196,8 +196,8 @@ extern uint32_t ar5416GetCurRssi(struct ath_hal *ah);
extern HAL_BOOL ar5416SetAntennaSwitch(struct ath_hal *, HAL_ANT_SETTING);
extern HAL_BOOL ar5416SetDecompMask(struct ath_hal *, uint16_t, int);
extern void ar5416SetCoverageClass(struct ath_hal *, uint8_t, int);
extern uint32_t ar5416GetMibCycleCounts(struct ath_hal *ah,
HAL_SURVEY_SAMPLE *hsample);
extern HAL_BOOL ar5416GetMibCycleCounts(struct ath_hal *ah,
HAL_SURVEY_SAMPLE *hsample);
extern uint32_t ar5416Get11nExtBusy(struct ath_hal *ah);
extern void ar5416Set11nMac2040(struct ath_hal *ah, HAL_HT_MACMODE mode);
extern HAL_HT_RXCLEAR ar5416Get11nRxClear(struct ath_hal *ah);

View File

@ -847,7 +847,7 @@ ar5416AniGetListenTime(struct ath_hal *ah)
if (ANI_ENA(ah))
aniState = ahp->ah_curani;
if (good == 0) {
if (good == AH_FALSE) {
/*
* Cycle counter wrap (or initial call); it's not possible
* to accurately calculate a value because the registers

View File

@ -145,6 +145,7 @@ ar5416InitState(struct ath_hal_5416 *ahp5416, uint16_t devid, HAL_SOFTC sc,
ah->ah_setDecompMask = ar5416SetDecompMask;
ah->ah_setCoverageClass = ar5416SetCoverageClass;
ah->ah_setQuiet = ar5416SetQuiet;
ah->ah_getMibCycleCounts = ar5416GetMibCycleCounts;
ah->ah_resetKeyCacheEntry = ar5416ResetKeyCacheEntry;
ah->ah_setKeyCacheEntry = ar5416SetKeyCacheEntry;

View File

@ -184,11 +184,11 @@ ar5416SetCoverageClass(struct ath_hal *ah, uint8_t coverageclass, int now)
/*
* Return the busy for rx_frame, rx_clear, and tx_frame
*/
uint32_t
HAL_BOOL
ar5416GetMibCycleCounts(struct ath_hal *ah, HAL_SURVEY_SAMPLE *hsample)
{
struct ath_hal_5416 *ahp = AH5416(ah);
u_int32_t good = 1;
u_int32_t good = AH_TRUE;
/* XXX freeze/unfreeze mib counters */
uint32_t rc = OS_REG_READ(ah, AR_RCCNT);
@ -205,7 +205,7 @@ ar5416GetMibCycleCounts(struct ath_hal *ah, HAL_SURVEY_SAMPLE *hsample)
*/
HALDEBUG(ah, HAL_DEBUG_ANY,
"%s: cycle counter wrap. ExtBusy = 0\n", __func__);
good = 0;
good = AH_FALSE;
} else {
hsample->cycle_count = cc - ahp->ah_cycleCount;
hsample->chan_busy = rc - ahp->ah_ctlBusy;
@ -224,7 +224,7 @@ ar5416GetMibCycleCounts(struct ath_hal *ah, HAL_SURVEY_SAMPLE *hsample)
ahp->ah_txBusy = tf;
ahp->ah_extBusy = ec;
return good;
return (good);
}
/*

View File

@ -1011,6 +1011,8 @@ void ath_intr(void *);
((*(_ah)->ah_isFastClockEnabled)((_ah)))
#define ath_hal_radar_wait(_ah, _chan) \
((*(_ah)->ah_radarWait)((_ah), (_chan)))
#define ath_hal_get_mib_cycle_counts(_ah, _sample) \
((*(_ah)->ah_getMibCycleCounts)((_ah), (_sample)))
#define ath_hal_get_chan_ext_busy(_ah) \
((*(_ah)->ah_get11nExtBusy)((_ah)))