Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: vt6655: Replace typedef struct tagSTxDesc

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>

authored by

Malcolm Priestley and committed by
Greg Kroah-Hartman
e2357271 54382859

+39 -38
+1 -1
drivers/staging/vt6655/card.c
··· 514 514 ) 515 515 { 516 516 unsigned int uu; 517 - PSTxDesc pCurrTD; 517 + struct vnt_tx_desc *pCurrTD; 518 518 519 519 /* initialize TD index */ 520 520 pDevice->apTailTD[0] = pDevice->apCurrTD[0] = &(pDevice->apTD0Rings[0]);
+5 -7
drivers/staging/vt6655/desc.h
··· 250 250 }; 251 251 252 252 /* transmit descriptor */ 253 - typedef struct tagSTxDesc { 253 + struct vnt_tx_desc { 254 254 volatile struct vnt_tdes0 td0; 255 255 volatile struct vnt_tdes1 td1; 256 - volatile __le32 buff_addr; 257 - volatile __le32 next_desc; 258 - struct tagSTxDesc *next __aligned(8); 256 + volatile __le32 buff_addr; 257 + volatile __le32 next_desc; 258 + struct vnt_tx_desc *next __aligned(8); 259 259 struct vnt_td_info *td_info __aligned(8); 260 - } __attribute__ ((__packed__)) 261 - STxDesc, *PSTxDesc; 262 - typedef const STxDesc *PCSTxDesc; 260 + } __packed; 263 261 264 262 /* Length, Service, and Signal fields of Phy for Tx */ 265 263 struct vnt_phy_field {
+4 -4
drivers/staging/vt6655/device.h
··· 252 252 int nTxQueues; 253 253 volatile int iTDUsed[TYPE_MAXTD]; 254 254 255 - volatile PSTxDesc apCurrTD[TYPE_MAXTD]; 256 - volatile PSTxDesc apTailTD[TYPE_MAXTD]; 255 + struct vnt_tx_desc *apCurrTD[TYPE_MAXTD]; 256 + struct vnt_tx_desc *apTailTD[TYPE_MAXTD]; 257 257 258 - volatile PSTxDesc apTD0Rings; 259 - volatile PSTxDesc apTD1Rings; 258 + struct vnt_tx_desc *apTD0Rings; 259 + struct vnt_tx_desc *apTD1Rings; 260 260 261 261 volatile PSRxDesc aRD0Ring; 262 262 volatile PSRxDesc aRD1Ring;
+23 -20
drivers/staging/vt6655/device_main.c
··· 157 157 static int device_tx_srv(struct vnt_private *pDevice, unsigned int uIdx); 158 158 static bool device_alloc_rx_buf(struct vnt_private *pDevice, PSRxDesc pDesc); 159 159 static void device_init_registers(struct vnt_private *pDevice); 160 - static void device_free_tx_buf(struct vnt_private *pDevice, PSTxDesc pDesc); 160 + static void device_free_tx_buf(struct vnt_private *, struct vnt_tx_desc *); 161 161 static void device_free_td0_ring(struct vnt_private *pDevice); 162 162 static void device_free_td1_ring(struct vnt_private *pDevice); 163 163 static void device_free_rd0_ring(struct vnt_private *pDevice); ··· 522 522 vir_pool = dma_zalloc_coherent(&pDevice->pcid->dev, 523 523 pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) + 524 524 pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc) + 525 - pDevice->sOpts.nTxDescs[0] * sizeof(STxDesc) + 526 - pDevice->sOpts.nTxDescs[1] * sizeof(STxDesc), 525 + pDevice->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc) + 526 + pDevice->sOpts.nTxDescs[1] * sizeof(struct vnt_tx_desc), 527 527 &pDevice->pool_dma, GFP_ATOMIC); 528 528 if (vir_pool == NULL) { 529 529 dev_err(&pDevice->pcid->dev, "allocate desc dma memory failed\n"); ··· 551 551 dma_free_coherent(&pDevice->pcid->dev, 552 552 pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) + 553 553 pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc) + 554 - pDevice->sOpts.nTxDescs[0] * sizeof(STxDesc) + 555 - pDevice->sOpts.nTxDescs[1] * sizeof(STxDesc), 554 + pDevice->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc) + 555 + pDevice->sOpts.nTxDescs[1] * sizeof(struct vnt_tx_desc), 556 556 vir_pool, pDevice->pool_dma 557 557 ); 558 558 return false; ··· 562 562 pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc); 563 563 564 564 pDevice->td1_pool_dma = pDevice->td0_pool_dma + 565 - pDevice->sOpts.nTxDescs[0] * sizeof(STxDesc); 565 + pDevice->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc); 566 566 567 567 /* vir_pool: pvoid type */ 568 568 pDevice->apTD0Rings = vir_pool ··· 572 572 pDevice->apTD1Rings = vir_pool 573 573 + pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) 574 574 + pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc) 575 - + pDevice->sOpts.nTxDescs[0] * sizeof(STxDesc); 575 + + pDevice->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc); 576 576 577 577 pDevice->tx1_bufs = pDevice->tx0_bufs + 578 578 pDevice->sOpts.nTxDescs[0] * PKT_BUF_SZ; ··· 597 597 dma_free_coherent(&pDevice->pcid->dev, 598 598 pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) + 599 599 pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc) + 600 - pDevice->sOpts.nTxDescs[0] * sizeof(STxDesc) + 601 - pDevice->sOpts.nTxDescs[1] * sizeof(STxDesc) 600 + pDevice->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc) + 601 + pDevice->sOpts.nTxDescs[1] * sizeof(struct vnt_tx_desc) 602 602 , 603 603 pDevice->aRD0Ring, pDevice->pool_dma 604 604 ); ··· 697 697 { 698 698 int i; 699 699 dma_addr_t curr; 700 - PSTxDesc pDesc; 700 + struct vnt_tx_desc *pDesc; 701 701 702 702 curr = pDevice->td0_pool_dma; 703 - for (i = 0; i < pDevice->sOpts.nTxDescs[0]; i++, curr += sizeof(STxDesc)) { 703 + for (i = 0; i < pDevice->sOpts.nTxDescs[0]; 704 + i++, curr += sizeof(struct vnt_tx_desc)) { 704 705 pDesc = &(pDevice->apTD0Rings[i]); 705 706 pDesc->td_info = alloc_td_info(); 706 707 ··· 710 709 pDesc->td_info->buf_dma = pDevice->tx_bufs_dma0 + (i)*PKT_BUF_SZ; 711 710 } 712 711 pDesc->next = &(pDevice->apTD0Rings[(i+1) % pDevice->sOpts.nTxDescs[0]]); 713 - pDesc->next_desc = cpu_to_le32(curr+sizeof(STxDesc)); 712 + pDesc->next_desc = cpu_to_le32(curr + sizeof(struct vnt_tx_desc)); 714 713 } 715 714 716 715 if (i > 0) ··· 722 721 { 723 722 int i; 724 723 dma_addr_t curr; 725 - PSTxDesc pDesc; 724 + struct vnt_tx_desc *pDesc; 726 725 727 726 /* Init the TD ring entries */ 728 727 curr = pDevice->td1_pool_dma; 729 - for (i = 0; i < pDevice->sOpts.nTxDescs[1]; i++, curr += sizeof(STxDesc)) { 728 + for (i = 0; i < pDevice->sOpts.nTxDescs[1]; 729 + i++, curr += sizeof(struct vnt_tx_desc)) { 730 730 pDesc = &(pDevice->apTD1Rings[i]); 731 731 pDesc->td_info = alloc_td_info(); 732 732 ··· 736 734 pDesc->td_info->buf_dma = pDevice->tx_bufs_dma1 + (i) * PKT_BUF_SZ; 737 735 } 738 736 pDesc->next = &(pDevice->apTD1Rings[(i + 1) % pDevice->sOpts.nTxDescs[1]]); 739 - pDesc->next_desc = cpu_to_le32(curr+sizeof(STxDesc)); 737 + pDesc->next_desc = cpu_to_le32(curr + sizeof(struct vnt_tx_desc)); 740 738 } 741 739 742 740 if (i > 0) ··· 749 747 int i; 750 748 751 749 for (i = 0; i < pDevice->sOpts.nTxDescs[0]; i++) { 752 - PSTxDesc pDesc = &(pDevice->apTD0Rings[i]); 750 + struct vnt_tx_desc *pDesc = &pDevice->apTD0Rings[i]; 753 751 struct vnt_td_info *pTDInfo = pDesc->td_info; 754 752 755 753 dev_kfree_skb(pTDInfo->skb); ··· 762 760 int i; 763 761 764 762 for (i = 0; i < pDevice->sOpts.nTxDescs[1]; i++) { 765 - PSTxDesc pDesc = &(pDevice->apTD1Rings[i]); 763 + struct vnt_tx_desc *pDesc = &pDevice->apTD1Rings[i]; 766 764 struct vnt_td_info *pTDInfo = pDesc->td_info; 767 765 768 766 dev_kfree_skb(pTDInfo->skb); ··· 902 900 903 901 static int device_tx_srv(struct vnt_private *pDevice, unsigned int uIdx) 904 902 { 905 - PSTxDesc pTD; 903 + struct vnt_tx_desc *pTD; 906 904 int works = 0; 907 905 unsigned char byTsr0; 908 906 unsigned char byTsr1; ··· 960 958 } 961 959 } 962 960 963 - static void device_free_tx_buf(struct vnt_private *pDevice, PSTxDesc pDesc) 961 + static void device_free_tx_buf(struct vnt_private *pDevice, 962 + struct vnt_tx_desc *pDesc) 964 963 { 965 964 struct vnt_td_info *pTDInfo = pDesc->td_info; 966 965 struct sk_buff *skb = pTDInfo->skb; ··· 1159 1156 static int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) 1160 1157 { 1161 1158 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 1162 - PSTxDesc head_td; 1159 + struct vnt_tx_desc *head_td; 1163 1160 u32 dma_idx; 1164 1161 unsigned long flags; 1165 1162
+5 -5
drivers/staging/vt6655/rxtx.c
··· 130 130 static unsigned int 131 131 s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType, 132 132 unsigned char *pbyTxBufferAddr, 133 - unsigned int uDMAIdx, PSTxDesc pHeadTD, 133 + unsigned int uDMAIdx, struct vnt_tx_desc *pHeadTD, 134 134 unsigned int uNodeIndex); 135 135 136 136 static ··· 1027 1027 static unsigned int 1028 1028 s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType, 1029 1029 unsigned char *pbyTxBufferAddr, 1030 - unsigned int uDMAIdx, PSTxDesc pHeadTD, 1030 + unsigned int uDMAIdx, struct vnt_tx_desc *pHeadTD, 1031 1031 unsigned int is_pspoll) 1032 1032 { 1033 1033 struct vnt_td_info *td_info = pHeadTD->td_info; ··· 1047 1047 unsigned int cbReqCount = 0; 1048 1048 bool bNeedACK = (bool)(fifo_ctl & FIFOCTL_NEEDACK); 1049 1049 bool bRTS = (bool)(fifo_ctl & FIFOCTL_RTS); 1050 - PSTxDesc ptdCurr; 1050 + struct vnt_tx_desc *ptdCurr; 1051 1051 unsigned int cbHeaderLength = 0; 1052 1052 void *pvRrvTime; 1053 1053 struct vnt_mic_hdr *pMICHDR; ··· 1198 1198 /* Copy the Packet into a tx Buffer */ 1199 1199 memcpy((pbyBuffer + uLength), skb->data, skb->len); 1200 1200 1201 - ptdCurr = (PSTxDesc)pHeadTD; 1201 + ptdCurr = pHeadTD; 1202 1202 1203 1203 ptdCurr->td_info->req_count = (u16)cbReqCount; 1204 1204 ··· 1273 1273 } 1274 1274 1275 1275 int vnt_generate_fifo_header(struct vnt_private *priv, u32 dma_idx, 1276 - PSTxDesc head_td, struct sk_buff *skb) 1276 + struct vnt_tx_desc *head_td, struct sk_buff *skb) 1277 1277 { 1278 1278 struct vnt_td_info *td_info = head_td->td_info; 1279 1279 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+1 -1
drivers/staging/vt6655/rxtx.h
··· 192 192 } __packed; 193 193 194 194 int vnt_generate_fifo_header(struct vnt_private *, u32, 195 - PSTxDesc head_td, struct sk_buff *); 195 + struct vnt_tx_desc *head_td, struct sk_buff *); 196 196 int vnt_beacon_make(struct vnt_private *, struct ieee80211_vif *); 197 197 int vnt_beacon_enable(struct vnt_private *, struct ieee80211_vif *, 198 198 struct ieee80211_bss_conf *);