Staging: vt6656: whitespace cleanups in ioctl.c

The indents on this file didn't line up so it was hard to work with.
I changed other white space issues as I came across them.  I also
deleted or changed some couple comments and the comment style.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Dan Carpenter 2011-10-20 09:10:25 +03:00 committed by Greg Kroah-Hartman
parent 4fb544c947
commit 883aeecc9d
1 changed files with 589 additions and 658 deletions

View File

@ -40,21 +40,11 @@
#include "rndis.h"
#include "rf.h"
/*--------------------- Static Definitions -------------------------*/
SWPAResult wpa_Result;
static int msglevel = MSG_LEVEL_INFO;
/*--------------------- Static Classes ----------------------------*/
/*--------------------- Static Variables --------------------------*/
//static int msglevel =MSG_LEVEL_DEBUG;
static int msglevel =MSG_LEVEL_INFO;
SWPAResult wpa_Result;
/*--------------------- Static Functions --------------------------*/
/*--------------------- Export Variables --------------------------*/
int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
int private_ioctl(PSDevice pDevice, struct ifreq *rq)
{
PSCmdRequest pReq = (PSCmdRequest)rq;
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
@ -77,16 +67,14 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
SCmdLinkStatus sLinkStatus;
BYTE abySuppRates[] = {WLAN_EID_SUPP_RATES, 4, 0x02, 0x04, 0x0B, 0x16};
BYTE abyNullAddr[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
DWORD dwKeyIndex= 0;
DWORD dwKeyIndex = 0;
BYTE abyScanSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1];
signed long ldBm;
pReq->wResult = 0;
switch(pReq->wCmdCode) {
switch (pReq->wCmdCode) {
case WLAN_CMD_BSS_SCAN:
if (copy_from_user(&sScanCmd, pReq->data, sizeof(SCmdScan))) {
result = -EFAULT;
break;
@ -100,14 +88,14 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
spin_lock_irq(&pDevice->lock);
if (memcmp(pMgmt->abyCurrBSSID, &abyNullAddr[0], 6) == 0)
BSSvClearBSSList((void *) pDevice, FALSE);
BSSvClearBSSList((void *)pDevice, FALSE);
else
BSSvClearBSSList((void *) pDevice, pDevice->bLinkPass);
BSSvClearBSSList((void *)pDevice, pDevice->bLinkPass);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_BSS_SCAN..begin\n");
if (pItemSSID->len != 0)
bScheduleCommand((void *) pDevice,
bScheduleCommand((void *)pDevice,
WLAN_CMD_BSSID_SCAN,
abyScanSSID);
else
@ -117,8 +105,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
break;
case WLAN_CMD_ZONETYPE_SET:
//mike add :cann't support.
result=-EOPNOTSUPP;
result = -EOPNOTSUPP;
break;
if (copy_from_user(&sZoneTypeCmd, pReq->data, sizeof(SCmdZoneTypeSet))) {
@ -126,50 +113,42 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
break;
}
if(sZoneTypeCmd.bWrite==TRUE) {
//////write zonetype
if(sZoneTypeCmd.ZoneType == ZoneType_USA) {
//set to USA
if (sZoneTypeCmd.bWrite == TRUE) {
/* write zonetype */
if (sZoneTypeCmd.ZoneType == ZoneType_USA) {
/* set to USA */
printk("set_ZoneType:USA\n");
}
else if(sZoneTypeCmd.ZoneType == ZoneType_Japan) {
//set to Japan
} else if (sZoneTypeCmd.ZoneType == ZoneType_Japan) {
/* set to Japan */
printk("set_ZoneType:Japan\n");
}
else if(sZoneTypeCmd.ZoneType == ZoneType_Europe) {
//set to Europe
} else if (sZoneTypeCmd.ZoneType == ZoneType_Europe) {
/* set to Europe */
printk("set_ZoneType:Europe\n");
}
}
else {
///////read zonetype
BYTE zonetype=0;
} else {
/* read zonetype */
BYTE zonetype = 0;
if(zonetype == 0x00) { //USA
if (zonetype == 0x00) { /* USA */
sZoneTypeCmd.ZoneType = ZoneType_USA;
}
else if(zonetype == 0x01) { //Japan
} else if (zonetype == 0x01) { /* Japan */
sZoneTypeCmd.ZoneType = ZoneType_Japan;
}
else if(zonetype == 0x02) { //Europe
} else if (zonetype == 0x02) { /* Europe */
sZoneTypeCmd.ZoneType = ZoneType_Europe;
}
else { //Unknown ZoneType
printk("Error:ZoneType[%x] Unknown ???\n",zonetype);
} else { /* Unknown ZoneType */
printk("Error:ZoneType[%x] Unknown ???\n", zonetype);
result = -EFAULT;
break;
}
if (copy_to_user(pReq->data, &sZoneTypeCmd, sizeof(SCmdZoneTypeSet))) {
if (copy_to_user(pReq->data, &sZoneTypeCmd,
sizeof(SCmdZoneTypeSet))) {
result = -EFAULT;
break;
}
}
break;
case WLAN_CMD_BSS_JOIN:
if (copy_from_user(&sJoinCmd, pReq->data, sizeof(SCmdBSSJoin))) {
result = -EFAULT;
break;
@ -181,31 +160,28 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
if (sJoinCmd.wBSSType == ADHOC) {
pMgmt->eConfigMode = WMAC_CONFIG_IBSS_STA;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ioct set to adhoc mode\n");
}
else {
} else {
pMgmt->eConfigMode = WMAC_CONFIG_ESS_STA;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ioct set to STA mode\n");
}
if (sJoinCmd.bPSEnable == TRUE) {
pDevice->ePSMode = WMAC_POWER_FAST;
// pDevice->ePSMode = WMAC_POWER_MAX;
pMgmt->wListenInterval = 2;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Power Saving On\n");
}
else {
} else {
pDevice->ePSMode = WMAC_POWER_CAM;
pMgmt->wListenInterval = 1;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Power Saving Off \n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Power Saving Off\n");
}
if (sJoinCmd.bShareKeyAuth == TRUE){
if (sJoinCmd.bShareKeyAuth == TRUE) {
pMgmt->bShareKeyAlgorithm = TRUE;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Share Key \n");
}
else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Share Key\n");
} else {
pMgmt->bShareKeyAlgorithm = FALSE;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Open System \n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Open System\n");
}
pDevice->uChannel = sJoinCmd.uChannel;
netif_stop_queue(pDevice->dev);
spin_lock_irq(&pDevice->lock);
@ -218,8 +194,8 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
break;
case WLAN_CMD_SET_WEP:
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_SET_WEP Key. \n");
memset(&sWEPCmd, 0 ,sizeof(SCmdSetWEP));
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_SET_WEP Key.\n");
memset(&sWEPCmd, 0, sizeof(SCmdSetWEP));
if (copy_from_user(&sWEPCmd, pReq->data, sizeof(SCmdSetWEP))) {
result = -EFAULT;
break;
@ -237,38 +213,32 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
break;
}
for (ii = 0; ii < WLAN_WEP_NKEYS; ii ++) {
for (ii = 0; ii < WLAN_WEP_NKEYS; ii++) {
if (sWEPCmd.bWepKeyAvailable[ii]) {
if (ii == sWEPCmd.byKeyIndex)
//2006-1207-01<Modify>by Einsn Liu
// dwKeyIndex|= (1 << 31);
dwKeyIndex=ii|(1 << 31);
dwKeyIndex = ii | (1 << 31);
else
dwKeyIndex = ii;
spin_lock_irq(&pDevice->lock);
KeybSetDefaultKey( pDevice,
&(pDevice->sKey),
KeybSetDefaultKey(pDevice, &(pDevice->sKey),
dwKeyIndex,
sWEPCmd.auWepKeyLength[ii],
NULL,
(PBYTE)&sWEPCmd.abyWepKey[ii][0],
KEY_CTL_WEP
);
KEY_CTL_WEP);
spin_unlock_irq(&pDevice->lock);
}
}
pDevice->byKeyIndex = sWEPCmd.byKeyIndex;
pDevice->bTransmitKey = TRUE;
pDevice->bEncryptionEnable = TRUE;
pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled;
break;
case WLAN_CMD_GET_LINK:
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_GET_LINK status. \n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_GET_LINK status.\n");
memset(sLinkStatus.abySSID, 0 , WLAN_SSID_MAXLEN + 1);
memset(sLinkStatus.abySSID, 0, WLAN_SSID_MAXLEN + 1);
if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA)
sLinkStatus.wBSSType = ADHOC;
@ -287,17 +257,16 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
memcpy(sLinkStatus.abySSID, pItemSSID->abySSID, pItemSSID->len);
memcpy(sLinkStatus.abyBSSID, pMgmt->abyCurrBSSID, WLAN_BSSID_LEN);
sLinkStatus.uLinkRate = pMgmt->sNodeDBTable[0].wTxDataRate;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" Link Success ! \n");
}
else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Link Success!\n");
} else {
sLinkStatus.bLink = FALSE;
sLinkStatus.uLinkRate = 0;
}
if (copy_to_user(pReq->data, &sLinkStatus, sizeof(SCmdLinkStatus))) {
if (copy_to_user(pReq->data, &sLinkStatus,
sizeof(SCmdLinkStatus))) {
result = -EFAULT;
break;
}
break;
case WLAN_CMD_GET_LISTLEN:
@ -337,24 +306,22 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
pList->sBSSIDList[ii].wCapInfo = pBSS->wCapInfo;
RFvRSSITodBm(pDevice, (BYTE)(pBSS->uRSSI), &ldBm);
pList->sBSSIDList[ii].uRSSI = (unsigned int) ldBm;
// pList->sBSSIDList[ii].uRSSI = pBSS->uRSSI;
/* pList->sBSSIDList[ii].uRSSI = pBSS->uRSSI; */
memcpy(pList->sBSSIDList[ii].abyBSSID, pBSS->abyBSSID, WLAN_BSSID_LEN);
pItemSSID = (PWLAN_IE_SSID)pBSS->abySSID;
memset(pList->sBSSIDList[ii].abySSID, 0, WLAN_SSID_MAXLEN + 1);
memcpy(pList->sBSSIDList[ii].abySSID, pItemSSID->abySSID, pItemSSID->len);
if (WLAN_GET_CAP_INFO_ESS(pBSS->wCapInfo)) {
pList->sBSSIDList[ii].byNetType = INFRA;
}
else {
} else {
pList->sBSSIDList[ii].byNetType = ADHOC;
}
if (WLAN_GET_CAP_INFO_PRIVACY(pBSS->wCapInfo)) {
pList->sBSSIDList[ii].bWEPOn = TRUE;
}
else {
} else {
pList->sBSSIDList[ii].bWEPOn = FALSE;
}
ii ++;
ii++;
if (ii >= pList->uItem)
break;
}
@ -382,35 +349,31 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
}
break;
case WLAN_CMD_STOP_MAC:
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_STOP_MAC\n");
// Todo xxxxxx
/* Todo xxxxxx */
netif_stop_queue(pDevice->dev);
spin_lock_irq(&pDevice->lock);
if (pDevice->bRadioOff == FALSE) {
CARDbRadioPowerOff(pDevice);
}
pDevice->bLinkPass = FALSE;
ControlvMaskByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_PAPEDELAY,LEDSTS_STS,LEDSTS_SLOW);
ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG, MAC_REG_PAPEDELAY, LEDSTS_STS, LEDSTS_SLOW);
memset(pMgmt->abyCurrBSSID, 0, 6);
pMgmt->eCurrState = WMAC_STATE_IDLE;
// del_timer(&pDevice->sTimerCommand);
// del_timer(&pMgmt->sTimerSecondCallback);
/* del_timer(&pDevice->sTimerCommand); */
/* del_timer(&pMgmt->sTimerSecondCallback); */
pDevice->bCmdRunning = FALSE;
spin_unlock_irq(&pDevice->lock);
break;
case WLAN_CMD_START_MAC:
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_START_MAC\n");
// Todo xxxxxxx
/* Todo xxxxxxx */
if (pDevice->bRadioOff == TRUE)
CARDbRadioPowerOn(pDevice);
break;
case WLAN_CMD_SET_HOSTAPD:
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_SET_HOSTAPD\n");
if (copy_from_user(&sValue, pReq->data, sizeof(SCmdValue))) {
@ -418,28 +381,23 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
break;
}
if (sValue.dwValue == 1) {
if (vt6656_hostap_set_hostapd(pDevice, 1, 1) == 0){
if (vt6656_hostap_set_hostapd(pDevice, 1, 1) == 0) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Enable HOSTAP\n");
}
else {
} else {
result = -EFAULT;
break;
}
}
else {
} else {
vt6656_hostap_set_hostapd(pDevice, 0, 1);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Disable HOSTAP\n");
}
break;
case WLAN_CMD_SET_HOSTAPD_STA:
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_SET_HOSTAPD_STA\n");
break;
case WLAN_CMD_SET_802_1X:
case WLAN_CMD_SET_802_1X:
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_SET_802_1X\n");
if (copy_from_user(&sValue, pReq->data, sizeof(SCmdValue))) {
result = -EFAULT;
@ -449,17 +407,13 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
if (sValue.dwValue == 1) {
pDevice->bEnable8021x = TRUE;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Enable 802.1x\n");
}
else {
} else {
pDevice->bEnable8021x = FALSE;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Disable 802.1x\n");
}
break;
case WLAN_CMD_SET_HOST_WEP:
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_SET_HOST_WEP\n");
if (copy_from_user(&sValue, pReq->data, sizeof(SCmdValue))) {
result = -EFAULT;
@ -469,12 +423,10 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
if (sValue.dwValue == 1) {
pDevice->bEnableHostWEP = TRUE;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Enable HostWEP\n");
}
else {
} else {
pDevice->bEnableHostWEP = FALSE;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Disable HostWEP\n");
}
break;
case WLAN_CMD_SET_WPA:
@ -486,20 +438,16 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
}
if (sValue.dwValue == 1) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "up wpadev\n");
memcpy(pDevice->wpadev->dev_addr,
pDevice->dev->dev_addr,
memcpy(pDevice->wpadev->dev_addr, pDevice->dev->dev_addr,
ETH_ALEN);
pDevice->bWPADEVUp = TRUE;
}
else {
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "close wpadev\n");
pDevice->bWPADEVUp = FALSE;
}
break;
case WLAN_CMD_AP_START:
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_AP_START\n");
if (pDevice->bRadioOff == TRUE) {
CARDbRadioPowerOn(pDevice);
@ -513,21 +461,17 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
if (sStartAPCmd.wBSSType == AP) {
pMgmt->eConfigMode = WMAC_CONFIG_AP;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ioct set to AP mode\n");
}
else {
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ioct BSS type not set to AP mode\n");
result = -EFAULT;
break;
}
if (sStartAPCmd.wBBPType == PHY80211g) {
pMgmt->byAPBBType = PHY_TYPE_11G;
}
else if (sStartAPCmd.wBBPType == PHY80211a) {
} else if (sStartAPCmd.wBBPType == PHY80211a) {
pMgmt->byAPBBType = PHY_TYPE_11A;
}
else {
} else {
pMgmt->byAPBBType = PHY_TYPE_11B;
}
@ -535,7 +479,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
memset(pMgmt->abyDesireSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
memcpy(pMgmt->abyDesireSSID, pItemSSID, pItemSSID->len + WLAN_IEHDR_LEN);
if ((sStartAPCmd.uChannel > 0)&&(sStartAPCmd.uChannel <= 14))
if ((sStartAPCmd.uChannel > 0) && (sStartAPCmd.uChannel <= 14))
pDevice->uChannel = sStartAPCmd.uChannel;
if ((sStartAPCmd.uBeaconInt >= 20) && (sStartAPCmd.uBeaconInt <= 1000))
@ -543,13 +487,12 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
else
pMgmt->wIBSSBeaconPeriod = 100;
if (sStartAPCmd.bShareKeyAuth == TRUE){
if (sStartAPCmd.bShareKeyAuth == TRUE) {
pMgmt->bShareKeyAlgorithm = TRUE;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Share Key \n");
}
else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Share Key\n");
} else {
pMgmt->bShareKeyAlgorithm = FALSE;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Open System \n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Open System\n");
}
memcpy(pMgmt->abyIBSSSuppRates, abySuppRates, 6);
@ -558,17 +501,17 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
pMgmt->abyIBSSSuppRates[3] |= BIT7;
pMgmt->abyIBSSSuppRates[4] |= BIT7;
pMgmt->abyIBSSSuppRates[5] |= BIT7;
}else if (sStartAPCmd.byBasicRate & BIT2) {
} else if (sStartAPCmd.byBasicRate & BIT2) {
pMgmt->abyIBSSSuppRates[2] |= BIT7;
pMgmt->abyIBSSSuppRates[3] |= BIT7;
pMgmt->abyIBSSSuppRates[4] |= BIT7;
}else if (sStartAPCmd.byBasicRate & BIT1) {
} else if (sStartAPCmd.byBasicRate & BIT1) {
pMgmt->abyIBSSSuppRates[2] |= BIT7;
pMgmt->abyIBSSSuppRates[3] |= BIT7;
}else if (sStartAPCmd.byBasicRate & BIT1) {
} else if (sStartAPCmd.byBasicRate & BIT1) {
pMgmt->abyIBSSSuppRates[2] |= BIT7;
}else {
//default 1,2M
} else {
/* default 1,2M */
pMgmt->abyIBSSSuppRates[2] |= BIT7;
pMgmt->abyIBSSSuppRates[3] |= BIT7;
}
@ -577,17 +520,15 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
pMgmt->abyIBSSSuppRates[2],
pMgmt->abyIBSSSuppRates[3],
pMgmt->abyIBSSSuppRates[4],
pMgmt->abyIBSSSuppRates[5]
);
pMgmt->abyIBSSSuppRates[5]);
netif_stop_queue(pDevice->dev);
spin_lock_irq(&pDevice->lock);
bScheduleCommand((void *) pDevice, WLAN_CMD_RUN_AP, NULL);
bScheduleCommand((void *)pDevice, WLAN_CMD_RUN_AP, NULL);
spin_unlock_irq(&pDevice->lock);
break;
case WLAN_CMD_GET_NODE_CNT:
cbListCount = 0;
pNode = &(pMgmt->sNodeDBTable[0]);
for (ii = 0; ii < (MAX_NODE_NUM + 1); ii++) {
@ -606,7 +547,6 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
break;
case WLAN_CMD_GET_NODE_LIST:
if (copy_from_user(&sNodeList, pReq->data, sizeof(SNodeList))) {
result = -EFAULT;
break;
@ -636,13 +576,12 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
pNodeList->sNodeList[jj].abyWepKey[1],
pNodeList->sNodeList[jj].abyWepKey[2],
pNodeList->sNodeList[jj].abyWepKey[3],
pNodeList->sNodeList[jj].abyWepKey[4]
);
pNodeList->sNodeList[jj].abyWepKey[4]);
pNodeList->sNodeList[jj].bIsInFallback = pNode->bIsInFallback;
pNodeList->sNodeList[jj].uTxFailures = pNode->uTxFailures;
pNodeList->sNodeList[jj].uTxAttempts = pNode->uTxAttempts;
pNodeList->sNodeList[jj].wFailureRatio = (WORD)pNode->uFailureRatio;
jj ++;
jj++;
if (jj >= pNodeList->uItem)
break;
}
@ -656,7 +595,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
break;
case 0xFF:
memset(wpa_Result.ifname,0,sizeof(wpa_Result.ifname));
memset(wpa_Result.ifname, 0, sizeof(wpa_Result.ifname));
wpa_Result.proto = 0;
wpa_Result.key_mgmt = 0;
wpa_Result.eap_type = 0;
@ -666,33 +605,25 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
result = -EFAULT;
break;
}
//DavidWang for some AP maybe good authenticate
if(wpa_Result.key_mgmt==0x20)
pMgmt->Cisco_cckm =1;
/* for some AP maybe good authenticate */
if (wpa_Result.key_mgmt == 0x20)
pMgmt->Cisco_cckm = 1;
else
pMgmt->Cisco_cckm =0;
pMgmt->Cisco_cckm = 0;
if(wpa_Result.authenticated==TRUE) {
if (wpa_Result.authenticated == TRUE) {
{
union iwreq_data wrqu;
pItemSSID = (PWLAN_IE_SSID)pMgmt->abyCurrSSID;
memset(&wrqu, 0, sizeof(wrqu));
wrqu.data.flags = RT_WPACONNECTED_EVENT_FLAG;
wrqu.data.length =pItemSSID->len;
wrqu.data.length = pItemSSID->len;
wireless_send_event(pDevice->dev, IWEVCUSTOM, &wrqu, pItemSSID->abySSID);
}
pDevice->fWPA_Authened = TRUE; //is successful peer to wpa_Result.authenticated?
}
//printk("get private wpa_supplicant announce WPA SM\n");
//printk("wpa-->ifname=%s\n",wpa_Result.ifname);
//printk("wpa-->proto=%d\n",wpa_Result.proto);
//printk("wpa-->key-mgmt=%d\n",wpa_Result.key_mgmt);
//printk("wpa-->eap_type=%d\n",wpa_Result.eap_type);
//printk("wpa-->authenticated is %s\n",(wpa_Result.authenticated==TRUE)?"TRUE":"FALSE");
pDevice->fWPA_Authened = TRUE; /* is successful peer to wpa_Result.authenticated? */
}
pReq->wResult = 0;
break;