debugfs.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 file;
  22. struct net_device;
  23. #define BATADV_DEBUGFS_SUBDIR "batman_adv"
  24. #if IS_ENABLED(CONFIG_BATMAN_ADV_DEBUGFS)
  25. void batadv_debugfs_deprecated(struct file *file, const char *alt);
  26. void batadv_debugfs_init(void);
  27. void batadv_debugfs_destroy(void);
  28. int batadv_debugfs_add_meshif(struct net_device *dev);
  29. void batadv_debugfs_rename_meshif(struct net_device *dev);
  30. void batadv_debugfs_del_meshif(struct net_device *dev);
  31. int batadv_debugfs_add_hardif(struct batadv_hard_iface *hard_iface);
  32. void batadv_debugfs_rename_hardif(struct batadv_hard_iface *hard_iface);
  33. void batadv_debugfs_del_hardif(struct batadv_hard_iface *hard_iface);
  34. #else
  35. static inline void batadv_debugfs_deprecated(struct file *file, const char *alt)
  36. {
  37. }
  38. static inline void batadv_debugfs_init(void)
  39. {
  40. }
  41. static inline void batadv_debugfs_destroy(void)
  42. {
  43. }
  44. static inline int batadv_debugfs_add_meshif(struct net_device *dev)
  45. {
  46. return 0;
  47. }
  48. static inline void batadv_debugfs_rename_meshif(struct net_device *dev)
  49. {
  50. }
  51. static inline void batadv_debugfs_del_meshif(struct net_device *dev)
  52. {
  53. }
  54. static inline
  55. int batadv_debugfs_add_hardif(struct batadv_hard_iface *hard_iface)
  56. {
  57. return 0;
  58. }
  59. static inline
  60. void batadv_debugfs_rename_hardif(struct batadv_hard_iface *hard_iface)
  61. {
  62. }
  63. static inline
  64. void batadv_debugfs_del_hardif(struct batadv_hard_iface *hard_iface)
  65. {
  66. }
  67. #endif
  68. #endif /* _NET_BATMAN_ADV_DEBUGFS_H_ */