ReactOS 0.4.16-dev-336-gb667d82
isapnp.h
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS ISA PnP Bus driver
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Common header file
5 * COPYRIGHT: Copyright 2010 Cameron Gutman <cameron.gutman@reactos.org>
6 * Copyright 2020 Hervé Poussineau <hpoussin@reactos.org>
7 */
8
9#ifndef _ISAPNP_PCH_
10#define _ISAPNP_PCH_
11
12#include <ntddk.h>
13#include <ntstrsafe.h>
14#include <section_attribs.h>
15
16#include "isapnphw.h"
17#include "isapnpres.h"
18
19#include <initguid.h>
20#include <wdmguid.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26#define TAG_ISAPNP 'pasI'
27
28typedef enum
29{
33
35{
36 IsaPnpBus = 'odFI',
38 IsaPnpReadDataPort = 'pdRI'
40
42{
47
49{
56
59
62
68
70{
73
75#define ISAPNP_ENUMERATED 0x00000001
76#define ISAPNP_SCANNED_BY_READ_PORT 0x00000002
77#define ISAPNP_READ_PORT_ALLOW_FDO_SCAN 0x00000004
78#define ISAPNP_READ_PORT_NEED_REBALANCE 0x00000008
80 union
81 {
82 /* Data belonging to logical devices */
83 struct
84 {
86
88
91 };
92
94 };
95
96 _Write_guarded_by_(_Global_interlock_)
97 volatile LONG SpecialFiles;
99
100extern KEVENT BusSyncEvent;
101
103extern BOOLEAN ReadPortCreated;
104
106extern LIST_ENTRY BusListHead;
107
111VOID
112IsaPnpAcquireBusDataLock(VOID)
113{
115
117}
118
121VOID
122IsaPnpReleaseBusDataLock(VOID)
123{
125}
126
127_Requires_lock_not_held_(FdoExt->DeviceSyncEvent)
128_Acquires_lock_(FdoExt->DeviceSyncEvent)
130VOID
131IsaPnpAcquireDeviceDataLock(
133{
135
136 KeWaitForSingleObject(&FdoExt->DeviceSyncEvent, Executive, KernelMode, FALSE, NULL);
137}
138
139_Releases_lock_(FdoExt->DeviceSyncEvent)
141VOID
142IsaPnpReleaseDeviceDataLock(
144{
145 KeSetEvent(&FdoExt->DeviceSyncEvent, IO_NO_INCREMENT, FALSE);
146}
147
148/* isapnp.c */
149
150CODE_SEG("PAGE")
155 _In_ ULONG RangeStart,
156 _In_ ULONG RangeEnd,
159
160CODE_SEG("PAGE")
165
166CODE_SEG("PAGE")
170 _In_ ULONG Channel);
171
172CODE_SEG("PAGE")
176 _In_ ULONG RangeStart,
177 _In_ ULONG RangeEnd,
179
180CODE_SEG("PAGE")
183 _In_opt_ ULONG SelectedReadPort);
184
185CODE_SEG("PAGE")
188
189CODE_SEG("PAGE")
190VOID
193
194CODE_SEG("PAGE")
199 _In_ BOOLEAN IncludeDataPort);
200
201CODE_SEG("INIT")
202DRIVER_INITIALIZE DriverEntry;
203
204/* fdo.c */
205CODE_SEG("PAGE")
211
212/* interface.c */
213CODE_SEG("PAGE")
218
219/* pdo.c */
220CODE_SEG("PAGE")
223 _In_ PISAPNP_PDO_EXTENSION PdoDeviceExtension,
226
227CODE_SEG("PAGE")
228VOID
231
232/* hardware.c */
233CODE_SEG("PAGE")
234UCHAR
236 _In_ PUCHAR ReadDataPort);
237
238_Requires_lock_held_(FdoExt->DeviceSyncEvent)
239CODE_SEG("PAGE")
241IsaHwFillDeviceList(
243
244CODE_SEG("PAGE")
248 _In_ PISAPNP_LOGICAL_DEVICE LogicalDevice,
250
251CODE_SEG("PAGE")
252VOID
254 _In_ PISAPNP_LOGICAL_DEVICE LogicalDevice);
255
256CODE_SEG("PAGE")
257VOID
259 _In_ PISAPNP_LOGICAL_DEVICE LogicalDevice);
260
261CODE_SEG("PAGE")
262VOID
265 _In_ PISAPNP_LOGICAL_DEVICE LogicalDevice);
266
267CODE_SEG("PAGE")
268VOID
270
271#ifdef __cplusplus
272}
273#endif
274
275#endif /* _ISAPNP_PCH_ */
#define CODE_SEG(...)
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
#define _Acquires_lock_(lock)
#define _Guarded_by_(lock)
#define _Requires_lock_held_(lock)
#define _Requires_lock_not_held_(lock)
#define _Releases_lock_(lock)
_In_ PIRP Irp
Definition: csq.h:116
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
Definition: env_spec_w32.h:478
#define KeSetEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:476
VOID IsaPnpRemoveLogicalDeviceDO(_In_ PDEVICE_OBJECT Pdo)
Definition: pdo.c:823
VOID IsaHwWakeDevice(_In_ PISAPNP_LOGICAL_DEVICE LogicalDevice)
Definition: hardware.c:1650
BOOLEAN FindDmaDescriptor(_In_ PISAPNP_LOGICAL_DEVICE LogDevice, _In_ ULONG Channel)
Definition: isapnp.c:535
NTSTATUS IsaFdoQueryInterface(_In_ PISAPNP_FDO_EXTENSION FdoExt, _In_ PIO_STACK_LOCATION IrpSp)
Definition: interface.c:19
BOOLEAN FindIrqDescriptor(_In_ PISAPNP_LOGICAL_DEVICE LogDevice, _In_ ULONG Vector)
Definition: isapnp.c:508
VOID IsaHwWaitForKey(VOID)
Definition: hardware.c:1684
struct _ISAPNP_FDO_EXTENSION ISAPNP_FDO_EXTENSION
ISAPNP_DEVICE_STATE
Definition: isapnp.h:29
@ dsStopped
Definition: isapnp.h:30
@ dsStarted
Definition: isapnp.h:31
struct _ISAPNP_FDO_EXTENSION * PISAPNP_FDO_EXTENSION
struct _ISAPNP_PDO_EXTENSION * PISAPNP_PDO_EXTENSION
DRIVER_INITIALIZE DriverEntry
Definition: isapnp.h:202
NTSTATUS IsaPnpFillDeviceRelations(_In_ PISAPNP_FDO_EXTENSION FdoExt, _Inout_ PIRP Irp, _In_ BOOLEAN IncludeDataPort)
Definition: isapnp.c:1054
VOID IsaHwDeactivateDevice(_In_ PISAPNP_LOGICAL_DEVICE LogicalDevice)
Definition: hardware.c:1673
_ISAPNP_SIGNATURE
Definition: isapnp.h:35
@ IsaPnpLogicalDevice
Definition: isapnp.h:37
@ IsaPnpBus
Definition: isapnp.h:36
@ IsaPnpReadDataPort
Definition: isapnp.h:38
struct _ISAPNP_PDO_EXTENSION ISAPNP_PDO_EXTENSION
struct _ISAPNP_COMMON_EXTENSION ISAPNP_COMMON_EXTENSION
VOID IsaPnpRemoveReadPortDO(_In_ PDEVICE_OBJECT Pdo)
Definition: isapnp.c:1042
UCHAR IsaHwTryReadDataPort(_In_ PUCHAR ReadDataPort)
Definition: hardware.c:1259
KEVENT BusSyncEvent
Definition: isapnp.c:21
PIO_RESOURCE_REQUIREMENTS_LIST IsaPnpCreateReadPortDORequirements(_In_opt_ ULONG SelectedReadPort)
Definition: isapnp.c:821
NTSTATUS IsaPdoPnp(_In_ PISAPNP_PDO_EXTENSION PdoDeviceExtension, _Inout_ PIRP Irp, _In_ PIO_STACK_LOCATION IrpSp)
Definition: pdo.c:867
NTSTATUS IsaFdoPnp(_In_ PISAPNP_FDO_EXTENSION FdoExt, _Inout_ PIRP Irp, _In_ PIO_STACK_LOCATION IrpSp)
Definition: fdo.c:123
struct _ISAPNP_COMMON_EXTENSION * PISAPNP_COMMON_EXTENSION
enum _ISAPNP_SIGNATURE ISAPNP_SIGNATURE
PCM_RESOURCE_LIST IsaPnpCreateReadPortDOResources(VOID)
Definition: isapnp.c:967
BOOLEAN FindIoDescriptor(_In_ PISAPNP_LOGICAL_DEVICE LogDevice, _In_opt_ ULONG Base, _In_ ULONG RangeStart, _In_ ULONG RangeEnd, _Out_opt_ PUCHAR Information, _Out_opt_ PULONG Length)
Definition: isapnp.c:459
BOOLEAN FindMemoryDescriptor(_In_ PISAPNP_LOGICAL_DEVICE LogDevice, _In_ ULONG RangeStart, _In_ ULONG RangeEnd, _Out_opt_ PUCHAR Information)
Definition: isapnp.c:562
NTSTATUS IsaHwConfigureDevice(_In_ PISAPNP_FDO_EXTENSION FdoExt, _In_ PISAPNP_LOGICAL_DEVICE LogicalDevice, _In_ PCM_RESOURCE_LIST Resources)
Definition: hardware.c:1517
VOID IsaHwActivateDevice(_In_ PISAPNP_FDO_EXTENSION FdoExt, _In_ PISAPNP_LOGICAL_DEVICE LogicalDevice)
Definition: hardware.c:1661
#define ASSERT(a)
Definition: mode.c:44
#define KernelMode
Definition: asm.h:34
_In_opt_ ULONG Base
Definition: rtlfuncs.h:2451
#define _Out_opt_
Definition: no_sal2.h:214
#define _Inout_
Definition: no_sal2.h:162
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
long LONG
Definition: pedump.c:60
PEPROCESS PsInitialSystemProcess
Definition: psmgr.c:50
ISAPNP_SIGNATURE Signature
Definition: isapnp.h:43
PDEVICE_OBJECT Self
Definition: isapnp.h:44
ISAPNP_DEVICE_STATE State
Definition: isapnp.h:45
PDRIVER_OBJECT DriverObject
Definition: isapnp.h:63
PUCHAR ReadDataPort
Definition: isapnp.h:64
LIST_ENTRY DeviceListHead
Definition: precomp.h:82
PDEVICE_OBJECT Pdo
Definition: isapnp.h:52
_Guarded_by_(DeviceSyncEvent) ULONG DeviceCount
LIST_ENTRY BusLink
Definition: isapnp.h:66
KEVENT DeviceSyncEvent
Definition: isapnp.h:55
ISAPNP_COMMON_EXTENSION Common
Definition: isapnp.h:50
PDEVICE_OBJECT Ldo
Definition: isapnp.h:51
_Guarded_by_(DeviceSyncEvent) LIST_ENTRY DeviceListHead
PDEVICE_OBJECT ReadPortPdo
Definition: isapnp.h:53
PCM_RESOURCE_LIST ResourceList
Definition: isapnp.h:89
ISAPNP_COMMON_EXTENSION Common
Definition: isapnp.h:71
PIO_RESOURCE_REQUIREMENTS_LIST RequirementsList
Definition: isapnp.h:87
ULONG ResourceListSize
Definition: isapnp.h:90
_Write_guarded_by_(_Global_interlock_) volatile LONG SpecialFiles
PISAPNP_LOGICAL_DEVICE IsaPnpDevice
Definition: isapnp.h:85
PISAPNP_FDO_EXTENSION FdoExt
Definition: isapnp.h:72
Definition: typedefs.h:120
uint32_t * PULONG
Definition: typedefs.h:59
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
WDF_EXTERN_C_START typedef _Must_inspect_result_ _In_ WDFDRIVER _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT Pdo
Definition: wdfminiport.h:72
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
Definition: wdfrequest.h:1049
#define FORCEINLINE
Definition: wdftypes.h:67
#define IO_NO_INCREMENT
Definition: iotypes.h:598
@ Executive
Definition: ketypes.h:415
#define PsGetCurrentProcess
Definition: psfuncs.h:17
unsigned char UCHAR
Definition: xmlstorage.h:181