Commit 51b6d9c2 authored by Jim Lieb's avatar Jim Lieb Committed by Greg Kroah-Hartman

Staging: vt665x: Remove umem.h Part 1

Remove references to umem.h macros and refer directly to memcpy
functions.  Delete the include file.
Signed-off-by: default avatarJim Lieb <lieb@canonical.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a7ad322a
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
*/ */
#include "ttype.h" #include "ttype.h"
#include "umem.h"
#include "tmacro.h" #include "tmacro.h"
#include "tether.h" #include "tether.h"
#include "IEEE11h.h" #include "IEEE11h.h"
...@@ -104,7 +103,7 @@ static BOOL s_bRxMSRReq(PSMgmtObject pMgmt, PWLAN_FRAME_MSRREQ pMSRReq, UINT uLe ...@@ -104,7 +103,7 @@ static BOOL s_bRxMSRReq(PSMgmtObject pMgmt, PWLAN_FRAME_MSRREQ pMSRReq, UINT uLe
BOOL bResult = TRUE; BOOL bResult = TRUE;
if (uLength <= WLAN_A3FR_MAXLEN) { 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))); uNumOfEIDs = ((uLength - offsetof(WLAN_FRAME_MSRREQ, sMSRReqEIDs))/ (sizeof(WLAN_IE_MEASURE_REQ)));
pMgmt->pCurrMeasureEIDRep = &(((PWLAN_FRAME_MSRREP) (pMgmt->abyCurrentMSRRep))->sMSRRepEIDs[0]); pMgmt->pCurrMeasureEIDRep = &(((PWLAN_FRAME_MSRREP) (pMgmt->abyCurrentMSRRep))->sMSRRepEIDs[0]);
...@@ -133,9 +132,9 @@ static BOOL s_bRxTPCReq(PSMgmtObject pMgmt, PWLAN_FRAME_TPCREQ pTPCReq, BYTE byR ...@@ -133,9 +132,9 @@ static BOOL s_bRxTPCReq(PSMgmtObject pMgmt, PWLAN_FRAME_TPCREQ pTPCReq, BYTE byR
WLAN_SET_FC_FSTYPE(WLAN_FSTYPE_ACTION) WLAN_SET_FC_FSTYPE(WLAN_FSTYPE_ACTION)
); );
MEMvCopy( pFrame->Header.abyAddr1, pTPCReq->Header.abyAddr2, WLAN_ADDR_LEN); memcpy( pFrame->Header.abyAddr1, pTPCReq->Header.abyAddr2, WLAN_ADDR_LEN);
MEMvCopy( pFrame->Header.abyAddr2, CARDpGetCurrentAddress(pMgmt->pAdapter), WLAN_ADDR_LEN); memcpy( pFrame->Header.abyAddr2, CARDpGetCurrentAddress(pMgmt->pAdapter), WLAN_ADDR_LEN);
MEMvCopy( pFrame->Header.abyAddr3, pMgmt->abyCurrBSSID, WLAN_BSSID_LEN); memcpy( pFrame->Header.abyAddr3, pMgmt->abyCurrBSSID, WLAN_BSSID_LEN);
pFrame->byCategory = 0; pFrame->byCategory = 0;
pFrame->byAction = 3; pFrame->byAction = 3;
...@@ -283,9 +282,9 @@ BOOL IEEE11hbMSRRepTx ( ...@@ -283,9 +282,9 @@ BOOL IEEE11hbMSRRepTx (
WLAN_SET_FC_FSTYPE(WLAN_FSTYPE_ACTION) WLAN_SET_FC_FSTYPE(WLAN_FSTYPE_ACTION)
); );
MEMvCopy( pMSRRep->Header.abyAddr1, ((PWLAN_FRAME_MSRREQ) (pMgmt->abyCurrentMSRReq))->Header.abyAddr2, WLAN_ADDR_LEN); memcpy( pMSRRep->Header.abyAddr1, ((PWLAN_FRAME_MSRREQ) (pMgmt->abyCurrentMSRReq))->Header.abyAddr2, WLAN_ADDR_LEN);
MEMvCopy( pMSRRep->Header.abyAddr2, CARDpGetCurrentAddress(pMgmt->pAdapter), WLAN_ADDR_LEN); memcpy( pMSRRep->Header.abyAddr2, CARDpGetCurrentAddress(pMgmt->pAdapter), WLAN_ADDR_LEN);
MEMvCopy( pMSRRep->Header.abyAddr3, pMgmt->abyCurrBSSID, WLAN_BSSID_LEN); memcpy( pMSRRep->Header.abyAddr3, pMgmt->abyCurrBSSID, WLAN_BSSID_LEN);
pMSRRep->byCategory = 0; pMSRRep->byCategory = 0;
pMSRRep->byAction = 1; pMSRRep->byAction = 1;
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
* *
*/ */
#include "umem.h"
#include "device.h" #include "device.h"
#include "80211hdr.h" #include "80211hdr.h"
...@@ -278,7 +277,7 @@ int ii,jj,kk; ...@@ -278,7 +277,7 @@ int ii,jj,kk;
pbyPayload = pbyIV + 8; //IV-length pbyPayload = pbyIV + 8; //IV-length
abyNonce[0] = 0x00; //now is 0, if Qos here will be priority 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[7] = pbyIV[7];
abyNonce[8] = pbyIV[6]; abyNonce[8] = pbyIV[6];
abyNonce[9] = pbyIV[5]; abyNonce[9] = pbyIV[5];
...@@ -288,7 +287,7 @@ int ii,jj,kk; ...@@ -288,7 +287,7 @@ int ii,jj,kk;
//MIC_IV //MIC_IV
MIC_IV[0] = 0x59; 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[14] = (BYTE)(wPayloadSize >> 8);
MIC_IV[15] = (BYTE)(wPayloadSize & 0xff); MIC_IV[15] = (BYTE)(wPayloadSize & 0xff);
...@@ -300,16 +299,16 @@ int ii,jj,kk; ...@@ -300,16 +299,16 @@ int ii,jj,kk;
byTmp = (BYTE)(pMACHeader->wFrameCtl >> 8); byTmp = (BYTE)(pMACHeader->wFrameCtl >> 8);
byTmp &= 0x87; byTmp &= 0x87;
MIC_HDR1[3] = byTmp | 0x40; MIC_HDR1[3] = byTmp | 0x40;
MEMvCopy(&(MIC_HDR1[4]), pMACHeader->abyAddr1, U_ETHER_ADDR_LEN); memcpy(&(MIC_HDR1[4]), pMACHeader->abyAddr1, U_ETHER_ADDR_LEN);
MEMvCopy(&(MIC_HDR1[10]), pMACHeader->abyAddr2, U_ETHER_ADDR_LEN); memcpy(&(MIC_HDR1[10]), pMACHeader->abyAddr2, U_ETHER_ADDR_LEN);
//MIC_HDR2 //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); byTmp = (BYTE)(pMACHeader->wSeqCtl & 0xff);
MIC_HDR2[6] = byTmp & 0x0f; MIC_HDR2[6] = byTmp & 0x0f;
MIC_HDR2[7] = 0; MIC_HDR2[7] = 0;
if ( bA4 ) { if ( bA4 ) {
MEMvCopy(&(MIC_HDR2[8]), pMACHeader->abyAddr4, U_ETHER_ADDR_LEN); memcpy(&(MIC_HDR2[8]), pMACHeader->abyAddr4, U_ETHER_ADDR_LEN);
} else { } else {
MIC_HDR2[8] = 0x00; MIC_HDR2[8] = 0x00;
MIC_HDR2[9] = 0x00; MIC_HDR2[9] = 0x00;
...@@ -334,7 +333,7 @@ int ii,jj,kk; ...@@ -334,7 +333,7 @@ int ii,jj,kk;
wCnt = 1; wCnt = 1;
abyCTRPLD[0] = 0x01; abyCTRPLD[0] = 0x01;
MEMvCopy(&(abyCTRPLD[1]), &(abyNonce[0]), 13); memcpy(&(abyCTRPLD[1]), &(abyNonce[0]), 13);
for(jj=wPayloadSize; jj>16; jj=jj-16) { for(jj=wPayloadSize; jj>16; jj=jj-16) {
...@@ -351,13 +350,13 @@ int ii,jj,kk; ...@@ -351,13 +350,13 @@ int ii,jj,kk;
} }
AESv128(pbyRxKey,abyTmp,abyMIC); AESv128(pbyRxKey,abyTmp,abyMIC);
MEMvCopy(pbyPayload, abyPlainText, 16); memcpy(pbyPayload, abyPlainText, 16);
wCnt++; wCnt++;
pbyPayload += 16; pbyPayload += 16;
} //for wPayloadSize } //for wPayloadSize
//last payload //last payload
MEMvCopy(&(abyLastCipher[0]), pbyPayload, jj); memcpy(&(abyLastCipher[0]), pbyPayload, jj);
for ( ii=jj; ii<16; ii++ ) { for ( ii=jj; ii<16; ii++ ) {
abyLastCipher[ii] = 0x00; abyLastCipher[ii] = 0x00;
} }
...@@ -369,7 +368,7 @@ int ii,jj,kk; ...@@ -369,7 +368,7 @@ int ii,jj,kk;
for ( kk=0; kk<16; kk++ ) { for ( kk=0; kk<16; kk++ ) {
abyPlainText[kk] = abyTmp[kk] ^ abyLastCipher[kk]; abyPlainText[kk] = abyTmp[kk] ^ abyLastCipher[kk];
} }
MEMvCopy(pbyPayload, abyPlainText, jj); memcpy(pbyPayload, abyPlainText, jj);
pbyPayload += jj; pbyPayload += jj;
//for MIC calculation //for MIC calculation
...@@ -394,7 +393,7 @@ int ii,jj,kk; ...@@ -394,7 +393,7 @@ int ii,jj,kk;
//=>above is the dec-MIC from packet //=>above is the dec-MIC from packet
//-------------------------------------------- //--------------------------------------------
if ( MEMEqualMemory(abyMIC,abyTmp,8) ) { if ( !memcmp(abyMIC,abyTmp,8) ) {
return TRUE; return TRUE;
} else { } else {
return FALSE; return FALSE;
......
...@@ -55,7 +55,6 @@ ...@@ -55,7 +55,6 @@
#include "mac.h" #include "mac.h"
#include "baseband.h" #include "baseband.h"
#include "srom.h" #include "srom.h"
#include "umem.h"
#include "rf.h" #include "rf.h"
/*--------------------- Static Definitions -------------------------*/ /*--------------------- Static Definitions -------------------------*/
......
...@@ -56,7 +56,6 @@ ...@@ -56,7 +56,6 @@
#include "card.h" #include "card.h"
#include "mac.h" #include "mac.h"
#include "wpa2.h" #include "wpa2.h"
#include "umem.h"
#include "iowpa.h" #include "iowpa.h"
//#define PLICE_DEBUG //#define PLICE_DEBUG
...@@ -167,7 +166,7 @@ if(pDevice->bLinkPass==FALSE) pCurrBSS->bSelected = FALSE; ...@@ -167,7 +166,7 @@ if(pDevice->bLinkPass==FALSE) pCurrBSS->bSelected = FALSE;
if (IS_ETH_ADDRESS_EQUAL(pCurrBSS->abyBSSID, pbyBSSID)) { if (IS_ETH_ADDRESS_EQUAL(pCurrBSS->abyBSSID, pbyBSSID)) {
if (pSSID != NULL) { if (pSSID != NULL) {
// compare ssid // compare ssid
if (MEMEqualMemory(pSSID->abySSID, if ( !memcmp(pSSID->abySSID,
((PWLAN_IE_SSID)pCurrBSS->abySSID)->abySSID, ((PWLAN_IE_SSID)pCurrBSS->abySSID)->abySSID,
pSSID->len)) { pSSID->len)) {
if ((pMgmt->eConfigMode == WMAC_CONFIG_AUTO) || if ((pMgmt->eConfigMode == WMAC_CONFIG_AUTO) ||
...@@ -200,7 +199,7 @@ if(pDevice->bLinkPass==FALSE) pCurrBSS->bSelected = FALSE; ...@@ -200,7 +199,7 @@ if(pDevice->bLinkPass==FALSE) pCurrBSS->bSelected = FALSE;
if (pSSID != NULL) { if (pSSID != NULL) {
// matched SSID // matched SSID
if (!MEMEqualMemory(pSSID->abySSID, if (! !memcmp(pSSID->abySSID,
((PWLAN_IE_SSID)pCurrBSS->abySSID)->abySSID, ((PWLAN_IE_SSID)pCurrBSS->abySSID)->abySSID,
pSSID->len) || pSSID->len) ||
(pSSID->len != ((PWLAN_IE_SSID)pCurrBSS->abySSID)->len)) { (pSSID->len != ((PWLAN_IE_SSID)pCurrBSS->abySSID)->len)) {
...@@ -259,8 +258,8 @@ if(pDevice->bLinkPass==FALSE) pCurrBSS->bSelected = FALSE; ...@@ -259,8 +258,8 @@ if(pDevice->bLinkPass==FALSE) pCurrBSS->bSelected = FALSE;
/* /*
if (pDevice->bRoaming == FALSE) { if (pDevice->bRoaming == FALSE) {
// Einsn Add @20070907 // Einsn Add @20070907
ZERO_MEMORY(pbyDesireSSID, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1); memset(pbyDesireSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
MEMvCopy(pbyDesireSSID,pCurrBSS->abySSID,WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1) ; memcpy(pbyDesireSSID,pCurrBSS->abySSID,WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1) ;
}*/ }*/
return(pSelect); return(pSelect);
...@@ -502,7 +501,7 @@ BSSbInsertToBSSList ( ...@@ -502,7 +501,7 @@ BSSbInsertToBSSList (
} }
} }
if ((bIs802_1x == TRUE) && (pSSID->len == ((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->len) && 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); bAdd_PMKID_Candidate((HANDLE)pDevice, pBSSList->abyBSSID, &pBSSList->sRSNCapObj);
...@@ -568,7 +567,7 @@ BSSbInsertToBSSList ( ...@@ -568,7 +567,7 @@ BSSbInsertToBSSList (
pBSSList->uIELength = uIELength; pBSSList->uIELength = uIELength;
if (pBSSList->uIELength > WLAN_BEACON_FR_MAXLEN) if (pBSSList->uIELength > WLAN_BEACON_FR_MAXLEN)
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; return TRUE;
} }
......
...@@ -57,7 +57,6 @@ ...@@ -57,7 +57,6 @@
#include "key.h" #include "key.h"
#include "rc4.h" #include "rc4.h"
#include "country.h" #include "country.h"
#include "umem.h"
/*--------------------- Static Definitions -------------------------*/ /*--------------------- Static Definitions -------------------------*/
...@@ -1304,7 +1303,7 @@ BOOL CARDbSetBSSID(PVOID pDeviceHandler, PBYTE pbyBSSID, CARD_OP_MODE eOPMode) ...@@ -1304,7 +1303,7 @@ BOOL CARDbSetBSSID(PVOID pDeviceHandler, PBYTE pbyBSSID, CARD_OP_MODE eOPMode)
PSDevice pDevice = (PSDevice) pDeviceHandler; PSDevice pDevice = (PSDevice) pDeviceHandler;
MACvWriteBSSIDAddress(pDevice->PortOffset, pbyBSSID); MACvWriteBSSIDAddress(pDevice->PortOffset, pbyBSSID);
MEMvCopy(pDevice->abyBSSID, pbyBSSID, WLAN_BSSID_LEN); memcpy(pDevice->abyBSSID, pbyBSSID, WLAN_BSSID_LEN);
if (eOPMode == OP_MODE_ADHOC) { if (eOPMode == OP_MODE_ADHOC) {
MACvRegBitsOn(pDevice->PortOffset, MAC_REG_HOSTCR, HOSTCR_ADHOC); MACvRegBitsOn(pDevice->PortOffset, MAC_REG_HOSTCR, HOSTCR_ADHOC);
} else { } else {
...@@ -1566,7 +1565,7 @@ CARDbAdd_PMKID_Candidate ( ...@@ -1566,7 +1565,7 @@ CARDbAdd_PMKID_Candidate (
if (pDevice->gsPMKIDCandidate.NumCandidates >= MAX_PMKIDLIST) { if (pDevice->gsPMKIDCandidate.NumCandidates >= MAX_PMKIDLIST) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"vFlush_PMKID_Candidate: 3\n"); 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++) { for (ii = 0; ii < 6; ii++) {
...@@ -1578,7 +1577,7 @@ CARDbAdd_PMKID_Candidate ( ...@@ -1578,7 +1577,7 @@ CARDbAdd_PMKID_Candidate (
// Update Old Candidate // Update Old Candidate
for (ii = 0; ii < pDevice->gsPMKIDCandidate.NumCandidates; ii++) { for (ii = 0; ii < pDevice->gsPMKIDCandidate.NumCandidates; ii++) {
pCandidateList = &pDevice->gsPMKIDCandidate.CandidateList[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)) { if ((bRSNCapExist == TRUE) && (wRSNCap & BIT0)) {
pCandidateList->Flags |= NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED; pCandidateList->Flags |= NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED;
} else { } else {
...@@ -1595,7 +1594,7 @@ CARDbAdd_PMKID_Candidate ( ...@@ -1595,7 +1594,7 @@ CARDbAdd_PMKID_Candidate (
} else { } else {
pCandidateList->Flags &= ~(NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED); 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++; pDevice->gsPMKIDCandidate.NumCandidates++;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"NumCandidates:%d\n", (int)pDevice->gsPMKIDCandidate.NumCandidates); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"NumCandidates:%d\n", (int)pDevice->gsPMKIDCandidate.NumCandidates);
return TRUE; return TRUE;
...@@ -2276,7 +2275,7 @@ CARDbChannelGetList ( ...@@ -2276,7 +2275,7 @@ CARDbChannelGetList (
if (uCountryCodeIdx >= CCODE_MAX) { if (uCountryCodeIdx >= CCODE_MAX) {
return (FALSE); return (FALSE);
} }
MEMvCopy(pbyChannelTable, ChannelRuleTab[uCountryCodeIdx].bChannelIdxList, CB_MAX_CHANNEL); memcpy(pbyChannelTable, ChannelRuleTab[uCountryCodeIdx].bChannelIdxList, CB_MAX_CHANNEL);
return (TRUE); return (TRUE);
} }
......
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
#include "bssdb.h" #include "bssdb.h"
#include "mac.h" #include "mac.h"
#include "baseband.h" #include "baseband.h"
#include "umem.h"
#include "michael.h" #include "michael.h"
#include "tkip.h" #include "tkip.h"
#include "tcrc.h" #include "tcrc.h"
...@@ -930,7 +929,7 @@ device_receive_frame ( ...@@ -930,7 +929,7 @@ device_receive_frame (
RSC = dwRxTSC47_16; RSC = dwRxTSC47_16;
RSC <<= 16; RSC <<= 16;
RSC += wRxTSC15_0; RSC += wRxTSC15_0;
MEMvCopy(&(pKey->KeyRSC), &RSC, sizeof(QWORD)); memcpy(&(pKey->KeyRSC), &RSC, sizeof(QWORD));
if ( (pDevice->sMgmtObj.eCurrMode == WMAC_MODE_ESS_STA) && if ( (pDevice->sMgmtObj.eCurrMode == WMAC_MODE_ESS_STA) &&
(pDevice->sMgmtObj.eCurrState == WMAC_STATE_ASSOC)) { (pDevice->sMgmtObj.eCurrState == WMAC_STATE_ASSOC)) {
...@@ -1263,8 +1262,8 @@ static BOOL s_bHandleRxEncryption ( ...@@ -1263,8 +1262,8 @@ static BOOL s_bHandleRxEncryption (
// 2. WEP 256 // 2. WEP 256
PayloadLen -= (WLAN_HDR_ADDR3_LEN + 4 + 4); // 24 is 802.11 header,4 is IV, 4 is crc PayloadLen -= (WLAN_HDR_ADDR3_LEN + 4 + 4); // 24 is 802.11 header,4 is IV, 4 is crc
MEMvCopy(pDevice->abyPRNG, pbyIV, 3); memcpy(pDevice->abyPRNG, pbyIV, 3);
MEMvCopy(pDevice->abyPRNG + 3, pKey->abyKey, pKey->uKeyLength); memcpy(pDevice->abyPRNG + 3, pKey->abyKey, pKey->uKeyLength);
rc4_init(&pDevice->SBox, pDevice->abyPRNG, pKey->uKeyLength + 3); rc4_init(&pDevice->SBox, pDevice->abyPRNG, pKey->uKeyLength + 3);
rc4_encrypt(&pDevice->SBox, pbyIV+4, pbyIV+4, PayloadLen); rc4_encrypt(&pDevice->SBox, pbyIV+4, pbyIV+4, PayloadLen);
...@@ -1373,8 +1372,8 @@ static BOOL s_bHostWepRxEncryption ( ...@@ -1373,8 +1372,8 @@ static BOOL s_bHostWepRxEncryption (
// 3. NotOnFly // 3. NotOnFly
PayloadLen -= (WLAN_HDR_ADDR3_LEN + 4 + 4); // 24 is 802.11 header,4 is IV, 4 is crc PayloadLen -= (WLAN_HDR_ADDR3_LEN + 4 + 4); // 24 is 802.11 header,4 is IV, 4 is crc
MEMvCopy(pDevice->abyPRNG, pbyIV, 3); memcpy(pDevice->abyPRNG, pbyIV, 3);
MEMvCopy(pDevice->abyPRNG + 3, pKey->abyKey, pKey->uKeyLength); memcpy(pDevice->abyPRNG + 3, pKey->abyKey, pKey->uKeyLength);
rc4_init(&pDevice->SBox, pDevice->abyPRNG, pKey->uKeyLength + 3); rc4_init(&pDevice->SBox, pDevice->abyPRNG, pKey->uKeyLength + 3);
rc4_encrypt(&pDevice->SBox, pbyIV+4, pbyIV+4, PayloadLen); rc4_encrypt(&pDevice->SBox, pbyIV+4, pbyIV+4, PayloadLen);
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include "mac.h" #include "mac.h"
#include "card.h" #include "card.h"
#include "hostap.h" #include "hostap.h"
#include "umem.h"
#include "wpactl.h" #include "wpactl.h"
#include "rf.h" #include "rf.h"
...@@ -726,8 +725,8 @@ vConfigWEPKey ( ...@@ -726,8 +725,8 @@ vConfigWEPKey (
int ii; int ii;
ZERO_MEMORY(&pDevice->abyWepKey[dwKeyIndex][0], WLAN_WEPMAX_KEYLEN); memset(&pDevice->abyWepKey[dwKeyIndex][0], 0, WLAN_WEPMAX_KEYLEN);
MEMvCopy(&pDevice->abyWepKey[dwKeyIndex][0], pbyKey, uKeyLength); memcpy(&pDevice->abyWepKey[dwKeyIndex][0], pbyKey, uKeyLength);
pDevice->bWepKeyAvailable[dwKeyIndex] = TRUE; pDevice->bWepKeyAvailable[dwKeyIndex] = TRUE;
pDevice->auWepKeyLength[dwKeyIndex] = uKeyLength; pDevice->auWepKeyLength[dwKeyIndex] = uKeyLength;
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include "mac.h" #include "mac.h"
#include "card.h" #include "card.h"
#include "hostap.h" #include "hostap.h"
#include "umem.h"
#include "power.h" #include "power.h"
#include "rf.h" #include "rf.h"
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
#include "tmacro.h" #include "tmacro.h"
#include "tbit.h" #include "tbit.h"
#include "key.h" #include "key.h"
#include "umem.h"
#include "mac.h" #include "mac.h"
/*--------------------- Static Definitions -------------------------*/ /*--------------------- Static Definitions -------------------------*/
...@@ -247,7 +246,7 @@ BOOL KeybSetKey ( ...@@ -247,7 +246,7 @@ BOOL KeybSetKey (
pKey->uKeyLength = uKeyLength; pKey->uKeyLength = uKeyLength;
pKey->dwKeyIndex = dwKeyIndex; pKey->dwKeyIndex = dwKeyIndex;
pKey->byCipherSuite = byKeyDecMode; pKey->byCipherSuite = byKeyDecMode;
MEMvCopy(pKey->abyKey, pbyKey, uKeyLength); memcpy(pKey->abyKey, pbyKey, uKeyLength);
if (byKeyDecMode == KEY_CTL_WEP) { if (byKeyDecMode == KEY_CTL_WEP) {
if (uKeyLength == WLAN_WEP40_KEYLEN) if (uKeyLength == WLAN_WEP40_KEYLEN)
pKey->abyKey[15] &= 0x7F; pKey->abyKey[15] &= 0x7F;
...@@ -258,10 +257,10 @@ BOOL KeybSetKey ( ...@@ -258,10 +257,10 @@ BOOL KeybSetKey (
if ((dwKeyIndex & USE_KEYRSC) == 0) { if ((dwKeyIndex & USE_KEYRSC) == 0) {
// RSC set by NIC // RSC set by NIC
ZERO_MEMORY(&(pKey->KeyRSC), sizeof(QWORD)); memset(&(pKey->KeyRSC), 0, sizeof(QWORD));
} }
else { else {
MEMvCopy(&(pKey->KeyRSC), pKeyRSC, sizeof(QWORD)); memcpy(&(pKey->KeyRSC), pKeyRSC, sizeof(QWORD));
} }
pKey->dwTSC47_16 = 0; pKey->dwTSC47_16 = 0;
pKey->wTSC15_0 = 0; pKey->wTSC15_0 = 0;
...@@ -283,7 +282,7 @@ BOOL KeybSetKey ( ...@@ -283,7 +282,7 @@ BOOL KeybSetKey (
} }
} }
if (j < (MAX_KEY_TABLE-1)) { 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; pTable->KeyTable[j].bInUse = TRUE;
if ((dwKeyIndex & PAIRWISE_KEY) != 0) { if ((dwKeyIndex & PAIRWISE_KEY) != 0) {
// Pairwise key // Pairwise key
...@@ -312,7 +311,7 @@ BOOL KeybSetKey ( ...@@ -312,7 +311,7 @@ BOOL KeybSetKey (
pKey->uKeyLength = uKeyLength; pKey->uKeyLength = uKeyLength;
pKey->dwKeyIndex = dwKeyIndex; pKey->dwKeyIndex = dwKeyIndex;
pKey->byCipherSuite = byKeyDecMode; pKey->byCipherSuite = byKeyDecMode;
MEMvCopy(pKey->abyKey, pbyKey, uKeyLength); memcpy(pKey->abyKey, pbyKey, uKeyLength);
if (byKeyDecMode == KEY_CTL_WEP) { if (byKeyDecMode == KEY_CTL_WEP) {
if (uKeyLength == WLAN_WEP40_KEYLEN) if (uKeyLength == WLAN_WEP40_KEYLEN)
pKey->abyKey[15] &= 0x7F; pKey->abyKey[15] &= 0x7F;
...@@ -323,10 +322,10 @@ BOOL KeybSetKey ( ...@@ -323,10 +322,10 @@ BOOL KeybSetKey (
if ((dwKeyIndex & USE_KEYRSC) == 0) { if ((dwKeyIndex & USE_KEYRSC) == 0) {
// RSC set by NIC // RSC set by NIC
ZERO_MEMORY(&(pKey->KeyRSC), sizeof(QWORD)); memset(&(pKey->KeyRSC), 0, sizeof(QWORD));
} }
else { else {
MEMvCopy(&(pKey->KeyRSC), pKeyRSC, sizeof(QWORD)); memcpy(&(pKey->KeyRSC), pKeyRSC, sizeof(QWORD));
} }
pKey->dwTSC47_16 = 0; pKey->dwTSC47_16 = 0;
pKey->wTSC15_0 = 0; pKey->wTSC15_0 = 0;
...@@ -688,7 +687,7 @@ BOOL KeybSetDefaultKey ( ...@@ -688,7 +687,7 @@ BOOL KeybSetDefaultKey (
pKey->uKeyLength = uKeyLength; pKey->uKeyLength = uKeyLength;
pKey->dwKeyIndex = dwKeyIndex; pKey->dwKeyIndex = dwKeyIndex;
pKey->byCipherSuite = byKeyDecMode; pKey->byCipherSuite = byKeyDecMode;
MEMvCopy(pKey->abyKey, pbyKey, uKeyLength); memcpy(pKey->abyKey, pbyKey, uKeyLength);
if (byKeyDecMode == KEY_CTL_WEP) { if (byKeyDecMode == KEY_CTL_WEP) {
if (uKeyLength == WLAN_WEP40_KEYLEN) if (uKeyLength == WLAN_WEP40_KEYLEN)
pKey->abyKey[15] &= 0x7F; pKey->abyKey[15] &= 0x7F;
...@@ -699,9 +698,9 @@ BOOL KeybSetDefaultKey ( ...@@ -699,9 +698,9 @@ BOOL KeybSetDefaultKey (
if ((dwKeyIndex & USE_KEYRSC) == 0) { if ((dwKeyIndex & USE_KEYRSC) == 0) {
// RSC set by NIC // RSC set by NIC
ZERO_MEMORY(&(pKey->KeyRSC), sizeof(QWORD)); memset(&(pKey->KeyRSC), 0, sizeof(QWORD));
} else { } else {
MEMvCopy(&(pKey->KeyRSC), pKeyRSC, sizeof(QWORD)); memcpy(&(pKey->KeyRSC), pKeyRSC, sizeof(QWORD));
} }
pKey->dwTSC47_16 = 0; pKey->dwTSC47_16 = 0;
pKey->wTSC15_0 = 0; pKey->wTSC15_0 = 0;
...@@ -787,7 +786,7 @@ BOOL KeybSetAllGroupKey ( ...@@ -787,7 +786,7 @@ BOOL KeybSetAllGroupKey (
pKey->uKeyLength = uKeyLength; pKey->uKeyLength = uKeyLength;
pKey->dwKeyIndex = dwKeyIndex; pKey->dwKeyIndex = dwKeyIndex;
pKey->byCipherSuite = byKeyDecMode; pKey->byCipherSuite = byKeyDecMode;
MEMvCopy(pKey->abyKey, pbyKey, uKeyLength); memcpy(pKey->abyKey, pbyKey, uKeyLength);
if (byKeyDecMode == KEY_CTL_WEP) { if (byKeyDecMode == KEY_CTL_WEP) {
if (uKeyLength == WLAN_WEP40_KEYLEN) if (uKeyLength == WLAN_WEP40_KEYLEN)
pKey->abyKey[15] &= 0x7F; pKey->abyKey[15] &= 0x7F;
...@@ -798,10 +797,10 @@ BOOL KeybSetAllGroupKey ( ...@@ -798,10 +797,10 @@ BOOL KeybSetAllGroupKey (
if ((dwKeyIndex & USE_KEYRSC) == 0) { if ((dwKeyIndex & USE_KEYRSC) == 0) {
// RSC set by NIC // RSC set by NIC
ZERO_MEMORY(&(pKey->KeyRSC), sizeof(QWORD)); memset(&(pKey->KeyRSC), 0, sizeof(QWORD));
} }
else { else {
MEMvCopy(&(pKey->KeyRSC), pKeyRSC, sizeof(QWORD)); memcpy(&(pKey->KeyRSC), pKeyRSC, sizeof(QWORD));
} }
pKey->dwTSC47_16 = 0; pKey->dwTSC47_16 = 0;
pKey->wTSC15_0 = 0; pKey->wTSC15_0 = 0;
......
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
#include "tether.h" #include "tether.h"
#include "mib.h" #include "mib.h"
#include "wctl.h" #include "wctl.h"
#include "umem.h"
#include "baseband.h" #include "baseband.h"
/*--------------------- Static Definitions -------------------------*/ /*--------------------- Static Definitions -------------------------*/
...@@ -75,7 +74,7 @@ static int msglevel =MSG_LEVEL_INFO; ...@@ -75,7 +74,7 @@ static int msglevel =MSG_LEVEL_INFO;
void STAvClearAllCounter (PSStatCounter pStatistic) void STAvClearAllCounter (PSStatCounter pStatistic)
{ {
// set memory to zero // set memory to zero
ZERO_MEMORY(pStatistic, sizeof(SStatCounter)); memset(pStatistic, 0, sizeof(SStatCounter));
} }
...@@ -410,7 +409,7 @@ STAvUpdateRDStatCounterEx ( ...@@ -410,7 +409,7 @@ STAvUpdateRDStatCounterEx (
// rx length // rx length
pStatistic->dwCntRxFrmLength = cbFrameLength; pStatistic->dwCntRxFrmLength = cbFrameLength;
// rx pattern, we just see 10 bytes for sample // rx pattern, we just see 10 bytes for sample
MEMvCopy(pStatistic->abyCntRxPattern, (PBYTE)pbyBuffer, 10); memcpy(pStatistic->abyCntRxPattern, (PBYTE)pbyBuffer, 10);
} }
...@@ -535,7 +534,7 @@ STAvUpdateTDStatCounterEx ( ...@@ -535,7 +534,7 @@ STAvUpdateTDStatCounterEx (
// tx length // tx length
pStatistic->dwCntTxBufLength = uPktLength; pStatistic->dwCntTxBufLength = uPktLength;
// tx pattern, we just see 16 bytes for sample // tx pattern, we just see 16 bytes for sample
MEMvCopy(pStatistic->abyCntTxPattern, pbyBuffer, 16); memcpy(pStatistic->abyCntTxPattern, pbyBuffer, 16);
} }
...@@ -595,5 +594,5 @@ void ...@@ -595,5 +594,5 @@ void
STAvClear802_11Counter(PSDot11Counters p802_11Counter) STAvClear802_11Counter(PSDot11Counters p802_11Counter)
{ {
// set memory to zero // set memory to zero
ZERO_MEMORY(p802_11Counter, sizeof(SDot11Counters)); memset(p802_11Counter, 0, sizeof(SDot11Counters));
} }
...@@ -31,8 +31,6 @@ ...@@ -31,8 +31,6 @@
#ifndef __MICHAEL_H__ #ifndef __MICHAEL_H__
#define __MICHAEL_H__ #define __MICHAEL_H__
#include "umem.h"
/*--------------------- Export Definitions -------------------------*/ /*--------------------- Export Definitions -------------------------*/
/*--------------------- Export Types ------------------------------*/ /*--------------------- Export Types ------------------------------*/
......
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
#include "power.h" #include "power.h"
#include "wcmd.h" #include "wcmd.h"
#include "tbit.h" #include "tbit.h"
#include "umem.h"
#include "rxtx.h" #include "rxtx.h"
#include "card.h" #include "card.h"
......
...@@ -55,7 +55,6 @@ ...@@ -55,7 +55,6 @@
#include "bssdb.h" #include "bssdb.h"
#include "mac.h" #include "mac.h"
#include "baseband.h" #include "baseband.h"
#include "umem.h"
#include "michael.h" #include "michael.h"
#include "tkip.h" #include "tkip.h"
#include "tcrc.h" #include "tcrc.h"
...@@ -242,16 +241,16 @@ s_vFillTxKey ( ...@@ -242,16 +241,16 @@ s_vFillTxKey (
if (pTransmitKey->byCipherSuite == KEY_CTL_WEP) { if (pTransmitKey->byCipherSuite == KEY_CTL_WEP) {
if (pTransmitKey->uKeyLength == WLAN_WEP232_KEYLEN ){ if (pTransmitKey->uKeyLength == WLAN_WEP232_KEYLEN ){
MEMvCopy(pDevice->abyPRNG, (PBYTE)&(dwRevIVCounter), 3); memcpy(pDevice->abyPRNG, (PBYTE)&(dwRevIVCounter), 3);
MEMvCopy(pDevice->abyPRNG+3, pTransmitKey->abyKey, pTransmitKey->uKeyLength); memcpy(pDevice->abyPRNG+3, pTransmitKey->abyKey, pTransmitKey->uKeyLength);
} else { } else {
MEMvCopy(pbyBuf, (PBYTE)&(dwRevIVCounter), 3); memcpy(pbyBuf, (PBYTE)&(dwRevIVCounter), 3);
MEMvCopy(pbyBuf+3, pTransmitKey->abyKey, pTransmitKey->uKeyLength); memcpy(pbyBuf+3, pTransmitKey->abyKey, pTransmitKey->uKeyLength);
if(pTransmitKey->uKeyLength == WLAN_WEP40_KEYLEN) { if(pTransmitKey->uKeyLength == WLAN_WEP40_KEYLEN) {
MEMvCopy(pbyBuf+8, (PBYTE)&(dwRevIVCounter), 3); memcpy(pbyBuf+8, (PBYTE)&(dwRevIVCounter), 3);
MEMvCopy(pbyBuf+11, pTransmitKey->abyKey, pTransmitKey->uKeyLength); memcpy(pbyBuf+11, pTransmitKey->abyKey, pTransmitKey->uKeyLength);
} }
MEMvCopy(pDevice->abyPRNG, pbyBuf, 16); memcpy(pDevice->abyPRNG, pbyBuf, 16);
} }
// Append IV after Mac Header // Append IV after Mac Header
*pdwIV &= WEP_IV_MASK;//00000000 11111111 11111111 11111111 *pdwIV &= WEP_IV_MASK;//00000000 11111111 11111111 11111111
...@@ -268,9 +267,9 @@ s_vFillTxKey ( ...@@ -268,9 +267,9 @@ s_vFillTxKey (
} }
TKIPvMixKey(pTransmitKey->abyKey, pDevice->abyCurrentNetAddr, TKIPvMixKey(pTransmitKey->abyKey, pDevice->abyCurrentNetAddr,
pTransmitKey->wTSC15_0, pTransmitKey->dwTSC47_16, pDevice->abyPRNG); pTransmitKey->wTSC15_0, pTransmitKey->dwTSC47_16, pDevice->abyPRNG);
MEMvCopy(pbyBuf, pDevice->abyPRNG, 16); memcpy(pbyBuf, pDevice->abyPRNG, 16);
// Make IV // Make IV
MEMvCopy(pdwIV, pDevice->abyPRNG, 3); memcpy(pdwIV, pDevice->abyPRNG, 3);
*(pbyIVHead+3) = (BYTE)(((byKeyIndex << 6) & 0xc0) | 0x20); // 0x20 is ExtIV *(pbyIVHead+3) = (BYTE)(((byKeyIndex << 6) & 0xc0) | 0x20); // 0x20 is ExtIV
// Append IV&ExtIV after Mac Header // Append IV&ExtIV after Mac Header
...@@ -282,7 +281,7 @@ s_vFillTxKey ( ...@@ -282,7 +281,7 @@ s_vFillTxKey (
if (pTransmitKey->wTSC15_0 == 0) { if (pTransmitKey->wTSC15_0 == 0) {
pTransmitKey->dwTSC47_16++; pTransmitKey->dwTSC47_16++;
} }
MEMvCopy(pbyBuf, pTransmitKey->abyKey, 16); memcpy(pbyBuf, pTransmitKey->abyKey, 16);
// Make IV // Make IV
*pdwIV = 0; *pdwIV = 0;
...@@ -294,7 +293,7 @@ s_vFillTxKey ( ...@@ -294,7 +293,7 @@ s_vFillTxKey (
//Fill MICHDR0 //Fill MICHDR0
*pMICHDR = 0x59; *pMICHDR = 0x59;
*((PBYTE)(pMICHDR+1)) = 0; // TxPriority *((PBYTE)(pMICHDR+1)) = 0; // TxPriority
MEMvCopy(pMICHDR+2, &(pMACHeader->abyAddr2[0]), 6); memcpy(pMICHDR+2, &(pMACHeader->abyAddr2[0]), 6);
*((PBYTE)(pMICHDR+8)) = HIBYTE(HIWORD(pTransmitKey->dwTSC47_16)); *((PBYTE)(pMICHDR+8)) = HIBYTE(HIWORD(pTransmitKey->dwTSC47_16));
*((PBYTE)(pMICHDR+9)) = LOBYTE(HIWORD(pTransmitKey->dwTSC47_16)); *((PBYTE)(pMICHDR+9)) = LOBYTE(HIWORD(pTransmitKey->dwTSC47_16));
*((PBYTE)(pMICHDR+10)) = HIBYTE(LOWORD(pTransmitKey->dwTSC47_16)); *((PBYTE)(pMICHDR+10)) = HIBYTE(LOWORD(pTransmitKey->dwTSC47_16));
...@@ -312,18 +311,18 @@ s_vFillTxKey ( ...@@ -312,18 +311,18 @@ s_vFillTxKey (
*((PBYTE)(pMICHDR+17)) = 22; // HLEN[7:0] *((PBYTE)(pMICHDR+17)) = 22; // HLEN[7:0]
} }
wValue = cpu_to_le16(pMACHeader->wFrameCtl & 0xC78F); wValue = cpu_to_le16(pMACHeader->wFrameCtl & 0xC78F);
MEMvCopy(pMICHDR+18, (PBYTE)&wValue, 2); // MSKFRACTL memcpy(pMICHDR+18, (PBYTE)&wValue, 2); // MSKFRACTL
MEMvCopy(pMICHDR+20, &(pMACHeader->abyAddr1[0]), 6); memcpy(pMICHDR+20, &(pMACHeader->abyAddr1[0]), 6);
MEMvCopy(pMICHDR+26, &(pMACHeader->abyAddr2[0]), 6); memcpy(pMICHDR+26, &(pMACHeader->abyAddr2[0]), 6);
//Fill MICHDR2 //Fill MICHDR2
MEMvCopy(pMICHDR+32, &(pMACHeader->abyAddr3[0]), 6); memcpy(pMICHDR+32, &(pMACHeader->abyAddr3[0]), 6);
wValue = pMACHeader->wSeqCtl; wValue = pMACHeader->wSeqCtl;
wValue &= 0x000F; wValue &= 0x000F;
wValue = cpu_to_le16(wValue); wValue = cpu_to_le16(wValue);
MEMvCopy(pMICHDR+38, (PBYTE)&wValue, 2); // MSKSEQCTL memcpy(pMICHDR+38, (PBYTE)&wValue, 2); // MSKSEQCTL
if (pDevice->bLongHeader) { if (pDevice->bLongHeader) {
MEMvCopy(pMICHDR+40, &(pMACHeader->abyAddr4[0]), 6); memcpy(pMICHDR+40, &(pMACHeader->abyAddr4[0]), 6);
} }
} }
} }
...@@ -902,16 +901,16 @@ s_vFillRTSHead ( ...@@ -902,16 +901,16 @@ s_vFillRTSHead (
pBuf->Data.wFrameControl = TYPE_CTL_RTS;//0x00B4 pBuf->Data.wFrameControl = TYPE_CTL_RTS;//0x00B4
if ((pDevice->eOPMode == OP_MODE_ADHOC) || if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) { (pDevice->eOPMode == OP_MODE_AP)) {
MEMvCopy(&(pBuf->Data.abyRA[0]), &(psEthHeader->abyDstAddr[0]), U_ETHER_ADDR_LEN); memcpy(&(pBuf->Data.abyRA[0]), &(psEthHeader->abyDstAddr[0]), U_ETHER_ADDR_LEN);
} }
else { else {
MEMvCopy(&(pBuf->Data.abyRA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN); memcpy(&(pBuf->Data.abyRA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN);
} }
if (pDevice->eOPMode == OP_MODE_AP) { if (pDevice->eOPMode == OP_MODE_AP) {
MEMvCopy(&(pBuf->Data.abyTA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN); memcpy(&(pBuf->Data.abyTA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN);
} }
else { else {
MEMvCopy(&(pBuf->Data.abyTA[0]), &(psEthHeader->abySrcAddr[0]), U_ETHER_ADDR_LEN); memcpy(&(pBuf->Data.abyTA[0]), &(psEthHeader->abySrcAddr[0]), U_ETHER_ADDR_LEN);
} }
} }
else { else {
...@@ -940,17 +939,17 @@ s_vFillRTSHead ( ...@@ -940,17 +939,17 @@ s_vFillRTSHead (
if ((pDevice->eOPMode == OP_MODE_ADHOC) || if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) { (pDevice->eOPMode == OP_MODE_AP)) {
MEMvCopy(&(pBuf->Data.abyRA[0]), &(psEthHeader->abyDstAddr[0]), U_ETHER_ADDR_LEN); memcpy(&(pBuf->Data.abyRA[0]), &(psEthHeader->abyDstAddr[0]), U_ETHER_ADDR_LEN);
} }
else { else {
MEMvCopy(&(pBuf->Data.abyRA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN); memcpy(&(pBuf->Data.abyRA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN);
} }
if (pDevice->eOPMode == OP_MODE_AP) { if (pDevice->eOPMode == OP_MODE_AP) {
MEMvCopy(&(pBuf->Data.abyTA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN); memcpy(&(pBuf->Data.abyTA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN);
} }
else { else {
MEMvCopy(&(pBuf->Data.abyTA[0]), &(psEthHeader->abySrcAddr[0]), U_ETHER_ADDR_LEN); memcpy(&(pBuf->Data.abyTA[0]), &(psEthHeader->abySrcAddr[0]), U_ETHER_ADDR_LEN);
} }
} // if (byFBOption == AUTO_FB_NONE) } // if (byFBOption == AUTO_FB_NONE)
...@@ -971,17 +970,17 @@ s_vFillRTSHead ( ...@@ -971,17 +970,17 @@ s_vFillRTSHead (
if ((pDevice->eOPMode == OP_MODE_ADHOC) || if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) { (pDevice->eOPMode == OP_MODE_AP)) {
MEMvCopy(&(pBuf->Data.abyRA[0]), &(psEthHeader->abyDstAddr[0]), U_ETHER_ADDR_LEN); memcpy(&(pBuf->Data.abyRA[0]), &(psEthHeader->abyDstAddr[0]), U_ETHER_ADDR_LEN);
} }
else { else {
MEMvCopy(&(pBuf->Data.abyRA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN); memcpy(&(pBuf->Data.abyRA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN);
} }
if (pDevice->eOPMode == OP_MODE_AP) { if (pDevice->eOPMode == OP_MODE_AP) {
MEMvCopy(&(pBuf->Data.abyTA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN); memcpy(&(pBuf->Data.abyTA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN);
} }
else { else {
MEMvCopy(&(pBuf->Data.abyTA[0]), &(psEthHeader->abySrcAddr[0]), U_ETHER_ADDR_LEN); memcpy(&(pBuf->Data.abyTA[0]), &(psEthHeader->abySrcAddr[0]), U_ETHER_ADDR_LEN);
} }
} }
...@@ -1002,16 +1001,16 @@ s_vFillRTSHead ( ...@@ -1002,16 +1001,16 @@ s_vFillRTSHead (
if ((pDevice->eOPMode == OP_MODE_ADHOC) || if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) { (pDevice->eOPMode == OP_MODE_AP)) {
MEMvCopy(&(pBuf->Data.abyRA[0]), &(psEthHeader->abyDstAddr[0]), U_ETHER_ADDR_LEN); memcpy(&(pBuf->Data.abyRA[0]), &(psEthHeader->abyDstAddr[0]), U_ETHER_ADDR_LEN);
} }
else { else {
MEMvCopy(&(pBuf->Data.abyRA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN); memcpy(&(pBuf->Data.abyRA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN);
} }
if (pDevice->eOPMode == OP_MODE_AP) { if (pDevice->eOPMode == OP_MODE_AP) {
MEMvCopy(&(pBuf->Data.abyTA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN); memcpy(&(pBuf->Data.abyTA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN);
} }
else { else {
MEMvCopy(&(pBuf->Data.abyTA[0]), &(psEthHeader->abySrcAddr[0]), U_ETHER_ADDR_LEN); memcpy(&(pBuf->Data.abyTA[0]), &(psEthHeader->abySrcAddr[0]), U_ETHER_ADDR_LEN);
} }
} }
} }
...@@ -1031,17 +1030,17 @@ s_vFillRTSHead ( ...@@ -1031,17 +1030,17 @@ s_vFillRTSHead (
if ((pDevice->eOPMode == OP_MODE_ADHOC) || if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) { (pDevice->eOPMode == OP_MODE_AP)) {
MEMvCopy(&(pBuf->Data.abyRA[0]), &(psEthHeader->abyDstAddr[0]), U_ETHER_ADDR_LEN); memcpy(&(pBuf->Data.abyRA[0]), &(psEthHeader->abyDstAddr[0]), U_ETHER_ADDR_LEN);
} }
else { else {
MEMvCopy(&(pBuf->Data.abyRA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN); memcpy(&(pBuf->Data.abyRA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN);
} }
if (pDevice->eOPMode == OP_MODE_AP) { if (pDevice->eOPMode == OP_MODE_AP) {
MEMvCopy(&(pBuf->Data.abyTA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN); memcpy(&(pBuf->Data.abyTA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN);
} }
else { else {
MEMvCopy(&(pBuf->Data.abyTA[0]), &(psEthHeader->abySrcAddr[0]), U_ETHER_ADDR_LEN); memcpy(&(pBuf->Data.abyTA[0]), &(psEthHeader->abySrcAddr[0]), U_ETHER_ADDR_LEN);
} }
} }
} }
...@@ -1100,7 +1099,7 @@ s_vFillCTSHead ( ...@@ -1100,7 +1099,7 @@ s_vFillCTSHead (
pBuf->Data.wDurationID = pBuf->wDuration_ba; pBuf->Data.wDurationID = pBuf->wDuration_ba;
pBuf->Data.wFrameControl = TYPE_CTL_CTS;//0x00C4 pBuf->Data.wFrameControl = TYPE_CTL_CTS;//0x00C4
pBuf->Data.wReserved = 0x0000; pBuf->Data.wReserved = 0x0000;
MEMvCopy(&(pBuf->Data.abyRA[0]), &(pDevice->abyCurrentNetAddr[0]), U_ETHER_ADDR_LEN); memcpy(&(pBuf->Data.abyRA[0]), &(pDevice->abyCurrentNetAddr[0]), U_ETHER_ADDR_LEN);
} else { //if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA) } else { //if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA)
PSCTS pBuf = (PSCTS)pvCTS; PSCTS pBuf = (PSCTS)pvCTS;
...@@ -1118,7 +1117,7 @@ s_vFillCTSHead ( ...@@ -1118,7 +1117,7 @@ s_vFillCTSHead (
pBuf->Data.wDurationID = pBuf->wDuration_ba; pBuf->Data.wDurationID = pBuf->wDuration_ba;
pBuf->Data.wFrameControl = TYPE_CTL_CTS;//0x00C4 pBuf->Data.wFrameControl = TYPE_CTL_CTS;//0x00C4
pBuf->Data.wReserved = 0x0000; pBuf->Data.wReserved = 0x0000;
MEMvCopy(&(pBuf->Data.abyRA[0]), &(pDevice->abyCurrentNetAddr[0]), U_ETHER_ADDR_LEN); memcpy(&(pBuf->Data.abyRA[0]), &(pDevice->abyCurrentNetAddr[0]), U_ETHER_ADDR_LEN);
} }
} }
} }
...@@ -1546,7 +1545,7 @@ s_cbFillTxBufHead ( ...@@ -1546,7 +1545,7 @@ s_cbFillTxBufHead (
} }
} // Auto Fall Back } // Auto Fall Back
} }
ZERO_MEMORY((PVOID)(pbyTxBufferAddr + wTxBufSize), (cbHeaderLength - wTxBufSize)); memset((PVOID)(pbyTxBufferAddr + wTxBufSize), 0, (cbHeaderLength - wTxBufSize));
////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////
if ((bNeedEncrypt == TRUE) && (pTransmitKey != NULL) && (pTransmitKey->byCipherSuite == KEY_CTL_TKIP)) { if ((bNeedEncrypt == TRUE) && (pTransmitKey != NULL) && (pTransmitKey->byCipherSuite == KEY_CTL_TKIP)) {
...@@ -1627,13 +1626,13 @@ s_cbFillTxBufHead ( ...@@ -1627,13 +1626,13 @@ s_cbFillTxBufHead (
if (ntohs(psEthHeader->wType) > MAX_DATA_LEN) { if (ntohs(psEthHeader->wType) > MAX_DATA_LEN) {
if ((psEthHeader->wType == TYPE_PKT_IPX) || if ((psEthHeader->wType == TYPE_PKT_IPX) ||
(psEthHeader->wType == cpu_to_le16(0xF380))) { (psEthHeader->wType == cpu_to_le16(0xF380))) {
MEMvCopy((PBYTE) (pbyPayloadHead), &pDevice->abySNAP_Bridgetunnel[0], 6); memcpy((PBYTE) (pbyPayloadHead), &pDevice->abySNAP_Bridgetunnel[0], 6);
} }
else { else {
MEMvCopy((PBYTE) (pbyPayloadHead), &pDevice->abySNAP_RFC1042[0], 6); memcpy((PBYTE) (pbyPayloadHead), &pDevice->abySNAP_RFC1042[0], 6);
} }
pbyType = (PBYTE) (pbyPayloadHead + 6); pbyType = (PBYTE) (pbyPayloadHead + 6);
MEMvCopy(pbyType, &(psEthHeader->wType), sizeof(WORD)); memcpy(pbyType, &(psEthHeader->wType), sizeof(WORD));
cb802_1_H_len = 8; cb802_1_H_len = 8;
} }
...@@ -1655,10 +1654,10 @@ s_cbFillTxBufHead ( ...@@ -1655,10 +1654,10 @@ s_cbFillTxBufHead (
uLength = cbHeaderLength + cbMACHdLen + uPadding + cbIVlen + cb802_1_H_len; uLength = cbHeaderLength + cbMACHdLen + uPadding + cbIVlen + cb802_1_H_len;
//copy TxBufferHeader + MacHeader to desc //copy TxBufferHeader + MacHeader to desc
MEMvCopy(pbyBuffer, (PVOID)psTxBufHd, uLength); memcpy(pbyBuffer, (PVOID)psTxBufHd, uLength);
// Copy the Packet into a tx Buffer // Copy the Packet into a tx Buffer
MEMvCopy((pbyBuffer + uLength), (pPacket + 14), (cbFragPayloadSize - cb802_1_H_len)); memcpy((pbyBuffer + uLength), (pPacket + 14), (cbFragPayloadSize - cb802_1_H_len));
uTotalCopyLength += cbFragPayloadSize - cb802_1_H_len; uTotalCopyLength += cbFragPayloadSize - cb802_1_H_len;
...@@ -1742,12 +1741,12 @@ s_cbFillTxBufHead ( ...@@ -1742,12 +1741,12 @@ s_cbFillTxBufHead (
uLength = cbHeaderLength + cbMACHdLen + uPadding + cbIVlen; uLength = cbHeaderLength + cbMACHdLen + uPadding + cbIVlen;
//copy TxBufferHeader + MacHeader to desc //copy TxBufferHeader + MacHeader to desc
MEMvCopy(pbyBuffer, (PVOID)psTxBufHd, uLength); memcpy(pbyBuffer, (PVOID)psTxBufHd, uLength);
// Copy the Packet into a tx Buffer // Copy the Packet into a tx Buffer
if (bMIC2Frag == FALSE) { if (bMIC2Frag == FALSE) {
MEMvCopy((pbyBuffer + uLength), memcpy((pbyBuffer + uLength),
(pPacket + 14 + uTotalCopyLength), (pPacket + 14 + uTotalCopyLength),
(cbLastFragPayloadSize - cbMIClen) (cbLastFragPayloadSize - cbMIClen)
); );
...@@ -1768,16 +1767,16 @@ s_cbFillTxBufHead ( ...@@ -1768,16 +1767,16 @@ s_cbFillTxBufHead (
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Last MIC:%lX, %lX\n", *pdwMIC_L, *pdwMIC_R); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Last MIC:%lX, %lX\n", *pdwMIC_L, *pdwMIC_R);
} else { } else {
if (uMICFragLen >= 4) { if (uMICFragLen >= 4) {
MEMvCopy((pbyBuffer + uLength), ((PBYTE)&dwSafeMIC_R + (uMICFragLen - 4)), memcpy((pbyBuffer + uLength), ((PBYTE)&dwSafeMIC_R + (uMICFragLen - 4)),
(cbMIClen - uMICFragLen)); (cbMIClen - uMICFragLen));
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"LAST: uMICFragLen >= 4: %X, %d\n", DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"LAST: uMICFragLen >= 4: %X, %d\n",
*(PBYTE)((PBYTE)&dwSafeMIC_R + (uMICFragLen - 4)), *(PBYTE)((PBYTE)&dwSafeMIC_R + (uMICFragLen - 4)),
(cbMIClen - uMICFragLen)); (cbMIClen - uMICFragLen));
} else { } else {
MEMvCopy((pbyBuffer + uLength), ((PBYTE)&dwSafeMIC_L + uMICFragLen), memcpy((pbyBuffer + uLength), ((PBYTE)&dwSafeMIC_L + uMICFragLen),
(4 - uMICFragLen)); (4 - uMICFragLen));
MEMvCopy((pbyBuffer + uLength + (4 - uMICFragLen)), &dwSafeMIC_R, 4); memcpy((pbyBuffer + uLength + (4 - uMICFragLen)), &dwSafeMIC_R, 4);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"LAST: uMICFragLen < 4: %X, %d\n", DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"LAST: uMICFragLen < 4: %X, %d\n",
*(PBYTE)((PBYTE)&dwSafeMIC_R + uMICFragLen - 4), *(PBYTE)((PBYTE)&dwSafeMIC_R + uMICFragLen - 4),
(cbMIClen - uMICFragLen)); (cbMIClen - uMICFragLen));
...@@ -1877,10 +1876,10 @@ s_cbFillTxBufHead ( ...@@ -1877,10 +1876,10 @@ s_cbFillTxBufHead (
uLength = cbHeaderLength + cbMACHdLen + uPadding + cbIVlen; uLength = cbHeaderLength + cbMACHdLen + uPadding + cbIVlen;
//copy TxBufferHeader + MacHeader to desc //copy TxBufferHeader + MacHeader to desc
MEMvCopy(pbyBuffer, (PVOID)psTxBufHd, uLength); memcpy(pbyBuffer, (PVOID)psTxBufHd, uLength);
// Copy the Packet into a tx Buffer // Copy the Packet into a tx Buffer
MEMvCopy((pbyBuffer + uLength), memcpy((pbyBuffer + uLength),
(pPacket + 14 + uTotalCopyLength), (pPacket + 14 + uTotalCopyLength),
cbFragPayloadSize cbFragPayloadSize
); );
...@@ -1991,13 +1990,13 @@ s_cbFillTxBufHead ( ...@@ -1991,13 +1990,13 @@ s_cbFillTxBufHead (
if (ntohs(psEthHeader->wType) > MAX_DATA_LEN) { if (ntohs(psEthHeader->wType) > MAX_DATA_LEN) {
if ((psEthHeader->wType == TYPE_PKT_IPX) || if ((psEthHeader->wType == TYPE_PKT_IPX) ||
(psEthHeader->wType == cpu_to_le16(0xF380))) { (psEthHeader->wType == cpu_to_le16(0xF380))) {
MEMvCopy((PBYTE) (pbyPayloadHead), &pDevice->abySNAP_Bridgetunnel[0], 6); memcpy((PBYTE) (pbyPayloadHead), &pDevice->abySNAP_Bridgetunnel[0], 6);
} }
else { else {
MEMvCopy((PBYTE) (pbyPayloadHead), &pDevice->abySNAP_RFC1042[0], 6); memcpy((PBYTE) (pbyPayloadHead), &pDevice->abySNAP_RFC1042[0], 6);
} }
pbyType = (PBYTE) (pbyPayloadHead + 6); pbyType = (PBYTE) (pbyPayloadHead + 6);
MEMvCopy(pbyType, &(psEthHeader->wType), sizeof(WORD)); memcpy(pbyType, &(psEthHeader->wType), sizeof(WORD));
cb802_1_H_len = 8; cb802_1_H_len = 8;
} }
...@@ -2017,10 +2016,10 @@ s_cbFillTxBufHead ( ...@@ -2017,10 +2016,10 @@ s_cbFillTxBufHead (
uLength = cbHeaderLength + cbMACHdLen + uPadding + cbIVlen + cb802_1_H_len; uLength = cbHeaderLength + cbMACHdLen + uPadding + cbIVlen + cb802_1_H_len;
//copy TxBufferHeader + MacHeader to desc //copy TxBufferHeader + MacHeader to desc
MEMvCopy(pbyBuffer, (PVOID)psTxBufHd, uLength); memcpy(pbyBuffer, (PVOID)psTxBufHd, uLength);
// Copy the Packet into a tx Buffer // Copy the Packet into a tx Buffer
MEMvCopy((pbyBuffer + uLength), memcpy((pbyBuffer + uLength),
(pPacket + 14), (pPacket + 14),
cbFrameBodySize - cb802_1_H_len cbFrameBodySize - cb802_1_H_len
); );
...@@ -2120,7 +2119,7 @@ vGenerateFIFOHeader ( ...@@ -2120,7 +2119,7 @@ vGenerateFIFOHeader (
wTxBufSize = sizeof(STxBufHead); wTxBufSize = sizeof(STxBufHead);
ZERO_MEMORY(pTxBufHead, wTxBufSize); memset(pTxBufHead, 0, wTxBufSize);
//Set FIFOCTL_NEEDACK //Set FIFOCTL_NEEDACK
if ((pDevice->eOPMode == OP_MODE_ADHOC) || if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
...@@ -2280,7 +2279,7 @@ vGenerateMACHeader ( ...@@ -2280,7 +2279,7 @@ vGenerateMACHeader (
{ {
PS802_11Header pMACHeader = (PS802_11Header)pbyBufferAddr; PS802_11Header pMACHeader = (PS802_11Header)pbyBufferAddr;
ZERO_MEMORY(pMACHeader, (sizeof(S802_11Header))); //- sizeof(pMACHeader->dwIV))); memset(pMACHeader, 0, (sizeof(S802_11Header))); //- sizeof(pMACHeader->dwIV)));
if (uDMAIdx == TYPE_ATIMDMA) { if (uDMAIdx == TYPE_ATIMDMA) {
pMACHeader->wFrameCtl = TYPE_802_11_ATIM; pMACHeader->wFrameCtl = TYPE_802_11_ATIM;
...@@ -2289,21 +2288,21 @@ vGenerateMACHeader ( ...@@ -2289,21 +2288,21 @@ vGenerateMACHeader (
} }
if (pDevice->eOPMode == OP_MODE_AP) { if (pDevice->eOPMode == OP_MODE_AP) {
MEMvCopy(&(pMACHeader->abyAddr1[0]), &(psEthHeader->abyDstAddr[0]), U_ETHER_ADDR_LEN); memcpy(&(pMACHeader->abyAddr1[0]), &(psEthHeader->abyDstAddr[0]), U_ETHER_ADDR_LEN);
MEMvCopy(&(pMACHeader->abyAddr2[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN); memcpy(&(pMACHeader->abyAddr2[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN);
MEMvCopy(&(pMACHeader->abyAddr3[0]), &(psEthHeader->abySrcAddr[0]), U_ETHER_ADDR_LEN); memcpy(&(pMACHeader->abyAddr3[0]), &(psEthHeader->abySrcAddr[0]), U_ETHER_ADDR_LEN);
pMACHeader->wFrameCtl |= FC_FROMDS; pMACHeader->wFrameCtl |= FC_FROMDS;
} }
else { else {
if (pDevice->eOPMode == OP_MODE_ADHOC) { if (pDevice->eOPMode == OP_MODE_ADHOC) {
MEMvCopy(&(pMACHeader->abyAddr1[0]), &(psEthHeader->abyDstAddr[0]), U_ETHER_ADDR_LEN); memcpy(&(pMACHeader->abyAddr1[0]), &(psEthHeader->abyDstAddr[0]), U_ETHER_ADDR_LEN);
MEMvCopy(&(pMACHeader->abyAddr2[0]), &(psEthHeader->abySrcAddr[0]), U_ETHER_ADDR_LEN); memcpy(&(pMACHeader->abyAddr2[0]), &(psEthHeader->abySrcAddr[0]), U_ETHER_ADDR_LEN);
MEMvCopy(&(pMACHeader->abyAddr3[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN); memcpy(&(pMACHeader->abyAddr3[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN);
} }
else { else {
MEMvCopy(&(pMACHeader->abyAddr3[0]), &(psEthHeader->abyDstAddr[0]), U_ETHER_ADDR_LEN); memcpy(&(pMACHeader->abyAddr3[0]), &(psEthHeader->abyDstAddr[0]), U_ETHER_ADDR_LEN);
MEMvCopy(&(pMACHeader->abyAddr2[0]), &(psEthHeader->abySrcAddr[0]), U_ETHER_ADDR_LEN); memcpy(&(pMACHeader->abyAddr2[0]), &(psEthHeader->abySrcAddr[0]), U_ETHER_ADDR_LEN);
MEMvCopy(&(pMACHeader->abyAddr1[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN); memcpy(&(pMACHeader->abyAddr1[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN);
pMACHeader->wFrameCtl |= FC_TODS; pMACHeader->wFrameCtl |= FC_TODS;
} }
} }
...@@ -2316,7 +2315,7 @@ vGenerateMACHeader ( ...@@ -2316,7 +2315,7 @@ vGenerateMACHeader (
if (pDevice->bLongHeader) { if (pDevice->bLongHeader) {
PWLAN_80211HDR_A4 pMACA4Header = (PWLAN_80211HDR_A4) pbyBufferAddr; PWLAN_80211HDR_A4 pMACA4Header = (PWLAN_80211HDR_A4) pbyBufferAddr;
pMACHeader->wFrameCtl |= (FC_TODS | FC_FROMDS); pMACHeader->wFrameCtl |= (FC_TODS | FC_FROMDS);
MEMvCopy(pMACA4Header->abyAddr4, pDevice->abyBSSID, WLAN_ADDR_LEN); memcpy(pMACA4Header->abyAddr4, pDevice->abyBSSID, WLAN_ADDR_LEN);
} }
pMACHeader->wSeqCtl = cpu_to_le16(pDevice->wSeqCounter << 4); pMACHeader->wSeqCtl = cpu_to_le16(pDevice->wSeqCounter << 4);
...@@ -2518,10 +2517,10 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { ...@@ -2518,10 +2517,10 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) {
cbHeaderSize = wTxBufSize + sizeof(SRrvTime_ab) + sizeof(STxDataHead_ab); cbHeaderSize = wTxBufSize + sizeof(SRrvTime_ab) + sizeof(STxDataHead_ab);
} }
ZERO_MEMORY((PVOID)(pbyTxBufferAddr + wTxBufSize), (cbHeaderSize - wTxBufSize)); memset((PVOID)(pbyTxBufferAddr + wTxBufSize), 0, (cbHeaderSize - wTxBufSize));
MEMvCopy(&(sEthHeader.abyDstAddr[0]), &(pPacket->p80211Header->sA3.abyAddr1[0]), U_ETHER_ADDR_LEN); memcpy(&(sEthHeader.abyDstAddr[0]), &(pPacket->p80211Header->sA3.abyAddr1[0]), U_ETHER_ADDR_LEN);
MEMvCopy(&(sEthHeader.abySrcAddr[0]), &(pPacket->p80211Header->sA3.abyAddr2[0]), U_ETHER_ADDR_LEN); memcpy(&(sEthHeader.abySrcAddr[0]), &(pPacket->p80211Header->sA3.abyAddr2[0]), U_ETHER_ADDR_LEN);
//========================= //=========================
// No Fragmentation // No Fragmentation
//========================= //=========================
...@@ -2591,13 +2590,13 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { ...@@ -2591,13 +2590,13 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) {
s_vFillTxKey(pDevice, (PBYTE)(pTxBufHead->adwTxKey), pbyIVHead, pTransmitKey, s_vFillTxKey(pDevice, (PBYTE)(pTxBufHead->adwTxKey), pbyIVHead, pTransmitKey,
(PBYTE)pMACHeader, (WORD)cbFrameBodySize, NULL); (PBYTE)pMACHeader, (WORD)cbFrameBodySize, NULL);
MEMvCopy(pMACHeader, pPacket->p80211Header, cbMacHdLen); memcpy(pMACHeader, pPacket->p80211Header, cbMacHdLen);
MEMvCopy(pbyPayloadHead, ((PBYTE)(pPacket->p80211Header) + cbMacHdLen), memcpy(pbyPayloadHead, ((PBYTE)(pPacket->p80211Header) + cbMacHdLen),
cbFrameBodySize); cbFrameBodySize);
} }
else { else {
// Copy the Packet into a tx Buffer // Copy the Packet into a tx Buffer
MEMvCopy(pMACHeader, pPacket->p80211Header, pPacket->cbMPDULen); memcpy(pMACHeader, pPacket->p80211Header, pPacket->cbMPDULen);
} }
pMACHeader->wSeqCtl = cpu_to_le16(pDevice->wSeqCounter << 4); pMACHeader->wSeqCtl = cpu_to_le16(pDevice->wSeqCounter << 4);
...@@ -2714,7 +2713,7 @@ CMD_STATUS csBeacon_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { ...@@ -2714,7 +2713,7 @@ CMD_STATUS csBeacon_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) {
//Generate Beacon Header //Generate Beacon Header
pMACHeader = (PS802_11Header)(pbyBuffer + cbHeaderSize); pMACHeader = (PS802_11Header)(pbyBuffer + cbHeaderSize);
MEMvCopy(pMACHeader, pPacket->p80211Header, pPacket->cbMPDULen); memcpy(pMACHeader, pPacket->p80211Header, pPacket->cbMPDULen);
pMACHeader->wDurationID = 0; pMACHeader->wDurationID = 0;
pMACHeader->wSeqCtl = cpu_to_le16(pDevice->wSeqCounter << 4); pMACHeader->wSeqCtl = cpu_to_le16(pDevice->wSeqCounter << 4);
...@@ -3063,9 +3062,9 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, PBYTE pbMPDU, UINT cbMPDU ...@@ -3063,9 +3062,9 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, PBYTE pbMPDU, UINT cbMPDU
} }
ZERO_MEMORY((PVOID)(pbyTxBufferAddr + wTxBufSize), (cbHeaderSize - wTxBufSize)); memset((PVOID)(pbyTxBufferAddr + wTxBufSize), 0, (cbHeaderSize - wTxBufSize));
MEMvCopy(&(sEthHeader.abyDstAddr[0]), &(p80211Header->sA3.abyAddr1[0]), U_ETHER_ADDR_LEN); memcpy(&(sEthHeader.abyDstAddr[0]), &(p80211Header->sA3.abyAddr1[0]), U_ETHER_ADDR_LEN);
MEMvCopy(&(sEthHeader.abySrcAddr[0]), &(p80211Header->sA3.abyAddr2[0]), U_ETHER_ADDR_LEN); memcpy(&(sEthHeader.abySrcAddr[0]), &(p80211Header->sA3.abyAddr2[0]), U_ETHER_ADDR_LEN);
//========================= //=========================
// No Fragmentation // No Fragmentation
//========================= //=========================
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include "tmacro.h" #include "tmacro.h"
#include "tbit.h" #include "tbit.h"
#include "tkip.h" #include "tkip.h"
#include "umem.h"
/*--------------------- Static Definitions -------------------------*/ /*--------------------- Static Definitions -------------------------*/
......
/*
* Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*
* File: umem.h
*
* Purpose: Define Memory macros
*
* Author: Tevin Chen
*
* Date: Mar 17, 1997
*
*/
#ifndef __UMEM_H__
#define __UMEM_H__
#include "ttype.h"
/*--------------------- Export Definitions -------------------------*/
// 4-byte memory tag
#define MEM_TAG 'mTEW'
// Macros used for memory allocation and deallocation.
#define ZERO_MEMORY(Destination,Length) { \
memset((PVOID)(Destination), \
0, \
(ULONG)(Length) \
); \
}
#define MEMvCopy(pvDest, pvSource, uCount) { \
memcpy((PVOID)(pvDest), \
(PVOID)(pvSource), \
(ULONG)(uCount) \
); \
}
#define MEMEqualMemory(Destination,Source,Length) (!memcmp((Destination),(Source),(Length)))
/*--------------------- Export Classes ----------------------------*/
/*--------------------- Export Variables --------------------------*/
/*--------------------- Export Functions --------------------------*/
#endif // __UMEM_H__
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
*/ */
#include "vntwifi.h" #include "vntwifi.h"
#include "umem.h"
#include "tbit.h" #include "tbit.h"
#include "IEEE11h.h" #include "IEEE11h.h"
#include "country.h" #include "country.h"
...@@ -677,7 +676,7 @@ VNTWIFIbSetPMKIDCache ( ...@@ -677,7 +676,7 @@ VNTWIFIbSetPMKIDCache (
return (FALSE); return (FALSE);
} }
pMgmt->gsPMKIDCache.BSSIDInfoCount = ulCount; pMgmt->gsPMKIDCache.BSSIDInfoCount = ulCount;
MEMvCopy(pMgmt->gsPMKIDCache.BSSIDInfo, pPMKIDInfo, (ulCount*sizeof(PMKIDInfo))); memcpy(pMgmt->gsPMKIDCache.BSSIDInfo, pPMKIDInfo, (ulCount*sizeof(PMKIDInfo)));
return (TRUE); return (TRUE);
} }
...@@ -741,24 +740,24 @@ VNTWIFIbMeasureReport( ...@@ -741,24 +740,24 @@ VNTWIFIbMeasureReport(
switch (pMgmt->pCurrMeasureEIDRep->byType) { switch (pMgmt->pCurrMeasureEIDRep->byType) {
case MEASURE_TYPE_BASIC : case MEASURE_TYPE_BASIC :
pMgmt->pCurrMeasureEIDRep->len += sizeof(MEASEURE_REP_BASIC); pMgmt->pCurrMeasureEIDRep->len += sizeof(MEASEURE_REP_BASIC);
MEMvCopy( &(pMgmt->pCurrMeasureEIDRep->sRep.sBasic), memcpy( &(pMgmt->pCurrMeasureEIDRep->sRep.sBasic),
&(((PWLAN_IE_MEASURE_REQ) pvMeasureEID)->sReq), &(((PWLAN_IE_MEASURE_REQ) pvMeasureEID)->sReq),
sizeof(MEASEURE_REQ)); sizeof(MEASEURE_REQ));
pMgmt->pCurrMeasureEIDRep->sRep.sBasic.byMap = byBasicMap; pMgmt->pCurrMeasureEIDRep->sRep.sBasic.byMap = byBasicMap;
break; break;
case MEASURE_TYPE_CCA : case MEASURE_TYPE_CCA :
pMgmt->pCurrMeasureEIDRep->len += sizeof(MEASEURE_REP_CCA); pMgmt->pCurrMeasureEIDRep->len += sizeof(MEASEURE_REP_CCA);
MEMvCopy( &(pMgmt->pCurrMeasureEIDRep->sRep.sCCA), memcpy( &(pMgmt->pCurrMeasureEIDRep->sRep.sCCA),
&(((PWLAN_IE_MEASURE_REQ) pvMeasureEID)->sReq), &(((PWLAN_IE_MEASURE_REQ) pvMeasureEID)->sReq),
sizeof(MEASEURE_REQ)); sizeof(MEASEURE_REQ));
pMgmt->pCurrMeasureEIDRep->sRep.sCCA.byCCABusyFraction = byCCAFraction; pMgmt->pCurrMeasureEIDRep->sRep.sCCA.byCCABusyFraction = byCCAFraction;
break; break;
case MEASURE_TYPE_RPI : case MEASURE_TYPE_RPI :
pMgmt->pCurrMeasureEIDRep->len += sizeof(MEASEURE_REP_RPI); pMgmt->pCurrMeasureEIDRep->len += sizeof(MEASEURE_REP_RPI);
MEMvCopy( &(pMgmt->pCurrMeasureEIDRep->sRep.sRPI), memcpy( &(pMgmt->pCurrMeasureEIDRep->sRep.sRPI),
&(((PWLAN_IE_MEASURE_REQ) pvMeasureEID)->sReq), &(((PWLAN_IE_MEASURE_REQ) pvMeasureEID)->sReq),
sizeof(MEASEURE_REQ)); sizeof(MEASEURE_REQ));
MEMvCopy(pMgmt->pCurrMeasureEIDRep->sRep.sRPI.abyRPIdensity, pbyRPIs, 8); memcpy(pMgmt->pCurrMeasureEIDRep->sRep.sRPI.abyRPIdensity, pbyRPIs, 8);
break; break;
default : default :
break; break;
......
...@@ -50,7 +50,6 @@ ...@@ -50,7 +50,6 @@
#include "wctl.h" #include "wctl.h"
#include "card.h" #include "card.h"
#include "baseband.h" #include "baseband.h"
#include "umem.h"
#include "rxtx.h" #include "rxtx.h"
#include "rf.h" #include "rf.h"
#include "iowpa.h" #include "iowpa.h"
...@@ -930,14 +929,14 @@ s_bCommandComplete ( ...@@ -930,14 +929,14 @@ s_bCommandComplete (
pDevice->eCommandState = WLAN_CMD_SCAN_START; pDevice->eCommandState = WLAN_CMD_SCAN_START;
pMgmt->uScanChannel = 0; pMgmt->uScanChannel = 0;
if (pSSID->len != 0) { if (pSSID->len != 0) {
MEMvCopy(pMgmt->abyScanSSID, pSSID, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1); memcpy(pMgmt->abyScanSSID, pSSID, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
} else { } else {
memset(pMgmt->abyScanSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1); memset(pMgmt->abyScanSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
} }
/* /*
if ((bForceSCAN == FALSE) && (pDevice->bLinkPass == TRUE)) { if ((bForceSCAN == FALSE) && (pDevice->bLinkPass == TRUE)) {
if ((pSSID->len == ((PWLAN_IE_SSID)pMgmt->abyCurrSSID)->len) && if ((pSSID->len == ((PWLAN_IE_SSID)pMgmt->abyCurrSSID)->len) &&
(MEMEqualMemory(pSSID->abySSID, ((PWLAN_IE_SSID)pMgmt->abyCurrSSID)->abySSID, pSSID->len))) { ( !memcmp(pSSID->abySSID, ((PWLAN_IE_SSID)pMgmt->abyCurrSSID)->abySSID, pSSID->len))) {
pDevice->eCommandState = WLAN_CMD_IDLE; pDevice->eCommandState = WLAN_CMD_IDLE;
} }
} }
...@@ -948,7 +947,7 @@ s_bCommandComplete ( ...@@ -948,7 +947,7 @@ s_bCommandComplete (
if (pSSID->len > WLAN_SSID_MAXLEN) if (pSSID->len > WLAN_SSID_MAXLEN)
pSSID->len = WLAN_SSID_MAXLEN; pSSID->len = WLAN_SSID_MAXLEN;
if (pSSID->len != 0) if (pSSID->len != 0)
MEMvCopy(pDevice->pMgmt->abyDesireSSID, pSSID, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1); memcpy(pDevice->pMgmt->abyDesireSSID, pSSID, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"eCommandState= WLAN_CMD_SSID_START\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"eCommandState= WLAN_CMD_SSID_START\n");
break; break;
case WLAN_CMD_DISASSOCIATE: case WLAN_CMD_DISASSOCIATE:
...@@ -1001,13 +1000,13 @@ BOOL bScheduleCommand ( ...@@ -1001,13 +1000,13 @@ BOOL bScheduleCommand (
switch (eCommand) { switch (eCommand) {
case WLAN_CMD_BSSID_SCAN: case WLAN_CMD_BSSID_SCAN:
MEMvCopy(pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].abyCmdDesireSSID, memcpy(pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].abyCmdDesireSSID,
pbyItem0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1); pbyItem0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].bForceSCAN = FALSE; pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].bForceSCAN = FALSE;
break; break;
case WLAN_CMD_SSID: case WLAN_CMD_SSID:
MEMvCopy(pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].abyCmdDesireSSID, memcpy(pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].abyCmdDesireSSID,
pbyItem0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1); pbyItem0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
break; break;
......
...@@ -78,7 +78,6 @@ ...@@ -78,7 +78,6 @@
#include "rxtx.h" #include "rxtx.h"
#include "wpa.h" #include "wpa.h"
#include "rf.h" #include "rf.h"
#include "umem.h"
#include "iowpa.h" #include "iowpa.h"
#define PLICE_DEBUG #define PLICE_DEBUG
...@@ -2498,7 +2497,7 @@ vMgrCreateOwnIBSS( ...@@ -2498,7 +2497,7 @@ vMgrCreateOwnIBSS(
} }
if (pMgmt->eConfigMode == WMAC_CONFIG_IBSS_STA) { if (pMgmt->eConfigMode == WMAC_CONFIG_IBSS_STA) {
MEMvCopy(pMgmt->abyIBSSDFSOwner, pDevice->abyCurrentNetAddr, 6); memcpy(pMgmt->abyIBSSDFSOwner, pDevice->abyCurrentNetAddr, 6);
pMgmt->byIBSSDFSRecovery = 10; pMgmt->byIBSSDFSRecovery = 10;
pMgmt->eCurrMode = WMAC_MODE_IBSS_STA; pMgmt->eCurrMode = WMAC_MODE_IBSS_STA;
} }
...@@ -3020,14 +3019,14 @@ s_vMgrSynchBSS ( ...@@ -3020,14 +3019,14 @@ s_vMgrSynchBSS (
} }
if (ePhyType == PHY_TYPE_11A) { if (ePhyType == PHY_TYPE_11A) {
MEMvCopy(pMgmt->abyCurrSuppRates, &abyCurrSuppRatesA[0], sizeof(abyCurrSuppRatesA)); memcpy(pMgmt->abyCurrSuppRates, &abyCurrSuppRatesA[0], sizeof(abyCurrSuppRatesA));
pMgmt->abyCurrExtSuppRates[1] = 0; pMgmt->abyCurrExtSuppRates[1] = 0;
} else if (ePhyType == PHY_TYPE_11B) { } else if (ePhyType == PHY_TYPE_11B) {
MEMvCopy(pMgmt->abyCurrSuppRates, &abyCurrSuppRatesB[0], sizeof(abyCurrSuppRatesB)); memcpy(pMgmt->abyCurrSuppRates, &abyCurrSuppRatesB[0], sizeof(abyCurrSuppRatesB));
pMgmt->abyCurrExtSuppRates[1] = 0; pMgmt->abyCurrExtSuppRates[1] = 0;
} else { } else {
MEMvCopy(pMgmt->abyCurrSuppRates, &abyCurrSuppRatesG[0], sizeof(abyCurrSuppRatesG)); memcpy(pMgmt->abyCurrSuppRates, &abyCurrSuppRatesG[0], sizeof(abyCurrSuppRatesG));
MEMvCopy(pMgmt->abyCurrExtSuppRates, &abyCurrExtSuppRatesG[0], sizeof(abyCurrExtSuppRatesG)); memcpy(pMgmt->abyCurrExtSuppRates, &abyCurrExtSuppRatesG[0], sizeof(abyCurrExtSuppRatesG));
} }
...@@ -3377,7 +3376,7 @@ s_MgrMakeBeacon( ...@@ -3377,7 +3376,7 @@ s_MgrMakeBeacon(
pIBSSDFS = (PWLAN_IE_IBSS_DFS) pbyBuffer; pIBSSDFS = (PWLAN_IE_IBSS_DFS) pbyBuffer;
pIBSSDFS->byElementID = WLAN_EID_IBSS_DFS; pIBSSDFS->byElementID = WLAN_EID_IBSS_DFS;
pIBSSDFS->len = 7; pIBSSDFS->len = 7;
MEMvCopy( pIBSSDFS->abyDFSOwner, memcpy( pIBSSDFS->abyDFSOwner,
pMgmt->abyIBSSDFSOwner, pMgmt->abyIBSSDFSOwner,
6); 6);
pIBSSDFS->byDFSRecovery = pMgmt->byIBSSDFSRecovery; pIBSSDFS->byDFSRecovery = pMgmt->byIBSSDFSRecovery;
...@@ -3410,7 +3409,7 @@ s_MgrMakeBeacon( ...@@ -3410,7 +3409,7 @@ s_MgrMakeBeacon(
if (((PWLAN_IE_SUPP_RATES)pCurrExtSuppRates)->len != 0) { if (((PWLAN_IE_SUPP_RATES)pCurrExtSuppRates)->len != 0) {
sFrame.pExtSuppRates = (PWLAN_IE_SUPP_RATES)(sFrame.pBuf + sFrame.len); sFrame.pExtSuppRates = (PWLAN_IE_SUPP_RATES)(sFrame.pBuf + sFrame.len);
sFrame.len += ((PWLAN_IE_SUPP_RATES)pCurrExtSuppRates)->len + WLAN_IEHDR_LEN; sFrame.len += ((PWLAN_IE_SUPP_RATES)pCurrExtSuppRates)->len + WLAN_IEHDR_LEN;
MEMvCopy(sFrame.pExtSuppRates, memcpy(sFrame.pExtSuppRates,
pCurrExtSuppRates, pCurrExtSuppRates,
((PWLAN_IE_SUPP_RATES)pCurrExtSuppRates)->len + WLAN_IEHDR_LEN ((PWLAN_IE_SUPP_RATES)pCurrExtSuppRates)->len + WLAN_IEHDR_LEN
); );
...@@ -3581,7 +3580,7 @@ s_MgrMakeProbeResponse( ...@@ -3581,7 +3580,7 @@ s_MgrMakeProbeResponse(
pIBSSDFS = (PWLAN_IE_IBSS_DFS) pbyBuffer; pIBSSDFS = (PWLAN_IE_IBSS_DFS) pbyBuffer;
pIBSSDFS->byElementID = WLAN_EID_IBSS_DFS; pIBSSDFS->byElementID = WLAN_EID_IBSS_DFS;
pIBSSDFS->len = 7; pIBSSDFS->len = 7;
MEMvCopy( pIBSSDFS->abyDFSOwner, memcpy( pIBSSDFS->abyDFSOwner,
pMgmt->abyIBSSDFSOwner, pMgmt->abyIBSSDFSOwner,
6); 6);
pIBSSDFS->byDFSRecovery = pMgmt->byIBSSDFSRecovery; pIBSSDFS->byDFSRecovery = pMgmt->byIBSSDFSRecovery;
...@@ -3602,7 +3601,7 @@ s_MgrMakeProbeResponse( ...@@ -3602,7 +3601,7 @@ s_MgrMakeProbeResponse(
if (((PWLAN_IE_SUPP_RATES)pCurrExtSuppRates)->len != 0) { if (((PWLAN_IE_SUPP_RATES)pCurrExtSuppRates)->len != 0) {
sFrame.pExtSuppRates = (PWLAN_IE_SUPP_RATES)(sFrame.pBuf + sFrame.len); sFrame.pExtSuppRates = (PWLAN_IE_SUPP_RATES)(sFrame.pBuf + sFrame.len);
sFrame.len += ((PWLAN_IE_SUPP_RATES)pCurrExtSuppRates)->len + WLAN_IEHDR_LEN; sFrame.len += ((PWLAN_IE_SUPP_RATES)pCurrExtSuppRates)->len + WLAN_IEHDR_LEN;
MEMvCopy(sFrame.pExtSuppRates, memcpy(sFrame.pExtSuppRates,
pCurrExtSuppRates, pCurrExtSuppRates,
((PWLAN_IE_SUPP_RATES)pCurrExtSuppRates)->len + WLAN_IEHDR_LEN ((PWLAN_IE_SUPP_RATES)pCurrExtSuppRates)->len + WLAN_IEHDR_LEN
); );
...@@ -3688,7 +3687,7 @@ s_MgrMakeAssocRequest( ...@@ -3688,7 +3687,7 @@ s_MgrMakeAssocRequest(
pMgmt->sAssocInfo.AssocInfo.RequestIELength = pCurrSSID->len + WLAN_IEHDR_LEN; pMgmt->sAssocInfo.AssocInfo.RequestIELength = pCurrSSID->len + WLAN_IEHDR_LEN;
pMgmt->sAssocInfo.AssocInfo.OffsetRequestIEs = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION); pMgmt->sAssocInfo.AssocInfo.OffsetRequestIEs = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION);
pbyIEs = pMgmt->sAssocInfo.abyIEs; pbyIEs = pMgmt->sAssocInfo.abyIEs;
MEMvCopy(pbyIEs, pCurrSSID, pCurrSSID->len + WLAN_IEHDR_LEN); memcpy(pbyIEs, pCurrSSID, pCurrSSID->len + WLAN_IEHDR_LEN);
pbyIEs += pCurrSSID->len + WLAN_IEHDR_LEN; pbyIEs += pCurrSSID->len + WLAN_IEHDR_LEN;
// Copy the rate set // Copy the rate set
...@@ -3707,7 +3706,7 @@ s_MgrMakeAssocRequest( ...@@ -3707,7 +3706,7 @@ s_MgrMakeAssocRequest(
} }
pMgmt->sAssocInfo.AssocInfo.RequestIELength += pCurrRates->len + WLAN_IEHDR_LEN; pMgmt->sAssocInfo.AssocInfo.RequestIELength += pCurrRates->len + WLAN_IEHDR_LEN;
MEMvCopy(pbyIEs, pCurrRates, pCurrRates->len + WLAN_IEHDR_LEN); memcpy(pbyIEs, pCurrRates, pCurrRates->len + WLAN_IEHDR_LEN);
pbyIEs += pCurrRates->len + WLAN_IEHDR_LEN; pbyIEs += pCurrRates->len + WLAN_IEHDR_LEN;
// for 802.11h // for 802.11h
...@@ -3795,7 +3794,7 @@ s_MgrMakeAssocRequest( ...@@ -3795,7 +3794,7 @@ s_MgrMakeAssocRequest(
sFrame.len += sFrame.pRSNWPA->len + WLAN_IEHDR_LEN; sFrame.len += sFrame.pRSNWPA->len + WLAN_IEHDR_LEN;
// copy to AssocInfo. for OID_802_11_ASSOCIATION_INFORMATION // copy to AssocInfo. for OID_802_11_ASSOCIATION_INFORMATION
pMgmt->sAssocInfo.AssocInfo.RequestIELength += sFrame.pRSNWPA->len + WLAN_IEHDR_LEN; pMgmt->sAssocInfo.AssocInfo.RequestIELength += sFrame.pRSNWPA->len + WLAN_IEHDR_LEN;
MEMvCopy(pbyIEs, sFrame.pRSNWPA, sFrame.pRSNWPA->len + WLAN_IEHDR_LEN); memcpy(pbyIEs, sFrame.pRSNWPA, sFrame.pRSNWPA->len + WLAN_IEHDR_LEN);
pbyIEs += sFrame.pRSNWPA->len + WLAN_IEHDR_LEN; pbyIEs += sFrame.pRSNWPA->len + WLAN_IEHDR_LEN;
} else if (((pMgmt->eAuthenMode == WMAC_AUTH_WPA2) || } else if (((pMgmt->eAuthenMode == WMAC_AUTH_WPA2) ||
...@@ -3857,7 +3856,7 @@ s_MgrMakeAssocRequest( ...@@ -3857,7 +3856,7 @@ s_MgrMakeAssocRequest(
// RSN Capabilites // RSN Capabilites
if (pMgmt->pCurrBSS->sRSNCapObj.bRSNCapExist == TRUE) { if (pMgmt->pCurrBSS->sRSNCapObj.bRSNCapExist == TRUE) {
MEMvCopy(&sFrame.pRSN->abyRSN[16], &pMgmt->pCurrBSS->sRSNCapObj.wRSNCap, 2); memcpy(&sFrame.pRSN->abyRSN[16], &pMgmt->pCurrBSS->sRSNCapObj.wRSNCap, 2);
} else { } else {
sFrame.pRSN->abyRSN[16] = 0; sFrame.pRSN->abyRSN[16] = 0;
sFrame.pRSN->abyRSN[17] = 0; sFrame.pRSN->abyRSN[17] = 0;
...@@ -3871,9 +3870,9 @@ s_MgrMakeAssocRequest( ...@@ -3871,9 +3870,9 @@ s_MgrMakeAssocRequest(
*pwPMKID = 0; // Initialize PMKID count *pwPMKID = 0; // Initialize PMKID count
pbyRSN += 2; // Point to PMKID list pbyRSN += 2; // Point to PMKID list
for (ii = 0; ii < pDevice->gsPMKID.BSSIDInfoCount; ii++) { for (ii = 0; ii < pDevice->gsPMKID.BSSIDInfoCount; ii++) {
if (MEMEqualMemory(&pDevice->gsPMKID.BSSIDInfo[ii].BSSID[0], pMgmt->abyCurrBSSID, U_ETHER_ADDR_LEN)) { if ( !memcmp(&pDevice->gsPMKID.BSSIDInfo[ii].BSSID[0], pMgmt->abyCurrBSSID, U_ETHER_ADDR_LEN)) {
(*pwPMKID) ++; (*pwPMKID) ++;
MEMvCopy(pbyRSN, pDevice->gsPMKID.BSSIDInfo[ii].PMKID, 16); memcpy(pbyRSN, pDevice->gsPMKID.BSSIDInfo[ii].PMKID, 16);
pbyRSN += 16; pbyRSN += 16;
} }
} }
...@@ -3885,7 +3884,7 @@ s_MgrMakeAssocRequest( ...@@ -3885,7 +3884,7 @@ s_MgrMakeAssocRequest(
sFrame.len += sFrame.pRSN->len + WLAN_IEHDR_LEN; sFrame.len += sFrame.pRSN->len + WLAN_IEHDR_LEN;
// copy to AssocInfo. for OID_802_11_ASSOCIATION_INFORMATION // copy to AssocInfo. for OID_802_11_ASSOCIATION_INFORMATION
pMgmt->sAssocInfo.AssocInfo.RequestIELength += sFrame.pRSN->len + WLAN_IEHDR_LEN; pMgmt->sAssocInfo.AssocInfo.RequestIELength += sFrame.pRSN->len + WLAN_IEHDR_LEN;
MEMvCopy(pbyIEs, sFrame.pRSN, sFrame.pRSN->len + WLAN_IEHDR_LEN); memcpy(pbyIEs, sFrame.pRSN, sFrame.pRSN->len + WLAN_IEHDR_LEN);
pbyIEs += sFrame.pRSN->len + WLAN_IEHDR_LEN; pbyIEs += sFrame.pRSN->len + WLAN_IEHDR_LEN;
} }
...@@ -3967,7 +3966,7 @@ s_MgrMakeReAssocRequest( ...@@ -3967,7 +3966,7 @@ s_MgrMakeReAssocRequest(
pMgmt->sAssocInfo.AssocInfo.RequestIELength = pCurrSSID->len + WLAN_IEHDR_LEN; pMgmt->sAssocInfo.AssocInfo.RequestIELength = pCurrSSID->len + WLAN_IEHDR_LEN;
pMgmt->sAssocInfo.AssocInfo.OffsetRequestIEs = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION); pMgmt->sAssocInfo.AssocInfo.OffsetRequestIEs = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION);
pbyIEs = pMgmt->sAssocInfo.abyIEs; pbyIEs = pMgmt->sAssocInfo.abyIEs;
MEMvCopy(pbyIEs, pCurrSSID, pCurrSSID->len + WLAN_IEHDR_LEN); memcpy(pbyIEs, pCurrSSID, pCurrSSID->len + WLAN_IEHDR_LEN);
pbyIEs += pCurrSSID->len + WLAN_IEHDR_LEN; pbyIEs += pCurrSSID->len + WLAN_IEHDR_LEN;
/* Copy the rate set */ /* Copy the rate set */
...@@ -3984,7 +3983,7 @@ s_MgrMakeReAssocRequest( ...@@ -3984,7 +3983,7 @@ s_MgrMakeReAssocRequest(
} }
pMgmt->sAssocInfo.AssocInfo.RequestIELength += pCurrRates->len + WLAN_IEHDR_LEN; pMgmt->sAssocInfo.AssocInfo.RequestIELength += pCurrRates->len + WLAN_IEHDR_LEN;
MEMvCopy(pbyIEs, pCurrRates, pCurrRates->len + WLAN_IEHDR_LEN); memcpy(pbyIEs, pCurrRates, pCurrRates->len + WLAN_IEHDR_LEN);
pbyIEs += pCurrRates->len + WLAN_IEHDR_LEN; pbyIEs += pCurrRates->len + WLAN_IEHDR_LEN;
if (((pMgmt->eAuthenMode == WMAC_AUTH_WPA) || if (((pMgmt->eAuthenMode == WMAC_AUTH_WPA) ||
...@@ -4051,7 +4050,7 @@ s_MgrMakeReAssocRequest( ...@@ -4051,7 +4050,7 @@ s_MgrMakeReAssocRequest(
sFrame.len += sFrame.pRSNWPA->len + WLAN_IEHDR_LEN; sFrame.len += sFrame.pRSNWPA->len + WLAN_IEHDR_LEN;
// copy to AssocInfo. for OID_802_11_ASSOCIATION_INFORMATION // copy to AssocInfo. for OID_802_11_ASSOCIATION_INFORMATION
pMgmt->sAssocInfo.AssocInfo.RequestIELength += sFrame.pRSNWPA->len + WLAN_IEHDR_LEN; pMgmt->sAssocInfo.AssocInfo.RequestIELength += sFrame.pRSNWPA->len + WLAN_IEHDR_LEN;
MEMvCopy(pbyIEs, sFrame.pRSNWPA, sFrame.pRSNWPA->len + WLAN_IEHDR_LEN); memcpy(pbyIEs, sFrame.pRSNWPA, sFrame.pRSNWPA->len + WLAN_IEHDR_LEN);
pbyIEs += sFrame.pRSNWPA->len + WLAN_IEHDR_LEN; pbyIEs += sFrame.pRSNWPA->len + WLAN_IEHDR_LEN;
} else if (((pMgmt->eAuthenMode == WMAC_AUTH_WPA2) || } else if (((pMgmt->eAuthenMode == WMAC_AUTH_WPA2) ||
...@@ -4113,7 +4112,7 @@ s_MgrMakeReAssocRequest( ...@@ -4113,7 +4112,7 @@ s_MgrMakeReAssocRequest(
// RSN Capabilites // RSN Capabilites
if (pMgmt->pCurrBSS->sRSNCapObj.bRSNCapExist == TRUE) { if (pMgmt->pCurrBSS->sRSNCapObj.bRSNCapExist == TRUE) {
MEMvCopy(&sFrame.pRSN->abyRSN[16], &pMgmt->pCurrBSS->sRSNCapObj.wRSNCap, 2); memcpy(&sFrame.pRSN->abyRSN[16], &pMgmt->pCurrBSS->sRSNCapObj.wRSNCap, 2);
} else { } else {
sFrame.pRSN->abyRSN[16] = 0; sFrame.pRSN->abyRSN[16] = 0;
sFrame.pRSN->abyRSN[17] = 0; sFrame.pRSN->abyRSN[17] = 0;
...@@ -4127,9 +4126,9 @@ s_MgrMakeReAssocRequest( ...@@ -4127,9 +4126,9 @@ s_MgrMakeReAssocRequest(
*pwPMKID = 0; // Initialize PMKID count *pwPMKID = 0; // Initialize PMKID count
pbyRSN += 2; // Point to PMKID list pbyRSN += 2; // Point to PMKID list
for (ii = 0; ii < pDevice->gsPMKID.BSSIDInfoCount; ii++) { for (ii = 0; ii < pDevice->gsPMKID.BSSIDInfoCount; ii++) {
if (MEMEqualMemory(&pDevice->gsPMKID.BSSIDInfo[ii].BSSID[0], pMgmt->abyCurrBSSID, U_ETHER_ADDR_LEN)) { if ( !memcmp(&pDevice->gsPMKID.BSSIDInfo[ii].BSSID[0], pMgmt->abyCurrBSSID, U_ETHER_ADDR_LEN)) {
(*pwPMKID) ++; (*pwPMKID) ++;
MEMvCopy(pbyRSN, pDevice->gsPMKID.BSSIDInfo[ii].PMKID, 16); memcpy(pbyRSN, pDevice->gsPMKID.BSSIDInfo[ii].PMKID, 16);
pbyRSN += 16; pbyRSN += 16;
} }
} }
...@@ -4141,7 +4140,7 @@ s_MgrMakeReAssocRequest( ...@@ -4141,7 +4140,7 @@ s_MgrMakeReAssocRequest(
sFrame.len += sFrame.pRSN->len + WLAN_IEHDR_LEN; sFrame.len += sFrame.pRSN->len + WLAN_IEHDR_LEN;
// copy to AssocInfo. for OID_802_11_ASSOCIATION_INFORMATION // copy to AssocInfo. for OID_802_11_ASSOCIATION_INFORMATION
pMgmt->sAssocInfo.AssocInfo.RequestIELength += sFrame.pRSN->len + WLAN_IEHDR_LEN; pMgmt->sAssocInfo.AssocInfo.RequestIELength += sFrame.pRSN->len + WLAN_IEHDR_LEN;
MEMvCopy(pbyIEs, sFrame.pRSN, sFrame.pRSN->len + WLAN_IEHDR_LEN); memcpy(pbyIEs, sFrame.pRSN, sFrame.pRSN->len + WLAN_IEHDR_LEN);
pbyIEs += sFrame.pRSN->len + WLAN_IEHDR_LEN; pbyIEs += sFrame.pRSN->len + WLAN_IEHDR_LEN;
} }
...@@ -4215,7 +4214,7 @@ s_MgrMakeAssocResponse( ...@@ -4215,7 +4214,7 @@ s_MgrMakeAssocResponse(
if (((PWLAN_IE_SUPP_RATES)pCurrExtSuppRates)->len != 0) { if (((PWLAN_IE_SUPP_RATES)pCurrExtSuppRates)->len != 0) {
sFrame.pExtSuppRates = (PWLAN_IE_SUPP_RATES)(sFrame.pBuf + sFrame.len); sFrame.pExtSuppRates = (PWLAN_IE_SUPP_RATES)(sFrame.pBuf + sFrame.len);
sFrame.len += ((PWLAN_IE_SUPP_RATES)pCurrExtSuppRates)->len + WLAN_IEHDR_LEN; sFrame.len += ((PWLAN_IE_SUPP_RATES)pCurrExtSuppRates)->len + WLAN_IEHDR_LEN;
MEMvCopy(sFrame.pExtSuppRates, memcpy(sFrame.pExtSuppRates,
pCurrExtSuppRates, pCurrExtSuppRates,
((PWLAN_IE_SUPP_RATES)pCurrExtSuppRates)->len + WLAN_IEHDR_LEN ((PWLAN_IE_SUPP_RATES)pCurrExtSuppRates)->len + WLAN_IEHDR_LEN
); );
...@@ -4289,7 +4288,7 @@ s_MgrMakeReAssocResponse( ...@@ -4289,7 +4288,7 @@ s_MgrMakeReAssocResponse(
if (((PWLAN_IE_SUPP_RATES)pCurrExtSuppRates)->len != 0) { if (((PWLAN_IE_SUPP_RATES)pCurrExtSuppRates)->len != 0) {
sFrame.pExtSuppRates = (PWLAN_IE_SUPP_RATES)(sFrame.pBuf + sFrame.len); sFrame.pExtSuppRates = (PWLAN_IE_SUPP_RATES)(sFrame.pBuf + sFrame.len);
sFrame.len += ((PWLAN_IE_SUPP_RATES)pCurrExtSuppRates)->len + WLAN_IEHDR_LEN; sFrame.len += ((PWLAN_IE_SUPP_RATES)pCurrExtSuppRates)->len + WLAN_IEHDR_LEN;
MEMvCopy(sFrame.pExtSuppRates, memcpy(sFrame.pExtSuppRates,
pCurrExtSuppRates, pCurrExtSuppRates,
((PWLAN_IE_SUPP_RATES)pCurrExtSuppRates)->len + WLAN_IEHDR_LEN ((PWLAN_IE_SUPP_RATES)pCurrExtSuppRates)->len + WLAN_IEHDR_LEN
); );
...@@ -4833,7 +4832,7 @@ bAdd_PMKID_Candidate ( ...@@ -4833,7 +4832,7 @@ bAdd_PMKID_Candidate (
// Update Old Candidate // Update Old Candidate
for (ii = 0; ii < pDevice->gsPMKIDCandidate.NumCandidates; ii++) { for (ii = 0; ii < pDevice->gsPMKIDCandidate.NumCandidates; ii++) {
pCandidateList = &pDevice->gsPMKIDCandidate.CandidateList[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 ((psRSNCapObj->bRSNCapExist == TRUE) && (psRSNCapObj->wRSNCap & BIT0)) { if ((psRSNCapObj->bRSNCapExist == TRUE) && (psRSNCapObj->wRSNCap & BIT0)) {
pCandidateList->Flags |= NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED; pCandidateList->Flags |= NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED;
} else { } else {
...@@ -4850,7 +4849,7 @@ bAdd_PMKID_Candidate ( ...@@ -4850,7 +4849,7 @@ bAdd_PMKID_Candidate (
} else { } else {
pCandidateList->Flags &= ~(NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED); 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++; pDevice->gsPMKIDCandidate.NumCandidates++;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"NumCandidates:%d\n", (int)pDevice->gsPMKIDCandidate.NumCandidates); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"NumCandidates:%d\n", (int)pDevice->gsPMKIDCandidate.NumCandidates);
return TRUE; return TRUE;
...@@ -4880,7 +4879,7 @@ vFlush_PMKID_Candidate ( ...@@ -4880,7 +4879,7 @@ vFlush_PMKID_Candidate (
if (pDevice == NULL) if (pDevice == NULL)
return; return;
ZERO_MEMORY(&pDevice->gsPMKIDCandidate, sizeof(SPMKIDCandidateEvent)); memset(&pDevice->gsPMKIDCandidate, 0, sizeof(SPMKIDCandidateEvent));
} }
static BOOL static BOOL
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
*/ */
#include "ttype.h" #include "ttype.h"
#include "umem.h"
#include "tmacro.h" #include "tmacro.h"
#include "tether.h" #include "tether.h"
#include "device.h" #include "device.h"
...@@ -121,22 +120,22 @@ WPA_ParseRSN ( ...@@ -121,22 +120,22 @@ WPA_ParseRSN (
// information element header makes sense // information element header makes sense
if ((pRSN->len >= 6) // oui1(4)+ver(2) if ((pRSN->len >= 6) // oui1(4)+ver(2)
&& (pRSN->byElementID == WLAN_EID_RSN_WPA) && MEMEqualMemory(pRSN->abyOUI, abyOUI01, 4) && (pRSN->byElementID == WLAN_EID_RSN_WPA) && !memcmp(pRSN->abyOUI, abyOUI01, 4)
&& (pRSN->wVersion == 1)) { && (pRSN->wVersion == 1)) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Legal RSN\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Legal RSN\n");
// update each variable if pRSN is long enough to contain the variable // update each variable if pRSN is long enough to contain the variable
if (pRSN->len >= 10) //oui1(4)+ver(2)+GKSuite(4) if (pRSN->len >= 10) //oui1(4)+ver(2)+GKSuite(4)
{ {
if (MEMEqualMemory(pRSN->abyMulticast, abyOUI01, 4)) if ( !memcmp(pRSN->abyMulticast, abyOUI01, 4))
pBSSList->byGKType = WPA_WEP40; pBSSList->byGKType = WPA_WEP40;
else if (MEMEqualMemory(pRSN->abyMulticast, abyOUI02, 4)) else if ( !memcmp(pRSN->abyMulticast, abyOUI02, 4))
pBSSList->byGKType = WPA_TKIP; pBSSList->byGKType = WPA_TKIP;
else if (MEMEqualMemory(pRSN->abyMulticast, abyOUI03, 4)) else if ( !memcmp(pRSN->abyMulticast, abyOUI03, 4))
pBSSList->byGKType = WPA_AESWRAP; pBSSList->byGKType = WPA_AESWRAP;
else if (MEMEqualMemory(pRSN->abyMulticast, abyOUI04, 4)) else if ( !memcmp(pRSN->abyMulticast, abyOUI04, 4))
pBSSList->byGKType = WPA_AESCCMP; pBSSList->byGKType = WPA_AESCCMP;
else if (MEMEqualMemory(pRSN->abyMulticast, abyOUI05, 4)) else if ( !memcmp(pRSN->abyMulticast, abyOUI05, 4))
pBSSList->byGKType = WPA_WEP104; pBSSList->byGKType = WPA_WEP104;
else else
// any vendor checks here // any vendor checks here
...@@ -151,13 +150,13 @@ WPA_ParseRSN ( ...@@ -151,13 +150,13 @@ WPA_ParseRSN (
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wPKCount: %d, sizeof(pBSSList->abyPKType): %ld\n", pRSN->wPKCount, sizeof(pBSSList->abyPKType)); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wPKCount: %d, sizeof(pBSSList->abyPKType): %ld\n", pRSN->wPKCount, sizeof(pBSSList->abyPKType));
for(i = 0; (i < pRSN->wPKCount) && (j < sizeof(pBSSList->abyPKType)/sizeof(BYTE)); i++) { for(i = 0; (i < pRSN->wPKCount) && (j < sizeof(pBSSList->abyPKType)/sizeof(BYTE)); i++) {
if(pRSN->len >= 12+i*4+4) { //oui1(4)+ver(2)+GKS(4)+PKSCnt(2)+PKS(4*i) if(pRSN->len >= 12+i*4+4) { //oui1(4)+ver(2)+GKS(4)+PKSCnt(2)+PKS(4*i)
if (MEMEqualMemory(pRSN->PKSList[i].abyOUI, abyOUI00, 4)) if ( !memcmp(pRSN->PKSList[i].abyOUI, abyOUI00, 4))
pBSSList->abyPKType[j++] = WPA_NONE; pBSSList->abyPKType[j++] = WPA_NONE;
else if (MEMEqualMemory(pRSN->PKSList[i].abyOUI, abyOUI02, 4)) else if ( !memcmp(pRSN->PKSList[i].abyOUI, abyOUI02, 4))
pBSSList->abyPKType[j++] = WPA_TKIP; pBSSList->abyPKType[j++] = WPA_TKIP;
else if (MEMEqualMemory(pRSN->PKSList[i].abyOUI, abyOUI03, 4)) else if ( !memcmp(pRSN->PKSList[i].abyOUI, abyOUI03, 4))
pBSSList->abyPKType[j++] = WPA_AESWRAP; pBSSList->abyPKType[j++] = WPA_AESWRAP;
else if (MEMEqualMemory(pRSN->PKSList[i].abyOUI, abyOUI04, 4)) else if ( !memcmp(pRSN->PKSList[i].abyOUI, abyOUI04, 4))
pBSSList->abyPKType[j++] = WPA_AESCCMP; pBSSList->abyPKType[j++] = WPA_AESCCMP;
else else
// any vendor checks here // any vendor checks here
...@@ -183,9 +182,9 @@ WPA_ParseRSN ( ...@@ -183,9 +182,9 @@ WPA_ParseRSN (
pIE_RSN_Auth->wAuthCount, sizeof(pBSSList->abyAuthType)); pIE_RSN_Auth->wAuthCount, sizeof(pBSSList->abyAuthType));
for(i = 0; (i < pIE_RSN_Auth->wAuthCount) && (j < sizeof(pBSSList->abyAuthType)/sizeof(BYTE)); i++) { for(i = 0; (i < pIE_RSN_Auth->wAuthCount) && (j < sizeof(pBSSList->abyAuthType)/sizeof(BYTE)); i++) {
if(pRSN->len >= 14+4+(m+i)*4) { //oui1(4)+ver(2)+GKS(4)+PKSCnt(2)+PKS(4*m)+AKC(2)+AKS(4*i) if(pRSN->len >= 14+4+(m+i)*4) { //oui1(4)+ver(2)+GKS(4)+PKSCnt(2)+PKS(4*m)+AKC(2)+AKS(4*i)
if (MEMEqualMemory(pIE_RSN_Auth->AuthKSList[i].abyOUI, abyOUI01, 4)) if ( !memcmp(pIE_RSN_Auth->AuthKSList[i].abyOUI, abyOUI01, 4))
pBSSList->abyAuthType[j++] = WPA_AUTH_IEEE802_1X; pBSSList->abyAuthType[j++] = WPA_AUTH_IEEE802_1X;
else if (MEMEqualMemory(pIE_RSN_Auth->AuthKSList[i].abyOUI, abyOUI02, 4)) else if ( !memcmp(pIE_RSN_Auth->AuthKSList[i].abyOUI, abyOUI02, 4))
pBSSList->abyAuthType[j++] = WPA_AUTH_PSK; pBSSList->abyAuthType[j++] = WPA_AUTH_PSK;
else else
// any vendor checks here // any vendor checks here
...@@ -307,7 +306,7 @@ WPAb_Is_RSN ( ...@@ -307,7 +306,7 @@ WPAb_Is_RSN (
return FALSE; return FALSE;
if ((pRSN->len >= 6) && // oui1(4)+ver(2) if ((pRSN->len >= 6) && // oui1(4)+ver(2)
(pRSN->byElementID == WLAN_EID_RSN_WPA) && MEMEqualMemory(pRSN->abyOUI, abyOUI01, 4) && (pRSN->byElementID == WLAN_EID_RSN_WPA) && !memcmp(pRSN->abyOUI, abyOUI01, 4) &&
(pRSN->wVersion == 1)) { (pRSN->wVersion == 1)) {
return TRUE; return TRUE;
} }
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
*/ */
#include "wpa2.h" #include "wpa2.h"
#include "umem.h"
#include "device.h" #include "device.h"
#include "wmgr.h" #include "wmgr.h"
...@@ -142,15 +141,15 @@ WPA2vParseRSN ( ...@@ -142,15 +141,15 @@ WPA2vParseRSN (
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Legal 802.11i RSN\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Legal 802.11i RSN\n");
pbyOUI = &(pRSN->abyRSN[0]); pbyOUI = &(pRSN->abyRSN[0]);
if (MEMEqualMemory(pbyOUI, abyOUIWEP40, 4)) if ( !memcmp(pbyOUI, abyOUIWEP40, 4))
pBSSNode->byCSSGK = WLAN_11i_CSS_WEP40; pBSSNode->byCSSGK = WLAN_11i_CSS_WEP40;
else if (MEMEqualMemory(pbyOUI, abyOUITKIP, 4)) else if ( !memcmp(pbyOUI, abyOUITKIP, 4))
pBSSNode->byCSSGK = WLAN_11i_CSS_TKIP; pBSSNode->byCSSGK = WLAN_11i_CSS_TKIP;
else if (MEMEqualMemory(pbyOUI, abyOUICCMP, 4)) else if ( !memcmp(pbyOUI, abyOUICCMP, 4))
pBSSNode->byCSSGK = WLAN_11i_CSS_CCMP; pBSSNode->byCSSGK = WLAN_11i_CSS_CCMP;
else if (MEMEqualMemory(pbyOUI, abyOUIWEP104, 4)) else if ( !memcmp(pbyOUI, abyOUIWEP104, 4))
pBSSNode->byCSSGK = WLAN_11i_CSS_WEP104; pBSSNode->byCSSGK = WLAN_11i_CSS_WEP104;
else if (MEMEqualMemory(pbyOUI, abyOUIGK, 4)) { else if ( !memcmp(pbyOUI, abyOUIGK, 4)) {
// invalid CSS, P802.11i/D10.0, p32 // invalid CSS, P802.11i/D10.0, p32
return; return;
} else } else
...@@ -172,19 +171,19 @@ WPA2vParseRSN ( ...@@ -172,19 +171,19 @@ WPA2vParseRSN (
for (i = 0; (i < pBSSNode->wCSSPKCount) && (j < sizeof(pBSSNode->abyCSSPK)/sizeof(BYTE)); i++) { for (i = 0; (i < pBSSNode->wCSSPKCount) && (j < sizeof(pBSSNode->abyCSSPK)/sizeof(BYTE)); i++) {
if (pRSN->len >= 8+i*4+4) { // ver(2)+GK(4)+PKCnt(2)+PKS(4*i) if (pRSN->len >= 8+i*4+4) { // ver(2)+GK(4)+PKCnt(2)+PKS(4*i)
if (MEMEqualMemory(pbyOUI, abyOUIGK, 4)) { if ( !memcmp(pbyOUI, abyOUIGK, 4)) {
pBSSNode->abyCSSPK[j++] = WLAN_11i_CSS_USE_GROUP; pBSSNode->abyCSSPK[j++] = WLAN_11i_CSS_USE_GROUP;
bUseGK = TRUE; bUseGK = TRUE;
} else if (MEMEqualMemory(pbyOUI, abyOUIWEP40, 4)) { } else if ( !memcmp(pbyOUI, abyOUIWEP40, 4)) {
// Invialid CSS, continue to parsing // Invialid CSS, continue to parsing
} else if (MEMEqualMemory(pbyOUI, abyOUITKIP, 4)) { } else if ( !memcmp(pbyOUI, abyOUITKIP, 4)) {
if (pBSSNode->byCSSGK != WLAN_11i_CSS_CCMP) if (pBSSNode->byCSSGK != WLAN_11i_CSS_CCMP)
pBSSNode->abyCSSPK[j++] = WLAN_11i_CSS_TKIP; pBSSNode->abyCSSPK[j++] = WLAN_11i_CSS_TKIP;
else else
; // Invialid CSS, continue to parsing ; // Invialid CSS, continue to parsing
} else if (MEMEqualMemory(pbyOUI, abyOUICCMP, 4)) { } else if ( !memcmp(pbyOUI, abyOUICCMP, 4)) {
pBSSNode->abyCSSPK[j++] = WLAN_11i_CSS_CCMP; pBSSNode->abyCSSPK[j++] = WLAN_11i_CSS_CCMP;
} else if (MEMEqualMemory(pbyOUI, abyOUIWEP104, 4)) { } else if ( !memcmp(pbyOUI, abyOUIWEP104, 4)) {
// Invialid CSS, continue to parsing // Invialid CSS, continue to parsing
} else { } else {
// any vendor checks here // any vendor checks here
...@@ -222,9 +221,9 @@ WPA2vParseRSN ( ...@@ -222,9 +221,9 @@ WPA2vParseRSN (
pbyOUI = &(pRSN->abyRSN[8+4*m]); pbyOUI = &(pRSN->abyRSN[8+4*m]);
for (i = 0; (i < pBSSNode->wAKMSSAuthCount) && (j < sizeof(pBSSNode->abyAKMSSAuthType)/sizeof(BYTE)); i++) { for (i = 0; (i < pBSSNode->wAKMSSAuthCount) && (j < sizeof(pBSSNode->abyAKMSSAuthType)/sizeof(BYTE)); i++) {
if (pRSN->len >= 10+(m+i)*4+4) { // ver(2)+GK(4)+PKCnt(2)+PKS(4*m)+AKMSS(2)+AKS(4*i) if (pRSN->len >= 10+(m+i)*4+4) { // ver(2)+GK(4)+PKCnt(2)+PKS(4*m)+AKMSS(2)+AKS(4*i)
if (MEMEqualMemory(pbyOUI, abyOUI8021X, 4)) if ( !memcmp(pbyOUI, abyOUI8021X, 4))
pBSSNode->abyAKMSSAuthType[j++] = WLAN_11i_AKMSS_802_1X; pBSSNode->abyAKMSSAuthType[j++] = WLAN_11i_AKMSS_802_1X;
else if (MEMEqualMemory(pbyOUI, abyOUIPSK, 4)) else if ( !memcmp(pbyOUI, abyOUIPSK, 4))
pBSSNode->abyAKMSSAuthType[j++] = WLAN_11i_AKMSS_PSK; pBSSNode->abyAKMSSAuthType[j++] = WLAN_11i_AKMSS_PSK;
else else
// any vendor checks here // any vendor checks here
...@@ -332,7 +331,7 @@ WPA2uSetIEs( ...@@ -332,7 +331,7 @@ WPA2uSetIEs(
// RSN Capabilites // RSN Capabilites
if (pMgmt->pCurrBSS->sRSNCapObj.bRSNCapExist == TRUE) { if (pMgmt->pCurrBSS->sRSNCapObj.bRSNCapExist == TRUE) {
MEMvCopy(&pRSNIEs->abyRSN[16], &pMgmt->pCurrBSS->sRSNCapObj.wRSNCap, 2); memcpy(&pRSNIEs->abyRSN[16], &pMgmt->pCurrBSS->sRSNCapObj.wRSNCap, 2);
} else { } else {
pRSNIEs->abyRSN[16] = 0; pRSNIEs->abyRSN[16] = 0;
pRSNIEs->abyRSN[17] = 0; pRSNIEs->abyRSN[17] = 0;
...@@ -347,9 +346,9 @@ WPA2uSetIEs( ...@@ -347,9 +346,9 @@ WPA2uSetIEs(
*pwPMKID = 0; // Initialize PMKID count *pwPMKID = 0; // Initialize PMKID count
pbyBuffer = &pRSNIEs->abyRSN[20]; // Point to PMKID list pbyBuffer = &pRSNIEs->abyRSN[20]; // Point to PMKID list
for (ii = 0; ii < pMgmt->gsPMKIDCache.BSSIDInfoCount; ii++) { for (ii = 0; ii < pMgmt->gsPMKIDCache.BSSIDInfoCount; ii++) {
if (MEMEqualMemory(&pMgmt->gsPMKIDCache.BSSIDInfo[ii].abyBSSID[0], pMgmt->abyCurrBSSID, U_ETHER_ADDR_LEN)) { if ( !memcmp(&pMgmt->gsPMKIDCache.BSSIDInfo[ii].abyBSSID[0], pMgmt->abyCurrBSSID, U_ETHER_ADDR_LEN)) {
(*pwPMKID) ++; (*pwPMKID) ++;
MEMvCopy(pbyBuffer, pMgmt->gsPMKIDCache.BSSIDInfo[ii].abyPMKID, 16); memcpy(pbyBuffer, pMgmt->gsPMKIDCache.BSSIDInfo[ii].abyPMKID, 16);
pbyBuffer += 16; pbyBuffer += 16;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment