Commit c3504bfd authored by Joe Perches's avatar Joe Perches Committed by Greg Kroah-Hartman

staging:vt6655:mac: Whitespace cleanups

Neatening only.
git diff -w shows no differences.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d82adcab
......@@ -75,7 +75,7 @@
unsigned short TxRate_iwconfig;//2008-5-8 <add> by chester
/*--------------------- Static Definitions -------------------------*/
//static int msglevel =MSG_LEVEL_DEBUG;
static int msglevel =MSG_LEVEL_INFO;
static int msglevel = MSG_LEVEL_INFO;
/*--------------------- Static Classes ----------------------------*/
/*--------------------- Static Variables --------------------------*/
......@@ -103,7 +103,7 @@ static int msglevel =MSG_LEVEL_INFO;
* Return Value: none
*
*/
void MACvReadAllRegs (unsigned long dwIoBase, unsigned char *pbyMacRegs)
void MACvReadAllRegs(unsigned long dwIoBase, unsigned char *pbyMacRegs)
{
int ii;
......@@ -140,7 +140,7 @@ void MACvReadAllRegs (unsigned long dwIoBase, unsigned char *pbyMacRegs)
* Return Value: true if all test bits On; otherwise false
*
*/
bool MACbIsRegBitsOn (unsigned long dwIoBase, unsigned char byRegOfs, unsigned char byTestBits)
bool MACbIsRegBitsOn(unsigned long dwIoBase, unsigned char byRegOfs, unsigned char byTestBits)
{
unsigned char byData;
......@@ -163,7 +163,7 @@ bool MACbIsRegBitsOn (unsigned long dwIoBase, unsigned char byRegOfs, unsigned c
* Return Value: true if all test bits Off; otherwise false
*
*/
bool MACbIsRegBitsOff (unsigned long dwIoBase, unsigned char byRegOfs, unsigned char byTestBits)
bool MACbIsRegBitsOff(unsigned long dwIoBase, unsigned char byRegOfs, unsigned char byTestBits)
{
unsigned char byData;
......@@ -184,7 +184,7 @@ bool MACbIsRegBitsOff (unsigned long dwIoBase, unsigned char byRegOfs, unsigned
* Return Value: true if interrupt is disable; otherwise false
*
*/
bool MACbIsIntDisable (unsigned long dwIoBase)
bool MACbIsIntDisable(unsigned long dwIoBase)
{
unsigned long dwData;
......@@ -209,7 +209,7 @@ bool MACbIsIntDisable (unsigned long dwIoBase)
* Return Value: Mask Value read
*
*/
unsigned char MACbyReadMultiAddr (unsigned long dwIoBase, unsigned int uByteIdx)
unsigned char MACbyReadMultiAddr(unsigned long dwIoBase, unsigned int uByteIdx)
{
unsigned char byData;
......@@ -234,7 +234,7 @@ unsigned char MACbyReadMultiAddr (unsigned long dwIoBase, unsigned int uByteIdx)
* Return Value: none
*
*/
void MACvWriteMultiAddr (unsigned long dwIoBase, unsigned int uByteIdx, unsigned char byData)
void MACvWriteMultiAddr(unsigned long dwIoBase, unsigned int uByteIdx, unsigned char byData)
{
MACvSelectPage1(dwIoBase);
VNSvOutPortB(dwIoBase + MAC_REG_MAR0 + uByteIdx, byData);
......@@ -255,7 +255,7 @@ void MACvWriteMultiAddr (unsigned long dwIoBase, unsigned int uByteIdx, unsigned
* Return Value: none
*
*/
void MACvSetMultiAddrByHash (unsigned long dwIoBase, unsigned char byHashIdx)
void MACvSetMultiAddrByHash(unsigned long dwIoBase, unsigned char byHashIdx)
{
unsigned int uByteIdx;
unsigned char byBitMask;
......@@ -286,7 +286,7 @@ void MACvSetMultiAddrByHash (unsigned long dwIoBase, unsigned char byHashIdx)
* Return Value: none
*
*/
void MACvResetMultiAddrByHash (unsigned long dwIoBase, unsigned char byHashIdx)
void MACvResetMultiAddrByHash(unsigned long dwIoBase, unsigned char byHashIdx)
{
unsigned int uByteIdx;
unsigned char byBitMask;
......@@ -317,7 +317,7 @@ void MACvResetMultiAddrByHash (unsigned long dwIoBase, unsigned char byHashIdx)
* Return Value: none
*
*/
void MACvSetRxThreshold (unsigned long dwIoBase, unsigned char byThreshold)
void MACvSetRxThreshold(unsigned long dwIoBase, unsigned char byThreshold)
{
unsigned char byOrgValue;
......@@ -342,7 +342,7 @@ void MACvSetRxThreshold (unsigned long dwIoBase, unsigned char byThreshold)
* Return Value: none
*
*/
void MACvGetRxThreshold (unsigned long dwIoBase, unsigned char *pbyThreshold)
void MACvGetRxThreshold(unsigned long dwIoBase, unsigned char *pbyThreshold)
{
// get FCR0
VNSvInPortB(dwIoBase + MAC_REG_FCR0, pbyThreshold);
......@@ -363,7 +363,7 @@ void MACvGetRxThreshold (unsigned long dwIoBase, unsigned char *pbyThreshold)
* Return Value: none
*
*/
void MACvSetTxThreshold (unsigned long dwIoBase, unsigned char byThreshold)
void MACvSetTxThreshold(unsigned long dwIoBase, unsigned char byThreshold)
{
unsigned char byOrgValue;
......@@ -388,7 +388,7 @@ void MACvSetTxThreshold (unsigned long dwIoBase, unsigned char byThreshold)
* Return Value: none
*
*/
void MACvGetTxThreshold (unsigned long dwIoBase, unsigned char *pbyThreshold)
void MACvGetTxThreshold(unsigned long dwIoBase, unsigned char *pbyThreshold)
{
// get FCR0
VNSvInPortB(dwIoBase + MAC_REG_FCR0, pbyThreshold);
......@@ -409,7 +409,7 @@ void MACvGetTxThreshold (unsigned long dwIoBase, unsigned char *pbyThreshold)
* Return Value: none
*
*/
void MACvSetDmaLength (unsigned long dwIoBase, unsigned char byDmaLength)
void MACvSetDmaLength(unsigned long dwIoBase, unsigned char byDmaLength)
{
unsigned char byOrgValue;
......@@ -434,7 +434,7 @@ void MACvSetDmaLength (unsigned long dwIoBase, unsigned char byDmaLength)
* Return Value: none
*
*/
void MACvGetDmaLength (unsigned long dwIoBase, unsigned char *pbyDmaLength)
void MACvGetDmaLength(unsigned long dwIoBase, unsigned char *pbyDmaLength)
{
// get FCR0
VNSvInPortB(dwIoBase + MAC_REG_FCR0, pbyDmaLength);
......@@ -455,7 +455,7 @@ void MACvGetDmaLength (unsigned long dwIoBase, unsigned char *pbyDmaLength)
* Return Value: none
*
*/
void MACvSetShortRetryLimit (unsigned long dwIoBase, unsigned char byRetryLimit)
void MACvSetShortRetryLimit(unsigned long dwIoBase, unsigned char byRetryLimit)
{
// set SRT
VNSvOutPortB(dwIoBase + MAC_REG_SRT, byRetryLimit);
......@@ -474,7 +474,7 @@ void MACvSetShortRetryLimit (unsigned long dwIoBase, unsigned char byRetryLimit)
* Return Value: none
*
*/
void MACvGetShortRetryLimit (unsigned long dwIoBase, unsigned char *pbyRetryLimit)
void MACvGetShortRetryLimit(unsigned long dwIoBase, unsigned char *pbyRetryLimit)
{
// get SRT
VNSvInPortB(dwIoBase + MAC_REG_SRT, pbyRetryLimit);
......@@ -494,7 +494,7 @@ void MACvGetShortRetryLimit (unsigned long dwIoBase, unsigned char *pbyRetryLimi
* Return Value: none
*
*/
void MACvSetLongRetryLimit (unsigned long dwIoBase, unsigned char byRetryLimit)
void MACvSetLongRetryLimit(unsigned long dwIoBase, unsigned char byRetryLimit)
{
// set LRT
VNSvOutPortB(dwIoBase + MAC_REG_LRT, byRetryLimit);
......@@ -513,7 +513,7 @@ void MACvSetLongRetryLimit (unsigned long dwIoBase, unsigned char byRetryLimit)
* Return Value: none
*
*/
void MACvGetLongRetryLimit (unsigned long dwIoBase, unsigned char *pbyRetryLimit)
void MACvGetLongRetryLimit(unsigned long dwIoBase, unsigned char *pbyRetryLimit)
{
// get LRT
VNSvInPortB(dwIoBase + MAC_REG_LRT, pbyRetryLimit);
......@@ -533,7 +533,7 @@ void MACvGetLongRetryLimit (unsigned long dwIoBase, unsigned char *pbyRetryLimit
* Return Value: none
*
*/
void MACvSetLoopbackMode (unsigned long dwIoBase, unsigned char byLoopbackMode)
void MACvSetLoopbackMode(unsigned long dwIoBase, unsigned char byLoopbackMode)
{
unsigned char byOrgValue;
......@@ -559,7 +559,7 @@ void MACvSetLoopbackMode (unsigned long dwIoBase, unsigned char byLoopbackMode)
* Return Value: true if in Loopback mode; otherwise false
*
*/
bool MACbIsInLoopbackMode (unsigned long dwIoBase)
bool MACbIsInLoopbackMode(unsigned long dwIoBase)
{
unsigned char byOrgValue;
......@@ -583,7 +583,7 @@ bool MACbIsInLoopbackMode (unsigned long dwIoBase)
* Return Value: none
*
*/
void MACvSetPacketFilter (unsigned long dwIoBase, unsigned short wFilterType)
void MACvSetPacketFilter(unsigned long dwIoBase, unsigned short wFilterType)
{
unsigned char byOldRCR;
unsigned char byNewRCR = 0;
......@@ -643,7 +643,7 @@ void MACvSetPacketFilter (unsigned long dwIoBase, unsigned short wFilterType)
* Return Value: none
*
*/
void MACvSaveContext (unsigned long dwIoBase, unsigned char *pbyCxtBuf)
void MACvSaveContext(unsigned long dwIoBase, unsigned char *pbyCxtBuf)
{
int ii;
......@@ -676,7 +676,7 @@ void MACvSaveContext (unsigned long dwIoBase, unsigned char *pbyCxtBuf)
* Return Value: none
*
*/
void MACvRestoreContext (unsigned long dwIoBase, unsigned char *pbyCxtBuf)
void MACvRestoreContext(unsigned long dwIoBase, unsigned char *pbyCxtBuf)
{
int ii;
......@@ -728,7 +728,7 @@ void MACvRestoreContext (unsigned long dwIoBase, unsigned char *pbyCxtBuf)
* Return Value: true if all values are the same; otherwise false
*
*/
bool MACbCompareContext (unsigned long dwIoBase, unsigned char *pbyCxtBuf)
bool MACbCompareContext(unsigned long dwIoBase, unsigned char *pbyCxtBuf)
{
unsigned long dwData;
......@@ -773,18 +773,18 @@ bool MACbCompareContext (unsigned long dwIoBase, unsigned char *pbyCxtBuf)
* Return Value: true if Reset Success; otherwise false
*
*/
bool MACbSoftwareReset (unsigned long dwIoBase)
bool MACbSoftwareReset(unsigned long dwIoBase)
{
unsigned char byData;
unsigned short ww;
// turn on HOSTCR_SOFTRST, just write 0x01 to reset
//MACvRegBitsOn(dwIoBase, MAC_REG_HOSTCR, HOSTCR_SOFTRST);
VNSvOutPortB(dwIoBase+ MAC_REG_HOSTCR, 0x01);
VNSvOutPortB(dwIoBase + MAC_REG_HOSTCR, 0x01);
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortB(dwIoBase + MAC_REG_HOSTCR, &byData);
if ( !(byData & HOSTCR_SOFTRST))
if (!(byData & HOSTCR_SOFTRST))
break;
}
if (ww == W_MAX_TIMEOUT)
......@@ -806,7 +806,7 @@ bool MACbSoftwareReset (unsigned long dwIoBase)
* Return Value: true if success; otherwise false
*
*/
bool MACbSafeSoftwareReset (unsigned long dwIoBase)
bool MACbSafeSoftwareReset(unsigned long dwIoBase)
{
unsigned char abyTmpRegData[MAC_MAX_CONTEXT_SIZE_PAGE0+MAC_MAX_CONTEXT_SIZE_PAGE1];
bool bRetVal;
......@@ -839,7 +839,7 @@ bool MACbSafeSoftwareReset (unsigned long dwIoBase)
* Return Value: true if success; otherwise false
*
*/
bool MACbSafeRxOff (unsigned long dwIoBase)
bool MACbSafeRxOff(unsigned long dwIoBase)
{
unsigned short ww;
unsigned long dwData;
......@@ -857,17 +857,17 @@ bool MACbSafeRxOff (unsigned long dwIoBase)
}
if (ww == W_MAX_TIMEOUT) {
DBG_PORT80(0x10);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" DBG_PORT80(0x10)\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " DBG_PORT80(0x10)\n");
return(false);
}
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortD(dwIoBase + MAC_REG_RXDMACTL1, &dwData);
if ( !(dwData & DMACTL_RUN))
if (!(dwData & DMACTL_RUN))
break;
}
if (ww == W_MAX_TIMEOUT) {
DBG_PORT80(0x11);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" DBG_PORT80(0x11)\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " DBG_PORT80(0x11)\n");
return(false);
}
......@@ -876,12 +876,12 @@ bool MACbSafeRxOff (unsigned long dwIoBase)
// W_MAX_TIMEOUT is the timeout period
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortB(dwIoBase + MAC_REG_HOSTCR, &byData);
if ( !(byData & HOSTCR_RXONST))
if (!(byData & HOSTCR_RXONST))
break;
}
if (ww == W_MAX_TIMEOUT) {
DBG_PORT80(0x12);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" DBG_PORT80(0x12)\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " DBG_PORT80(0x12)\n");
return(false);
}
return true;
......@@ -900,7 +900,7 @@ bool MACbSafeRxOff (unsigned long dwIoBase)
* Return Value: true if success; otherwise false
*
*/
bool MACbSafeTxOff (unsigned long dwIoBase)
bool MACbSafeTxOff(unsigned long dwIoBase)
{
unsigned short ww;
unsigned long dwData;
......@@ -915,22 +915,22 @@ bool MACbSafeTxOff (unsigned long dwIoBase)
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortD(dwIoBase + MAC_REG_TXDMACTL0, &dwData);
if ( !(dwData & DMACTL_RUN))
if (!(dwData & DMACTL_RUN))
break;
}
if (ww == W_MAX_TIMEOUT) {
DBG_PORT80(0x20);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" DBG_PORT80(0x20)\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " DBG_PORT80(0x20)\n");
return(false);
}
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortD(dwIoBase + MAC_REG_AC0DMACTL, &dwData);
if ( !(dwData & DMACTL_RUN))
if (!(dwData & DMACTL_RUN))
break;
}
if (ww == W_MAX_TIMEOUT) {
DBG_PORT80(0x21);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" DBG_PORT80(0x21)\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " DBG_PORT80(0x21)\n");
return(false);
}
......@@ -940,12 +940,12 @@ bool MACbSafeTxOff (unsigned long dwIoBase)
// W_MAX_TIMEOUT is the timeout period
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortB(dwIoBase + MAC_REG_HOSTCR, &byData);
if ( !(byData & HOSTCR_TXONST))
if (!(byData & HOSTCR_TXONST))
break;
}
if (ww == W_MAX_TIMEOUT) {
DBG_PORT80(0x24);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" DBG_PORT80(0x24)\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " DBG_PORT80(0x24)\n");
return(false);
}
return true;
......@@ -964,19 +964,19 @@ bool MACbSafeTxOff (unsigned long dwIoBase)
* Return Value: true if success; otherwise false
*
*/
bool MACbSafeStop (unsigned long dwIoBase)
bool MACbSafeStop(unsigned long dwIoBase)
{
MACvRegBitsOff(dwIoBase, MAC_REG_TCR, TCR_AUTOBCNTX);
if (MACbSafeRxOff(dwIoBase) == false) {
DBG_PORT80(0xA1);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" MACbSafeRxOff == false)\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " MACbSafeRxOff == false)\n");
MACbSafeSoftwareReset(dwIoBase);
return false;
}
if (MACbSafeTxOff(dwIoBase) == false) {
DBG_PORT80(0xA2);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" MACbSafeTxOff == false)\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " MACbSafeTxOff == false)\n");
MACbSafeSoftwareReset(dwIoBase);
return false;
}
......@@ -999,7 +999,7 @@ bool MACbSafeStop (unsigned long dwIoBase)
* Return Value: true if success; otherwise false
*
*/
bool MACbShutdown (unsigned long dwIoBase)
bool MACbShutdown(unsigned long dwIoBase)
{
// disable MAC IMR
MACvIntDisable(dwIoBase);
......@@ -1026,7 +1026,7 @@ bool MACbShutdown (unsigned long dwIoBase)
* Return Value: none
*
*/
void MACvInitialize (unsigned long dwIoBase)
void MACvInitialize(unsigned long dwIoBase)
{
// clear sticky bits
MACvClearStckDS(dwIoBase);
......@@ -1048,7 +1048,7 @@ void MACvInitialize (unsigned long dwIoBase)
//while (true) {
// u8 u8Data;
// VNSvInPortB(dwIoBase + MAC_REG_I2MCSR, &u8Data);
// if ( !(u8Data & I2MCSR_AUTOLD))
// if (!(u8Data & I2MCSR_AUTOLD))
// break;
//}
......@@ -1079,11 +1079,11 @@ void MACvInitialize (unsigned long dwIoBase)
* Return Value: none
*
*/
void MACvSetCurrRx0DescAddr (unsigned long dwIoBase, unsigned long dwCurrDescAddr)
void MACvSetCurrRx0DescAddr(unsigned long dwIoBase, unsigned long dwCurrDescAddr)
{
unsigned short ww;
unsigned char byData;
unsigned char byOrgDMACtl;
unsigned short ww;
unsigned char byData;
unsigned char byOrgDMACtl;
VNSvInPortB(dwIoBase + MAC_REG_RXDMACTL0, &byOrgDMACtl);
if (byOrgDMACtl & DMACTL_RUN) {
......@@ -1091,7 +1091,7 @@ unsigned char byOrgDMACtl;
}
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortB(dwIoBase + MAC_REG_RXDMACTL0, &byData);
if ( !(byData & DMACTL_RUN))
if (!(byData & DMACTL_RUN))
break;
}
if (ww == W_MAX_TIMEOUT) {
......@@ -1117,11 +1117,11 @@ unsigned char byOrgDMACtl;
* Return Value: none
*
*/
void MACvSetCurrRx1DescAddr (unsigned long dwIoBase, unsigned long dwCurrDescAddr)
void MACvSetCurrRx1DescAddr(unsigned long dwIoBase, unsigned long dwCurrDescAddr)
{
unsigned short ww;
unsigned char byData;
unsigned char byOrgDMACtl;
unsigned short ww;
unsigned char byData;
unsigned char byOrgDMACtl;
VNSvInPortB(dwIoBase + MAC_REG_RXDMACTL1, &byOrgDMACtl);
if (byOrgDMACtl & DMACTL_RUN) {
......@@ -1129,7 +1129,7 @@ unsigned char byOrgDMACtl;
}
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortB(dwIoBase + MAC_REG_RXDMACTL1, &byData);
if ( !(byData & DMACTL_RUN))
if (!(byData & DMACTL_RUN))
break;
}
if (ww == W_MAX_TIMEOUT) {
......@@ -1155,11 +1155,11 @@ unsigned char byOrgDMACtl;
* Return Value: none
*
*/
void MACvSetCurrTx0DescAddrEx (unsigned long dwIoBase, unsigned long dwCurrDescAddr)
void MACvSetCurrTx0DescAddrEx(unsigned long dwIoBase, unsigned long dwCurrDescAddr)
{
unsigned short ww;
unsigned char byData;
unsigned char byOrgDMACtl;
unsigned short ww;
unsigned char byData;
unsigned char byOrgDMACtl;
VNSvInPortB(dwIoBase + MAC_REG_TXDMACTL0, &byOrgDMACtl);
if (byOrgDMACtl & DMACTL_RUN) {
......@@ -1167,7 +1167,7 @@ unsigned char byOrgDMACtl;
}
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortB(dwIoBase + MAC_REG_TXDMACTL0, &byData);
if ( !(byData & DMACTL_RUN))
if (!(byData & DMACTL_RUN))
break;
}
if (ww == W_MAX_TIMEOUT) {
......@@ -1193,12 +1193,12 @@ unsigned char byOrgDMACtl;
* Return Value: none
*
*/
//TxDMA1 = AC0DMA
void MACvSetCurrAC0DescAddrEx (unsigned long dwIoBase, unsigned long dwCurrDescAddr)
//TxDMA1 = AC0DMA
void MACvSetCurrAC0DescAddrEx(unsigned long dwIoBase, unsigned long dwCurrDescAddr)
{
unsigned short ww;
unsigned char byData;
unsigned char byOrgDMACtl;
unsigned short ww;
unsigned char byData;
unsigned char byOrgDMACtl;
VNSvInPortB(dwIoBase + MAC_REG_AC0DMACTL, &byOrgDMACtl);
if (byOrgDMACtl & DMACTL_RUN) {
......@@ -1211,7 +1211,7 @@ unsigned char byOrgDMACtl;
}
if (ww == W_MAX_TIMEOUT) {
DBG_PORT80(0x26);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" DBG_PORT80(0x26)\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " DBG_PORT80(0x26)\n");
}
VNSvOutPortD(dwIoBase + MAC_REG_AC0DMAPTR, dwCurrDescAddr);
if (byOrgDMACtl & DMACTL_RUN) {
......@@ -1221,11 +1221,11 @@ unsigned char byOrgDMACtl;
void MACvSetCurrTXDescAddr (int iTxType, unsigned long dwIoBase, unsigned long dwCurrDescAddr)
void MACvSetCurrTXDescAddr(int iTxType, unsigned long dwIoBase, unsigned long dwCurrDescAddr)
{
if(iTxType == TYPE_AC0DMA){
if (iTxType == TYPE_AC0DMA) {
MACvSetCurrAC0DescAddrEx(dwIoBase, dwCurrDescAddr);
}else if(iTxType == TYPE_TXDMA0){
} else if (iTxType == TYPE_TXDMA0) {
MACvSetCurrTx0DescAddrEx(dwIoBase, dwCurrDescAddr);
}
}
......@@ -1244,15 +1244,15 @@ void MACvSetCurrTXDescAddr (int iTxType, unsigned long dwIoBase, unsigned long d
* Return Value: none
*
*/
void MACvTimer0MicroSDelay (unsigned long dwIoBase, unsigned int uDelay)
void MACvTimer0MicroSDelay(unsigned long dwIoBase, unsigned int uDelay)
{
unsigned char byValue;
unsigned int uu,ii;
unsigned char byValue;
unsigned int uu, ii;
VNSvOutPortB(dwIoBase + MAC_REG_TMCTL0, 0);
VNSvOutPortD(dwIoBase + MAC_REG_TMDATA0, uDelay);
VNSvOutPortB(dwIoBase + MAC_REG_TMCTL0, (TMCTL_TMD | TMCTL_TE));
for(ii=0;ii<66;ii++) { // assume max PCI clock is 66Mhz
for (ii = 0; ii < 66; ii++) { // assume max PCI clock is 66Mhz
for (uu = 0; uu < uDelay; uu++) {
VNSvInPortB(dwIoBase + MAC_REG_TMCTL0, &byValue);
if ((byValue == 0) ||
......@@ -1280,7 +1280,7 @@ unsigned int uu,ii;
* Return Value: none
*
*/
void MACvOneShotTimer0MicroSec (unsigned long dwIoBase, unsigned int uDelayTime)
void MACvOneShotTimer0MicroSec(unsigned long dwIoBase, unsigned int uDelayTime)
{
VNSvOutPortB(dwIoBase + MAC_REG_TMCTL0, 0);
VNSvOutPortD(dwIoBase + MAC_REG_TMDATA0, uDelayTime);
......@@ -1301,7 +1301,7 @@ void MACvOneShotTimer0MicroSec (unsigned long dwIoBase, unsigned int uDelayTime)
* Return Value: none
*
*/
void MACvOneShotTimer1MicroSec (unsigned long dwIoBase, unsigned int uDelayTime)
void MACvOneShotTimer1MicroSec(unsigned long dwIoBase, unsigned int uDelayTime)
{
VNSvOutPortB(dwIoBase + MAC_REG_TMCTL1, 0);
VNSvOutPortD(dwIoBase + MAC_REG_TMDATA1, uDelayTime);
......@@ -1309,7 +1309,7 @@ void MACvOneShotTimer1MicroSec (unsigned long dwIoBase, unsigned int uDelayTime)
}
void MACvSetMISCFifo (unsigned long dwIoBase, unsigned short wOffset, unsigned long dwData)
void MACvSetMISCFifo(unsigned long dwIoBase, unsigned short wOffset, unsigned long dwData)
{
if (wOffset > 273)
return;
......@@ -1319,57 +1319,57 @@ void MACvSetMISCFifo (unsigned long dwIoBase, unsigned short wOffset, unsigned l
}
bool MACbTxDMAOff (unsigned long dwIoBase, unsigned int idx)
bool MACbTxDMAOff(unsigned long dwIoBase, unsigned int idx)
{
unsigned char byData;
unsigned int ww = 0;
unsigned char byData;
unsigned int ww = 0;
if (idx == TYPE_TXDMA0) {
VNSvOutPortB(dwIoBase + MAC_REG_TXDMACTL0+2, DMACTL_RUN);
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortB(dwIoBase + MAC_REG_TXDMACTL0, &byData);
if ( !(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 ( !(byData & DMACTL_RUN))
if (!(byData & DMACTL_RUN))
break;
}
}
if (ww == W_MAX_TIMEOUT) {
DBG_PORT80(0x29);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" DBG_PORT80(0x29)\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " DBG_PORT80(0x29)\n");
return false;
}
return true;
}
void MACvClearBusSusInd (unsigned long dwIoBase)
void MACvClearBusSusInd(unsigned long dwIoBase)
{
unsigned long dwOrgValue;
unsigned int ww;
// check if BcnSusInd enabled
VNSvInPortD(dwIoBase + MAC_REG_ENCFG , &dwOrgValue);
if( !(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( !(dwOrgValue & EnCFG_BcnSusInd))
if (!(dwOrgValue & EnCFG_BcnSusInd))
break;
}
if (ww == W_MAX_TIMEOUT) {
DBG_PORT80(0x33);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" DBG_PORT80(0x33)\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " DBG_PORT80(0x33)\n");
}
}
void MACvEnableBusSusEn (unsigned long dwIoBase)
void MACvEnableBusSusEn(unsigned long dwIoBase)
{
unsigned char byOrgValue;
unsigned long dwOrgValue;
......@@ -1382,16 +1382,16 @@ void MACvEnableBusSusEn (unsigned long dwIoBase)
VNSvOutPortB(dwIoBase + MAC_REG_ENCFG, byOrgValue);
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortD(dwIoBase + MAC_REG_ENCFG , &dwOrgValue);
if(dwOrgValue & EnCFG_BcnSusInd)
if (dwOrgValue & EnCFG_BcnSusInd)
break;
}
if (ww == W_MAX_TIMEOUT) {
DBG_PORT80(0x34);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" DBG_PORT80(0x34)\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " DBG_PORT80(0x34)\n");
}
}
bool MACbFlushSYNCFifo (unsigned long dwIoBase)
bool MACbFlushSYNCFifo(unsigned long dwIoBase)
{
unsigned char byOrgValue;
unsigned int ww;
......@@ -1405,17 +1405,17 @@ bool MACbFlushSYNCFifo (unsigned long dwIoBase)
// Check if SyncFlushOK
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortB(dwIoBase + MAC_REG_MACCR , &byOrgValue);
if(byOrgValue & MACCR_SYNCFLUSHOK)
if (byOrgValue & MACCR_SYNCFLUSHOK)
break;
}
if (ww == W_MAX_TIMEOUT) {
DBG_PORT80(0x35);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" DBG_PORT80(0x33)\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " DBG_PORT80(0x33)\n");
}
return true;
}
bool MACbPSWakeup (unsigned long dwIoBase)
bool MACbPSWakeup(unsigned long dwIoBase)
{
unsigned char byOrgValue;
unsigned int ww;
......@@ -1429,12 +1429,12 @@ bool MACbPSWakeup (unsigned long dwIoBase)
// Check if SyncFlushOK
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortB(dwIoBase + MAC_REG_PSCTL , &byOrgValue);
if(byOrgValue & PSCTL_WAKEDONE)
if (byOrgValue & PSCTL_WAKEDONE)
break;
}
if (ww == W_MAX_TIMEOUT) {
DBG_PORT80(0x36);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" DBG_PORT80(0x33)\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " DBG_PORT80(0x33)\n");
return false;
}
return true;
......@@ -1455,18 +1455,18 @@ bool MACbPSWakeup (unsigned long dwIoBase)
*
*/
void MACvSetKeyEntry (unsigned long dwIoBase, unsigned short wKeyCtl, unsigned int uEntryIdx,
void MACvSetKeyEntry(unsigned long dwIoBase, unsigned short wKeyCtl, unsigned int uEntryIdx,
unsigned int uKeyIdx, unsigned char *pbyAddr, unsigned long *pdwKey, unsigned char byLocalID)
{
unsigned short wOffset;
unsigned long dwData;
int ii;
unsigned short wOffset;
unsigned long dwData;
int ii;
if (byLocalID <= 1)
return;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"MACvSetKeyEntry\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "MACvSetKeyEntry\n");
wOffset = MISCFIFO_KEYETRY0;
wOffset += (uEntryIdx * MISCFIFO_KEYENTRYSIZE);
......@@ -1474,7 +1474,7 @@ int ii;
dwData |= wKeyCtl;
dwData <<= 16;
dwData |= MAKEWORD(*(pbyAddr+4), *(pbyAddr+5));
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"1. wOffset: %d, Data: %lX, KeyCtl:%X\n", wOffset, dwData, wKeyCtl);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "1. wOffset: %d, Data: %lX, KeyCtl:%X\n", wOffset, dwData, wKeyCtl);
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset);
VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, dwData);
......@@ -1489,7 +1489,7 @@ int ii;
dwData |= *(pbyAddr+1);
dwData <<= 8;
dwData |= *(pbyAddr+0);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"2. wOffset: %d, Data: %lX\n", wOffset, dwData);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "2. wOffset: %d, Data: %lX\n", wOffset, dwData);
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset);
VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, dwData);
......@@ -1497,9 +1497,9 @@ int ii;
wOffset++;
wOffset += (uKeyIdx * 4);
for (ii=0;ii<4;ii++) {
for (ii = 0; ii < 4; ii++) {
// always push 128 bits
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"3.(%d) wOffset: %d, Data: %lX\n", ii, wOffset+ii, *pdwKey);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "3.(%d) wOffset: %d, Data: %lX\n", ii, wOffset+ii, *pdwKey);
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset+ii);
VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, *pdwKey++);
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
......@@ -1522,9 +1522,9 @@ int ii;
* Return Value: none
*
*/
void MACvDisableKeyEntry (unsigned long dwIoBase, unsigned int uEntryIdx)
void MACvDisableKeyEntry(unsigned long dwIoBase, unsigned int uEntryIdx)
{
unsigned short wOffset;
unsigned short wOffset;
wOffset = MISCFIFO_KEYETRY0;
wOffset += (uEntryIdx * MISCFIFO_KEYENTRYSIZE);
......@@ -1550,17 +1550,17 @@ unsigned short wOffset;
*
*/
void MACvSetDefaultKeyEntry (unsigned long dwIoBase, unsigned int uKeyLen,
void MACvSetDefaultKeyEntry(unsigned long dwIoBase, unsigned int uKeyLen,
unsigned int uKeyIdx, unsigned long *pdwKey, unsigned char byLocalID)
{
unsigned short wOffset;
unsigned long dwData;
int ii;
unsigned short wOffset;
unsigned long dwData;
int ii;
if (byLocalID <= 1)
return;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"MACvSetDefaultKeyEntry\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "MACvSetDefaultKeyEntry\n");
wOffset = MISCFIFO_KEYETRY0;
wOffset += (10 * MISCFIFO_KEYENTRYSIZE);
......@@ -1568,8 +1568,8 @@ int ii;
wOffset++;
wOffset += (uKeyIdx * 4);
// always push 128 bits
for (ii=0; ii<3; ii++) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"(%d) wOffset: %d, Data: %lX\n", ii, wOffset+ii, *pdwKey);
for (ii = 0; ii < 3; ii++) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "(%d) wOffset: %d, Data: %lX\n", ii, wOffset+ii, *pdwKey);
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset+ii);
VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, *pdwKey++);
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
......@@ -1581,7 +1581,7 @@ int ii;
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset+3);
VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, dwData);
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"End. wOffset: %d, Data: %lX\n", wOffset+3, dwData);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "End. wOffset: %d, Data: %lX\n", wOffset+3, dwData);
}
......@@ -1601,10 +1601,10 @@ int ii;
*
*/
/*
void MACvEnableDefaultKey (unsigned long dwIoBase, unsigned char byLocalID)
{
unsigned short wOffset;
unsigned long dwData;
void MACvEnableDefaultKey(unsigned long dwIoBase, unsigned char byLocalID)
{
unsigned short wOffset;
unsigned long dwData;
if (byLocalID <= 1)
......@@ -1617,9 +1617,9 @@ unsigned long dwData;
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset);
VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, dwData);
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"MACvEnableDefaultKey: wOffset: %d, Data: %lX\n", wOffset, dwData);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "MACvEnableDefaultKey: wOffset: %d, Data: %lX\n", wOffset, dwData);
}
}
*/
/*
......@@ -1636,10 +1636,10 @@ unsigned long dwData;
* Return Value: none
*
*/
void MACvDisableDefaultKey (unsigned long dwIoBase)
void MACvDisableDefaultKey(unsigned long dwIoBase)
{
unsigned short wOffset;
unsigned long dwData;
unsigned short wOffset;
unsigned long dwData;
wOffset = MISCFIFO_KEYETRY0;
......@@ -1649,7 +1649,7 @@ unsigned long dwData;
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset);
VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, dwData);
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"MACvDisableDefaultKey: wOffset: %d, Data: %lX\n", wOffset, dwData);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "MACvDisableDefaultKey: wOffset: %d, Data: %lX\n", wOffset, dwData);
}
/*
......@@ -1666,18 +1666,18 @@ unsigned long dwData;
* Return Value: none
*
*/
void MACvSetDefaultTKIPKeyEntry (unsigned long dwIoBase, unsigned int uKeyLen,
void MACvSetDefaultTKIPKeyEntry(unsigned long dwIoBase, unsigned int uKeyLen,
unsigned int uKeyIdx, unsigned long *pdwKey, unsigned char byLocalID)
{
unsigned short wOffset;
unsigned long dwData;
int ii;
unsigned short wOffset;
unsigned long dwData;
int ii;
if (byLocalID <= 1)
return;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"MACvSetDefaultTKIPKeyEntry\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "MACvSetDefaultTKIPKeyEntry\n");
wOffset = MISCFIFO_KEYETRY0;
// Kyle test : change offset from 10 -> 0
wOffset += (10 * MISCFIFO_KEYENTRYSIZE);
......@@ -1695,10 +1695,10 @@ int ii;
wOffset++;
wOffset += (uKeyIdx * 4);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"1. wOffset: %d, Data: %lX, idx:%d\n", wOffset, *pdwKey, uKeyIdx);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "1. wOffset: %d, Data: %lX, idx:%d\n", wOffset, *pdwKey, uKeyIdx);
// always push 128 bits
for (ii=0; ii<4; ii++) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"2.(%d) wOffset: %d, Data: %lX\n", ii, wOffset+ii, *pdwKey);
for (ii = 0; ii < 4; ii++) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "2.(%d) wOffset: %d, Data: %lX\n", ii, wOffset+ii, *pdwKey);
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset+ii);
VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, *pdwKey++);
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
......@@ -1723,16 +1723,16 @@ int ii;
*
*/
void MACvSetDefaultKeyCtl (unsigned long dwIoBase, unsigned short wKeyCtl, unsigned int uEntryIdx, unsigned char byLocalID)
void MACvSetDefaultKeyCtl(unsigned long dwIoBase, unsigned short wKeyCtl, unsigned int uEntryIdx, unsigned char byLocalID)
{
unsigned short wOffset;
unsigned long dwData;
unsigned short wOffset;
unsigned long dwData;
if (byLocalID <= 1)
return;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"MACvSetKeyEntry\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "MACvSetKeyEntry\n");
wOffset = MISCFIFO_KEYETRY0;
wOffset += (uEntryIdx * MISCFIFO_KEYENTRYSIZE);
......@@ -1740,7 +1740,7 @@ unsigned long dwData;
dwData |= wKeyCtl;
dwData <<= 16;
dwData |= 0xffff;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"1. wOffset: %d, Data: %lX, KeyCtl:%X\n", wOffset, dwData, wKeyCtl);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "1. wOffset: %d, Data: %lX, KeyCtl:%X\n", wOffset, dwData, wKeyCtl);
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset);
VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, dwData);
......
......@@ -638,107 +638,107 @@
/*--------------------- Export Macros ------------------------------*/
#define MACvRegBitsOn(dwIoBase, byRegOfs, byBits) \
{ \
{ \
unsigned char byData; \
VNSvInPortB(dwIoBase + byRegOfs, &byData); \
VNSvOutPortB(dwIoBase + byRegOfs, byData | (byBits)); \
}
}
#define MACvWordRegBitsOn(dwIoBase, byRegOfs, wBits) \
{ \
{ \
unsigned short wData; \
VNSvInPortW(dwIoBase + byRegOfs, &wData); \
VNSvOutPortW(dwIoBase + byRegOfs, wData | (wBits)); \
}
}
#define MACvDWordRegBitsOn(dwIoBase, byRegOfs, dwBits) \
{ \
{ \
unsigned long dwData; \
VNSvInPortD(dwIoBase + byRegOfs, &dwData); \
VNSvOutPortD(dwIoBase + byRegOfs, dwData | (dwBits)); \
}
}
#define MACvRegBitsOnEx(dwIoBase, byRegOfs, byMask, byBits) \
{ \
{ \
unsigned char byData; \
VNSvInPortB(dwIoBase + byRegOfs, &byData); \
byData &= byMask; \
VNSvOutPortB(dwIoBase + byRegOfs, byData | (byBits)); \
}
}
#define MACvRegBitsOff(dwIoBase, byRegOfs, byBits) \
{ \
{ \
unsigned char byData; \
VNSvInPortB(dwIoBase + byRegOfs, &byData); \
VNSvOutPortB(dwIoBase + byRegOfs, byData & ~(byBits)); \
}
}
#define MACvWordRegBitsOff(dwIoBase, byRegOfs, wBits) \
{ \
{ \
unsigned short wData; \
VNSvInPortW(dwIoBase + byRegOfs, &wData); \
VNSvOutPortW(dwIoBase + byRegOfs, wData & ~(wBits)); \
}
}
#define MACvDWordRegBitsOff(dwIoBase, byRegOfs, dwBits) \
{ \
{ \
unsigned long dwData; \
VNSvInPortD(dwIoBase + byRegOfs, &dwData); \
VNSvOutPortD(dwIoBase + byRegOfs, dwData & ~(dwBits)); \
}
}
#define MACvGetCurrRx0DescAddr(dwIoBase, pdwCurrDescAddr) \
{ \
{ \
VNSvInPortD(dwIoBase + MAC_REG_RXDMAPTR0, \
(unsigned long *)pdwCurrDescAddr); \
}
}
#define MACvGetCurrRx1DescAddr(dwIoBase, pdwCurrDescAddr) \
{ \
{ \
VNSvInPortD(dwIoBase + MAC_REG_RXDMAPTR1, \
(unsigned long *)pdwCurrDescAddr); \
}
}
#define MACvGetCurrTx0DescAddr(dwIoBase, pdwCurrDescAddr) \
{ \
{ \
VNSvInPortD(dwIoBase + MAC_REG_TXDMAPTR0, \
(unsigned long *)pdwCurrDescAddr); \
}
}
#define MACvGetCurrAC0DescAddr(dwIoBase, pdwCurrDescAddr) \
{ \
{ \
VNSvInPortD(dwIoBase + MAC_REG_AC0DMAPTR, \
(unsigned long *)pdwCurrDescAddr); \
}
}
#define MACvGetCurrSyncDescAddr(dwIoBase, pdwCurrDescAddr) \
{ \
{ \
VNSvInPortD(dwIoBase + MAC_REG_SYNCDMAPTR, \
(unsigned long *)pdwCurrDescAddr); \
}
}
#define MACvGetCurrATIMDescAddr(dwIoBase, pdwCurrDescAddr) \
{ \
{ \
VNSvInPortD(dwIoBase + MAC_REG_ATIMDMAPTR, \
(unsigned long *)pdwCurrDescAddr); \
} \
} \
// set the chip with current BCN tx descriptor address
#define MACvSetCurrBCNTxDescAddr(dwIoBase, dwCurrDescAddr) \
{ \
{ \
VNSvOutPortD(dwIoBase + MAC_REG_BCNDMAPTR, \
dwCurrDescAddr); \
}
}
// set the chip with current BCN length
#define MACvSetCurrBCNLength(dwIoBase, wCurrBCNLength) \
{ \
{ \
VNSvOutPortW(dwIoBase + MAC_REG_BCNDMACTL+2, \
wCurrBCNLength); \
}
}
#define MACvReadBSSIDAddress(dwIoBase, pbyEtherAddr) \
{ \
{ \
VNSvOutPortB(dwIoBase + MAC_REG_PAGE1SEL, 1); \
VNSvInPortB(dwIoBase + MAC_REG_BSSID0, \
(unsigned char *)pbyEtherAddr); \
......@@ -753,10 +753,10 @@
VNSvInPortB(dwIoBase + MAC_REG_BSSID0 + 5, \
pbyEtherAddr + 5); \
VNSvOutPortB(dwIoBase + MAC_REG_PAGE1SEL, 0); \
}
}
#define MACvWriteBSSIDAddress(dwIoBase, pbyEtherAddr) \
{ \
{ \
VNSvOutPortB(dwIoBase + MAC_REG_PAGE1SEL, 1); \
VNSvOutPortB(dwIoBase + MAC_REG_BSSID0, \
*(pbyEtherAddr)); \
......@@ -771,10 +771,10 @@
VNSvOutPortB(dwIoBase + MAC_REG_BSSID0 + 5, \
*(pbyEtherAddr + 5)); \
VNSvOutPortB(dwIoBase + MAC_REG_PAGE1SEL, 0); \
}
}
#define MACvReadEtherAddress(dwIoBase, pbyEtherAddr) \
{ \
{ \
VNSvOutPortB(dwIoBase + MAC_REG_PAGE1SEL, 1); \
VNSvInPortB(dwIoBase + MAC_REG_PAR0, \
(unsigned char *)pbyEtherAddr); \
......@@ -789,11 +789,11 @@
VNSvInPortB(dwIoBase + MAC_REG_PAR0 + 5, \
pbyEtherAddr + 5); \
VNSvOutPortB(dwIoBase + MAC_REG_PAGE1SEL, 0); \
}
}
#define MACvWriteEtherAddress(dwIoBase, pbyEtherAddr) \
{ \
{ \
VNSvOutPortB(dwIoBase + MAC_REG_PAGE1SEL, 1); \
VNSvOutPortB(dwIoBase + MAC_REG_PAR0, \
*pbyEtherAddr); \
......@@ -808,241 +808,241 @@
VNSvOutPortB(dwIoBase + MAC_REG_PAR0 + 5, \
*(pbyEtherAddr + 5)); \
VNSvOutPortB(dwIoBase + MAC_REG_PAGE1SEL, 0); \
}
}
#define MACvClearISR(dwIoBase) \
{ \
{ \
VNSvOutPortD(dwIoBase + MAC_REG_ISR, IMR_MASK_VALUE); \
}
}
#define MACvStart(dwIoBase) \
{ \
{ \
VNSvOutPortB(dwIoBase + MAC_REG_HOSTCR, \
(HOSTCR_MACEN | HOSTCR_RXON | HOSTCR_TXON)); \
}
}
#define MACvRx0PerPktMode(dwIoBase) \
{ \
{ \
VNSvOutPortD(dwIoBase + MAC_REG_RXDMACTL0, RX_PERPKT); \
}
}
#define MACvRx0BufferFillMode(dwIoBase) \
{ \
{ \
VNSvOutPortD(dwIoBase + MAC_REG_RXDMACTL0, RX_PERPKTCLR); \
}
}
#define MACvRx1PerPktMode(dwIoBase) \
{ \
{ \
VNSvOutPortD(dwIoBase + MAC_REG_RXDMACTL1, RX_PERPKT); \
}
}
#define MACvRx1BufferFillMode(dwIoBase) \
{ \
{ \
VNSvOutPortD(dwIoBase + MAC_REG_RXDMACTL1, RX_PERPKTCLR); \
}
}
#define MACvRxOn(dwIoBase) \
{ \
{ \
MACvRegBitsOn(dwIoBase, MAC_REG_HOSTCR, HOSTCR_RXON); \
}
}
#define MACvReceive0(dwIoBase) \
{ \
{ \
unsigned long dwData; \
VNSvInPortD(dwIoBase + MAC_REG_RXDMACTL0, &dwData); \
if (dwData & DMACTL_RUN) { \
VNSvOutPortD(dwIoBase + MAC_REG_RXDMACTL0, DMACTL_WAKE);\
VNSvOutPortD(dwIoBase + MAC_REG_RXDMACTL0, DMACTL_WAKE); \
} \
else { \
VNSvOutPortD(dwIoBase + MAC_REG_RXDMACTL0, DMACTL_RUN); \
} \
}
}
#define MACvReceive1(dwIoBase) \
{ \
{ \
unsigned long dwData; \
VNSvInPortD(dwIoBase + MAC_REG_RXDMACTL1, &dwData); \
if (dwData & DMACTL_RUN) { \
VNSvOutPortD(dwIoBase + MAC_REG_RXDMACTL1, DMACTL_WAKE);\
VNSvOutPortD(dwIoBase + MAC_REG_RXDMACTL1, DMACTL_WAKE); \
} \
else { \
VNSvOutPortD(dwIoBase + MAC_REG_RXDMACTL1, DMACTL_RUN); \
} \
}
}
#define MACvTxOn(dwIoBase) \
{ \
{ \
MACvRegBitsOn(dwIoBase, MAC_REG_HOSTCR, HOSTCR_TXON); \
}
}
#define MACvTransmit0(dwIoBase) \
{ \
{ \
unsigned long dwData; \
VNSvInPortD(dwIoBase + MAC_REG_TXDMACTL0, &dwData); \
if (dwData & DMACTL_RUN) { \
VNSvOutPortD(dwIoBase + MAC_REG_TXDMACTL0, DMACTL_WAKE);\
VNSvOutPortD(dwIoBase + MAC_REG_TXDMACTL0, DMACTL_WAKE); \
} \
else { \
VNSvOutPortD(dwIoBase + MAC_REG_TXDMACTL0, DMACTL_RUN); \
} \
}
}
#define MACvTransmitAC0(dwIoBase) \
{ \
{ \
unsigned long dwData; \
VNSvInPortD(dwIoBase + MAC_REG_AC0DMACTL, &dwData); \
if (dwData & DMACTL_RUN) { \
VNSvOutPortD(dwIoBase + MAC_REG_AC0DMACTL, DMACTL_WAKE);\
VNSvOutPortD(dwIoBase + MAC_REG_AC0DMACTL, DMACTL_WAKE); \
} \
else { \
VNSvOutPortD(dwIoBase + MAC_REG_AC0DMACTL, DMACTL_RUN); \
} \
}
}
#define MACvTransmitSYNC(dwIoBase) \
{ \
{ \
unsigned long dwData; \
VNSvInPortD(dwIoBase + MAC_REG_SYNCDMACTL, &dwData); \
if (dwData & DMACTL_RUN) { \
VNSvOutPortD(dwIoBase + MAC_REG_SYNCDMACTL, DMACTL_WAKE);\
VNSvOutPortD(dwIoBase + MAC_REG_SYNCDMACTL, DMACTL_WAKE); \
} \
else { \
VNSvOutPortD(dwIoBase + MAC_REG_SYNCDMACTL, DMACTL_RUN); \
} \
}
}
#define MACvTransmitATIM(dwIoBase) \
{ \
{ \
unsigned long dwData; \
VNSvInPortD(dwIoBase + MAC_REG_ATIMDMACTL, &dwData); \
if (dwData & DMACTL_RUN) { \
VNSvOutPortD(dwIoBase + MAC_REG_ATIMDMACTL, DMACTL_WAKE);\
VNSvOutPortD(dwIoBase + MAC_REG_ATIMDMACTL, DMACTL_WAKE); \
} \
else { \
VNSvOutPortD(dwIoBase + MAC_REG_ATIMDMACTL, DMACTL_RUN); \
} \
}
}
#define MACvTransmitBCN(dwIoBase) \
{ \
{ \
VNSvOutPortB(dwIoBase + MAC_REG_BCNDMACTL, BEACON_READY); \
}
}
#define MACvClearStckDS(dwIoBase) \
{ \
{ \
unsigned char byOrgValue; \
VNSvInPortB(dwIoBase + MAC_REG_STICKHW, &byOrgValue); \
byOrgValue = byOrgValue & 0xFC; \
VNSvOutPortB(dwIoBase + MAC_REG_STICKHW, byOrgValue); \
}
}
#define MACvReadISR(dwIoBase, pdwValue) \
{ \
{ \
VNSvInPortD(dwIoBase + MAC_REG_ISR, pdwValue); \
}
}
#define MACvWriteISR(dwIoBase, dwValue) \
{ \
{ \
VNSvOutPortD(dwIoBase + MAC_REG_ISR, dwValue); \
}
}
#define MACvIntEnable(dwIoBase, dwMask) \
{ \
{ \
VNSvOutPortD(dwIoBase + MAC_REG_IMR, dwMask); \
}
}
#define MACvIntDisable(dwIoBase) \
{ \
{ \
VNSvOutPortD(dwIoBase + MAC_REG_IMR, 0); \
}
}
#define MACvSelectPage0(dwIoBase) \
{ \
{ \
VNSvOutPortB(dwIoBase + MAC_REG_PAGE1SEL, 0); \
}
}
#define MACvSelectPage1(dwIoBase) \
{ \
{ \
VNSvOutPortB(dwIoBase + MAC_REG_PAGE1SEL, 1); \
}
}
#define MACvReadMIBCounter(dwIoBase, pdwCounter) \
{ \
{ \
VNSvInPortD(dwIoBase + MAC_REG_MIBCNTR , pdwCounter); \
}
}
#define MACvPwrEvntDisable(dwIoBase) \
{ \
{ \
VNSvOutPortW(dwIoBase + MAC_REG_WAKEUPEN0, 0x0000); \
}
}
#define MACvEnableProtectMD(dwIoBase) \
{ \
{ \
unsigned long dwOrgValue; \
VNSvInPortD(dwIoBase + MAC_REG_ENCFG , &dwOrgValue); \
dwOrgValue = dwOrgValue | EnCFG_ProtectMd; \
VNSvOutPortD(dwIoBase + MAC_REG_ENCFG, dwOrgValue); \
}
}
#define MACvDisableProtectMD(dwIoBase) \
{ \
{ \
unsigned long dwOrgValue; \
VNSvInPortD(dwIoBase + MAC_REG_ENCFG , &dwOrgValue); \
dwOrgValue = dwOrgValue & ~EnCFG_ProtectMd; \
VNSvOutPortD(dwIoBase + MAC_REG_ENCFG, dwOrgValue); \
}
}
#define MACvEnableBarkerPreambleMd(dwIoBase) \
{ \
{ \
unsigned long dwOrgValue; \
VNSvInPortD(dwIoBase + MAC_REG_ENCFG , &dwOrgValue); \
dwOrgValue = dwOrgValue | EnCFG_BarkerPream; \
VNSvOutPortD(dwIoBase + MAC_REG_ENCFG, dwOrgValue); \
}
}
#define MACvDisableBarkerPreambleMd(dwIoBase) \
{ \
{ \
unsigned long dwOrgValue; \
VNSvInPortD(dwIoBase + MAC_REG_ENCFG , &dwOrgValue); \
dwOrgValue = dwOrgValue & ~EnCFG_BarkerPream; \
VNSvOutPortD(dwIoBase + MAC_REG_ENCFG, dwOrgValue); \
}
}
#define MACvSetBBType(dwIoBase, byTyp) \
{ \
{ \
unsigned long dwOrgValue; \
VNSvInPortD(dwIoBase + MAC_REG_ENCFG , &dwOrgValue); \
dwOrgValue = dwOrgValue & ~EnCFG_BBType_MASK; \
dwOrgValue = dwOrgValue | (unsigned long) byTyp; \
VNSvOutPortD(dwIoBase + MAC_REG_ENCFG, dwOrgValue); \
}
}
#define MACvReadATIMW(dwIoBase, pwCounter) \
{ \
{ \
VNSvInPortW(dwIoBase + MAC_REG_AIDATIM , pwCounter); \
}
}
#define MACvWriteATIMW(dwIoBase, wCounter) \
{ \
{ \
VNSvOutPortW(dwIoBase + MAC_REG_AIDATIM , wCounter); \
}
}
#define MACvWriteCRC16_128(dwIoBase, byRegOfs, wCRC) \
{ \
{ \
VNSvOutPortB(dwIoBase + MAC_REG_PAGE1SEL, 1); \
VNSvOutPortW(dwIoBase + byRegOfs, wCRC); \
VNSvOutPortB(dwIoBase + MAC_REG_PAGE1SEL, 0); \
}
}
#define MACvGPIOIn(dwIoBase, pbyValue) \
{ \
{ \
VNSvInPortB(dwIoBase + MAC_REG_GPIOCTL1, pbyValue); \
}
}
#define MACvSetRFLE_LatchBase(dwIoBase) \
{ \
{ \
MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_RFLEOPT); \
}
}
/*--------------------- Export Classes ----------------------------*/
......@@ -1107,7 +1107,7 @@ void MACvOneShotTimer1MicroSec(unsigned long dwIoBase, unsigned int uDelayTime);
void MACvSetMISCFifo(unsigned long dwIoBase, unsigned short wOffset, unsigned long dwData);
bool MACbTxDMAOff (unsigned long dwIoBase, unsigned int idx);
bool MACbTxDMAOff(unsigned long dwIoBase, unsigned int idx);
void MACvClearBusSusInd(unsigned long dwIoBase);
void MACvEnableBusSusEn(unsigned long dwIoBase);
......
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