41 cbmiec_test_irq(IN PDEVICE_EXTENSION Pdx, OUT PVOID Buffer, IN ULONG BufferLength)
54 if (
sizeof(*bufferTestIrq) > BufferLength)
61 RtlZeroMemory(bufferTestIrq, BufferLength);
65 ntStatus = STATUS_SUCCESS;
68 PUCHAR ecrPort = Pdx->ParPortEcpPortAddress + ECR_OFFSET;
82 if (!Pdx->ParallelPortAllocatedInterrupt)
84 ntStatus = STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT;
98 ret = InterlockedExchange(&Pdx->IrqCount, 100);
104 if (Pdx->ParPortEcpPortAddress)
109 DBG_CABLE((
DBG_PREFIX "" __DATE__
" " __TIME__));
110 DBG_CABLE((
DBG_PREFIX "Setting ECP to configuration mode"));
116 DBG_CABLE((
DBG_PREFIX "Addresses: %p = (%02x, %02x, %02x)",
117 Pdx->ParPortEcpPortAddress,
132 DBG_CABLE((
DBG_PREFIX "Resetting ECP to old mode"));
136 DBG_CABLE((
DBG_PREFIX "Interrupt bit ECR = %s",
141 DBG_CABLE((
DBG_PREFIX "Interrupt bit ECR = %s",
149 DBG_CABLE((
DBG_PREFIX "Interrupt bit ECR = %s",
157 DBG_CABLE((
DBG_PREFIX "Before: ECR (%p) = %02x",
158 Pdx->ParPortEcpPortAddress + ECR_OFFSET,
164 DBG_CABLE((
DBG_PREFIX "After: ECR (%p) = %02x",
165 Pdx->ParPortEcpPortAddress + ECR_OFFSET,
175 ret = InterlockedExchange(&Pdx->IrqCount, 100);
176 DBG_CABLE((
DBG_PREFIX "Pdx->IrqCount = 100, old Value = %u", ret));
196 DBG_CABLE((
DBG_PREFIX "Disallow Interrupts"));
199 if (Pdx->ParPortEcpPortAddress)
201 DBG_CABLE((
DBG_PREFIX "Before: ECR (%p) = %02x",
202 Pdx->ParPortEcpPortAddress + ECR_OFFSET,
208 DBG_CABLE((
DBG_PREFIX "After: ECR (%p) = %02x",
209 Pdx->ParPortEcpPortAddress + ECR_OFFSET,
213 ret = InterlockedExchange(&Pdx->IrqCount, 0);
214 DBG_CABLE((
DBG_PREFIX "Pdx->IrqCount = 0, old Value = %u", ret));
226 ntStatus = STATUS_NO_SUCH_DEVICE;
238 FUNC_LEAVE_NTSTATUS(ntStatus);
VOID cbmiec_udelay(IN ULONG howlong)
Wait for a timeout.
#define PP_ATN_OUT
The ATN OUT bit.
#define PP_DATA_OUT
The DATA OUT bit.
#define PP_RESET_OUT
The RESET OUT bit.
Definitions for the libiec library.
Internal functions and definitions of the libiec library.
#define PP_LP_IRQ
Bit for allowing interrupts of the LPT.
#define WRITE_PORT_UCHAR(_x_, _y_)
WRITE_PORT_UCHAR replacement for debugging.
#define CBMIEC_RELEASE(_rel)
#define PP_CLK_OUT
The CLOCK OUT bit.
NTSTATUS cbmiec_test_irq(IN PDEVICE_EXTENSION Pdx, OUT PVOID Buffer, IN ULONG BufferLength)
Test for IRQ capabilities.
Definitions for the opencbm driver.
#define LogErrorOnly(_Fdo_, _UniqueErrorValue_)
#define READ_PORT_UCHAR(_x_)
READ_PORT_UCHAR replacement for debugging.