staging: vt6655: mac.c rename dwIoBase to io_base

Removing camel case.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Malcolm Priestley 2016-02-28 19:02:54 +00:00 committed by Greg Kroah-Hartman
parent b08bb6bb5a
commit c2d845de8f

View File

@ -61,7 +61,7 @@
* *
* Parameters: * Parameters:
* In: * In:
* dwIoBase - Base Address for MAC * io_base - Base Address for MAC
* byRegOfs - Offset of MAC Register * byRegOfs - Offset of MAC Register
* byTestBits - Test bits * byTestBits - Test bits
* Out: * Out:
@ -73,10 +73,10 @@
bool MACbIsRegBitsOn(struct vnt_private *priv, unsigned char byRegOfs, bool MACbIsRegBitsOn(struct vnt_private *priv, unsigned char byRegOfs,
unsigned char byTestBits) unsigned char byTestBits)
{ {
void __iomem *dwIoBase = priv->PortOffset; void __iomem *io_base = priv->PortOffset;
unsigned char byData; unsigned char byData;
VNSvInPortB(dwIoBase + byRegOfs, &byData); VNSvInPortB(io_base + byRegOfs, &byData);
return (byData & byTestBits) == byTestBits; return (byData & byTestBits) == byTestBits;
} }
@ -86,7 +86,7 @@ bool MACbIsRegBitsOn(struct vnt_private *priv, unsigned char byRegOfs,
* *
* Parameters: * Parameters:
* In: * In:
* dwIoBase - Base Address for MAC * io_base - Base Address for MAC
* byRegOfs - Offset of MAC Register * byRegOfs - Offset of MAC Register
* byTestBits - Test bits * byTestBits - Test bits
* Out: * Out:
@ -98,10 +98,10 @@ bool MACbIsRegBitsOn(struct vnt_private *priv, unsigned char byRegOfs,
bool MACbIsRegBitsOff(struct vnt_private *priv, unsigned char byRegOfs, bool MACbIsRegBitsOff(struct vnt_private *priv, unsigned char byRegOfs,
unsigned char byTestBits) unsigned char byTestBits)
{ {
void __iomem *dwIoBase = priv->PortOffset; void __iomem *io_base = priv->PortOffset;
unsigned char byData; unsigned char byData;
VNSvInPortB(dwIoBase + byRegOfs, &byData); VNSvInPortB(io_base + byRegOfs, &byData);
return !(byData & byTestBits); return !(byData & byTestBits);
} }
@ -111,7 +111,7 @@ bool MACbIsRegBitsOff(struct vnt_private *priv, unsigned char byRegOfs,
* *
* Parameters: * Parameters:
* In: * In:
* dwIoBase - Base Address for MAC * io_base - Base Address for MAC
* Out: * Out:
* none * none
* *
@ -120,10 +120,10 @@ bool MACbIsRegBitsOff(struct vnt_private *priv, unsigned char byRegOfs,
*/ */
bool MACbIsIntDisable(struct vnt_private *priv) bool MACbIsIntDisable(struct vnt_private *priv)
{ {
void __iomem *dwIoBase = priv->PortOffset; void __iomem *io_base = priv->PortOffset;
unsigned long dwData; unsigned long dwData;
VNSvInPortD(dwIoBase + MAC_REG_IMR, &dwData); VNSvInPortD(io_base + MAC_REG_IMR, &dwData);
if (dwData != 0) if (dwData != 0)
return false; return false;
@ -136,7 +136,7 @@ bool MACbIsIntDisable(struct vnt_private *priv)
* *
* Parameters: * Parameters:
* In: * In:
* dwIoBase - Base Address for MAC * io_base - Base Address for MAC
* byRetryLimit- Retry Limit * byRetryLimit- Retry Limit
* Out: * Out:
* none * none
@ -146,9 +146,9 @@ bool MACbIsIntDisable(struct vnt_private *priv)
*/ */
void MACvSetShortRetryLimit(struct vnt_private *priv, unsigned char byRetryLimit) void MACvSetShortRetryLimit(struct vnt_private *priv, unsigned char byRetryLimit)
{ {
void __iomem *dwIoBase = priv->PortOffset; void __iomem *io_base = priv->PortOffset;
/* set SRT */ /* set SRT */
VNSvOutPortB(dwIoBase + MAC_REG_SRT, byRetryLimit); VNSvOutPortB(io_base + MAC_REG_SRT, byRetryLimit);
} }
@ -158,7 +158,7 @@ void MACvSetShortRetryLimit(struct vnt_private *priv, unsigned char byRetryLimit
* *
* Parameters: * Parameters:
* In: * In:
* dwIoBase - Base Address for MAC * io_base - Base Address for MAC
* byRetryLimit- Retry Limit * byRetryLimit- Retry Limit
* Out: * Out:
* none * none
@ -168,9 +168,9 @@ void MACvSetShortRetryLimit(struct vnt_private *priv, unsigned char byRetryLimit
*/ */
void MACvSetLongRetryLimit(struct vnt_private *priv, unsigned char byRetryLimit) void MACvSetLongRetryLimit(struct vnt_private *priv, unsigned char byRetryLimit)
{ {
void __iomem *dwIoBase = priv->PortOffset; void __iomem *io_base = priv->PortOffset;
/* set LRT */ /* set LRT */
VNSvOutPortB(dwIoBase + MAC_REG_LRT, byRetryLimit); VNSvOutPortB(io_base + MAC_REG_LRT, byRetryLimit);
} }
/* /*
@ -179,7 +179,7 @@ void MACvSetLongRetryLimit(struct vnt_private *priv, unsigned char byRetryLimit)
* *
* Parameters: * Parameters:
* In: * In:
* dwIoBase - Base Address for MAC * io_base - Base Address for MAC
* byLoopbackMode - Loopback Mode * byLoopbackMode - Loopback Mode
* Out: * Out:
* none * none
@ -189,15 +189,15 @@ void MACvSetLongRetryLimit(struct vnt_private *priv, unsigned char byRetryLimit)
*/ */
void MACvSetLoopbackMode(struct vnt_private *priv, unsigned char byLoopbackMode) void MACvSetLoopbackMode(struct vnt_private *priv, unsigned char byLoopbackMode)
{ {
void __iomem *dwIoBase = priv->PortOffset; void __iomem *io_base = priv->PortOffset;
unsigned char byOrgValue; unsigned char byOrgValue;
byLoopbackMode <<= 6; byLoopbackMode <<= 6;
/* set TCR */ /* set TCR */
VNSvInPortB(dwIoBase + MAC_REG_TEST, &byOrgValue); VNSvInPortB(io_base + MAC_REG_TEST, &byOrgValue);
byOrgValue = byOrgValue & 0x3F; byOrgValue = byOrgValue & 0x3F;
byOrgValue = byOrgValue | byLoopbackMode; byOrgValue = byOrgValue | byLoopbackMode;
VNSvOutPortB(dwIoBase + MAC_REG_TEST, byOrgValue); VNSvOutPortB(io_base + MAC_REG_TEST, byOrgValue);
} }
/* /*
@ -206,7 +206,7 @@ void MACvSetLoopbackMode(struct vnt_private *priv, unsigned char byLoopbackMode)
* *
* Parameters: * Parameters:
* In: * In:
* dwIoBase - Base Address for MAC * io_base - Base Address for MAC
* Out: * Out:
* pbyCxtBuf - Context buffer * pbyCxtBuf - Context buffer
* *
@ -215,21 +215,21 @@ void MACvSetLoopbackMode(struct vnt_private *priv, unsigned char byLoopbackMode)
*/ */
void MACvSaveContext(struct vnt_private *priv, unsigned char *pbyCxtBuf) void MACvSaveContext(struct vnt_private *priv, unsigned char *pbyCxtBuf)
{ {
void __iomem *dwIoBase = priv->PortOffset; void __iomem *io_base = priv->PortOffset;
int ii; int ii;
/* read page0 register */ /* read page0 register */
for (ii = 0; ii < MAC_MAX_CONTEXT_SIZE_PAGE0; ii++) for (ii = 0; ii < MAC_MAX_CONTEXT_SIZE_PAGE0; ii++)
VNSvInPortB((dwIoBase + ii), (pbyCxtBuf + ii)); VNSvInPortB((io_base + ii), (pbyCxtBuf + ii));
MACvSelectPage1(dwIoBase); MACvSelectPage1(io_base);
/* read page1 register */ /* read page1 register */
for (ii = 0; ii < MAC_MAX_CONTEXT_SIZE_PAGE1; ii++) for (ii = 0; ii < MAC_MAX_CONTEXT_SIZE_PAGE1; ii++)
VNSvInPortB((dwIoBase + ii), VNSvInPortB((io_base + ii),
(pbyCxtBuf + MAC_MAX_CONTEXT_SIZE_PAGE0 + ii)); (pbyCxtBuf + MAC_MAX_CONTEXT_SIZE_PAGE0 + ii));
MACvSelectPage0(dwIoBase); MACvSelectPage0(io_base);
} }
/* /*
@ -238,7 +238,7 @@ void MACvSaveContext(struct vnt_private *priv, unsigned char *pbyCxtBuf)
* *
* Parameters: * Parameters:
* In: * In:
* dwIoBase - Base Address for MAC * io_base - Base Address for MAC
* pbyCxtBuf - Context buffer * pbyCxtBuf - Context buffer
* Out: * Out:
* none * none
@ -248,43 +248,43 @@ void MACvSaveContext(struct vnt_private *priv, unsigned char *pbyCxtBuf)
*/ */
void MACvRestoreContext(struct vnt_private *priv, unsigned char *pbyCxtBuf) void MACvRestoreContext(struct vnt_private *priv, unsigned char *pbyCxtBuf)
{ {
void __iomem *dwIoBase = priv->PortOffset; void __iomem *io_base = priv->PortOffset;
int ii; int ii;
MACvSelectPage1(dwIoBase); MACvSelectPage1(io_base);
/* restore page1 */ /* restore page1 */
for (ii = 0; ii < MAC_MAX_CONTEXT_SIZE_PAGE1; ii++) for (ii = 0; ii < MAC_MAX_CONTEXT_SIZE_PAGE1; ii++)
VNSvOutPortB((dwIoBase + ii), VNSvOutPortB((io_base + ii),
*(pbyCxtBuf + MAC_MAX_CONTEXT_SIZE_PAGE0 + ii)); *(pbyCxtBuf + MAC_MAX_CONTEXT_SIZE_PAGE0 + ii));
MACvSelectPage0(dwIoBase); MACvSelectPage0(io_base);
/* restore RCR,TCR,IMR... */ /* restore RCR,TCR,IMR... */
for (ii = MAC_REG_RCR; ii < MAC_REG_ISR; ii++) for (ii = MAC_REG_RCR; ii < MAC_REG_ISR; ii++)
VNSvOutPortB(dwIoBase + ii, *(pbyCxtBuf + ii)); VNSvOutPortB(io_base + ii, *(pbyCxtBuf + ii));
/* restore MAC Config. */ /* restore MAC Config. */
for (ii = MAC_REG_LRT; ii < MAC_REG_PAGE1SEL; ii++) for (ii = MAC_REG_LRT; ii < MAC_REG_PAGE1SEL; ii++)
VNSvOutPortB(dwIoBase + ii, *(pbyCxtBuf + ii)); VNSvOutPortB(io_base + ii, *(pbyCxtBuf + ii));
VNSvOutPortB(dwIoBase + MAC_REG_CFG, *(pbyCxtBuf + MAC_REG_CFG)); VNSvOutPortB(io_base + MAC_REG_CFG, *(pbyCxtBuf + MAC_REG_CFG));
/* restore PS Config. */ /* restore PS Config. */
for (ii = MAC_REG_PSCFG; ii < MAC_REG_BBREGCTL; ii++) for (ii = MAC_REG_PSCFG; ii < MAC_REG_BBREGCTL; ii++)
VNSvOutPortB(dwIoBase + ii, *(pbyCxtBuf + ii)); VNSvOutPortB(io_base + ii, *(pbyCxtBuf + ii));
/* restore CURR_RX_DESC_ADDR, CURR_TX_DESC_ADDR */ /* restore CURR_RX_DESC_ADDR, CURR_TX_DESC_ADDR */
VNSvOutPortD(dwIoBase + MAC_REG_TXDMAPTR0, VNSvOutPortD(io_base + MAC_REG_TXDMAPTR0,
*(unsigned long *)(pbyCxtBuf + MAC_REG_TXDMAPTR0)); *(unsigned long *)(pbyCxtBuf + MAC_REG_TXDMAPTR0));
VNSvOutPortD(dwIoBase + MAC_REG_AC0DMAPTR, VNSvOutPortD(io_base + MAC_REG_AC0DMAPTR,
*(unsigned long *)(pbyCxtBuf + MAC_REG_AC0DMAPTR)); *(unsigned long *)(pbyCxtBuf + MAC_REG_AC0DMAPTR));
VNSvOutPortD(dwIoBase + MAC_REG_BCNDMAPTR, VNSvOutPortD(io_base + MAC_REG_BCNDMAPTR,
*(unsigned long *)(pbyCxtBuf + MAC_REG_BCNDMAPTR)); *(unsigned long *)(pbyCxtBuf + MAC_REG_BCNDMAPTR));
VNSvOutPortD(dwIoBase + MAC_REG_RXDMAPTR0, VNSvOutPortD(io_base + MAC_REG_RXDMAPTR0,
*(unsigned long *)(pbyCxtBuf + MAC_REG_RXDMAPTR0)); *(unsigned long *)(pbyCxtBuf + MAC_REG_RXDMAPTR0));
VNSvOutPortD(dwIoBase + MAC_REG_RXDMAPTR1, VNSvOutPortD(io_base + MAC_REG_RXDMAPTR1,
*(unsigned long *)(pbyCxtBuf + MAC_REG_RXDMAPTR1)); *(unsigned long *)(pbyCxtBuf + MAC_REG_RXDMAPTR1));
} }
@ -294,7 +294,7 @@ void MACvRestoreContext(struct vnt_private *priv, unsigned char *pbyCxtBuf)
* *
* Parameters: * Parameters:
* In: * In:
* dwIoBase - Base Address for MAC * io_base - Base Address for MAC
* Out: * Out:
* none * none
* *
@ -303,15 +303,15 @@ void MACvRestoreContext(struct vnt_private *priv, unsigned char *pbyCxtBuf)
*/ */
bool MACbSoftwareReset(struct vnt_private *priv) bool MACbSoftwareReset(struct vnt_private *priv)
{ {
void __iomem *dwIoBase = priv->PortOffset; void __iomem *io_base = priv->PortOffset;
unsigned char byData; unsigned char byData;
unsigned short ww; unsigned short ww;
/* turn on HOSTCR_SOFTRST, just write 0x01 to reset */ /* turn on HOSTCR_SOFTRST, just write 0x01 to reset */
VNSvOutPortB(dwIoBase + MAC_REG_HOSTCR, 0x01); VNSvOutPortB(io_base + MAC_REG_HOSTCR, 0x01);
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortB(dwIoBase + MAC_REG_HOSTCR, &byData); VNSvInPortB(io_base + MAC_REG_HOSTCR, &byData);
if (!(byData & HOSTCR_SOFTRST)) if (!(byData & HOSTCR_SOFTRST))
break; break;
} }
@ -326,7 +326,7 @@ bool MACbSoftwareReset(struct vnt_private *priv)
* *
* Parameters: * Parameters:
* In: * In:
* dwIoBase - Base Address for MAC * io_base - Base Address for MAC
* Out: * Out:
* none * none
* *
@ -358,7 +358,7 @@ bool MACbSafeSoftwareReset(struct vnt_private *priv)
* *
* Parameters: * Parameters:
* In: * In:
* dwIoBase - Base Address for MAC * io_base - Base Address for MAC
* Out: * Out:
* none * none
* *
@ -367,7 +367,7 @@ bool MACbSafeSoftwareReset(struct vnt_private *priv)
*/ */
bool MACbSafeRxOff(struct vnt_private *priv) bool MACbSafeRxOff(struct vnt_private *priv)
{ {
void __iomem *dwIoBase = priv->PortOffset; void __iomem *io_base = priv->PortOffset;
unsigned short ww; unsigned short ww;
unsigned long dwData; unsigned long dwData;
unsigned char byData; unsigned char byData;
@ -375,10 +375,10 @@ bool MACbSafeRxOff(struct vnt_private *priv)
/* turn off wow temp for turn off Rx safely */ /* turn off wow temp for turn off Rx safely */
/* Clear RX DMA0,1 */ /* Clear RX DMA0,1 */
VNSvOutPortD(dwIoBase + MAC_REG_RXDMACTL0, DMACTL_CLRRUN); VNSvOutPortD(io_base + MAC_REG_RXDMACTL0, DMACTL_CLRRUN);
VNSvOutPortD(dwIoBase + MAC_REG_RXDMACTL1, DMACTL_CLRRUN); VNSvOutPortD(io_base + MAC_REG_RXDMACTL1, DMACTL_CLRRUN);
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortD(dwIoBase + MAC_REG_RXDMACTL0, &dwData); VNSvInPortD(io_base + MAC_REG_RXDMACTL0, &dwData);
if (!(dwData & DMACTL_RUN)) if (!(dwData & DMACTL_RUN))
break; break;
} }
@ -387,7 +387,7 @@ bool MACbSafeRxOff(struct vnt_private *priv)
return false; return false;
} }
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortD(dwIoBase + MAC_REG_RXDMACTL1, &dwData); VNSvInPortD(io_base + MAC_REG_RXDMACTL1, &dwData);
if (!(dwData & DMACTL_RUN)) if (!(dwData & DMACTL_RUN))
break; break;
} }
@ -397,10 +397,10 @@ bool MACbSafeRxOff(struct vnt_private *priv)
} }
/* try to safe shutdown RX */ /* try to safe shutdown RX */
MACvRegBitsOff(dwIoBase, MAC_REG_HOSTCR, HOSTCR_RXON); MACvRegBitsOff(io_base, MAC_REG_HOSTCR, HOSTCR_RXON);
/* 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_HOSTCR, &byData); VNSvInPortB(io_base + MAC_REG_HOSTCR, &byData);
if (!(byData & HOSTCR_RXONST)) if (!(byData & HOSTCR_RXONST))
break; break;
} }
@ -417,7 +417,7 @@ bool MACbSafeRxOff(struct vnt_private *priv)
* *
* Parameters: * Parameters:
* In: * In:
* dwIoBase - Base Address for MAC * io_base - Base Address for MAC
* Out: * Out:
* none * none
* *
@ -426,19 +426,19 @@ bool MACbSafeRxOff(struct vnt_private *priv)
*/ */
bool MACbSafeTxOff(struct vnt_private *priv) bool MACbSafeTxOff(struct vnt_private *priv)
{ {
void __iomem *dwIoBase = priv->PortOffset; void __iomem *io_base = priv->PortOffset;
unsigned short ww; unsigned short ww;
unsigned long dwData; unsigned long dwData;
unsigned char byData; unsigned char byData;
/* Clear TX DMA */ /* Clear TX DMA */
/* Tx0 */ /* Tx0 */
VNSvOutPortD(dwIoBase + MAC_REG_TXDMACTL0, DMACTL_CLRRUN); VNSvOutPortD(io_base + MAC_REG_TXDMACTL0, DMACTL_CLRRUN);
/* AC0 */ /* AC0 */
VNSvOutPortD(dwIoBase + MAC_REG_AC0DMACTL, DMACTL_CLRRUN); VNSvOutPortD(io_base + MAC_REG_AC0DMACTL, DMACTL_CLRRUN);
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortD(dwIoBase + MAC_REG_TXDMACTL0, &dwData); VNSvInPortD(io_base + MAC_REG_TXDMACTL0, &dwData);
if (!(dwData & DMACTL_RUN)) if (!(dwData & DMACTL_RUN))
break; break;
} }
@ -447,7 +447,7 @@ bool MACbSafeTxOff(struct vnt_private *priv)
return false; return false;
} }
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortD(dwIoBase + MAC_REG_AC0DMACTL, &dwData); VNSvInPortD(io_base + MAC_REG_AC0DMACTL, &dwData);
if (!(dwData & DMACTL_RUN)) if (!(dwData & DMACTL_RUN))
break; break;
} }
@ -457,11 +457,11 @@ bool MACbSafeTxOff(struct vnt_private *priv)
} }
/* try to safe shutdown TX */ /* try to safe shutdown TX */
MACvRegBitsOff(dwIoBase, MAC_REG_HOSTCR, HOSTCR_TXON); MACvRegBitsOff(io_base, MAC_REG_HOSTCR, HOSTCR_TXON);
/* 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_HOSTCR, &byData); VNSvInPortB(io_base + MAC_REG_HOSTCR, &byData);
if (!(byData & HOSTCR_TXONST)) if (!(byData & HOSTCR_TXONST))
break; break;
} }
@ -478,7 +478,7 @@ bool MACbSafeTxOff(struct vnt_private *priv)
* *
* Parameters: * Parameters:
* In: * In:
* dwIoBase - Base Address for MAC * io_base - Base Address for MAC
* Out: * Out:
* none * none
* *
@ -487,9 +487,9 @@ bool MACbSafeTxOff(struct vnt_private *priv)
*/ */
bool MACbSafeStop(struct vnt_private *priv) bool MACbSafeStop(struct vnt_private *priv)
{ {
void __iomem *dwIoBase = priv->PortOffset; void __iomem *io_base = priv->PortOffset;
MACvRegBitsOff(dwIoBase, MAC_REG_TCR, TCR_AUTOBCNTX); MACvRegBitsOff(io_base, MAC_REG_TCR, TCR_AUTOBCNTX);
if (!MACbSafeRxOff(priv)) { if (!MACbSafeRxOff(priv)) {
pr_debug(" MACbSafeRxOff == false)\n"); pr_debug(" MACbSafeRxOff == false)\n");
@ -502,7 +502,7 @@ bool MACbSafeStop(struct vnt_private *priv)
return false; return false;
} }
MACvRegBitsOff(dwIoBase, MAC_REG_HOSTCR, HOSTCR_MACEN); MACvRegBitsOff(io_base, MAC_REG_HOSTCR, HOSTCR_MACEN);
return true; return true;
} }
@ -513,7 +513,7 @@ bool MACbSafeStop(struct vnt_private *priv)
* *
* Parameters: * Parameters:
* In: * In:
* dwIoBase - Base Address for MAC * io_base - Base Address for MAC
* Out: * Out:
* none * none
* *
@ -522,9 +522,9 @@ bool MACbSafeStop(struct vnt_private *priv)
*/ */
bool MACbShutdown(struct vnt_private *priv) bool MACbShutdown(struct vnt_private *priv)
{ {
void __iomem *dwIoBase = priv->PortOffset; void __iomem *io_base = priv->PortOffset;
/* disable MAC IMR */ /* disable MAC IMR */
MACvIntDisable(dwIoBase); MACvIntDisable(io_base);
MACvSetLoopbackMode(priv, MAC_LB_INTERNAL); MACvSetLoopbackMode(priv, MAC_LB_INTERNAL);
/* stop the adapter */ /* stop the adapter */
if (!MACbSafeStop(priv)) { if (!MACbSafeStop(priv)) {
@ -541,7 +541,7 @@ bool MACbShutdown(struct vnt_private *priv)
* *
* Parameters: * Parameters:
* In: * In:
* dwIoBase - Base Address for MAC * io_base - Base Address for MAC
* Out: * Out:
* none * none
* *
@ -550,20 +550,20 @@ bool MACbShutdown(struct vnt_private *priv)
*/ */
void MACvInitialize(struct vnt_private *priv) void MACvInitialize(struct vnt_private *priv)
{ {
void __iomem *dwIoBase = priv->PortOffset; void __iomem *io_base = priv->PortOffset;
/* clear sticky bits */ /* clear sticky bits */
MACvClearStckDS(dwIoBase); MACvClearStckDS(io_base);
/* disable force PME-enable */ /* disable force PME-enable */
VNSvOutPortB(dwIoBase + MAC_REG_PMC1, PME_OVR); VNSvOutPortB(io_base + MAC_REG_PMC1, PME_OVR);
/* only 3253 A */ /* only 3253 A */
/* do reset */ /* do reset */
MACbSoftwareReset(priv); MACbSoftwareReset(priv);
/* reset TSF counter */ /* reset TSF counter */
VNSvOutPortB(dwIoBase + MAC_REG_TFTCTL, TFTCTL_TSFCNTRST); VNSvOutPortB(io_base + MAC_REG_TFTCTL, TFTCTL_TSFCNTRST);
/* enable TSF counter */ /* enable TSF counter */
VNSvOutPortB(dwIoBase + MAC_REG_TFTCTL, TFTCTL_TSFCNTREN); VNSvOutPortB(io_base + MAC_REG_TFTCTL, TFTCTL_TSFCNTREN);
} }
/* /*
@ -572,7 +572,7 @@ void MACvInitialize(struct vnt_private *priv)
* *
* Parameters: * Parameters:
* In: * In:
* dwIoBase - Base Address for MAC * io_base - Base Address for MAC
* dwCurrDescAddr - Descriptor Address * dwCurrDescAddr - Descriptor Address
* Out: * Out:
* none * none
@ -582,24 +582,24 @@ void MACvInitialize(struct vnt_private *priv)
*/ */
void MACvSetCurrRx0DescAddr(struct vnt_private *priv, unsigned long dwCurrDescAddr) void MACvSetCurrRx0DescAddr(struct vnt_private *priv, unsigned long dwCurrDescAddr)
{ {
void __iomem *dwIoBase = priv->PortOffset; void __iomem *io_base = priv->PortOffset;
unsigned short ww; unsigned short ww;
unsigned char byData; unsigned char byData;
unsigned char byOrgDMACtl; unsigned char byOrgDMACtl;
VNSvInPortB(dwIoBase + MAC_REG_RXDMACTL0, &byOrgDMACtl); VNSvInPortB(io_base + MAC_REG_RXDMACTL0, &byOrgDMACtl);
if (byOrgDMACtl & DMACTL_RUN) if (byOrgDMACtl & DMACTL_RUN)
VNSvOutPortB(dwIoBase + MAC_REG_RXDMACTL0+2, DMACTL_RUN); VNSvOutPortB(io_base + MAC_REG_RXDMACTL0+2, DMACTL_RUN);
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortB(dwIoBase + MAC_REG_RXDMACTL0, &byData); VNSvInPortB(io_base + MAC_REG_RXDMACTL0, &byData);
if (!(byData & DMACTL_RUN)) if (!(byData & DMACTL_RUN))
break; break;
} }
VNSvOutPortD(dwIoBase + MAC_REG_RXDMAPTR0, dwCurrDescAddr); VNSvOutPortD(io_base + MAC_REG_RXDMAPTR0, dwCurrDescAddr);
if (byOrgDMACtl & DMACTL_RUN) if (byOrgDMACtl & DMACTL_RUN)
VNSvOutPortB(dwIoBase + MAC_REG_RXDMACTL0, DMACTL_RUN); VNSvOutPortB(io_base + MAC_REG_RXDMACTL0, DMACTL_RUN);
} }
/* /*
@ -608,7 +608,7 @@ void MACvSetCurrRx0DescAddr(struct vnt_private *priv, unsigned long dwCurrDescAd
* *
* Parameters: * Parameters:
* In: * In:
* dwIoBase - Base Address for MAC * io_base - Base Address for MAC
* dwCurrDescAddr - Descriptor Address * dwCurrDescAddr - Descriptor Address
* Out: * Out:
* none * none
@ -618,24 +618,24 @@ void MACvSetCurrRx0DescAddr(struct vnt_private *priv, unsigned long dwCurrDescAd
*/ */
void MACvSetCurrRx1DescAddr(struct vnt_private *priv, unsigned long dwCurrDescAddr) void MACvSetCurrRx1DescAddr(struct vnt_private *priv, unsigned long dwCurrDescAddr)
{ {
void __iomem *dwIoBase = priv->PortOffset; void __iomem *io_base = priv->PortOffset;
unsigned short ww; unsigned short ww;
unsigned char byData; unsigned char byData;
unsigned char byOrgDMACtl; unsigned char byOrgDMACtl;
VNSvInPortB(dwIoBase + MAC_REG_RXDMACTL1, &byOrgDMACtl); VNSvInPortB(io_base + MAC_REG_RXDMACTL1, &byOrgDMACtl);
if (byOrgDMACtl & DMACTL_RUN) if (byOrgDMACtl & DMACTL_RUN)
VNSvOutPortB(dwIoBase + MAC_REG_RXDMACTL1+2, DMACTL_RUN); VNSvOutPortB(io_base + MAC_REG_RXDMACTL1+2, DMACTL_RUN);
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortB(dwIoBase + MAC_REG_RXDMACTL1, &byData); VNSvInPortB(io_base + MAC_REG_RXDMACTL1, &byData);
if (!(byData & DMACTL_RUN)) if (!(byData & DMACTL_RUN))
break; break;
} }
VNSvOutPortD(dwIoBase + MAC_REG_RXDMAPTR1, dwCurrDescAddr); VNSvOutPortD(io_base + MAC_REG_RXDMAPTR1, dwCurrDescAddr);
if (byOrgDMACtl & DMACTL_RUN) if (byOrgDMACtl & DMACTL_RUN)
VNSvOutPortB(dwIoBase + MAC_REG_RXDMACTL1, DMACTL_RUN); VNSvOutPortB(io_base + MAC_REG_RXDMACTL1, DMACTL_RUN);
} }
@ -645,7 +645,7 @@ void MACvSetCurrRx1DescAddr(struct vnt_private *priv, unsigned long dwCurrDescAd
* *
* Parameters: * Parameters:
* In: * In:
* dwIoBase - Base Address for MAC * io_base - Base Address for MAC
* dwCurrDescAddr - Descriptor Address * dwCurrDescAddr - Descriptor Address
* Out: * Out:
* none * none
@ -656,24 +656,24 @@ void MACvSetCurrRx1DescAddr(struct vnt_private *priv, unsigned long dwCurrDescAd
void MACvSetCurrTx0DescAddrEx(struct vnt_private *priv, void MACvSetCurrTx0DescAddrEx(struct vnt_private *priv,
unsigned long dwCurrDescAddr) unsigned long dwCurrDescAddr)
{ {
void __iomem *dwIoBase = priv->PortOffset; void __iomem *io_base = priv->PortOffset;
unsigned short ww; unsigned short ww;
unsigned char byData; unsigned char byData;
unsigned char byOrgDMACtl; unsigned char byOrgDMACtl;
VNSvInPortB(dwIoBase + MAC_REG_TXDMACTL0, &byOrgDMACtl); VNSvInPortB(io_base + MAC_REG_TXDMACTL0, &byOrgDMACtl);
if (byOrgDMACtl & DMACTL_RUN) if (byOrgDMACtl & DMACTL_RUN)
VNSvOutPortB(dwIoBase + MAC_REG_TXDMACTL0+2, DMACTL_RUN); VNSvOutPortB(io_base + MAC_REG_TXDMACTL0+2, DMACTL_RUN);
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortB(dwIoBase + MAC_REG_TXDMACTL0, &byData); VNSvInPortB(io_base + MAC_REG_TXDMACTL0, &byData);
if (!(byData & DMACTL_RUN)) if (!(byData & DMACTL_RUN))
break; break;
} }
VNSvOutPortD(dwIoBase + MAC_REG_TXDMAPTR0, dwCurrDescAddr); VNSvOutPortD(io_base + MAC_REG_TXDMAPTR0, dwCurrDescAddr);
if (byOrgDMACtl & DMACTL_RUN) if (byOrgDMACtl & DMACTL_RUN)
VNSvOutPortB(dwIoBase + MAC_REG_TXDMACTL0, DMACTL_RUN); VNSvOutPortB(io_base + MAC_REG_TXDMACTL0, DMACTL_RUN);
} }
/* /*
@ -682,7 +682,7 @@ void MACvSetCurrTx0DescAddrEx(struct vnt_private *priv,
* *
* Parameters: * Parameters:
* In: * In:
* dwIoBase - Base Address for MAC * io_base - Base Address for MAC
* dwCurrDescAddr - Descriptor Address * dwCurrDescAddr - Descriptor Address
* Out: * Out:
* none * none
@ -694,25 +694,25 @@ void MACvSetCurrTx0DescAddrEx(struct vnt_private *priv,
void MACvSetCurrAC0DescAddrEx(struct vnt_private *priv, void MACvSetCurrAC0DescAddrEx(struct vnt_private *priv,
unsigned long dwCurrDescAddr) unsigned long dwCurrDescAddr)
{ {
void __iomem *dwIoBase = priv->PortOffset; void __iomem *io_base = priv->PortOffset;
unsigned short ww; unsigned short ww;
unsigned char byData; unsigned char byData;
unsigned char byOrgDMACtl; unsigned char byOrgDMACtl;
VNSvInPortB(dwIoBase + MAC_REG_AC0DMACTL, &byOrgDMACtl); VNSvInPortB(io_base + MAC_REG_AC0DMACTL, &byOrgDMACtl);
if (byOrgDMACtl & DMACTL_RUN) if (byOrgDMACtl & DMACTL_RUN)
VNSvOutPortB(dwIoBase + MAC_REG_AC0DMACTL+2, DMACTL_RUN); VNSvOutPortB(io_base + MAC_REG_AC0DMACTL+2, DMACTL_RUN);
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortB(dwIoBase + MAC_REG_AC0DMACTL, &byData); VNSvInPortB(io_base + MAC_REG_AC0DMACTL, &byData);
if (!(byData & DMACTL_RUN)) if (!(byData & DMACTL_RUN))
break; break;
} }
if (ww == W_MAX_TIMEOUT) if (ww == W_MAX_TIMEOUT)
pr_debug(" DBG_PORT80(0x26)\n"); pr_debug(" DBG_PORT80(0x26)\n");
VNSvOutPortD(dwIoBase + MAC_REG_AC0DMAPTR, dwCurrDescAddr); VNSvOutPortD(io_base + MAC_REG_AC0DMAPTR, dwCurrDescAddr);
if (byOrgDMACtl & DMACTL_RUN) if (byOrgDMACtl & DMACTL_RUN)
VNSvOutPortB(dwIoBase + MAC_REG_AC0DMACTL, DMACTL_RUN); VNSvOutPortB(io_base + MAC_REG_AC0DMACTL, DMACTL_RUN);
} }
void MACvSetCurrTXDescAddr(int iTxType, struct vnt_private *priv, void MACvSetCurrTXDescAddr(int iTxType, struct vnt_private *priv,
@ -730,7 +730,7 @@ void MACvSetCurrTXDescAddr(int iTxType, struct vnt_private *priv,
* *
* Parameters: * Parameters:
* In: * In:
* dwIoBase - Base Address for MAC * io_base - Base Address for MAC
* uDelay - Delay time (timer resolution is 4 us) * uDelay - Delay time (timer resolution is 4 us)
* Out: * Out:
* none * none
@ -740,24 +740,24 @@ void MACvSetCurrTXDescAddr(int iTxType, struct vnt_private *priv,
*/ */
void MACvTimer0MicroSDelay(struct vnt_private *priv, unsigned int uDelay) void MACvTimer0MicroSDelay(struct vnt_private *priv, unsigned int uDelay)
{ {
void __iomem *dwIoBase = priv->PortOffset; void __iomem *io_base = priv->PortOffset;
unsigned char byValue; unsigned char byValue;
unsigned int uu, ii; unsigned int uu, ii;
VNSvOutPortB(dwIoBase + MAC_REG_TMCTL0, 0); VNSvOutPortB(io_base + MAC_REG_TMCTL0, 0);
VNSvOutPortD(dwIoBase + MAC_REG_TMDATA0, uDelay); VNSvOutPortD(io_base + MAC_REG_TMDATA0, uDelay);
VNSvOutPortB(dwIoBase + MAC_REG_TMCTL0, (TMCTL_TMD | TMCTL_TE)); VNSvOutPortB(io_base + 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++) { for (uu = 0; uu < uDelay; uu++) {
VNSvInPortB(dwIoBase + MAC_REG_TMCTL0, &byValue); VNSvInPortB(io_base + MAC_REG_TMCTL0, &byValue);
if ((byValue == 0) || if ((byValue == 0) ||
(byValue & TMCTL_TSUSP)) { (byValue & TMCTL_TSUSP)) {
VNSvOutPortB(dwIoBase + MAC_REG_TMCTL0, 0); VNSvOutPortB(io_base + MAC_REG_TMCTL0, 0);
return; return;
} }
} }
} }
VNSvOutPortB(dwIoBase + MAC_REG_TMCTL0, 0); VNSvOutPortB(io_base + MAC_REG_TMCTL0, 0);
} }
/* /*
@ -766,7 +766,7 @@ void MACvTimer0MicroSDelay(struct vnt_private *priv, unsigned int uDelay)
* *
* Parameters: * Parameters:
* In: * In:
* dwIoBase - Base Address for MAC * io_base - Base Address for MAC
* uDelay - Delay time * uDelay - Delay time
* Out: * Out:
* none * none
@ -776,28 +776,28 @@ void MACvTimer0MicroSDelay(struct vnt_private *priv, unsigned int uDelay)
*/ */
void MACvOneShotTimer1MicroSec(struct vnt_private *priv, unsigned int uDelayTime) void MACvOneShotTimer1MicroSec(struct vnt_private *priv, unsigned int uDelayTime)
{ {
void __iomem *dwIoBase = priv->PortOffset; void __iomem *io_base = priv->PortOffset;
VNSvOutPortB(dwIoBase + MAC_REG_TMCTL1, 0); VNSvOutPortB(io_base + MAC_REG_TMCTL1, 0);
VNSvOutPortD(dwIoBase + MAC_REG_TMDATA1, uDelayTime); VNSvOutPortD(io_base + MAC_REG_TMDATA1, uDelayTime);
VNSvOutPortB(dwIoBase + MAC_REG_TMCTL1, (TMCTL_TMD | TMCTL_TE)); VNSvOutPortB(io_base + MAC_REG_TMCTL1, (TMCTL_TMD | TMCTL_TE));
} }
void MACvSetMISCFifo(struct vnt_private *priv, unsigned short wOffset, void MACvSetMISCFifo(struct vnt_private *priv, unsigned short wOffset,
unsigned long dwData) unsigned long dwData)
{ {
void __iomem *dwIoBase = priv->PortOffset; void __iomem *io_base = priv->PortOffset;
if (wOffset > 273) if (wOffset > 273)
return; return;
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset); VNSvOutPortW(io_base + MAC_REG_MISCFFNDEX, wOffset);
VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, dwData); VNSvOutPortD(io_base + MAC_REG_MISCFFDATA, dwData);
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE); VNSvOutPortW(io_base + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
} }
bool MACbPSWakeup(struct vnt_private *priv) bool MACbPSWakeup(struct vnt_private *priv)
{ {
void __iomem *dwIoBase = priv->PortOffset; void __iomem *io_base = priv->PortOffset;
unsigned char byOrgValue; unsigned char byOrgValue;
unsigned int ww; unsigned int ww;
/* Read PSCTL */ /* Read PSCTL */
@ -805,11 +805,11 @@ bool MACbPSWakeup(struct vnt_private *priv)
return true; return true;
/* Disable PS */ /* Disable PS */
MACvRegBitsOff(dwIoBase, MAC_REG_PSCTL, PSCTL_PSEN); MACvRegBitsOff(io_base, MAC_REG_PSCTL, PSCTL_PSEN);
/* Check if SyncFlushOK */ /* Check if SyncFlushOK */
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortB(dwIoBase + MAC_REG_PSCTL, &byOrgValue); VNSvInPortB(io_base + MAC_REG_PSCTL, &byOrgValue);
if (byOrgValue & PSCTL_WAKEDONE) if (byOrgValue & PSCTL_WAKEDONE)
break; break;
} }
@ -826,7 +826,7 @@ bool MACbPSWakeup(struct vnt_private *priv)
* *
* Parameters: * Parameters:
* In: * In:
* dwIoBase - Base Address for MAC * io_base - Base Address for MAC
* *
* Out: * Out:
* none * none
@ -840,7 +840,7 @@ void MACvSetKeyEntry(struct vnt_private *priv, unsigned short wKeyCtl,
unsigned char *pbyAddr, u32 *pdwKey, unsigned char *pbyAddr, u32 *pdwKey,
unsigned char byLocalID) unsigned char byLocalID)
{ {
void __iomem *dwIoBase = priv->PortOffset; void __iomem *io_base = priv->PortOffset;
unsigned short wOffset; unsigned short wOffset;
u32 dwData; u32 dwData;
int ii; int ii;
@ -859,9 +859,9 @@ void MACvSetKeyEntry(struct vnt_private *priv, unsigned short wKeyCtl,
pr_debug("1. wOffset: %d, Data: %X, KeyCtl:%X\n", pr_debug("1. wOffset: %d, Data: %X, KeyCtl:%X\n",
wOffset, dwData, wKeyCtl); wOffset, dwData, wKeyCtl);
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset); VNSvOutPortW(io_base + MAC_REG_MISCFFNDEX, wOffset);
VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, dwData); VNSvOutPortD(io_base + MAC_REG_MISCFFDATA, dwData);
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE); VNSvOutPortW(io_base + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
wOffset++; wOffset++;
dwData = 0; dwData = 0;
@ -874,9 +874,9 @@ void MACvSetKeyEntry(struct vnt_private *priv, unsigned short wKeyCtl,
dwData |= *(pbyAddr+0); dwData |= *(pbyAddr+0);
pr_debug("2. wOffset: %d, Data: %X\n", wOffset, dwData); pr_debug("2. wOffset: %d, Data: %X\n", wOffset, dwData);
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset); VNSvOutPortW(io_base + MAC_REG_MISCFFNDEX, wOffset);
VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, dwData); VNSvOutPortD(io_base + MAC_REG_MISCFFDATA, dwData);
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE); VNSvOutPortW(io_base + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
wOffset++; wOffset++;
wOffset += (uKeyIdx * 4); wOffset += (uKeyIdx * 4);
@ -884,9 +884,9 @@ void MACvSetKeyEntry(struct vnt_private *priv, unsigned short wKeyCtl,
/* always push 128 bits */ /* always push 128 bits */
pr_debug("3.(%d) wOffset: %d, Data: %X\n", pr_debug("3.(%d) wOffset: %d, Data: %X\n",
ii, wOffset+ii, *pdwKey); ii, wOffset+ii, *pdwKey);
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset+ii); VNSvOutPortW(io_base + MAC_REG_MISCFFNDEX, wOffset+ii);
VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, *pdwKey++); VNSvOutPortD(io_base + MAC_REG_MISCFFDATA, *pdwKey++);
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE); VNSvOutPortW(io_base + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
} }
} }
@ -896,7 +896,7 @@ void MACvSetKeyEntry(struct vnt_private *priv, unsigned short wKeyCtl,
* *
* Parameters: * Parameters:
* In: * In:
* dwIoBase - Base Address for MAC * io_base - Base Address for MAC
* *
* Out: * Out:
* none * none
@ -906,13 +906,13 @@ void MACvSetKeyEntry(struct vnt_private *priv, unsigned short wKeyCtl,
*/ */
void MACvDisableKeyEntry(struct vnt_private *priv, unsigned int uEntryIdx) void MACvDisableKeyEntry(struct vnt_private *priv, unsigned int uEntryIdx)
{ {
void __iomem *dwIoBase = priv->PortOffset; void __iomem *io_base = priv->PortOffset;
unsigned short wOffset; unsigned short wOffset;
wOffset = MISCFIFO_KEYETRY0; wOffset = MISCFIFO_KEYETRY0;
wOffset += (uEntryIdx * MISCFIFO_KEYENTRYSIZE); wOffset += (uEntryIdx * MISCFIFO_KEYENTRYSIZE);
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset); VNSvOutPortW(io_base + MAC_REG_MISCFFNDEX, wOffset);
VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, 0); VNSvOutPortD(io_base + MAC_REG_MISCFFDATA, 0);
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE); VNSvOutPortW(io_base + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
} }