Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 162327
b: refs/heads/master
c: 3e36259
h: refs/heads/master
i:
  162325: 9e7a642
  162323: 561a8db
  162319: 3e0d5fe
v: v3
  • Loading branch information
Jim Lieb authored and Greg Kroah-Hartman committed Sep 15, 2009
1 parent 8691338 commit 3aeaa1e
Show file tree
Hide file tree
Showing 25 changed files with 169 additions and 264 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 51b6d9c299f10780b3093d3748257ecc4ae7340d
refs/heads/master: 3e362598fd3c7b8729afd0383a4cdf08849b020e
23 changes: 11 additions & 12 deletions trunk/drivers/staging/vt6656/aes_ccmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
*
*/

#include "umem.h"
#include "device.h"
#include "80211hdr.h"

Expand Down Expand Up @@ -278,7 +277,7 @@ int ii,jj,kk;
pbyPayload = pbyIV + 8; //IV-length

abyNonce[0] = 0x00; //now is 0, if Qos here will be priority
MEMvCopy(&(abyNonce[1]), pMACHeader->abyAddr2, U_ETHER_ADDR_LEN);
memcpy(&(abyNonce[1]), pMACHeader->abyAddr2, U_ETHER_ADDR_LEN);
abyNonce[7] = pbyIV[7];
abyNonce[8] = pbyIV[6];
abyNonce[9] = pbyIV[5];
Expand All @@ -288,7 +287,7 @@ int ii,jj,kk;

//MIC_IV
MIC_IV[0] = 0x59;
MEMvCopy(&(MIC_IV[1]), &(abyNonce[0]), 13);
memcpy(&(MIC_IV[1]), &(abyNonce[0]), 13);
MIC_IV[14] = (BYTE)(wPayloadSize >> 8);
MIC_IV[15] = (BYTE)(wPayloadSize & 0xff);

Expand All @@ -300,16 +299,16 @@ int ii,jj,kk;
byTmp = (BYTE)(pMACHeader->wFrameCtl >> 8);
byTmp &= 0x87;
MIC_HDR1[3] = byTmp | 0x40;
MEMvCopy(&(MIC_HDR1[4]), pMACHeader->abyAddr1, U_ETHER_ADDR_LEN);
MEMvCopy(&(MIC_HDR1[10]), pMACHeader->abyAddr2, U_ETHER_ADDR_LEN);
memcpy(&(MIC_HDR1[4]), pMACHeader->abyAddr1, U_ETHER_ADDR_LEN);
memcpy(&(MIC_HDR1[10]), pMACHeader->abyAddr2, U_ETHER_ADDR_LEN);

//MIC_HDR2
MEMvCopy(&(MIC_HDR2[0]), pMACHeader->abyAddr3, U_ETHER_ADDR_LEN);
memcpy(&(MIC_HDR2[0]), pMACHeader->abyAddr3, U_ETHER_ADDR_LEN);
byTmp = (BYTE)(pMACHeader->wSeqCtl & 0xff);
MIC_HDR2[6] = byTmp & 0x0f;
MIC_HDR2[7] = 0;
if ( bA4 ) {
MEMvCopy(&(MIC_HDR2[8]), pMACHeader->abyAddr4, U_ETHER_ADDR_LEN);
memcpy(&(MIC_HDR2[8]), pMACHeader->abyAddr4, U_ETHER_ADDR_LEN);
} else {
MIC_HDR2[8] = 0x00;
MIC_HDR2[9] = 0x00;
Expand All @@ -334,7 +333,7 @@ int ii,jj,kk;

wCnt = 1;
abyCTRPLD[0] = 0x01;
MEMvCopy(&(abyCTRPLD[1]), &(abyNonce[0]), 13);
memcpy(&(abyCTRPLD[1]), &(abyNonce[0]), 13);

for(jj=wPayloadSize; jj>16; jj=jj-16) {

Expand All @@ -351,13 +350,13 @@ int ii,jj,kk;
}
AESv128(pbyRxKey,abyTmp,abyMIC);

MEMvCopy(pbyPayload, abyPlainText, 16);
memcpy(pbyPayload, abyPlainText, 16);
wCnt++;
pbyPayload += 16;
} //for wPayloadSize

//last payload
MEMvCopy(&(abyLastCipher[0]), pbyPayload, jj);
memcpy(&(abyLastCipher[0]), pbyPayload, jj);
for ( ii=jj; ii<16; ii++ ) {
abyLastCipher[ii] = 0x00;
}
Expand All @@ -369,7 +368,7 @@ int ii,jj,kk;
for ( kk=0; kk<16; kk++ ) {
abyPlainText[kk] = abyTmp[kk] ^ abyLastCipher[kk];
}
MEMvCopy(pbyPayload, abyPlainText, jj);
memcpy(pbyPayload, abyPlainText, jj);
pbyPayload += jj;

//for MIC calculation
Expand All @@ -394,7 +393,7 @@ int ii,jj,kk;
//=>above is the dec-MIC from packet
//--------------------------------------------

if ( MEMEqualMemory(abyMIC,abyTmp,8) ) {
if ( !memcmp(abyMIC,abyTmp,8) ) {
return TRUE;
} else {
return FALSE;
Expand Down
13 changes: 6 additions & 7 deletions trunk/drivers/staging/vt6656/bssdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
#include "card.h"
#include "mac.h"
#include "wpa2.h"
#include "umem.h"
#include "tbit.h"
#include "control.h"
#include "rndis.h"
Expand Down Expand Up @@ -170,7 +169,7 @@ BSSpSearchBSSList(
if (IS_ETH_ADDRESS_EQUAL(pCurrBSS->abyBSSID, pbyBSSID)) {
if (pSSID != NULL) {
// compare ssid
if (MEMEqualMemory(pSSID->abySSID,
if ( !memcmp(pSSID->abySSID,
((PWLAN_IE_SSID)pCurrBSS->abySSID)->abySSID,
pSSID->len)) {
if ((pMgmt->eConfigMode == WMAC_CONFIG_AUTO) ||
Expand Down Expand Up @@ -208,7 +207,7 @@ BSSpSearchBSSList(

if (pSSID != NULL) {
// matched SSID
if (!MEMEqualMemory(pSSID->abySSID,
if (memcmp(pSSID->abySSID,
((PWLAN_IE_SSID)pCurrBSS->abySSID)->abySSID,
pSSID->len) ||
(pSSID->len != ((PWLAN_IE_SSID)pCurrBSS->abySSID)->len)) {
Expand Down Expand Up @@ -275,8 +274,8 @@ pDevice->bSameBSSMaxNum = jj;
pSelect->bSelected = TRUE;
if (pDevice->bRoaming == FALSE) {
// Einsn Add @20070907
ZERO_MEMORY(pbyDesireSSID, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
MEMvCopy(pbyDesireSSID,pCurrBSS->abySSID,WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1) ;
memset(pbyDesireSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
memcpy(pbyDesireSSID,pCurrBSS->abySSID,WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1) ;
}

return(pSelect);
Expand Down Expand Up @@ -518,7 +517,7 @@ BSSbInsertToBSSList (
}
}
if ((bIs802_1x == TRUE) && (pSSID->len == ((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->len) &&
(MEMEqualMemory(pSSID->abySSID, ((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySSID, pSSID->len))) {
( !memcmp(pSSID->abySSID, ((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySSID, pSSID->len))) {

bAdd_PMKID_Candidate((HANDLE)pDevice, pBSSList->abyBSSID, &pBSSList->sRSNCapObj);

Expand Down Expand Up @@ -587,7 +586,7 @@ BSSbInsertToBSSList (
pBSSList->uIELength = uIELength;
if (pBSSList->uIELength > WLAN_BEACON_FR_MAXLEN)
pBSSList->uIELength = WLAN_BEACON_FR_MAXLEN;
MEMvCopy(pBSSList->abyIEs, pbyIEs, pBSSList->uIELength);
memcpy(pBSSList->abyIEs, pbyIEs, pBSSList->uIELength);

return TRUE;
}
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/staging/vt6656/card.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
#include "key.h"
#include "rc4.h"
#include "country.h"
#include "umem.h"
#include "datarate.h"
#include "rndis.h"
#include "control.h"
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/staging/vt6656/channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include "country.h"
#include "channel.h"
#include "rf.h"
#include "umem.h"

/*--------------------- Static Definitions -------------------------*/
static int msglevel =MSG_LEVEL_INFO;
Expand Down Expand Up @@ -433,7 +432,7 @@ CHvChannelGetList (
if (uCountryCodeIdx >= CCODE_MAX) {
return (FALSE);
}
MEMvCopy(pbyChannelTable, ChannelRuleTab[uCountryCodeIdx].bChannelIdxList, CB_MAX_CHANNEL);
memcpy(pbyChannelTable, ChannelRuleTab[uCountryCodeIdx].bChannelIdxList, CB_MAX_CHANNEL);
return (TRUE);
}

Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/staging/vt6656/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
*/

#include "control.h"
#include "umem.h"
#include "rndis.h"

/*--------------------- Static Definitions -------------------------*/
Expand Down
11 changes: 5 additions & 6 deletions trunk/drivers/staging/vt6656/dpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
#include "bssdb.h"
#include "mac.h"
#include "baseband.h"
#include "umem.h"
#include "michael.h"
#include "tkip.h"
#include "tcrc.h"
Expand Down Expand Up @@ -941,7 +940,7 @@ RXbBulkInProcessData (
RSC = dwRxTSC47_16;
RSC <<= 16;
RSC += wRxTSC15_0;
MEMvCopy(&(pKey->KeyRSC), &RSC, sizeof(QWORD));
memcpy(&(pKey->KeyRSC), &RSC, sizeof(QWORD));

if ( (pDevice->sMgmtObj.eCurrMode == WMAC_MODE_ESS_STA) &&
(pDevice->sMgmtObj.eCurrState == WMAC_STATE_ASSOC)) {
Expand Down Expand Up @@ -1239,8 +1238,8 @@ static BOOL s_bHandleRxEncryption (
// 2. WEP 256

PayloadLen -= (WLAN_HDR_ADDR3_LEN + 4 + 4); // 24 is 802.11 header,4 is IV, 4 is crc
MEMvCopy(pDevice->abyPRNG, pbyIV, 3);
MEMvCopy(pDevice->abyPRNG + 3, pKey->abyKey, pKey->uKeyLength);
memcpy(pDevice->abyPRNG, pbyIV, 3);
memcpy(pDevice->abyPRNG + 3, pKey->abyKey, pKey->uKeyLength);
rc4_init(&pDevice->SBox, pDevice->abyPRNG, pKey->uKeyLength + 3);
rc4_encrypt(&pDevice->SBox, pbyIV+4, pbyIV+4, PayloadLen);

Expand Down Expand Up @@ -1350,8 +1349,8 @@ static BOOL s_bHostWepRxEncryption (
// 3. NotOnFly

PayloadLen -= (WLAN_HDR_ADDR3_LEN + 4 + 4); // 24 is 802.11 header,4 is IV, 4 is crc
MEMvCopy(pDevice->abyPRNG, pbyIV, 3);
MEMvCopy(pDevice->abyPRNG + 3, pKey->abyKey, pKey->uKeyLength);
memcpy(pDevice->abyPRNG, pbyIV, 3);
memcpy(pDevice->abyPRNG + 3, pKey->abyKey, pKey->uKeyLength);
rc4_init(&pDevice->SBox, pDevice->abyPRNG, pKey->uKeyLength + 3);
rc4_encrypt(&pDevice->SBox, pbyIV+4, pbyIV+4, PayloadLen);

Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/staging/vt6656/firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
*
*/

#include "umem.h"
#include "firmware.h"
#include "control.h"
#include "rndis.h"
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/staging/vt6656/int.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#include "mac.h"
#include "power.h"
#include "bssdb.h"
#include "umem.h"
#include "usbpipe.h"

/*--------------------- Static Definitions -------------------------*/
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/staging/vt6656/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include "mac.h"
#include "card.h"
#include "hostap.h"
#include "umem.h"
#include "wpactl.h"
#include "control.h"
#include "rndis.h"
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/staging/vt6656/iwctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include "mac.h"
#include "card.h"
#include "hostap.h"
#include "umem.h"
#include "power.h"
#include "rf.h"

Expand Down
27 changes: 13 additions & 14 deletions trunk/drivers/staging/vt6656/key.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#include "tmacro.h"
#include "tbit.h"
#include "key.h"
#include "umem.h"
#include "mac.h"
#include "rndis.h"
#include "control.h"
Expand Down Expand Up @@ -278,7 +277,7 @@ BOOL KeybSetKey (
pKey->uKeyLength = uKeyLength;
pKey->dwKeyIndex = dwKeyIndex;
pKey->byCipherSuite = byKeyDecMode;
MEMvCopy(pKey->abyKey, pbyKey, uKeyLength);
memcpy(pKey->abyKey, pbyKey, uKeyLength);
if (byKeyDecMode == KEY_CTL_WEP) {
if (uKeyLength == WLAN_WEP40_KEYLEN)
pKey->abyKey[15] &= 0x7F;
Expand All @@ -289,10 +288,10 @@ BOOL KeybSetKey (

if ((dwKeyIndex & USE_KEYRSC) == 0) {
// RSC set by NIC
ZERO_MEMORY(&(pKey->KeyRSC), sizeof(QWORD));
memset(&(pKey->KeyRSC), 0, sizeof(QWORD));
}
else {
MEMvCopy(&(pKey->KeyRSC), pKeyRSC, sizeof(QWORD));
memcpy(&(pKey->KeyRSC), pKeyRSC, sizeof(QWORD));
}
pKey->dwTSC47_16 = 0;
pKey->wTSC15_0 = 0;
Expand All @@ -314,7 +313,7 @@ BOOL KeybSetKey (
}
}
if (j < (MAX_KEY_TABLE-1)) {
MEMvCopy(pTable->KeyTable[j].abyBSSID,pbyBSSID,U_ETHER_ADDR_LEN);
memcpy(pTable->KeyTable[j].abyBSSID,pbyBSSID,U_ETHER_ADDR_LEN);
pTable->KeyTable[j].bInUse = TRUE;
if ((dwKeyIndex & PAIRWISE_KEY) != 0) {
// Pairwise key
Expand Down Expand Up @@ -343,7 +342,7 @@ BOOL KeybSetKey (
pKey->uKeyLength = uKeyLength;
pKey->dwKeyIndex = dwKeyIndex;
pKey->byCipherSuite = byKeyDecMode;
MEMvCopy(pKey->abyKey, pbyKey, uKeyLength);
memcpy(pKey->abyKey, pbyKey, uKeyLength);
if (byKeyDecMode == KEY_CTL_WEP) {
if (uKeyLength == WLAN_WEP40_KEYLEN)
pKey->abyKey[15] &= 0x7F;
Expand All @@ -354,10 +353,10 @@ BOOL KeybSetKey (

if ((dwKeyIndex & USE_KEYRSC) == 0) {
// RSC set by NIC
ZERO_MEMORY(&(pKey->KeyRSC), sizeof(QWORD));
memset(&(pKey->KeyRSC), 0, sizeof(QWORD));
}
else {
MEMvCopy(&(pKey->KeyRSC), pKeyRSC, sizeof(QWORD));
memcpy(&(pKey->KeyRSC), pKeyRSC, sizeof(QWORD));
}
pKey->dwTSC47_16 = 0;
pKey->wTSC15_0 = 0;
Expand Down Expand Up @@ -732,7 +731,7 @@ BOOL KeybSetDefaultKey (
pKey->uKeyLength = uKeyLength;
pKey->dwKeyIndex = dwKeyIndex;
pKey->byCipherSuite = byKeyDecMode;
MEMvCopy(pKey->abyKey, pbyKey, uKeyLength);
memcpy(pKey->abyKey, pbyKey, uKeyLength);
if (byKeyDecMode == KEY_CTL_WEP) {
if (uKeyLength == WLAN_WEP40_KEYLEN)
pKey->abyKey[15] &= 0x7F;
Expand All @@ -744,9 +743,9 @@ BOOL KeybSetDefaultKey (

if ((dwKeyIndex & USE_KEYRSC) == 0) {
// RSC set by NIC
ZERO_MEMORY(&(pKey->KeyRSC), sizeof(QWORD));
memset(&(pKey->KeyRSC), 0, sizeof(QWORD));
} else {
MEMvCopy(&(pKey->KeyRSC), pKeyRSC, sizeof(QWORD));
memcpy(&(pKey->KeyRSC), pKeyRSC, sizeof(QWORD));
}
pKey->dwTSC47_16 = 0;
pKey->wTSC15_0 = 0;
Expand Down Expand Up @@ -832,7 +831,7 @@ BOOL KeybSetAllGroupKey (
pKey->uKeyLength = uKeyLength;
pKey->dwKeyIndex = dwKeyIndex;
pKey->byCipherSuite = byKeyDecMode;
MEMvCopy(pKey->abyKey, pbyKey, uKeyLength);
memcpy(pKey->abyKey, pbyKey, uKeyLength);
if (byKeyDecMode == KEY_CTL_WEP) {
if (uKeyLength == WLAN_WEP40_KEYLEN)
pKey->abyKey[15] &= 0x7F;
Expand All @@ -844,10 +843,10 @@ BOOL KeybSetAllGroupKey (

if ((dwKeyIndex & USE_KEYRSC) == 0) {
// RSC set by NIC
ZERO_MEMORY(&(pKey->KeyRSC), sizeof(QWORD));
memset(&(pKey->KeyRSC), 0, sizeof(QWORD));
}
else {
MEMvCopy(&(pKey->KeyRSC), pKeyRSC, sizeof(QWORD));
memcpy(&(pKey->KeyRSC), pKeyRSC, sizeof(QWORD));
}
pKey->dwTSC47_16 = 0;
pKey->wTSC15_0 = 0;
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/staging/vt6656/mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include "ttype.h"
#include "device.h"
#include "tmacro.h"
#include "umem.h"

/*--------------------- Export Definitions -------------------------*/

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/staging/vt6656/main_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,8 @@ static BOOL device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType)
CARDbSetMediaChannel(pDevice, pMgmt->uCurrChannel);

// get Permanent network address
MEMvCopy(pDevice->abyPermanentNetAddr,&(sInitRsp.byNetAddr[0]),6)
MEMvCopy(pDevice->abyCurrentNetAddr, pDevice->abyPermanentNetAddr, U_ETHER_ADDR_LEN);
memcpy(pDevice->abyPermanentNetAddr,&(sInitRsp.byNetAddr[0]),6);
memcpy(pDevice->abyCurrentNetAddr, pDevice->abyPermanentNetAddr, U_ETHER_ADDR_LEN);

// if exist SW network address, use SW network address.

Expand Down
Loading

0 comments on commit 3aeaa1e

Please sign in to comment.