ReactOS 0.4.15-dev-7677-g8209aa5
parallel.h
Go to the documentation of this file.
1/*
2 * parallel.h
3 *
4 * ParPort driver interface
5 *
6 * This file is part of the w32api package.
7 *
8 * Contributors:
9 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
10 *
11 * THIS SOFTWARE IS NOT COPYRIGHTED
12 *
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
15 *
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 */
22
23#ifndef __PARALLEL_H
24#define __PARALLEL_H
25
26#include "ntddpar.h"
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32#define DD_PARALLEL_PORT_BASE_NAME "ParallelPort"
33#define DD_PARALLEL_PORT_BASE_NAME_U L"ParallelPort"
34
35#define IOCTL_INTERNAL_DESELECT_DEVICE \
36 CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 24, METHOD_BUFFERED, FILE_ANY_ACCESS)
37#define IOCTL_INTERNAL_GET_MORE_PARALLEL_PORT_INFO \
38 CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 17, METHOD_BUFFERED, FILE_ANY_ACCESS)
39#define IOCTL_INTERNAL_GET_PARALLEL_PNP_INFO \
40 CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 21, METHOD_BUFFERED, FILE_ANY_ACCESS)
41#define IOCTL_INTERNAL_GET_PARALLEL_PORT_INFO \
42 CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)
43#define IOCTL_INTERNAL_INIT_1284_3_BUS \
44 CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 22, METHOD_BUFFERED, FILE_ANY_ACCESS)
45#define IOCTL_INTERNAL_PARALLEL_CLEAR_CHIP_MODE \
46 CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 20, METHOD_BUFFERED, FILE_ANY_ACCESS)
47#define IOCTL_INTERNAL_PARALLEL_CONNECT_INTERRUPT \
48 CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 13, METHOD_BUFFERED, FILE_ANY_ACCESS)
49#define IOCTL_INTERNAL_PARALLEL_DISCONNECT_INTERRUPT \
50 CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 14, METHOD_BUFFERED, FILE_ANY_ACCESS)
51#define IOCTL_INTERNAL_PARALLEL_PORT_ALLOCATE \
52 CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 11, METHOD_BUFFERED, FILE_ANY_ACCESS)
53#define IOCTL_INTERNAL_PARALLEL_PORT_FREE \
54 CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 40, METHOD_BUFFERED, FILE_ANY_ACCESS)
55#define IOCTL_INTERNAL_PARALLEL_SET_CHIP_MODE \
56 CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 19, METHOD_BUFFERED, FILE_ANY_ACCESS)
57#define IOCTL_INTERNAL_RELEASE_PARALLEL_PORT_INFO \
58 CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 15, METHOD_BUFFERED, FILE_ANY_ACCESS)
59#define IOCTL_INTERNAL_SELECT_DEVICE \
60 CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 23, METHOD_BUFFERED, FILE_ANY_ACCESS)
61
62
63typedef struct _PARALLEL_1284_COMMAND {
68
69/* PARALLEL_1284_COMMAND.CommandFlags */
70#define PAR_END_OF_CHAIN_DEVICE 0x00000001
71#define PAR_HAVE_PORT_KEEP_PORT 0x00000002
72
81
82typedef NTSTATUS
84 _In_ PVOID SetChipContext,
85 _In_ UCHAR ChipMode);
86
87typedef NTSTATUS
89 _In_ PVOID ClearChipContext,
90 _In_ UCHAR ChipMode);
91
92typedef NTSTATUS
94 _In_ PVOID ClearChipContext,
95 _In_ UCHAR ChipMode);
96
97typedef NTSTATUS
99 _In_ PVOID TrySelectContext,
100 _In_ PVOID TrySelectCommand);
101
102typedef NTSTATUS
104 _In_ PVOID DeselectContext,
105 _In_ PVOID DeselectCommand);
106
107/* PARALLEL_PNP_INFORMATION.HardwareCapabilities */
108#define PPT_NO_HARDWARE_PRESENT 0x00000000
109#define PPT_ECP_PRESENT 0x00000001
110#define PPT_EPP_PRESENT 0x00000002
111#define PPT_EPP_32_PRESENT 0x00000004
112#define PPT_BYTE_PRESENT 0x00000008
113#define PPT_BIDI_PRESENT 0x00000008
114#define PPT_1284_3_PRESENT 0x00000010
115
135
136typedef BOOLEAN
138 _In_ PVOID TryAllocateContext);
139
140typedef VOID
142 _In_ PVOID FreeContext);
143
144typedef ULONG
146 _In_ PVOID QueryAllocsContext);
147
157
158/* PARALLEL_CHIP_MODE.ModeFlags */
159#define INITIAL_MODE 0x00
160#define PARCHIP_ECR_ARBITRATOR 0x01
161
162typedef struct _PARALLEL_CHIP_MODE {
166
167typedef VOID
170
177
178
179#define IOCTL_INTERNAL_DISCONNECT_IDLE \
180 CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 32, METHOD_BUFFERED, FILE_ANY_ACCESS)
181#define IOCTL_INTERNAL_LOCK_PORT \
182 CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 37, METHOD_BUFFERED, FILE_ANY_ACCESS)
183#define IOCTL_INTERNAL_LOCK_PORT_NO_SELECT \
184 CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 52, METHOD_BUFFERED, FILE_ANY_ACCESS)
185#define IOCTL_INTERNAL_PARCLASS_CONNECT \
186 CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 30, METHOD_BUFFERED, FILE_ANY_ACCESS)
187#define IOCTL_INTERNAL_PARCLASS_DISCONNECT \
188 CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 31, METHOD_BUFFERED, FILE_ANY_ACCESS)
189#define IOCTL_INTERNAL_UNLOCK_PORT \
190 CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 38, METHOD_BUFFERED, FILE_ANY_ACCESS)
191#define IOCTL_INTERNAL_UNLOCK_PORT_NO_DESELECT \
192 CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 53, METHOD_BUFFERED, FILE_ANY_ACCESS)
193
194typedef USHORT
197
198typedef enum _PARALLEL_SAFETY {
202
203typedef NTSTATUS
206 _In_ USHORT ModeMaskFwd,
207 _In_ USHORT ModeMaskRev,
208 _In_ PARALLEL_SAFETY ModeSafety,
209 _In_ BOOLEAN IsForward);
210
211typedef NTSTATUS
214
215typedef NTSTATUS
218
219typedef NTSTATUS
222
223typedef NTSTATUS
226 _Out_writes_bytes_to_(NumBytesToRead, *NumBytesRead) PVOID Buffer,
227 _In_ ULONG NumBytesToRead,
228 _Out_ PULONG NumBytesRead,
229 _In_ UCHAR Channel);
230
231typedef NTSTATUS
234 _In_reads_bytes_(NumBytesToWrite) PVOID Buffer,
235 _In_ ULONG NumBytesToWrite,
236 _Out_ PULONG NumBytesWritten,
237 _In_ UCHAR Channel);
238
239typedef NTSTATUS
243
244typedef NTSTATUS
248
249typedef struct _PARCLASS_INFORMATION {
267
268#ifdef __cplusplus
269}
270#endif
271
272#endif /* __PARALLEL_H */
unsigned char BOOLEAN
#define VOID
Definition: acefi.h:82
Definition: bufpool.h:45
#define NTSTATUS
Definition: precomp.h:21
ULONG_PTR KAFFINITY
Definition: compat.h:85
enum _INTERFACE_TYPE INTERFACE_TYPE
#define _In_reads_bytes_(size)
Definition: ms_sal.h:321
#define _Out_writes_bytes_to_(size, count)
Definition: ms_sal.h:360
#define _Out_
Definition: ms_sal.h:345
#define _In_
Definition: ms_sal.h:308
#define BOOLEAN
Definition: pedump.c:73
unsigned short USHORT
Definition: pedump.c:61
enum _KINTERRUPT_MODE KINTERRUPT_MODE
NTSTATUS(NTAPI * PPARALLEL_WRITE)(_In_ PVOID Context, _In_reads_bytes_(NumBytesToWrite) PVOID Buffer, _In_ ULONG NumBytesToWrite, _Out_ PULONG NumBytesWritten, _In_ UCHAR Channel)
Definition: parallel.h:232
NTSTATUS(NTAPI * PPARALLEL_IEEE_FWD_TO_REV)(_In_ PVOID Context)
Definition: parallel.h:216
NTSTATUS(NTAPI * PPARALLEL_TRYSELECT_DEVICE)(_In_ PVOID Context, _In_ PARALLEL_1284_COMMAND Command)
Definition: parallel.h:240
_PARALLEL_SAFETY
Definition: parallel.h:198
@ SAFE_MODE
Definition: parallel.h:199
@ UNSAFE_MODE
Definition: parallel.h:200
struct _PARALLEL_CHIP_MODE PARALLEL_CHIP_MODE
struct _PARALLEL_1284_COMMAND PARALLEL_1284_COMMAND
NTSTATUS(NTAPI * PPARALLEL_SET_CHIP_MODE)(_In_ PVOID SetChipContext, _In_ UCHAR ChipMode)
Definition: parallel.h:83
struct _PARALLEL_1284_COMMAND * PPARALLEL_1284_COMMAND
struct _MORE_PARALLEL_PORT_INFORMATION MORE_PARALLEL_PORT_INFORMATION
NTSTATUS(NTAPI * PPARALLEL_DESELECT_DEVICE)(_In_ PVOID Context, _In_ PARALLEL_1284_COMMAND Command)
Definition: parallel.h:245
struct _PARCLASS_INFORMATION * PPARCLASS_INFORMATION
struct _PARALLEL_PORT_INFORMATION * PPARALLEL_PORT_INFORMATION
VOID(NTAPI * PPARALLEL_DEFERRED_ROUTINE)(_In_ PVOID DeferredContext)
Definition: parallel.h:168
NTSTATUS(NTAPI * PPARALLEL_CLEAR_CHIP_MODE)(_In_ PVOID ClearChipContext, _In_ UCHAR ChipMode)
Definition: parallel.h:88
struct _MORE_PARALLEL_PORT_INFORMATION * PMORE_PARALLEL_PORT_INFORMATION
NTSTATUS(NTAPI * PTERMINATE_IEEE_MODE)(_In_ PVOID Context)
Definition: parallel.h:212
VOID(NTAPI * PPARALLEL_FREE_ROUTINE)(_In_ PVOID FreeContext)
Definition: parallel.h:141
ULONG(NTAPI * PPARALLEL_QUERY_WAITERS_ROUTINE)(_In_ PVOID QueryAllocsContext)
Definition: parallel.h:145
NTSTATUS(NTAPI * PPARALLEL_READ)(_In_ PVOID Context, _Out_writes_bytes_to_(NumBytesToRead, *NumBytesRead) PVOID Buffer, _In_ ULONG NumBytesToRead, _Out_ PULONG NumBytesRead, _In_ UCHAR Channel)
Definition: parallel.h:224
NTSTATUS(NTAPI * PPARCHIP_CLEAR_CHIP_MODE)(_In_ PVOID ClearChipContext, _In_ UCHAR ChipMode)
Definition: parallel.h:93
NTSTATUS(NTAPI * PPARALLEL_TRY_SELECT_ROUTINE)(_In_ PVOID TrySelectContext, _In_ PVOID TrySelectCommand)
Definition: parallel.h:98
enum _PARALLEL_SAFETY PARALLEL_SAFETY
struct _PARALLEL_INTERRUPT_SERVICE_ROUTINE * PPARALLEL_INTERRUPT_SERVICE_ROUTINE
NTSTATUS(NTAPI * PNEGOTIATE_IEEE_MODE)(_In_ PVOID Context, _In_ USHORT ModeMaskFwd, _In_ USHORT ModeMaskRev, _In_ PARALLEL_SAFETY ModeSafety, _In_ BOOLEAN IsForward)
Definition: parallel.h:204
struct _PARALLEL_CHIP_MODE * PPARALLEL_CHIP_MODE
struct _PARALLEL_PORT_INFORMATION PARALLEL_PORT_INFORMATION
struct _PARCLASS_INFORMATION PARCLASS_INFORMATION
struct _PARALLEL_PNP_INFORMATION PARALLEL_PNP_INFORMATION
struct _PARALLEL_PNP_INFORMATION * PPARALLEL_PNP_INFORMATION
USHORT(NTAPI * PDETERMINE_IEEE_MODES)(_In_ PVOID Context)
Definition: parallel.h:195
NTSTATUS(NTAPI * PPARALLEL_DESELECT_ROUTINE)(_In_ PVOID DeselectContext, _In_ PVOID DeselectCommand)
Definition: parallel.h:103
NTSTATUS(NTAPI * PPARALLEL_IEEE_REV_TO_FWD)(_In_ PVOID Context)
Definition: parallel.h:220
struct _PARALLEL_INTERRUPT_SERVICE_ROUTINE PARALLEL_INTERRUPT_SERVICE_ROUTINE
BOOLEAN(NTAPI * PPARALLEL_TRY_ALLOCATE_ROUTINE)(_In_ PVOID TryAllocateContext)
Definition: parallel.h:137
Definition: shell.h:41
INTERFACE_TYPE InterfaceType
Definition: parallel.h:74
KINTERRUPT_MODE InterruptMode
Definition: parallel.h:79
PPARALLEL_DEFERRED_ROUTINE DeferredPortCheckRoutine
Definition: parallel.h:174
PKSERVICE_ROUTINE InterruptServiceRoutine
Definition: parallel.h:172
PPARALLEL_TRY_SELECT_ROUTINE TrySelectDevice
Definition: parallel.h:129
PPARALLEL_CLEAR_CHIP_MODE ClearChipMode
Definition: parallel.h:123
PPARALLEL_DESELECT_ROUTINE DeselectDevice
Definition: parallel.h:130
PHYSICAL_ADDRESS EppControllerPhysicalAddress
Definition: parallel.h:126
PHYSICAL_ADDRESS OriginalEcpController
Definition: parallel.h:117
PPARALLEL_SET_CHIP_MODE TrySetChipMode
Definition: parallel.h:122
PPARALLEL_FREE_ROUTINE FreePort
Definition: parallel.h:153
PPARALLEL_QUERY_WAITERS_ROUTINE QueryNumWaiters
Definition: parallel.h:154
PPARALLEL_TRY_ALLOCATE_ROUTINE TryAllocatePort
Definition: parallel.h:152
PHYSICAL_ADDRESS OriginalController
Definition: parallel.h:149
PPARALLEL_IEEE_REV_TO_FWD IeeeRevToFwdMode
Definition: parallel.h:257
PPARALLEL_WRITE ParallelWrite
Definition: parallel.h:259
PPARALLEL_DESELECT_DEVICE ParallelDeSelect
Definition: parallel.h:265
PPARALLEL_TRYSELECT_DEVICE ParallelTryselect
Definition: parallel.h:264
PPARALLEL_IEEE_FWD_TO_REV IeeeFwdToRevMode
Definition: parallel.h:256
PPARALLEL_READ ParallelRead
Definition: parallel.h:258
PNEGOTIATE_IEEE_MODE NegotiateIeeeMode
Definition: parallel.h:254
ULONG HardwareCapabilities
Definition: parallel.h:261
PTERMINATE_IEEE_MODE TerminateIeeeMode
Definition: parallel.h:255
PDETERMINE_IEEE_MODES DetermineIeeeModes
Definition: parallel.h:253
uint16_t * PWSTR
Definition: typedefs.h:56
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
KSERVICE_ROUTINE * PKSERVICE_ROUTINE
Definition: ketypes.h:512
_In_opt_ PVOID DeferredContext
Definition: ketypes.h:687
unsigned char UCHAR
Definition: xmlstorage.h:181