A.4.5.3 Handling SRB_FUNCTION_ABORT_COMMAND

A HwScsiStartIo routine is also responsible for handling incoming SRBs with the Function member set to SRB_FUNCTION_ABORT_COMMAND.

For an abort request, the miniport's HwScsiStartIo routine should verify that the given SRB has not been aborted already by calling ScsiPortGetSrb for the target logical unit and comparing the returned pointer to the current SRB's NextSrb value. If they are unequal, the current SRB has already been aborted, and the miniport's HwScsiStartIo routine should do the following:

1.Set the input SRB's ScsiStatus to SRB_STATUS_ABORT_FAILED.

2.Call ScsiPortNotification with the NotificationType RequestComplete and with the input SRB.

3.Call ScsiPortNotification again with the NotificationType NextRequest, or with NextLuRequest if the HBA supports tagged queueing or multiple requests per logical unit.

Otherwise, the HwScsiStartIo routine does the following:

1.Sets up context for the request in its device, logical unit, and/or SRB extensions

2.Programs the HBA to abort the given NextSrb request