Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Kernel v2.6.25-rc7 /net/802/tr.c

Filename:/net/802/tr.c
Lines Added:26
Lines Deleted:5
Also changed in: (Previous) 2.6.25-rc6  2.6.25-rc5  2.6.25-rc4  2.6.25-rc3  2.6.25-rc2  2.6.25-rc1 
(Following) 2.6.25-rc8  2.6.25-rc9  2.6.25 

Location
[  2.6.25-rc7
  [  net
    [  802
       o  tr.c

Patch

diff --git a/net/802/tr.c b/net/802/tr.c
index 1e115e5..18c6647 100644
--- a/net/802/tr.c
+++ b/net/802/tr.c
@@ -35,6 +35,7 @@
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 #include <linux/init.h>
+#include <linux/sysctl.h>
 #include <net/arp.h>
 #include <net/net_namespace.h>
 
@@ -75,7 +76,7 @@ static DEFINE_SPINLOCK(rif_lock);
 
 static struct timer_list rif_timer;
 
-int sysctl_tr_rif_timeout = 60*10*HZ;
+static int sysctl_tr_rif_timeout = 60*10*HZ;
 
 static inline unsigned long rif_hash(const unsigned char *addr)
 {
@@ -634,6 +635,26 @@ struct net_device *alloc_trdev(int sizeof_priv)
    return alloc_netdev(sizeof_priv, "tr%d", tr_setup);
 }
 
+#ifdef CONFIG_SYSCTL
+static struct ctl_table tr_table[] = {
+   {
+      .ctl_name   = NET_TR_RIF_TIMEOUT,
+      .procname   = "rif_timeout",
+      .data      = &sysctl_tr_rif_timeout,
+      .maxlen      = sizeof(int),
+      .mode      = 0644,
+      .proc_handler   = &proc_dointvec
+   },
+   { 0 },
+};
+
+static __initdata struct ctl_path tr_path[] = {
+   { .procname = "net", .ctl_name = CTL_NET, },
+   { .procname = "token-ring", .ctl_name = NET_TR, },
+   { }
+};
+#endif
+
 /*
  *   Called during bootup.  We don't actually have to initialise
  *   too much for this.
@@ -641,12 +662,12 @@ struct net_device *alloc_trdev(int sizeof_priv)
 
 static int __init rif_init(void)
 {
-   init_timer(&rif_timer);
    rif_timer.expires  = jiffies + sysctl_tr_rif_timeout;
-   rif_timer.data     = 0L;
-   rif_timer.function = rif_check_expire;
+   setup_timer(&rif_timer, rif_check_expire, 0);
    add_timer(&rif_timer);
-
+#ifdef CONFIG_SYSCTL
+   register_sysctl_paths(tr_path, tr_table);
+#endif
    proc_net_fops_create(&init_net, "tr_rif", S_IRUGO, &rif_seq_fops);
    return 0;
 }


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.