22 ULONG InquiryDataSize;
29 DPRINT(
"SpiGetInquiryData() called\n");
36 BusCount = DeviceExtension->NumberOfBuses;
44 Length += InquiryDataSize * DeviceExtension->TotalLUCount;
67 for (
UINT8 pathId = 0; pathId < DeviceExtension->NumberOfBuses; pathId++)
75 BusData->
InitiatorBusId = DeviceExtension->Buses[pathId].BusIdentifier;
85 lunEntry = lunEntry->
Flink)
95 InquiryData->
Lun = lunExt->
Lun;
129 UINT32 LastCharacterPosition = 0;
137 LastCharacterPosition =
Index;
142 return LastCharacterPosition + 1;
201 + FieldLengthRevision
226 deviceDescriptor->DeviceType = inquiryData->
DeviceType;
229 deviceDescriptor->CommandQueueing = inquiryData->
CommandQueue;
231 deviceDescriptor->VendorIdOffset =
233 deviceDescriptor->ProductIdOffset =
234 deviceDescriptor->VendorIdOffset + FieldLengthVendor + 1;
235 deviceDescriptor->ProductRevisionOffset =
236 deviceDescriptor->ProductIdOffset + FieldLengthProduct + 1;
237 deviceDescriptor->SerialNumberOffset = 0;
238 deviceDescriptor->RawPropertiesLength =
239 FieldLengthVendor + FieldLengthProduct + FieldLengthRevision + 3;
245 Buffer[FieldLengthVendor] =
'\0';
246 Buffer += FieldLengthVendor + 1;
249 Buffer[FieldLengthProduct] =
'\0';
250 Buffer += FieldLengthProduct + 1;
253 Buffer[FieldLengthRevision] =
'\0';
254 Buffer += FieldLengthRevision + 1;
257 (
LPCSTR)((
ULONG_PTR)deviceDescriptor + deviceDescriptor->VendorIdOffset));
259 (
LPCSTR)((
ULONG_PTR)deviceDescriptor + deviceDescriptor->ProductIdOffset));
261 (
LPCSTR)((
ULONG_PTR)deviceDescriptor + deviceDescriptor->ProductRevisionOffset));
303 ASSERT(portExt->Common.IsFDO);
369 .AcceleratedTransfer =
TRUE,
371 .BusMajorVersion = 2,
414 DPRINT(
"ScsiPortDeviceControl()\n");
416 Irp->IoStatus.Information = 0;
420 switch (
Stack->Parameters.DeviceIoControl.IoControlCode)
424 DPRINT(
" IOCTL_STORAGE_QUERY_PROPERTY\n");
439 DPRINT(
" IOCTL_SCSI_GET_ADDRESS\n");
458 address->PortNumber = portExt->PortNumber;
469 DPRINT(
" IOCTL_SCSI_GET_DUMP_POINTERS\n");
493 DPRINT(
" IOCTL_SCSI_GET_CAPABILITIES\n");
519 DPRINT(
" IOCTL_SCSI_GET_INQUIRY_DATA\n");
532 DPRINT1(
"IOCTL_SCSI_MINIPORT unimplemented!\n");
537 DPRINT1(
"IOCTL_SCSI_PASS_THROUGH unimplemented!\n");
542 DPRINT1(
"unknown ioctl code: 0x%lX\n",
Stack->Parameters.DeviceIoControl.IoControlCode);
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define INQUIRYDATABUFFERSIZE
#define STATUS_NOT_SUPPORTED
#define STATUS_NOT_IMPLEMENTED
static NTSTATUS SpiGetInquiryData(_In_ PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, _In_ PIRP Irp)
static NTSTATUS FdoHandleQueryProperty(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
static UINT32 GetFieldLength(_In_ PUCHAR Name, _In_ UINT32 MaxLength)
static NTSTATUS PdoHandleQueryProperty(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
NTSTATUS NTAPI ScsiPortDeviceControl(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp)
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define IOCTL_STORAGE_QUERY_PROPERTY
* PSTORAGE_DESCRIPTOR_HEADER
STORAGE_DESCRIPTOR_HEADER
* PSTORAGE_DEVICE_DESCRIPTOR
@ StorageDeviceIdProperty
STORAGE_DEVICE_DESCRIPTOR
#define IoSkipCurrentIrpStackLocation(Irp)
#define IoCompleteRequest
#define STATUS_INVALID_PARAMETER_2
#define STATUS_INVALID_PARAMETER_1
FORCEINLINE BOOLEAN VerifyIrpInBufferSize(_In_ PIRP Irp, _In_ SIZE_T Size)
FORCEINLINE BOOLEAN VerifyIrpOutBufferSize(_In_ PIRP Irp, _In_ SIZE_T Size)
#define IOCTL_SCSI_GET_DUMP_POINTERS
#define IOCTL_SCSI_PASS_THROUGH
#define IOCTL_SCSI_GET_ADDRESS
#define IOCTL_SCSI_GET_CAPABILITIES
struct _SCSI_ADAPTER_BUS_INFO SCSI_ADAPTER_BUS_INFO
#define IOCTL_SCSI_MINIPORT
struct _SCSI_INQUIRY_DATA * PSCSI_INQUIRY_DATA
struct _SCSI_BUS_DATA SCSI_BUS_DATA
struct _SCSI_ADDRESS SCSI_ADDRESS
#define IOCTL_SCSI_GET_INQUIRY_DATA
struct _IO_SCSI_CAPABILITIES IO_SCSI_CAPABILITIES
struct _SCSI_ADAPTER_BUS_INFO * PSCSI_ADAPTER_BUS_INFO
struct _DUMP_POINTERS DUMP_POINTERS
struct _STORAGE_ADAPTER_DESCRIPTOR_WIN8 STORAGE_ADAPTER_DESCRIPTOR_WIN8
#define STATUS_BUFFER_TOO_SMALL
IO_SCSI_CAPABILITIES PortCapabilities
UCHAR ProductRevisionLevel[4]
ULONG MaximumTransferLength
ULONG MaximumPhysicalPages
union _IO_STACK_LOCATION::@1581 Parameters
struct _IO_STACK_LOCATION::@1581::@1582 DeviceIoControl
struct _LIST_ENTRY * Flink
UCHAR NumberOfLogicalUnits
ULONG NextInquiryDataOffset
PDEVICE_OBJECT LowerDevice
SCSI_PORT_COMMON_EXTENSION Common
STORAGE_QUERY_TYPE QueryType
STORAGE_PROPERTY_ID PropertyId
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_INVALID_DEVICE_REQUEST
#define ALIGN_UP(size, type)
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack