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: Andres More <more.andres@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
static void xor_128(u8 *a, u8 *b, u8 *out)
{
- PDWORD dwPtrA = (PDWORD) a;
- PDWORD dwPtrB = (PDWORD) b;
- PDWORD dwPtrOut = (PDWORD) out;
+ u32 * dwPtrA = (u32 *) a;
+ u32 * dwPtrB = (u32 *) b;
+ u32 * dwPtrOut = (u32 *) out;
(*dwPtrOut++) = (*dwPtrA++) ^ (*dwPtrB++);
(*dwPtrOut++) = (*dwPtrA++) ^ (*dwPtrB++);
static void xor_32(u8 *a, u8 *b, u8 *out)
{
- PDWORD dwPtrA = (PDWORD) a;
- PDWORD dwPtrB = (PDWORD) b;
- PDWORD dwPtrOut = (PDWORD) out;
+ u32 * dwPtrA = (u32 *) a;
+ u32 * dwPtrB = (u32 *) b;
+ u32 * dwPtrOut = (u32 *) out;
(*dwPtrOut++) = (*dwPtrA++) ^ (*dwPtrB++);
}
u8 byAuthSequence;
unsigned long ulLastRxJiffer;
u8 bySuppRate;
- DWORD dwFlags;
+ u32 dwFlags;
u16 wEnQueueCnt;
bool bOnFly;
unsigned long long KeyRSC;
u8 byKeyIndex;
- DWORD dwKeyIndex;
+ u32 dwKeyIndex;
u8 byCipherSuite;
- DWORD dwTSC47_16;
+ u32 dwTSC47_16;
u16 wTSC15_0;
unsigned int uWepKeyLength;
u8 abyWepKey[WLAN_WEPMAX_KEYLEN];
typedef struct tagSQuietControl {
bool bEnable;
- DWORD dwStartTime;
+ u32 dwStartTime;
u8 byPeriod;
u16 wDuration;
} SQuietControl, *PSQuietControl;
// Soft MIC
if ((pKey != NULL) && (pKey->byCipherSuite == KEY_CTL_TKIP)) {
if (bIsWEP) {
- PDWORD pdwMIC_L;
- PDWORD pdwMIC_R;
- DWORD dwMIC_Priority;
- DWORD dwMICKey0 = 0, dwMICKey1 = 0;
- DWORD dwLocalMIC_L = 0;
- DWORD dwLocalMIC_R = 0;
+ u32 * pdwMIC_L;
+ u32 * pdwMIC_R;
+ u32 dwMIC_Priority;
+ u32 dwMICKey0 = 0, dwMICKey1 = 0;
+ u32 dwLocalMIC_L = 0;
+ u32 dwLocalMIC_R = 0;
if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) {
- dwMICKey0 = cpu_to_le32(*(PDWORD)(&pKey->abyKey[24]));
- dwMICKey1 = cpu_to_le32(*(PDWORD)(&pKey->abyKey[28]));
+ dwMICKey0 = cpu_to_le32(*(u32 *)(&pKey->abyKey[24]));
+ dwMICKey1 = cpu_to_le32(*(u32 *)(&pKey->abyKey[28]));
}
else {
if (pMgmt->eAuthenMode == WMAC_AUTH_WPANONE) {
- dwMICKey0 = cpu_to_le32(*(PDWORD)(&pKey->abyKey[16]));
- dwMICKey1 = cpu_to_le32(*(PDWORD)(&pKey->abyKey[20]));
+ dwMICKey0 = cpu_to_le32(*(u32 *)(&pKey->abyKey[16]));
+ dwMICKey1 = cpu_to_le32(*(u32 *)(&pKey->abyKey[20]));
} else if ((pKey->dwKeyIndex & BIT28) == 0) {
- dwMICKey0 = cpu_to_le32(*(PDWORD)(&pKey->abyKey[16]));
- dwMICKey1 = cpu_to_le32(*(PDWORD)(&pKey->abyKey[20]));
+ dwMICKey0 = cpu_to_le32(*(u32 *)(&pKey->abyKey[16]));
+ dwMICKey1 = cpu_to_le32(*(u32 *)(&pKey->abyKey[20]));
} else {
- dwMICKey0 = cpu_to_le32(*(PDWORD)(&pKey->abyKey[24]));
- dwMICKey1 = cpu_to_le32(*(PDWORD)(&pKey->abyKey[28]));
+ dwMICKey0 = cpu_to_le32(*(u32 *)(&pKey->abyKey[24]));
+ dwMICKey1 = cpu_to_le32(*(u32 *)(&pKey->abyKey[28]));
}
}
MIC_vGetMIC(&dwLocalMIC_L, &dwLocalMIC_R);
MIC_vUnInit();
- pdwMIC_L = (PDWORD)(skb->data + 8 + FrameSize);
- pdwMIC_R = (PDWORD)(skb->data + 8 + FrameSize + 4);
+ pdwMIC_L = (u32 *)(skb->data + 8 + FrameSize);
+ pdwMIC_R = (u32 *)(skb->data + 8 + FrameSize + 4);
if ((cpu_to_le32(*pdwMIC_L) != dwLocalMIC_L) || (cpu_to_le32(*pdwMIC_R) != dwLocalMIC_R) ||
(pKey->byCipherSuite == KEY_CTL_CCMP))) {
if (bIsWEP) {
u16 wLocalTSC15_0 = 0;
- DWORD dwLocalTSC47_16 = 0;
+ u32 dwLocalTSC47_16 = 0;
unsigned long long RSC = 0;
// endian issues
RSC = *((unsigned long long *) &(pKey->KeyRSC));
wLocalTSC15_0 = (u16) RSC;
- dwLocalTSC47_16 = (DWORD) (RSC>>16);
+ dwLocalTSC47_16 = (u32) (RSC>>16);
RSC = dwRxTSC47_16;
RSC <<= 16;
// TKIP/AES
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);
if (byDecMode == KEY_CTL_TKIP) {
*pwRxTSC15_0 = cpu_to_le16(MAKEWORD(*(pbyIV+2), *pbyIV));
// TKIP/AES
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);
if (byDecMode == KEY_CTL_TKIP) {
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) {
pDevice->byKeyIndex = (u8)dwKeyIndex;
pDevice->bTransmitKey = true;
if (uKeyLength == WLAN_WEP104_KEYLEN)
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)
pKey->KeyRSC = 0; /* RSC set by NIC */
if (uKeyLength == WLAN_WEP104_KEYLEN)
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)
pKey->KeyRSC = 0; /* RSC set by NIC */
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)
pKey->KeyRSC = 0; /* RSC set by NIC */
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)
pKey->KeyRSC = 0; /* RSC set by NIC */
u32 uKeyLength;
u8 abyKey[MAX_KEY_LEN];
u64 KeyRSC;
- DWORD dwTSC47_16;
+ u32 dwTSC47_16;
u16 wTSC15_0;
u8 byCipherSuite;
u8 byReserved0;
- DWORD dwKeyIndex;
+ u32 dwKeyIndex;
void *pvKeyTable;
} SKeyItem, *PSKeyItem; //64
u8 byReserved0[2]; //8
SKeyItem PairwiseKey;
SKeyItem GroupKey[MAX_GROUP_KEY]; //64*5 = 320, 320+8=328
- DWORD dwGTKeyIndex; // GroupTransmitKey Index
+ u32 dwGTKeyIndex; // GroupTransmitKey Index
bool bInUse;
u16 wKeyCtl;
bool bSoftWEP;
// USB counter
//
typedef struct tagSUSBCounter {
- DWORD dwCrc;
+ u32 dwCrc;
} SUSBCounter, *PSUSBCounter;
// e.g. "interface 1"
signed long ifType;
signed long ifMtu;
- DWORD ifSpeed;
+ u32 ifSpeed;
u8 ifPhysAddress[ETH_ALEN];
signed long ifAdminStatus;
signed long ifOperStatus;
- DWORD ifLastChange;
- DWORD ifInOctets;
- DWORD ifInUcastPkts;
- DWORD ifInNUcastPkts;
- DWORD ifInDiscards;
- DWORD ifInErrors;
- DWORD ifInUnknownProtos;
- DWORD ifOutOctets;
- DWORD ifOutUcastPkts;
- DWORD ifOutNUcastPkts;
- DWORD ifOutDiscards;
- DWORD ifOutErrors;
- DWORD ifOutQLen;
- DWORD ifSpecific;
+ u32 ifLastChange;
+ u32 ifInOctets;
+ u32 ifInUcastPkts;
+ u32 ifInNUcastPkts;
+ u32 ifInDiscards;
+ u32 ifInErrors;
+ u32 ifInUnknownProtos;
+ u32 ifOutOctets;
+ u32 ifOutUcastPkts;
+ u32 ifOutNUcastPkts;
+ u32 ifOutDiscards;
+ u32 ifOutErrors;
+ u32 ifOutQLen;
+ u32 ifSpecific;
} SMib2Counter, *PSMib2Counter;
// Value in the ifType entry
//
typedef struct tagSRmonCounter {
signed long etherStatsIndex;
- DWORD etherStatsDataSource;
- DWORD etherStatsDropEvents;
- DWORD etherStatsOctets;
- DWORD etherStatsPkts;
- DWORD etherStatsBroadcastPkts;
- DWORD etherStatsMulticastPkts;
- DWORD etherStatsCRCAlignErrors;
- DWORD etherStatsUndersizePkts;
- DWORD etherStatsOversizePkts;
- DWORD etherStatsFragments;
- DWORD etherStatsJabbers;
- DWORD etherStatsCollisions;
- DWORD etherStatsPkt64Octets;
- DWORD etherStatsPkt65to127Octets;
- DWORD etherStatsPkt128to255Octets;
- DWORD etherStatsPkt256to511Octets;
- DWORD etherStatsPkt512to1023Octets;
- DWORD etherStatsPkt1024to1518Octets;
- DWORD etherStatsOwners;
- DWORD etherStatsStatus;
+ u32 etherStatsDataSource;
+ u32 etherStatsDropEvents;
+ u32 etherStatsOctets;
+ u32 etherStatsPkts;
+ u32 etherStatsBroadcastPkts;
+ u32 etherStatsMulticastPkts;
+ u32 etherStatsCRCAlignErrors;
+ u32 etherStatsUndersizePkts;
+ u32 etherStatsOversizePkts;
+ u32 etherStatsFragments;
+ u32 etherStatsJabbers;
+ u32 etherStatsCollisions;
+ u32 etherStatsPkt64Octets;
+ u32 etherStatsPkt65to127Octets;
+ u32 etherStatsPkt128to255Octets;
+ u32 etherStatsPkt256to511Octets;
+ u32 etherStatsPkt512to1023Octets;
+ u32 etherStatsPkt1024to1518Octets;
+ u32 etherStatsOwners;
+ u32 etherStatsStatus;
} SRmonCounter, *PSRmonCounter;
//
typedef struct tagSISRCounters {
unsigned long Length;
- DWORD dwIsrTx0OK;
- DWORD dwIsrAC0TxOK;
- DWORD dwIsrBeaconTxOK;
- DWORD dwIsrRx0OK;
- DWORD dwIsrTBTTInt;
- DWORD dwIsrSTIMERInt;
- DWORD dwIsrWatchDog;
- DWORD dwIsrUnrecoverableError;
- DWORD dwIsrSoftInterrupt;
- DWORD dwIsrMIBNearfull;
- DWORD dwIsrRxNoBuf;
-
- DWORD dwIsrUnknown; // unknown interrupt count
-
- DWORD dwIsrRx1OK;
- DWORD dwIsrATIMTxOK;
- DWORD dwIsrSYNCTxOK;
- DWORD dwIsrCFPEnd;
- DWORD dwIsrATIMEnd;
- DWORD dwIsrSYNCFlushOK;
- DWORD dwIsrSTIMER1Int;
+ u32 dwIsrTx0OK;
+ u32 dwIsrAC0TxOK;
+ u32 dwIsrBeaconTxOK;
+ u32 dwIsrRx0OK;
+ u32 dwIsrTBTTInt;
+ u32 dwIsrSTIMERInt;
+ u32 dwIsrWatchDog;
+ u32 dwIsrUnrecoverableError;
+ u32 dwIsrSoftInterrupt;
+ u32 dwIsrMIBNearfull;
+ u32 dwIsrRxNoBuf;
+
+ u32 dwIsrUnknown; // unknown interrupt count
+
+ u32 dwIsrRx1OK;
+ u32 dwIsrATIMTxOK;
+ u32 dwIsrSYNCTxOK;
+ u32 dwIsrCFPEnd;
+ u32 dwIsrATIMEnd;
+ u32 dwIsrSYNCFlushOK;
+ u32 dwIsrSTIMER1Int;
/////////////////////////////////////
} SISRCounters, *PSISRCounters;
// RSR status count
//
- DWORD dwRsrFrmAlgnErr;
- DWORD dwRsrErr;
- DWORD dwRsrCRCErr;
- DWORD dwRsrCRCOk;
- DWORD dwRsrBSSIDOk;
- DWORD dwRsrADDROk;
- DWORD dwRsrBCNSSIDOk;
- DWORD dwRsrLENErr;
- DWORD dwRsrTYPErr;
-
- DWORD dwNewRsrDECRYPTOK;
- DWORD dwNewRsrCFP;
- DWORD dwNewRsrUTSF;
- DWORD dwNewRsrHITAID;
- DWORD dwNewRsrHITAID0;
-
- DWORD dwRsrLong;
- DWORD dwRsrRunt;
-
- DWORD dwRsrRxControl;
- DWORD dwRsrRxData;
- DWORD dwRsrRxManage;
-
- DWORD dwRsrRxPacket;
- DWORD dwRsrRxOctet;
- DWORD dwRsrBroadcast;
- DWORD dwRsrMulticast;
- DWORD dwRsrDirected;
+ u32 dwRsrFrmAlgnErr;
+ u32 dwRsrErr;
+ u32 dwRsrCRCErr;
+ u32 dwRsrCRCOk;
+ u32 dwRsrBSSIDOk;
+ u32 dwRsrADDROk;
+ u32 dwRsrBCNSSIDOk;
+ u32 dwRsrLENErr;
+ u32 dwRsrTYPErr;
+
+ u32 dwNewRsrDECRYPTOK;
+ u32 dwNewRsrCFP;
+ u32 dwNewRsrUTSF;
+ u32 dwNewRsrHITAID;
+ u32 dwNewRsrHITAID0;
+
+ u32 dwRsrLong;
+ u32 dwRsrRunt;
+
+ u32 dwRsrRxControl;
+ u32 dwRsrRxData;
+ u32 dwRsrRxManage;
+
+ u32 dwRsrRxPacket;
+ u32 dwRsrRxOctet;
+ u32 dwRsrBroadcast;
+ u32 dwRsrMulticast;
+ u32 dwRsrDirected;
// 64-bit OID
unsigned long long ullRsrOK;
unsigned long long ullRxMulticastFrames;
unsigned long long ullRxDirectedFrames;
- DWORD dwRsrRxFragment;
- DWORD dwRsrRxFrmLen64;
- DWORD dwRsrRxFrmLen65_127;
- DWORD dwRsrRxFrmLen128_255;
- DWORD dwRsrRxFrmLen256_511;
- DWORD dwRsrRxFrmLen512_1023;
- DWORD dwRsrRxFrmLen1024_1518;
+ u32 dwRsrRxFragment;
+ u32 dwRsrRxFrmLen64;
+ u32 dwRsrRxFrmLen65_127;
+ u32 dwRsrRxFrmLen128_255;
+ u32 dwRsrRxFrmLen256_511;
+ u32 dwRsrRxFrmLen512_1023;
+ u32 dwRsrRxFrmLen1024_1518;
// TSR status count
//
- DWORD dwTsrTotalRetry; // total collision retry count
- DWORD dwTsrOnceRetry; // this packet only occur one collision
- DWORD dwTsrMoreThanOnceRetry; // this packet occur more than one collision
- DWORD dwTsrRetry; // this packet has ever occur collision,
+ u32 dwTsrTotalRetry; // total collision retry count
+ u32 dwTsrOnceRetry; // this packet only occur one collision
+ u32 dwTsrMoreThanOnceRetry; // this packet occur more than one collision
+ u32 dwTsrRetry; // this packet has ever occur collision,
// that is (dwTsrOnceCollision0 + dwTsrMoreThanOnceCollision0)
- DWORD dwTsrACKData;
- DWORD dwTsrErr;
- DWORD dwAllTsrOK;
- DWORD dwTsrRetryTimeout;
- DWORD dwTsrTransmitTimeout;
-
- DWORD dwTsrTxPacket;
- DWORD dwTsrTxOctet;
- DWORD dwTsrBroadcast;
- DWORD dwTsrMulticast;
- DWORD dwTsrDirected;
+ u32 dwTsrACKData;
+ u32 dwTsrErr;
+ u32 dwAllTsrOK;
+ u32 dwTsrRetryTimeout;
+ u32 dwTsrTransmitTimeout;
+
+ u32 dwTsrTxPacket;
+ u32 dwTsrTxOctet;
+ u32 dwTsrBroadcast;
+ u32 dwTsrMulticast;
+ u32 dwTsrDirected;
// RD/TD count
- DWORD dwCntRxFrmLength;
- DWORD dwCntTxBufLength;
+ u32 dwCntRxFrmLength;
+ u32 dwCntTxBufLength;
u8 abyCntRxPattern[16];
u8 abyCntTxPattern[16];
// Software check....
- DWORD dwCntRxDataErr; // rx buffer data software compare CRC err count
- DWORD dwCntDecryptErr; // rx buffer data software compare CRC err count
- DWORD dwCntRxICVErr; // rx buffer data software compare CRC err count
+ u32 dwCntRxDataErr; // rx buffer data software compare CRC err count
+ u32 dwCntDecryptErr; // rx buffer data software compare CRC err count
+ u32 dwCntRxICVErr; // rx buffer data software compare CRC err count
// 64-bit OID
unsigned long long ullTxDirectedBytes;
// for autorate
- DWORD dwTxOk[MAX_RATE+1];
- DWORD dwTxFail[MAX_RATE+1];
- DWORD dwTxRetryCount[8];
+ u32 dwTxOk[MAX_RATE+1];
+ u32 dwTxFail[MAX_RATE+1];
+ u32 dwTxRetryCount[8];
STxPktInfo abyTxPktInfo[16];
* Date: Sep 4, 2002
*
* Functions:
- * s_dwGetUINT32 - Convert from u8[] to DWORD in a portable way
- * s_vPutUINT32 - Convert from DWORD to u8[] in a portable way
+ * s_dwGetUINT32 - Convert from u8[] to u32 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_vSetKey - Set the key.
* MIC_vInit - Set the key.
/*--------------------- Static Functions --------------------------*/
/*
- * static DWORD s_dwGetUINT32(u8 * p); Get DWORD from
+ * static u32 s_dwGetUINT32(u8 * p); Get u32 from
* 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
*/
static void s_vClear(void); /* Clear the internal message,
* resets the object to the
* 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
* message */
/*--------------------- Export Variables --------------------------*/
-static DWORD L, R; /* Current state */
-static DWORD K0, K1; /* Key */
-static DWORD M; /* Message accumulator (single word) */
+static u32 L, R; /* Current state */
+static u32 K0, K1; /* Key */
+static u32 M; /* Message accumulator (single word) */
static unsigned int nBytesInM; /* # bytes in M */
/*--------------------- Export Functions --------------------------*/
/*
-static DWORD s_dwGetUINT32 (u8 * p)
-// Convert from u8[] to DWORD in a portable way
+static u32 s_dwGetUINT32 (u8 * p)
+// Convert from u8[] to u32 in a portable way
{
- DWORD res = 0;
+ u32 res = 0;
unsigned int i;
for (i = 0; i < 4; i++)
res |= (*p++) << (8*i);
return res;
}
-static void s_vPutUINT32(u8 *p, DWORD val)
-// Convert from DWORD to u8[] in a portable way
+static void s_vPutUINT32(u8 *p, u32 val)
+// Convert from u32 to u8[] in a portable way
{
unsigned int i;
for (i = 0; i < 4; i++) {
M = 0;
}
-static void s_vSetKey(DWORD dwK0, DWORD dwK1)
+static void s_vSetKey(u32 dwK0, u32 dwK1)
{
/* Set the key */
K0 = dwK0;
}
}
-void MIC_vInit(DWORD dwK0, DWORD dwK1)
+void MIC_vInit(u32 dwK0, u32 dwK1)
{
/* Set the key */
s_vSetKey(dwK0, dwK1);
}
}
-void MIC_vGetMIC(PDWORD pdwL, PDWORD pdwR)
+void MIC_vGetMIC(u32 * pdwL, u32 * pdwR)
{
/* Append the minimum padding */
s_vAppendByte(0x5a);
/*--------------------- Export Types ------------------------------*/
-void MIC_vInit(DWORD dwK0, DWORD dwK1);
+void MIC_vInit(u32 dwK0, u32 dwK1);
void MIC_vUnInit(void);
// Get the MIC result. Destination should accept 8 bytes of result.
// This also resets the message to empty.
-void MIC_vGetMIC(PDWORD pdwL, PDWORD pdwR);
+void MIC_vGetMIC(u32 * pdwL, u32 * pdwR);
/*--------------------- Export Macros ------------------------------*/
case RF_AIROHA7230:
{
- DWORD dwMax7230Pwr;
+ u32 dwMax7230Pwr;
if (uRATE <= RATE_11M) { //RobertYu:20060426, for better 11b mask
bResult &= IFRFbWriteEmbedded(pDevice, 0x111BB900+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW);
case RF_VT3226: //RobertYu:20051111, VT3226C0 and before
{
- DWORD dwVT3226Pwr;
+ u32 dwVT3226Pwr;
if (pDevice->byCurPwr >= VT3226_PWR_IDX_LEN)
return false;
case RF_VT3226D0: //RobertYu:20051228
{
- DWORD dwVT3226Pwr;
+ u32 dwVT3226Pwr;
if (pDevice->byCurPwr >= VT3226_PWR_IDX_LEN)
return false;
//{{RobertYu:20060609
case RF_VT3342A0:
{
- DWORD dwVT3342Pwr;
+ u32 dwVT3342Pwr;
if (pDevice->byCurPwr >= VT3342_PWR_IDX_LEN)
return false;
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;
typedef struct _CMD_SET_TSFTBTT
u8 byBBCR10;
u8 byBB_BBType; //CR88
u8 byMAC_BBType;
- DWORD dwRSPINF_b_1;
- DWORD dwRSPINF_b_2;
- DWORD dwRSPINF_b_55;
- DWORD dwRSPINF_b_11;
+ u32 dwRSPINF_b_1;
+ u32 dwRSPINF_b_2;
+ u32 dwRSPINF_b_55;
+ u32 dwRSPINF_b_11;
u16 wRSPINF_a[9];
} CMD_CHANGE_BBTYPE, *PCMD_CHANGE_BBTYPE;
//=======================================================================
// Append ICV after 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
*pdwICV = cpu_to_le32(~dwICV);
// RC4 encryption
//=======================================================================
//Append ICV after 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
*pdwICV = cpu_to_le32(~dwICV);
// RC4 encryption
dwMICKey1 = *(u32 *)(&pTransmitKey->abyKey[20]);
}
else if ((pTransmitKey->dwKeyIndex & AUTHENTICATOR_KEY) != 0) {
- dwMICKey0 = *(PDWORD)(&pTransmitKey->abyKey[16]);
- dwMICKey1 = *(PDWORD)(&pTransmitKey->abyKey[20]);
+ dwMICKey0 = *(u32 *)(&pTransmitKey->abyKey[16]);
+ dwMICKey1 = *(u32 *)(&pTransmitKey->abyKey[20]);
}
else {
- dwMICKey0 = *(PDWORD)(&pTransmitKey->abyKey[24]);
- dwMICKey1 = *(PDWORD)(&pTransmitKey->abyKey[28]);
+ dwMICKey0 = *(u32 *)(&pTransmitKey->abyKey[24]);
+ dwMICKey1 = *(u32 *)(&pTransmitKey->abyKey[28]);
}
// DO Software Michael
MIC_vInit(dwMICKey0, dwMICKey1);
MIC_vAppend(pbyPayloadHead, cbFrameBodySize);
- pdwMIC_L = (PDWORD)(pbyPayloadHead + cbFrameBodySize);
- pdwMIC_R = (PDWORD)(pbyPayloadHead + cbFrameBodySize + 4);
+ pdwMIC_L = (u32 *)(pbyPayloadHead + cbFrameBodySize);
+ pdwMIC_R = (u32 *)(pbyPayloadHead + cbFrameBodySize + 4);
MIC_vGetMIC(pdwMIC_L, pdwMIC_R);
MIC_vUnInit();
if (pDevice->bSoftwareGenCrcErr == true) {
unsigned int cbLen;
- PDWORD pdwCRC;
+ u32 * pdwCRC;
dwCRC = 0xFFFFFFFFL;
cbLen = cbFrameSize - cbFCSlen;
// calculate CRC, and wrtie CRC value to end of TD
dwCRC = CRCdwGetCrc32Ex(pbyMacHdr, cbLen, dwCRC);
- pdwCRC = (PDWORD)(pbyMacHdr + cbLen);
+ pdwCRC = (u32 *)(pbyMacHdr + cbLen);
// finally, we must invert dwCRC to get the correct answer
*pdwCRC = ~dwCRC;
// Force Error
if ((pTransmitKey != NULL) && (pTransmitKey->byCipherSuite == KEY_CTL_TKIP)) {
- dwMICKey0 = *(PDWORD)(&pTransmitKey->abyKey[16]);
- dwMICKey1 = *(PDWORD)(&pTransmitKey->abyKey[20]);
+ dwMICKey0 = *(u32 *)(&pTransmitKey->abyKey[16]);
+ dwMICKey1 = *(u32 *)(&pTransmitKey->abyKey[20]);
// DO Software Michael
MIC_vInit(dwMICKey0, dwMICKey1);
MIC_vAppend((pbyTxBufferAddr + uLength), cbFrameBodySize);
- pdwMIC_L = (PDWORD)(pbyTxBufferAddr + uLength + cbFrameBodySize);
- pdwMIC_R = (PDWORD)(pbyTxBufferAddr + uLength + cbFrameBodySize + 4);
+ pdwMIC_L = (u32 *)(pbyTxBufferAddr + uLength + cbFrameBodySize);
+ pdwMIC_R = (u32 *)(pbyTxBufferAddr + uLength + cbFrameBodySize + 4);
MIC_vGetMIC(pdwMIC_L, pdwMIC_R);
MIC_vUnInit();
/*--------------------- Static Variables --------------------------*/
/* 32-bit CRC table */
-static const DWORD s_adwCrc32Table[256] = {
+static const u32 s_adwCrc32Table[256] = {
0x00000000L, 0x77073096L, 0xEE0E612CL, 0x990951BAL,
0x076DC419L, 0x706AF48FL, 0xE963A535L, 0x9E6495A3L,
0x0EDB8832L, 0x79DCB8A4L, 0xE0D5E91EL, 0x97D2D988L,
* 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;
while (cbByte--) {
* Return Value: CRC-32
*
-*/
-DWORD CRCdwGetCrc32(u8 * pbyData, unsigned int cbByte)
+u32 CRCdwGetCrc32(u8 * pbyData, unsigned int cbByte)
{
return ~CRCdwCrc32(pbyData, cbByte, 0xFFFFFFFFL);
}
* 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);
}
/*--------------------- Export Functions --------------------------*/
-DWORD CRCdwCrc32(u8 * pbyData, unsigned int cbByte, DWORD dwCrcSeed);
-DWORD CRCdwGetCrc32(u8 * pbyData, unsigned int cbByte);
-DWORD CRCdwGetCrc32Ex(u8 * pbyData, unsigned int cbByte, DWORD dwPreCRC);
+u32 CRCdwCrc32(u8 * pbyData, unsigned int cbByte, u32 dwCrcSeed);
+u32 CRCdwGetCrc32(u8 * pbyData, unsigned int cbByte);
+u32 CRCdwGetCrc32Ex(u8 * pbyData, unsigned int cbByte, u32 dwPreCRC);
#endif /* __TCRC_H__ */
*/
bool ETHbIsBufferCrc32Ok(u8 * pbyBuffer, unsigned int cbFrameLength)
{
- DWORD dwCRC;
+ u32 dwCRC;
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 true;
}
u8 * pbyTKey,
u8 * pbyTA,
u16 wTSC15_0,
- DWORD dwTSC47_16,
+ u32 dwTSC47_16,
u8 * pbyRC4Key
)
{
u8 * pbyTKey,
u8 * pbyTA,
u16 wTSC15_0,
- DWORD dwTSC47_16,
+ u32 dwTSC47_16,
u8 * pbyRC4Key
);
#define LOWORD(d) ((u16)(d))
#endif
#if !defined(HIWORD)
-#define HIWORD(d) ((u16)((((DWORD)(d)) >> 16) & 0xFFFF))
+#define HIWORD(d) ((u16)((((u32)(d)) >> 16) & 0xFFFF))
#endif
#define LODWORD(q) ((q).u.dwLowDword)
#define MAKEWORD(lb, hb) ((u16)(((u8)(lb)) | (((u16)((u8)(hb))) << 8)))
#endif
#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 /* __TMACRO_H__ */
/****** Simple typedefs ***************************************************/
-typedef u32 DWORD;
-
/****** Common pointer types ***********************************************/
typedef u32 ULONG_PTR;
// boolean pointer
-typedef DWORD * PDWORD;
-
#endif /* __TTYPE_H__ */
{
struct viawget_wpa_param *param = ctx;
struct vnt_manager *pMgmt = &pDevice->vnt_mgmt;
- DWORD dwKeyIndex = 0;
+ u32 dwKeyIndex = 0;
u8 abyKey[MAX_KEY_LEN];
u8 abySeq[MAX_KEY_LEN];
u64 KeyRSC;
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 (dwKeyIndex > 3) {