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 (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff &&
499 param->sta_addr[2] == 0xff && param->sta_addr[3] == 0xff &&
500 param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) {
501 if (param->u.crypt.idx >= MAX_GROUP_KEY)
506 if (BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &iNodeIndex) == false) {
507 param->u.crypt.err = HOSTAP_CRYPT_ERR_UNKNOWN_ADDR;
508 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " HOSTAP_CRYPT_ERR_UNKNOWN_ADDR\n");
512 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " hostap_set_encryption: sta_index %d \n", iNodeIndex);
513 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " hostap_set_encryption: alg %d \n", param->u.crypt.alg);
515 if (param->u.crypt.alg == WPA_ALG_NONE) {
517 if (pMgmt->sNodeDBTable[iNodeIndex].bOnFly == true) {
518 if (KeybRemoveKey(&(pDevice->sKey),
520 pMgmt->sNodeDBTable[iNodeIndex].dwKeyIndex,
521 pDevice->PortOffset) == false) {
522 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybRemoveKey fail \n");
524 pMgmt->sNodeDBTable[iNodeIndex].bOnFly = false;
526 pMgmt->sNodeDBTable[iNodeIndex].byKeyIndex = 0;
527 pMgmt->sNodeDBTable[iNodeIndex].dwKeyIndex = 0;
528 pMgmt->sNodeDBTable[iNodeIndex].uWepKeyLength = 0;
529 pMgmt->sNodeDBTable[iNodeIndex].KeyRSC = 0;
530 pMgmt->sNodeDBTable[iNodeIndex].dwTSC47_16 = 0;
531 pMgmt->sNodeDBTable[iNodeIndex].wTSC15_0 = 0;
532 pMgmt->sNodeDBTable[iNodeIndex].byCipherSuite = 0;
533 memset(&pMgmt->sNodeDBTable[iNodeIndex].abyWepKey[0],
541 memcpy(abyKey, param->u.crypt.key, param->u.crypt.key_len);
542 // copy to node key tbl
543 pMgmt->sNodeDBTable[iNodeIndex].byKeyIndex = param->u.crypt.idx;
544 pMgmt->sNodeDBTable[iNodeIndex].uWepKeyLength = param->u.crypt.key_len;
545 memcpy(&pMgmt->sNodeDBTable[iNodeIndex].abyWepKey[0],
547 param->u.crypt.key_len
550 dwKeyIndex = (unsigned long)(param->u.crypt.idx);
551 if (param->u.crypt.flags & HOSTAP_CRYPT_FLAG_SET_TX_KEY) {
552 pDevice->byKeyIndex = (unsigned char)dwKeyIndex;
553 pDevice->bTransmitKey = true;
554 dwKeyIndex |= (1 << 31);
557 if (param->u.crypt.alg == WPA_ALG_WEP) {
559 if ((pDevice->bEnable8021x == false) || (iNodeIndex == 0)) {
560 KeybSetDefaultKey(&(pDevice->sKey),
561 dwKeyIndex & ~(BIT30 | USE_KEYRSC),
562 param->u.crypt.key_len,
570 // 8021x enable, individual key
571 dwKeyIndex |= (1 << 30); // set pairwise key
572 if (KeybSetKey(&(pDevice->sKey),
574 dwKeyIndex & ~(USE_KEYRSC),
575 param->u.crypt.key_len,
577 (unsigned char *)abyKey,
580 pDevice->byLocalID) == true) {
582 pMgmt->sNodeDBTable[iNodeIndex].bOnFly = true;
586 pMgmt->sNodeDBTable[iNodeIndex].bOnFly = false;
587 bKeyTableFull = true;
590 pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled;
591 pDevice->bEncryptionEnable = true;
592 pMgmt->byCSSPK = KEY_CTL_WEP;
593 pMgmt->byCSSGK = KEY_CTL_WEP;
594 pMgmt->sNodeDBTable[iNodeIndex].byCipherSuite = KEY_CTL_WEP;
595 pMgmt->sNodeDBTable[iNodeIndex].dwKeyIndex = dwKeyIndex;
599 if (param->u.crypt.seq) {
600 memcpy(&abySeq, param->u.crypt.seq, 8);
601 for (ii = 0 ; ii < 8 ; ii++) {
602 KeyRSC |= (abySeq[ii] << (ii * 8));
604 dwKeyIndex |= 1 << 29;
605 pMgmt->sNodeDBTable[iNodeIndex].KeyRSC = KeyRSC;
608 if (param->u.crypt.alg == WPA_ALG_TKIP) {
609 if (param->u.crypt.key_len != MAX_KEY_LEN)
611 pDevice->eEncryptionStatus = Ndis802_11Encryption2Enabled;
612 byKeyDecMode = KEY_CTL_TKIP;
613 pMgmt->byCSSPK = KEY_CTL_TKIP;
614 pMgmt->byCSSGK = KEY_CTL_TKIP;
617 if (param->u.crypt.alg == WPA_ALG_CCMP) {
618 if ((param->u.crypt.key_len != AES_KEY_LEN) ||
619 (pDevice->byLocalID <= REV_ID_VT3253_A1))
621 pDevice->eEncryptionStatus = Ndis802_11Encryption3Enabled;
622 byKeyDecMode = KEY_CTL_CCMP;
623 pMgmt->byCSSPK = KEY_CTL_CCMP;
624 pMgmt->byCSSGK = KEY_CTL_CCMP;
628 if (iNodeIndex == 0) {
629 KeybSetDefaultKey(&(pDevice->sKey),
631 param->u.crypt.key_len,
637 pMgmt->sNodeDBTable[iNodeIndex].bOnFly = true;
640 dwKeyIndex |= (1 << 30); // set pairwise key
641 if (KeybSetKey(&(pDevice->sKey),
644 param->u.crypt.key_len,
646 (unsigned char *)abyKey,
649 pDevice->byLocalID) == true) {
651 pMgmt->sNodeDBTable[iNodeIndex].bOnFly = true;
655 pMgmt->sNodeDBTable[iNodeIndex].bOnFly = false;
656 bKeyTableFull = true;
657 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " Key Table Full\n");
662 if (bKeyTableFull == true) {
663 wKeyCtl &= 0x7F00; // clear all key control filed
664 wKeyCtl |= (byKeyDecMode << 4);
665 wKeyCtl |= (byKeyDecMode);
666 wKeyCtl |= 0x0044; // use group key for all address
667 wKeyCtl |= 0x4000; // disable KeyTable[MAX_KEY_TABLE-1] on-fly to genernate rx int
668 MACvSetDefaultKeyCtl(pDevice->PortOffset, wKeyCtl, MAX_KEY_TABLE-1, pDevice->byLocalID);
671 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " Set key sta_index= %d \n", iNodeIndex);
672 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " tx_index=%d len=%d \n", param->u.crypt.idx,
673 param->u.crypt.key_len );
674 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " key=%x-%x-%x-%x-%x-xxxxx \n",
675 pMgmt->sNodeDBTable[iNodeIndex].abyWepKey[0],
676 pMgmt->sNodeDBTable[iNodeIndex].abyWepKey[1],
677 pMgmt->sNodeDBTable[iNodeIndex].abyWepKey[2],
678 pMgmt->sNodeDBTable[iNodeIndex].abyWepKey[3],
679 pMgmt->sNodeDBTable[iNodeIndex].abyWepKey[4]
683 pDevice->bEncryptionEnable = true;
684 pMgmt->sNodeDBTable[iNodeIndex].byCipherSuite = byKeyDecMode;
685 pMgmt->sNodeDBTable[iNodeIndex].dwKeyIndex = dwKeyIndex;
686 pMgmt->sNodeDBTable[iNodeIndex].dwTSC47_16 = 0;
687 pMgmt->sNodeDBTable[iNodeIndex].wTSC15_0 = 0;
696 * get each stations encryption key
707 static int hostap_get_encryption(PSDevice pDevice,
708 struct viawget_hostapd_param *param,
711 PSMgmtObject pMgmt = pDevice->pMgmt;
717 param->u.crypt.err = 0;
719 if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff &&
720 param->sta_addr[2] == 0xff && param->sta_addr[3] == 0xff &&
721 param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) {
724 if (BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &iNodeIndex) == false) {
725 param->u.crypt.err = HOSTAP_CRYPT_ERR_UNKNOWN_ADDR;
726 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "hostap_get_encryption: HOSTAP_CRYPT_ERR_UNKNOWN_ADDR\n");
730 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "hostap_get_encryption: %d\n", iNodeIndex);
731 memset(param->u.crypt.seq, 0, 8);
732 for (ii = 0 ; ii < 8 ; ii++) {
733 param->u.crypt.seq[ii] = (unsigned char)pMgmt->sNodeDBTable[iNodeIndex].KeyRSC >> (ii * 8);
742 * vt6655_hostap_ioctl main function supported for hostap deamon.
754 int vt6655_hostap_ioctl(PSDevice pDevice, struct iw_point *p)
756 struct viawget_hostapd_param *param;
760 if (p->length < sizeof(struct viawget_hostapd_param) ||
761 p->length > VIAWGET_HOSTAPD_MAX_BUF_SIZE || !p->pointer)
764 param = kmalloc((int)p->length, (int)GFP_KERNEL);
768 if (copy_from_user(param, p->pointer, p->length)) {
773 switch (param->cmd) {
774 case VIAWGET_HOSTAPD_SET_ENCRYPTION:
775 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_SET_ENCRYPTION \n");
776 spin_lock_irq(&pDevice->lock);
777 ret = hostap_set_encryption(pDevice, param, p->length);
778 spin_unlock_irq(&pDevice->lock);
780 case VIAWGET_HOSTAPD_GET_ENCRYPTION:
781 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_GET_ENCRYPTION \n");
782 spin_lock_irq(&pDevice->lock);
783 ret = hostap_get_encryption(pDevice, param, p->length);
784 spin_unlock_irq(&pDevice->lock);
786 case VIAWGET_HOSTAPD_SET_ASSOC_AP_ADDR:
787 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_SET_ASSOC_AP_ADDR \n");
790 case VIAWGET_HOSTAPD_FLUSH:
791 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_FLUSH \n");
792 spin_lock_irq(&pDevice->lock);
793 hostap_flush_sta(pDevice);
794 spin_unlock_irq(&pDevice->lock);
796 case VIAWGET_HOSTAPD_ADD_STA:
797 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_ADD_STA \n");
798 spin_lock_irq(&pDevice->lock);
799 ret = hostap_add_sta(pDevice, param);
800 spin_unlock_irq(&pDevice->lock);
802 case VIAWGET_HOSTAPD_REMOVE_STA:
803 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_REMOVE_STA \n");
804 spin_lock_irq(&pDevice->lock);
805 ret = hostap_remove_sta(pDevice, param);
806 spin_unlock_irq(&pDevice->lock);
808 case VIAWGET_HOSTAPD_GET_INFO_STA:
809 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_GET_INFO_STA \n");
810 ret = hostap_get_info_sta(pDevice, param);
814 case VIAWGET_HOSTAPD_RESET_TXEXC_STA:
815 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_RESET_TXEXC_STA \n");
816 ret = hostap_reset_txexc_sta(pDevice, param);
819 case VIAWGET_HOSTAPD_SET_FLAGS_STA:
820 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_SET_FLAGS_STA \n");
821 ret = hostap_set_flags_sta(pDevice, param);
824 case VIAWGET_HOSTAPD_MLME:
825 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_MLME \n");
828 case VIAWGET_HOSTAPD_SET_GENERIC_ELEMENT:
829 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_SET_GENERIC_ELEMENT \n");
830 ret = hostap_set_generic_element(pDevice, param);
833 case VIAWGET_HOSTAPD_SCAN_REQ:
834 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_SCAN_REQ \n");
837 case VIAWGET_HOSTAPD_STA_CLEAR_STATS:
838 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_STA_CLEAR_STATS \n");
842 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "vt6655_hostap_ioctl: unknown cmd=%d\n",
849 if ((ret == 0) && ap_ioctl) {
850 if (copy_to_user(p->pointer, param, p->length)) {