aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2011-01-20 07:03:20 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2011-01-20 07:03:20 +0000
commit7fbdd9a0e996b6413830f84320b1bb65b4a54cdc (patch)
tree99be7f746cbe5c38863c7617993c62e70c6f291f /sys
parent9ea467445df33c00bef8d71e394157b6290acc18 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ath/ath_hal/ah.c10
-rw-r--r--sys/dev/ath/ath_hal/ah_internal.h2
2 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/ath/ath_hal/ah.c b/sys/dev/ath/ath_hal/ah.c
index cff9613616a19..8ac55f5f8b9d4 100644
--- a/sys/dev/ath/ath_hal/ah.c
+++ b/sys/dev/ath/ath_hal/ah.c
@@ -197,9 +197,16 @@ HAL_BOOL
ath_hal_wait(struct ath_hal *ah, u_int reg, uint32_t mask, uint32_t val)
{
#define AH_TIMEOUT 1000
+ return ath_hal_waitfor(ah, reg, mask, val, AH_TIMEOUT);
+#undef AH_TIMEOUT
+}
+
+HAL_BOOL
+ath_hal_waitfor(struct ath_hal *ah, u_int reg, uint32_t mask, uint32_t val, uint32_t timeout)
+{
int i;
- for (i = 0; i < AH_TIMEOUT; i++) {
+ for (i = 0; i < timeout; i++) {
if ((OS_REG_READ(ah, reg) & mask) == val)
return AH_TRUE;
OS_DELAY(10);
@@ -208,7 +215,6 @@ ath_hal_wait(struct ath_hal *ah, u_int reg, uint32_t mask, uint32_t val)
"%s: timeout on reg 0x%x: 0x%08x & 0x%08x != 0x%08x\n",
__func__, reg, OS_REG_READ(ah, reg), mask, val);
return AH_FALSE;
-#undef AH_TIMEOUT
}
/*
diff --git a/sys/dev/ath/ath_hal/ah_internal.h b/sys/dev/ath/ath_hal/ah_internal.h
index 2765c422c53eb..207143efe6d2e 100644
--- a/sys/dev/ath/ath_hal/ah_internal.h
+++ b/sys/dev/ath/ath_hal/ah_internal.h
@@ -471,6 +471,8 @@ extern int ath_hal_additional_swba_backoff; /* in TU's */
/* wait for the register contents to have the specified value */
extern HAL_BOOL ath_hal_wait(struct ath_hal *, u_int reg,
uint32_t mask, uint32_t val);
+extern HAL_BOOL ath_hal_waitfor(struct ath_hal *, u_int reg,
+ uint32_t mask, uint32_t val, uint32_t timeout);
/* return the first n bits in val reversed */
extern uint32_t ath_hal_reverseBits(uint32_t val, uint32_t n);