1 | /*
|
---|
2 | * ntddscsi.h
|
---|
3 | *
|
---|
4 | * SCSI port IOCTL interface.
|
---|
5 | *
|
---|
6 | * This file is part of the w32api package.
|
---|
7 | *
|
---|
8 | * Contributors:
|
---|
9 | * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
|
---|
10 | *
|
---|
11 | * THIS SOFTWARE IS NOT COPYRIGHTED
|
---|
12 | *
|
---|
13 | * This source code is offered for use in the public domain. You may
|
---|
14 | * use, modify or distribute it freely.
|
---|
15 | *
|
---|
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.
|
---|
20 | *
|
---|
21 | */
|
---|
22 |
|
---|
23 | #ifndef __NTDDSCSI_H
|
---|
24 | #define __NTDDSCSI_H
|
---|
25 |
|
---|
26 | #if __GNUC__ >=3
|
---|
27 | #pragma GCC system_header
|
---|
28 | #endif
|
---|
29 |
|
---|
30 | #ifdef __cplusplus
|
---|
31 | extern "C" {
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | #include "ntddk.h"
|
---|
35 |
|
---|
36 | #define DD_SCSI_DEVICE_NAME "\\Device\\ScsiPort"
|
---|
37 | #define DD_SCSI_DEVICE_NAME_U L"\\Device\\ScsiPort"
|
---|
38 |
|
---|
39 | #define IOCTL_SCSI_BASE FILE_DEVICE_CONTROLLER
|
---|
40 |
|
---|
41 | #define IOCTL_SCSI_GET_INQUIRY_DATA \
|
---|
42 | CTL_CODE(IOCTL_SCSI_BASE, 0x0403, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
---|
43 |
|
---|
44 | #define IOCTL_SCSI_GET_CAPABILITIES \
|
---|
45 | CTL_CODE(IOCTL_SCSI_BASE, 0x0404, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
---|
46 |
|
---|
47 | #define IOCTL_SCSI_GET_ADDRESS \
|
---|
48 | CTL_CODE(IOCTL_SCSI_BASE, 0x0406, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
---|
49 |
|
---|
50 | #define IOCTL_SCSI_MINIPORT \
|
---|
51 | CTL_CODE(IOCTL_SCSI_BASE, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
---|
52 |
|
---|
53 | #define IOCTL_SCSI_PASS_THROUGH \
|
---|
54 | CTL_CODE(IOCTL_SCSI_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
---|
55 |
|
---|
56 | #define IOCTL_SCSI_PASS_THROUGH_DIRECT \
|
---|
57 | CTL_CODE(IOCTL_SCSI_BASE, 0x0405, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
---|
58 |
|
---|
59 | #define IOCTL_SCSI_RESCAN_BUS \
|
---|
60 | CTL_CODE(IOCTL_SCSI_BASE, 0x0407, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
---|
61 |
|
---|
62 |
|
---|
63 | DEFINE_GUID(ScsiRawInterfaceGuid, \
|
---|
64 | 0x53f56309L, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
|
---|
65 |
|
---|
66 | DEFINE_GUID(WmiScsiAddressGuid, \
|
---|
67 | 0x53f5630fL, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
|
---|
68 |
|
---|
69 | typedef struct _SCSI_PASS_THROUGH {
|
---|
70 | USHORT Length;
|
---|
71 | UCHAR ScsiStatus;
|
---|
72 | UCHAR PathId;
|
---|
73 | UCHAR TargetId;
|
---|
74 | UCHAR Lun;
|
---|
75 | UCHAR CdbLength;
|
---|
76 | UCHAR SenseInfoLength;
|
---|
77 | UCHAR DataIn;
|
---|
78 | ULONG DataTransferLength;
|
---|
79 | ULONG TimeOutValue;
|
---|
80 | ULONG_PTR DataBufferOffset;
|
---|
81 | ULONG SenseInfoOffset;
|
---|
82 | UCHAR Cdb[16];
|
---|
83 | } SCSI_PASS_THROUGH, *PSCSI_PASS_THROUGH;
|
---|
84 |
|
---|
85 | typedef struct _SCSI_PASS_THROUGH_DIRECT {
|
---|
86 | USHORT Length;
|
---|
87 | UCHAR ScsiStatus;
|
---|
88 | UCHAR PathId;
|
---|
89 | UCHAR TargetId;
|
---|
90 | UCHAR Lun;
|
---|
91 | UCHAR CdbLength;
|
---|
92 | UCHAR SenseInfoLength;
|
---|
93 | UCHAR DataIn;
|
---|
94 | ULONG DataTransferLength;
|
---|
95 | ULONG TimeOutValue;
|
---|
96 | PVOID DataBuffer;
|
---|
97 | ULONG SenseInfoOffset;
|
---|
98 | UCHAR Cdb[16];
|
---|
99 | } SCSI_PASS_THROUGH_DIRECT, *PSCSI_PASS_THROUGH_DIRECT;
|
---|
100 |
|
---|
101 | typedef struct _SRB_IO_CONTROL {
|
---|
102 | ULONG HeaderLength;
|
---|
103 | UCHAR Signature[8];
|
---|
104 | ULONG Timeout;
|
---|
105 | ULONG ControlCode;
|
---|
106 | ULONG ReturnCode;
|
---|
107 | ULONG Length;
|
---|
108 | } SRB_IO_CONTROL, *PSRB_IO_CONTROL;
|
---|
109 |
|
---|
110 | typedef struct _SCSI_ADDRESS {
|
---|
111 | ULONG Length;
|
---|
112 | UCHAR PortNumber;
|
---|
113 | UCHAR PathId;
|
---|
114 | UCHAR TargetId;
|
---|
115 | UCHAR Lun;
|
---|
116 | } SCSI_ADDRESS, *PSCSI_ADDRESS;
|
---|
117 |
|
---|
118 | typedef struct _SCSI_BUS_DATA {
|
---|
119 | UCHAR NumberOfLogicalUnits;
|
---|
120 | UCHAR InitiatorBusId;
|
---|
121 | ULONG InquiryDataOffset;
|
---|
122 | }SCSI_BUS_DATA, *PSCSI_BUS_DATA;
|
---|
123 |
|
---|
124 | typedef struct _SCSI_ADAPTER_BUS_INFO {
|
---|
125 | UCHAR NumberOfBuses;
|
---|
126 | SCSI_BUS_DATA BusData[1];
|
---|
127 | } SCSI_ADAPTER_BUS_INFO, *PSCSI_ADAPTER_BUS_INFO;
|
---|
128 |
|
---|
129 | typedef struct _IO_SCSI_CAPABILITIES {
|
---|
130 | ULONG Length;
|
---|
131 | ULONG MaximumTransferLength;
|
---|
132 | ULONG MaximumPhysicalPages;
|
---|
133 | ULONG SupportedAsynchronousEvents;
|
---|
134 | ULONG AlignmentMask;
|
---|
135 | BOOLEAN TaggedQueuing;
|
---|
136 | BOOLEAN AdapterScansDown;
|
---|
137 | BOOLEAN AdapterUsesPio;
|
---|
138 | } IO_SCSI_CAPABILITIES, *PIO_SCSI_CAPABILITIES;
|
---|
139 |
|
---|
140 | typedef struct _SCSI_INQUIRY_DATA {
|
---|
141 | UCHAR PathId;
|
---|
142 | UCHAR TargetId;
|
---|
143 | UCHAR Lun;
|
---|
144 | BOOLEAN DeviceClaimed;
|
---|
145 | ULONG InquiryDataLength;
|
---|
146 | ULONG NextInquiryDataOffset;
|
---|
147 | UCHAR InquiryData[1];
|
---|
148 | } SCSI_INQUIRY_DATA, *PSCSI_INQUIRY_DATA;
|
---|
149 |
|
---|
150 | #define SCSI_IOCTL_DATA_OUT 0
|
---|
151 | #define SCSI_IOCTL_DATA_IN 1
|
---|
152 | #define SCSI_IOCTL_DATA_UNSPECIFIED 2
|
---|
153 |
|
---|
154 | typedef struct _DUMP_POINTERS {
|
---|
155 | PADAPTER_OBJECT AdapterObject;
|
---|
156 | PVOID MappedRegisterBase;
|
---|
157 | PVOID DumpData;
|
---|
158 | PVOID CommonBufferVa;
|
---|
159 | LARGE_INTEGER CommonBufferPa;
|
---|
160 | ULONG CommonBufferSize;
|
---|
161 | BOOLEAN AllocateCommonBuffers;
|
---|
162 | BOOLEAN UseDiskDump;
|
---|
163 | UCHAR Spare1[2];
|
---|
164 | PVOID DeviceObject;
|
---|
165 | } DUMP_POINTERS, *PDUMP_POINTERS;
|
---|
166 |
|
---|
167 | #ifdef __cplusplus
|
---|
168 | }
|
---|
169 | #endif
|
---|
170 |
|
---|
171 | #endif /* __NTDDSCSI_H */
|
---|