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: Thu May 6 21:32:46 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
, SLOT_TIMEOUT
};
36 extern int sysctl_discovery
;
37 extern int sysctl_discovery_slots
;
38 extern int sysctl_slot_timeout
;
39 extern int sysctl_fast_poll_increase
;
40 int sysctl_compression
= 0;
41 extern char sysctl_devname
[];
43 #ifdef CONFIG_IRDA_DEBUG
44 extern unsigned int irda_debug
;
48 static ctl_table irda_table
[] = {
49 { DISCOVERY
, "discovery", &sysctl_discovery
,
50 sizeof(int), 0644, NULL
, &proc_dointvec
},
51 { DEVNAME
, "devname", sysctl_devname
,
52 65, 0644, NULL
, &proc_dostring
, &sysctl_string
},
53 { COMPRESSION
, "compression", &sysctl_compression
,
54 sizeof(int), 0644, NULL
, &proc_dointvec
},
55 #ifdef CONFIG_IRDA_DEBUG
56 { DEBUG
, "debug", &irda_debug
,
57 sizeof(int), 0644, NULL
, &proc_dointvec
},
59 #ifdef CONFIG_IRDA_FAST_RR
60 { SLOTS
, "fast_poll_increase", &sysctl_fast_poll_increase
,
61 sizeof(int), 0644, NULL
, &proc_dointvec
},
63 { SLOTS
, "discovery_slots", &sysctl_discovery_slots
,
64 sizeof(int), 0644, NULL
, &proc_dointvec
},
65 { SLOT_TIMEOUT
, "slot_timeout", &sysctl_slot_timeout
,
66 sizeof(int), 0644, NULL
, &proc_dointvec
},
71 static ctl_table irda_net_table
[] = {
72 { NET_IRDA
, "irda", NULL
, 0, 0555, irda_table
},
76 /* The parent directory */
77 static ctl_table irda_root_table
[] = {
78 { CTL_NET
, "net", NULL
, 0, 0555, irda_net_table
},
82 static struct ctl_table_header
*irda_table_header
;
85 * Function irda_sysctl_register (void)
87 * Register our sysctl interface
90 int irda_sysctl_register(void)
92 irda_table_header
= register_sysctl_table( irda_root_table
, 0);
93 if ( !irda_table_header
)
99 * Function irda_sysctl_unregister (void)
101 * Unregister our sysctl interface
104 void irda_sysctl_unregister(void)
106 unregister_sysctl_table( irda_table_header
);