*
* Parameters:
* In:
- * dwIoBase - Base Address for MAC
+ * io_base - Base Address for MAC
* byRegOfs - Offset of MAC Register
* byTestBits - Test bits
* Out:
bool MACbIsRegBitsOn(struct vnt_private *priv, unsigned char byRegOfs,
unsigned char byTestBits)
{
- void __iomem *dwIoBase = priv->PortOffset;
+ void __iomem *io_base = priv->PortOffset;
unsigned char byData;
- VNSvInPortB(dwIoBase + byRegOfs, &byData);
+ VNSvInPortB(io_base + byRegOfs, &byData);
return (byData & byTestBits) == byTestBits;
}
*
* Parameters:
* In:
- * dwIoBase - Base Address for MAC
+ * io_base - Base Address for MAC
* byRegOfs - Offset of MAC Register
* byTestBits - Test bits
* Out:
bool MACbIsRegBitsOff(struct vnt_private *priv, unsigned char byRegOfs,
unsigned char byTestBits)
{
- void __iomem *dwIoBase = priv->PortOffset;
+ void __iomem *io_base = priv->PortOffset;
unsigned char byData;
- VNSvInPortB(dwIoBase + byRegOfs, &byData);
+ VNSvInPortB(io_base + byRegOfs, &byData);
return !(byData & byTestBits);
}
*
* Parameters:
* In:
- * dwIoBase - Base Address for MAC
+ * io_base - Base Address for MAC
* Out:
* none
*
*/
bool MACbIsIntDisable(struct vnt_private *priv)
{
- void __iomem *dwIoBase = priv->PortOffset;
+ void __iomem *io_base = priv->PortOffset;
unsigned long dwData;
- VNSvInPortD(dwIoBase + MAC_REG_IMR, &dwData);
+ VNSvInPortD(io_base + MAC_REG_IMR, &dwData);
if (dwData != 0)
return false;
*
* Parameters:
* In:
- * dwIoBase - Base Address for MAC
+ * io_base - Base Address for MAC
* byRetryLimit- Retry Limit
* Out:
* none
*/
void MACvSetShortRetryLimit(struct vnt_private *priv, unsigned char byRetryLimit)
{
- void __iomem *dwIoBase = priv->PortOffset;
+ void __iomem *io_base = priv->PortOffset;
/* set SRT */
- VNSvOutPortB(dwIoBase + MAC_REG_SRT, byRetryLimit);
+ VNSvOutPortB(io_base + MAC_REG_SRT, byRetryLimit);
}
*
* Parameters:
* In:
- * dwIoBase - Base Address for MAC
+ * io_base - Base Address for MAC
* byRetryLimit- Retry Limit
* Out:
* none
*/
void MACvSetLongRetryLimit(struct vnt_private *priv, unsigned char byRetryLimit)
{
- void __iomem *dwIoBase = priv->PortOffset;
+ void __iomem *io_base = priv->PortOffset;
/* set LRT */
- VNSvOutPortB(dwIoBase + MAC_REG_LRT, byRetryLimit);
+ VNSvOutPortB(io_base + MAC_REG_LRT, byRetryLimit);
}
/*
*
* Parameters:
* In:
- * dwIoBase - Base Address for MAC
+ * io_base - Base Address for MAC
* byLoopbackMode - Loopback Mode
* Out:
* none
*/
void MACvSetLoopbackMode(struct vnt_private *priv, unsigned char byLoopbackMode)
{
- void __iomem *dwIoBase = priv->PortOffset;
+ void __iomem *io_base = priv->PortOffset;
unsigned char byOrgValue;
byLoopbackMode <<= 6;
/* set TCR */
- VNSvInPortB(dwIoBase + MAC_REG_TEST, &byOrgValue);
+ VNSvInPortB(io_base + MAC_REG_TEST, &byOrgValue);
byOrgValue = byOrgValue & 0x3F;
byOrgValue = byOrgValue | byLoopbackMode;
- VNSvOutPortB(dwIoBase + MAC_REG_TEST, byOrgValue);
+ VNSvOutPortB(io_base + MAC_REG_TEST, byOrgValue);
}
/*
*
* Parameters:
* In:
- * dwIoBase - Base Address for MAC
+ * io_base - Base Address for MAC
* Out:
* pbyCxtBuf - Context buffer
*
*/
void MACvSaveContext(struct vnt_private *priv, unsigned char *pbyCxtBuf)
{
- void __iomem *dwIoBase = priv->PortOffset;
+ void __iomem *io_base = priv->PortOffset;
int ii;
/* read page0 register */
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 */
for (ii = 0; ii < MAC_MAX_CONTEXT_SIZE_PAGE1; ii++)
- VNSvInPortB((dwIoBase + ii),
+ VNSvInPortB((io_base + ii),
(pbyCxtBuf + MAC_MAX_CONTEXT_SIZE_PAGE0 + ii));
- MACvSelectPage0(dwIoBase);
+ MACvSelectPage0(io_base);
}
/*
*
* Parameters:
* In:
- * dwIoBase - Base Address for MAC
+ * io_base - Base Address for MAC
* pbyCxtBuf - Context buffer
* Out:
* none
*/
void MACvRestoreContext(struct vnt_private *priv, unsigned char *pbyCxtBuf)
{
- void __iomem *dwIoBase = priv->PortOffset;
+ void __iomem *io_base = priv->PortOffset;
int ii;
- MACvSelectPage1(dwIoBase);
+ MACvSelectPage1(io_base);
/* restore page1 */
for (ii = 0; ii < MAC_MAX_CONTEXT_SIZE_PAGE1; ii++)
- VNSvOutPortB((dwIoBase + ii),
+ VNSvOutPortB((io_base + ii),
*(pbyCxtBuf + MAC_MAX_CONTEXT_SIZE_PAGE0 + ii));
- MACvSelectPage0(dwIoBase);
+ MACvSelectPage0(io_base);
/* restore RCR,TCR,IMR... */
for (ii = MAC_REG_RCR; ii < MAC_REG_ISR; ii++)
- VNSvOutPortB(dwIoBase + ii, *(pbyCxtBuf + ii));
+ VNSvOutPortB(io_base + ii, *(pbyCxtBuf + ii));
/* restore MAC Config. */
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. */
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 */
- VNSvOutPortD(dwIoBase + MAC_REG_TXDMAPTR0,
+ VNSvOutPortD(io_base + 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));
- VNSvOutPortD(dwIoBase + MAC_REG_BCNDMAPTR,
+ VNSvOutPortD(io_base + 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));
- VNSvOutPortD(dwIoBase + MAC_REG_RXDMAPTR1,
+ VNSvOutPortD(io_base + MAC_REG_RXDMAPTR1,
*(unsigned long *)(pbyCxtBuf + MAC_REG_RXDMAPTR1));
}
*
* Parameters:
* In:
- * dwIoBase - Base Address for MAC
+ * io_base - Base Address for MAC
* Out:
* none
*
*/
bool MACbSoftwareReset(struct vnt_private *priv)
{
- void __iomem *dwIoBase = priv->PortOffset;
+ void __iomem *io_base = priv->PortOffset;
unsigned char byData;
unsigned short ww;
/* 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++) {
- VNSvInPortB(dwIoBase + MAC_REG_HOSTCR, &byData);
+ VNSvInPortB(io_base + MAC_REG_HOSTCR, &byData);
if (!(byData & HOSTCR_SOFTRST))
break;
}
*
* Parameters:
* In:
- * dwIoBase - Base Address for MAC
+ * io_base - Base Address for MAC
* Out:
* none
*
*
* Parameters:
* In:
- * dwIoBase - Base Address for MAC
+ * io_base - Base Address for MAC
* Out:
* none
*
*/
bool MACbSafeRxOff(struct vnt_private *priv)
{
- void __iomem *dwIoBase = priv->PortOffset;
+ void __iomem *io_base = priv->PortOffset;
unsigned short ww;
unsigned long dwData;
unsigned char byData;
/* turn off wow temp for turn off Rx safely */
/* Clear RX DMA0,1 */
- VNSvOutPortD(dwIoBase + MAC_REG_RXDMACTL0, DMACTL_CLRRUN);
- VNSvOutPortD(dwIoBase + MAC_REG_RXDMACTL1, DMACTL_CLRRUN);
+ VNSvOutPortD(io_base + MAC_REG_RXDMACTL0, DMACTL_CLRRUN);
+ VNSvOutPortD(io_base + MAC_REG_RXDMACTL1, DMACTL_CLRRUN);
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))
break;
}
return false;
}
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))
break;
}
}
/* 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 */
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))
break;
}
*
* Parameters:
* In:
- * dwIoBase - Base Address for MAC
+ * io_base - Base Address for MAC
* Out:
* none
*
*/
bool MACbSafeTxOff(struct vnt_private *priv)
{
- void __iomem *dwIoBase = priv->PortOffset;
+ void __iomem *io_base = priv->PortOffset;
unsigned short ww;
unsigned long dwData;
unsigned char byData;
/* Clear TX DMA */
/* Tx0 */
- VNSvOutPortD(dwIoBase + MAC_REG_TXDMACTL0, DMACTL_CLRRUN);
+ VNSvOutPortD(io_base + MAC_REG_TXDMACTL0, DMACTL_CLRRUN);
/* AC0 */
- VNSvOutPortD(dwIoBase + MAC_REG_AC0DMACTL, DMACTL_CLRRUN);
+ VNSvOutPortD(io_base + MAC_REG_AC0DMACTL, DMACTL_CLRRUN);
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))
break;
}
return false;
}
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))
break;
}
}
/* 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 */
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))
break;
}
*
* Parameters:
* In:
- * dwIoBase - Base Address for MAC
+ * io_base - Base Address for MAC
* Out:
* none
*
*/
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)) {
pr_debug(" MACbSafeRxOff == false)\n");
return false;
}
- MACvRegBitsOff(dwIoBase, MAC_REG_HOSTCR, HOSTCR_MACEN);
+ MACvRegBitsOff(io_base, MAC_REG_HOSTCR, HOSTCR_MACEN);
return true;
}
*
* Parameters:
* In:
- * dwIoBase - Base Address for MAC
+ * io_base - Base Address for MAC
* Out:
* none
*
*/
bool MACbShutdown(struct vnt_private *priv)
{
- void __iomem *dwIoBase = priv->PortOffset;
+ void __iomem *io_base = priv->PortOffset;
/* disable MAC IMR */
- MACvIntDisable(dwIoBase);
+ MACvIntDisable(io_base);
MACvSetLoopbackMode(priv, MAC_LB_INTERNAL);
/* stop the adapter */
if (!MACbSafeStop(priv)) {
*
* Parameters:
* In:
- * dwIoBase - Base Address for MAC
+ * io_base - Base Address for MAC
* Out:
* none
*
*/
void MACvInitialize(struct vnt_private *priv)
{
- void __iomem *dwIoBase = priv->PortOffset;
+ void __iomem *io_base = priv->PortOffset;
/* clear sticky bits */
- MACvClearStckDS(dwIoBase);
+ MACvClearStckDS(io_base);
/* disable force PME-enable */
- VNSvOutPortB(dwIoBase + MAC_REG_PMC1, PME_OVR);
+ VNSvOutPortB(io_base + MAC_REG_PMC1, PME_OVR);
/* only 3253 A */
/* do reset */
MACbSoftwareReset(priv);
/* reset TSF counter */
- VNSvOutPortB(dwIoBase + MAC_REG_TFTCTL, TFTCTL_TSFCNTRST);
+ VNSvOutPortB(io_base + MAC_REG_TFTCTL, TFTCTL_TSFCNTRST);
/* enable TSF counter */
- VNSvOutPortB(dwIoBase + MAC_REG_TFTCTL, TFTCTL_TSFCNTREN);
+ VNSvOutPortB(io_base + MAC_REG_TFTCTL, TFTCTL_TSFCNTREN);
}
/*
*
* Parameters:
* In:
- * dwIoBase - Base Address for MAC
+ * io_base - Base Address for MAC
* dwCurrDescAddr - Descriptor Address
* Out:
* none
*/
void MACvSetCurrRx0DescAddr(struct vnt_private *priv, unsigned long dwCurrDescAddr)
{
- void __iomem *dwIoBase = priv->PortOffset;
+ void __iomem *io_base = priv->PortOffset;
unsigned short ww;
unsigned char byData;
unsigned char byOrgDMACtl;
- VNSvInPortB(dwIoBase + MAC_REG_RXDMACTL0, &byOrgDMACtl);
+ VNSvInPortB(io_base + MAC_REG_RXDMACTL0, &byOrgDMACtl);
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++) {
- VNSvInPortB(dwIoBase + MAC_REG_RXDMACTL0, &byData);
+ VNSvInPortB(io_base + MAC_REG_RXDMACTL0, &byData);
if (!(byData & DMACTL_RUN))
break;
}
- VNSvOutPortD(dwIoBase + MAC_REG_RXDMAPTR0, dwCurrDescAddr);
+ VNSvOutPortD(io_base + MAC_REG_RXDMAPTR0, dwCurrDescAddr);
if (byOrgDMACtl & DMACTL_RUN)
- VNSvOutPortB(dwIoBase + MAC_REG_RXDMACTL0, DMACTL_RUN);
+ VNSvOutPortB(io_base + MAC_REG_RXDMACTL0, DMACTL_RUN);
}
/*
*
* Parameters:
* In:
- * dwIoBase - Base Address for MAC
+ * io_base - Base Address for MAC
* dwCurrDescAddr - Descriptor Address
* Out:
* none
*/
void MACvSetCurrRx1DescAddr(struct vnt_private *priv, unsigned long dwCurrDescAddr)
{
- void __iomem *dwIoBase = priv->PortOffset;
+ void __iomem *io_base = priv->PortOffset;
unsigned short ww;
unsigned char byData;
unsigned char byOrgDMACtl;
- VNSvInPortB(dwIoBase + MAC_REG_RXDMACTL1, &byOrgDMACtl);
+ VNSvInPortB(io_base + MAC_REG_RXDMACTL1, &byOrgDMACtl);
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++) {
- VNSvInPortB(dwIoBase + MAC_REG_RXDMACTL1, &byData);
+ VNSvInPortB(io_base + MAC_REG_RXDMACTL1, &byData);
if (!(byData & DMACTL_RUN))
break;
}
- VNSvOutPortD(dwIoBase + MAC_REG_RXDMAPTR1, dwCurrDescAddr);
+ VNSvOutPortD(io_base + MAC_REG_RXDMAPTR1, dwCurrDescAddr);
if (byOrgDMACtl & DMACTL_RUN)
- VNSvOutPortB(dwIoBase + MAC_REG_RXDMACTL1, DMACTL_RUN);
+ VNSvOutPortB(io_base + MAC_REG_RXDMACTL1, DMACTL_RUN);
}
*
* Parameters:
* In:
- * dwIoBase - Base Address for MAC
+ * io_base - Base Address for MAC
* dwCurrDescAddr - Descriptor Address
* Out:
* none
void MACvSetCurrTx0DescAddrEx(struct vnt_private *priv,
unsigned long dwCurrDescAddr)
{
- void __iomem *dwIoBase = priv->PortOffset;
+ void __iomem *io_base = priv->PortOffset;
unsigned short ww;
unsigned char byData;
unsigned char byOrgDMACtl;
- VNSvInPortB(dwIoBase + MAC_REG_TXDMACTL0, &byOrgDMACtl);
+ VNSvInPortB(io_base + MAC_REG_TXDMACTL0, &byOrgDMACtl);
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++) {
- VNSvInPortB(dwIoBase + MAC_REG_TXDMACTL0, &byData);
+ VNSvInPortB(io_base + MAC_REG_TXDMACTL0, &byData);
if (!(byData & DMACTL_RUN))
break;
}
- VNSvOutPortD(dwIoBase + MAC_REG_TXDMAPTR0, dwCurrDescAddr);
+ VNSvOutPortD(io_base + MAC_REG_TXDMAPTR0, dwCurrDescAddr);
if (byOrgDMACtl & DMACTL_RUN)
- VNSvOutPortB(dwIoBase + MAC_REG_TXDMACTL0, DMACTL_RUN);
+ VNSvOutPortB(io_base + MAC_REG_TXDMACTL0, DMACTL_RUN);
}
/*
*
* Parameters:
* In:
- * dwIoBase - Base Address for MAC
+ * io_base - Base Address for MAC
* dwCurrDescAddr - Descriptor Address
* Out:
* none
void MACvSetCurrAC0DescAddrEx(struct vnt_private *priv,
unsigned long dwCurrDescAddr)
{
- void __iomem *dwIoBase = priv->PortOffset;
+ void __iomem *io_base = priv->PortOffset;
unsigned short ww;
unsigned char byData;
unsigned char byOrgDMACtl;
- VNSvInPortB(dwIoBase + MAC_REG_AC0DMACTL, &byOrgDMACtl);
+ VNSvInPortB(io_base + MAC_REG_AC0DMACTL, &byOrgDMACtl);
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++) {
- VNSvInPortB(dwIoBase + MAC_REG_AC0DMACTL, &byData);
+ VNSvInPortB(io_base + MAC_REG_AC0DMACTL, &byData);
if (!(byData & DMACTL_RUN))
break;
}
if (ww == W_MAX_TIMEOUT)
pr_debug(" DBG_PORT80(0x26)\n");
- VNSvOutPortD(dwIoBase + MAC_REG_AC0DMAPTR, dwCurrDescAddr);
+ VNSvOutPortD(io_base + MAC_REG_AC0DMAPTR, dwCurrDescAddr);
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,
*
* Parameters:
* In:
- * dwIoBase - Base Address for MAC
+ * io_base - Base Address for MAC
* uDelay - Delay time (timer resolution is 4 us)
* Out:
* none
*/
void MACvTimer0MicroSDelay(struct vnt_private *priv, unsigned int uDelay)
{
- void __iomem *dwIoBase = priv->PortOffset;
+ void __iomem *io_base = priv->PortOffset;
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));
+ VNSvOutPortB(io_base + MAC_REG_TMCTL0, 0);
+ VNSvOutPortD(io_base + MAC_REG_TMDATA0, uDelay);
+ VNSvOutPortB(io_base + MAC_REG_TMCTL0, (TMCTL_TMD | TMCTL_TE));
for (ii = 0; ii < 66; ii++) { /* assume max PCI clock is 66Mhz */
for (uu = 0; uu < uDelay; uu++) {
- VNSvInPortB(dwIoBase + MAC_REG_TMCTL0, &byValue);
+ VNSvInPortB(io_base + MAC_REG_TMCTL0, &byValue);
if ((byValue == 0) ||
(byValue & TMCTL_TSUSP)) {
- VNSvOutPortB(dwIoBase + MAC_REG_TMCTL0, 0);
+ VNSvOutPortB(io_base + MAC_REG_TMCTL0, 0);
return;
}
}
}
- VNSvOutPortB(dwIoBase + MAC_REG_TMCTL0, 0);
+ VNSvOutPortB(io_base + MAC_REG_TMCTL0, 0);
}
/*
*
* Parameters:
* In:
- * dwIoBase - Base Address for MAC
+ * io_base - Base Address for MAC
* uDelay - Delay time
* Out:
* none
*/
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);
- VNSvOutPortD(dwIoBase + MAC_REG_TMDATA1, uDelayTime);
- VNSvOutPortB(dwIoBase + MAC_REG_TMCTL1, (TMCTL_TMD | TMCTL_TE));
+ VNSvOutPortB(io_base + MAC_REG_TMCTL1, 0);
+ VNSvOutPortD(io_base + MAC_REG_TMDATA1, uDelayTime);
+ VNSvOutPortB(io_base + MAC_REG_TMCTL1, (TMCTL_TMD | TMCTL_TE));
}
void MACvSetMISCFifo(struct vnt_private *priv, unsigned short wOffset,
unsigned long dwData)
{
- void __iomem *dwIoBase = priv->PortOffset;
+ void __iomem *io_base = priv->PortOffset;
if (wOffset > 273)
return;
- VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset);
- VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, dwData);
- VNSvOutPortW(dwIoBase + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
+ VNSvOutPortW(io_base + MAC_REG_MISCFFNDEX, wOffset);
+ VNSvOutPortD(io_base + MAC_REG_MISCFFDATA, dwData);
+ VNSvOutPortW(io_base + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
}
bool MACbPSWakeup(struct vnt_private *priv)
{
- void __iomem *dwIoBase = priv->PortOffset;
+ void __iomem *io_base = priv->PortOffset;
unsigned char byOrgValue;
unsigned int ww;
/* Read PSCTL */
return true;
/* Disable PS */
- MACvRegBitsOff(dwIoBase, MAC_REG_PSCTL, PSCTL_PSEN);
+ MACvRegBitsOff(io_base, MAC_REG_PSCTL, PSCTL_PSEN);
/* Check if SyncFlushOK */
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)
break;
}
*
* Parameters:
* In:
- * dwIoBase - Base Address for MAC
+ * io_base - Base Address for MAC
*
* Out:
* none
unsigned char *pbyAddr, u32 *pdwKey,
unsigned char byLocalID)
{
- void __iomem *dwIoBase = priv->PortOffset;
+ void __iomem *io_base = priv->PortOffset;
unsigned short wOffset;
u32 dwData;
int ii;
pr_debug("1. wOffset: %d, Data: %X, KeyCtl:%X\n",
wOffset, dwData, wKeyCtl);
- VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset);
- VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, dwData);
- VNSvOutPortW(dwIoBase + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
+ VNSvOutPortW(io_base + MAC_REG_MISCFFNDEX, wOffset);
+ VNSvOutPortD(io_base + MAC_REG_MISCFFDATA, dwData);
+ VNSvOutPortW(io_base + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
wOffset++;
dwData = 0;
dwData |= *(pbyAddr+0);
pr_debug("2. wOffset: %d, Data: %X\n", wOffset, dwData);
- VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset);
- VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, dwData);
- VNSvOutPortW(dwIoBase + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
+ VNSvOutPortW(io_base + MAC_REG_MISCFFNDEX, wOffset);
+ VNSvOutPortD(io_base + MAC_REG_MISCFFDATA, dwData);
+ VNSvOutPortW(io_base + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
wOffset++;
wOffset += (uKeyIdx * 4);
/* always push 128 bits */
pr_debug("3.(%d) wOffset: %d, Data: %X\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);
+ VNSvOutPortW(io_base + MAC_REG_MISCFFNDEX, wOffset+ii);
+ VNSvOutPortD(io_base + MAC_REG_MISCFFDATA, *pdwKey++);
+ VNSvOutPortW(io_base + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
}
}
*
* Parameters:
* In:
- * dwIoBase - Base Address for MAC
+ * io_base - Base Address for MAC
*
* Out:
* none
*/
void MACvDisableKeyEntry(struct vnt_private *priv, unsigned int uEntryIdx)
{
- void __iomem *dwIoBase = priv->PortOffset;
+ void __iomem *io_base = priv->PortOffset;
unsigned short wOffset;
wOffset = MISCFIFO_KEYETRY0;
wOffset += (uEntryIdx * MISCFIFO_KEYENTRYSIZE);
- VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset);
- VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, 0);
- VNSvOutPortW(dwIoBase + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
+ VNSvOutPortW(io_base + MAC_REG_MISCFFNDEX, wOffset);
+ VNSvOutPortD(io_base + MAC_REG_MISCFFDATA, 0);
+ VNSvOutPortW(io_base + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
}