aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/batman-adv/translation-table.c
diff options
context:
space:
mode:
authorMarek Lindner <lindner_marek@yahoo.de>2010-05-07 21:47:22 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-11 13:42:39 -0700
commit208e13e4297a1d9b986aa371c4529df7dda1c835 (patch)
tree037587ed4e6df7004762e6e22593a61dc87c1079 /drivers/staging/batman-adv/translation-table.c
parentStaging: batman-adv: remove redundant pointer to originator interface (diff)
downloadlinux-dev-208e13e4297a1d9b986aa371c4529df7dda1c835.tar.xz
linux-dev-208e13e4297a1d9b986aa371c4529df7dda1c835.zip
Staging: batman-adv: move /proc interface handling to /sys
Instead of having a single /proc file "interfaces" in which you have to echo the wanted interface batman-adv will create a subfolder in each suitable /sys/class/net folder. This subfolder contains files for the interface specific settings. For example, mesh_iface to add/remove an interface from a virtual mesh network (at the moment only bat0 is supported). Example: echo bat0 > /sys/class/net/eth0/batman-adv/mesh_iface to deactivate: echo none > /sys/class/net/eth0/batman-adv/mesh_iface Interfaces which are not compatible with batman-adv won't contain the batman-adv folder, therefore can't be activated. Not supported are: loopback, non-ethernet, non-ARP and virtual mesh network interfaces 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/translation-table.c')
-rw-r--r--drivers/staging/batman-adv/translation-table.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/staging/batman-adv/translation-table.c b/drivers/staging/batman-adv/translation-table.c
index b735200ecf1b..c7a6635e34ad 100644
--- a/drivers/staging/batman-adv/translation-table.c
+++ b/drivers/staging/batman-adv/translation-table.c
@@ -159,16 +159,14 @@ int hna_local_fill_buffer(unsigned char *buff, int buff_len)
int hna_local_fill_buffer_text(struct net_device *net_dev, char *buff,
size_t count, loff_t off)
{
+ struct bat_priv *bat_priv = netdev_priv(net_dev);
struct hna_local_entry *hna_local_entry;
HASHIT(hashit);
int bytes_written = 0;
unsigned long flags;
size_t hdr_len;
- rcu_read_lock();
- if (list_empty(&if_list)) {
- rcu_read_unlock();
-
+ if (!bat_priv->primary_if) {
if (off == 0)
return sprintf(buff,
"BATMAN mesh %s disabled - please specify interfaces to enable it\n",
@@ -176,7 +174,6 @@ int hna_local_fill_buffer_text(struct net_device *net_dev, char *buff,
return 0;
}
- rcu_read_unlock();
hdr_len = sprintf(buff,
"Locally retrieved addresses (from %s) announced via HNA:\n",
@@ -376,16 +373,14 @@ void hna_global_add_orig(struct orig_node *orig_node,
int hna_global_fill_buffer_text(struct net_device *net_dev, char *buff,
size_t count, loff_t off)
{
+ struct bat_priv *bat_priv = netdev_priv(net_dev);
struct hna_global_entry *hna_global_entry;
HASHIT(hashit);
int bytes_written = 0;
unsigned long flags;
size_t hdr_len;
- rcu_read_lock();
- if (list_empty(&if_list)) {
- rcu_read_unlock();
-
+ if (!bat_priv->primary_if) {
if (off == 0)
return sprintf(buff,
"BATMAN mesh %s disabled - please specify interfaces to enable it\n",
@@ -393,7 +388,6 @@ int hna_global_fill_buffer_text(struct net_device *net_dev, char *buff,
return 0;
}
- rcu_read_unlock();
hdr_len = sprintf(buff,
"Globally announced HNAs received via the mesh %s (translation table):\n",