|
@@ -177,8 +177,7 @@
|
|
|
#ifdef RTMP_MAC_PCI
|
|
|
#define RTMP_RF_IO_WRITE32(_A, _V) \
|
|
|
{ \
|
|
|
- if ((_A)->bPCIclkOff == FALSE) \
|
|
|
- { \
|
|
|
+ if ((_A)->bPCIclkOff == FALSE) { \
|
|
|
PHY_CSR4_STRUC _value; \
|
|
|
unsigned long _busyCnt = 0; \
|
|
|
\
|
|
@@ -187,9 +186,8 @@
|
|
|
if (_value.field.Busy == IDLE) \
|
|
|
break; \
|
|
|
_busyCnt++; \
|
|
|
- }while (_busyCnt < MAX_BUSY_COUNT); \
|
|
|
- if(_busyCnt < MAX_BUSY_COUNT) \
|
|
|
- { \
|
|
|
+ } while (_busyCnt < MAX_BUSY_COUNT); \
|
|
|
+ if (_busyCnt < MAX_BUSY_COUNT) { \
|
|
|
RTMP_IO_WRITE32((_A), RF_CSR_CFG0, (_V)); \
|
|
|
} \
|
|
|
} \
|
|
@@ -218,52 +216,46 @@
|
|
|
_bViaMCU: if we need access the bbp via the MCU.
|
|
|
*/
|
|
|
#define RTMP_BBP_IO_READ8(_pAd, _bbpID, _pV, _bViaMCU) \
|
|
|
- do{ \
|
|
|
- BBP_CSR_CFG_STRUC BbpCsr; \
|
|
|
- int _busyCnt, _secCnt, _regID; \
|
|
|
- \
|
|
|
- _regID = ((_bViaMCU) == TRUE ? H2M_BBP_AGENT : BBP_CSR_CFG); \
|
|
|
- for (_busyCnt=0; _busyCnt<MAX_BUSY_COUNT; _busyCnt++) \
|
|
|
- { \
|
|
|
- RTMP_IO_READ32(_pAd, _regID, &BbpCsr.word); \
|
|
|
+ do { \
|
|
|
+ BBP_CSR_CFG_STRUC BbpCsr; \
|
|
|
+ int _busyCnt, _secCnt, _regID; \
|
|
|
+ \
|
|
|
+ _regID = ((_bViaMCU) == TRUE ? H2M_BBP_AGENT : BBP_CSR_CFG); \
|
|
|
+ for (_busyCnt = 0; _busyCnt < MAX_BUSY_COUNT; _busyCnt++) { \
|
|
|
+ RTMP_IO_READ32(_pAd, _regID, &BbpCsr.word); \
|
|
|
if (BbpCsr.field.Busy == BUSY) \
|
|
|
- continue; \
|
|
|
+ continue; \
|
|
|
BbpCsr.word = 0; \
|
|
|
BbpCsr.field.fRead = 1; \
|
|
|
- BbpCsr.field.BBP_RW_MODE = 1; \
|
|
|
+ BbpCsr.field.BBP_RW_MODE = 1; \
|
|
|
BbpCsr.field.Busy = 1; \
|
|
|
- BbpCsr.field.RegNum = _bbpID; \
|
|
|
+ BbpCsr.field.RegNum = _bbpID; \
|
|
|
RTMP_IO_WRITE32(_pAd, _regID, BbpCsr.word); \
|
|
|
- if ((_bViaMCU) == TRUE) \
|
|
|
- { \
|
|
|
- AsicSendCommandToMcu(_pAd, 0x80, 0xff, 0x0, 0x0); \
|
|
|
- RTMPusecDelay(1000); \
|
|
|
- } \
|
|
|
- for (_secCnt=0; _secCnt<MAX_BUSY_COUNT; _secCnt++) \
|
|
|
- { \
|
|
|
+ if ((_bViaMCU) == TRUE) { \
|
|
|
+ AsicSendCommandToMcu(_pAd, 0x80, 0xff, 0x0, 0x0); \
|
|
|
+ RTMPusecDelay(1000); \
|
|
|
+ } \
|
|
|
+ for (_secCnt = 0; _secCnt < MAX_BUSY_COUNT; _secCnt++) { \
|
|
|
RTMP_IO_READ32(_pAd, _regID, &BbpCsr.word); \
|
|
|
- if (BbpCsr.field.Busy == IDLE) \
|
|
|
- break; \
|
|
|
- } \
|
|
|
- if ((BbpCsr.field.Busy == IDLE) && \
|
|
|
- (BbpCsr.field.RegNum == _bbpID)) \
|
|
|
- { \
|
|
|
- *(_pV) = (u8)BbpCsr.field.Value; \
|
|
|
- break; \
|
|
|
- } \
|
|
|
- } \
|
|
|
- if (BbpCsr.field.Busy == BUSY) \
|
|
|
- { \
|
|
|
- DBGPRINT_ERR(("BBP(viaMCU=%d) read R%d fail\n", (_bViaMCU), _bbpID)); \
|
|
|
+ if (BbpCsr.field.Busy == IDLE) \
|
|
|
+ break; \
|
|
|
+ } \
|
|
|
+ if ((BbpCsr.field.Busy == IDLE) && \
|
|
|
+ (BbpCsr.field.RegNum == _bbpID)) { \
|
|
|
+ *(_pV) = (u8)BbpCsr.field.Value; \
|
|
|
+ break; \
|
|
|
+ } \
|
|
|
+ } \
|
|
|
+ if (BbpCsr.field.Busy == BUSY) { \
|
|
|
+ DBGPRINT_ERR(("BBP(viaMCU=%d) read R%d fail\n", (_bViaMCU), _bbpID)); \
|
|
|
*(_pV) = (_pAd)->BbpWriteLatch[_bbpID]; \
|
|
|
- if ((_bViaMCU) == TRUE) \
|
|
|
- { \
|
|
|
+ if ((_bViaMCU) == TRUE) { \
|
|
|
RTMP_IO_READ32(_pAd, _regID, &BbpCsr.word); \
|
|
|
BbpCsr.field.Busy = 0; \
|
|
|
RTMP_IO_WRITE32(_pAd, _regID, BbpCsr.word); \
|
|
|
} \
|
|
|
} \
|
|
|
- }while(0)
|
|
|
+ } while (0)
|
|
|
|
|
|
/*
|
|
|
This marco used for the BBP read operation which didn't need via MCU.
|
|
@@ -283,42 +275,35 @@
|
|
|
int i, k; \
|
|
|
BOOLEAN brc; \
|
|
|
BbpCsr.field.Busy = IDLE; \
|
|
|
- if ((IS_RT3090((_A)) || IS_RT3572((_A)) || IS_RT3390((_A))) && ((_A)->StaCfg.PSControl.field.rt30xxPowerMode == 3) \
|
|
|
+ if ((IS_RT3090((_A)) || IS_RT3572((_A)) || IS_RT3390((_A))) \
|
|
|
+ && ((_A)->StaCfg.PSControl.field.rt30xxPowerMode == 3) \
|
|
|
&& ((_A)->StaCfg.PSControl.field.EnableNewPS == TRUE) \
|
|
|
&& ((_A)->bPCIclkOff == FALSE) \
|
|
|
- && ((_A)->brt30xxBanMcuCmd == FALSE)) \
|
|
|
- { \
|
|
|
- for (i=0; i<MAX_BUSY_COUNT; i++) \
|
|
|
- { \
|
|
|
- RTMP_IO_READ32(_A, H2M_BBP_AGENT, &BbpCsr.word); \
|
|
|
- if (BbpCsr.field.Busy == BUSY) \
|
|
|
- { \
|
|
|
- continue; \
|
|
|
- } \
|
|
|
- BbpCsr.word = 0; \
|
|
|
- BbpCsr.field.fRead = 1; \
|
|
|
- BbpCsr.field.BBP_RW_MODE = 1; \
|
|
|
- BbpCsr.field.Busy = 1; \
|
|
|
- BbpCsr.field.RegNum = _I; \
|
|
|
- RTMP_IO_WRITE32(_A, H2M_BBP_AGENT, BbpCsr.word); \
|
|
|
- brc = AsicSendCommandToMcu(_A, 0x80, 0xff, 0x0, 0x0); \
|
|
|
- if (brc == TRUE) \
|
|
|
- { \
|
|
|
- for (k=0; k<MAX_BUSY_COUNT; k++) \
|
|
|
- { \
|
|
|
- RTMP_IO_READ32(_A, H2M_BBP_AGENT, &BbpCsr.word); \
|
|
|
- if (BbpCsr.field.Busy == IDLE) \
|
|
|
- break; \
|
|
|
- } \
|
|
|
- if ((BbpCsr.field.Busy == IDLE) && \
|
|
|
- (BbpCsr.field.RegNum == _I)) \
|
|
|
- { \
|
|
|
- *(_pV) = (u8)BbpCsr.field.Value; \
|
|
|
- break; \
|
|
|
- } \
|
|
|
- } \
|
|
|
- else \
|
|
|
- { \
|
|
|
+ && ((_A)->brt30xxBanMcuCmd == FALSE)) { \
|
|
|
+ for (i = 0; i < MAX_BUSY_COUNT; i++) { \
|
|
|
+ RTMP_IO_READ32(_A, H2M_BBP_AGENT, &BbpCsr.word); \
|
|
|
+ if (BbpCsr.field.Busy == BUSY) { \
|
|
|
+ continue; \
|
|
|
+ } \
|
|
|
+ BbpCsr.word = 0; \
|
|
|
+ BbpCsr.field.fRead = 1; \
|
|
|
+ BbpCsr.field.BBP_RW_MODE = 1; \
|
|
|
+ BbpCsr.field.Busy = 1; \
|
|
|
+ BbpCsr.field.RegNum = _I; \
|
|
|
+ RTMP_IO_WRITE32(_A, H2M_BBP_AGENT, BbpCsr.word); \
|
|
|
+ brc = AsicSendCommandToMcu(_A, 0x80, 0xff, 0x0, 0x0); \
|
|
|
+ if (brc == TRUE) { \
|
|
|
+ for (k = 0; k < MAX_BUSY_COUNT; k++) { \
|
|
|
+ RTMP_IO_READ32(_A, H2M_BBP_AGENT, &BbpCsr.word); \
|
|
|
+ if (BbpCsr.field.Busy == IDLE) \
|
|
|
+ break; \
|
|
|
+ } \
|
|
|
+ if ((BbpCsr.field.Busy == IDLE) && \
|
|
|
+ (BbpCsr.field.RegNum == _I)) { \
|
|
|
+ *(_pV) = (u8)BbpCsr.field.Value; \
|
|
|
+ break; \
|
|
|
+ } \
|
|
|
+ } else { \
|
|
|
BbpCsr.field.Busy = 0; \
|
|
|
RTMP_IO_WRITE32(_A, H2M_BBP_AGENT, BbpCsr.word); \
|
|
|
} \
|
|
@@ -326,46 +311,38 @@
|
|
|
} \
|
|
|
else if (!((IS_RT3090((_A)) || IS_RT3572((_A)) || IS_RT3390((_A))) && ((_A)->StaCfg.PSControl.field.rt30xxPowerMode == 3) \
|
|
|
&& ((_A)->StaCfg.PSControl.field.EnableNewPS == TRUE)) \
|
|
|
- && ((_A)->bPCIclkOff == FALSE)) \
|
|
|
- { \
|
|
|
- for (i=0; i<MAX_BUSY_COUNT; i++) \
|
|
|
- { \
|
|
|
- RTMP_IO_READ32(_A, H2M_BBP_AGENT, &BbpCsr.word); \
|
|
|
- if (BbpCsr.field.Busy == BUSY) \
|
|
|
- { \
|
|
|
- continue; \
|
|
|
- } \
|
|
|
- BbpCsr.word = 0; \
|
|
|
- BbpCsr.field.fRead = 1; \
|
|
|
- BbpCsr.field.BBP_RW_MODE = 1; \
|
|
|
- BbpCsr.field.Busy = 1; \
|
|
|
- BbpCsr.field.RegNum = _I; \
|
|
|
- RTMP_IO_WRITE32(_A, H2M_BBP_AGENT, BbpCsr.word); \
|
|
|
- AsicSendCommandToMcu(_A, 0x80, 0xff, 0x0, 0x0); \
|
|
|
- for (k=0; k<MAX_BUSY_COUNT; k++) \
|
|
|
- { \
|
|
|
- RTMP_IO_READ32(_A, H2M_BBP_AGENT, &BbpCsr.word); \
|
|
|
- if (BbpCsr.field.Busy == IDLE) \
|
|
|
- break; \
|
|
|
- } \
|
|
|
- if ((BbpCsr.field.Busy == IDLE) && \
|
|
|
- (BbpCsr.field.RegNum == _I)) \
|
|
|
- { \
|
|
|
- *(_pV) = (u8)BbpCsr.field.Value; \
|
|
|
- break; \
|
|
|
- } \
|
|
|
- } \
|
|
|
- } \
|
|
|
- else \
|
|
|
- { \
|
|
|
+ && ((_A)->bPCIclkOff == FALSE)) { \
|
|
|
+ for (i = 0; i < MAX_BUSY_COUNT; i++) { \
|
|
|
+ RTMP_IO_READ32(_A, H2M_BBP_AGENT, &BbpCsr.word); \
|
|
|
+ if (BbpCsr.field.Busy == BUSY) { \
|
|
|
+ continue; \
|
|
|
+ } \
|
|
|
+ BbpCsr.word = 0; \
|
|
|
+ BbpCsr.field.fRead = 1; \
|
|
|
+ BbpCsr.field.BBP_RW_MODE = 1; \
|
|
|
+ BbpCsr.field.Busy = 1; \
|
|
|
+ BbpCsr.field.RegNum = _I; \
|
|
|
+ RTMP_IO_WRITE32(_A, H2M_BBP_AGENT, BbpCsr.word); \
|
|
|
+ AsicSendCommandToMcu(_A, 0x80, 0xff, 0x0, 0x0); \
|
|
|
+ for (k = 0; k < MAX_BUSY_COUNT; k++) { \
|
|
|
+ RTMP_IO_READ32(_A, H2M_BBP_AGENT, &BbpCsr.word); \
|
|
|
+ if (BbpCsr.field.Busy == IDLE) \
|
|
|
+ break; \
|
|
|
+ } \
|
|
|
+ if ((BbpCsr.field.Busy == IDLE) && \
|
|
|
+ (BbpCsr.field.RegNum == _I)) { \
|
|
|
+ *(_pV) = (u8)BbpCsr.field.Value; \
|
|
|
+ break; \
|
|
|
+ } \
|
|
|
+ } \
|
|
|
+ } else { \
|
|
|
DBGPRINT_ERR((" , brt30xxBanMcuCmd = %d, Read BBP %d \n", (_A)->brt30xxBanMcuCmd, (_I))); \
|
|
|
- *(_pV) = (_A)->BbpWriteLatch[_I]; \
|
|
|
- } \
|
|
|
- if ((BbpCsr.field.Busy == BUSY) || ((_A)->bPCIclkOff == TRUE)) \
|
|
|
- { \
|
|
|
- DBGPRINT_ERR(("BBP read R%d=0x%x fail\n", _I, BbpCsr.word)); \
|
|
|
- *(_pV) = (_A)->BbpWriteLatch[_I]; \
|
|
|
- } \
|
|
|
+ *(_pV) = (_A)->BbpWriteLatch[_I]; \
|
|
|
+ } \
|
|
|
+ if ((BbpCsr.field.Busy == BUSY) || ((_A)->bPCIclkOff == TRUE)) { \
|
|
|
+ DBGPRINT_ERR(("BBP read R%d=0x%x fail\n", _I, BbpCsr.word)); \
|
|
|
+ *(_pV) = (_A)->BbpWriteLatch[_I]; \
|
|
|
+ } \
|
|
|
}
|
|
|
|
|
|
/*
|
|
@@ -376,43 +353,39 @@
|
|
|
_bViaMCU: if we need access the bbp via the MCU.
|
|
|
*/
|
|
|
#define RTMP_BBP_IO_WRITE8(_pAd, _bbpID, _pV, _bViaMCU) \
|
|
|
- do{ \
|
|
|
+ do { \
|
|
|
BBP_CSR_CFG_STRUC BbpCsr; \
|
|
|
- int _busyCnt, _regID; \
|
|
|
- \
|
|
|
+ int _busyCnt, _regID; \
|
|
|
+ \
|
|
|
_regID = ((_bViaMCU) == TRUE ? H2M_BBP_AGENT : BBP_CSR_CFG); \
|
|
|
- for (_busyCnt=0; _busyCnt<MAX_BUSY_COUNT; _busyCnt++) \
|
|
|
- { \
|
|
|
+ for (_busyCnt = 0; _busyCnt < MAX_BUSY_COUNT; _busyCnt++) { \
|
|
|
RTMP_IO_READ32((_pAd), BBP_CSR_CFG, &BbpCsr.word); \
|
|
|
- if (BbpCsr.field.Busy == BUSY) \
|
|
|
- continue; \
|
|
|
- BbpCsr.word = 0; \
|
|
|
- BbpCsr.field.fRead = 0; \
|
|
|
- BbpCsr.field.BBP_RW_MODE = 1; \
|
|
|
- BbpCsr.field.Busy = 1; \
|
|
|
- BbpCsr.field.Value = _pV; \
|
|
|
- BbpCsr.field.RegNum = _bbpID; \
|
|
|
- RTMP_IO_WRITE32((_pAd), BBP_CSR_CFG, BbpCsr.word); \
|
|
|
- if ((_bViaMCU) == TRUE) \
|
|
|
- { \
|
|
|
- AsicSendCommandToMcu(_pAd, 0x80, 0xff, 0x0, 0x0); \
|
|
|
- if ((_pAd)->OpMode == OPMODE_AP) \
|
|
|
- RTMPusecDelay(1000); \
|
|
|
- } \
|
|
|
- (_pAd)->BbpWriteLatch[_bbpID] = _pV; \
|
|
|
- break; \
|
|
|
- } \
|
|
|
- if (_busyCnt == MAX_BUSY_COUNT) \
|
|
|
- { \
|
|
|
- DBGPRINT_ERR(("BBP write R%d fail\n", _bbpID)); \
|
|
|
- if((_bViaMCU) == TRUE) \
|
|
|
- { \
|
|
|
+ if (BbpCsr.field.Busy == BUSY) \
|
|
|
+ continue; \
|
|
|
+ BbpCsr.word = 0; \
|
|
|
+ BbpCsr.field.fRead = 0; \
|
|
|
+ BbpCsr.field.BBP_RW_MODE = 1; \
|
|
|
+ BbpCsr.field.Busy = 1; \
|
|
|
+ BbpCsr.field.Value = _pV; \
|
|
|
+ BbpCsr.field.RegNum = _bbpID; \
|
|
|
+ RTMP_IO_WRITE32((_pAd), BBP_CSR_CFG, BbpCsr.word); \
|
|
|
+ if ((_bViaMCU) == TRUE) { \
|
|
|
+ AsicSendCommandToMcu(_pAd, 0x80, 0xff, 0x0, 0x0); \
|
|
|
+ if ((_pAd)->OpMode == OPMODE_AP) \
|
|
|
+ RTMPusecDelay(1000); \
|
|
|
+ } \
|
|
|
+ (_pAd)->BbpWriteLatch[_bbpID] = _pV; \
|
|
|
+ break; \
|
|
|
+ } \
|
|
|
+ if (_busyCnt == MAX_BUSY_COUNT) { \
|
|
|
+ DBGPRINT_ERR(("BBP write R%d fail\n", _bbpID)); \
|
|
|
+ if ((_bViaMCU) == TRUE) { \
|
|
|
RTMP_IO_READ32(_pAd, H2M_BBP_AGENT, &BbpCsr.word); \
|
|
|
- BbpCsr.field.Busy = 0; \
|
|
|
+ BbpCsr.field.Busy = 0; \
|
|
|
RTMP_IO_WRITE32(_pAd, H2M_BBP_AGENT, BbpCsr.word); \
|
|
|
- } \
|
|
|
- } \
|
|
|
- }while(0)
|
|
|
+ } \
|
|
|
+ } \
|
|
|
+ } while (0)
|
|
|
|
|
|
/*
|
|
|
This marco used for the BBP write operation which didn't need via MCU.
|
|
@@ -426,25 +399,22 @@
|
|
|
will use this function too and didn't access the bbp register via the MCU.
|
|
|
*/
|
|
|
/* Write BBP register by register's ID & value */
|
|
|
-#define RTMP_BBP_IO_WRITE8_BY_REG_ID(_A, _I, _V) \
|
|
|
-{ \
|
|
|
- BBP_CSR_CFG_STRUC BbpCsr; \
|
|
|
- int BusyCnt = 0; \
|
|
|
+#define RTMP_BBP_IO_WRITE8_BY_REG_ID(_A, _I, _V) \
|
|
|
+{ \
|
|
|
+ BBP_CSR_CFG_STRUC BbpCsr; \
|
|
|
+ int BusyCnt = 0; \
|
|
|
BOOLEAN brc; \
|
|
|
- if (_I < MAX_NUM_OF_BBP_LATCH) \
|
|
|
- { \
|
|
|
- if ((IS_RT3090((_A)) || IS_RT3572((_A)) || IS_RT3390((_A))) && ((_A)->StaCfg.PSControl.field.rt30xxPowerMode == 3) \
|
|
|
+ if (_I < MAX_NUM_OF_BBP_LATCH) { \
|
|
|
+ if ((IS_RT3090((_A)) || IS_RT3572((_A)) || IS_RT3390((_A))) \
|
|
|
+ && ((_A)->StaCfg.PSControl.field.rt30xxPowerMode == 3) \
|
|
|
&& ((_A)->StaCfg.PSControl.field.EnableNewPS == TRUE) \
|
|
|
&& ((_A)->bPCIclkOff == FALSE) \
|
|
|
- && ((_A)->brt30xxBanMcuCmd == FALSE)) \
|
|
|
- { \
|
|
|
- if (_A->AccessBBPFailCount > 20) \
|
|
|
- { \
|
|
|
- AsicResetBBPAgent(_A); \
|
|
|
- _A->AccessBBPFailCount = 0; \
|
|
|
- } \
|
|
|
- for (BusyCnt=0; BusyCnt<MAX_BUSY_COUNT; BusyCnt++) \
|
|
|
- { \
|
|
|
+ && ((_A)->brt30xxBanMcuCmd == FALSE)) { \
|
|
|
+ if (_A->AccessBBPFailCount > 20) { \
|
|
|
+ AsicResetBBPAgent(_A); \
|
|
|
+ _A->AccessBBPFailCount = 0; \
|
|
|
+ } \
|
|
|
+ for (BusyCnt = 0; BusyCnt < MAX_BUSY_COUNT; BusyCnt++) { \
|
|
|
RTMP_IO_READ32(_A, H2M_BBP_AGENT, &BbpCsr.word); \
|
|
|
if (BbpCsr.field.Busy == BUSY) \
|
|
|
continue; \
|
|
@@ -456,29 +426,24 @@
|
|
|
BbpCsr.field.RegNum = _I; \
|
|
|
RTMP_IO_WRITE32(_A, H2M_BBP_AGENT, BbpCsr.word); \
|
|
|
brc = AsicSendCommandToMcu(_A, 0x80, 0xff, 0x0, 0x0); \
|
|
|
- if (brc == TRUE) \
|
|
|
- { \
|
|
|
+ if (brc == TRUE) { \
|
|
|
(_A)->BbpWriteLatch[_I] = _V; \
|
|
|
- } \
|
|
|
- else \
|
|
|
- { \
|
|
|
+ } else { \
|
|
|
BbpCsr.field.Busy = 0; \
|
|
|
RTMP_IO_WRITE32(_A, H2M_BBP_AGENT, BbpCsr.word); \
|
|
|
} \
|
|
|
break; \
|
|
|
} \
|
|
|
} \
|
|
|
- else if (!((IS_RT3090((_A)) || IS_RT3572((_A)) || IS_RT3390((_A))) && ((_A)->StaCfg.PSControl.field.rt30xxPowerMode == 3) \
|
|
|
+ else if (!((IS_RT3090((_A)) || IS_RT3572((_A)) || IS_RT3390((_A))) \
|
|
|
+ && ((_A)->StaCfg.PSControl.field.rt30xxPowerMode == 3) \
|
|
|
&& ((_A)->StaCfg.PSControl.field.EnableNewPS == TRUE)) \
|
|
|
- && ((_A)->bPCIclkOff == FALSE)) \
|
|
|
- { \
|
|
|
- if (_A->AccessBBPFailCount > 20) \
|
|
|
- { \
|
|
|
- AsicResetBBPAgent(_A); \
|
|
|
- _A->AccessBBPFailCount = 0; \
|
|
|
- } \
|
|
|
- for (BusyCnt=0; BusyCnt<MAX_BUSY_COUNT; BusyCnt++) \
|
|
|
- { \
|
|
|
+ && ((_A)->bPCIclkOff == FALSE)) { \
|
|
|
+ if (_A->AccessBBPFailCount > 20) { \
|
|
|
+ AsicResetBBPAgent(_A); \
|
|
|
+ _A->AccessBBPFailCount = 0; \
|
|
|
+ } \
|
|
|
+ for (BusyCnt = 0; BusyCnt < MAX_BUSY_COUNT; BusyCnt++) { \
|
|
|
RTMP_IO_READ32(_A, H2M_BBP_AGENT, &BbpCsr.word); \
|
|
|
if (BbpCsr.field.Busy == BUSY) \
|
|
|
continue; \
|
|
@@ -493,20 +458,15 @@
|
|
|
(_A)->BbpWriteLatch[_I] = _V; \
|
|
|
break; \
|
|
|
} \
|
|
|
- } \
|
|
|
- else \
|
|
|
- { \
|
|
|
+ } else { \
|
|
|
DBGPRINT_ERR((" brt30xxBanMcuCmd = %d. Write BBP %d \n", (_A)->brt30xxBanMcuCmd, (_I))); \
|
|
|
} \
|
|
|
- if ((BusyCnt == MAX_BUSY_COUNT) || ((_A)->bPCIclkOff == TRUE)) \
|
|
|
- { \
|
|
|
- if (BusyCnt == MAX_BUSY_COUNT) \
|
|
|
+ if ((BusyCnt == MAX_BUSY_COUNT) || ((_A)->bPCIclkOff == TRUE)) { \
|
|
|
+ if (BusyCnt == MAX_BUSY_COUNT) \
|
|
|
(_A)->AccessBBPFailCount++; \
|
|
|
- DBGPRINT_ERR(("BBP write R%d=0x%x fail. BusyCnt= %d.bPCIclkOff = %d. \n", _I, BbpCsr.word, BusyCnt, (_A)->bPCIclkOff )); \
|
|
|
+ DBGPRINT_ERR(("BBP write R%d=0x%x fail. BusyCnt= %d.bPCIclkOff = %d. \n", _I, BbpCsr.word, BusyCnt, (_A)->bPCIclkOff)); \
|
|
|
} \
|
|
|
- } \
|
|
|
- else \
|
|
|
- { \
|
|
|
+ } else { \
|
|
|
DBGPRINT_ERR(("****** BBP_Write_Latch Buffer exceeds max boundry ****** \n")); \
|
|
|
} \
|
|
|
}
|
|
@@ -522,7 +482,7 @@
|
|
|
|
|
|
#ifdef RT30xx
|
|
|
#define RTMP_ASIC_MMPS_DISABLE(_pAd) \
|
|
|
- do{ \
|
|
|
+ do { \
|
|
|
u32 _macData; \
|
|
|
u8 _bbpData = 0; \
|
|
|
/* disable MMPS BBP control register */ \
|
|
@@ -534,10 +494,10 @@
|
|
|
RTMP_IO_READ32(_pAd, 0x1210, &_macData); \
|
|
|
_macData &= ~(0x09); /*bit 0, 3*/ \
|
|
|
RTMP_IO_WRITE32(_pAd, 0x1210, _macData); \
|
|
|
- }while(0)
|
|
|
+ } while (0)
|
|
|
|
|
|
#define RTMP_ASIC_MMPS_ENABLE(_pAd) \
|
|
|
- do{ \
|
|
|
+ do { \
|
|
|
u32 _macData; \
|
|
|
u8 _bbpData = 0; \
|
|
|
/* enable MMPS BBP control register */ \
|
|
@@ -549,7 +509,7 @@
|
|
|
RTMP_IO_READ32(_pAd, 0x1210, &_macData); \
|
|
|
_macData |= (0x09); /*bit 0, 3*/ \
|
|
|
RTMP_IO_WRITE32(_pAd, 0x1210, _macData); \
|
|
|
- }while(0)
|
|
|
+ } while (0)
|
|
|
|
|
|
#endif /* RT30xx // */
|
|
|
|