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

staging: vt6655: 64 bit fixes :TKIP mode micheal.c sizeof long.

Fix MIC_vGetMIC and MIC_vInit to u32

Fix calling functions to u32
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4dbc77c0
...@@ -733,8 +733,8 @@ device_receive_frame( ...@@ -733,8 +733,8 @@ device_receive_frame(
unsigned long *pdwMIC_R; unsigned long *pdwMIC_R;
unsigned long dwMIC_Priority; unsigned long dwMIC_Priority;
unsigned long dwMICKey0 = 0, dwMICKey1 = 0; unsigned long dwMICKey0 = 0, dwMICKey1 = 0;
unsigned long dwLocalMIC_L = 0; u32 dwLocalMIC_L = 0;
unsigned long dwLocalMIC_R = 0; u32 dwLocalMIC_R = 0;
viawget_wpa_header *wpahdr; viawget_wpa_header *wpahdr;
if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) { if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) {
......
...@@ -53,14 +53,14 @@ ...@@ -53,14 +53,14 @@
*/ */
static void s_vClear(void); // Clear the internal message, static void s_vClear(void); // Clear the internal message,
// resets the object to the state just after construction. // resets the object to the state just after construction.
static void s_vSetKey(unsigned long dwK0, unsigned long dwK1); static void s_vSetKey(u32 dwK0, u32 dwK1);
static void s_vAppendByte(unsigned char b); // Add a single byte to the internal message static void s_vAppendByte(unsigned char b); // Add a single byte to the internal message
/*--------------------- Export Variables --------------------------*/ /*--------------------- Export Variables --------------------------*/
static unsigned long L, R; // Current state static u32 L, R; /* Current state */
static unsigned long K0, K1; // Key static u32 K0, K1; /* Key */
static unsigned long M; // Message accumulator (single word) static u32 M; /* Message accumulator (single word) */
static unsigned int nBytesInM; // # bytes in M static unsigned int nBytesInM; // # bytes in M
/*--------------------- Export Functions --------------------------*/ /*--------------------- Export Functions --------------------------*/
...@@ -98,7 +98,7 @@ static void s_vClear(void) ...@@ -98,7 +98,7 @@ static void s_vClear(void)
M = 0; M = 0;
} }
static void s_vSetKey(unsigned long dwK0, unsigned long dwK1) static void s_vSetKey(u32 dwK0, u32 dwK1)
{ {
// Set the key // Set the key
K0 = dwK0; K0 = dwK0;
...@@ -129,7 +129,7 @@ static void s_vAppendByte(unsigned char b) ...@@ -129,7 +129,7 @@ static void s_vAppendByte(unsigned char b)
} }
} }
void MIC_vInit(unsigned long dwK0, unsigned long dwK1) void MIC_vInit(u32 dwK0, u32 dwK1)
{ {
// Set the key // Set the key
s_vSetKey(dwK0, dwK1); s_vSetKey(dwK0, dwK1);
...@@ -155,7 +155,7 @@ void MIC_vAppend(unsigned char *src, unsigned int nBytes) ...@@ -155,7 +155,7 @@ void MIC_vAppend(unsigned char *src, unsigned int nBytes)
} }
} }
void MIC_vGetMIC(unsigned long *pdwL, unsigned long *pdwR) void MIC_vGetMIC(u32 *pdwL, u32 *pdwR)
{ {
// Append the minimum padding // Append the minimum padding
s_vAppendByte(0x5a); s_vAppendByte(0x5a);
......
...@@ -31,11 +31,13 @@ ...@@ -31,11 +31,13 @@
#ifndef __MICHAEL_H__ #ifndef __MICHAEL_H__
#define __MICHAEL_H__ #define __MICHAEL_H__
#include <linux/types.h>
/*--------------------- Export Definitions -------------------------*/ /*--------------------- Export Definitions -------------------------*/
/*--------------------- Export Types ------------------------------*/ /*--------------------- Export Types ------------------------------*/
void MIC_vInit(unsigned long dwK0, unsigned long dwK1); void MIC_vInit(u32 dwK0, u32 dwK1);
void MIC_vUnInit(void); void MIC_vUnInit(void);
...@@ -44,7 +46,7 @@ void MIC_vAppend(unsigned char *src, unsigned int nBytes); ...@@ -44,7 +46,7 @@ void MIC_vAppend(unsigned char *src, unsigned int nBytes);
/* Get the MIC result. Destination should accept 8 bytes of result. */ /* Get the MIC result. Destination should accept 8 bytes of result. */
/* This also resets the message to empty. */ /* This also resets the message to empty. */
void MIC_vGetMIC(unsigned long *pdwL, unsigned long *pdwR); void MIC_vGetMIC(u32 *pdwL, u32 *pdwR);
/*--------------------- Export Macros ------------------------------*/ /*--------------------- Export Macros ------------------------------*/
......
...@@ -1259,8 +1259,8 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT ...@@ -1259,8 +1259,8 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT
unsigned int cbMICHDR = 0; unsigned int cbMICHDR = 0;
unsigned long dwMICKey0, dwMICKey1; unsigned long dwMICKey0, dwMICKey1;
unsigned long dwMIC_Priority; unsigned long dwMIC_Priority;
unsigned long *pdwMIC_L; u32 *pdwMIC_L;
unsigned long *pdwMIC_R; u32 *pdwMIC_R;
unsigned long dwSafeMIC_L, dwSafeMIC_R; //Fix "Last Frag Size" < "MIC length". unsigned long dwSafeMIC_L, dwSafeMIC_R; //Fix "Last Frag Size" < "MIC length".
bool bMIC2Frag = false; bool bMIC2Frag = false;
unsigned int uMICFragLen = 0; unsigned int uMICFragLen = 0;
...@@ -1624,10 +1624,10 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT ...@@ -1624,10 +1624,10 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT
if (bMIC2Frag == false) { if (bMIC2Frag == false) {
if (uTmpLen != 0) if (uTmpLen != 0)
MIC_vAppend((pbyBuffer + uLength), uTmpLen); MIC_vAppend((pbyBuffer + uLength), uTmpLen);
pdwMIC_L = (unsigned long *)(pbyBuffer + uLength + uTmpLen); pdwMIC_L = (u32 *)(pbyBuffer + uLength + uTmpLen);
pdwMIC_R = (unsigned long *)(pbyBuffer + uLength + uTmpLen + 4); pdwMIC_R = (u32 *)(pbyBuffer + uLength + uTmpLen + 4);
MIC_vGetMIC(pdwMIC_L, pdwMIC_R); MIC_vGetMIC(pdwMIC_L, pdwMIC_R);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Last MIC:%lX, %lX\n", *pdwMIC_L, *pdwMIC_R); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Last MIC:%X, %X\n", *pdwMIC_L, *pdwMIC_R);
} else { } else {
if (uMICFragLen >= 4) { if (uMICFragLen >= 4) {
memcpy((pbyBuffer + uLength), ((unsigned char *)&dwSafeMIC_R + (uMICFragLen - 4)), memcpy((pbyBuffer + uLength), ((unsigned char *)&dwSafeMIC_R + (uMICFragLen - 4)),
...@@ -1744,8 +1744,8 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT ...@@ -1744,8 +1744,8 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT
uMICFragLen = cbFragPayloadSize - uTmpLen; uMICFragLen = cbFragPayloadSize - uTmpLen;
ASSERT(uMICFragLen < cbMIClen); ASSERT(uMICFragLen < cbMIClen);
pdwMIC_L = (unsigned long *)(pbyBuffer + uLength + uTmpLen); pdwMIC_L = (u32 *)(pbyBuffer + uLength + uTmpLen);
pdwMIC_R = (unsigned long *)(pbyBuffer + uLength + uTmpLen + 4); pdwMIC_R = (u32 *)(pbyBuffer + uLength + uTmpLen + 4);
MIC_vGetMIC(pdwMIC_L, pdwMIC_R); MIC_vGetMIC(pdwMIC_L, pdwMIC_R);
dwSafeMIC_L = *pdwMIC_L; dwSafeMIC_L = *pdwMIC_L;
dwSafeMIC_R = *pdwMIC_R; dwSafeMIC_R = *pdwMIC_R;
...@@ -1759,7 +1759,7 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT ...@@ -1759,7 +1759,7 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT
} }
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n");
*/ */
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Get MIC:%lX, %lX\n", *pdwMIC_L, *pdwMIC_R); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Get MIC:%X, %X\n", *pdwMIC_L, *pdwMIC_R);
} }
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Middle frag len: %d\n", uTmpLen); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Middle frag len: %d\n", uTmpLen);
/* /*
...@@ -1873,8 +1873,8 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT ...@@ -1873,8 +1873,8 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT
MIC_vAppend((pbyBuffer + uLength - cb802_1_H_len), cbFrameBodySize); MIC_vAppend((pbyBuffer + uLength - cb802_1_H_len), cbFrameBodySize);
pdwMIC_L = (unsigned long *)(pbyBuffer + uLength - cb802_1_H_len + cbFrameBodySize); pdwMIC_L = (u32 *)(pbyBuffer + uLength - cb802_1_H_len + cbFrameBodySize);
pdwMIC_R = (unsigned long *)(pbyBuffer + uLength - cb802_1_H_len + cbFrameBodySize + 4); pdwMIC_R = (u32 *)(pbyBuffer + uLength - cb802_1_H_len + cbFrameBodySize + 4);
MIC_vGetMIC(pdwMIC_L, pdwMIC_R); MIC_vGetMIC(pdwMIC_L, pdwMIC_R);
MIC_vUnInit(); MIC_vUnInit();
...@@ -1887,7 +1887,7 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT ...@@ -1887,7 +1887,7 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "uLength: %d, %d\n", uLength, cbFrameBodySize); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "uLength: %d, %d\n", uLength, cbFrameBodySize);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "cbReqCount:%d, %d, %d, %d\n", cbReqCount, cbHeaderLength, uPadding, cbIVlen); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "cbReqCount:%d, %d, %d, %d\n", cbReqCount, cbHeaderLength, uPadding, cbIVlen);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "MIC:%lx, %lx\n", *pdwMIC_L, *pdwMIC_R); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "MIC:%x, %x\n", *pdwMIC_L, *pdwMIC_R);
/* /*
for (ii = 0; ii < 8; ii++) { for (ii = 0; ii < 8; ii++) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%02x ", *(((unsigned char *)(pdwMIC_L) + ii))); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%02x ", *(((unsigned char *)(pdwMIC_L) + ii)));
...@@ -2594,8 +2594,8 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un ...@@ -2594,8 +2594,8 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un
unsigned int uLength = 0; unsigned int uLength = 0;
unsigned long dwMICKey0, dwMICKey1; unsigned long dwMICKey0, dwMICKey1;
unsigned long dwMIC_Priority; unsigned long dwMIC_Priority;
unsigned long *pdwMIC_L; u32 *pdwMIC_L;
unsigned long *pdwMIC_R; u32 *pdwMIC_R;
unsigned short wTxBufSize; unsigned short wTxBufSize;
unsigned int cbMacHdLen; unsigned int cbMacHdLen;
SEthernetHeader sEthHeader; SEthernetHeader sEthHeader;
...@@ -2855,8 +2855,8 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un ...@@ -2855,8 +2855,8 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un
MIC_vAppend((pbyTxBufferAddr + uLength), cbFrameBodySize); MIC_vAppend((pbyTxBufferAddr + uLength), cbFrameBodySize);
pdwMIC_L = (unsigned long *)(pbyTxBufferAddr + uLength + cbFrameBodySize); pdwMIC_L = (u32 *)(pbyTxBufferAddr + uLength + cbFrameBodySize);
pdwMIC_R = (unsigned long *)(pbyTxBufferAddr + uLength + cbFrameBodySize + 4); pdwMIC_R = (u32 *)(pbyTxBufferAddr + uLength + cbFrameBodySize + 4);
MIC_vGetMIC(pdwMIC_L, pdwMIC_R); MIC_vGetMIC(pdwMIC_L, pdwMIC_R);
MIC_vUnInit(); MIC_vUnInit();
...@@ -2869,7 +2869,7 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un ...@@ -2869,7 +2869,7 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "uLength: %d, %d\n", uLength, cbFrameBodySize); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "uLength: %d, %d\n", uLength, cbFrameBodySize);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "cbReqCount:%d, %d, %d, %d\n", cbReqCount, cbHeaderSize, uPadding, cbIVlen); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "cbReqCount:%d, %d, %d, %d\n", cbReqCount, cbHeaderSize, uPadding, cbIVlen);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "MIC:%lx, %lx\n", *pdwMIC_L, *pdwMIC_R); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "MIC:%x, %x\n", *pdwMIC_L, *pdwMIC_R);
} }
......
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