47 #define VIAWGET_WPA_MAX_BUF_SIZE 1024
49 static const int frequency_list[] = {
50 2412, 2417, 2422, 2427, 2432, 2437, 2442,
51 2447, 2452, 2457, 2462, 2467, 2472, 2484
88 static int wpa_init_wpadev(
PSDevice pDevice)
98 wpadev_priv = netdev_priv(pDevice->
wpadev);
99 *wpadev_priv = *pDevice;
137 static int wpa_release_wpadev(
PSDevice pDevice)
140 dev_kfree_skb(pDevice->
skb);
146 pDevice->
dev->name, pDevice->
wpadev->name);
171 return wpa_init_wpadev(pDevice);
172 return wpa_release_wpadev(pDevice);
192 DWORD dwKeyIndex = 0;
220 spin_unlock_irq(&pDevice->
lock);
221 if (param->
u.
wpa_key.key && fcpfkernel) {
227 spin_lock_irq(&pDevice->
lock);
231 spin_lock_irq(&pDevice->
lock);
236 if (dwKeyIndex > 3) {
242 dwKeyIndex |= (1 << 31);
263 spin_unlock_irq(&pDevice->
lock);
264 if (param->
u.
wpa_key.seq && fcpfkernel) {
270 spin_lock_irq(&pDevice->
lock);
274 spin_lock_irq(&pDevice->
lock);
277 for (ii = 0 ; ii < param->
u.
wpa_key.seq_len ; ii++) {
279 LODWORD(KeyRSC) |= (abySeq[ii] << (ii * 8));
281 HIDWORD(KeyRSC) |= (abySeq[ii] << ((ii-4) * 8));
283 dwKeyIndex |= 1 << 29;
300 dwKeyIndex |= (1 << 31);
340 if (is_broadcast_ether_addr(¶m->
addr[0]) || (param->
addr ==
NULL)) {
370 dwKeyIndex |= (1 << 30);
376 dwKeyIndex, param->
u.
wpa_key.key_len,
382 if (!compare_ether_addr(¶m->
addr[0], pDevice->
abyBSSID)) {
392 if ((ret == 0) && ((param->
u.
wpa_key.set_tx) != 0)) {
444 spin_lock_irq(&pDevice->
lock);
449 spin_unlock_irq(&pDevice->
lock);
474 printk(
"wpa_set_scan-->desired [ssid=%s,ssid_len=%d]\n",
481 pItemSSID->len = param->
u.
scan_req.ssid_len;
483 spin_lock_irq(&pDevice->
lock);
487 spin_unlock_irq(&pDevice->
lock);
572 if (ptempBSS ==
NULL) {
573 printk(
"bubble sort kmalloc memory fail@@@\n");
579 for (jj = 0; jj < MAX_BSS_NUM - ii - 1; jj++) {
616 memcpy(scan_buf->
ssid, pItemSSID->abySSID, pItemSSID->len);
617 scan_buf->
ssid_len = pItemSSID->len;
618 scan_buf->
freq = frequency_list[pBSS->uChannel-1];
619 scan_buf->
caps = pBSS->wCapInfo;
623 scan_buf->
qual = 100;
627 scan_buf->
qual=(40-(-ldBm-50))*100/40;
633 scan_buf->
level = ldBm;
636 if (pBSS->wWPALen != 0) {
640 if (pBSS->wRSNLen != 0) {
679 BYTE abyNullAddr[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
763 if(bwepEnabled==
TRUE) {
785 spin_lock_irq(&pDevice->
lock);
790 netif_stop_queue(pDevice->
dev);
802 printk(
"wpa_set_associate---->hidden mode site survey before associate.......\n");
811 spin_unlock_irq(&pDevice->
lock);
848 switch (param->
cmd) {
850 ret = wpa_set_wpa(pDevice, param);
856 spin_lock_irq(&pDevice->
lock);
858 spin_unlock_irq(&pDevice->
lock);
863 ret = wpa_set_scan(pDevice, param);
868 ret = wpa_get_scan(pDevice, param);
874 ret = wpa_get_ssid(pDevice, param);
880 ret = wpa_get_bssid(pDevice, param);
886 ret = wpa_set_associate(pDevice, param);
891 ret = wpa_set_disassociate(pDevice, param);
909 if ((ret == 0) && wpa_ioctl) {