diff options
| author | Pavel Emelyanov <xemul@openvz.org> | 2008-01-24 20:04:49 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:56:28 -0500 |
| commit | 36f0bebd9865dc7e327777fca34b75e65cbfd1a6 (patch) | |
| tree | 394626193facaaa5dd86e284617c74fb6c8a0494 /net/802 | |
| parent | 3e37c3f9978839d91188e4ca0cc662a7245f28e4 (diff) | |
[TR]: Use ctl paths to register net/token-ring/ table
The same thing for token-ring - use ctl paths and get
rid of external references on the tr_table.
Unfortunately, I couldn't split this patch into cleanup and
use-the-paths parts.
As a lame excuse I can say, that the cleanup is just moving
the tr_table from one file to another - closet to a single
variable, that this ctl table tunes. Since the source file
becomes empty after the move, I remove it.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/802')
| -rw-r--r-- | net/802/Makefile | 3 | ||||
| -rw-r--r-- | net/802/sysctl_net_802.c | 33 | ||||
| -rw-r--r-- | net/802/tr.c | 25 |
3 files changed, 25 insertions, 36 deletions
diff --git a/net/802/Makefile b/net/802/Makefile index 977704a54f68..68569ffddea1 100644 --- a/net/802/Makefile +++ b/net/802/Makefile | |||
| @@ -3,9 +3,8 @@ | |||
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | # Check the p8022 selections against net/core/Makefile. | 5 | # Check the p8022 selections against net/core/Makefile. |
| 6 | obj-$(CONFIG_SYSCTL) += sysctl_net_802.o | ||
| 7 | obj-$(CONFIG_LLC) += p8022.o psnap.o | 6 | obj-$(CONFIG_LLC) += p8022.o psnap.o |
| 8 | obj-$(CONFIG_TR) += p8022.o psnap.o tr.o sysctl_net_802.o | 7 | obj-$(CONFIG_TR) += p8022.o psnap.o tr.o |
| 9 | obj-$(CONFIG_NET_FC) += fc.o | 8 | obj-$(CONFIG_NET_FC) += fc.o |
| 10 | obj-$(CONFIG_FDDI) += fddi.o | 9 | obj-$(CONFIG_FDDI) += fddi.o |
| 11 | obj-$(CONFIG_HIPPI) += hippi.o | 10 | obj-$(CONFIG_HIPPI) += hippi.o |
diff --git a/net/802/sysctl_net_802.c b/net/802/sysctl_net_802.c deleted file mode 100644 index ead56037398b..000000000000 --- a/net/802/sysctl_net_802.c +++ /dev/null | |||
| @@ -1,33 +0,0 @@ | |||
| 1 | /* -*- linux-c -*- | ||
| 2 | * sysctl_net_802.c: sysctl interface to net 802 subsystem. | ||
| 3 | * | ||
| 4 | * Begun April 1, 1996, Mike Shaver. | ||
| 5 | * Added /proc/sys/net/802 directory entry (empty =) ). [MS] | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or | ||
| 8 | * modify it under the terms of the GNU General Public License | ||
| 9 | * as published by the Free Software Foundation; either version | ||
| 10 | * 2 of the License, or (at your option) any later version. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #include <linux/mm.h> | ||
| 14 | #include <linux/if_tr.h> | ||
| 15 | #include <linux/sysctl.h> | ||
| 16 | |||
| 17 | #ifdef CONFIG_TR | ||
| 18 | extern int sysctl_tr_rif_timeout; | ||
| 19 | #endif | ||
| 20 | |||
| 21 | struct ctl_table tr_table[] = { | ||
| 22 | #ifdef CONFIG_TR | ||
| 23 | { | ||
| 24 | .ctl_name = NET_TR_RIF_TIMEOUT, | ||
| 25 | .procname = "rif_timeout", | ||
| 26 | .data = &sysctl_tr_rif_timeout, | ||
| 27 | .maxlen = sizeof(int), | ||
| 28 | .mode = 0644, | ||
| 29 | .proc_handler = &proc_dointvec | ||
| 30 | }, | ||
| 31 | #endif /* CONFIG_TR */ | ||
| 32 | { 0 }, | ||
| 33 | }; | ||
diff --git a/net/802/tr.c b/net/802/tr.c index 151855dd4599..3f16b1720554 100644 --- a/net/802/tr.c +++ b/net/802/tr.c | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | #include <linux/proc_fs.h> | 35 | #include <linux/proc_fs.h> |
| 36 | #include <linux/seq_file.h> | 36 | #include <linux/seq_file.h> |
| 37 | #include <linux/init.h> | 37 | #include <linux/init.h> |
| 38 | #include <linux/sysctl.h> | ||
| 38 | #include <net/arp.h> | 39 | #include <net/arp.h> |
| 39 | #include <net/net_namespace.h> | 40 | #include <net/net_namespace.h> |
| 40 | 41 | ||
| @@ -634,6 +635,26 @@ struct net_device *alloc_trdev(int sizeof_priv) | |||
| 634 | return alloc_netdev(sizeof_priv, "tr%d", tr_setup); | 635 | return alloc_netdev(sizeof_priv, "tr%d", tr_setup); |
| 635 | } | 636 | } |
| 636 | 637 | ||
| 638 | #ifdef CONFIG_SYSCTL | ||
| 639 | static struct ctl_table tr_table[] = { | ||
| 640 | { | ||
| 641 | .ctl_name = NET_TR_RIF_TIMEOUT, | ||
| 642 | .procname = "rif_timeout", | ||
| 643 | .data = &sysctl_tr_rif_timeout, | ||
| 644 | .maxlen = sizeof(int), | ||
| 645 | .mode = 0644, | ||
| 646 | .proc_handler = &proc_dointvec | ||
| 647 | }, | ||
| 648 | { 0 }, | ||
| 649 | }; | ||
| 650 | |||
| 651 | static __initdata struct ctl_path tr_path[] = { | ||
| 652 | { .procname = "net", .ctl_name = CTL_NET, }, | ||
| 653 | { .procname = "token-ring", .ctl_name = NET_TR, }, | ||
| 654 | { } | ||
| 655 | }; | ||
| 656 | #endif | ||
| 657 | |||
| 637 | /* | 658 | /* |
| 638 | * Called during bootup. We don't actually have to initialise | 659 | * Called during bootup. We don't actually have to initialise |
| 639 | * too much for this. | 660 | * too much for this. |
| @@ -644,7 +665,9 @@ static int __init rif_init(void) | |||
| 644 | rif_timer.expires = jiffies + sysctl_tr_rif_timeout; | 665 | rif_timer.expires = jiffies + sysctl_tr_rif_timeout; |
| 645 | setup_timer(&rif_timer, rif_check_expire, 0); | 666 | setup_timer(&rif_timer, rif_check_expire, 0); |
| 646 | add_timer(&rif_timer); | 667 | add_timer(&rif_timer); |
| 647 | 668 | #ifdef CONFIG_SYSCTL | |
| 669 | register_sysctl_paths(tr_path, tr_table); | ||
| 670 | #endif | ||
| 648 | proc_net_fops_create(&init_net, "tr_rif", S_IRUGO, &rif_seq_fops); | 671 | proc_net_fops_create(&init_net, "tr_rif", S_IRUGO, &rif_seq_fops); |
| 649 | return 0; | 672 | return 0; |
| 650 | } | 673 | } |
