提交 52a7e64b 编写于 作者: A Andres More 提交者: Greg Kroah-Hartman

staging: vt6656: replaced custom DWORD definition with u32

Checkpatch findings were not resolved.

sed -i 's/\bDWORD\b/u32/g' drivers/staging/vt6656/*.[ch]
sed -i 's/\bPDWORD\b/u32 */g' drivers/staging/vt6656/*.[ch]
Signed-off-by: NAndres More <more.andres@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 3eaca0d2
...@@ -108,9 +108,9 @@ u8 dot3_table[256] = { ...@@ -108,9 +108,9 @@ u8 dot3_table[256] = {
static void xor_128(u8 *a, u8 *b, u8 *out) static void xor_128(u8 *a, u8 *b, u8 *out)
{ {
PDWORD dwPtrA = (PDWORD) a; u32 * dwPtrA = (u32 *) a;
PDWORD dwPtrB = (PDWORD) b; u32 * dwPtrB = (u32 *) b;
PDWORD dwPtrOut = (PDWORD) out; u32 * dwPtrOut = (u32 *) out;
(*dwPtrOut++) = (*dwPtrA++) ^ (*dwPtrB++); (*dwPtrOut++) = (*dwPtrA++) ^ (*dwPtrB++);
(*dwPtrOut++) = (*dwPtrA++) ^ (*dwPtrB++); (*dwPtrOut++) = (*dwPtrA++) ^ (*dwPtrB++);
...@@ -121,9 +121,9 @@ static void xor_128(u8 *a, u8 *b, u8 *out) ...@@ -121,9 +121,9 @@ static void xor_128(u8 *a, u8 *b, u8 *out)
static void xor_32(u8 *a, u8 *b, u8 *out) static void xor_32(u8 *a, u8 *b, u8 *out)
{ {
PDWORD dwPtrA = (PDWORD) a; u32 * dwPtrA = (u32 *) a;
PDWORD dwPtrB = (PDWORD) b; u32 * dwPtrB = (u32 *) b;
PDWORD dwPtrOut = (PDWORD) out; u32 * dwPtrOut = (u32 *) out;
(*dwPtrOut++) = (*dwPtrA++) ^ (*dwPtrB++); (*dwPtrOut++) = (*dwPtrA++) ^ (*dwPtrB++);
} }
......
...@@ -193,15 +193,15 @@ typedef struct tagKnownNodeDB { ...@@ -193,15 +193,15 @@ typedef struct tagKnownNodeDB {
u8 byAuthSequence; u8 byAuthSequence;
unsigned long ulLastRxJiffer; unsigned long ulLastRxJiffer;
u8 bySuppRate; u8 bySuppRate;
DWORD dwFlags; u32 dwFlags;
u16 wEnQueueCnt; u16 wEnQueueCnt;
bool bOnFly; bool bOnFly;
unsigned long long KeyRSC; unsigned long long KeyRSC;
u8 byKeyIndex; u8 byKeyIndex;
DWORD dwKeyIndex; u32 dwKeyIndex;
u8 byCipherSuite; u8 byCipherSuite;
DWORD dwTSC47_16; u32 dwTSC47_16;
u16 wTSC15_0; u16 wTSC15_0;
unsigned int uWepKeyLength; unsigned int uWepKeyLength;
u8 abyWepKey[WLAN_WEPMAX_KEYLEN]; u8 abyWepKey[WLAN_WEPMAX_KEYLEN];
......
...@@ -309,7 +309,7 @@ typedef struct tagSPMKIDCandidateEvent { ...@@ -309,7 +309,7 @@ typedef struct tagSPMKIDCandidateEvent {
typedef struct tagSQuietControl { typedef struct tagSQuietControl {
bool bEnable; bool bEnable;
DWORD dwStartTime; u32 dwStartTime;
u8 byPeriod; u8 byPeriod;
u16 wDuration; u16 wDuration;
} SQuietControl, *PSQuietControl; } SQuietControl, *PSQuietControl;
......
...@@ -750,28 +750,28 @@ int RXbBulkInProcessData(struct vnt_private *pDevice, PRCB pRCB, ...@@ -750,28 +750,28 @@ int RXbBulkInProcessData(struct vnt_private *pDevice, PRCB pRCB,
// Soft MIC // Soft MIC
if ((pKey != NULL) && (pKey->byCipherSuite == KEY_CTL_TKIP)) { if ((pKey != NULL) && (pKey->byCipherSuite == KEY_CTL_TKIP)) {
if (bIsWEP) { if (bIsWEP) {
PDWORD pdwMIC_L; u32 * pdwMIC_L;
PDWORD pdwMIC_R; u32 * pdwMIC_R;
DWORD dwMIC_Priority; u32 dwMIC_Priority;
DWORD dwMICKey0 = 0, dwMICKey1 = 0; u32 dwMICKey0 = 0, dwMICKey1 = 0;
DWORD dwLocalMIC_L = 0; u32 dwLocalMIC_L = 0;
DWORD dwLocalMIC_R = 0; u32 dwLocalMIC_R = 0;
if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) { if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) {
dwMICKey0 = cpu_to_le32(*(PDWORD)(&pKey->abyKey[24])); dwMICKey0 = cpu_to_le32(*(u32 *)(&pKey->abyKey[24]));
dwMICKey1 = cpu_to_le32(*(PDWORD)(&pKey->abyKey[28])); dwMICKey1 = cpu_to_le32(*(u32 *)(&pKey->abyKey[28]));
} }
else { else {
if (pMgmt->eAuthenMode == WMAC_AUTH_WPANONE) { if (pMgmt->eAuthenMode == WMAC_AUTH_WPANONE) {
dwMICKey0 = cpu_to_le32(*(PDWORD)(&pKey->abyKey[16])); dwMICKey0 = cpu_to_le32(*(u32 *)(&pKey->abyKey[16]));
dwMICKey1 = cpu_to_le32(*(PDWORD)(&pKey->abyKey[20])); dwMICKey1 = cpu_to_le32(*(u32 *)(&pKey->abyKey[20]));
} else if ((pKey->dwKeyIndex & BIT28) == 0) { } else if ((pKey->dwKeyIndex & BIT28) == 0) {
dwMICKey0 = cpu_to_le32(*(PDWORD)(&pKey->abyKey[16])); dwMICKey0 = cpu_to_le32(*(u32 *)(&pKey->abyKey[16]));
dwMICKey1 = cpu_to_le32(*(PDWORD)(&pKey->abyKey[20])); dwMICKey1 = cpu_to_le32(*(u32 *)(&pKey->abyKey[20]));
} else { } else {
dwMICKey0 = cpu_to_le32(*(PDWORD)(&pKey->abyKey[24])); dwMICKey0 = cpu_to_le32(*(u32 *)(&pKey->abyKey[24]));
dwMICKey1 = cpu_to_le32(*(PDWORD)(&pKey->abyKey[28])); dwMICKey1 = cpu_to_le32(*(u32 *)(&pKey->abyKey[28]));
} }
} }
...@@ -785,8 +785,8 @@ int RXbBulkInProcessData(struct vnt_private *pDevice, PRCB pRCB, ...@@ -785,8 +785,8 @@ int RXbBulkInProcessData(struct vnt_private *pDevice, PRCB pRCB,
MIC_vGetMIC(&dwLocalMIC_L, &dwLocalMIC_R); MIC_vGetMIC(&dwLocalMIC_L, &dwLocalMIC_R);
MIC_vUnInit(); MIC_vUnInit();
pdwMIC_L = (PDWORD)(skb->data + 8 + FrameSize); pdwMIC_L = (u32 *)(skb->data + 8 + FrameSize);
pdwMIC_R = (PDWORD)(skb->data + 8 + FrameSize + 4); pdwMIC_R = (u32 *)(skb->data + 8 + FrameSize + 4);
if ((cpu_to_le32(*pdwMIC_L) != dwLocalMIC_L) || (cpu_to_le32(*pdwMIC_R) != dwLocalMIC_R) || if ((cpu_to_le32(*pdwMIC_L) != dwLocalMIC_L) || (cpu_to_le32(*pdwMIC_R) != dwLocalMIC_R) ||
...@@ -838,12 +838,12 @@ int RXbBulkInProcessData(struct vnt_private *pDevice, PRCB pRCB, ...@@ -838,12 +838,12 @@ int RXbBulkInProcessData(struct vnt_private *pDevice, PRCB pRCB,
(pKey->byCipherSuite == KEY_CTL_CCMP))) { (pKey->byCipherSuite == KEY_CTL_CCMP))) {
if (bIsWEP) { if (bIsWEP) {
u16 wLocalTSC15_0 = 0; u16 wLocalTSC15_0 = 0;
DWORD dwLocalTSC47_16 = 0; u32 dwLocalTSC47_16 = 0;
unsigned long long RSC = 0; unsigned long long RSC = 0;
// endian issues // endian issues
RSC = *((unsigned long long *) &(pKey->KeyRSC)); RSC = *((unsigned long long *) &(pKey->KeyRSC));
wLocalTSC15_0 = (u16) RSC; wLocalTSC15_0 = (u16) RSC;
dwLocalTSC47_16 = (DWORD) (RSC>>16); dwLocalTSC47_16 = (u32) (RSC>>16);
RSC = dwRxTSC47_16; RSC = dwRxTSC47_16;
RSC <<= 16; RSC <<= 16;
...@@ -1136,7 +1136,7 @@ static int s_bHandleRxEncryption(struct vnt_private *pDevice, u8 *pbyFrame, ...@@ -1136,7 +1136,7 @@ static int s_bHandleRxEncryption(struct vnt_private *pDevice, u8 *pbyFrame,
// TKIP/AES // TKIP/AES
PayloadLen -= (WLAN_HDR_ADDR3_LEN + 8 + 4); // 24 is 802.11 header, 8 is IV&ExtIV, 4 is crc PayloadLen -= (WLAN_HDR_ADDR3_LEN + 8 + 4); // 24 is 802.11 header, 8 is IV&ExtIV, 4 is crc
*pdwRxTSC47_16 = cpu_to_le32(*(PDWORD)(pbyIV + 4)); *pdwRxTSC47_16 = cpu_to_le32(*(u32 *)(pbyIV + 4));
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ExtIV: %x\n", *pdwRxTSC47_16); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ExtIV: %x\n", *pdwRxTSC47_16);
if (byDecMode == KEY_CTL_TKIP) { if (byDecMode == KEY_CTL_TKIP) {
*pwRxTSC15_0 = cpu_to_le16(MAKEWORD(*(pbyIV+2), *pbyIV)); *pwRxTSC15_0 = cpu_to_le16(MAKEWORD(*(pbyIV+2), *pbyIV));
...@@ -1235,7 +1235,7 @@ static int s_bHostWepRxEncryption(struct vnt_private *pDevice, u8 *pbyFrame, ...@@ -1235,7 +1235,7 @@ static int s_bHostWepRxEncryption(struct vnt_private *pDevice, u8 *pbyFrame,
// TKIP/AES // TKIP/AES
PayloadLen -= (WLAN_HDR_ADDR3_LEN + 8 + 4); // 24 is 802.11 header, 8 is IV&ExtIV, 4 is crc PayloadLen -= (WLAN_HDR_ADDR3_LEN + 8 + 4); // 24 is 802.11 header, 8 is IV&ExtIV, 4 is crc
*pdwRxTSC47_16 = cpu_to_le32(*(PDWORD)(pbyIV + 4)); *pdwRxTSC47_16 = cpu_to_le32(*(u32 *)(pbyIV + 4));
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ExtIV: %x\n", *pdwRxTSC47_16); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ExtIV: %x\n", *pdwRxTSC47_16);
if (byDecMode == KEY_CTL_TKIP) { if (byDecMode == KEY_CTL_TKIP) {
......
...@@ -489,7 +489,7 @@ static int hostap_set_encryption(struct vnt_private *pDevice, ...@@ -489,7 +489,7 @@ static int hostap_set_encryption(struct vnt_private *pDevice,
param->u.crypt.key_len param->u.crypt.key_len
); );
dwKeyIndex = (DWORD)(param->u.crypt.idx); dwKeyIndex = (u32)(param->u.crypt.idx);
if (param->u.crypt.flags & HOSTAP_CRYPT_FLAG_SET_TX_KEY) { if (param->u.crypt.flags & HOSTAP_CRYPT_FLAG_SET_TX_KEY) {
pDevice->byKeyIndex = (u8)dwKeyIndex; pDevice->byKeyIndex = (u8)dwKeyIndex;
pDevice->bTransmitKey = true; pDevice->bTransmitKey = true;
......
...@@ -272,7 +272,7 @@ int KeybSetKey(struct vnt_private *pDevice, PSKeyManagement pTable, ...@@ -272,7 +272,7 @@ int KeybSetKey(struct vnt_private *pDevice, PSKeyManagement pTable,
if (uKeyLength == WLAN_WEP104_KEYLEN) if (uKeyLength == WLAN_WEP104_KEYLEN)
pKey->abyKey[15] |= 0x80; pKey->abyKey[15] |= 0x80;
} }
MACvSetKeyEntry(pDevice, pTable->KeyTable[i].wKeyCtl, i, uKeyIdx, pbyBSSID, (PDWORD)pKey->abyKey); MACvSetKeyEntry(pDevice, pTable->KeyTable[i].wKeyCtl, i, uKeyIdx, pbyBSSID, (u32 *)pKey->abyKey);
if ((dwKeyIndex & USE_KEYRSC) == 0) if ((dwKeyIndex & USE_KEYRSC) == 0)
pKey->KeyRSC = 0; /* RSC set by NIC */ pKey->KeyRSC = 0; /* RSC set by NIC */
...@@ -340,7 +340,7 @@ int KeybSetKey(struct vnt_private *pDevice, PSKeyManagement pTable, ...@@ -340,7 +340,7 @@ int KeybSetKey(struct vnt_private *pDevice, PSKeyManagement pTable,
if (uKeyLength == WLAN_WEP104_KEYLEN) if (uKeyLength == WLAN_WEP104_KEYLEN)
pKey->abyKey[15] |= 0x80; pKey->abyKey[15] |= 0x80;
} }
MACvSetKeyEntry(pDevice, pTable->KeyTable[j].wKeyCtl, j, uKeyIdx, pbyBSSID, (PDWORD)pKey->abyKey); MACvSetKeyEntry(pDevice, pTable->KeyTable[j].wKeyCtl, j, uKeyIdx, pbyBSSID, (u32 *)pKey->abyKey);
if ((dwKeyIndex & USE_KEYRSC) == 0) if ((dwKeyIndex & USE_KEYRSC) == 0)
pKey->KeyRSC = 0; /* RSC set by NIC */ pKey->KeyRSC = 0; /* RSC set by NIC */
...@@ -707,7 +707,7 @@ int KeybSetDefaultKey(struct vnt_private *pDevice, PSKeyManagement pTable, ...@@ -707,7 +707,7 @@ int KeybSetDefaultKey(struct vnt_private *pDevice, PSKeyManagement pTable,
pKey->abyKey[15] |= 0x80; pKey->abyKey[15] |= 0x80;
} }
MACvSetKeyEntry(pDevice, pTable->KeyTable[MAX_KEY_TABLE-1].wKeyCtl, MAX_KEY_TABLE-1, uKeyIdx, pTable->KeyTable[MAX_KEY_TABLE-1].abyBSSID, (PDWORD) pKey->abyKey); MACvSetKeyEntry(pDevice, pTable->KeyTable[MAX_KEY_TABLE-1].wKeyCtl, MAX_KEY_TABLE-1, uKeyIdx, pTable->KeyTable[MAX_KEY_TABLE-1].abyBSSID, (u32 *) pKey->abyKey);
if ((dwKeyIndex & USE_KEYRSC) == 0) if ((dwKeyIndex & USE_KEYRSC) == 0)
pKey->KeyRSC = 0; /* RSC set by NIC */ pKey->KeyRSC = 0; /* RSC set by NIC */
...@@ -805,7 +805,7 @@ int KeybSetAllGroupKey(struct vnt_private *pDevice, PSKeyManagement pTable, ...@@ -805,7 +805,7 @@ int KeybSetAllGroupKey(struct vnt_private *pDevice, PSKeyManagement pTable,
pKey->abyKey[15] |= 0x80; pKey->abyKey[15] |= 0x80;
} }
MACvSetKeyEntry(pDevice, pTable->KeyTable[i].wKeyCtl, i, uKeyIdx, pTable->KeyTable[i].abyBSSID, (PDWORD) pKey->abyKey); MACvSetKeyEntry(pDevice, pTable->KeyTable[i].wKeyCtl, i, uKeyIdx, pTable->KeyTable[i].abyBSSID, (u32 *) pKey->abyKey);
if ((dwKeyIndex & USE_KEYRSC) == 0) if ((dwKeyIndex & USE_KEYRSC) == 0)
pKey->KeyRSC = 0; /* RSC set by NIC */ pKey->KeyRSC = 0; /* RSC set by NIC */
......
...@@ -61,11 +61,11 @@ typedef struct tagSKeyItem ...@@ -61,11 +61,11 @@ typedef struct tagSKeyItem
u32 uKeyLength; u32 uKeyLength;
u8 abyKey[MAX_KEY_LEN]; u8 abyKey[MAX_KEY_LEN];
u64 KeyRSC; u64 KeyRSC;
DWORD dwTSC47_16; u32 dwTSC47_16;
u16 wTSC15_0; u16 wTSC15_0;
u8 byCipherSuite; u8 byCipherSuite;
u8 byReserved0; u8 byReserved0;
DWORD dwKeyIndex; u32 dwKeyIndex;
void *pvKeyTable; void *pvKeyTable;
} SKeyItem, *PSKeyItem; //64 } SKeyItem, *PSKeyItem; //64
...@@ -75,7 +75,7 @@ typedef struct tagSKeyTable ...@@ -75,7 +75,7 @@ typedef struct tagSKeyTable
u8 byReserved0[2]; //8 u8 byReserved0[2]; //8
SKeyItem PairwiseKey; SKeyItem PairwiseKey;
SKeyItem GroupKey[MAX_GROUP_KEY]; //64*5 = 320, 320+8=328 SKeyItem GroupKey[MAX_GROUP_KEY]; //64*5 = 320, 320+8=328
DWORD dwGTKeyIndex; // GroupTransmitKey Index u32 dwGTKeyIndex; // GroupTransmitKey Index
bool bInUse; bool bInUse;
u16 wKeyCtl; u16 wKeyCtl;
bool bSoftWEP; bool bSoftWEP;
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
// USB counter // USB counter
// //
typedef struct tagSUSBCounter { typedef struct tagSUSBCounter {
DWORD dwCrc; u32 dwCrc;
} SUSBCounter, *PSUSBCounter; } SUSBCounter, *PSUSBCounter;
...@@ -91,24 +91,24 @@ typedef struct tagSMib2Counter { ...@@ -91,24 +91,24 @@ typedef struct tagSMib2Counter {
// e.g. "interface 1" // e.g. "interface 1"
signed long ifType; signed long ifType;
signed long ifMtu; signed long ifMtu;
DWORD ifSpeed; u32 ifSpeed;
u8 ifPhysAddress[ETH_ALEN]; u8 ifPhysAddress[ETH_ALEN];
signed long ifAdminStatus; signed long ifAdminStatus;
signed long ifOperStatus; signed long ifOperStatus;
DWORD ifLastChange; u32 ifLastChange;
DWORD ifInOctets; u32 ifInOctets;
DWORD ifInUcastPkts; u32 ifInUcastPkts;
DWORD ifInNUcastPkts; u32 ifInNUcastPkts;
DWORD ifInDiscards; u32 ifInDiscards;
DWORD ifInErrors; u32 ifInErrors;
DWORD ifInUnknownProtos; u32 ifInUnknownProtos;
DWORD ifOutOctets; u32 ifOutOctets;
DWORD ifOutUcastPkts; u32 ifOutUcastPkts;
DWORD ifOutNUcastPkts; u32 ifOutNUcastPkts;
DWORD ifOutDiscards; u32 ifOutDiscards;
DWORD ifOutErrors; u32 ifOutErrors;
DWORD ifOutQLen; u32 ifOutQLen;
DWORD ifSpecific; u32 ifSpecific;
} SMib2Counter, *PSMib2Counter; } SMib2Counter, *PSMib2Counter;
// Value in the ifType entry // Value in the ifType entry
...@@ -125,26 +125,26 @@ typedef struct tagSMib2Counter { ...@@ -125,26 +125,26 @@ typedef struct tagSMib2Counter {
// //
typedef struct tagSRmonCounter { typedef struct tagSRmonCounter {
signed long etherStatsIndex; signed long etherStatsIndex;
DWORD etherStatsDataSource; u32 etherStatsDataSource;
DWORD etherStatsDropEvents; u32 etherStatsDropEvents;
DWORD etherStatsOctets; u32 etherStatsOctets;
DWORD etherStatsPkts; u32 etherStatsPkts;
DWORD etherStatsBroadcastPkts; u32 etherStatsBroadcastPkts;
DWORD etherStatsMulticastPkts; u32 etherStatsMulticastPkts;
DWORD etherStatsCRCAlignErrors; u32 etherStatsCRCAlignErrors;
DWORD etherStatsUndersizePkts; u32 etherStatsUndersizePkts;
DWORD etherStatsOversizePkts; u32 etherStatsOversizePkts;
DWORD etherStatsFragments; u32 etherStatsFragments;
DWORD etherStatsJabbers; u32 etherStatsJabbers;
DWORD etherStatsCollisions; u32 etherStatsCollisions;
DWORD etherStatsPkt64Octets; u32 etherStatsPkt64Octets;
DWORD etherStatsPkt65to127Octets; u32 etherStatsPkt65to127Octets;
DWORD etherStatsPkt128to255Octets; u32 etherStatsPkt128to255Octets;
DWORD etherStatsPkt256to511Octets; u32 etherStatsPkt256to511Octets;
DWORD etherStatsPkt512to1023Octets; u32 etherStatsPkt512to1023Octets;
DWORD etherStatsPkt1024to1518Octets; u32 etherStatsPkt1024to1518Octets;
DWORD etherStatsOwners; u32 etherStatsOwners;
DWORD etherStatsStatus; u32 etherStatsStatus;
} SRmonCounter, *PSRmonCounter; } SRmonCounter, *PSRmonCounter;
// //
...@@ -192,27 +192,27 @@ typedef struct tagSCustomCounters { ...@@ -192,27 +192,27 @@ typedef struct tagSCustomCounters {
typedef struct tagSISRCounters { typedef struct tagSISRCounters {
unsigned long Length; unsigned long Length;
DWORD dwIsrTx0OK; u32 dwIsrTx0OK;
DWORD dwIsrAC0TxOK; u32 dwIsrAC0TxOK;
DWORD dwIsrBeaconTxOK; u32 dwIsrBeaconTxOK;
DWORD dwIsrRx0OK; u32 dwIsrRx0OK;
DWORD dwIsrTBTTInt; u32 dwIsrTBTTInt;
DWORD dwIsrSTIMERInt; u32 dwIsrSTIMERInt;
DWORD dwIsrWatchDog; u32 dwIsrWatchDog;
DWORD dwIsrUnrecoverableError; u32 dwIsrUnrecoverableError;
DWORD dwIsrSoftInterrupt; u32 dwIsrSoftInterrupt;
DWORD dwIsrMIBNearfull; u32 dwIsrMIBNearfull;
DWORD dwIsrRxNoBuf; u32 dwIsrRxNoBuf;
DWORD dwIsrUnknown; // unknown interrupt count u32 dwIsrUnknown; // unknown interrupt count
DWORD dwIsrRx1OK; u32 dwIsrRx1OK;
DWORD dwIsrATIMTxOK; u32 dwIsrATIMTxOK;
DWORD dwIsrSYNCTxOK; u32 dwIsrSYNCTxOK;
DWORD dwIsrCFPEnd; u32 dwIsrCFPEnd;
DWORD dwIsrATIMEnd; u32 dwIsrATIMEnd;
DWORD dwIsrSYNCFlushOK; u32 dwIsrSYNCFlushOK;
DWORD dwIsrSTIMER1Int; u32 dwIsrSTIMER1Int;
///////////////////////////////////// /////////////////////////////////////
} SISRCounters, *PSISRCounters; } SISRCounters, *PSISRCounters;
...@@ -248,34 +248,34 @@ typedef struct tagSStatCounter { ...@@ -248,34 +248,34 @@ typedef struct tagSStatCounter {
// RSR status count // RSR status count
// //
DWORD dwRsrFrmAlgnErr; u32 dwRsrFrmAlgnErr;
DWORD dwRsrErr; u32 dwRsrErr;
DWORD dwRsrCRCErr; u32 dwRsrCRCErr;
DWORD dwRsrCRCOk; u32 dwRsrCRCOk;
DWORD dwRsrBSSIDOk; u32 dwRsrBSSIDOk;
DWORD dwRsrADDROk; u32 dwRsrADDROk;
DWORD dwRsrBCNSSIDOk; u32 dwRsrBCNSSIDOk;
DWORD dwRsrLENErr; u32 dwRsrLENErr;
DWORD dwRsrTYPErr; u32 dwRsrTYPErr;
DWORD dwNewRsrDECRYPTOK; u32 dwNewRsrDECRYPTOK;
DWORD dwNewRsrCFP; u32 dwNewRsrCFP;
DWORD dwNewRsrUTSF; u32 dwNewRsrUTSF;
DWORD dwNewRsrHITAID; u32 dwNewRsrHITAID;
DWORD dwNewRsrHITAID0; u32 dwNewRsrHITAID0;
DWORD dwRsrLong; u32 dwRsrLong;
DWORD dwRsrRunt; u32 dwRsrRunt;
DWORD dwRsrRxControl; u32 dwRsrRxControl;
DWORD dwRsrRxData; u32 dwRsrRxData;
DWORD dwRsrRxManage; u32 dwRsrRxManage;
DWORD dwRsrRxPacket; u32 dwRsrRxPacket;
DWORD dwRsrRxOctet; u32 dwRsrRxOctet;
DWORD dwRsrBroadcast; u32 dwRsrBroadcast;
DWORD dwRsrMulticast; u32 dwRsrMulticast;
DWORD dwRsrDirected; u32 dwRsrDirected;
// 64-bit OID // 64-bit OID
unsigned long long ullRsrOK; unsigned long long ullRsrOK;
...@@ -287,36 +287,36 @@ typedef struct tagSStatCounter { ...@@ -287,36 +287,36 @@ typedef struct tagSStatCounter {
unsigned long long ullRxMulticastFrames; unsigned long long ullRxMulticastFrames;
unsigned long long ullRxDirectedFrames; unsigned long long ullRxDirectedFrames;
DWORD dwRsrRxFragment; u32 dwRsrRxFragment;
DWORD dwRsrRxFrmLen64; u32 dwRsrRxFrmLen64;
DWORD dwRsrRxFrmLen65_127; u32 dwRsrRxFrmLen65_127;
DWORD dwRsrRxFrmLen128_255; u32 dwRsrRxFrmLen128_255;
DWORD dwRsrRxFrmLen256_511; u32 dwRsrRxFrmLen256_511;
DWORD dwRsrRxFrmLen512_1023; u32 dwRsrRxFrmLen512_1023;
DWORD dwRsrRxFrmLen1024_1518; u32 dwRsrRxFrmLen1024_1518;
// TSR status count // TSR status count
// //
DWORD dwTsrTotalRetry; // total collision retry count u32 dwTsrTotalRetry; // total collision retry count
DWORD dwTsrOnceRetry; // this packet only occur one collision u32 dwTsrOnceRetry; // this packet only occur one collision
DWORD dwTsrMoreThanOnceRetry; // this packet occur more than one collision u32 dwTsrMoreThanOnceRetry; // this packet occur more than one collision
DWORD dwTsrRetry; // this packet has ever occur collision, u32 dwTsrRetry; // this packet has ever occur collision,
// that is (dwTsrOnceCollision0 + dwTsrMoreThanOnceCollision0) // that is (dwTsrOnceCollision0 + dwTsrMoreThanOnceCollision0)
DWORD dwTsrACKData; u32 dwTsrACKData;
DWORD dwTsrErr; u32 dwTsrErr;
DWORD dwAllTsrOK; u32 dwAllTsrOK;
DWORD dwTsrRetryTimeout; u32 dwTsrRetryTimeout;
DWORD dwTsrTransmitTimeout; u32 dwTsrTransmitTimeout;
DWORD dwTsrTxPacket; u32 dwTsrTxPacket;
DWORD dwTsrTxOctet; u32 dwTsrTxOctet;
DWORD dwTsrBroadcast; u32 dwTsrBroadcast;
DWORD dwTsrMulticast; u32 dwTsrMulticast;
DWORD dwTsrDirected; u32 dwTsrDirected;
// RD/TD count // RD/TD count
DWORD dwCntRxFrmLength; u32 dwCntRxFrmLength;
DWORD dwCntTxBufLength; u32 dwCntTxBufLength;
u8 abyCntRxPattern[16]; u8 abyCntRxPattern[16];
u8 abyCntTxPattern[16]; u8 abyCntTxPattern[16];
...@@ -324,9 +324,9 @@ typedef struct tagSStatCounter { ...@@ -324,9 +324,9 @@ typedef struct tagSStatCounter {
// Software check.... // Software check....
DWORD dwCntRxDataErr; // rx buffer data software compare CRC err count u32 dwCntRxDataErr; // rx buffer data software compare CRC err count
DWORD dwCntDecryptErr; // rx buffer data software compare CRC err count u32 dwCntDecryptErr; // rx buffer data software compare CRC err count
DWORD dwCntRxICVErr; // rx buffer data software compare CRC err count u32 dwCntRxICVErr; // rx buffer data software compare CRC err count
// 64-bit OID // 64-bit OID
...@@ -341,9 +341,9 @@ typedef struct tagSStatCounter { ...@@ -341,9 +341,9 @@ typedef struct tagSStatCounter {
unsigned long long ullTxDirectedBytes; unsigned long long ullTxDirectedBytes;
// for autorate // for autorate
DWORD dwTxOk[MAX_RATE+1]; u32 dwTxOk[MAX_RATE+1];
DWORD dwTxFail[MAX_RATE+1]; u32 dwTxFail[MAX_RATE+1];
DWORD dwTxRetryCount[8]; u32 dwTxRetryCount[8];
STxPktInfo abyTxPktInfo[16]; STxPktInfo abyTxPktInfo[16];
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
* Date: Sep 4, 2002 * Date: Sep 4, 2002
* *
* Functions: * Functions:
* s_dwGetUINT32 - Convert from u8[] to DWORD in a portable way * s_dwGetUINT32 - Convert from u8[] to u32 in a portable way
* s_vPutUINT32 - Convert from DWORD to u8[] in a portable way * s_vPutUINT32 - Convert from u32 to u8[] in a portable way
* s_vClear - Reset the state to the empty message. * s_vClear - Reset the state to the empty message.
* s_vSetKey - Set the key. * s_vSetKey - Set the key.
* MIC_vInit - Set the key. * MIC_vInit - Set the key.
...@@ -48,39 +48,39 @@ ...@@ -48,39 +48,39 @@
/*--------------------- Static Functions --------------------------*/ /*--------------------- Static Functions --------------------------*/
/* /*
* static DWORD s_dwGetUINT32(u8 * p); Get DWORD from * static u32 s_dwGetUINT32(u8 * p); Get u32 from
* 4 bytes LSByte first * 4 bytes LSByte first
* static void s_vPutUINT32(u8* p, DWORD val); Put DWORD into * static void s_vPutUINT32(u8* p, u32 val); Put u32 into
* 4 bytes LSByte first * 4 bytes LSByte first
*/ */
static void s_vClear(void); /* Clear the internal message, static void s_vClear(void); /* Clear the internal message,
* resets the object to the * resets the object to the
* state just after construction. */ * state just after construction. */
static void s_vSetKey(DWORD dwK0, DWORD dwK1); static void s_vSetKey(u32 dwK0, u32 dwK1);
static void s_vAppendByte(u8 b); /* Add a single byte to the internal static void s_vAppendByte(u8 b); /* Add a single byte to the internal
* message */ * message */
/*--------------------- Export Variables --------------------------*/ /*--------------------- Export Variables --------------------------*/
static DWORD L, R; /* Current state */ static u32 L, R; /* Current state */
static DWORD K0, K1; /* Key */ static u32 K0, K1; /* Key */
static DWORD 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 --------------------------*/
/* /*
static DWORD s_dwGetUINT32 (u8 * p) static u32 s_dwGetUINT32 (u8 * p)
// Convert from u8[] to DWORD in a portable way // Convert from u8[] to u32 in a portable way
{ {
DWORD res = 0; u32 res = 0;
unsigned int i; unsigned int i;
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
res |= (*p++) << (8*i); res |= (*p++) << (8*i);
return res; return res;
} }
static void s_vPutUINT32(u8 *p, DWORD val) static void s_vPutUINT32(u8 *p, u32 val)
// Convert from DWORD to u8[] in a portable way // Convert from u32 to u8[] in a portable way
{ {
unsigned int i; unsigned int i;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
...@@ -99,7 +99,7 @@ static void s_vClear(void) ...@@ -99,7 +99,7 @@ static void s_vClear(void)
M = 0; M = 0;
} }
static void s_vSetKey(DWORD dwK0, DWORD dwK1) static void s_vSetKey(u32 dwK0, u32 dwK1)
{ {
/* Set the key */ /* Set the key */
K0 = dwK0; K0 = dwK0;
...@@ -130,7 +130,7 @@ static void s_vAppendByte(u8 b) ...@@ -130,7 +130,7 @@ static void s_vAppendByte(u8 b)
} }
} }
void MIC_vInit(DWORD dwK0, DWORD dwK1) void MIC_vInit(u32 dwK0, u32 dwK1)
{ {
/* Set the key */ /* Set the key */
s_vSetKey(dwK0, dwK1); s_vSetKey(dwK0, dwK1);
...@@ -157,7 +157,7 @@ void MIC_vAppend(u8 * src, unsigned int nBytes) ...@@ -157,7 +157,7 @@ void MIC_vAppend(u8 * src, unsigned int nBytes)
} }
} }
void MIC_vGetMIC(PDWORD pdwL, PDWORD pdwR) void MIC_vGetMIC(u32 * pdwL, u32 * pdwR)
{ {
/* Append the minimum padding */ /* Append the minimum padding */
s_vAppendByte(0x5a); s_vAppendByte(0x5a);
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
/*--------------------- Export Types ------------------------------*/ /*--------------------- Export Types ------------------------------*/
void MIC_vInit(DWORD dwK0, DWORD dwK1); void MIC_vInit(u32 dwK0, u32 dwK1);
void MIC_vUnInit(void); void MIC_vUnInit(void);
...@@ -44,7 +44,7 @@ void MIC_vAppend(u8 * src, unsigned int nBytes); ...@@ -44,7 +44,7 @@ void MIC_vAppend(u8 * 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(PDWORD pdwL, PDWORD pdwR); void MIC_vGetMIC(u32 * pdwL, u32 * pdwR);
/*--------------------- Export Macros ------------------------------*/ /*--------------------- Export Macros ------------------------------*/
......
...@@ -842,7 +842,7 @@ int RFbRawSetPower(struct vnt_private *pDevice, u8 byPwr, u32 uRATE) ...@@ -842,7 +842,7 @@ int RFbRawSetPower(struct vnt_private *pDevice, u8 byPwr, u32 uRATE)
case RF_AIROHA7230: case RF_AIROHA7230:
{ {
DWORD dwMax7230Pwr; u32 dwMax7230Pwr;
if (uRATE <= RATE_11M) { //RobertYu:20060426, for better 11b mask if (uRATE <= RATE_11M) { //RobertYu:20060426, for better 11b mask
bResult &= IFRFbWriteEmbedded(pDevice, 0x111BB900+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW); bResult &= IFRFbWriteEmbedded(pDevice, 0x111BB900+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW);
...@@ -864,7 +864,7 @@ int RFbRawSetPower(struct vnt_private *pDevice, u8 byPwr, u32 uRATE) ...@@ -864,7 +864,7 @@ int RFbRawSetPower(struct vnt_private *pDevice, u8 byPwr, u32 uRATE)
case RF_VT3226: //RobertYu:20051111, VT3226C0 and before case RF_VT3226: //RobertYu:20051111, VT3226C0 and before
{ {
DWORD dwVT3226Pwr; u32 dwVT3226Pwr;
if (pDevice->byCurPwr >= VT3226_PWR_IDX_LEN) if (pDevice->byCurPwr >= VT3226_PWR_IDX_LEN)
return false; return false;
...@@ -876,7 +876,7 @@ int RFbRawSetPower(struct vnt_private *pDevice, u8 byPwr, u32 uRATE) ...@@ -876,7 +876,7 @@ int RFbRawSetPower(struct vnt_private *pDevice, u8 byPwr, u32 uRATE)
case RF_VT3226D0: //RobertYu:20051228 case RF_VT3226D0: //RobertYu:20051228
{ {
DWORD dwVT3226Pwr; u32 dwVT3226Pwr;
if (pDevice->byCurPwr >= VT3226_PWR_IDX_LEN) if (pDevice->byCurPwr >= VT3226_PWR_IDX_LEN)
return false; return false;
...@@ -921,7 +921,7 @@ int RFbRawSetPower(struct vnt_private *pDevice, u8 byPwr, u32 uRATE) ...@@ -921,7 +921,7 @@ int RFbRawSetPower(struct vnt_private *pDevice, u8 byPwr, u32 uRATE)
//{{RobertYu:20060609 //{{RobertYu:20060609
case RF_VT3342A0: case RF_VT3342A0:
{ {
DWORD dwVT3342Pwr; u32 dwVT3342Pwr;
if (pDevice->byCurPwr >= VT3342_PWR_IDX_LEN) if (pDevice->byCurPwr >= VT3342_PWR_IDX_LEN)
return false; return false;
......
...@@ -115,7 +115,7 @@ typedef struct _CMD_CLRKEY_ENTRY ...@@ -115,7 +115,7 @@ typedef struct _CMD_CLRKEY_ENTRY
typedef struct _CMD_WRITE_MISCFF typedef struct _CMD_WRITE_MISCFF
{ {
DWORD adwMiscFFData[22][4]; //a key entry has only 22 dwords u32 adwMiscFFData[22][4]; //a key entry has only 22 dwords
} CMD_WRITE_MISCFF, *PCMD_WRITE_MISCFF; } CMD_WRITE_MISCFF, *PCMD_WRITE_MISCFF;
typedef struct _CMD_SET_TSFTBTT typedef struct _CMD_SET_TSFTBTT
...@@ -143,10 +143,10 @@ typedef struct _CMD_CHANGE_BBTYPE ...@@ -143,10 +143,10 @@ typedef struct _CMD_CHANGE_BBTYPE
u8 byBBCR10; u8 byBBCR10;
u8 byBB_BBType; //CR88 u8 byBB_BBType; //CR88
u8 byMAC_BBType; u8 byMAC_BBType;
DWORD dwRSPINF_b_1; u32 dwRSPINF_b_1;
DWORD dwRSPINF_b_2; u32 dwRSPINF_b_2;
DWORD dwRSPINF_b_55; u32 dwRSPINF_b_55;
DWORD dwRSPINF_b_11; u32 dwRSPINF_b_11;
u16 wRSPINF_a[9]; u16 wRSPINF_a[9];
} CMD_CHANGE_BBTYPE, *PCMD_CHANGE_BBTYPE; } CMD_CHANGE_BBTYPE, *PCMD_CHANGE_BBTYPE;
......
...@@ -324,7 +324,7 @@ static void s_vSWencryption(struct vnt_private *pDevice, ...@@ -324,7 +324,7 @@ static void s_vSWencryption(struct vnt_private *pDevice,
//======================================================================= //=======================================================================
// Append ICV after payload // Append ICV after payload
dwICV = CRCdwGetCrc32Ex(pbyPayloadHead, wPayloadSize, dwICV);//ICV(Payload) dwICV = CRCdwGetCrc32Ex(pbyPayloadHead, wPayloadSize, dwICV);//ICV(Payload)
pdwICV = (PDWORD)(pbyPayloadHead + wPayloadSize); pdwICV = (u32 *)(pbyPayloadHead + wPayloadSize);
// finally, we must invert dwCRC to get the correct answer // finally, we must invert dwCRC to get the correct answer
*pdwICV = cpu_to_le32(~dwICV); *pdwICV = cpu_to_le32(~dwICV);
// RC4 encryption // RC4 encryption
...@@ -335,7 +335,7 @@ static void s_vSWencryption(struct vnt_private *pDevice, ...@@ -335,7 +335,7 @@ static void s_vSWencryption(struct vnt_private *pDevice,
//======================================================================= //=======================================================================
//Append ICV after payload //Append ICV after payload
dwICV = CRCdwGetCrc32Ex(pbyPayloadHead, wPayloadSize, dwICV);//ICV(Payload) dwICV = CRCdwGetCrc32Ex(pbyPayloadHead, wPayloadSize, dwICV);//ICV(Payload)
pdwICV = (PDWORD)(pbyPayloadHead + wPayloadSize); pdwICV = (u32 *)(pbyPayloadHead + wPayloadSize);
// finally, we must invert dwCRC to get the correct answer // finally, we must invert dwCRC to get the correct answer
*pdwICV = cpu_to_le32(~dwICV); *pdwICV = cpu_to_le32(~dwICV);
// RC4 encryption // RC4 encryption
...@@ -1516,12 +1516,12 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType, ...@@ -1516,12 +1516,12 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
dwMICKey1 = *(u32 *)(&pTransmitKey->abyKey[20]); dwMICKey1 = *(u32 *)(&pTransmitKey->abyKey[20]);
} }
else if ((pTransmitKey->dwKeyIndex & AUTHENTICATOR_KEY) != 0) { else if ((pTransmitKey->dwKeyIndex & AUTHENTICATOR_KEY) != 0) {
dwMICKey0 = *(PDWORD)(&pTransmitKey->abyKey[16]); dwMICKey0 = *(u32 *)(&pTransmitKey->abyKey[16]);
dwMICKey1 = *(PDWORD)(&pTransmitKey->abyKey[20]); dwMICKey1 = *(u32 *)(&pTransmitKey->abyKey[20]);
} }
else { else {
dwMICKey0 = *(PDWORD)(&pTransmitKey->abyKey[24]); dwMICKey0 = *(u32 *)(&pTransmitKey->abyKey[24]);
dwMICKey1 = *(PDWORD)(&pTransmitKey->abyKey[28]); dwMICKey1 = *(u32 *)(&pTransmitKey->abyKey[28]);
} }
// DO Software Michael // DO Software Michael
MIC_vInit(dwMICKey0, dwMICKey1); MIC_vInit(dwMICKey0, dwMICKey1);
...@@ -1541,8 +1541,8 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType, ...@@ -1541,8 +1541,8 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
MIC_vAppend(pbyPayloadHead, cbFrameBodySize); MIC_vAppend(pbyPayloadHead, cbFrameBodySize);
pdwMIC_L = (PDWORD)(pbyPayloadHead + cbFrameBodySize); pdwMIC_L = (u32 *)(pbyPayloadHead + cbFrameBodySize);
pdwMIC_R = (PDWORD)(pbyPayloadHead + cbFrameBodySize + 4); pdwMIC_R = (u32 *)(pbyPayloadHead + cbFrameBodySize + 4);
MIC_vGetMIC(pdwMIC_L, pdwMIC_R); MIC_vGetMIC(pdwMIC_L, pdwMIC_R);
MIC_vUnInit(); MIC_vUnInit();
...@@ -1570,13 +1570,13 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType, ...@@ -1570,13 +1570,13 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
if (pDevice->bSoftwareGenCrcErr == true) { if (pDevice->bSoftwareGenCrcErr == true) {
unsigned int cbLen; unsigned int cbLen;
PDWORD pdwCRC; u32 * pdwCRC;
dwCRC = 0xFFFFFFFFL; dwCRC = 0xFFFFFFFFL;
cbLen = cbFrameSize - cbFCSlen; cbLen = cbFrameSize - cbFCSlen;
// calculate CRC, and wrtie CRC value to end of TD // calculate CRC, and wrtie CRC value to end of TD
dwCRC = CRCdwGetCrc32Ex(pbyMacHdr, cbLen, dwCRC); dwCRC = CRCdwGetCrc32Ex(pbyMacHdr, cbLen, dwCRC);
pdwCRC = (PDWORD)(pbyMacHdr + cbLen); pdwCRC = (u32 *)(pbyMacHdr + cbLen);
// finally, we must invert dwCRC to get the correct answer // finally, we must invert dwCRC to get the correct answer
*pdwCRC = ~dwCRC; *pdwCRC = ~dwCRC;
// Force Error // Force Error
...@@ -2359,8 +2359,8 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb) ...@@ -2359,8 +2359,8 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb)
if ((pTransmitKey != NULL) && (pTransmitKey->byCipherSuite == KEY_CTL_TKIP)) { if ((pTransmitKey != NULL) && (pTransmitKey->byCipherSuite == KEY_CTL_TKIP)) {
dwMICKey0 = *(PDWORD)(&pTransmitKey->abyKey[16]); dwMICKey0 = *(u32 *)(&pTransmitKey->abyKey[16]);
dwMICKey1 = *(PDWORD)(&pTransmitKey->abyKey[20]); dwMICKey1 = *(u32 *)(&pTransmitKey->abyKey[20]);
// DO Software Michael // DO Software Michael
MIC_vInit(dwMICKey0, dwMICKey1); MIC_vInit(dwMICKey0, dwMICKey1);
...@@ -2374,8 +2374,8 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb) ...@@ -2374,8 +2374,8 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb)
MIC_vAppend((pbyTxBufferAddr + uLength), cbFrameBodySize); MIC_vAppend((pbyTxBufferAddr + uLength), cbFrameBodySize);
pdwMIC_L = (PDWORD)(pbyTxBufferAddr + uLength + cbFrameBodySize); pdwMIC_L = (u32 *)(pbyTxBufferAddr + uLength + cbFrameBodySize);
pdwMIC_R = (PDWORD)(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();
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
/*--------------------- Static Variables --------------------------*/ /*--------------------- Static Variables --------------------------*/
/* 32-bit CRC table */ /* 32-bit CRC table */
static const DWORD s_adwCrc32Table[256] = { static const u32 s_adwCrc32Table[256] = {
0x00000000L, 0x77073096L, 0xEE0E612CL, 0x990951BAL, 0x00000000L, 0x77073096L, 0xEE0E612CL, 0x990951BAL,
0x076DC419L, 0x706AF48FL, 0xE963A535L, 0x9E6495A3L, 0x076DC419L, 0x706AF48FL, 0xE963A535L, 0x9E6495A3L,
0x0EDB8832L, 0x79DCB8A4L, 0xE0D5E91EL, 0x97D2D988L, 0x0EDB8832L, 0x79DCB8A4L, 0xE0D5E91EL, 0x97D2D988L,
...@@ -132,9 +132,9 @@ static const DWORD s_adwCrc32Table[256] = { ...@@ -132,9 +132,9 @@ static const DWORD s_adwCrc32Table[256] = {
* Return Value: CRC-32 * Return Value: CRC-32
* *
-*/ -*/
DWORD CRCdwCrc32(u8 * pbyData, unsigned int cbByte, DWORD dwCrcSeed) u32 CRCdwCrc32(u8 * pbyData, unsigned int cbByte, u32 dwCrcSeed)
{ {
DWORD dwCrc; u32 dwCrc;
dwCrc = dwCrcSeed; dwCrc = dwCrcSeed;
while (cbByte--) { while (cbByte--) {
...@@ -165,7 +165,7 @@ DWORD CRCdwCrc32(u8 * pbyData, unsigned int cbByte, DWORD dwCrcSeed) ...@@ -165,7 +165,7 @@ DWORD CRCdwCrc32(u8 * pbyData, unsigned int cbByte, DWORD dwCrcSeed)
* Return Value: CRC-32 * Return Value: CRC-32
* *
-*/ -*/
DWORD CRCdwGetCrc32(u8 * pbyData, unsigned int cbByte) u32 CRCdwGetCrc32(u8 * pbyData, unsigned int cbByte)
{ {
return ~CRCdwCrc32(pbyData, cbByte, 0xFFFFFFFFL); return ~CRCdwCrc32(pbyData, cbByte, 0xFFFFFFFFL);
} }
...@@ -191,7 +191,7 @@ DWORD CRCdwGetCrc32(u8 * pbyData, unsigned int cbByte) ...@@ -191,7 +191,7 @@ DWORD CRCdwGetCrc32(u8 * pbyData, unsigned int cbByte)
* Return Value: CRC-32 * Return Value: CRC-32
* *
-*/ -*/
DWORD CRCdwGetCrc32Ex(u8 * pbyData, unsigned int cbByte, DWORD dwPreCRC) u32 CRCdwGetCrc32Ex(u8 * pbyData, unsigned int cbByte, u32 dwPreCRC)
{ {
return CRCdwCrc32(pbyData, cbByte, dwPreCRC); return CRCdwCrc32(pbyData, cbByte, dwPreCRC);
} }
......
...@@ -43,8 +43,8 @@ ...@@ -43,8 +43,8 @@
/*--------------------- Export Functions --------------------------*/ /*--------------------- Export Functions --------------------------*/
DWORD CRCdwCrc32(u8 * pbyData, unsigned int cbByte, DWORD dwCrcSeed); u32 CRCdwCrc32(u8 * pbyData, unsigned int cbByte, u32 dwCrcSeed);
DWORD CRCdwGetCrc32(u8 * pbyData, unsigned int cbByte); u32 CRCdwGetCrc32(u8 * pbyData, unsigned int cbByte);
DWORD CRCdwGetCrc32Ex(u8 * pbyData, unsigned int cbByte, DWORD dwPreCRC); u32 CRCdwGetCrc32Ex(u8 * pbyData, unsigned int cbByte, u32 dwPreCRC);
#endif /* __TCRC_H__ */ #endif /* __TCRC_H__ */
...@@ -98,10 +98,10 @@ u8 ETHbyGetHashIndexByCrc32(u8 * pbyMultiAddr) ...@@ -98,10 +98,10 @@ u8 ETHbyGetHashIndexByCrc32(u8 * pbyMultiAddr)
*/ */
bool ETHbIsBufferCrc32Ok(u8 * pbyBuffer, unsigned int cbFrameLength) bool ETHbIsBufferCrc32Ok(u8 * pbyBuffer, unsigned int cbFrameLength)
{ {
DWORD dwCRC; u32 dwCRC;
dwCRC = CRCdwGetCrc32(pbyBuffer, cbFrameLength - 4); dwCRC = CRCdwGetCrc32(pbyBuffer, cbFrameLength - 4);
if (cpu_to_le32(*((PDWORD)(pbyBuffer + cbFrameLength - 4))) != dwCRC) if (cpu_to_le32(*((u32 *)(pbyBuffer + cbFrameLength - 4))) != dwCRC)
return false; return false;
return true; return true;
} }
......
...@@ -185,7 +185,7 @@ void TKIPvMixKey( ...@@ -185,7 +185,7 @@ void TKIPvMixKey(
u8 * pbyTKey, u8 * pbyTKey,
u8 * pbyTA, u8 * pbyTA,
u16 wTSC15_0, u16 wTSC15_0,
DWORD dwTSC47_16, u32 dwTSC47_16,
u8 * pbyRC4Key u8 * pbyRC4Key
) )
{ {
......
...@@ -50,7 +50,7 @@ void TKIPvMixKey( ...@@ -50,7 +50,7 @@ void TKIPvMixKey(
u8 * pbyTKey, u8 * pbyTKey,
u8 * pbyTA, u8 * pbyTA,
u16 wTSC15_0, u16 wTSC15_0,
DWORD dwTSC47_16, u32 dwTSC47_16,
u8 * pbyRC4Key u8 * pbyRC4Key
); );
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
#define LOWORD(d) ((u16)(d)) #define LOWORD(d) ((u16)(d))
#endif #endif
#if !defined(HIWORD) #if !defined(HIWORD)
#define HIWORD(d) ((u16)((((DWORD)(d)) >> 16) & 0xFFFF)) #define HIWORD(d) ((u16)((((u32)(d)) >> 16) & 0xFFFF))
#endif #endif
#define LODWORD(q) ((q).u.dwLowDword) #define LODWORD(q) ((q).u.dwLowDword)
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
#define MAKEWORD(lb, hb) ((u16)(((u8)(lb)) | (((u16)((u8)(hb))) << 8))) #define MAKEWORD(lb, hb) ((u16)(((u8)(lb)) | (((u16)((u8)(hb))) << 8)))
#endif #endif
#if !defined(MAKEDWORD) #if !defined(MAKEDWORD)
#define MAKEDWORD(lw, hw) ((DWORD)(((u16)(lw)) | (((DWORD)((u16)(hw))) << 16))) #define MAKEDWORD(lw, hw) ((u32)(((u16)(lw)) | (((u32)((u16)(hw))) << 16)))
#endif #endif
#endif /* __TMACRO_H__ */ #endif /* __TMACRO_H__ */
...@@ -35,8 +35,6 @@ ...@@ -35,8 +35,6 @@
/****** Simple typedefs ***************************************************/ /****** Simple typedefs ***************************************************/
typedef u32 DWORD;
/****** Common pointer types ***********************************************/ /****** Common pointer types ***********************************************/
typedef u32 ULONG_PTR; typedef u32 ULONG_PTR;
...@@ -44,6 +42,4 @@ typedef u32 DWORD_PTR; ...@@ -44,6 +42,4 @@ typedef u32 DWORD_PTR;
// boolean pointer // boolean pointer
typedef DWORD * PDWORD;
#endif /* __TTYPE_H__ */ #endif /* __TTYPE_H__ */
...@@ -71,7 +71,7 @@ int wpa_set_keys(struct vnt_private *pDevice, void *ctx) ...@@ -71,7 +71,7 @@ int wpa_set_keys(struct vnt_private *pDevice, void *ctx)
{ {
struct viawget_wpa_param *param = ctx; struct viawget_wpa_param *param = ctx;
struct vnt_manager *pMgmt = &pDevice->vnt_mgmt; struct vnt_manager *pMgmt = &pDevice->vnt_mgmt;
DWORD dwKeyIndex = 0; u32 dwKeyIndex = 0;
u8 abyKey[MAX_KEY_LEN]; u8 abyKey[MAX_KEY_LEN];
u8 abySeq[MAX_KEY_LEN]; u8 abySeq[MAX_KEY_LEN];
u64 KeyRSC; u64 KeyRSC;
...@@ -101,7 +101,7 @@ int wpa_set_keys(struct vnt_private *pDevice, void *ctx) ...@@ -101,7 +101,7 @@ int wpa_set_keys(struct vnt_private *pDevice, void *ctx)
memcpy(&abyKey[0], param->u.wpa_key.key, param->u.wpa_key.key_len); memcpy(&abyKey[0], param->u.wpa_key.key, param->u.wpa_key.key_len);
dwKeyIndex = (DWORD)(param->u.wpa_key.key_index); dwKeyIndex = (u32)(param->u.wpa_key.key_index);
if (param->u.wpa_key.alg_name == WPA_ALG_WEP) { if (param->u.wpa_key.alg_name == WPA_ALG_WEP) {
if (dwKeyIndex > 3) { if (dwKeyIndex > 3) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册