Arnaldo Carvalho de Melo | 590232a | 2005-09-22 04:30:44 -0300 | [diff] [blame] | 1 | /* |
| 2 | * sysctl_net_llc.c: sysctl interface to LLC net subsystem. |
YOSHIFUJI Hideaki | d57b186 | 2007-02-09 23:25:01 +0900 | [diff] [blame] | 3 | * |
Arnaldo Carvalho de Melo | 590232a | 2005-09-22 04:30:44 -0300 | [diff] [blame] | 4 | * Arnaldo Carvalho de Melo <acme@conectiva.com.br> |
| 5 | */ |
| 6 | |
Arnaldo Carvalho de Melo | 590232a | 2005-09-22 04:30:44 -0300 | [diff] [blame] | 7 | #include <linux/mm.h> |
| 8 | #include <linux/init.h> |
| 9 | #include <linux/sysctl.h> |
Arnaldo Carvalho de Melo | 2928c19 | 2005-09-22 05:14:33 -0300 | [diff] [blame] | 10 | #include <net/llc.h> |
Arnaldo Carvalho de Melo | 590232a | 2005-09-22 04:30:44 -0300 | [diff] [blame] | 11 | |
| 12 | #ifndef CONFIG_SYSCTL |
| 13 | #error This file should not be compiled without CONFIG_SYSCTL defined |
| 14 | #endif |
| 15 | |
Arnaldo Carvalho de Melo | 590232a | 2005-09-22 04:30:44 -0300 | [diff] [blame] | 16 | static struct ctl_table llc2_timeout_table[] = { |
| 17 | { |
| 18 | .ctl_name = NET_LLC2_ACK_TIMEOUT, |
| 19 | .procname = "ack", |
| 20 | .data = &sysctl_llc2_ack_timeout, |
| 21 | .maxlen = sizeof(long), |
| 22 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 23 | .proc_handler = proc_dointvec_jiffies, |
| 24 | .strategy = sysctl_jiffies, |
Arnaldo Carvalho de Melo | 590232a | 2005-09-22 04:30:44 -0300 | [diff] [blame] | 25 | }, |
| 26 | { |
| 27 | .ctl_name = NET_LLC2_BUSY_TIMEOUT, |
| 28 | .procname = "busy", |
| 29 | .data = &sysctl_llc2_busy_timeout, |
| 30 | .maxlen = sizeof(long), |
| 31 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 32 | .proc_handler = proc_dointvec_jiffies, |
| 33 | .strategy = sysctl_jiffies, |
Arnaldo Carvalho de Melo | 590232a | 2005-09-22 04:30:44 -0300 | [diff] [blame] | 34 | }, |
| 35 | { |
| 36 | .ctl_name = NET_LLC2_P_TIMEOUT, |
| 37 | .procname = "p", |
| 38 | .data = &sysctl_llc2_p_timeout, |
| 39 | .maxlen = sizeof(long), |
| 40 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 41 | .proc_handler = proc_dointvec_jiffies, |
| 42 | .strategy = sysctl_jiffies, |
Arnaldo Carvalho de Melo | 590232a | 2005-09-22 04:30:44 -0300 | [diff] [blame] | 43 | }, |
| 44 | { |
| 45 | .ctl_name = NET_LLC2_REJ_TIMEOUT, |
| 46 | .procname = "rej", |
| 47 | .data = &sysctl_llc2_rej_timeout, |
| 48 | .maxlen = sizeof(long), |
| 49 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 50 | .proc_handler = proc_dointvec_jiffies, |
| 51 | .strategy = sysctl_jiffies, |
Arnaldo Carvalho de Melo | 590232a | 2005-09-22 04:30:44 -0300 | [diff] [blame] | 52 | }, |
| 53 | { 0 }, |
| 54 | }; |
| 55 | |
| 56 | static struct ctl_table llc_station_table[] = { |
| 57 | { |
| 58 | .ctl_name = NET_LLC_STATION_ACK_TIMEOUT, |
| 59 | .procname = "ack_timeout", |
| 60 | .data = &sysctl_llc_station_ack_timeout, |
| 61 | .maxlen = sizeof(long), |
| 62 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 63 | .proc_handler = proc_dointvec_jiffies, |
| 64 | .strategy = sysctl_jiffies, |
Arnaldo Carvalho de Melo | 590232a | 2005-09-22 04:30:44 -0300 | [diff] [blame] | 65 | }, |
| 66 | { 0 }, |
| 67 | }; |
| 68 | |
| 69 | static struct ctl_table llc2_dir_timeout_table[] = { |
| 70 | { |
| 71 | .ctl_name = NET_LLC2, |
| 72 | .procname = "timeout", |
| 73 | .mode = 0555, |
| 74 | .child = llc2_timeout_table, |
YOSHIFUJI Hideaki | d57b186 | 2007-02-09 23:25:01 +0900 | [diff] [blame] | 75 | }, |
Arnaldo Carvalho de Melo | 590232a | 2005-09-22 04:30:44 -0300 | [diff] [blame] | 76 | { 0 }, |
| 77 | }; |
| 78 | |
| 79 | static struct ctl_table llc_table[] = { |
| 80 | { |
| 81 | .ctl_name = NET_LLC2, |
| 82 | .procname = "llc2", |
| 83 | .mode = 0555, |
| 84 | .child = llc2_dir_timeout_table, |
YOSHIFUJI Hideaki | d57b186 | 2007-02-09 23:25:01 +0900 | [diff] [blame] | 85 | }, |
Arnaldo Carvalho de Melo | 590232a | 2005-09-22 04:30:44 -0300 | [diff] [blame] | 86 | { |
| 87 | .ctl_name = NET_LLC_STATION, |
| 88 | .procname = "station", |
| 89 | .mode = 0555, |
| 90 | .child = llc_station_table, |
| 91 | }, |
| 92 | { 0 }, |
| 93 | }; |
| 94 | |
Pavel Emelyanov | b5ccd79 | 2008-01-09 00:30:05 -0800 | [diff] [blame] | 95 | static struct ctl_path llc_path[] = { |
| 96 | { .procname = "net", .ctl_name = CTL_NET, }, |
| 97 | { .procname = "llc", .ctl_name = NET_LLC, }, |
| 98 | { } |
Arnaldo Carvalho de Melo | 590232a | 2005-09-22 04:30:44 -0300 | [diff] [blame] | 99 | }; |
| 100 | |
| 101 | static struct ctl_table_header *llc_table_header; |
| 102 | |
| 103 | int __init llc_sysctl_init(void) |
| 104 | { |
Pavel Emelyanov | b5ccd79 | 2008-01-09 00:30:05 -0800 | [diff] [blame] | 105 | llc_table_header = register_sysctl_paths(llc_path, llc_table); |
Arnaldo Carvalho de Melo | 590232a | 2005-09-22 04:30:44 -0300 | [diff] [blame] | 106 | |
| 107 | return llc_table_header ? 0 : -ENOMEM; |
| 108 | } |
| 109 | |
| 110 | void llc_sysctl_exit(void) |
| 111 | { |
| 112 | if (llc_table_header) { |
| 113 | unregister_sysctl_table(llc_table_header); |
| 114 | llc_table_header = NULL; |
| 115 | } |
| 116 | } |