Add config interface start (PciReadWriteConfigSpace, PciReadSlotConfig)
[reactos.git] / reactos / drivers / bus / pcix / pci.h
1 /*
2 * PROJECT: ReactOS PCI Bus Driver
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: drivers/bus/pci/pci.h
5 * PURPOSE: Main Header File
6 * PROGRAMMERS: ReactOS Portable Systems Group
7 */
8
9 #include <initguid.h>
10 #include <ntifs.h>
11 #include <ntagp.h>
12 #include <wdmguid.h>
13 #include <wchar.h>
14 #include <acpiioct.h>
15 #include <drivers/pci/pci.h>
16 #include <drivers/acpi/acpi.h>
17 #include "halfuncs.h"
18 #include "rtlfuncs.h"
19 #include "vffuncs.h"
20 #include "bugcodes.h"
21
22 //
23 // Tag used in all pool allocations (Pci Bus)
24 //
25 #define PCI_POOL_TAG 'BicP'
26
27 //
28 // Checks if the specified FDO is the FDO for the Root PCI Bus
29 //
30 #define PCI_IS_ROOT_FDO(x) ((x)->BusRootFdoExtension == x)
31
32 //
33 // Assertions to make sure we are dealing with the right kind of extension
34 //
35 #define ASSERT_FDO(x) ASSERT((x)->ExtensionType == PciFdoExtensionType);
36 #define ASSERT_PDO(x) ASSERT((x)->ExtensionType == PciPdoExtensionType);
37
38 //
39 // PCI Hack Entry Name Lengths
40 //
41 #define PCI_HACK_ENTRY_SIZE sizeof(L"VVVVdddd") - sizeof(UNICODE_NULL)
42 #define PCI_HACK_ENTRY_REV_SIZE sizeof(L"VVVVddddRR") - sizeof(UNICODE_NULL)
43 #define PCI_HACK_ENTRY_SUBSYS_SIZE sizeof(L"VVVVddddssssIIII") - sizeof(UNICODE_NULL)
44 #define PCI_HACK_ENTRY_FULL_SIZE sizeof(L"VVVVddddssssIIIIRR") - sizeof(UNICODE_NULL)
45
46 //
47 // PCI Hack Entry Flags
48 //
49 #define PCI_HACK_HAS_REVISION_INFO 0x01
50 #define PCI_HACK_HAS_SUBSYSTEM_INFO 0x02
51
52 //
53 // PCI Interface Flags
54 //
55 #define PCI_INTERFACE_PDO 0x01
56 #define PCI_INTERFACE_FDO 0x02
57 #define PCI_INTERFACE_ROOT 0x04
58
59 //
60 // Device Extension, Interface, Translator and Arbiter Signatures
61 //
62 typedef enum _PCI_SIGNATURE
63 {
64 PciPdoExtensionType = 'icP0',
65 PciFdoExtensionType = 'icP1',
66 PciArb_Io = 'icP2',
67 PciArb_Memory = 'icP3',
68 PciArb_Interrupt = 'icP4',
69 PciArb_BusNumber = 'icP5',
70 PciTrans_Interrupt = 'icP6',
71 PciInterface_BusHandler = 'icP7',
72 PciInterface_IntRouteHandler = 'icP8',
73 PciInterface_PciCb = 'icP9',
74 PciInterface_LegacyDeviceDetection = 'icP:',
75 PciInterface_PmeHandler = 'icP;',
76 PciInterface_DevicePresent = 'icP<',
77 PciInterface_NativeIde = 'icP=',
78 PciInterface_AgpTarget = 'icP>',
79 PciInterface_Location = 'icP?'
80 } PCI_SIGNATURE, *PPCI_SIGNATURE;
81
82 //
83 // Device Extension Logic States
84 //
85 typedef enum _PCI_STATE
86 {
87 PciNotStarted,
88 PciStarted,
89 PciDeleted,
90 PciStopped,
91 PciSurpriseRemoved,
92 PciSynchronizedOperation,
93 PciMaxObjectState
94 } PCI_STATE;
95
96 //
97 // IRP Dispatch Logic Style
98 //
99 typedef enum _PCI_DISPATCH_STYLE
100 {
101 IRP_COMPLETE,
102 IRP_DOWNWARD,
103 IRP_UPWARD,
104 IRP_DISPATCH,
105 } PCI_DISPATCH_STYLE;
106
107 //
108 // PCI Hack Entry Information
109 //
110 typedef struct _PCI_HACK_ENTRY
111 {
112 USHORT VendorID;
113 USHORT DeviceID;
114 USHORT SubVendorID;
115 USHORT SubSystemID;
116 ULONGLONG HackFlags;
117 USHORT RevisionID;
118 UCHAR Flags;
119 } PCI_HACK_ENTRY, *PPCI_HACK_ENTRY;
120
121 //
122 // Power State Information for Device Extension
123 //
124 typedef struct _PCI_POWER_STATE
125 {
126 SYSTEM_POWER_STATE CurrentSystemState;
127 DEVICE_POWER_STATE CurrentDeviceState;
128 SYSTEM_POWER_STATE SystemWakeLevel;
129 DEVICE_POWER_STATE DeviceWakeLevel;
130 DEVICE_POWER_STATE SystemStateMapping[7];
131 PIRP WaitWakeIrp;
132 PVOID SavedCancelRoutine;
133 LONG Paging;
134 LONG Hibernate;
135 LONG CrashDump;
136 } PCI_POWER_STATE, *PPCI_POWER_STATE;
137
138 //
139 // Internal PCI Lock Structure
140 //
141 typedef struct _PCI_LOCK
142 {
143 LONG Atom;
144 BOOLEAN OldIrql;
145 } PCI_LOCK, *PPCI_LOCK;
146
147 //
148 // Device Extension for a Bus FDO
149 //
150 typedef struct _PCI_FDO_EXTENSION
151 {
152 SINGLE_LIST_ENTRY List;
153 ULONG ExtensionType;
154 struct _PCI_MJ_DISPATCH_TABLE *IrpDispatchTable;
155 BOOLEAN DeviceState;
156 BOOLEAN TentativeNextState;
157 KEVENT SecondaryExtLock;
158 PDEVICE_OBJECT PhysicalDeviceObject;
159 PDEVICE_OBJECT FunctionalDeviceObject;
160 PDEVICE_OBJECT AttachedDeviceObject;
161 KEVENT ChildListLock;
162 struct _PCI_PDO_EXTENSION *ChildPdoList;
163 struct _PCI_FDO_EXTENSION *BusRootFdoExtension;
164 struct _PCI_FDO_EXTENSION *ParentFdoExtension;
165 struct _PCI_PDO_EXTENSION *ChildBridgePdoList;
166 PPCI_BUS_INTERFACE_STANDARD PciBusInterface;
167 BOOLEAN MaxSubordinateBus;
168 BUS_HANDLER *BusHandler;
169 BOOLEAN BaseBus;
170 BOOLEAN Fake;
171 BOOLEAN ChildDelete;
172 BOOLEAN Scanned;
173 BOOLEAN ArbitersInitialized;
174 BOOLEAN BrokenVideoHackApplied;
175 BOOLEAN Hibernated;
176 PCI_POWER_STATE PowerState;
177 SINGLE_LIST_ENTRY SecondaryExtension;
178 LONG ChildWaitWakeCount;
179 PPCI_COMMON_CONFIG PreservedConfig;
180 PCI_LOCK Lock;
181 struct
182 {
183 BOOLEAN Acquired;
184 BOOLEAN CacheLineSize;
185 BOOLEAN LatencyTimer;
186 BOOLEAN EnablePERR;
187 BOOLEAN EnableSERR;
188 } HotPlugParameters;
189 LONG BusHackFlags;
190 } PCI_FDO_EXTENSION, *PPCI_FDO_EXTENSION;
191
192 typedef struct _PCI_FUNCTION_RESOURCES
193 {
194 IO_RESOURCE_DESCRIPTOR Limit[7];
195 CM_PARTIAL_RESOURCE_DESCRIPTOR Current[7];
196 } PCI_FUNCTION_RESOURCES, *PPCI_FUNCTION_RESOURCES;
197
198 typedef union _PCI_HEADER_TYPE_DEPENDENT
199 {
200 struct
201 {
202 UCHAR Spare[4];
203 } type0;
204 struct
205 {
206 UCHAR PrimaryBus;
207 UCHAR SecondaryBus;
208 UCHAR SubordinateBus;
209 UCHAR SubtractiveDecode:1;
210 UCHAR IsaBitSet:1;
211 UCHAR VgaBitSet:1;
212 UCHAR WeChangedBusNumbers:1;
213 UCHAR IsaBitRequired:1;
214 } type1;
215 struct
216 {
217 UCHAR Spare[4];
218 } type2;
219 } PCI_HEADER_TYPE_DEPENDENT, *PPCI_HEADER_TYPE_DEPENDENT;
220
221 typedef struct _PCI_PDO_EXTENSION
222 {
223 PVOID Next;
224 ULONG ExtensionType;
225 struct _PCI_MJ_DISPATCH_TABLE *IrpDispatchTable;
226 BOOLEAN DeviceState;
227 BOOLEAN TentativeNextState;
228
229 KEVENT SecondaryExtLock;
230 PCI_SLOT_NUMBER Slot;
231 PDEVICE_OBJECT PhysicalDeviceObject;
232 PPCI_FDO_EXTENSION ParentFdoExtension;
233 SINGLE_LIST_ENTRY SecondaryExtension;
234 LONG BusInterfaceReferenceCount;
235 LONG AgpInterfaceReferenceCount;
236 USHORT VendorId;
237 USHORT DeviceId;
238 USHORT SubsystemVendorId;
239 USHORT SubsystemId;
240 BOOLEAN RevisionId;
241 BOOLEAN ProgIf;
242 BOOLEAN SubClass;
243 BOOLEAN BaseClass;
244 BOOLEAN AdditionalResourceCount;
245 BOOLEAN AdjustedInterruptLine;
246 BOOLEAN InterruptPin;
247 BOOLEAN RawInterruptLine;
248 BOOLEAN CapabilitiesPtr;
249 BOOLEAN SavedLatencyTimer;
250 BOOLEAN SavedCacheLineSize;
251 BOOLEAN HeaderType;
252 BOOLEAN NotPresent;
253 BOOLEAN ReportedMissing;
254 BOOLEAN ExpectedWritebackFailure;
255 BOOLEAN NoTouchPmeEnable;
256 BOOLEAN LegacyDriver;
257 BOOLEAN UpdateHardware;
258 BOOLEAN MovedDevice;
259 BOOLEAN DisablePowerDown;
260 BOOLEAN NeedsHotPlugConfiguration;
261 BOOLEAN SwitchedIDEToNativeMode;
262 BOOLEAN BIOSAllowsIDESwitchToNativeMode;
263 BOOLEAN IoSpaceUnderNativeIdeControl;
264 BOOLEAN OnDebugPath;
265 PCI_POWER_STATE PowerState;
266 PCI_HEADER_TYPE_DEPENDENT Dependent;
267 ULONGLONG HackFlags;
268 PCI_FUNCTION_RESOURCES *Resources;
269 PCI_FDO_EXTENSION *BridgeFdoExtension;
270 struct _PCI_PDO_EXTENSION *NextBridge;
271 struct _PCI_PDO_EXTENSION *NextHashEntry;
272 PCI_LOCK Lock;
273 PCI_PMC PowerCapabilities;
274 BOOLEAN TargetAgpCapabilityId;
275 USHORT CommandEnables;
276 USHORT InitialCommand;
277 } PCI_PDO_EXTENSION, *PPCI_PDO_EXTENSION;
278
279 //
280 // IRP Dispatch Function Type
281 //
282 typedef NTSTATUS (NTAPI *PCI_DISPATCH_FUNCTION)(
283 IN PIRP Irp,
284 IN PIO_STACK_LOCATION IoStackLocation,
285 IN PPCI_FDO_EXTENSION DeviceExtension
286 );
287
288 //
289 // IRP Dispatch Minor Table
290 //
291 typedef struct _PCI_MN_DISPATCH_TABLE
292 {
293 PCI_DISPATCH_STYLE DispatchStyle;
294 PCI_DISPATCH_FUNCTION DispatchFunction;
295 } PCI_MN_DISPATCH_TABLE, *PPCI_MN_DISPATCH_TABLE;
296
297 //
298 // IRP Dispatch Major Table
299 //
300 typedef struct _PCI_MJ_DISPATCH_TABLE
301 {
302 ULONG PnpIrpMaximumMinorFunction;
303 PPCI_MN_DISPATCH_TABLE PnpIrpDispatchTable;
304 ULONG PowerIrpMaximumMinorFunction;
305 PPCI_MN_DISPATCH_TABLE PowerIrpDispatchTable;
306 PCI_DISPATCH_STYLE SystemControlIrpDispatchStyle;
307 PCI_DISPATCH_FUNCTION SystemControlIrpDispatchFunction;
308 PCI_DISPATCH_STYLE OtherIrpDispatchStyle;
309 PCI_DISPATCH_FUNCTION OtherIrpDispatchFunction;
310 } PCI_MJ_DISPATCH_TABLE, *PPCI_MJ_DISPATCH_TABLE;
311
312 //
313 // Generic PCI Interface Constructor and Initializer
314 //
315 struct _PCI_INTERFACE;
316 typedef NTSTATUS (NTAPI *PCI_INTERFACE_CONSTRUCTOR)(
317 IN PVOID DeviceExtension,
318 IN PVOID Instance,
319 IN PVOID InterfaceData,
320 IN USHORT Version,
321 IN USHORT Size,
322 IN PINTERFACE Interface
323 );
324
325 typedef NTSTATUS (NTAPI *PCI_INTERFACE_INITIALIZER)(
326 IN PVOID Instance
327 );
328
329 //
330 // Generic PCI Interface (Interface, Translator, Arbiter)
331 //
332 typedef struct _PCI_INTERFACE
333 {
334 CONST GUID *InterfaceType;
335 USHORT MinSize;
336 USHORT MinVersion;
337 USHORT MaxVersion;
338 USHORT Flags;
339 LONG ReferenceCount;
340 PCI_SIGNATURE Signature;
341 PCI_INTERFACE_CONSTRUCTOR Constructor;
342 PCI_INTERFACE_INITIALIZER Initializer;
343 } PCI_INTERFACE, *PPCI_INTERFACE;
344
345 //
346 // Generic Secondary Extension Instance Header (Interface, Translator, Arbiter)
347 //
348 typedef struct PCI_SECONDARY_EXTENSION
349 {
350 SINGLE_LIST_ENTRY List;
351 PCI_SIGNATURE ExtensionType;
352 PVOID Destructor;
353 } PCI_SECONDARY_EXTENSION, *PPCI_SECONDARY_EXTENSION;
354
355 //
356 // PCI Arbiter Instance
357 //
358 typedef struct PCI_ARBITER_INSTANCE
359 {
360 PCI_SECONDARY_EXTENSION Header;
361 PPCI_INTERFACE Interface;
362 PPCI_FDO_EXTENSION BusFdoExtension;
363 WCHAR InstanceName[24];
364 //ARBITER_INSTANCE CommonInstance; FIXME: Need Arbiter Headers
365 } PCI_ARBITER_INSTANCE, *PPCI_ARBITER_INSTANCE;
366
367 //
368 // IRP Dispatch Routines
369 //
370 NTSTATUS
371 NTAPI
372 PciDispatchIrp(
373 IN PDEVICE_OBJECT DeviceObject,
374 IN PIRP Irp
375 );
376
377 NTSTATUS
378 NTAPI
379 PciIrpNotSupported(
380 IN PIRP Irp,
381 IN PIO_STACK_LOCATION IoStackLocation,
382 IN PPCI_FDO_EXTENSION DeviceExtension
383 );
384
385 NTSTATUS
386 NTAPI
387 PciPassIrpFromFdoToPdo(
388 IN PPCI_FDO_EXTENSION DeviceExtension,
389 IN PIRP Irp
390 );
391
392 NTSTATUS
393 NTAPI
394 PciCallDownIrpStack(
395 IN PPCI_FDO_EXTENSION DeviceExtension,
396 IN PIRP Irp
397 );
398
399 //
400 // Power Routines
401 //
402 NTSTATUS
403 NTAPI
404 PciFdoWaitWake(
405 IN PIRP Irp,
406 IN PIO_STACK_LOCATION IoStackLocation,
407 IN PPCI_FDO_EXTENSION DeviceExtension
408 );
409
410 NTSTATUS
411 NTAPI
412 PciFdoSetPowerState(
413 IN PIRP Irp,
414 IN PIO_STACK_LOCATION IoStackLocation,
415 IN PPCI_FDO_EXTENSION DeviceExtension
416 );
417
418 NTSTATUS
419 NTAPI
420 PciFdoIrpQueryPower(
421 IN PIRP Irp,
422 IN PIO_STACK_LOCATION IoStackLocation,
423 IN PPCI_FDO_EXTENSION DeviceExtension
424 );
425
426 //
427 // Bus FDO Routines
428 //
429 NTSTATUS
430 NTAPI
431 PciAddDevice(
432 IN PDRIVER_OBJECT DriverObject,
433 IN PDEVICE_OBJECT PhysicalDeviceObject
434 );
435
436 NTSTATUS
437 NTAPI
438 PciFdoIrpStartDevice(
439 IN PIRP Irp,
440 IN PIO_STACK_LOCATION IoStackLocation,
441 IN PPCI_FDO_EXTENSION DeviceExtension
442 );
443
444 NTSTATUS
445 NTAPI
446 PciFdoIrpQueryRemoveDevice(
447 IN PIRP Irp,
448 IN PIO_STACK_LOCATION IoStackLocation,
449 IN PPCI_FDO_EXTENSION DeviceExtension
450 );
451
452 NTSTATUS
453 NTAPI
454 PciFdoIrpRemoveDevice(
455 IN PIRP Irp,
456 IN PIO_STACK_LOCATION IoStackLocation,
457 IN PPCI_FDO_EXTENSION DeviceExtension
458 );
459
460 NTSTATUS
461 NTAPI
462 PciFdoIrpCancelRemoveDevice(
463 IN PIRP Irp,
464 IN PIO_STACK_LOCATION IoStackLocation,
465 IN PPCI_FDO_EXTENSION DeviceExtension
466 );
467
468 NTSTATUS
469 NTAPI
470 PciFdoIrpStopDevice(
471 IN PIRP Irp,
472 IN PIO_STACK_LOCATION IoStackLocation,
473 IN PPCI_FDO_EXTENSION DeviceExtension
474 );
475
476 NTSTATUS
477 NTAPI
478 PciFdoIrpQueryStopDevice(
479 IN PIRP Irp,
480 IN PIO_STACK_LOCATION IoStackLocation,
481 IN PPCI_FDO_EXTENSION DeviceExtension
482 );
483
484 NTSTATUS
485 NTAPI
486 PciFdoIrpCancelStopDevice(
487 IN PIRP Irp,
488 IN PIO_STACK_LOCATION IoStackLocation,
489 IN PPCI_FDO_EXTENSION DeviceExtension
490 );
491
492 NTSTATUS
493 NTAPI
494 PciFdoIrpQueryDeviceRelations(
495 IN PIRP Irp,
496 IN PIO_STACK_LOCATION IoStackLocation,
497 IN PPCI_FDO_EXTENSION DeviceExtension
498 );
499
500 NTSTATUS
501 NTAPI
502 PciFdoIrpQueryInterface(
503 IN PIRP Irp,
504 IN PIO_STACK_LOCATION IoStackLocation,
505 IN PPCI_FDO_EXTENSION DeviceExtension
506 );
507
508 NTSTATUS
509 NTAPI
510 PciFdoIrpQueryCapabilities(
511 IN PIRP Irp,
512 IN PIO_STACK_LOCATION IoStackLocation,
513 IN PPCI_FDO_EXTENSION DeviceExtension
514 );
515
516 NTSTATUS
517 NTAPI
518 PciFdoIrpDeviceUsageNotification(
519 IN PIRP Irp,
520 IN PIO_STACK_LOCATION IoStackLocation,
521 IN PPCI_FDO_EXTENSION DeviceExtension
522 );
523
524 NTSTATUS
525 NTAPI
526 PciFdoIrpSurpriseRemoval(
527 IN PIRP Irp,
528 IN PIO_STACK_LOCATION IoStackLocation,
529 IN PPCI_FDO_EXTENSION DeviceExtension
530 );
531
532 NTSTATUS
533 NTAPI
534 PciFdoIrpQueryLegacyBusInformation(
535 IN PIRP Irp,
536 IN PIO_STACK_LOCATION IoStackLocation,
537 IN PPCI_FDO_EXTENSION DeviceExtension
538 );
539
540 //
541 // HAL Callback/Hook Routines
542 //
543 VOID
544 NTAPI
545 PciHookHal(
546 VOID
547 );
548
549 //
550 // PCI Verifier Routines
551 //
552 VOID
553 NTAPI
554 PciVerifierInit(
555 IN PDRIVER_OBJECT DriverObject
556 );
557
558 //
559 // Utility Routines
560 //
561 BOOLEAN
562 NTAPI
563 PciStringToUSHORT(
564 IN PWCHAR String,
565 OUT PUSHORT Value
566 );
567
568 BOOLEAN
569 NTAPI
570 PciIsDatacenter(
571 VOID
572 );
573
574 NTSTATUS
575 NTAPI
576 PciBuildDefaultExclusionLists(
577 VOID
578 );
579
580 BOOLEAN
581 NTAPI
582 PciUnicodeStringStrStr(
583 IN PUNICODE_STRING InputString,
584 IN PCUNICODE_STRING EqualString,
585 IN BOOLEAN CaseInSensitive
586 );
587
588 BOOLEAN
589 NTAPI
590 PciOpenKey(
591 IN PWCHAR KeyName,
592 IN HANDLE RootKey,
593 IN ACCESS_MASK DesiredAccess,
594 OUT PHANDLE KeyHandle,
595 OUT PNTSTATUS KeyStatus
596 );
597
598 NTSTATUS
599 NTAPI
600 PciGetRegistryValue(
601 IN PWCHAR ValueName,
602 IN PWCHAR KeyName,
603 IN HANDLE RootHandle,
604 IN ULONG Type,
605 OUT PVOID *OutputBuffer,
606 OUT PULONG OutputLength
607 );
608
609 PPCI_FDO_EXTENSION
610 NTAPI
611 PciFindParentPciFdoExtension(
612 IN PDEVICE_OBJECT DeviceObject,
613 IN PKEVENT Lock
614 );
615
616 VOID
617 NTAPI
618 PciInsertEntryAtTail(
619 IN PSINGLE_LIST_ENTRY ListHead,
620 IN PPCI_FDO_EXTENSION DeviceExtension,
621 IN PKEVENT Lock
622 );
623
624 NTSTATUS
625 NTAPI
626 PciGetDeviceProperty(
627 IN PDEVICE_OBJECT DeviceObject,
628 IN DEVICE_REGISTRY_PROPERTY DeviceProperty,
629 OUT PVOID *OutputBuffer
630 );
631
632 NTSTATUS
633 NTAPI
634 PciSendIoctl(
635 IN PDEVICE_OBJECT DeviceObject,
636 IN ULONG IoControlCode,
637 IN PVOID InputBuffer,
638 IN ULONG InputBufferLength,
639 IN PVOID OutputBuffer,
640 IN ULONG OutputBufferLength
641 );
642
643 VOID
644 NTAPI
645 PcipLinkSecondaryExtension(
646 IN PSINGLE_LIST_ENTRY List,
647 IN PVOID Lock,
648 IN PPCI_SECONDARY_EXTENSION SecondaryExtension,
649 IN PCI_SIGNATURE ExtensionType,
650 IN PVOID Destructor
651 );
652
653 PPCI_SECONDARY_EXTENSION
654 NTAPI
655 PciFindNextSecondaryExtension(
656 IN PSINGLE_LIST_ENTRY ListHead,
657 IN PCI_SIGNATURE ExtensionType
658 );
659
660 //
661 // Configuration Routines
662 //
663 NTSTATUS
664 NTAPI
665 PciGetConfigHandlers(
666 IN PPCI_FDO_EXTENSION FdoExtension
667 );
668
669 VOID
670 NTAPI
671 PciReadSlotConfig(
672 IN PPCI_FDO_EXTENSION DeviceExtension,
673 IN PCI_SLOT_NUMBER Slot,
674 IN PVOID Buffer,
675 IN ULONG Offset,
676 IN ULONG Length
677 );
678
679 //
680 // State Machine Logic Transition Routines
681 //
682 VOID
683 NTAPI
684 PciInitializeState(
685 IN PPCI_FDO_EXTENSION DeviceExtension
686 );
687
688 NTSTATUS
689 NTAPI
690 PciBeginStateTransition(
691 IN PPCI_FDO_EXTENSION DeviceExtension,
692 IN PCI_STATE NewState
693 );
694
695 NTSTATUS
696 NTAPI
697 PciCancelStateTransition(
698 IN PPCI_FDO_EXTENSION DeviceExtension,
699 IN PCI_STATE NewState
700 );
701
702 VOID
703 NTAPI
704 PciCommitStateTransition(
705 IN PPCI_FDO_EXTENSION DeviceExtension,
706 IN PCI_STATE NewState
707 );
708
709
710 //
711 // Arbiter Support
712 //
713 NTSTATUS
714 NTAPI
715 PciInitializeArbiters(
716 IN PPCI_FDO_EXTENSION FdoExtension
717 );
718
719 NTSTATUS
720 NTAPI
721 PciInitializeArbiterRanges(
722 IN PPCI_FDO_EXTENSION DeviceExtension,
723 IN PCM_RESOURCE_LIST Resources
724 );
725
726 //
727 // Debug Helpers
728 //
729 BOOLEAN
730 NTAPI
731 PciDebugIrpDispatchDisplay(
732 IN PIO_STACK_LOCATION IoStackLocation,
733 IN PPCI_FDO_EXTENSION DeviceExtension,
734 IN USHORT MaxMinor
735 );
736
737 VOID
738 NTAPI
739 PciDebugDumpCommonConfig(
740 IN PPCI_COMMON_HEADER PciData
741 );
742
743 //
744 // Interface Support
745 //
746 NTSTATUS
747 NTAPI
748 PciQueryInterface(
749 IN PPCI_FDO_EXTENSION DeviceExtension,
750 IN CONST GUID* InterfaceType,
751 IN ULONG Size,
752 IN ULONG Version,
753 IN PVOID InterfaceData,
754 IN PINTERFACE Interface,
755 IN BOOLEAN LastChance
756 );
757
758 NTSTATUS
759 NTAPI
760 PciPmeInterfaceInitializer(
761 IN PVOID Instance
762 );
763
764 NTSTATUS
765 NTAPI
766 routeintrf_Initializer(
767 IN PVOID Instance
768 );
769
770 NTSTATUS
771 NTAPI
772 arbusno_Initializer(
773 IN PVOID Instance
774 );
775
776 NTSTATUS
777 NTAPI
778 agpintrf_Initializer(
779 IN PVOID Instance
780 );
781
782 NTSTATUS
783 NTAPI
784 tranirq_Initializer(
785 IN PVOID Instance
786 );
787
788 NTSTATUS
789 NTAPI
790 busintrf_Initializer(
791 IN PVOID Instance
792 );
793
794 NTSTATUS
795 NTAPI
796 armem_Initializer(
797 IN PVOID Instance
798 );
799
800 NTSTATUS
801 NTAPI
802 ario_Initializer(
803 IN PVOID Instance
804 );
805
806 NTSTATUS
807 NTAPI
808 locintrf_Initializer(
809 IN PVOID Instance
810 );
811
812 NTSTATUS
813 NTAPI
814 pcicbintrf_Initializer(
815 IN PVOID Instance
816 );
817
818 NTSTATUS
819 NTAPI
820 lddintrf_Initializer(
821 IN PVOID Instance
822 );
823
824 NTSTATUS
825 NTAPI
826 devpresent_Initializer(
827 IN PVOID Instance
828 );
829
830 NTSTATUS
831 NTAPI
832 agpintrf_Constructor(
833 IN PVOID DeviceExtension,
834 IN PVOID Instance,
835 IN PVOID InterfaceData,
836 IN USHORT Version,
837 IN USHORT Size,
838 IN PINTERFACE Interface
839 );
840
841 NTSTATUS
842 NTAPI
843 arbusno_Constructor(
844 IN PVOID DeviceExtension,
845 IN PVOID Instance,
846 IN PVOID InterfaceData,
847 IN USHORT Version,
848 IN USHORT Size,
849 IN PINTERFACE Interface
850 );
851
852 NTSTATUS
853 NTAPI
854 tranirq_Constructor(
855 IN PVOID DeviceExtension,
856 IN PVOID Instance,
857 IN PVOID InterfaceData,
858 IN USHORT Version,
859 IN USHORT Size,
860 IN PINTERFACE Interface
861 );
862
863 NTSTATUS
864 NTAPI
865 armem_Constructor(
866 IN PVOID DeviceExtension,
867 IN PVOID Instance,
868 IN PVOID InterfaceData,
869 IN USHORT Version,
870 IN USHORT Size,
871 IN PINTERFACE Interface
872 );
873
874 NTSTATUS
875 NTAPI
876 busintrf_Constructor(
877 IN PVOID DeviceExtension,
878 IN PVOID Instance,
879 IN PVOID InterfaceData,
880 IN USHORT Version,
881 IN USHORT Size,
882 IN PINTERFACE Interface
883 );
884
885 NTSTATUS
886 NTAPI
887 ario_Constructor(
888 IN PVOID DeviceExtension,
889 IN PVOID Instance,
890 IN PVOID InterfaceData,
891 IN USHORT Version,
892 IN USHORT Size,
893 IN PINTERFACE Interface
894 );
895
896 NTSTATUS
897 NTAPI
898 pcicbintrf_Constructor(
899 IN PVOID DeviceExtension,
900 IN PVOID Instance,
901 IN PVOID InterfaceData,
902 IN USHORT Version,
903 IN USHORT Size,
904 IN PINTERFACE Interface
905 );
906
907 NTSTATUS
908 NTAPI
909 lddintrf_Constructor(
910 IN PVOID DeviceExtension,
911 IN PVOID Instance,
912 IN PVOID InterfaceData,
913 IN USHORT Version,
914 IN USHORT Size,
915 IN PINTERFACE Interface
916 );
917
918 NTSTATUS
919 NTAPI
920 locintrf_Constructor(
921 IN PVOID DeviceExtension,
922 IN PVOID Instance,
923 IN PVOID InterfaceData,
924 IN USHORT Version,
925 IN USHORT Size,
926 IN PINTERFACE Interface
927 );
928
929 NTSTATUS
930 NTAPI
931 PciPmeInterfaceConstructor(
932 IN PVOID DeviceExtension,
933 IN PVOID Instance,
934 IN PVOID InterfaceData,
935 IN USHORT Version,
936 IN USHORT Size,
937 IN PINTERFACE Interface
938 );
939
940 NTSTATUS
941 NTAPI
942 routeintrf_Constructor(
943 IN PVOID DeviceExtension,
944 IN PVOID Instance,
945 IN PVOID InterfaceData,
946 IN USHORT Version,
947 IN USHORT Size,
948 IN PINTERFACE Interface
949 );
950
951 NTSTATUS
952 NTAPI
953 devpresent_Constructor(
954 IN PVOID DeviceExtension,
955 IN PVOID Instance,
956 IN PVOID InterfaceData,
957 IN USHORT Version,
958 IN USHORT Size,
959 IN PINTERFACE Interface
960 );
961
962 //
963 // PCI Enumeration and Resources
964 //
965 NTSTATUS
966 NTAPI
967 PciQueryDeviceRelations(
968 IN PPCI_FDO_EXTENSION DeviceExtension,
969 IN OUT PDEVICE_RELATIONS *pDeviceRelations
970 );
971
972 //
973 // Identification Functions
974 //
975 PWCHAR
976 NTAPI
977 PciGetDeviceDescriptionMessage(
978 IN UCHAR BaseClass,
979 IN UCHAR SubClass
980 );
981
982 //
983 // External Resources
984 //
985 extern SINGLE_LIST_ENTRY PciFdoExtensionListHead;
986 extern KEVENT PciGlobalLock;
987 extern PPCI_INTERFACE PciInterfaces[];
988 extern PCI_INTERFACE ArbiterInterfaceBusNumber;
989 extern PCI_INTERFACE ArbiterInterfaceMemory;
990 extern PCI_INTERFACE ArbiterInterfaceIo;
991 extern PCI_INTERFACE BusHandlerInterface;
992 extern PCI_INTERFACE PciRoutingInterface;
993 extern PCI_INTERFACE PciCardbusPrivateInterface;
994 extern PCI_INTERFACE PciLegacyDeviceDetectionInterface;
995 extern PCI_INTERFACE PciPmeInterface;
996 extern PCI_INTERFACE PciDevicePresentInterface;
997 //extern PCI_INTERFACE PciNativeIdeInterface;
998 extern PCI_INTERFACE PciLocationInterface;
999 extern PCI_INTERFACE AgpTargetInterface;
1000 extern PCI_INTERFACE TranslatorInterfaceInterrupt;
1001 extern PDRIVER_OBJECT PciDriverObject;
1002 extern PWATCHDOG_TABLE WdTable;
1003
1004 /* EOF */