1 | /*
|
---|
2 | * Definitions for scsi media access
|
---|
3 | *
|
---|
4 | * Copyright (C) 2002 Laurent Pinchart
|
---|
5 | * Copyright 2005 Ivan Leo Puoti
|
---|
6 | *
|
---|
7 | * This library is free software; you can redistribute it and/or
|
---|
8 | * modify it under the terms of the GNU Lesser General Public
|
---|
9 | * License as published by the Free Software Foundation; either
|
---|
10 | * version 2.1 of the License, or (at your option) any later version.
|
---|
11 | *
|
---|
12 | * This library is distributed in the hope that it will be useful,
|
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
15 | * Lesser General Public License for more details.
|
---|
16 | *
|
---|
17 | * You should have received a copy of the GNU Lesser General Public
|
---|
18 | * License along with this library; if not, write to the Free Software
|
---|
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
---|
20 | */
|
---|
21 |
|
---|
22 | /*
|
---|
23 | * Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
24 | * other than GPL or LGPL is available it will apply instead, Sun elects to use only
|
---|
25 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
26 | * a choice of LGPL license versions is made available with the language indicating
|
---|
27 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
28 | * of the LGPL is applied is otherwise unspecified.
|
---|
29 | */
|
---|
30 |
|
---|
31 | #ifndef _NTDDSCSI_H_
|
---|
32 | #define _NTDDSCSI_H_
|
---|
33 |
|
---|
34 | #ifdef __cplusplus
|
---|
35 | extern "C" {
|
---|
36 | #endif
|
---|
37 |
|
---|
38 | #define IOCTL_SCSI_BASE FILE_DEVICE_CONTROLLER
|
---|
39 |
|
---|
40 | #define IOCTL_SCSI_PASS_THROUGH CTL_CODE(IOCTL_SCSI_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
---|
41 | #define IOCTL_SCSI_MINIPORT CTL_CODE(IOCTL_SCSI_BASE, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
---|
42 | #define IOCTL_SCSI_GET_INQUIRY_DATA CTL_CODE(IOCTL_SCSI_BASE, 0x0403, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
---|
43 | #define IOCTL_SCSI_GET_CAPABILITIES CTL_CODE(IOCTL_SCSI_BASE, 0x0404, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
---|
44 | #define IOCTL_SCSI_PASS_THROUGH_DIRECT CTL_CODE(IOCTL_SCSI_BASE, 0x0405, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
---|
45 | #define IOCTL_SCSI_GET_ADDRESS CTL_CODE(IOCTL_SCSI_BASE, 0x0406, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
---|
46 | #define IOCTL_SCSI_RESCAN_BUS CTL_CODE(IOCTL_SCSI_BASE, 0x0407, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
---|
47 | #define IOCTL_SCSI_GET_DUMP_POINTERS CTL_CODE(IOCTL_SCSI_BASE, 0x0408, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
---|
48 | #define IOCTL_SCSI_FREE_DUMP_POINTERS CTL_CODE(IOCTL_SCSI_BASE, 0x0409, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
---|
49 | #define IOCTL_IDE_PASS_THROUGH CTL_CODE(IOCTL_SCSI_BASE, 0x040a, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
---|
50 |
|
---|
51 | #define SCSI_IOCTL_DATA_OUT 0
|
---|
52 | #define SCSI_IOCTL_DATA_IN 1
|
---|
53 | #define SCSI_IOCTL_DATA_UNSPECIFIED 2
|
---|
54 |
|
---|
55 | typedef struct _SCSI_PASS_THROUGH {
|
---|
56 | USHORT Length;
|
---|
57 | UCHAR ScsiStatus;
|
---|
58 | UCHAR PathId;
|
---|
59 | UCHAR TargetId;
|
---|
60 | UCHAR Lun;
|
---|
61 | UCHAR CdbLength;
|
---|
62 | UCHAR SenseInfoLength;
|
---|
63 | UCHAR DataIn;
|
---|
64 | ULONG DataTransferLength;
|
---|
65 | ULONG TimeOutValue;
|
---|
66 | ULONG_PTR DataBufferOffset;
|
---|
67 | ULONG SenseInfoOffset;
|
---|
68 | UCHAR Cdb[16];
|
---|
69 | } SCSI_PASS_THROUGH, *PSCSI_PASS_THROUGH;
|
---|
70 |
|
---|
71 | typedef struct _SCSI_PASS_THROUGH_DIRECT {
|
---|
72 | USHORT Length;
|
---|
73 | UCHAR ScsiStatus;
|
---|
74 | UCHAR PathId;
|
---|
75 | UCHAR TargetId;
|
---|
76 | UCHAR Lun;
|
---|
77 | UCHAR CdbLength;
|
---|
78 | UCHAR SenseInfoLength;
|
---|
79 | UCHAR DataIn;
|
---|
80 | ULONG DataTransferLength;
|
---|
81 | ULONG TimeOutValue;
|
---|
82 | PVOID DataBuffer;
|
---|
83 | ULONG SenseInfoOffset;
|
---|
84 | UCHAR Cdb[16];
|
---|
85 | } SCSI_PASS_THROUGH_DIRECT, *PSCSI_PASS_THROUGH_DIRECT;
|
---|
86 |
|
---|
87 | typedef struct _SCSI_ADDRESS {
|
---|
88 | ULONG Length;
|
---|
89 | UCHAR PortNumber;
|
---|
90 | UCHAR PathId;
|
---|
91 | UCHAR TargetId;
|
---|
92 | UCHAR Lun;
|
---|
93 | } SCSI_ADDRESS, *PSCSI_ADDRESS;
|
---|
94 |
|
---|
95 | typedef struct _IO_SCSI_CAPABILITIES {
|
---|
96 | ULONG Length;
|
---|
97 | ULONG MaximumTransferLength;
|
---|
98 | ULONG MaximumPhysicalPages;
|
---|
99 | ULONG SupportedAsynchronousEvents;
|
---|
100 | ULONG AlignmentMask;
|
---|
101 | BOOLEAN TaggedQueuing;
|
---|
102 | BOOLEAN AdapterScansDown;
|
---|
103 | BOOLEAN AdapterUsesPio;
|
---|
104 | } IO_SCSI_CAPABILITIES, *PIO_SCSI_CAPABILITIES;
|
---|
105 |
|
---|
106 | typedef struct _SCSI_BUS_DATA {
|
---|
107 | UCHAR NumberOfLogicalUnits;
|
---|
108 | UCHAR InitiatorBusId;
|
---|
109 | ULONG InquiryDataOffset;
|
---|
110 | } SCSI_BUS_DATA, *PSCSI_BUS_DATA;
|
---|
111 |
|
---|
112 | typedef struct _SCSI_ADAPTER_BUS_INFO {
|
---|
113 | UCHAR NumberOfBuses;
|
---|
114 | SCSI_BUS_DATA BusData[1];
|
---|
115 | } SCSI_ADAPTER_BUS_INFO, *PSCSI_ADAPTER_BUS_INFO;
|
---|
116 |
|
---|
117 | typedef struct _SCSI_INQUIRY_DATA {
|
---|
118 | UCHAR PathId;
|
---|
119 | UCHAR TargetId;
|
---|
120 | UCHAR Lun;
|
---|
121 | BOOLEAN DeviceClaimed;
|
---|
122 | ULONG InquiryDataLength;
|
---|
123 | ULONG NextInquiryDataOffset;
|
---|
124 | UCHAR InquiryData[1];
|
---|
125 | } SCSI_INQUIRY_DATA, *PSCSI_INQUIRY_DATA;
|
---|
126 |
|
---|
127 | #ifdef __cplusplus
|
---|
128 | }
|
---|
129 | #endif
|
---|
130 |
|
---|
131 | #endif /* _NTDDSCSI_H_ */
|
---|