}
-VOID NTAPI
-WaitForControllerInterrupt(PCONTROLLER_INFO ControllerInfo)
+NTSTATUS NTAPI
+WaitForControllerInterrupt(PCONTROLLER_INFO ControllerInfo, PLARGE_INTEGER Timeout)
/*
* FUNCTION: Wait for the controller to interrupt, and then clear the event
* ARGUMENTS:
* ControllerInfo: Controller to wait for
+ * Timeout: How long to wait for
* NOTES:
* - There is a small chance that an unexpected or spurious interrupt could
* be lost with this clear/wait/clear scheme used in this driver. This is
* - PAGED_CODE because it waits
*/
{
+ NTSTATUS Status;
+
PAGED_CODE();
ASSERT(ControllerInfo);
- KeWaitForSingleObject(&ControllerInfo->SynchEvent, Executive, KernelMode, FALSE, NULL);
+ Status = KeWaitForSingleObject(&ControllerInfo->SynchEvent, Executive, KernelMode, FALSE, Timeout);
KeClearEvent(&ControllerInfo->SynchEvent);
+
+ return Status;
}
static DRIVER_DISPATCH CreateClose;
continue;
}
- WaitForControllerInterrupt(DriveInfo->ControllerInfo);
+ WaitForControllerInterrupt(DriveInfo->ControllerInfo, NULL);
/* Get the results */
Status = HwRecalibrateResult(DriveInfo->ControllerInfo);
return STATUS_IO_DEVICE_ERROR;
}
- WaitForControllerInterrupt(DriveInfo->ControllerInfo);
+ WaitForControllerInterrupt(DriveInfo->ControllerInfo, NULL);
if(HwSenseInterruptStatus(DriveInfo->ControllerInfo) != STATUS_SUCCESS)
{
return STATUS_IO_DEVICE_ERROR;
}
- WaitForControllerInterrupt(DriveInfo->ControllerInfo);
+ WaitForControllerInterrupt(DriveInfo->ControllerInfo, NULL);
if(HwSenseInterruptStatus(DriveInfo->ControllerInfo) != STATUS_SUCCESS)
{
INFO_(FLOPPY, "InitController: waiting for initial interrupt\n");
/* Wait for an interrupt */
- WaitForControllerInterrupt(ControllerInfo);
+ WaitForControllerInterrupt(ControllerInfo, NULL);
/* Reset means you have to clear each of the four interrupts (one per drive) */
for(i = 0; i < MAX_DRIVES_PER_CONTROLLER; i++)