aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/sysfs.h
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2019-03-03 18:02:57 +0100
committerSimon Wunderlich <sw@simonwunderlich.de>2019-03-25 10:01:11 +0100
commit0fa4c30d710d7e646688073339312dabc58d89a2 (patch)
tree62adc48c8c76c2bd9e2be981a95bc734f2e8a149 /net/batman-adv/sysfs.h
parentbatman-adv: Drop documentation about sysfs files (diff)
downloadlinux-dev-0fa4c30d710d7e646688073339312dabc58d89a2.tar.xz
linux-dev-0fa4c30d710d7e646688073339312dabc58d89a2.zip
batman-adv: Make sysfs support optional
The sysfs files will be marked as deprecated in the near future. They are already replaced by the batadv generic netlink family. Add an Kconfig option to disable the sysfs support for users who want to test their tools or want to safe some space. This setting should currently still be enabled by default to keep backward compatible with legacy tools. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Diffstat (limited to '')
-rw-r--r--net/batman-adv/sysfs.h38
1 files changed, 36 insertions, 2 deletions
diff --git a/net/batman-adv/sysfs.h b/net/batman-adv/sysfs.h
index 2d13f59efb1a..83fa808b1871 100644
--- a/net/batman-adv/sysfs.h
+++ b/net/batman-adv/sysfs.h
@@ -45,6 +45,8 @@ struct batadv_attribute {
char *buf, size_t count);
};
+#ifdef CONFIG_BATMAN_ADV_SYSFS
+
int batadv_sysfs_add_meshif(struct net_device *dev);
void batadv_sysfs_del_meshif(struct net_device *dev);
int batadv_sysfs_add_hardif(struct kobject **hardif_obj,
@@ -54,7 +56,39 @@ int batadv_sysfs_add_vlan(struct net_device *dev,
struct batadv_softif_vlan *vlan);
void batadv_sysfs_del_vlan(struct batadv_priv *bat_priv,
struct batadv_softif_vlan *vlan);
-int batadv_throw_uevent(struct batadv_priv *bat_priv, enum batadv_uev_type type,
- enum batadv_uev_action action, const char *data);
+
+#else
+
+static inline int batadv_sysfs_add_meshif(struct net_device *dev)
+{
+ return 0;
+}
+
+static inline void batadv_sysfs_del_meshif(struct net_device *dev)
+{
+}
+
+static inline int batadv_sysfs_add_hardif(struct kobject **hardif_obj,
+ struct net_device *dev)
+{
+ return 0;
+}
+
+static inline void batadv_sysfs_del_hardif(struct kobject **hardif_obj)
+{
+}
+
+static inline int batadv_sysfs_add_vlan(struct net_device *dev,
+ struct batadv_softif_vlan *vlan)
+{
+ return 0;
+}
+
+static inline void batadv_sysfs_del_vlan(struct batadv_priv *bat_priv,
+ struct batadv_softif_vlan *vlan)
+{
+}
+
+#endif
#endif /* _NET_BATMAN_ADV_SYSFS_H_ */