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.

154 lines
4.7 KiB

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. spti.h
  5. Abstract:
  6. These are the structures and defines that are used in the
  7. SPTI.C.
  8. Author:
  9. Revision History:
  10. --*/
  11. typedef struct _SCSI_PASS_THROUGH_WITH_BUFFERS {
  12. SCSI_PASS_THROUGH spt;
  13. ULONG Filler; // realign buffers to double word boundary
  14. UCHAR ucSenseBuf[32];
  15. UCHAR ucDataBuf[512];
  16. } SCSI_PASS_THROUGH_WITH_BUFFERS, *PSCSI_PASS_THROUGH_WITH_BUFFERS;
  17. typedef struct _SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER {
  18. SCSI_PASS_THROUGH_DIRECT sptd;
  19. ULONG Filler; // realign buffer to double word boundary
  20. UCHAR ucSenseBuf[32];
  21. } SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER, *PSCSI_PASS_THROUGH_DIRECT_WITH_BUFFER;
  22. VOID
  23. PrintError(ULONG);
  24. VOID
  25. PrintDataBuffer(PUCHAR, ULONG);
  26. VOID
  27. PrintInquiryData(PVOID);
  28. PUCHAR
  29. AllocateAlignedBuffer(ULONG, ULONG);
  30. VOID
  31. PrintStatusResults(BOOL, DWORD, PSCSI_PASS_THROUGH_WITH_BUFFERS, ULONG);
  32. VOID
  33. PrintSenseInfo(PSCSI_PASS_THROUGH_WITH_BUFFERS);
  34. //
  35. // Command Descriptor Block constants.
  36. //
  37. #define CDB6GENERIC_LENGTH 6
  38. #define CDB10GENERIC_LENGTH 10
  39. #define SETBITON 1
  40. #define SETBITOFF 0
  41. //
  42. // Mode Sense/Select page constants.
  43. //
  44. #define MODE_PAGE_ERROR_RECOVERY 0x01
  45. #define MODE_PAGE_DISCONNECT 0x02
  46. #define MODE_PAGE_FORMAT_DEVICE 0x03
  47. #define MODE_PAGE_RIGID_GEOMETRY 0x04
  48. #define MODE_PAGE_FLEXIBILE 0x05
  49. #define MODE_PAGE_VERIFY_ERROR 0x07
  50. #define MODE_PAGE_CACHING 0x08
  51. #define MODE_PAGE_PERIPHERAL 0x09
  52. #define MODE_PAGE_CONTROL 0x0A
  53. #define MODE_PAGE_MEDIUM_TYPES 0x0B
  54. #define MODE_PAGE_NOTCH_PARTITION 0x0C
  55. #define MODE_SENSE_RETURN_ALL 0x3f
  56. #define MODE_SENSE_CURRENT_VALUES 0x00
  57. #define MODE_SENSE_CHANGEABLE_VALUES 0x40
  58. #define MODE_SENSE_DEFAULT_VAULES 0x80
  59. #define MODE_SENSE_SAVED_VALUES 0xc0
  60. #define MODE_PAGE_DEVICE_CONFIG 0x10
  61. #define MODE_PAGE_MEDIUM_PARTITION 0x11
  62. #define MODE_PAGE_DATA_COMPRESS 0x0f
  63. //
  64. // SCSI CDB operation codes
  65. //
  66. #define SCSIOP_TEST_UNIT_READY 0x00
  67. #define SCSIOP_REZERO_UNIT 0x01
  68. #define SCSIOP_REWIND 0x01
  69. #define SCSIOP_REQUEST_BLOCK_ADDR 0x02
  70. #define SCSIOP_REQUEST_SENSE 0x03
  71. #define SCSIOP_FORMAT_UNIT 0x04
  72. #define SCSIOP_READ_BLOCK_LIMITS 0x05
  73. #define SCSIOP_REASSIGN_BLOCKS 0x07
  74. #define SCSIOP_READ6 0x08
  75. #define SCSIOP_RECEIVE 0x08
  76. #define SCSIOP_WRITE6 0x0A
  77. #define SCSIOP_PRINT 0x0A
  78. #define SCSIOP_SEND 0x0A
  79. #define SCSIOP_SEEK6 0x0B
  80. #define SCSIOP_TRACK_SELECT 0x0B
  81. #define SCSIOP_SLEW_PRINT 0x0B
  82. #define SCSIOP_SEEK_BLOCK 0x0C
  83. #define SCSIOP_PARTITION 0x0D
  84. #define SCSIOP_READ_REVERSE 0x0F
  85. #define SCSIOP_WRITE_FILEMARKS 0x10
  86. #define SCSIOP_FLUSH_BUFFER 0x10
  87. #define SCSIOP_SPACE 0x11
  88. #define SCSIOP_INQUIRY 0x12
  89. #define SCSIOP_VERIFY6 0x13
  90. #define SCSIOP_RECOVER_BUF_DATA 0x14
  91. #define SCSIOP_MODE_SELECT 0x15
  92. #define SCSIOP_RESERVE_UNIT 0x16
  93. #define SCSIOP_RELEASE_UNIT 0x17
  94. #define SCSIOP_COPY 0x18
  95. #define SCSIOP_ERASE 0x19
  96. #define SCSIOP_MODE_SENSE 0x1A
  97. #define SCSIOP_START_STOP_UNIT 0x1B
  98. #define SCSIOP_STOP_PRINT 0x1B
  99. #define SCSIOP_LOAD_UNLOAD 0x1B
  100. #define SCSIOP_RECEIVE_DIAGNOSTIC 0x1C
  101. #define SCSIOP_SEND_DIAGNOSTIC 0x1D
  102. #define SCSIOP_MEDIUM_REMOVAL 0x1E
  103. #define SCSIOP_READ_CAPACITY 0x25
  104. #define SCSIOP_READ 0x28
  105. #define SCSIOP_WRITE 0x2A
  106. #define SCSIOP_SEEK 0x2B
  107. #define SCSIOP_LOCATE 0x2B
  108. #define SCSIOP_WRITE_VERIFY 0x2E
  109. #define SCSIOP_VERIFY 0x2F
  110. #define SCSIOP_SEARCH_DATA_HIGH 0x30
  111. #define SCSIOP_SEARCH_DATA_EQUAL 0x31
  112. #define SCSIOP_SEARCH_DATA_LOW 0x32
  113. #define SCSIOP_SET_LIMITS 0x33
  114. #define SCSIOP_READ_POSITION 0x34
  115. #define SCSIOP_SYNCHRONIZE_CACHE 0x35
  116. #define SCSIOP_COMPARE 0x39
  117. #define SCSIOP_COPY_COMPARE 0x3A
  118. #define SCSIOP_WRITE_DATA_BUFF 0x3B
  119. #define SCSIOP_READ_DATA_BUFF 0x3C
  120. #define SCSIOP_CHANGE_DEFINITION 0x40
  121. #define SCSIOP_READ_SUB_CHANNEL 0x42
  122. #define SCSIOP_READ_TOC 0x43
  123. #define SCSIOP_READ_HEADER 0x44
  124. #define SCSIOP_PLAY_AUDIO 0x45
  125. #define SCSIOP_PLAY_AUDIO_MSF 0x47
  126. #define SCSIOP_PLAY_TRACK_INDEX 0x48
  127. #define SCSIOP_PLAY_TRACK_RELATIVE 0x49
  128. #define SCSIOP_PAUSE_RESUME 0x4B
  129. #define SCSIOP_LOG_SELECT 0x4C
  130. #define SCSIOP_LOG_SENSE 0x4D