dhd_dbg.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * Debug/trace/assert driver definitions for Dongle Host Driver.
  3. *
  4. * Copyright (C) 1999-2011, Broadcom Corporation
  5. *
  6. * Unless you and Broadcom execute a separate written software license
  7. * agreement governing use of this software, this software is licensed to you
  8. * under the terms of the GNU General Public License version 2 (the "GPL"),
  9. * available at http://www.broadcom.com/licenses/GPLv2.php, with the
  10. * following added to such license:
  11. *
  12. * As a special exception, the copyright holders of this software give you
  13. * permission to link this software with independent modules, and to copy and
  14. * distribute the resulting executable under terms of your choice, provided that
  15. * you also meet, for each linked independent module, the terms and conditions of
  16. * the license of that module. An independent module is a module which is not
  17. * derived from this software. The special exception does not apply to any
  18. * modifications of the software.
  19. *
  20. * Notwithstanding the above, under no circumstances may you combine this
  21. * software in any way with any other Broadcom software provided under a license
  22. * other than the GPL, without Broadcom's express prior written consent.
  23. *
  24. * $Id: dhd_dbg.h 285933 2011-09-23 21:45:31Z $
  25. */
  26. #ifndef _dhd_dbg_
  27. #define _dhd_dbg_
  28. #if defined(DHD_DEBUG)
  29. #define DHD_ERROR(args) do {if ((dhd_msg_level & DHD_ERROR_VAL) && (net_ratelimit())) \
  30. printf args;} while (0)
  31. #define DHD_TRACE(args) do {if (dhd_msg_level & DHD_TRACE_VAL) printf args;} while (0)
  32. #define DHD_INFO(args) do {if (dhd_msg_level & DHD_INFO_VAL) printf args;} while (0)
  33. #define DHD_DATA(args) do {if (dhd_msg_level & DHD_DATA_VAL) printf args;} while (0)
  34. #define DHD_CTL(args) do {if (dhd_msg_level & DHD_CTL_VAL) printf args;} while (0)
  35. #define DHD_TIMER(args) do {if (dhd_msg_level & DHD_TIMER_VAL) printf args;} while (0)
  36. #define DHD_HDRS(args) do {if (dhd_msg_level & DHD_HDRS_VAL) printf args;} while (0)
  37. #define DHD_BYTES(args) do {if (dhd_msg_level & DHD_BYTES_VAL) printf args;} while (0)
  38. #define DHD_INTR(args) do {if (dhd_msg_level & DHD_INTR_VAL) printf args;} while (0)
  39. #define DHD_GLOM(args) do {if (dhd_msg_level & DHD_GLOM_VAL) printf args;} while (0)
  40. #define DHD_EVENT(args) do {if (dhd_msg_level & DHD_EVENT_VAL) printf args;} while (0)
  41. #define DHD_BTA(args) do {if (dhd_msg_level & DHD_BTA_VAL) printf args;} while (0)
  42. #define DHD_ISCAN(args) do {if (dhd_msg_level & DHD_ISCAN_VAL) printf args;} while (0)
  43. #define DHD_ARPOE(args) do {if (dhd_msg_level & DHD_ARPOE_VAL) printf args;} while (0)
  44. #define DHD_ERROR_ON() (dhd_msg_level & DHD_ERROR_VAL)
  45. #define DHD_TRACE_ON() (dhd_msg_level & DHD_TRACE_VAL)
  46. #define DHD_INFO_ON() (dhd_msg_level & DHD_INFO_VAL)
  47. #define DHD_DATA_ON() (dhd_msg_level & DHD_DATA_VAL)
  48. #define DHD_CTL_ON() (dhd_msg_level & DHD_CTL_VAL)
  49. #define DHD_TIMER_ON() (dhd_msg_level & DHD_TIMER_VAL)
  50. #define DHD_HDRS_ON() (dhd_msg_level & DHD_HDRS_VAL)
  51. #define DHD_BYTES_ON() (dhd_msg_level & DHD_BYTES_VAL)
  52. #define DHD_INTR_ON() (dhd_msg_level & DHD_INTR_VAL)
  53. #define DHD_GLOM_ON() (dhd_msg_level & DHD_GLOM_VAL)
  54. #define DHD_EVENT_ON() (dhd_msg_level & DHD_EVENT_VAL)
  55. #define DHD_BTA_ON() (dhd_msg_level & DHD_BTA_VAL)
  56. #define DHD_ISCAN_ON() (dhd_msg_level & DHD_ISCAN_VAL)
  57. #define DHD_ARPOE_ON() (dhd_msg_level & DHD_ARPOE_VAL)
  58. #else /* defined(BCMDBG) || defined(DHD_DEBUG) */
  59. #define DHD_ERROR(args) do {if (net_ratelimit()) printf args;} while (0)
  60. #define DHD_TRACE(args)
  61. #define DHD_INFO(args)
  62. #define DHD_DATA(args)
  63. #define DHD_CTL(args)
  64. #define DHD_TIMER(args)
  65. #define DHD_HDRS(args)
  66. #define DHD_BYTES(args)
  67. #define DHD_INTR(args)
  68. #define DHD_GLOM(args)
  69. #define DHD_EVENT(args)
  70. #define DHD_BTA(args)
  71. #define DHD_ISCAN(args)
  72. #define DHD_ARPOE(args)
  73. #define DHD_ERROR_ON() 0
  74. #define DHD_TRACE_ON() 0
  75. #define DHD_INFO_ON() 0
  76. #define DHD_DATA_ON() 0
  77. #define DHD_CTL_ON() 0
  78. #define DHD_TIMER_ON() 0
  79. #define DHD_HDRS_ON() 0
  80. #define DHD_BYTES_ON() 0
  81. #define DHD_INTR_ON() 0
  82. #define DHD_GLOM_ON() 0
  83. #define DHD_EVENT_ON() 0
  84. #define DHD_BTA_ON() 0
  85. #define DHD_ISCAN_ON() 0
  86. #define DHD_ARPOE_ON() 0
  87. #endif
  88. #define DHD_LOG(args)
  89. #define DHD_BLOG(cp, size)
  90. #define DHD_NONE(args)
  91. extern int dhd_msg_level;
  92. /* Defines msg bits */
  93. #include <dhdioctl.h>
  94. #endif /* _dhd_dbg_ */