BOOLEAN SpTerminateAdapterSynchronized( IN PADAPTER_EXTENSION Adapter ) { // // Disable the interrupt from coming in. // SET_FLAG(Adapter->InterruptData.InterruptFlags, PD_ADAPTER_REMOVED); CLEAR_FLAG(Adapter->InterruptData.InterruptFlags, PD_RESET_HOLD); ScsiPortCompleteRequest(Adapter->HwDeviceExtension, 0xff, 0xff, 0xff, SRB_STATUS_NO_HBA); // // Run the completion DPC. // if(TEST_FLAG(Adapter->InterruptData.InterruptFlags, PD_NOTIFICATION_REQUIRED)) { SpRequestCompletionDpc(Adapter->DeviceObject); } return TRUE; }
BOOLEAN ResetBus (PVOID HAObject, ULONG PathID) { TRACE(0, ("ResetBus(): \n")); ((ADAPTER_PTR)HAObject)->Service(HA_RESET_BUS, (ADAPTER_PTR)HAObject, 0l); // Stall here, to allow the interrupt service routine to handle the reset // and blow off requests, etc. ScsiPortStallExecution(100l); // Send completion of reset request: ScsiPortCompleteRequest(HAObject, (UCHAR)PathID, (UCHAR)-1, (UCHAR)-1, SRB_STATUS_BUS_RESET); return TRUE; }
BOOLEAN MpHwResetBus( __in pHW_HBA_EXT pHBAExt, // Adapter device-object extension from port driver. __in ULONG BusId ) { // To do: At some future point, it may be worthwhile to ensure that any SRBs being handled be completed at once. // Practically speaking, however, it seems that the only SRBs that would not be completed very quickly // would be those handled by the worker thread. In the future, therefore, there might be a global flag // set here to instruct the thread to complete outstanding I/Os as they appear; but a period for that // happening would have to be devised (such completion shouldn't be unbounded). DbgPrint("PhDskMnt::MpHwResetBus: pHBAExt = 0x%p, BusId = %u. Calling ScsiPortCompleteRequest().\n", pHBAExt, BusId); ScsiPortCompleteRequest(pHBAExt, (UCHAR) BusId, SP_UNTAGGED, SP_UNTAGGED, SRB_STATUS_BUS_RESET); return TRUE; } // End MpHwResetBus().