[BTRFS] Fix booting with runtime checks
[reactos.git] / drivers / parallel / parport / parport.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: Parallel Port Function Driver
4 * FILE: drivers/parallel/parport/parport.h
5 * PURPOSE: Parport driver header
6 */
7
8 #ifndef _PARPORT_PCH_
9 #define _PARPORT_PCH_
10
11 #include <ntddk.h>
12 #include <ndk/haltypes.h>
13 #include <ntddpar.h>
14 #include <stdio.h>
15
16 #include "hardware.h"
17
18 //#define NDEBUG
19 #include <debug.h>
20
21 typedef enum
22 {
23 dsStopped,
24 dsStarted,
25 dsPaused,
26 dsRemoved,
27 dsSurpriseRemoved
28 } DEVICE_STATE;
29
30 typedef struct _COMMON_DEVICE_EXTENSION
31 {
32 BOOLEAN IsFDO;
33 DEVICE_STATE PnpState;
34 } COMMON_DEVICE_EXTENSION, *PCOMMON_DEVICE_EXTENSION;
35
36 typedef struct _FDO_DEVICE_EXTENSION
37 {
38 COMMON_DEVICE_EXTENSION Common;
39
40 PDEVICE_OBJECT Pdo;
41 PDEVICE_OBJECT LowerDevice;
42
43 PDEVICE_OBJECT AttachedRawPdo;
44 PDEVICE_OBJECT AttachedPdo[2];
45
46 ULONG PortNumber;
47
48 ULONG OpenCount;
49
50 ULONG BaseAddress;
51 PKINTERRUPT Interrupt;
52
53 } FDO_DEVICE_EXTENSION, *PFDO_DEVICE_EXTENSION;
54
55 typedef struct _PDO_DEVICE_EXTENSION
56 {
57 COMMON_DEVICE_EXTENSION Common;
58
59 PDEVICE_OBJECT AttachedFdo;
60
61 ULONG PortNumber;
62 ULONG LptPort;
63
64 ULONG OpenCount;
65
66 } PDO_DEVICE_EXTENSION, *PPDO_DEVICE_EXTENSION;
67
68 #define PARPORT_TAG 'trpP'
69
70 /* fdo.c */
71
72 DRIVER_ADD_DEVICE AddDevice;
73
74 NTSTATUS
75 NTAPI
76 FdoCreate(IN PDEVICE_OBJECT DeviceObject,
77 IN PIRP Irp);
78
79 NTSTATUS
80 NTAPI
81 FdoClose(IN PDEVICE_OBJECT DeviceObject,
82 IN PIRP Irp);
83
84 NTSTATUS
85 NTAPI
86 FdoCleanup(IN PDEVICE_OBJECT DeviceObject,
87 IN PIRP Irp);
88
89 NTSTATUS
90 NTAPI
91 FdoRead(IN PDEVICE_OBJECT DeviceObject,
92 IN PIRP Irp);
93
94 NTSTATUS
95 NTAPI
96 FdoWrite(IN PDEVICE_OBJECT DeviceObject,
97 IN PIRP Irp);
98
99 NTSTATUS
100 NTAPI
101 FdoPnp(IN PDEVICE_OBJECT DeviceObject,
102 IN PIRP Irp);
103
104 NTSTATUS
105 NTAPI
106 FdoPower(IN PDEVICE_OBJECT DeviceObject,
107 IN PIRP Irp);
108
109
110 /* misc.c */
111
112 NTSTATUS
113 ForwardIrpAndWait(IN PDEVICE_OBJECT DeviceObject,
114 IN PIRP Irp);
115
116 DRIVER_DISPATCH ForwardIrpAndForget;
117
118 PVOID
119 GetUserBuffer(IN PIRP Irp);
120
121 //KSERVICE_ROUTINE ParportInterruptService;
122
123
124 /* pdo.c */
125
126 NTSTATUS
127 NTAPI
128 PdoCreate(IN PDEVICE_OBJECT DeviceObject,
129 IN PIRP Irp);
130
131 NTSTATUS
132 NTAPI
133 PdoClose(IN PDEVICE_OBJECT DeviceObject,
134 IN PIRP Irp);
135
136 NTSTATUS
137 NTAPI
138 PdoCleanup(IN PDEVICE_OBJECT DeviceObject,
139 IN PIRP Irp);
140
141 NTSTATUS
142 NTAPI
143 PdoRead(IN PDEVICE_OBJECT DeviceObject,
144 IN PIRP Irp);
145
146 NTSTATUS
147 NTAPI
148 PdoWrite(IN PDEVICE_OBJECT DeviceObject,
149 IN PIRP Irp);
150
151 NTSTATUS
152 NTAPI
153 PdoPnp(IN PDEVICE_OBJECT DeviceObject,
154 IN PIRP Irp);
155
156 NTSTATUS
157 NTAPI
158 PdoPower(IN PDEVICE_OBJECT DeviceObject,
159 IN PIRP Irp);
160
161 #endif /* _PARPORT_PCH_ */