ReactOS 0.4.16-dev-106-g10b08aa
scsi_port.h
Go to the documentation of this file.
1
2// Copyright (C) Alexander Telyatnikov, Ivan Keliukh, Yegor Anchishkin, SKIF Software, 1999-2013. Kiev, Ukraine
3// All rights reserved
4// This file was released under the GPLv2 on June 2015.
6/*
7
8Module Name:
9
10 scsi_port.h
11
12Abstract:
13
14 This is the include file that defines all constants and types for
15 accessing the SCSI port adapters.
16
17Environment:
18
19 kernel mode only
20 */
21
22#ifndef __SCSI_PORT_H__
23#define __SCSI_PORT_H__
24
25#include "srb.h"
26
27#ifdef SCSIPORT_API
28#undef SCSIPORT_API
29#endif
30
31// Device Name - this string is the name of the device. It is the name
32// that should be passed to NtOpenFile when accessing the device.
33//
34// Note: For devices that support multiple units, it should be suffixed
35// with the Ascii representation of the unit number.
36
37#define IOCTL_SCSI_BASE FILE_DEVICE_CONTROLLER
38
39#define DD_SCSI_DEVICE_NAME "\\Device\\ScsiPort"
40
41
42// NtDeviceIoControlFile IoControlCode values for this device.
43//
44// Warning: Remember that the low two bits of the code specify how the
45// buffers are passed to the driver!
46
47#define IOCTL_SCSI_PASS_THROUGH CTL_CODE(IOCTL_SCSI_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
48#define IOCTL_SCSI_MINIPORT CTL_CODE(IOCTL_SCSI_BASE, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
49#define IOCTL_SCSI_GET_INQUIRY_DATA CTL_CODE(IOCTL_SCSI_BASE, 0x0403, METHOD_BUFFERED, FILE_ANY_ACCESS)
50#define IOCTL_SCSI_GET_CAPABILITIES CTL_CODE(IOCTL_SCSI_BASE, 0x0404, METHOD_BUFFERED, FILE_ANY_ACCESS)
51#define IOCTL_SCSI_PASS_THROUGH_DIRECT CTL_CODE(IOCTL_SCSI_BASE, 0x0405, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
52#define IOCTL_SCSI_GET_ADDRESS CTL_CODE(IOCTL_SCSI_BASE, 0x0406, METHOD_BUFFERED, FILE_ANY_ACCESS)
53#define IOCTL_SCSI_RESCAN_BUS CTL_CODE(IOCTL_SCSI_BASE, 0x0407, METHOD_BUFFERED, FILE_ANY_ACCESS)
54#define IOCTL_SCSI_GET_DUMP_POINTERS CTL_CODE(IOCTL_SCSI_BASE, 0x0408, METHOD_BUFFERED, FILE_ANY_ACCESS)
55
56// Define the SCSI pass through structure.
57
58typedef struct _SCSI_PASS_THROUGH {
73
74// Define the SCSI pass through direct structure.
75
91
92// Define SCSI information.
93// Used with the IOCTL_SCSI_GET_INQUIRY_DATA IOCTL.
94
95typedef struct _SCSI_BUS_DATA {
100
101// Define SCSI adapter bus information structure..
102// Used with the IOCTL_SCSI_GET_INQUIRY_DATA IOCTL.
103
108
109// Define SCSI adapter bus information.
110// Used with the IOCTL_SCSI_GET_INQUIRY_DATA IOCTL.
111
112typedef struct _SCSI_INQUIRY_DATA {
121
122// Define header for I/O control SRB.
123
124typedef struct _SRB_IO_CONTROL {
132
133// SCSI port driver capabilities structure.
134
135typedef struct _IO_SCSI_CAPABILITIES {
136 ULONG Length; // Length of this structure
137 ULONG MaximumTransferLength; // Maximum transfer size in single SRB (obsolete)
138 ULONG MaximumPhysicalPages; // Maximum number of physical pages per data buffer
139 ULONG SupportedAsynchronousEvents; // Async calls from port to class
140 ULONG AlignmentMask; // Alignment mask for data transfers.
141 BOOLEAN TaggedQueuing; // Supports tagged queuing
142 BOOLEAN AdapterScansDown; // Host adapter scans down for bios devices.
143 BOOLEAN AdapterUsesPio; // The host adapter uses programmed I/O.
145
146typedef struct _SCSI_ADDRESS {
153
154// Define structure for returning crash dump pointers.
155
156struct _ADAPTER_OBJECT;
157
158typedef struct _DUMP_POINTERS {
166
167
168
169// Define values for pass-through DataIn field.
170
171#define SCSI_IOCTL_DATA_OUT 0
172#define SCSI_IOCTL_DATA_IN 1
173#define SCSI_IOCTL_DATA_UNSPECIFIED 2
174
175#define CLASS_SPECIAL_CAUSE_NOT_REPORTABLE_HACK 0x00000020
176
177#define SCSIPORT_API
178
179#ifndef USER_MODE
181 IN PSCSI_ADAPTER_BUS_INFO *ConfigInfo);
183 IN BOOLEAN DirectAccess);
185
186#ifndef CDRW_W32
187
188// Class dll routines called by class drivers
189
191 OUT PIO_SCSI_CAPABILITIES *PortCapabilities);
199 OUT PDEVICE_OBJECT *NewPortDeviceObject OPTIONAL);
206
207#endif //CDRW_W32
208
210 PVOID DeviceExtension);
211
212extern NTSTATUS
216 );
217#endif //USER_MODE
218
219#endif //__SCSI_PORT_H__
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
_In_ PSCSI_REQUEST_BLOCK Srb
Definition: cdrom.h:989
_In_ BOOLEAN Release
Definition: cdrom.h:920
_In_ ULONG _In_ BOOLEAN _In_ ULONG _In_ UCHAR _In_ UCHAR _In_ UCHAR Lun
Definition: classpnp.h:1315
_In_ ULONG _In_ BOOLEAN _In_ ULONG _In_ UCHAR PathId
Definition: classpnp.h:1313
_In_ ULONG _In_ BOOLEAN _In_ ULONG _In_ UCHAR _In_ UCHAR TargetId
Definition: classpnp.h:1314
_In_ PIRP Irp
Definition: csq.h:116
IN OUT PVCB IN PDEVICE_OBJECT TargetDeviceObject
Definition: fatprocs.h:1675
struct _cl_event * event
Definition: glext.h:7739
unsigned short USHORT
Definition: pedump.c:61
static WCHAR Address[46]
Definition: ping.c:68
static ULONG Timeout
Definition: ping.c:61
struct _SCSI_PASS_THROUGH_DIRECT * PSCSI_PASS_THROUGH_DIRECT
NTSTATUS ScsiClassIoCompletion(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context)
struct _SCSI_PASS_THROUGH * PSCSI_PASS_THROUGH
struct _IO_SCSI_CAPABILITIES * PIO_SCSI_CAPABILITIES
NTSTATUS ScsiClassClaimDevice(IN PDEVICE_OBJECT PortDeviceObject, IN PSCSI_INQUIRY_DATA LunInfo, IN BOOLEAN Release, OUT PDEVICE_OBJECT *NewPortDeviceObject OPTIONAL)
struct _SCSI_PASS_THROUGH_DIRECT SCSI_PASS_THROUGH_DIRECT
struct _SCSI_INQUIRY_DATA SCSI_INQUIRY_DATA
struct _SCSI_ADAPTER_BUS_INFO SCSI_ADAPTER_BUS_INFO
VOID ScsiClassReleaseQueue(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS ScsiClassGetAddress(IN PDEVICE_OBJECT ClassDeviceObject, OUT PSCSI_ADDRESS Address)
VOID ScsiClassInitSrbBusAddr(PSCSI_REQUEST_BLOCK Srb, PVOID DeviceExtension)
struct _SRB_IO_CONTROL * PSRB_IO_CONTROL
NTSTATUS ScsiClassInternalIoControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
struct _SCSI_ADDRESS * PSCSI_ADDRESS
NTSTATUS ScsiClassSendSrbSynchronous(IN PDEVICE_OBJECT TargetDeviceObject, IN PSCSI_REQUEST_BLOCK _srb, IN PKEVENT event)
NTSTATUS ScsiClassRemoveDevice(IN PDEVICE_OBJECT PortDeviceObject, IN UCHAR PathId, IN UCHAR TargetId, IN UCHAR Lun)
struct _SCSI_INQUIRY_DATA * PSCSI_INQUIRY_DATA
struct _SCSI_BUS_DATA SCSI_BUS_DATA
struct _SCSI_ADDRESS SCSI_ADDRESS
NTSTATUS ScsiClassReadDriveCapacity(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS ScsiClassReadDeviceInquiryData(IN PDEVICE_OBJECT DeviceObject, IN BOOLEAN DirectAccess)
struct _SCSI_BUS_DATA * PSCSI_BUS_DATA
NTSTATUS ScsiClassGetCapabilities(IN PDEVICE_OBJECT PortDeviceObject, OUT PIO_SCSI_CAPABILITIES *PortCapabilities)
struct _DUMP_POINTERS * PDUMP_POINTERS
struct _SRB_IO_CONTROL SRB_IO_CONTROL
struct _IO_SCSI_CAPABILITIES IO_SCSI_CAPABILITIES
struct _SCSI_PASS_THROUGH SCSI_PASS_THROUGH
struct _SCSI_ADAPTER_BUS_INFO * PSCSI_ADAPTER_BUS_INFO
struct _DUMP_POINTERS DUMP_POINTERS
NTSTATUS ScsiClassGetInquiryData(IN PDEVICE_OBJECT PortDeviceObject, IN PSCSI_ADAPTER_BUS_INFO *ConfigInfo)
NTSTATUS DbgWaitForSingleObject_(IN PVOID Object, IN PLARGE_INTEGER Timeout OPTIONAL)
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
PVOID CommonBufferVa
Definition: scsi_port.h:162
PVOID PortConfiguration
Definition: scsi_port.h:161
LARGE_INTEGER CommonBufferPa
Definition: scsi_port.h:163
struct _ADAPTER_OBJECT * AdapterObject
Definition: scsi_port.h:159
PVOID MappedRegisterBase
Definition: scsi_port.h:160
ULONG CommonBufferSize
Definition: scsi_port.h:164
BOOLEAN AdapterScansDown
Definition: scsi_port.h:142
ULONG SupportedAsynchronousEvents
Definition: scsi_port.h:139
SCSI_BUS_DATA BusData[1]
Definition: scsi_port.h:106
UCHAR PathId
Definition: scsi_port.h:149
UCHAR TargetId
Definition: scsi_port.h:150
ULONG Length
Definition: scsi_port.h:147
UCHAR PortNumber
Definition: scsi_port.h:148
ULONG InquiryDataOffset
Definition: scsi_port.h:98
UCHAR NumberOfLogicalUnits
Definition: scsi_port.h:96
UCHAR InitiatorBusId
Definition: scsi_port.h:97
UCHAR InquiryData[1]
Definition: scsi_port.h:119
ULONG NextInquiryDataOffset
Definition: scsi_port.h:118
ULONG InquiryDataLength
Definition: scsi_port.h:117
BOOLEAN DeviceClaimed
Definition: scsi_port.h:116
UCHAR SenseInfoLength
Definition: scsi_port.h:65
UCHAR Cdb[16]
Definition: scsi_port.h:71
ULONG DataTransferLength
Definition: scsi_port.h:67
ULONG SenseInfoOffset
Definition: scsi_port.h:70
ULONG DataBufferOffset
Definition: scsi_port.h:69
UCHAR Signature[8]
Definition: scsi_port.h:126
ULONG ControlCode
Definition: scsi_port.h:128
ULONG HeaderLength
Definition: scsi_port.h:125
ULONG ReturnCode
Definition: scsi_port.h:129
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
unsigned char UCHAR
Definition: xmlstorage.h:181