blob: e2ebe358626313956ac432c8377ef1564b44805b [file] [log] [blame]
Arnaldo Carvalho de Melo590232a2005-09-22 04:30:44 -03001/*
2 * sysctl_net_llc.c: sysctl interface to LLC net subsystem.
YOSHIFUJI Hideakid57b1862007-02-09 23:25:01 +09003 *
Arnaldo Carvalho de Melo590232a2005-09-22 04:30:44 -03004 * Arnaldo Carvalho de Melo <acme@conectiva.com.br>
5 */
6
Arnaldo Carvalho de Melo590232a2005-09-22 04:30:44 -03007#include <linux/mm.h>
8#include <linux/init.h>
9#include <linux/sysctl.h>
Arnaldo Carvalho de Melo2928c192005-09-22 05:14:33 -030010#include <net/llc.h>
Arnaldo Carvalho de Melo590232a2005-09-22 04:30:44 -030011
12#ifndef CONFIG_SYSCTL
13#error This file should not be compiled without CONFIG_SYSCTL defined
14#endif
15
Arnaldo Carvalho de Melo590232a2005-09-22 04:30:44 -030016static struct ctl_table llc2_timeout_table[] = {
17 {
Arnaldo Carvalho de Melo590232a2005-09-22 04:30:44 -030018 .procname = "ack",
19 .data = &sysctl_llc2_ack_timeout,
20 .maxlen = sizeof(long),
21 .mode = 0644,
Alexey Dobriyan6d9f2392008-11-03 18:21:05 -080022 .proc_handler = proc_dointvec_jiffies,
Arnaldo Carvalho de Melo590232a2005-09-22 04:30:44 -030023 },
24 {
Arnaldo Carvalho de Melo590232a2005-09-22 04:30:44 -030025 .procname = "busy",
26 .data = &sysctl_llc2_busy_timeout,
27 .maxlen = sizeof(long),
28 .mode = 0644,
Alexey Dobriyan6d9f2392008-11-03 18:21:05 -080029 .proc_handler = proc_dointvec_jiffies,
Arnaldo Carvalho de Melo590232a2005-09-22 04:30:44 -030030 },
31 {
Arnaldo Carvalho de Melo590232a2005-09-22 04:30:44 -030032 .procname = "p",
33 .data = &sysctl_llc2_p_timeout,
34 .maxlen = sizeof(long),
35 .mode = 0644,
Alexey Dobriyan6d9f2392008-11-03 18:21:05 -080036 .proc_handler = proc_dointvec_jiffies,
Arnaldo Carvalho de Melo590232a2005-09-22 04:30:44 -030037 },
38 {
Arnaldo Carvalho de Melo590232a2005-09-22 04:30:44 -030039 .procname = "rej",
40 .data = &sysctl_llc2_rej_timeout,
41 .maxlen = sizeof(long),
42 .mode = 0644,
Alexey Dobriyan6d9f2392008-11-03 18:21:05 -080043 .proc_handler = proc_dointvec_jiffies,
Arnaldo Carvalho de Melo590232a2005-09-22 04:30:44 -030044 },
Eric W. Biedermanf8572d82009-11-05 13:32:03 -080045 { },
Arnaldo Carvalho de Melo590232a2005-09-22 04:30:44 -030046};
47
48static struct ctl_table llc_station_table[] = {
49 {
Arnaldo Carvalho de Melo590232a2005-09-22 04:30:44 -030050 .procname = "ack_timeout",
51 .data = &sysctl_llc_station_ack_timeout,
52 .maxlen = sizeof(long),
53 .mode = 0644,
Alexey Dobriyan6d9f2392008-11-03 18:21:05 -080054 .proc_handler = proc_dointvec_jiffies,
Arnaldo Carvalho de Melo590232a2005-09-22 04:30:44 -030055 },
Eric W. Biedermanf8572d82009-11-05 13:32:03 -080056 { },
Arnaldo Carvalho de Melo590232a2005-09-22 04:30:44 -030057};
58
59static struct ctl_table llc2_dir_timeout_table[] = {
60 {
Arnaldo Carvalho de Melo590232a2005-09-22 04:30:44 -030061 .procname = "timeout",
62 .mode = 0555,
63 .child = llc2_timeout_table,
YOSHIFUJI Hideakid57b1862007-02-09 23:25:01 +090064 },
Eric W. Biedermanf8572d82009-11-05 13:32:03 -080065 { },
Arnaldo Carvalho de Melo590232a2005-09-22 04:30:44 -030066};
67
68static struct ctl_table llc_table[] = {
69 {
Arnaldo Carvalho de Melo590232a2005-09-22 04:30:44 -030070 .procname = "llc2",
71 .mode = 0555,
72 .child = llc2_dir_timeout_table,
YOSHIFUJI Hideakid57b1862007-02-09 23:25:01 +090073 },
Arnaldo Carvalho de Melo590232a2005-09-22 04:30:44 -030074 {
Arnaldo Carvalho de Melo590232a2005-09-22 04:30:44 -030075 .procname = "station",
76 .mode = 0555,
77 .child = llc_station_table,
78 },
Eric W. Biedermanf8572d82009-11-05 13:32:03 -080079 { },
Arnaldo Carvalho de Melo590232a2005-09-22 04:30:44 -030080};
81
Pavel Emelyanovb5ccd792008-01-09 00:30:05 -080082static struct ctl_path llc_path[] = {
Eric W. Biedermanf8572d82009-11-05 13:32:03 -080083 { .procname = "net", },
84 { .procname = "llc", },
Pavel Emelyanovb5ccd792008-01-09 00:30:05 -080085 { }
Arnaldo Carvalho de Melo590232a2005-09-22 04:30:44 -030086};
87
88static struct ctl_table_header *llc_table_header;
89
90int __init llc_sysctl_init(void)
91{
Pavel Emelyanovb5ccd792008-01-09 00:30:05 -080092 llc_table_header = register_sysctl_paths(llc_path, llc_table);
Arnaldo Carvalho de Melo590232a2005-09-22 04:30:44 -030093
94 return llc_table_header ? 0 : -ENOMEM;
95}
96
97void llc_sysctl_exit(void)
98{
99 if (llc_table_header) {
100 unregister_sysctl_table(llc_table_header);
101 llc_table_header = NULL;
102 }
103}