- Missed in previous commit: Fix VideoPortEnable/DisableInterrupt -- they should only fail if the driver didn't provide an ISR (documented).

svn path=/trunk/; revision=44086
This commit is contained in:
Stefan Ginsberg 2009-11-10 23:01:42 +00:00
parent 662ba31e98
commit 0c19771290

View file

@ -106,42 +106,56 @@ IntVideoPortSetupInterrupt(
/* /*
* @implemented * @implemented
*/ */
VP_STATUS
VP_STATUS NTAPI NTAPI
VideoPortEnableInterrupt(IN PVOID HwDeviceExtension) VideoPortEnableInterrupt(IN PVOID HwDeviceExtension)
{ {
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
BOOLEAN Status; BOOLEAN InterruptValid;
TRACE_(VIDEOPRT, "VideoPortEnableInterrupt\n");
/* Get the device extension */
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
Status = HalEnableSystemInterrupt( /* Fail if the driver didn't register an ISR */
DeviceExtension->InterruptVector, if (!DeviceExtension->DriverExtension->InitializationData.HwInterrupt)
{
/* No ISR, no interrupts */
return ERROR_INVALID_FUNCTION;
}
/* Re-enable the interrupt and return */
InterruptValid = HalEnableSystemInterrupt(DeviceExtension->InterruptVector,
0, 0,
DeviceExtension->InterruptLevel); DeviceExtension->InterruptLevel);
return Status ? NO_ERROR : ERROR_INVALID_PARAMETER; /* Make sure the interrupt was valid */
ASSERT(InterruptValid == TRUE);
/* Return to caller */
return NO_ERROR;
} }
/* /*
* @implemented * @implemented
*/ */
VP_STATUS
VP_STATUS NTAPI NTAPI
VideoPortDisableInterrupt(IN PVOID HwDeviceExtension) VideoPortDisableInterrupt(IN PVOID HwDeviceExtension)
{ {
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
BOOLEAN Status;
TRACE_(VIDEOPRT, "VideoPortDisableInterrupt\n");
/* Get the device extension */
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
Status = HalDisableSystemInterrupt( /* Fail if the driver didn't register an ISR */
DeviceExtension->InterruptVector, if (!DeviceExtension->DriverExtension->InitializationData.HwInterrupt)
0); {
/* No ISR, no interrupts */
return ERROR_INVALID_FUNCTION;
}
return Status ? NO_ERROR : ERROR_INVALID_PARAMETER; /* Disable the interrupt and return */
HalDisableSystemInterrupt(DeviceExtension->InterruptVector,
0);
return NO_ERROR;
} }