aboutsummaryrefslogtreecommitdiffstats
path: root/net/decnet/dn_dev.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2009-11-05 16:32:03 -0500
committerEric W. Biederman <ebiederm@xmission.com>2009-11-12 05:05:06 -0500
commitf8572d8f2a2ba75408b97dc24ef47c83671795d7 (patch)
tree052506a457939fea00d138d3a982d778df34e14c /net/decnet/dn_dev.c
parent86b1bc68e2f4244e4ea5db5458df9d19259fbb30 (diff)
sysctl net: Remove unused binary sysctl code
Now that sys_sysctl is a compatiblity wrapper around /proc/sys all sysctl strategy routines, and all ctl_name and strategy entries in the sysctl tables are unused, and can be revmoed. In addition neigh_sysctl_register has been modified to no longer take a strategy argument and it's callers have been modified not to pass one. Cc: "David Miller" <davem@davemloft.net> Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org> Cc: netdev@vger.kernel.org Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'net/decnet/dn_dev.c')
-rw-r--r--net/decnet/dn_dev.c64
1 files changed, 3 insertions, 61 deletions
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index 6e1f085db06a..1b1daeb151f2 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -89,7 +89,6 @@ static struct dn_dev_parms dn_dev_list[] = {
89 .t2 = 1, 89 .t2 = 1,
90 .t3 = 10, 90 .t3 = 10,
91 .name = "ethernet", 91 .name = "ethernet",
92 .ctl_name = NET_DECNET_CONF_ETHER,
93 .up = dn_eth_up, 92 .up = dn_eth_up,
94 .down = dn_eth_down, 93 .down = dn_eth_down,
95 .timer3 = dn_send_brd_hello, 94 .timer3 = dn_send_brd_hello,
@@ -101,7 +100,6 @@ static struct dn_dev_parms dn_dev_list[] = {
101 .t2 = 1, 100 .t2 = 1,
102 .t3 = 10, 101 .t3 = 10,
103 .name = "ipgre", 102 .name = "ipgre",
104 .ctl_name = NET_DECNET_CONF_GRE,
105 .timer3 = dn_send_brd_hello, 103 .timer3 = dn_send_brd_hello,
106}, 104},
107#if 0 105#if 0
@@ -112,7 +110,6 @@ static struct dn_dev_parms dn_dev_list[] = {
112 .t2 = 1, 110 .t2 = 1,
113 .t3 = 120, 111 .t3 = 120,
114 .name = "x25", 112 .name = "x25",
115 .ctl_name = NET_DECNET_CONF_X25,
116 .timer3 = dn_send_ptp_hello, 113 .timer3 = dn_send_ptp_hello,
117}, 114},
118#endif 115#endif
@@ -124,7 +121,6 @@ static struct dn_dev_parms dn_dev_list[] = {
124 .t2 = 1, 121 .t2 = 1,
125 .t3 = 10, 122 .t3 = 10,
126 .name = "ppp", 123 .name = "ppp",
127 .ctl_name = NET_DECNET_CONF_PPP,
128 .timer3 = dn_send_brd_hello, 124 .timer3 = dn_send_brd_hello,
129}, 125},
130#endif 126#endif
@@ -135,7 +131,6 @@ static struct dn_dev_parms dn_dev_list[] = {
135 .t2 = 1, 131 .t2 = 1,
136 .t3 = 120, 132 .t3 = 120,
137 .name = "ddcmp", 133 .name = "ddcmp",
138 .ctl_name = NET_DECNET_CONF_DDCMP,
139 .timer3 = dn_send_ptp_hello, 134 .timer3 = dn_send_ptp_hello,
140}, 135},
141{ 136{
@@ -145,7 +140,6 @@ static struct dn_dev_parms dn_dev_list[] = {
145 .t2 = 1, 140 .t2 = 1,
146 .t3 = 10, 141 .t3 = 10,
147 .name = "loopback", 142 .name = "loopback",
148 .ctl_name = NET_DECNET_CONF_LOOPBACK,
149 .timer3 = dn_send_brd_hello, 143 .timer3 = dn_send_brd_hello,
150} 144}
151}; 145};
@@ -166,10 +160,6 @@ static int max_priority[] = { 127 }; /* From DECnet spec */
166 160
167static int dn_forwarding_proc(ctl_table *, int, 161static int dn_forwarding_proc(ctl_table *, int,
168 void __user *, size_t *, loff_t *); 162 void __user *, size_t *, loff_t *);
169static int dn_forwarding_sysctl(ctl_table *table,
170 void __user *oldval, size_t __user *oldlenp,
171 void __user *newval, size_t newlen);
172
173static struct dn_dev_sysctl_table { 163static struct dn_dev_sysctl_table {
174 struct ctl_table_header *sysctl_header; 164 struct ctl_table_header *sysctl_header;
175 ctl_table dn_dev_vars[5]; 165 ctl_table dn_dev_vars[5];
@@ -177,44 +167,36 @@ static struct dn_dev_sysctl_table {
177 NULL, 167 NULL,
178 { 168 {
179 { 169 {
180 .ctl_name = NET_DECNET_CONF_DEV_FORWARDING,
181 .procname = "forwarding", 170 .procname = "forwarding",
182 .data = (void *)DN_DEV_PARMS_OFFSET(forwarding), 171 .data = (void *)DN_DEV_PARMS_OFFSET(forwarding),
183 .maxlen = sizeof(int), 172 .maxlen = sizeof(int),
184 .mode = 0644, 173 .mode = 0644,
185 .proc_handler = dn_forwarding_proc, 174 .proc_handler = dn_forwarding_proc,
186 .strategy = dn_forwarding_sysctl,
187 }, 175 },
188 { 176 {
189 .ctl_name = NET_DECNET_CONF_DEV_PRIORITY,
190 .procname = "priority", 177 .procname = "priority",
191 .data = (void *)DN_DEV_PARMS_OFFSET(priority), 178 .data = (void *)DN_DEV_PARMS_OFFSET(priority),
192 .maxlen = sizeof(int), 179 .maxlen = sizeof(int),
193 .mode = 0644, 180 .mode = 0644,
194 .proc_handler = proc_dointvec_minmax, 181 .proc_handler = proc_dointvec_minmax,
195 .strategy = sysctl_intvec,
196 .extra1 = &min_priority, 182 .extra1 = &min_priority,
197 .extra2 = &max_priority 183 .extra2 = &max_priority
198 }, 184 },
199 { 185 {
200 .ctl_name = NET_DECNET_CONF_DEV_T2,
201 .procname = "t2", 186 .procname = "t2",
202 .data = (void *)DN_DEV_PARMS_OFFSET(t2), 187 .data = (void *)DN_DEV_PARMS_OFFSET(t2),
203 .maxlen = sizeof(int), 188 .maxlen = sizeof(int),
204 .mode = 0644, 189 .mode = 0644,
205 .proc_handler = proc_dointvec_minmax, 190 .proc_handler = proc_dointvec_minmax,
206 .strategy = sysctl_intvec,
207 .extra1 = &min_t2, 191 .extra1 = &min_t2,
208 .extra2 = &max_t2 192 .extra2 = &max_t2
209 }, 193 },
210 { 194 {
211 .ctl_name = NET_DECNET_CONF_DEV_T3,
212 .procname = "t3", 195 .procname = "t3",
213 .data = (void *)DN_DEV_PARMS_OFFSET(t3), 196 .data = (void *)DN_DEV_PARMS_OFFSET(t3),
214 .maxlen = sizeof(int), 197 .maxlen = sizeof(int),
215 .mode = 0644, 198 .mode = 0644,
216 .proc_handler = proc_dointvec_minmax, 199 .proc_handler = proc_dointvec_minmax,
217 .strategy = sysctl_intvec,
218 .extra1 = &min_t3, 200 .extra1 = &min_t3,
219 .extra2 = &max_t3 201 .extra2 = &max_t3
220 }, 202 },
@@ -230,9 +212,9 @@ static void dn_dev_sysctl_register(struct net_device *dev, struct dn_dev_parms *
230#define DN_CTL_PATH_DEV 3 212#define DN_CTL_PATH_DEV 3
231 213
232 struct ctl_path dn_ctl_path[] = { 214 struct ctl_path dn_ctl_path[] = {
233 { .procname = "net", .ctl_name = CTL_NET, }, 215 { .procname = "net", },
234 { .procname = "decnet", .ctl_name = NET_DECNET, }, 216 { .procname = "decnet", },
235 { .procname = "conf", .ctl_name = NET_DECNET_CONF, }, 217 { .procname = "conf", },
236 { /* to be set */ }, 218 { /* to be set */ },
237 { }, 219 { },
238 }; 220 };
@@ -248,10 +230,8 @@ static void dn_dev_sysctl_register(struct net_device *dev, struct dn_dev_parms *
248 230
249 if (dev) { 231 if (dev) {
250 dn_ctl_path[DN_CTL_PATH_DEV].procname = dev->name; 232 dn_ctl_path[DN_CTL_PATH_DEV].procname = dev->name;
251 dn_ctl_path[DN_CTL_PATH_DEV].ctl_name = dev->ifindex;
252 } else { 233 } else {
253 dn_ctl_path[DN_CTL_PATH_DEV].procname = parms->name; 234 dn_ctl_path[DN_CTL_PATH_DEV].procname = parms->name;
254 dn_ctl_path[DN_CTL_PATH_DEV].ctl_name = parms->ctl_name;
255 } 235 }
256 236
257 t->dn_dev_vars[0].extra1 = (void *)dev; 237 t->dn_dev_vars[0].extra1 = (void *)dev;
@@ -317,44 +297,6 @@ static int dn_forwarding_proc(ctl_table *table, int write,
317#endif 297#endif
318} 298}
319 299
320static int dn_forwarding_sysctl(ctl_table *table,
321 void __user *oldval, size_t __user *oldlenp,
322 void __user *newval, size_t newlen)
323{
324#ifdef CONFIG_DECNET_ROUTER
325 struct net_device *dev = table->extra1;
326 struct dn_dev *dn_db;
327 int value;
328
329 if (table->extra1 == NULL)
330 return -EINVAL;
331
332 dn_db = dev->dn_ptr;
333
334 if (newval && newlen) {
335 if (newlen != sizeof(int))
336 return -EINVAL;
337
338 if (get_user(value, (int __user *)newval))
339 return -EFAULT;
340 if (value < 0)
341 return -EINVAL;
342 if (value > 2)
343 return -EINVAL;
344
345 if (dn_db->parms.down)
346 dn_db->parms.down(dev);
347 dn_db->parms.forwarding = value;
348 if (dn_db->parms.up)
349 dn_db->parms.up(dev);
350 }
351
352 return 0;
353#else
354 return -EINVAL;
355#endif
356}
357
358#else /* CONFIG_SYSCTL */ 300#else /* CONFIG_SYSCTL */
359static void dn_dev_sysctl_unregister(struct dn_dev_parms *parms) 301static void dn_dev_sysctl_unregister(struct dn_dev_parms *parms)
360{ 302{