diff options
author | Jim Lieb <lieb@canonical.com> | 2009-08-12 14:54:16 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-09-15 12:02:08 -0700 |
commit | 256a816b6b78bf29fba0c0f1bbcf998953429422 (patch) | |
tree | c74cbe782154efac2cac80e075c06e44efb81055 /drivers/staging/vt6655/mac.c | |
parent | 8a3d91b02830dd7c58d27e5de65222219ac2163f (diff) | |
download | op-kernel-dev-256a816b6b78bf29fba0c0f1bbcf998953429422.zip op-kernel-dev-256a816b6b78bf29fba0c0f1bbcf998953429422.tar.gz |
Staging: vt665x: remove tbit.h part 2
Remove use of tbit macros adn remove header file.
Signed-off-by: Jim Lieb <lieb@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/vt6655/mac.c')
-rw-r--r-- | drivers/staging/vt6655/mac.c | 75 |
1 files changed, 37 insertions, 38 deletions
diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c index 889866c..cdd7cd5 100644 --- a/drivers/staging/vt6655/mac.c +++ b/drivers/staging/vt6655/mac.c @@ -69,7 +69,6 @@ */ #include "tmacro.h" -#include "tbit.h" #include "tether.h" #include "mac.h" @@ -146,7 +145,7 @@ BOOL MACbIsRegBitsOn (DWORD_PTR dwIoBase, BYTE byRegOfs, BYTE byTestBits) BYTE byData; VNSvInPortB(dwIoBase + byRegOfs, &byData); - return BITbIsAllBitsOn(byData, byTestBits); + return (byData & byTestBits) == byTestBits; } /* @@ -169,7 +168,7 @@ BOOL MACbIsRegBitsOff (DWORD_PTR dwIoBase, BYTE byRegOfs, BYTE byTestBits) BYTE byData; VNSvInPortB(dwIoBase + byRegOfs, &byData); - return BITbIsAllBitsOff(byData, byTestBits); + return !(byData & byTestBits); } /* @@ -565,7 +564,7 @@ BOOL MACbIsInLoopbackMode (DWORD_PTR dwIoBase) BYTE byOrgValue; VNSvInPortB(dwIoBase + MAC_REG_TEST, &byOrgValue); - if (BITbIsAnyBitsOn(byOrgValue, (TEST_LBINT | TEST_LBEXT))) + if (byOrgValue & (TEST_LBINT | TEST_LBEXT)) return TRUE; return FALSE; } @@ -592,7 +591,7 @@ void MACvSetPacketFilter (DWORD_PTR dwIoBase, WORD wFilterType) // if only in DIRECTED mode, multicast-address will set to zero, // but if other mode exist (e.g. PROMISCUOUS), multicast-address // will be open - if (BITbIsBitOn(wFilterType, PKT_TYPE_DIRECTED)) { + if (wFilterType & PKT_TYPE_DIRECTED) { // set multicast address to accept none MACvSelectPage1(dwIoBase); VNSvOutPortD(dwIoBase + MAC_REG_MAR0, 0L); @@ -600,7 +599,7 @@ void MACvSetPacketFilter (DWORD_PTR dwIoBase, WORD wFilterType) MACvSelectPage0(dwIoBase); } - if (BITbIsAnyBitsOn(wFilterType, PKT_TYPE_PROMISCUOUS | PKT_TYPE_ALL_MULTICAST)) { + if (wFilterType & (PKT_TYPE_PROMISCUOUS | PKT_TYPE_ALL_MULTICAST)) { // set multicast address to accept all MACvSelectPage1(dwIoBase); VNSvOutPortD(dwIoBase + MAC_REG_MAR0, 0xFFFFFFFFL); @@ -608,20 +607,20 @@ void MACvSetPacketFilter (DWORD_PTR dwIoBase, WORD wFilterType) MACvSelectPage0(dwIoBase); } - if (BITbIsBitOn(wFilterType, PKT_TYPE_PROMISCUOUS)) { + if (wFilterType & PKT_TYPE_PROMISCUOUS) { byNewRCR |= (RCR_RXALLTYPE | RCR_UNICAST | RCR_MULTICAST | RCR_BROADCAST); byNewRCR &= ~RCR_BSSID; } - if (BITbIsAnyBitsOn(wFilterType, (PKT_TYPE_ALL_MULTICAST | PKT_TYPE_MULTICAST))) + if (wFilterType & (PKT_TYPE_ALL_MULTICAST | PKT_TYPE_MULTICAST)) byNewRCR |= RCR_MULTICAST; - if (BITbIsBitOn(wFilterType, PKT_TYPE_BROADCAST)) + if (wFilterType & PKT_TYPE_BROADCAST) byNewRCR |= RCR_BROADCAST; - if (BITbIsBitOn(wFilterType, PKT_TYPE_ERROR_CRC)) + if (wFilterType & PKT_TYPE_ERROR_CRC) byNewRCR |= RCR_ERRCRC; VNSvInPortB(dwIoBase + MAC_REG_RCR, &byOldRCR); @@ -785,7 +784,7 @@ BOOL MACbSoftwareReset (DWORD_PTR dwIoBase) for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { VNSvInPortB(dwIoBase + MAC_REG_HOSTCR, &byData); - if (BITbIsBitOff(byData, HOSTCR_SOFTRST)) + if ( !(byData & HOSTCR_SOFTRST)) break; } if (ww == W_MAX_TIMEOUT) @@ -853,7 +852,7 @@ BOOL MACbSafeRxOff (DWORD_PTR dwIoBase) VNSvOutPortD(dwIoBase + MAC_REG_RXDMACTL1, DMACTL_CLRRUN); for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { VNSvInPortD(dwIoBase + MAC_REG_RXDMACTL0, &dwData); - if (BITbIsAllBitsOff(dwData, DMACTL_RUN)) + if (!(dwData & DMACTL_RUN)) break; } if (ww == W_MAX_TIMEOUT) { @@ -863,7 +862,7 @@ BOOL MACbSafeRxOff (DWORD_PTR dwIoBase) } for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { VNSvInPortD(dwIoBase + MAC_REG_RXDMACTL1, &dwData); - if (BITbIsAllBitsOff(dwData, DMACTL_RUN)) + if ( !(dwData & DMACTL_RUN)) break; } if (ww == W_MAX_TIMEOUT) { @@ -877,7 +876,7 @@ BOOL MACbSafeRxOff (DWORD_PTR dwIoBase) // W_MAX_TIMEOUT is the timeout period for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { VNSvInPortB(dwIoBase + MAC_REG_HOSTCR, &byData); - if (BITbIsAllBitsOff(byData, HOSTCR_RXONST)) + if ( !(byData & HOSTCR_RXONST)) break; } if (ww == W_MAX_TIMEOUT) { @@ -916,7 +915,7 @@ BOOL MACbSafeTxOff (DWORD_PTR dwIoBase) for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { VNSvInPortD(dwIoBase + MAC_REG_TXDMACTL0, &dwData); - if (BITbIsAllBitsOff(dwData, DMACTL_RUN)) + if ( !(dwData & DMACTL_RUN)) break; } if (ww == W_MAX_TIMEOUT) { @@ -926,7 +925,7 @@ BOOL MACbSafeTxOff (DWORD_PTR dwIoBase) } for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { VNSvInPortD(dwIoBase + MAC_REG_AC0DMACTL, &dwData); - if (BITbIsAllBitsOff(dwData, DMACTL_RUN)) + if ( !(dwData & DMACTL_RUN)) break; } if (ww == W_MAX_TIMEOUT) { @@ -941,7 +940,7 @@ BOOL MACbSafeTxOff (DWORD_PTR dwIoBase) // W_MAX_TIMEOUT is the timeout period for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { VNSvInPortB(dwIoBase + MAC_REG_HOSTCR, &byData); - if (BITbIsAllBitsOff(byData, HOSTCR_TXONST)) + if ( !(byData & HOSTCR_TXONST)) break; } if (ww == W_MAX_TIMEOUT) { @@ -1049,7 +1048,7 @@ void MACvInitialize (DWORD_PTR dwIoBase) //while (TRUE) { // U8 u8Data; // VNSvInPortB(dwIoBase + MAC_REG_I2MCSR, &u8Data); - // if (BITbIsBitOff(u8Data, I2MCSR_AUTOLD)) + // if ( !(u8Data & I2MCSR_AUTOLD)) // break; //} @@ -1087,19 +1086,19 @@ BYTE byData; BYTE byOrgDMACtl; VNSvInPortB(dwIoBase + MAC_REG_RXDMACTL0, &byOrgDMACtl); - if (BITbIsAllBitsOn(byOrgDMACtl, DMACTL_RUN)) { + if (byOrgDMACtl & DMACTL_RUN) { VNSvOutPortB(dwIoBase + MAC_REG_RXDMACTL0+2, DMACTL_RUN); } for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { VNSvInPortB(dwIoBase + MAC_REG_RXDMACTL0, &byData); - if (BITbIsAllBitsOff(byData, DMACTL_RUN)) + if ( !(byData & DMACTL_RUN)) break; } if (ww == W_MAX_TIMEOUT) { DBG_PORT80(0x13); } VNSvOutPortD(dwIoBase + MAC_REG_RXDMAPTR0, dwCurrDescAddr); - if (BITbIsAllBitsOn(byOrgDMACtl, DMACTL_RUN)) { + if (byOrgDMACtl & DMACTL_RUN) { VNSvOutPortB(dwIoBase + MAC_REG_RXDMACTL0, DMACTL_RUN); } } @@ -1125,19 +1124,19 @@ BYTE byData; BYTE byOrgDMACtl; VNSvInPortB(dwIoBase + MAC_REG_RXDMACTL1, &byOrgDMACtl); - if (BITbIsAllBitsOn(byOrgDMACtl, DMACTL_RUN)) { + if (byOrgDMACtl & DMACTL_RUN) { VNSvOutPortB(dwIoBase + MAC_REG_RXDMACTL1+2, DMACTL_RUN); } for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { VNSvInPortB(dwIoBase + MAC_REG_RXDMACTL1, &byData); - if (BITbIsAllBitsOff(byData, DMACTL_RUN)) + if ( !(byData & DMACTL_RUN)) break; } if (ww == W_MAX_TIMEOUT) { DBG_PORT80(0x14); } VNSvOutPortD(dwIoBase + MAC_REG_RXDMAPTR1, dwCurrDescAddr); - if (BITbIsAllBitsOn(byOrgDMACtl, DMACTL_RUN)) { + if (byOrgDMACtl & DMACTL_RUN) { VNSvOutPortB(dwIoBase + MAC_REG_RXDMACTL1, DMACTL_RUN); } } @@ -1163,19 +1162,19 @@ BYTE byData; BYTE byOrgDMACtl; VNSvInPortB(dwIoBase + MAC_REG_TXDMACTL0, &byOrgDMACtl); - if (BITbIsAllBitsOn(byOrgDMACtl, DMACTL_RUN)) { + if (byOrgDMACtl & DMACTL_RUN) { VNSvOutPortB(dwIoBase + MAC_REG_TXDMACTL0+2, DMACTL_RUN); } for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { VNSvInPortB(dwIoBase + MAC_REG_TXDMACTL0, &byData); - if (BITbIsAllBitsOff(byData, DMACTL_RUN)) + if ( !(byData & DMACTL_RUN)) break; } if (ww == W_MAX_TIMEOUT) { DBG_PORT80(0x25); } VNSvOutPortD(dwIoBase + MAC_REG_TXDMAPTR0, dwCurrDescAddr); - if (BITbIsAllBitsOn(byOrgDMACtl, DMACTL_RUN)) { + if (byOrgDMACtl & DMACTL_RUN) { VNSvOutPortB(dwIoBase + MAC_REG_TXDMACTL0, DMACTL_RUN); } } @@ -1202,12 +1201,12 @@ BYTE byData; BYTE byOrgDMACtl; VNSvInPortB(dwIoBase + MAC_REG_AC0DMACTL, &byOrgDMACtl); - if (BITbIsAllBitsOn(byOrgDMACtl, DMACTL_RUN)) { + if (byOrgDMACtl & DMACTL_RUN) { VNSvOutPortB(dwIoBase + MAC_REG_AC0DMACTL+2, DMACTL_RUN); } for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { VNSvInPortB(dwIoBase + MAC_REG_AC0DMACTL, &byData); - if (BITbIsAllBitsOff(byData, DMACTL_RUN)) + if (!(byData & DMACTL_RUN)) break; } if (ww == W_MAX_TIMEOUT) { @@ -1215,7 +1214,7 @@ BYTE byOrgDMACtl; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" DBG_PORT80(0x26)\n"); } VNSvOutPortD(dwIoBase + MAC_REG_AC0DMAPTR, dwCurrDescAddr); - if (BITbIsAllBitsOn(byOrgDMACtl, DMACTL_RUN)) { + if (byOrgDMACtl & DMACTL_RUN) { VNSvOutPortB(dwIoBase + MAC_REG_AC0DMACTL, DMACTL_RUN); } } @@ -1257,7 +1256,7 @@ UINT uu,ii; for (uu = 0; uu < uDelay; uu++) { VNSvInPortB(dwIoBase + MAC_REG_TMCTL0, &byValue); if ((byValue == 0) || - (BITbIsAllBitsOn(byValue, TMCTL_TSUSP))) { + (byValue & TMCTL_TSUSP)) { VNSvOutPortB(dwIoBase + MAC_REG_TMCTL0, 0); return; } @@ -1329,14 +1328,14 @@ UINT ww = 0; VNSvOutPortB(dwIoBase + MAC_REG_TXDMACTL0+2, DMACTL_RUN); for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { VNSvInPortB(dwIoBase + MAC_REG_TXDMACTL0, &byData); - if (BITbIsAllBitsOff(byData, DMACTL_RUN)) + if ( !(byData & DMACTL_RUN)) break; } } else if (idx == TYPE_AC0DMA) { VNSvOutPortB(dwIoBase + MAC_REG_AC0DMACTL+2, DMACTL_RUN); for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { VNSvInPortB(dwIoBase + MAC_REG_AC0DMACTL, &byData); - if (BITbIsAllBitsOff(byData, DMACTL_RUN)) + if ( !(byData & DMACTL_RUN)) break; } } @@ -1354,14 +1353,14 @@ void MACvClearBusSusInd (DWORD_PTR dwIoBase) UINT ww; // check if BcnSusInd enabled VNSvInPortD(dwIoBase + MAC_REG_ENCFG , &dwOrgValue); - if(BITbIsBitOff(dwOrgValue, EnCFG_BcnSusInd)) + if( !(dwOrgValue & EnCFG_BcnSusInd)) return; //Set BcnSusClr dwOrgValue = dwOrgValue | EnCFG_BcnSusClr; VNSvOutPortD(dwIoBase + MAC_REG_ENCFG, dwOrgValue); for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { VNSvInPortD(dwIoBase + MAC_REG_ENCFG , &dwOrgValue); - if(BITbIsBitOff(dwOrgValue, EnCFG_BcnSusInd)) + if( !(dwOrgValue & EnCFG_BcnSusInd)) break; } if (ww == W_MAX_TIMEOUT) { @@ -1383,7 +1382,7 @@ void MACvEnableBusSusEn (DWORD_PTR dwIoBase) VNSvOutPortB(dwIoBase + MAC_REG_ENCFG, byOrgValue); for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { VNSvInPortD(dwIoBase + MAC_REG_ENCFG , &dwOrgValue); - if(BITbIsBitOn(dwOrgValue, EnCFG_BcnSusInd)) + if(dwOrgValue & EnCFG_BcnSusInd) break; } if (ww == W_MAX_TIMEOUT) { @@ -1406,7 +1405,7 @@ BOOL MACbFlushSYNCFifo (DWORD_PTR dwIoBase) // Check if SyncFlushOK for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { VNSvInPortB(dwIoBase + MAC_REG_MACCR , &byOrgValue); - if(BITbIsBitOn(byOrgValue, MACCR_SYNCFLUSHOK)) + if(byOrgValue & MACCR_SYNCFLUSHOK) break; } if (ww == W_MAX_TIMEOUT) { @@ -1430,7 +1429,7 @@ BOOL MACbPSWakeup (DWORD_PTR dwIoBase) // Check if SyncFlushOK for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { VNSvInPortB(dwIoBase + MAC_REG_PSCTL , &byOrgValue); - if(BITbIsBitOn(byOrgValue, PSCTL_WAKEDONE)) + if(byOrgValue & PSCTL_WAKEDONE) break; } if (ww == W_MAX_TIMEOUT) { |