staging: vt6655: replace typedef struct tagRDES0
authorMalcolm Priestley <tvboxspy@gmail.com>
Sat, 15 Aug 2015 20:57:32 +0000 (21:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Sep 2015 01:24:26 +0000 (18:24 -0700)
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 <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6655/card.c
drivers/staging/vt6655/desc.h
drivers/staging/vt6655/device_main.c
drivers/staging/vt6655/dpc.c

index c7b75dfc2d5f27cc9c2c882ac1becdf9b6b0c487..ab632e0d8cc4079dd3bc7db477f49a5eae6bf86e 100644 (file)
@@ -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);
        }
 
index 3c9007e34c0ff30c644d923a2a040bcf146f456b..68b3121917b38c61529b092613ccdc925cc1ee68 100644 (file)
@@ -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;
index 0d8f123c57fe22cebe800d7c282e6808bb046b3c..37c2be2fbe4c2b2b9eb149b75189aad6072a2216 100644 (file)
@@ -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);
 
index e14eed160a191fd5405ea900ea720bcbbeda230e..dbaaeeb94817461c9533b0cf70133f19791e8ec2 100644 (file)
@@ -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.*/