2016-03-06 12:57:26

by Malcolm Priestley

[permalink] [raw]
Subject: [PATCH 01/13] staging: vt6655: mac.c rename pbyCxtBuf to cxt_buf

Removing camel case and type prefix.

Signed-off-by: Malcolm Priestley <[email protected]>
---
Following on from patch
MACvSaveContext use memcpy_fromio to read context.

drivers/staging/vt6655/mac.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index 66ae991..9c4dabd 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -202,22 +202,22 @@ void MACvSetLoopbackMode(struct vnt_private *priv, unsigned char byLoopbackMode)
* In:
* io_base - Base Address for MAC
* Out:
- * pbyCxtBuf - Context buffer
+ * cxt_buf - Context buffer
*
* Return Value: none
*
*/
-void MACvSaveContext(struct vnt_private *priv, unsigned char *pbyCxtBuf)
+void MACvSaveContext(struct vnt_private *priv, unsigned char *cxt_buf)
{
void __iomem *io_base = priv->PortOffset;

/* read page0 register */
- memcpy_fromio(pbyCxtBuf, io_base, MAC_MAX_CONTEXT_SIZE_PAGE0);
+ memcpy_fromio(cxt_buf, io_base, MAC_MAX_CONTEXT_SIZE_PAGE0);

MACvSelectPage1(io_base);

/* read page1 register */
- memcpy_fromio(pbyCxtBuf + MAC_MAX_CONTEXT_SIZE_PAGE0, io_base,
+ memcpy_fromio(cxt_buf + MAC_MAX_CONTEXT_SIZE_PAGE0, io_base,
MAC_MAX_CONTEXT_SIZE_PAGE1);

MACvSelectPage0(io_base);
@@ -230,14 +230,14 @@ void MACvSaveContext(struct vnt_private *priv, unsigned char *pbyCxtBuf)
* Parameters:
* In:
* io_base - Base Address for MAC
- * pbyCxtBuf - Context buffer
+ * cxt_buf - Context buffer
* Out:
* none
*
* Return Value: none
*
*/
-void MACvRestoreContext(struct vnt_private *priv, unsigned char *pbyCxtBuf)
+void MACvRestoreContext(struct vnt_private *priv, unsigned char *cxt_buf)
{
void __iomem *io_base = priv->PortOffset;
int ii;
@@ -246,37 +246,37 @@ void MACvRestoreContext(struct vnt_private *priv, unsigned char *pbyCxtBuf)
/* restore page1 */
for (ii = 0; ii < MAC_MAX_CONTEXT_SIZE_PAGE1; ii++)
VNSvOutPortB((io_base + ii),
- *(pbyCxtBuf + MAC_MAX_CONTEXT_SIZE_PAGE0 + ii));
+ *(cxt_buf + MAC_MAX_CONTEXT_SIZE_PAGE0 + ii));

MACvSelectPage0(io_base);

/* restore RCR,TCR,IMR... */
for (ii = MAC_REG_RCR; ii < MAC_REG_ISR; ii++)
- VNSvOutPortB(io_base + ii, *(pbyCxtBuf + ii));
+ VNSvOutPortB(io_base + ii, *(cxt_buf + ii));

/* restore MAC Config. */
for (ii = MAC_REG_LRT; ii < MAC_REG_PAGE1SEL; ii++)
- VNSvOutPortB(io_base + ii, *(pbyCxtBuf + ii));
+ VNSvOutPortB(io_base + ii, *(cxt_buf + ii));

- VNSvOutPortB(io_base + MAC_REG_CFG, *(pbyCxtBuf + MAC_REG_CFG));
+ VNSvOutPortB(io_base + MAC_REG_CFG, *(cxt_buf + MAC_REG_CFG));

/* restore PS Config. */
for (ii = MAC_REG_PSCFG; ii < MAC_REG_BBREGCTL; ii++)
- VNSvOutPortB(io_base + ii, *(pbyCxtBuf + ii));
+ VNSvOutPortB(io_base + ii, *(cxt_buf + ii));

/* restore CURR_RX_DESC_ADDR, CURR_TX_DESC_ADDR */
VNSvOutPortD(io_base + MAC_REG_TXDMAPTR0,
- *(unsigned long *)(pbyCxtBuf + MAC_REG_TXDMAPTR0));
+ *(unsigned long *)(cxt_buf + MAC_REG_TXDMAPTR0));
VNSvOutPortD(io_base + MAC_REG_AC0DMAPTR,
- *(unsigned long *)(pbyCxtBuf + MAC_REG_AC0DMAPTR));
+ *(unsigned long *)(cxt_buf + MAC_REG_AC0DMAPTR));
VNSvOutPortD(io_base + MAC_REG_BCNDMAPTR,
- *(unsigned long *)(pbyCxtBuf + MAC_REG_BCNDMAPTR));
+ *(unsigned long *)(cxt_buf + MAC_REG_BCNDMAPTR));

VNSvOutPortD(io_base + MAC_REG_RXDMAPTR0,
- *(unsigned long *)(pbyCxtBuf + MAC_REG_RXDMAPTR0));
+ *(unsigned long *)(cxt_buf + MAC_REG_RXDMAPTR0));

VNSvOutPortD(io_base + MAC_REG_RXDMAPTR1,
- *(unsigned long *)(pbyCxtBuf + MAC_REG_RXDMAPTR1));
+ *(unsigned long *)(cxt_buf + MAC_REG_RXDMAPTR1));
}

/*
--
2.7.0



2016-03-06 12:57:34

by Malcolm Priestley

[permalink] [raw]
Subject: [PATCH 08/13] staging: vt6655: MACvSetLoopbackMode replace byOrgValue with ioread8

Removing VNSvInPortB and nesting inside iowrite8.

Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/mac.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index 6499709..ece2bf0 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -184,14 +184,11 @@ void MACvSetLongRetryLimit(struct vnt_private *priv, unsigned char byRetryLimit)
void MACvSetLoopbackMode(struct vnt_private *priv, unsigned char byLoopbackMode)
{
void __iomem *io_base = priv->PortOffset;
- unsigned char byOrgValue;

byLoopbackMode <<= 6;
/* set TCR */
- VNSvInPortB(io_base + MAC_REG_TEST, &byOrgValue);
- byOrgValue = byOrgValue & 0x3F;
- byOrgValue = byOrgValue | byLoopbackMode;
- iowrite8(byOrgValue, io_base + MAC_REG_TEST);
+ iowrite8((ioread8(io_base + MAC_REG_TEST) & 0x3f) | byLoopbackMode,
+ io_base + MAC_REG_TEST);
}

/*
--
2.7.0


2016-03-06 12:57:35

by Malcolm Priestley

[permalink] [raw]
Subject: [PATCH 10/13] staging: vt6655: mac Replace dwCurrDescAddr with curr_desc_addr.

Removing camel case and type prefix.

Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/mac.c | 30 +++++++++++++++---------------
drivers/staging/vt6655/mac.h | 14 +++++++-------
2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index a1be62d..d44026b 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -545,14 +545,14 @@ void MACvInitialize(struct vnt_private *priv)
* Parameters:
* In:
* io_base - Base Address for MAC
- * dwCurrDescAddr - Descriptor Address
+ * curr_desc_addr - Descriptor Address
* Out:
* none
*
* Return Value: none
*
*/
-void MACvSetCurrRx0DescAddr(struct vnt_private *priv, u32 dwCurrDescAddr)
+void MACvSetCurrRx0DescAddr(struct vnt_private *priv, u32 curr_desc_addr)
{
void __iomem *io_base = priv->PortOffset;
unsigned short ww;
@@ -567,7 +567,7 @@ void MACvSetCurrRx0DescAddr(struct vnt_private *priv, u32 dwCurrDescAddr)
break;
}

- iowrite32(dwCurrDescAddr, io_base + MAC_REG_RXDMAPTR0);
+ iowrite32(curr_desc_addr, io_base + MAC_REG_RXDMAPTR0);
if (byOrgDMACtl & DMACTL_RUN)
iowrite8(DMACTL_RUN, io_base + MAC_REG_RXDMACTL0);
}
@@ -579,14 +579,14 @@ void MACvSetCurrRx0DescAddr(struct vnt_private *priv, u32 dwCurrDescAddr)
* Parameters:
* In:
* io_base - Base Address for MAC
- * dwCurrDescAddr - Descriptor Address
+ * curr_desc_addr - Descriptor Address
* Out:
* none
*
* Return Value: none
*
*/
-void MACvSetCurrRx1DescAddr(struct vnt_private *priv, u32 dwCurrDescAddr)
+void MACvSetCurrRx1DescAddr(struct vnt_private *priv, u32 curr_desc_addr)
{
void __iomem *io_base = priv->PortOffset;
unsigned short ww;
@@ -601,7 +601,7 @@ void MACvSetCurrRx1DescAddr(struct vnt_private *priv, u32 dwCurrDescAddr)
break;
}

- iowrite32(dwCurrDescAddr, io_base + MAC_REG_RXDMAPTR1);
+ iowrite32(curr_desc_addr, io_base + MAC_REG_RXDMAPTR1);
if (byOrgDMACtl & DMACTL_RUN)
iowrite8(DMACTL_RUN, io_base + MAC_REG_RXDMACTL1);

@@ -614,7 +614,7 @@ void MACvSetCurrRx1DescAddr(struct vnt_private *priv, u32 dwCurrDescAddr)
* Parameters:
* In:
* io_base - Base Address for MAC
- * dwCurrDescAddr - Descriptor Address
+ * curr_desc_addr - Descriptor Address
* Out:
* none
*
@@ -622,7 +622,7 @@ void MACvSetCurrRx1DescAddr(struct vnt_private *priv, u32 dwCurrDescAddr)
*
*/
void MACvSetCurrTx0DescAddrEx(struct vnt_private *priv,
- u32 dwCurrDescAddr)
+ u32 curr_desc_addr)
{
void __iomem *io_base = priv->PortOffset;
unsigned short ww;
@@ -637,7 +637,7 @@ void MACvSetCurrTx0DescAddrEx(struct vnt_private *priv,
break;
}

- iowrite32(dwCurrDescAddr, io_base + MAC_REG_TXDMAPTR0);
+ iowrite32(curr_desc_addr, io_base + MAC_REG_TXDMAPTR0);
if (byOrgDMACtl & DMACTL_RUN)
iowrite8(DMACTL_RUN, io_base + MAC_REG_TXDMACTL0);
}
@@ -649,7 +649,7 @@ void MACvSetCurrTx0DescAddrEx(struct vnt_private *priv,
* Parameters:
* In:
* io_base - Base Address for MAC
- * dwCurrDescAddr - Descriptor Address
+ * curr_desc_addr - Descriptor Address
* Out:
* none
*
@@ -658,7 +658,7 @@ void MACvSetCurrTx0DescAddrEx(struct vnt_private *priv,
*/
/* TxDMA1 = AC0DMA */
void MACvSetCurrAC0DescAddrEx(struct vnt_private *priv,
- u32 dwCurrDescAddr)
+ u32 curr_desc_addr)
{
void __iomem *io_base = priv->PortOffset;
unsigned short ww;
@@ -674,18 +674,18 @@ void MACvSetCurrAC0DescAddrEx(struct vnt_private *priv,
}
if (ww == W_MAX_TIMEOUT)
pr_debug(" DBG_PORT80(0x26)\n");
- iowrite32(dwCurrDescAddr, io_base + MAC_REG_AC0DMAPTR);
+ iowrite32(curr_desc_addr, io_base + MAC_REG_AC0DMAPTR);
if (byOrgDMACtl & DMACTL_RUN)
iowrite8(DMACTL_RUN, io_base + MAC_REG_AC0DMACTL);
}

void MACvSetCurrTXDescAddr(int iTxType, struct vnt_private *priv,
- u32 dwCurrDescAddr)
+ u32 curr_desc_addr)
{
if (iTxType == TYPE_AC0DMA)
- MACvSetCurrAC0DescAddrEx(priv, dwCurrDescAddr);
+ MACvSetCurrAC0DescAddrEx(priv, curr_desc_addr);
else if (iTxType == TYPE_TXDMA0)
- MACvSetCurrTx0DescAddrEx(priv, dwCurrDescAddr);
+ MACvSetCurrTx0DescAddrEx(priv, curr_desc_addr);
}

/*
diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index 3eef928..030f529 100644
--- a/drivers/staging/vt6655/mac.h
+++ b/drivers/staging/vt6655/mac.h
@@ -916,19 +916,19 @@ bool MACbSafeStop(struct vnt_private *);
bool MACbShutdown(struct vnt_private *);
void MACvInitialize(struct vnt_private *);
void MACvSetCurrRx0DescAddr(struct vnt_private *,
- u32 dwCurrDescAddr);
+ u32 curr_desc_addr);
void MACvSetCurrRx1DescAddr(struct vnt_private *,
- u32 dwCurrDescAddr);
+ u32 curr_desc_addr);
void MACvSetCurrTXDescAddr(int iTxType, struct vnt_private *,
- u32 dwCurrDescAddr);
+ u32 curr_desc_addr);
void MACvSetCurrTx0DescAddrEx(struct vnt_private *,
- u32 dwCurrDescAddr);
+ u32 curr_desc_addr);
void MACvSetCurrAC0DescAddrEx(struct vnt_private *,
- u32 dwCurrDescAddr);
+ u32 curr_desc_addr);
void MACvSetCurrSyncDescAddrEx(struct vnt_private *,
- u32 dwCurrDescAddr);
+ u32 curr_desc_addr);
void MACvSetCurrATIMDescAddrEx(struct vnt_private *,
- u32 dwCurrDescAddr);
+ u32 curr_desc_addr);
void MACvTimer0MicroSDelay(struct vnt_private *, unsigned int uDelay);
void MACvOneShotTimer1MicroSec(struct vnt_private *, unsigned int uDelayTime);

--
2.7.0


2016-03-06 12:57:27

by Malcolm Priestley

[permalink] [raw]
Subject: [PATCH 02/13] staging: vt6655: MACvRestoreContext replace for loops with memcpy_toio.

Removing the need for variable ii.

Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/mac.c | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index 9c4dabd..02e3e42 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -240,29 +240,27 @@ void MACvSaveContext(struct vnt_private *priv, unsigned char *cxt_buf)
void MACvRestoreContext(struct vnt_private *priv, unsigned char *cxt_buf)
{
void __iomem *io_base = priv->PortOffset;
- int ii;

MACvSelectPage1(io_base);
/* restore page1 */
- for (ii = 0; ii < MAC_MAX_CONTEXT_SIZE_PAGE1; ii++)
- VNSvOutPortB((io_base + ii),
- *(cxt_buf + MAC_MAX_CONTEXT_SIZE_PAGE0 + ii));
+ memcpy_toio(io_base, cxt_buf + MAC_MAX_CONTEXT_SIZE_PAGE0,
+ MAC_MAX_CONTEXT_SIZE_PAGE1);

MACvSelectPage0(io_base);

/* restore RCR,TCR,IMR... */
- for (ii = MAC_REG_RCR; ii < MAC_REG_ISR; ii++)
- VNSvOutPortB(io_base + ii, *(cxt_buf + ii));
+ memcpy_toio(io_base + MAC_REG_RCR, cxt_buf + MAC_REG_RCR,
+ MAC_REG_ISR - MAC_REG_RCR);

/* restore MAC Config. */
- for (ii = MAC_REG_LRT; ii < MAC_REG_PAGE1SEL; ii++)
- VNSvOutPortB(io_base + ii, *(cxt_buf + ii));
+ memcpy_toio(io_base + MAC_REG_LRT, cxt_buf + MAC_REG_LRT,
+ MAC_REG_PAGE1SEL - MAC_REG_LRT);

VNSvOutPortB(io_base + MAC_REG_CFG, *(cxt_buf + MAC_REG_CFG));

/* restore PS Config. */
- for (ii = MAC_REG_PSCFG; ii < MAC_REG_BBREGCTL; ii++)
- VNSvOutPortB(io_base + ii, *(cxt_buf + ii));
+ memcpy_toio(io_base + MAC_REG_PSCFG, cxt_buf + MAC_REG_PSCFG,
+ MAC_REG_BBREGCTL - MAC_REG_PSCFG);

/* restore CURR_RX_DESC_ADDR, CURR_TX_DESC_ADDR */
VNSvOutPortD(io_base + MAC_REG_TXDMAPTR0,
--
2.7.0


2016-03-06 12:57:31

by Malcolm Priestley

[permalink] [raw]
Subject: [PATCH 06/13] staging: vt6655: mac.c replace VNSvOutPortB with iowrite8

removing macro from functions

Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/mac.c | 44 ++++++++++++++++++++++----------------------
1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index 43e5f66..a1be5a7 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -142,7 +142,7 @@ void MACvSetShortRetryLimit(struct vnt_private *priv, unsigned char byRetryLimit
{
void __iomem *io_base = priv->PortOffset;
/* set SRT */
- VNSvOutPortB(io_base + MAC_REG_SRT, byRetryLimit);
+ iowrite8(byRetryLimit, io_base + MAC_REG_SRT);
}


@@ -164,7 +164,7 @@ void MACvSetLongRetryLimit(struct vnt_private *priv, unsigned char byRetryLimit)
{
void __iomem *io_base = priv->PortOffset;
/* set LRT */
- VNSvOutPortB(io_base + MAC_REG_LRT, byRetryLimit);
+ iowrite8(byRetryLimit, io_base + MAC_REG_LRT);
}

/*
@@ -191,7 +191,7 @@ void MACvSetLoopbackMode(struct vnt_private *priv, unsigned char byLoopbackMode)
VNSvInPortB(io_base + MAC_REG_TEST, &byOrgValue);
byOrgValue = byOrgValue & 0x3F;
byOrgValue = byOrgValue | byLoopbackMode;
- VNSvOutPortB(io_base + MAC_REG_TEST, byOrgValue);
+ iowrite8(byOrgValue, io_base + MAC_REG_TEST);
}

/*
@@ -256,7 +256,7 @@ void MACvRestoreContext(struct vnt_private *priv, unsigned char *cxt_buf)
memcpy_toio(io_base + MAC_REG_LRT, cxt_buf + MAC_REG_LRT,
MAC_REG_PAGE1SEL - MAC_REG_LRT);

- VNSvOutPortB(io_base + MAC_REG_CFG, *(cxt_buf + MAC_REG_CFG));
+ iowrite8(*(cxt_buf + MAC_REG_CFG), io_base + MAC_REG_CFG);

/* restore PS Config. */
memcpy_toio(io_base + MAC_REG_PSCFG, cxt_buf + MAC_REG_PSCFG,
@@ -294,7 +294,7 @@ bool MACbSoftwareReset(struct vnt_private *priv)
unsigned short ww;

/* turn on HOSTCR_SOFTRST, just write 0x01 to reset */
- VNSvOutPortB(io_base + MAC_REG_HOSTCR, 0x01);
+ iowrite8(0x01, io_base + MAC_REG_HOSTCR);

for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
if (!(ioread8(io_base + MAC_REG_HOSTCR) & HOSTCR_SOFTRST))
@@ -529,16 +529,16 @@ void MACvInitialize(struct vnt_private *priv)
/* clear sticky bits */
MACvClearStckDS(io_base);
/* disable force PME-enable */
- VNSvOutPortB(io_base + MAC_REG_PMC1, PME_OVR);
+ iowrite8(PME_OVR, io_base + MAC_REG_PMC1);
/* only 3253 A */

/* do reset */
MACbSoftwareReset(priv);

/* reset TSF counter */
- VNSvOutPortB(io_base + MAC_REG_TFTCTL, TFTCTL_TSFCNTRST);
+ iowrite8(TFTCTL_TSFCNTRST, io_base + MAC_REG_TFTCTL);
/* enable TSF counter */
- VNSvOutPortB(io_base + MAC_REG_TFTCTL, TFTCTL_TSFCNTREN);
+ iowrite8(TFTCTL_TSFCNTREN, io_base + MAC_REG_TFTCTL);
}

/*
@@ -563,7 +563,7 @@ void MACvSetCurrRx0DescAddr(struct vnt_private *priv, u32 dwCurrDescAddr)

VNSvInPortB(io_base + MAC_REG_RXDMACTL0, &byOrgDMACtl);
if (byOrgDMACtl & DMACTL_RUN)
- VNSvOutPortB(io_base + MAC_REG_RXDMACTL0+2, DMACTL_RUN);
+ iowrite8(DMACTL_RUN, io_base + MAC_REG_RXDMACTL0 + 2);

for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
if (!(ioread8(io_base + MAC_REG_RXDMACTL0) & DMACTL_RUN))
@@ -572,7 +572,7 @@ void MACvSetCurrRx0DescAddr(struct vnt_private *priv, u32 dwCurrDescAddr)

iowrite32(dwCurrDescAddr, io_base + MAC_REG_RXDMAPTR0);
if (byOrgDMACtl & DMACTL_RUN)
- VNSvOutPortB(io_base + MAC_REG_RXDMACTL0, DMACTL_RUN);
+ iowrite8(DMACTL_RUN, io_base + MAC_REG_RXDMACTL0);
}

/*
@@ -597,7 +597,7 @@ void MACvSetCurrRx1DescAddr(struct vnt_private *priv, u32 dwCurrDescAddr)

VNSvInPortB(io_base + MAC_REG_RXDMACTL1, &byOrgDMACtl);
if (byOrgDMACtl & DMACTL_RUN)
- VNSvOutPortB(io_base + MAC_REG_RXDMACTL1+2, DMACTL_RUN);
+ iowrite8(DMACTL_RUN, io_base + MAC_REG_RXDMACTL1 + 2);

for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
if (!(ioread8(io_base + MAC_REG_RXDMACTL1) & DMACTL_RUN))
@@ -606,7 +606,7 @@ void MACvSetCurrRx1DescAddr(struct vnt_private *priv, u32 dwCurrDescAddr)

iowrite32(dwCurrDescAddr, io_base + MAC_REG_RXDMAPTR1);
if (byOrgDMACtl & DMACTL_RUN)
- VNSvOutPortB(io_base + MAC_REG_RXDMACTL1, DMACTL_RUN);
+ iowrite8(DMACTL_RUN, io_base + MAC_REG_RXDMACTL1);

}

@@ -633,7 +633,7 @@ void MACvSetCurrTx0DescAddrEx(struct vnt_private *priv,

VNSvInPortB(io_base + MAC_REG_TXDMACTL0, &byOrgDMACtl);
if (byOrgDMACtl & DMACTL_RUN)
- VNSvOutPortB(io_base + MAC_REG_TXDMACTL0+2, DMACTL_RUN);
+ iowrite8(DMACTL_RUN, io_base + MAC_REG_TXDMACTL0 + 2);

for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
if (!(ioread8(io_base + MAC_REG_TXDMACTL0) & DMACTL_RUN))
@@ -642,7 +642,7 @@ void MACvSetCurrTx0DescAddrEx(struct vnt_private *priv,

iowrite32(dwCurrDescAddr, io_base + MAC_REG_TXDMAPTR0);
if (byOrgDMACtl & DMACTL_RUN)
- VNSvOutPortB(io_base + MAC_REG_TXDMACTL0, DMACTL_RUN);
+ iowrite8(DMACTL_RUN, io_base + MAC_REG_TXDMACTL0);
}

/*
@@ -669,7 +669,7 @@ void MACvSetCurrAC0DescAddrEx(struct vnt_private *priv,

VNSvInPortB(io_base + MAC_REG_AC0DMACTL, &byOrgDMACtl);
if (byOrgDMACtl & DMACTL_RUN)
- VNSvOutPortB(io_base + MAC_REG_AC0DMACTL+2, DMACTL_RUN);
+ iowrite8(DMACTL_RUN, io_base + MAC_REG_AC0DMACTL + 2);

for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
if (!(ioread8(io_base + MAC_REG_AC0DMACTL) & DMACTL_RUN))
@@ -679,7 +679,7 @@ void MACvSetCurrAC0DescAddrEx(struct vnt_private *priv,
pr_debug(" DBG_PORT80(0x26)\n");
iowrite32(dwCurrDescAddr, io_base + MAC_REG_AC0DMAPTR);
if (byOrgDMACtl & DMACTL_RUN)
- VNSvOutPortB(io_base + MAC_REG_AC0DMACTL, DMACTL_RUN);
+ iowrite8(DMACTL_RUN, io_base + MAC_REG_AC0DMACTL);
}

void MACvSetCurrTXDescAddr(int iTxType, struct vnt_private *priv,
@@ -711,20 +711,20 @@ void MACvTimer0MicroSDelay(struct vnt_private *priv, unsigned int uDelay)
unsigned char byValue;
unsigned int uu, ii;

- VNSvOutPortB(io_base + MAC_REG_TMCTL0, 0);
+ iowrite8(0, io_base + MAC_REG_TMCTL0);
iowrite32(uDelay, io_base + MAC_REG_TMDATA0);
- VNSvOutPortB(io_base + MAC_REG_TMCTL0, (TMCTL_TMD | TMCTL_TE));
+ iowrite8((TMCTL_TMD | TMCTL_TE), io_base + MAC_REG_TMCTL0);
for (ii = 0; ii < 66; ii++) { /* assume max PCI clock is 66Mhz */
for (uu = 0; uu < uDelay; uu++) {
VNSvInPortB(io_base + MAC_REG_TMCTL0, &byValue);
if ((byValue == 0) ||
(byValue & TMCTL_TSUSP)) {
- VNSvOutPortB(io_base + MAC_REG_TMCTL0, 0);
+ iowrite8(0, io_base + MAC_REG_TMCTL0);
return;
}
}
}
- VNSvOutPortB(io_base + MAC_REG_TMCTL0, 0);
+ iowrite8(0, io_base + MAC_REG_TMCTL0);
}

/*
@@ -745,9 +745,9 @@ void MACvOneShotTimer1MicroSec(struct vnt_private *priv, unsigned int uDelayTime
{
void __iomem *io_base = priv->PortOffset;

- VNSvOutPortB(io_base + MAC_REG_TMCTL1, 0);
+ iowrite8(0, io_base + MAC_REG_TMCTL1);
iowrite32(uDelayTime, io_base + MAC_REG_TMDATA1);
- VNSvOutPortB(io_base + MAC_REG_TMCTL1, (TMCTL_TMD | TMCTL_TE));
+ iowrite8((TMCTL_TMD | TMCTL_TE), io_base + MAC_REG_TMCTL1);
}

void MACvSetMISCFifo(struct vnt_private *priv, unsigned short wOffset,
--
2.7.0


2016-03-06 12:57:36

by Malcolm Priestley

[permalink] [raw]
Subject: [PATCH 11/13] staging: vt6655: mac.c replace byOrgDMACtl with org_dma_ctl

Removing camel case and type prefix.

Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/mac.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index d44026b..87bec1c 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -556,10 +556,10 @@ void MACvSetCurrRx0DescAddr(struct vnt_private *priv, u32 curr_desc_addr)
{
void __iomem *io_base = priv->PortOffset;
unsigned short ww;
- unsigned char byOrgDMACtl;
+ unsigned char org_dma_ctl;

- byOrgDMACtl = ioread8(io_base + MAC_REG_RXDMACTL0);
- if (byOrgDMACtl & DMACTL_RUN)
+ org_dma_ctl = ioread8(io_base + MAC_REG_RXDMACTL0);
+ if (org_dma_ctl & DMACTL_RUN)
iowrite8(DMACTL_RUN, io_base + MAC_REG_RXDMACTL0 + 2);

for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
@@ -568,7 +568,7 @@ void MACvSetCurrRx0DescAddr(struct vnt_private *priv, u32 curr_desc_addr)
}

iowrite32(curr_desc_addr, io_base + MAC_REG_RXDMAPTR0);
- if (byOrgDMACtl & DMACTL_RUN)
+ if (org_dma_ctl & DMACTL_RUN)
iowrite8(DMACTL_RUN, io_base + MAC_REG_RXDMACTL0);
}

@@ -590,10 +590,10 @@ void MACvSetCurrRx1DescAddr(struct vnt_private *priv, u32 curr_desc_addr)
{
void __iomem *io_base = priv->PortOffset;
unsigned short ww;
- unsigned char byOrgDMACtl;
+ unsigned char org_dma_ctl;

- byOrgDMACtl = ioread8(io_base + MAC_REG_RXDMACTL1);
- if (byOrgDMACtl & DMACTL_RUN)
+ org_dma_ctl = ioread8(io_base + MAC_REG_RXDMACTL1);
+ if (org_dma_ctl & DMACTL_RUN)
iowrite8(DMACTL_RUN, io_base + MAC_REG_RXDMACTL1 + 2);

for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
@@ -602,7 +602,7 @@ void MACvSetCurrRx1DescAddr(struct vnt_private *priv, u32 curr_desc_addr)
}

iowrite32(curr_desc_addr, io_base + MAC_REG_RXDMAPTR1);
- if (byOrgDMACtl & DMACTL_RUN)
+ if (org_dma_ctl & DMACTL_RUN)
iowrite8(DMACTL_RUN, io_base + MAC_REG_RXDMACTL1);

}
@@ -626,10 +626,10 @@ void MACvSetCurrTx0DescAddrEx(struct vnt_private *priv,
{
void __iomem *io_base = priv->PortOffset;
unsigned short ww;
- unsigned char byOrgDMACtl;
+ unsigned char org_dma_ctl;

- byOrgDMACtl = ioread8(io_base + MAC_REG_TXDMACTL0);
- if (byOrgDMACtl & DMACTL_RUN)
+ org_dma_ctl = ioread8(io_base + MAC_REG_TXDMACTL0);
+ if (org_dma_ctl & DMACTL_RUN)
iowrite8(DMACTL_RUN, io_base + MAC_REG_TXDMACTL0 + 2);

for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
@@ -638,7 +638,7 @@ void MACvSetCurrTx0DescAddrEx(struct vnt_private *priv,
}

iowrite32(curr_desc_addr, io_base + MAC_REG_TXDMAPTR0);
- if (byOrgDMACtl & DMACTL_RUN)
+ if (org_dma_ctl & DMACTL_RUN)
iowrite8(DMACTL_RUN, io_base + MAC_REG_TXDMACTL0);
}

@@ -662,10 +662,10 @@ void MACvSetCurrAC0DescAddrEx(struct vnt_private *priv,
{
void __iomem *io_base = priv->PortOffset;
unsigned short ww;
- unsigned char byOrgDMACtl;
+ unsigned char org_dma_ctl;

- byOrgDMACtl = ioread8(io_base + MAC_REG_AC0DMACTL);
- if (byOrgDMACtl & DMACTL_RUN)
+ org_dma_ctl = ioread8(io_base + MAC_REG_AC0DMACTL);
+ if (org_dma_ctl & DMACTL_RUN)
iowrite8(DMACTL_RUN, io_base + MAC_REG_AC0DMACTL + 2);

for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
@@ -675,7 +675,7 @@ void MACvSetCurrAC0DescAddrEx(struct vnt_private *priv,
if (ww == W_MAX_TIMEOUT)
pr_debug(" DBG_PORT80(0x26)\n");
iowrite32(curr_desc_addr, io_base + MAC_REG_AC0DMAPTR);
- if (byOrgDMACtl & DMACTL_RUN)
+ if (org_dma_ctl & DMACTL_RUN)
iowrite8(DMACTL_RUN, io_base + MAC_REG_AC0DMACTL);
}

--
2.7.0


2016-03-06 12:57:29

by Malcolm Priestley

[permalink] [raw]
Subject: [PATCH 03/13] staging: vt6655: mac.c/h resize all unsigned long to u32

All addressing is limited to 32 bits match this to all
functions and port out functions.

Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/mac.c | 22 +++++++++++-----------
drivers/staging/vt6655/mac.h | 16 ++++++++--------
2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index 02e3e42..c2723c1 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -264,17 +264,17 @@ void MACvRestoreContext(struct vnt_private *priv, unsigned char *cxt_buf)

/* restore CURR_RX_DESC_ADDR, CURR_TX_DESC_ADDR */
VNSvOutPortD(io_base + MAC_REG_TXDMAPTR0,
- *(unsigned long *)(cxt_buf + MAC_REG_TXDMAPTR0));
+ *(u32 *)(cxt_buf + MAC_REG_TXDMAPTR0));
VNSvOutPortD(io_base + MAC_REG_AC0DMAPTR,
- *(unsigned long *)(cxt_buf + MAC_REG_AC0DMAPTR));
+ *(u32 *)(cxt_buf + MAC_REG_AC0DMAPTR));
VNSvOutPortD(io_base + MAC_REG_BCNDMAPTR,
- *(unsigned long *)(cxt_buf + MAC_REG_BCNDMAPTR));
+ *(u32 *)(cxt_buf + MAC_REG_BCNDMAPTR));

VNSvOutPortD(io_base + MAC_REG_RXDMAPTR0,
- *(unsigned long *)(cxt_buf + MAC_REG_RXDMAPTR0));
+ *(u32 *)(cxt_buf + MAC_REG_RXDMAPTR0));

VNSvOutPortD(io_base + MAC_REG_RXDMAPTR1,
- *(unsigned long *)(cxt_buf + MAC_REG_RXDMAPTR1));
+ *(u32 *)(cxt_buf + MAC_REG_RXDMAPTR1));
}

/*
@@ -557,7 +557,7 @@ void MACvInitialize(struct vnt_private *priv)
* Return Value: none
*
*/
-void MACvSetCurrRx0DescAddr(struct vnt_private *priv, unsigned long dwCurrDescAddr)
+void MACvSetCurrRx0DescAddr(struct vnt_private *priv, u32 dwCurrDescAddr)
{
void __iomem *io_base = priv->PortOffset;
unsigned short ww;
@@ -591,7 +591,7 @@ void MACvSetCurrRx0DescAddr(struct vnt_private *priv, unsigned long dwCurrDescAd
* Return Value: none
*
*/
-void MACvSetCurrRx1DescAddr(struct vnt_private *priv, unsigned long dwCurrDescAddr)
+void MACvSetCurrRx1DescAddr(struct vnt_private *priv, u32 dwCurrDescAddr)
{
void __iomem *io_base = priv->PortOffset;
unsigned short ww;
@@ -627,7 +627,7 @@ void MACvSetCurrRx1DescAddr(struct vnt_private *priv, unsigned long dwCurrDescAd
*
*/
void MACvSetCurrTx0DescAddrEx(struct vnt_private *priv,
- unsigned long dwCurrDescAddr)
+ u32 dwCurrDescAddr)
{
void __iomem *io_base = priv->PortOffset;
unsigned short ww;
@@ -663,7 +663,7 @@ void MACvSetCurrTx0DescAddrEx(struct vnt_private *priv,
*/
/* TxDMA1 = AC0DMA */
void MACvSetCurrAC0DescAddrEx(struct vnt_private *priv,
- unsigned long dwCurrDescAddr)
+ u32 dwCurrDescAddr)
{
void __iomem *io_base = priv->PortOffset;
unsigned short ww;
@@ -685,7 +685,7 @@ void MACvSetCurrAC0DescAddrEx(struct vnt_private *priv,
}

void MACvSetCurrTXDescAddr(int iTxType, struct vnt_private *priv,
- unsigned long dwCurrDescAddr)
+ u32 dwCurrDescAddr)
{
if (iTxType == TYPE_AC0DMA)
MACvSetCurrAC0DescAddrEx(priv, dwCurrDescAddr);
@@ -753,7 +753,7 @@ void MACvOneShotTimer1MicroSec(struct vnt_private *priv, unsigned int uDelayTime
}

void MACvSetMISCFifo(struct vnt_private *priv, unsigned short wOffset,
- unsigned long dwData)
+ u32 dwData)
{
void __iomem *io_base = priv->PortOffset;

diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index 192f466..3eef928 100644
--- a/drivers/staging/vt6655/mac.h
+++ b/drivers/staging/vt6655/mac.h
@@ -916,24 +916,24 @@ bool MACbSafeStop(struct vnt_private *);
bool MACbShutdown(struct vnt_private *);
void MACvInitialize(struct vnt_private *);
void MACvSetCurrRx0DescAddr(struct vnt_private *,
- unsigned long dwCurrDescAddr);
+ u32 dwCurrDescAddr);
void MACvSetCurrRx1DescAddr(struct vnt_private *,
- unsigned long dwCurrDescAddr);
+ u32 dwCurrDescAddr);
void MACvSetCurrTXDescAddr(int iTxType, struct vnt_private *,
- unsigned long dwCurrDescAddr);
+ u32 dwCurrDescAddr);
void MACvSetCurrTx0DescAddrEx(struct vnt_private *,
- unsigned long dwCurrDescAddr);
+ u32 dwCurrDescAddr);
void MACvSetCurrAC0DescAddrEx(struct vnt_private *,
- unsigned long dwCurrDescAddr);
+ u32 dwCurrDescAddr);
void MACvSetCurrSyncDescAddrEx(struct vnt_private *,
- unsigned long dwCurrDescAddr);
+ u32 dwCurrDescAddr);
void MACvSetCurrATIMDescAddrEx(struct vnt_private *,
- unsigned long dwCurrDescAddr);
+ u32 dwCurrDescAddr);
void MACvTimer0MicroSDelay(struct vnt_private *, unsigned int uDelay);
void MACvOneShotTimer1MicroSec(struct vnt_private *, unsigned int uDelayTime);

void MACvSetMISCFifo(struct vnt_private *, unsigned short wOffset,
- unsigned long dwData);
+ u32 dwData);

bool MACbPSWakeup(struct vnt_private *);

--
2.7.0


2016-03-06 12:57:32

by Malcolm Priestley

[permalink] [raw]
Subject: [PATCH 07/13] staging: vt6655: MACbPSWakeup replace VNSvInPortB byOrgValue with ioread8

removing byOrgValue variable.

Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/mac.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index a1be5a7..6499709 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -765,7 +765,6 @@ void MACvSetMISCFifo(struct vnt_private *priv, unsigned short wOffset,
bool MACbPSWakeup(struct vnt_private *priv)
{
void __iomem *io_base = priv->PortOffset;
- unsigned char byOrgValue;
unsigned int ww;
/* Read PSCTL */
if (MACbIsRegBitsOff(priv, MAC_REG_PSCTL, PSCTL_PS))
@@ -776,8 +775,7 @@ bool MACbPSWakeup(struct vnt_private *priv)

/* Check if SyncFlushOK */
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
- VNSvInPortB(io_base + MAC_REG_PSCTL, &byOrgValue);
- if (byOrgValue & PSCTL_WAKEDONE)
+ if (ioread8(io_base + MAC_REG_PSCTL) & PSCTL_WAKEDONE)
break;
}
if (ww == W_MAX_TIMEOUT) {
--
2.7.0


2016-03-06 12:57:30

by Malcolm Priestley

[permalink] [raw]
Subject: [PATCH 05/13] staging: vt6655: mac.c replace VNSvOutPortW with iowrite16

removig macro from functions.

Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/mac.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index a9ddb95..43e5f66 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -757,9 +757,9 @@ void MACvSetMISCFifo(struct vnt_private *priv, unsigned short wOffset,

if (wOffset > 273)
return;
- VNSvOutPortW(io_base + MAC_REG_MISCFFNDEX, wOffset);
+ iowrite16(wOffset, io_base + MAC_REG_MISCFFNDEX);
iowrite32(dwData, io_base + MAC_REG_MISCFFDATA);
- VNSvOutPortW(io_base + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
+ iowrite16(MISCFFCTL_WRITE, io_base + MAC_REG_MISCFFCTL);
}

bool MACbPSWakeup(struct vnt_private *priv)
@@ -826,9 +826,9 @@ void MACvSetKeyEntry(struct vnt_private *priv, unsigned short wKeyCtl,
pr_debug("1. wOffset: %d, Data: %X, KeyCtl:%X\n",
wOffset, dwData, wKeyCtl);

- VNSvOutPortW(io_base + MAC_REG_MISCFFNDEX, wOffset);
+ iowrite16(wOffset, io_base + MAC_REG_MISCFFNDEX);
iowrite32(dwData, io_base + MAC_REG_MISCFFDATA);
- VNSvOutPortW(io_base + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
+ iowrite16(MISCFFCTL_WRITE, io_base + MAC_REG_MISCFFCTL);
wOffset++;

dwData = 0;
@@ -841,9 +841,9 @@ void MACvSetKeyEntry(struct vnt_private *priv, unsigned short wKeyCtl,
dwData |= *(pbyAddr+0);
pr_debug("2. wOffset: %d, Data: %X\n", wOffset, dwData);

- VNSvOutPortW(io_base + MAC_REG_MISCFFNDEX, wOffset);
+ iowrite16(wOffset, io_base + MAC_REG_MISCFFNDEX);
iowrite32(dwData, io_base + MAC_REG_MISCFFDATA);
- VNSvOutPortW(io_base + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
+ iowrite16(MISCFFCTL_WRITE, io_base + MAC_REG_MISCFFCTL);
wOffset++;

wOffset += (uKeyIdx * 4);
@@ -851,9 +851,9 @@ void MACvSetKeyEntry(struct vnt_private *priv, unsigned short wKeyCtl,
/* always push 128 bits */
pr_debug("3.(%d) wOffset: %d, Data: %X\n",
ii, wOffset+ii, *pdwKey);
- VNSvOutPortW(io_base + MAC_REG_MISCFFNDEX, wOffset+ii);
+ iowrite16(wOffset + ii, io_base + MAC_REG_MISCFFNDEX);
iowrite32(*pdwKey++, io_base + MAC_REG_MISCFFDATA);
- VNSvOutPortW(io_base + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
+ iowrite16(MISCFFCTL_WRITE, io_base + MAC_REG_MISCFFCTL);
}
}

@@ -879,7 +879,7 @@ void MACvDisableKeyEntry(struct vnt_private *priv, unsigned int uEntryIdx)
wOffset = MISCFIFO_KEYETRY0;
wOffset += (uEntryIdx * MISCFIFO_KEYENTRYSIZE);

- VNSvOutPortW(io_base + MAC_REG_MISCFFNDEX, wOffset);
+ iowrite16(wOffset, io_base + MAC_REG_MISCFFNDEX);
iowrite32(0, io_base + MAC_REG_MISCFFDATA);
- VNSvOutPortW(io_base + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
+ iowrite16(MISCFFCTL_WRITE, io_base + MAC_REG_MISCFFCTL);
}
--
2.7.0


2016-03-06 12:57:34

by Malcolm Priestley

[permalink] [raw]
Subject: [PATCH 09/13] staging: vt6655: mac.c replace VNSvInPortB with ioread8

Removing the macro from functions.

Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/mac.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index ece2bf0..a1be62d 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -558,7 +558,7 @@ void MACvSetCurrRx0DescAddr(struct vnt_private *priv, u32 dwCurrDescAddr)
unsigned short ww;
unsigned char byOrgDMACtl;

- VNSvInPortB(io_base + MAC_REG_RXDMACTL0, &byOrgDMACtl);
+ byOrgDMACtl = ioread8(io_base + MAC_REG_RXDMACTL0);
if (byOrgDMACtl & DMACTL_RUN)
iowrite8(DMACTL_RUN, io_base + MAC_REG_RXDMACTL0 + 2);

@@ -592,7 +592,7 @@ void MACvSetCurrRx1DescAddr(struct vnt_private *priv, u32 dwCurrDescAddr)
unsigned short ww;
unsigned char byOrgDMACtl;

- VNSvInPortB(io_base + MAC_REG_RXDMACTL1, &byOrgDMACtl);
+ byOrgDMACtl = ioread8(io_base + MAC_REG_RXDMACTL1);
if (byOrgDMACtl & DMACTL_RUN)
iowrite8(DMACTL_RUN, io_base + MAC_REG_RXDMACTL1 + 2);

@@ -628,7 +628,7 @@ void MACvSetCurrTx0DescAddrEx(struct vnt_private *priv,
unsigned short ww;
unsigned char byOrgDMACtl;

- VNSvInPortB(io_base + MAC_REG_TXDMACTL0, &byOrgDMACtl);
+ byOrgDMACtl = ioread8(io_base + MAC_REG_TXDMACTL0);
if (byOrgDMACtl & DMACTL_RUN)
iowrite8(DMACTL_RUN, io_base + MAC_REG_TXDMACTL0 + 2);

@@ -664,7 +664,7 @@ void MACvSetCurrAC0DescAddrEx(struct vnt_private *priv,
unsigned short ww;
unsigned char byOrgDMACtl;

- VNSvInPortB(io_base + MAC_REG_AC0DMACTL, &byOrgDMACtl);
+ byOrgDMACtl = ioread8(io_base + MAC_REG_AC0DMACTL);
if (byOrgDMACtl & DMACTL_RUN)
iowrite8(DMACTL_RUN, io_base + MAC_REG_AC0DMACTL + 2);

@@ -713,7 +713,7 @@ void MACvTimer0MicroSDelay(struct vnt_private *priv, unsigned int uDelay)
iowrite8((TMCTL_TMD | TMCTL_TE), io_base + MAC_REG_TMCTL0);
for (ii = 0; ii < 66; ii++) { /* assume max PCI clock is 66Mhz */
for (uu = 0; uu < uDelay; uu++) {
- VNSvInPortB(io_base + MAC_REG_TMCTL0, &byValue);
+ byValue = ioread8(io_base + MAC_REG_TMCTL0);
if ((byValue == 0) ||
(byValue & TMCTL_TSUSP)) {
iowrite8(0, io_base + MAC_REG_TMCTL0);
--
2.7.0


2016-03-06 12:57:38

by Malcolm Priestley

[permalink] [raw]
Subject: [PATCH 13/13] staging: vt6655: mac.c replace dwData with data.

Removing camel case and type prefix.

Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/mac.c | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index e762c33..45196c6 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -748,14 +748,14 @@ void MACvOneShotTimer1MicroSec(struct vnt_private *priv, unsigned int uDelayTime
}

void MACvSetMISCFifo(struct vnt_private *priv, unsigned short offset,
- u32 dwData)
+ u32 data)
{
void __iomem *io_base = priv->PortOffset;

if (offset > 273)
return;
iowrite16(offset, io_base + MAC_REG_MISCFFNDEX);
- iowrite32(dwData, io_base + MAC_REG_MISCFFDATA);
+ iowrite32(data, io_base + MAC_REG_MISCFFDATA);
iowrite16(MISCFFCTL_WRITE, io_base + MAC_REG_MISCFFCTL);
}

@@ -804,7 +804,7 @@ void MACvSetKeyEntry(struct vnt_private *priv, unsigned short wKeyCtl,
{
void __iomem *io_base = priv->PortOffset;
unsigned short offset;
- u32 dwData;
+ u32 data;
int ii;

if (byLocalID <= 1)
@@ -814,30 +814,30 @@ void MACvSetKeyEntry(struct vnt_private *priv, unsigned short wKeyCtl,
offset = MISCFIFO_KEYETRY0;
offset += (uEntryIdx * MISCFIFO_KEYENTRYSIZE);

- dwData = 0;
- dwData |= wKeyCtl;
- dwData <<= 16;
- dwData |= MAKEWORD(*(pbyAddr+4), *(pbyAddr+5));
+ data = 0;
+ data |= wKeyCtl;
+ data <<= 16;
+ data |= MAKEWORD(*(pbyAddr + 4), *(pbyAddr + 5));
pr_debug("1. offset: %d, Data: %X, KeyCtl:%X\n",
- offset, dwData, wKeyCtl);
+ offset, data, wKeyCtl);

iowrite16(offset, io_base + MAC_REG_MISCFFNDEX);
- iowrite32(dwData, io_base + MAC_REG_MISCFFDATA);
+ iowrite32(data, io_base + MAC_REG_MISCFFDATA);
iowrite16(MISCFFCTL_WRITE, io_base + MAC_REG_MISCFFCTL);
offset++;

- dwData = 0;
- dwData |= *(pbyAddr+3);
- dwData <<= 8;
- dwData |= *(pbyAddr+2);
- dwData <<= 8;
- dwData |= *(pbyAddr+1);
- dwData <<= 8;
- dwData |= *(pbyAddr+0);
- pr_debug("2. offset: %d, Data: %X\n", offset, dwData);
+ data = 0;
+ data |= *(pbyAddr + 3);
+ data <<= 8;
+ data |= *(pbyAddr + 2);
+ data <<= 8;
+ data |= *(pbyAddr + 1);
+ data <<= 8;
+ data |= *pbyAddr;
+ pr_debug("2. offset: %d, Data: %X\n", offset, data);

iowrite16(offset, io_base + MAC_REG_MISCFFNDEX);
- iowrite32(dwData, io_base + MAC_REG_MISCFFDATA);
+ iowrite32(data, io_base + MAC_REG_MISCFFDATA);
iowrite16(MISCFFCTL_WRITE, io_base + MAC_REG_MISCFFCTL);
offset++;

--
2.7.0


2016-03-06 12:57:29

by Malcolm Priestley

[permalink] [raw]
Subject: [PATCH 04/13] staging: vt6655: mac.c replace VNSvOutPortD with iowrite32.

Removing the macro from functions.

Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/mac.c | 52 +++++++++++++++++++++-----------------------
1 file changed, 25 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index c2723c1..a9ddb95 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -263,18 +263,16 @@ void MACvRestoreContext(struct vnt_private *priv, unsigned char *cxt_buf)
MAC_REG_BBREGCTL - MAC_REG_PSCFG);

/* restore CURR_RX_DESC_ADDR, CURR_TX_DESC_ADDR */
- VNSvOutPortD(io_base + MAC_REG_TXDMAPTR0,
- *(u32 *)(cxt_buf + MAC_REG_TXDMAPTR0));
- VNSvOutPortD(io_base + MAC_REG_AC0DMAPTR,
- *(u32 *)(cxt_buf + MAC_REG_AC0DMAPTR));
- VNSvOutPortD(io_base + MAC_REG_BCNDMAPTR,
- *(u32 *)(cxt_buf + MAC_REG_BCNDMAPTR));
-
- VNSvOutPortD(io_base + MAC_REG_RXDMAPTR0,
- *(u32 *)(cxt_buf + MAC_REG_RXDMAPTR0));
-
- VNSvOutPortD(io_base + MAC_REG_RXDMAPTR1,
- *(u32 *)(cxt_buf + MAC_REG_RXDMAPTR1));
+ iowrite32(*(u32 *)(cxt_buf + MAC_REG_TXDMAPTR0),
+ io_base + MAC_REG_TXDMAPTR0);
+ iowrite32(*(u32 *)(cxt_buf + MAC_REG_AC0DMAPTR),
+ io_base + MAC_REG_AC0DMAPTR);
+ iowrite32(*(u32 *)(cxt_buf + MAC_REG_BCNDMAPTR),
+ io_base + MAC_REG_BCNDMAPTR);
+ iowrite32(*(u32 *)(cxt_buf + MAC_REG_RXDMAPTR0),
+ io_base + MAC_REG_RXDMAPTR0);
+ iowrite32(*(u32 *)(cxt_buf + MAC_REG_RXDMAPTR1),
+ io_base + MAC_REG_RXDMAPTR1);
}

/*
@@ -360,8 +358,8 @@ bool MACbSafeRxOff(struct vnt_private *priv)
/* turn off wow temp for turn off Rx safely */

/* Clear RX DMA0,1 */
- VNSvOutPortD(io_base + MAC_REG_RXDMACTL0, DMACTL_CLRRUN);
- VNSvOutPortD(io_base + MAC_REG_RXDMACTL1, DMACTL_CLRRUN);
+ iowrite32(DMACTL_CLRRUN, io_base + MAC_REG_RXDMACTL0);
+ iowrite32(DMACTL_CLRRUN, io_base + MAC_REG_RXDMACTL1);
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
if (!(ioread32(io_base + MAC_REG_RXDMACTL0) & DMACTL_RUN))
break;
@@ -413,9 +411,9 @@ bool MACbSafeTxOff(struct vnt_private *priv)

/* Clear TX DMA */
/* Tx0 */
- VNSvOutPortD(io_base + MAC_REG_TXDMACTL0, DMACTL_CLRRUN);
+ iowrite32(DMACTL_CLRRUN, io_base + MAC_REG_TXDMACTL0);
/* AC0 */
- VNSvOutPortD(io_base + MAC_REG_AC0DMACTL, DMACTL_CLRRUN);
+ iowrite32(DMACTL_CLRRUN, io_base + MAC_REG_AC0DMACTL);

for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
if (!(ioread32(io_base + MAC_REG_TXDMACTL0) & DMACTL_RUN))
@@ -572,7 +570,7 @@ void MACvSetCurrRx0DescAddr(struct vnt_private *priv, u32 dwCurrDescAddr)
break;
}

- VNSvOutPortD(io_base + MAC_REG_RXDMAPTR0, dwCurrDescAddr);
+ iowrite32(dwCurrDescAddr, io_base + MAC_REG_RXDMAPTR0);
if (byOrgDMACtl & DMACTL_RUN)
VNSvOutPortB(io_base + MAC_REG_RXDMACTL0, DMACTL_RUN);
}
@@ -606,7 +604,7 @@ void MACvSetCurrRx1DescAddr(struct vnt_private *priv, u32 dwCurrDescAddr)
break;
}

- VNSvOutPortD(io_base + MAC_REG_RXDMAPTR1, dwCurrDescAddr);
+ iowrite32(dwCurrDescAddr, io_base + MAC_REG_RXDMAPTR1);
if (byOrgDMACtl & DMACTL_RUN)
VNSvOutPortB(io_base + MAC_REG_RXDMACTL1, DMACTL_RUN);

@@ -642,7 +640,7 @@ void MACvSetCurrTx0DescAddrEx(struct vnt_private *priv,
break;
}

- VNSvOutPortD(io_base + MAC_REG_TXDMAPTR0, dwCurrDescAddr);
+ iowrite32(dwCurrDescAddr, io_base + MAC_REG_TXDMAPTR0);
if (byOrgDMACtl & DMACTL_RUN)
VNSvOutPortB(io_base + MAC_REG_TXDMACTL0, DMACTL_RUN);
}
@@ -679,7 +677,7 @@ void MACvSetCurrAC0DescAddrEx(struct vnt_private *priv,
}
if (ww == W_MAX_TIMEOUT)
pr_debug(" DBG_PORT80(0x26)\n");
- VNSvOutPortD(io_base + MAC_REG_AC0DMAPTR, dwCurrDescAddr);
+ iowrite32(dwCurrDescAddr, io_base + MAC_REG_AC0DMAPTR);
if (byOrgDMACtl & DMACTL_RUN)
VNSvOutPortB(io_base + MAC_REG_AC0DMACTL, DMACTL_RUN);
}
@@ -714,7 +712,7 @@ void MACvTimer0MicroSDelay(struct vnt_private *priv, unsigned int uDelay)
unsigned int uu, ii;

VNSvOutPortB(io_base + MAC_REG_TMCTL0, 0);
- VNSvOutPortD(io_base + MAC_REG_TMDATA0, uDelay);
+ iowrite32(uDelay, io_base + MAC_REG_TMDATA0);
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++) {
@@ -748,7 +746,7 @@ void MACvOneShotTimer1MicroSec(struct vnt_private *priv, unsigned int uDelayTime
void __iomem *io_base = priv->PortOffset;

VNSvOutPortB(io_base + MAC_REG_TMCTL1, 0);
- VNSvOutPortD(io_base + MAC_REG_TMDATA1, uDelayTime);
+ iowrite32(uDelayTime, io_base + MAC_REG_TMDATA1);
VNSvOutPortB(io_base + MAC_REG_TMCTL1, (TMCTL_TMD | TMCTL_TE));
}

@@ -760,7 +758,7 @@ void MACvSetMISCFifo(struct vnt_private *priv, unsigned short wOffset,
if (wOffset > 273)
return;
VNSvOutPortW(io_base + MAC_REG_MISCFFNDEX, wOffset);
- VNSvOutPortD(io_base + MAC_REG_MISCFFDATA, dwData);
+ iowrite32(dwData, io_base + MAC_REG_MISCFFDATA);
VNSvOutPortW(io_base + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
}

@@ -829,7 +827,7 @@ void MACvSetKeyEntry(struct vnt_private *priv, unsigned short wKeyCtl,
wOffset, dwData, wKeyCtl);

VNSvOutPortW(io_base + MAC_REG_MISCFFNDEX, wOffset);
- VNSvOutPortD(io_base + MAC_REG_MISCFFDATA, dwData);
+ iowrite32(dwData, io_base + MAC_REG_MISCFFDATA);
VNSvOutPortW(io_base + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
wOffset++;

@@ -844,7 +842,7 @@ void MACvSetKeyEntry(struct vnt_private *priv, unsigned short wKeyCtl,
pr_debug("2. wOffset: %d, Data: %X\n", wOffset, dwData);

VNSvOutPortW(io_base + MAC_REG_MISCFFNDEX, wOffset);
- VNSvOutPortD(io_base + MAC_REG_MISCFFDATA, dwData);
+ iowrite32(dwData, io_base + MAC_REG_MISCFFDATA);
VNSvOutPortW(io_base + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
wOffset++;

@@ -854,7 +852,7 @@ void MACvSetKeyEntry(struct vnt_private *priv, unsigned short wKeyCtl,
pr_debug("3.(%d) wOffset: %d, Data: %X\n",
ii, wOffset+ii, *pdwKey);
VNSvOutPortW(io_base + MAC_REG_MISCFFNDEX, wOffset+ii);
- VNSvOutPortD(io_base + MAC_REG_MISCFFDATA, *pdwKey++);
+ iowrite32(*pdwKey++, io_base + MAC_REG_MISCFFDATA);
VNSvOutPortW(io_base + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
}
}
@@ -882,6 +880,6 @@ void MACvDisableKeyEntry(struct vnt_private *priv, unsigned int uEntryIdx)
wOffset += (uEntryIdx * MISCFIFO_KEYENTRYSIZE);

VNSvOutPortW(io_base + MAC_REG_MISCFFNDEX, wOffset);
- VNSvOutPortD(io_base + MAC_REG_MISCFFDATA, 0);
+ iowrite32(0, io_base + MAC_REG_MISCFFDATA);
VNSvOutPortW(io_base + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
}
--
2.7.0


2016-03-06 12:57:37

by Malcolm Priestley

[permalink] [raw]
Subject: [PATCH 12/13] staging: vt6655: mac.c replace wOffset with offset.

Removing camel case and type prefix.

Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/mac.c | 42 +++++++++++++++++++++---------------------
1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index 87bec1c..e762c33 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -747,14 +747,14 @@ void MACvOneShotTimer1MicroSec(struct vnt_private *priv, unsigned int uDelayTime
iowrite8((TMCTL_TMD | TMCTL_TE), io_base + MAC_REG_TMCTL1);
}

-void MACvSetMISCFifo(struct vnt_private *priv, unsigned short wOffset,
+void MACvSetMISCFifo(struct vnt_private *priv, unsigned short offset,
u32 dwData)
{
void __iomem *io_base = priv->PortOffset;

- if (wOffset > 273)
+ if (offset > 273)
return;
- iowrite16(wOffset, io_base + MAC_REG_MISCFFNDEX);
+ iowrite16(offset, io_base + MAC_REG_MISCFFNDEX);
iowrite32(dwData, io_base + MAC_REG_MISCFFDATA);
iowrite16(MISCFFCTL_WRITE, io_base + MAC_REG_MISCFFCTL);
}
@@ -803,7 +803,7 @@ void MACvSetKeyEntry(struct vnt_private *priv, unsigned short wKeyCtl,
unsigned char byLocalID)
{
void __iomem *io_base = priv->PortOffset;
- unsigned short wOffset;
+ unsigned short offset;
u32 dwData;
int ii;

@@ -811,20 +811,20 @@ void MACvSetKeyEntry(struct vnt_private *priv, unsigned short wKeyCtl,
return;

pr_debug("MACvSetKeyEntry\n");
- wOffset = MISCFIFO_KEYETRY0;
- wOffset += (uEntryIdx * MISCFIFO_KEYENTRYSIZE);
+ offset = MISCFIFO_KEYETRY0;
+ offset += (uEntryIdx * MISCFIFO_KEYENTRYSIZE);

dwData = 0;
dwData |= wKeyCtl;
dwData <<= 16;
dwData |= MAKEWORD(*(pbyAddr+4), *(pbyAddr+5));
- pr_debug("1. wOffset: %d, Data: %X, KeyCtl:%X\n",
- wOffset, dwData, wKeyCtl);
+ pr_debug("1. offset: %d, Data: %X, KeyCtl:%X\n",
+ offset, dwData, wKeyCtl);

- iowrite16(wOffset, io_base + MAC_REG_MISCFFNDEX);
+ iowrite16(offset, io_base + MAC_REG_MISCFFNDEX);
iowrite32(dwData, io_base + MAC_REG_MISCFFDATA);
iowrite16(MISCFFCTL_WRITE, io_base + MAC_REG_MISCFFCTL);
- wOffset++;
+ offset++;

dwData = 0;
dwData |= *(pbyAddr+3);
@@ -834,19 +834,19 @@ void MACvSetKeyEntry(struct vnt_private *priv, unsigned short wKeyCtl,
dwData |= *(pbyAddr+1);
dwData <<= 8;
dwData |= *(pbyAddr+0);
- pr_debug("2. wOffset: %d, Data: %X\n", wOffset, dwData);
+ pr_debug("2. offset: %d, Data: %X\n", offset, dwData);

- iowrite16(wOffset, io_base + MAC_REG_MISCFFNDEX);
+ iowrite16(offset, io_base + MAC_REG_MISCFFNDEX);
iowrite32(dwData, io_base + MAC_REG_MISCFFDATA);
iowrite16(MISCFFCTL_WRITE, io_base + MAC_REG_MISCFFCTL);
- wOffset++;
+ offset++;

- wOffset += (uKeyIdx * 4);
+ offset += (uKeyIdx * 4);
for (ii = 0; ii < 4; ii++) {
/* always push 128 bits */
- pr_debug("3.(%d) wOffset: %d, Data: %X\n",
- ii, wOffset+ii, *pdwKey);
- iowrite16(wOffset + ii, io_base + MAC_REG_MISCFFNDEX);
+ pr_debug("3.(%d) offset: %d, Data: %X\n",
+ ii, offset + ii, *pdwKey);
+ iowrite16(offset + ii, io_base + MAC_REG_MISCFFNDEX);
iowrite32(*pdwKey++, io_base + MAC_REG_MISCFFDATA);
iowrite16(MISCFFCTL_WRITE, io_base + MAC_REG_MISCFFCTL);
}
@@ -869,12 +869,12 @@ void MACvSetKeyEntry(struct vnt_private *priv, unsigned short wKeyCtl,
void MACvDisableKeyEntry(struct vnt_private *priv, unsigned int uEntryIdx)
{
void __iomem *io_base = priv->PortOffset;
- unsigned short wOffset;
+ unsigned short offset;

- wOffset = MISCFIFO_KEYETRY0;
- wOffset += (uEntryIdx * MISCFIFO_KEYENTRYSIZE);
+ offset = MISCFIFO_KEYETRY0;
+ offset += (uEntryIdx * MISCFIFO_KEYENTRYSIZE);

- iowrite16(wOffset, io_base + MAC_REG_MISCFFNDEX);
+ iowrite16(offset, io_base + MAC_REG_MISCFFNDEX);
iowrite32(0, io_base + MAC_REG_MISCFFDATA);
iowrite16(MISCFFCTL_WRITE, io_base + MAC_REG_MISCFFCTL);
}
--
2.7.0