with struct vnt_rdes0 replacing members as follows
wResCount -> res_count
f15Reserved -> f15_reserved
f1Owner -> owner
big endian
f8Reserved1 -> f8_reserved1
f7Reserved -> f7_reserved
Narrowing endian differences to inside structure.
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/card.c | 8 ++++----
drivers/staging/vt6655/desc.h | 33 ++++++++++++---------------------
drivers/staging/vt6655/device_main.c | 10 +++++-----
drivers/staging/vt6655/dpc.c | 2 +-
4 files changed, 22 insertions(+), 31 deletions(-)
diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index c7b75df..ab632e0 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -573,16 +573,16 @@ CARDvSafeResetRx(
/* init state, all RD is chip's */
for (uu = 0; uu < pDevice->sOpts.nRxDescs0; uu++) {
pDesc = &(pDevice->aRD0Ring[uu]);
- pDesc->m_rd0RD0.wResCount = cpu_to_le16(pDevice->rx_buf_sz);
- pDesc->m_rd0RD0.f1Owner = OWNED_BY_NIC;
+ pDesc->rd0.res_count = cpu_to_le16(pDevice->rx_buf_sz);
+ pDesc->rd0.owner = OWNED_BY_NIC;
pDesc->m_rd1RD1.wReqCount = cpu_to_le16(pDevice->rx_buf_sz);
}
/* init state, all RD is chip's */
for (uu = 0; uu < pDevice->sOpts.nRxDescs1; uu++) {
pDesc = &(pDevice->aRD1Ring[uu]);
- pDesc->m_rd0RD0.wResCount = cpu_to_le16(pDevice->rx_buf_sz);
- pDesc->m_rd0RD0.f1Owner = OWNED_BY_NIC;
+ pDesc->rd0.res_count = cpu_to_le16(pDevice->rx_buf_sz);
+ pDesc->rd0.owner = OWNED_BY_NIC;
pDesc->m_rd1RD1.wReqCount = cpu_to_le16(pDevice->rx_buf_sz);
}
diff --git a/drivers/staging/vt6655/desc.h b/drivers/staging/vt6655/desc.h
index 3c9007e..68b3121 100644
--- a/drivers/staging/vt6655/desc.h
+++ b/drivers/staging/vt6655/desc.h
@@ -172,31 +172,22 @@ typedef struct tagDEVICE_RD_INFO {
dma_addr_t skb_dma;
} DEVICE_RD_INFO, *PDEVICE_RD_INFO;
+struct vnt_rdes0 {
+ volatile __le16 res_count;
#ifdef __BIG_ENDIAN
-
-typedef struct tagRDES0 {
- volatile __le16 wResCount;
union {
- volatile u16 f15Reserved;
+ volatile u16 f15_reserved;
struct {
- volatile u8 f8Reserved1;
- volatile u8 f1Owner:1;
- volatile u8 f7Reserved:7;
- } __attribute__ ((__packed__));
- } __attribute__ ((__packed__));
-} __attribute__ ((__packed__))
-SRDES0, *PSRDES0;
-
+ volatile u8 f8_reserved1;
+ volatile u8 owner:1;
+ volatile u8 f7_reserved:7;
+ } __packed;
+ } __packed;
#else
-
-typedef struct tagRDES0 {
- __le16 wResCount;
- unsigned short f15Reserved:15;
- unsigned short f1Owner:1;
-} __attribute__ ((__packed__))
-SRDES0;
-
+ u16 f15_reserved:15;
+ u16 owner:1;
#endif
+} __packed;
typedef struct tagRDES1 {
__le16 wReqCount;
@@ -206,7 +197,7 @@ SRDES1;
/* Rx descriptor*/
typedef struct tagSRxDesc {
- volatile SRDES0 m_rd0RD0;
+ volatile struct vnt_rdes0 rd0;
volatile SRDES1 m_rd1RD1;
volatile __le32 buff_addr;
volatile __le32 next_desc;
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index 0d8f123..37c2be2 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -778,7 +778,7 @@ static int device_rx_srv(struct vnt_private *pDevice, unsigned int uIdx)
int works = 0;
for (pRD = pDevice->pCurrRD[uIdx];
- pRD->m_rd0RD0.f1Owner == OWNED_BY_HOST;
+ pRD->rd0.owner == OWNED_BY_HOST;
pRD = pRD->next) {
if (works++ > 15)
break;
@@ -793,7 +793,7 @@ static int device_rx_srv(struct vnt_private *pDevice, unsigned int uIdx)
break;
}
}
- pRD->m_rd0RD0.f1Owner = OWNED_BY_NIC;
+ pRD->rd0.owner = OWNED_BY_NIC;
}
pDevice->pCurrRD[uIdx] = pRD;
@@ -814,10 +814,10 @@ static bool device_alloc_rx_buf(struct vnt_private *pDevice, PSRxDesc pRD)
skb_put(pRDInfo->skb, skb_tailroom(pRDInfo->skb)),
pDevice->rx_buf_sz, DMA_FROM_DEVICE);
- *((unsigned int *)&(pRD->m_rd0RD0)) = 0; /* FIX cast */
+ *((unsigned int *)&pRD->rd0) = 0; /* FIX cast */
- pRD->m_rd0RD0.wResCount = cpu_to_le16(pDevice->rx_buf_sz);
- pRD->m_rd0RD0.f1Owner = OWNED_BY_NIC;
+ pRD->rd0.res_count = cpu_to_le16(pDevice->rx_buf_sz);
+ pRD->rd0.owner = OWNED_BY_NIC;
pRD->m_rd1RD1.wReqCount = cpu_to_le16(pDevice->rx_buf_sz);
pRD->buff_addr = cpu_to_le32(pRDInfo->skb_dma);
diff --git a/drivers/staging/vt6655/dpc.c b/drivers/staging/vt6655/dpc.c
index e14eed1..dbaaeeb 100644
--- a/drivers/staging/vt6655/dpc.c
+++ b/drivers/staging/vt6655/dpc.c
@@ -144,7 +144,7 @@ bool vnt_receive_frame(struct vnt_private *priv, PSRxDesc curr_rd)
priv->rx_buf_sz, DMA_FROM_DEVICE);
frame_size = le16_to_cpu(curr_rd->m_rd1RD1.wReqCount)
- - le16_to_cpu(curr_rd->m_rd0RD0.wResCount);
+ - le16_to_cpu(curr_rd->rd0.res_count);
if ((frame_size > 2364) || (frame_size < 33)) {
/* Frame Size error drop this packet.*/
--
2.5.0
with struct vnt_rdes1 and members
wReqCount -> req_count
wReserved -> reserved
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/card.c | 4 ++--
drivers/staging/vt6655/desc.h | 11 +++++------
drivers/staging/vt6655/device_main.c | 2 +-
drivers/staging/vt6655/dpc.c | 2 +-
4 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index ab632e0..7a30ba2 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -575,7 +575,7 @@ CARDvSafeResetRx(
pDesc = &(pDevice->aRD0Ring[uu]);
pDesc->rd0.res_count = cpu_to_le16(pDevice->rx_buf_sz);
pDesc->rd0.owner = OWNED_BY_NIC;
- pDesc->m_rd1RD1.wReqCount = cpu_to_le16(pDevice->rx_buf_sz);
+ pDesc->rd1.req_count = cpu_to_le16(pDevice->rx_buf_sz);
}
/* init state, all RD is chip's */
@@ -583,7 +583,7 @@ CARDvSafeResetRx(
pDesc = &(pDevice->aRD1Ring[uu]);
pDesc->rd0.res_count = cpu_to_le16(pDevice->rx_buf_sz);
pDesc->rd0.owner = OWNED_BY_NIC;
- pDesc->m_rd1RD1.wReqCount = cpu_to_le16(pDevice->rx_buf_sz);
+ pDesc->rd1.req_count = cpu_to_le16(pDevice->rx_buf_sz);
}
/* set perPkt mode */
diff --git a/drivers/staging/vt6655/desc.h b/drivers/staging/vt6655/desc.h
index 68b3121..eb0c7c3 100644
--- a/drivers/staging/vt6655/desc.h
+++ b/drivers/staging/vt6655/desc.h
@@ -189,16 +189,15 @@ struct vnt_rdes0 {
#endif
} __packed;
-typedef struct tagRDES1 {
- __le16 wReqCount;
- unsigned short wReserved;
-} __attribute__ ((__packed__))
-SRDES1;
+struct vnt_rdes1 {
+ __le16 req_count;
+ u16 reserved;
+} __packed;
/* Rx descriptor*/
typedef struct tagSRxDesc {
volatile struct vnt_rdes0 rd0;
- volatile SRDES1 m_rd1RD1;
+ volatile struct vnt_rdes1 rd1;
volatile __le32 buff_addr;
volatile __le32 next_desc;
struct tagSRxDesc *next __aligned(8);
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index 37c2be2..22c1957 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -818,7 +818,7 @@ static bool device_alloc_rx_buf(struct vnt_private *pDevice, PSRxDesc pRD)
pRD->rd0.res_count = cpu_to_le16(pDevice->rx_buf_sz);
pRD->rd0.owner = OWNED_BY_NIC;
- pRD->m_rd1RD1.wReqCount = cpu_to_le16(pDevice->rx_buf_sz);
+ pRD->rd1.req_count = cpu_to_le16(pDevice->rx_buf_sz);
pRD->buff_addr = cpu_to_le32(pRDInfo->skb_dma);
return true;
diff --git a/drivers/staging/vt6655/dpc.c b/drivers/staging/vt6655/dpc.c
index dbaaeeb..ef39cbe 100644
--- a/drivers/staging/vt6655/dpc.c
+++ b/drivers/staging/vt6655/dpc.c
@@ -143,7 +143,7 @@ bool vnt_receive_frame(struct vnt_private *priv, PSRxDesc curr_rd)
dma_unmap_single(&priv->pcid->dev, rd_info->skb_dma,
priv->rx_buf_sz, DMA_FROM_DEVICE);
- frame_size = le16_to_cpu(curr_rd->m_rd1RD1.wReqCount)
+ frame_size = le16_to_cpu(curr_rd->rd1.req_count)
- le16_to_cpu(curr_rd->rd0.res_count);
if ((frame_size > 2364) || (frame_size < 33)) {
--
2.5.0
with struct vnt_rx_desc and all members the same.
volatile is removed from pointers as this generates warning
message.
Only the first four members of vnt_rx_desc need to be volatile.
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/card.c | 2 +-
drivers/staging/vt6655/desc.h | 8 +++---
drivers/staging/vt6655/device.h | 6 ++---
drivers/staging/vt6655/device_main.c | 51 +++++++++++++++++++-----------------
drivers/staging/vt6655/dpc.c | 2 +-
drivers/staging/vt6655/dpc.h | 2 +-
6 files changed, 36 insertions(+), 35 deletions(-)
diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index 7a30ba2..ecbe94f 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -564,7 +564,7 @@ CARDvSafeResetRx(
)
{
unsigned int uu;
- PSRxDesc pDesc;
+ struct vnt_rx_desc *pDesc;
/* initialize RD index */
pDevice->pCurrRD[0] = &(pDevice->aRD0Ring[0]);
diff --git a/drivers/staging/vt6655/desc.h b/drivers/staging/vt6655/desc.h
index 752c546..9fbc717 100644
--- a/drivers/staging/vt6655/desc.h
+++ b/drivers/staging/vt6655/desc.h
@@ -195,16 +195,14 @@ struct vnt_rdes1 {
} __packed;
/* Rx descriptor*/
-typedef struct tagSRxDesc {
+struct vnt_rx_desc {
volatile struct vnt_rdes0 rd0;
volatile struct vnt_rdes1 rd1;
volatile __le32 buff_addr;
volatile __le32 next_desc;
- struct tagSRxDesc *next __aligned(8);
+ struct vnt_rx_desc *next __aligned(8);
struct vnt_rd_info *rd_info __aligned(8);
-} __attribute__ ((__packed__))
-SRxDesc, *PSRxDesc;
-typedef const SRxDesc *PCSRxDesc;
+} __packed;
struct vnt_tdes0 {
volatile u8 tsr0;
diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index 80cc170..d1917d0 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -258,9 +258,9 @@ struct vnt_private {
struct vnt_tx_desc *apTD0Rings;
struct vnt_tx_desc *apTD1Rings;
- volatile PSRxDesc aRD0Ring;
- volatile PSRxDesc aRD1Ring;
- volatile PSRxDesc pCurrRD[TYPE_MAXRD];
+ struct vnt_rx_desc *aRD0Ring;
+ struct vnt_rx_desc *aRD1Ring;
+ struct vnt_rx_desc *pCurrRD[TYPE_MAXRD];
OPTIONS sOpts;
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index defdcc0..86c24a1 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -155,7 +155,7 @@ static void device_init_td1_ring(struct vnt_private *pDevice);
static int device_rx_srv(struct vnt_private *pDevice, unsigned int uIdx);
static int device_tx_srv(struct vnt_private *pDevice, unsigned int uIdx);
-static bool device_alloc_rx_buf(struct vnt_private *pDevice, PSRxDesc pDesc);
+static bool device_alloc_rx_buf(struct vnt_private *, struct vnt_rx_desc *);
static void device_init_registers(struct vnt_private *pDevice);
static void device_free_tx_buf(struct vnt_private *, struct vnt_tx_desc *);
static void device_free_td0_ring(struct vnt_private *pDevice);
@@ -520,8 +520,8 @@ static bool device_init_rings(struct vnt_private *pDevice)
/*allocate all RD/TD rings a single pool*/
vir_pool = dma_zalloc_coherent(&pDevice->pcid->dev,
- pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) +
- pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc) +
+ pDevice->sOpts.nRxDescs0 * sizeof(struct vnt_rx_desc) +
+ pDevice->sOpts.nRxDescs1 * sizeof(struct vnt_rx_desc) +
pDevice->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc) +
pDevice->sOpts.nTxDescs[1] * sizeof(struct vnt_tx_desc),
&pDevice->pool_dma, GFP_ATOMIC);
@@ -532,11 +532,11 @@ static bool device_init_rings(struct vnt_private *pDevice)
pDevice->aRD0Ring = vir_pool;
pDevice->aRD1Ring = vir_pool +
- pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc);
+ pDevice->sOpts.nRxDescs0 * sizeof(struct vnt_rx_desc);
pDevice->rd0_pool_dma = pDevice->pool_dma;
pDevice->rd1_pool_dma = pDevice->rd0_pool_dma +
- pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc);
+ pDevice->sOpts.nRxDescs0 * sizeof(struct vnt_rx_desc);
pDevice->tx0_bufs = dma_zalloc_coherent(&pDevice->pcid->dev,
pDevice->sOpts.nTxDescs[0] * PKT_BUF_SZ +
@@ -549,8 +549,8 @@ static bool device_init_rings(struct vnt_private *pDevice)
dev_err(&pDevice->pcid->dev, "allocate buf dma memory failed\n");
dma_free_coherent(&pDevice->pcid->dev,
- pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) +
- pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc) +
+ pDevice->sOpts.nRxDescs0 * sizeof(struct vnt_rx_desc) +
+ pDevice->sOpts.nRxDescs1 * sizeof(struct vnt_rx_desc) +
pDevice->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc) +
pDevice->sOpts.nTxDescs[1] * sizeof(struct vnt_tx_desc),
vir_pool, pDevice->pool_dma
@@ -559,19 +559,19 @@ static bool device_init_rings(struct vnt_private *pDevice)
}
pDevice->td0_pool_dma = pDevice->rd1_pool_dma +
- pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc);
+ pDevice->sOpts.nRxDescs1 * sizeof(struct vnt_rx_desc);
pDevice->td1_pool_dma = pDevice->td0_pool_dma +
pDevice->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc);
/* vir_pool: pvoid type */
pDevice->apTD0Rings = vir_pool
- + pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc)
- + pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc);
+ + pDevice->sOpts.nRxDescs0 * sizeof(struct vnt_rx_desc)
+ + pDevice->sOpts.nRxDescs1 * sizeof(struct vnt_rx_desc);
pDevice->apTD1Rings = vir_pool
- + pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc)
- + pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc)
+ + pDevice->sOpts.nRxDescs0 * sizeof(struct vnt_rx_desc)
+ + pDevice->sOpts.nRxDescs1 * sizeof(struct vnt_rx_desc)
+ pDevice->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc);
pDevice->tx1_bufs = pDevice->tx0_bufs +
@@ -595,8 +595,8 @@ static bool device_init_rings(struct vnt_private *pDevice)
static void device_free_rings(struct vnt_private *pDevice)
{
dma_free_coherent(&pDevice->pcid->dev,
- pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) +
- pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc) +
+ pDevice->sOpts.nRxDescs0 * sizeof(struct vnt_rx_desc) +
+ pDevice->sOpts.nRxDescs1 * sizeof(struct vnt_rx_desc) +
pDevice->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc) +
pDevice->sOpts.nTxDescs[1] * sizeof(struct vnt_tx_desc)
,
@@ -617,10 +617,11 @@ static void device_init_rd0_ring(struct vnt_private *pDevice)
{
int i;
dma_addr_t curr = pDevice->rd0_pool_dma;
- PSRxDesc pDesc;
+ struct vnt_rx_desc *pDesc;
/* Init the RD0 ring entries */
- for (i = 0; i < pDevice->sOpts.nRxDescs0; i ++, curr += sizeof(SRxDesc)) {
+ for (i = 0; i < pDevice->sOpts.nRxDescs0;
+ i ++, curr += sizeof(struct vnt_rx_desc)) {
pDesc = &(pDevice->aRD0Ring[i]);
pDesc->rd_info = alloc_rd_info();
@@ -628,7 +629,7 @@ static void device_init_rd0_ring(struct vnt_private *pDevice)
dev_err(&pDevice->pcid->dev, "can not alloc rx bufs\n");
pDesc->next = &(pDevice->aRD0Ring[(i+1) % pDevice->sOpts.nRxDescs0]);
- pDesc->next_desc = cpu_to_le32(curr + sizeof(SRxDesc));
+ pDesc->next_desc = cpu_to_le32(curr + sizeof(struct vnt_rx_desc));
}
if (i > 0)
@@ -640,10 +641,11 @@ static void device_init_rd1_ring(struct vnt_private *pDevice)
{
int i;
dma_addr_t curr = pDevice->rd1_pool_dma;
- PSRxDesc pDesc;
+ struct vnt_rx_desc *pDesc;
/* Init the RD1 ring entries */
- for (i = 0; i < pDevice->sOpts.nRxDescs1; i ++, curr += sizeof(SRxDesc)) {
+ for (i = 0; i < pDevice->sOpts.nRxDescs1;
+ i ++, curr += sizeof(struct vnt_rx_desc)) {
pDesc = &(pDevice->aRD1Ring[i]);
pDesc->rd_info = alloc_rd_info();
@@ -651,7 +653,7 @@ static void device_init_rd1_ring(struct vnt_private *pDevice)
dev_err(&pDevice->pcid->dev, "can not alloc rx bufs\n");
pDesc->next = &(pDevice->aRD1Ring[(i+1) % pDevice->sOpts.nRxDescs1]);
- pDesc->next_desc = cpu_to_le32(curr + sizeof(SRxDesc));
+ pDesc->next_desc = cpu_to_le32(curr + sizeof(struct vnt_rx_desc));
}
if (i > 0)
@@ -664,7 +666,7 @@ static void device_free_rd0_ring(struct vnt_private *pDevice)
int i;
for (i = 0; i < pDevice->sOpts.nRxDescs0; i++) {
- PSRxDesc pDesc = &(pDevice->aRD0Ring[i]);
+ struct vnt_rx_desc *pDesc = &(pDevice->aRD0Ring[i]);
struct vnt_rd_info *rd_info = pDesc->rd_info;
dma_unmap_single(&pDevice->pcid->dev, rd_info->skb_dma,
@@ -681,7 +683,7 @@ static void device_free_rd1_ring(struct vnt_private *pDevice)
int i;
for (i = 0; i < pDevice->sOpts.nRxDescs1; i++) {
- PSRxDesc pDesc = &(pDevice->aRD1Ring[i]);
+ struct vnt_rx_desc *pDesc = &(pDevice->aRD1Ring[i]);
struct vnt_rd_info *rd_info = pDesc->rd_info;
dma_unmap_single(&pDevice->pcid->dev, rd_info->skb_dma,
@@ -774,7 +776,7 @@ static void device_free_td1_ring(struct vnt_private *pDevice)
static int device_rx_srv(struct vnt_private *pDevice, unsigned int uIdx)
{
- PSRxDesc pRD;
+ struct vnt_rx_desc *pRD;
int works = 0;
for (pRD = pDevice->pCurrRD[uIdx];
@@ -801,7 +803,8 @@ static int device_rx_srv(struct vnt_private *pDevice, unsigned int uIdx)
return works;
}
-static bool device_alloc_rx_buf(struct vnt_private *pDevice, PSRxDesc pRD)
+static bool device_alloc_rx_buf(struct vnt_private *pDevice,
+ struct vnt_rx_desc *pRD)
{
struct vnt_rd_info *pRDInfo = pRD->rd_info;
diff --git a/drivers/staging/vt6655/dpc.c b/drivers/staging/vt6655/dpc.c
index 4659185..700032e 100644
--- a/drivers/staging/vt6655/dpc.c
+++ b/drivers/staging/vt6655/dpc.c
@@ -132,7 +132,7 @@ static bool vnt_rx_data(struct vnt_private *priv, struct sk_buff *skb,
return true;
}
-bool vnt_receive_frame(struct vnt_private *priv, PSRxDesc curr_rd)
+bool vnt_receive_frame(struct vnt_private *priv, struct vnt_rx_desc *curr_rd)
{
struct vnt_rd_info *rd_info = curr_rd->rd_info;
struct sk_buff *skb;
diff --git a/drivers/staging/vt6655/dpc.h b/drivers/staging/vt6655/dpc.h
index ad49571..e80b308 100644
--- a/drivers/staging/vt6655/dpc.h
+++ b/drivers/staging/vt6655/dpc.h
@@ -31,6 +31,6 @@
#include "device.h"
-bool vnt_receive_frame(struct vnt_private *priv, PSRxDesc curr_rd);
+bool vnt_receive_frame(struct vnt_private *priv, struct vnt_rx_desc *curr_rd);
#endif /* __RXTX_H__ */
--
2.5.0
with struct vnt_rd_info
volatile is removed because it will generate a warning
(in any case this member is not) and renaming rd_info.
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/desc.h | 6 +++---
drivers/staging/vt6655/device.h | 4 ++--
drivers/staging/vt6655/device_main.c | 24 ++++++++++++------------
drivers/staging/vt6655/dpc.c | 2 +-
4 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/drivers/staging/vt6655/desc.h b/drivers/staging/vt6655/desc.h
index eb0c7c3..752c546 100644
--- a/drivers/staging/vt6655/desc.h
+++ b/drivers/staging/vt6655/desc.h
@@ -167,10 +167,10 @@
* leads error.
*/
-typedef struct tagDEVICE_RD_INFO {
+struct vnt_rd_info {
struct sk_buff *skb;
dma_addr_t skb_dma;
-} DEVICE_RD_INFO, *PDEVICE_RD_INFO;
+};
struct vnt_rdes0 {
volatile __le16 res_count;
@@ -201,7 +201,7 @@ typedef struct tagSRxDesc {
volatile __le32 buff_addr;
volatile __le32 next_desc;
struct tagSRxDesc *next __aligned(8);
- volatile PDEVICE_RD_INFO pRDInfo __aligned(8);
+ struct vnt_rd_info *rd_info __aligned(8);
} __attribute__ ((__packed__))
SRxDesc, *PSRxDesc;
typedef const SRxDesc *PCSRxDesc;
diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index c9fa6ef..80cc170 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -410,9 +410,9 @@ struct vnt_private {
struct ieee80211_low_level_stats low_stats;
};
-static inline PDEVICE_RD_INFO alloc_rd_info(void)
+static inline struct vnt_rd_info *alloc_rd_info(void)
{
- return kzalloc(sizeof(DEVICE_RD_INFO), GFP_ATOMIC);
+ return kzalloc(sizeof(struct vnt_rd_info), GFP_ATOMIC);
}
static inline struct vnt_td_info *alloc_td_info(void)
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index 22c1957..defdcc0 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -622,7 +622,7 @@ static void device_init_rd0_ring(struct vnt_private *pDevice)
/* Init the RD0 ring entries */
for (i = 0; i < pDevice->sOpts.nRxDescs0; i ++, curr += sizeof(SRxDesc)) {
pDesc = &(pDevice->aRD0Ring[i]);
- pDesc->pRDInfo = alloc_rd_info();
+ pDesc->rd_info = alloc_rd_info();
if (!device_alloc_rx_buf(pDevice, pDesc))
dev_err(&pDevice->pcid->dev, "can not alloc rx bufs\n");
@@ -645,7 +645,7 @@ static void device_init_rd1_ring(struct vnt_private *pDevice)
/* Init the RD1 ring entries */
for (i = 0; i < pDevice->sOpts.nRxDescs1; i ++, curr += sizeof(SRxDesc)) {
pDesc = &(pDevice->aRD1Ring[i]);
- pDesc->pRDInfo = alloc_rd_info();
+ pDesc->rd_info = alloc_rd_info();
if (!device_alloc_rx_buf(pDevice, pDesc))
dev_err(&pDevice->pcid->dev, "can not alloc rx bufs\n");
@@ -665,14 +665,14 @@ static void device_free_rd0_ring(struct vnt_private *pDevice)
for (i = 0; i < pDevice->sOpts.nRxDescs0; i++) {
PSRxDesc pDesc = &(pDevice->aRD0Ring[i]);
- PDEVICE_RD_INFO pRDInfo = pDesc->pRDInfo;
+ struct vnt_rd_info *rd_info = pDesc->rd_info;
- dma_unmap_single(&pDevice->pcid->dev, pRDInfo->skb_dma,
+ dma_unmap_single(&pDevice->pcid->dev, rd_info->skb_dma,
pDevice->rx_buf_sz, DMA_FROM_DEVICE);
- dev_kfree_skb(pRDInfo->skb);
+ dev_kfree_skb(rd_info->skb);
- kfree(pDesc->pRDInfo);
+ kfree(pDesc->rd_info);
}
}
@@ -682,14 +682,14 @@ static void device_free_rd1_ring(struct vnt_private *pDevice)
for (i = 0; i < pDevice->sOpts.nRxDescs1; i++) {
PSRxDesc pDesc = &(pDevice->aRD1Ring[i]);
- PDEVICE_RD_INFO pRDInfo = pDesc->pRDInfo;
+ struct vnt_rd_info *rd_info = pDesc->rd_info;
- dma_unmap_single(&pDevice->pcid->dev, pRDInfo->skb_dma,
+ dma_unmap_single(&pDevice->pcid->dev, rd_info->skb_dma,
pDevice->rx_buf_sz, DMA_FROM_DEVICE);
- dev_kfree_skb(pRDInfo->skb);
+ dev_kfree_skb(rd_info->skb);
- kfree(pDesc->pRDInfo);
+ kfree(pDesc->rd_info);
}
}
@@ -783,7 +783,7 @@ static int device_rx_srv(struct vnt_private *pDevice, unsigned int uIdx)
if (works++ > 15)
break;
- if (!pRD->pRDInfo->skb)
+ if (!pRD->rd_info->skb)
break;
if (vnt_receive_frame(pDevice, pRD)) {
@@ -803,7 +803,7 @@ static int device_rx_srv(struct vnt_private *pDevice, unsigned int uIdx)
static bool device_alloc_rx_buf(struct vnt_private *pDevice, PSRxDesc pRD)
{
- PDEVICE_RD_INFO pRDInfo = pRD->pRDInfo;
+ struct vnt_rd_info *pRDInfo = pRD->rd_info;
pRDInfo->skb = dev_alloc_skb((int)pDevice->rx_buf_sz);
if (pRDInfo->skb == NULL)
diff --git a/drivers/staging/vt6655/dpc.c b/drivers/staging/vt6655/dpc.c
index ef39cbe..4659185 100644
--- a/drivers/staging/vt6655/dpc.c
+++ b/drivers/staging/vt6655/dpc.c
@@ -134,7 +134,7 @@ static bool vnt_rx_data(struct vnt_private *priv, struct sk_buff *skb,
bool vnt_receive_frame(struct vnt_private *priv, PSRxDesc curr_rd)
{
- PDEVICE_RD_INFO rd_info = curr_rd->pRDInfo;
+ struct vnt_rd_info *rd_info = curr_rd->rd_info;
struct sk_buff *skb;
u16 frame_size;
--
2.5.0