1 --- a/net/mac80211/rc80211_minstrel.h
2 +++ b/net/mac80211/rc80211_minstrel.h
3 @@ -80,6 +80,11 @@ struct minstrel_priv {
4 unsigned int lookaround_rate_mrr;
7 +struct minstrel_debugfs_info {
12 void minstrel_add_sta_debugfs(void *priv, void *priv_sta, struct dentry *dir);
13 void minstrel_remove_sta_debugfs(void *priv, void *priv_sta);
15 --- a/net/mac80211/rc80211_minstrel_debugfs.c
16 +++ b/net/mac80211/rc80211_minstrel_debugfs.c
18 #include <net/mac80211.h>
19 #include "rc80211_minstrel.h"
21 -struct minstrel_stats_info {
22 - struct minstrel_sta_info *mi;
28 minstrel_stats_open(struct inode *inode, struct file *file)
30 struct minstrel_sta_info *mi = inode->i_private;
31 - struct minstrel_stats_info *ms;
32 + struct minstrel_debugfs_info *ms;
33 unsigned int i, tp, prob, eprob;
36 - ms = kmalloc(sizeof(*ms), GFP_KERNEL);
37 + ms = kmalloc(sizeof(*ms) + 4096, GFP_KERNEL);
41 @@ -107,35 +101,18 @@ minstrel_stats_open(struct inode *inode,
45 -minstrel_stats_read(struct file *file, char __user *buf, size_t len, loff_t *o)
46 +minstrel_stats_read(struct file *file, char __user *buf, size_t len, loff_t *ppos)
48 - struct minstrel_stats_info *ms;
50 + struct minstrel_debugfs_info *ms;
52 ms = file->private_data;
55 - len = min(len, ms->len);
63 - if (copy_to_user(buf, src, len))
67 + return simple_read_from_buffer(buf, len, ppos, ms->buf, ms->len);
71 minstrel_stats_release(struct inode *inode, struct file *file)
73 - struct minstrel_stats_info *ms = file->private_data;
77 + kfree(file->private_data);