Handling SRB_FUNCTION_FLUSH and SRB_FUNCTION_SHUTDOWN

If the HBA caches data internally, as indicated when HwScsiFindAdapter sets up the PORT_CONFIGURATION_INFORMATION, the HwScsiStartIo routine must support the SRB_FUNCTION_FLUSH and SRB_FUNCTION_SHUTDOWN requests as follows:

  • An SRB with its Function member set to SRB_FUNCTION_FLUSH tells the miniport driver to transfer data cached in the HBA, usually to a disk. The miniport driver must hold on to the flush request until all cached data has been transferred and, then, complete the flush request.

  • Such a flush request might originate when an application closes a file or the application itself is terminated.

  • An SRB with its Function member set to SRB_FUNCTION_SHUTDOWN tells the miniport driver to complete transferring data, including flushing all cached data, out to the target device. The miniport driver must hold on to the shutdown request until no data remains in the HBA's internal cache for the target logical unit and, then, complete the shutdown request.

    Note that a miniport driver can be called with more than one shutdown request, possibly for the same logical unit or with several shutdown requests for different logical units, before the system itself is actually shut down.