bcm570x_debug.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /******************************************************************************/
  2. /* */
  3. /* Broadcom BCM5700 Linux Network Driver, Copyright (c) 2000 Broadcom */
  4. /* Corporation. */
  5. /* All rights reserved. */
  6. /* */
  7. /* This program is free software; you can redistribute it and/or modify */
  8. /* it under the terms of the GNU General Public License as published by */
  9. /* the Free Software Foundation, located in the file LICENSE. */
  10. /* */
  11. /* History: */
  12. /* 02/25/00 Hav Khauv Initial version. */
  13. /******************************************************************************/
  14. #ifndef DEBUG_H
  15. #define DEBUG_H
  16. #ifdef VXWORKS
  17. #include <vxWorks.h>
  18. #endif
  19. /******************************************************************************/
  20. /* Debug macros */
  21. /******************************************************************************/
  22. /* Code path for controlling output debug messages. */
  23. /* Define your code path here. */
  24. #define CP_INIT 0x010000
  25. #define CP_SEND 0x020000
  26. #define CP_RCV 0x040000
  27. #define CP_INT 0x080000
  28. #define CP_UINIT 0x100000
  29. #define CP_RESET 0x200000
  30. #define CP_ALL (CP_INIT | CP_SEND | CP_RCV | CP_INT | \
  31. CP_RESET | CP_UINIT)
  32. #define CP_MASK 0xffff0000
  33. /* Debug message levels. */
  34. #define LV_VERBOSE 0x03
  35. #define LV_INFORM 0x02
  36. #define LV_WARN 0x01
  37. #define LV_FATAL 0x00
  38. #define LV_MASK 0xffff
  39. /* Code path and messsage level combined. These are the first argument of */
  40. /* the DbgMessage macro. */
  41. #define INIT_V (CP_INIT | LV_VERBOSE)
  42. #define INIT_I (CP_INIT | LV_INFORM)
  43. #define INIT_W (CP_INIT | LV_WARN)
  44. #define SEND_V (CP_SEND | LV_VERBOSE)
  45. #define SEND_I (CP_SEND | LV_INFORM)
  46. #define SEND_W (CP_SEND | LV_WARN)
  47. #define RCV_V (CP_RCV | LV_VERBOSE)
  48. #define RCV_I (CP_RCV | LV_INFORM)
  49. #define RCV_W (CP_RCV | LV_WARN)
  50. #define INT_V (CP_INT | LV_VERBOSE)
  51. #define INT_I (CP_INT | LV_INFORM)
  52. #define INT_W (CP_INT | LV_WARN)
  53. #define UINIT_V (CP_UINIT | LV_VERBOSE)
  54. #define UINIT_I (CP_UINIT | LV_INFORM)
  55. #define UINIT_W (CP_UINIT | LV_WARN)
  56. #define RESET_V (CP_RESET | LV_VERBOSE)
  57. #define RESET_I (CP_RESET | LV_INFORM)
  58. #define RESET_W (CP_RESET | LV_WARN)
  59. #define CPALL_V (CP_ALL | LV_VERBOSE)
  60. #define CPALL_I (CP_ALL | LV_INFORM)
  61. #define CPALL_W (CP_ALL | LV_WARN)
  62. /* All code path message levels. */
  63. #define FATAL (CP_ALL | LV_FATAL)
  64. #define WARN (CP_ALL | LV_WARN)
  65. #define INFORM (CP_ALL | LV_INFORM)
  66. #define VERBOSE (CP_ALL | LV_VERBOSE)
  67. /* These constants control the message output. */
  68. /* Set your debug message output level and code path here. */
  69. #ifndef DBG_MSG_CP
  70. #define DBG_MSG_CP CP_ALL /* Where to output messages. */
  71. #endif
  72. #ifndef DBG_MSG_LV
  73. #define DBG_MSG_LV LV_VERBOSE /* Level of message output. */
  74. #endif
  75. /* DbgMessage macro. */
  76. #if DBG
  77. #define DbgMessage(CNTRL, MESSAGE) \
  78. if((CNTRL & DBG_MSG_CP) && ((CNTRL & LV_MASK) <= DBG_MSG_LV)) \
  79. printf MESSAGE
  80. #define DbgBreak() DbgBreakPoint()
  81. #undef STATIC
  82. #define STATIC
  83. #else
  84. #define DbgMessage(CNTRL, MESSAGE)
  85. #define DbgBreak()
  86. #undef STATIC
  87. #define STATIC static
  88. #endif /* DBG */
  89. #endif /* DEBUG_H */