diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-09-22 19:54:53 (GMT) |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-09-22 20:01:40 (GMT) |
commit | ae19ffbadc1b2100285a5b5b3d0a4e0a11390904 (patch) | |
tree | 3c2086ab67398a019089a47ca3f362a4bc6db74f /drivers/staging/vt6655/wpa2.c | |
parent | 34e84f39a27d059a3e6ec6e8b94aafa702e6f220 (diff) | |
parent | 9173a8ef24a6b1b8031507b35b8ffe5f85a87692 (diff) | |
download | linux-fsl-qoriq-ae19ffbadc1b2100285a5b5b3d0a4e0a11390904.tar.xz |
Merge branch 'master' into for-linus
Diffstat (limited to 'drivers/staging/vt6655/wpa2.c')
-rw-r--r-- | drivers/staging/vt6655/wpa2.c | 55 |
1 files changed, 23 insertions, 32 deletions
diff --git a/drivers/staging/vt6655/wpa2.c b/drivers/staging/vt6655/wpa2.c index e2fdb33..931b6bd 100644 --- a/drivers/staging/vt6655/wpa2.c +++ b/drivers/staging/vt6655/wpa2.c @@ -30,19 +30,10 @@ * Date: Oct. 4, 2004 * */ -#if !defined(__WPA2_H__) + #include "wpa2.h" -#endif -#if !defined(__UMEM_H__) -#include "umem.h" -#endif -#if !defined(__DEVICE_H__) #include "device.h" -#endif -#if !defined(__WMGR_H__) #include "wmgr.h" -#endif - /*--------------------- Static Definitions -------------------------*/ static int msglevel =MSG_LEVEL_INFO; @@ -127,7 +118,7 @@ WPA2vParseRSN ( PBYTE pbyOUI; BOOL bUseGK = FALSE; - DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO"WPA2_ParseRSN: [%d]\n", pRSN->len); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"WPA2_ParseRSN: [%d]\n", pRSN->len); WPA2_ClearRSN(pBSSNode); @@ -147,25 +138,25 @@ WPA2vParseRSN ( if ((pRSN->byElementID == WLAN_EID_RSN) && (pRSN->wVersion == 1)) { - DEVICE_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]); - 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 // any vendor checks here pBSSNode->byCSSGK = WLAN_11i_CSS_UNKNOWN; - DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO"802.11i CSS: %X\n", pBSSNode->byCSSGK); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"802.11i CSS: %X\n", pBSSNode->byCSSGK); if (pRSN->len == 6) { pBSSNode->bWPA2Valid = TRUE; @@ -180,26 +171,26 @@ 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 pBSSNode->abyCSSPK[j++] = WLAN_11i_CSS_UNKNOWN; } pbyOUI += 4; - DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO"abyCSSPK[%d]: %X\n", j-1, pBSSNode->abyCSSPK[j-1]); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"abyCSSPK[%d]: %X\n", j-1, pBSSNode->abyCSSPK[j-1]); } else break; } //for @@ -219,7 +210,7 @@ WPA2vParseRSN ( return; } pBSSNode->wCSSPKCount = (WORD)j; - DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wCSSPKCount: %d\n", pBSSNode->wCSSPKCount); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wCSSPKCount: %d\n", pBSSNode->wCSSPKCount); } m = *((PWORD) &(pRSN->abyRSN[4])); @@ -230,19 +221,19 @@ 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 pBSSNode->abyAKMSSAuthType[j++] = WLAN_11i_AKMSS_UNKNOWN; - DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO"abyAKMSSAuthType[%d]: %X\n", j-1, pBSSNode->abyAKMSSAuthType[j-1]); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"abyAKMSSAuthType[%d]: %X\n", j-1, pBSSNode->abyAKMSSAuthType[j-1]); } else break; } pBSSNode->wAKMSSAuthCount = (WORD)j; - DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wAKMSSAuthCount: %d\n", pBSSNode->wAKMSSAuthCount); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wAKMSSAuthCount: %d\n", pBSSNode->wAKMSSAuthCount); n = *((PWORD) &(pRSN->abyRSN[6+4*m]));; if (pRSN->len >= 12+4*m+4*n) { // ver(2)+GK(4)+PKCnt(2)+PKS(4*m)+AKMSSCnt(2)+AKMSS(4*n)+Cap(2) @@ -340,7 +331,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; @@ -355,9 +346,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; } } |