1 /*********************************************************************
5 * Description: Sysctl interface for IrDA
6 * Status: Experimental.
7 * Author: Dag Brattli <dagb@cs.uit.no>
8 * Created at: Sun May 24 22:12:06 1998
9 * Modified at: Fri Jun 4 02:50:15 1999
10 * Modified by: Dag Brattli <dagb@cs.uit.no>
12 * Copyright (c) 1997, 1999 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/config.h>
27 #include <linux/ctype.h>
28 #include <linux/sysctl.h>
29 #include <asm/segment.h>
31 #include <net/irda/irda.h>
33 #define NET_IRDA 412 /* Random number */
34 enum { DISCOVERY
=1, DEVNAME
, COMPRESSION
, DEBUG
, SLOTS
, DISCOVERY_TIMEOUT
,
37 extern int sysctl_discovery
;
38 extern int sysctl_discovery_slots
;
39 extern int sysctl_discovery_timeout
;
40 extern int sysctl_slot_timeout
;
41 extern int sysctl_fast_poll_increase
;
42 int sysctl_compression
= 0;
43 extern char sysctl_devname
[];
45 #ifdef CONFIG_IRDA_DEBUG
46 extern unsigned int irda_debug
;
50 static ctl_table irda_table
[] = {
51 { DISCOVERY
, "discovery", &sysctl_discovery
,
52 sizeof(int), 0644, NULL
, &proc_dointvec
},
53 { DEVNAME
, "devname", sysctl_devname
,
54 65, 0644, NULL
, &proc_dostring
, &sysctl_string
},
55 { COMPRESSION
, "compression", &sysctl_compression
,
56 sizeof(int), 0644, NULL
, &proc_dointvec
},
57 #ifdef CONFIG_IRDA_DEBUG
58 { DEBUG
, "debug", &irda_debug
,
59 sizeof(int), 0644, NULL
, &proc_dointvec
},
61 #ifdef CONFIG_IRDA_FAST_RR
62 { SLOTS
, "fast_poll_increase", &sysctl_fast_poll_increase
,
63 sizeof(int), 0644, NULL
, &proc_dointvec
},
65 { SLOTS
, "discovery_slots", &sysctl_discovery_slots
,
66 sizeof(int), 0644, NULL
, &proc_dointvec
},
67 { DISCOVERY_TIMEOUT
, "discovery_timeout", &sysctl_discovery_timeout
,
68 sizeof(int), 0644, NULL
, &proc_dointvec
},
69 { SLOT_TIMEOUT
, "slot_timeout", &sysctl_slot_timeout
,
70 sizeof(int), 0644, NULL
, &proc_dointvec
},
75 static ctl_table irda_net_table
[] = {
76 { NET_IRDA
, "irda", NULL
, 0, 0555, irda_table
},
80 /* The parent directory */
81 static ctl_table irda_root_table
[] = {
82 { CTL_NET
, "net", NULL
, 0, 0555, irda_net_table
},
86 static struct ctl_table_header
*irda_table_header
;
89 * Function irda_sysctl_register (void)
91 * Register our sysctl interface
94 int irda_sysctl_register(void)
96 irda_table_header
= register_sysctl_table(irda_root_table
, 0);
97 if (!irda_table_header
)
104 * Function irda_sysctl_unregister (void)
106 * Unregister our sysctl interface
109 void irda_sysctl_unregister(void)
111 unregister_sysctl_table(irda_table_header
);