Author: adrian
Date: Thu Jan 20 07:03:20 2011
New Revision: 217622
URL: http://svn.freebsd.org/changeset/base/217622

Log:
  Add another HAL function which waits for a register for a configurable amount.
  
  This will be used by some future code.

Modified:
  head/sys/dev/ath/ath_hal/ah.c
  head/sys/dev/ath/ath_hal/ah_internal.h

Modified: head/sys/dev/ath/ath_hal/ah.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ah.c       Thu Jan 20 05:49:15 2011        
(r217621)
+++ head/sys/dev/ath/ath_hal/ah.c       Thu Jan 20 07:03:20 2011        
(r217622)
@@ -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 r
            "%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
 }
 
 /*

Modified: head/sys/dev/ath/ath_hal/ah_internal.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ah_internal.h      Thu Jan 20 05:49:15 2011        
(r217621)
+++ head/sys/dev/ath/ath_hal/ah_internal.h      Thu Jan 20 07:03:20 2011        
(r217622)
@@ -471,6 +471,8 @@ extern      int ath_hal_additional_swba_backo
 /* 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);
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to