Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150428
b: refs/heads/master
c: 8705782
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed May 22, 2009
1 parent 63964ac commit 367a23f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9cef873798dfcdc10ff40b02abf1de935ceeba85
refs/heads/master: 87057825824973f29cf2f37cff1e549170b2d7e6
32 changes: 27 additions & 5 deletions trunk/net/wireless/wext.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,8 +636,10 @@ static void wireless_seq_printf_stats(struct seq_file *seq,
/*
* Print info for /proc/net/wireless (print all entries)
*/
static int wireless_seq_show(struct seq_file *seq, void *v)
static int wireless_dev_seq_show(struct seq_file *seq, void *v)
{
might_sleep();

if (v == SEQ_START_TOKEN)
seq_printf(seq, "Inter-| sta-| Quality | Discarded "
"packets | Missed | WE\n"
Expand All @@ -651,21 +653,41 @@ static int wireless_seq_show(struct seq_file *seq, void *v)

static void *wireless_dev_seq_start(struct seq_file *seq, loff_t *pos)
{
struct net *net = seq_file_net(seq);
loff_t off;
struct net_device *dev;

rtnl_lock();
return dev_seq_start(seq, pos);
if (!*pos)
return SEQ_START_TOKEN;

off = 1;
for_each_netdev(net, dev)
if (off++ == *pos)
return dev;
return NULL;
}

static void *wireless_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
struct net *net = seq_file_net(seq);

++*pos;

return v == SEQ_START_TOKEN ?
first_net_device(net) : next_net_device(v);
}

static void wireless_dev_seq_stop(struct seq_file *seq, void *v)
{
dev_seq_stop(seq, v);
rtnl_unlock();
}

static const struct seq_operations wireless_seq_ops = {
.start = wireless_dev_seq_start,
.next = dev_seq_next,
.next = wireless_dev_seq_next,
.stop = wireless_dev_seq_stop,
.show = wireless_seq_show,
.show = wireless_dev_seq_show,
};

static int seq_open_wireless(struct inode *inode, struct file *file)
Expand Down

0 comments on commit 367a23f

Please sign in to comment.