1 --- a/net80211/ieee80211_linux.c
2 +++ b/net80211/ieee80211_linux.c
3 @@ -476,8 +476,12 @@ static int
4 proc_ieee80211_open(struct inode *inode, struct file *file)
6 struct proc_ieee80211_priv *pv = NULL;
7 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
8 + struct ieee80211vap *vap = PDE_DATA(inode);
10 struct proc_dir_entry *dp = PDE(inode);
11 struct ieee80211vap *vap = dp->data;
14 if (!(file->private_data = kmalloc(sizeof(struct proc_ieee80211_priv), GFP_KERNEL)))
16 @@ -842,10 +846,16 @@ ieee80211_virtfs_latevattach(struct ieee
17 tmp = vap->iv_proc_entries;
20 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
21 + tmp->entry = proc_create_data(tmp->name,
22 + PROC_IEEE80211_PERM, vap->iv_proc,
25 tmp->entry = create_proc_entry(tmp->name,
26 PROC_IEEE80211_PERM, vap->iv_proc);
27 tmp->entry->data = vap;
28 tmp->entry->proc_fops = tmp->fileops;
33 @@ -913,10 +923,16 @@ ieee80211_proc_vcreate(struct ieee80211v
35 /* Create the actual proc entry */
37 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
38 + entry->entry = proc_create_data(entry->name,
39 + PROC_IEEE80211_PERM, vap->iv_proc,
40 + entry->fileops, vap);
42 entry->entry = create_proc_entry(entry->name,
43 PROC_IEEE80211_PERM, vap->iv_proc);
44 entry->entry->data = vap;
45 entry->entry->proc_fops = entry->fileops;
49 /* Add it to the list */
50 @@ -953,14 +969,26 @@ ieee80211_virtfs_vdetach(struct ieee8021
51 tmp = vap->iv_proc_entries;
54 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
55 + proc_remove(tmp->entry);
57 remove_proc_entry(tmp->name, vap->iv_proc);
63 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
64 + proc_remove(vap->iv_proc);
66 remove_proc_entry(vap->iv_proc->name, proc_madwifi);
68 if (proc_madwifi_count == 1) {
69 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
70 + proc_remove(proc_madwifi);
72 remove_proc_entry("madwifi", proc_net);
77 --- a/ath_rate/minstrel/minstrel.c
78 +++ b/ath_rate/minstrel/minstrel.c
79 @@ -835,8 +835,12 @@ static int
80 ath_proc_ratesample_open(struct inode *inode, struct file *file)
82 struct proc_ieee80211_priv *pv = NULL;
83 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0))
84 + struct ieee80211vap *vap = PDE_DATA(inode);
86 struct proc_dir_entry *dp = PDE(inode);
87 struct ieee80211vap *vap = dp->data;
90 if (!(file->private_data = kmalloc(sizeof(struct proc_ieee80211_priv),
92 --- a/ath_rate/sample/sample.c
93 +++ b/ath_rate/sample/sample.c
94 @@ -923,12 +923,15 @@ proc_read_nodes(struct ieee80211vap *vap
98 -proc_ratesample_open(struct inode *inode, struct file *file)
99 +proc_ratesample_open_common(struct inode *inode, struct file *file, const unsigned long size)
101 struct proc_ieee80211_priv *pv;
102 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
103 + struct ieee80211vap *vap = PDE_DATA(inode);
105 struct proc_dir_entry *dp = PDE(inode);
106 struct ieee80211vap *vap = dp->data;
107 - unsigned long size;
110 if (!(file->private_data = kmalloc(sizeof(struct proc_ieee80211_priv),
112 @@ -953,18 +956,47 @@ proc_ratesample_open(struct inode *inode
113 pv->max_wlen = MAX_PROC_IEEE80211_SIZE;
114 pv->max_rlen = MAX_PROC_IEEE80211_SIZE;
116 - /* Determine what size packets to get stats for based on proc filename */
117 - size = simple_strtoul(dp->name + 10, NULL, 0);
119 /* now read the data into the buffer */
120 pv->rlen = proc_read_nodes(vap, size, pv->rbuf, MAX_PROC_IEEE80211_SIZE);
124 -static struct file_operations proc_ratesample_ops = {
126 +proc_ratesample_stats250_open(struct inode *inode, struct file *file)
128 + return proc_ratesample_open_common(inode, file, 250);
132 +proc_ratesample_stats1600_open(struct inode *inode, struct file *file)
134 + return proc_ratesample_open_common(inode, file, 1600);
138 +proc_ratesample_stats3000_open(struct inode *inode, struct file *file)
140 + return proc_ratesample_open_common(inode, file, 3000);
143 +static struct file_operations proc_ratesample_stats250_ops = {
146 + .open = proc_ratesample_stats250_open,
150 +static struct file_operations proc_ratesample_stats1600_ops = {
153 + .open = proc_ratesample_stats1600_open,
157 +static struct file_operations proc_ratesample_stats3000_ops = {
160 - .open = proc_ratesample_open,
161 + .open = proc_ratesample_stats3000_open,
165 @@ -972,9 +1004,9 @@ static void
166 ath_rate_dynamic_proc_register(struct ieee80211vap *vap)
168 /* Create proc entries for the rate control algorithm */
169 - ieee80211_proc_vcreate(vap, &proc_ratesample_ops, "ratestats_250");
170 - ieee80211_proc_vcreate(vap, &proc_ratesample_ops, "ratestats_1600");
171 - ieee80211_proc_vcreate(vap, &proc_ratesample_ops, "ratestats_3000");
172 + ieee80211_proc_vcreate(vap, &proc_ratesample_stats250_ops, "ratestats_250");
173 + ieee80211_proc_vcreate(vap, &proc_ratesample_stats1600_ops, "ratestats_1600");
174 + ieee80211_proc_vcreate(vap, &proc_ratesample_stats3000_ops, "ratestats_3000");
177 static struct ieee80211_rate_ops ath_rate_ops = {