42 #define VIAWGET_HOSTAPD_MAX_BUF_SIZE 1024
43 #define HOSTAP_CRYPT_FLAG_SET_TX_KEY BIT0
44 #define HOSTAP_CRYPT_ERR_UNKNOWN_ADDR 3
45 #define HOSTAP_CRYPT_ERR_KEY_SET_FAILED 5
63 static int hostap_enable_hostapd(
PSDevice pDevice,
int rtnl_locked)
75 if (pDevice->apdev ==
NULL)
78 apdev_priv = netdev_priv(pDevice->apdev);
79 *apdev_priv = *pDevice;
82 pDevice->apdev->netdev_ops = &apdev_netdev_ops;
86 pDevice->apdev->base_addr = dev->
base_addr;
87 pDevice->apdev->irq = dev->
irq;
88 pDevice->apdev->mem_start = dev->
mem_start;
89 pDevice->apdev->mem_end = dev->
mem_end;
102 dev->
name, pDevice->apdev->name);
123 static int hostap_disable_hostapd(
PSDevice pDevice,
int rtnl_locked)
128 if (pDevice->apdev && pDevice->apdev->name && pDevice->apdev->name[0]) {
130 unregister_netdevice(pDevice->apdev);
134 pDevice->
dev->name, pDevice->apdev->name);
136 kfree(pDevice->apdev);
137 pDevice->apdev =
NULL;
138 pDevice->bEnable8021x =
FALSE;
139 pDevice->bEnableHostWEP =
FALSE;
162 if (val < 0 || val > 1)
165 if (pDevice->bEnableHostapd == val)
168 pDevice->bEnableHostapd =
val;
171 return hostap_enable_hostapd(pDevice, rtnl_locked);
173 return hostap_disable_hostapd(pDevice, rtnl_locked);
190 static int hostap_remove_sta(
PSDevice pDevice,
193 unsigned int uNodeIndex;
222 unsigned int uNodeIndex;
278 static int hostap_get_info_sta(
PSDevice pDevice,
282 unsigned int uNodeIndex;
311 static int hostap_set_flags_sta(
PSDevice pDevice,
315 unsigned int uNodeIndex;
345 static int hostap_set_generic_element(
PSDevice pDevice,
391 static void hostap_flush_sta(
PSDevice pDevice)
418 DWORD dwKeyIndex = 0;
442 if (is_broadcast_ether_addr(param->
sta_addr)) {
497 dwKeyIndex |= (1 << 31);
502 if ((pDevice->bEnable8021x ==
FALSE) || (iNodeIndex == 0)) {
514 dwKeyIndex |= (1 << 30);
531 bKeyTableFull =
TRUE;
545 for (ii = 0 ; ii < 8 ; ii++) {
546 KeyRSC |= (abySeq[ii] << (ii * 8));
548 dwKeyIndex |= 1 << 29;
572 if (iNodeIndex == 0) {
584 dwKeyIndex |= (1 << 30);
600 bKeyTableFull =
TRUE;
606 if (bKeyTableFull ==
TRUE) {
608 wKeyCtl |= (byKeyDecMode << 4);
609 wKeyCtl |= (byKeyDecMode);
652 static int hostap_get_encryption(
PSDevice pDevice,
664 if (is_broadcast_ether_addr(param->
sta_addr)) {
675 for (ii = 0 ; ii < 8 ; ii++) {
716 switch (param->
cmd) {
719 spin_lock_irq(&pDevice->
lock);
721 spin_unlock_irq(&pDevice->
lock);
725 spin_lock_irq(&pDevice->
lock);
726 ret = hostap_get_encryption(pDevice, param, p->
length);
727 spin_unlock_irq(&pDevice->
lock);
735 spin_lock_irq(&pDevice->
lock);
736 hostap_flush_sta(pDevice);
737 spin_unlock_irq(&pDevice->
lock);
741 spin_lock_irq(&pDevice->
lock);
743 spin_unlock_irq(&pDevice->
lock);
747 spin_lock_irq(&pDevice->
lock);
748 ret = hostap_remove_sta(pDevice, param);
749 spin_unlock_irq(&pDevice->
lock);
753 ret = hostap_get_info_sta(pDevice, param);
758 ret = hostap_set_flags_sta(pDevice, param);
767 ret = hostap_set_generic_element(pDevice, param);
786 if ((ret == 0) && ap_ioctl) {