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

staging: vt6655: replace typedef struct tagDEVICE_TD_INFO and structure

Create struct vnt_td_info with members
mic_hdr
skb
buf
buf_dma
dwReqCount -> req_count
byFlags -> flags

In struct tagSTxDesc volatile is removed because it will generate a warning
(in any case this member is not) and renaming td_info.

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
54382859 3a0989bb

+33 -33
+6 -6
drivers/staging/vt6655/desc.h
··· 240 240 volatile u8 reserved; 241 241 } __packed; 242 242 243 - typedef struct tagDEVICE_TD_INFO { 243 + struct vnt_td_info { 244 244 void *mic_hdr; 245 245 struct sk_buff *skb; 246 246 unsigned char *buf; 247 - dma_addr_t buf_dma; 248 - u16 dwReqCount; 249 - unsigned char byFlags; 250 - } DEVICE_TD_INFO, *PDEVICE_TD_INFO; 247 + dma_addr_t buf_dma; 248 + u16 req_count; 249 + u8 flags; 250 + }; 251 251 252 252 /* transmit descriptor */ 253 253 typedef struct tagSTxDesc { ··· 256 256 volatile __le32 buff_addr; 257 257 volatile __le32 next_desc; 258 258 struct tagSTxDesc *next __aligned(8); 259 - volatile PDEVICE_TD_INFO pTDInfo __aligned(8); 259 + struct vnt_td_info *td_info __aligned(8); 260 260 } __attribute__ ((__packed__)) 261 261 STxDesc, *PSTxDesc; 262 262 typedef const STxDesc *PCSTxDesc;
+2 -2
drivers/staging/vt6655/device.h
··· 415 415 return kzalloc(sizeof(DEVICE_RD_INFO), GFP_ATOMIC); 416 416 } 417 417 418 - static inline PDEVICE_TD_INFO alloc_td_info(void) 418 + static inline struct vnt_td_info *alloc_td_info(void) 419 419 { 420 - return kzalloc(sizeof(DEVICE_TD_INFO), GFP_ATOMIC); 420 + return kzalloc(sizeof(struct vnt_td_info), GFP_ATOMIC); 421 421 } 422 422 #endif
+21 -21
drivers/staging/vt6655/device_main.c
··· 702 702 curr = pDevice->td0_pool_dma; 703 703 for (i = 0; i < pDevice->sOpts.nTxDescs[0]; i++, curr += sizeof(STxDesc)) { 704 704 pDesc = &(pDevice->apTD0Rings[i]); 705 - pDesc->pTDInfo = alloc_td_info(); 705 + pDesc->td_info = alloc_td_info(); 706 706 707 707 if (pDevice->flags & DEVICE_FLAGS_TX_ALIGN) { 708 - pDesc->pTDInfo->buf = pDevice->tx0_bufs + (i)*PKT_BUF_SZ; 709 - pDesc->pTDInfo->buf_dma = pDevice->tx_bufs_dma0 + (i)*PKT_BUF_SZ; 708 + pDesc->td_info->buf = pDevice->tx0_bufs + (i)*PKT_BUF_SZ; 709 + pDesc->td_info->buf_dma = pDevice->tx_bufs_dma0 + (i)*PKT_BUF_SZ; 710 710 } 711 711 pDesc->next = &(pDevice->apTD0Rings[(i+1) % pDevice->sOpts.nTxDescs[0]]); 712 712 pDesc->next_desc = cpu_to_le32(curr+sizeof(STxDesc)); ··· 727 727 curr = pDevice->td1_pool_dma; 728 728 for (i = 0; i < pDevice->sOpts.nTxDescs[1]; i++, curr += sizeof(STxDesc)) { 729 729 pDesc = &(pDevice->apTD1Rings[i]); 730 - pDesc->pTDInfo = alloc_td_info(); 730 + pDesc->td_info = alloc_td_info(); 731 731 732 732 if (pDevice->flags & DEVICE_FLAGS_TX_ALIGN) { 733 - pDesc->pTDInfo->buf = pDevice->tx1_bufs + (i) * PKT_BUF_SZ; 734 - pDesc->pTDInfo->buf_dma = pDevice->tx_bufs_dma1 + (i) * PKT_BUF_SZ; 733 + pDesc->td_info->buf = pDevice->tx1_bufs + (i) * PKT_BUF_SZ; 734 + pDesc->td_info->buf_dma = pDevice->tx_bufs_dma1 + (i) * PKT_BUF_SZ; 735 735 } 736 736 pDesc->next = &(pDevice->apTD1Rings[(i + 1) % pDevice->sOpts.nTxDescs[1]]); 737 737 pDesc->next_desc = cpu_to_le32(curr+sizeof(STxDesc)); ··· 748 748 749 749 for (i = 0; i < pDevice->sOpts.nTxDescs[0]; i++) { 750 750 PSTxDesc pDesc = &(pDevice->apTD0Rings[i]); 751 - PDEVICE_TD_INFO pTDInfo = pDesc->pTDInfo; 751 + struct vnt_td_info *pTDInfo = pDesc->td_info; 752 752 753 753 dev_kfree_skb(pTDInfo->skb); 754 - kfree(pDesc->pTDInfo); 754 + kfree(pDesc->td_info); 755 755 } 756 756 } 757 757 ··· 761 761 762 762 for (i = 0; i < pDevice->sOpts.nTxDescs[1]; i++) { 763 763 PSTxDesc pDesc = &(pDevice->apTD1Rings[i]); 764 - PDEVICE_TD_INFO pTDInfo = pDesc->pTDInfo; 764 + struct vnt_td_info *pTDInfo = pDesc->td_info; 765 765 766 766 dev_kfree_skb(pTDInfo->skb); 767 - kfree(pDesc->pTDInfo); 767 + kfree(pDesc->td_info); 768 768 } 769 769 } 770 770 ··· 839 839 }; 840 840 841 841 static int vnt_int_report_rate(struct vnt_private *priv, 842 - PDEVICE_TD_INFO context, u8 tsr0, u8 tsr1) 842 + struct vnt_td_info *context, u8 tsr0, u8 tsr1) 843 843 { 844 844 struct vnt_tx_fifo_head *fifo_head; 845 845 struct ieee80211_tx_info *info; ··· 916 916 917 917 /* Only the status of first TD in the chain is correct */ 918 918 if (pTD->td1.tcr & TCR_STP) { 919 - if ((pTD->pTDInfo->byFlags & TD_FLAGS_NETIF_SKB) != 0) { 919 + if ((pTD->td_info->flags & TD_FLAGS_NETIF_SKB) != 0) { 920 920 if (!(byTsr1 & TSR1_TERR)) { 921 921 if (byTsr0 != 0) { 922 922 pr_debug(" Tx[%d] OK but has error. tsr1[%02X] tsr0[%02X]\n", ··· 930 930 } 931 931 932 932 if (byTsr1 & TSR1_TERR) { 933 - if ((pTD->pTDInfo->byFlags & TD_FLAGS_PRIV_SKB) != 0) { 933 + if ((pTD->td_info->flags & TD_FLAGS_PRIV_SKB) != 0) { 934 934 pr_debug(" Tx[%d] fail has error. tsr1[%02X] tsr0[%02X]\n", 935 935 (int)uIdx, byTsr1, byTsr0); 936 936 } 937 937 } 938 938 939 - vnt_int_report_rate(pDevice, pTD->pTDInfo, byTsr0, byTsr1); 939 + vnt_int_report_rate(pDevice, pTD->td_info, byTsr0, byTsr1); 940 940 941 941 device_free_tx_buf(pDevice, pTD); 942 942 pDevice->iTDUsed[uIdx]--; ··· 960 960 961 961 static void device_free_tx_buf(struct vnt_private *pDevice, PSTxDesc pDesc) 962 962 { 963 - PDEVICE_TD_INFO pTDInfo = pDesc->pTDInfo; 963 + struct vnt_td_info *pTDInfo = pDesc->td_info; 964 964 struct sk_buff *skb = pTDInfo->skb; 965 965 966 966 if (skb) 967 967 ieee80211_tx_status_irqsafe(pDevice->hw, skb); 968 968 969 969 pTDInfo->skb = NULL; 970 - pTDInfo->byFlags = 0; 970 + pTDInfo->flags = 0; 971 971 } 972 972 973 973 static void vnt_check_bb_vga(struct vnt_private *priv) ··· 1176 1176 1177 1177 head_td->td1.tcr = 0; 1178 1178 1179 - head_td->pTDInfo->skb = skb; 1179 + head_td->td_info->skb = skb; 1180 1180 1181 1181 if (dma_idx == TYPE_AC0DMA) 1182 - head_td->pTDInfo->byFlags = TD_FLAGS_NETIF_SKB; 1182 + head_td->td_info->flags = TD_FLAGS_NETIF_SKB; 1183 1183 1184 1184 priv->apCurrTD[dma_idx] = head_td->next; 1185 1185 ··· 1193 1193 1194 1194 /* Set TSR1 & ReqCount in TxDescHead */ 1195 1195 head_td->td1.tcr |= (TCR_STP | TCR_EDP | EDMSDU); 1196 - head_td->td1.req_count = cpu_to_le16(head_td->pTDInfo->dwReqCount); 1196 + head_td->td1.req_count = cpu_to_le16(head_td->td_info->req_count); 1197 1197 1198 - head_td->buff_addr = cpu_to_le32(head_td->pTDInfo->buf_dma); 1198 + head_td->buff_addr = cpu_to_le32(head_td->td_info->buf_dma); 1199 1199 1200 1200 /* Poll Transmit the adapter */ 1201 1201 wmb(); 1202 1202 head_td->td0.owner = OWNED_BY_NIC; 1203 1203 wmb(); /* second memory barrier */ 1204 1204 1205 - if (head_td->pTDInfo->byFlags & TD_FLAGS_NETIF_SKB) 1205 + if (head_td->td_info->flags & TD_FLAGS_NETIF_SKB) 1206 1206 MACvTransmitAC0(priv->PortOffset); 1207 1207 else 1208 1208 MACvTransmit0(priv->PortOffset);
+4 -4
drivers/staging/vt6655/rxtx.c
··· 1030 1030 unsigned int uDMAIdx, PSTxDesc pHeadTD, 1031 1031 unsigned int is_pspoll) 1032 1032 { 1033 - PDEVICE_TD_INFO td_info = pHeadTD->pTDInfo; 1033 + struct vnt_td_info *td_info = pHeadTD->td_info; 1034 1034 struct sk_buff *skb = td_info->skb; 1035 1035 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 1036 1036 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; ··· 1192 1192 hdr->duration_id = uDuration; 1193 1193 1194 1194 cbReqCount = cbHeaderLength + uPadding + skb->len; 1195 - pbyBuffer = (unsigned char *)pHeadTD->pTDInfo->buf; 1195 + pbyBuffer = (unsigned char *)pHeadTD->td_info->buf; 1196 1196 uLength = cbHeaderLength + uPadding; 1197 1197 1198 1198 /* Copy the Packet into a tx Buffer */ ··· 1200 1200 1201 1201 ptdCurr = (PSTxDesc)pHeadTD; 1202 1202 1203 - ptdCurr->pTDInfo->dwReqCount = (u16)cbReqCount; 1203 + ptdCurr->td_info->req_count = (u16)cbReqCount; 1204 1204 1205 1205 return cbHeaderLength; 1206 1206 } ··· 1275 1275 int vnt_generate_fifo_header(struct vnt_private *priv, u32 dma_idx, 1276 1276 PSTxDesc head_td, struct sk_buff *skb) 1277 1277 { 1278 - PDEVICE_TD_INFO td_info = head_td->pTDInfo; 1278 + struct vnt_td_info *td_info = head_td->td_info; 1279 1279 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 1280 1280 struct ieee80211_tx_rate *tx_rate = &info->control.rates[0]; 1281 1281 struct ieee80211_rate *rate;