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
5 return copy_to_user(result, buffer, len) ? -EFAULT : 0;
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) { \
19 +#define PARPORT_PARPORT_DIR(child) { \
20 + .ctl_name = DEV_PARPORT, \
21 + .procname = "parport", \
26 +#define PARPORT_DEV_DIR(child) { \
27 + .ctl_name = CTL_DEV, \
28 + .procname = "dev", \
33 +#define PARPORT_DEVICES_ROOT_DIR { \
34 + .ctl_name = DEV_PARPORT_DEVICES, \
35 + .procname = "devices", \
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 = {
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,
55 - { DEV_PARPORT_DMA, "dma",
56 - NULL, 0, 0444, NULL,
58 - { DEV_PARPORT_MODES, "modes",
59 - NULL, 0, 0444, NULL,
60 - &do_hardware_modes },
62 + .ctl_name = DEV_PARPORT_SPINTIME,
63 + .procname = "spintime",
64 + .maxlen = sizeof(int),
66 + .proc_handler = &proc_dointvec_minmax,
67 + .extra1 = (void *) &parport_min_spintime_value,
68 + .extra2 = (void *) &parport_max_spintime_value,
71 + .ctl_name = DEV_PARPORT_BASE_ADDR,
72 + .procname = "base-addr",
74 + .proc_handler = &do_hardware_base_addr,
77 + .ctl_name = DEV_PARPORT_IRQ,
80 + .proc_handler = &do_hardware_irq,
83 + .ctl_name = DEV_PARPORT_DMA,
86 + .proc_handler = &do_hardware_dma,
89 + .ctl_name = DEV_PARPORT_MODES,
90 + .procname = "modes",
92 + .proc_handler = &do_hardware_modes,
94 PARPORT_DEVICES_ROOT_DIR,
95 #ifdef CONFIG_PARPORT_1284
96 - { DEV_PARPORT_AUTOPROBE, "autoprobe",
97 - NULL, 0, 0444, NULL,
99 - { DEV_PARPORT_AUTOPROBE + 1, "autoprobe0",
100 - NULL, 0, 0444, NULL,
102 - { DEV_PARPORT_AUTOPROBE + 2, "autoprobe1",
103 - NULL, 0, 0444, NULL,
105 - { DEV_PARPORT_AUTOPROBE + 3, "autoprobe2",
106 - NULL, 0, 0444, NULL,
108 - { DEV_PARPORT_AUTOPROBE + 4, "autoprobe3",
109 - NULL, 0, 0444, NULL,
112 + .ctl_name = DEV_PARPORT_AUTOPROBE,
113 + .procname = "autoprobe",
115 + .proc_handler = &do_autoprobe,
118 + .ctl_name = DEV_PARPORT_AUTOPROBE + 1,
119 + .procname = "autoprobe0",
121 + .proc_handler = &do_autoprobe,
124 + .ctl_name = DEV_PARPORT_AUTOPROBE + 2,
125 + .procname = "autoprobe1",
127 + .proc_handler = &do_autoprobe,
130 + .ctl_name = DEV_PARPORT_AUTOPROBE + 3,
131 + .procname = "autoprobe2",
133 + .proc_handler = &do_autoprobe,
136 + .ctl_name = DEV_PARPORT_AUTOPROBE + 4,
137 + .procname = "autoprobe3",
139 + .proc_handler = &do_autoprobe,
141 #endif /* IEEE 1284 support */
144 + .ctl_name = 0, /* sentinel */
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}}
154 + .ctl_name = DEV_PARPORT_DEVICES_ACTIVE,
155 + .procname = "active",
157 + .proc_handler = &do_active_device,
160 + .ctl_name = 0, /* sentinel */
164 + PARPORT_PORT_DIR(NULL),
166 + .ctl_name = 0, /* sentinel */
170 + PARPORT_PARPORT_DIR(NULL),
172 + .ctl_name = 0, /* sentinel */
176 + PARPORT_DEV_DIR(NULL),
178 + .ctl_name = 0, /* sentinel */
183 struct parport_device_sysctl_table
184 @@ -323,17 +397,51 @@
185 parport_device_sysctl_template = {
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 },
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}}
200 + .ctl_name = DEV_PARPORT_DEVICE_TIMESLICE,
201 + .procname = "timeslice",
202 + .maxlen = sizeof(int),
204 + .proc_handler = &proc_doulongvec_ms_jiffies_minmax,
205 + .extra1 = (void *) &parport_min_timeslice_value,
206 + .extra2 = (void *) &parport_max_timeslice_value
209 + ctl_name = 0, /* sentinel */
217 + .ctl_name = 0, /* sentinel */
221 + PARPORT_DEVICES_ROOT_DIR,
223 + .ctl_name = 0, /* sentinel */
227 + PARPORT_PORT_DIR(NULL),
229 + .ctl_name = 0, /* sentinel */
233 + PARPORT_PARPORT_DIR(NULL),
235 + .ctl_name = 0, /* sentinel */
239 + PARPORT_DEV_DIR(NULL),
241 + .ctl_name = 0, /* sentinel */
246 struct parport_default_sysctl_table
247 @@ -352,26 +460,53 @@
248 parport_default_sysctl_table = {
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 },
265 - { { DEV_PARPORT_DEFAULT, "default", NULL, 0, 0555,
266 - parport_default_sysctl_table.vars },{0}},
268 - PARPORT_PARPORT_DIR(parport_default_sysctl_table.default_dir),
270 - { PARPORT_DEV_DIR(parport_default_sysctl_table.parport_dir), {0}}
272 + .ctl_name = DEV_PARPORT_DEFAULT_TIMESLICE,
273 + .procname = "timeslice",
274 + .data - &parport_default_timeslice,
275 + .maxlen = sizeof(parport_default_timeslice),
277 + .proc_handler = &proc_doulongvec_ms_jiffies_minmax,
278 + .extra1 = (void *) &parport_min_timeslice_value,
279 + .extra2 = (void *) &parport_max_timeslice_value,
282 + .ctl_name = DEV_PARPORT_DEFAULT_SPINTIME,
283 + .procname = "spintime",
284 + .data = &parport_default_spintime,
285 + .maxlen = sizeof(parport_default_spintime),
287 + .proc_handler = &proc_dointvec_minmax,
288 + .extra1 = (void *) &parport_min_spintime_value,
289 + .extra2 = (void *) &parport_max_spintime_value,
292 + .ctl_name = 0, /* sentinel */
297 + .ctl_name = DEV_PARPORT_DEFAULT,
298 + .procname = "default",
300 + .proc_handler = parport_default_sysctl_table.vars,
303 + .ctl_name = 0, /* sentinel */
307 + PARPORT_PARPORT_DIR(parport_default_sysctl_table.default_dir),
309 + .ctl_name = 0, /* sentinel */
313 + PARPORT_DEV_DIR(parport_default_sysctl_table.parport_dir),
315 + .ctl_name = 0, /* sentinel */