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 /*--------------------- Static Definitions -------------------------*/
45 /*--------------------- Static Classes ----------------------------*/
47 /*--------------------- Static Variables --------------------------*/
48 //static int msglevel =MSG_LEVEL_DEBUG;
49 static int msglevel
=MSG_LEVEL_INFO
;
51 SWPAResult wpa_Result
;
53 /*--------------------- Static Functions --------------------------*/
55 /*--------------------- Export Variables --------------------------*/
57 int private_ioctl(PSDevice pDevice
, struct ifreq
*rq
) {
59 PSCmdRequest pReq
= (PSCmdRequest
)rq
;
60 PSMgmtObject pMgmt
= &(pDevice
->sMgmtObj
);
62 PWLAN_IE_SSID pItemSSID
;
64 SCmdZoneTypeSet sZoneTypeCmd
;
66 SCmdStartAP sStartAPCmd
;
73 unsigned int cbListCount
;
77 SCmdLinkStatus sLinkStatus
;
78 BYTE abySuppRates
[] = {WLAN_EID_SUPP_RATES
, 4, 0x02, 0x04, 0x0B, 0x16};
79 BYTE abyNullAddr
[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
81 BYTE abyScanSSID
[WLAN_IEHDR_LEN
+ WLAN_SSID_MAXLEN
+ 1];
86 switch(pReq
->wCmdCode
) {
88 case WLAN_CMD_BSS_SCAN
:
90 if (copy_from_user(&sScanCmd
, pReq
->data
, sizeof(SCmdScan
))) {
95 pItemSSID
= (PWLAN_IE_SSID
)sScanCmd
.ssid
;
96 if (pItemSSID
->len
!= 0) {
97 memset(abyScanSSID
, 0, WLAN_IEHDR_LEN
+ WLAN_SSID_MAXLEN
+ 1);
98 memcpy(abyScanSSID
, pItemSSID
, pItemSSID
->len
+ WLAN_IEHDR_LEN
);
100 spin_lock_irq(&pDevice
->lock
);
102 if (memcmp(pMgmt
->abyCurrBSSID
, &abyNullAddr
[0], 6) == 0)
103 BSSvClearBSSList((void *) pDevice
, FALSE
);
105 BSSvClearBSSList((void *) pDevice
, pDevice
->bLinkPass
);
107 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"WLAN_CMD_BSS_SCAN..begin\n");
109 if (pItemSSID
->len
!= 0)
110 bScheduleCommand((void *) pDevice
,
114 bScheduleCommand((void *) pDevice
, WLAN_CMD_BSSID_SCAN
, NULL
);
116 spin_unlock_irq(&pDevice
->lock
);
119 case WLAN_CMD_ZONETYPE_SET
:
120 //mike add :cann't support.
124 if (copy_from_user(&sZoneTypeCmd
, pReq
->data
, sizeof(SCmdZoneTypeSet
))) {
129 if(sZoneTypeCmd
.bWrite
==TRUE
) {
131 if(sZoneTypeCmd
.ZoneType
== ZoneType_USA
) {
133 printk("set_ZoneType:USA\n");
135 else if(sZoneTypeCmd
.ZoneType
== ZoneType_Japan
) {
137 printk("set_ZoneType:Japan\n");
139 else if(sZoneTypeCmd
.ZoneType
== ZoneType_Europe
) {
141 printk("set_ZoneType:Europe\n");
149 if(zonetype
== 0x00) { //USA
150 sZoneTypeCmd
.ZoneType
= ZoneType_USA
;
152 else if(zonetype
== 0x01) { //Japan
153 sZoneTypeCmd
.ZoneType
= ZoneType_Japan
;
155 else if(zonetype
== 0x02) { //Europe
156 sZoneTypeCmd
.ZoneType
= ZoneType_Europe
;
158 else { //Unknown ZoneType
159 printk("Error:ZoneType[%x] Unknown ???\n",zonetype
);
163 if (copy_to_user(pReq
->data
, &sZoneTypeCmd
, sizeof(SCmdZoneTypeSet
))) {
171 case WLAN_CMD_BSS_JOIN
:
173 if (copy_from_user(&sJoinCmd
, pReq
->data
, sizeof(SCmdBSSJoin
))) {
178 pItemSSID
= (PWLAN_IE_SSID
)sJoinCmd
.ssid
;
179 memset(pMgmt
->abyDesireSSID
, 0, WLAN_IEHDR_LEN
+ WLAN_SSID_MAXLEN
+ 1);
180 memcpy(pMgmt
->abyDesireSSID
, pItemSSID
, pItemSSID
->len
+ WLAN_IEHDR_LEN
);
181 if (sJoinCmd
.wBSSType
== ADHOC
) {
182 pMgmt
->eConfigMode
= WMAC_CONFIG_IBSS_STA
;
183 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"ioct set to adhoc mode\n");
186 pMgmt
->eConfigMode
= WMAC_CONFIG_ESS_STA
;
187 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"ioct set to STA mode\n");
189 if (sJoinCmd
.bPSEnable
== TRUE
) {
190 pDevice
->ePSMode
= WMAC_POWER_FAST
;
191 // pDevice->ePSMode = WMAC_POWER_MAX;
192 pMgmt
->wListenInterval
= 2;
193 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"Power Saving On\n");
196 pDevice
->ePSMode
= WMAC_POWER_CAM
;
197 pMgmt
->wListenInterval
= 1;
198 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"Power Saving Off \n");
201 if (sJoinCmd
.bShareKeyAuth
== TRUE
){
202 pMgmt
->bShareKeyAlgorithm
= TRUE
;
203 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"Share Key \n");
206 pMgmt
->bShareKeyAlgorithm
= FALSE
;
207 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"Open System \n");
209 pDevice
->uChannel
= sJoinCmd
.uChannel
;
210 netif_stop_queue(pDevice
->dev
);
211 spin_lock_irq(&pDevice
->lock
);
212 pMgmt
->eCurrState
= WMAC_STATE_IDLE
;
213 bScheduleCommand((void *) pDevice
,
215 pMgmt
->abyDesireSSID
);
216 bScheduleCommand((void *) pDevice
, WLAN_CMD_SSID
, NULL
);
217 spin_unlock_irq(&pDevice
->lock
);
220 case WLAN_CMD_SET_WEP
:
221 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"WLAN_CMD_SET_WEP Key. \n");
222 memset(&sWEPCmd
, 0 ,sizeof(SCmdSetWEP
));
223 if (copy_from_user(&sWEPCmd
, pReq
->data
, sizeof(SCmdSetWEP
))) {
227 if (sWEPCmd
.bEnableWep
!= TRUE
) {
230 pDevice
->bEncryptionEnable
= FALSE
;
231 pDevice
->eEncryptionStatus
= Ndis802_11EncryptionDisabled
;
232 spin_lock_irq(&pDevice
->lock
);
233 for (uu
= 0; uu
< MAX_KEY_TABLE
; uu
++)
234 MACvDisableKeyEntry(pDevice
, uu
);
235 spin_unlock_irq(&pDevice
->lock
);
236 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"WEP function disable.\n");
240 for (ii
= 0; ii
< WLAN_WEP_NKEYS
; ii
++) {
241 if (sWEPCmd
.bWepKeyAvailable
[ii
]) {
242 if (ii
== sWEPCmd
.byKeyIndex
)
243 //2006-1207-01<Modify>by Einsn Liu
244 // dwKeyIndex|= (1 << 31);
245 dwKeyIndex
=ii
|(1 << 31);
248 spin_lock_irq(&pDevice
->lock
);
249 KeybSetDefaultKey( pDevice
,
252 sWEPCmd
.auWepKeyLength
[ii
],
254 (PBYTE
)&sWEPCmd
.abyWepKey
[ii
][0],
257 spin_unlock_irq(&pDevice
->lock
);
261 pDevice
->byKeyIndex
= sWEPCmd
.byKeyIndex
;
262 pDevice
->bTransmitKey
= TRUE
;
263 pDevice
->bEncryptionEnable
= TRUE
;
264 pDevice
->eEncryptionStatus
= Ndis802_11Encryption1Enabled
;
268 case WLAN_CMD_GET_LINK
:
269 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"WLAN_CMD_GET_LINK status. \n");
271 memset(sLinkStatus
.abySSID
, 0 , WLAN_SSID_MAXLEN
+ 1);
273 if (pMgmt
->eCurrMode
== WMAC_MODE_IBSS_STA
)
274 sLinkStatus
.wBSSType
= ADHOC
;
276 sLinkStatus
.wBSSType
= INFRA
;
278 if (pMgmt
->eCurrState
== WMAC_STATE_JOINTED
)
279 sLinkStatus
.byState
= ADHOC_JOINTED
;
281 sLinkStatus
.byState
= ADHOC_STARTED
;
283 sLinkStatus
.uChannel
= pMgmt
->uCurrChannel
;
284 if (pDevice
->bLinkPass
== TRUE
) {
285 sLinkStatus
.bLink
= TRUE
;
286 pItemSSID
= (PWLAN_IE_SSID
)pMgmt
->abyCurrSSID
;
287 memcpy(sLinkStatus
.abySSID
, pItemSSID
->abySSID
, pItemSSID
->len
);
288 memcpy(sLinkStatus
.abyBSSID
, pMgmt
->abyCurrBSSID
, WLAN_BSSID_LEN
);
289 sLinkStatus
.uLinkRate
= pMgmt
->sNodeDBTable
[0].wTxDataRate
;
290 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" Link Success ! \n");
293 sLinkStatus
.bLink
= FALSE
;
295 if (copy_to_user(pReq
->data
, &sLinkStatus
, sizeof(SCmdLinkStatus
))) {
302 case WLAN_CMD_GET_LISTLEN
:
304 pBSS
= &(pMgmt
->sBSSList
[0]);
305 for (ii
= 0; ii
< MAX_BSS_NUM
; ii
++) {
306 pBSS
= &(pMgmt
->sBSSList
[ii
]);
311 sList
.uItem
= cbListCount
;
312 if (copy_to_user(pReq
->data
, &sList
, sizeof(SBSSIDList
))) {
319 case WLAN_CMD_GET_LIST
:
320 if (copy_from_user(&sList
, pReq
->data
, sizeof(SBSSIDList
))) {
324 pList
= (PSBSSIDList
)kmalloc(sizeof(SBSSIDList
) + (sList
.uItem
* sizeof(SBSSIDItem
)), (int)GFP_ATOMIC
);
329 pList
->uItem
= sList
.uItem
;
330 pBSS
= &(pMgmt
->sBSSList
[0]);
331 for (ii
= 0, jj
= 0; jj
< MAX_BSS_NUM
; jj
++) {
332 pBSS
= &(pMgmt
->sBSSList
[jj
]);
334 pList
->sBSSIDList
[ii
].uChannel
= pBSS
->uChannel
;
335 pList
->sBSSIDList
[ii
].wBeaconInterval
= pBSS
->wBeaconInterval
;
336 pList
->sBSSIDList
[ii
].wCapInfo
= pBSS
->wCapInfo
;
337 RFvRSSITodBm(pDevice
, (BYTE
)(pBSS
->uRSSI
), &ldBm
);
338 pList
->sBSSIDList
[ii
].uRSSI
= (unsigned int) ldBm
;
339 // pList->sBSSIDList[ii].uRSSI = pBSS->uRSSI;
340 memcpy(pList
->sBSSIDList
[ii
].abyBSSID
, pBSS
->abyBSSID
, WLAN_BSSID_LEN
);
341 pItemSSID
= (PWLAN_IE_SSID
)pBSS
->abySSID
;
342 memset(pList
->sBSSIDList
[ii
].abySSID
, 0, WLAN_SSID_MAXLEN
+ 1);
343 memcpy(pList
->sBSSIDList
[ii
].abySSID
, pItemSSID
->abySSID
, pItemSSID
->len
);
344 if (WLAN_GET_CAP_INFO_ESS(pBSS
->wCapInfo
)) {
345 pList
->sBSSIDList
[ii
].byNetType
= INFRA
;
348 pList
->sBSSIDList
[ii
].byNetType
= ADHOC
;
350 if (WLAN_GET_CAP_INFO_PRIVACY(pBSS
->wCapInfo
)) {
351 pList
->sBSSIDList
[ii
].bWEPOn
= TRUE
;
354 pList
->sBSSIDList
[ii
].bWEPOn
= FALSE
;
357 if (ii
>= pList
->uItem
)
362 if (copy_to_user(pReq
->data
, pList
, sizeof(SBSSIDList
) + (sList
.uItem
* sizeof(SBSSIDItem
)))) {
370 case WLAN_CMD_GET_MIB
:
371 if (copy_to_user(pReq
->data
, &(pDevice
->s802_11Counter
), sizeof(SDot11MIBCount
))) {
377 case WLAN_CMD_GET_STAT
:
378 if (copy_to_user(pReq
->data
, &(pDevice
->scStatistic
), sizeof(SStatCounter
))) {
383 case WLAN_CMD_STOP_MAC
:
385 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"WLAN_CMD_STOP_MAC\n");
387 netif_stop_queue(pDevice
->dev
);
388 spin_lock_irq(&pDevice
->lock
);
389 if (pDevice
->bRadioOff
== FALSE
) {
390 CARDbRadioPowerOff(pDevice
);
392 pDevice
->bLinkPass
= FALSE
;
393 ControlvMaskByte(pDevice
,MESSAGE_REQUEST_MACREG
,MAC_REG_PAPEDELAY
,LEDSTS_STS
,LEDSTS_SLOW
);
394 memset(pMgmt
->abyCurrBSSID
, 0, 6);
395 pMgmt
->eCurrState
= WMAC_STATE_IDLE
;
396 // del_timer(&pDevice->sTimerCommand);
397 // del_timer(&pMgmt->sTimerSecondCallback);
398 pDevice
->bCmdRunning
= FALSE
;
399 spin_unlock_irq(&pDevice
->lock
);
403 case WLAN_CMD_START_MAC
:
405 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"WLAN_CMD_START_MAC\n");
407 if (pDevice
->bRadioOff
== TRUE
)
408 CARDbRadioPowerOn(pDevice
);
411 case WLAN_CMD_SET_HOSTAPD
:
413 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"WLAN_CMD_SET_HOSTAPD\n");
415 if (copy_from_user(&sValue
, pReq
->data
, sizeof(SCmdValue
))) {
419 if (sValue
.dwValue
== 1) {
420 if (vt6656_hostap_set_hostapd(pDevice
, 1, 1) == 0){
421 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"Enable HOSTAP\n");
429 vt6656_hostap_set_hostapd(pDevice
, 0, 1);
430 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"Disable HOSTAP\n");
435 case WLAN_CMD_SET_HOSTAPD_STA
:
437 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"WLAN_CMD_SET_HOSTAPD_STA\n");
440 case WLAN_CMD_SET_802_1X
:
442 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"WLAN_CMD_SET_802_1X\n");
443 if (copy_from_user(&sValue
, pReq
->data
, sizeof(SCmdValue
))) {
448 if (sValue
.dwValue
== 1) {
449 pDevice
->bEnable8021x
= TRUE
;
450 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"Enable 802.1x\n");
453 pDevice
->bEnable8021x
= FALSE
;
454 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"Disable 802.1x\n");
460 case WLAN_CMD_SET_HOST_WEP
:
462 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"WLAN_CMD_SET_HOST_WEP\n");
463 if (copy_from_user(&sValue
, pReq
->data
, sizeof(SCmdValue
))) {
468 if (sValue
.dwValue
== 1) {
469 pDevice
->bEnableHostWEP
= TRUE
;
470 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"Enable HostWEP\n");
473 pDevice
->bEnableHostWEP
= FALSE
;
474 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"Disable HostWEP\n");
479 case WLAN_CMD_SET_WPA
:
480 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"WLAN_CMD_SET_WPA\n");
482 if (copy_from_user(&sValue
, pReq
->data
, sizeof(SCmdValue
))) {
486 if (sValue
.dwValue
== 1) {
487 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"up wpadev\n");
488 memcpy(pDevice
->wpadev
->dev_addr
,
489 pDevice
->dev
->dev_addr
,
491 pDevice
->bWPADEVUp
= TRUE
;
494 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"close wpadev\n");
495 pDevice
->bWPADEVUp
= FALSE
;
500 case WLAN_CMD_AP_START
:
502 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"WLAN_CMD_AP_START\n");
503 if (pDevice
->bRadioOff
== TRUE
) {
504 CARDbRadioPowerOn(pDevice
);
505 add_timer(&pMgmt
->sTimerSecondCallback
);
507 if (copy_from_user(&sStartAPCmd
, pReq
->data
, sizeof(SCmdStartAP
))) {
512 if (sStartAPCmd
.wBSSType
== AP
) {
513 pMgmt
->eConfigMode
= WMAC_CONFIG_AP
;
514 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"ioct set to AP mode\n");
517 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"ioct BSS type not set to AP mode\n");
523 if (sStartAPCmd
.wBBPType
== PHY80211g
) {
524 pMgmt
->byAPBBType
= PHY_TYPE_11G
;
526 else if (sStartAPCmd
.wBBPType
== PHY80211a
) {
527 pMgmt
->byAPBBType
= PHY_TYPE_11A
;
530 pMgmt
->byAPBBType
= PHY_TYPE_11B
;
533 pItemSSID
= (PWLAN_IE_SSID
)sStartAPCmd
.ssid
;
534 memset(pMgmt
->abyDesireSSID
, 0, WLAN_IEHDR_LEN
+ WLAN_SSID_MAXLEN
+ 1);
535 memcpy(pMgmt
->abyDesireSSID
, pItemSSID
, pItemSSID
->len
+ WLAN_IEHDR_LEN
);
537 if ((sStartAPCmd
.uChannel
> 0)&&(sStartAPCmd
.uChannel
<= 14))
538 pDevice
->uChannel
= sStartAPCmd
.uChannel
;
540 if ((sStartAPCmd
.uBeaconInt
>= 20) && (sStartAPCmd
.uBeaconInt
<= 1000))
541 pMgmt
->wIBSSBeaconPeriod
= sStartAPCmd
.uBeaconInt
;
543 pMgmt
->wIBSSBeaconPeriod
= 100;
545 if (sStartAPCmd
.bShareKeyAuth
== TRUE
){
546 pMgmt
->bShareKeyAlgorithm
= TRUE
;
547 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"Share Key \n");
550 pMgmt
->bShareKeyAlgorithm
= FALSE
;
551 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"Open System \n");
553 memcpy(pMgmt
->abyIBSSSuppRates
, abySuppRates
, 6);
555 if (sStartAPCmd
.byBasicRate
& BIT3
) {
556 pMgmt
->abyIBSSSuppRates
[2] |= BIT7
;
557 pMgmt
->abyIBSSSuppRates
[3] |= BIT7
;
558 pMgmt
->abyIBSSSuppRates
[4] |= BIT7
;
559 pMgmt
->abyIBSSSuppRates
[5] |= BIT7
;
560 }else if (sStartAPCmd
.byBasicRate
& BIT2
) {
561 pMgmt
->abyIBSSSuppRates
[2] |= BIT7
;
562 pMgmt
->abyIBSSSuppRates
[3] |= BIT7
;
563 pMgmt
->abyIBSSSuppRates
[4] |= BIT7
;
564 }else if (sStartAPCmd
.byBasicRate
& BIT1
) {
565 pMgmt
->abyIBSSSuppRates
[2] |= BIT7
;
566 pMgmt
->abyIBSSSuppRates
[3] |= BIT7
;
567 }else if (sStartAPCmd
.byBasicRate
& BIT1
) {
568 pMgmt
->abyIBSSSuppRates
[2] |= BIT7
;
571 pMgmt
->abyIBSSSuppRates
[2] |= BIT7
;
572 pMgmt
->abyIBSSSuppRates
[3] |= BIT7
;
575 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"Support Rate= %x %x %x %x\n",
576 pMgmt
->abyIBSSSuppRates
[2],
577 pMgmt
->abyIBSSSuppRates
[3],
578 pMgmt
->abyIBSSSuppRates
[4],
579 pMgmt
->abyIBSSSuppRates
[5]
582 netif_stop_queue(pDevice
->dev
);
583 spin_lock_irq(&pDevice
->lock
);
584 bScheduleCommand((void *) pDevice
, WLAN_CMD_RUN_AP
, NULL
);
585 spin_unlock_irq(&pDevice
->lock
);
588 case WLAN_CMD_GET_NODE_CNT
:
591 pNode
= &(pMgmt
->sNodeDBTable
[0]);
592 for (ii
= 0; ii
< (MAX_NODE_NUM
+ 1); ii
++) {
593 pNode
= &(pMgmt
->sNodeDBTable
[ii
]);
599 sNodeList
.uItem
= cbListCount
;
600 if (copy_to_user(pReq
->data
, &sNodeList
, sizeof(SNodeList
))) {
607 case WLAN_CMD_GET_NODE_LIST
:
609 if (copy_from_user(&sNodeList
, pReq
->data
, sizeof(SNodeList
))) {
613 pNodeList
= (PSNodeList
)kmalloc(sizeof(SNodeList
) + (sNodeList
.uItem
* sizeof(SNodeItem
)), (int)GFP_ATOMIC
);
614 if (pNodeList
== NULL
) {
618 pNodeList
->uItem
= sNodeList
.uItem
;
619 pNode
= &(pMgmt
->sNodeDBTable
[0]);
620 for (ii
= 0, jj
= 0; ii
< (MAX_NODE_NUM
+ 1); ii
++) {
621 pNode
= &(pMgmt
->sNodeDBTable
[ii
]);
622 if (pNode
->bActive
) {
623 pNodeList
->sNodeList
[jj
].wAID
= pNode
->wAID
;
624 memcpy(pNodeList
->sNodeList
[jj
].abyMACAddr
, pNode
->abyMACAddr
, WLAN_ADDR_LEN
);
625 pNodeList
->sNodeList
[jj
].wTxDataRate
= pNode
->wTxDataRate
;
626 pNodeList
->sNodeList
[jj
].wInActiveCount
= (WORD
)pNode
->uInActiveCount
;
627 pNodeList
->sNodeList
[jj
].wEnQueueCnt
= (WORD
)pNode
->wEnQueueCnt
;
628 pNodeList
->sNodeList
[jj
].wFlags
= (WORD
)pNode
->dwFlags
;
629 pNodeList
->sNodeList
[jj
].bPWBitOn
= pNode
->bPSEnable
;
630 pNodeList
->sNodeList
[jj
].byKeyIndex
= pNode
->byKeyIndex
;
631 pNodeList
->sNodeList
[jj
].wWepKeyLength
= pNode
->uWepKeyLength
;
632 memcpy(&(pNodeList
->sNodeList
[jj
].abyWepKey
[0]), &(pNode
->abyWepKey
[0]), WEP_KEYMAXLEN
);
633 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"key= %2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
634 pNodeList
->sNodeList
[jj
].abyWepKey
[0],
635 pNodeList
->sNodeList
[jj
].abyWepKey
[1],
636 pNodeList
->sNodeList
[jj
].abyWepKey
[2],
637 pNodeList
->sNodeList
[jj
].abyWepKey
[3],
638 pNodeList
->sNodeList
[jj
].abyWepKey
[4]
640 pNodeList
->sNodeList
[jj
].bIsInFallback
= pNode
->bIsInFallback
;
641 pNodeList
->sNodeList
[jj
].uTxFailures
= pNode
->uTxFailures
;
642 pNodeList
->sNodeList
[jj
].uTxAttempts
= pNode
->uTxAttempts
;
643 pNodeList
->sNodeList
[jj
].wFailureRatio
= (WORD
)pNode
->uFailureRatio
;
645 if (jj
>= pNodeList
->uItem
)
649 if (copy_to_user(pReq
->data
, pNodeList
, sizeof(SNodeList
) + (sNodeList
.uItem
* sizeof(SNodeItem
)))) {
658 memset(wpa_Result
.ifname
,0,sizeof(wpa_Result
.ifname
));
659 wpa_Result
.proto
= 0;
660 wpa_Result
.key_mgmt
= 0;
661 wpa_Result
.eap_type
= 0;
662 wpa_Result
.authenticated
= FALSE
;
663 pDevice
->fWPA_Authened
= FALSE
;
664 if (copy_from_user(&wpa_Result
, pReq
->data
, sizeof(wpa_Result
))) {
668 //DavidWang for some AP maybe good authenticate
669 if(wpa_Result
.key_mgmt
==0x20)
670 pMgmt
->Cisco_cckm
=1;
672 pMgmt
->Cisco_cckm
=0;
675 if(wpa_Result
.authenticated
==TRUE
) {
677 union iwreq_data wrqu
;
679 pItemSSID
= (PWLAN_IE_SSID
)pMgmt
->abyCurrSSID
;
681 memset(&wrqu
, 0, sizeof(wrqu
));
682 wrqu
.data
.flags
= RT_WPACONNECTED_EVENT_FLAG
;
683 wrqu
.data
.length
=pItemSSID
->len
;
684 wireless_send_event(pDevice
->dev
, IWEVCUSTOM
, &wrqu
, pItemSSID
->abySSID
);
686 pDevice
->fWPA_Authened
= TRUE
; //is successful peer to wpa_Result.authenticated?
689 //printk("get private wpa_supplicant announce WPA SM\n");
690 //printk("wpa-->ifname=%s\n",wpa_Result.ifname);
691 //printk("wpa-->proto=%d\n",wpa_Result.proto);
692 //printk("wpa-->key-mgmt=%d\n",wpa_Result.key_mgmt);
693 //printk("wpa-->eap_type=%d\n",wpa_Result.eap_type);
694 //printk("wpa-->authenticated is %s\n",(wpa_Result.authenticated==TRUE)?"TRUE":"FALSE");
700 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"Private command not support..\n");