A.4.1 Required and Optional SCSI Miniport Routines
Every SCSI miniport driver must have at least the following system-defined
routines:
-
DriverEntry to initialize the miniport driver
-
HwScsiFindAdapter to determine how (or whether) driver-supported HBA(s) are
configured in the machine
-
HwScsiInitialize to initialize supported HBA(s)
-
HwScsiStartIo to start operations on its HBA(s) for incoming requests
-
HwScsiResetBus to handle bus-reset requests.
Depending on each HBA and the driver designer, SCSI miniport drivers also have
some or all of the following system-defined routines:
-
HwScsiInterrupt to handle HBA-generated interrupts, which is optional if and
only if the HBA does not generate interrupts so the miniport manages all I/O
operations on its HBA by polling
However, using polling exclusively has an adverse effect on a miniport’s
performance and on its HBA’s I/O throughput. Such a miniport driver should
also have a HwScsiTimer routine.
-
HwScsiDisableInterruptsCallback and HwScsiEnableInterruptsCallback to handle
deferred I/O processing if interrupt-driven I/O operations take a long time
-
HwScsiTimer to time operations that require long delays on the HBA, or for any
other purpose determined by the driver designer
A miniport should have a HwScsiTimer routine if it has no HwScsiInterrupt
routine so it can use the HwScsiTimer routine for efficient polling of its
HBA.
-
HwScsiDmaStarted, which is required if the HBA uses a system DMA controller,
to set up an HBA transfer after the system DMA controller has been programmed
by the port driver
-
HwScsiAdapterState, which is optional if and only if the HBA has no BIOS or
x86-real-mode driver and/or will never run in x86-only Microsoft Windows
systems
Each of the preceding miniport driver routines, except DriverEntry, has
a name chosen to describe its functionality. Except for DriverEntry,
which is a required name for every miniport’s initial entry point, names for
miniport driver routines can be anything the driver writer chooses.
The following sections describe the requirements for and functionality of each
of these miniport driver routines. See the Kernel-Mode Driver Reference
for their formal definitions and descriptions of their parameters.
Section A.4.11
describes error-handling requirements for SCSI miniport drivers.