2 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 * Purpose: private ioctl functions
25 * Date: Auguest 20, 2003
43 SWPAResult wpa_Result;
44 static int msglevel = MSG_LEVEL_INFO;
46 int private_ioctl(PSDevice pDevice, struct ifreq *rq)
49 PSCmdRequest pReq = (PSCmdRequest)rq;
50 PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
52 PWLAN_IE_SSID pItemSSID;
54 SCmdZoneTypeSet sZoneTypeCmd;
56 SCmdStartAP sStartAPCmd;
63 unsigned int cbListCount;
67 SCmdLinkStatus sLinkStatus;
68 BYTE abySuppRates[] = {WLAN_EID_SUPP_RATES, 4, 0x02, 0x04, 0x0B, 0x16};
69 BYTE abyNullAddr[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
71 BYTE abyScanSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1];
76 switch (pReq->wCmdCode) {
77 case WLAN_CMD_BSS_SCAN:
78 if (copy_from_user(&sScanCmd, pReq->data, sizeof(SCmdScan))) {
83 pItemSSID = (PWLAN_IE_SSID)sScanCmd.ssid;
84 if (pItemSSID->len != 0) {
85 memset(abyScanSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
86 memcpy(abyScanSSID, pItemSSID, pItemSSID->len + WLAN_IEHDR_LEN);
88 spin_lock_irq(&pDevice->lock);
90 if (memcmp(pMgmt->abyCurrBSSID, &abyNullAddr[0], 6) == 0)
91 BSSvClearBSSList((void *)pDevice, FALSE);
93 BSSvClearBSSList((void *)pDevice, pDevice->bLinkPass);
95 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_BSS_SCAN..begin\n");
97 if (pItemSSID->len != 0)
98 bScheduleCommand((void *)pDevice,
102 bScheduleCommand((void *) pDevice, WLAN_CMD_BSSID_SCAN, NULL);
104 spin_unlock_irq(&pDevice->lock);
107 case WLAN_CMD_ZONETYPE_SET:
108 result = -EOPNOTSUPP;
111 if (copy_from_user(&sZoneTypeCmd, pReq->data, sizeof(SCmdZoneTypeSet))) {
116 if (sZoneTypeCmd.bWrite == TRUE) {
118 if (sZoneTypeCmd.ZoneType == ZoneType_USA) {
120 printk("set_ZoneType:USA\n");
121 } else if (sZoneTypeCmd.ZoneType == ZoneType_Japan) {
123 printk("set_ZoneType:Japan\n");
124 } else if (sZoneTypeCmd.ZoneType == ZoneType_Europe) {
126 printk("set_ZoneType:Europe\n");
132 if (zonetype == 0x00) { /* USA */
133 sZoneTypeCmd.ZoneType = ZoneType_USA;
134 } else if (zonetype == 0x01) { /* Japan */
135 sZoneTypeCmd.ZoneType = ZoneType_Japan;
136 } else if (zonetype == 0x02) { /* Europe */
137 sZoneTypeCmd.ZoneType = ZoneType_Europe;
138 } else { /* Unknown ZoneType */
139 printk("Error:ZoneType[%x] Unknown ???\n", zonetype);
144 if (copy_to_user(pReq->data, &sZoneTypeCmd,
145 sizeof(SCmdZoneTypeSet))) {
151 case WLAN_CMD_BSS_JOIN:
152 if (copy_from_user(&sJoinCmd, pReq->data, sizeof(SCmdBSSJoin))) {
157 pItemSSID = (PWLAN_IE_SSID)sJoinCmd.ssid;
158 memset(pMgmt->abyDesireSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
159 memcpy(pMgmt->abyDesireSSID, pItemSSID, pItemSSID->len + WLAN_IEHDR_LEN);
160 if (sJoinCmd.wBSSType == ADHOC) {
161 pMgmt->eConfigMode = WMAC_CONFIG_IBSS_STA;
162 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ioct set to adhoc mode\n");
164 pMgmt->eConfigMode = WMAC_CONFIG_ESS_STA;
165 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ioct set to STA mode\n");
167 if (sJoinCmd.bPSEnable == TRUE) {
168 pDevice->ePSMode = WMAC_POWER_FAST;
169 pMgmt->wListenInterval = 2;
170 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Power Saving On\n");
172 pDevice->ePSMode = WMAC_POWER_CAM;
173 pMgmt->wListenInterval = 1;
174 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Power Saving Off\n");
177 if (sJoinCmd.bShareKeyAuth == TRUE) {
178 pMgmt->bShareKeyAlgorithm = TRUE;
179 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Share Key\n");
181 pMgmt->bShareKeyAlgorithm = FALSE;
182 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Open System\n");
185 pDevice->uChannel = sJoinCmd.uChannel;
186 netif_stop_queue(pDevice->dev);
187 spin_lock_irq(&pDevice->lock);
188 pMgmt->eCurrState = WMAC_STATE_IDLE;
189 bScheduleCommand((void *) pDevice,
191 pMgmt->abyDesireSSID);
192 bScheduleCommand((void *) pDevice, WLAN_CMD_SSID, NULL);
193 spin_unlock_irq(&pDevice->lock);
196 case WLAN_CMD_SET_WEP:
197 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_SET_WEP Key.\n");
198 memset(&sWEPCmd, 0, sizeof(SCmdSetWEP));
199 if (copy_from_user(&sWEPCmd, pReq->data, sizeof(SCmdSetWEP))) {
203 if (sWEPCmd.bEnableWep != TRUE) {
206 pDevice->bEncryptionEnable = FALSE;
207 pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled;
208 spin_lock_irq(&pDevice->lock);
209 for (uu = 0; uu < MAX_KEY_TABLE; uu++)
210 MACvDisableKeyEntry(pDevice, uu);
211 spin_unlock_irq(&pDevice->lock);
212 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WEP function disable.\n");
216 for (ii = 0; ii < WLAN_WEP_NKEYS; ii++) {
217 if (sWEPCmd.bWepKeyAvailable[ii]) {
218 if (ii == sWEPCmd.byKeyIndex)
219 dwKeyIndex = ii | (1 << 31);
222 spin_lock_irq(&pDevice->lock);
223 KeybSetDefaultKey(pDevice, &(pDevice->sKey),
225 sWEPCmd.auWepKeyLength[ii],
227 (PBYTE)&sWEPCmd.abyWepKey[ii][0],
229 spin_unlock_irq(&pDevice->lock);
232 pDevice->byKeyIndex = sWEPCmd.byKeyIndex;
233 pDevice->bTransmitKey = TRUE;
234 pDevice->bEncryptionEnable = TRUE;
235 pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled;
238 case WLAN_CMD_GET_LINK:
239 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_GET_LINK status.\n");
241 memset(sLinkStatus.abySSID, 0, WLAN_SSID_MAXLEN + 1);
243 if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA)
244 sLinkStatus.wBSSType = ADHOC;
246 sLinkStatus.wBSSType = INFRA;
248 if (pMgmt->eCurrState == WMAC_STATE_JOINTED)
249 sLinkStatus.byState = ADHOC_JOINTED;
251 sLinkStatus.byState = ADHOC_STARTED;
253 sLinkStatus.uChannel = pMgmt->uCurrChannel;
254 if (pDevice->bLinkPass == TRUE) {
255 sLinkStatus.bLink = TRUE;
256 pItemSSID = (PWLAN_IE_SSID)pMgmt->abyCurrSSID;
257 memcpy(sLinkStatus.abySSID, pItemSSID->abySSID, pItemSSID->len);
258 memcpy(sLinkStatus.abyBSSID, pMgmt->abyCurrBSSID, WLAN_BSSID_LEN);
259 sLinkStatus.uLinkRate = pMgmt->sNodeDBTable[0].wTxDataRate;
260 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Link Success!\n");
262 sLinkStatus.bLink = FALSE;
263 sLinkStatus.uLinkRate = 0;
265 if (copy_to_user(pReq->data, &sLinkStatus,
266 sizeof(SCmdLinkStatus))) {
272 case WLAN_CMD_GET_LISTLEN:
274 pBSS = &(pMgmt->sBSSList[0]);
275 for (ii = 0; ii < MAX_BSS_NUM; ii++) {
276 pBSS = &(pMgmt->sBSSList[ii]);
281 sList.uItem = cbListCount;
282 if (copy_to_user(pReq->data, &sList, sizeof(SBSSIDList))) {
289 case WLAN_CMD_GET_LIST:
290 if (copy_from_user(&sList, pReq->data, sizeof(SBSSIDList))) {
294 pList = (PSBSSIDList)kmalloc(sizeof(SBSSIDList) + (sList.uItem * sizeof(SBSSIDItem)), (int)GFP_ATOMIC);
299 pList->uItem = sList.uItem;
300 pBSS = &(pMgmt->sBSSList[0]);
301 for (ii = 0, jj = 0; jj < MAX_BSS_NUM ; jj++) {
302 pBSS = &(pMgmt->sBSSList[jj]);
304 pList->sBSSIDList[ii].uChannel = pBSS->uChannel;
305 pList->sBSSIDList[ii].wBeaconInterval = pBSS->wBeaconInterval;
306 pList->sBSSIDList[ii].wCapInfo = pBSS->wCapInfo;
307 RFvRSSITodBm(pDevice, (BYTE)(pBSS->uRSSI), &ldBm);
308 pList->sBSSIDList[ii].uRSSI = (unsigned int) ldBm;
309 /* pList->sBSSIDList[ii].uRSSI = pBSS->uRSSI; */
310 memcpy(pList->sBSSIDList[ii].abyBSSID, pBSS->abyBSSID, WLAN_BSSID_LEN);
311 pItemSSID = (PWLAN_IE_SSID)pBSS->abySSID;
312 memset(pList->sBSSIDList[ii].abySSID, 0, WLAN_SSID_MAXLEN + 1);
313 memcpy(pList->sBSSIDList[ii].abySSID, pItemSSID->abySSID, pItemSSID->len);
314 if (WLAN_GET_CAP_INFO_ESS(pBSS->wCapInfo)) {
315 pList->sBSSIDList[ii].byNetType = INFRA;
317 pList->sBSSIDList[ii].byNetType = ADHOC;
319 if (WLAN_GET_CAP_INFO_PRIVACY(pBSS->wCapInfo)) {
320 pList->sBSSIDList[ii].bWEPOn = TRUE;
322 pList->sBSSIDList[ii].bWEPOn = FALSE;
325 if (ii >= pList->uItem)
330 if (copy_to_user(pReq->data, pList, sizeof(SBSSIDList) + (sList.uItem * sizeof(SBSSIDItem)))) {
338 case WLAN_CMD_GET_MIB:
339 if (copy_to_user(pReq->data, &(pDevice->s802_11Counter), sizeof(SDot11MIBCount))) {
345 case WLAN_CMD_GET_STAT:
346 if (copy_to_user(pReq->data, &(pDevice->scStatistic), sizeof(SStatCounter))) {
351 case WLAN_CMD_STOP_MAC:
352 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_STOP_MAC\n");
354 netif_stop_queue(pDevice->dev);
355 spin_lock_irq(&pDevice->lock);
356 if (pDevice->bRadioOff == FALSE) {
357 CARDbRadioPowerOff(pDevice);
359 pDevice->bLinkPass = FALSE;
360 ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG, MAC_REG_PAPEDELAY, LEDSTS_STS, LEDSTS_SLOW);
361 memset(pMgmt->abyCurrBSSID, 0, 6);
362 pMgmt->eCurrState = WMAC_STATE_IDLE;
363 /* del_timer(&pDevice->sTimerCommand); */
364 /* del_timer(&pMgmt->sTimerSecondCallback); */
365 pDevice->bCmdRunning = FALSE;
366 spin_unlock_irq(&pDevice->lock);
369 case WLAN_CMD_START_MAC:
370 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_START_MAC\n");
372 if (pDevice->bRadioOff == TRUE)
373 CARDbRadioPowerOn(pDevice);
376 case WLAN_CMD_SET_HOSTAPD:
377 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_SET_HOSTAPD\n");
379 if (copy_from_user(&sValue, pReq->data, sizeof(SCmdValue))) {
383 if (sValue.dwValue == 1) {
384 if (vt6656_hostap_set_hostapd(pDevice, 1, 1) == 0) {
385 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Enable HOSTAP\n");
391 vt6656_hostap_set_hostapd(pDevice, 0, 1);
392 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Disable HOSTAP\n");
396 case WLAN_CMD_SET_HOSTAPD_STA:
397 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_SET_HOSTAPD_STA\n");
400 case WLAN_CMD_SET_802_1X:
401 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_SET_802_1X\n");
402 if (copy_from_user(&sValue, pReq->data, sizeof(SCmdValue))) {
407 if (sValue.dwValue == 1) {
408 pDevice->bEnable8021x = TRUE;
409 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Enable 802.1x\n");
411 pDevice->bEnable8021x = FALSE;
412 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Disable 802.1x\n");
416 case WLAN_CMD_SET_HOST_WEP:
417 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_SET_HOST_WEP\n");
418 if (copy_from_user(&sValue, pReq->data, sizeof(SCmdValue))) {
423 if (sValue.dwValue == 1) {
424 pDevice->bEnableHostWEP = TRUE;
425 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Enable HostWEP\n");
427 pDevice->bEnableHostWEP = FALSE;
428 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Disable HostWEP\n");
432 case WLAN_CMD_SET_WPA:
433 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_SET_WPA\n");
435 if (copy_from_user(&sValue, pReq->data, sizeof(SCmdValue))) {
439 if (sValue.dwValue == 1) {
440 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "up wpadev\n");
441 memcpy(pDevice->wpadev->dev_addr, pDevice->dev->dev_addr,
443 pDevice->bWPADEVUp = TRUE;
445 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "close wpadev\n");
446 pDevice->bWPADEVUp = FALSE;
450 case WLAN_CMD_AP_START:
451 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_AP_START\n");
452 if (pDevice->bRadioOff == TRUE) {
453 CARDbRadioPowerOn(pDevice);
454 add_timer(&pMgmt->sTimerSecondCallback);
456 if (copy_from_user(&sStartAPCmd, pReq->data, sizeof(SCmdStartAP))) {
461 if (sStartAPCmd.wBSSType == AP) {
462 pMgmt->eConfigMode = WMAC_CONFIG_AP;
463 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ioct set to AP mode\n");
465 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ioct BSS type not set to AP mode\n");
470 if (sStartAPCmd.wBBPType == PHY80211g) {
471 pMgmt->byAPBBType = PHY_TYPE_11G;
472 } else if (sStartAPCmd.wBBPType == PHY80211a) {
473 pMgmt->byAPBBType = PHY_TYPE_11A;
475 pMgmt->byAPBBType = PHY_TYPE_11B;
478 pItemSSID = (PWLAN_IE_SSID)sStartAPCmd.ssid;
479 memset(pMgmt->abyDesireSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
480 memcpy(pMgmt->abyDesireSSID, pItemSSID, pItemSSID->len + WLAN_IEHDR_LEN);
482 if ((sStartAPCmd.uChannel > 0) && (sStartAPCmd.uChannel <= 14))
483 pDevice->uChannel = sStartAPCmd.uChannel;
485 if ((sStartAPCmd.uBeaconInt >= 20) && (sStartAPCmd.uBeaconInt <= 1000))
486 pMgmt->wIBSSBeaconPeriod = sStartAPCmd.uBeaconInt;
488 pMgmt->wIBSSBeaconPeriod = 100;
490 if (sStartAPCmd.bShareKeyAuth == TRUE) {
491 pMgmt->bShareKeyAlgorithm = TRUE;
492 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Share Key\n");
494 pMgmt->bShareKeyAlgorithm = FALSE;
495 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Open System\n");
497 memcpy(pMgmt->abyIBSSSuppRates, abySuppRates, 6);
499 if (sStartAPCmd.byBasicRate & BIT3) {
500 pMgmt->abyIBSSSuppRates[2] |= BIT7;
501 pMgmt->abyIBSSSuppRates[3] |= BIT7;
502 pMgmt->abyIBSSSuppRates[4] |= BIT7;
503 pMgmt->abyIBSSSuppRates[5] |= BIT7;
504 } else if (sStartAPCmd.byBasicRate & BIT2) {
505 pMgmt->abyIBSSSuppRates[2] |= BIT7;
506 pMgmt->abyIBSSSuppRates[3] |= BIT7;
507 pMgmt->abyIBSSSuppRates[4] |= BIT7;
508 } else if (sStartAPCmd.byBasicRate & BIT1) {
509 pMgmt->abyIBSSSuppRates[2] |= BIT7;
510 pMgmt->abyIBSSSuppRates[3] |= BIT7;
511 } else if (sStartAPCmd.byBasicRate & BIT1) {
512 pMgmt->abyIBSSSuppRates[2] |= BIT7;
515 pMgmt->abyIBSSSuppRates[2] |= BIT7;
516 pMgmt->abyIBSSSuppRates[3] |= BIT7;
519 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Support Rate= %x %x %x %x\n",
520 pMgmt->abyIBSSSuppRates[2],
521 pMgmt->abyIBSSSuppRates[3],
522 pMgmt->abyIBSSSuppRates[4],
523 pMgmt->abyIBSSSuppRates[5]);
525 netif_stop_queue(pDevice->dev);
526 spin_lock_irq(&pDevice->lock);
527 bScheduleCommand((void *)pDevice, WLAN_CMD_RUN_AP, NULL);
528 spin_unlock_irq(&pDevice->lock);
531 case WLAN_CMD_GET_NODE_CNT:
533 pNode = &(pMgmt->sNodeDBTable[0]);
534 for (ii = 0; ii < (MAX_NODE_NUM + 1); ii++) {
535 pNode = &(pMgmt->sNodeDBTable[ii]);
541 sNodeList.uItem = cbListCount;
542 if (copy_to_user(pReq->data, &sNodeList, sizeof(SNodeList))) {
549 case WLAN_CMD_GET_NODE_LIST:
550 if (copy_from_user(&sNodeList, pReq->data, sizeof(SNodeList))) {
554 pNodeList = (PSNodeList)kmalloc(sizeof(SNodeList) + (sNodeList.uItem * sizeof(SNodeItem)), (int)GFP_ATOMIC);
555 if (pNodeList == NULL) {
559 pNodeList->uItem = sNodeList.uItem;
560 pNode = &(pMgmt->sNodeDBTable[0]);
561 for (ii = 0, jj = 0; ii < (MAX_NODE_NUM + 1); ii++) {
562 pNode = &(pMgmt->sNodeDBTable[ii]);
563 if (pNode->bActive) {
564 pNodeList->sNodeList[jj].wAID = pNode->wAID;
565 memcpy(pNodeList->sNodeList[jj].abyMACAddr, pNode->abyMACAddr, WLAN_ADDR_LEN);
566 pNodeList->sNodeList[jj].wTxDataRate = pNode->wTxDataRate;
567 pNodeList->sNodeList[jj].wInActiveCount = (WORD)pNode->uInActiveCount;
568 pNodeList->sNodeList[jj].wEnQueueCnt = (WORD)pNode->wEnQueueCnt;
569 pNodeList->sNodeList[jj].wFlags = (WORD)pNode->dwFlags;
570 pNodeList->sNodeList[jj].bPWBitOn = pNode->bPSEnable;
571 pNodeList->sNodeList[jj].byKeyIndex = pNode->byKeyIndex;
572 pNodeList->sNodeList[jj].wWepKeyLength = pNode->uWepKeyLength;
573 memcpy(&(pNodeList->sNodeList[jj].abyWepKey[0]), &(pNode->abyWepKey[0]), WEP_KEYMAXLEN);
574 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "key= %2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
575 pNodeList->sNodeList[jj].abyWepKey[0],
576 pNodeList->sNodeList[jj].abyWepKey[1],
577 pNodeList->sNodeList[jj].abyWepKey[2],
578 pNodeList->sNodeList[jj].abyWepKey[3],
579 pNodeList->sNodeList[jj].abyWepKey[4]);
580 pNodeList->sNodeList[jj].bIsInFallback = pNode->bIsInFallback;
581 pNodeList->sNodeList[jj].uTxFailures = pNode->uTxFailures;
582 pNodeList->sNodeList[jj].uTxAttempts = pNode->uTxAttempts;
583 pNodeList->sNodeList[jj].wFailureRatio = (WORD)pNode->uFailureRatio;
585 if (jj >= pNodeList->uItem)
589 if (copy_to_user(pReq->data, pNodeList, sizeof(SNodeList) + (sNodeList.uItem * sizeof(SNodeItem)))) {
598 memset(wpa_Result.ifname, 0, sizeof(wpa_Result.ifname));
599 wpa_Result.proto = 0;
600 wpa_Result.key_mgmt = 0;
601 wpa_Result.eap_type = 0;
602 wpa_Result.authenticated = FALSE;
603 pDevice->fWPA_Authened = FALSE;
604 if (copy_from_user(&wpa_Result, pReq->data, sizeof(wpa_Result))) {
608 /* for some AP maybe good authenticate */
609 if (wpa_Result.key_mgmt == 0x20)
610 pMgmt->Cisco_cckm = 1;
612 pMgmt->Cisco_cckm = 0;
614 if (wpa_Result.authenticated == TRUE) {
616 union iwreq_data wrqu;
618 pItemSSID = (PWLAN_IE_SSID)pMgmt->abyCurrSSID;
619 memset(&wrqu, 0, sizeof(wrqu));
620 wrqu.data.flags = RT_WPACONNECTED_EVENT_FLAG;
621 wrqu.data.length = pItemSSID->len;
622 wireless_send_event(pDevice->dev, IWEVCUSTOM, &wrqu, pItemSSID->abySSID);
625 pDevice->fWPA_Authened = TRUE; /* is successful peer to wpa_Result.authenticated? */
632 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Private command not support..\n");