4 * Copyright (C) 2002, 2003, 2004 ReactOS Team
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
28 #include <ndk/exfuncs.h>
29 #include <ndk/halfuncs.h>
30 #include <ndk/inbvfuncs.h>
31 #include <ndk/kefuncs.h>
32 #include <ndk/rtlfuncs.h>
45 #define TAG_VIDEO_PORT 'PDIV'
46 #define TAG_VIDEO_PORT_BUFFER '\0mpV'
48 typedef struct _VIDEO_PORT_ADDRESS_MAPPING
53 PHYSICAL_ADDRESS IoAddress
;
54 ULONG SystemIoBusNumber
;
56 } VIDEO_PORT_ADDRESS_MAPPING
, *PVIDEO_PORT_ADDRESS_MAPPING
;
58 struct _VIDEO_PORT_AGP_VIRTUAL_MAPPING
;
60 typedef struct _VIDEO_PORT_AGP_MAPPING
64 PHYSICAL_ADDRESS PhysicalAddress
;
65 } VIDEO_PORT_AGP_MAPPING
, *PVIDEO_PORT_AGP_MAPPING
;
67 typedef struct _VIDEO_PORT_AGP_VIRTUAL_MAPPING
69 PVIDEO_PORT_AGP_MAPPING AgpMapping
;
72 } VIDEO_PORT_AGP_VIRTUAL_MAPPING
, *PVIDEO_PORT_AGP_VIRTUAL_MAPPING
;
74 typedef struct _VIDEO_PORT_DRIVER_EXTENSION
76 VIDEO_HW_INITIALIZATION_DATA InitializationData
;
78 UNICODE_STRING RegistryPath
;
79 } VIDEO_PORT_DRIVER_EXTENSION
, *PVIDEO_PORT_DRIVER_EXTENSION
;
81 typedef struct _VIDEO_PORT_COMMON_EXTENSION
84 } VIDEO_PORT_COMMON_EXTENSION
, *PVIDEO_PORT_COMMON_EXTENSION
;
86 typedef struct _VIDEO_PORT_DEVICE_EXTENSTION
88 VIDEO_PORT_COMMON_EXTENSION Common
;
90 PDRIVER_OBJECT DriverObject
;
91 PDEVICE_OBJECT PhysicalDeviceObject
;
92 PDEVICE_OBJECT FunctionalDeviceObject
;
93 PDEVICE_OBJECT NextDeviceObject
;
94 UNICODE_STRING RegistryPath
;
95 PKINTERRUPT InterruptObject
;
96 KSPIN_LOCK InterruptSpinLock
;
97 PCM_RESOURCE_LIST AllocatedResources
;
98 ULONG InterruptVector
;
100 BOOLEAN InterruptShared
;
101 INTERFACE_TYPE AdapterInterfaceType
;
102 ULONG SystemIoBusNumber
;
103 ULONG SystemIoSlotNumber
;
104 LIST_ENTRY AddressMappingListHead
;
106 VIDEO_PORT_DRIVER_EXTENSION
*DriverExtension
;
108 AGP_BUS_INTERFACE_STANDARD AgpInterface
;
110 LIST_ENTRY DmaAdapterList
, ChildDeviceList
;
111 CHAR MiniPortDeviceExtension
[1];
112 } VIDEO_PORT_DEVICE_EXTENSION
, *PVIDEO_PORT_DEVICE_EXTENSION
;
114 typedef struct _VIDEO_PORT_CHILD_EXTENSION
116 VIDEO_PORT_COMMON_EXTENSION Common
;
119 VIDEO_CHILD_TYPE ChildType
;
120 UCHAR ChildDescriptor
[256];
124 PDRIVER_OBJECT DriverObject
;
125 PDEVICE_OBJECT PhysicalDeviceObject
;
127 LIST_ENTRY ListEntry
;
129 CHAR ChildDeviceExtension
[1];
130 } VIDEO_PORT_CHILD_EXTENSION
, *PVIDEO_PORT_CHILD_EXTENSION
;
132 #define VIDEO_PORT_GET_CHILD_EXTENSION(MiniportExtension) \
135 VIDEO_PORT_CHILD_EXTENSION, \
136 ChildDeviceExtension)
138 #define VIDEO_PORT_GET_DEVICE_EXTENSION(MiniportExtension) \
141 VIDEO_PORT_DEVICE_EXTENSION, \
142 MiniPortDeviceExtension)
144 typedef struct _VIDEO_PORT_EVENT
147 } VIDEO_PORT_EVENT
, *PVIDEO_PORT_EVENT
;
153 PDEVICE_OBJECT DeviceObject
,
154 PIO_STATUS_BLOCK IoStatusBlock
,
156 PIO_STACK_LOCATION Stack OPTIONAL
);
160 IN PVOID HwDeviceExtension
,
161 IN OUT PINTERFACE Interface
);
166 IntVideoPortDispatchPdoPnp(
167 IN PDEVICE_OBJECT DeviceObject
,
173 IntVideoPortAddDevice(
174 IN PDRIVER_OBJECT DriverObject
,
175 IN PDEVICE_OBJECT PhysicalDeviceObject
);
178 IntVideoPortDispatchOpen(
179 IN PDEVICE_OBJECT DeviceObject
,
183 IntVideoPortDispatchClose(
184 IN PDEVICE_OBJECT DeviceObject
,
188 IntVideoPortDispatchCleanup(
189 IN PDEVICE_OBJECT DeviceObject
,
193 IntVideoPortDispatchDeviceControl(
194 IN PDEVICE_OBJECT DeviceObject
,
198 IntVideoPortDispatchPnp(
199 IN PDEVICE_OBJECT DeviceObject
,
203 IntVideoPortDispatchPower(
204 IN PDEVICE_OBJECT DeviceObject
,
208 IntVideoPortDispatchSystemControl(
209 IN PDEVICE_OBJECT DeviceObject
,
213 IntVideoPortDispatchWrite(
214 IN PDEVICE_OBJECT DeviceObject
,
218 IntVideoPortUnload(PDRIVER_OBJECT DriverObject
);
223 IntVideoPortSetupTimer(
224 IN PDEVICE_OBJECT DeviceObject
,
225 IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension
);
230 IntVideoPortSetupInterrupt(
231 IN PDEVICE_OBJECT DeviceObject
,
232 IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension
,
233 IN PVIDEO_PORT_CONFIG_INFO ConfigInfo
);
238 IntVideoPortFilterResourceRequirements(
239 IN PDEVICE_OBJECT DeviceObject
,
243 IntVideoPortMapPhysicalMemory(
245 IN PHYSICAL_ADDRESS PhysicalAddress
,
246 IN ULONG SizeInBytes
,
248 IN OUT PVOID
*VirtualAddress OPTIONAL
);
252 extern ULONG CsrssInitialized
;
253 extern PKPROCESS Csrss
;
254 extern ULONG VideoPortDeviceNumber
;
257 IntAttachToCSRSS(PKPROCESS
*CallingProcess
, PKAPC_STATE ApcState
);
260 IntDetachFromCSRSS(PKPROCESS
*CallingProcess
, PKAPC_STATE ApcState
);
263 IntVideoPortCreateAdapterDeviceObject(
264 IN PDRIVER_OBJECT DriverObject
,
265 IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension
,
266 IN PDEVICE_OBJECT PhysicalDeviceObject OPTIONAL
,
267 OUT PDEVICE_OBJECT
*DeviceObject OPTIONAL
);
270 IntVideoPortFindAdapter(
271 IN PDRIVER_OBJECT DriverObject
,
272 IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension
,
273 IN PDEVICE_OBJECT DeviceObject
);
276 IntVideoPortGetProcAddress(
277 IN PVOID HwDeviceExtension
,
278 IN PUCHAR FunctionName
);
283 IntInt10AllocateBuffer(
287 IN OUT PULONG Length
);
314 IN OUT PINT10_BIOS_ARGUMENTS BiosArguments
);
316 #endif /* VIDEOPRT_H */