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: handle hostap deamon ioctl input/out functions
41 #define VIAWGET_HOSTAPD_MAX_BUF_SIZE 1024
42 #define HOSTAP_CRYPT_FLAG_SET_TX_KEY BIT0
43 #define HOSTAP_CRYPT_ERR_UNKNOWN_ADDR 3
44 #define HOSTAP_CRYPT_ERR_KEY_SET_FAILED 5
46 /*--------------------- Static Definitions -------------------------*/
48 /*--------------------- Static Classes ----------------------------*/
50 /*--------------------- Static Variables --------------------------*/
51 //static int msglevel =MSG_LEVEL_DEBUG;
52 static int msglevel = MSG_LEVEL_INFO;
54 /*--------------------- Static Functions --------------------------*/
59 /*--------------------- Export Variables --------------------------*/
64 * register net_device (AP) for hostap deamon
76 static int hostap_enable_hostapd(PSDevice pDevice, int rtnl_locked)
79 struct net_device *dev = pDevice->dev;
81 const struct net_device_ops apdev_netdev_ops = {
82 .ndo_start_xmit = pDevice->tx_80211,
85 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Enabling hostapd mode\n", dev->name);
87 pDevice->apdev = kzalloc(sizeof(struct net_device), GFP_KERNEL);
88 if (pDevice->apdev == NULL)
91 apdev_priv = netdev_priv(pDevice->apdev);
92 *apdev_priv = *pDevice;
93 memcpy(pDevice->apdev->dev_addr, dev->dev_addr, ETH_ALEN);
95 pDevice->apdev->netdev_ops = &apdev_netdev_ops;
97 pDevice->apdev->type = ARPHRD_IEEE80211;
99 pDevice->apdev->base_addr = dev->base_addr;
100 pDevice->apdev->irq = dev->irq;
101 pDevice->apdev->mem_start = dev->mem_start;
102 pDevice->apdev->mem_end = dev->mem_end;
103 sprintf(pDevice->apdev->name, "%sap", dev->name);
105 ret = register_netdevice(pDevice->apdev);
107 ret = register_netdev(pDevice->apdev);
109 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: register_netdevice(AP) failed!\n",
114 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Registered netdevice %s for AP management\n",
115 dev->name, pDevice->apdev->name);
117 KeyvInitTable(&pDevice->sKey, pDevice->PortOffset);
124 * unregister net_device(AP)
136 static int hostap_disable_hostapd(PSDevice pDevice, int rtnl_locked)
139 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: disabling hostapd mode\n", pDevice->dev->name);
141 if (pDevice->apdev && pDevice->apdev->name && pDevice->apdev->name[0]) {
143 unregister_netdevice(pDevice->apdev);
145 unregister_netdev(pDevice->apdev);
146 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Netdevice %s unregistered\n",
147 pDevice->dev->name, pDevice->apdev->name);
149 kfree(pDevice->apdev);
150 pDevice->apdev = NULL;
151 pDevice->bEnable8021x = false;
152 pDevice->bEnableHostWEP = false;
153 pDevice->bEncryptionEnable = false;
155 //4.2007-0118-03,<Add> by EinsnLiu
156 //execute some clear work
157 pDevice->pMgmt->byCSSPK = KEY_CTL_NONE;
158 pDevice->pMgmt->byCSSGK = KEY_CTL_NONE;
159 KeyvInitTable(&pDevice->sKey, pDevice->PortOffset);
167 * Set enable/disable hostapd mode
179 int vt6655_hostap_set_hostapd(PSDevice pDevice, int val, int rtnl_locked)
181 if (val < 0 || val > 1)
184 if (pDevice->bEnableHostapd == val)
187 pDevice->bEnableHostapd = val;
190 return hostap_enable_hostapd(pDevice, rtnl_locked);
192 return hostap_disable_hostapd(pDevice, rtnl_locked);
198 * remove station function supported for hostap deamon
209 static int hostap_remove_sta(PSDevice pDevice,
210 struct viawget_hostapd_param *param)
212 unsigned int uNodeIndex;
215 if (BSSDBbIsSTAInNodeDB(pDevice->pMgmt, param->sta_addr, &uNodeIndex)) {
216 BSSvRemoveOneNode(pDevice, uNodeIndex);
226 * add a station from hostap deamon
237 static int hostap_add_sta(PSDevice pDevice,
238 struct viawget_hostapd_param *param)
240 PSMgmtObject pMgmt = pDevice->pMgmt;
241 unsigned int uNodeIndex;
244 if (!BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &uNodeIndex)) {
245 BSSvCreateOneNode((PSDevice)pDevice, &uNodeIndex);
247 memcpy(pMgmt->sNodeDBTable[uNodeIndex].abyMACAddr, param->sta_addr, WLAN_ADDR_LEN);
248 pMgmt->sNodeDBTable[uNodeIndex].eNodeState = NODE_ASSOC;
249 pMgmt->sNodeDBTable[uNodeIndex].wCapInfo = param->u.add_sta.capability;
250 // TODO listenInterval
251 // pMgmt->sNodeDBTable[uNodeIndex].wListenInterval = 1;
252 pMgmt->sNodeDBTable[uNodeIndex].bPSEnable = false;
253 pMgmt->sNodeDBTable[uNodeIndex].bySuppRate = param->u.add_sta.tx_supp_rates;
256 pMgmt->sNodeDBTable[uNodeIndex].wTxDataRate =
257 pMgmt->sNodeDBTable[uNodeIndex].wMaxSuppRate;
258 // set max basic rate
259 pMgmt->sNodeDBTable[uNodeIndex].wMaxBasicRate = RATE_2M;
260 // Todo: check sta preamble, if ap can't support, set status code
261 pMgmt->sNodeDBTable[uNodeIndex].bShortPreamble =
262 WLAN_GET_CAP_INFO_SHORTPREAMBLE(pMgmt->sNodeDBTable[uNodeIndex].wCapInfo);
264 pMgmt->sNodeDBTable[uNodeIndex].wAID = (unsigned short)param->u.add_sta.aid;
266 pMgmt->sNodeDBTable[uNodeIndex].ulLastRxJiffer = jiffies;
268 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Add STA AID= %d \n", pMgmt->sNodeDBTable[uNodeIndex].wAID);
269 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "MAC=%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X \n",
277 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Max Support rate = %d \n",
278 pMgmt->sNodeDBTable[uNodeIndex].wMaxSuppRate);
297 static int hostap_get_info_sta(PSDevice pDevice,
298 struct viawget_hostapd_param *param)
300 PSMgmtObject pMgmt = pDevice->pMgmt;
301 unsigned int uNodeIndex;
303 if (BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &uNodeIndex)) {
304 param->u.get_info_sta.inactive_sec =
305 (jiffies - pMgmt->sNodeDBTable[uNodeIndex].ulLastRxJiffer) / HZ;
307 //param->u.get_info_sta.txexc = pMgmt->sNodeDBTable[uNodeIndex].uTxAttempts;
331 static int hostap_reset_txexc_sta(PSDevice pDevice,
332 struct viawget_hostapd_param *param)
334 PSMgmtObject pMgmt = pDevice->pMgmt;
335 unsigned int uNodeIndex;
337 if (BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &uNodeIndex)) {
338 pMgmt->sNodeDBTable[uNodeIndex].uTxAttempts = 0;
361 static int hostap_set_flags_sta(PSDevice pDevice,
362 struct viawget_hostapd_param *param)
364 PSMgmtObject pMgmt = pDevice->pMgmt;
365 unsigned int uNodeIndex;
367 if (BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &uNodeIndex)) {
368 pMgmt->sNodeDBTable[uNodeIndex].dwFlags |= param->u.set_flags_sta.flags_or;
369 pMgmt->sNodeDBTable[uNodeIndex].dwFlags &= param->u.set_flags_sta.flags_and;
370 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " dwFlags = %x \n",
371 (unsigned int)pMgmt->sNodeDBTable[uNodeIndex].dwFlags);
384 * set generic element (wpa ie)
395 static int hostap_set_generic_element(PSDevice pDevice,
396 struct viawget_hostapd_param *param)
398 PSMgmtObject pMgmt = pDevice->pMgmt;
402 memcpy(pMgmt->abyWPAIE,
403 param->u.generic_elem.data,
404 param->u.generic_elem.len
407 pMgmt->wWPAIELen = param->u.generic_elem.len;
409 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pMgmt->wWPAIELen = %d\n", pMgmt->wWPAIELen);
412 if (pMgmt->wWPAIELen == 0) {
413 pMgmt->eAuthenMode = WMAC_AUTH_OPEN;
414 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " No WPAIE, Disable WPA \n");
417 if ((pMgmt->abyWPAIE[0] == WLAN_EID_RSN_WPA) ||
418 (pMgmt->abyWPAIE[0] == WLAN_EID_RSN)) {
419 pMgmt->eAuthenMode = WMAC_AUTH_WPANONE;
420 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Set WPAIE enable WPA\n");
430 * flush station nodes table.
441 static void hostap_flush_sta(PSDevice pDevice)
443 // reserved node index =0 for multicast node.
444 BSSvClearNodeDBTable(pDevice, 1);
445 pDevice->uAssocCount = 0;
452 * set each stations encryption key
463 static int hostap_set_encryption(PSDevice pDevice,
464 struct viawget_hostapd_param *param,
467 PSMgmtObject pMgmt = pDevice->pMgmt;
468 unsigned long dwKeyIndex = 0;
469 unsigned char abyKey[MAX_KEY_LEN];
470 unsigned char abySeq[MAX_KEY_LEN];
471 NDIS_802_11_KEY_RSC KeyRSC;
472 unsigned char byKeyDecMode = KEY_CTL_WEP;
476 bool bKeyTableFull = false;
477 unsigned short wKeyCtl = 0;
480 param->u.crypt.err = 0;
483 (int) ((char *) param->u.crypt.key - (char *) param) +
484 param->u.crypt.key_len)
488 if (param->u.crypt.alg > WPA_ALG_CCMP)
492 if ((param->u.crypt.idx > 3) || (param->u.crypt.key_len > MAX_KEY_LEN)) {
493 param->u.crypt.err = HOSTAP_CRYPT_ERR_KEY_SET_FAILED;
494 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " HOSTAP_CRYPT_ERR_KEY_SET_FAILED\n");
498 if (is_broadcast_ether_addr(param->sta_addr)) {
499 if (param->u.crypt.idx >= MAX_GROUP_KEY)
504 if (BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &iNodeIndex) == false) {
505 param->u.crypt.err = HOSTAP_CRYPT_ERR_UNKNOWN_ADDR;
506 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " HOSTAP_CRYPT_ERR_UNKNOWN_ADDR\n");
510 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " hostap_set_encryption: sta_index %d \n", iNodeIndex);
511 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " hostap_set_encryption: alg %d \n", param->u.crypt.alg);
513 if (param->u.crypt.alg == WPA_ALG_NONE) {
515 if (pMgmt->sNodeDBTable[iNodeIndex].bOnFly == true) {
516 if (KeybRemoveKey(&(pDevice->sKey),
518 pMgmt->sNodeDBTable[iNodeIndex].dwKeyIndex,
519 pDevice->PortOffset) == false) {
520 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybRemoveKey fail \n");
522 pMgmt->sNodeDBTable[iNodeIndex].bOnFly = false;
524 pMgmt->sNodeDBTable[iNodeIndex].byKeyIndex = 0;
525 pMgmt->sNodeDBTable[iNodeIndex].dwKeyIndex = 0;
526 pMgmt->sNodeDBTable[iNodeIndex].uWepKeyLength = 0;
527 pMgmt->sNodeDBTable[iNodeIndex].KeyRSC = 0;
528 pMgmt->sNodeDBTable[iNodeIndex].dwTSC47_16 = 0;
529 pMgmt->sNodeDBTable[iNodeIndex].wTSC15_0 = 0;
530 pMgmt->sNodeDBTable[iNodeIndex].byCipherSuite = 0;
531 memset(&pMgmt->sNodeDBTable[iNodeIndex].abyWepKey[0],
539 memcpy(abyKey, param->u.crypt.key, param->u.crypt.key_len);
540 // copy to node key tbl
541 pMgmt->sNodeDBTable[iNodeIndex].byKeyIndex = param->u.crypt.idx;
542 pMgmt->sNodeDBTable[iNodeIndex].uWepKeyLength = param->u.crypt.key_len;
543 memcpy(&pMgmt->sNodeDBTable[iNodeIndex].abyWepKey[0],
545 param->u.crypt.key_len
548 dwKeyIndex = (unsigned long)(param->u.crypt.idx);
549 if (param->u.crypt.flags & HOSTAP_CRYPT_FLAG_SET_TX_KEY) {
550 pDevice->byKeyIndex = (unsigned char)dwKeyIndex;
551 pDevice->bTransmitKey = true;
552 dwKeyIndex |= (1 << 31);
555 if (param->u.crypt.alg == WPA_ALG_WEP) {
557 if ((pDevice->bEnable8021x == false) || (iNodeIndex == 0)) {
558 KeybSetDefaultKey(&(pDevice->sKey),
559 dwKeyIndex & ~(BIT30 | USE_KEYRSC),
560 param->u.crypt.key_len,
568 // 8021x enable, individual key
569 dwKeyIndex |= (1 << 30); // set pairwise key
570 if (KeybSetKey(&(pDevice->sKey),
572 dwKeyIndex & ~(USE_KEYRSC),
573 param->u.crypt.key_len,
575 (unsigned char *)abyKey,
578 pDevice->byLocalID) == true) {
580 pMgmt->sNodeDBTable[iNodeIndex].bOnFly = true;
584 pMgmt->sNodeDBTable[iNodeIndex].bOnFly = false;
585 bKeyTableFull = true;
588 pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled;
589 pDevice->bEncryptionEnable = true;
590 pMgmt->byCSSPK = KEY_CTL_WEP;
591 pMgmt->byCSSGK = KEY_CTL_WEP;
592 pMgmt->sNodeDBTable[iNodeIndex].byCipherSuite = KEY_CTL_WEP;
593 pMgmt->sNodeDBTable[iNodeIndex].dwKeyIndex = dwKeyIndex;
597 if (param->u.crypt.seq) {
598 memcpy(&abySeq, param->u.crypt.seq, 8);
599 for (ii = 0; ii < 8; ii++)
600 KeyRSC |= (unsigned long)abySeq[ii] << (ii * 8);
602 dwKeyIndex |= 1 << 29;
603 pMgmt->sNodeDBTable[iNodeIndex].KeyRSC = KeyRSC;
606 if (param->u.crypt.alg == WPA_ALG_TKIP) {
607 if (param->u.crypt.key_len != MAX_KEY_LEN)
609 pDevice->eEncryptionStatus = Ndis802_11Encryption2Enabled;
610 byKeyDecMode = KEY_CTL_TKIP;
611 pMgmt->byCSSPK = KEY_CTL_TKIP;
612 pMgmt->byCSSGK = KEY_CTL_TKIP;
615 if (param->u.crypt.alg == WPA_ALG_CCMP) {
616 if ((param->u.crypt.key_len != AES_KEY_LEN) ||
617 (pDevice->byLocalID <= REV_ID_VT3253_A1))
619 pDevice->eEncryptionStatus = Ndis802_11Encryption3Enabled;
620 byKeyDecMode = KEY_CTL_CCMP;
621 pMgmt->byCSSPK = KEY_CTL_CCMP;
622 pMgmt->byCSSGK = KEY_CTL_CCMP;
626 if (iNodeIndex == 0) {
627 KeybSetDefaultKey(&(pDevice->sKey),
629 param->u.crypt.key_len,
635 pMgmt->sNodeDBTable[iNodeIndex].bOnFly = true;
638 dwKeyIndex |= (1 << 30); // set pairwise key
639 if (KeybSetKey(&(pDevice->sKey),
642 param->u.crypt.key_len,
644 (unsigned char *)abyKey,
647 pDevice->byLocalID) == true) {
649 pMgmt->sNodeDBTable[iNodeIndex].bOnFly = true;
653 pMgmt->sNodeDBTable[iNodeIndex].bOnFly = false;
654 bKeyTableFull = true;
655 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " Key Table Full\n");
660 if (bKeyTableFull == true) {
661 wKeyCtl &= 0x7F00; // clear all key control filed
662 wKeyCtl |= (byKeyDecMode << 4);
663 wKeyCtl |= (byKeyDecMode);
664 wKeyCtl |= 0x0044; // use group key for all address
665 wKeyCtl |= 0x4000; // disable KeyTable[MAX_KEY_TABLE-1] on-fly to genernate rx int
666 MACvSetDefaultKeyCtl(pDevice->PortOffset, wKeyCtl, MAX_KEY_TABLE-1, pDevice->byLocalID);
669 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " Set key sta_index= %d \n", iNodeIndex);
670 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " tx_index=%d len=%d \n", param->u.crypt.idx,
671 param->u.crypt.key_len);
672 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " key=%x-%x-%x-%x-%x-xxxxx \n",
673 pMgmt->sNodeDBTable[iNodeIndex].abyWepKey[0],
674 pMgmt->sNodeDBTable[iNodeIndex].abyWepKey[1],
675 pMgmt->sNodeDBTable[iNodeIndex].abyWepKey[2],
676 pMgmt->sNodeDBTable[iNodeIndex].abyWepKey[3],
677 pMgmt->sNodeDBTable[iNodeIndex].abyWepKey[4]
681 pDevice->bEncryptionEnable = true;
682 pMgmt->sNodeDBTable[iNodeIndex].byCipherSuite = byKeyDecMode;
683 pMgmt->sNodeDBTable[iNodeIndex].dwKeyIndex = dwKeyIndex;
684 pMgmt->sNodeDBTable[iNodeIndex].dwTSC47_16 = 0;
685 pMgmt->sNodeDBTable[iNodeIndex].wTSC15_0 = 0;
694 * get each stations encryption key
705 static int hostap_get_encryption(PSDevice pDevice,
706 struct viawget_hostapd_param *param,
709 PSMgmtObject pMgmt = pDevice->pMgmt;
715 param->u.crypt.err = 0;
717 if (is_broadcast_ether_addr(param->sta_addr)) {
720 if (BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &iNodeIndex) == false) {
721 param->u.crypt.err = HOSTAP_CRYPT_ERR_UNKNOWN_ADDR;
722 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "hostap_get_encryption: HOSTAP_CRYPT_ERR_UNKNOWN_ADDR\n");
726 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "hostap_get_encryption: %d\n", iNodeIndex);
727 memset(param->u.crypt.seq, 0, 8);
728 for (ii = 0; ii < 8; ii++) {
729 param->u.crypt.seq[ii] = (unsigned char)pMgmt->sNodeDBTable[iNodeIndex].KeyRSC >> (ii * 8);
738 * vt6655_hostap_ioctl main function supported for hostap deamon.
750 int vt6655_hostap_ioctl(PSDevice pDevice, struct iw_point *p)
752 struct viawget_hostapd_param *param;
756 if (p->length < sizeof(struct viawget_hostapd_param) ||
757 p->length > VIAWGET_HOSTAPD_MAX_BUF_SIZE || !p->pointer)
760 param = kmalloc((int)p->length, (int)GFP_KERNEL);
764 if (copy_from_user(param, p->pointer, p->length)) {
769 switch (param->cmd) {
770 case VIAWGET_HOSTAPD_SET_ENCRYPTION:
771 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_SET_ENCRYPTION \n");
772 spin_lock_irq(&pDevice->lock);
773 ret = hostap_set_encryption(pDevice, param, p->length);
774 spin_unlock_irq(&pDevice->lock);
776 case VIAWGET_HOSTAPD_GET_ENCRYPTION:
777 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_GET_ENCRYPTION \n");
778 spin_lock_irq(&pDevice->lock);
779 ret = hostap_get_encryption(pDevice, param, p->length);
780 spin_unlock_irq(&pDevice->lock);
782 case VIAWGET_HOSTAPD_SET_ASSOC_AP_ADDR:
783 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_SET_ASSOC_AP_ADDR \n");
786 case VIAWGET_HOSTAPD_FLUSH:
787 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_FLUSH \n");
788 spin_lock_irq(&pDevice->lock);
789 hostap_flush_sta(pDevice);
790 spin_unlock_irq(&pDevice->lock);
792 case VIAWGET_HOSTAPD_ADD_STA:
793 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_ADD_STA \n");
794 spin_lock_irq(&pDevice->lock);
795 ret = hostap_add_sta(pDevice, param);
796 spin_unlock_irq(&pDevice->lock);
798 case VIAWGET_HOSTAPD_REMOVE_STA:
799 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_REMOVE_STA \n");
800 spin_lock_irq(&pDevice->lock);
801 ret = hostap_remove_sta(pDevice, param);
802 spin_unlock_irq(&pDevice->lock);
804 case VIAWGET_HOSTAPD_GET_INFO_STA:
805 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_GET_INFO_STA \n");
806 ret = hostap_get_info_sta(pDevice, param);
810 case VIAWGET_HOSTAPD_RESET_TXEXC_STA:
811 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_RESET_TXEXC_STA \n");
812 ret = hostap_reset_txexc_sta(pDevice, param);
815 case VIAWGET_HOSTAPD_SET_FLAGS_STA:
816 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_SET_FLAGS_STA \n");
817 ret = hostap_set_flags_sta(pDevice, param);
820 case VIAWGET_HOSTAPD_MLME:
821 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_MLME \n");
824 case VIAWGET_HOSTAPD_SET_GENERIC_ELEMENT:
825 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_SET_GENERIC_ELEMENT \n");
826 ret = hostap_set_generic_element(pDevice, param);
829 case VIAWGET_HOSTAPD_SCAN_REQ:
830 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_SCAN_REQ \n");
833 case VIAWGET_HOSTAPD_STA_CLEAR_STATS:
834 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_STA_CLEAR_STATS \n");
838 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "vt6655_hostap_ioctl: unknown cmd=%d\n",
845 if ((ret == 0) && ap_ioctl) {
846 if (copy_to_user(p->pointer, param, p->length)) {