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.

111 lines
3.9 KiB

  1. /****************************************************************************
  2. *
  3. * (C) COPYRIGHT 1996-2000, MICROSOFT CORP.
  4. *
  5. * FILE: scsiscan.h
  6. *
  7. * VERSION: 1.0
  8. *
  9. * DATE: 2/11/1997
  10. *
  11. * DESCRIPTION:
  12. * IOCTL definitions for the SCSI scanner device driver.
  13. *
  14. *****************************************************************************/
  15. //
  16. // Turns off []
  17. //
  18. #pragma warning(disable : 4200)
  19. #ifndef _SCSISCAN_H_
  20. #define _SCSISCAN_H_
  21. // SCSISCAN_CMD.SrbFlags
  22. #define SRB_FLAGS_DISABLE_SYNCH_TRANSFER 0x00000008
  23. #define SRB_FLAGS_DISABLE_AUTOSENSE 0x00000020
  24. #define SRB_FLAGS_DATA_IN 0x00000040
  25. #define SRB_FLAGS_DATA_OUT 0x00000080
  26. #define SRB_FLAGS_NO_DATA_TRANSFER 0x00000000
  27. // SCSISCAN_CMD.SrbStatus definitions
  28. #define SRB_STATUS_PENDING 0x00
  29. #define SRB_STATUS_SUCCESS 0x01
  30. #define SRB_STATUS_ABORTED 0x02
  31. #define SRB_STATUS_ABORT_FAILED 0x03
  32. #define SRB_STATUS_ERROR 0x04
  33. #define SRB_STATUS_BUSY 0x05
  34. #define SRB_STATUS_INVALID_REQUEST 0x06
  35. #define SRB_STATUS_INVALID_PATH_ID 0x07
  36. #define SRB_STATUS_NO_DEVICE 0x08
  37. #define SRB_STATUS_TIMEOUT 0x09
  38. #define SRB_STATUS_SELECTION_TIMEOUT 0x0A
  39. #define SRB_STATUS_COMMAND_TIMEOUT 0x0B
  40. #define SRB_STATUS_MESSAGE_REJECTED 0x0D
  41. #define SRB_STATUS_BUS_RESET 0x0E
  42. #define SRB_STATUS_PARITY_ERROR 0x0F
  43. #define SRB_STATUS_REQUEST_SENSE_FAILED 0x10
  44. #define SRB_STATUS_NO_HBA 0x11
  45. #define SRB_STATUS_DATA_OVERRUN 0x12
  46. #define SRB_STATUS_UNEXPECTED_BUS_FREE 0x13
  47. #define SRB_STATUS_PHASE_SEQUENCE_FAILURE 0x14
  48. #define SRB_STATUS_BAD_SRB_BLOCK_LENGTH 0x15
  49. #define SRB_STATUS_REQUEST_FLUSHED 0x16
  50. #define SRB_STATUS_INVALID_LUN 0x20
  51. #define SRB_STATUS_INVALID_TARGET_ID 0x21
  52. #define SRB_STATUS_BAD_FUNCTION 0x22
  53. #define SRB_STATUS_ERROR_RECOVERY 0x23
  54. #define SRB_STATUS_QUEUE_FROZEN 0x40
  55. #define SRB_STATUS_AUTOSENSE_VALID 0x80
  56. #define SRB_STATUS(Status) (Status & ~(SRB_STATUS_AUTOSENSE_VALID | SRB_STATUS_QUEUE_FROZEN))
  57. typedef struct _SCSISCAN_CMD {
  58. ULONG Reserved1;
  59. ULONG Size;
  60. ULONG SrbFlags;
  61. UCHAR CdbLength;
  62. UCHAR SenseLength;
  63. UCHAR Reserved2;
  64. UCHAR Reserved3;
  65. ULONG TransferLength;
  66. UCHAR Cdb[16];
  67. PUCHAR pSrbStatus;
  68. PUCHAR pSenseBuffer;
  69. } SCSISCAN_CMD, *PSCSISCAN_CMD;
  70. // Temporarily set to 128. Should be determined by other definition.
  71. #define MAX_STRING 128
  72. typedef struct _SCSISCAN_INFO{
  73. ULONG Size;
  74. ULONG Flags;
  75. UCHAR PortNumber;
  76. UCHAR PathId;
  77. UCHAR TargetId;
  78. UCHAR Lun;
  79. UCHAR AdapterName[MAX_STRING];
  80. ULONG Reserved;
  81. } SCSISCAN_INFO, *PSCSISCAN_INFO;
  82. #define SCSISCAN_RESERVED 0x000
  83. #define SCSISCAN_CMD_CODE 0x004
  84. #define SCSISCAN_LOCKDEVICE 0x005
  85. #define SCSISCAN_UNLOCKDEVICE 0x006
  86. #define SCSISCAN_SET_TIMEOUT 0x007
  87. #define SCSISCAN_GET_INFO 0x008
  88. //---------------------------------------------------------------------------
  89. // IOCTL definitions.
  90. // Use these definitions when calling DeviceIoControl
  91. //---------------------------------------------------------------------------
  92. #define IOCTL_SCSISCAN_CMD CTL_CODE(FILE_DEVICE_SCANNER, SCSISCAN_CMD_CODE, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
  93. #define IOCTL_SCSISCAN_LOCKDEVICE CTL_CODE(FILE_DEVICE_SCANNER, SCSISCAN_LOCKDEVICE, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
  94. #define IOCTL_SCSISCAN_UNLOCKDEVICE CTL_CODE(FILE_DEVICE_SCANNER, SCSISCAN_UNLOCKDEVICE, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
  95. #define IOCTL_SCSISCAN_SET_TIMEOUT CTL_CODE(FILE_DEVICE_SCANNER, SCSISCAN_SET_TIMEOUT, METHOD_BUFFERED, FILE_ANY_ACCESS)
  96. #define IOCTL_SCSISCAN_GET_INFO CTL_CODE(FILE_DEVICE_SCANNER, SCSISCAN_GET_INFO , METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
  97. #endif