Skip to content

Commit

Permalink
staging: vt6656: replaced custom DWORD definition with u32
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andres More authored and Greg Kroah-Hartman committed Mar 11, 2013
1 parent 3eaca0d commit 52a7e64
Show file tree
Hide file tree
Showing 21 changed files with 210 additions and 214 deletions.
12 changes: 6 additions & 6 deletions drivers/staging/vt6656/aes_ccmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ u8 dot3_table[256] = {

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++);
Expand All @@ -121,9 +121,9 @@ static void xor_128(u8 *a, u8 *b, u8 *out)

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++);
}
Expand Down
6 changes: 3 additions & 3 deletions drivers/staging/vt6656/bssdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,15 @@ typedef struct tagKnownNodeDB {
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];
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/vt6656/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ typedef struct tagSPMKIDCandidateEvent {

typedef struct tagSQuietControl {
bool bEnable;
DWORD dwStartTime;
u32 dwStartTime;
u8 byPeriod;
u16 wDuration;
} SQuietControl, *PSQuietControl;
Expand Down
40 changes: 20 additions & 20 deletions drivers/staging/vt6656/dpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,28 +750,28 @@ int RXbBulkInProcessData(struct vnt_private *pDevice, PRCB pRCB,
// 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]));
}
}

Expand All @@ -785,8 +785,8 @@ int RXbBulkInProcessData(struct vnt_private *pDevice, PRCB pRCB,
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) ||
Expand Down Expand Up @@ -838,12 +838,12 @@ int RXbBulkInProcessData(struct vnt_private *pDevice, PRCB pRCB,
(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;
Expand Down Expand Up @@ -1136,7 +1136,7 @@ static int s_bHandleRxEncryption(struct vnt_private *pDevice, u8 *pbyFrame,
// 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));
Expand Down Expand Up @@ -1235,7 +1235,7 @@ static int s_bHostWepRxEncryption(struct vnt_private *pDevice, u8 *pbyFrame,
// 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) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/vt6656/hostap.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ static int hostap_set_encryption(struct vnt_private *pDevice,
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;
Expand Down
8 changes: 4 additions & 4 deletions drivers/staging/vt6656/key.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ int KeybSetKey(struct vnt_private *pDevice, PSKeyManagement pTable,
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 */
Expand Down Expand Up @@ -340,7 +340,7 @@ int KeybSetKey(struct vnt_private *pDevice, PSKeyManagement pTable,
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 */
Expand Down Expand Up @@ -707,7 +707,7 @@ int KeybSetDefaultKey(struct vnt_private *pDevice, PSKeyManagement pTable,
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 */
Expand Down Expand Up @@ -805,7 +805,7 @@ int KeybSetAllGroupKey(struct vnt_private *pDevice, PSKeyManagement pTable,
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 */
Expand Down
6 changes: 3 additions & 3 deletions drivers/staging/vt6656/key.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ typedef struct tagSKeyItem
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

Expand All @@ -75,7 +75,7 @@ typedef struct tagSKeyTable
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;
Expand Down
Loading

0 comments on commit 52a7e64

Please sign in to comment.