staging: vt6656: rxtx: Remove unused uDMAIdx from driver.
PATCH 1/4 staging: vt6656: rxtx: Remove unused uDMAIdx from driver.
Remove from functions and callers.
Signed-off-by Malcolm Priestley <[email protected]>
--- drivers/staging/vt6656/main_usb.c | 2 +- drivers/staging/vt6656/rxtx.c | 33 +++++++++++++++------------------ drivers/staging/vt6656/rxtx.h | 2 +- drivers/staging/vt6656/wcmd.c | 4 ++-- 4 files changed, 19 insertions(+), 22 deletions(-)
drivers/staging/vt6656/main_usb.c +1 -1
@@ -1189,7 +1189,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) goto out; } -if (nsDMA_tx_packet (pDevice,TYPE_AC0DMA , skb)) { +if (nsDMA_tx_packet (pDevice, skb)) {if (netif_queue_stopped (dev))netif_wake_queue (dev); }
drivers/staging/vt6656/rxtx.c +15 -18
@@ -101,11 +101,11 @@ static struct vnt_usb_send_context *s_vGetFreeContext(struct vnt_private *);static u16 s_vGenerateTxParameter (struct vnt_private *pDevice,u8 byPktType,u16 wCurrentRate,struct vnt_tx_buffer *tx_buffer,struct vnt_mic_hdr **mic_hdr,u32 need_mic,u32 cbFrameSize, -int bNeedACK,u32 uDMAIdx,struct ethhdr *psEthHeader,bool need_rts); +int bNeedACK,struct ethhdr *psEthHeader,bool need_rts);static void s_vGenerateMACHeader (struct vnt_private *pDevice,u8 *pbyBufferAddr,u16 wDuration,struct ethhdr *psEthHeader, -int bNeedEncrypt,u16 wFragType,u32 uDMAIdx,u32 uFragIdx); +int bNeedEncrypt,u16 wFragType,u32 uFragIdx); static void s_vFillTxKey(struct vnt_private *pDevice, struct vnt_tx_fifo_head *fifo_head, u8 *pbyIVHead,
@@ -121,7 +121,7 @@ static unsigned int s_uGetTxRsvTime(struct vnt_private *pDevice, u8 byPktType,static __le16 s_uGetRTSCTSRsvTime (struct vnt_private *priv,u8 rsv_type,u8 pkt_type,u32 frame_lenght,u16 current_rate); -static u16 s_vFillCTSHead (struct vnt_private *pDevice,u32 uDMAIdx, +static u16 s_vFillCTSHead (struct vnt_private *pDevice,u8 byPktType,union vnt_tx_data_head *head,u32 cbFrameLength,int bNeedAck,u16 wCurrentRate,u8 byFBOption);
@@ -714,7 +714,7 @@ static u16 s_vFillRTSHead(struct vnt_private *pDevice, u8 byPktType,return 0 ; } -static u16 s_vFillCTSHead (struct vnt_private *pDevice,u32 uDMAIdx, +static u16 s_vFillCTSHead (struct vnt_private *pDevice,u8 byPktType,union vnt_tx_data_head *head,u32 cbFrameLength,int bNeedAck,u16 wCurrentRate,u8 byFBOption) {
@@ -787,7 +787,6 @@ static u16 s_vFillCTSHead(struct vnt_private *pDevice, u32 uDMAIdx,* pCTS - CTS Buffer * cbFrameSize - Transmit Data Length (Hdr+Payload+FCS) * bNeedACK - If need ACK -* uDMAIdx - DMA Index * Out: * none *
@@ -798,7 +797,7 @@ static u16 s_vFillCTSHead(struct vnt_private *pDevice, u32 uDMAIdx,static u16 s_vGenerateTxParameter (struct vnt_private *pDevice,u8 byPktType,u16 wCurrentRate,struct vnt_tx_buffer *tx_buffer,struct vnt_mic_hdr **mic_hdr,u32 need_mic,u32 cbFrameSize, -int bNeedACK,u32 uDMAIdx,struct ethhdr *psEthHeader,bool need_rts) +int bNeedACK,struct ethhdr *psEthHeader,bool need_rts) {struct vnt_tx_fifo_head *pFifoHead = &tx_buffer->fifo_head;union vnt_tx_data_head *head =NULL ;
@@ -869,7 +868,7 @@ static u16 s_vGenerateTxParameter(struct vnt_private *pDevice, }/* Fill CTS */ -return s_vFillCTSHead (pDevice, uDMAIdx, byPktType, +return s_vFillCTSHead (pDevice, byPktType, head, cbFrameSize, bNeedACK, wCurrentRate, byFBOption); }
@@ -954,7 +953,7 @@ static u16 s_vGenerateTxParameter(struct vnt_private *pDevice,static int s_bPacketToWirelessUsb (struct vnt_private *pDevice,u8 byPktType,struct vnt_tx_buffer *tx_buffer,int bNeedEncryption, -u32 uSkbPacketLen,u32 uDMAIdx,struct ethhdr *psEthHeader, +u32 uSkbPacketLen,struct ethhdr *psEthHeader,u8 *pPacket,PSKeyItem pTransmitKey,u32 uNodeIndex,u16 wCurrentRate,u32 *pcbHeaderLen,u32 *pcbTotalLen) {
@@ -1150,17 +1149,16 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,//========================= DBG_PRT (MSG_LEVEL_DEBUG ,KERN_INFO "No Fragmentation...\n" ); byFragType =FRAGCTL_NONFRAG ; -//uDMAIdx = TYPE_AC0DMA; //pTxBufHead = (PSTxBufHead) &(pTxBufHead->adwTxKey[0]); /* Fill FIFO, RrvTime, RTS and CTS */ uDuration =s_vGenerateTxParameter (pDevice, byPktType, wCurrentRate, tx_buffer, &pMICHDR, cbMICHDR, - cbFrameSize, bNeedACK, uDMAIdx, psEthHeader, bRTS); + cbFrameSize, bNeedACK, psEthHeader, bRTS);// Generate TX MAC Header s_vGenerateMACHeader (pDevice, pbyMacHdr, (u16 )uDuration, psEthHeader, bNeedEncryption, - byFragType, uDMAIdx,0 ); + byFragType,0 );if (bNeedEncryption == true) {//Fill TXKEY
@@ -1292,7 +1290,7 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,static void s_vGenerateMACHeader (struct vnt_private *pDevice,u8 *pbyBufferAddr,u16 wDuration,struct ethhdr *psEthHeader, -int bNeedEncrypt,u16 wFragType,u32 uDMAIdx,u32 uFragIdx) +int bNeedEncrypt,u16 wFragType,u32 uFragIdx) {struct ieee80211_hdr *pMACHeader = (struct ieee80211_hdr *)pbyBufferAddr;
@@ -1532,7 +1530,7 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice,/* Fill FIFO,RrvTime,RTS,and CTS */ uDuration =s_vGenerateTxParameter (pDevice, byPktType, wCurrentRate, pTX_Buffer, &pMICHDR,0 , - cbFrameSize, bNeedACK,TYPE_TXDMA0 , &sEthHeader, false); + cbFrameSize, bNeedACK, &sEthHeader, false); pMACHeader = (struct ieee80211_hdr *) (pbyTxBufferAddr + cbHeaderSize);
@@ -1926,7 +1924,7 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb)/* Fill FIFO,RrvTime,RTS,and CTS */ uDuration =s_vGenerateTxParameter (pDevice, byPktType, wCurrentRate, pTX_Buffer, &pMICHDR, cbMICHDR, - cbFrameSize, bNeedACK,TYPE_TXDMA0 , &sEthHeader, false); + cbFrameSize, bNeedACK, &sEthHeader, false); pMACHeader = (struct ieee80211_hdr *) (pbyTxBufferAddr + cbHeaderSize);
@@ -2088,8 +2086,7 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb)* Return Value: NULL */ -int nsDMA_tx_packet (struct vnt_private *pDevice, -u32 uDMAIdx,struct sk_buff *skb) +int nsDMA_tx_packet (struct vnt_private *pDevice,struct sk_buff *skb) {struct net_device_stats *pStats = &pDevice->stats;struct vnt_manager *pMgmt = &pDevice->vnt_mgmt;
@@ -2420,7 +2417,7 @@ int nsDMA_tx_packet(struct vnt_private *pDevice, fConvertedPacket =s_bPacketToWirelessUsb (pDevice, byPktType, pTX_Buffer, bNeedEncryption, - skb->len, uDMAIdx, &pDevice->sTxEthHeader, + skb->len, &pDevice->sTxEthHeader, (u8 *)skb->data, pTransmitKey, uNodeIndex, pDevice->wCurrentRate, &uHeaderLen, &BytesToWrite
@@ -2584,7 +2581,7 @@ int bRelayPacketSend(struct vnt_private *pDevice, u8 *pbySkbData, u32 uDataLen, fConvertedPacket =s_bPacketToWirelessUsb (pDevice, byPktType, pTX_Buffer, bNeedEncryption, - uDataLen,TYPE_AC0DMA , &pDevice->sTxEthHeader, + uDataLen, &pDevice->sTxEthHeader, pbySkbData, pTransmitKey, uNodeIndex, pDevice->wCurrentRate, &uHeaderLen, &BytesToWrite
drivers/staging/vt6656/rxtx.h +1 -1
@@ -247,7 +247,7 @@ struct vnt_beacon_buffer { } __packed;void vDMA0_tx_80211 (struct vnt_private *,struct sk_buff *skb); -int nsDMA_tx_packet (struct vnt_private *,u32 uDMAIdx,struct sk_buff *skb); +int nsDMA_tx_packet (struct vnt_private *,struct sk_buff *skb);CMD_STATUS csMgmt_xmit (struct vnt_private *,struct vnt_tx_mgmt *);CMD_STATUS csBeacon_xmit (struct vnt_private *,struct vnt_tx_mgmt *); int bRelayPacketSend(struct vnt_private *, u8 *pbySkbData, u32 uDataLen,
drivers/staging/vt6656/wcmd.c +2 -2
@@ -675,7 +675,7 @@ void vRunCommand(struct work_struct *work) pDevice->bMoreData = true; } -if (nsDMA_tx_packet (pDevice,TYPE_AC0DMA , skb) !=0 ) +if (nsDMA_tx_packet (pDevice, skb) !=0 )DBG_PRT (MSG_LEVEL_DEBUG ,KERN_INFO "Multicast ps tx fail\n" ); pMgmt->sNodeDBTable[0 ].wEnQueueCnt--;
@@ -698,7 +698,7 @@ void vRunCommand(struct work_struct *work) pDevice->bMoreData = true; } -if (nsDMA_tx_packet (pDevice,TYPE_AC0DMA , skb) !=0 ) +if (nsDMA_tx_packet (pDevice, skb) !=0 )DBG_PRT (MSG_LEVEL_DEBUG ,KERN_INFO "sta ps tx fail\n" ); pMgmt->sNodeDBTable[ii].wEnQueueCnt--;
Signature · 1 line
1.9.1
PATCH 2/4 staging: vt6656: desh.h Remove unused macros and structures.
All are dead and of no use.
Signed-off-by Malcolm Priestley <[email protected]>
--- drivers/staging/vt6656/desc.h | 55 ------------------------------------------- 1 file changed, 55 deletions(-)
drivers/staging/vt6656/desc.h +0 -55
@@ -91,15 +91,6 @@#define TSR_ACKDATA 0x02#define TSR_VALID 0x01 -#define CB_PROTOCOL_RESERVED_SECTION 16 - -/* -* if retries exceed 15 times, TX will abort, and -* if TX fifo underflow, TX will fail -* we should try to resend it -*/ -#define CB_MAX_TX_ABORT_RETRY 3 -#define FIFOCTL_AUTO_FB_1 0x1000#define FIFOCTL_AUTO_FB_0 0x0800#define FIFOCTL_GRPACK 0x0400
@@ -126,50 +117,4 @@#define FRAGCTL_STAFRAG 0x0001#define FRAGCTL_NONFRAG 0x0000 -#define TYPE_TXDMA0 0 -#define TYPE_AC0DMA 1 -#define TYPE_ATIMDMA 2 -#define TYPE_SYNCDMA 3 -#define TYPE_MAXTD 2 - -#define TYPE_BEACONDMA 4 - -#define TYPE_RXDMA0 0 -#define TYPE_RXDMA1 1 -#define TYPE_MAXRD 2 - -/* TD_INFO flags control bit */ -#define TD_FLAGS_NETIF_SKB 0x01/* check if need release skb */ -#define TD_FLAGS_PRIV_SKB 0x02/* check if called from private skb(hostap) */ -#define TD_FLAGS_PS_RETRY 0x04/* check if PS STA frame re-transmit */ - -/* -* TX FIFO header -*/ -typedef struct tagSBEACONCtl { -u32 BufReady:1 ; -u32 TSF:15 ; -u32 BufLen:11 ; -u32 Reserved:5 ; -} __attribute__ ((__packed__ )) -SBEACONCtl ; - -typedef struct tagSSecretKey { -u32 dwLowDword; -u8 byHighByte; -} __attribute__ ((__packed__ )) -SSecretKey ; - -typedef struct tagSKeyEntry { -u8 abyAddrHi[2 ]; -u16 wKCTL; -u8 abyAddrLo[4 ]; -u32 dwKey0[4 ]; -u32 dwKey1[4 ]; -u32 dwKey2[4 ]; -u32 dwKey3[4 ]; -u32 dwKey4[4 ]; -} __attribute__ ((__packed__ )) -SKeyEntry ; -#endif /* __DESC_H__ */
Signature · 1 line
1.9.1
PATCH 3/4 staging: vt6656: nsDMA_tx_packet Move pContext later
In reply to Malcolm Priestleycall s_vGetFreeContext later in function skiping large chunk of code.
Signed-off-by Malcolm Priestley <[email protected]>
--- drivers/staging/vt6656/rxtx.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)
drivers/staging/vt6656/rxtx.c +7 -9
@@ -2175,14 +2175,6 @@ int nsDMA_tx_packet(struct vnt_private *pDevice, struct sk_buff *skb) } } - pContext =s_vGetFreeContext (pDevice); - -if (pContext ==NULL ) { -DBG_PRT (MSG_LEVEL_DEBUG ,KERN_DEBUG " pContext == NULL\n" ); -dev_kfree_skb_irq (skb); -return STATUS_RESOURCES ; - } -memcpy (pDevice->sTxEthHeader.h_dest, (u8 *)(skb->data),ETH_HLEN );//mike add:station mode check eapol-key challenge--->
@@ -2405,7 +2397,6 @@ int nsDMA_tx_packet(struct vnt_private *pDevice, struct sk_buff *skb)if (pTransmitKey ==NULL ) {DBG_PRT (MSG_LEVEL_DEBUG ,KERN_INFO "return no tx key\n" ); - pContext->bBoolInUse = false;dev_kfree_skb_irq (skb); pStats->tx_dropped++;return STATUS_FAILURE ;
@@ -2413,6 +2404,13 @@ int nsDMA_tx_packet(struct vnt_private *pDevice, struct sk_buff *skb) } } + pContext =s_vGetFreeContext (pDevice); +if (!pContext) { +DBG_PRT (MSG_LEVEL_DEBUG ,KERN_DEBUG " pContext == NULL\n" ); +dev_kfree_skb_irq (skb); +return STATUS_RESOURCES ; + } + pTX_Buffer = (struct vnt_tx_buffer *)&pContext->Data[0 ]; fConvertedPacket = s_bPacketToWirelessUsb(pDevice, byPktType,
Signature · 1 line
1.9.1
PATCH 4/4 staging: vt6656: struct vnt_usb_send_context remove camel case.
In reply to Malcolm PriestleyCamel case changes
pDevice -> priv
pPacket -> skb
pUrb -> urb
uBufLen -> buf_len;
bBoolInUse -> in_use
Data -> data
Signed-off-by Malcolm Priestley <[email protected]>
--- drivers/staging/vt6656/device.h | 12 +++---- drivers/staging/vt6656/main_usb.c | 14 ++++---- drivers/staging/vt6656/rxtx.c | 74 +++++++++++++++++++-------------------- drivers/staging/vt6656/usbpipe.c | 26 +++++++------- 4 files changed, 63 insertions(+), 63 deletions(-)
drivers/staging/vt6656/device.h +6 -6
@@ -176,13 +176,13 @@ struct vnt_rcb {/* used to track bulk out irps */ struct vnt_usb_send_context { -void *pDevice; -struct sk_buff *pPacket; -struct urb *pUrb; -unsigned int uBufLen; +void *priv; +struct sk_buff *skb; +struct urb *urb; +unsigned int buf_len;u8 type; -bool bBoolInUse; -unsigned char Data[MAX_TOTAL_SIZE_WITH_ALL_HEADERS ]; +bool in_use; +unsigned char data[MAX_TOTAL_SIZE_WITH_ALL_HEADERS ]; };/* tx packet info for rxtx */
drivers/staging/vt6656/main_usb.c +7 -7
@@ -757,9 +757,9 @@ static void device_free_tx_bufs(struct vnt_private *priv)for (ii =0 ; ii < priv->cbTD; ii++) { tx_context = priv->apTD[ii];/* deallocate URBs */ -if (tx_context->pUrb) { -usb_kill_urb (tx_context->pUrb); -usb_free_urb (tx_context->pUrb); +if (tx_context->urb) { +usb_kill_urb (tx_context->urb); +usb_free_urb (tx_context->urb); }kfree (tx_context);
@@ -825,17 +825,17 @@ static bool device_alloc_bufs(struct vnt_private *priv) } priv->apTD[ii] = tx_context; - tx_context->pDevice = priv; + tx_context->priv = priv;/* allocate URBs */ - tx_context->pUrb =usb_alloc_urb (0 ,GFP_ATOMIC ); -if (tx_context->pUrb ==NULL ) { + tx_context->urb =usb_alloc_urb (0 ,GFP_ATOMIC ); +if (!tx_context->urb) {DBG_PRT (MSG_LEVEL_ERR ,KERN_ERR "alloc tx urb failed\n" ); goto free_tx; } - tx_context->bBoolInUse = false; + tx_context->in_use = false; }/* allocate RCB mem */
drivers/staging/vt6656/rxtx.c +37 -37
165 lines not on this page · raw message
drivers/staging/vt6656/usbpipe.c +13 -13
@@ -530,17 +530,17 @@ int PIPEnsSendBulkOut(struct vnt_private *priv,DBG_PRT (MSG_LEVEL_DEBUG ,KERN_INFO "s_nsSendBulkOut\n" );if (!(MP_IS_READY (priv) && priv->Flags & fMP_POST_WRITES)) { - context->bBoolInUse = false; + context->in_use = false;return STATUS_RESOURCES ; } - urb = context->pUrb; + urb = context->urb;usb_fill_bulk_urb (urb, priv->usb,usb_sndbulkpipe (priv->usb,3 ), - context->Data, - context->uBufLen, + context->data, + context->buf_len, s_nsBulkOutIoCompleteWrite, context);
@@ -548,7 +548,7 @@ int PIPEnsSendBulkOut(struct vnt_private *priv,if (status !=0 ) {DBG_PRT (MSG_LEVEL_DEBUG ,KERN_INFO "Submit Tx URB failed %d\n" , status); - context->bBoolInUse = false; + context->in_use = false;return STATUS_FAILURE ; }
@@ -586,7 +586,7 @@ int PIPEnsSendBulkOut(struct vnt_private *priv,static void s_nsBulkOutIoCompleteWrite (struct urb *urb) {struct vnt_usb_send_context *context = urb->context; -struct vnt_private *priv = context->pDevice; +struct vnt_private *priv = context->priv;u8 context_type = context->type;DBG_PRT (MSG_LEVEL_DEBUG ,KERN_INFO "---->s_nsBulkOutIoCompleteWrite\n" );
@@ -594,12 +594,12 @@ static void s_nsBulkOutIoCompleteWrite(struct urb *urb)switch (urb->status) {case 0 :DBG_PRT (MSG_LEVEL_DEBUG ,KERN_INFO -"Write %d bytes\n" , context->uBufLen); +"Write %d bytes\n" , context->buf_len);break ;case -ECONNRESET :case -ENOENT :case -ESHUTDOWN : - context->bBoolInUse = false; + context->in_use = false;return ;case -ETIMEDOUT :default :
@@ -612,11 +612,11 @@ static void s_nsBulkOutIoCompleteWrite(struct urb *urb)return ;if (CONTEXT_DATA_PACKET == context_type) { -if (context->pPacket !=NULL ) { -dev_kfree_skb_irq (context->pPacket); - context->pPacket =NULL ; +if (context->skb !=NULL ) { +dev_kfree_skb_irq (context->skb); + context->skb =NULL ;DBG_PRT (MSG_LEVEL_DEBUG ,KERN_INFO -"tx %d bytes\n" , context->uBufLen); +"tx %d bytes\n" , context->buf_len); } priv->dev->trans_start = jiffies;
@@ -627,7 +627,7 @@ static void s_nsBulkOutIoCompleteWrite(struct urb *urb)netif_wake_queue (priv->dev); } - context->bBoolInUse = false; + context->in_use = false;return ; }
Signature · 1 line
1.9.1
Greg KH
maintainerRe: [PATCH 3/4] staging: vt6656: nsDMA_tx_packet Move pContext later
In reply to Malcolm PriestleyQuoted 7 lines · Malcolm Priestley
call
s_vGetFreeContextlater in function skiping large chunk of code.Signed-off-by Malcolm Priestley <[email protected]>--- drivers/staging/vt6656/rxtx.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)
Due to other changes in the tree, this patch doesn't apply :(