diff options
author | David S. Miller <davem@davemloft.net> | 2008-06-29 01:57:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-06-29 01:57:58 -0400 |
commit | 28f49d8fec19833672a6a813bfde0068fee50bc9 (patch) | |
tree | 6905c5cabc063e44b891ae0af5b5d7cce69e6e71 /drivers/net/wireless/prism54 | |
parent | 332e4af80d1214fbf0e263e1408fc7c5b64ecdd6 (diff) | |
parent | ff28bd94e307c67abb1bccda5d3a9018bd798e08 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'drivers/net/wireless/prism54')
-rw-r--r-- | drivers/net/wireless/prism54/isl_ioctl.c | 49 |
1 files changed, 27 insertions, 22 deletions
diff --git a/drivers/net/wireless/prism54/isl_ioctl.c b/drivers/net/wireless/prism54/isl_ioctl.c index 5b375b289036..97fa14e0a479 100644 --- a/drivers/net/wireless/prism54/isl_ioctl.c +++ b/drivers/net/wireless/prism54/isl_ioctl.c | |||
@@ -571,8 +571,9 @@ prism54_set_scan(struct net_device *dev, struct iw_request_info *info, | |||
571 | */ | 571 | */ |
572 | 572 | ||
573 | static char * | 573 | static char * |
574 | prism54_translate_bss(struct net_device *ndev, char *current_ev, | 574 | prism54_translate_bss(struct net_device *ndev, struct iw_request_info *info, |
575 | char *end_buf, struct obj_bss *bss, char noise) | 575 | char *current_ev, char *end_buf, struct obj_bss *bss, |
576 | char noise) | ||
576 | { | 577 | { |
577 | struct iw_event iwe; /* Temporary buffer */ | 578 | struct iw_event iwe; /* Temporary buffer */ |
578 | short cap; | 579 | short cap; |
@@ -584,8 +585,8 @@ prism54_translate_bss(struct net_device *ndev, char *current_ev, | |||
584 | memcpy(iwe.u.ap_addr.sa_data, bss->address, 6); | 585 | memcpy(iwe.u.ap_addr.sa_data, bss->address, 6); |
585 | iwe.u.ap_addr.sa_family = ARPHRD_ETHER; | 586 | iwe.u.ap_addr.sa_family = ARPHRD_ETHER; |
586 | iwe.cmd = SIOCGIWAP; | 587 | iwe.cmd = SIOCGIWAP; |
587 | current_ev = | 588 | current_ev = iwe_stream_add_event(info, current_ev, end_buf, |
588 | iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_ADDR_LEN); | 589 | &iwe, IW_EV_ADDR_LEN); |
589 | 590 | ||
590 | /* The following entries will be displayed in the same order we give them */ | 591 | /* The following entries will be displayed in the same order we give them */ |
591 | 592 | ||
@@ -593,7 +594,7 @@ prism54_translate_bss(struct net_device *ndev, char *current_ev, | |||
593 | iwe.u.data.length = bss->ssid.length; | 594 | iwe.u.data.length = bss->ssid.length; |
594 | iwe.u.data.flags = 1; | 595 | iwe.u.data.flags = 1; |
595 | iwe.cmd = SIOCGIWESSID; | 596 | iwe.cmd = SIOCGIWESSID; |
596 | current_ev = iwe_stream_add_point(current_ev, end_buf, | 597 | current_ev = iwe_stream_add_point(info, current_ev, end_buf, |
597 | &iwe, bss->ssid.octets); | 598 | &iwe, bss->ssid.octets); |
598 | 599 | ||
599 | /* Capabilities */ | 600 | /* Capabilities */ |
@@ -610,9 +611,8 @@ prism54_translate_bss(struct net_device *ndev, char *current_ev, | |||
610 | iwe.u.mode = IW_MODE_ADHOC; | 611 | iwe.u.mode = IW_MODE_ADHOC; |
611 | iwe.cmd = SIOCGIWMODE; | 612 | iwe.cmd = SIOCGIWMODE; |
612 | if (iwe.u.mode) | 613 | if (iwe.u.mode) |
613 | current_ev = | 614 | current_ev = iwe_stream_add_event(info, current_ev, end_buf, |
614 | iwe_stream_add_event(current_ev, end_buf, &iwe, | 615 | &iwe, IW_EV_UINT_LEN); |
615 | IW_EV_UINT_LEN); | ||
616 | 616 | ||
617 | /* Encryption capability */ | 617 | /* Encryption capability */ |
618 | if (cap & CAP_CRYPT) | 618 | if (cap & CAP_CRYPT) |
@@ -621,14 +621,15 @@ prism54_translate_bss(struct net_device *ndev, char *current_ev, | |||
621 | iwe.u.data.flags = IW_ENCODE_DISABLED; | 621 | iwe.u.data.flags = IW_ENCODE_DISABLED; |
622 | iwe.u.data.length = 0; | 622 | iwe.u.data.length = 0; |
623 | iwe.cmd = SIOCGIWENCODE; | 623 | iwe.cmd = SIOCGIWENCODE; |
624 | current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, NULL); | 624 | current_ev = iwe_stream_add_point(info, current_ev, end_buf, |
625 | &iwe, NULL); | ||
625 | 626 | ||
626 | /* Add frequency. (short) bss->channel is the frequency in MHz */ | 627 | /* Add frequency. (short) bss->channel is the frequency in MHz */ |
627 | iwe.u.freq.m = bss->channel; | 628 | iwe.u.freq.m = bss->channel; |
628 | iwe.u.freq.e = 6; | 629 | iwe.u.freq.e = 6; |
629 | iwe.cmd = SIOCGIWFREQ; | 630 | iwe.cmd = SIOCGIWFREQ; |
630 | current_ev = | 631 | current_ev = iwe_stream_add_event(info, current_ev, end_buf, |
631 | iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_FREQ_LEN); | 632 | &iwe, IW_EV_FREQ_LEN); |
632 | 633 | ||
633 | /* Add quality statistics */ | 634 | /* Add quality statistics */ |
634 | iwe.u.qual.level = bss->rssi; | 635 | iwe.u.qual.level = bss->rssi; |
@@ -636,20 +637,20 @@ prism54_translate_bss(struct net_device *ndev, char *current_ev, | |||
636 | /* do a simple SNR for quality */ | 637 | /* do a simple SNR for quality */ |
637 | iwe.u.qual.qual = bss->rssi - noise; | 638 | iwe.u.qual.qual = bss->rssi - noise; |
638 | iwe.cmd = IWEVQUAL; | 639 | iwe.cmd = IWEVQUAL; |
639 | current_ev = | 640 | current_ev = iwe_stream_add_event(info, current_ev, end_buf, |
640 | iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_QUAL_LEN); | 641 | &iwe, IW_EV_QUAL_LEN); |
641 | 642 | ||
642 | /* Add WPA/RSN Information Element, if any */ | 643 | /* Add WPA/RSN Information Element, if any */ |
643 | wpa_ie_len = prism54_wpa_bss_ie_get(priv, bss->address, wpa_ie); | 644 | wpa_ie_len = prism54_wpa_bss_ie_get(priv, bss->address, wpa_ie); |
644 | if (wpa_ie_len > 0) { | 645 | if (wpa_ie_len > 0) { |
645 | iwe.cmd = IWEVGENIE; | 646 | iwe.cmd = IWEVGENIE; |
646 | iwe.u.data.length = min(wpa_ie_len, (size_t)MAX_WPA_IE_LEN); | 647 | iwe.u.data.length = min(wpa_ie_len, (size_t)MAX_WPA_IE_LEN); |
647 | current_ev = iwe_stream_add_point(current_ev, end_buf, | 648 | current_ev = iwe_stream_add_point(info, current_ev, end_buf, |
648 | &iwe, wpa_ie); | 649 | &iwe, wpa_ie); |
649 | } | 650 | } |
650 | /* Do the bitrates */ | 651 | /* Do the bitrates */ |
651 | { | 652 | { |
652 | char * current_val = current_ev + IW_EV_LCP_LEN; | 653 | char *current_val = current_ev + iwe_stream_lcp_len(info); |
653 | int i; | 654 | int i; |
654 | int mask; | 655 | int mask; |
655 | 656 | ||
@@ -662,14 +663,14 @@ prism54_translate_bss(struct net_device *ndev, char *current_ev, | |||
662 | for(i = 0; i < sizeof(scan_rate_list); i++) { | 663 | for(i = 0; i < sizeof(scan_rate_list); i++) { |
663 | if(bss->rates & mask) { | 664 | if(bss->rates & mask) { |
664 | iwe.u.bitrate.value = (scan_rate_list[i] * 500000); | 665 | iwe.u.bitrate.value = (scan_rate_list[i] * 500000); |
665 | current_val = iwe_stream_add_value(current_ev, current_val, | 666 | current_val = iwe_stream_add_value( |
666 | end_buf, &iwe, | 667 | info, current_ev, current_val, |
667 | IW_EV_PARAM_LEN); | 668 | end_buf, &iwe, IW_EV_PARAM_LEN); |
668 | } | 669 | } |
669 | mask <<= 1; | 670 | mask <<= 1; |
670 | } | 671 | } |
671 | /* Check if we added any event */ | 672 | /* Check if we added any event */ |
672 | if ((current_val - current_ev) > IW_EV_LCP_LEN) | 673 | if ((current_val - current_ev) > iwe_stream_lcp_len(info)) |
673 | current_ev = current_val; | 674 | current_ev = current_val; |
674 | } | 675 | } |
675 | 676 | ||
@@ -710,7 +711,7 @@ prism54_get_scan(struct net_device *ndev, struct iw_request_info *info, | |||
710 | 711 | ||
711 | /* ok now, scan the list and translate its info */ | 712 | /* ok now, scan the list and translate its info */ |
712 | for (i = 0; i < (int) bsslist->nr; i++) { | 713 | for (i = 0; i < (int) bsslist->nr; i++) { |
713 | current_ev = prism54_translate_bss(ndev, current_ev, | 714 | current_ev = prism54_translate_bss(ndev, info, current_ev, |
714 | extra + dwrq->length, | 715 | extra + dwrq->length, |
715 | &(bsslist->bsslist[i]), | 716 | &(bsslist->bsslist[i]), |
716 | noise); | 717 | noise); |
@@ -2704,6 +2705,7 @@ prism2_ioctl_scan_req(struct net_device *ndev, | |||
2704 | struct prism2_hostapd_param *param) | 2705 | struct prism2_hostapd_param *param) |
2705 | { | 2706 | { |
2706 | islpci_private *priv = netdev_priv(ndev); | 2707 | islpci_private *priv = netdev_priv(ndev); |
2708 | struct iw_request_info info; | ||
2707 | int i, rvalue; | 2709 | int i, rvalue; |
2708 | struct obj_bsslist *bsslist; | 2710 | struct obj_bsslist *bsslist; |
2709 | u32 noise = 0; | 2711 | u32 noise = 0; |
@@ -2727,9 +2729,12 @@ prism2_ioctl_scan_req(struct net_device *ndev, | |||
2727 | rvalue |= mgt_get_request(priv, DOT11_OID_BSSLIST, 0, NULL, &r); | 2729 | rvalue |= mgt_get_request(priv, DOT11_OID_BSSLIST, 0, NULL, &r); |
2728 | bsslist = r.ptr; | 2730 | bsslist = r.ptr; |
2729 | 2731 | ||
2732 | info.cmd = PRISM54_HOSTAPD; | ||
2733 | info.flags = 0; | ||
2734 | |||
2730 | /* ok now, scan the list and translate its info */ | 2735 | /* ok now, scan the list and translate its info */ |
2731 | for (i = 0; i < min(IW_MAX_AP, (int) bsslist->nr); i++) | 2736 | for (i = 0; i < min(IW_MAX_AP, (int) bsslist->nr); i++) |
2732 | current_ev = prism54_translate_bss(ndev, current_ev, | 2737 | current_ev = prism54_translate_bss(ndev, &info, current_ev, |
2733 | extra + IW_SCAN_MAX_DATA, | 2738 | extra + IW_SCAN_MAX_DATA, |
2734 | &(bsslist->bsslist[i]), | 2739 | &(bsslist->bsslist[i]), |
2735 | noise); | 2740 | noise); |