4 * SCSI port IOCTL interface.
6 * This file is part of the w32api package.
9 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
11 * THIS SOFTWARE IS NOT COPYRIGHTED
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
27 #pragma GCC system_header
36 #define DD_SCSI_DEVICE_NAME "\\Device\\ScsiPort"
37 #define DD_SCSI_DEVICE_NAME_U L"\\Device\\ScsiPort"
39 #define IOCTL_SCSI_BASE FILE_DEVICE_CONTROLLER
41 #define IOCTL_SCSI_GET_INQUIRY_DATA \
42 CTL_CODE(IOCTL_SCSI_BASE, 0x0403, METHOD_BUFFERED, FILE_ANY_ACCESS)
44 #define IOCTL_SCSI_GET_CAPABILITIES \
45 CTL_CODE(IOCTL_SCSI_BASE, 0x0404, METHOD_BUFFERED, FILE_ANY_ACCESS)
47 #define IOCTL_SCSI_GET_ADDRESS \
48 CTL_CODE(IOCTL_SCSI_BASE, 0x0406, METHOD_BUFFERED, FILE_ANY_ACCESS)
50 #define IOCTL_SCSI_MINIPORT \
51 CTL_CODE(IOCTL_SCSI_BASE, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
53 #define IOCTL_SCSI_PASS_THROUGH \
54 CTL_CODE(IOCTL_SCSI_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
56 #define IOCTL_SCSI_PASS_THROUGH_DIRECT \
57 CTL_CODE(IOCTL_SCSI_BASE, 0x0405, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
59 #define IOCTL_SCSI_RESCAN_BUS \
60 CTL_CODE(IOCTL_SCSI_BASE, 0x0407, METHOD_BUFFERED, FILE_ANY_ACCESS)
63 DEFINE_GUID(ScsiRawInterfaceGuid
, \
64 0x53f56309L
, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
66 DEFINE_GUID(WmiScsiAddressGuid
, \
67 0x53f5630fL
, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
69 typedef struct _SCSI_PASS_THROUGH
{
76 UCHAR SenseInfoLength
;
78 ULONG DataTransferLength
;
80 ULONG_PTR DataBufferOffset
;
81 ULONG SenseInfoOffset
;
83 } SCSI_PASS_THROUGH
, *PSCSI_PASS_THROUGH
;
85 typedef struct _SCSI_PASS_THROUGH_DIRECT
{
92 UCHAR SenseInfoLength
;
94 ULONG DataTransferLength
;
97 ULONG SenseInfoOffset
;
99 } SCSI_PASS_THROUGH_DIRECT
, *PSCSI_PASS_THROUGH_DIRECT
;
101 typedef struct _SRB_IO_CONTROL
{
108 } SRB_IO_CONTROL
, *PSRB_IO_CONTROL
;
110 typedef struct _SCSI_ADDRESS
{
116 } SCSI_ADDRESS
, *PSCSI_ADDRESS
;
118 typedef struct _SCSI_BUS_DATA
{
119 UCHAR NumberOfLogicalUnits
;
120 UCHAR InitiatorBusId
;
121 ULONG InquiryDataOffset
;
122 }SCSI_BUS_DATA
, *PSCSI_BUS_DATA
;
124 typedef struct _SCSI_ADAPTER_BUS_INFO
{
126 SCSI_BUS_DATA BusData
[1];
127 } SCSI_ADAPTER_BUS_INFO
, *PSCSI_ADAPTER_BUS_INFO
;
129 typedef struct _IO_SCSI_CAPABILITIES
{
131 ULONG MaximumTransferLength
;
132 ULONG MaximumPhysicalPages
;
133 ULONG SupportedAsynchronousEvents
;
135 BOOLEAN TaggedQueuing
;
136 BOOLEAN AdapterScansDown
;
137 BOOLEAN AdapterUsesPio
;
138 } IO_SCSI_CAPABILITIES
, *PIO_SCSI_CAPABILITIES
;
140 typedef struct _SCSI_INQUIRY_DATA
{
144 BOOLEAN DeviceClaimed
;
145 ULONG InquiryDataLength
;
146 ULONG NextInquiryDataOffset
;
147 UCHAR InquiryData
[1];
148 } SCSI_INQUIRY_DATA
, *PSCSI_INQUIRY_DATA
;
150 #define SCSI_IOCTL_DATA_OUT 0
151 #define SCSI_IOCTL_DATA_IN 1
152 #define SCSI_IOCTL_DATA_UNSPECIFIED 2
154 typedef struct _DUMP_POINTERS
{
155 PADAPTER_OBJECT AdapterObject
;
156 PVOID MappedRegisterBase
;
158 PVOID CommonBufferVa
;
159 LARGE_INTEGER CommonBufferPa
;
160 ULONG CommonBufferSize
;
161 BOOLEAN AllocateCommonBuffers
;
165 } DUMP_POINTERS
, *PDUMP_POINTERS
;
171 #endif /* __NTDDSCSI_H */