From: Malcolm Priestley <tvboxspy@gmail.com>
To: gregkh@linuxfoundation.org
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 2/2] staging: vt6656: rxtx change u32 [4] aWTxKey to u8[16] tx_key
Date: Tue, 15 Oct 2013 21:46:49 +0100 [thread overview]
Message-ID: <1381870009.5100.45.camel@canaries32-MCP7A> (raw)
Replace 4 x u32 aWTxKey with u8 array of 16 bytes tx_key.
Replaces pbyBuf in s_vFillTxKey and connects pbyTxBufferAddr
directly to tx_key without a cast elsewhere in structure.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
drivers/staging/vt6656/rxtx.c | 23 ++++++++++++-----------
drivers/staging/vt6656/rxtx.h | 2 +-
2 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index 35a3ddb..7ca1c26 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -185,7 +185,6 @@ static void s_vFillTxKey(struct vnt_private *pDevice,
PSKeyItem pTransmitKey, u8 *pbyHdrBuf, u16 wPayloadLen,
struct vnt_mic_hdr *mic_hdr)
{
- u8 *pbyBuf = (u8 *)&fifo_head->adwTxKey[0];
u32 *pdwIV = (u32 *)pbyIVHead;
u32 *pdwExtIV = (u32 *)((u8 *)pbyIVHead + 4);
struct ieee80211_hdr *pMACHeader = (struct ieee80211_hdr *)pbyHdrBuf;
@@ -206,16 +205,18 @@ static void s_vFillTxKey(struct vnt_private *pDevice,
memcpy(pDevice->abyPRNG + 3, pTransmitKey->abyKey,
pTransmitKey->uKeyLength);
} else {
- memcpy(pbyBuf, (u8 *)&dwRevIVCounter, 3);
- memcpy(pbyBuf + 3, pTransmitKey->abyKey,
+ memcpy(fifo_head->tx_key, (u8 *)&dwRevIVCounter, 3);
+ memcpy(&fifo_head->tx_key[3], pTransmitKey->abyKey,
pTransmitKey->uKeyLength);
if (pTransmitKey->uKeyLength == WLAN_WEP40_KEYLEN) {
- memcpy(pbyBuf+8, (u8 *)&dwRevIVCounter, 3);
- memcpy(pbyBuf+11, pTransmitKey->abyKey,
+ memcpy(&fifo_head->tx_key[8],
+ (u8 *)&dwRevIVCounter, 3);
+ memcpy(&fifo_head->tx_key[11],
+ pTransmitKey->abyKey,
pTransmitKey->uKeyLength);
}
- memcpy(pDevice->abyPRNG, pbyBuf, 16);
+ memcpy(pDevice->abyPRNG, fifo_head->tx_key, 16);
}
/* Append IV after Mac Header */
*pdwIV &= WEP_IV_MASK;
@@ -235,7 +236,7 @@ static void s_vFillTxKey(struct vnt_private *pDevice,
TKIPvMixKey(pTransmitKey->abyKey, pDevice->abyCurrentNetAddr,
pTransmitKey->wTSC15_0, pTransmitKey->dwTSC47_16,
pDevice->abyPRNG);
- memcpy(pbyBuf, pDevice->abyPRNG, 16);
+ memcpy(fifo_head->tx_key, pDevice->abyPRNG, 16);
/* Make IV */
memcpy(pdwIV, pDevice->abyPRNG, 3);
@@ -254,7 +255,7 @@ static void s_vFillTxKey(struct vnt_private *pDevice,
if (pTransmitKey->wTSC15_0 == 0)
pTransmitKey->dwTSC47_16++;
- memcpy(pbyBuf, pTransmitKey->abyKey, 16);
+ memcpy(fifo_head->tx_key, pTransmitKey->abyKey, 16);
/* Make IV */
*pdwIV = 0;
@@ -1103,7 +1104,7 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
pTxBufHead->wFIFOCtl |= (FIFOCTL_RTS | FIFOCTL_LRETRY);
}
- pbyTxBufferAddr = (u8 *) &(pTxBufHead->adwTxKey[0]);
+ pbyTxBufferAddr = pTxBufHead->tx_key;
wTxBufSize = sizeof(struct vnt_tx_fifo_head);
if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {//802.11g packet
@@ -1419,7 +1420,7 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice,
pTX_Buffer = (struct vnt_tx_buffer *)&pContext->Data[0];
cbFrameBodySize = pPacket->cbPayloadLen;
pTxBufHead = &pTX_Buffer->fifo_head;
- pbyTxBufferAddr = (u8 *)&pTxBufHead->adwTxKey[0];
+ pbyTxBufferAddr = pTxBufHead->tx_key;
wTxBufSize = sizeof(struct vnt_tx_fifo_head);
if (pDevice->byBBType == BB_TYPE_11A) {
@@ -1791,7 +1792,7 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb)
pTX_Buffer = (struct vnt_tx_buffer *)&pContext->Data[0];
pTxBufHead = &pTX_Buffer->fifo_head;
- pbyTxBufferAddr = (u8 *)&pTxBufHead->adwTxKey[0];
+ pbyTxBufferAddr = pTxBufHead->tx_key;
wTxBufSize = sizeof(struct vnt_tx_fifo_head);
if (pDevice->byBBType == BB_TYPE_11A) {
diff --git a/drivers/staging/vt6656/rxtx.h b/drivers/staging/vt6656/rxtx.h
index eecbe89..b2dbc09 100644
--- a/drivers/staging/vt6656/rxtx.h
+++ b/drivers/staging/vt6656/rxtx.h
@@ -215,7 +215,7 @@ union vnt_tx_head {
};
struct vnt_tx_fifo_head {
- u32 adwTxKey[4];
+ u8 tx_key[16];
u16 wFIFOCtl;
u16 wTimeStamp;
u16 wFragCtl;
--
1.8.3.2
next reply other threads:[~2013-10-15 20:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-15 20:46 Malcolm Priestley [this message]
2013-10-16 19:46 ` [PATCH 2/2] staging: vt6656: rxtx change u32 [4] aWTxKey to u8[16] tx_key Greg KH
2013-10-16 21:25 ` Malcolm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1381870009.5100.45.camel@canaries32-MCP7A \
--to=tvboxspy@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox