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>
This commit is contained in:
Malcolm Priestley 2015-08-14 22:58:51 +01:00 committed by Greg Kroah-Hartman
parent 543828599a
commit e235727173
6 changed files with 39 additions and 38 deletions

View File

@ -514,7 +514,7 @@ CARDvSafeResetTx(
) )
{ {
unsigned int uu; unsigned int uu;
PSTxDesc pCurrTD; struct vnt_tx_desc *pCurrTD;
/* initialize TD index */ /* initialize TD index */
pDevice->apTailTD[0] = pDevice->apCurrTD[0] = &(pDevice->apTD0Rings[0]); pDevice->apTailTD[0] = pDevice->apCurrTD[0] = &(pDevice->apTD0Rings[0]);

View File

@ -250,16 +250,14 @@ struct vnt_td_info {
}; };
/* transmit descriptor */ /* transmit descriptor */
typedef struct tagSTxDesc { struct vnt_tx_desc {
volatile struct vnt_tdes0 td0; volatile struct vnt_tdes0 td0;
volatile struct vnt_tdes1 td1; volatile struct vnt_tdes1 td1;
volatile __le32 buff_addr; volatile __le32 buff_addr;
volatile __le32 next_desc; volatile __le32 next_desc;
struct tagSTxDesc *next __aligned(8); struct vnt_tx_desc *next __aligned(8);
struct vnt_td_info *td_info __aligned(8); struct vnt_td_info *td_info __aligned(8);
} __attribute__ ((__packed__)) } __packed;
STxDesc, *PSTxDesc;
typedef const STxDesc *PCSTxDesc;
/* Length, Service, and Signal fields of Phy for Tx */ /* Length, Service, and Signal fields of Phy for Tx */
struct vnt_phy_field { struct vnt_phy_field {

View File

@ -252,11 +252,11 @@ struct vnt_private {
int nTxQueues; int nTxQueues;
volatile int iTDUsed[TYPE_MAXTD]; volatile int iTDUsed[TYPE_MAXTD];
volatile PSTxDesc apCurrTD[TYPE_MAXTD]; struct vnt_tx_desc *apCurrTD[TYPE_MAXTD];
volatile PSTxDesc apTailTD[TYPE_MAXTD]; struct vnt_tx_desc *apTailTD[TYPE_MAXTD];
volatile PSTxDesc apTD0Rings; struct vnt_tx_desc *apTD0Rings;
volatile PSTxDesc apTD1Rings; struct vnt_tx_desc *apTD1Rings;
volatile PSRxDesc aRD0Ring; volatile PSRxDesc aRD0Ring;
volatile PSRxDesc aRD1Ring; volatile PSRxDesc aRD1Ring;

View 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 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 *pDevice, PSRxDesc pDesc);
static void device_init_registers(struct vnt_private *pDevice); 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_td0_ring(struct vnt_private *pDevice);
static void device_free_td1_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); 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, vir_pool = dma_zalloc_coherent(&pDevice->pcid->dev,
pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) + pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) +
pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc) + pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc) +
pDevice->sOpts.nTxDescs[0] * sizeof(STxDesc) + pDevice->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc) +
pDevice->sOpts.nTxDescs[1] * sizeof(STxDesc), pDevice->sOpts.nTxDescs[1] * sizeof(struct vnt_tx_desc),
&pDevice->pool_dma, GFP_ATOMIC); &pDevice->pool_dma, GFP_ATOMIC);
if (vir_pool == NULL) { if (vir_pool == NULL) {
dev_err(&pDevice->pcid->dev, "allocate desc dma memory failed\n"); 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, dma_free_coherent(&pDevice->pcid->dev,
pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) + pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) +
pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc) + pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc) +
pDevice->sOpts.nTxDescs[0] * sizeof(STxDesc) + pDevice->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc) +
pDevice->sOpts.nTxDescs[1] * sizeof(STxDesc), pDevice->sOpts.nTxDescs[1] * sizeof(struct vnt_tx_desc),
vir_pool, pDevice->pool_dma vir_pool, pDevice->pool_dma
); );
return false; return false;
@ -562,7 +562,7 @@ static bool device_init_rings(struct vnt_private *pDevice)
pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc); pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc);
pDevice->td1_pool_dma = pDevice->td0_pool_dma + 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 */ /* vir_pool: pvoid type */
pDevice->apTD0Rings = vir_pool pDevice->apTD0Rings = vir_pool
@ -572,7 +572,7 @@ static bool device_init_rings(struct vnt_private *pDevice)
pDevice->apTD1Rings = vir_pool pDevice->apTD1Rings = vir_pool
+ pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) + pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc)
+ pDevice->sOpts.nRxDescs1 * 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->tx1_bufs = pDevice->tx0_bufs +
pDevice->sOpts.nTxDescs[0] * PKT_BUF_SZ; 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, dma_free_coherent(&pDevice->pcid->dev,
pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) + pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) +
pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc) + pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc) +
pDevice->sOpts.nTxDescs[0] * sizeof(STxDesc) + pDevice->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc) +
pDevice->sOpts.nTxDescs[1] * sizeof(STxDesc) pDevice->sOpts.nTxDescs[1] * sizeof(struct vnt_tx_desc)
, ,
pDevice->aRD0Ring, pDevice->pool_dma pDevice->aRD0Ring, pDevice->pool_dma
); );
@ -697,10 +697,11 @@ static void device_init_td0_ring(struct vnt_private *pDevice)
{ {
int i; int i;
dma_addr_t curr; dma_addr_t curr;
PSTxDesc pDesc; struct vnt_tx_desc *pDesc;
curr = pDevice->td0_pool_dma; 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 = &(pDevice->apTD0Rings[i]);
pDesc->td_info = alloc_td_info(); 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->td_info->buf_dma = pDevice->tx_bufs_dma0 + (i)*PKT_BUF_SZ;
} }
pDesc->next = &(pDevice->apTD0Rings[(i+1) % pDevice->sOpts.nTxDescs[0]]); 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) if (i > 0)
@ -721,11 +722,12 @@ static void device_init_td1_ring(struct vnt_private *pDevice)
{ {
int i; int i;
dma_addr_t curr; dma_addr_t curr;
PSTxDesc pDesc; struct vnt_tx_desc *pDesc;
/* Init the TD ring entries */ /* Init the TD ring entries */
curr = pDevice->td1_pool_dma; 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 = &(pDevice->apTD1Rings[i]);
pDesc->td_info = alloc_td_info(); 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->td_info->buf_dma = pDevice->tx_bufs_dma1 + (i) * PKT_BUF_SZ;
} }
pDesc->next = &(pDevice->apTD1Rings[(i + 1) % pDevice->sOpts.nTxDescs[1]]); 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) if (i > 0)
@ -747,7 +749,7 @@ static void device_free_td0_ring(struct vnt_private *pDevice)
int i; int i;
for (i = 0; i < pDevice->sOpts.nTxDescs[0]; 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; struct vnt_td_info *pTDInfo = pDesc->td_info;
dev_kfree_skb(pTDInfo->skb); dev_kfree_skb(pTDInfo->skb);
@ -760,7 +762,7 @@ static void device_free_td1_ring(struct vnt_private *pDevice)
int i; int i;
for (i = 0; i < pDevice->sOpts.nTxDescs[1]; 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; struct vnt_td_info *pTDInfo = pDesc->td_info;
dev_kfree_skb(pTDInfo->skb); 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) static int device_tx_srv(struct vnt_private *pDevice, unsigned int uIdx)
{ {
PSTxDesc pTD; struct vnt_tx_desc *pTD;
int works = 0; int works = 0;
unsigned char byTsr0; unsigned char byTsr0;
unsigned char byTsr1; 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 vnt_td_info *pTDInfo = pDesc->td_info;
struct sk_buff *skb = pTDInfo->skb; 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) static int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb)
{ {
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
PSTxDesc head_td; struct vnt_tx_desc *head_td;
u32 dma_idx; u32 dma_idx;
unsigned long flags; unsigned long flags;

View File

@ -130,7 +130,7 @@ s_vGenerateTxParameter(
static unsigned int static unsigned int
s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType, s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType,
unsigned char *pbyTxBufferAddr, unsigned char *pbyTxBufferAddr,
unsigned int uDMAIdx, PSTxDesc pHeadTD, unsigned int uDMAIdx, struct vnt_tx_desc *pHeadTD,
unsigned int uNodeIndex); unsigned int uNodeIndex);
static static
@ -1027,7 +1027,7 @@ s_vGenerateTxParameter(
static unsigned int static unsigned int
s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType, s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType,
unsigned char *pbyTxBufferAddr, unsigned char *pbyTxBufferAddr,
unsigned int uDMAIdx, PSTxDesc pHeadTD, unsigned int uDMAIdx, struct vnt_tx_desc *pHeadTD,
unsigned int is_pspoll) unsigned int is_pspoll)
{ {
struct vnt_td_info *td_info = pHeadTD->td_info; 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; unsigned int cbReqCount = 0;
bool bNeedACK = (bool)(fifo_ctl & FIFOCTL_NEEDACK); bool bNeedACK = (bool)(fifo_ctl & FIFOCTL_NEEDACK);
bool bRTS = (bool)(fifo_ctl & FIFOCTL_RTS); bool bRTS = (bool)(fifo_ctl & FIFOCTL_RTS);
PSTxDesc ptdCurr; struct vnt_tx_desc *ptdCurr;
unsigned int cbHeaderLength = 0; unsigned int cbHeaderLength = 0;
void *pvRrvTime; void *pvRrvTime;
struct vnt_mic_hdr *pMICHDR; 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 */ /* Copy the Packet into a tx Buffer */
memcpy((pbyBuffer + uLength), skb->data, skb->len); memcpy((pbyBuffer + uLength), skb->data, skb->len);
ptdCurr = (PSTxDesc)pHeadTD; ptdCurr = pHeadTD;
ptdCurr->td_info->req_count = (u16)cbReqCount; 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, 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 vnt_td_info *td_info = head_td->td_info;
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);

View File

@ -192,7 +192,7 @@ struct vnt_tx_short_buf_head {
} __packed; } __packed;
int vnt_generate_fifo_header(struct vnt_private *, u32, 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_make(struct vnt_private *, struct ieee80211_vif *);
int vnt_beacon_enable(struct vnt_private *, struct ieee80211_vif *, int vnt_beacon_enable(struct vnt_private *, struct ieee80211_vif *,
struct ieee80211_bss_conf *); struct ieee80211_bss_conf *);