staging: vt6655: Replace typedef struct tagSTxDesc
authorMalcolm Priestley <tvboxspy@gmail.com>
Fri, 14 Aug 2015 21:58:51 +0000 (22:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Aug 2015 02:31:11 +0000 (19:31 -0700)
Replace with struct vnt_tx_desc with all members the same.

volatile is removed from pointers as this generates warning
message.

Only the first four members of vnt_tx_desc need to be volatile.

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.h
drivers/staging/vt6655/device_main.c
drivers/staging/vt6655/rxtx.c
drivers/staging/vt6655/rxtx.h

index e3ff4ad2e317990adbfb1b1695da1e4a42567857..c7b75dfc2d5f27cc9c2c882ac1becdf9b6b0c487 100644 (file)
@@ -514,7 +514,7 @@ CARDvSafeResetTx(
 )
 {
        unsigned int uu;
-       PSTxDesc    pCurrTD;
+       struct vnt_tx_desc *pCurrTD;
 
        /* initialize TD index */
        pDevice->apTailTD[0] = pDevice->apCurrTD[0] = &(pDevice->apTD0Rings[0]);
index 452971cb209e39531e07f6d9448a1174992f8901..3c9007e34c0ff30c644d923a2a040bcf146f456b 100644 (file)
@@ -250,16 +250,14 @@ struct vnt_td_info {
 };
 
 /* transmit descriptor */
-typedef struct tagSTxDesc {
+struct vnt_tx_desc {
        volatile struct vnt_tdes0 td0;
        volatile struct vnt_tdes1 td1;
-       volatile    __le32  buff_addr;
-       volatile    __le32  next_desc;
-       struct tagSTxDesc *next __aligned(8);
+       volatile __le32 buff_addr;
+       volatile __le32 next_desc;
+       struct vnt_tx_desc *next __aligned(8);
        struct vnt_td_info *td_info __aligned(8);
-} __attribute__ ((__packed__))
-STxDesc, *PSTxDesc;
-typedef const STxDesc *PCSTxDesc;
+} __packed;
 
 /* Length, Service, and Signal fields of Phy for Tx */
 struct vnt_phy_field {
index a31769a184d0591f3262a82fc2ec9cf3427cfe19..c9fa6ef42d340d6cb5e48343e503cbdaec43e7c4 100644 (file)
@@ -252,11 +252,11 @@ struct vnt_private {
        int                         nTxQueues;
        volatile int                iTDUsed[TYPE_MAXTD];
 
-       volatile PSTxDesc           apCurrTD[TYPE_MAXTD];
-       volatile PSTxDesc           apTailTD[TYPE_MAXTD];
+       struct vnt_tx_desc *apCurrTD[TYPE_MAXTD];
+       struct vnt_tx_desc *apTailTD[TYPE_MAXTD];
 
-       volatile PSTxDesc           apTD0Rings;
-       volatile PSTxDesc           apTD1Rings;
+       struct vnt_tx_desc *apTD0Rings;
+       struct vnt_tx_desc *apTD1Rings;
 
        volatile PSRxDesc           aRD0Ring;
        volatile PSRxDesc           aRD1Ring;
index f3d81787c98cd12e79d74e77151279f2f1027de9..0d8f123c57fe22cebe800d7c282e6808bb046b3c 100644 (file)
@@ -157,7 +157,7 @@ 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 void device_init_registers(struct vnt_private *pDevice);
-static void device_free_tx_buf(struct vnt_private *pDevice, PSTxDesc pDesc);
+static void device_free_tx_buf(struct vnt_private *, struct vnt_tx_desc *);
 static void device_free_td0_ring(struct vnt_private *pDevice);
 static void device_free_td1_ring(struct vnt_private *pDevice);
 static void device_free_rd0_ring(struct vnt_private *pDevice);
@@ -522,8 +522,8 @@ static bool device_init_rings(struct vnt_private *pDevice)
        vir_pool = dma_zalloc_coherent(&pDevice->pcid->dev,
                                         pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) +
                                         pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc) +
-                                        pDevice->sOpts.nTxDescs[0] * sizeof(STxDesc) +
-                                        pDevice->sOpts.nTxDescs[1] * sizeof(STxDesc),
+                                        pDevice->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc) +
+                                        pDevice->sOpts.nTxDescs[1] * sizeof(struct vnt_tx_desc),
                                         &pDevice->pool_dma, GFP_ATOMIC);
        if (vir_pool == NULL) {
                dev_err(&pDevice->pcid->dev, "allocate desc dma memory failed\n");
@@ -551,8 +551,8 @@ static bool device_init_rings(struct vnt_private *pDevice)
                dma_free_coherent(&pDevice->pcid->dev,
                                    pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) +
                                    pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc) +
-                                   pDevice->sOpts.nTxDescs[0] * sizeof(STxDesc) +
-                                   pDevice->sOpts.nTxDescs[1] * sizeof(STxDesc),
+                                   pDevice->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc) +
+                                   pDevice->sOpts.nTxDescs[1] * sizeof(struct vnt_tx_desc),
                                    vir_pool, pDevice->pool_dma
                        );
                return false;
@@ -562,7 +562,7 @@ static bool device_init_rings(struct vnt_private *pDevice)
                pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc);
 
        pDevice->td1_pool_dma = pDevice->td0_pool_dma +
-               pDevice->sOpts.nTxDescs[0] * sizeof(STxDesc);
+               pDevice->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc);
 
        /* vir_pool: pvoid type */
        pDevice->apTD0Rings = vir_pool
@@ -572,7 +572,7 @@ static bool device_init_rings(struct vnt_private *pDevice)
        pDevice->apTD1Rings = vir_pool
                + pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc)
                + pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc)
-               + pDevice->sOpts.nTxDescs[0] * sizeof(STxDesc);
+               + pDevice->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc);
 
        pDevice->tx1_bufs = pDevice->tx0_bufs +
                pDevice->sOpts.nTxDescs[0] * PKT_BUF_SZ;
@@ -597,8 +597,8 @@ 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.nTxDescs[0] * sizeof(STxDesc) +
-                           pDevice->sOpts.nTxDescs[1] * sizeof(STxDesc)
+                           pDevice->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc) +
+                           pDevice->sOpts.nTxDescs[1] * sizeof(struct vnt_tx_desc)
                            ,
                            pDevice->aRD0Ring, pDevice->pool_dma
                );
@@ -697,10 +697,11 @@ static void device_init_td0_ring(struct vnt_private *pDevice)
 {
        int i;
        dma_addr_t  curr;
-       PSTxDesc        pDesc;
+       struct vnt_tx_desc *pDesc;
 
        curr = pDevice->td0_pool_dma;
-       for (i = 0; i < pDevice->sOpts.nTxDescs[0]; i++, curr += sizeof(STxDesc)) {
+       for (i = 0; i < pDevice->sOpts.nTxDescs[0];
+            i++, curr += sizeof(struct vnt_tx_desc)) {
                pDesc = &(pDevice->apTD0Rings[i]);
                pDesc->td_info = alloc_td_info();
 
@@ -709,7 +710,7 @@ static void device_init_td0_ring(struct vnt_private *pDevice)
                        pDesc->td_info->buf_dma = pDevice->tx_bufs_dma0 + (i)*PKT_BUF_SZ;
                }
                pDesc->next = &(pDevice->apTD0Rings[(i+1) % pDevice->sOpts.nTxDescs[0]]);
-               pDesc->next_desc = cpu_to_le32(curr+sizeof(STxDesc));
+               pDesc->next_desc = cpu_to_le32(curr + sizeof(struct vnt_tx_desc));
        }
 
        if (i > 0)
@@ -721,11 +722,12 @@ static void device_init_td1_ring(struct vnt_private *pDevice)
 {
        int i;
        dma_addr_t  curr;
-       PSTxDesc    pDesc;
+       struct vnt_tx_desc *pDesc;
 
        /* Init the TD ring entries */
        curr = pDevice->td1_pool_dma;
-       for (i = 0; i < pDevice->sOpts.nTxDescs[1]; i++, curr += sizeof(STxDesc)) {
+       for (i = 0; i < pDevice->sOpts.nTxDescs[1];
+            i++, curr += sizeof(struct vnt_tx_desc)) {
                pDesc = &(pDevice->apTD1Rings[i]);
                pDesc->td_info = alloc_td_info();
 
@@ -734,7 +736,7 @@ static void device_init_td1_ring(struct vnt_private *pDevice)
                        pDesc->td_info->buf_dma = pDevice->tx_bufs_dma1 + (i) * PKT_BUF_SZ;
                }
                pDesc->next = &(pDevice->apTD1Rings[(i + 1) % pDevice->sOpts.nTxDescs[1]]);
-               pDesc->next_desc = cpu_to_le32(curr+sizeof(STxDesc));
+               pDesc->next_desc = cpu_to_le32(curr + sizeof(struct vnt_tx_desc));
        }
 
        if (i > 0)
@@ -747,7 +749,7 @@ static void device_free_td0_ring(struct vnt_private *pDevice)
        int i;
 
        for (i = 0; i < pDevice->sOpts.nTxDescs[0]; i++) {
-               PSTxDesc        pDesc = &(pDevice->apTD0Rings[i]);
+               struct vnt_tx_desc *pDesc = &pDevice->apTD0Rings[i];
                struct vnt_td_info *pTDInfo = pDesc->td_info;
 
                dev_kfree_skb(pTDInfo->skb);
@@ -760,7 +762,7 @@ static void device_free_td1_ring(struct vnt_private *pDevice)
        int i;
 
        for (i = 0; i < pDevice->sOpts.nTxDescs[1]; i++) {
-               PSTxDesc        pDesc = &(pDevice->apTD1Rings[i]);
+               struct vnt_tx_desc *pDesc = &pDevice->apTD1Rings[i];
                struct vnt_td_info *pTDInfo = pDesc->td_info;
 
                dev_kfree_skb(pTDInfo->skb);
@@ -900,7 +902,7 @@ static int vnt_int_report_rate(struct vnt_private *priv,
 
 static int device_tx_srv(struct vnt_private *pDevice, unsigned int uIdx)
 {
-       PSTxDesc                 pTD;
+       struct vnt_tx_desc *pTD;
        int                      works = 0;
        unsigned char byTsr0;
        unsigned char byTsr1;
@@ -958,7 +960,8 @@ static void device_error(struct vnt_private *pDevice, unsigned short status)
        }
 }
 
-static void device_free_tx_buf(struct vnt_private *pDevice, PSTxDesc pDesc)
+static void device_free_tx_buf(struct vnt_private *pDevice,
+                              struct vnt_tx_desc *pDesc)
 {
        struct vnt_td_info *pTDInfo = pDesc->td_info;
        struct sk_buff *skb = pTDInfo->skb;
@@ -1156,7 +1159,7 @@ static irqreturn_t vnt_interrupt(int irq,  void *arg)
 static int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb)
 {
        struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
-       PSTxDesc head_td;
+       struct vnt_tx_desc *head_td;
        u32 dma_idx;
        unsigned long flags;
 
index 8d0ae80709d3ed0f857f95178b70b01a2b7e5d82..5875d655dd5545af326ab776ce5bc394f2580ea4 100644 (file)
@@ -130,7 +130,7 @@ s_vGenerateTxParameter(
 static unsigned int
 s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType,
                  unsigned char *pbyTxBufferAddr,
-                 unsigned int uDMAIdx, PSTxDesc pHeadTD,
+                 unsigned int uDMAIdx, struct vnt_tx_desc *pHeadTD,
                  unsigned int uNodeIndex);
 
 static
@@ -1027,7 +1027,7 @@ s_vGenerateTxParameter(
 static unsigned int
 s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType,
                  unsigned char *pbyTxBufferAddr,
-                 unsigned int uDMAIdx, PSTxDesc pHeadTD,
+                 unsigned int uDMAIdx, struct vnt_tx_desc *pHeadTD,
                  unsigned int is_pspoll)
 {
        struct vnt_td_info *td_info = pHeadTD->td_info;
@@ -1047,7 +1047,7 @@ s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType,
        unsigned int cbReqCount = 0;
        bool bNeedACK = (bool)(fifo_ctl & FIFOCTL_NEEDACK);
        bool bRTS = (bool)(fifo_ctl & FIFOCTL_RTS);
-       PSTxDesc       ptdCurr;
+       struct vnt_tx_desc *ptdCurr;
        unsigned int cbHeaderLength = 0;
        void *pvRrvTime;
        struct vnt_mic_hdr *pMICHDR;
@@ -1198,7 +1198,7 @@ s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType,
        /* Copy the Packet into a tx Buffer */
        memcpy((pbyBuffer + uLength), skb->data, skb->len);
 
-       ptdCurr = (PSTxDesc)pHeadTD;
+       ptdCurr = pHeadTD;
 
        ptdCurr->td_info->req_count = (u16)cbReqCount;
 
@@ -1273,7 +1273,7 @@ static void vnt_fill_txkey(struct ieee80211_hdr *hdr, u8 *key_buffer,
 }
 
 int vnt_generate_fifo_header(struct vnt_private *priv, u32 dma_idx,
-                            PSTxDesc head_td, struct sk_buff *skb)
+                            struct vnt_tx_desc *head_td, struct sk_buff *skb)
 {
        struct vnt_td_info *td_info = head_td->td_info;
        struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
index 54694df14e4488c330c98fda27fa4fcf57bb5207..1e30ecb5c63c08b6a3ab1b06658203a32c5bdf8d 100644 (file)
@@ -192,7 +192,7 @@ struct vnt_tx_short_buf_head {
 } __packed;
 
 int vnt_generate_fifo_header(struct vnt_private *, u32,
-                            PSTxDesc head_td, struct sk_buff *);
+                            struct vnt_tx_desc *head_td, struct sk_buff *);
 int vnt_beacon_make(struct vnt_private *, struct ieee80211_vif *);
 int vnt_beacon_enable(struct vnt_private *, struct ieee80211_vif *,
                      struct ieee80211_bss_conf *);