debug.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef _BRCMS_DEBUG_H_
  2. #define _BRCMS_DEBUG_H_
  3. #include <linux/device.h>
  4. #include <linux/bcma/bcma.h>
  5. #include <net/cfg80211.h>
  6. #include <net/mac80211.h>
  7. #include "main.h"
  8. #include "mac80211_if.h"
  9. void __brcms_info(struct device *dev, const char *fmt, ...);
  10. void __brcms_warn(struct device *dev, const char *fmt, ...);
  11. void __brcms_err(struct device *dev, const char *fmt, ...);
  12. void __brcms_crit(struct device *dev, const char *fmt, ...);
  13. #if defined(CONFIG_BRCMDBG) || defined(CONFIG_BRCM_TRACING)
  14. void __brcms_dbg(struct device *dev, u32 level, const char *func,
  15. const char *fmt, ...);
  16. #else
  17. static inline void __brcms_dbg(struct device *dev, u32 level,
  18. const char *func, const char *fmt, ...)
  19. {
  20. }
  21. #endif
  22. /*
  23. * Debug macros cannot be used when wlc is uninitialized. Generally
  24. * this means any code that could run before brcms_c_attach() has
  25. * returned successfully probably shouldn't use the following macros.
  26. */
  27. #define brcms_dbg(core, l, f, a...) __brcms_dbg(&(core)->dev, l, __func__, f, ##a)
  28. #define brcms_info(core, f, a...) __brcms_info(&(core)->dev, f, ##a)
  29. #define brcms_warn(core, f, a...) __brcms_warn(&(core)->dev, f, ##a)
  30. #define brcms_err(core, f, a...) __brcms_err(&(core)->dev, f, ##a)
  31. #define brcms_crit(core, f, a...) __brcms_crit(&(core)->dev, f, ##a)
  32. #define brcms_dbg_info(core, f, a...) brcms_dbg(core, BRCM_DL_INFO, f, ##a)
  33. #define brcms_dbg_mac80211(core, f, a...) brcms_dbg(core, BRCM_DL_MAC80211, f, ##a)
  34. #define brcms_dbg_rx(core, f, a...) brcms_dbg(core, BRCM_DL_RX, f, ##a)
  35. #define brcms_dbg_tx(core, f, a...) brcms_dbg(core, BRCM_DL_TX, f, ##a)
  36. #endif /* _BRCMS_DEBUG_H_ */