Delen via


Required and Optional SCSI Miniport Driver Routines

A miniport driver's HwScsiXxx routines can have any name chosen by the driver writer. DriverEntry is a required name.

Every SCSI miniport driver must have at least the following system-defined routines:

Required Routine Description
DriverEntry Initializes the miniport driver
HwScsiFindAdapter Determines how (or whether) driver-supported host bus adapter(s) (HBAs) are configured in the machine
HwScsiInitialize Initializes supported HBA(s)
HwScsiStartIo Starts operations on the miniport's HBA(s) for incoming requests
HwScsiResetBus Handles 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:

Routine Description
HwScsiInterrupt Handles HBA-generated interrupts, which is optional if and only if the HBA does not generate interrupts so the miniport driver manages all I/O operations on its HBA by polling. However, using polling exclusively has an adverse effect on a miniport driver's performance and on its HBA's I/O throughput. Such a miniport driver should also have an HwScsiTimer routine.
HwScsiDisableInterruptsCallback and HwScsiEnableInterruptsCallback Handle deferred I/O processing if interrupt-driven I/O operations take a long time.
HwScsiTimer Times operations that require long delays on the HBA, or for any other purpose determined by the driver designer. A miniport driver 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 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 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.
HwScsiAdapterControl Required if the miniport driver supports Plug and Play.
HwScsiWmiExecuteMethod Executes a method associated with a data block. This routine is optional.
HwScsiWmiFunctionControl Enables or disables notification of events, and also enables or disables data collection for data blocks that the miniport driver designated as expensive to collect. Optional.
HwScsiWmiQueryDataBlock Obtains either a single instance or all instances of a data block. Required.
HwScsiWmiQueryReginfo Obtains information about the data and event blocks to be registered on behalf of the miniport driver by the SCSI port driver. Required.
HwScsiWmiSetDataBlock Changes all data items in a single instance of a data block. Optional.
HwScsiWmiSetDataItem Changes a single data item in an instance of a data block. Optional.

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 driver's initial entry point, names for miniport driver routines can be anything the driver writer chooses.

Error Handling in SCSI Miniport Drivers describes error-handling requirements for SCSI miniport drivers.