Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 162326
b: refs/heads/master
c: 51b6d9c
h: refs/heads/master
v: v3
  • Loading branch information
Jim Lieb authored and Greg Kroah-Hartman committed Sep 15, 2009
1 parent 9e7a642 commit 8691338
Show file tree
Hide file tree
Showing 21 changed files with 199 additions and 290 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: a7ad322a46663755718a214a9a34e5cfe64d07f7
refs/heads/master: 51b6d9c299f10780b3093d3748257ecc4ae7340d
15 changes: 7 additions & 8 deletions trunk/drivers/staging/vt6655/IEEE11h.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
*/

#include "ttype.h"
#include "umem.h"
#include "tmacro.h"
#include "tether.h"
#include "IEEE11h.h"
Expand Down Expand Up @@ -104,7 +103,7 @@ static BOOL s_bRxMSRReq(PSMgmtObject pMgmt, PWLAN_FRAME_MSRREQ pMSRReq, UINT uLe
BOOL bResult = TRUE;

if (uLength <= WLAN_A3FR_MAXLEN) {
MEMvCopy(pMgmt->abyCurrentMSRReq, pMSRReq, uLength);
memcpy(pMgmt->abyCurrentMSRReq, pMSRReq, uLength);
}
uNumOfEIDs = ((uLength - offsetof(WLAN_FRAME_MSRREQ, sMSRReqEIDs))/ (sizeof(WLAN_IE_MEASURE_REQ)));
pMgmt->pCurrMeasureEIDRep = &(((PWLAN_FRAME_MSRREP) (pMgmt->abyCurrentMSRRep))->sMSRRepEIDs[0]);
Expand Down Expand Up @@ -133,9 +132,9 @@ static BOOL s_bRxTPCReq(PSMgmtObject pMgmt, PWLAN_FRAME_TPCREQ pTPCReq, BYTE byR
WLAN_SET_FC_FSTYPE(WLAN_FSTYPE_ACTION)
);

MEMvCopy( pFrame->Header.abyAddr1, pTPCReq->Header.abyAddr2, WLAN_ADDR_LEN);
MEMvCopy( pFrame->Header.abyAddr2, CARDpGetCurrentAddress(pMgmt->pAdapter), WLAN_ADDR_LEN);
MEMvCopy( pFrame->Header.abyAddr3, pMgmt->abyCurrBSSID, WLAN_BSSID_LEN);
memcpy( pFrame->Header.abyAddr1, pTPCReq->Header.abyAddr2, WLAN_ADDR_LEN);
memcpy( pFrame->Header.abyAddr2, CARDpGetCurrentAddress(pMgmt->pAdapter), WLAN_ADDR_LEN);
memcpy( pFrame->Header.abyAddr3, pMgmt->abyCurrBSSID, WLAN_BSSID_LEN);

pFrame->byCategory = 0;
pFrame->byAction = 3;
Expand Down Expand Up @@ -283,9 +282,9 @@ BOOL IEEE11hbMSRRepTx (
WLAN_SET_FC_FSTYPE(WLAN_FSTYPE_ACTION)
);

MEMvCopy( pMSRRep->Header.abyAddr1, ((PWLAN_FRAME_MSRREQ) (pMgmt->abyCurrentMSRReq))->Header.abyAddr2, WLAN_ADDR_LEN);
MEMvCopy( pMSRRep->Header.abyAddr2, CARDpGetCurrentAddress(pMgmt->pAdapter), WLAN_ADDR_LEN);
MEMvCopy( pMSRRep->Header.abyAddr3, pMgmt->abyCurrBSSID, WLAN_BSSID_LEN);
memcpy( pMSRRep->Header.abyAddr1, ((PWLAN_FRAME_MSRREQ) (pMgmt->abyCurrentMSRReq))->Header.abyAddr2, WLAN_ADDR_LEN);
memcpy( pMSRRep->Header.abyAddr2, CARDpGetCurrentAddress(pMgmt->pAdapter), WLAN_ADDR_LEN);
memcpy( pMSRRep->Header.abyAddr3, pMgmt->abyCurrBSSID, WLAN_BSSID_LEN);

pMSRRep->byCategory = 0;
pMSRRep->byAction = 1;
Expand Down
23 changes: 11 additions & 12 deletions trunk/drivers/staging/vt6655/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
1 change: 0 additions & 1 deletion trunk/drivers/staging/vt6655/baseband.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
#include "mac.h"
#include "baseband.h"
#include "srom.h"
#include "umem.h"
#include "rf.h"

/*--------------------- Static Definitions -------------------------*/
Expand Down
13 changes: 6 additions & 7 deletions trunk/drivers/staging/vt6655/bssdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
#include "card.h"
#include "mac.h"
#include "wpa2.h"
#include "umem.h"
#include "iowpa.h"

//#define PLICE_DEBUG
Expand Down Expand Up @@ -167,7 +166,7 @@ if(pDevice->bLinkPass==FALSE) pCurrBSS->bSelected = FALSE;
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 @@ -200,7 +199,7 @@ if(pDevice->bLinkPass==FALSE) pCurrBSS->bSelected = FALSE;

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 @@ -259,8 +258,8 @@ if(pDevice->bLinkPass==FALSE) pCurrBSS->bSelected = FALSE;
/*
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 @@ -502,7 +501,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 @@ -568,7 +567,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
11 changes: 5 additions & 6 deletions trunk/drivers/staging/vt6655/card.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
#include "key.h"
#include "rc4.h"
#include "country.h"
#include "umem.h"

/*--------------------- Static Definitions -------------------------*/

Expand Down Expand Up @@ -1304,7 +1303,7 @@ BOOL CARDbSetBSSID(PVOID pDeviceHandler, PBYTE pbyBSSID, CARD_OP_MODE eOPMode)
PSDevice pDevice = (PSDevice) pDeviceHandler;

MACvWriteBSSIDAddress(pDevice->PortOffset, pbyBSSID);
MEMvCopy(pDevice->abyBSSID, pbyBSSID, WLAN_BSSID_LEN);
memcpy(pDevice->abyBSSID, pbyBSSID, WLAN_BSSID_LEN);
if (eOPMode == OP_MODE_ADHOC) {
MACvRegBitsOn(pDevice->PortOffset, MAC_REG_HOSTCR, HOSTCR_ADHOC);
} else {
Expand Down Expand Up @@ -1566,7 +1565,7 @@ CARDbAdd_PMKID_Candidate (

if (pDevice->gsPMKIDCandidate.NumCandidates >= MAX_PMKIDLIST) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"vFlush_PMKID_Candidate: 3\n");
ZERO_MEMORY(&pDevice->gsPMKIDCandidate, sizeof(SPMKIDCandidateEvent));
memset(&pDevice->gsPMKIDCandidate, 0, sizeof(SPMKIDCandidateEvent));
}

for (ii = 0; ii < 6; ii++) {
Expand All @@ -1578,7 +1577,7 @@ CARDbAdd_PMKID_Candidate (
// Update Old Candidate
for (ii = 0; ii < pDevice->gsPMKIDCandidate.NumCandidates; ii++) {
pCandidateList = &pDevice->gsPMKIDCandidate.CandidateList[ii];
if (MEMEqualMemory(pCandidateList->BSSID, pbyBSSID, U_ETHER_ADDR_LEN)) {
if ( !memcmp(pCandidateList->BSSID, pbyBSSID, U_ETHER_ADDR_LEN)) {
if ((bRSNCapExist == TRUE) && (wRSNCap & BIT0)) {
pCandidateList->Flags |= NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED;
} else {
Expand All @@ -1595,7 +1594,7 @@ CARDbAdd_PMKID_Candidate (
} else {
pCandidateList->Flags &= ~(NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED);
}
MEMvCopy(pCandidateList->BSSID, pbyBSSID, U_ETHER_ADDR_LEN);
memcpy(pCandidateList->BSSID, pbyBSSID, U_ETHER_ADDR_LEN);
pDevice->gsPMKIDCandidate.NumCandidates++;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"NumCandidates:%d\n", (int)pDevice->gsPMKIDCandidate.NumCandidates);
return TRUE;
Expand Down Expand Up @@ -2276,7 +2275,7 @@ CARDbChannelGetList (
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
11 changes: 5 additions & 6 deletions trunk/drivers/staging/vt6655/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 @@ -930,7 +929,7 @@ device_receive_frame (
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 @@ -1263,8 +1262,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 @@ -1373,8 +1372,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
5 changes: 2 additions & 3 deletions trunk/drivers/staging/vt6655/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 "rf.h"

Expand Down Expand Up @@ -726,8 +725,8 @@ vConfigWEPKey (
int ii;
ZERO_MEMORY(&pDevice->abyWepKey[dwKeyIndex][0], WLAN_WEPMAX_KEYLEN);
MEMvCopy(&pDevice->abyWepKey[dwKeyIndex][0], pbyKey, uKeyLength);
memset(&pDevice->abyWepKey[dwKeyIndex][0], 0, WLAN_WEPMAX_KEYLEN);
memcpy(&pDevice->abyWepKey[dwKeyIndex][0], pbyKey, uKeyLength);
pDevice->bWepKeyAvailable[dwKeyIndex] = TRUE;
pDevice->auWepKeyLength[dwKeyIndex] = uKeyLength;
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/staging/vt6655/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
Loading

0 comments on commit 8691338

Please sign in to comment.