summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/libertas/debugfs.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2007-05-26 00:15:56 +0400
committerJohn W. Linville <linville@tuxdriver.com>2007-06-11 22:28:41 +0400
commitfcdb53dbc743f288bf72e485fefb3a967b733686 (patch)
treeceafcff8076af2da654214e3b72caa7b15164a28 /drivers/net/wireless/libertas/debugfs.c
parent90e8eafc93ed159846bb7126af8502f2a8570a11 (diff)
downloadlinux-fcdb53dbc743f288bf72e485fefb3a967b733686.tar.xz
[PATCH] libertas: make scan result handling more flexible
- use a linked list for scan results - age scan results - pass bss_descriptors around instead of indexes into the scan table - lock access to the scan results - stop returning EAGAIN from SIOCGIWSCAN handler Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/debugfs.c')
-rw-r--r--drivers/net/wireless/libertas/debugfs.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index aa11e0a6cae8..c26227adf897 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -63,35 +63,34 @@ static ssize_t libertas_getscantable(struct file *file, char __user *userbuf,
int numscansdone = 0, res;
unsigned long addr = get_zeroed_page(GFP_KERNEL);
char *buf = (char *)addr;
+ struct bss_descriptor * iter_bss;
pos += snprintf(buf+pos, len-pos,
"# | ch | ss | bssid | cap | TSF | Qual | SSID \n");
- while (numscansdone < priv->adapter->numinscantable) {
- struct bss_descriptor *pbssinfo;
+ mutex_lock(&priv->adapter->lock);
+ list_for_each_entry (iter_bss, &priv->adapter->network_list, list) {
u16 cap;
- pbssinfo = &priv->adapter->scantable[numscansdone];
- memcpy(&cap, &pbssinfo->cap, sizeof(cap));
+ memcpy(&cap, &iter_bss->cap, sizeof(cap));
pos += snprintf(buf+pos, len-pos,
"%02u| %03d | %03ld | %02x:%02x:%02x:%02x:%02x:%02x |",
- numscansdone, pbssinfo->channel, pbssinfo->rssi,
- pbssinfo->bssid[0], pbssinfo->bssid[1],
- pbssinfo->bssid[2], pbssinfo->bssid[3],
- pbssinfo->bssid[4], pbssinfo->bssid[5]);
+ numscansdone, iter_bss->channel, iter_bss->rssi,
+ iter_bss->bssid[0], iter_bss->bssid[1],
+ iter_bss->bssid[2], iter_bss->bssid[3],
+ iter_bss->bssid[4], iter_bss->bssid[5]);
pos += snprintf(buf+pos, len-pos, " %04x-", cap);
pos += snprintf(buf+pos, len-pos, "%c%c%c |",
- pbssinfo->cap.ibss ? 'A' : 'I',
- pbssinfo->cap.privacy ? 'P' : ' ',
- pbssinfo->cap.spectrummgmt ? 'S' : ' ');
- pos += snprintf(buf+pos, len-pos, " %08llx |", pbssinfo->networktsf);
- pos += snprintf(buf+pos, len-pos, " %d |",
- SCAN_RSSI(priv->adapter->scantable[numscansdone].rssi));
-
- pos += snprintf(buf+pos, len-pos, " %s\n", pbssinfo->ssid.ssid);
+ iter_bss->cap.ibss ? 'A' : 'I',
+ iter_bss->cap.privacy ? 'P' : ' ',
+ iter_bss->cap.spectrummgmt ? 'S' : ' ');
+ pos += snprintf(buf+pos, len-pos, " %08llx |", iter_bss->networktsf);
+ pos += snprintf(buf+pos, len-pos, " %d |", SCAN_RSSI(iter_bss->rssi));
+ pos += snprintf(buf+pos, len-pos, " %s\n", iter_bss->ssid.ssid);
numscansdone++;
}
+ mutex_unlock(&priv->adapter->lock);
res = simple_read_from_buffer(userbuf, count, ppos, buf, pos);