Commit 3e362598 authored by Jim Lieb's avatar Jim Lieb Committed by Greg Kroah-Hartman

Staging: vt665x: Remove umem.h Part 2

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 51b6d9c2
......@@ -33,7 +33,6 @@
*
*/
#include "umem.h"
#include "device.h"
#include "80211hdr.h"
......@@ -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];
......@@ -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);
......@@ -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;
......@@ -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) {
......@@ -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;
}
......@@ -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
......@@ -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;
......
......@@ -55,7 +55,6 @@
#include "card.h"
#include "mac.h"
#include "wpa2.h"
#include "umem.h"
#include "tbit.h"
#include "control.h"
#include "rndis.h"
......@@ -170,7 +169,7 @@ BSSpSearchBSSList(
if (IS_ETH_ADDRESS_EQUAL(pCurrBSS->abyBSSID, pbyBSSID)) {
if (pSSID != NULL) {
// compare ssid
if (MEMEqualMemory(pSSID->abySSID,
if ( !memcmp(pSSID->abySSID,
((PWLAN_IE_SSID)pCurrBSS->abySSID)->abySSID,
pSSID->len)) {
if ((pMgmt->eConfigMode == WMAC_CONFIG_AUTO) ||
......@@ -208,7 +207,7 @@ BSSpSearchBSSList(
if (pSSID != NULL) {
// matched SSID
if (!MEMEqualMemory(pSSID->abySSID,
if (memcmp(pSSID->abySSID,
((PWLAN_IE_SSID)pCurrBSS->abySSID)->abySSID,
pSSID->len) ||
(pSSID->len != ((PWLAN_IE_SSID)pCurrBSS->abySSID)->len)) {
......@@ -275,8 +274,8 @@ pDevice->bSameBSSMaxNum = jj;
pSelect->bSelected = TRUE;
if (pDevice->bRoaming == FALSE) {
// Einsn Add @20070907
ZERO_MEMORY(pbyDesireSSID, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
MEMvCopy(pbyDesireSSID,pCurrBSS->abySSID,WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1) ;
memset(pbyDesireSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
memcpy(pbyDesireSSID,pCurrBSS->abySSID,WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1) ;
}
return(pSelect);
......@@ -518,7 +517,7 @@ BSSbInsertToBSSList (
}
}
if ((bIs802_1x == TRUE) && (pSSID->len == ((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->len) &&
(MEMEqualMemory(pSSID->abySSID, ((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySSID, pSSID->len))) {
( !memcmp(pSSID->abySSID, ((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySSID, pSSID->len))) {
bAdd_PMKID_Candidate((HANDLE)pDevice, pBSSList->abyBSSID, &pBSSList->sRSNCapObj);
......@@ -587,7 +586,7 @@ BSSbInsertToBSSList (
pBSSList->uIELength = uIELength;
if (pBSSList->uIELength > WLAN_BEACON_FR_MAXLEN)
pBSSList->uIELength = WLAN_BEACON_FR_MAXLEN;
MEMvCopy(pBSSList->abyIEs, pbyIEs, pBSSList->uIELength);
memcpy(pBSSList->abyIEs, pbyIEs, pBSSList->uIELength);
return TRUE;
}
......
......@@ -56,7 +56,6 @@
#include "key.h"
#include "rc4.h"
#include "country.h"
#include "umem.h"
#include "datarate.h"
#include "rndis.h"
#include "control.h"
......
......@@ -37,7 +37,6 @@
#include "country.h"
#include "channel.h"
#include "rf.h"
#include "umem.h"
/*--------------------- Static Definitions -------------------------*/
static int msglevel =MSG_LEVEL_INFO;
......@@ -433,7 +432,7 @@ CHvChannelGetList (
if (uCountryCodeIdx >= CCODE_MAX) {
return (FALSE);
}
MEMvCopy(pbyChannelTable, ChannelRuleTab[uCountryCodeIdx].bChannelIdxList, CB_MAX_CHANNEL);
memcpy(pbyChannelTable, ChannelRuleTab[uCountryCodeIdx].bChannelIdxList, CB_MAX_CHANNEL);
return (TRUE);
}
......
......@@ -39,7 +39,6 @@
*/
#include "control.h"
#include "umem.h"
#include "rndis.h"
/*--------------------- Static Definitions -------------------------*/
......
......@@ -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"
......@@ -941,7 +940,7 @@ RXbBulkInProcessData (
RSC = dwRxTSC47_16;
RSC <<= 16;
RSC += wRxTSC15_0;
MEMvCopy(&(pKey->KeyRSC), &RSC, sizeof(QWORD));
memcpy(&(pKey->KeyRSC), &RSC, sizeof(QWORD));
if ( (pDevice->sMgmtObj.eCurrMode == WMAC_MODE_ESS_STA) &&
(pDevice->sMgmtObj.eCurrState == WMAC_STATE_ASSOC)) {
......@@ -1239,8 +1238,8 @@ static BOOL s_bHandleRxEncryption (
// 2. WEP 256
PayloadLen -= (WLAN_HDR_ADDR3_LEN + 4 + 4); // 24 is 802.11 header,4 is IV, 4 is crc
MEMvCopy(pDevice->abyPRNG, pbyIV, 3);
MEMvCopy(pDevice->abyPRNG + 3, pKey->abyKey, pKey->uKeyLength);
memcpy(pDevice->abyPRNG, pbyIV, 3);
memcpy(pDevice->abyPRNG + 3, pKey->abyKey, pKey->uKeyLength);
rc4_init(&pDevice->SBox, pDevice->abyPRNG, pKey->uKeyLength + 3);
rc4_encrypt(&pDevice->SBox, pbyIV+4, pbyIV+4, PayloadLen);
......@@ -1350,8 +1349,8 @@ static BOOL s_bHostWepRxEncryption (
// 3. NotOnFly
PayloadLen -= (WLAN_HDR_ADDR3_LEN + 4 + 4); // 24 is 802.11 header,4 is IV, 4 is crc
MEMvCopy(pDevice->abyPRNG, pbyIV, 3);
MEMvCopy(pDevice->abyPRNG + 3, pKey->abyKey, pKey->uKeyLength);
memcpy(pDevice->abyPRNG, pbyIV, 3);
memcpy(pDevice->abyPRNG + 3, pKey->abyKey, pKey->uKeyLength);
rc4_init(&pDevice->SBox, pDevice->abyPRNG, pKey->uKeyLength + 3);
rc4_encrypt(&pDevice->SBox, pbyIV+4, pbyIV+4, PayloadLen);
......
......@@ -31,7 +31,6 @@
*
*/
#include "umem.h"
#include "firmware.h"
#include "control.h"
#include "rndis.h"
......
......@@ -39,7 +39,6 @@
#include "mac.h"
#include "power.h"
#include "bssdb.h"
#include "umem.h"
#include "usbpipe.h"
/*--------------------- Static Definitions -------------------------*/
......
......@@ -35,7 +35,6 @@
#include "mac.h"
#include "card.h"
#include "hostap.h"
#include "umem.h"
#include "wpactl.h"
#include "control.h"
#include "rndis.h"
......
......@@ -36,7 +36,6 @@
#include "mac.h"
#include "card.h"
#include "hostap.h"
#include "umem.h"
#include "power.h"
#include "rf.h"
......
......@@ -39,7 +39,6 @@
#include "tmacro.h"
#include "tbit.h"
#include "key.h"
#include "umem.h"
#include "mac.h"
#include "rndis.h"
#include "control.h"
......@@ -278,7 +277,7 @@ BOOL KeybSetKey (
pKey->uKeyLength = uKeyLength;
pKey->dwKeyIndex = dwKeyIndex;
pKey->byCipherSuite = byKeyDecMode;
MEMvCopy(pKey->abyKey, pbyKey, uKeyLength);
memcpy(pKey->abyKey, pbyKey, uKeyLength);
if (byKeyDecMode == KEY_CTL_WEP) {
if (uKeyLength == WLAN_WEP40_KEYLEN)
pKey->abyKey[15] &= 0x7F;
......@@ -289,10 +288,10 @@ BOOL KeybSetKey (
if ((dwKeyIndex & USE_KEYRSC) == 0) {
// RSC set by NIC
ZERO_MEMORY(&(pKey->KeyRSC), sizeof(QWORD));
memset(&(pKey->KeyRSC), 0, sizeof(QWORD));
}
else {
MEMvCopy(&(pKey->KeyRSC), pKeyRSC, sizeof(QWORD));
memcpy(&(pKey->KeyRSC), pKeyRSC, sizeof(QWORD));
}
pKey->dwTSC47_16 = 0;
pKey->wTSC15_0 = 0;
......@@ -314,7 +313,7 @@ BOOL KeybSetKey (
}
}
if (j < (MAX_KEY_TABLE-1)) {
MEMvCopy(pTable->KeyTable[j].abyBSSID,pbyBSSID,U_ETHER_ADDR_LEN);
memcpy(pTable->KeyTable[j].abyBSSID,pbyBSSID,U_ETHER_ADDR_LEN);
pTable->KeyTable[j].bInUse = TRUE;
if ((dwKeyIndex & PAIRWISE_KEY) != 0) {
// Pairwise key
......@@ -343,7 +342,7 @@ BOOL KeybSetKey (
pKey->uKeyLength = uKeyLength;
pKey->dwKeyIndex = dwKeyIndex;
pKey->byCipherSuite = byKeyDecMode;
MEMvCopy(pKey->abyKey, pbyKey, uKeyLength);
memcpy(pKey->abyKey, pbyKey, uKeyLength);
if (byKeyDecMode == KEY_CTL_WEP) {
if (uKeyLength == WLAN_WEP40_KEYLEN)
pKey->abyKey[15] &= 0x7F;
......@@ -354,10 +353,10 @@ BOOL KeybSetKey (
if ((dwKeyIndex & USE_KEYRSC) == 0) {
// RSC set by NIC
ZERO_MEMORY(&(pKey->KeyRSC), sizeof(QWORD));
memset(&(pKey->KeyRSC), 0, sizeof(QWORD));
}
else {
MEMvCopy(&(pKey->KeyRSC), pKeyRSC, sizeof(QWORD));
memcpy(&(pKey->KeyRSC), pKeyRSC, sizeof(QWORD));
}
pKey->dwTSC47_16 = 0;
pKey->wTSC15_0 = 0;
......@@ -732,7 +731,7 @@ BOOL KeybSetDefaultKey (
pKey->uKeyLength = uKeyLength;
pKey->dwKeyIndex = dwKeyIndex;
pKey->byCipherSuite = byKeyDecMode;
MEMvCopy(pKey->abyKey, pbyKey, uKeyLength);
memcpy(pKey->abyKey, pbyKey, uKeyLength);
if (byKeyDecMode == KEY_CTL_WEP) {
if (uKeyLength == WLAN_WEP40_KEYLEN)
pKey->abyKey[15] &= 0x7F;
......@@ -744,9 +743,9 @@ BOOL KeybSetDefaultKey (
if ((dwKeyIndex & USE_KEYRSC) == 0) {
// RSC set by NIC
ZERO_MEMORY(&(pKey->KeyRSC), sizeof(QWORD));
memset(&(pKey->KeyRSC), 0, sizeof(QWORD));
} else {
MEMvCopy(&(pKey->KeyRSC), pKeyRSC, sizeof(QWORD));
memcpy(&(pKey->KeyRSC), pKeyRSC, sizeof(QWORD));
}
pKey->dwTSC47_16 = 0;
pKey->wTSC15_0 = 0;
......@@ -832,7 +831,7 @@ BOOL KeybSetAllGroupKey (
pKey->uKeyLength = uKeyLength;
pKey->dwKeyIndex = dwKeyIndex;
pKey->byCipherSuite = byKeyDecMode;
MEMvCopy(pKey->abyKey, pbyKey, uKeyLength);
memcpy(pKey->abyKey, pbyKey, uKeyLength);
if (byKeyDecMode == KEY_CTL_WEP) {
if (uKeyLength == WLAN_WEP40_KEYLEN)
pKey->abyKey[15] &= 0x7F;
......@@ -844,10 +843,10 @@ BOOL KeybSetAllGroupKey (
if ((dwKeyIndex & USE_KEYRSC) == 0) {
// RSC set by NIC
ZERO_MEMORY(&(pKey->KeyRSC), sizeof(QWORD));
memset(&(pKey->KeyRSC), 0, sizeof(QWORD));
}
else {
MEMvCopy(&(pKey->KeyRSC), pKeyRSC, sizeof(QWORD));
memcpy(&(pKey->KeyRSC), pKeyRSC, sizeof(QWORD));
}
pKey->dwTSC47_16 = 0;
pKey->wTSC15_0 = 0;
......
......@@ -37,7 +37,6 @@
#include "ttype.h"
#include "device.h"
#include "tmacro.h"
#include "umem.h"
/*--------------------- Export Definitions -------------------------*/
......
......@@ -607,8 +607,8 @@ static BOOL device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType)
CARDbSetMediaChannel(pDevice, pMgmt->uCurrChannel);
// get Permanent network address
MEMvCopy(pDevice->abyPermanentNetAddr,&(sInitRsp.byNetAddr[0]),6)
MEMvCopy(pDevice->abyCurrentNetAddr, pDevice->abyPermanentNetAddr, U_ETHER_ADDR_LEN);
memcpy(pDevice->abyPermanentNetAddr,&(sInitRsp.byNetAddr[0]),6);
memcpy(pDevice->abyCurrentNetAddr, pDevice->abyPermanentNetAddr, U_ETHER_ADDR_LEN);
// if exist SW network address, use SW network address.
......
......@@ -43,7 +43,6 @@
#include "tether.h"
#include "mib.h"
#include "wctl.h"
#include "umem.h"
#include "baseband.h"
/*--------------------- Static Definitions -------------------------*/
......@@ -75,7 +74,7 @@ static int msglevel =MSG_LEVEL_INFO;
void STAvClearAllCounter (PSStatCounter pStatistic)
{
// set memory to zero
ZERO_MEMORY(pStatistic, sizeof(SStatCounter));
memset(pStatistic, 0, sizeof(SStatCounter));
}
......@@ -388,7 +387,7 @@ STAvUpdateRDStatCounterEx (
// rx length
pStatistic->dwCntRxFrmLength = cbFrameLength;
// rx pattern, we just see 10 bytes for sample
MEMvCopy(pStatistic->abyCntRxPattern, (PBYTE)pbyBuffer, 10);
memcpy(pStatistic->abyCntRxPattern, (PBYTE)pbyBuffer, 10);
}
......@@ -543,7 +542,7 @@ void
STAvClear802_11Counter(PSDot11Counters p802_11Counter)
{
// set memory to zero
ZERO_MEMORY(p802_11Counter, sizeof(SDot11Counters));
memset(p802_11Counter, 0, sizeof(SDot11Counters));
}
/*
......
......@@ -31,8 +31,6 @@
#ifndef __MICHAEL_H__
#define __MICHAEL_H__
#include "umem.h"
/*--------------------- Export Definitions -------------------------*/
/*--------------------- Export Types ------------------------------*/
......
......@@ -45,7 +45,6 @@
#include "power.h"
#include "wcmd.h"
#include "tbit.h"
#include "umem.h"
#include "rxtx.h"
#include "card.h"
#include "control.h"
......
This diff is collapsed.
......@@ -35,7 +35,6 @@
#include "tmacro.h"
#include "tbit.h"
#include "tkip.h"
#include "umem.h"
/*--------------------- 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__
......@@ -38,7 +38,6 @@
*
*/
#include "umem.h"
#include "int.h"
#include "rxtx.h"
#include "dpc.h"
......
......@@ -51,7 +51,6 @@
#include "card.h"
#include "baseband.h"
#include "control.h"
#include "umem.h"
#include "rxtx.h"
#include "rf.h"
#include "rndis.h"
......@@ -1117,14 +1116,14 @@ s_bCommandComplete (
pDevice->eCommandState = WLAN_CMD_SCAN_START;
pMgmt->uScanChannel = 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 {
memset(pMgmt->abyScanSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
}
/*
if ((bForceSCAN == FALSE) && (pDevice->bLinkPass == TRUE)) {
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;
}
}
......@@ -1135,7 +1134,7 @@ s_bCommandComplete (
if (pSSID->len > WLAN_SSID_MAXLEN)
pSSID->len = WLAN_SSID_MAXLEN;
if (pSSID->len != 0)
MEMvCopy(pMgmt->abyDesireSSID, pSSID, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
memcpy(pMgmt->abyDesireSSID, pSSID, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"eCommandState= WLAN_CMD_SSID_START\n");
break;
case WLAN_CMD_DISASSOCIATE:
......@@ -1213,12 +1212,12 @@ BOOL bScheduleCommand (
switch (eCommand) {
case WLAN_CMD_BSSID_SCAN:
pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].bForceSCAN = FALSE;
MEMvCopy(pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].abyCmdDesireSSID,
memcpy(pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].abyCmdDesireSSID,
pbyItem0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
break;
case WLAN_CMD_SSID:
MEMvCopy(pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].abyCmdDesireSSID,
memcpy(pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].abyCmdDesireSSID,
pbyItem0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
break;
......
This diff is collapsed.
......@@ -33,7 +33,6 @@
*/
#include "ttype.h"
#include "umem.h"
#include "tmacro.h"
#include "tether.h"
#include "device.h"
......@@ -121,22 +120,22 @@ WPA_ParseRSN (
// information element header makes sense
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)) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Legal RSN\n");
// update each variable if pRSN is long enough to contain the variable
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;
else if (MEMEqualMemory(pRSN->abyMulticast, abyOUI02, 4))
else if ( !memcmp(pRSN->abyMulticast, abyOUI02, 4))
pBSSList->byGKType = WPA_TKIP;
else if (MEMEqualMemory(pRSN->abyMulticast, abyOUI03, 4))
else if ( !memcmp(pRSN->abyMulticast, abyOUI03, 4))
pBSSList->byGKType = WPA_AESWRAP;
else if (MEMEqualMemory(pRSN->abyMulticast, abyOUI04, 4))
else if ( !memcmp(pRSN->abyMulticast, abyOUI04, 4))
pBSSList->byGKType = WPA_AESCCMP;
else if (MEMEqualMemory(pRSN->abyMulticast, abyOUI05, 4))
else if ( !memcmp(pRSN->abyMulticast, abyOUI05, 4))
pBSSList->byGKType = WPA_WEP104;
else
// any vendor checks here
......@@ -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));
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 (MEMEqualMemory(pRSN->PKSList[i].abyOUI, abyOUI00, 4))
if ( !memcmp(pRSN->PKSList[i].abyOUI, abyOUI00, 4))
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;
else if (MEMEqualMemory(pRSN->PKSList[i].abyOUI, abyOUI03, 4))
else if ( !memcmp(pRSN->PKSList[i].abyOUI, abyOUI03, 4))
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;
else
// any vendor checks here
......@@ -183,9 +182,9 @@ WPA_ParseRSN (
pIE_RSN_Auth->wAuthCount, sizeof(pBSSList->abyAuthType));
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 (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;
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;
else
// any vendor checks here
......@@ -307,7 +306,7 @@ WPAb_Is_RSN (
return FALSE;
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)) {
return TRUE;
}
......
......@@ -32,9 +32,7 @@
*/
#include "wpa2.h"
#include "umem.h"
#include "device.h"
#include "wmgr.h"
/*--------------------- Static Definitions -------------------------*/
static int msglevel =MSG_LEVEL_INFO;
......@@ -142,15 +140,15 @@ WPA2vParseRSN (
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Legal 802.11i RSN\n");
pbyOUI = &(pRSN->abyRSN[0]);
if (MEMEqualMemory(pbyOUI, abyOUIWEP40, 4))
if ( !memcmp(pbyOUI, abyOUIWEP40, 4))
pBSSNode->byCSSGK = WLAN_11i_CSS_WEP40;
else if (MEMEqualMemory(pbyOUI, abyOUITKIP, 4))
else if ( !memcmp(pbyOUI, abyOUITKIP, 4))
pBSSNode->byCSSGK = WLAN_11i_CSS_TKIP;
else if (MEMEqualMemory(pbyOUI, abyOUICCMP, 4))
else if ( !memcmp(pbyOUI, abyOUICCMP, 4))
pBSSNode->byCSSGK = WLAN_11i_CSS_CCMP;
else if (MEMEqualMemory(pbyOUI, abyOUIWEP104, 4))
else if ( !memcmp(pbyOUI, abyOUIWEP104, 4))
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
return;
} else
......@@ -172,19 +170,19 @@ WPA2vParseRSN (
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 (MEMEqualMemory(pbyOUI, abyOUIGK, 4)) {
if ( !memcmp(pbyOUI, abyOUIGK, 4)) {
pBSSNode->abyCSSPK[j++] = WLAN_11i_CSS_USE_GROUP;
bUseGK = TRUE;
} else if (MEMEqualMemory(pbyOUI, abyOUIWEP40, 4)) {
} else if ( !memcmp(pbyOUI, abyOUIWEP40, 4)) {
// Invialid CSS, continue to parsing
} else if (MEMEqualMemory(pbyOUI, abyOUITKIP, 4)) {
} else if ( !memcmp(pbyOUI, abyOUITKIP, 4)) {
if (pBSSNode->byCSSGK != WLAN_11i_CSS_CCMP)
pBSSNode->abyCSSPK[j++] = WLAN_11i_CSS_TKIP;
else
; // Invialid CSS, continue to parsing
} else if (MEMEqualMemory(pbyOUI, abyOUICCMP, 4)) {
} else if ( !memcmp(pbyOUI, abyOUICCMP, 4)) {
pBSSNode->abyCSSPK[j++] = WLAN_11i_CSS_CCMP;
} else if (MEMEqualMemory(pbyOUI, abyOUIWEP104, 4)) {
} else if ( !memcmp(pbyOUI, abyOUIWEP104, 4)) {
// Invialid CSS, continue to parsing
} else {
// any vendor checks here
......@@ -222,9 +220,9 @@ WPA2vParseRSN (
pbyOUI = &(pRSN->abyRSN[8+4*m]);
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 (MEMEqualMemory(pbyOUI, abyOUI8021X, 4))
if ( !memcmp(pbyOUI, abyOUI8021X, 4))
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;
else
// any vendor checks here
......@@ -332,7 +330,7 @@ WPA2uSetIEs(
// RSN Capabilites
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 {
pRSNIEs->abyRSN[16] = 0;
pRSNIEs->abyRSN[17] = 0;
......@@ -347,9 +345,9 @@ WPA2uSetIEs(
*pwPMKID = 0; // Initialize PMKID count
pbyBuffer = &pRSNIEs->abyRSN[20]; // Point to PMKID list
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) ++;
MEMvCopy(pbyBuffer, pMgmt->gsPMKIDCache.BSSIDInfo[ii].abyPMKID, 16);
memcpy(pbyBuffer, pMgmt->gsPMKIDCache.BSSIDInfo[ii].abyPMKID, 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