Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 lines
2.7 KiB

  1. /*****************************************************************************
  2. ** **
  3. ** COPYRIGHT (C) 2000, 2001 MKNET CORPORATION **
  4. ** DEVELOPED FOR THE MK7100-BASED VFIR PCI CONTROLLER. **
  5. ** **
  6. *****************************************************************************/
  7. /**********************************************************************
  8. Module Name:
  9. DBG.H
  10. **********************************************************************/
  11. #ifndef _DBG_H
  12. #define _DBG_H
  13. // Statistics should eventually go in the adapter struct.
  14. typedef struct MK7DBG_STAT {
  15. UINT isrCnt;
  16. // TX
  17. UINT txIsrCnt;
  18. UINT txSndCnt; // call to our send
  19. UINT txComp; // TX processed w/ int bit set
  20. UINT txCompNoInt; // TX processed w/o int bit set
  21. UINT txNoTcb;
  22. UINT txProcQ; // processed Q'd entry
  23. UINT txSkipPoll; // master side skipped a poll because no tcb's
  24. UINT txLargestPkt;
  25. UINT txSlaveStuck;
  26. UINT txErrCnt;
  27. UINT txErr;
  28. // RX
  29. UINT rxIsrCnt;
  30. UINT rxComp;
  31. UINT rxCompNoInt;
  32. UINT rxNoRpd;
  33. UINT rxPktsInd;
  34. UINT rxPktsRtn;
  35. UINT rxLargestPkt;
  36. UINT rxErrCnt;
  37. UINT rxErr;
  38. UINT rxErrSirCrc;
  39. } MK7DBG_STAT;
  40. #if DBG
  41. extern MK7DBG_STAT GDbgStat;
  42. extern VOID MyLogEvent(char *, ULONG);
  43. extern LONGLONG GDbgTACmdTime[]; // command sent
  44. extern LONGLONG GDbgTARspTime[]; // response received
  45. extern LONGLONG GDbgTATime[]; // turnaround time
  46. extern UINT GDbgTATimeIdx;
  47. extern VOID MyLogPhysEvent(ULONG *, UINT *, ULONG);
  48. extern ULONG DbgLogTxPhysBuffs[];
  49. extern ULONG DbgLogRxPhysBuffs[];
  50. extern UINT DbgLogTxPhysBuffsIndex;
  51. extern UINT DbgLogRxPhysBuffsIndex;
  52. #define LOGTXPHY(V) {MyLogPhysEvent(DbgLogTxPhysBuffs, &DbgLogTxPhysBuffsIndex, V);}
  53. #define LOGRXPHY(V) {MyLogPhysEvent(DbgLogRxPhysBuffs, &DbgLogRxPhysBuffsIndex, V);}
  54. //
  55. // __FUNC__[] is the the built-in variable to hold a string, usually
  56. // the name of the function we're currently in. Here the macro sets
  57. // the variable so calls to DbgPrint later will print out the function
  58. // name.
  59. //
  60. // The variables __FILE__ and __LINE__ are used similarly. But these
  61. // 2 are set automatically.
  62. #define DBGFUNC(__F) static const char __FUNC__[] = __F;; \
  63. {DbgPrint("%s: \n", __FUNC__);}
  64. #define DBGLINE(S) {DbgPrint("%s:%d - ", __FILE__, __LINE__);DbgPrint S;}
  65. #define DBGSTR(S) DbgPrint S;
  66. #define DBGSTATUS1(S,I) DbgPrint (S, I) // B3.1.0-pre
  67. #define DBGLOG(S, V) {MyLogEvent(S, V);}
  68. #endif // DBG
  69. #if !DBG
  70. #define DBGLOG(S,V)
  71. #define DBGFUNC(__F);
  72. #define DBGLINE(S);
  73. #define DBGSTR(S);
  74. #define DBGSTR1(S, I);
  75. #define LOGTXPHY(V)
  76. #define LOGRXPHY(V)
  77. #undef ASSERT
  78. #define ASSERT(x)
  79. #endif // !DBG
  80. #define LOOPBACK_NONE 0
  81. #define LOOPBACK_SW 1
  82. #define LOOPBACK_HW 2
  83. #endif // DBG_H