Staging: rt2870: remove WPA_SUPPLICANT_SUPPORT ifdefs

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Bartlomiej Zolnierkiewicz 2009-04-26 16:05:57 +02:00 committed by Greg Kroah-Hartman
parent e08bae5ab2
commit f3a9749f8d
13 changed files with 5 additions and 97 deletions

View File

@ -5,7 +5,6 @@ EXTRA_CFLAGS += -DLINUX -DAGGREGATION_SUPPORT -DPIGGYBACK_SUPPORT -DWMM_SUPPORT
EXTRA_CFLAGS += -DRT2870 EXTRA_CFLAGS += -DRT2870
EXTRA_CFLAGS += -DDBG EXTRA_CFLAGS += -DDBG
EXTRA_CFLAGS += -DDOT11_N_SUPPORT EXTRA_CFLAGS += -DDOT11_N_SUPPORT
EXTRA_CFLAGS += -DWPA_SUPPLICANT_SUPPORT
rt2870sta-objs := \ rt2870sta-objs := \
common/md5.o \ common/md5.o \

View File

@ -625,14 +625,12 @@ VOID RTMPMakeRSNIE(
{ {
IF_DEV_CONFIG_OPMODE_ON_STA(pAd) IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{ {
#ifdef WPA_SUPPLICANT_SUPPORT
if (pAd->StaCfg.WpaSupplicantUP != WPA_SUPPLICANT_DISABLE) if (pAd->StaCfg.WpaSupplicantUP != WPA_SUPPLICANT_DISABLE)
{ {
if (AuthMode < Ndis802_11AuthModeWPA) if (AuthMode < Ndis802_11AuthModeWPA)
return; return;
} }
else else
#endif // WPA_SUPPLICANT_SUPPORT //
{ {
// Support WPAPSK or WPA2PSK in STA-Infra mode // Support WPAPSK or WPA2PSK in STA-Infra mode
// Support WPANone in STA-Adhoc mode // Support WPANone in STA-Adhoc mode

View File

@ -939,9 +939,7 @@ VOID STAMlmePeriodicExec(
ULONG TxTotalCnt; ULONG TxTotalCnt;
int i; int i;
#ifdef WPA_SUPPLICANT_SUPPORT
if (pAd->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_DISABLE) if (pAd->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_DISABLE)
#endif // WPA_SUPPLICANT_SUPPORT //
{ {
// WPA MIC error should block association attempt for 60 seconds // WPA MIC error should block association attempt for 60 seconds
if (pAd->StaCfg.bBlockAssoc && (pAd->StaCfg.LastMicErrorTime + (60 * OS_HZ) < pAd->Mlme.Now32)) if (pAd->StaCfg.bBlockAssoc && (pAd->StaCfg.LastMicErrorTime + (60 * OS_HZ) < pAd->Mlme.Now32))

View File

@ -3316,13 +3316,10 @@ VOID UserCfgInit(
NdisZeroMemory(pAd->nickname, IW_ESSID_MAX_SIZE+1); NdisZeroMemory(pAd->nickname, IW_ESSID_MAX_SIZE+1);
sprintf(pAd->nickname, "%s", STA_NIC_DEVICE_NAME); sprintf(pAd->nickname, "%s", STA_NIC_DEVICE_NAME);
RTMPInitTimer(pAd, &pAd->StaCfg.WpaDisassocAndBlockAssocTimer, GET_TIMER_FUNCTION(WpaDisassocApAndBlockAssoc), pAd, FALSE); RTMPInitTimer(pAd, &pAd->StaCfg.WpaDisassocAndBlockAssocTimer, GET_TIMER_FUNCTION(WpaDisassocApAndBlockAssoc), pAd, FALSE);
#ifdef WPA_SUPPLICANT_SUPPORT
pAd->StaCfg.IEEE8021X = FALSE; pAd->StaCfg.IEEE8021X = FALSE;
pAd->StaCfg.IEEE8021x_required_keys = FALSE; pAd->StaCfg.IEEE8021x_required_keys = FALSE;
pAd->StaCfg.WpaSupplicantUP = WPA_SUPPLICANT_DISABLE; pAd->StaCfg.WpaSupplicantUP = WPA_SUPPLICANT_DISABLE;
pAd->StaCfg.WpaSupplicantUP = WPA_SUPPLICANT_ENABLE; pAd->StaCfg.WpaSupplicantUP = WPA_SUPPLICANT_ENABLE;
#endif // WPA_SUPPLICANT_SUPPORT //
} }
// Default for extra information is not valid // Default for extra information is not valid

View File

@ -157,7 +157,7 @@
#define RT_OID_802_11_QUERY_LAST_RX_RATE 0x0613 #define RT_OID_802_11_QUERY_LAST_RX_RATE 0x0613
#define RT_OID_802_11_TX_POWER_LEVEL_1 0x0614 #define RT_OID_802_11_TX_POWER_LEVEL_1 0x0614
#define RT_OID_802_11_QUERY_PIDVID 0x0615 #define RT_OID_802_11_QUERY_PIDVID 0x0615
//for WPA_SUPPLICANT_SUPPORT
#define OID_SET_COUNTERMEASURES 0x0616 #define OID_SET_COUNTERMEASURES 0x0616
#define OID_802_11_SET_IEEE8021X 0x0617 #define OID_802_11_SET_IEEE8021X 0x0617
#define OID_802_11_SET_IEEE8021X_REQUIRE_KEY 0x0618 #define OID_802_11_SET_IEEE8021X_REQUIRE_KEY 0x0618

View File

@ -608,13 +608,6 @@ typedef struct _CmdQ {
UINT32 CmdQState; UINT32 CmdQState;
}CmdQ, *PCmdQ; }CmdQ, *PCmdQ;
//
// For WPA SUPPLICANT: WIRELESS EXT support wireless events: v14 or newer
//
#if WIRELESS_EXT >= 14
//#define WPA_SUPPLICANT_SUPPORT 1
#endif
/* oid.h */ /* oid.h */
// Cipher suite type for mixed mode group cipher, P802.11i-2004 // Cipher suite type for mixed mode group cipher, P802.11i-2004
typedef enum _RT_802_11_CIPHER_SUITE_TYPE { typedef enum _RT_802_11_CIPHER_SUITE_TYPE {

View File

@ -67,10 +67,6 @@
#include "igmp_snoop.h" #include "igmp_snoop.h"
#endif // IGMP_SNOOP_SUPPORT // #endif // IGMP_SNOOP_SUPPORT //
#ifndef WPA_SUPPLICANT_SUPPORT
#error "Build for being controlled by NetworkManager or wext, please set HAS_WPA_SUPPLICANT=y"
#endif // WPA_SUPPLICANT_SUPPORT //
#ifdef IKANOS_VX_1X0 #ifdef IKANOS_VX_1X0
#include "vr_ikans.h" #include "vr_ikans.h"
#endif // IKANOS_VX_1X0 // #endif // IKANOS_VX_1X0 //

View File

@ -1277,12 +1277,10 @@ NDIS_STATUS RTMPReadParametersHook(
pAd->StaCfg.AuthMode = Ndis802_11AuthModeWPANone; pAd->StaCfg.AuthMode = Ndis802_11AuthModeWPANone;
else if ((strcmp(tmpbuf, "WPA2PSK") == 0) || (strcmp(tmpbuf, "wpa2psk") == 0)) else if ((strcmp(tmpbuf, "WPA2PSK") == 0) || (strcmp(tmpbuf, "wpa2psk") == 0))
pAd->StaCfg.AuthMode = Ndis802_11AuthModeWPA2PSK; pAd->StaCfg.AuthMode = Ndis802_11AuthModeWPA2PSK;
#ifdef WPA_SUPPLICANT_SUPPORT
else if ((strcmp(tmpbuf, "WPA") == 0) || (strcmp(tmpbuf, "wpa") == 0)) else if ((strcmp(tmpbuf, "WPA") == 0) || (strcmp(tmpbuf, "wpa") == 0))
pAd->StaCfg.AuthMode = Ndis802_11AuthModeWPA; pAd->StaCfg.AuthMode = Ndis802_11AuthModeWPA;
else if ((strcmp(tmpbuf, "WPA2") == 0) || (strcmp(tmpbuf, "wpa2") == 0)) else if ((strcmp(tmpbuf, "WPA2") == 0) || (strcmp(tmpbuf, "wpa2") == 0))
pAd->StaCfg.AuthMode = Ndis802_11AuthModeWPA2; pAd->StaCfg.AuthMode = Ndis802_11AuthModeWPA2;
#endif // WPA_SUPPLICANT_SUPPORT //
else else
pAd->StaCfg.AuthMode = Ndis802_11AuthModeOpen; pAd->StaCfg.AuthMode = Ndis802_11AuthModeOpen;

View File

@ -1949,7 +1949,6 @@ typedef struct _STA_ADMIN_CONFIG {
BOOLEAN bFastRoaming; // 0:disable fast roaming, 1:enable fast roaming BOOLEAN bFastRoaming; // 0:disable fast roaming, 1:enable fast roaming
CHAR dBmToRoam; // the condition to roam when receiving Rssi less than this value. It's negative value. CHAR dBmToRoam; // the condition to roam when receiving Rssi less than this value. It's negative value.
#ifdef WPA_SUPPLICANT_SUPPORT
BOOLEAN IEEE8021X; BOOLEAN IEEE8021X;
BOOLEAN IEEE8021x_required_keys; BOOLEAN IEEE8021x_required_keys;
CIPHER_KEY DesireSharedKey[4]; // Record user desired WEP keys CIPHER_KEY DesireSharedKey[4]; // Record user desired WEP keys
@ -1960,7 +1959,6 @@ typedef struct _STA_ADMIN_CONFIG {
// 2: driver takes care of scanning, AP selection, and IEEE 802.11 association parameters // 2: driver takes care of scanning, AP selection, and IEEE 802.11 association parameters
UCHAR WpaSupplicantUP; UCHAR WpaSupplicantUP;
UCHAR WpaSupplicantScanCount; UCHAR WpaSupplicantScanCount;
#endif // WPA_SUPPLICANT_SUPPORT //
CHAR dev_name[16]; CHAR dev_name[16];
USHORT OriDevType; USHORT OriDevType;
@ -5851,7 +5849,6 @@ VOID QueryBATABLE(
OUT PQUERYBA_TABLE pBAT); OUT PQUERYBA_TABLE pBAT);
#endif // DOT11_N_SUPPORT // #endif // DOT11_N_SUPPORT //
#ifdef WPA_SUPPLICANT_SUPPORT
INT WpaCheckEapCode( INT WpaCheckEapCode(
IN PRTMP_ADAPTER pAd, IN PRTMP_ADAPTER pAd,
IN PUCHAR pFrame, IN PUCHAR pFrame,
@ -5864,7 +5861,6 @@ VOID WpaSendMicFailureToWpaSupplicant(
VOID SendAssocIEsToWpaSupplicant( VOID SendAssocIEsToWpaSupplicant(
IN PRTMP_ADAPTER pAd); IN PRTMP_ADAPTER pAd);
#endif // WPA_SUPPLICANT_SUPPORT //
int wext_notify_event_assoc( int wext_notify_event_assoc(
IN RTMP_ADAPTER *pAd); IN RTMP_ADAPTER *pAd);

View File

@ -260,9 +260,8 @@ VOID CntlIdleProc(
DisassocParmFill(pAd, &DisassocReq, pAd->CommonCfg.Bssid, REASON_DISASSOC_STA_LEAVING); DisassocParmFill(pAd, &DisassocReq, pAd->CommonCfg.Bssid, REASON_DISASSOC_STA_LEAVING);
MlmeEnqueue(pAd, ASSOC_STATE_MACHINE, MT2_MLME_DISASSOC_REQ, sizeof(MLME_DISASSOC_REQ_STRUCT), &DisassocReq); MlmeEnqueue(pAd, ASSOC_STATE_MACHINE, MT2_MLME_DISASSOC_REQ, sizeof(MLME_DISASSOC_REQ_STRUCT), &DisassocReq);
pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_DISASSOC; pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_DISASSOC;
#ifdef WPA_SUPPLICANT_SUPPORT
if (pAd->StaCfg.WpaSupplicantUP != WPA_SUPPLICANT_ENABLE_WITH_WEB_UI) if (pAd->StaCfg.WpaSupplicantUP != WPA_SUPPLICANT_ENABLE_WITH_WEB_UI)
#endif // WPA_SUPPLICANT_SUPPORT //
{ {
// Set the AutoReconnectSsid to prevent it reconnect to old SSID // Set the AutoReconnectSsid to prevent it reconnect to old SSID
// Since calling this indicate user don't want to connect to that SSID anymore. // Since calling this indicate user don't want to connect to that SSID anymore.
@ -1479,15 +1478,11 @@ VOID LinkUp(
// If WEP is enabled, add paiewise and shared key // If WEP is enabled, add paiewise and shared key
#ifdef WPA_SUPPLICANT_SUPPORT
if (((pAd->StaCfg.WpaSupplicantUP)&& if (((pAd->StaCfg.WpaSupplicantUP)&&
(pAd->StaCfg.WepStatus == Ndis802_11WEPEnabled)&& (pAd->StaCfg.WepStatus == Ndis802_11WEPEnabled)&&
(pAd->StaCfg.PortSecured == WPA_802_1X_PORT_SECURED)) || (pAd->StaCfg.PortSecured == WPA_802_1X_PORT_SECURED)) ||
((pAd->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_DISABLE)&& ((pAd->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_DISABLE)&&
(pAd->StaCfg.WepStatus == Ndis802_11WEPEnabled))) (pAd->StaCfg.WepStatus == Ndis802_11WEPEnabled)))
#else
if (pAd->StaCfg.WepStatus == Ndis802_11WEPEnabled)
#endif // WPA_SUPPLICANT_SUPPORT //
{ {
PUCHAR Key; PUCHAR Key;
UCHAR CipherAlg; UCHAR CipherAlg;
@ -1915,7 +1910,7 @@ VOID LinkDown(
} }
// 802.1x port control // 802.1x port control
#ifdef WPA_SUPPLICANT_SUPPORT
// Prevent clear PortSecured here with static WEP // Prevent clear PortSecured here with static WEP
// NetworkManger set security policy first then set SSID to connect AP. // NetworkManger set security policy first then set SSID to connect AP.
if (pAd->StaCfg.WpaSupplicantUP && if (pAd->StaCfg.WpaSupplicantUP &&
@ -1925,7 +1920,6 @@ VOID LinkDown(
pAd->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED; pAd->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
} }
else else
#endif // WPA_SUPPLICANT_SUPPORT //
{ {
pAd->StaCfg.PortSecured = WPA_802_1X_PORT_NOT_SECURED; pAd->StaCfg.PortSecured = WPA_802_1X_PORT_NOT_SECURED;
pAd->StaCfg.PrivacyFilter = Ndis802_11PrivFilter8021xWEP; pAd->StaCfg.PrivacyFilter = Ndis802_11PrivFilter8021xWEP;

View File

@ -49,7 +49,6 @@ VOID STARxEAPOLFrameIndicate(
PRXWI_STRUC pRxWI = pRxBlk->pRxWI; PRXWI_STRUC pRxWI = pRxBlk->pRxWI;
UCHAR *pTmpBuf; UCHAR *pTmpBuf;
#ifdef WPA_SUPPLICANT_SUPPORT
if (pAd->StaCfg.WpaSupplicantUP) if (pAd->StaCfg.WpaSupplicantUP)
{ {
// All EAPoL frames have to pass to upper layer (ex. WPA_SUPPLICANT daemon) // All EAPoL frames have to pass to upper layer (ex. WPA_SUPPLICANT daemon)
@ -115,7 +114,6 @@ VOID STARxEAPOLFrameIndicate(
} }
} }
else else
#endif // WPA_SUPPLICANT_SUPPORT //
{ {
// Special DATA frame that has to pass to MLME // Special DATA frame that has to pass to MLME
// 1. Cisco Aironet frames for CCX2. We need pass it to MLME for special process // 1. Cisco Aironet frames for CCX2. We need pass it to MLME for special process
@ -235,13 +233,11 @@ BOOLEAN STACheckTkipMICValue(
{ {
DBGPRINT_RAW(RT_DEBUG_ERROR,("Rx MIC Value error 2\n")); DBGPRINT_RAW(RT_DEBUG_ERROR,("Rx MIC Value error 2\n"));
#ifdef WPA_SUPPLICANT_SUPPORT
if (pAd->StaCfg.WpaSupplicantUP) if (pAd->StaCfg.WpaSupplicantUP)
{ {
WpaSendMicFailureToWpaSupplicant(pAd, (pWpaKey->Type == PAIRWISEKEY) ? TRUE : FALSE); WpaSendMicFailureToWpaSupplicant(pAd, (pWpaKey->Type == PAIRWISEKEY) ? TRUE : FALSE);
} }
else else
#endif // WPA_SUPPLICANT_SUPPORT //
{ {
RTMPReportMicError(pAd, pWpaKey); RTMPReportMicError(pAd, pWpaKey);
} }
@ -961,9 +957,7 @@ NDIS_STATUS STASendPacket(
(pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK) || (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK) ||
(pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2) || (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2) ||
(pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK) (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK)
#ifdef WPA_SUPPLICANT_SUPPORT
|| (pAd->StaCfg.IEEE8021X == TRUE) || (pAd->StaCfg.IEEE8021X == TRUE)
#endif // WPA_SUPPLICANT_SUPPORT //
) )
&& ((pAd->StaCfg.PortSecured == WPA_802_1X_PORT_NOT_SECURED) || (pAd->StaCfg.MicErrCnt >= 2)) && ((pAd->StaCfg.PortSecured == WPA_802_1X_PORT_NOT_SECURED) || (pAd->StaCfg.MicErrCnt >= 2))
&& (RTMP_GET_PACKET_EAPOL(pPacket)== FALSE) && (RTMP_GET_PACKET_EAPOL(pPacket)== FALSE)
@ -1218,9 +1212,7 @@ VOID RTMPSendNullFrame(
(pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK) || (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK) ||
(pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2) || (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2) ||
(pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK) (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK)
#ifdef WPA_SUPPLICANT_SUPPORT
|| (pAd->StaCfg.IEEE8021X == TRUE) || (pAd->StaCfg.IEEE8021X == TRUE)
#endif
) && ) &&
(pAd->StaCfg.PortSecured == WPA_802_1X_PORT_NOT_SECURED)) (pAd->StaCfg.PortSecured == WPA_802_1X_PORT_NOT_SECURED))
{ {
@ -1341,13 +1333,11 @@ VOID STAFindCipherAlgorithm(
CipherAlg = CIPHER_NONE; CipherAlg = CIPHER_NONE;
else if ((Cipher == Ndis802_11EncryptionDisabled) || (pAd->SharedKey[BSS0][KeyIdx].KeyLen == 0)) else if ((Cipher == Ndis802_11EncryptionDisabled) || (pAd->SharedKey[BSS0][KeyIdx].KeyLen == 0))
CipherAlg = CIPHER_NONE; CipherAlg = CIPHER_NONE;
#ifdef WPA_SUPPLICANT_SUPPORT
else if ( pAd->StaCfg.WpaSupplicantUP && else if ( pAd->StaCfg.WpaSupplicantUP &&
(Cipher == Ndis802_11Encryption1Enabled) && (Cipher == Ndis802_11Encryption1Enabled) &&
(pAd->StaCfg.IEEE8021X == TRUE) && (pAd->StaCfg.IEEE8021X == TRUE) &&
(pAd->StaCfg.PortSecured == WPA_802_1X_PORT_NOT_SECURED)) (pAd->StaCfg.PortSecured == WPA_802_1X_PORT_NOT_SECURED))
CipherAlg = CIPHER_NONE; CipherAlg = CIPHER_NONE;
#endif // WPA_SUPPLICANT_SUPPORT //
else else
{ {
//Header_802_11.FC.Wep = 1; //Header_802_11.FC.Wep = 1;

View File

@ -1928,8 +1928,6 @@ VOID RTMPReportMicError(
} }
} }
#ifdef WPA_SUPPLICANT_SUPPORT
#define LENGTH_EAP_H 4 #define LENGTH_EAP_H 4
// If the received frame is EAP-Packet ,find out its EAP-Code (Request(0x01), Response(0x02), Success(0x03), Failure(0x04)). // If the received frame is EAP-Packet ,find out its EAP-Code (Request(0x01), Response(0x02), Success(0x03), Failure(0x04)).
INT WpaCheckEapCode( INT WpaCheckEapCode(
@ -1970,7 +1968,6 @@ VOID WpaSendMicFailureToWpaSupplicant(
return; return;
} }
#endif // WPA_SUPPLICANT_SUPPORT //
VOID WpaMicFailureReportFrame( VOID WpaMicFailureReportFrame(
IN PRTMP_ADAPTER pAd, IN PRTMP_ADAPTER pAd,

View File

@ -163,11 +163,9 @@ INT Set_PSMode_Proc(
IN PRTMP_ADAPTER pAdapter, IN PRTMP_ADAPTER pAdapter,
IN PUCHAR arg); IN PUCHAR arg);
#ifdef WPA_SUPPLICANT_SUPPORT
INT Set_Wpa_Support( INT Set_Wpa_Support(
IN PRTMP_ADAPTER pAd, IN PRTMP_ADAPTER pAd,
IN PUCHAR arg); IN PUCHAR arg);
#endif // WPA_SUPPLICANT_SUPPORT //
#ifdef DBG #ifdef DBG
VOID RTMPIoctlBBP( VOID RTMPIoctlBBP(
@ -264,13 +262,7 @@ static struct {
#ifdef DBG #ifdef DBG
{"Debug", Set_Debug_Proc}, {"Debug", Set_Debug_Proc},
#endif #endif
#ifdef WPA_SUPPLICANT_SUPPORT
{"WpaSupport", Set_Wpa_Support}, {"WpaSupport", Set_Wpa_Support},
#endif // WPA_SUPPLICANT_SUPPORT //
{"FixedTxMode", Set_FixedTxMode_Proc}, {"FixedTxMode", Set_FixedTxMode_Proc},
#ifdef DOT11_N_SUPPORT #ifdef DOT11_N_SUPPORT
{"TGnWifiTest", Set_TGnWifiTest_Proc}, {"TGnWifiTest", Set_TGnWifiTest_Proc},
@ -305,14 +297,13 @@ VOID RTMPAddKey(
NdisZeroMemory(&pAd->SharedKey[BSS0][0], sizeof(CIPHER_KEY)); NdisZeroMemory(&pAd->SharedKey[BSS0][0], sizeof(CIPHER_KEY));
pAd->SharedKey[BSS0][0].KeyLen = LEN_TKIP_EK; pAd->SharedKey[BSS0][0].KeyLen = LEN_TKIP_EK;
NdisMoveMemory(pAd->SharedKey[BSS0][0].Key, pKey->KeyMaterial, LEN_TKIP_EK); NdisMoveMemory(pAd->SharedKey[BSS0][0].Key, pKey->KeyMaterial, LEN_TKIP_EK);
#ifdef WPA_SUPPLICANT_SUPPORT
if (pAd->StaCfg.PairCipher == Ndis802_11Encryption2Enabled) if (pAd->StaCfg.PairCipher == Ndis802_11Encryption2Enabled)
{ {
NdisMoveMemory(pAd->SharedKey[BSS0][0].RxMic, pKey->KeyMaterial + LEN_TKIP_EK, LEN_TKIP_TXMICK); NdisMoveMemory(pAd->SharedKey[BSS0][0].RxMic, pKey->KeyMaterial + LEN_TKIP_EK, LEN_TKIP_TXMICK);
NdisMoveMemory(pAd->SharedKey[BSS0][0].TxMic, pKey->KeyMaterial + LEN_TKIP_EK + LEN_TKIP_TXMICK, LEN_TKIP_RXMICK); NdisMoveMemory(pAd->SharedKey[BSS0][0].TxMic, pKey->KeyMaterial + LEN_TKIP_EK + LEN_TKIP_TXMICK, LEN_TKIP_RXMICK);
} }
else else
#endif // WPA_SUPPLICANT_SUPPORT //
{ {
NdisMoveMemory(pAd->SharedKey[BSS0][0].TxMic, pKey->KeyMaterial + LEN_TKIP_EK, LEN_TKIP_TXMICK); NdisMoveMemory(pAd->SharedKey[BSS0][0].TxMic, pKey->KeyMaterial + LEN_TKIP_EK, LEN_TKIP_TXMICK);
NdisMoveMemory(pAd->SharedKey[BSS0][0].RxMic, pKey->KeyMaterial + LEN_TKIP_EK + LEN_TKIP_TXMICK, LEN_TKIP_RXMICK); NdisMoveMemory(pAd->SharedKey[BSS0][0].RxMic, pKey->KeyMaterial + LEN_TKIP_EK + LEN_TKIP_TXMICK, LEN_TKIP_RXMICK);
@ -366,14 +357,13 @@ VOID RTMPAddKey(
NdisZeroMemory(&pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId], sizeof(CIPHER_KEY)); NdisZeroMemory(&pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId], sizeof(CIPHER_KEY));
pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].KeyLen = LEN_TKIP_EK; pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].KeyLen = LEN_TKIP_EK;
NdisMoveMemory(pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].Key, pKey->KeyMaterial, LEN_TKIP_EK); NdisMoveMemory(pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].Key, pKey->KeyMaterial, LEN_TKIP_EK);
#ifdef WPA_SUPPLICANT_SUPPORT
if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption2Enabled) if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption2Enabled)
{ {
NdisMoveMemory(pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].RxMic, pKey->KeyMaterial + LEN_TKIP_EK, LEN_TKIP_TXMICK); NdisMoveMemory(pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].RxMic, pKey->KeyMaterial + LEN_TKIP_EK, LEN_TKIP_TXMICK);
NdisMoveMemory(pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].TxMic, pKey->KeyMaterial + LEN_TKIP_EK + LEN_TKIP_TXMICK, LEN_TKIP_RXMICK); NdisMoveMemory(pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].TxMic, pKey->KeyMaterial + LEN_TKIP_EK + LEN_TKIP_TXMICK, LEN_TKIP_RXMICK);
} }
else else
#endif // WPA_SUPPLICANT_SUPPORT //
{ {
NdisMoveMemory(pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].TxMic, pKey->KeyMaterial + LEN_TKIP_EK, LEN_TKIP_TXMICK); NdisMoveMemory(pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].TxMic, pKey->KeyMaterial + LEN_TKIP_EK, LEN_TKIP_TXMICK);
NdisMoveMemory(pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].RxMic, pKey->KeyMaterial + LEN_TKIP_EK + LEN_TKIP_TXMICK, LEN_TKIP_RXMICK); NdisMoveMemory(pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].RxMic, pKey->KeyMaterial + LEN_TKIP_EK + LEN_TKIP_TXMICK, LEN_TKIP_RXMICK);
@ -854,14 +844,12 @@ int rt_ioctl_giwap(struct net_device *dev,
ap_addr->sa_family = ARPHRD_ETHER; ap_addr->sa_family = ARPHRD_ETHER;
memcpy(ap_addr->sa_data, &pAdapter->CommonCfg.Bssid, ETH_ALEN); memcpy(ap_addr->sa_data, &pAdapter->CommonCfg.Bssid, ETH_ALEN);
} }
#ifdef WPA_SUPPLICANT_SUPPORT
// Add for RT2870 // Add for RT2870
else if (pAdapter->StaCfg.WpaSupplicantUP != WPA_SUPPLICANT_DISABLE) else if (pAdapter->StaCfg.WpaSupplicantUP != WPA_SUPPLICANT_DISABLE)
{ {
ap_addr->sa_family = ARPHRD_ETHER; ap_addr->sa_family = ARPHRD_ETHER;
memcpy(ap_addr->sa_data, &pAdapter->MlmeAux.Bssid, ETH_ALEN); memcpy(ap_addr->sa_data, &pAdapter->MlmeAux.Bssid, ETH_ALEN);
} }
#endif // WPA_SUPPLICANT_SUPPORT //
else else
{ {
DBGPRINT(RT_DEBUG_TRACE, ("IOCTL::SIOCGIWAP(=EMPTY)\n")); DBGPRINT(RT_DEBUG_TRACE, ("IOCTL::SIOCGIWAP(=EMPTY)\n"));
@ -970,12 +958,10 @@ int rt_ioctl_siwscan(struct net_device *dev,
} }
#ifdef WPA_SUPPLICANT_SUPPORT
if (pAdapter->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_ENABLE) if (pAdapter->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_ENABLE)
{ {
pAdapter->StaCfg.WpaSupplicantScanCount++; pAdapter->StaCfg.WpaSupplicantScanCount++;
} }
#endif // WPA_SUPPLICANT_SUPPORT //
pAdapter->StaCfg.bScanReqIsFromWebUI = TRUE; pAdapter->StaCfg.bScanReqIsFromWebUI = TRUE;
if (RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS)) if (RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS))
@ -983,7 +969,6 @@ int rt_ioctl_siwscan(struct net_device *dev,
do{ do{
Now = jiffies; Now = jiffies;
#ifdef WPA_SUPPLICANT_SUPPORT
if ((pAdapter->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_ENABLE) && if ((pAdapter->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_ENABLE) &&
(pAdapter->StaCfg.WpaSupplicantScanCount > 3)) (pAdapter->StaCfg.WpaSupplicantScanCount > 3))
{ {
@ -991,7 +976,6 @@ int rt_ioctl_siwscan(struct net_device *dev,
Status = NDIS_STATUS_SUCCESS; Status = NDIS_STATUS_SUCCESS;
break; break;
} }
#endif // WPA_SUPPLICANT_SUPPORT //
if ((OPSTATUS_TEST_FLAG(pAdapter, fOP_STATUS_MEDIA_STATE_CONNECTED)) && if ((OPSTATUS_TEST_FLAG(pAdapter, fOP_STATUS_MEDIA_STATE_CONNECTED)) &&
((pAdapter->StaCfg.AuthMode == Ndis802_11AuthModeWPA) || ((pAdapter->StaCfg.AuthMode == Ndis802_11AuthModeWPA) ||
@ -1051,13 +1035,10 @@ int rt_ioctl_giwscan(struct net_device *dev,
return -EAGAIN; return -EAGAIN;
} }
#ifdef WPA_SUPPLICANT_SUPPORT
if (pAdapter->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_ENABLE) if (pAdapter->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_ENABLE)
{ {
pAdapter->StaCfg.WpaSupplicantScanCount = 0; pAdapter->StaCfg.WpaSupplicantScanCount = 0;
} }
#endif // WPA_SUPPLICANT_SUPPORT //
if (pAdapter->ScanTab.BssNr == 0) if (pAdapter->ScanTab.BssNr == 0)
{ {
@ -1398,14 +1379,12 @@ int rt_ioctl_giwessid(struct net_device *dev,
memcpy(essid, pAdapter->CommonCfg.Ssid, pAdapter->CommonCfg.SsidLen); memcpy(essid, pAdapter->CommonCfg.Ssid, pAdapter->CommonCfg.SsidLen);
} }
#ifdef RT2870 #ifdef RT2870
#ifdef WPA_SUPPLICANT_SUPPORT
// Add for RT2870 // Add for RT2870
else if (pAdapter->StaCfg.WpaSupplicantUP != WPA_SUPPLICANT_DISABLE) else if (pAdapter->StaCfg.WpaSupplicantUP != WPA_SUPPLICANT_DISABLE)
{ {
data->length = pAdapter->CommonCfg.SsidLen; data->length = pAdapter->CommonCfg.SsidLen;
memcpy(essid, pAdapter->CommonCfg.Ssid, pAdapter->CommonCfg.SsidLen); memcpy(essid, pAdapter->CommonCfg.Ssid, pAdapter->CommonCfg.SsidLen);
} }
#endif // WPA_SUPPLICANT_SUPPORT //
#endif // RT2870 // #endif // RT2870 //
else else
{//the ANY ssid was specified {//the ANY ssid was specified
@ -1901,10 +1880,7 @@ rt_private_get_statistics(struct net_device *dev, struct iw_request_info *info,
sprintf(extra+strlen(extra), "RSSI-B (if available) = %ld\n", (LONG)(pAd->StaCfg.RssiSample.LastRssi1 - pAd->BbpRssiToDbmDelta)); sprintf(extra+strlen(extra), "RSSI-B (if available) = %ld\n", (LONG)(pAd->StaCfg.RssiSample.LastRssi1 - pAd->BbpRssiToDbmDelta));
sprintf(extra+strlen(extra), "RSSI-C (if available) = %ld\n\n", (LONG)(pAd->StaCfg.RssiSample.LastRssi2 - pAd->BbpRssiToDbmDelta)); sprintf(extra+strlen(extra), "RSSI-C (if available) = %ld\n\n", (LONG)(pAd->StaCfg.RssiSample.LastRssi2 - pAd->BbpRssiToDbmDelta));
} }
#ifdef WPA_SUPPLICANT_SUPPORT
sprintf(extra+strlen(extra), "WpaSupplicantUP = %d\n\n", pAd->StaCfg.WpaSupplicantUP); sprintf(extra+strlen(extra), "WpaSupplicantUP = %d\n\n", pAd->StaCfg.WpaSupplicantUP);
#endif // WPA_SUPPLICANT_SUPPORT //
wrq->length = strlen(extra) + 1; // 1: size of '\0' wrq->length = strlen(extra) + 1; // 1: size of '\0'
DBGPRINT(RT_DEBUG_TRACE, ("<== rt_private_get_statistics, wrq->length = %d\n", wrq->length)); DBGPRINT(RT_DEBUG_TRACE, ("<== rt_private_get_statistics, wrq->length = %d\n", wrq->length));
@ -2216,9 +2192,7 @@ int rt_ioctl_siwauth(struct net_device *dev,
pAdapter->StaCfg.WepStatus = Ndis802_11WEPEnabled; pAdapter->StaCfg.WepStatus = Ndis802_11WEPEnabled;
pAdapter->StaCfg.OrigWepStatus = pAdapter->StaCfg.WepStatus; pAdapter->StaCfg.OrigWepStatus = pAdapter->StaCfg.WepStatus;
pAdapter->StaCfg.PairCipher = Ndis802_11WEPEnabled; pAdapter->StaCfg.PairCipher = Ndis802_11WEPEnabled;
#ifdef WPA_SUPPLICANT_SUPPORT
pAdapter->StaCfg.IEEE8021X = FALSE; pAdapter->StaCfg.IEEE8021X = FALSE;
#endif // WPA_SUPPLICANT_SUPPORT //
} }
else if (param->value == IW_AUTH_CIPHER_TKIP) else if (param->value == IW_AUTH_CIPHER_TKIP)
{ {
@ -2260,22 +2234,16 @@ int rt_ioctl_siwauth(struct net_device *dev,
if (pAdapter->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK) if (pAdapter->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK)
{ {
pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeWPA; pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeWPA;
#ifdef WPA_SUPPLICANT_SUPPORT
pAdapter->StaCfg.IEEE8021X = FALSE; pAdapter->StaCfg.IEEE8021X = FALSE;
#endif // WPA_SUPPLICANT_SUPPORT //
} }
else if (pAdapter->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK) else if (pAdapter->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK)
{ {
pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeWPA2; pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeWPA2;
#ifdef WPA_SUPPLICANT_SUPPORT
pAdapter->StaCfg.IEEE8021X = FALSE; pAdapter->StaCfg.IEEE8021X = FALSE;
#endif // WPA_SUPPLICANT_SUPPORT //
} }
#ifdef WPA_SUPPLICANT_SUPPORT
else else
// WEP 1x // WEP 1x
pAdapter->StaCfg.IEEE8021X = TRUE; pAdapter->StaCfg.IEEE8021X = TRUE;
#endif // WPA_SUPPLICANT_SUPPORT //
} }
else if (param->value == 0) else if (param->value == 0)
{ {
@ -3140,12 +3108,10 @@ INT RTMPSetInformation(
#ifdef DOT11_N_SUPPORT #ifdef DOT11_N_SUPPORT
OID_SET_HT_PHYMODE HT_PhyMode; //11n ,kathy OID_SET_HT_PHYMODE HT_PhyMode; //11n ,kathy
#endif // DOT11_N_SUPPORT // #endif // DOT11_N_SUPPORT //
#ifdef WPA_SUPPLICANT_SUPPORT
PNDIS_802_11_PMKID pPmkId = NULL; PNDIS_802_11_PMKID pPmkId = NULL;
BOOLEAN IEEE8021xState = FALSE; BOOLEAN IEEE8021xState = FALSE;
BOOLEAN IEEE8021x_required_keys = FALSE; BOOLEAN IEEE8021x_required_keys = FALSE;
UCHAR wpa_supplicant_enable = 0; UCHAR wpa_supplicant_enable = 0;
#endif // WPA_SUPPLICANT_SUPPORT //
#ifdef DOT11_N_SUPPORT #ifdef DOT11_N_SUPPORT
MaxPhyMode = PHY_11N_5G; MaxPhyMode = PHY_11N_5G;
@ -4090,18 +4056,15 @@ INT RTMPSetInformation(
// Default key for tx (shared key) // Default key for tx (shared key)
if (pWepKey->KeyIndex & 0x80000000) if (pWepKey->KeyIndex & 0x80000000)
{ {
#ifdef WPA_SUPPLICANT_SUPPORT
// set key material and key length // set key material and key length
NdisZeroMemory(pAdapter->StaCfg.DesireSharedKey[KeyIdx].Key, 16); NdisZeroMemory(pAdapter->StaCfg.DesireSharedKey[KeyIdx].Key, 16);
pAdapter->StaCfg.DesireSharedKey[KeyIdx].KeyLen = (UCHAR) pWepKey->KeyLength; pAdapter->StaCfg.DesireSharedKey[KeyIdx].KeyLen = (UCHAR) pWepKey->KeyLength;
NdisMoveMemory(pAdapter->StaCfg.DesireSharedKey[KeyIdx].Key, &pWepKey->KeyMaterial, pWepKey->KeyLength); NdisMoveMemory(pAdapter->StaCfg.DesireSharedKey[KeyIdx].Key, &pWepKey->KeyMaterial, pWepKey->KeyLength);
pAdapter->StaCfg.DesireSharedKeyId = KeyIdx; pAdapter->StaCfg.DesireSharedKeyId = KeyIdx;
pAdapter->StaCfg.DesireSharedKey[KeyIdx].CipherAlg = CipherAlg; pAdapter->StaCfg.DesireSharedKey[KeyIdx].CipherAlg = CipherAlg;
#endif // WPA_SUPPLICANT_SUPPORT //
pAdapter->StaCfg.DefaultKeyId = (UCHAR) KeyIdx; pAdapter->StaCfg.DefaultKeyId = (UCHAR) KeyIdx;
} }
#ifdef WPA_SUPPLICANT_SUPPORT
if ((pAdapter->StaCfg.WpaSupplicantUP != WPA_SUPPLICANT_DISABLE) && if ((pAdapter->StaCfg.WpaSupplicantUP != WPA_SUPPLICANT_DISABLE) &&
(pAdapter->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)) (pAdapter->StaCfg.AuthMode >= Ndis802_11AuthModeWPA))
{ {
@ -4119,7 +4082,6 @@ INT RTMPSetInformation(
pAdapter->IndicateMediaState = NdisMediaStateConnected; pAdapter->IndicateMediaState = NdisMediaStateConnected;
} }
else if (pAdapter->StaCfg.PortSecured == WPA_802_1X_PORT_SECURED) else if (pAdapter->StaCfg.PortSecured == WPA_802_1X_PORT_SECURED)
#endif // WPA_SUPPLICANT_SUPPORT
{ {
Key = pAdapter->SharedKey[BSS0][KeyIdx].Key; Key = pAdapter->SharedKey[BSS0][KeyIdx].Key;
@ -4140,7 +4102,6 @@ INT RTMPSetInformation(
} }
kfree(pWepKey); kfree(pWepKey);
break; break;
#ifdef WPA_SUPPLICANT_SUPPORT
case OID_SET_COUNTERMEASURES: case OID_SET_COUNTERMEASURES:
if (wrq->u.data.length != sizeof(int)) if (wrq->u.data.length != sizeof(int))
Status = -EINVAL; Status = -EINVAL;
@ -4274,8 +4235,6 @@ INT RTMPSetInformation(
if(pPmkId) if(pPmkId)
kfree(pPmkId); kfree(pPmkId);
break; break;
#endif // WPA_SUPPLICANT_SUPPORT //
default: default:
DBGPRINT(RT_DEBUG_TRACE, ("Set::unknown IOCTL's subcmd = 0x%08x\n", cmd)); DBGPRINT(RT_DEBUG_TRACE, ("Set::unknown IOCTL's subcmd = 0x%08x\n", cmd));
Status = -EOPNOTSUPP; Status = -EOPNOTSUPP;
@ -4811,7 +4770,6 @@ INT RTMPQueryInformation(
Status = copy_to_user(wrq->u.data.pointer, &pAdapter->CommonCfg.bWmmCapable, wrq->u.data.length); Status = copy_to_user(wrq->u.data.pointer, &pAdapter->CommonCfg.bWmmCapable, wrq->u.data.length);
DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_QUERY_WMM (=%d)\n", pAdapter->CommonCfg.bWmmCapable)); DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_QUERY_WMM (=%d)\n", pAdapter->CommonCfg.bWmmCapable));
break; break;
#ifdef WPA_SUPPLICANT_SUPPORT
case RT_OID_NEW_DRIVER: case RT_OID_NEW_DRIVER:
{ {
UCHAR enabled = 1; UCHAR enabled = 1;
@ -4825,8 +4783,6 @@ INT RTMPQueryInformation(
Status = copy_to_user(wrq->u.data.pointer, &pAdapter->StaCfg.WpaSupplicantUP, wrq->u.data.length); Status = copy_to_user(wrq->u.data.pointer, &pAdapter->StaCfg.WpaSupplicantUP, wrq->u.data.length);
DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_WPA_SUPPLICANT_SUPPORT (=%d)\n", pAdapter->StaCfg.WpaSupplicantUP)); DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_WPA_SUPPLICANT_SUPPORT (=%d)\n", pAdapter->StaCfg.WpaSupplicantUP));
break; break;
#endif // WPA_SUPPLICANT_SUPPORT //
case RT_OID_DRIVER_DEVICE_NAME: case RT_OID_DRIVER_DEVICE_NAME:
DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_DRIVER_DEVICE_NAME \n")); DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_DRIVER_DEVICE_NAME \n"));
wrq->u.data.length = 16; wrq->u.data.length = 16;
@ -5510,12 +5466,10 @@ INT Set_AuthMode_Proc(
pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeWPANone; pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeWPANone;
else if ((strcmp(arg, "WPA2PSK") == 0) || (strcmp(arg, "wpa2psk") == 0)) else if ((strcmp(arg, "WPA2PSK") == 0) || (strcmp(arg, "wpa2psk") == 0))
pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeWPA2PSK; pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeWPA2PSK;
#ifdef WPA_SUPPLICANT_SUPPORT
else if ((strcmp(arg, "WPA") == 0) || (strcmp(arg, "wpa") == 0)) else if ((strcmp(arg, "WPA") == 0) || (strcmp(arg, "wpa") == 0))
pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeWPA; pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeWPA;
else if ((strcmp(arg, "WPA2") == 0) || (strcmp(arg, "wpa2") == 0)) else if ((strcmp(arg, "WPA2") == 0) || (strcmp(arg, "wpa2") == 0))
pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeWPA2; pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeWPA2;
#endif // WPA_SUPPLICANT_SUPPORT //
else else
return FALSE; return FALSE;
@ -6057,7 +6011,6 @@ INT Set_PSMode_Proc(
return TRUE; return TRUE;
} }
#ifdef WPA_SUPPLICANT_SUPPORT
/* /*
========================================================================== ==========================================================================
Description: Description:
@ -6088,7 +6041,6 @@ INT Set_Wpa_Support(
return TRUE; return TRUE;
} }
#endif // WPA_SUPPLICANT_SUPPORT //
#ifdef DBG #ifdef DBG
/* /*