skdebug.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /******************************************************************************
  2. *
  3. * Name: skdebug.h
  4. * Project: GEnesis, PCI Gigabit Ethernet Adapter
  5. * Version: $Revision: 1.12 $
  6. * Date: $Date: 2002/07/15 15:37:13 $
  7. * Purpose: SK specific DEBUG support
  8. *
  9. ******************************************************************************/
  10. /******************************************************************************
  11. *
  12. * (C)Copyright 1998-2002 SysKonnect GmbH.
  13. *
  14. * This program is free software; you can redistribute it and/or modify
  15. * it under the terms of the GNU General Public License as published by
  16. * the Free Software Foundation; either version 2 of the License, or
  17. * (at your option) any later version.
  18. *
  19. * The information in this file is provided "AS IS" without warranty.
  20. *
  21. ******************************************************************************/
  22. /******************************************************************************
  23. *
  24. * History:
  25. * $Log: skdebug.h,v $
  26. * Revision 1.12 2002/07/15 15:37:13 rschmidt
  27. * Power Management support
  28. * Editorial changes
  29. *
  30. * Revision 1.11 2002/04/25 11:04:39 rschmidt
  31. * Editorial changes
  32. *
  33. * Revision 1.10 1999/11/22 13:47:40 cgoos
  34. * Changed license header to GPL.
  35. *
  36. * Revision 1.9 1999/09/14 14:02:43 rwahl
  37. * Added SK_DBGMOD_PECP.
  38. *
  39. * Revision 1.8 1998/11/25 08:31:54 gklug
  40. * fix: no C++ comments allowed in common sources
  41. *
  42. * Revision 1.7 1998/11/24 16:47:24 swolf
  43. * Driver may now define its own SK_DBG_MSG() (eg. in "h/skdrv1st.h").
  44. *
  45. * Revision 1.6 1998/10/28 10:23:55 rassmann
  46. * ADDED SK_DBGMOD_ADDR.
  47. *
  48. * Revision 1.5 1998/10/22 09:43:55 gklug
  49. * add: CSUM module
  50. *
  51. * Revision 1.4 1998/10/01 07:54:44 gklug
  52. * add: PNMI debug module
  53. *
  54. * Revision 1.3 1998/09/18 08:32:34 afischer
  55. * Macros changed according ssr-spec.:
  56. * SK_DBG_MODCHK -> SK_DBG_CHKMOD
  57. * SK_DBG_CATCHK -> SK_DBG_CHKCAT
  58. *
  59. * Revision 1.2 1998/07/03 14:38:25 malthoff
  60. * Add category SK_DBGCAT_FATAL.
  61. *
  62. * Revision 1.1 1998/06/19 13:39:01 malthoff
  63. * created.
  64. *
  65. *
  66. ******************************************************************************/
  67. #ifndef __INC_SKDEBUG_H
  68. #define __INC_SKDEBUG_H
  69. #ifdef DEBUG
  70. #ifndef SK_DBG_MSG
  71. #define SK_DBG_MSG(pAC,comp,cat,arg) \
  72. if ( ((comp) & SK_DBG_CHKMOD(pAC)) && \
  73. ((cat) & SK_DBG_CHKCAT(pAC)) ) { \
  74. SK_DBG_PRINTF arg ; \
  75. }
  76. #endif
  77. #else
  78. #define SK_DBG_MSG(pAC,comp,lev,arg)
  79. #endif
  80. /* PLS NOTE:
  81. * =========
  82. * Due to any restrictions of kernel printf routines do not use other
  83. * format identifiers as: %x %d %c %s .
  84. * Never use any combined format identifiers such as: %lx %ld in your
  85. * printf - argument (arg) because some OS specific kernel printfs may
  86. * only support some basic identifiers.
  87. */
  88. /* Debug modules */
  89. #define SK_DBGMOD_MERR 0x00000001L /* general module error indication */
  90. #define SK_DBGMOD_HWM 0x00000002L /* Hardware init module */
  91. #define SK_DBGMOD_RLMT 0x00000004L /* RLMT module */
  92. #define SK_DBGMOD_VPD 0x00000008L /* VPD module */
  93. #define SK_DBGMOD_I2C 0x00000010L /* I2C module */
  94. #define SK_DBGMOD_PNMI 0x00000020L /* PNMI module */
  95. #define SK_DBGMOD_CSUM 0x00000040L /* CSUM module */
  96. #define SK_DBGMOD_ADDR 0x00000080L /* ADDR module */
  97. #define SK_DBGMOD_PECP 0x00000100L /* PECP module */
  98. #define SK_DBGMOD_POWM 0x00000200L /* Power Management module */
  99. /* Debug events */
  100. #define SK_DBGCAT_INIT 0x00000001L /* module/driver initialization */
  101. #define SK_DBGCAT_CTRL 0x00000002L /* controlling devices */
  102. #define SK_DBGCAT_ERR 0x00000004L /* error handling paths */
  103. #define SK_DBGCAT_TX 0x00000008L /* transmit path */
  104. #define SK_DBGCAT_RX 0x00000010L /* receive path */
  105. #define SK_DBGCAT_IRQ 0x00000020L /* general IRQ handling */
  106. #define SK_DBGCAT_QUEUE 0x00000040L /* any queue management */
  107. #define SK_DBGCAT_DUMP 0x00000080L /* large data output e.g. hex dump */
  108. #define SK_DBGCAT_FATAL 0x00000100L /* fatal error */
  109. #endif /* __INC_SKDEBUG_H */