ReactOS 0.4.16-dev-106-g10b08aa
srb.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _ACCESS_RANGE
 
struct  _PORT_CONFIGURATION_INFORMATION
 
struct  _PORT_CONFIGURATION_INFORMATION_NT
 
struct  _PORT_CONFIGURATION_INFORMATION_2K
 
struct  _PORT_CONFIGURATION_INFORMATION_COMMON
 
struct  _SCSI_SUPPORTED_CONTROL_TYPE_LIST
 
struct  _SCSI_REQUEST_BLOCK
 
struct  _SCSI_WMI_REQUEST_BLOCK
 
struct  _HW_INITIALIZATION_DATA
 
struct  _HW_INITIALIZATION_DATA_2K
 
struct  _HW_INITIALIZATION_DATA_COMMON
 

Macros

#define SCSI_MAXIMUM_LOGICAL_UNITS   8
 
#define SCSI_MAXIMUM_TARGETS_PER_BUS   128
 
#define SCSI_MAXIMUM_LUNS_PER_TARGET   255
 
#define SCSI_MAXIMUM_BUSES   8
 
#define SCSI_MINIMUM_PHYSICAL_BREAKS   16
 
#define SCSI_MAXIMUM_PHYSICAL_BREAKS   255
 
#define SCSI_MAXIMUM_TARGETS   8
 
#define MAXIMUM_CDB_SIZE   12
 
#define CONFIG_INFO_VERSION_2   sizeof(PORT_CONFIGURATION_INFORMATION)
 
#define SCSI_DMA64_SYSTEM_SUPPORTED   0x80
 
#define SCSI_DMA64_MINIPORT_SUPPORTED   0x01
 
#define SP_UNINITIALIZED_VALUE   ((ULONG) ~0)
 
#define SP_UNTAGGED   ((UCHAR) ~0)
 
#define SRBEV_BUS_RESET   0x0001
 
#define SRBEV_SCSI_ASYNC_NOTIFICATION   0x0002
 
#define SCSI_REQUEST_BLOCK_SIZE   sizeof(SCSI_REQUEST_BLOCK)
 
#define SRB_FUNCTION_EXECUTE_SCSI   0x00
 
#define SRB_FUNCTION_CLAIM_DEVICE   0x01
 
#define SRB_FUNCTION_IO_CONTROL   0x02
 
#define SRB_FUNCTION_RECEIVE_EVENT   0x03
 
#define SRB_FUNCTION_RELEASE_QUEUE   0x04
 
#define SRB_FUNCTION_ATTACH_DEVICE   0x05
 
#define SRB_FUNCTION_RELEASE_DEVICE   0x06
 
#define SRB_FUNCTION_SHUTDOWN   0x07
 
#define SRB_FUNCTION_FLUSH   0x08
 
#define SRB_FUNCTION_ABORT_COMMAND   0x10
 
#define SRB_FUNCTION_RELEASE_RECOVERY   0x11
 
#define SRB_FUNCTION_RESET_BUS   0x12
 
#define SRB_FUNCTION_RESET_DEVICE   0x13
 
#define SRB_FUNCTION_TERMINATE_IO   0x14
 
#define SRB_FUNCTION_FLUSH_QUEUE   0x15
 
#define SRB_FUNCTION_REMOVE_DEVICE   0x16
 
#define SRB_FUNCTION_WMI   0x17
 
#define SRB_FUNCTION_LOCK_QUEUE   0x18
 
#define SRB_FUNCTION_UNLOCK_QUEUE   0x19
 
#define SRB_FUNCTION_RESET_LOGICAL_UNIT   0x20
 
#define SRB_STATUS_PENDING   0x00
 
#define SRB_STATUS_SUCCESS   0x01
 
#define SRB_STATUS_ABORTED   0x02
 
#define SRB_STATUS_ABORT_FAILED   0x03
 
#define SRB_STATUS_ERROR   0x04
 
#define SRB_STATUS_BUSY   0x05
 
#define SRB_STATUS_INVALID_REQUEST   0x06
 
#define SRB_STATUS_INVALID_PATH_ID   0x07
 
#define SRB_STATUS_NO_DEVICE   0x08
 
#define SRB_STATUS_TIMEOUT   0x09
 
#define SRB_STATUS_SELECTION_TIMEOUT   0x0A
 
#define SRB_STATUS_COMMAND_TIMEOUT   0x0B
 
#define SRB_STATUS_MESSAGE_REJECTED   0x0D
 
#define SRB_STATUS_BUS_RESET   0x0E
 
#define SRB_STATUS_PARITY_ERROR   0x0F
 
#define SRB_STATUS_REQUEST_SENSE_FAILED   0x10
 
#define SRB_STATUS_NO_HBA   0x11
 
#define SRB_STATUS_DATA_OVERRUN   0x12
 
#define SRB_STATUS_UNEXPECTED_BUS_FREE   0x13
 
#define SRB_STATUS_PHASE_SEQUENCE_FAILURE   0x14
 
#define SRB_STATUS_BAD_SRB_BLOCK_LENGTH   0x15
 
#define SRB_STATUS_REQUEST_FLUSHED   0x16
 
#define SRB_STATUS_INVALID_LUN   0x20
 
#define SRB_STATUS_INVALID_TARGET_ID   0x21
 
#define SRB_STATUS_BAD_FUNCTION   0x22
 
#define SRB_STATUS_ERROR_RECOVERY   0x23
 
#define SRB_STATUS_NOT_POWERED   0x24
 
#define SRB_STATUS_INTERNAL_ERROR   0x30
 
#define SRB_STATUS_QUEUE_FROZEN   0x40
 
#define SRB_STATUS_AUTOSENSE_VALID   0x80
 
#define SRB_STATUS(Status)   (Status & ~(SRB_STATUS_AUTOSENSE_VALID | SRB_STATUS_QUEUE_FROZEN))
 
#define SRB_FLAGS_QUEUE_ACTION_ENABLE   0x00000002
 
#define SRB_FLAGS_DISABLE_DISCONNECT   0x00000004
 
#define SRB_FLAGS_DISABLE_SYNCH_TRANSFER   0x00000008
 
#define SRB_FLAGS_BYPASS_FROZEN_QUEUE   0x00000010
 
#define SRB_FLAGS_DISABLE_AUTOSENSE   0x00000020
 
#define SRB_FLAGS_DATA_IN   0x00000040
 
#define SRB_FLAGS_DATA_OUT   0x00000080
 
#define SRB_FLAGS_NO_DATA_TRANSFER   0x00000000
 
#define SRB_FLAGS_UNSPECIFIED_DIRECTION   (SRB_FLAGS_DATA_IN | SRB_FLAGS_DATA_OUT)
 
#define SRB_FLAGS_NO_QUEUE_FREEZE   0x00000100
 
#define SRB_FLAGS_ADAPTER_CACHE_ENABLE   0x00000200
 
#define SRB_FLAGS_FREE_SENSE_BUFFER   0x00000400
 
#define SRB_FLAGS_IS_ACTIVE   0x00010000
 
#define SRB_FLAGS_ALLOCATED_FROM_ZONE   0x00020000
 
#define SRB_FLAGS_SGLIST_FROM_POOL   0x00040000
 
#define SRB_FLAGS_BYPASS_LOCKED_QUEUE   0x00080000
 
#define SRB_FLAGS_NO_KEEP_AWAKE   0x00100000
 
#define SRB_FLAGS_PORT_DRIVER_ALLOCSENSE   0x00200000
 
#define SRB_FLAGS_PORT_DRIVER_SENSEHASPORT   0x00400000
 
#define SRB_FLAGS_DONT_START_NEXT_PACKET   0x00800000
 
#define SRB_FLAGS_PORT_DRIVER_RESERVED   0x0F000000
 
#define SRB_FLAGS_CLASS_DRIVER_RESERVED   0xF0000000
 
#define SRB_SIMPLE_TAG_REQUEST   0x20
 
#define SRB_HEAD_OF_QUEUE_TAG_REQUEST   0x21
 
#define SRB_ORDERED_QUEUE_TAG_REQUEST   0x22
 
#define SRB_WMI_FLAGS_ADAPTER_REQUEST   0x01
 
#define SP_BUS_PARITY_ERROR   0x0001
 
#define SP_UNEXPECTED_DISCONNECT   0x0002
 
#define SP_INVALID_RESELECTION   0x0003
 
#define SP_BUS_TIME_OUT   0x0004
 
#define SP_PROTOCOL_ERROR   0x0005
 
#define SP_INTERNAL_ADAPTER_ERROR   0x0006
 
#define SP_REQUEST_TIMEOUT   0x0007
 
#define SP_IRQ_NOT_RESPONDING   0x0008
 
#define SP_BAD_FW_WARNING   0x0009
 
#define SP_BAD_FW_ERROR   0x000a
 
#define SP_LOST_WMI_MINIPORT_REQUEST   0x000b
 
#define SP_RETURN_NOT_FOUND   0
 
#define SP_RETURN_FOUND   1
 
#define SP_RETURN_ERROR   2
 
#define SP_RETURN_BAD_CONFIG   3
 
#define SCSIPORT_API   DECLSPEC_IMPORT
 
#define ScsiPortConvertPhysicalAddressToUlong(Address)   ((Address).LowPart)
 

Typedefs

typedef PHYSICAL_ADDRESS SCSI_PHYSICAL_ADDRESS
 
typedef PHYSICAL_ADDRESSPSCSI_PHYSICAL_ADDRESS
 
typedef struct _ACCESS_RANGE ACCESS_RANGE
 
typedef struct _ACCESS_RANGEPACCESS_RANGE
 
typedef struct _PORT_CONFIGURATION_INFORMATION PORT_CONFIGURATION_INFORMATION
 
typedef struct _PORT_CONFIGURATION_INFORMATIONPPORT_CONFIGURATION_INFORMATION
 
typedef struct _PORT_CONFIGURATION_INFORMATION_NT PORT_CONFIGURATION_INFORMATION_NT
 
typedef struct _PORT_CONFIGURATION_INFORMATION_NTPPORT_CONFIGURATION_INFORMATION_NT
 
typedef struct _PORT_CONFIGURATION_INFORMATION_2K PORT_CONFIGURATION_INFORMATION_2K
 
typedef struct _PORT_CONFIGURATION_INFORMATION_2KPPORT_CONFIGURATION_INFORMATION_2K
 
typedef struct _PORT_CONFIGURATION_INFORMATION_COMMON PORT_CONFIGURATION_INFORMATION_COMMON
 
typedef struct _PORT_CONFIGURATION_INFORMATION_COMMONPPORT_CONFIGURATION_INFORMATION_COMMON
 
typedef enum _SCSI_ADAPTER_CONTROL_TYPE SCSI_ADAPTER_CONTROL_TYPE
 
typedef enum _SCSI_ADAPTER_CONTROL_TYPEPSCSI_ADAPTER_CONTROL_TYPE
 
typedef enum _SCSI_ADAPTER_CONTROL_STATUS SCSI_ADAPTER_CONTROL_STATUS
 
typedef enum _SCSI_ADAPTER_CONTROL_STATUSPSCSI_ADAPTER_CONTROL_STATUS
 
typedef struct _SCSI_SUPPORTED_CONTROL_TYPE_LIST SCSI_SUPPORTED_CONTROL_TYPE_LIST
 
typedef struct _SCSI_SUPPORTED_CONTROL_TYPE_LISTPSCSI_SUPPORTED_CONTROL_TYPE_LIST
 
typedef struct _SCSI_REQUEST_BLOCK SCSI_REQUEST_BLOCK
 
typedef struct _SCSI_REQUEST_BLOCKPSCSI_REQUEST_BLOCK
 
typedef struct _SCSI_WMI_REQUEST_BLOCK SCSI_WMI_REQUEST_BLOCK
 
typedef struct _SCSI_WMI_REQUEST_BLOCKPSCSI_WMI_REQUEST_BLOCK
 
typedef BOOLEAN(NTAPIPHW_INITIALIZE) (IN PVOID DeviceExtension)
 
typedef BOOLEAN(NTAPIPHW_STARTIO) (IN PVOID DeviceExtension, IN PSCSI_REQUEST_BLOCK Srb)
 
typedef BOOLEAN(NTAPIPHW_INTERRUPT) (IN PVOID DeviceExtension)
 
typedef VOID(NTAPIPHW_TIMER) (IN PVOID DeviceExtension)
 
typedef VOID(NTAPIPHW_DMA_STARTED) (IN PVOID DeviceExtension)
 
typedef ULONG(NTAPIPHW_FIND_ADAPTER) (IN PVOID DeviceExtension, IN PVOID HwContext, IN PVOID BusInformation, IN PCHAR ArgumentString, IN OUT PPORT_CONFIGURATION_INFORMATION ConfigInfo, OUT PBOOLEAN Again)
 
typedef BOOLEAN(NTAPIPHW_RESET_BUS) (IN PVOID DeviceExtension, IN ULONG PathId)
 
typedef BOOLEAN(NTAPIPHW_ADAPTER_STATE) (IN PVOID DeviceExtension, IN PVOID Context, IN BOOLEAN SaveState)
 
typedef SCSI_ADAPTER_CONTROL_STATUS(NTAPIPHW_ADAPTER_CONTROL) (IN PVOID DeviceExtension, IN SCSI_ADAPTER_CONTROL_TYPE ControlType, IN PVOID Parameters)
 
typedef enum _SCSI_NOTIFICATION_TYPE SCSI_NOTIFICATION_TYPE
 
typedef enum _SCSI_NOTIFICATION_TYPEPSCSI_NOTIFICATION_TYPE
 
typedef struct _HW_INITIALIZATION_DATA HW_INITIALIZATION_DATA
 
typedef struct _HW_INITIALIZATION_DATAPHW_INITIALIZATION_DATA
 
typedef struct _HW_INITIALIZATION_DATA_2K HW_INITIALIZATION_DATA_2K
 
typedef struct _HW_INITIALIZATION_DATA_2KPHW_INITIALIZATION_DATA_2K
 
typedef struct _HW_INITIALIZATION_DATA_COMMON HW_INITIALIZATION_DATA_COMMON
 
typedef struct _HW_INITIALIZATION_DATA_COMMONPHW_INITIALIZATION_DATA_COMMON
 

Enumerations

enum  _SCSI_ADAPTER_CONTROL_TYPE {
  ScsiQuerySupportedControlTypes = 0 , ScsiStopAdapter , ScsiRestartAdapter , ScsiSetBootConfig ,
  ScsiSetRunningConfig , ScsiAdapterControlMax , MakeAdapterControlTypeSizeOfUlong = 0xffffffff , ScsiQuerySupportedControlTypes = 0 ,
  ScsiStopAdapter , ScsiRestartAdapter , ScsiSetBootConfig , ScsiSetRunningConfig ,
  ScsiAdapterControlMax , MakeAdapterControlTypeSizeOfUlong = 0xffffffff , ScsiQuerySupportedControlTypes = 0 , ScsiStopAdapter ,
  ScsiRestartAdapter , ScsiSetBootConfig , ScsiSetRunningConfig , ScsiAdapterControlMax ,
  MakeAdapterControlTypeSizeOfUlong = 0xffffffff
}
 
enum  _SCSI_ADAPTER_CONTROL_STATUS {
  ScsiAdapterControlSuccess = 0 , ScsiAdapterControlUnsuccessful , ScsiAdapterControlSuccess = 0 , ScsiAdapterControlUnsuccessful ,
  ScsiAdapterControlSuccess = 0 , ScsiAdapterControlUnsuccessful
}
 
enum  _SCSI_NOTIFICATION_TYPE {
  RequestComplete , NextRequest , NextLuRequest , ResetDetected ,
  CallDisableInterrupts , CallEnableInterrupts , RequestTimerCall , BusChangeDetected ,
  WMIEvent , WMIReregister , RequestComplete , NextRequest ,
  NextLuRequest , ResetDetected , CallDisableInterrupts , CallEnableInterrupts ,
  RequestTimerCall , BusChangeDetected , WMIEvent , WMIReregister ,
  LinkUp , LinkDown , QueryTickCount , BufferOverrunDetected ,
  TraceNotification , RequestComplete , NextRequest , NextLuRequest ,
  ResetDetected , _obsolete1 , _obsolete2 , RequestTimerCall ,
  BusChangeDetected , WMIEvent , WMIReregister , LinkUp ,
  LinkDown , QueryTickCount , BufferOverrunDetected , TraceNotification ,
  GetExtendedFunctionTable , EnablePassiveInitialization = 0x1000 , InitializeDpc , IssueDpc ,
  AcquireSpinLock , ReleaseSpinLock
}
 

Functions

SCSIPORT_API ULONG NTAPI ScsiPortInitialize (IN PVOID Argument1, IN PVOID Argument2, IN struct _HW_INITIALIZATION_DATA *HwInitializationData, IN PVOID HwContext)
 
SCSIPORT_API VOID NTAPI ScsiPortFreeDeviceBase (IN PVOID HwDeviceExtension, IN PVOID MappedAddress)
 
SCSIPORT_API ULONG NTAPI ScsiPortGetBusData (IN PVOID DeviceExtension, IN ULONG BusDataType, IN ULONG SystemIoBusNumber, IN ULONG SlotNumber, IN PVOID Buffer, IN ULONG Length)
 
SCSIPORT_API ULONG NTAPI ScsiPortSetBusDataByOffset (IN PVOID DeviceExtension, IN ULONG BusDataType, IN ULONG SystemIoBusNumber, IN ULONG SlotNumber, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
 
SCSIPORT_API PVOID NTAPI ScsiPortGetDeviceBase (IN PVOID HwDeviceExtension, IN INTERFACE_TYPE BusType, IN ULONG SystemIoBusNumber, IN SCSI_PHYSICAL_ADDRESS IoAddress, IN ULONG NumberOfBytes, IN BOOLEAN InIoSpace)
 
SCSIPORT_API PVOID NTAPI ScsiPortGetLogicalUnit (IN PVOID HwDeviceExtension, IN UCHAR PathId, IN UCHAR TargetId, IN UCHAR Lun)
 
SCSIPORT_API PSCSI_REQUEST_BLOCK NTAPI ScsiPortGetSrb (IN PVOID DeviceExtension, IN UCHAR PathId, IN UCHAR TargetId, IN UCHAR Lun, IN LONG QueueTag)
 
SCSIPORT_API SCSI_PHYSICAL_ADDRESS NTAPI ScsiPortGetPhysicalAddress (IN PVOID HwDeviceExtension, IN PSCSI_REQUEST_BLOCK Srb, IN PVOID VirtualAddress, OUT ULONG *Length)
 
SCSIPORT_API PVOID NTAPI ScsiPortGetVirtualAddress (IN PVOID HwDeviceExtension, IN SCSI_PHYSICAL_ADDRESS PhysicalAddress)
 
SCSIPORT_API PVOID NTAPI ScsiPortGetUncachedExtension (IN PVOID HwDeviceExtension, IN PPORT_CONFIGURATION_INFORMATION ConfigInfo, IN ULONG NumberOfBytes)
 
SCSIPORT_API VOID NTAPI ScsiPortFlushDma (IN PVOID DeviceExtension)
 
SCSIPORT_API VOID NTAPI ScsiPortIoMapTransfer (IN PVOID HwDeviceExtension, IN PSCSI_REQUEST_BLOCK Srb, IN PVOID LogicalAddress, IN ULONG Length)
 
SCSIPORT_API VOID __cdecl ScsiPortNotification (IN SCSI_NOTIFICATION_TYPE NotificationType, IN PVOID HwDeviceExtension,...)
 
SCSIPORT_API VOID NTAPI ScsiPortLogError (IN PVOID HwDeviceExtension, IN PSCSI_REQUEST_BLOCK Srb OPTIONAL, IN UCHAR PathId, IN UCHAR TargetId, IN UCHAR Lun, IN ULONG ErrorCode, IN ULONG UniqueId)
 
SCSIPORT_API VOID NTAPI ScsiPortCompleteRequest (IN PVOID HwDeviceExtension, IN UCHAR PathId, IN UCHAR TargetId, IN UCHAR Lun, IN UCHAR SrbStatus)
 
SCSIPORT_API VOID NTAPI ScsiPortMoveMemory (IN PVOID WriteBuffer, IN PVOID ReadBuffer, IN ULONG Length)
 
SCSIPORT_API UCHAR NTAPI ScsiPortReadPortUchar (IN PUCHAR Port)
 
SCSIPORT_API USHORT NTAPI ScsiPortReadPortUshort (IN PUSHORT Port)
 
SCSIPORT_API ULONG NTAPI ScsiPortReadPortUlong (IN PULONG Port)
 
SCSIPORT_API VOID NTAPI ScsiPortReadPortBufferUchar (IN PUCHAR Port, IN PUCHAR Buffer, IN ULONG Count)
 
SCSIPORT_API VOID NTAPI ScsiPortReadPortBufferUshort (IN PUSHORT Port, IN PUSHORT Buffer, IN ULONG Count)
 
SCSIPORT_API VOID NTAPI ScsiPortReadPortBufferUlong (IN PULONG Port, IN PULONG Buffer, IN ULONG Count)
 
SCSIPORT_API UCHAR NTAPI ScsiPortReadRegisterUchar (IN PUCHAR Register)
 
SCSIPORT_API USHORT NTAPI ScsiPortReadRegisterUshort (IN PUSHORT Register)
 
SCSIPORT_API ULONG NTAPI ScsiPortReadRegisterUlong (IN PULONG Register)
 
SCSIPORT_API VOID NTAPI ScsiPortReadRegisterBufferUchar (IN PUCHAR Register, IN PUCHAR Buffer, IN ULONG Count)
 
SCSIPORT_API VOID NTAPI ScsiPortReadRegisterBufferUshort (IN PUSHORT Register, IN PUSHORT Buffer, IN ULONG Count)
 
SCSIPORT_API VOID NTAPI ScsiPortReadRegisterBufferUlong (IN PULONG Register, IN PULONG Buffer, IN ULONG Count)
 
SCSIPORT_API VOID NTAPI ScsiPortStallExecution (IN ULONG Delay)
 
SCSIPORT_API VOID NTAPI ScsiPortWritePortUchar (IN PUCHAR Port, IN UCHAR Value)
 
SCSIPORT_API VOID NTAPI ScsiPortWritePortUshort (IN PUSHORT Port, IN USHORT Value)
 
SCSIPORT_API VOID NTAPI ScsiPortWritePortUlong (IN PULONG Port, IN ULONG Value)
 
SCSIPORT_API VOID NTAPI ScsiPortWritePortBufferUchar (IN PUCHAR Port, IN PUCHAR Buffer, IN ULONG Count)
 
SCSIPORT_API VOID NTAPI ScsiPortWritePortBufferUshort (IN PUSHORT Port, IN PUSHORT Buffer, IN ULONG Count)
 
SCSIPORT_API VOID NTAPI ScsiPortWritePortBufferUlong (IN PULONG Port, IN PULONG Buffer, IN ULONG Count)
 
SCSIPORT_API VOID NTAPI ScsiPortWriteRegisterUchar (IN PUCHAR Register, IN UCHAR Value)
 
SCSIPORT_API VOID NTAPI ScsiPortWriteRegisterUshort (IN PUSHORT Register, IN USHORT Value)
 
SCSIPORT_API VOID NTAPI ScsiPortWriteRegisterUlong (IN PULONG Register, IN ULONG Value)
 
SCSIPORT_API VOID NTAPI ScsiPortWriteRegisterBufferUchar (IN PUCHAR Register, IN PUCHAR Buffer, IN ULONG Count)
 
SCSIPORT_API VOID NTAPI ScsiPortWriteRegisterBufferUshort (IN PUSHORT Register, IN PUSHORT Buffer, IN ULONG Count)
 
SCSIPORT_API VOID NTAPI ScsiPortWriteRegisterBufferUlong (IN PULONG Register, IN PULONG Buffer, IN ULONG Count)
 
SCSIPORT_API SCSI_PHYSICAL_ADDRESS NTAPI ScsiPortConvertUlongToPhysicalAddress (ULONG UlongAddress)
 
SCSIPORT_API ULONG NTAPI ScsiPortConvertPhysicalAddressToUlong (SCSI_PHYSICAL_ADDRESS Address)
 
SCSIPORT_API BOOLEAN NTAPI ScsiPortValidateRange (IN PVOID HwDeviceExtension, IN INTERFACE_TYPE BusType, IN ULONG SystemIoBusNumber, IN SCSI_PHYSICAL_ADDRESS IoAddress, IN ULONG NumberOfBytes, IN BOOLEAN InIoSpace)
 
SCSIPORT_API VOID __cdecl ScsiDebugPrint (ULONG DebugPrintLevel, PCCHAR DebugMessage,...)
 

Macro Definition Documentation

◆ CONFIG_INFO_VERSION_2

#define CONFIG_INFO_VERSION_2   sizeof(PORT_CONFIGURATION_INFORMATION)

Definition at line 146 of file srb.h.

◆ MAXIMUM_CDB_SIZE

#define MAXIMUM_CDB_SIZE   12

Definition at line 33 of file srb.h.

◆ SCSI_DMA64_MINIPORT_SUPPORTED

#define SCSI_DMA64_MINIPORT_SUPPORTED   0x01

Definition at line 169 of file srb.h.

◆ SCSI_DMA64_SYSTEM_SUPPORTED

#define SCSI_DMA64_SYSTEM_SUPPORTED   0x80

Definition at line 161 of file srb.h.

◆ SCSI_MAXIMUM_BUSES

#define SCSI_MAXIMUM_BUSES   8

Definition at line 24 of file srb.h.

◆ SCSI_MAXIMUM_LOGICAL_UNITS

#define SCSI_MAXIMUM_LOGICAL_UNITS   8

Definition at line 21 of file srb.h.

◆ SCSI_MAXIMUM_LUNS_PER_TARGET

#define SCSI_MAXIMUM_LUNS_PER_TARGET   255

Definition at line 23 of file srb.h.

◆ SCSI_MAXIMUM_PHYSICAL_BREAKS

#define SCSI_MAXIMUM_PHYSICAL_BREAKS   255

Definition at line 26 of file srb.h.

◆ SCSI_MAXIMUM_TARGETS

#define SCSI_MAXIMUM_TARGETS   8

Definition at line 31 of file srb.h.

◆ SCSI_MAXIMUM_TARGETS_PER_BUS

#define SCSI_MAXIMUM_TARGETS_PER_BUS   128

Definition at line 22 of file srb.h.

◆ SCSI_MINIMUM_PHYSICAL_BREAKS

#define SCSI_MINIMUM_PHYSICAL_BREAKS   16

Definition at line 25 of file srb.h.

◆ SCSI_REQUEST_BLOCK_SIZE

#define SCSI_REQUEST_BLOCK_SIZE   sizeof(SCSI_REQUEST_BLOCK)

Definition at line 282 of file srb.h.

◆ SCSIPORT_API

#define SCSIPORT_API   DECLSPEC_IMPORT

Definition at line 608 of file srb.h.

◆ ScsiPortConvertPhysicalAddressToUlong

#define ScsiPortConvertPhysicalAddressToUlong (   Address)    ((Address).LowPart)

Definition at line 957 of file srb.h.

◆ SP_BAD_FW_ERROR

#define SP_BAD_FW_ERROR   0x000a

Definition at line 513 of file srb.h.

◆ SP_BAD_FW_WARNING

#define SP_BAD_FW_WARNING   0x0009

Definition at line 512 of file srb.h.

◆ SP_BUS_PARITY_ERROR

#define SP_BUS_PARITY_ERROR   0x0001

Definition at line 504 of file srb.h.

◆ SP_BUS_TIME_OUT

#define SP_BUS_TIME_OUT   0x0004

Definition at line 507 of file srb.h.

◆ SP_INTERNAL_ADAPTER_ERROR

#define SP_INTERNAL_ADAPTER_ERROR   0x0006

Definition at line 509 of file srb.h.

◆ SP_INVALID_RESELECTION

#define SP_INVALID_RESELECTION   0x0003

Definition at line 506 of file srb.h.

◆ SP_IRQ_NOT_RESPONDING

#define SP_IRQ_NOT_RESPONDING   0x0008

Definition at line 511 of file srb.h.

◆ SP_LOST_WMI_MINIPORT_REQUEST

#define SP_LOST_WMI_MINIPORT_REQUEST   0x000b

Definition at line 514 of file srb.h.

◆ SP_PROTOCOL_ERROR

#define SP_PROTOCOL_ERROR   0x0005

Definition at line 508 of file srb.h.

◆ SP_REQUEST_TIMEOUT

#define SP_REQUEST_TIMEOUT   0x0007

Definition at line 510 of file srb.h.

◆ SP_RETURN_BAD_CONFIG

#define SP_RETURN_BAD_CONFIG   3

Definition at line 524 of file srb.h.

◆ SP_RETURN_ERROR

#define SP_RETURN_ERROR   2

Definition at line 523 of file srb.h.

◆ SP_RETURN_FOUND

#define SP_RETURN_FOUND   1

Definition at line 522 of file srb.h.

◆ SP_RETURN_NOT_FOUND

#define SP_RETURN_NOT_FOUND   0

Definition at line 521 of file srb.h.

◆ SP_UNEXPECTED_DISCONNECT

#define SP_UNEXPECTED_DISCONNECT   0x0002

Definition at line 505 of file srb.h.

◆ SP_UNINITIALIZED_VALUE

#define SP_UNINITIALIZED_VALUE   ((ULONG) ~0)

Definition at line 232 of file srb.h.

◆ SP_UNTAGGED

#define SP_UNTAGGED   ((UCHAR) ~0)

Definition at line 233 of file srb.h.

◆ SRB_FLAGS_ADAPTER_CACHE_ENABLE

#define SRB_FLAGS_ADAPTER_CACHE_ENABLE   0x00000200

Definition at line 405 of file srb.h.

◆ SRB_FLAGS_ALLOCATED_FROM_ZONE

#define SRB_FLAGS_ALLOCATED_FROM_ZONE   0x00020000

Definition at line 408 of file srb.h.

◆ SRB_FLAGS_BYPASS_FROZEN_QUEUE

#define SRB_FLAGS_BYPASS_FROZEN_QUEUE   0x00000010

Definition at line 398 of file srb.h.

◆ SRB_FLAGS_BYPASS_LOCKED_QUEUE

#define SRB_FLAGS_BYPASS_LOCKED_QUEUE   0x00080000

Definition at line 410 of file srb.h.

◆ SRB_FLAGS_CLASS_DRIVER_RESERVED

#define SRB_FLAGS_CLASS_DRIVER_RESERVED   0xF0000000

Definition at line 418 of file srb.h.

◆ SRB_FLAGS_DATA_IN

#define SRB_FLAGS_DATA_IN   0x00000040

Definition at line 400 of file srb.h.

◆ SRB_FLAGS_DATA_OUT

#define SRB_FLAGS_DATA_OUT   0x00000080

Definition at line 401 of file srb.h.

◆ SRB_FLAGS_DISABLE_AUTOSENSE

#define SRB_FLAGS_DISABLE_AUTOSENSE   0x00000020

Definition at line 399 of file srb.h.

◆ SRB_FLAGS_DISABLE_DISCONNECT

#define SRB_FLAGS_DISABLE_DISCONNECT   0x00000004

Definition at line 396 of file srb.h.

◆ SRB_FLAGS_DISABLE_SYNCH_TRANSFER

#define SRB_FLAGS_DISABLE_SYNCH_TRANSFER   0x00000008

Definition at line 397 of file srb.h.

◆ SRB_FLAGS_DONT_START_NEXT_PACKET

#define SRB_FLAGS_DONT_START_NEXT_PACKET   0x00800000

Definition at line 415 of file srb.h.

◆ SRB_FLAGS_FREE_SENSE_BUFFER

#define SRB_FLAGS_FREE_SENSE_BUFFER   0x00000400

Definition at line 406 of file srb.h.

◆ SRB_FLAGS_IS_ACTIVE

#define SRB_FLAGS_IS_ACTIVE   0x00010000

Definition at line 407 of file srb.h.

◆ SRB_FLAGS_NO_DATA_TRANSFER

#define SRB_FLAGS_NO_DATA_TRANSFER   0x00000000

Definition at line 402 of file srb.h.

◆ SRB_FLAGS_NO_KEEP_AWAKE

#define SRB_FLAGS_NO_KEEP_AWAKE   0x00100000

Definition at line 412 of file srb.h.

◆ SRB_FLAGS_NO_QUEUE_FREEZE

#define SRB_FLAGS_NO_QUEUE_FREEZE   0x00000100

Definition at line 404 of file srb.h.

◆ SRB_FLAGS_PORT_DRIVER_ALLOCSENSE

#define SRB_FLAGS_PORT_DRIVER_ALLOCSENSE   0x00200000

Definition at line 413 of file srb.h.

◆ SRB_FLAGS_PORT_DRIVER_RESERVED

#define SRB_FLAGS_PORT_DRIVER_RESERVED   0x0F000000

Definition at line 417 of file srb.h.

◆ SRB_FLAGS_PORT_DRIVER_SENSEHASPORT

#define SRB_FLAGS_PORT_DRIVER_SENSEHASPORT   0x00400000

Definition at line 414 of file srb.h.

◆ SRB_FLAGS_QUEUE_ACTION_ENABLE

#define SRB_FLAGS_QUEUE_ACTION_ENABLE   0x00000002

Definition at line 395 of file srb.h.

◆ SRB_FLAGS_SGLIST_FROM_POOL

#define SRB_FLAGS_SGLIST_FROM_POOL   0x00040000

Definition at line 409 of file srb.h.

◆ SRB_FLAGS_UNSPECIFIED_DIRECTION

#define SRB_FLAGS_UNSPECIFIED_DIRECTION   (SRB_FLAGS_DATA_IN | SRB_FLAGS_DATA_OUT)

Definition at line 403 of file srb.h.

◆ SRB_FUNCTION_ABORT_COMMAND

#define SRB_FUNCTION_ABORT_COMMAND   0x10

Definition at line 324 of file srb.h.

◆ SRB_FUNCTION_ATTACH_DEVICE

#define SRB_FUNCTION_ATTACH_DEVICE   0x05

Definition at line 320 of file srb.h.

◆ SRB_FUNCTION_CLAIM_DEVICE

#define SRB_FUNCTION_CLAIM_DEVICE   0x01

Definition at line 316 of file srb.h.

◆ SRB_FUNCTION_EXECUTE_SCSI

#define SRB_FUNCTION_EXECUTE_SCSI   0x00

Definition at line 315 of file srb.h.

◆ SRB_FUNCTION_FLUSH

#define SRB_FUNCTION_FLUSH   0x08

Definition at line 323 of file srb.h.

◆ SRB_FUNCTION_FLUSH_QUEUE

#define SRB_FUNCTION_FLUSH_QUEUE   0x15

Definition at line 329 of file srb.h.

◆ SRB_FUNCTION_IO_CONTROL

#define SRB_FUNCTION_IO_CONTROL   0x02

Definition at line 317 of file srb.h.

◆ SRB_FUNCTION_LOCK_QUEUE

#define SRB_FUNCTION_LOCK_QUEUE   0x18

Definition at line 332 of file srb.h.

◆ SRB_FUNCTION_RECEIVE_EVENT

#define SRB_FUNCTION_RECEIVE_EVENT   0x03

Definition at line 318 of file srb.h.

◆ SRB_FUNCTION_RELEASE_DEVICE

#define SRB_FUNCTION_RELEASE_DEVICE   0x06

Definition at line 321 of file srb.h.

◆ SRB_FUNCTION_RELEASE_QUEUE

#define SRB_FUNCTION_RELEASE_QUEUE   0x04

Definition at line 319 of file srb.h.

◆ SRB_FUNCTION_RELEASE_RECOVERY

#define SRB_FUNCTION_RELEASE_RECOVERY   0x11

Definition at line 325 of file srb.h.

◆ SRB_FUNCTION_REMOVE_DEVICE

#define SRB_FUNCTION_REMOVE_DEVICE   0x16

Definition at line 330 of file srb.h.

◆ SRB_FUNCTION_RESET_BUS

#define SRB_FUNCTION_RESET_BUS   0x12

Definition at line 326 of file srb.h.

◆ SRB_FUNCTION_RESET_DEVICE

#define SRB_FUNCTION_RESET_DEVICE   0x13

Definition at line 327 of file srb.h.

◆ SRB_FUNCTION_RESET_LOGICAL_UNIT

#define SRB_FUNCTION_RESET_LOGICAL_UNIT   0x20

Definition at line 334 of file srb.h.

◆ SRB_FUNCTION_SHUTDOWN

#define SRB_FUNCTION_SHUTDOWN   0x07

Definition at line 322 of file srb.h.

◆ SRB_FUNCTION_TERMINATE_IO

#define SRB_FUNCTION_TERMINATE_IO   0x14

Definition at line 328 of file srb.h.

◆ SRB_FUNCTION_UNLOCK_QUEUE

#define SRB_FUNCTION_UNLOCK_QUEUE   0x19

Definition at line 333 of file srb.h.

◆ SRB_FUNCTION_WMI

#define SRB_FUNCTION_WMI   0x17

Definition at line 331 of file srb.h.

◆ SRB_HEAD_OF_QUEUE_TAG_REQUEST

#define SRB_HEAD_OF_QUEUE_TAG_REQUEST   0x21

Definition at line 424 of file srb.h.

◆ SRB_ORDERED_QUEUE_TAG_REQUEST

#define SRB_ORDERED_QUEUE_TAG_REQUEST   0x22

Definition at line 425 of file srb.h.

◆ SRB_SIMPLE_TAG_REQUEST

#define SRB_SIMPLE_TAG_REQUEST   0x20

Definition at line 423 of file srb.h.

◆ SRB_STATUS

Definition at line 389 of file srb.h.

◆ SRB_STATUS_ABORT_FAILED

#define SRB_STATUS_ABORT_FAILED   0x03

Definition at line 343 of file srb.h.

◆ SRB_STATUS_ABORTED

#define SRB_STATUS_ABORTED   0x02

Definition at line 342 of file srb.h.

◆ SRB_STATUS_AUTOSENSE_VALID

#define SRB_STATUS_AUTOSENSE_VALID   0x80

Definition at line 387 of file srb.h.

◆ SRB_STATUS_BAD_FUNCTION

#define SRB_STATUS_BAD_FUNCTION   0x22

Definition at line 364 of file srb.h.

◆ SRB_STATUS_BAD_SRB_BLOCK_LENGTH

#define SRB_STATUS_BAD_SRB_BLOCK_LENGTH   0x15

Definition at line 360 of file srb.h.

◆ SRB_STATUS_BUS_RESET

#define SRB_STATUS_BUS_RESET   0x0E

Definition at line 353 of file srb.h.

◆ SRB_STATUS_BUSY

#define SRB_STATUS_BUSY   0x05

Definition at line 345 of file srb.h.

◆ SRB_STATUS_COMMAND_TIMEOUT

#define SRB_STATUS_COMMAND_TIMEOUT   0x0B

Definition at line 351 of file srb.h.

◆ SRB_STATUS_DATA_OVERRUN

#define SRB_STATUS_DATA_OVERRUN   0x12

Definition at line 357 of file srb.h.

◆ SRB_STATUS_ERROR

#define SRB_STATUS_ERROR   0x04

Definition at line 344 of file srb.h.

◆ SRB_STATUS_ERROR_RECOVERY

#define SRB_STATUS_ERROR_RECOVERY   0x23

Definition at line 365 of file srb.h.

◆ SRB_STATUS_INTERNAL_ERROR

#define SRB_STATUS_INTERNAL_ERROR   0x30

Definition at line 373 of file srb.h.

◆ SRB_STATUS_INVALID_LUN

#define SRB_STATUS_INVALID_LUN   0x20

Definition at line 362 of file srb.h.

◆ SRB_STATUS_INVALID_PATH_ID

#define SRB_STATUS_INVALID_PATH_ID   0x07

Definition at line 347 of file srb.h.

◆ SRB_STATUS_INVALID_REQUEST

#define SRB_STATUS_INVALID_REQUEST   0x06

Definition at line 346 of file srb.h.

◆ SRB_STATUS_INVALID_TARGET_ID

#define SRB_STATUS_INVALID_TARGET_ID   0x21

Definition at line 363 of file srb.h.

◆ SRB_STATUS_MESSAGE_REJECTED

#define SRB_STATUS_MESSAGE_REJECTED   0x0D

Definition at line 352 of file srb.h.

◆ SRB_STATUS_NO_DEVICE

#define SRB_STATUS_NO_DEVICE   0x08

Definition at line 348 of file srb.h.

◆ SRB_STATUS_NO_HBA

#define SRB_STATUS_NO_HBA   0x11

Definition at line 356 of file srb.h.

◆ SRB_STATUS_NOT_POWERED

#define SRB_STATUS_NOT_POWERED   0x24

Definition at line 366 of file srb.h.

◆ SRB_STATUS_PARITY_ERROR

#define SRB_STATUS_PARITY_ERROR   0x0F

Definition at line 354 of file srb.h.

◆ SRB_STATUS_PENDING

#define SRB_STATUS_PENDING   0x00

Definition at line 340 of file srb.h.

◆ SRB_STATUS_PHASE_SEQUENCE_FAILURE

#define SRB_STATUS_PHASE_SEQUENCE_FAILURE   0x14

Definition at line 359 of file srb.h.

◆ SRB_STATUS_QUEUE_FROZEN

#define SRB_STATUS_QUEUE_FROZEN   0x40

Definition at line 386 of file srb.h.

◆ SRB_STATUS_REQUEST_FLUSHED

#define SRB_STATUS_REQUEST_FLUSHED   0x16

Definition at line 361 of file srb.h.

◆ SRB_STATUS_REQUEST_SENSE_FAILED

#define SRB_STATUS_REQUEST_SENSE_FAILED   0x10

Definition at line 355 of file srb.h.

◆ SRB_STATUS_SELECTION_TIMEOUT

#define SRB_STATUS_SELECTION_TIMEOUT   0x0A

Definition at line 350 of file srb.h.

◆ SRB_STATUS_SUCCESS

#define SRB_STATUS_SUCCESS   0x01

Definition at line 341 of file srb.h.

◆ SRB_STATUS_TIMEOUT

#define SRB_STATUS_TIMEOUT   0x09

Definition at line 349 of file srb.h.

◆ SRB_STATUS_UNEXPECTED_BUS_FREE

#define SRB_STATUS_UNEXPECTED_BUS_FREE   0x13

Definition at line 358 of file srb.h.

◆ SRB_WMI_FLAGS_ADAPTER_REQUEST

#define SRB_WMI_FLAGS_ADAPTER_REQUEST   0x01

Definition at line 427 of file srb.h.

◆ SRBEV_BUS_RESET

#define SRBEV_BUS_RESET   0x0001

Definition at line 239 of file srb.h.

◆ SRBEV_SCSI_ASYNC_NOTIFICATION

#define SRBEV_SCSI_ASYNC_NOTIFICATION   0x0002

Definition at line 240 of file srb.h.

Typedef Documentation

◆ ACCESS_RANGE

◆ HW_INITIALIZATION_DATA

◆ HW_INITIALIZATION_DATA_2K

◆ HW_INITIALIZATION_DATA_COMMON

◆ PACCESS_RANGE

◆ PHW_ADAPTER_CONTROL

typedef SCSI_ADAPTER_CONTROL_STATUS(NTAPI * PHW_ADAPTER_CONTROL) (IN PVOID DeviceExtension, IN SCSI_ADAPTER_CONTROL_TYPE ControlType, IN PVOID Parameters)

Definition at line 493 of file srb.h.

◆ PHW_ADAPTER_STATE

typedef BOOLEAN(NTAPI * PHW_ADAPTER_STATE) (IN PVOID DeviceExtension, IN PVOID Context, IN BOOLEAN SaveState)

Definition at line 485 of file srb.h.

◆ PHW_DMA_STARTED

typedef VOID(NTAPI * PHW_DMA_STARTED) (IN PVOID DeviceExtension)

Definition at line 461 of file srb.h.

◆ PHW_FIND_ADAPTER

typedef ULONG(NTAPI * PHW_FIND_ADAPTER) (IN PVOID DeviceExtension, IN PVOID HwContext, IN PVOID BusInformation, IN PCHAR ArgumentString, IN OUT PPORT_CONFIGURATION_INFORMATION ConfigInfo, OUT PBOOLEAN Again)

Definition at line 467 of file srb.h.

◆ PHW_INITIALIZATION_DATA

◆ PHW_INITIALIZATION_DATA_2K

◆ PHW_INITIALIZATION_DATA_COMMON

◆ PHW_INITIALIZE

typedef BOOLEAN(NTAPI * PHW_INITIALIZE) (IN PVOID DeviceExtension)

Definition at line 436 of file srb.h.

◆ PHW_INTERRUPT

typedef BOOLEAN(NTAPI * PHW_INTERRUPT) (IN PVOID DeviceExtension)

Definition at line 449 of file srb.h.

◆ PHW_RESET_BUS

typedef BOOLEAN(NTAPI * PHW_RESET_BUS) (IN PVOID DeviceExtension, IN ULONG PathId)

Definition at line 478 of file srb.h.

◆ PHW_STARTIO

typedef BOOLEAN(NTAPI * PHW_STARTIO) (IN PVOID DeviceExtension, IN PSCSI_REQUEST_BLOCK Srb)

Definition at line 442 of file srb.h.

◆ PHW_TIMER

typedef VOID(NTAPI * PHW_TIMER) (IN PVOID DeviceExtension)

Definition at line 455 of file srb.h.

◆ PORT_CONFIGURATION_INFORMATION

◆ PORT_CONFIGURATION_INFORMATION_2K

◆ PORT_CONFIGURATION_INFORMATION_COMMON

◆ PORT_CONFIGURATION_INFORMATION_NT

◆ PPORT_CONFIGURATION_INFORMATION

◆ PPORT_CONFIGURATION_INFORMATION_2K

◆ PPORT_CONFIGURATION_INFORMATION_COMMON

◆ PPORT_CONFIGURATION_INFORMATION_NT

◆ PSCSI_ADAPTER_CONTROL_STATUS

◆ PSCSI_ADAPTER_CONTROL_TYPE

◆ PSCSI_NOTIFICATION_TYPE

◆ PSCSI_PHYSICAL_ADDRESS

Definition at line 38 of file srb.h.

◆ PSCSI_REQUEST_BLOCK

◆ PSCSI_SUPPORTED_CONTROL_TYPE_LIST

◆ PSCSI_WMI_REQUEST_BLOCK

◆ SCSI_ADAPTER_CONTROL_STATUS

◆ SCSI_ADAPTER_CONTROL_TYPE

◆ SCSI_NOTIFICATION_TYPE

◆ SCSI_PHYSICAL_ADDRESS

Definition at line 38 of file srb.h.

◆ SCSI_REQUEST_BLOCK

◆ SCSI_SUPPORTED_CONTROL_TYPE_LIST

◆ SCSI_WMI_REQUEST_BLOCK

Enumeration Type Documentation

◆ _SCSI_ADAPTER_CONTROL_STATUS

Enumerator
ScsiAdapterControlSuccess 
ScsiAdapterControlUnsuccessful 
ScsiAdapterControlSuccess 
ScsiAdapterControlUnsuccessful 
ScsiAdapterControlSuccess 
ScsiAdapterControlUnsuccessful 

Definition at line 190 of file srb.h.

190 {
@ ScsiAdapterControlSuccess
Definition: srb.h:191
@ ScsiAdapterControlUnsuccessful
Definition: srb.h:192
enum _SCSI_ADAPTER_CONTROL_STATUS SCSI_ADAPTER_CONTROL_STATUS
enum _SCSI_ADAPTER_CONTROL_STATUS * PSCSI_ADAPTER_CONTROL_STATUS

◆ _SCSI_ADAPTER_CONTROL_TYPE

Enumerator
ScsiQuerySupportedControlTypes 
ScsiStopAdapter 
ScsiRestartAdapter 
ScsiSetBootConfig 
ScsiSetRunningConfig 
ScsiAdapterControlMax 
MakeAdapterControlTypeSizeOfUlong 
ScsiQuerySupportedControlTypes 
ScsiStopAdapter 
ScsiRestartAdapter 
ScsiSetBootConfig 
ScsiSetRunningConfig 
ScsiAdapterControlMax 
MakeAdapterControlTypeSizeOfUlong 
ScsiQuerySupportedControlTypes 
ScsiStopAdapter 
ScsiRestartAdapter 
ScsiSetBootConfig 
ScsiSetRunningConfig 
ScsiAdapterControlMax 
MakeAdapterControlTypeSizeOfUlong 

Definition at line 176 of file srb.h.

176 {
@ ScsiRestartAdapter
Definition: srb.h:179
@ ScsiQuerySupportedControlTypes
Definition: srb.h:177
@ ScsiAdapterControlMax
Definition: srb.h:182
@ ScsiSetBootConfig
Definition: srb.h:180
@ ScsiStopAdapter
Definition: srb.h:178
@ MakeAdapterControlTypeSizeOfUlong
Definition: srb.h:183
@ ScsiSetRunningConfig
Definition: srb.h:181
enum _SCSI_ADAPTER_CONTROL_TYPE SCSI_ADAPTER_CONTROL_TYPE
enum _SCSI_ADAPTER_CONTROL_TYPE * PSCSI_ADAPTER_CONTROL_TYPE

◆ _SCSI_NOTIFICATION_TYPE

Enumerator
RequestComplete 
NextRequest 
NextLuRequest 
ResetDetected 
CallDisableInterrupts 
CallEnableInterrupts 
RequestTimerCall 
BusChangeDetected 
WMIEvent 
WMIReregister 
RequestComplete 
NextRequest 
NextLuRequest 
ResetDetected 
CallDisableInterrupts 
CallEnableInterrupts 
RequestTimerCall 
BusChangeDetected 
WMIEvent 
WMIReregister 
LinkUp 
LinkDown 
QueryTickCount 
BufferOverrunDetected 
TraceNotification 
RequestComplete 
NextRequest 
NextLuRequest 
ResetDetected 
_obsolete1 
_obsolete2 
RequestTimerCall 
BusChangeDetected 
WMIEvent 
WMIReregister 
LinkUp 
LinkDown 
QueryTickCount 
BufferOverrunDetected 
TraceNotification 
GetExtendedFunctionTable 
EnablePassiveInitialization 
InitializeDpc 
IssueDpc 
AcquireSpinLock 
ReleaseSpinLock 

Definition at line 530 of file srb.h.

530 {
538 BusChangeDetected, /* New */
539 WMIEvent,
enum _SCSI_NOTIFICATION_TYPE * PSCSI_NOTIFICATION_TYPE
enum _SCSI_NOTIFICATION_TYPE SCSI_NOTIFICATION_TYPE
@ ResetDetected
Definition: srb.h:534
@ WMIEvent
Definition: srb.h:539
@ RequestTimerCall
Definition: srb.h:537
@ CallEnableInterrupts
Definition: srb.h:536
@ CallDisableInterrupts
Definition: srb.h:535
@ RequestComplete
Definition: srb.h:531
@ WMIReregister
Definition: srb.h:540
@ NextRequest
Definition: srb.h:532
@ BusChangeDetected
Definition: srb.h:538
@ NextLuRequest
Definition: srb.h:533

Function Documentation

◆ ScsiDebugPrint()

SCSIPORT_API VOID __cdecl ScsiDebugPrint ( ULONG  DebugPrintLevel,
PCCHAR  DebugMessage,
  ... 
)

◆ ScsiPortCompleteRequest()

SCSIPORT_API VOID NTAPI ScsiPortCompleteRequest ( IN PVOID  HwDeviceExtension,
IN UCHAR  PathId,
IN UCHAR  TargetId,
IN UCHAR  Lun,
IN UCHAR  SrbStatus 
)

Definition at line 507 of file scsiport.c.

513{
514 // FIXME
516}
#define UNIMPLEMENTED
Definition: debug.h:118

Referenced by AtapiResetController(), BT958HwResetBus(), and BusLogic_ProcessCompletedCCBs().

◆ ScsiPortConvertPhysicalAddressToUlong()

SCSIPORT_API ULONG NTAPI ScsiPortConvertPhysicalAddressToUlong ( SCSI_PHYSICAL_ADDRESS  Address)

◆ ScsiPortConvertUlongToPhysicalAddress()

SCSIPORT_API SCSI_PHYSICAL_ADDRESS NTAPI ScsiPortConvertUlongToPhysicalAddress ( ULONG  UlongAddress)

◆ ScsiPortFlushDma()

SCSIPORT_API VOID NTAPI ScsiPortFlushDma ( IN PVOID  DeviceExtension)

Definition at line 540 of file scsiport.c.

542{
543 // FIXME
545}

◆ ScsiPortFreeDeviceBase()

SCSIPORT_API VOID NTAPI ScsiPortFreeDeviceBase ( IN PVOID  HwDeviceExtension,
IN PVOID  MappedAddress 
)

Definition at line 549 of file scsiport.c.

552{
553 // Nothing to do
554}

Referenced by AtapiFindController(), AtapiFindIsaController(), AtapiFindNativeModeController(), AtapiFindPCIController(), and UniataChipDetect().

◆ ScsiPortGetBusData()

SCSIPORT_API ULONG NTAPI ScsiPortGetBusData ( IN PVOID  DeviceExtension,
IN ULONG  BusDataType,
IN ULONG  SystemIoBusNumber,
IN ULONG  SlotNumber,
IN PVOID  Buffer,
IN ULONG  Length 
)

Definition at line 558 of file scsiport.c.

565{
566 return HalGetBusDataByOffset(BusDataType, SystemIoBusNumber, SlotNumber, Buffer, 0, Length);
567}
Definition: bufpool.h:45
ULONG NTAPI HalGetBusDataByOffset(IN BUS_DATA_TYPE BusDataType, IN ULONG BusNumber, IN ULONG SlotNumber, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
Definition: bus.c:73
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
_In_ WDFIORESREQLIST _In_ ULONG SlotNumber
Definition: wdfresource.h:68

Referenced by AtapiAliSouthBridgeFixup(), AtapiFindController(), AtapiFindNativeModeController(), AtapiRosbSouthBridgeFixup(), AtapiViaSouthBridgeFixup(), and FindBrokenController().

◆ ScsiPortGetDeviceBase()

SCSIPORT_API PVOID NTAPI ScsiPortGetDeviceBase ( IN PVOID  HwDeviceExtension,
IN INTERFACE_TYPE  BusType,
IN ULONG  SystemIoBusNumber,
IN SCSI_PHYSICAL_ADDRESS  IoAddress,
IN ULONG  NumberOfBytes,
IN BOOLEAN  InIoSpace 
)

Definition at line 571 of file scsiport.c.

578{
581
582 AddressSpace = (ULONG)InIoSpace;
584 SystemIoBusNumber,
585 IoAddress,
588 {
589 return NULL;
590 }
591
592 /* I/O space */
593 if (AddressSpace != 0)
594 return (PVOID)(ULONG_PTR)TranslatedAddress.u.LowPart;
595
596 // FIXME
597#if 0
600 FALSE);
601#else
603 return (PVOID)(ULONG_PTR)IoAddress.LowPart;
604#endif
605}
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define ULONG_PTR
Definition: config.h:101
BOOLEAN NTAPI HalTranslateBusAddress(IN INTERFACE_TYPE InterfaceType, IN ULONG BusNumber, IN PHYSICAL_ADDRESS BusAddress, IN OUT PULONG AddressSpace, OUT PPHYSICAL_ADDRESS TranslatedAddress)
Definition: bus.c:140
PVOID NTAPI MmMapIoSpace(IN PHYSICAL_ADDRESS PhysicalAddress, IN SIZE_T NumberOfBytes, IN MEMORY_CACHING_TYPE CacheType)
Definition: iosup.c:47
uint32_t ULONG
Definition: typedefs.h:59
struct _LARGE_INTEGER::@2299 u
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE BusType
Definition: halfuncs.h:159
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG _Out_ PPHYSICAL_ADDRESS TranslatedAddress
Definition: iofuncs.h:2275
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG AddressSpace
Definition: iofuncs.h:2274
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _Inout_ PLARGE_INTEGER NumberOfBytes
Definition: iotypes.h:1036

Referenced by AtapiFindController(), AtapiFindIsaController(), AtapiFindNativeModeController(), AtapiFindPCIController(), AtapiGetIoRange(), BT958HwFindAdapter(), and UniataFindBusMasterController().

◆ ScsiPortGetLogicalUnit()

SCSIPORT_API PVOID NTAPI ScsiPortGetLogicalUnit ( IN PVOID  HwDeviceExtension,
IN UCHAR  PathId,
IN UCHAR  TargetId,
IN UCHAR  Lun 
)

Definition at line 609 of file scsiport.c.

614{
615 // FIXME
617 return NULL;
618}

◆ ScsiPortGetPhysicalAddress()

SCSIPORT_API SCSI_PHYSICAL_ADDRESS NTAPI ScsiPortGetPhysicalAddress ( IN PVOID  HwDeviceExtension,
IN PSCSI_REQUEST_BLOCK  Srb,
IN PVOID  VirtualAddress,
OUT ULONG Length 
)

Definition at line 622 of file scsiport.c.

627{
628 PSCSI_PORT_DEVICE_EXTENSION DeviceExtension;
632
633 TRACE("ScsiPortGetPhysicalAddress(%p %p %p %p)\n",
634 HwDeviceExtension, Srb, VirtualAddress, Length);
635
636 DeviceExtension = ((PSCSI_PORT_DEVICE_EXTENSION)HwDeviceExtension) - 1;
637
639 {
640 /* Simply look it up in the allocated common buffer */
642
643 BufferLength = DeviceExtension->CommonBufferLength - Offset;
645 }
646 else
647 {
648 /* Nothing */
650 }
651
653 return PhysicalAddress;
654}
struct SCSI_PORT_DEVICE_EXTENSION * PSCSI_PORT_DEVICE_EXTENSION
_In_ PSCSI_REQUEST_BLOCK Srb
Definition: cdrom.h:989
#define SP_UNINITIALIZED_VALUE
Definition: srb.h:232
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
#define TRACE(s)
Definition: solgame.cpp:4
PVOID SenseInfoBuffer
Definition: srb.h:264
int64_t LONGLONG
Definition: typedefs.h:68
unsigned char * PUCHAR
Definition: typedefs.h:53
LONGLONG QuadPart
Definition: typedefs.h:114
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3771
_Must_inspect_result_ _In_ WDFDMATRANSACTION _In_ PFN_WDF_PROGRAM_DMA _In_ WDF_DMA_DIRECTION _In_ PMDL _In_ PVOID VirtualAddress
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS PhysicalAddress
Definition: iotypes.h:1098

Referenced by BusLogic_InitializeHostAdapter(), BusLogic_QueueCommand(), and BusLogic_WriteOutgoingMailbox().

◆ ScsiPortGetSrb()

SCSIPORT_API PSCSI_REQUEST_BLOCK NTAPI ScsiPortGetSrb ( IN PVOID  DeviceExtension,
IN UCHAR  PathId,
IN UCHAR  TargetId,
IN UCHAR  Lun,
IN LONG  QueueTag 
)

Definition at line 658 of file scsiport.c.

664{
665 // FIXME
667 return NULL;
668}

Referenced by AtapiStartIo__(), and BT958HwStartIO().

◆ ScsiPortGetUncachedExtension()

SCSIPORT_API PVOID NTAPI ScsiPortGetUncachedExtension ( IN PVOID  HwDeviceExtension,
IN PPORT_CONFIGURATION_INFORMATION  ConfigInfo,
IN ULONG  NumberOfBytes 
)

Definition at line 736 of file scsiport.c.

740{
741 PSCSI_PORT_DEVICE_EXTENSION DeviceExtension;
743 ULONG MapRegistersCount;
745
746 TRACE("ScsiPortGetUncachedExtension(%p %p %lu)\n",
747 HwDeviceExtension, ConfigInfo, NumberOfBytes);
748
749 DeviceExtension = ((PSCSI_PORT_DEVICE_EXTENSION)HwDeviceExtension) - 1;
750
751 /* Check for allocated common DMA buffer */
752 if (DeviceExtension->SrbExtensionBuffer != NULL)
753 {
754 return NULL;
755 }
756
757 /* Check for DMA adapter object */
758 if (DeviceExtension->AdapterObject == NULL)
759 {
760 /* Initialize DMA adapter description */
762
764 DeviceDescription.Master = ConfigInfo->Master;
765 DeviceDescription.ScatterGather = ConfigInfo->ScatterGather;
766 DeviceDescription.DemandMode = ConfigInfo->DemandMode;
767 DeviceDescription.Dma32BitAddresses = ConfigInfo->Dma32BitAddresses;
768 DeviceDescription.BusNumber = ConfigInfo->SystemIoBusNumber;
769 DeviceDescription.DmaChannel = ConfigInfo->DmaChannel;
770 DeviceDescription.InterfaceType = ConfigInfo->AdapterInterfaceType;
771 DeviceDescription.DmaWidth = ConfigInfo->DmaWidth;
772 DeviceDescription.DmaSpeed = ConfigInfo->DmaSpeed;
773 DeviceDescription.MaximumLength = ConfigInfo->MaximumTransferLength;
774 DeviceDescription.DmaPort = ConfigInfo->DmaPort;
775
776 /* Get a DMA adapter object */
777#if 0
778 DeviceExtension->AdapterObject =
779 HalGetAdapter(&DeviceDescription, &MapRegistersCount);
780
781 /* Fail in case of error */
782 if (DeviceExtension->AdapterObject == NULL)
783 {
784 return NULL;
785 }
786#else
787 MapRegistersCount = 0;
788#endif
789
790 /* Set number of physical breaks */
791 if (ConfigInfo->NumberOfPhysicalBreaks != 0 &&
792 MapRegistersCount > ConfigInfo->NumberOfPhysicalBreaks)
793 {
794 DeviceExtension->PortCapabilities.MaximumPhysicalPages =
795 ConfigInfo->NumberOfPhysicalBreaks;
796 }
797 else
798 {
799 DeviceExtension->PortCapabilities.MaximumPhysicalPages = MapRegistersCount;
800 }
801 }
802
803 /* Update Srb extension size */
804 if (DeviceExtension->SrbExtensionSize != ConfigInfo->SrbExtensionSize)
805 DeviceExtension->SrbExtensionSize = ConfigInfo->SrbExtensionSize;
806
807 /* Allocate a common DMA buffer */
808 Status = SpiAllocateCommonBuffer(DeviceExtension, NumberOfBytes);
809
810 if (!NT_SUCCESS(Status))
811 {
812 TRACE("SpiAllocateCommonBuffer() failed with Status = 0x%08X!\n", Status);
813 return NULL;
814 }
815
816 return DeviceExtension->NonCachedExtension;
817}
LONG NTSTATUS
Definition: precomp.h:26
static NTSTATUS SpiAllocateCommonBuffer(IN OUT PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, IN ULONG NonCachedSize)
Definition: scsiport.c:672
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
Status
Definition: gdiplustypes.h:25
PADAPTER_OBJECT NTAPI HalGetAdapter(IN PDEVICE_DESCRIPTION DeviceDescription, OUT PULONG NumberOfMapRegisters)
Definition: dma.c:22
PADAPTER_OBJECT AdapterObject
Definition: scsiport.c:86
IO_SCSI_CAPABILITIES PortCapabilities
Definition: scsiport.c:78
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING DeviceDescription
Definition: wdfpdo.h:432
#define DEVICE_DESCRIPTION_VERSION
Definition: iotypes.h:2063

Referenced by Buslogic_InitBT958().

◆ ScsiPortGetVirtualAddress()

SCSIPORT_API PVOID NTAPI ScsiPortGetVirtualAddress ( IN PVOID  HwDeviceExtension,
IN SCSI_PHYSICAL_ADDRESS  PhysicalAddress 
)

Definition at line 821 of file scsiport.c.

824{
825 // FIXME
827 return NULL;
828}

Referenced by AtapiDmaPioSync(), and BusLogic_ScanIncomingMailboxes().

◆ ScsiPortInitialize()

SCSIPORT_API ULONG NTAPI ScsiPortInitialize ( IN PVOID  Argument1,
IN PVOID  Argument2,
IN struct _HW_INITIALIZATION_DATA HwInitializationData,
IN PVOID  HwContext 
)

Definition at line 836 of file scsiport.c.

841{
844 PSCSI_PORT_DEVICE_EXTENSION DeviceExtension = NULL;
845 PCONFIGURATION_INFORMATION SystemConfig;
847 CONFIGURATION_INFO ConfigInfo;
848 ULONG DeviceExtensionSize;
849 ULONG PortConfigSize;
850 BOOLEAN Again;
851 BOOLEAN DeviceFound = FALSE;
852 BOOLEAN FirstConfigCall = TRUE;
856
857 PDEVICE_OBJECT PortDeviceObject;
859 PIO_SCSI_CAPABILITIES PortCapabilities;
860
862
863 DPRINT("ScsiPortInitialize() called!\n");
864
865 /* Check params for validity */
866 if ((HwInitializationData->HwInitialize == NULL) ||
867 (HwInitializationData->HwStartIo == NULL) ||
868 (HwInitializationData->HwInterrupt == NULL) ||
869 (HwInitializationData->HwFindAdapter == NULL) ||
870 (HwInitializationData->HwResetBus == NULL))
871 {
873 }
874
875 PSCSI_PORT_DRIVER_EXTENSION driverExtension;
876
877 // ScsiPortInitialize may be called multiple times by the same driver
878 driverExtension = IoGetDriverObjectExtension(DriverObject, HwInitializationData->HwInitialize);
879
880 if (!driverExtension)
881 {
883 HwInitializationData->HwInitialize,
885 (PVOID *)&driverExtension);
886
887 if (!NT_SUCCESS(Status))
888 {
889 DPRINT1("Failed to allocate the driver extension! Status 0x%x\n", Status);
890 return Status;
891 }
892 }
893
894 // set up the driver extension
895 driverExtension->RegistryPath.Buffer =
897 driverExtension->RegistryPath.MaximumLength = RegistryPath->MaximumLength;
899
900 driverExtension->DriverObject = DriverObject;
901
902 /* Set handlers */
904 DriverObject->DriverStartIo = ScsiPortStartIo;
905 DriverObject->DriverExtension->AddDevice = ScsiPortAddDevice;
912
913 /* Obtain configuration information */
914 SystemConfig = IoGetConfigurationInformation();
915
916 /* Zero the internal configuration info structure */
917 RtlZeroMemory(&ConfigInfo, sizeof(CONFIGURATION_INFO));
918
919 /* Zero starting slot number */
920 SlotNumber.u.AsULONG = 0;
921
922 /* Allocate space for access ranges */
923 if (HwInitializationData->NumberOfAccessRanges)
924 {
925 ConfigInfo.AccessRanges =
927 HwInitializationData->NumberOfAccessRanges * sizeof(ACCESS_RANGE), TAG_SCSIPORT);
928
929 /* Fail if failed */
930 if (ConfigInfo.AccessRanges == NULL)
932 }
933
934 /* Open registry keys and fill the driverExtension */
935 SpiInitOpenKeys(&ConfigInfo, driverExtension);
936
937 // FIXME: PnP miniports are not supported
938 ASSERT(driverExtension->IsLegacyDriver);
939
940 /* Last adapter number = not known */
942
943 /* Calculate sizes of DeviceExtension and PortConfig */
944 DeviceExtensionSize = sizeof(SCSI_PORT_DEVICE_EXTENSION) +
945 HwInitializationData->DeviceExtensionSize;
946
947 DPRINT("AdapterInterfaceType: %lu\n",
948 HwInitializationData->AdapterInterfaceType);
949
950 while (TRUE)
951 {
952 WCHAR NameBuffer[27];
953 /* Create a unicode device name */
954 swprintf(NameBuffer,
955 L"\\Device\\ScsiPort%lu",
956 SystemConfig->ScsiPortCount);
957 if (!RtlCreateUnicodeString(&DeviceName, NameBuffer))
958 {
959 DPRINT1("Failed to allocate memory for device name!\n");
961 PortDeviceObject = NULL;
962 break;
963 }
964
965 DPRINT("Creating device: %wZ\n", &DeviceName);
966
967 /* Create the port device */
969 DeviceExtensionSize,
970 &DeviceName,
973 FALSE,
974 &PortDeviceObject);
975
976 if (!NT_SUCCESS(Status))
977 {
978 DPRINT1("IoCreateDevice call failed! (Status 0x%lX)\n", Status);
979 PortDeviceObject = NULL;
980 break;
981 }
982
983 /* Set the buffering strategy here... */
984 PortDeviceObject->Flags |= DO_DIRECT_IO;
985 PortDeviceObject->AlignmentRequirement = FILE_WORD_ALIGNMENT; /* FIXME: Is this really needed? */
986
987 /* Fill Device Extension */
988 DeviceExtension = PortDeviceObject->DeviceExtension;
989 RtlZeroMemory(DeviceExtension, DeviceExtensionSize);
990 DeviceExtension->Common.DeviceObject = PortDeviceObject;
991 DeviceExtension->Common.IsFDO = TRUE;
992 DeviceExtension->Length = DeviceExtensionSize;
993 DeviceExtension->PortNumber = SystemConfig->ScsiPortCount;
994 DeviceExtension->DeviceName = DeviceName;
995
996 /* Driver's routines... */
997 DeviceExtension->HwInitialize = HwInitializationData->HwInitialize;
998 DeviceExtension->HwStartIo = HwInitializationData->HwStartIo;
999 DeviceExtension->HwInterrupt = HwInitializationData->HwInterrupt;
1000 DeviceExtension->HwResetBus = HwInitializationData->HwResetBus;
1001 DeviceExtension->HwDmaStarted = HwInitializationData->HwDmaStarted;
1002
1003 /* Extensions sizes */
1004 DeviceExtension->MiniPortExtensionSize = HwInitializationData->DeviceExtensionSize;
1005 DeviceExtension->LunExtensionSize =
1006 ALIGN_UP(HwInitializationData->SpecificLuExtensionSize, INT64);
1007 DeviceExtension->SrbExtensionSize =
1008 ALIGN_UP(HwInitializationData->SrbExtensionSize, INT64);
1009
1010 /* Fill some numbers (bus count, lun count, etc) */
1011 DeviceExtension->MaxLunCount = SCSI_MAXIMUM_LOGICAL_UNITS;
1012 DeviceExtension->RequestsNumber = 16;
1013
1014 /* Initialize the spin lock in the controller extension */
1015 KeInitializeSpinLock(&DeviceExtension->IrqLock);
1016 KeInitializeSpinLock(&DeviceExtension->SpinLock);
1017
1018 /* Initialize the DPC object */
1019 IoInitializeDpcRequest(PortDeviceObject,
1021
1022 /* Initialize the device timer */
1023 DeviceExtension->TimerCount = -1;
1024 IoInitializeTimer(PortDeviceObject,
1026 DeviceExtension);
1027
1028 /* Initialize miniport timer */
1029 KeInitializeTimer(&DeviceExtension->MiniportTimer);
1030 KeInitializeDpc(&DeviceExtension->MiniportTimerDpc,
1032 PortDeviceObject);
1033
1034CreatePortConfig:
1035
1036 /* Allocate and initialize port configuration info */
1037 PortConfigSize = sizeof(PORT_CONFIGURATION_INFORMATION) +
1038 HwInitializationData->NumberOfAccessRanges * sizeof(ACCESS_RANGE);
1039 PortConfigSize = ALIGN_UP(PortConfigSize, INT64);
1040 DeviceExtension->PortConfig = ExAllocatePoolWithTag(NonPagedPool, PortConfigSize, TAG_SCSIPORT);
1041
1042 /* Fail if failed */
1043 if (DeviceExtension->PortConfig == NULL)
1044 {
1046 break;
1047 }
1048
1049 Status = SpiCreatePortConfig(DeviceExtension,
1051 &ConfigInfo,
1052 DeviceExtension->PortConfig,
1053 FirstConfigCall);
1054
1055 if (!NT_SUCCESS(Status))
1056 {
1057 DPRINT("SpiCreatePortConfig() failed with Status 0x%08X\n", Status);
1058 break;
1059 }
1060
1061 PortConfig = DeviceExtension->PortConfig;
1062
1063 /* Copy extension sizes into the PortConfig */
1064 PortConfig->SpecificLuExtensionSize = DeviceExtension->LunExtensionSize;
1065 PortConfig->SrbExtensionSize = DeviceExtension->SrbExtensionSize;
1066
1067 /* Initialize Access ranges */
1068 if (HwInitializationData->NumberOfAccessRanges != 0)
1069 {
1070 PortConfig->AccessRanges = ALIGN_UP_POINTER(PortConfig + 1, INT64);
1071
1072 /* Copy the data */
1073 RtlCopyMemory(PortConfig->AccessRanges,
1074 ConfigInfo.AccessRanges,
1075 HwInitializationData->NumberOfAccessRanges * sizeof(ACCESS_RANGE));
1076 }
1077
1078 /* Search for matching PCI device */
1079 if ((HwInitializationData->AdapterInterfaceType == PCIBus) &&
1080 (HwInitializationData->VendorIdLength > 0) &&
1081 (HwInitializationData->VendorId != NULL) &&
1082 (HwInitializationData->DeviceIdLength > 0) &&
1083 (HwInitializationData->DeviceId != NULL))
1084 {
1085 PortConfig->BusInterruptLevel = 0;
1086
1087 /* Get PCI device data */
1088 DPRINT(
1089 "VendorId '%.*s' DeviceId '%.*s'\n", HwInitializationData->VendorIdLength,
1090 HwInitializationData->VendorId, HwInitializationData->DeviceIdLength,
1091 HwInitializationData->DeviceId);
1092
1094 DriverObject, PortDeviceObject, HwInitializationData, PortConfig, RegistryPath,
1095 ConfigInfo.BusNumber, &SlotNumber))
1096 {
1097 /* Continue to the next bus, nothing here */
1098 ConfigInfo.BusNumber++;
1099 DeviceExtension->PortConfig = NULL;
1100 ExFreePool(PortConfig);
1101 Again = FALSE;
1102 goto CreatePortConfig;
1103 }
1104
1105 if (!PortConfig->BusInterruptLevel)
1106 {
1107 /* Bypass this slot, because no interrupt was assigned */
1108 DeviceExtension->PortConfig = NULL;
1109 ExFreePool(PortConfig);
1110 goto CreatePortConfig;
1111 }
1112 }
1113 else
1114 {
1115 DPRINT("Non-pci bus\n");
1116 }
1117
1118 /* Note: HwFindAdapter is called once for each bus */
1119 Again = FALSE;
1120 DPRINT("Calling HwFindAdapter() for Bus %lu\n", PortConfig->SystemIoBusNumber);
1121 Result = (HwInitializationData->HwFindAdapter)(
1122 &DeviceExtension->MiniPortDeviceExtension, HwContext, 0, /* BusInformation */
1123 ConfigInfo.Parameter, /* ArgumentString */
1124 PortConfig, &Again);
1125
1126 DPRINT("HwFindAdapter() Result: %lu Again: %s\n", Result, (Again) ? "True" : "False");
1127
1128 /* Free MapRegisterBase, it's not needed anymore */
1129 if (DeviceExtension->MapRegisterBase != NULL)
1130 {
1131 ExFreePool(DeviceExtension->MapRegisterBase);
1132 DeviceExtension->MapRegisterBase = NULL;
1133 }
1134
1135 /* If result is nothing good... */
1136 if (Result != SP_RETURN_FOUND)
1137 {
1138 DPRINT("HwFindAdapter() Result: %lu\n", Result);
1139
1141 {
1142 /* We can continue on the next bus */
1143 ConfigInfo.BusNumber++;
1144 Again = FALSE;
1145
1146 DeviceExtension->PortConfig = NULL;
1147 ExFreePool(PortConfig);
1148 goto CreatePortConfig;
1149 }
1150
1151 /* Otherwise, break */
1153 break;
1154 }
1155
1156 DPRINT(
1157 "ScsiPortInitialize(): Found HBA! (%x), adapter Id %d\n",
1158 PortConfig->BusInterruptVector, PortConfig->InitiatorBusId[0]);
1159
1160 /* If the SRB extension size was updated */
1161 if (!DeviceExtension->NonCachedExtension &&
1162 (PortConfig->SrbExtensionSize != DeviceExtension->SrbExtensionSize))
1163 {
1164 /* Set it (rounding to LONGLONG again) */
1165 DeviceExtension->SrbExtensionSize = ALIGN_UP(PortConfig->SrbExtensionSize, INT64);
1166 }
1167
1168 /* The same with LUN extension size */
1169 if (PortConfig->SpecificLuExtensionSize != DeviceExtension->LunExtensionSize)
1170 DeviceExtension->LunExtensionSize = PortConfig->SpecificLuExtensionSize;
1171
1172 /* Construct a resource list */
1173 ResourceList = SpiConfigToResource(DeviceExtension, PortConfig);
1174
1175 PDEVICE_OBJECT LowerPDO = NULL;
1176
1178 HwInitializationData->AdapterInterfaceType,
1179 ConfigInfo.BusNumber,
1180 PortConfig->SlotNumber,
1182 NULL,
1183 TRUE,
1184 &LowerPDO);
1185
1186 if (!NT_SUCCESS(Status))
1187 {
1188 DPRINT1("IoReportDetectedDevice failed. Status: 0x%x\n", Status);
1189 __debugbreak();
1190 break;
1191 }
1192
1193 DeviceExtension->Common.LowerDevice = IoAttachDeviceToDeviceStack(PortDeviceObject, LowerPDO);
1194
1195 ASSERT(DeviceExtension->Common.LowerDevice);
1196
1197 PortDeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
1198
1199 if (ResourceList)
1200 {
1202 }
1203
1204 /* Copy all stuff which we ever need from PortConfig to the DeviceExtension */
1206 DeviceExtension->MaxTargedIds = SCSI_MAXIMUM_TARGETS_PER_BUS;
1207 else
1208 DeviceExtension->MaxTargedIds = PortConfig->MaximumNumberOfTargets;
1209
1210 DeviceExtension->NumberOfBuses = PortConfig->NumberOfBuses;
1211 DeviceExtension->CachesData = PortConfig->CachesData;
1212 DeviceExtension->ReceiveEvent = PortConfig->ReceiveEvent;
1213 DeviceExtension->SupportsTaggedQueuing = PortConfig->TaggedQueuing;
1214 DeviceExtension->MultipleReqsPerLun = PortConfig->MultipleRequestPerLu;
1215
1216 /* Initialize bus scanning information */
1217 size_t BusConfigSize = DeviceExtension->NumberOfBuses * sizeof(*DeviceExtension->Buses);
1218 DeviceExtension->Buses = ExAllocatePoolZero(NonPagedPool, BusConfigSize, TAG_SCSIPORT);
1219 if (!DeviceExtension->Buses)
1220 {
1221 DPRINT1("Out of resources!\n");
1223 break;
1224 }
1225
1226 // initialize bus data
1227 for (UINT8 pathId = 0; pathId < DeviceExtension->NumberOfBuses; pathId++)
1228 {
1229 DeviceExtension->Buses[pathId].BusIdentifier =
1230 DeviceExtension->PortConfig->InitiatorBusId[pathId];
1231 InitializeListHead(&DeviceExtension->Buses[pathId].LunsListHead);
1232 }
1233
1234 /* If something was disabled via registry - apply it */
1235 if (ConfigInfo.DisableMultipleLun)
1236 DeviceExtension->MultipleReqsPerLun = PortConfig->MultipleRequestPerLu = FALSE;
1237
1238 if (ConfigInfo.DisableTaggedQueueing)
1239 DeviceExtension->SupportsTaggedQueuing = PortConfig->MultipleRequestPerLu = FALSE;
1240
1241 /* Check if we need to alloc SRB data */
1242 if (DeviceExtension->SupportsTaggedQueuing || DeviceExtension->MultipleReqsPerLun)
1243 {
1244 DeviceExtension->NeedSrbDataAlloc = TRUE;
1245 }
1246 else
1247 {
1248 DeviceExtension->NeedSrbDataAlloc = FALSE;
1249 }
1250
1251 /* Get a pointer to the port capabilities */
1252 PortCapabilities = &DeviceExtension->PortCapabilities;
1253
1254 /* Copy one field there */
1255 DeviceExtension->MapBuffers = PortConfig->MapBuffers;
1256 PortCapabilities->AdapterUsesPio = PortConfig->MapBuffers;
1257
1258 if (DeviceExtension->AdapterObject == NULL &&
1259 (PortConfig->DmaChannel != SP_UNINITIALIZED_VALUE || PortConfig->Master))
1260 {
1261 DPRINT1("DMA is not supported yet\n");
1262 ASSERT(FALSE);
1263 }
1264
1265 if (DeviceExtension->SrbExtensionBuffer == NULL &&
1266 (DeviceExtension->SrbExtensionSize != 0 || PortConfig->AutoRequestSense))
1267 {
1268 DeviceExtension->SupportsAutoSense = PortConfig->AutoRequestSense;
1269 DeviceExtension->NeedSrbExtensionAlloc = TRUE;
1270
1271 /* Allocate common buffer */
1272 Status = SpiAllocateCommonBuffer(DeviceExtension, 0);
1273
1274 /* Check for failure */
1275 if (!NT_SUCCESS(Status))
1276 break;
1277 }
1278
1279 /* Allocate SrbData, if needed */
1280 if (DeviceExtension->NeedSrbDataAlloc)
1281 {
1282 ULONG Count;
1284
1285 if (DeviceExtension->SrbDataCount != 0)
1286 Count = DeviceExtension->SrbDataCount;
1287 else
1288 Count = DeviceExtension->RequestsNumber * 2;
1289
1290 /* Allocate the data */
1291 SrbData = ExAllocatePoolWithTag(
1293 if (SrbData == NULL)
1295
1296 RtlZeroMemory(SrbData, Count * sizeof(SCSI_REQUEST_BLOCK_INFO));
1297
1298 DeviceExtension->SrbInfo = SrbData;
1299 DeviceExtension->FreeSrbInfo = SrbData;
1300 DeviceExtension->SrbDataCount = Count;
1301
1302 /* Link it to the list */
1303 while (Count > 0)
1304 {
1305 SrbData->Requests.Flink = (PLIST_ENTRY)(SrbData + 1);
1306 SrbData++;
1307 Count--;
1308 }
1309
1310 /* Mark the last entry of the list */
1311 SrbData--;
1312 SrbData->Requests.Flink = NULL;
1313 }
1314
1315 /* Initialize port capabilities */
1316 PortCapabilities = &DeviceExtension->PortCapabilities;
1317 PortCapabilities->Length = sizeof(IO_SCSI_CAPABILITIES);
1318 PortCapabilities->MaximumTransferLength = PortConfig->MaximumTransferLength;
1319
1320 if (PortConfig->ReceiveEvent)
1322
1323 PortCapabilities->TaggedQueuing = DeviceExtension->SupportsTaggedQueuing;
1324 PortCapabilities->AdapterScansDown = PortConfig->AdapterScansDown;
1325
1326 if (PortConfig->AlignmentMask > PortDeviceObject->AlignmentRequirement)
1327 PortDeviceObject->AlignmentRequirement = PortConfig->AlignmentMask;
1328
1329 PortCapabilities->AlignmentMask = PortDeviceObject->AlignmentRequirement;
1330
1331 if (PortCapabilities->MaximumPhysicalPages == 0)
1332 {
1333 PortCapabilities->MaximumPhysicalPages =
1334 BYTES_TO_PAGES(PortCapabilities->MaximumTransferLength);
1335
1336 /* Apply miniport's limits */
1337 if (PortConfig->NumberOfPhysicalBreaks < PortCapabilities->MaximumPhysicalPages)
1338 {
1339 PortCapabilities->MaximumPhysicalPages = PortConfig->NumberOfPhysicalBreaks;
1340 }
1341 }
1342
1343 FdoCallHWInitialize(DeviceExtension);
1344
1345 Status = FdoStartAdapter(DeviceExtension);
1346
1347 if (!NT_SUCCESS(Status))
1348 {
1349 DPRINT1("Failed to start the legacy adapter. Status 0x%x\n", Status);
1350 break;
1351 }
1352
1353 FdoScanAdapter(DeviceExtension);
1354
1355 FirstConfigCall = FALSE;
1356
1357 /* Increase adapter number and bus number respectively */
1358 ConfigInfo.AdapterNumber++;
1359
1360 if (!Again)
1361 ConfigInfo.BusNumber++;
1362
1363 DPRINT(" Bus: %lu\n", ConfigInfo.BusNumber);
1364
1365 DeviceFound = TRUE;
1366 }
1367
1368 /* Clean up the mess */
1369 if (!NT_SUCCESS(Status) && PortDeviceObject)
1370 {
1371 FdoRemoveAdapter(DeviceExtension);
1372 }
1373
1374 /* Close registry keys */
1375 if (ConfigInfo.ServiceKey != NULL)
1376 ZwClose(ConfigInfo.ServiceKey);
1377
1378 if (ConfigInfo.DeviceKey != NULL)
1379 ZwClose(ConfigInfo.DeviceKey);
1380
1381 if (ConfigInfo.BusKey != NULL)
1382 ZwClose(ConfigInfo.BusKey);
1383
1384 if (ConfigInfo.AccessRanges != NULL)
1385 ExFreePool(ConfigInfo.AccessRanges);
1386
1387 if (ConfigInfo.Parameter != NULL)
1388 ExFreePool(ConfigInfo.Parameter);
1389
1390 DPRINT("ScsiPortInitialize() done, Status = 0x%08X, DeviceFound = %d!\n",
1391 Status, DeviceFound);
1392
1393 return (DeviceFound == FALSE) ? Status : STATUS_SUCCESS;
1394}
unsigned char BOOLEAN
unsigned char UINT8
signed long long INT64
#define DPRINT1
Definition: precomp.h:8
#define FILE_DEVICE_SECURE_OPEN
Definition: cdrw_usr.h:46
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
_In_ PVOID Argument2
Definition: classpnp.h:721
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define TRUE
Definition: types.h:120
#define swprintf
Definition: precomp.h:40
VOID NTAPI KeInitializeDpc(IN PKDPC Dpc, IN PKDEFERRED_ROUTINE DeferredRoutine, IN PVOID DeferredContext)
Definition: dpc.c:712
#define SCSI_MAXIMUM_TARGETS_PER_BUS
Definition: srb.h:22
#define SRBEV_SCSI_ASYNC_NOTIFICATION
Definition: srb.h:240
#define SP_RETURN_FOUND
Definition: srb.h:522
#define SCSI_MAXIMUM_LOGICAL_UNITS
Definition: srb.h:21
struct _PORT_CONFIGURATION_INFORMATION PORT_CONFIGURATION_INFORMATION
#define SP_RETURN_NOT_FOUND
Definition: srb.h:521
NTSTATUS NTAPI ScsiPortDeviceControl(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp)
Definition: ioctl.c:404
VOID SpiInitOpenKeys(_Inout_ PCONFIGURATION_INFO ConfigInfo, _In_ PSCSI_PORT_DRIVER_EXTENSION DriverExtension)
Definition: registry.c:18
VOID NTAPI SpiMiniportTimerDpc(IN struct _KDPC *Dpc, IN PVOID DeviceObject, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
Definition: scsiport.c:2336
static NTSTATUS SpiCreatePortConfig(PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, PHW_INITIALIZATION_DATA HwInitData, PCONFIGURATION_INFO InternalConfigInfo, PPORT_CONFIGURATION_INFORMATION ConfigInfo, BOOLEAN FirstCall)
Definition: scsiport.c:2369
static VOID NTAPI ScsiPortIoTimer(PDEVICE_OBJECT DeviceObject, PVOID Context)
Definition: scsiport.c:2234
static BOOLEAN SpiGetPciConfigData(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT DeviceObject, IN struct _HW_INITIALIZATION_DATA *HwInitializationData, IN OUT PPORT_CONFIGURATION_INFORMATION PortConfig, IN PUNICODE_STRING RegistryPath, IN ULONG BusNumber, IN OUT PPCI_SLOT_NUMBER NextSlotNumber)
Definition: scsiport.c:1891
NTSTATUS NTAPI ScsiPortDispatchPnp(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: scsiport.c:129
static PCM_RESOURCE_LIST SpiConfigToResource(PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, PPORT_CONFIGURATION_INFORMATION PortConfig)
Definition: scsiport.c:1739
VOID NTAPI ScsiPortUnload(_In_ PDRIVER_OBJECT DriverObject)
Definition: scsiport.c:121
static NTSTATUS NTAPI ScsiPortCreateClose(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: scsiport.c:2024
NTSTATUS NTAPI ScsiPortAddDevice(_In_ PDRIVER_OBJECT DriverObject, _In_ PDEVICE_OBJECT PhysicalDeviceObject)
Definition: scsiport.c:145
UNICODE_STRING * PUNICODE_STRING
Definition: env_spec_w32.h:373
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define DO_DIRECT_IO
Definition: env_spec_w32.h:396
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define NonPagedPool
Definition: env_spec_w32.h:307
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define KeInitializeSpinLock(sl)
Definition: env_spec_w32.h:604
#define PagedPool
Definition: env_spec_w32.h:308
@ PCIBus
Definition: hwresource.cpp:142
void __cdecl __debugbreak(void)
Definition: intrin_ppc.h:698
PCONFIGURATION_INFORMATION NTAPI IoGetConfigurationInformation(VOID)
Returns a pointer to the I/O manager's global configuration information structure.
Definition: iorsrce.c:998
NTSTATUS NTAPI IoInitializeTimer(IN PDEVICE_OBJECT DeviceObject, IN PIO_TIMER_ROUTINE TimerRoutine, IN PVOID Context)
Definition: iotimer.c:92
#define ASSERT(a)
Definition: mode.c:44
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
FORCEINLINE PVOID ExAllocatePoolZero(ULONG PoolType, SIZE_T NumberOfBytes, ULONG Tag)
Definition: precomp.h:45
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
int Count
Definition: noreturn.cpp:7
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
#define FILE_WORD_ALIGNMENT
Definition: nt_native.h:787
PDEVICE_OBJECT NTAPI IoAttachDeviceToDeviceStack(IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice)
Definition: device.c:966
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1031
PVOID NTAPI IoGetDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress)
Definition: driver.c:1904
NTSTATUS NTAPI IoAllocateDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress, IN ULONG DriverObjectExtensionSize, OUT PVOID *DriverObjectExtension)
Definition: driver.c:1826
#define STATUS_INTERNAL_ERROR
Definition: ntstatus.h:465
#define STATUS_REVISION_MISMATCH
Definition: ntstatus.h:325
#define L(x)
Definition: ntvdm.h:50
NTSTATUS NTAPI IoReportDetectedDevice(_In_ PDRIVER_OBJECT DriverObject, _In_ INTERFACE_TYPE LegacyBusType, _In_ ULONG BusNumber, _In_ ULONG SlotNumber, _In_opt_ PCM_RESOURCE_LIST ResourceList, _In_opt_ PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirements, _In_ BOOLEAN ResourceAssigned, _Inout_ PDEVICE_OBJECT *DeviceObject)
Definition: pnpreport.c:148
#define FILE_DEVICE_CONTROLLER
Definition: winioctl.h:49
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
struct _IO_SCSI_CAPABILITIES IO_SCSI_CAPABILITIES
DRIVER_DISPATCH ScsiPortDispatchPower
Definition: scsiport.h:426
DRIVER_DISPATCH ScsiPortDispatchScsi
Definition: scsiport.h:452
DRIVER_STARTIO ScsiPortStartIo
Definition: scsiport.h:454
#define TAG_SCSIPORT
Definition: scsiport.h:21
IO_DPC_ROUTINE ScsiPortDpcForIsr
Definition: scsiport.h:451
_Must_inspect_result_ _In_ PVOID _In_ struct _HW_INITIALIZATION_DATA _In_ PVOID HwContext
Definition: srb.h:907
_Must_inspect_result_ _In_ PVOID _In_ struct _HW_INITIALIZATION_DATA * HwInitializationData
Definition: srb.h:906
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
NTSTATUS FdoStartAdapter(_In_ PSCSI_PORT_DEVICE_EXTENSION PortExtension)
Definition: fdo.c:609
VOID FdoScanAdapter(_In_ PSCSI_PORT_DEVICE_EXTENSION PortExtension)
Definition: fdo.c:222
NTSTATUS FdoCallHWInitialize(_In_ PSCSI_PORT_DEVICE_EXTENSION DeviceExtension)
Calls HwInitialize routine of the miniport and sets up interrupts Should be called inside ScsiPortIni...
Definition: fdo.c:366
NTSTATUS FdoRemoveAdapter(_In_ PSCSI_PORT_DEVICE_EXTENSION DeviceExtension)
Definition: fdo.c:510
PHW_INITIALIZE HwInitialize
Definition: scsiport.c:80
PHW_RESET_BUS HwResetBus
Definition: scsiport.c:83
PHW_INTERRUPT HwInterrupt
Definition: scsiport.c:82
BOOLEAN DisableTaggedQueueing
Definition: scsiport.h:92
ULONG LastAdapterNumber
Definition: scsiport.h:83
PACCESS_RANGE AccessRanges
Definition: scsiport.h:97
BOOLEAN DisableMultipleLun
Definition: scsiport.h:93
ULONG AlignmentRequirement
Definition: env_spec_w32.h:420
PVOID DeviceExtension
Definition: env_spec_w32.h:418
PDRIVER_UNLOAD DriverUnload
Definition: iotypes.h:2288
BOOLEAN AdapterScansDown
Definition: scsi_port.h:142
ULONG SupportedAsynchronousEvents
Definition: scsi_port.h:139
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
ACCESS_RANGE(* AccessRanges)[]
Definition: srb.h:74
PDRIVER_OBJECT DriverObject
Definition: scsiport.h:334
UNICODE_STRING RegistryPath
Definition: scsiport.h:335
USHORT MaximumLength
Definition: env_spec_w32.h:370
VOID NTAPI KeInitializeTimer(OUT PKTIMER Timer)
Definition: timerobj.c:233
struct _LIST_ENTRY * PLIST_ENTRY
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define ALIGN_UP(size, type)
Definition: umtypes.h:91
#define ALIGN_UP_POINTER(ptr, type)
Definition: umtypes.h:97
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3275
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:309
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409
_IRQL_requires_same_ _In_opt_ PVOID Argument1
Definition: cmtypes.h:696
FORCEINLINE VOID IoInitializeDpcRequest(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIO_DPC_ROUTINE DpcRoutine)
Definition: iofuncs.h:2840
#define IRP_MJ_SCSI
struct _DRIVER_OBJECT * PDRIVER_OBJECT
#define IRP_MJ_POWER
#define BYTES_TO_PAGES(Size)
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ ScsiPortIoMapTransfer()

SCSIPORT_API VOID NTAPI ScsiPortIoMapTransfer ( IN PVOID  HwDeviceExtension,
IN PSCSI_REQUEST_BLOCK  Srb,
IN PVOID  LogicalAddress,
IN ULONG  Length 
)

Definition at line 1287 of file scsiport.c.

1292{
1293 // FIXME
1295}

◆ ScsiPortLogError()

SCSIPORT_API VOID NTAPI ScsiPortLogError ( IN PVOID  HwDeviceExtension,
IN PSCSI_REQUEST_BLOCK Srb  OPTIONAL,
IN UCHAR  PathId,
IN UCHAR  TargetId,
IN UCHAR  Lun,
IN ULONG  ErrorCode,
IN ULONG  UniqueId 
)

Definition at line 1299 of file scsiport.c.

1307{
1308 // FIXME
1310}

Referenced by AtapiStartIo(), AtapiStartIo__(), BT958HwFindAdapter(), Buslogic_InitBT958(), BusLogic_ProcessCompletedCCBs(), and MapError().

◆ ScsiPortMoveMemory()

SCSIPORT_API VOID NTAPI ScsiPortMoveMemory ( IN PVOID  WriteBuffer,
IN PVOID  ReadBuffer,
IN ULONG  Length 
)

Definition at line 1314 of file scsiport.c.

1318{
1320}
#define WriteBuffer(BaseIoAddress, Buffer, Count)
Definition: atapi.h:344
#define ReadBuffer(BaseIoAddress, Buffer, Count)
Definition: atapi.h:339
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:264

Referenced by Atapi2Scsi(), AtapiStartIo(), AtapiStartIo__(), BusLogic_QueueCommand(), and IssueIdentify().

◆ ScsiPortNotification()

SCSIPORT_API VOID __cdecl ScsiPortNotification ( IN SCSI_NOTIFICATION_TYPE  NotificationType,
IN PVOID  HwDeviceExtension,
  ... 
)

Definition at line 1451 of file scsiport.c.

1452{
1453 PSCSI_PORT_DEVICE_EXTENSION DeviceExtension;
1454 va_list ap;
1455
1456 DPRINT("ScsiPortNotification() called\n");
1457
1458 DeviceExtension =
1459 CONTAINING_RECORD(HwDeviceExtension, SCSI_PORT_DEVICE_EXTENSION, MiniPortDeviceExtension);
1460
1461 DPRINT("DeviceExtension %p\n", DeviceExtension);
1462
1463 va_start(ap, HwDeviceExtension);
1464
1465 switch (NotificationType)
1466 {
1467 case RequestComplete:
1468 {
1471
1473
1474 DPRINT("Notify: RequestComplete (Srb %p)\n", Srb);
1475
1476 /* Make sure Srb is alright */
1478 ASSERT(
1481
1483 {
1484 /* It's been already completed */
1485 va_end(ap);
1486 return;
1487 }
1488
1489 /* It's not active anymore */
1490 Srb->SrbFlags &= ~SRB_FLAGS_IS_ACTIVE;
1491
1493 {
1494 /* TODO: Treat it specially */
1495 ASSERT(FALSE);
1496 }
1497 else
1498 {
1500 PSCSI_PORT_LUN_EXTENSION LunExtension = IoStack->DeviceObject->DeviceExtension;
1501 ASSERT(LunExtension && !LunExtension->Common.IsFDO);
1502
1503 /* Get the SRB data */
1504 SrbData = SpiGetSrbData(DeviceExtension, LunExtension, Srb->QueueTag);
1505
1506 /* Make sure there are no CompletedRequests and there is a Srb */
1507 ASSERT(SrbData->CompletedRequests == NULL && SrbData->Srb != NULL);
1508
1509 /* If it's a read/write request, make sure it has data inside it */
1510 if ((Srb->SrbStatus == SRB_STATUS_SUCCESS) &&
1511 ((Srb->Cdb[0] == SCSIOP_READ) || (Srb->Cdb[0] == SCSIOP_WRITE)))
1512 {
1514 }
1515
1516 SrbData->CompletedRequests = DeviceExtension->InterruptData.CompletedRequests;
1517 DeviceExtension->InterruptData.CompletedRequests = SrbData;
1518 }
1519 }
1520 break;
1521
1522 case NextRequest:
1523 DPRINT("Notify: NextRequest\n");
1524 DeviceExtension->InterruptData.Flags |= SCSI_PORT_NEXT_REQUEST_READY;
1525 break;
1526
1527 case NextLuRequest:
1528 {
1529 UCHAR PathId;
1531 UCHAR Lun;
1532 PSCSI_PORT_LUN_EXTENSION LunExtension;
1533
1534 PathId = (UCHAR)va_arg(ap, int);
1535 TargetId = (UCHAR)va_arg(ap, int);
1536 Lun = (UCHAR)va_arg(ap, int);
1537
1538 DPRINT(
1539 "Notify: NextLuRequest(PathId %u TargetId %u Lun %u)\n", PathId, TargetId, Lun);
1540
1541 /* Mark it in the flags field */
1542 DeviceExtension->InterruptData.Flags |= SCSI_PORT_NEXT_REQUEST_READY;
1543
1544 /* Get the LUN extension */
1545 LunExtension = GetLunByPath(DeviceExtension, PathId, TargetId, Lun);
1546
1547 /* If returned LunExtension is NULL, break out */
1548 if (!LunExtension)
1549 break;
1550
1551 /* This request should not be processed if */
1552 if ((LunExtension->ReadyLun) || (LunExtension->SrbInfo.Srb))
1553 {
1554 /* Nothing to do here */
1555 break;
1556 }
1557
1558 /* Add this LUN to the list */
1559 LunExtension->ReadyLun = DeviceExtension->InterruptData.ReadyLun;
1560 DeviceExtension->InterruptData.ReadyLun = LunExtension;
1561 }
1562 break;
1563
1564 case ResetDetected:
1565 DPRINT("Notify: ResetDetected\n");
1566 /* Add RESET flags */
1567 DeviceExtension->InterruptData.Flags |= SCSI_PORT_RESET | SCSI_PORT_RESET_REPORTED;
1568 break;
1569
1571 DPRINT1("UNIMPLEMENTED SCSI Notification called: CallDisableInterrupts!\n");
1572 break;
1573
1575 DPRINT1("UNIMPLEMENTED SCSI Notification called: CallEnableInterrupts!\n");
1576 break;
1577
1578 case RequestTimerCall:
1579 DPRINT("Notify: RequestTimerCall\n");
1580 DeviceExtension->InterruptData.Flags |= SCSI_PORT_TIMER_NEEDED;
1581 DeviceExtension->InterruptData.HwScsiTimer = (PHW_TIMER)va_arg(ap, PHW_TIMER);
1582 DeviceExtension->InterruptData.MiniportTimerValue = (ULONG)va_arg(ap, ULONG);
1583 break;
1584
1585 case BusChangeDetected:
1586 DPRINT1("UNIMPLEMENTED SCSI Notification called: BusChangeDetected!\n");
1587 break;
1588
1589 default:
1590 DPRINT1("Unsupported notification from WMI: %lu\n", NotificationType);
1591 break;
1592 }
1593
1594 va_end(ap);
1595
1596 /* Request a DPC after we're done with the interrupt */
1597 DeviceExtension->InterruptData.Flags |= SCSI_PORT_NOTIFICATION_NEEDED;
1598}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define va_arg(ap, T)
Definition: acmsvcex.h:89
#define SCSI_PORT_NEXT_REQUEST_READY
Definition: scsiport.c:53
#define SCSISTAT_GOOD
Definition: cdrw_hw.h:1078
#define SCSIOP_WRITE
Definition: cdrw_hw.h:906
#define SCSIOP_READ
Definition: cdrw_hw.h:905
_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
#define SRB_FLAGS_IS_ACTIVE
Definition: srb.h:407
VOID(NTAPI * PHW_TIMER)(IN PVOID DeviceExtension)
Definition: srb.h:456
#define SRB_FUNCTION_EXECUTE_SCSI
Definition: srb.h:315
#define SRB_STATUS_PENDING
Definition: srb.h:340
struct _SCSI_REQUEST_BLOCK * PSCSI_REQUEST_BLOCK
#define SRB_STATUS_SUCCESS
Definition: srb.h:341
#define SRB_FUNCTION_ABORT_COMMAND
Definition: srb.h:324
#define SCSI_PORT_RESET
Definition: scsiport.h:35
#define SCSI_PORT_TIMER_NEEDED
Definition: scsiport.h:43
#define SCSI_PORT_NOTIFICATION_NEEDED
Definition: scsiport.h:31
#define SCSI_PORT_RESET_REPORTED
Definition: scsiport.h:37
PSCSI_REQUEST_BLOCK_INFO SpiGetSrbData(_In_ PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, _In_ PSCSI_PORT_LUN_EXTENSION LunExtension, _In_ UCHAR QueueTag)
Definition: pdo.c:102
PSCSI_PORT_LUN_EXTENSION GetLunByPath(_In_ PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, _In_ UCHAR PathId, _In_ UCHAR TargetId, _In_ UCHAR Lun)
Definition: pdo.c:68
PDEVICE_OBJECT DeviceObject
Definition: iotypes.h:3223
SCSI_PORT_COMMON_EXTENSION Common
Definition: scsiport.h:146
SCSI_REQUEST_BLOCK_INFO SrbInfo
Definition: scsiport.h:174
struct _SCSI_PORT_LUN_EXTENSION * ReadyLun
Definition: scsiport.h:171
struct _SCSI_REQUEST_BLOCK_INFO * CompletedRequests
Definition: scsiport.h:129
PSCSI_REQUEST_BLOCK Srb
Definition: scsiport.h:119
UCHAR QueueTag
Definition: srb.h:256
PVOID OriginalRequest
Definition: srb.h:266
UCHAR Cdb[16]
Definition: srb.h:279
UCHAR Function
Definition: srb.h:250
UCHAR ScsiStatus
Definition: srb.h:252
ULONG DataTransferLength
Definition: srb.h:261
ULONG SrbFlags
Definition: srb.h:260
UCHAR SrbStatus
Definition: srb.h:251
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
_In_ WDF_SPECIAL_FILE_TYPE NotificationType
Definition: wdfdevice.h:1024
void int int ULONGLONG int va_list * ap
Definition: winesup.h:36
unsigned char UCHAR
Definition: xmlstorage.h:181

◆ ScsiPortReadPortBufferUchar()

SCSIPORT_API VOID NTAPI ScsiPortReadPortBufferUchar ( IN PUCHAR  Port,
IN PUCHAR  Buffer,
IN ULONG  Count 
)

Definition at line 54 of file stubs.c.

58{
60}
VOID NTAPI READ_PORT_BUFFER_UCHAR(IN PUCHAR Port, OUT PUCHAR Buffer, IN ULONG Count)
Definition: portio.c:26
CPPORT Port[4]
Definition: headless.c:35

◆ ScsiPortReadPortBufferUlong()

SCSIPORT_API VOID NTAPI ScsiPortReadPortBufferUlong ( IN PULONG  Port,
IN PULONG  Buffer,
IN ULONG  Count 
)

Definition at line 74 of file stubs.c.

78{
80}
VOID NTAPI READ_PORT_BUFFER_ULONG(IN PULONG Port, OUT PULONG Buffer, IN ULONG Count)
Definition: portio.c:46

◆ ScsiPortReadPortBufferUshort()

SCSIPORT_API VOID NTAPI ScsiPortReadPortBufferUshort ( IN PUSHORT  Port,
IN PUSHORT  Buffer,
IN ULONG  Count 
)

Definition at line 64 of file stubs.c.

68{
70}
VOID NTAPI READ_PORT_BUFFER_USHORT(IN PUSHORT Port, OUT PUSHORT Buffer, IN ULONG Count)
Definition: portio.c:36

◆ ScsiPortReadPortUchar()

SCSIPORT_API UCHAR NTAPI ScsiPortReadPortUchar ( IN PUCHAR  Port)

◆ ScsiPortReadPortUlong()

SCSIPORT_API ULONG NTAPI ScsiPortReadPortUlong ( IN PULONG  Port)

Definition at line 1400 of file scsiport.c.

1402{
1403 return READ_PORT_ULONG(Port);
1404}
ULONG NTAPI READ_PORT_ULONG(IN PULONG Port)
Definition: portio.c:70

◆ ScsiPortReadPortUshort()

SCSIPORT_API USHORT NTAPI ScsiPortReadPortUshort ( IN PUSHORT  Port)

Definition at line 1408 of file scsiport.c.

1410{
1411 return READ_PORT_USHORT(Port);
1412}
USHORT NTAPI READ_PORT_USHORT(IN PUSHORT Port)
Definition: portio.c:63

Referenced by AtapiSendCommand(), and IssueIdentify().

◆ ScsiPortReadRegisterBufferUchar()

SCSIPORT_API VOID NTAPI ScsiPortReadRegisterBufferUchar ( IN PUCHAR  Register,
IN PUCHAR  Buffer,
IN ULONG  Count 
)

Definition at line 1416 of file scsiport.c.

1420{
1421 // FIXME
1423}

◆ ScsiPortReadRegisterBufferUlong()

SCSIPORT_API VOID NTAPI ScsiPortReadRegisterBufferUlong ( IN PULONG  Register,
IN PULONG  Buffer,
IN ULONG  Count 
)

Definition at line 1427 of file scsiport.c.

1431{
1432 // FIXME
1434}

◆ ScsiPortReadRegisterBufferUshort()

SCSIPORT_API VOID NTAPI ScsiPortReadRegisterBufferUshort ( IN PUSHORT  Register,
IN PUSHORT  Buffer,
IN ULONG  Count 
)

Definition at line 1438 of file scsiport.c.

1442{
1443 // FIXME
1445}

◆ ScsiPortReadRegisterUchar()

SCSIPORT_API UCHAR NTAPI ScsiPortReadRegisterUchar ( IN PUCHAR  Register)

Definition at line 1449 of file scsiport.c.

1451{
1453}
NTKERNELAPI UCHAR NTAPI READ_REGISTER_UCHAR(IN PUCHAR Register)

◆ ScsiPortReadRegisterUlong()

SCSIPORT_API ULONG NTAPI ScsiPortReadRegisterUlong ( IN PULONG  Register)

Definition at line 1457 of file scsiport.c.

1459{
1461}
#define READ_REGISTER_ULONG(r)
Definition: arm.h:26

◆ ScsiPortReadRegisterUshort()

SCSIPORT_API USHORT NTAPI ScsiPortReadRegisterUshort ( IN PUSHORT  Register)

Definition at line 1465 of file scsiport.c.

1467{
1469}
#define READ_REGISTER_USHORT(r)
Definition: arm.h:29

◆ ScsiPortSetBusDataByOffset()

SCSIPORT_API ULONG NTAPI ScsiPortSetBusDataByOffset ( IN PVOID  DeviceExtension,
IN ULONG  BusDataType,
IN ULONG  SystemIoBusNumber,
IN ULONG  SlotNumber,
IN PVOID  Buffer,
IN ULONG  Offset,
IN ULONG  Length 
)

Definition at line 1473 of file scsiport.c.

1481{
1482 // FIXME
1484 return 0;
1485}

◆ ScsiPortStallExecution()

◆ ScsiPortValidateRange()

SCSIPORT_API BOOLEAN NTAPI ScsiPortValidateRange ( IN PVOID  HwDeviceExtension,
IN INTERFACE_TYPE  BusType,
IN ULONG  SystemIoBusNumber,
IN SCSI_PHYSICAL_ADDRESS  IoAddress,
IN ULONG  NumberOfBytes,
IN BOOLEAN  InIoSpace 
)

Definition at line 1497 of file scsiport.c.

1504{
1505 // FIXME
1507 return TRUE;
1508}

Referenced by BT958HwFindAdapter(), and UniataFindBusMasterController().

◆ ScsiPortWritePortBufferUchar()

SCSIPORT_API VOID NTAPI ScsiPortWritePortBufferUchar ( IN PUCHAR  Port,
IN PUCHAR  Buffer,
IN ULONG  Count 
)

Definition at line 1517 of file scsiport.c.

1521{
1523}
#define H2I(Port)
Definition: portio.c:18
PPC_QUAL void __outbytestring(unsigned long const Port, const unsigned char *const Buffer, const unsigned long Count)
Definition: intrin_ppc.h:653

◆ ScsiPortWritePortBufferUlong()

SCSIPORT_API VOID NTAPI ScsiPortWritePortBufferUlong ( IN PULONG  Port,
IN PULONG  Buffer,
IN ULONG  Count 
)

Definition at line 1527 of file scsiport.c.

1531{
1533}
PPC_QUAL void __outdwordstring(unsigned long const Port, const unsigned long *const Buffer, const unsigned long Count)
Definition: intrin_ppc.h:671

◆ ScsiPortWritePortBufferUshort()

SCSIPORT_API VOID NTAPI ScsiPortWritePortBufferUshort ( IN PUSHORT  Port,
IN PUSHORT  Buffer,
IN ULONG  Count 
)

Definition at line 1537 of file scsiport.c.

1541{
1543}
PPC_QUAL void __outwordstring(unsigned long const Port, const unsigned short *const Buffer, const unsigned long Count)
Definition: intrin_ppc.h:662

◆ ScsiPortWritePortUchar()

SCSIPORT_API VOID NTAPI ScsiPortWritePortUchar ( IN PUCHAR  Port,
IN UCHAR  Value 
)

Definition at line 1547 of file scsiport.c.

1550{
1552}
#define WRITE_PORT_UCHAR(p, d)
Definition: pc98vid.h:21
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413

Referenced by AtapiFindController(), AtapiFindNativeModeController(), AtapiFindPCIController(), AtapiHwInitialize(), AtapiSendCommand(), FindDevices(), IdeMediaStatus(), IdeReadWrite(), IdeSendCommand(), IdeSendSmartCommand(), IdeVerify(), IssueIdentify(), MapError(), SetDriveParameters(), and WriteBusLogicPort().

◆ ScsiPortWritePortUlong()

SCSIPORT_API VOID NTAPI ScsiPortWritePortUlong ( IN PULONG  Port,
IN ULONG  Value 
)

Definition at line 1556 of file scsiport.c.

1559{
1561}
VOID NTAPI WRITE_PORT_ULONG(IN PULONG Port, IN ULONG Value)
Definition: portio.c:123

◆ ScsiPortWritePortUshort()

SCSIPORT_API VOID NTAPI ScsiPortWritePortUshort ( IN PUSHORT  Port,
IN USHORT  Value 
)

Definition at line 1565 of file scsiport.c.

1568{
1570}
VOID NTAPI WRITE_PORT_USHORT(IN PUSHORT Port, IN USHORT Value)
Definition: portio.c:115

◆ ScsiPortWriteRegisterBufferUchar()

SCSIPORT_API VOID NTAPI ScsiPortWriteRegisterBufferUchar ( IN PUCHAR  Register,
IN PUCHAR  Buffer,
IN ULONG  Count 
)

Definition at line 1574 of file scsiport.c.

1578{
1579 // FIXME
1581}

◆ ScsiPortWriteRegisterBufferUlong()

SCSIPORT_API VOID NTAPI ScsiPortWriteRegisterBufferUlong ( IN PULONG  Register,
IN PULONG  Buffer,
IN ULONG  Count 
)

Definition at line 1585 of file scsiport.c.

1589{
1590 // FIXME
1592}

◆ ScsiPortWriteRegisterBufferUshort()

SCSIPORT_API VOID NTAPI ScsiPortWriteRegisterBufferUshort ( IN PUSHORT  Register,
IN PUSHORT  Buffer,
IN ULONG  Count 
)

Definition at line 1596 of file scsiport.c.

1600{
1601 // FIXME
1603}

◆ ScsiPortWriteRegisterUchar()

SCSIPORT_API VOID NTAPI ScsiPortWriteRegisterUchar ( IN PUCHAR  Register,
IN UCHAR  Value 
)

Definition at line 1607 of file scsiport.c.

1610{
1612}
NTKERNELAPI VOID NTAPI WRITE_REGISTER_UCHAR(IN PUCHAR Register, IN UCHAR Value)

◆ ScsiPortWriteRegisterUlong()

SCSIPORT_API VOID NTAPI ScsiPortWriteRegisterUlong ( IN PULONG  Register,
IN ULONG  Value 
)

Definition at line 1616 of file scsiport.c.

1619{
1621}
#define WRITE_REGISTER_ULONG(r, v)
Definition: arm.h:27

◆ ScsiPortWriteRegisterUshort()

SCSIPORT_API VOID NTAPI ScsiPortWriteRegisterUshort ( IN PUSHORT  Register,
IN USHORT  Value 
)

Definition at line 1625 of file scsiport.c.

1628{
1630}
#define WRITE_REGISTER_USHORT(r, v)
Definition: arm.h:30