diff options
author | Marek Lindner <lindner_marek@yahoo.de> | 2011-11-28 11:15:37 -0500 |
---|---|---|
committer | Marek Lindner <lindner_marek@yahoo.de> | 2012-02-16 13:50:20 -0500 |
commit | ea3d2fd1b11fb3ef8706a48ece0a49a61bcd08bc (patch) | |
tree | f2c9c945d6a73540569f796363b2899ad75656d3 /net/batman-adv | |
parent | d419be1fd1e4417adc833365a3b69d0968c27c3f (diff) |
batman-adv: export used routing algorithm via sysfs
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net/batman-adv')
-rw-r--r-- | net/batman-adv/bat_sysfs.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/batman-adv/bat_sysfs.c b/net/batman-adv/bat_sysfs.c index c25492f7d665..480ae0a5ba43 100644 --- a/net/batman-adv/bat_sysfs.c +++ b/net/batman-adv/bat_sysfs.c | |||
@@ -272,6 +272,13 @@ static ssize_t store_vis_mode(struct kobject *kobj, struct attribute *attr, | |||
272 | return count; | 272 | return count; |
273 | } | 273 | } |
274 | 274 | ||
275 | static ssize_t show_bat_algo(struct kobject *kobj, struct attribute *attr, | ||
276 | char *buff) | ||
277 | { | ||
278 | struct bat_priv *bat_priv = kobj_to_batpriv(kobj); | ||
279 | return sprintf(buff, "%s\n", bat_priv->bat_algo_ops->name); | ||
280 | } | ||
281 | |||
275 | static void post_gw_deselect(struct net_device *net_dev) | 282 | static void post_gw_deselect(struct net_device *net_dev) |
276 | { | 283 | { |
277 | struct bat_priv *bat_priv = netdev_priv(net_dev); | 284 | struct bat_priv *bat_priv = netdev_priv(net_dev); |
@@ -382,6 +389,7 @@ BAT_ATTR_BOOL(bonding, S_IRUGO | S_IWUSR, NULL); | |||
382 | BAT_ATTR_BOOL(fragmentation, S_IRUGO | S_IWUSR, update_min_mtu); | 389 | BAT_ATTR_BOOL(fragmentation, S_IRUGO | S_IWUSR, update_min_mtu); |
383 | BAT_ATTR_BOOL(ap_isolation, S_IRUGO | S_IWUSR, NULL); | 390 | BAT_ATTR_BOOL(ap_isolation, S_IRUGO | S_IWUSR, NULL); |
384 | static BAT_ATTR(vis_mode, S_IRUGO | S_IWUSR, show_vis_mode, store_vis_mode); | 391 | static BAT_ATTR(vis_mode, S_IRUGO | S_IWUSR, show_vis_mode, store_vis_mode); |
392 | static BAT_ATTR(routing_algo, S_IRUGO, show_bat_algo, NULL); | ||
385 | static BAT_ATTR(gw_mode, S_IRUGO | S_IWUSR, show_gw_mode, store_gw_mode); | 393 | static BAT_ATTR(gw_mode, S_IRUGO | S_IWUSR, show_gw_mode, store_gw_mode); |
386 | BAT_ATTR_UINT(orig_interval, S_IRUGO | S_IWUSR, 2 * JITTER, INT_MAX, NULL); | 394 | BAT_ATTR_UINT(orig_interval, S_IRUGO | S_IWUSR, 2 * JITTER, INT_MAX, NULL); |
387 | BAT_ATTR_UINT(hop_penalty, S_IRUGO | S_IWUSR, 0, TQ_MAX_VALUE, NULL); | 395 | BAT_ATTR_UINT(hop_penalty, S_IRUGO | S_IWUSR, 0, TQ_MAX_VALUE, NULL); |
@@ -399,6 +407,7 @@ static struct bat_attribute *mesh_attrs[] = { | |||
399 | &bat_attr_fragmentation, | 407 | &bat_attr_fragmentation, |
400 | &bat_attr_ap_isolation, | 408 | &bat_attr_ap_isolation, |
401 | &bat_attr_vis_mode, | 409 | &bat_attr_vis_mode, |
410 | &bat_attr_routing_algo, | ||
402 | &bat_attr_gw_mode, | 411 | &bat_attr_gw_mode, |
403 | &bat_attr_orig_interval, | 412 | &bat_attr_orig_interval, |
404 | &bat_attr_hop_penalty, | 413 | &bat_attr_hop_penalty, |