|
ReactOS 0.4.17-dev-1343-g8fe3cee
|
#include <wdm.h>#include <ntddk.h>#include <ntintsafe.h>#include <ntstrsafe.h>#include <stdio.h>#include <memory.h>#include <storport.h>#include <ntddscsi.h>#include <ntdddisk.h>#include <mountdev.h>#include <wdmguid.h>

Go to the source code of this file.
Classes | |
| struct | _DRIVER_INIT_DATA |
| struct | _DRIVER_OBJECT_EXTENSION |
| struct | _MINIPORT_DEVICE_EXTENSION |
| struct | _MINIPORT |
| struct | _UNIT_DATA |
| struct | _TIMER_ENTRY |
| struct | _PDO_IO_FLOW_CONTROL |
| struct | _FDO_IO_FLOW_CONTROL |
| struct | _STARVED_REQUEST_QUEUE |
| struct | _FDO_DEVICE_EXTENSION |
| struct | _PDO_DEVICE_EXTENSION |
| struct | _EXTENDED_REQUEST |
| struct | _QUEUED_REQUEST_REFERENCE |
| struct | _LUN_DESCRIPTOR |
| struct | _REPORT_LUNS_DATA |
Macros | |
| #define | _STORPORT_ |
| #define | TAG_GLOBAL_DATA 'DGtS' |
| #define | TAG_INIT_DATA 'DItS' |
| #define | TAG_DEVICE_RELATION 'RDtS' |
| #define | TAG_DEVICE_ID 'DItS' |
| #define | TAG_DEVICE_TEXT 'XTtS' |
| #define | TAG_MINIPORT_DATA 'DMtS' |
| #define | TAG_ACCRESS_RANGE 'RAtS' |
| #define | TAG_RESOURCE_LIST 'LRtS' |
| #define | TAG_ADDRESS_MAPPING 'MAtS' |
| #define | TAG_INQUIRY_DATA 'QItS' |
| #define | TAG_LUN_EXTENSION 'ELtS' |
| #define | TAG_REPORT_LUN_DATA 'LRtS' |
| #define | TAG_SENSE_DATA 'NStS' |
| #define | TAG_QUEUED_REQUEST 'RQtS' |
| #define | TAG_SRB_EXTENSION 'XStS' |
| #define | SET_FLAG(Flags, Bit) ((Flags) |= (Bit)) |
| #define | CLEAR_FLAG(Flags, Bit) ((Flags) &= ~(Bit)) |
| #define | TEST_FLAG(Flags, Bit) (((Flags) & (Bit)) != 0) |
| #define | HW_INIT_DATA_SIZE_PHYSICAL FIELD_OFFSET(HW_INITIALIZATION_DATA, HwFreeAdapterResources) |
| #define | HW_INIT_DATA_SIZE_VIRTUAL_LEGACY FIELD_OFFSET(HW_INITIALIZATION_DATA, HwTracingEnabled) |
Enumerations | |
| enum | DEVICE_STATE { dsStopped , dsStarted , dsPaused , dsRemoved , dsSurpriseRemoved , NotStarted = 0 , Started , StopPending , Stopped , RemovePending , SurpriseRemovePending , Deleted , dsStopped , dsStarted , dsPaused , dsRemoved , dsSurpriseRemoved , dsStopped , dsStarted , dsPaused , dsRemoved , dsSurpriseRemoved } |
| enum | EXTENSION_TYPE { InvalidExtension = 0 , DriverExtension , FdoExtension , PdoExtension } |
| #define HW_INIT_DATA_SIZE_PHYSICAL FIELD_OFFSET(HW_INITIALIZATION_DATA, HwFreeAdapterResources) |
| #define HW_INIT_DATA_SIZE_VIRTUAL_LEGACY FIELD_OFFSET(HW_INITIALIZATION_DATA, HwTracingEnabled) |
| typedef struct _DRIVER_INIT_DATA DRIVER_INIT_DATA |
| typedef struct _EXTENDED_REQUEST EXTENDED_REQUEST |
| typedef struct _LUN_DESCRIPTOR LUN_DESCRIPTOR |
| typedef struct _DRIVER_INIT_DATA * PDRIVER_INIT_DATA |
| typedef struct _EXTENDED_REQUEST * PEXTENDED_REQUEST |
| typedef struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION |
| typedef struct _FDO_IO_FLOW_CONTROL * PFDO_IO_FLOW_CONTROL |
| typedef struct _LUN_DESCRIPTOR * PLUN_DESCRIPTOR |
| typedef struct _PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION |
| typedef struct _PDO_IO_FLOW_CONTROL * PPDO_IO_FLOW_CONTROL |
| typedef struct _REPORT_LUNS_DATA * PREPORT_LUNS_DATA |
| typedef struct _TIMER_ENTRY * PTIMER_ENTRY |
| typedef struct _UNIT_DATA * PUNIT_DATA |
| typedef struct _REPORT_LUNS_DATA REPORT_LUNS_DATA |
| typedef struct _TIMER_ENTRY TIMER_ENTRY |
| typedef struct _UNIT_DATA UNIT_DATA |
| Enumerator | |
|---|---|
| InvalidExtension | |
| DriverExtension | |
| FdoExtension | |
| PdoExtension | |
Definition at line 57 of file precomp.h.
| NTSTATUS AllocateAddressMapping | ( | PMAPPED_ADDRESS * | MappedAddressList, |
| STOR_PHYSICAL_ADDRESS | IoAddress, | ||
| PVOID | MappedAddress, | ||
| ULONG | NumberOfBytes, | ||
| ULONG | BusNumber | ||
| ) |
Definition at line 291 of file misc.c.
Referenced by StorPortGetDeviceBase().
| PCM_RESOURCE_LIST CopyResourceList | ( | POOL_TYPE | PoolType, |
| PCM_RESOURCE_LIST | Source | ||
| ) |
Definition at line 92 of file misc.c.
Referenced by PortFdoStartDevice().
| NTSTATUS NTAPI DriverEntry | ( | _In_ PDRIVER_OBJECT | DriverObject, |
| _In_ PUNICODE_STRING | RegistryPath | ||
| ) |
Definition at line 1771 of file compbatt.c.
| PPDO_DEVICE_EXTENSION FdoFindLun | ( | _In_ PFDO_DEVICE_EXTENSION | FdoExtension, |
| _In_ ULONG | Bus, | ||
| _In_ ULONG | Target, | ||
| _In_ ULONG | Lun | ||
| ) |
Definition at line 1306 of file fdo.c.
Referenced by StorPortDeviceBusy(), StorPortDeviceReady(), StorPortGetLogicalUnit(), and StorPortSetDeviceQueueDepth().
| PPDO_DEVICE_EXTENSION NTAPI FdoFindLunAboveDispatch | ( | _In_ PFDO_DEVICE_EXTENSION | FdoExtension, |
| _In_ ULONG | Bus, | ||
| _In_ ULONG | Target, | ||
| _In_ ULONG | Lun | ||
| ) |
Finds a unit from an interrupt service routine or any other caller above DISPATCH_LEVEL.
Definition at line 1405 of file fdo.c.
Referenced by StorPortGetLogicalUnit().
Definition at line 5 of file utils.c.
| INTERFACE_TYPE GetBusInterface | ( | PDEVICE_OBJECT | DeviceObject | ) |
Definition at line 33 of file misc.c.
Referenced by PortFdoStartMiniport().
| PCSTR GetDeviceType | ( | _In_ PINQUIRYDATA | InquiryData | ) |
Definition at line 7 of file scsitypes.h.
| PCSTR GetGenericType | ( | _In_ PINQUIRYDATA | InquiryData | ) |
Definition at line 49 of file scsitypes.h.
| NTSTATUS GetResourceListInterrupt | ( | PFDO_DEVICE_EXTENSION | DeviceExtension, |
| PULONG | Vector, | ||
| PKIRQL | Irql, | ||
| KINTERRUPT_MODE * | InterruptMode, | ||
| PBOOLEAN | ShareVector, | ||
| PKAFFINITY | Affinity | ||
| ) |
Definition at line 242 of file misc.c.
Referenced by PortFdoConnectInterrupt().
| SCSI_ADAPTER_CONTROL_STATUS NTAPI MiniportAdapterControl | ( | _In_ PMINIPORT | Miniport, |
| _In_ SCSI_ADAPTER_CONTROL_TYPE | ControlType, | ||
| _In_opt_ PVOID | Parameters | ||
| ) |
Sends one adapter control request, if the miniport claimed it.
Definition at line 504 of file miniport.c.
Referenced by PortFdoStopAdapter().
Definition at line 325 of file miniport.c.
Referenced by PortFdoStartMiniport().
Tells the miniport the adapter is going away.
Definition at line 419 of file miniport.c.
Referenced by PortFdoPnp().
Definition at line 399 of file miniport.c.
Referenced by PortFdoStartMiniport().
Definition at line 436 of file miniport.c.
Referenced by PortFdoInterruptRoutine().
Definition at line 603 of file miniport.c.
Referenced by PortFdoMessageInterruptRoutine().
| NTSTATUS MiniportInitialize | ( | _In_ PMINIPORT | Miniport, |
| _In_ PFDO_DEVICE_EXTENSION | DeviceExtension, | ||
| _In_ PHW_INITIALIZATION_DATA | HwInitializationData | ||
| ) |
Definition at line 264 of file miniport.c.
Asks the miniport which adapter control requests it handles.
Definition at line 456 of file miniport.c.
Referenced by PortFdoStartMiniport().
Asks the miniport which unit control requests it handles.
Definition at line 529 of file miniport.c.
Referenced by PortFdoStartMiniport().
| BOOLEAN MiniportStartIo | ( | _In_ PMINIPORT | Miniport, |
| _In_ PSCSI_REQUEST_BLOCK | Srb | ||
| ) |
Definition at line 621 of file miniport.c.
| SCSI_UNIT_CONTROL_STATUS NTAPI MiniportUnitControl | ( | _In_ PMINIPORT | Miniport, |
| _In_ SCSI_UNIT_CONTROL_TYPE | ControlType, | ||
| _In_opt_ PVOID | Parameters | ||
| ) |
Sends one unit control request, if the miniport claimed it.
Definition at line 581 of file miniport.c.
Referenced by PortCreatePdo(), and PortDeletePdo().
| VOID PortAllocateRequestReserve | ( | _In_ PFDO_DEVICE_EXTENSION | FdoExtension | ) |
Reserves the memory a single request needs, so IO can still be issued out of pool.
Definition at line 168 of file fdo.c.
Referenced by PortFdoStartDevice().
| VOID NTAPI PortCompletionDpc | ( | _In_ PKDPC | Dpc, |
| _In_ PVOID | Context, | ||
| _In_ PVOID | SystemArgument1, | ||
| _In_ PVOID | SystemArgument2 | ||
| ) |
Definition at line 920 of file srb.c.
Referenced by PortAddDevice().
| NTSTATUS PortCreatePdo | ( | _In_ PFDO_DEVICE_EXTENSION | FdoExtension, |
| _In_ ULONG | Bus, | ||
| _In_ ULONG | Target, | ||
| _In_ ULONG | Lun, | ||
| _Out_ PPDO_DEVICE_EXTENSION * | PdoExtension | ||
| ) |
Definition at line 21 of file pdo.c.
Referenced by PortFdoScanBus().
| NTSTATUS PortDeletePdo | ( | _In_ PPDO_DEVICE_EXTENSION | PdoExtension | ) |
Definition at line 126 of file pdo.c.
Referenced by PortFdoScanBus().
| VOID NTAPI PortFdoBusChangeDpc | ( | _In_ PKDPC | Dpc, |
| _In_opt_ PVOID | DeferredContext, | ||
| _In_opt_ PVOID | SystemArgument1, | ||
| _In_opt_ PVOID | SystemArgument2 | ||
| ) |
Definition at line 1471 of file fdo.c.
Referenced by PortAddDevice().
Definition at line 147 of file ioctl.c.
Referenced by PortDispatchDeviceControl().
| VOID NTAPI PortFdoLinkPdo | ( | _Inout_ PFDO_DEVICE_EXTENSION | FdoExtension, |
| _Inout_ PPDO_DEVICE_EXTENSION | PdoExtension | ||
| ) |
Adds a PDO where both the list lock and the interrupt service routines respect it.
Definition at line 1431 of file fdo.c.
Referenced by PortCreatePdo().
Definition at line 1519 of file fdo.c.
Referenced by PortDispatchPnp().
Definition at line 1491 of file fdo.c.
Referenced by PortDispatchScsi().
| VOID NTAPI PortFdoUnlinkPdo | ( | _Inout_ PFDO_DEVICE_EXTENSION | FdoExtension, |
| _Inout_ PPDO_DEVICE_EXTENSION | PdoExtension | ||
| ) |
Definition at line 1451 of file fdo.c.
Referenced by PortDeletePdo().
| VOID PortFlushStarvedRequests | ( | _In_ PFDO_DEVICE_EXTENSION | FdoExtension | ) |
Fails every queued request, for when the adapter goes away.
Definition at line 153 of file fdo.c.
Referenced by PortFdoPnp().
| VOID PortFreeRequestReserve | ( | _In_ PFDO_DEVICE_EXTENSION | FdoExtension | ) |
Releases the reserve. No request may be using it anymore.
Definition at line 205 of file fdo.c.
Referenced by PortFdoPnp().
| PHW_INITIALIZATION_DATA PortGetDriverInitData | ( | PDRIVER_OBJECT_EXTENSION | DriverExtension, |
| INTERFACE_TYPE | InterfaceType | ||
| ) |
Definition at line 87 of file storport.c.
Referenced by PortFdoStartMiniport(), and StorPortGetUncachedExtension().
| NTSTATUS PortInitializeStarvedRequestQueue | ( | _In_ PSTARVED_REQUEST_QUEUE | Queue | ) |
Definition at line 105 of file fdo.c.
Referenced by PortAddDevice().
Definition at line 379 of file ioctl.c.
Referenced by PortDispatchDeviceControl().
| NTSTATUS PortPdoIssueRequest | ( | _In_ PPDO_DEVICE_EXTENSION | PdoExtension, |
| _In_ PQUEUED_REQUEST_REFERENCE | RequestReference | ||
| ) |
Definition at line 311 of file srb.c.
Referenced by PortPdoScsi(), and PortScheduleComingRequestsOnCompletion().
Definition at line 710 of file pdo.c.
Referenced by PortDispatchPnp().
| BOOLEAN PortPdoScheduleRequestFlowControlled | ( | _In_ PPDO_DEVICE_EXTENSION | PdoExtension, |
| _In_ PFDO_DEVICE_EXTENSION | FdoExtension, | ||
| _In_ PQUEUED_REQUEST_REFERENCE | RequestReference | ||
| ) |
Schedules an outstanding request and return a boolean value to indicate if the request can be immediately issued.
| PdoExtension | PDO device extension. |
| FdoExtension | FDO device extension. |
| RequestReference | RequestReference must be allocated beforehand. |
Definition at line 429 of file srb.c.
Referenced by PortPdoScsi().
Definition at line 548 of file srb.c.
Referenced by PortDispatchScsi(), and PortRetryStarvedRequest().
| VOID PortQueueStarvedRequest | ( | _In_ PFDO_DEVICE_EXTENSION | FdoExtension, |
| _In_ PIRP | Irp | ||
| ) |
Queues a request that could not allocate its private contexts.
Definition at line 124 of file fdo.c.
Referenced by PortPdoStarveRequest().
| VOID PortRetryStarvedRequest | ( | _In_ PFDO_DEVICE_EXTENSION | FdoExtension | ) |
Retries one queued request, so each completion lets exactly one through.
Definition at line 135 of file fdo.c.
Referenced by PortCompleteRequest().
| NTSTATUS QueryBusInterface | ( | PDEVICE_OBJECT | DeviceObject, |
| PGUID | Guid, | ||
| USHORT | Size, | ||
| USHORT | Version, | ||
| PBUS_INTERFACE_STANDARD | Interface, | ||
| PVOID | InterfaceSpecificData | ||
| ) |
Definition at line 122 of file misc.c.
Referenced by PortFdoStartDevice().
| VOID NTAPI SimpleTimerCallbackDpcRoutine | ( | PKDPC | Dpc, |
| PVOID | DeferredContext, | ||
| PVOID | SystemArgument1, | ||
| PVOID | SystemArgument2 | ||
| ) |
| VOID NTAPI StorpBuildExtendedSrb | ( | _In_ PSCSI_REQUEST_BLOCK | Srb, |
| _Out_ PEXTENDED_REQUEST | Request | ||
| ) |
Fills in the extended request a miniport will be given.
| Srb | The request as the class layer built it. |
| Request | Storage for the translated request, already zeroed. |
Definition at line 102 of file srbex.c.
Referenced by PortPdoAfterBuildingScatterGatherList().
| VOID NTAPI StorpBuildUnitAddress | ( | _In_ PPDO_DEVICE_EXTENSION | PdoExtension, |
| _Out_ PSTOR_ADDR_BTL8 | Address | ||
| ) |
Fills in the bus, target and LUN address of a logical unit.
Definition at line 28 of file srbex.c.
Referenced by PortCreatePdo(), and PortDeletePdo().
| VOID NTAPI StorpCompleteExtendedSrb | ( | _In_ PSCSI_REQUEST_BLOCK | Srb, |
| _In_ PEXTENDED_REQUEST | Request | ||
| ) |
Carries the miniport's answer back to the original request block.
Definition at line 157 of file srbex.c.
Referenced by StorPortNotification().
Tells whether a request block is in the extended format.
Definition at line 47 of file srbex.c.
Referenced by StorPortNotification(), StorpRequestReference(), and StorpSrbDataBuffer().
| PQUEUED_REQUEST_REFERENCE NTAPI StorpRequestReference | ( | _In_ PSCSI_REQUEST_BLOCK | Srb | ) |
Finds the request reference behind an SRB in either format.
Definition at line 61 of file srbex.c.
Referenced by StorPortExtendedFunction(), StorPortGetScatterGatherList(), and StorPortNotification().
| PVOID NTAPI StorpSrbDataBuffer | ( | _In_ PSCSI_REQUEST_BLOCK | Srb | ) |
Finds the data buffer of a request in either format.
Definition at line 80 of file srbex.c.
Referenced by StorPortExtendedFunction().
| VOID StorpSrbFreeRequestReference | ( | _In_ PSCSI_REQUEST_BLOCK | Srb | ) |
Frees an SRB's Request Reference and restore Srb->OriginalRequest field to IRP. This function does not check if Srb->OriginalRequest is actually an request reference, and you must determine it by other means.
| Srb |
Definition at line 112 of file srb.c.
Referenced by PortCompleteRequest(), and PortPdoSrbAllocatePrivateContexts().
| VOID NTAPI TimerCallbackDpcRoutine | ( | PKDPC | Dpc, |
| PVOID | DeferredContext, | ||
| PVOID | SystemArgument1, | ||
| PVOID | SystemArgument2 | ||
| ) |
Definition at line 348 of file misc.c.
Referenced by StorPortExtendedFunction().
| BOOLEAN TranslateResourceListAddress | ( | PFDO_DEVICE_EXTENSION | DeviceExtension, |
| INTERFACE_TYPE | BusType, | ||
| ULONG | SystemIoBusNumber, | ||
| STOR_PHYSICAL_ADDRESS | IoAddress, | ||
| ULONG | NumberOfBytes, | ||
| BOOLEAN | InIoSpace, | ||
| PPHYSICAL_ADDRESS | TranslatedAddress | ||
| ) |
Definition at line 173 of file misc.c.
Referenced by StorPortGetDeviceBase().