Commit c0de17e4 authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Greg Kroah-Hartman

staging: vt6656: rxtx.c: s_vGetFreeContext use single tx memset.

memset to 0 structure _USB_SEND_CONTEXT pContext->Data to its
size of MAX_TOTAL_SIZE_WITH_ALL_HEADERS as defined
in device.h

This removes the need for memset in the TX path.

It also allows the removal of dead structure
TX_BUFFER_CONTAINER BufferHeader;
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a6669811
...@@ -155,6 +155,7 @@ static void *s_vGetFreeContext(struct vnt_private *pDevice) ...@@ -155,6 +155,7 @@ static void *s_vGetFreeContext(struct vnt_private *pDevice)
pContext = pDevice->apTD[ii]; pContext = pDevice->apTD[ii];
if (pContext->bBoolInUse == false) { if (pContext->bBoolInUse == false) {
pContext->bBoolInUse = true; pContext->bBoolInUse = true;
memset(pContext->Data, 0, MAX_TOTAL_SIZE_WITH_ALL_HEADERS);
pReturnContext = pContext; pReturnContext = pContext;
break; break;
} }
...@@ -1206,7 +1207,6 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType, ...@@ -1206,7 +1207,6 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
} }
pTxBufHead = (PTX_BUFFER) usbPacketBuf; pTxBufHead = (PTX_BUFFER) usbPacketBuf;
memset(pTxBufHead, 0, sizeof(TX_BUFFER));
// Get pkt type // Get pkt type
if (ntohs(psEthHeader->h_proto) > ETH_DATA_LEN) { if (ntohs(psEthHeader->h_proto) > ETH_DATA_LEN) {
...@@ -1582,8 +1582,6 @@ static void s_vGenerateMACHeader(struct vnt_private *pDevice, ...@@ -1582,8 +1582,6 @@ static void s_vGenerateMACHeader(struct vnt_private *pDevice,
{ {
struct ieee80211_hdr *pMACHeader = (struct ieee80211_hdr *)pbyBufferAddr; struct ieee80211_hdr *pMACHeader = (struct ieee80211_hdr *)pbyBufferAddr;
memset(pMACHeader, 0, (sizeof(struct ieee80211_hdr)));
if (uDMAIdx == TYPE_ATIMDMA) { if (uDMAIdx == TYPE_ATIMDMA) {
pMACHeader->frame_control = TYPE_802_11_ATIM; pMACHeader->frame_control = TYPE_802_11_ATIM;
} else { } else {
...@@ -1699,7 +1697,6 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice, ...@@ -1699,7 +1697,6 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice,
cbFrameBodySize = pPacket->cbPayloadLen; cbFrameBodySize = pPacket->cbPayloadLen;
pTxBufHead = (PSTxBufHead) pbyTxBufferAddr; pTxBufHead = (PSTxBufHead) pbyTxBufferAddr;
wTxBufSize = sizeof(STxBufHead); wTxBufSize = sizeof(STxBufHead);
memset(pTxBufHead, 0, wTxBufSize);
if (pDevice->byBBType == BB_TYPE_11A) { if (pDevice->byBBType == BB_TYPE_11A) {
wCurrentRate = RATE_6M; wCurrentRate = RATE_6M;
...@@ -1828,9 +1825,6 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice, ...@@ -1828,9 +1825,6 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice,
cbHeaderSize = wTxBufSize + sizeof(SRrvTime_ab) + sizeof(STxDataHead_ab); cbHeaderSize = wTxBufSize + sizeof(SRrvTime_ab) + sizeof(STxDataHead_ab);
} }
memset((void *)(pbyTxBufferAddr + wTxBufSize), 0,
(cbHeaderSize - wTxBufSize));
memcpy(&(sEthHeader.h_dest[0]), memcpy(&(sEthHeader.h_dest[0]),
&(pPacket->p80211Header->sA3.abyAddr1[0]), &(pPacket->p80211Header->sA3.abyAddr1[0]),
ETH_ALEN); ETH_ALEN);
...@@ -1968,7 +1962,6 @@ CMD_STATUS csBeacon_xmit(struct vnt_private *pDevice, ...@@ -1968,7 +1962,6 @@ CMD_STATUS csBeacon_xmit(struct vnt_private *pDevice,
pTxBufHead = (PSTxShortBufHead) pbyTxBufferAddr; pTxBufHead = (PSTxShortBufHead) pbyTxBufferAddr;
wTxBufSize = sizeof(STxShortBufHead); wTxBufSize = sizeof(STxShortBufHead);
memset(pTxBufHead, 0, wTxBufSize);
if (pDevice->byBBType == BB_TYPE_11A) { if (pDevice->byBBType == BB_TYPE_11A) {
wCurrentRate = RATE_6M; wCurrentRate = RATE_6M;
...@@ -2077,7 +2070,6 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb) ...@@ -2077,7 +2070,6 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb)
pbyTxBufferAddr = (u8 *)(&pTX_Buffer->adwTxKey[0]); pbyTxBufferAddr = (u8 *)(&pTX_Buffer->adwTxKey[0]);
pTxBufHead = (PSTxBufHead) pbyTxBufferAddr; pTxBufHead = (PSTxBufHead) pbyTxBufferAddr;
wTxBufSize = sizeof(STxBufHead); wTxBufSize = sizeof(STxBufHead);
memset(pTxBufHead, 0, wTxBufSize);
if (pDevice->byBBType == BB_TYPE_11A) { if (pDevice->byBBType == BB_TYPE_11A) {
wCurrentRate = RATE_6M; wCurrentRate = RATE_6M;
...@@ -2233,8 +2225,6 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb) ...@@ -2233,8 +2225,6 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb)
pvTxDataHd = (PSTxDataHead_ab) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab) + cbMICHDR); pvTxDataHd = (PSTxDataHead_ab) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab) + cbMICHDR);
cbHeaderSize = wTxBufSize + sizeof(SRrvTime_ab) + cbMICHDR + sizeof(STxDataHead_ab); cbHeaderSize = wTxBufSize + sizeof(SRrvTime_ab) + cbMICHDR + sizeof(STxDataHead_ab);
} }
memset((void *)(pbyTxBufferAddr + wTxBufSize), 0,
(cbHeaderSize - wTxBufSize));
memcpy(&(sEthHeader.h_dest[0]), memcpy(&(sEthHeader.h_dest[0]),
&(p80211Header->sA3.abyAddr1[0]), &(p80211Header->sA3.abyAddr1[0]),
ETH_ALEN); ETH_ALEN);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment