blob: 1c5afd301ce924b4b7210f4a1b1e59464c927f78 [file] [log] [blame]
Sven Eckelmann7db7d9f2017-11-19 15:05:11 +01001/* SPDX-License-Identifier: GPL-2.0 */
Sven Eckelmann7a79d712018-12-31 23:59:59 +01002/* Copyright (C) 2010-2019 B.A.T.M.A.N. contributors:
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +00003 *
4 * Marek Lindner
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +00005 */
6
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +00007#ifndef _NET_BATMAN_ADV_DEBUGFS_H_
8#define _NET_BATMAN_ADV_DEBUGFS_H_
9
Sven Eckelmann1e2c2a42015-04-17 19:40:28 +020010#include "main.h"
11
Sven Eckelmann68a600d2019-05-24 20:11:17 +020012#include <linux/fs.h>
13#include <linux/netdevice.h>
Sven Eckelmann1e2c2a42015-04-17 19:40:28 +020014
Sven Eckelmann54590e42012-06-03 22:19:08 +020015#define BATADV_DEBUGFS_SUBDIR "batman_adv"
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000016
Sven Eckelmanndc1cbd12016-07-16 09:31:20 +020017#if IS_ENABLED(CONFIG_BATMAN_ADV_DEBUGFS)
Markus Pargmann9bb21882014-12-26 12:41:18 +010018
Sven Eckelmann00caf6a2018-08-10 23:36:15 +020019void batadv_debugfs_deprecated(struct file *file, const char *alt);
Sven Eckelmann40a072d2012-05-12 02:09:23 +020020void batadv_debugfs_init(void);
21void batadv_debugfs_destroy(void);
22int batadv_debugfs_add_meshif(struct net_device *dev);
Sven Eckelmann6da7be72018-06-01 19:24:24 +020023void batadv_debugfs_rename_meshif(struct net_device *dev);
Sven Eckelmann40a072d2012-05-12 02:09:23 +020024void batadv_debugfs_del_meshif(struct net_device *dev);
Greg Kroah-Hartman3bcacd12019-06-14 09:11:23 +020025void batadv_debugfs_add_hardif(struct batadv_hard_iface *hard_iface);
Sven Eckelmann36dc6212018-06-01 19:24:23 +020026void batadv_debugfs_rename_hardif(struct batadv_hard_iface *hard_iface);
Simon Wunderlich5bc7c1e2013-11-21 14:16:12 +010027void batadv_debugfs_del_hardif(struct batadv_hard_iface *hard_iface);
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000028
Markus Pargmann9bb21882014-12-26 12:41:18 +010029#else
30
Sven Eckelmann00caf6a2018-08-10 23:36:15 +020031static inline void batadv_debugfs_deprecated(struct file *file, const char *alt)
32{
33}
34
Markus Pargmann9bb21882014-12-26 12:41:18 +010035static inline void batadv_debugfs_init(void)
36{
37}
38
39static inline void batadv_debugfs_destroy(void)
40{
41}
42
43static inline int batadv_debugfs_add_meshif(struct net_device *dev)
44{
45 return 0;
46}
47
Sven Eckelmann6da7be72018-06-01 19:24:24 +020048static inline void batadv_debugfs_rename_meshif(struct net_device *dev)
49{
50}
51
Markus Pargmann9bb21882014-12-26 12:41:18 +010052static inline void batadv_debugfs_del_meshif(struct net_device *dev)
53{
54}
55
56static inline
Greg Kroah-Hartman3bcacd12019-06-14 09:11:23 +020057void batadv_debugfs_add_hardif(struct batadv_hard_iface *hard_iface)
Markus Pargmann9bb21882014-12-26 12:41:18 +010058{
Markus Pargmann9bb21882014-12-26 12:41:18 +010059}
60
61static inline
Sven Eckelmann36dc6212018-06-01 19:24:23 +020062void batadv_debugfs_rename_hardif(struct batadv_hard_iface *hard_iface)
63{
64}
65
66static inline
Markus Pargmann9bb21882014-12-26 12:41:18 +010067void batadv_debugfs_del_hardif(struct batadv_hard_iface *hard_iface)
68{
69}
70
71#endif
72
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000073#endif /* _NET_BATMAN_ADV_DEBUGFS_H_ */