blob: c0b8694041ece9397900506814304fac673a4f7e [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
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of version 2 of the GNU General Public
8 * License as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
Antonio Quartulliebf38fb2013-11-03 20:40:48 +010016 * along with this program; if not, see <http://www.gnu.org/licenses/>.
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000017 */
18
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000019#ifndef _NET_BATMAN_ADV_DEBUGFS_H_
20#define _NET_BATMAN_ADV_DEBUGFS_H_
21
Sven Eckelmann1e2c2a42015-04-17 19:40:28 +020022#include "main.h"
23
Sven Eckelmann00caf6a2018-08-10 23:36:15 +020024struct file;
Sven Eckelmann1e2c2a42015-04-17 19:40:28 +020025struct net_device;
26
Sven Eckelmann54590e42012-06-03 22:19:08 +020027#define BATADV_DEBUGFS_SUBDIR "batman_adv"
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000028
Sven Eckelmanndc1cbd12016-07-16 09:31:20 +020029#if IS_ENABLED(CONFIG_BATMAN_ADV_DEBUGFS)
Markus Pargmann9bb21882014-12-26 12:41:18 +010030
Sven Eckelmann00caf6a2018-08-10 23:36:15 +020031void batadv_debugfs_deprecated(struct file *file, const char *alt);
Sven Eckelmann40a072d2012-05-12 02:09:23 +020032void batadv_debugfs_init(void);
33void batadv_debugfs_destroy(void);
34int batadv_debugfs_add_meshif(struct net_device *dev);
Sven Eckelmann6da7be72018-06-01 19:24:24 +020035void batadv_debugfs_rename_meshif(struct net_device *dev);
Sven Eckelmann40a072d2012-05-12 02:09:23 +020036void batadv_debugfs_del_meshif(struct net_device *dev);
Simon Wunderlich5bc7c1e2013-11-21 14:16:12 +010037int batadv_debugfs_add_hardif(struct batadv_hard_iface *hard_iface);
Sven Eckelmann36dc6212018-06-01 19:24:23 +020038void batadv_debugfs_rename_hardif(struct batadv_hard_iface *hard_iface);
Simon Wunderlich5bc7c1e2013-11-21 14:16:12 +010039void batadv_debugfs_del_hardif(struct batadv_hard_iface *hard_iface);
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000040
Markus Pargmann9bb21882014-12-26 12:41:18 +010041#else
42
Sven Eckelmann00caf6a2018-08-10 23:36:15 +020043static inline void batadv_debugfs_deprecated(struct file *file, const char *alt)
44{
45}
46
Markus Pargmann9bb21882014-12-26 12:41:18 +010047static inline void batadv_debugfs_init(void)
48{
49}
50
51static inline void batadv_debugfs_destroy(void)
52{
53}
54
55static inline int batadv_debugfs_add_meshif(struct net_device *dev)
56{
57 return 0;
58}
59
Sven Eckelmann6da7be72018-06-01 19:24:24 +020060static inline void batadv_debugfs_rename_meshif(struct net_device *dev)
61{
62}
63
Markus Pargmann9bb21882014-12-26 12:41:18 +010064static inline void batadv_debugfs_del_meshif(struct net_device *dev)
65{
66}
67
68static inline
69int batadv_debugfs_add_hardif(struct batadv_hard_iface *hard_iface)
70{
71 return 0;
72}
73
74static inline
Sven Eckelmann36dc6212018-06-01 19:24:23 +020075void batadv_debugfs_rename_hardif(struct batadv_hard_iface *hard_iface)
76{
77}
78
79static inline
Markus Pargmann9bb21882014-12-26 12:41:18 +010080void batadv_debugfs_del_hardif(struct batadv_hard_iface *hard_iface)
81{
82}
83
84#endif
85
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000086#endif /* _NET_BATMAN_ADV_DEBUGFS_H_ */