diff options
author | Simon Wunderlich <simon@open-mesh.com> | 2013-11-21 08:16:12 -0500 |
---|---|---|
committer | Antonio Quartulli <antonio@meshcoding.com> | 2014-01-12 08:41:15 -0500 |
commit | 5bc7c1eb44f25a2e0d6a37af8eb1e07c7d2d43e6 (patch) | |
tree | 95ed7f0f81e6ab7af35f95501d370bcf6f71d127 /net/batman-adv/hard-interface.c | |
parent | f3b3d9018975ffb2680b7c1d37122f9d80301587 (diff) |
batman-adv: add debugfs structure for information per interface
To show information per interface, add a debugfs hardif structure
similar to the system in sysfs. Hard interface folders will be created
in "$debugfs/batman-adv/". Files are not yet added.
Signed-off-by: Simon Wunderlich <simon@open-mesh.com>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Diffstat (limited to 'net/batman-adv/hard-interface.c')
-rw-r--r-- | net/batman-adv/hard-interface.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c index bebd46ce0ebd..3f0e41a50514 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "translation-table.h" | 23 | #include "translation-table.h" |
24 | #include "routing.h" | 24 | #include "routing.h" |
25 | #include "sysfs.h" | 25 | #include "sysfs.h" |
26 | #include "debugfs.h" | ||
26 | #include "originator.h" | 27 | #include "originator.h" |
27 | #include "hash.h" | 28 | #include "hash.h" |
28 | #include "bridge_loop_avoidance.h" | 29 | #include "bridge_loop_avoidance.h" |
@@ -539,6 +540,7 @@ static void batadv_hardif_remove_interface_finish(struct work_struct *work) | |||
539 | hard_iface = container_of(work, struct batadv_hard_iface, | 540 | hard_iface = container_of(work, struct batadv_hard_iface, |
540 | cleanup_work); | 541 | cleanup_work); |
541 | 542 | ||
543 | batadv_debugfs_del_hardif(hard_iface); | ||
542 | batadv_sysfs_del_hardif(&hard_iface->hardif_obj); | 544 | batadv_sysfs_del_hardif(&hard_iface->hardif_obj); |
543 | batadv_hardif_free_ref(hard_iface); | 545 | batadv_hardif_free_ref(hard_iface); |
544 | } | 546 | } |
@@ -569,6 +571,11 @@ batadv_hardif_add_interface(struct net_device *net_dev) | |||
569 | hard_iface->net_dev = net_dev; | 571 | hard_iface->net_dev = net_dev; |
570 | hard_iface->soft_iface = NULL; | 572 | hard_iface->soft_iface = NULL; |
571 | hard_iface->if_status = BATADV_IF_NOT_IN_USE; | 573 | hard_iface->if_status = BATADV_IF_NOT_IN_USE; |
574 | |||
575 | ret = batadv_debugfs_add_hardif(hard_iface); | ||
576 | if (ret) | ||
577 | goto free_sysfs; | ||
578 | |||
572 | INIT_LIST_HEAD(&hard_iface->list); | 579 | INIT_LIST_HEAD(&hard_iface->list); |
573 | INIT_WORK(&hard_iface->cleanup_work, | 580 | INIT_WORK(&hard_iface->cleanup_work, |
574 | batadv_hardif_remove_interface_finish); | 581 | batadv_hardif_remove_interface_finish); |
@@ -585,6 +592,8 @@ batadv_hardif_add_interface(struct net_device *net_dev) | |||
585 | 592 | ||
586 | return hard_iface; | 593 | return hard_iface; |
587 | 594 | ||
595 | free_sysfs: | ||
596 | batadv_sysfs_del_hardif(&hard_iface->hardif_obj); | ||
588 | free_if: | 597 | free_if: |
589 | kfree(hard_iface); | 598 | kfree(hard_iface); |
590 | release_dev: | 599 | release_dev: |