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_INFO;
53 /*--------------------- Static Functions --------------------------*/
55 /*--------------------- Export Variables --------------------------*/
59 * register net_device (AP) for hostap deamon
71 static int hostap_enable_hostapd(PSDevice pDevice, int rtnl_locked)
74 struct net_device *dev = pDevice->dev;
76 const struct net_device_ops apdev_netdev_ops = {
77 .ndo_start_xmit = pDevice->tx_80211,
80 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Enabling hostapd mode\n", dev->name);
82 pDevice->apdev = alloc_etherdev(sizeof(*apdev_priv));
83 if (pDevice->apdev == NULL)
86 apdev_priv = netdev_priv(pDevice->apdev);
87 *apdev_priv = *pDevice;
88 eth_hw_addr_inherit(pDevice->apdev, dev);
90 pDevice->apdev->netdev_ops = &apdev_netdev_ops;
92 pDevice->apdev->type = ARPHRD_IEEE80211;
94 pDevice->apdev->base_addr = dev->base_addr;
95 pDevice->apdev->irq = dev->irq;
96 pDevice->apdev->mem_start = dev->mem_start;
97 pDevice->apdev->mem_end = dev->mem_end;
98 sprintf(pDevice->apdev->name, "%sap", dev->name);
100 ret = register_netdevice(pDevice->apdev);
102 ret = register_netdev(pDevice->apdev);
104 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: register_netdevice(AP) failed!\n",
106 free_netdev(pDevice->apdev);
107 pDevice->apdev = NULL;
111 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Registered netdevice %s for AP management\n",
112 dev->name, pDevice->apdev->name);
114 KeyvInitTable(&pDevice->sKey, pDevice->PortOffset);
121 * unregister net_device(AP)
133 static int hostap_disable_hostapd(PSDevice pDevice, int rtnl_locked)
135 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: disabling hostapd mode\n", pDevice->dev->name);
137 if (pDevice->apdev && pDevice->apdev->name && pDevice->apdev->name[0]) {
139 unregister_netdevice(pDevice->apdev);
141 unregister_netdev(pDevice->apdev);
142 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Netdevice %s unregistered\n",
143 pDevice->dev->name, pDevice->apdev->name);
146 free_netdev(pDevice->apdev);
147 pDevice->apdev = NULL;
148 pDevice->bEnable8021x = false;
149 pDevice->bEnableHostWEP = false;
150 pDevice->bEncryptionEnable = false;
152 //4.2007-0118-03,<Add> by EinsnLiu
153 //execute some clear work
154 pDevice->pMgmt->byCSSPK = KEY_CTL_NONE;
155 pDevice->pMgmt->byCSSGK = KEY_CTL_NONE;
156 KeyvInitTable(&pDevice->sKey, pDevice->PortOffset);
163 * Set enable/disable hostapd mode
175 int vt6655_hostap_set_hostapd(PSDevice pDevice, int val, int rtnl_locked)
177 if (val < 0 || val > 1)
180 if (pDevice->bEnableHostapd == val)
183 pDevice->bEnableHostapd = val;
186 return hostap_enable_hostapd(pDevice, rtnl_locked);
188 return hostap_disable_hostapd(pDevice, rtnl_locked);
193 * remove station function supported for hostap deamon
204 static int hostap_remove_sta(PSDevice pDevice,
205 struct viawget_hostapd_param *param)
207 unsigned int uNodeIndex;
209 if (BSSDBbIsSTAInNodeDB(pDevice->pMgmt, param->sta_addr, &uNodeIndex))
210 BSSvRemoveOneNode(pDevice, uNodeIndex);
219 * add a station from hostap deamon
230 static int hostap_add_sta(PSDevice pDevice,
231 struct viawget_hostapd_param *param)
233 PSMgmtObject pMgmt = pDevice->pMgmt;
234 unsigned int uNodeIndex;
236 if (!BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &uNodeIndex))
237 BSSvCreateOneNode((PSDevice)pDevice, &uNodeIndex);
239 memcpy(pMgmt->sNodeDBTable[uNodeIndex].abyMACAddr, param->sta_addr, WLAN_ADDR_LEN);
240 pMgmt->sNodeDBTable[uNodeIndex].eNodeState = NODE_ASSOC;
241 pMgmt->sNodeDBTable[uNodeIndex].wCapInfo = param->u.add_sta.capability;
242 // TODO listenInterval
243 pMgmt->sNodeDBTable[uNodeIndex].bPSEnable = false;
244 pMgmt->sNodeDBTable[uNodeIndex].bySuppRate = param->u.add_sta.tx_supp_rates;
247 pMgmt->sNodeDBTable[uNodeIndex].wTxDataRate =
248 pMgmt->sNodeDBTable[uNodeIndex].wMaxSuppRate;
249 // set max basic rate
250 pMgmt->sNodeDBTable[uNodeIndex].wMaxBasicRate = RATE_2M;
251 // Todo: check sta preamble, if ap can't support, set status code
252 pMgmt->sNodeDBTable[uNodeIndex].bShortPreamble =
253 WLAN_GET_CAP_INFO_SHORTPREAMBLE(pMgmt->sNodeDBTable[uNodeIndex].wCapInfo);
255 pMgmt->sNodeDBTable[uNodeIndex].wAID = (unsigned short)param->u.add_sta.aid;
257 pMgmt->sNodeDBTable[uNodeIndex].ulLastRxJiffer = jiffies;
259 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Add STA AID= %d\n", pMgmt->sNodeDBTable[uNodeIndex].wAID);
260 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "MAC=%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
268 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Max Support rate = %d\n",
269 pMgmt->sNodeDBTable[uNodeIndex].wMaxSuppRate);
288 static int hostap_get_info_sta(PSDevice pDevice,
289 struct viawget_hostapd_param *param)
291 PSMgmtObject pMgmt = pDevice->pMgmt;
292 unsigned int uNodeIndex;
294 if (BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &uNodeIndex)) {
295 param->u.get_info_sta.inactive_sec =
296 (jiffies - pMgmt->sNodeDBTable[uNodeIndex].ulLastRxJiffer) / HZ;
317 static int hostap_set_flags_sta(PSDevice pDevice,
318 struct viawget_hostapd_param *param)
320 PSMgmtObject pMgmt = pDevice->pMgmt;
321 unsigned int uNodeIndex;
323 if (BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &uNodeIndex)) {
324 pMgmt->sNodeDBTable[uNodeIndex].dwFlags |= param->u.set_flags_sta.flags_or;
325 pMgmt->sNodeDBTable[uNodeIndex].dwFlags &= param->u.set_flags_sta.flags_and;
326 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " dwFlags = %x\n",
327 (unsigned int)pMgmt->sNodeDBTable[uNodeIndex].dwFlags);
337 * set generic element (wpa ie)
348 static int hostap_set_generic_element(PSDevice pDevice,
349 struct viawget_hostapd_param *param)
351 PSMgmtObject pMgmt = pDevice->pMgmt;
353 memcpy(pMgmt->abyWPAIE,
354 param->u.generic_elem.data,
355 param->u.generic_elem.len
358 pMgmt->wWPAIELen = param->u.generic_elem.len;
360 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pMgmt->wWPAIELen = %d\n", pMgmt->wWPAIELen);
363 if (pMgmt->wWPAIELen == 0) {
364 pMgmt->eAuthenMode = WMAC_AUTH_OPEN;
365 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " No WPAIE, Disable WPA\n");
368 if ((pMgmt->abyWPAIE[0] == WLAN_EID_RSN_WPA) ||
369 (pMgmt->abyWPAIE[0] == WLAN_EID_RSN)) {
370 pMgmt->eAuthenMode = WMAC_AUTH_WPANONE;
371 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Set WPAIE enable WPA\n");
381 * flush station nodes table.
392 static void hostap_flush_sta(PSDevice pDevice)
394 // reserved node index =0 for multicast node.
395 BSSvClearNodeDBTable(pDevice, 1);
396 pDevice->uAssocCount = 0;
401 * set each stations encryption key
412 static int hostap_set_encryption(PSDevice pDevice,
413 struct viawget_hostapd_param *param,
416 PSMgmtObject pMgmt = pDevice->pMgmt;
417 unsigned long dwKeyIndex = 0;
418 unsigned char abyKey[MAX_KEY_LEN];
419 unsigned char abySeq[MAX_KEY_LEN];
420 unsigned long long KeyRSC;
421 unsigned char byKeyDecMode = KEY_CTL_WEP;
424 bool bKeyTableFull = false;
425 unsigned short wKeyCtl = 0;
427 param->u.crypt.err = 0;
429 if (param->u.crypt.alg > WPA_ALG_CCMP)
432 if ((param->u.crypt.idx > 3) || (param->u.crypt.key_len > MAX_KEY_LEN)) {
433 param->u.crypt.err = HOSTAP_CRYPT_ERR_KEY_SET_FAILED;
434 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " HOSTAP_CRYPT_ERR_KEY_SET_FAILED\n");
438 if (is_broadcast_ether_addr(param->sta_addr)) {
439 if (param->u.crypt.idx >= MAX_GROUP_KEY)
444 if (BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &iNodeIndex) == false) {
445 param->u.crypt.err = HOSTAP_CRYPT_ERR_UNKNOWN_ADDR;
446 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " HOSTAP_CRYPT_ERR_UNKNOWN_ADDR\n");
450 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " hostap_set_encryption: sta_index %d\n", iNodeIndex);
451 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " hostap_set_encryption: alg %d\n", param->u.crypt.alg);
453 if (param->u.crypt.alg == WPA_ALG_NONE) {
454 if (pMgmt->sNodeDBTable[iNodeIndex].bOnFly) {
455 if (!KeybRemoveKey(&(pDevice->sKey),
457 pMgmt->sNodeDBTable[iNodeIndex].dwKeyIndex,
458 pDevice->PortOffset)) {
459 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybRemoveKey fail\n");
461 pMgmt->sNodeDBTable[iNodeIndex].bOnFly = false;
463 pMgmt->sNodeDBTable[iNodeIndex].byKeyIndex = 0;
464 pMgmt->sNodeDBTable[iNodeIndex].dwKeyIndex = 0;
465 pMgmt->sNodeDBTable[iNodeIndex].uWepKeyLength = 0;
466 pMgmt->sNodeDBTable[iNodeIndex].KeyRSC = 0;
467 pMgmt->sNodeDBTable[iNodeIndex].dwTSC47_16 = 0;
468 pMgmt->sNodeDBTable[iNodeIndex].wTSC15_0 = 0;
469 pMgmt->sNodeDBTable[iNodeIndex].byCipherSuite = 0;
470 memset(&pMgmt->sNodeDBTable[iNodeIndex].abyWepKey[0],
478 memcpy(abyKey, param->u.crypt.key, param->u.crypt.key_len);
479 // copy to node key tbl
480 pMgmt->sNodeDBTable[iNodeIndex].byKeyIndex = param->u.crypt.idx;
481 pMgmt->sNodeDBTable[iNodeIndex].uWepKeyLength = param->u.crypt.key_len;
482 memcpy(&pMgmt->sNodeDBTable[iNodeIndex].abyWepKey[0],
484 param->u.crypt.key_len
487 dwKeyIndex = (unsigned long)(param->u.crypt.idx);
488 if (param->u.crypt.flags & HOSTAP_CRYPT_FLAG_SET_TX_KEY) {
489 pDevice->byKeyIndex = (unsigned char)dwKeyIndex;
490 pDevice->bTransmitKey = true;
491 dwKeyIndex |= (1 << 31);
494 if (param->u.crypt.alg == WPA_ALG_WEP) {
495 if ((pDevice->bEnable8021x == false) || (iNodeIndex == 0)) {
496 KeybSetDefaultKey(&(pDevice->sKey),
497 dwKeyIndex & ~(BIT30 | USE_KEYRSC),
498 param->u.crypt.key_len,
506 // 8021x enable, individual key
507 dwKeyIndex |= (1 << 30); // set pairwise key
508 if (KeybSetKey(&(pDevice->sKey),
510 dwKeyIndex & ~(USE_KEYRSC),
511 param->u.crypt.key_len,
513 (unsigned char *)abyKey,
516 pDevice->byLocalID)) {
517 pMgmt->sNodeDBTable[iNodeIndex].bOnFly = true;
521 pMgmt->sNodeDBTable[iNodeIndex].bOnFly = false;
522 bKeyTableFull = true;
525 pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled;
526 pDevice->bEncryptionEnable = true;
527 pMgmt->byCSSPK = KEY_CTL_WEP;
528 pMgmt->byCSSGK = KEY_CTL_WEP;
529 pMgmt->sNodeDBTable[iNodeIndex].byCipherSuite = KEY_CTL_WEP;
530 pMgmt->sNodeDBTable[iNodeIndex].dwKeyIndex = dwKeyIndex;
534 if (param->u.crypt.seq) {
535 memcpy(&abySeq, param->u.crypt.seq, 8);
536 for (ii = 0; ii < 8; ii++)
537 KeyRSC |= (unsigned long)abySeq[ii] << (ii * 8);
539 dwKeyIndex |= 1 << 29;
540 pMgmt->sNodeDBTable[iNodeIndex].KeyRSC = KeyRSC;
543 if (param->u.crypt.alg == WPA_ALG_TKIP) {
544 if (param->u.crypt.key_len != MAX_KEY_LEN)
546 pDevice->eEncryptionStatus = Ndis802_11Encryption2Enabled;
547 byKeyDecMode = KEY_CTL_TKIP;
548 pMgmt->byCSSPK = KEY_CTL_TKIP;
549 pMgmt->byCSSGK = KEY_CTL_TKIP;
552 if (param->u.crypt.alg == WPA_ALG_CCMP) {
553 if ((param->u.crypt.key_len != AES_KEY_LEN) ||
554 (pDevice->byLocalID <= REV_ID_VT3253_A1))
556 pDevice->eEncryptionStatus = Ndis802_11Encryption3Enabled;
557 byKeyDecMode = KEY_CTL_CCMP;
558 pMgmt->byCSSPK = KEY_CTL_CCMP;
559 pMgmt->byCSSGK = KEY_CTL_CCMP;
562 if (iNodeIndex == 0) {
563 KeybSetDefaultKey(&(pDevice->sKey),
565 param->u.crypt.key_len,
571 pMgmt->sNodeDBTable[iNodeIndex].bOnFly = true;
574 dwKeyIndex |= (1 << 30); // set pairwise key
575 if (KeybSetKey(&(pDevice->sKey),
578 param->u.crypt.key_len,
580 (unsigned char *)abyKey,
583 pDevice->byLocalID)) {
584 pMgmt->sNodeDBTable[iNodeIndex].bOnFly = true;
588 pMgmt->sNodeDBTable[iNodeIndex].bOnFly = false;
589 bKeyTableFull = true;
590 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " Key Table Full\n");
596 wKeyCtl &= 0x7F00; // clear all key control filed
597 wKeyCtl |= (byKeyDecMode << 4);
598 wKeyCtl |= (byKeyDecMode);
599 wKeyCtl |= 0x0044; // use group key for all address
600 wKeyCtl |= 0x4000; // disable KeyTable[MAX_KEY_TABLE-1] on-fly to genernate rx int
601 MACvSetDefaultKeyCtl(pDevice->PortOffset, wKeyCtl, MAX_KEY_TABLE-1, pDevice->byLocalID);
604 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " Set key sta_index= %d\n", iNodeIndex);
605 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " tx_index=%d len=%d\n", param->u.crypt.idx,
606 param->u.crypt.key_len);
607 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " key=%x-%x-%x-%x-%x-xxxxx\n",
608 pMgmt->sNodeDBTable[iNodeIndex].abyWepKey[0],
609 pMgmt->sNodeDBTable[iNodeIndex].abyWepKey[1],
610 pMgmt->sNodeDBTable[iNodeIndex].abyWepKey[2],
611 pMgmt->sNodeDBTable[iNodeIndex].abyWepKey[3],
612 pMgmt->sNodeDBTable[iNodeIndex].abyWepKey[4]
616 pDevice->bEncryptionEnable = true;
617 pMgmt->sNodeDBTable[iNodeIndex].byCipherSuite = byKeyDecMode;
618 pMgmt->sNodeDBTable[iNodeIndex].dwKeyIndex = dwKeyIndex;
619 pMgmt->sNodeDBTable[iNodeIndex].dwTSC47_16 = 0;
620 pMgmt->sNodeDBTable[iNodeIndex].wTSC15_0 = 0;
627 * get each stations encryption key
638 static int hostap_get_encryption(PSDevice pDevice,
639 struct viawget_hostapd_param *param,
642 PSMgmtObject pMgmt = pDevice->pMgmt;
646 param->u.crypt.err = 0;
648 if (is_broadcast_ether_addr(param->sta_addr)) {
651 if (BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &iNodeIndex) == false) {
652 param->u.crypt.err = HOSTAP_CRYPT_ERR_UNKNOWN_ADDR;
653 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "hostap_get_encryption: HOSTAP_CRYPT_ERR_UNKNOWN_ADDR\n");
657 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "hostap_get_encryption: %d\n", iNodeIndex);
658 memset(param->u.crypt.seq, 0, 8);
659 for (ii = 0; ii < 8; ii++)
660 param->u.crypt.seq[ii] = (unsigned char)pMgmt->sNodeDBTable[iNodeIndex].KeyRSC >> (ii * 8);
667 * vt6655_hostap_ioctl main function supported for hostap deamon.
678 int vt6655_hostap_ioctl(PSDevice pDevice, struct iw_point *p)
680 struct viawget_hostapd_param *param;
684 if (p->length < sizeof(struct viawget_hostapd_param) ||
685 p->length > VIAWGET_HOSTAPD_MAX_BUF_SIZE || !p->pointer)
688 param = kmalloc((int)p->length, GFP_KERNEL);
692 if (copy_from_user(param, p->pointer, p->length)) {
697 switch (param->cmd) {
698 case VIAWGET_HOSTAPD_SET_ENCRYPTION:
699 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_SET_ENCRYPTION\n");
700 spin_lock_irq(&pDevice->lock);
701 ret = hostap_set_encryption(pDevice, param, p->length);
702 spin_unlock_irq(&pDevice->lock);
704 case VIAWGET_HOSTAPD_GET_ENCRYPTION:
705 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_GET_ENCRYPTION\n");
706 spin_lock_irq(&pDevice->lock);
707 ret = hostap_get_encryption(pDevice, param, p->length);
708 spin_unlock_irq(&pDevice->lock);
710 case VIAWGET_HOSTAPD_SET_ASSOC_AP_ADDR:
711 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_SET_ASSOC_AP_ADDR\n");
714 case VIAWGET_HOSTAPD_FLUSH:
715 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_FLUSH\n");
716 spin_lock_irq(&pDevice->lock);
717 hostap_flush_sta(pDevice);
718 spin_unlock_irq(&pDevice->lock);
720 case VIAWGET_HOSTAPD_ADD_STA:
721 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_ADD_STA\n");
722 spin_lock_irq(&pDevice->lock);
723 ret = hostap_add_sta(pDevice, param);
724 spin_unlock_irq(&pDevice->lock);
726 case VIAWGET_HOSTAPD_REMOVE_STA:
727 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_REMOVE_STA\n");
728 spin_lock_irq(&pDevice->lock);
729 ret = hostap_remove_sta(pDevice, param);
730 spin_unlock_irq(&pDevice->lock);
732 case VIAWGET_HOSTAPD_GET_INFO_STA:
733 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_GET_INFO_STA\n");
734 ret = hostap_get_info_sta(pDevice, param);
737 case VIAWGET_HOSTAPD_SET_FLAGS_STA:
738 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_SET_FLAGS_STA\n");
739 ret = hostap_set_flags_sta(pDevice, param);
741 case VIAWGET_HOSTAPD_MLME:
742 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_MLME\n");
745 case VIAWGET_HOSTAPD_SET_GENERIC_ELEMENT:
746 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_SET_GENERIC_ELEMENT\n");
747 ret = hostap_set_generic_element(pDevice, param);
749 case VIAWGET_HOSTAPD_SCAN_REQ:
750 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_SCAN_REQ\n");
753 case VIAWGET_HOSTAPD_STA_CLEAR_STATS:
754 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_STA_CLEAR_STATS\n");
758 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "vt6655_hostap_ioctl: unknown cmd=%d\n",
764 if ((ret == 0) && ap_ioctl) {
765 if (copy_to_user(p->pointer, param, p->length))