diff options
author | Marek Lindner <lindner_marek@yahoo.de> | 2010-05-07 21:47:18 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-11 13:42:39 -0700 |
commit | 47fdf097c348673dced571da8a15939005219da0 (patch) | |
tree | f5fbc972cf243db502a225a08ed18bd6eee56834 /drivers/staging/batman-adv/main.c | |
parent | 0887635b26e0cb6369c0438e55d9323d3aef3f69 (diff) | |
download | op-kernel-dev-47fdf097c348673dced571da8a15939005219da0.zip op-kernel-dev-47fdf097c348673dced571da8a15939005219da0.tar.gz |
Staging: batman-adv: convert multiple /proc files to use sysfs
This is the first patch in a series of patches which aim to convert
all batman-adv /proc files to sysfs. To keep the changes in a
digestable size it has been split up into smaller chunks. During
the transition period batman-adv will use /proc as well as sysfs.
As a first step the following files have been converted:
aggregate_ogm, originators, transtable_global, transtable_local
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/batman-adv/main.c')
-rw-r--r-- | drivers/staging/batman-adv/main.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/staging/batman-adv/main.c b/drivers/staging/batman-adv/main.c index 881aaa9..b5f8b80 100644 --- a/drivers/staging/batman-adv/main.c +++ b/drivers/staging/batman-adv/main.c @@ -21,6 +21,7 @@ #include "main.h" #include "proc.h" +#include "bat_sysfs.h" #include "routing.h" #include "send.h" #include "originator.h" @@ -44,7 +45,6 @@ DEFINE_SPINLOCK(forw_bcast_list_lock); atomic_t originator_interval; atomic_t vis_interval; atomic_t vis_mode; -atomic_t aggregation_enabled; int16_t num_hna; int16_t num_ifs; @@ -85,7 +85,6 @@ int init_module(void) atomic_set(&vis_interval, 1000);/* TODO: raise this later, this is only * for debugging now. */ atomic_set(&vis_mode, VIS_TYPE_CLIENT_UPDATE); - atomic_set(&aggregation_enabled, 1); /* the name should not be longer than 10 chars - see * http://lwn.net/Articles/23634/ */ @@ -116,6 +115,11 @@ int init_module(void) goto free_soft_device; } + retval = sysfs_add_meshif(soft_device); + + if (retval < 0) + goto unreg_soft_device; + register_netdevice_notifier(&hard_if_notifier); dev_add_pack(&batman_adv_packet_type); @@ -124,6 +128,8 @@ int init_module(void) return 0; +unreg_soft_device: + unregister_netdevice(soft_device); free_soft_device: free_netdev(soft_device); soft_device = NULL; @@ -136,6 +142,7 @@ void cleanup_module(void) shutdown_module(); if (soft_device) { + sysfs_del_meshif(soft_device); unregister_netdev(soft_device); soft_device = NULL; } |