aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2007-02-14 03:33:44 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-14 11:09:57 -0500
commit8d8cb8a1bbd92a77208bdeaa25c3f17f5da9297d (patch)
treedb2ceddb37742dd8ec9b05211d9b994f9531f33f
parent7ed744d1e8faed90aa027c08eeed21c4120e623d (diff)
[PATCH] sysctl: C99 convert arch/mips/lasat/sysctl.c and remove ABI breakage
While C99 converting the ctl_table initializers I realized that the binary sysctl numbers were in conflict with the binary values under CTL_KERN. Including CTL_KERN KERN_VERSION as used by glibc. So I just removed the sysctl binary interface for these values, as it was unsupportable. Luckily these sysctl were inserted at the end of the sysctl list so this bug was not visible to userspace. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Acked-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/mips/lasat/sysctl.c145
1 files changed, 116 insertions, 29 deletions
diff --git a/arch/mips/lasat/sysctl.c b/arch/mips/lasat/sysctl.c
index 12878359f2c8..c04e82fb9d59 100644
--- a/arch/mips/lasat/sysctl.c
+++ b/arch/mips/lasat/sysctl.c
@@ -302,42 +302,129 @@ extern int lasat_boot_to_service;
302#ifdef CONFIG_SYSCTL 302#ifdef CONFIG_SYSCTL
303 303
304static ctl_table lasat_table[] = { 304static ctl_table lasat_table[] = {
305 {LASAT_CPU_HZ, "cpu-hz", &lasat_board_info.li_cpu_hz, sizeof(int), 305 {
306 0444, NULL, &proc_dointvec, &sysctl_intvec}, 306 .ctl_name = CTL_UNNUMBERED,
307 {LASAT_BUS_HZ, "bus-hz", &lasat_board_info.li_bus_hz, sizeof(int), 307 .procname = "cpu-hz",
308 0444, NULL, &proc_dointvec, &sysctl_intvec}, 308 .data = &lasat_board_info.li_cpu_hz,
309 {LASAT_MODEL, "bmid", &lasat_board_info.li_bmid, sizeof(int), 309 .maxlen = sizeof(int),
310 0444, NULL, &proc_dointvec, &sysctl_intvec}, 310 .mode = 0444,
311 {LASAT_PRID, "prid", &lasat_board_info.li_prid, sizeof(int), 311 .proc_handler = &proc_dointvec,
312 0644, NULL, &proc_lasat_eeprom_value, &sysctl_lasat_eeprom_value}, 312 .strategy = &sysctl_intvec
313 },
314 {
315 .ctl_name = CTL_UNNUMBERED,
316 .procname = "bus-hz",
317 .data = &lasat_board_info.li_bus_hz,
318 .maxlen = sizeof(int),
319 .mode = 0444,
320 .proc_handler = &proc_dointvec,
321 .strategy = &sysctl_intvec
322 },
323 {
324 .ctl_name = CTL_UNNUMBERED,
325 .procname = "bmid",
326 .data = &lasat_board_info.li_bmid,
327 .maxlen = sizeof(int),
328 .mode = 0444,
329 .proc_handler = &proc_dointvec,
330 .strategy = &sysctl_intvec
331 },
332 {
333 .ctl_name = CTL_UNNUMBERED,
334 .procname = "prid",
335 .data = &lasat_board_info.li_prid,
336 .maxlen = sizeof(int),
337 .mode = 0644,
338 .proc_handler = &proc_lasat_eeprom_value,
339 .strategy = &sysctl_lasat_eeprom_value
340 },
313#ifdef CONFIG_INET 341#ifdef CONFIG_INET
314 {LASAT_IPADDR, "ipaddr", &lasat_board_info.li_eeprom_info.ipaddr, sizeof(int), 342 {
315 0644, NULL, &proc_lasat_ip, &sysctl_lasat_intvec}, 343 .ctl_name = CTL_UNNUMBERED,
316 {LASAT_NETMASK, "netmask", &lasat_board_info.li_eeprom_info.netmask, sizeof(int), 344 .procname = "ipaddr",
317 0644, NULL, &proc_lasat_ip, &sysctl_lasat_intvec}, 345 .data = &lasat_board_info.li_eeprom_info.ipaddr,
318 {LASAT_BCAST, "bcastaddr", &lasat_bcastaddr, 346 .maxlen = sizeof(int),
319 sizeof(lasat_bcastaddr), 0600, NULL, 347 .mode = 0644,
320 &proc_dostring, &sysctl_string}, 348 .proc_handler = &proc_lasat_ip,
349 .strategy = &sysctl_lasat_intvec
350 },
351 {
352 .ctl_name = LASAT_NETMASK,
353 .procname = "netmask",
354 .data = &lasat_board_info.li_eeprom_info.netmask,
355 .maxlen = sizeof(int),
356 .mode = 0644,
357 .proc_handler = &proc_lasat_ip,
358 .strategy = &sysctl_lasat_intvec
359 },
360 {
361 .ctl_name = CTL_UNNUMBERED,
362 .procname = "bcastaddr",
363 .data = &lasat_bcastaddr,
364 .maxlen = sizeof(lasat_bcastaddr),
365 .mode = 0600,
366 .proc_handler = &proc_dostring,
367 .strategy = &sysctl_string
368 },
321#endif 369#endif
322 {LASAT_PASSWORD, "passwd_hash", &lasat_board_info.li_eeprom_info.passwd_hash, sizeof(lasat_board_info.li_eeprom_info.passwd_hash), 370 {
323 0600, NULL, &proc_dolasatstring, &sysctl_lasatstring}, 371 .ctl_name = CTL_UNNUMBERED,
324 {LASAT_SBOOT, "boot-service", &lasat_boot_to_service, sizeof(int), 372 .procname = "passwd_hash",
325 0644, NULL, &proc_dointvec, &sysctl_intvec}, 373 .data = &lasat_board_info.li_eeprom_info.passwd_hash,
374 .maxlen = sizeof(lasat_board_info.li_eeprom_info.passwd_hash),
375 .mode = 0600,
376 .proc_handler = &proc_dolasatstring,
377 .strategy = &sysctl_lasatstring
378 },
379 {
380 .ctl_name = CTL_UNNUMBERED,
381 .procname = "boot-service",
382 .data = &lasat_boot_to_service,
383 .maxlen = sizeof(int),
384 .mode = 0644,
385 .proc_handler = &proc_dointvec,
386 .strategy = &sysctl_intvec
387 },
326#ifdef CONFIG_DS1603 388#ifdef CONFIG_DS1603
327 {LASAT_RTC, "rtc", &rtctmp, sizeof(int), 389 {
328 0644, NULL, &proc_dolasatrtc, &sysctl_lasat_rtc}, 390 .ctl_name = CTL_UNNUMBERED,
391 .procname = "rtc",
392 .data = &rtctmp,
393 .maxlen = sizeof(int),
394 .mode = 0644,
395 .proc_handler = &proc_dolasatrtc,
396 .strategy = &sysctl_lasat_rtc
397 },
329#endif 398#endif
330 {LASAT_NAMESTR, "namestr", &lasat_board_info.li_namestr, sizeof(lasat_board_info.li_namestr), 399 {
331 0444, NULL, &proc_dostring, &sysctl_string}, 400 .ctl_name = CTL_UNNUMBERED,
332 {LASAT_TYPESTR, "typestr", &lasat_board_info.li_typestr, sizeof(lasat_board_info.li_typestr), 401 .procname = "namestr",
333 0444, NULL, &proc_dostring, &sysctl_string}, 402 .data = &lasat_board_info.li_namestr,
334 {0} 403 .maxlen = sizeof(lasat_board_info.li_namestr),
404 .mode = 0444,
405 .proc_handler = &proc_dostring,
406 .strategy = &sysctl_string
407 },
408 {
409 .ctl_name = CTL_UNNUMBERED,
410 .procname = "typestr",
411 .data = &lasat_board_info.li_typestr,
412 .maxlen = sizeof(lasat_board_info.li_typestr),
413 .mode = 0444,
414 .proc_handler = &proc_dostring,
415 .strategy = &sysctl_string
416 },
417 {}
335}; 418};
336 419
337#define CTL_LASAT 1 // CTL_ANY ???
338static ctl_table lasat_root_table[] = { 420static ctl_table lasat_root_table[] = {
339 { CTL_LASAT, "lasat", NULL, 0, 0555, lasat_table }, 421 {
340 { 0 } 422 .ctl_name = CTL_UNNUMBERED,
423 .procname = "lasat",
424 .mode = 0555,
425 .child = lasat_table
426 },
427 {}
341}; 428};
342 429
343static int __init lasat_register_sysctl(void) 430static int __init lasat_register_sysctl(void)