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
33 #include <ndk/ntndk.h>
39 #define TAG_VIDEO_PORT 'PDIV'
40 #define TAG_VIDEO_PORT_BUFFER '\0mpV'
42 typedef struct _VIDEO_PORT_ADDRESS_MAPPING
47 PHYSICAL_ADDRESS IoAddress
;
48 ULONG SystemIoBusNumber
;
50 } VIDEO_PORT_ADDRESS_MAPPING
, *PVIDEO_PORT_ADDRESS_MAPPING
;
52 struct _VIDEO_PORT_AGP_VIRTUAL_MAPPING
;
54 typedef struct _VIDEO_PORT_AGP_MAPPING
58 PHYSICAL_ADDRESS PhysicalAddress
;
59 } VIDEO_PORT_AGP_MAPPING
, *PVIDEO_PORT_AGP_MAPPING
;
61 typedef struct _VIDEO_PORT_AGP_VIRTUAL_MAPPING
63 PVIDEO_PORT_AGP_MAPPING AgpMapping
;
66 } VIDEO_PORT_AGP_VIRTUAL_MAPPING
, *PVIDEO_PORT_AGP_VIRTUAL_MAPPING
;
68 typedef struct _VIDEO_PORT_DRIVER_EXTENSION
70 VIDEO_HW_INITIALIZATION_DATA InitializationData
;
72 UNICODE_STRING RegistryPath
;
73 } VIDEO_PORT_DRIVER_EXTENSION
, *PVIDEO_PORT_DRIVER_EXTENSION
;
75 typedef struct _VIDEO_PORT_DEVICE_EXTENSTION
78 PDRIVER_OBJECT DriverObject
;
79 PDEVICE_OBJECT PhysicalDeviceObject
;
80 PDEVICE_OBJECT FunctionalDeviceObject
;
81 PDEVICE_OBJECT NextDeviceObject
;
82 UNICODE_STRING RegistryPath
;
83 PKINTERRUPT InterruptObject
;
84 KSPIN_LOCK InterruptSpinLock
;
85 PCM_RESOURCE_LIST AllocatedResources
;
86 ULONG InterruptVector
;
88 BOOLEAN InterruptShared
;
89 INTERFACE_TYPE AdapterInterfaceType
;
90 ULONG SystemIoBusNumber
;
91 ULONG SystemIoSlotNumber
;
92 LIST_ENTRY AddressMappingListHead
;
94 VIDEO_PORT_DRIVER_EXTENSION
*DriverExtension
;
96 AGP_BUS_INTERFACE_STANDARD AgpInterface
;
98 LIST_ENTRY DmaAdapterList
;
99 CHAR MiniPortDeviceExtension
[1];
100 } VIDEO_PORT_DEVICE_EXTENSION
, *PVIDEO_PORT_DEVICE_EXTENSION
;
102 #define VIDEO_PORT_GET_DEVICE_EXTENSION(MiniportExtension) \
105 VIDEO_PORT_DEVICE_EXTENSION, \
106 MiniPortDeviceExtension)
108 typedef struct _VIDEO_PORT_EVENT
115 } VIDEO_PORT_EVENT
, *PVIDEO_PORT_EVENT
;
121 PDEVICE_OBJECT DeviceObject
,
122 PIO_STATUS_BLOCK IoStatusBlock
,
124 PIO_STACK_LOCATION Stack OPTIONAL
);
128 IN PVOID HwDeviceExtension
,
129 IN OUT PINTERFACE Interface
);
134 IntVideoPortAddDevice(
135 IN PDRIVER_OBJECT DriverObject
,
136 IN PDEVICE_OBJECT PhysicalDeviceObject
);
139 IntVideoPortDispatchOpen(
140 IN PDEVICE_OBJECT DeviceObject
,
144 IntVideoPortDispatchClose(
145 IN PDEVICE_OBJECT DeviceObject
,
149 IntVideoPortDispatchCleanup(
150 IN PDEVICE_OBJECT DeviceObject
,
154 IntVideoPortDispatchDeviceControl(
155 IN PDEVICE_OBJECT DeviceObject
,
159 IntVideoPortDispatchPnp(
160 IN PDEVICE_OBJECT DeviceObject
,
164 IntVideoPortDispatchPower(
165 IN PDEVICE_OBJECT DeviceObject
,
169 IntVideoPortDispatchSystemControl(
170 IN PDEVICE_OBJECT DeviceObject
,
174 IntVideoPortDispatchWrite(
175 IN PDEVICE_OBJECT DeviceObject
,
179 IntVideoPortUnload(PDRIVER_OBJECT DriverObject
);
184 IntVideoPortSetupTimer(
185 IN PDEVICE_OBJECT DeviceObject
,
186 IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension
);
191 IntVideoPortSetupInterrupt(
192 IN PDEVICE_OBJECT DeviceObject
,
193 IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension
,
194 IN PVIDEO_PORT_CONFIG_INFO ConfigInfo
);
199 IntVideoPortMapPhysicalMemory(
201 IN PHYSICAL_ADDRESS PhysicalAddress
,
202 IN ULONG SizeInBytes
,
204 IN OUT PVOID
*VirtualAddress OPTIONAL
);
208 extern ULONG CsrssInitialized
;
209 extern PKPROCESS Csrss
;
210 extern ULONG VideoPortDeviceNumber
;
213 IntAttachToCSRSS(PKPROCESS
*CallingProcess
, PKAPC_STATE ApcState
);
216 IntDetachFromCSRSS(PKPROCESS
*CallingProcess
, PKAPC_STATE ApcState
);
219 IntVideoPortCreateAdapterDeviceObject(
220 IN PDRIVER_OBJECT DriverObject
,
221 IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension
,
222 IN PDEVICE_OBJECT PhysicalDeviceObject OPTIONAL
,
223 OUT PDEVICE_OBJECT
*DeviceObject OPTIONAL
);
226 IntVideoPortFindAdapter(
227 IN PDRIVER_OBJECT DriverObject
,
228 IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension
,
229 IN PDEVICE_OBJECT DeviceObject
);
232 IntVideoPortGetProcAddress(
233 IN PVOID HwDeviceExtension
,
234 IN PUCHAR FunctionName
);
239 IntInt10AllocateBuffer(
243 IN OUT PULONG Length
);
270 IN OUT PINT10_BIOS_ARGUMENTS BiosArguments
);
272 #endif /* VIDEOPRT_H */