dbg_hexdump.h 1.1 KB

123456789101112131415161718192021222324252627282930
  1. #ifndef WIL_DBG_HEXDUMP_H_
  2. #define WIL_DBG_HEXDUMP_H_
  3. #if defined(CONFIG_DYNAMIC_DEBUG)
  4. #define wil_dynamic_hex_dump(prefix_str, prefix_type, rowsize, \
  5. groupsize, buf, len, ascii) \
  6. do { \
  7. DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, \
  8. __builtin_constant_p(prefix_str) ? prefix_str : "hexdump");\
  9. if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT)) \
  10. print_hex_dump(KERN_DEBUG, prefix_str, \
  11. prefix_type, rowsize, groupsize, \
  12. buf, len, ascii); \
  13. } while (0)
  14. #define wil_print_hex_dump_debug(prefix_str, prefix_type, rowsize, \
  15. groupsize, buf, len, ascii) \
  16. wil_dynamic_hex_dump(prefix_str, prefix_type, rowsize, \
  17. groupsize, buf, len, ascii)
  18. #define print_hex_dump_bytes(prefix_str, prefix_type, buf, len) \
  19. wil_dynamic_hex_dump(prefix_str, prefix_type, 16, 1, buf, len, true)
  20. #else /* defined(CONFIG_DYNAMIC_DEBUG) */
  21. #define wil_print_hex_dump_debug(prefix_str, prefix_type, rowsize, \
  22. groupsize, buf, len, ascii) \
  23. print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, rowsize, \
  24. groupsize, buf, len, ascii)
  25. #endif /* defined(CONFIG_DYNAMIC_DEBUG) */
  26. #endif /* WIL_DBG_HEXDUMP_H_ */