Commit 256a816b authored by Jim Lieb's avatar Jim Lieb Committed by Greg Kroah-Hartman

Staging: vt665x: remove tbit.h part 2

Remove use of tbit macros adn remove header file.
Signed-off-by: default avatarJim Lieb <lieb@canonical.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 8a3d91b0
...@@ -50,7 +50,6 @@ ...@@ -50,7 +50,6 @@
*/ */
#include "tmacro.h" #include "tmacro.h"
#include "tbit.h"
#include "tether.h" #include "tether.h"
#include "mac.h" #include "mac.h"
#include "baseband.h" #include "baseband.h"
...@@ -2029,7 +2028,7 @@ BOOL BBbReadEmbeded (DWORD_PTR dwIoBase, BYTE byBBAddr, PBYTE pbyData) ...@@ -2029,7 +2028,7 @@ BOOL BBbReadEmbeded (DWORD_PTR dwIoBase, BYTE byBBAddr, PBYTE pbyData)
// W_MAX_TIMEOUT is the timeout period // W_MAX_TIMEOUT is the timeout period
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortB(dwIoBase + MAC_REG_BBREGCTL, &byValue); VNSvInPortB(dwIoBase + MAC_REG_BBREGCTL, &byValue);
if (BITbIsBitOn(byValue, BBREGCTL_DONE)) if (byValue & BBREGCTL_DONE)
break; break;
} }
...@@ -2074,7 +2073,7 @@ BOOL BBbWriteEmbeded (DWORD_PTR dwIoBase, BYTE byBBAddr, BYTE byData) ...@@ -2074,7 +2073,7 @@ BOOL BBbWriteEmbeded (DWORD_PTR dwIoBase, BYTE byBBAddr, BYTE byData)
// W_MAX_TIMEOUT is the timeout period // W_MAX_TIMEOUT is the timeout period
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortB(dwIoBase + MAC_REG_BBREGCTL, &byValue); VNSvInPortB(dwIoBase + MAC_REG_BBREGCTL, &byValue);
if (BITbIsBitOn(byValue, BBREGCTL_DONE)) if (byValue & BBREGCTL_DONE)
break; break;
} }
...@@ -2106,7 +2105,7 @@ BOOL BBbIsRegBitsOn (DWORD_PTR dwIoBase, BYTE byBBAddr, BYTE byTestBits) ...@@ -2106,7 +2105,7 @@ BOOL BBbIsRegBitsOn (DWORD_PTR dwIoBase, BYTE byBBAddr, BYTE byTestBits)
BYTE byOrgData; BYTE byOrgData;
BBbReadEmbeded(dwIoBase, byBBAddr, &byOrgData); BBbReadEmbeded(dwIoBase, byBBAddr, &byOrgData);
return BITbIsAllBitsOn(byOrgData, byTestBits); return (byOrgData & byTestBits) == byTestBits;
} }
...@@ -2129,7 +2128,7 @@ BOOL BBbIsRegBitsOff (DWORD_PTR dwIoBase, BYTE byBBAddr, BYTE byTestBits) ...@@ -2129,7 +2128,7 @@ BOOL BBbIsRegBitsOff (DWORD_PTR dwIoBase, BYTE byBBAddr, BYTE byTestBits)
BYTE byOrgData; BYTE byOrgData;
BBbReadEmbeded(dwIoBase, byBBAddr, &byOrgData); BBbReadEmbeded(dwIoBase, byBBAddr, &byOrgData);
return BITbIsAllBitsOff(byOrgData, byTestBits); return (byOrgData & byTestBits) == 0;
} }
/* /*
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
* *
*/ */
#include "tbit.h"
#include "ttype.h" #include "ttype.h"
#include "tmacro.h" #include "tmacro.h"
#include "tether.h" #include "tether.h"
...@@ -1035,14 +1034,14 @@ BSSvSecondCallBack( ...@@ -1035,14 +1034,14 @@ BSSvSecondCallBack(
//2008-4-14 <add> by chester for led issue //2008-4-14 <add> by chester for led issue
#ifdef FOR_LED_ON_NOTEBOOK #ifdef FOR_LED_ON_NOTEBOOK
MACvGPIOIn(pDevice->PortOffset, &pDevice->byGPIO); MACvGPIOIn(pDevice->PortOffset, &pDevice->byGPIO);
if (((BITbIsBitOff(pDevice->byGPIO,GPIO0_DATA)&&(pDevice->bHWRadioOff == FALSE))||(BITbIsBitOn(pDevice->byGPIO,GPIO0_DATA)&&(pDevice->bHWRadioOff == TRUE)))&&(cc==FALSE)){ if ((( !(pDevice->byGPIO & GPIO0_DATA)&&(pDevice->bHWRadioOff == FALSE))||((pDevice->byGPIO & GPIO0_DATA)&&(pDevice->bHWRadioOff == TRUE)))&&(cc==FALSE)){
cc=TRUE; cc=TRUE;
} }
else if(cc==TRUE){ else if(cc==TRUE){
if(pDevice->bHWRadioOff == TRUE){ if(pDevice->bHWRadioOff == TRUE){
if (BITbIsBitOff(pDevice->byGPIO,GPIO0_DATA)) if ( !(pDevice->byGPIO & GPIO0_DATA))
//||(BITbIsBitOff(pDevice->byGPIO,GPIO0_DATA) && BITbIsBitOn(pDevice->byRadioCtl, EEP_RADIOCTL_INV))) //||( !(pDevice->byGPIO & GPIO0_DATA) && (pDevice->byRadioCtl & EEP_RADIOCTL_INV)))
{if(status==1) goto start; {if(status==1) goto start;
status=1; status=1;
CARDbRadioPowerOff(pDevice); CARDbRadioPowerOff(pDevice);
...@@ -1053,15 +1052,15 @@ CARDbRadioPowerOff(pDevice); ...@@ -1053,15 +1052,15 @@ CARDbRadioPowerOff(pDevice);
pDevice->bLinkPass = FALSE; pDevice->bLinkPass = FALSE;
} }
if (BITbIsBitOn(pDevice->byGPIO,GPIO0_DATA)) if (pDevice->byGPIO &GPIO0_DATA)
//||(BITbIsBitOff(pDevice->byGPIO,GPIO0_DATA) && BITbIsBitOn(pDevice->byRadioCtl, EEP_RADIOCTL_INV))) //||( !(pDevice->byGPIO & GPIO0_DATA) && (pDevice->byRadioCtl & EEP_RADIOCTL_INV)))
{if(status==2) goto start; {if(status==2) goto start;
status=2; status=2;
CARDbRadioPowerOn(pDevice); CARDbRadioPowerOn(pDevice);
} } } }
else{ else{
if (BITbIsBitOn(pDevice->byGPIO,GPIO0_DATA)) if (pDevice->byGPIO & GPIO0_DATA)
//||(BITbIsBitOff(pDevice->byGPIO,GPIO0_DATA) && BITbIsBitOn(pDevice->byRadioCtl, EEP_RADIOCTL_INV))) //||( !(pDevice->byGPIO & GPIO0_DATA) && (pDevice->byRadioCtl & EEP_RADIOCTL_INV)))
{if(status==3) goto start; {if(status==3) goto start;
status=3; status=3;
CARDbRadioPowerOff(pDevice); CARDbRadioPowerOff(pDevice);
...@@ -1072,8 +1071,8 @@ CARDbRadioPowerOff(pDevice); ...@@ -1072,8 +1071,8 @@ CARDbRadioPowerOff(pDevice);
pDevice->bLinkPass = FALSE; pDevice->bLinkPass = FALSE;
} }
if (BITbIsBitOff(pDevice->byGPIO,GPIO0_DATA)) if ( !(pDevice->byGPIO & GPIO0_DATA))
//||(BITbIsBitOff(pDevice->byGPIO,GPIO0_DATA) && BITbIsBitOn(pDevice->byRadioCtl, EEP_RADIOCTL_INV))) //||( !(pDevice->byGPIO & GPIO0_DATA) && (pDevice->byRadioCtl & EEP_RADIOCTL_INV)))
{if(status==4) goto start; {if(status==4) goto start;
status=4; status=4;
CARDbRadioPowerOn(pDevice); CARDbRadioPowerOn(pDevice);
......
...@@ -47,7 +47,6 @@ ...@@ -47,7 +47,6 @@
#include "tmacro.h" #include "tmacro.h"
#include "card.h" #include "card.h"
#include "tbit.h"
#include "baseband.h" #include "baseband.h"
#include "mac.h" #include "mac.h"
#include "desc.h" #include "desc.h"
...@@ -2374,7 +2373,7 @@ CARDbyAutoChannelSelect( ...@@ -2374,7 +2373,7 @@ CARDbyAutoChannelSelect(
} }
if (sChannelTbl[ii].byMAP == 0) { if (sChannelTbl[ii].byMAP == 0) {
return ((BYTE) ii); return ((BYTE) ii);
} else if (BITbIsBitOff(sChannelTbl[ii].byMAP, 0x08)) { } else if ( !(sChannelTbl[ii].byMAP & 0x08)) {
byOptionChannel = (BYTE) ii; byOptionChannel = (BYTE) ii;
} }
} }
...@@ -2385,7 +2384,7 @@ CARDbyAutoChannelSelect( ...@@ -2385,7 +2384,7 @@ CARDbyAutoChannelSelect(
if (sChannelTbl[ii].bValid == TRUE) { if (sChannelTbl[ii].bValid == TRUE) {
if (sChannelTbl[ii].byMAP == 0) { if (sChannelTbl[ii].byMAP == 0) {
aiWeight[ii] += 100; aiWeight[ii] += 100;
} else if (BITbIsBitOn(sChannelTbl[ii].byMAP, 0x01)) { } else if (sChannelTbl[ii].byMAP & 0x01) {
if (ii > 3) { if (ii > 3) {
aiWeight[ii-3] -= 10; aiWeight[ii-3] -= 10;
} }
...@@ -2973,7 +2972,7 @@ BOOL CARDbGetCurrentTSF (DWORD_PTR dwIoBase, PQWORD pqwCurrTSF) ...@@ -2973,7 +2972,7 @@ BOOL CARDbGetCurrentTSF (DWORD_PTR dwIoBase, PQWORD pqwCurrTSF)
MACvRegBitsOn(dwIoBase, MAC_REG_TFTCTL, TFTCTL_TSFCNTRRD); MACvRegBitsOn(dwIoBase, MAC_REG_TFTCTL, TFTCTL_TSFCNTRRD);
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortB(dwIoBase + MAC_REG_TFTCTL, &byData); VNSvInPortB(dwIoBase + MAC_REG_TFTCTL, &byData);
if (BITbIsBitOff(byData, TFTCTL_TSFCNTRRD)) if ( !(byData & TFTCTL_TSFCNTRRD))
break; break;
} }
if (ww == W_MAX_TIMEOUT) if (ww == W_MAX_TIMEOUT)
......
...@@ -62,7 +62,6 @@ ...@@ -62,7 +62,6 @@
#include "device.h" #include "device.h"
#include "card.h" #include "card.h"
#include "tbit.h"
#include "baseband.h" #include "baseband.h"
#include "mac.h" #include "mac.h"
#include "tether.h" #include "tether.h"
...@@ -789,8 +788,8 @@ else ...@@ -789,8 +788,8 @@ else
MACvGPIOIn(pDevice->PortOffset, &pDevice->byGPIO); MACvGPIOIn(pDevice->PortOffset, &pDevice->byGPIO);
//2008-4-14 <add> by chester for led issue //2008-4-14 <add> by chester for led issue
#ifdef FOR_LED_ON_NOTEBOOK #ifdef FOR_LED_ON_NOTEBOOK
if (BITbIsBitOn(pDevice->byGPIO,GPIO0_DATA)){pDevice->bHWRadioOff = TRUE;} if (pDevice->byGPIO & GPIO0_DATA){pDevice->bHWRadioOff = TRUE;}
if (BITbIsBitOff(pDevice->byGPIO,GPIO0_DATA)){pDevice->bHWRadioOff = FALSE;} if ( !(pDevice->byGPIO & GPIO0_DATA)){pDevice->bHWRadioOff = FALSE;}
} }
if ( (pDevice->bRadioControlOff == TRUE)) { if ( (pDevice->bRadioControlOff == TRUE)) {
...@@ -798,8 +797,8 @@ if (BITbIsBitOff(pDevice->byGPIO,GPIO0_DATA)){pDevice->bHWRadioOff = FALSE;} ...@@ -798,8 +797,8 @@ if (BITbIsBitOff(pDevice->byGPIO,GPIO0_DATA)){pDevice->bHWRadioOff = FALSE;}
} }
else CARDbRadioPowerOn(pDevice); else CARDbRadioPowerOn(pDevice);
#else #else
if ((BITbIsBitOn(pDevice->byGPIO,GPIO0_DATA) && BITbIsBitOff(pDevice->byRadioCtl, EEP_RADIOCTL_INV)) || if (((pDevice->byGPIO & GPIO0_DATA) && !(pDevice->byRadioCtl & EEP_RADIOCTL_INV)) ||
(BITbIsBitOff(pDevice->byGPIO,GPIO0_DATA) && BITbIsBitOn(pDevice->byRadioCtl, EEP_RADIOCTL_INV))) { ( !(pDevice->byGPIO & GPIO0_DATA) && (pDevice->byRadioCtl & EEP_RADIOCTL_INV))) {
pDevice->bHWRadioOff = TRUE; pDevice->bHWRadioOff = TRUE;
} }
} }
...@@ -1703,7 +1702,7 @@ static int device_tx_srv(PSDevice pDevice, UINT uIdx) { ...@@ -1703,7 +1702,7 @@ static int device_tx_srv(PSDevice pDevice, UINT uIdx) {
uFIFOHeaderSize uFIFOHeaderSize
); );
if (BITbIsBitOff(byTsr1, TSR1_TERR)) { if ( !(byTsr1 & TSR1_TERR)) {
if (byTsr0 != 0) { if (byTsr0 != 0) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" Tx[%d] OK but has error. tsr1[%02X] tsr0[%02X].\n", DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" Tx[%d] OK but has error. tsr1[%02X] tsr0[%02X].\n",
(INT)uIdx, byTsr1, byTsr0); (INT)uIdx, byTsr1, byTsr0);
...@@ -1735,7 +1734,7 @@ static int device_tx_srv(PSDevice pDevice, UINT uIdx) { ...@@ -1735,7 +1734,7 @@ static int device_tx_srv(PSDevice pDevice, UINT uIdx) {
} }
} }
if (BITbIsBitOn(byTsr1, TSR1_TERR)) { if (byTsr1 & TSR1_TERR) {
if ((pTD->pTDInfo->byFlags & TD_FLAGS_PRIV_SKB) != 0) { if ((pTD->pTDInfo->byFlags & TD_FLAGS_PRIV_SKB) != 0) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" Tx[%d] fail has error. tsr1[%02X] tsr0[%02X].\n", DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" Tx[%d] fail has error. tsr1[%02X] tsr0[%02X].\n",
(INT)uIdx, byTsr1, byTsr0); (INT)uIdx, byTsr1, byTsr0);
...@@ -2691,7 +2690,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) { ...@@ -2691,7 +2690,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) {
/* /*
// 2008-05-21 <mark> by Richardtai, we can't read RSSI here, because no packet bound with RSSI // 2008-05-21 <mark> by Richardtai, we can't read RSSI here, because no packet bound with RSSI
if ((BITbIsBitOn(pDevice->dwIsr, ISR_RXDMA0)) && if ((pDevice->dwIsr & ISR_RXDMA0) &&
(pDevice->byLocalID != REV_ID_VT3253_B0) && (pDevice->byLocalID != REV_ID_VT3253_B0) &&
(pDevice->bBSSIDFilter == TRUE)) { (pDevice->bBSSIDFilter == TRUE)) {
// update RSSI // update RSSI
...@@ -2732,7 +2731,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) { ...@@ -2732,7 +2731,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) {
if (pDevice->byLocalID > REV_ID_VT3253_B1) { if (pDevice->byLocalID > REV_ID_VT3253_B1) {
if (BITbIsBitOn(pDevice->dwIsr, ISR_MEASURESTART)) { if (pDevice->dwIsr & ISR_MEASURESTART) {
// 802.11h measure start // 802.11h measure start
pDevice->byOrgChannel = pDevice->byCurrentCh; pDevice->byOrgChannel = pDevice->byCurrentCh;
VNSvInPortB(pDevice->PortOffset + MAC_REG_RCR, &(pDevice->byOrgRCR)); VNSvInPortB(pDevice->PortOffset + MAC_REG_RCR, &(pDevice->byOrgRCR));
...@@ -2764,7 +2763,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) { ...@@ -2764,7 +2763,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) {
MACvSelectPage0(pDevice->PortOffset); MACvSelectPage0(pDevice->PortOffset);
} }
} }
if (BITbIsBitOn(pDevice->dwIsr, ISR_MEASUREEND)) { if (pDevice->dwIsr & ISR_MEASUREEND) {
// 802.11h measure end // 802.11h measure end
pDevice->bMeasureInProgress = FALSE; pDevice->bMeasureInProgress = FALSE;
VNSvOutPortB(pDevice->PortOffset + MAC_REG_RCR, pDevice->byOrgRCR); VNSvOutPortB(pDevice->PortOffset + MAC_REG_RCR, pDevice->byOrgRCR);
...@@ -2783,7 +2782,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) { ...@@ -2783,7 +2782,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) {
MACvSelectPage1(pDevice->PortOffset); MACvSelectPage1(pDevice->PortOffset);
MACvRegBitsOn(pDevice->PortOffset, MAC_REG_MSRCTL+1, MSRCTL1_TXPAUSE); MACvRegBitsOn(pDevice->PortOffset, MAC_REG_MSRCTL+1, MSRCTL1_TXPAUSE);
MACvSelectPage0(pDevice->PortOffset); MACvSelectPage0(pDevice->PortOffset);
if (BITbIsBitOn(byData, MSRCTL_FINISH)) { if (byData & MSRCTL_FINISH) {
// measure success // measure success
s_vCompleteCurrentMeasure(pDevice, 0); s_vCompleteCurrentMeasure(pDevice, 0);
} else { } else {
...@@ -2791,7 +2790,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) { ...@@ -2791,7 +2790,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) {
s_vCompleteCurrentMeasure(pDevice, MEASURE_MODE_LATE); s_vCompleteCurrentMeasure(pDevice, MEASURE_MODE_LATE);
} }
} }
if (BITbIsBitOn(pDevice->dwIsr, ISR_QUIETSTART)) { if (pDevice->dwIsr & ISR_QUIETSTART) {
do { do {
; ;
} while (CARDbStartQuiet(pDevice) == FALSE); } while (CARDbStartQuiet(pDevice) == FALSE);
......
...@@ -50,7 +50,6 @@ ...@@ -50,7 +50,6 @@
#include "tcrc.h" #include "tcrc.h"
#include "wctl.h" #include "wctl.h"
#include "wroute.h" #include "wroute.h"
#include "tbit.h"
#include "hostap.h" #include "hostap.h"
#include "rf.h" #include "rf.h"
#include "iowpa.h" #include "iowpa.h"
...@@ -441,7 +440,7 @@ device_receive_frame ( ...@@ -441,7 +440,7 @@ device_receive_frame (
dwDuration = (FrameSize << 4); dwDuration = (FrameSize << 4);
dwDuration /= acbyRxRate[*pbyRxRate%MAX_RATE]; dwDuration /= acbyRxRate[*pbyRxRate%MAX_RATE];
if (*pbyRxRate <= RATE_11M) { if (*pbyRxRate <= RATE_11M) {
if (BITbIsBitOn(*pbyRxSts, 0x01)) { if (*pbyRxSts & 0x01) {
// long preamble // long preamble
dwDuration += 192; dwDuration += 192;
} else { } else {
...@@ -572,7 +571,7 @@ device_receive_frame ( ...@@ -572,7 +571,7 @@ device_receive_frame (
//remove the CRC length //remove the CRC length
FrameSize -= U_CRC_LEN; FrameSize -= U_CRC_LEN;
if ((BITbIsAllBitsOff(*pbyRsr, (RSR_ADDRBROAD | RSR_ADDRMULTI))) && // unicast address if (( !(*pbyRsr & (RSR_ADDRBROAD | RSR_ADDRMULTI))) && // unicast address
(IS_FRAGMENT_PKT((skb->data+4))) (IS_FRAGMENT_PKT((skb->data+4)))
) { ) {
// defragment // defragment
...@@ -661,7 +660,7 @@ device_receive_frame ( ...@@ -661,7 +660,7 @@ device_receive_frame (
else { else {
if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) { if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) {
//In AP mode, hw only check addr1(BSSID or RA) if equal to local MAC. //In AP mode, hw only check addr1(BSSID or RA) if equal to local MAC.
if (BITbIsBitOff(*pbyRsr, RSR_BSSIDOK)) { if ( !(*pbyRsr & RSR_BSSIDOK)) {
if (bDeFragRx) { if (bDeFragRx) {
if (!device_alloc_frag_buf(pDevice, &pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx])) { if (!device_alloc_frag_buf(pDevice, &pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx])) {
DBG_PRT(MSG_LEVEL_ERR,KERN_ERR "%s: can not alloc more frag bufs\n", DBG_PRT(MSG_LEVEL_ERR,KERN_ERR "%s: can not alloc more frag bufs\n",
...@@ -674,7 +673,7 @@ device_receive_frame ( ...@@ -674,7 +673,7 @@ device_receive_frame (
else { else {
// discard DATA packet while not associate || BSSID error // discard DATA packet while not associate || BSSID error
if ((pDevice->bLinkPass == FALSE) || if ((pDevice->bLinkPass == FALSE) ||
BITbIsBitOff(*pbyRsr, RSR_BSSIDOK)) { !(*pbyRsr & RSR_BSSIDOK)) {
if (bDeFragRx) { if (bDeFragRx) {
if (!device_alloc_frag_buf(pDevice, &pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx])) { if (!device_alloc_frag_buf(pDevice, &pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx])) {
DBG_PRT(MSG_LEVEL_ERR,KERN_ERR "%s: can not alloc more frag bufs\n", DBG_PRT(MSG_LEVEL_ERR,KERN_ERR "%s: can not alloc more frag bufs\n",
...@@ -712,7 +711,7 @@ device_receive_frame ( ...@@ -712,7 +711,7 @@ device_receive_frame (
if (pDevice->bEnablePSMode) { if (pDevice->bEnablePSMode) {
if (IS_FC_MOREDATA((skb->data+4))) { if (IS_FC_MOREDATA((skb->data+4))) {
if (BITbIsBitOn(*pbyRsr, RSR_ADDROK)) { if (*pbyRsr & RSR_ADDROK) {
//PSbSendPSPOLL((PSDevice)pDevice); //PSbSendPSPOLL((PSDevice)pDevice);
} }
} }
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
*/ */
#include "tmacro.h" #include "tmacro.h"
#include "tbit.h"
#include "key.h" #include "key.h"
#include "mac.h" #include "mac.h"
......
This diff is collapsed.
This diff is collapsed.
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
*/ */
#include "tmacro.h" #include "tmacro.h"
#include "tbit.h"
#include "michael.h" #include "michael.h"
/*--------------------- Static Definitions -------------------------*/ /*--------------------- Static Definitions -------------------------*/
......
...@@ -38,13 +38,11 @@ ...@@ -38,13 +38,11 @@
*/ */
#include "ttype.h" #include "ttype.h"
#include "tbit.h"
#include "mac.h" #include "mac.h"
#include "device.h" #include "device.h"
#include "wmgr.h" #include "wmgr.h"
#include "power.h" #include "power.h"
#include "wcmd.h" #include "wcmd.h"
#include "tbit.h"
#include "rxtx.h" #include "rxtx.h"
#include "card.h" #include "card.h"
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include "mac.h" #include "mac.h"
#include "srom.h" #include "srom.h"
#include "tbit.h"
#include "rf.h" #include "rf.h"
#include "baseband.h" #include "baseband.h"
...@@ -633,7 +632,7 @@ BOOL IFRFbWriteEmbeded (DWORD_PTR dwIoBase, DWORD dwData) ...@@ -633,7 +632,7 @@ BOOL IFRFbWriteEmbeded (DWORD_PTR dwIoBase, DWORD dwData)
// W_MAX_TIMEOUT is the timeout period // W_MAX_TIMEOUT is the timeout period
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortD(dwIoBase + MAC_REG_IFREGCTL, &dwValue); VNSvInPortD(dwIoBase + MAC_REG_IFREGCTL, &dwValue);
if (BITbIsBitOn(dwValue, IFREGCTL_DONE)) if (dwValue & IFREGCTL_DONE)
break; break;
} }
......
...@@ -60,7 +60,6 @@ ...@@ -60,7 +60,6 @@
#include "tcrc.h" #include "tcrc.h"
#include "wctl.h" #include "wctl.h"
#include "wroute.h" #include "wroute.h"
#include "tbit.h"
#include "hostap.h" #include "hostap.h"
#include "rf.h" #include "rf.h"
......
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
#include "upc.h" #include "upc.h"
#include "tmacro.h" #include "tmacro.h"
#include "tbit.h"
#include "tether.h" #include "tether.h"
#include "mac.h" #include "mac.h"
#include "srom.h" #include "srom.h"
...@@ -97,12 +96,12 @@ BYTE SROMbyReadEmbedded(DWORD_PTR dwIoBase, BYTE byContntOffset) ...@@ -97,12 +96,12 @@ BYTE SROMbyReadEmbedded(DWORD_PTR dwIoBase, BYTE byContntOffset)
// wait DONE be set // wait DONE be set
for (wDelay = 0; wDelay < W_MAX_TIMEOUT; wDelay++) { for (wDelay = 0; wDelay < W_MAX_TIMEOUT; wDelay++) {
VNSvInPortB(dwIoBase + MAC_REG_I2MCSR, &byWait); VNSvInPortB(dwIoBase + MAC_REG_I2MCSR, &byWait);
if (BITbIsAnyBitsOn(byWait, (I2MCSR_DONE | I2MCSR_NACK))) if (byWait & (I2MCSR_DONE | I2MCSR_NACK))
break; break;
PCAvDelayByIO(CB_DELAY_LOOP_WAIT); PCAvDelayByIO(CB_DELAY_LOOP_WAIT);
} }
if ((wDelay < W_MAX_TIMEOUT) && if ((wDelay < W_MAX_TIMEOUT) &&
(BITbIsBitOff(byWait, I2MCSR_NACK))) { ( !(byWait & I2MCSR_NACK))) {
break; break;
} }
} }
...@@ -146,13 +145,13 @@ BOOL SROMbWriteEmbedded (DWORD_PTR dwIoBase, BYTE byContntOffset, BYTE byData) ...@@ -146,13 +145,13 @@ BOOL SROMbWriteEmbedded (DWORD_PTR dwIoBase, BYTE byContntOffset, BYTE byData)
// wait DONE be set // wait DONE be set
for (wDelay = 0; wDelay < W_MAX_TIMEOUT; wDelay++) { for (wDelay = 0; wDelay < W_MAX_TIMEOUT; wDelay++) {
VNSvInPortB(dwIoBase + MAC_REG_I2MCSR, &byWait); VNSvInPortB(dwIoBase + MAC_REG_I2MCSR, &byWait);
if (BITbIsAnyBitsOn(byWait, (I2MCSR_DONE | I2MCSR_NACK))) if (byWait & (I2MCSR_DONE | I2MCSR_NACK))
break; break;
PCAvDelayByIO(CB_DELAY_LOOP_WAIT); PCAvDelayByIO(CB_DELAY_LOOP_WAIT);
} }
if ((wDelay < W_MAX_TIMEOUT) && if ((wDelay < W_MAX_TIMEOUT) &&
(BITbIsBitOff(byWait, I2MCSR_NACK))) { ( !(byWait & I2MCSR_NACK))) {
break; break;
} }
} }
...@@ -228,7 +227,7 @@ BOOL SROMbIsRegBitsOn (DWORD_PTR dwIoBase, BYTE byContntOffset, BYTE byTestBits) ...@@ -228,7 +227,7 @@ BOOL SROMbIsRegBitsOn (DWORD_PTR dwIoBase, BYTE byContntOffset, BYTE byTestBits)
BYTE byOrgData; BYTE byOrgData;
byOrgData = SROMbyReadEmbedded(dwIoBase, byContntOffset); byOrgData = SROMbyReadEmbedded(dwIoBase, byContntOffset);
return BITbIsAllBitsOn(byOrgData, byTestBits); return (byOrgData & byTestBits) == byTestBits;
} }
...@@ -251,7 +250,7 @@ BOOL SROMbIsRegBitsOff (DWORD_PTR dwIoBase, BYTE byContntOffset, BYTE byTestBits ...@@ -251,7 +250,7 @@ BOOL SROMbIsRegBitsOff (DWORD_PTR dwIoBase, BYTE byContntOffset, BYTE byTestBits
BYTE byOrgData; BYTE byOrgData;
byOrgData = SROMbyReadEmbedded(dwIoBase, byContntOffset); byOrgData = SROMbyReadEmbedded(dwIoBase, byContntOffset);
return BITbIsAllBitsOff(byOrgData, byTestBits); return !(byOrgData & byTestBits);
} }
...@@ -407,7 +406,7 @@ BOOL SROMbAutoLoad (DWORD_PTR dwIoBase) ...@@ -407,7 +406,7 @@ BOOL SROMbAutoLoad (DWORD_PTR dwIoBase)
for (ii = 0; ii < EEP_MAX_CONTEXT_SIZE; ii++) { for (ii = 0; ii < EEP_MAX_CONTEXT_SIZE; ii++) {
MACvTimer0MicroSDelay(dwIoBase, CB_EEPROM_READBYTE_WAIT); MACvTimer0MicroSDelay(dwIoBase, CB_EEPROM_READBYTE_WAIT);
VNSvInPortB(dwIoBase + MAC_REG_I2MCSR, &byWait); VNSvInPortB(dwIoBase + MAC_REG_I2MCSR, &byWait);
if (BITbIsBitOff(byWait, I2MCSR_AUTOLD)) if ( !(byWait & I2MCSR_AUTOLD))
break; break;
} }
......
/*
* Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*
* File: tbit.h
*
* Purpose: Bit routines
*
* Author: Tevin Chen
*
* Date: May 21, 1996
*
*/
#ifndef __TBIT_H__
#define __TBIT_H__
#include "ttype.h"
/*--------------------- Export Definitions -------------------------*/
/*--------------------- Export Types ------------------------------*/
/*--------------------- Export Macros ------------------------------*/
// test single bit on
#define BITbIsBitOn(tData, tTestBit) \
(((tData) & (tTestBit)) != 0)
// test single bit off
#define BITbIsBitOff(tData, tTestBit) \
(((tData) & (tTestBit)) == 0)
#define BITbIsAllBitsOn(tData, tTestBit) \
(((tData) & (tTestBit)) == (tTestBit))
#define BITbIsAllBitsOff(tData, tTestBit) \
(((tData) & (tTestBit)) == 0)
#define BITbIsAnyBitsOn(tData, tTestBit) \
(((tData) & (tTestBit)) != 0)
#define BITbIsAnyBitsOff(tData, tTestBit) \
(((tData) & (tTestBit)) != (tTestBit))
/*--------------------- Export Classes ----------------------------*/
/*--------------------- Export Variables --------------------------*/
/*--------------------- Export Functions --------------------------*/
#endif // __TBIT_H__
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
* *
*/ */
#include "tbit.h"
#include "tcrc.h" #include "tcrc.h"
/*--------------------- Static Definitions -------------------------*/ /*--------------------- Static Definitions -------------------------*/
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include "device.h" #include "device.h"
#include "tmacro.h" #include "tmacro.h"
#include "tbit.h"
#include "tcrc.h" #include "tcrc.h"
#include "tether.h" #include "tether.h"
...@@ -74,7 +73,7 @@ BYTE ETHbyGetHashIndexByCrc32 (PBYTE pbyMultiAddr) ...@@ -74,7 +73,7 @@ BYTE ETHbyGetHashIndexByCrc32 (PBYTE pbyMultiAddr)
// reverse most bit to least bit // reverse most bit to least bit
for (ii = 0; ii < (sizeof(byTmpHash) * 8); ii++) { for (ii = 0; ii < (sizeof(byTmpHash) * 8); ii++) {
byHash <<= 1; byHash <<= 1;
if (BITbIsBitOn(byTmpHash, 0x01)) if (byTmpHash & 0x01)
byHash |= 1; byHash |= 1;
byTmpHash >>= 1; byTmpHash >>= 1;
} }
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
*/ */
#include "tmacro.h" #include "tmacro.h"
#include "tbit.h"
#include "tkip.h" #include "tkip.h"
/*--------------------- Static Definitions -------------------------*/ /*--------------------- Static Definitions -------------------------*/
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
*/ */
#include "vntwifi.h" #include "vntwifi.h"
#include "tbit.h"
#include "IEEE11h.h" #include "IEEE11h.h"
#include "country.h" #include "country.h"
#include "device.h" #include "device.h"
...@@ -691,7 +690,7 @@ VNTWIFIwGetMaxSupportRate( ...@@ -691,7 +690,7 @@ VNTWIFIwGetMaxSupportRate(
PSMgmtObject pMgmt = (PSMgmtObject) pMgmtObject; PSMgmtObject pMgmt = (PSMgmtObject) pMgmtObject;
for(wRate = RATE_54M; wRate > RATE_1M; wRate--) { for(wRate = RATE_54M; wRate > RATE_1M; wRate--) {
if (BITbIsBitOn(pMgmt->sNodeDBTable[0].wSuppRate, (1<<wRate))) { if (pMgmt->sNodeDBTable[0].wSuppRate & (1<<wRate)) {
return (wRate); return (wRate);
} }
} }
......
...@@ -62,7 +62,6 @@ ...@@ -62,7 +62,6 @@
*/ */
#include "tmacro.h" #include "tmacro.h"
#include "tbit.h"
#include "desc.h" #include "desc.h"
#include "device.h" #include "device.h"
#include "card.h" #include "card.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment