43 WaitCancelRoutine(IN PDEVICE_OBJECT Fdo, IN PIRP Irp)
45 PDEVICE_EXTENSION pdx;
49 pdx = Fdo->DeviceExtension;
53 DBG_DPC((
DBG_PREFIX "Cancelling IRP 0x%p", Irp));
54 DBG_IRQL( == DISPATCH_LEVEL);
55 IoReleaseCancelSpinLock(Irp->CancelIrql);
60 DBG_IRQL( <= DISPATCH_LEVEL);
61 KeSetEvent(&pdx->EventWaitForListener, IO_NO_INCREMENT, FALSE);
66 #endif // #ifdef USE_DPC
82 ULONG NumberOfAcks = SendEoi ? 2 : 1;
86 PERF_EVENT_VERBOSE(0x1100, NumberOfAcks);
97 if (Pdx->ParallelPortAllocatedInterrupt)
106 PERF_EVENT_VERBOSE(0x1101, NumberOfAcks);
107 ret = InterlockedExchange(&Pdx->IrqCount, NumberOfAcks);
109 PERF_EVENT_VERBOSE(0x1102, ret);
113 DBG_IRQ((
"Allow Interrupts"));
122 DBG_IRQ((
"Release CLK_OUT"));
130 PERF_EVENT_VERBOSE(0x1103, 0);
131 DBG_VERIFY(IoSetCancelRoutine(Pdx->IrpQueue.CurrentIrp, WaitCancelRoutine)
DBGDO(== NULL));
135 PERF_EVENT_VERBOSE(0x1104, 0);
136 DBG_DPC((
DBG_PREFIX "CALL KeWaitForSingleObject()"));
137 KeWaitForSingleObject(&Pdx->EventWaitForListener, Executive, KernelMode, FALSE, NULL);
138 DBG_DPC((
DBG_PREFIX "RETURN from KeWaitForSingleObject()"));
140 PERF_EVENT_VERBOSE(0x1105, 0);
144 if (IoSetCancelRoutine(Pdx->IrpQueue.CurrentIrp, NULL) == NULL)
146 PERF_EVENT_VERBOSE(0x1106, -1);
151 InterlockedExchange(&Pdx->IrqCount, 0);
164 DBG_IRQ((
"IrqCount = 0"));
169 DBG_IRQ((
"No more Interrupts"));
200 KeStallExecutionProcessor(1);
205 if (--NumberOfAcks == 0)
215 KeStallExecutionProcessor(1);
226 PERF_EVENT_VERBOSE(0x1107, 0);
IEC_TIMEOUTS libiec_global_timeouts
#define CBMIEC_GET(_line)
ULONG T_WaitForListener_Granu_T_H
= 10 us: Graunularity of wait_for_listener() polls
BOOLEAN QueueShouldCancelCurrentIrp(PQUEUE Queue)
Should the current IRP be cancelled?
VOID cbmiec_wait_for_listener(IN PDEVICE_EXTENSION Pdx, IN BOOLEAN SendEoi)
Wait until listener is ready to receive.
Internal functions and definitions of the libiec library.
#define PP_LP_IRQ
Bit for allowing interrupts of the LPT.
VOID cbmiec_schedule_timeout(IN ULONG howlong)
Schedule a timeout.
#define PP_DATA_IN
The DATA IN bit.
#define DBG_SUCCESS(_xxx)
#define CBMIEC_RELEASE(_rel)
#define PP_CLK_OUT
The CLOCK OUT bit.
VOID cbmiec_block_irq(PDEVICE_EXTENSION Pdx)
Block all interrupts.
Definitions for the opencbm driver.
VOID cbmiec_release_irq(PDEVICE_EXTENSION Pdx)
Release the interrupts.