2.2.0-final
[davej-history.git] / net / irda / irsysctl.c
blob6349829d5189b8b7167498374a5a090943ac1096
1 /*********************************************************************
2 *
3 * Filename: irsysctl.c
4 * Version:
5 * Description:
6 * Status: Experimental.
7 * Author: Dag Brattli <dagb@cs.uit.no>
8 * Created at: Sun May 24 22:12:06 1998
9 * Modified at: Thu Jan 7 10:35:02 1999
10 * Modified by: Dag Brattli <dagb@cs.uit.no>
12 * Copyright (c) 1997 Dag Brattli, All Rights Reserved.
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
19 * Neither Dag Brattli nor University of Tromsø admit liability nor
20 * provide warranty for any of this software. This material is
21 * provided "AS-IS" and at no charge.
23 ********************************************************************/
25 #include <linux/mm.h>
26 #include <linux/ctype.h>
27 #include <linux/sysctl.h>
28 #include <asm/segment.h>
30 #include <net/irda/irda.h>
32 #define NET_IRDA 412 /* Random number */
33 enum { DISCOVERY=1, DEVNAME, COMPRESSION, DEBUG };
35 extern int sysctl_discovery;
36 int sysctl_compression = 0;
37 extern char sysctl_devname[];
39 #ifdef CONFIG_IRDA_DEBUG
40 extern unsigned int irda_debug;
41 #endif
43 /* One file */
44 static ctl_table irda_table[] = {
45 { DISCOVERY, "discovery", &sysctl_discovery,
46 sizeof(int), 0644, NULL, &proc_dointvec },
47 { DEVNAME, "devname", sysctl_devname,
48 65, 0644, NULL, &proc_dostring, &sysctl_string},
49 { COMPRESSION, "compression", &sysctl_compression,
50 sizeof(int), 0644, NULL, &proc_dointvec },
51 #ifdef CONFIG_IRDA_DEBUG
52 { DEBUG, "debug", &irda_debug,
53 sizeof(int), 0644, NULL, &proc_dointvec },
54 #endif
55 { 0 }
58 /* One directory */
59 static ctl_table irda_net_table[] = {
60 { NET_IRDA, "irda", NULL, 0, 0555, irda_table },
61 { 0 }
64 /* The parent directory */
65 static ctl_table irda_root_table[] = {
66 { CTL_NET, "net", NULL, 0, 0555, irda_net_table },
67 { 0 }
70 static struct ctl_table_header *irda_table_header;
73 * Function irda_sysctl_register (void)
75 * Register our sysctl interface
78 int irda_sysctl_register(void)
80 irda_table_header = register_sysctl_table( irda_root_table, 0);
81 if ( !irda_table_header)
82 return -ENOMEM;
83 return 0;
87 * Function irda_sysctl_unregister (void)
89 * Unregister our sysctl interface
92 void irda_sysctl_unregister(void)
94 unregister_sysctl_table( irda_table_header);