]>
Commit | Line | Data |
---|---|---|
a494c824 | 1 | ===== drivers/parport/procfs.c 1.2 vs edited ===== |
2 | --- 1.2/drivers/parport/procfs.c Tue Feb 5 16:37:25 2002 | |
3 | +++ edited/drivers/parport/procfs.c Sun Feb 1 22:54:02 2004 | |
4 | @@ -232,12 +232,29 @@ | |
5 | return copy_to_user(result, buffer, len) ? -EFAULT : 0; | |
6 | } | |
7 | ||
8 | -#define PARPORT_PORT_DIR(child) { 0, NULL, NULL, 0, 0555, child } | |
9 | -#define PARPORT_PARPORT_DIR(child) { DEV_PARPORT, "parport", \ | |
10 | - NULL, 0, 0555, child } | |
11 | -#define PARPORT_DEV_DIR(child) { CTL_DEV, "dev", NULL, 0, 0555, child } | |
12 | -#define PARPORT_DEVICES_ROOT_DIR { DEV_PARPORT_DEVICES, "devices", \ | |
13 | - NULL, 0, 0555, NULL } | |
14 | +#define PARPORT_PORT_DIR(child) { \ | |
15 | + .mode = 0555, \ | |
16 | + .child = child, \ | |
17 | +} | |
18 | + | |
19 | +#define PARPORT_PARPORT_DIR(child) { \ | |
20 | + .ctl_name = DEV_PARPORT, \ | |
21 | + .procname = "parport", \ | |
22 | + .mode = 0555, \ | |
23 | + .child = child, \ | |
24 | +} | |
25 | + | |
26 | +#define PARPORT_DEV_DIR(child) { \ | |
27 | + .ctl_name = CTL_DEV, \ | |
28 | + .procname = "dev", \ | |
29 | + .mode = 0555, \ | |
30 | + .child = child, \ | |
31 | +} | |
32 | + | |
33 | +#define PARPORT_DEVICES_ROOT_DIR { \ | |
34 | + .ctl_name = DEV_PARPORT_DEVICES, \ | |
35 | + .procname = "devices", \ | |
36 | +} | |
37 | ||
38 | static const unsigned long parport_min_timeslice_value = | |
39 | PARPORT_MIN_TIMESLICE_VALUE; | |
40 | @@ -264,48 +281,105 @@ | |
41 | static const struct parport_sysctl_table parport_sysctl_template = { | |
42 | NULL, | |
43 | { | |
44 | - { DEV_PARPORT_SPINTIME, "spintime", | |
45 | - NULL, sizeof(int), 0644, NULL, | |
46 | - &proc_dointvec_minmax, NULL, NULL, | |
47 | - (void*) &parport_min_spintime_value, | |
48 | - (void*) &parport_max_spintime_value }, | |
49 | - { DEV_PARPORT_BASE_ADDR, "base-addr", | |
50 | - NULL, 0, 0444, NULL, | |
51 | - &do_hardware_base_addr }, | |
52 | - { DEV_PARPORT_IRQ, "irq", | |
53 | - NULL, 0, 0444, NULL, | |
54 | - &do_hardware_irq }, | |
55 | - { DEV_PARPORT_DMA, "dma", | |
56 | - NULL, 0, 0444, NULL, | |
57 | - &do_hardware_dma }, | |
58 | - { DEV_PARPORT_MODES, "modes", | |
59 | - NULL, 0, 0444, NULL, | |
60 | - &do_hardware_modes }, | |
61 | + { | |
62 | + .ctl_name = DEV_PARPORT_SPINTIME, | |
63 | + .procname = "spintime", | |
64 | + .maxlen = sizeof(int), | |
65 | + .mode = 0644, | |
66 | + .proc_handler = &proc_dointvec_minmax, | |
67 | + .extra1 = (void *) &parport_min_spintime_value, | |
68 | + .extra2 = (void *) &parport_max_spintime_value, | |
69 | + }, | |
70 | + { | |
71 | + .ctl_name = DEV_PARPORT_BASE_ADDR, | |
72 | + .procname = "base-addr", | |
73 | + .mode = 0444, | |
74 | + .proc_handler = &do_hardware_base_addr, | |
75 | + }, | |
76 | + { | |
77 | + .ctl_name = DEV_PARPORT_IRQ, | |
78 | + .procname = "irq", | |
79 | + .mode = 0444, | |
80 | + .proc_handler = &do_hardware_irq, | |
81 | + }, | |
82 | + { | |
83 | + .ctl_name = DEV_PARPORT_DMA, | |
84 | + .procname = "dma", | |
85 | + .mode = 0444, | |
86 | + .proc_handler = &do_hardware_dma, | |
87 | + }, | |
88 | + { | |
89 | + .ctl_name = DEV_PARPORT_MODES, | |
90 | + .procname = "modes", | |
91 | + .mode = 0444, | |
92 | + .proc_handler = &do_hardware_modes, | |
93 | + }, | |
94 | PARPORT_DEVICES_ROOT_DIR, | |
95 | #ifdef CONFIG_PARPORT_1284 | |
96 | - { DEV_PARPORT_AUTOPROBE, "autoprobe", | |
97 | - NULL, 0, 0444, NULL, | |
98 | - &do_autoprobe }, | |
99 | - { DEV_PARPORT_AUTOPROBE + 1, "autoprobe0", | |
100 | - NULL, 0, 0444, NULL, | |
101 | - &do_autoprobe }, | |
102 | - { DEV_PARPORT_AUTOPROBE + 2, "autoprobe1", | |
103 | - NULL, 0, 0444, NULL, | |
104 | - &do_autoprobe }, | |
105 | - { DEV_PARPORT_AUTOPROBE + 3, "autoprobe2", | |
106 | - NULL, 0, 0444, NULL, | |
107 | - &do_autoprobe }, | |
108 | - { DEV_PARPORT_AUTOPROBE + 4, "autoprobe3", | |
109 | - NULL, 0, 0444, NULL, | |
110 | - &do_autoprobe }, | |
111 | + { | |
112 | + .ctl_name = DEV_PARPORT_AUTOPROBE, | |
113 | + .procname = "autoprobe", | |
114 | + .mode = 0444, | |
115 | + .proc_handler = &do_autoprobe, | |
116 | + }, | |
117 | + { | |
118 | + .ctl_name = DEV_PARPORT_AUTOPROBE + 1, | |
119 | + .procname = "autoprobe0", | |
120 | + .mode = 0444, | |
121 | + .proc_handler = &do_autoprobe, | |
122 | + }, | |
123 | + { | |
124 | + .ctl_name = DEV_PARPORT_AUTOPROBE + 2, | |
125 | + .procname = "autoprobe1", | |
126 | + .mode = 0444, | |
127 | + .proc_handler = &do_autoprobe, | |
128 | + }, | |
129 | + { | |
130 | + .ctl_name = DEV_PARPORT_AUTOPROBE + 3, | |
131 | + .procname = "autoprobe2", | |
132 | + .mode = 0444, | |
133 | + .proc_handler = &do_autoprobe, | |
134 | + }, | |
135 | + { | |
136 | + .ctl_name = DEV_PARPORT_AUTOPROBE + 4, | |
137 | + .procname = "autoprobe3", | |
138 | + .mode = 0444, | |
139 | + .proc_handler = &do_autoprobe, | |
140 | + }, | |
141 | #endif /* IEEE 1284 support */ | |
142 | - {0} | |
143 | + { | |
144 | + .ctl_name = 0, /* sentinel */ | |
145 | + } | |
146 | }, | |
147 | - { {DEV_PARPORT_DEVICES_ACTIVE, "active", NULL, 0, 0444, NULL, | |
148 | - &do_active_device }, {0}}, | |
149 | - { PARPORT_PORT_DIR(NULL), {0}}, | |
150 | - { PARPORT_PARPORT_DIR(NULL), {0}}, | |
151 | - { PARPORT_DEV_DIR(NULL), {0}} | |
152 | + { | |
153 | + { | |
154 | + .ctl_name = DEV_PARPORT_DEVICES_ACTIVE, | |
155 | + .procname = "active", | |
156 | + .mode = 0444, | |
157 | + .proc_handler = &do_active_device, | |
158 | + }, | |
159 | + { | |
160 | + .ctl_name = 0, /* sentinel */ | |
161 | + } | |
162 | + }, | |
163 | + { | |
164 | + PARPORT_PORT_DIR(NULL), | |
165 | + { | |
166 | + .ctl_name = 0, /* sentinel */ | |
167 | + } | |
168 | + }, | |
169 | + { | |
170 | + PARPORT_PARPORT_DIR(NULL), | |
171 | + { | |
172 | + .ctl_name = 0, /* sentinel */ | |
173 | + } | |
174 | + }, | |
175 | + { | |
176 | + PARPORT_DEV_DIR(NULL), | |
177 | + { | |
178 | + .ctl_name = 0, /* sentinel */ | |
179 | + } | |
180 | + } | |
181 | }; | |
182 | ||
183 | struct parport_device_sysctl_table | |
184 | @@ -323,17 +397,51 @@ | |
185 | parport_device_sysctl_template = { | |
186 | NULL, | |
187 | { | |
188 | - { DEV_PARPORT_DEVICE_TIMESLICE, "timeslice", | |
189 | - NULL, sizeof(int), 0644, NULL, | |
190 | - &proc_doulongvec_ms_jiffies_minmax, NULL, NULL, | |
191 | - (void*) &parport_min_timeslice_value, | |
192 | - (void*) &parport_max_timeslice_value }, | |
193 | - }, | |
194 | - { {0, NULL, NULL, 0, 0555, NULL}, {0}}, | |
195 | - { PARPORT_DEVICES_ROOT_DIR, {0}}, | |
196 | - { PARPORT_PORT_DIR(NULL), {0}}, | |
197 | - { PARPORT_PARPORT_DIR(NULL), {0}}, | |
198 | - { PARPORT_DEV_DIR(NULL), {0}} | |
199 | + { | |
200 | + .ctl_name = DEV_PARPORT_DEVICE_TIMESLICE, | |
201 | + .procname = "timeslice", | |
202 | + .maxlen = sizeof(int), | |
203 | + .mode = 0644, | |
204 | + .proc_handler = &proc_doulongvec_ms_jiffies_minmax, | |
205 | + .extra1 = (void *) &parport_min_timeslice_value, | |
206 | + .extra2 = (void *) &parport_max_timeslice_value | |
207 | + }, | |
208 | + { | |
209 | + ctl_name = 0, /* sentinel */ | |
210 | + } | |
211 | + }, | |
212 | + { | |
213 | + { | |
214 | + .mode = 0555, | |
215 | + }, | |
216 | + { | |
217 | + .ctl_name = 0, /* sentinel */ | |
218 | + } | |
219 | + }, | |
220 | + { | |
221 | + PARPORT_DEVICES_ROOT_DIR, | |
222 | + { | |
223 | + .ctl_name = 0, /* sentinel */ | |
224 | + } | |
225 | + }, | |
226 | + { | |
227 | + PARPORT_PORT_DIR(NULL), | |
228 | + { | |
229 | + .ctl_name = 0, /* sentinel */ | |
230 | + } | |
231 | + }, | |
232 | + { | |
233 | + PARPORT_PARPORT_DIR(NULL), | |
234 | + { | |
235 | + .ctl_name = 0, /* sentinel */ | |
236 | + } | |
237 | + }, | |
238 | + { | |
239 | + PARPORT_DEV_DIR(NULL), | |
240 | + { | |
241 | + .ctl_name = 0, /* sentinel */ | |
242 | + } | |
243 | + } | |
244 | }; | |
245 | ||
246 | struct parport_default_sysctl_table | |
247 | @@ -352,26 +460,53 @@ | |
248 | parport_default_sysctl_table = { | |
249 | NULL, | |
250 | { | |
251 | - { DEV_PARPORT_DEFAULT_TIMESLICE, "timeslice", | |
252 | - &parport_default_timeslice, | |
253 | - sizeof(parport_default_timeslice), 0644, NULL, | |
254 | - &proc_doulongvec_ms_jiffies_minmax, NULL, NULL, | |
255 | - (void*) &parport_min_timeslice_value, | |
256 | - (void*) &parport_max_timeslice_value }, | |
257 | - { DEV_PARPORT_DEFAULT_SPINTIME, "spintime", | |
258 | - &parport_default_spintime, | |
259 | - sizeof(parport_default_spintime), 0644, NULL, | |
260 | - &proc_dointvec_minmax, NULL, NULL, | |
261 | - (void*) &parport_min_spintime_value, | |
262 | - (void*) &parport_max_spintime_value }, | |
263 | - {0} | |
264 | - }, | |
265 | - { { DEV_PARPORT_DEFAULT, "default", NULL, 0, 0555, | |
266 | - parport_default_sysctl_table.vars },{0}}, | |
267 | - { | |
268 | - PARPORT_PARPORT_DIR(parport_default_sysctl_table.default_dir), | |
269 | - {0}}, | |
270 | - { PARPORT_DEV_DIR(parport_default_sysctl_table.parport_dir), {0}} | |
271 | + { | |
272 | + .ctl_name = DEV_PARPORT_DEFAULT_TIMESLICE, | |
273 | + .procname = "timeslice", | |
274 | + .data - &parport_default_timeslice, | |
275 | + .maxlen = sizeof(parport_default_timeslice), | |
276 | + .mode = 0644, | |
277 | + .proc_handler = &proc_doulongvec_ms_jiffies_minmax, | |
278 | + .extra1 = (void *) &parport_min_timeslice_value, | |
279 | + .extra2 = (void *) &parport_max_timeslice_value, | |
280 | + }, | |
281 | + { | |
282 | + .ctl_name = DEV_PARPORT_DEFAULT_SPINTIME, | |
283 | + .procname = "spintime", | |
284 | + .data = &parport_default_spintime, | |
285 | + .maxlen = sizeof(parport_default_spintime), | |
286 | + .mode = 0644, | |
287 | + .proc_handler = &proc_dointvec_minmax, | |
288 | + .extra1 = (void *) &parport_min_spintime_value, | |
289 | + .extra2 = (void *) &parport_max_spintime_value, | |
290 | + }, | |
291 | + { | |
292 | + .ctl_name = 0, /* sentinel */ | |
293 | + } | |
294 | + }, | |
295 | + { | |
296 | + { | |
297 | + .ctl_name = DEV_PARPORT_DEFAULT, | |
298 | + .procname = "default", | |
299 | + .mode = 0555, | |
300 | + .proc_handler = parport_default_sysctl_table.vars, | |
301 | + }, | |
302 | + { | |
303 | + .ctl_name = 0, /* sentinel */ | |
304 | + } | |
305 | + }, | |
306 | + { | |
307 | + PARPORT_PARPORT_DIR(parport_default_sysctl_table.default_dir), | |
308 | + { | |
309 | + .ctl_name = 0, /* sentinel */ | |
310 | + } | |
311 | + }, | |
312 | + { | |
313 | + PARPORT_DEV_DIR(parport_default_sysctl_table.parport_dir), | |
314 | + { | |
315 | + .ctl_name = 0, /* sentinel */ | |
316 | + } | |
317 | + } | |
318 | }; | |
319 | ||
320 |