X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fnet%2Fwireless%2Fhostap%2Fhostap_proc.c;h=b03536008ad98df43218fe8a9aef9e7b05fb0fe2;hb=HEAD;hp=81b321ba189a1bd561ada1bbed543263f3c18de5;hpb=08cd84c81f27d5bd22ba958b7cae6d566c509280;p=linux-2.6 diff --git a/drivers/net/wireless/hostap/hostap_proc.c b/drivers/net/wireless/hostap/hostap_proc.c index 81b321ba18..b03536008a 100644 --- a/drivers/net/wireless/hostap/hostap_proc.c +++ b/drivers/net/wireless/hostap/hostap_proc.c @@ -1,5 +1,12 @@ /* /proc routines for Host AP driver */ +#include +#include +#include + +#include "hostap_wlan.h" +#include "hostap.h" + #define PROC_LIMIT (PAGE_SIZE - 80) @@ -99,6 +106,7 @@ static int prism2_wds_proc_read(char *page, char **start, off_t off, local_info_t *local = (local_info_t *) data; struct list_head *ptr; struct hostap_interface *iface; + DECLARE_MAC_BUF(mac); if (off > PROC_LIMIT) { *eof = 1; @@ -110,9 +118,9 @@ static int prism2_wds_proc_read(char *page, char **start, off_t off, iface = list_entry(ptr, struct hostap_interface, list); if (iface->type != HOSTAP_INTERFACE_WDS) continue; - p += sprintf(p, "%s\t" MACSTR "\n", + p += sprintf(p, "%s\t%s\n", iface->dev->name, - MAC2STR(iface->u.wds.remote_addr)); + print_mac(mac, iface->u.wds.remote_addr)); if ((p - page) > PROC_LIMIT) { printk(KERN_DEBUG "%s: wds proc did not fit\n", local->dev->name); @@ -140,6 +148,7 @@ static int prism2_bss_list_proc_read(char *page, char **start, off_t off, struct list_head *ptr; struct hostap_bss_info *bss; int i; + DECLARE_MAC_BUF(mac); if (off > PROC_LIMIT) { *eof = 1; @@ -151,8 +160,8 @@ static int prism2_bss_list_proc_read(char *page, char **start, off_t off, spin_lock_bh(&local->lock); list_for_each(ptr, &local->bss_list) { bss = list_entry(ptr, struct hostap_bss_info, list); - p += sprintf(p, MACSTR "\t%lu\t%u\t0x%x\t", - MAC2STR(bss->bssid), bss->last_update, + p += sprintf(p, "%s\t%lu\t%u\t0x%x\t", + print_mac(mac, bss->bssid), bss->last_update, bss->count, bss->capab_info); for (i = 0; i < bss->ssid_len; i++) { p += sprintf(p, "%c", @@ -302,20 +311,16 @@ static int prism2_scan_results_proc_read(char *page, char **start, off_t off, { char *p = page; local_info_t *local = (local_info_t *) data; - int entries, entry, i, len, total = 0, hostscan; - struct hfa384x_scan_result *scanres; - struct hfa384x_hostscan_result *hscanres; + int entry, i, len, total = 0; + struct hfa384x_hostscan_result *scanres; u8 *pos; + DECLARE_MAC_BUF(mac); p += sprintf(p, "CHID ANL SL BcnInt Capab Rate BSSID ATIM SupRates " "SSID\n"); spin_lock_bh(&local->lock); - hostscan = local->last_scan_type == PRISM2_HOSTSCAN; - entries = hostscan ? local->last_hostscan_results_count : - local->last_scan_results_count; - for (entry = 0; entry < entries; entry++) { - hscanres = &local->last_hostscan_results[entry]; + for (entry = 0; entry < local->last_scan_results_count; entry++) { scanres = &local->last_scan_results[entry]; if (total + (p - page) <= off) { @@ -327,39 +332,26 @@ static int prism2_scan_results_proc_read(char *page, char **start, off_t off, if ((p - page) > (PAGE_SIZE - 200)) break; - if (hostscan) { - p += sprintf(p, "%d %d %d %d 0x%02x %d " MACSTR " %d ", - le16_to_cpu(hscanres->chid), - (s16) le16_to_cpu(hscanres->anl), - (s16) le16_to_cpu(hscanres->sl), - le16_to_cpu(hscanres->beacon_interval), - le16_to_cpu(hscanres->capability), - le16_to_cpu(hscanres->rate), - MAC2STR(hscanres->bssid), - le16_to_cpu(hscanres->atim)); - } else { - p += sprintf(p, "%d %d %d %d 0x%02x %d " MACSTR - " N/A ", - le16_to_cpu(scanres->chid), - (s16) le16_to_cpu(scanres->anl), - (s16) le16_to_cpu(scanres->sl), - le16_to_cpu(scanres->beacon_interval), - le16_to_cpu(scanres->capability), - le16_to_cpu(scanres->rate), - MAC2STR(scanres->bssid)); - } - - pos = hostscan ? hscanres->sup_rates : scanres->sup_rates; - for (i = 0; i < sizeof(hscanres->sup_rates); i++) { + p += sprintf(p, "%d %d %d %d 0x%02x %d %s %d ", + le16_to_cpu(scanres->chid), + (s16) le16_to_cpu(scanres->anl), + (s16) le16_to_cpu(scanres->sl), + le16_to_cpu(scanres->beacon_interval), + le16_to_cpu(scanres->capability), + le16_to_cpu(scanres->rate), + print_mac(mac, scanres->bssid), + le16_to_cpu(scanres->atim)); + + pos = scanres->sup_rates; + for (i = 0; i < sizeof(scanres->sup_rates); i++) { if (pos[i] == 0) break; p += sprintf(p, "<%02x>", pos[i]); } p += sprintf(p, " "); - pos = hostscan ? hscanres->ssid : scanres->ssid; - len = le16_to_cpu(hostscan ? hscanres->ssid_len : - scanres->ssid_len); + pos = scanres->ssid; + len = le16_to_cpu(scanres->ssid_len); if (len > 32) len = 32; for (i = 0; i < len; i++) {