54 cbmiec_i_raw_write(PDEVICE_EXTENSION Pdx,
const UCHAR *Buffer, ULONG Count, ULONG *Sent, BOOLEAN Atn, BOOLEAN Talk)
66 if (!NT_SUCCESS(ntStatus))
68 FUNC_LEAVE_NTSTATUS(ntStatus);
75 PERF_EVENT_VERBOSE(0x1010, 0);
77 ret = InterlockedExchange(&Pdx->IrqCount, 0);
80 DBG_IEC((
DBG_PREFIX "About to send %d bytes%s", Count, Atn ?
" with ATN" :
""));
82 PERF_EVENT_VERBOSE(0x1011, 0);
96 PERF_EVENT_VERBOSE(0x1012, 0);
103 PERF_EVENT_VERBOSE(0x1013, 0);
111 PERF_EVENT_VERBOSE(0x1014, 1);
114 ntStatus = STATUS_NO_SUCH_DEVICE;
118 PERF_EVENT_VERBOSE(0x1014, 0);
129 PERF_EVENT_VERBOSE(0x1015, 0);
131 while(sent < Count && ntStatus == STATUS_SUCCESS)
138 PERF_EVENT_VERBOSE(0x1016, sent);
142 PERF_EVENT_VERBOSE(0x1017, sent);
152 PERF_EVENT_VERBOSE(0x1018, sent);
155 ((sent == (Count-1)) && (Atn == 0)) ? TRUE : FALSE);
157 PERF_EVENT_VERBOSE(0x1019, sent);
161 PERF_EVENT_VERBOSE(0x1020, 1);
163 ntStatus = STATUS_CANCELLED;
167 PERF_EVENT_VERBOSE(0x1020, 0);
172 PERF_EVENT_VERBOSE(0x1021, 0);
174 PERF_EVENT_VERBOSE(0x1022, 0);
178 PERF_EVENT_VERBOSE(0x1021, 1);
180 ntStatus = STATUS_NO_SUCH_DEVICE;
181 PERF_EVENT_VERBOSE(0x1022, 1);
188 ntStatus = STATUS_NO_SUCH_DEVICE;
193 if (ntStatus == STATUS_SUCCESS)
203 if (ntStatus == STATUS_SUCCESS)
212 if (ntStatus == STATUS_SUCCESS && Talk)
216 PERF_EVENT_VERBOSE(0x1030, 0);
220 PERF_EVENT_VERBOSE(0x1031, 0);
225 PERF_EVENT_VERBOSE(0x1033, 0);
229 PERF_EVENT_VERBOSE(0x1032, 0);
234 PERF_EVENT_VERBOSE(0x1034, 0);
238 PERF_EVENT_VERBOSE(0x1035, 0);
244 PERF_EVENT_VERBOSE(0x1036, 0);
246 PERF_EVENT_VERBOSE(0x1037, 0);
251 FUNC_LEAVE_NTSTATUS(ntStatus);
VOID cbmiec_udelay(IN ULONG howlong)
Wait for a timeout.
IEC_TIMEOUTS libiec_global_timeouts
#define CBMIEC_GET(_line)
#define PP_ATN_OUT
The ATN OUT bit.
NTSTATUS cbmiec_i_raw_write(PDEVICE_EXTENSION Pdx, const UCHAR *Buffer, ULONG Count, ULONG *Sent, BOOLEAN Atn, BOOLEAN Talk)
Write some bytes to the IEC bus.
ULONG T_11_SEND_BEFORE_BYTE_DELAY
= 50 us: Extra wait before sending of every single byte
#define PP_DATA_OUT
The DATA OUT bit.
BOOLEAN cbmiec_send_byte(IN PDEVICE_EXTENSION Pdx, IN UCHAR Byte)
Write one byte to the IEC bus.
ULONG T_10_SEND_BEFORE_1ST_BYTE
= 20 us: Extra wait before sending 1st byte
#define PP_CLK_IN
The CLOCK IN bit.
ULONG T_14_SEND_AT_END_DELAY
= 100 us: Extra wait after sending a block
ULONG T_12_SEND_AFTER_BYTE_DELAY
= 100 us: Extra wait after sending every single byte
ULONG T_9_SEND_WAIT_DEVICES_T_AT
= 10 us: Granularity: On send, how long to wait for driver to set DATA
BOOLEAN QueueShouldCancelCurrentIrp(PQUEUE Queue)
Should the current IRP be cancelled?
Internal functions and definitions of the libiec library.
#define PERF_EVENT_WRITE_BYTE_NO(_x_)
VOID cbmiec_schedule_timeout(IN ULONG howlong)
Schedule a timeout.
VOID cbmiec_setcablestate(PDEVICE_EXTENSION Pdx, CABLESTATE State)
Set the current state of the cable detection.
#define PP_DATA_IN
The DATA IN bit.
#define DBG_SUCCESS(_xxx)
#define CBMIEC_RELEASE(_rel)
#define PERF_EVENT_WRITE_BYTE(_x_)
#define PP_CLK_OUT
The CLOCK OUT bit.
VOID cbmiec_block_irq(PDEVICE_EXTENSION Pdx)
Block all interrupts.
NTSTATUS cbmiec_checkcable(PDEVICE_EXTENSION Pdx)
Determine the type of cable (XA1541/XM1541) on the IEC bus.
const UCHAR * DebugNtStatus(NTSTATUS Value)
Return the description of an NTSTATUS code.
Definitions for the opencbm driver.
VOID cbmiec_wait_for_listener(IN PDEVICE_EXTENSION Pdx, IN BOOLEAN SendEoi)
Wait until listener is ready to receive.
ULONG T_9_Times
x T_9a, is 100: On send, how long to wait for driver to set DATA
VOID cbmiec_release_irq(PDEVICE_EXTENSION Pdx)
Release the interrupts.