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'
47 #define TAG_REQUEST_PACKET 'qRpV'
49 typedef struct _VIDEO_PORT_ADDRESS_MAPPING
54 PHYSICAL_ADDRESS IoAddress
;
55 ULONG SystemIoBusNumber
;
57 } VIDEO_PORT_ADDRESS_MAPPING
, *PVIDEO_PORT_ADDRESS_MAPPING
;
59 struct _VIDEO_PORT_AGP_VIRTUAL_MAPPING
;
61 typedef struct _VIDEO_PORT_AGP_MAPPING
65 PHYSICAL_ADDRESS PhysicalAddress
;
66 } VIDEO_PORT_AGP_MAPPING
, *PVIDEO_PORT_AGP_MAPPING
;
68 typedef struct _VIDEO_PORT_AGP_VIRTUAL_MAPPING
70 PVIDEO_PORT_AGP_MAPPING AgpMapping
;
73 } VIDEO_PORT_AGP_VIRTUAL_MAPPING
, *PVIDEO_PORT_AGP_VIRTUAL_MAPPING
;
75 typedef struct _VIDEO_PORT_DRIVER_EXTENSION
77 VIDEO_HW_INITIALIZATION_DATA InitializationData
;
79 UNICODE_STRING RegistryPath
;
80 } VIDEO_PORT_DRIVER_EXTENSION
, *PVIDEO_PORT_DRIVER_EXTENSION
;
82 typedef struct _VIDEO_PORT_COMMON_EXTENSION
85 } VIDEO_PORT_COMMON_EXTENSION
, *PVIDEO_PORT_COMMON_EXTENSION
;
87 typedef struct _VIDEO_PORT_DEVICE_EXTENSTION
89 VIDEO_PORT_COMMON_EXTENSION Common
;
91 PDRIVER_OBJECT DriverObject
;
92 PDEVICE_OBJECT PhysicalDeviceObject
;
93 PDEVICE_OBJECT FunctionalDeviceObject
;
94 PDEVICE_OBJECT NextDeviceObject
;
95 UNICODE_STRING RegistryPath
;
96 PKINTERRUPT InterruptObject
;
97 KSPIN_LOCK InterruptSpinLock
;
98 PCM_RESOURCE_LIST AllocatedResources
;
99 ULONG InterruptVector
;
100 ULONG InterruptLevel
;
101 BOOLEAN InterruptShared
;
102 INTERFACE_TYPE AdapterInterfaceType
;
103 ULONG SystemIoBusNumber
;
104 ULONG SystemIoSlotNumber
;
105 LIST_ENTRY AddressMappingListHead
;
107 VIDEO_PORT_DRIVER_EXTENSION
*DriverExtension
;
109 AGP_BUS_INTERFACE_STANDARD AgpInterface
;
111 LIST_ENTRY DmaAdapterList
, ChildDeviceList
;
112 CHAR MiniPortDeviceExtension
[1];
113 } VIDEO_PORT_DEVICE_EXTENSION
, *PVIDEO_PORT_DEVICE_EXTENSION
;
115 typedef struct _VIDEO_PORT_CHILD_EXTENSION
117 VIDEO_PORT_COMMON_EXTENSION Common
;
120 VIDEO_CHILD_TYPE ChildType
;
121 UCHAR ChildDescriptor
[256];
125 PDRIVER_OBJECT DriverObject
;
126 PDEVICE_OBJECT PhysicalDeviceObject
;
128 LIST_ENTRY ListEntry
;
130 CHAR ChildDeviceExtension
[1];
131 } VIDEO_PORT_CHILD_EXTENSION
, *PVIDEO_PORT_CHILD_EXTENSION
;
133 #define VIDEO_PORT_GET_CHILD_EXTENSION(MiniportExtension) \
136 VIDEO_PORT_CHILD_EXTENSION, \
137 ChildDeviceExtension)
139 #define VIDEO_PORT_GET_DEVICE_EXTENSION(MiniportExtension) \
142 VIDEO_PORT_DEVICE_EXTENSION, \
143 MiniPortDeviceExtension)
145 typedef struct _VIDEO_PORT_EVENT
148 } VIDEO_PORT_EVENT
, *PVIDEO_PORT_EVENT
;
154 PDEVICE_OBJECT DeviceObject
,
155 PIO_STATUS_BLOCK IoStatusBlock
,
157 PIO_STACK_LOCATION Stack OPTIONAL
);
161 IN PVOID HwDeviceExtension
,
162 IN OUT PINTERFACE Interface
);
167 IntVideoPortDispatchPdoPnp(
168 IN PDEVICE_OBJECT DeviceObject
,
174 IntVideoPortAddDevice(
175 IN PDRIVER_OBJECT DriverObject
,
176 IN PDEVICE_OBJECT PhysicalDeviceObject
);
179 IntVideoPortDispatchOpen(
180 IN PDEVICE_OBJECT DeviceObject
,
184 IntVideoPortDispatchClose(
185 IN PDEVICE_OBJECT DeviceObject
,
189 IntVideoPortDispatchCleanup(
190 IN PDEVICE_OBJECT DeviceObject
,
194 IntVideoPortDispatchDeviceControl(
195 IN PDEVICE_OBJECT DeviceObject
,
199 IntVideoPortDispatchPnp(
200 IN PDEVICE_OBJECT DeviceObject
,
204 IntVideoPortDispatchPower(
205 IN PDEVICE_OBJECT DeviceObject
,
209 IntVideoPortDispatchSystemControl(
210 IN PDEVICE_OBJECT DeviceObject
,
214 IntVideoPortDispatchWrite(
215 IN PDEVICE_OBJECT DeviceObject
,
219 IntVideoPortUnload(PDRIVER_OBJECT DriverObject
);
224 IntVideoPortSetupTimer(
225 IN PDEVICE_OBJECT DeviceObject
,
226 IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension
);
231 IntVideoPortSetupInterrupt(
232 IN PDEVICE_OBJECT DeviceObject
,
233 IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension
,
234 IN PVIDEO_PORT_CONFIG_INFO ConfigInfo
);
239 IntVideoPortFilterResourceRequirements(
240 IN PDEVICE_OBJECT DeviceObject
,
244 IntVideoPortMapPhysicalMemory(
246 IN PHYSICAL_ADDRESS PhysicalAddress
,
247 IN ULONG SizeInBytes
,
249 IN OUT PVOID
*VirtualAddress OPTIONAL
);
253 extern ULONG CsrssInitialized
;
254 extern PKPROCESS Csrss
;
255 extern ULONG VideoPortDeviceNumber
;
258 IntAttachToCSRSS(PKPROCESS
*CallingProcess
, PKAPC_STATE ApcState
);
261 IntDetachFromCSRSS(PKPROCESS
*CallingProcess
, PKAPC_STATE ApcState
);
264 IntVideoPortCreateAdapterDeviceObject(
265 IN PDRIVER_OBJECT DriverObject
,
266 IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension
,
267 IN PDEVICE_OBJECT PhysicalDeviceObject OPTIONAL
,
268 OUT PDEVICE_OBJECT
*DeviceObject OPTIONAL
);
271 IntVideoPortFindAdapter(
272 IN PDRIVER_OBJECT DriverObject
,
273 IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension
,
274 IN PDEVICE_OBJECT DeviceObject
);
277 IntVideoPortGetProcAddress(
278 IN PVOID HwDeviceExtension
,
279 IN PUCHAR FunctionName
);
284 IntInt10AllocateBuffer(
288 IN OUT PULONG Length
);
315 IN OUT PINT10_BIOS_ARGUMENTS BiosArguments
);
317 #endif /* VIDEOPRT_H */