Jaa


SCSI Miniport Driver's DriverEntry Routine

A DriverEntry routine is the initial entry point for most Microsoft Windows kernel-mode drivers and for every SCSI miniport driver. A miniport driver's DriverEntry routine is called with two input arguments of type PVOID and must do the following:

  1. Initialize a HW_INITIALIZATION_DATA (SCSI) structure on the stack with zeros.

  2. Set the HwInitializationDataSize member to sizeof(HW_INITIALIZATION_DATA).

  3. Set driver-specific and HBA-specific values in the HW_INITIALIZATION_DATA members, including the miniport driver's entry points. The following entry points must be set:

    The following entry points can be set to a driver-supplied routine or must be set to NULL:

  • HwScsiInterrupt (NULL if the miniport driver uses polling exclusively)
  • HwScsiDmaStarted (NULL if the HBA uses PIO or is a bus master)
  • HwScsiAdapterState (NULL if the miniport driver runs only on NT-based operating system platforms or if it is designed to also run on x86-only Windows platforms but the HBA has neither a BIOS nor x86-real-mode driver)
  • HwScsiAdapterControl (NULL if the miniport driver does not support Plug and Play)
  1. In a legacy miniport driver, set up any driver-determined context data that the miniport driver's HwScsiFindAdapter routine will use.

  2. Call ScsiPortInitialize with the pointers that were input to the DriverEntry routine, the address of the filled-in HW_INITIALIZATION_DATA, and the address of the context data, if any.