debugfs.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Copyright (C) 2010-2018 B.A.T.M.A.N. contributors:
  3. *
  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
  16. * along with this program; if not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef _NET_BATMAN_ADV_DEBUGFS_H_
  19. #define _NET_BATMAN_ADV_DEBUGFS_H_
  20. #include "main.h"
  21. struct net_device;
  22. #define BATADV_DEBUGFS_SUBDIR "batman_adv"
  23. #if IS_ENABLED(CONFIG_BATMAN_ADV_DEBUGFS)
  24. void batadv_debugfs_init(void);
  25. void batadv_debugfs_destroy(void);
  26. int batadv_debugfs_add_meshif(struct net_device *dev);
  27. void batadv_debugfs_rename_meshif(struct net_device *dev);
  28. void batadv_debugfs_del_meshif(struct net_device *dev);
  29. int batadv_debugfs_add_hardif(struct batadv_hard_iface *hard_iface);
  30. void batadv_debugfs_rename_hardif(struct batadv_hard_iface *hard_iface);
  31. void batadv_debugfs_del_hardif(struct batadv_hard_iface *hard_iface);
  32. #else
  33. static inline void batadv_debugfs_init(void)
  34. {
  35. }
  36. static inline void batadv_debugfs_destroy(void)
  37. {
  38. }
  39. static inline int batadv_debugfs_add_meshif(struct net_device *dev)
  40. {
  41. return 0;
  42. }
  43. static inline void batadv_debugfs_rename_meshif(struct net_device *dev)
  44. {
  45. }
  46. static inline void batadv_debugfs_del_meshif(struct net_device *dev)
  47. {
  48. }
  49. static inline
  50. int batadv_debugfs_add_hardif(struct batadv_hard_iface *hard_iface)
  51. {
  52. return 0;
  53. }
  54. static inline
  55. void batadv_debugfs_rename_hardif(struct batadv_hard_iface *hard_iface)
  56. {
  57. }
  58. static inline
  59. void batadv_debugfs_del_hardif(struct batadv_hard_iface *hard_iface)
  60. {
  61. }
  62. #endif
  63. #endif /* _NET_BATMAN_ADV_DEBUGFS_H_ */