Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
[linux/fpc-iii.git] / net / rxrpc / sysctl.c
blob6374df7e77d1bfeb3558efd37e769e8e1b60f834
1 /* sysctl.c: Rx RPC control
3 * Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
12 #include <linux/sched.h>
13 #include <linux/slab.h>
14 #include <linux/module.h>
15 #include <linux/sysctl.h>
16 #include <rxrpc/types.h>
17 #include <rxrpc/rxrpc.h>
18 #include <asm/errno.h>
19 #include "internal.h"
21 int rxrpc_ktrace;
22 int rxrpc_kdebug;
23 int rxrpc_kproto;
24 int rxrpc_knet;
26 #ifdef CONFIG_SYSCTL
27 static struct ctl_table_header *rxrpc_sysctl = NULL;
29 static ctl_table rxrpc_sysctl_table[] = {
31 .ctl_name = 1,
32 .procname = "kdebug",
33 .data = &rxrpc_kdebug,
34 .maxlen = sizeof(int),
35 .mode = 0644,
36 .proc_handler = &proc_dointvec
39 .ctl_name = 2,
40 .procname = "ktrace",
41 .data = &rxrpc_ktrace,
42 .maxlen = sizeof(int),
43 .mode = 0644,
44 .proc_handler = &proc_dointvec
47 .ctl_name = 3,
48 .procname = "kproto",
49 .data = &rxrpc_kproto,
50 .maxlen = sizeof(int),
51 .mode = 0644,
52 .proc_handler = &proc_dointvec
55 .ctl_name = 4,
56 .procname = "knet",
57 .data = &rxrpc_knet,
58 .maxlen = sizeof(int),
59 .mode = 0644,
60 .proc_handler = &proc_dointvec
63 .ctl_name = 5,
64 .procname = "peertimo",
65 .data = &rxrpc_peer_timeout,
66 .maxlen = sizeof(unsigned long),
67 .mode = 0644,
68 .proc_handler = &proc_doulongvec_minmax
71 .ctl_name = 6,
72 .procname = "conntimo",
73 .data = &rxrpc_conn_timeout,
74 .maxlen = sizeof(unsigned long),
75 .mode = 0644,
76 .proc_handler = &proc_doulongvec_minmax
78 { .ctl_name = 0 }
81 static ctl_table rxrpc_dir_sysctl_table[] = {
83 .ctl_name = 1,
84 .procname = "rxrpc",
85 .maxlen = 0,
86 .mode = 0555,
87 .child = rxrpc_sysctl_table
89 { .ctl_name = 0 }
91 #endif /* CONFIG_SYSCTL */
93 /*****************************************************************************/
95 * initialise the sysctl stuff for Rx RPC
97 int rxrpc_sysctl_init(void)
99 #ifdef CONFIG_SYSCTL
100 rxrpc_sysctl = register_sysctl_table(rxrpc_dir_sysctl_table, 0);
101 if (!rxrpc_sysctl)
102 return -ENOMEM;
103 #endif /* CONFIG_SYSCTL */
105 return 0;
106 } /* end rxrpc_sysctl_init() */
108 /*****************************************************************************/
110 * clean up the sysctl stuff for Rx RPC
112 void rxrpc_sysctl_cleanup(void)
114 #ifdef CONFIG_SYSCTL
115 if (rxrpc_sysctl) {
116 unregister_sysctl_table(rxrpc_sysctl);
117 rxrpc_sysctl = NULL;
119 #endif /* CONFIG_SYSCTL */
121 } /* end rxrpc_sysctl_cleanup() */