From: Malcolm Priestley Date: Thu, 15 Aug 2013 18:37:04 +0000 (+0100) Subject: staging: vt6656: rxtx.c : s_bPacketToWirelessUsb remove usbPacketBuf. X-Git-Tag: MMI-PSA29.97-13-9~13778^2~255 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d0a2b8fa7663a09b66f54b77dbbf460fb762aa7d;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git staging: vt6656: rxtx.c : s_bPacketToWirelessUsb remove usbPacketBuf. Move vnt_tx_buffer *pTxBufHead to argument u8 *usbPacketBuf position. Fix the calling to s_bPacketToWirelessUsb so it attached to the calling struct vnt_tx_buffer pTX_Buffer. Signed-off-by: Malcolm Priestley Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c index 083f58f33d9d..e37e82c8a378 100644 --- a/drivers/staging/vt6656/rxtx.c +++ b/drivers/staging/vt6656/rxtx.c @@ -991,12 +991,12 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice, */ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType, - u8 *usbPacketBuf, int bNeedEncryption, u32 uSkbPacketLen, u32 uDMAIdx, - struct ethhdr *psEthHeader, u8 *pPacket, PSKeyItem pTransmitKey, - u32 uNodeIndex, u16 wCurrentRate, u32 *pcbHeaderLen, u32 *pcbTotalLen) + struct vnt_tx_buffer *pTxBufHead, int bNeedEncryption, + u32 uSkbPacketLen, u32 uDMAIdx, struct ethhdr *psEthHeader, + u8 *pPacket, PSKeyItem pTransmitKey, u32 uNodeIndex, u16 wCurrentRate, + u32 *pcbHeaderLen, u32 *pcbTotalLen) { struct vnt_manager *pMgmt = &pDevice->vnt_mgmt; - struct vnt_tx_buffer *pTxBufHead; u32 cbFrameSize, cbFrameBodySize; u32 cb802_1_H_len; u32 cbIVlen = 0, cbICVlen = 0, cbMIClen = 0, cbMACHdLen = 0; @@ -1026,8 +1026,6 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType, bSoftWEP = true; /* WEP 256 */ } - pTxBufHead = (struct vnt_tx_buffer *)usbPacketBuf; - // Get pkt type if (ntohs(psEthHeader->h_proto) > ETH_DATA_LEN) { if (pDevice->dwDiagRefCount == 0) { @@ -2541,8 +2539,10 @@ int nsDMA_tx_packet(struct vnt_private *pDevice, } } + pTX_Buffer = (struct vnt_tx_buffer *)&pContext->Data[0]; + fConvertedPacket = s_bPacketToWirelessUsb(pDevice, byPktType, - (u8 *)(&pContext->Data[0]), bNeedEncryption, + pTX_Buffer, bNeedEncryption, skb->len, uDMAIdx, &pDevice->sTxEthHeader, (u8 *)skb->data, pTransmitKey, uNodeIndex, pDevice->wCurrentRate, @@ -2564,7 +2564,6 @@ int nsDMA_tx_packet(struct vnt_private *pDevice, } } - pTX_Buffer = (struct vnt_tx_buffer *)&pContext->Data[0]; pTX_Buffer->byPKTNO = (u8) (((pDevice->wCurrentRate<<4) &0x00F0) | ((pDevice->wSeqCounter - 1) & 0x000F)); pTX_Buffer->wTxByteCount = (u16)BytesToWrite; @@ -2701,8 +2700,10 @@ int bRelayPacketSend(struct vnt_private *pDevice, u8 *pbySkbData, u32 uDataLen, // Convert the packet to an usb frame and copy into our buffer // and send the irp. + pTX_Buffer = (struct vnt_tx_buffer *)&pContext->Data[0]; + fConvertedPacket = s_bPacketToWirelessUsb(pDevice, byPktType, - (u8 *)(&pContext->Data[0]), bNeedEncryption, + pTX_Buffer, bNeedEncryption, uDataLen, TYPE_AC0DMA, &pDevice->sTxEthHeader, pbySkbData, pTransmitKey, uNodeIndex, pDevice->wCurrentRate, @@ -2714,7 +2715,6 @@ int bRelayPacketSend(struct vnt_private *pDevice, u8 *pbySkbData, u32 uDataLen, return false; } - pTX_Buffer = (struct vnt_tx_buffer *)&pContext->Data[0]; pTX_Buffer->byPKTNO = (u8) (((pDevice->wCurrentRate<<4) &0x00F0) | ((pDevice->wSeqCounter - 1) & 0x000F)); pTX_Buffer->wTxByteCount = (u16)BytesToWrite;