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.

187 lines
4.3 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. vrdlcdbg.h
  5. Abstract:
  6. contains prototypes etc for DLC dump/diagnostic functions in VrDlcDbg.c
  7. Author:
  8. Richard L Firth (rfirth) 30-Apr-1992
  9. Revision History:
  10. --*/
  11. //
  12. // CCB return codes valid in DOS mode
  13. // See IBM Local Area Network Tech. Ref. Appendix B
  14. //
  15. #define CCB_COMMAND_IN_PROGRESS 0xff
  16. #define CCB_SUCCESS 0x00
  17. #define CCB_INVALID_COMMAND 0x01
  18. #define CCB_ALREADY_PENDING 0x02
  19. #define CCB_ADAPTER_NOT_CLOSED 0x03
  20. #define CCB_ADAPTER_NOT_OPEN 0x04
  21. #define CCB_PARAMETERS_MISSING 0x05
  22. #define CCB_INVALID_OPTION 0x06
  23. #define CCB_COMMAND_CANCELLED 0x07
  24. #define CCB_UNAUTHORIZED_ACCESS 0x08
  25. #define CCB_ADAPTER_NOT_INITIALIZED 0x09
  26. #define CCB_CANCELLED_BY_USER 0x0a
  27. #define CCB_CANCELLED_IN_PROGRESS 0x0b
  28. #define CCB_SUCCESS_ADAPTER_NOT_OPEN 0x0c
  29. // hole - 0x0d to 0x0f
  30. #define CCB_NETBIOS_FAILURE 0x10
  31. #define CCB_TIMER_ERROR 0x11
  32. #define CCB_NEED_MORE_WORK_AREA 0x12
  33. #define CCB_INVALID_LOG_ID 0x13
  34. #define CCB_INVALID_SHARED_SEGMENT 0x14
  35. #define CCB_LOST_LOG_DATA 0x15
  36. #define CCB_BUFFER_TOO_BIG 0x16
  37. #define CCB_NETBIOS_CLASH 0x17
  38. #define CCB_INVALID_SAP_BUFFER 0x18
  39. #define CCB_NOT_ENOUGH_BUFFERS 0x19
  40. #define CCB_USER_BUFFER_TOO_BIG 0x1a
  41. #define CCB_INVALID_PARAMETER_POINTER 0x1b
  42. #define CCB_INVALID_TABLE_POINTER 0x1c
  43. #define CCB_INVALID_ADAPTER 0x1d
  44. #define CCB_INVALID_FUNCTION_ADDRESS 0x1e
  45. // hole - 0x1f
  46. #define CCB_DATA_LOST_NO_BUFFERS 0x20
  47. #define CCB_DATA_LOST_NO_SPACE 0x21
  48. #define CCB_TRANSMIT_FS_ERROR 0x22
  49. #define CCB_TRANSMIT_ERROR 0x23
  50. #define CCB_UNAUTHORIZED_MAC_FRAME 0x24
  51. #define CCB_MAX_COMMANDS_EXCEEDED 0x25
  52. #define CCB_UNRECOGNIZED_CORRELATOR 0x26 // Not Used
  53. #define CCB_LINK_NOT_OPEN 0x27
  54. #define CCB_INVALID_FRAME_LENGTH 0x28
  55. // hole - 0x29 to 0x2f
  56. #define CCB_NOT_ENOUGH_BUFFERS_OPEN 0x30
  57. // hole - 0x31
  58. #define CCB_INVALID_NODE_ADDRESS 0x32
  59. #define CCB_INVALID_RECEIVE_LENGTH 0x33
  60. #define CCB_INVALID_TRANSMIT_LENGTH 0x34
  61. // hole - 0x35 to 0x3f
  62. #define CCB_INVALID_STATION_ID 0x40
  63. #define CCB_PROTOCOL_ERROR 0x41
  64. #define CCB_PARAMETER_EXCEEDS_MAX 0x42
  65. #define CCB_INVALID_SAP_VALUE 0x43
  66. #define CCB_INVALID_ROUTING_LENGTH 0x44
  67. #define CCB_INVALID_GROUP_SAP 0x45
  68. #define CCB_NOT_ENOUGH_LINK_STATIONS 0x46
  69. #define CCB_CANNOT_CLOSE_SAP 0x47
  70. #define CCB_CANNOT_CLOSE_GROUP_SAP 0x48
  71. #define CCB_GROUP_SAP_FULL 0x49
  72. #define CCB_SEQUENCE_ERROR 0x4a
  73. #define CCB_STATION_CLOSED_NO_ACK 0x4b
  74. #define CCB_COMMANDS_PENDING 0x4c
  75. #define CCB_CANNOT_CONNECT 0x4d
  76. #define CCB_SAP_NOT_IN_GROUP 0x4e
  77. #define CCB_INVALID_REMOTE_ADDRESS 0x4f
  78. #define MAX_CCB1_ERROR CCB_INVALID_REMOTE_ADDRESS
  79. #define NUMBER_OF_CCB1_ERRORS (MAX_CCB1_ERROR + 1) // including holes
  80. //
  81. // Error macros
  82. //
  83. #define IS_VALID_CCB1_COMMAND(command) (command <= MAX_CCB1_COMMAND)
  84. #define IS_VALID_CCB1_ERROR(error) (error <= MAX_CCB1_ERROR)
  85. //
  86. // prototypes
  87. //
  88. VOID
  89. DumpCcb(
  90. IN PVOID Ccb,
  91. IN BOOL DumpAll,
  92. IN BOOL CcbIsInput,
  93. IN BOOL IsDos,
  94. IN WORD Segment OPTIONAL,
  95. IN WORD Offset OPTIONAL
  96. );
  97. VOID
  98. DumpDosDlcBufferPool(
  99. IN PDOS_DLC_BUFFER_POOL PoolDescriptor
  100. );
  101. VOID
  102. DumpDosDlcBufferChain(
  103. IN DOS_ADDRESS DosAddress,
  104. IN DWORD BufferCount
  105. );
  106. VOID
  107. DumpReceiveDataBuffer(
  108. IN PVOID Buffer,
  109. IN BOOL IsDos,
  110. IN WORD Segment,
  111. IN WORD Offset
  112. );
  113. LPSTR
  114. MapCcbRetcode(
  115. IN BYTE Retcode
  116. );
  117. BOOL
  118. IsCcbErrorCodeAllowable(
  119. IN BYTE CcbCommand,
  120. IN BYTE CcbErrorCode
  121. );
  122. BOOL
  123. IsCcbErrorCodeValid(
  124. IN BYTE CcbErrorCode
  125. );
  126. BOOL
  127. IsCcbCommandValid(
  128. IN BYTE CcbCommand
  129. );
  130. LPSTR
  131. MapCcbCommandToName(
  132. IN BYTE CcbCommand
  133. );
  134. VOID
  135. DumpDosAdapter(
  136. IN DOS_ADAPTER* pDosAdapter
  137. );
  138. //
  139. // debug conditional macros
  140. //
  141. #if DBG
  142. #define CHECK_CCB_COMMAND(pccb) \
  143. ASSERT(IsCcbCommandValid(((PLLC_DOS_CCB)pccb)->uchDlcCommand))
  144. #define CHECK_CCB_RETCODE(pccb) \
  145. ASSERT(IsCcbErrorCodeAllowable(((PLLC_DOS_CCB)pccb)->uchDlcCommand, ((PLLC_DOS_CCB)pccb)->uchDlcStatus))
  146. #else
  147. #define CHECK_CCB_COMMAND(pccb)
  148. #define CHECK_CCB_RETCODE(pccb)
  149. #endif