2010-04-01 19:07:40 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS PCI Bus Driver
|
|
|
|
* LICENSE: BSD - See COPYING.ARM in the top level directory
|
|
|
|
* FILE: drivers/bus/pci/pci.h
|
|
|
|
* PURPOSE: Main Header File
|
|
|
|
* PROGRAMMERS: ReactOS Portable Systems Group
|
|
|
|
*/
|
|
|
|
|
2014-02-06 11:18:34 +00:00
|
|
|
#ifndef _PCIX_PCH_
|
|
|
|
#define _PCIX_PCH_
|
|
|
|
|
Begin implement full PCI Bus Driver. code by me comments by sir_richard to avoid Engrish
DriverEntry full 100% implemented, ACPI WatchDog detect, PCI IRQ Routing detect, PCI errata/hackflag detect (PciGetDebugPorts not support, need PCI Debug Device to test)
Native (S)ATA, PCI BIOS Resource Lock, System Errata/Hackflag also is detect
HAL Hoooking enabled, callbacks stub
Stub PnP Interfaces: PciAddDevice, PciDriverUnload, PciDispatchIrp
PCI utility routines: PciUnicodeStringStrStr, PciStringToUSHORT, PciIsSuiteVersion, PciIsDatacenter, PciOpenKey, PciGetRegistryValue, PciBuildDefaultExclusionList done
PCI Verifier Support for future: PciVerifierInit/PciVerifierProfileChangeCallback (stub)
Thank you for much patience~ This 1200 first codes, have 12000 codes more to come!~~
svn path=/trunk/; revision=47894
2010-06-28 05:23:31 +00:00
|
|
|
#include <ntifs.h>
|
|
|
|
#include <wdmguid.h>
|
|
|
|
#include <wchar.h>
|
|
|
|
#include <acpiioct.h>
|
|
|
|
#include <drivers/pci/pci.h>
|
|
|
|
#include <drivers/acpi/acpi.h>
|
2014-01-04 12:05:02 +00:00
|
|
|
#include <ndk/halfuncs.h>
|
|
|
|
#include <ndk/rtlfuncs.h>
|
|
|
|
#include <ndk/vffuncs.h>
|
Begin implement full PCI Bus Driver. code by me comments by sir_richard to avoid Engrish
DriverEntry full 100% implemented, ACPI WatchDog detect, PCI IRQ Routing detect, PCI errata/hackflag detect (PciGetDebugPorts not support, need PCI Debug Device to test)
Native (S)ATA, PCI BIOS Resource Lock, System Errata/Hackflag also is detect
HAL Hoooking enabled, callbacks stub
Stub PnP Interfaces: PciAddDevice, PciDriverUnload, PciDispatchIrp
PCI utility routines: PciUnicodeStringStrStr, PciStringToUSHORT, PciIsSuiteVersion, PciIsDatacenter, PciOpenKey, PciGetRegistryValue, PciBuildDefaultExclusionList done
PCI Verifier Support for future: PciVerifierInit/PciVerifierProfileChangeCallback (stub)
Thank you for much patience~ This 1200 first codes, have 12000 codes more to come!~~
svn path=/trunk/; revision=47894
2010-06-28 05:23:31 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Tag used in all pool allocations (Pci Bus)
|
|
|
|
//
|
|
|
|
#define PCI_POOL_TAG 'BicP'
|
|
|
|
|
Implement Root Bus FDO AddDevice codes, get boot config, connect to HAL or ACPI config handlers (PciQueryForPciBusInterface, PciGetConfigHandlers), read BUS FDO hack flag, get _HPP HotPlug PCI ACPI data and initialize arbiter support.
PciGetHotPlugParameters work but no PCI HotPlug support on my machines, so cannot test ACPI data, that part stub now
Add PciFdoDispatchTable, PciFdoDispatchPnpTable, PciFdoDispatchPowerTable but all stub to PciIrpNotSupported however set correct IRP Dispatch Style for the IRPS
Arbiter support in PciInitializeARbiters done, but PciInterfaces array is NULL (stub) at moment
Add PCI_SIGNATURE, PCI_STATE, PCI_DISAPTCH_STYLE type, add PciInitializeState to begin the state support
Add structure for PCI_FDO_EXTENSION, PCI_SECONDARY_EXTENSION, PCI_INTERFACE, PCI_ARBITER_INSTANCE, PCI_DISPATCH_TABLE
PCI utility functions added: PciFindParentPciFdoExtension, PciInsertEntryAtTail, PciInsertEntryAtHead, PcipLinkSecondaryExtension, PciGetDeviceProperty, PciSendIoctl
Need sir_richard to add arbiter.h header to define ARBITER_INSTANCE for finish support
This 1000 more codes done now~
svn path=/trunk/; revision=47898
2010-06-28 17:30:35 +00:00
|
|
|
//
|
|
|
|
// Checks if the specified FDO is the FDO for the Root PCI Bus
|
|
|
|
//
|
|
|
|
#define PCI_IS_ROOT_FDO(x) ((x)->BusRootFdoExtension == x)
|
|
|
|
|
|
|
|
//
|
|
|
|
// Assertions to make sure we are dealing with the right kind of extension
|
|
|
|
//
|
|
|
|
#define ASSERT_FDO(x) ASSERT((x)->ExtensionType == PciFdoExtensionType);
|
|
|
|
#define ASSERT_PDO(x) ASSERT((x)->ExtensionType == PciPdoExtensionType);
|
|
|
|
|
Begin implement full PCI Bus Driver. code by me comments by sir_richard to avoid Engrish
DriverEntry full 100% implemented, ACPI WatchDog detect, PCI IRQ Routing detect, PCI errata/hackflag detect (PciGetDebugPorts not support, need PCI Debug Device to test)
Native (S)ATA, PCI BIOS Resource Lock, System Errata/Hackflag also is detect
HAL Hoooking enabled, callbacks stub
Stub PnP Interfaces: PciAddDevice, PciDriverUnload, PciDispatchIrp
PCI utility routines: PciUnicodeStringStrStr, PciStringToUSHORT, PciIsSuiteVersion, PciIsDatacenter, PciOpenKey, PciGetRegistryValue, PciBuildDefaultExclusionList done
PCI Verifier Support for future: PciVerifierInit/PciVerifierProfileChangeCallback (stub)
Thank you for much patience~ This 1200 first codes, have 12000 codes more to come!~~
svn path=/trunk/; revision=47894
2010-06-28 05:23:31 +00:00
|
|
|
//
|
|
|
|
// PCI Hack Entry Name Lengths
|
|
|
|
//
|
2010-06-29 20:21:45 +00:00
|
|
|
#define PCI_HACK_ENTRY_SIZE sizeof(L"VVVVdddd") - sizeof(UNICODE_NULL)
|
|
|
|
#define PCI_HACK_ENTRY_REV_SIZE sizeof(L"VVVVddddRR") - sizeof(UNICODE_NULL)
|
|
|
|
#define PCI_HACK_ENTRY_SUBSYS_SIZE sizeof(L"VVVVddddssssIIII") - sizeof(UNICODE_NULL)
|
|
|
|
#define PCI_HACK_ENTRY_FULL_SIZE sizeof(L"VVVVddddssssIIIIRR") - sizeof(UNICODE_NULL)
|
Begin implement full PCI Bus Driver. code by me comments by sir_richard to avoid Engrish
DriverEntry full 100% implemented, ACPI WatchDog detect, PCI IRQ Routing detect, PCI errata/hackflag detect (PciGetDebugPorts not support, need PCI Debug Device to test)
Native (S)ATA, PCI BIOS Resource Lock, System Errata/Hackflag also is detect
HAL Hoooking enabled, callbacks stub
Stub PnP Interfaces: PciAddDevice, PciDriverUnload, PciDispatchIrp
PCI utility routines: PciUnicodeStringStrStr, PciStringToUSHORT, PciIsSuiteVersion, PciIsDatacenter, PciOpenKey, PciGetRegistryValue, PciBuildDefaultExclusionList done
PCI Verifier Support for future: PciVerifierInit/PciVerifierProfileChangeCallback (stub)
Thank you for much patience~ This 1200 first codes, have 12000 codes more to come!~~
svn path=/trunk/; revision=47894
2010-06-28 05:23:31 +00:00
|
|
|
|
|
|
|
//
|
Implement Root Bus FDO AddDevice codes, get boot config, connect to HAL or ACPI config handlers (PciQueryForPciBusInterface, PciGetConfigHandlers), read BUS FDO hack flag, get _HPP HotPlug PCI ACPI data and initialize arbiter support.
PciGetHotPlugParameters work but no PCI HotPlug support on my machines, so cannot test ACPI data, that part stub now
Add PciFdoDispatchTable, PciFdoDispatchPnpTable, PciFdoDispatchPowerTable but all stub to PciIrpNotSupported however set correct IRP Dispatch Style for the IRPS
Arbiter support in PciInitializeARbiters done, but PciInterfaces array is NULL (stub) at moment
Add PCI_SIGNATURE, PCI_STATE, PCI_DISAPTCH_STYLE type, add PciInitializeState to begin the state support
Add structure for PCI_FDO_EXTENSION, PCI_SECONDARY_EXTENSION, PCI_INTERFACE, PCI_ARBITER_INSTANCE, PCI_DISPATCH_TABLE
PCI utility functions added: PciFindParentPciFdoExtension, PciInsertEntryAtTail, PciInsertEntryAtHead, PcipLinkSecondaryExtension, PciGetDeviceProperty, PciSendIoctl
Need sir_richard to add arbiter.h header to define ARBITER_INSTANCE for finish support
This 1000 more codes done now~
svn path=/trunk/; revision=47898
2010-06-28 17:30:35 +00:00
|
|
|
// PCI Hack Entry Flags
|
Begin implement full PCI Bus Driver. code by me comments by sir_richard to avoid Engrish
DriverEntry full 100% implemented, ACPI WatchDog detect, PCI IRQ Routing detect, PCI errata/hackflag detect (PciGetDebugPorts not support, need PCI Debug Device to test)
Native (S)ATA, PCI BIOS Resource Lock, System Errata/Hackflag also is detect
HAL Hoooking enabled, callbacks stub
Stub PnP Interfaces: PciAddDevice, PciDriverUnload, PciDispatchIrp
PCI utility routines: PciUnicodeStringStrStr, PciStringToUSHORT, PciIsSuiteVersion, PciIsDatacenter, PciOpenKey, PciGetRegistryValue, PciBuildDefaultExclusionList done
PCI Verifier Support for future: PciVerifierInit/PciVerifierProfileChangeCallback (stub)
Thank you for much patience~ This 1200 first codes, have 12000 codes more to come!~~
svn path=/trunk/; revision=47894
2010-06-28 05:23:31 +00:00
|
|
|
//
|
|
|
|
#define PCI_HACK_HAS_REVISION_INFO 0x01
|
|
|
|
#define PCI_HACK_HAS_SUBSYSTEM_INFO 0x02
|
Implement Root Bus FDO AddDevice codes, get boot config, connect to HAL or ACPI config handlers (PciQueryForPciBusInterface, PciGetConfigHandlers), read BUS FDO hack flag, get _HPP HotPlug PCI ACPI data and initialize arbiter support.
PciGetHotPlugParameters work but no PCI HotPlug support on my machines, so cannot test ACPI data, that part stub now
Add PciFdoDispatchTable, PciFdoDispatchPnpTable, PciFdoDispatchPowerTable but all stub to PciIrpNotSupported however set correct IRP Dispatch Style for the IRPS
Arbiter support in PciInitializeARbiters done, but PciInterfaces array is NULL (stub) at moment
Add PCI_SIGNATURE, PCI_STATE, PCI_DISAPTCH_STYLE type, add PciInitializeState to begin the state support
Add structure for PCI_FDO_EXTENSION, PCI_SECONDARY_EXTENSION, PCI_INTERFACE, PCI_ARBITER_INSTANCE, PCI_DISPATCH_TABLE
PCI utility functions added: PciFindParentPciFdoExtension, PciInsertEntryAtTail, PciInsertEntryAtHead, PcipLinkSecondaryExtension, PciGetDeviceProperty, PciSendIoctl
Need sir_richard to add arbiter.h header to define ARBITER_INSTANCE for finish support
This 1000 more codes done now~
svn path=/trunk/; revision=47898
2010-06-28 17:30:35 +00:00
|
|
|
|
Fix for code to handle IRP dispatching when unrecognized IRP (Thanks you sir_richard)
Add FDO IRP_MN_QUERY_INTERFACE support (it calls PciQueryInterface)
Add all PCI interface descriptor: PciLocationInterface (GUID_PNP_LOCATION_INTERFACE), PciPmeInterface (GUID_PCI_PME_INTERFACE), PciCardbusPrivateInterface (GUID_PCI_CARDBUS_INTERFACE_PRIVATE), PciLegacyDeviceDetectionInterface (GUID_LEGACY_DEVICE_DETECTION_STANDARD), AgpTargetInterface (GUID_AGP_TARGET_BUS_INTERFACE_STANDARD), PciRoutingInterface (GUID_INT_ROUTE_INTERFACE_STANDARD), BusHandlerInterface (GUID_BUS_INTERFACE_STANDARD) and stub initializer and constructor.
Add missing devhere.c interface file
Add all PCI arbiter descritptor: ArbiterInterfaceBusNumber, ArbiterInterfaceMemory, ArbiterInterfaceIo. Write constructor stub but not handled ArbitersInitialized == TRUE
Also add last-resort PCI interface: TranslatorInterfaceInterrupt (GUID_TRANSLATOR_INTERFACE_STANDARD) and part implement tranirq_Constructor
Add PciQueryInterface to find correct FDO/PDO/ROOT interface for a request and call interface constructor
Fix interface signatures, fix interface constructor type and PCI_INTERFACE, add interface flags (Thanks sir_richard)
Fix Aribtriter code (Thanks sir_richard)
Now another 1200 codes added, soon time for enumeration code!
svn path=/trunk/; revision=48074
2010-07-16 00:39:54 +00:00
|
|
|
//
|
|
|
|
// PCI Interface Flags
|
|
|
|
//
|
|
|
|
#define PCI_INTERFACE_PDO 0x01
|
|
|
|
#define PCI_INTERFACE_FDO 0x02
|
|
|
|
#define PCI_INTERFACE_ROOT 0x04
|
|
|
|
|
2010-07-17 15:09:19 +00:00
|
|
|
//
|
2010-07-17 16:53:18 +00:00
|
|
|
// PCI Skip Function Flags
|
2010-07-17 15:09:19 +00:00
|
|
|
//
|
|
|
|
#define PCI_SKIP_DEVICE_ENUMERATION 0x01
|
|
|
|
#define PCI_SKIP_RESOURCE_ENUMERATION 0x02
|
|
|
|
|
Joint patch
By sir_richard: [PCIX]: - Implement PciIsSlotPresentInParentMethod for ACPI query, and PcoDecodeEnable utility function.
- Implement PciConfigureIdeController based on WDHC Whitepaper "How Windows Switches a Controller to Native Mode". Check for PciEanbleNativeModeATA in registry, InitSafeBootMode, and call the ACPI driver to evaluate if NATA is present on the slot. Only configure the controller if both channels support native mode, as this is a Windows restriction.
- Implement PciApplyHacks for enumeration and resource update cases. In the first case, we handle legacy DEC Alpha Intel i82375 and i82378 PCI-to-(E)ISA bridges with invalid class codes. In the second, we configure IDE controllers for Native mode, except the OPTi Viper-M, which is known to cause issues. We also support cards with legacy VGA decodes by telling the arbiter to enable full access to the rangesm and finally we completely disable the decodes on Compaq PCI Hotplug Controllers (Revision 17) on PAE systems, as they have bugs handling 64-bit addresses. Finally, on resource updates, we apply a vendor-specific errata to the IBM 20H2999 PCI Docking Bridge (Hotplug) used on Thinkpad 600 Series laptops, and we attempt to avoid issues that can happen on certain devices that are plugged into an ICH1/2/3/4 Intel Hub when it has been configured to do subtractive decode. Full information on these workarounds can be seen in the comments. Finally, we also enable CardBUS devices for ACPI-compliant mode, by crossing out the LegacyBaseAddress in the CardBUS Type 2 PCI Configuration Header.
- Miscelleaneous code cleanups.
By eVb: More PciScanBus support, for debug PCI caps that driver use are dump, and detect nonBIOS configure device (spec is said that CacheLineSize != 0, LatencyTimer != 0 (on PCI-X, != 64)), if found NeedsHotPlugConfiguration to be set
By eVb: Support PCI_HACK_VIDEO_LEGACY_DECODE (call ario_ApplyBrokenVideoHack, but no arb support to do work)
svn path=/trunk/; revision=48116
2010-07-19 15:15:39 +00:00
|
|
|
//
|
|
|
|
// PCI Apply Hack Flags
|
|
|
|
//
|
|
|
|
#define PCI_HACK_FIXUP_BEFORE_CONFIGURATION 0x00
|
|
|
|
#define PCI_HACK_FIXUP_AFTER_CONFIGURATION 0x01
|
|
|
|
#define PCI_HACK_FIXUP_BEFORE_UPDATE 0x03
|
|
|
|
|
2010-07-17 16:53:18 +00:00
|
|
|
//
|
|
|
|
// PCI Debugging Device Support
|
|
|
|
//
|
|
|
|
#define MAX_DEBUGGING_DEVICES_SUPPORTED 0x04
|
|
|
|
|
2010-07-18 18:58:33 +00:00
|
|
|
//
|
|
|
|
// PCI Driver Verifier Failures
|
|
|
|
//
|
|
|
|
#define PCI_VERIFIER_CODES 0x04
|
Joint patch
By sir_richard: [PCIX]: - Implement PciIsSlotPresentInParentMethod for ACPI query, and PcoDecodeEnable utility function.
- Implement PciConfigureIdeController based on WDHC Whitepaper "How Windows Switches a Controller to Native Mode". Check for PciEanbleNativeModeATA in registry, InitSafeBootMode, and call the ACPI driver to evaluate if NATA is present on the slot. Only configure the controller if both channels support native mode, as this is a Windows restriction.
- Implement PciApplyHacks for enumeration and resource update cases. In the first case, we handle legacy DEC Alpha Intel i82375 and i82378 PCI-to-(E)ISA bridges with invalid class codes. In the second, we configure IDE controllers for Native mode, except the OPTi Viper-M, which is known to cause issues. We also support cards with legacy VGA decodes by telling the arbiter to enable full access to the rangesm and finally we completely disable the decodes on Compaq PCI Hotplug Controllers (Revision 17) on PAE systems, as they have bugs handling 64-bit addresses. Finally, on resource updates, we apply a vendor-specific errata to the IBM 20H2999 PCI Docking Bridge (Hotplug) used on Thinkpad 600 Series laptops, and we attempt to avoid issues that can happen on certain devices that are plugged into an ICH1/2/3/4 Intel Hub when it has been configured to do subtractive decode. Full information on these workarounds can be seen in the comments. Finally, we also enable CardBUS devices for ACPI-compliant mode, by crossing out the LegacyBaseAddress in the CardBUS Type 2 PCI Configuration Header.
- Miscelleaneous code cleanups.
By eVb: More PciScanBus support, for debug PCI caps that driver use are dump, and detect nonBIOS configure device (spec is said that CacheLineSize != 0, LatencyTimer != 0 (on PCI-X, != 64)), if found NeedsHotPlugConfiguration to be set
By eVb: Support PCI_HACK_VIDEO_LEGACY_DECODE (call ario_ApplyBrokenVideoHack, but no arb support to do work)
svn path=/trunk/; revision=48116
2010-07-19 15:15:39 +00:00
|
|
|
|
- Add support for PnP IRP to PDO: IRP_MN_QUERY_BUS_INFORMATION (PciQueryBusInformation), IRP_MN_QUERY_ID (PciQueryId), IRP_MN_QUERY_DEVICE_TEXT (PciQueryDeviceText), IRP_MN_QUERY_CAPABILITIES (PciQueryCapabilities), IRP_MN_QUERY_DEVICE_RELATIONS (PciQueryTargetDeviceRelations implement, PciQueryEjectionRelations, stub)
- Stub support for PnP IRP to PDO: IRP_MN_QUERY_RESOURCE_REQUIREMENTS (PciQueryRequirements), IRP_MN_QUERY_RESOURCES(PciQueryResources)
- Add support for PnP IRP to FDO: IRP_MN_QUERY_CAPABILITIES (handle in PciFdoIrpQueryDeviceCapabilities)
- Build device capability UI number (PciDetermineSlotNumber), use PIR$ (seem support broken, need to check loader) or device property for bus not root
- Use parent attachee device and this PDO for build device/system wake states, latency, device/system power mappings
- PCI-ID manage support: PciInitIdBuffer, PciIdPrintf, PciIdPrintfAppend
- Debug helper: PciDebugDumpQueryCapabilities
- Thanks richard for advise + beer
PCI-X driver now pass 10000 codes lines!
svn path=/trunk/; revision=48548
2010-08-14 17:09:20 +00:00
|
|
|
//
|
|
|
|
// PCI ID Buffer ANSI Strings
|
|
|
|
//
|
|
|
|
#define MAX_ANSI_STRINGS 0x08
|
|
|
|
|
Implement Root Bus FDO AddDevice codes, get boot config, connect to HAL or ACPI config handlers (PciQueryForPciBusInterface, PciGetConfigHandlers), read BUS FDO hack flag, get _HPP HotPlug PCI ACPI data and initialize arbiter support.
PciGetHotPlugParameters work but no PCI HotPlug support on my machines, so cannot test ACPI data, that part stub now
Add PciFdoDispatchTable, PciFdoDispatchPnpTable, PciFdoDispatchPowerTable but all stub to PciIrpNotSupported however set correct IRP Dispatch Style for the IRPS
Arbiter support in PciInitializeARbiters done, but PciInterfaces array is NULL (stub) at moment
Add PCI_SIGNATURE, PCI_STATE, PCI_DISAPTCH_STYLE type, add PciInitializeState to begin the state support
Add structure for PCI_FDO_EXTENSION, PCI_SECONDARY_EXTENSION, PCI_INTERFACE, PCI_ARBITER_INSTANCE, PCI_DISPATCH_TABLE
PCI utility functions added: PciFindParentPciFdoExtension, PciInsertEntryAtTail, PciInsertEntryAtHead, PcipLinkSecondaryExtension, PciGetDeviceProperty, PciSendIoctl
Need sir_richard to add arbiter.h header to define ARBITER_INSTANCE for finish support
This 1000 more codes done now~
svn path=/trunk/; revision=47898
2010-06-28 17:30:35 +00:00
|
|
|
//
|
|
|
|
// Device Extension, Interface, Translator and Arbiter Signatures
|
|
|
|
//
|
|
|
|
typedef enum _PCI_SIGNATURE
|
|
|
|
{
|
Fix for code to handle IRP dispatching when unrecognized IRP (Thanks you sir_richard)
Add FDO IRP_MN_QUERY_INTERFACE support (it calls PciQueryInterface)
Add all PCI interface descriptor: PciLocationInterface (GUID_PNP_LOCATION_INTERFACE), PciPmeInterface (GUID_PCI_PME_INTERFACE), PciCardbusPrivateInterface (GUID_PCI_CARDBUS_INTERFACE_PRIVATE), PciLegacyDeviceDetectionInterface (GUID_LEGACY_DEVICE_DETECTION_STANDARD), AgpTargetInterface (GUID_AGP_TARGET_BUS_INTERFACE_STANDARD), PciRoutingInterface (GUID_INT_ROUTE_INTERFACE_STANDARD), BusHandlerInterface (GUID_BUS_INTERFACE_STANDARD) and stub initializer and constructor.
Add missing devhere.c interface file
Add all PCI arbiter descritptor: ArbiterInterfaceBusNumber, ArbiterInterfaceMemory, ArbiterInterfaceIo. Write constructor stub but not handled ArbitersInitialized == TRUE
Also add last-resort PCI interface: TranslatorInterfaceInterrupt (GUID_TRANSLATOR_INTERFACE_STANDARD) and part implement tranirq_Constructor
Add PciQueryInterface to find correct FDO/PDO/ROOT interface for a request and call interface constructor
Fix interface signatures, fix interface constructor type and PCI_INTERFACE, add interface flags (Thanks sir_richard)
Fix Aribtriter code (Thanks sir_richard)
Now another 1200 codes added, soon time for enumeration code!
svn path=/trunk/; revision=48074
2010-07-16 00:39:54 +00:00
|
|
|
PciPdoExtensionType = 'icP0',
|
|
|
|
PciFdoExtensionType = 'icP1',
|
|
|
|
PciArb_Io = 'icP2',
|
|
|
|
PciArb_Memory = 'icP3',
|
|
|
|
PciArb_Interrupt = 'icP4',
|
|
|
|
PciArb_BusNumber = 'icP5',
|
|
|
|
PciTrans_Interrupt = 'icP6',
|
|
|
|
PciInterface_BusHandler = 'icP7',
|
|
|
|
PciInterface_IntRouteHandler = 'icP8',
|
|
|
|
PciInterface_PciCb = 'icP9',
|
|
|
|
PciInterface_LegacyDeviceDetection = 'icP:',
|
|
|
|
PciInterface_PmeHandler = 'icP;',
|
|
|
|
PciInterface_DevicePresent = 'icP<',
|
|
|
|
PciInterface_NativeIde = 'icP=',
|
|
|
|
PciInterface_AgpTarget = 'icP>',
|
|
|
|
PciInterface_Location = 'icP?'
|
Implement Root Bus FDO AddDevice codes, get boot config, connect to HAL or ACPI config handlers (PciQueryForPciBusInterface, PciGetConfigHandlers), read BUS FDO hack flag, get _HPP HotPlug PCI ACPI data and initialize arbiter support.
PciGetHotPlugParameters work but no PCI HotPlug support on my machines, so cannot test ACPI data, that part stub now
Add PciFdoDispatchTable, PciFdoDispatchPnpTable, PciFdoDispatchPowerTable but all stub to PciIrpNotSupported however set correct IRP Dispatch Style for the IRPS
Arbiter support in PciInitializeARbiters done, but PciInterfaces array is NULL (stub) at moment
Add PCI_SIGNATURE, PCI_STATE, PCI_DISAPTCH_STYLE type, add PciInitializeState to begin the state support
Add structure for PCI_FDO_EXTENSION, PCI_SECONDARY_EXTENSION, PCI_INTERFACE, PCI_ARBITER_INSTANCE, PCI_DISPATCH_TABLE
PCI utility functions added: PciFindParentPciFdoExtension, PciInsertEntryAtTail, PciInsertEntryAtHead, PcipLinkSecondaryExtension, PciGetDeviceProperty, PciSendIoctl
Need sir_richard to add arbiter.h header to define ARBITER_INSTANCE for finish support
This 1000 more codes done now~
svn path=/trunk/; revision=47898
2010-06-28 17:30:35 +00:00
|
|
|
} PCI_SIGNATURE, *PPCI_SIGNATURE;
|
|
|
|
|
2010-08-09 19:07:52 +00:00
|
|
|
//
|
|
|
|
// Driver-handled PCI Device Types
|
|
|
|
//
|
|
|
|
typedef enum _PCI_DEVICE_TYPES
|
|
|
|
{
|
|
|
|
PciTypeInvalid,
|
|
|
|
PciTypeHostBridge,
|
|
|
|
PciTypePciBridge,
|
|
|
|
PciTypeCardbusBridge,
|
|
|
|
PciTypeDevice
|
|
|
|
} PCI_DEVICE_TYPES;
|
|
|
|
|
Implement Root Bus FDO AddDevice codes, get boot config, connect to HAL or ACPI config handlers (PciQueryForPciBusInterface, PciGetConfigHandlers), read BUS FDO hack flag, get _HPP HotPlug PCI ACPI data and initialize arbiter support.
PciGetHotPlugParameters work but no PCI HotPlug support on my machines, so cannot test ACPI data, that part stub now
Add PciFdoDispatchTable, PciFdoDispatchPnpTable, PciFdoDispatchPowerTable but all stub to PciIrpNotSupported however set correct IRP Dispatch Style for the IRPS
Arbiter support in PciInitializeARbiters done, but PciInterfaces array is NULL (stub) at moment
Add PCI_SIGNATURE, PCI_STATE, PCI_DISAPTCH_STYLE type, add PciInitializeState to begin the state support
Add structure for PCI_FDO_EXTENSION, PCI_SECONDARY_EXTENSION, PCI_INTERFACE, PCI_ARBITER_INSTANCE, PCI_DISPATCH_TABLE
PCI utility functions added: PciFindParentPciFdoExtension, PciInsertEntryAtTail, PciInsertEntryAtHead, PcipLinkSecondaryExtension, PciGetDeviceProperty, PciSendIoctl
Need sir_richard to add arbiter.h header to define ARBITER_INSTANCE for finish support
This 1000 more codes done now~
svn path=/trunk/; revision=47898
2010-06-28 17:30:35 +00:00
|
|
|
//
|
|
|
|
// Device Extension Logic States
|
|
|
|
//
|
|
|
|
typedef enum _PCI_STATE
|
|
|
|
{
|
|
|
|
PciNotStarted,
|
|
|
|
PciStarted,
|
|
|
|
PciDeleted,
|
|
|
|
PciStopped,
|
|
|
|
PciSurpriseRemoved,
|
|
|
|
PciSynchronizedOperation,
|
|
|
|
PciMaxObjectState
|
|
|
|
} PCI_STATE;
|
|
|
|
|
|
|
|
//
|
|
|
|
// IRP Dispatch Logic Style
|
|
|
|
//
|
|
|
|
typedef enum _PCI_DISPATCH_STYLE
|
|
|
|
{
|
|
|
|
IRP_COMPLETE,
|
|
|
|
IRP_DOWNWARD,
|
|
|
|
IRP_UPWARD,
|
|
|
|
IRP_DISPATCH,
|
|
|
|
} PCI_DISPATCH_STYLE;
|
|
|
|
|
|
|
|
//
|
|
|
|
// PCI Hack Entry Information
|
|
|
|
//
|
Begin implement full PCI Bus Driver. code by me comments by sir_richard to avoid Engrish
DriverEntry full 100% implemented, ACPI WatchDog detect, PCI IRQ Routing detect, PCI errata/hackflag detect (PciGetDebugPorts not support, need PCI Debug Device to test)
Native (S)ATA, PCI BIOS Resource Lock, System Errata/Hackflag also is detect
HAL Hoooking enabled, callbacks stub
Stub PnP Interfaces: PciAddDevice, PciDriverUnload, PciDispatchIrp
PCI utility routines: PciUnicodeStringStrStr, PciStringToUSHORT, PciIsSuiteVersion, PciIsDatacenter, PciOpenKey, PciGetRegistryValue, PciBuildDefaultExclusionList done
PCI Verifier Support for future: PciVerifierInit/PciVerifierProfileChangeCallback (stub)
Thank you for much patience~ This 1200 first codes, have 12000 codes more to come!~~
svn path=/trunk/; revision=47894
2010-06-28 05:23:31 +00:00
|
|
|
typedef struct _PCI_HACK_ENTRY
|
|
|
|
{
|
|
|
|
USHORT VendorID;
|
|
|
|
USHORT DeviceID;
|
|
|
|
USHORT SubVendorID;
|
|
|
|
USHORT SubSystemID;
|
|
|
|
ULONGLONG HackFlags;
|
|
|
|
USHORT RevisionID;
|
|
|
|
UCHAR Flags;
|
|
|
|
} PCI_HACK_ENTRY, *PPCI_HACK_ENTRY;
|
|
|
|
|
Implement Root Bus FDO AddDevice codes, get boot config, connect to HAL or ACPI config handlers (PciQueryForPciBusInterface, PciGetConfigHandlers), read BUS FDO hack flag, get _HPP HotPlug PCI ACPI data and initialize arbiter support.
PciGetHotPlugParameters work but no PCI HotPlug support on my machines, so cannot test ACPI data, that part stub now
Add PciFdoDispatchTable, PciFdoDispatchPnpTable, PciFdoDispatchPowerTable but all stub to PciIrpNotSupported however set correct IRP Dispatch Style for the IRPS
Arbiter support in PciInitializeARbiters done, but PciInterfaces array is NULL (stub) at moment
Add PCI_SIGNATURE, PCI_STATE, PCI_DISAPTCH_STYLE type, add PciInitializeState to begin the state support
Add structure for PCI_FDO_EXTENSION, PCI_SECONDARY_EXTENSION, PCI_INTERFACE, PCI_ARBITER_INSTANCE, PCI_DISPATCH_TABLE
PCI utility functions added: PciFindParentPciFdoExtension, PciInsertEntryAtTail, PciInsertEntryAtHead, PcipLinkSecondaryExtension, PciGetDeviceProperty, PciSendIoctl
Need sir_richard to add arbiter.h header to define ARBITER_INSTANCE for finish support
This 1000 more codes done now~
svn path=/trunk/; revision=47898
2010-06-28 17:30:35 +00:00
|
|
|
//
|
|
|
|
// Power State Information for Device Extension
|
|
|
|
//
|
|
|
|
typedef struct _PCI_POWER_STATE
|
|
|
|
{
|
|
|
|
SYSTEM_POWER_STATE CurrentSystemState;
|
|
|
|
DEVICE_POWER_STATE CurrentDeviceState;
|
|
|
|
SYSTEM_POWER_STATE SystemWakeLevel;
|
|
|
|
DEVICE_POWER_STATE DeviceWakeLevel;
|
|
|
|
DEVICE_POWER_STATE SystemStateMapping[7];
|
|
|
|
PIRP WaitWakeIrp;
|
|
|
|
PVOID SavedCancelRoutine;
|
|
|
|
LONG Paging;
|
|
|
|
LONG Hibernate;
|
|
|
|
LONG CrashDump;
|
|
|
|
} PCI_POWER_STATE, *PPCI_POWER_STATE;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Internal PCI Lock Structure
|
|
|
|
//
|
|
|
|
typedef struct _PCI_LOCK
|
|
|
|
{
|
|
|
|
LONG Atom;
|
|
|
|
BOOLEAN OldIrql;
|
|
|
|
} PCI_LOCK, *PPCI_LOCK;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Device Extension for a Bus FDO
|
|
|
|
//
|
|
|
|
typedef struct _PCI_FDO_EXTENSION
|
|
|
|
{
|
|
|
|
SINGLE_LIST_ENTRY List;
|
|
|
|
ULONG ExtensionType;
|
|
|
|
struct _PCI_MJ_DISPATCH_TABLE *IrpDispatchTable;
|
|
|
|
BOOLEAN DeviceState;
|
|
|
|
BOOLEAN TentativeNextState;
|
|
|
|
KEVENT SecondaryExtLock;
|
|
|
|
PDEVICE_OBJECT PhysicalDeviceObject;
|
|
|
|
PDEVICE_OBJECT FunctionalDeviceObject;
|
|
|
|
PDEVICE_OBJECT AttachedDeviceObject;
|
|
|
|
KEVENT ChildListLock;
|
|
|
|
struct _PCI_PDO_EXTENSION *ChildPdoList;
|
|
|
|
struct _PCI_FDO_EXTENSION *BusRootFdoExtension;
|
|
|
|
struct _PCI_FDO_EXTENSION *ParentFdoExtension;
|
|
|
|
struct _PCI_PDO_EXTENSION *ChildBridgePdoList;
|
|
|
|
PPCI_BUS_INTERFACE_STANDARD PciBusInterface;
|
|
|
|
BOOLEAN MaxSubordinateBus;
|
|
|
|
BUS_HANDLER *BusHandler;
|
|
|
|
BOOLEAN BaseBus;
|
|
|
|
BOOLEAN Fake;
|
|
|
|
BOOLEAN ChildDelete;
|
|
|
|
BOOLEAN Scanned;
|
|
|
|
BOOLEAN ArbitersInitialized;
|
|
|
|
BOOLEAN BrokenVideoHackApplied;
|
|
|
|
BOOLEAN Hibernated;
|
|
|
|
PCI_POWER_STATE PowerState;
|
|
|
|
SINGLE_LIST_ENTRY SecondaryExtension;
|
|
|
|
LONG ChildWaitWakeCount;
|
|
|
|
PPCI_COMMON_CONFIG PreservedConfig;
|
|
|
|
PCI_LOCK Lock;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
BOOLEAN Acquired;
|
|
|
|
BOOLEAN CacheLineSize;
|
|
|
|
BOOLEAN LatencyTimer;
|
|
|
|
BOOLEAN EnablePERR;
|
|
|
|
BOOLEAN EnableSERR;
|
|
|
|
} HotPlugParameters;
|
|
|
|
LONG BusHackFlags;
|
|
|
|
} PCI_FDO_EXTENSION, *PPCI_FDO_EXTENSION;
|
|
|
|
|
2010-07-17 01:31:26 +00:00
|
|
|
typedef struct _PCI_FUNCTION_RESOURCES
|
|
|
|
{
|
2010-07-17 15:59:09 +00:00
|
|
|
IO_RESOURCE_DESCRIPTOR Limit[7];
|
|
|
|
CM_PARTIAL_RESOURCE_DESCRIPTOR Current[7];
|
2010-07-17 01:31:26 +00:00
|
|
|
} PCI_FUNCTION_RESOURCES, *PPCI_FUNCTION_RESOURCES;
|
|
|
|
|
|
|
|
typedef union _PCI_HEADER_TYPE_DEPENDENT
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
UCHAR Spare[4];
|
|
|
|
} type0;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
UCHAR PrimaryBus;
|
|
|
|
UCHAR SecondaryBus;
|
|
|
|
UCHAR SubordinateBus;
|
|
|
|
UCHAR SubtractiveDecode:1;
|
|
|
|
UCHAR IsaBitSet:1;
|
|
|
|
UCHAR VgaBitSet:1;
|
|
|
|
UCHAR WeChangedBusNumbers:1;
|
|
|
|
UCHAR IsaBitRequired:1;
|
|
|
|
} type1;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
UCHAR Spare[4];
|
|
|
|
} type2;
|
|
|
|
} PCI_HEADER_TYPE_DEPENDENT, *PPCI_HEADER_TYPE_DEPENDENT;
|
|
|
|
|
|
|
|
typedef struct _PCI_PDO_EXTENSION
|
|
|
|
{
|
|
|
|
PVOID Next;
|
|
|
|
ULONG ExtensionType;
|
|
|
|
struct _PCI_MJ_DISPATCH_TABLE *IrpDispatchTable;
|
|
|
|
BOOLEAN DeviceState;
|
|
|
|
BOOLEAN TentativeNextState;
|
2010-07-17 15:59:09 +00:00
|
|
|
|
2010-07-17 01:31:26 +00:00
|
|
|
KEVENT SecondaryExtLock;
|
|
|
|
PCI_SLOT_NUMBER Slot;
|
|
|
|
PDEVICE_OBJECT PhysicalDeviceObject;
|
|
|
|
PPCI_FDO_EXTENSION ParentFdoExtension;
|
|
|
|
SINGLE_LIST_ENTRY SecondaryExtension;
|
|
|
|
LONG BusInterfaceReferenceCount;
|
|
|
|
LONG AgpInterfaceReferenceCount;
|
|
|
|
USHORT VendorId;
|
|
|
|
USHORT DeviceId;
|
|
|
|
USHORT SubsystemVendorId;
|
|
|
|
USHORT SubsystemId;
|
|
|
|
BOOLEAN RevisionId;
|
|
|
|
BOOLEAN ProgIf;
|
|
|
|
BOOLEAN SubClass;
|
|
|
|
BOOLEAN BaseClass;
|
|
|
|
BOOLEAN AdditionalResourceCount;
|
|
|
|
BOOLEAN AdjustedInterruptLine;
|
|
|
|
BOOLEAN InterruptPin;
|
|
|
|
BOOLEAN RawInterruptLine;
|
|
|
|
BOOLEAN CapabilitiesPtr;
|
|
|
|
BOOLEAN SavedLatencyTimer;
|
|
|
|
BOOLEAN SavedCacheLineSize;
|
|
|
|
BOOLEAN HeaderType;
|
|
|
|
BOOLEAN NotPresent;
|
|
|
|
BOOLEAN ReportedMissing;
|
|
|
|
BOOLEAN ExpectedWritebackFailure;
|
|
|
|
BOOLEAN NoTouchPmeEnable;
|
|
|
|
BOOLEAN LegacyDriver;
|
|
|
|
BOOLEAN UpdateHardware;
|
|
|
|
BOOLEAN MovedDevice;
|
|
|
|
BOOLEAN DisablePowerDown;
|
|
|
|
BOOLEAN NeedsHotPlugConfiguration;
|
2010-09-12 06:03:12 +00:00
|
|
|
BOOLEAN IDEInNativeMode;
|
2010-07-17 01:31:26 +00:00
|
|
|
BOOLEAN BIOSAllowsIDESwitchToNativeMode;
|
|
|
|
BOOLEAN IoSpaceUnderNativeIdeControl;
|
|
|
|
BOOLEAN OnDebugPath;
|
2010-09-12 06:03:12 +00:00
|
|
|
BOOLEAN IoSpaceNotRequired;
|
2010-07-17 01:31:26 +00:00
|
|
|
PCI_POWER_STATE PowerState;
|
|
|
|
PCI_HEADER_TYPE_DEPENDENT Dependent;
|
|
|
|
ULONGLONG HackFlags;
|
|
|
|
PCI_FUNCTION_RESOURCES *Resources;
|
|
|
|
PCI_FDO_EXTENSION *BridgeFdoExtension;
|
|
|
|
struct _PCI_PDO_EXTENSION *NextBridge;
|
|
|
|
struct _PCI_PDO_EXTENSION *NextHashEntry;
|
|
|
|
PCI_LOCK Lock;
|
|
|
|
PCI_PMC PowerCapabilities;
|
|
|
|
BOOLEAN TargetAgpCapabilityId;
|
|
|
|
USHORT CommandEnables;
|
|
|
|
USHORT InitialCommand;
|
|
|
|
} PCI_PDO_EXTENSION, *PPCI_PDO_EXTENSION;
|
|
|
|
|
Implement Root Bus FDO AddDevice codes, get boot config, connect to HAL or ACPI config handlers (PciQueryForPciBusInterface, PciGetConfigHandlers), read BUS FDO hack flag, get _HPP HotPlug PCI ACPI data and initialize arbiter support.
PciGetHotPlugParameters work but no PCI HotPlug support on my machines, so cannot test ACPI data, that part stub now
Add PciFdoDispatchTable, PciFdoDispatchPnpTable, PciFdoDispatchPowerTable but all stub to PciIrpNotSupported however set correct IRP Dispatch Style for the IRPS
Arbiter support in PciInitializeARbiters done, but PciInterfaces array is NULL (stub) at moment
Add PCI_SIGNATURE, PCI_STATE, PCI_DISAPTCH_STYLE type, add PciInitializeState to begin the state support
Add structure for PCI_FDO_EXTENSION, PCI_SECONDARY_EXTENSION, PCI_INTERFACE, PCI_ARBITER_INSTANCE, PCI_DISPATCH_TABLE
PCI utility functions added: PciFindParentPciFdoExtension, PciInsertEntryAtTail, PciInsertEntryAtHead, PcipLinkSecondaryExtension, PciGetDeviceProperty, PciSendIoctl
Need sir_richard to add arbiter.h header to define ARBITER_INSTANCE for finish support
This 1000 more codes done now~
svn path=/trunk/; revision=47898
2010-06-28 17:30:35 +00:00
|
|
|
//
|
|
|
|
// IRP Dispatch Function Type
|
|
|
|
//
|
|
|
|
typedef NTSTATUS (NTAPI *PCI_DISPATCH_FUNCTION)(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
2010-07-17 15:59:09 +00:00
|
|
|
IN PVOID DeviceExtension
|
Implement Root Bus FDO AddDevice codes, get boot config, connect to HAL or ACPI config handlers (PciQueryForPciBusInterface, PciGetConfigHandlers), read BUS FDO hack flag, get _HPP HotPlug PCI ACPI data and initialize arbiter support.
PciGetHotPlugParameters work but no PCI HotPlug support on my machines, so cannot test ACPI data, that part stub now
Add PciFdoDispatchTable, PciFdoDispatchPnpTable, PciFdoDispatchPowerTable but all stub to PciIrpNotSupported however set correct IRP Dispatch Style for the IRPS
Arbiter support in PciInitializeARbiters done, but PciInterfaces array is NULL (stub) at moment
Add PCI_SIGNATURE, PCI_STATE, PCI_DISAPTCH_STYLE type, add PciInitializeState to begin the state support
Add structure for PCI_FDO_EXTENSION, PCI_SECONDARY_EXTENSION, PCI_INTERFACE, PCI_ARBITER_INSTANCE, PCI_DISPATCH_TABLE
PCI utility functions added: PciFindParentPciFdoExtension, PciInsertEntryAtTail, PciInsertEntryAtHead, PcipLinkSecondaryExtension, PciGetDeviceProperty, PciSendIoctl
Need sir_richard to add arbiter.h header to define ARBITER_INSTANCE for finish support
This 1000 more codes done now~
svn path=/trunk/; revision=47898
2010-06-28 17:30:35 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
//
|
|
|
|
// IRP Dispatch Minor Table
|
|
|
|
//
|
|
|
|
typedef struct _PCI_MN_DISPATCH_TABLE
|
|
|
|
{
|
|
|
|
PCI_DISPATCH_STYLE DispatchStyle;
|
|
|
|
PCI_DISPATCH_FUNCTION DispatchFunction;
|
|
|
|
} PCI_MN_DISPATCH_TABLE, *PPCI_MN_DISPATCH_TABLE;
|
|
|
|
|
|
|
|
//
|
|
|
|
// IRP Dispatch Major Table
|
|
|
|
//
|
|
|
|
typedef struct _PCI_MJ_DISPATCH_TABLE
|
|
|
|
{
|
|
|
|
ULONG PnpIrpMaximumMinorFunction;
|
|
|
|
PPCI_MN_DISPATCH_TABLE PnpIrpDispatchTable;
|
|
|
|
ULONG PowerIrpMaximumMinorFunction;
|
|
|
|
PPCI_MN_DISPATCH_TABLE PowerIrpDispatchTable;
|
|
|
|
PCI_DISPATCH_STYLE SystemControlIrpDispatchStyle;
|
|
|
|
PCI_DISPATCH_FUNCTION SystemControlIrpDispatchFunction;
|
|
|
|
PCI_DISPATCH_STYLE OtherIrpDispatchStyle;
|
|
|
|
PCI_DISPATCH_FUNCTION OtherIrpDispatchFunction;
|
|
|
|
} PCI_MJ_DISPATCH_TABLE, *PPCI_MJ_DISPATCH_TABLE;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Generic PCI Interface Constructor and Initializer
|
|
|
|
//
|
|
|
|
struct _PCI_INTERFACE;
|
|
|
|
typedef NTSTATUS (NTAPI *PCI_INTERFACE_CONSTRUCTOR)(
|
Fix for code to handle IRP dispatching when unrecognized IRP (Thanks you sir_richard)
Add FDO IRP_MN_QUERY_INTERFACE support (it calls PciQueryInterface)
Add all PCI interface descriptor: PciLocationInterface (GUID_PNP_LOCATION_INTERFACE), PciPmeInterface (GUID_PCI_PME_INTERFACE), PciCardbusPrivateInterface (GUID_PCI_CARDBUS_INTERFACE_PRIVATE), PciLegacyDeviceDetectionInterface (GUID_LEGACY_DEVICE_DETECTION_STANDARD), AgpTargetInterface (GUID_AGP_TARGET_BUS_INTERFACE_STANDARD), PciRoutingInterface (GUID_INT_ROUTE_INTERFACE_STANDARD), BusHandlerInterface (GUID_BUS_INTERFACE_STANDARD) and stub initializer and constructor.
Add missing devhere.c interface file
Add all PCI arbiter descritptor: ArbiterInterfaceBusNumber, ArbiterInterfaceMemory, ArbiterInterfaceIo. Write constructor stub but not handled ArbitersInitialized == TRUE
Also add last-resort PCI interface: TranslatorInterfaceInterrupt (GUID_TRANSLATOR_INTERFACE_STANDARD) and part implement tranirq_Constructor
Add PciQueryInterface to find correct FDO/PDO/ROOT interface for a request and call interface constructor
Fix interface signatures, fix interface constructor type and PCI_INTERFACE, add interface flags (Thanks sir_richard)
Fix Aribtriter code (Thanks sir_richard)
Now another 1200 codes added, soon time for enumeration code!
svn path=/trunk/; revision=48074
2010-07-16 00:39:54 +00:00
|
|
|
IN PVOID DeviceExtension,
|
Implement Root Bus FDO AddDevice codes, get boot config, connect to HAL or ACPI config handlers (PciQueryForPciBusInterface, PciGetConfigHandlers), read BUS FDO hack flag, get _HPP HotPlug PCI ACPI data and initialize arbiter support.
PciGetHotPlugParameters work but no PCI HotPlug support on my machines, so cannot test ACPI data, that part stub now
Add PciFdoDispatchTable, PciFdoDispatchPnpTable, PciFdoDispatchPowerTable but all stub to PciIrpNotSupported however set correct IRP Dispatch Style for the IRPS
Arbiter support in PciInitializeARbiters done, but PciInterfaces array is NULL (stub) at moment
Add PCI_SIGNATURE, PCI_STATE, PCI_DISAPTCH_STYLE type, add PciInitializeState to begin the state support
Add structure for PCI_FDO_EXTENSION, PCI_SECONDARY_EXTENSION, PCI_INTERFACE, PCI_ARBITER_INSTANCE, PCI_DISPATCH_TABLE
PCI utility functions added: PciFindParentPciFdoExtension, PciInsertEntryAtTail, PciInsertEntryAtHead, PcipLinkSecondaryExtension, PciGetDeviceProperty, PciSendIoctl
Need sir_richard to add arbiter.h header to define ARBITER_INSTANCE for finish support
This 1000 more codes done now~
svn path=/trunk/; revision=47898
2010-06-28 17:30:35 +00:00
|
|
|
IN PVOID Instance,
|
|
|
|
IN PVOID InterfaceData,
|
|
|
|
IN USHORT Version,
|
|
|
|
IN USHORT Size,
|
|
|
|
IN PINTERFACE Interface
|
|
|
|
);
|
|
|
|
|
|
|
|
typedef NTSTATUS (NTAPI *PCI_INTERFACE_INITIALIZER)(
|
|
|
|
IN PVOID Instance
|
|
|
|
);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Generic PCI Interface (Interface, Translator, Arbiter)
|
|
|
|
//
|
|
|
|
typedef struct _PCI_INTERFACE
|
|
|
|
{
|
Fix for code to handle IRP dispatching when unrecognized IRP (Thanks you sir_richard)
Add FDO IRP_MN_QUERY_INTERFACE support (it calls PciQueryInterface)
Add all PCI interface descriptor: PciLocationInterface (GUID_PNP_LOCATION_INTERFACE), PciPmeInterface (GUID_PCI_PME_INTERFACE), PciCardbusPrivateInterface (GUID_PCI_CARDBUS_INTERFACE_PRIVATE), PciLegacyDeviceDetectionInterface (GUID_LEGACY_DEVICE_DETECTION_STANDARD), AgpTargetInterface (GUID_AGP_TARGET_BUS_INTERFACE_STANDARD), PciRoutingInterface (GUID_INT_ROUTE_INTERFACE_STANDARD), BusHandlerInterface (GUID_BUS_INTERFACE_STANDARD) and stub initializer and constructor.
Add missing devhere.c interface file
Add all PCI arbiter descritptor: ArbiterInterfaceBusNumber, ArbiterInterfaceMemory, ArbiterInterfaceIo. Write constructor stub but not handled ArbitersInitialized == TRUE
Also add last-resort PCI interface: TranslatorInterfaceInterrupt (GUID_TRANSLATOR_INTERFACE_STANDARD) and part implement tranirq_Constructor
Add PciQueryInterface to find correct FDO/PDO/ROOT interface for a request and call interface constructor
Fix interface signatures, fix interface constructor type and PCI_INTERFACE, add interface flags (Thanks sir_richard)
Fix Aribtriter code (Thanks sir_richard)
Now another 1200 codes added, soon time for enumeration code!
svn path=/trunk/; revision=48074
2010-07-16 00:39:54 +00:00
|
|
|
CONST GUID *InterfaceType;
|
Implement Root Bus FDO AddDevice codes, get boot config, connect to HAL or ACPI config handlers (PciQueryForPciBusInterface, PciGetConfigHandlers), read BUS FDO hack flag, get _HPP HotPlug PCI ACPI data and initialize arbiter support.
PciGetHotPlugParameters work but no PCI HotPlug support on my machines, so cannot test ACPI data, that part stub now
Add PciFdoDispatchTable, PciFdoDispatchPnpTable, PciFdoDispatchPowerTable but all stub to PciIrpNotSupported however set correct IRP Dispatch Style for the IRPS
Arbiter support in PciInitializeARbiters done, but PciInterfaces array is NULL (stub) at moment
Add PCI_SIGNATURE, PCI_STATE, PCI_DISAPTCH_STYLE type, add PciInitializeState to begin the state support
Add structure for PCI_FDO_EXTENSION, PCI_SECONDARY_EXTENSION, PCI_INTERFACE, PCI_ARBITER_INSTANCE, PCI_DISPATCH_TABLE
PCI utility functions added: PciFindParentPciFdoExtension, PciInsertEntryAtTail, PciInsertEntryAtHead, PcipLinkSecondaryExtension, PciGetDeviceProperty, PciSendIoctl
Need sir_richard to add arbiter.h header to define ARBITER_INSTANCE for finish support
This 1000 more codes done now~
svn path=/trunk/; revision=47898
2010-06-28 17:30:35 +00:00
|
|
|
USHORT MinSize;
|
|
|
|
USHORT MinVersion;
|
|
|
|
USHORT MaxVersion;
|
|
|
|
USHORT Flags;
|
|
|
|
LONG ReferenceCount;
|
|
|
|
PCI_SIGNATURE Signature;
|
|
|
|
PCI_INTERFACE_CONSTRUCTOR Constructor;
|
|
|
|
PCI_INTERFACE_INITIALIZER Initializer;
|
|
|
|
} PCI_INTERFACE, *PPCI_INTERFACE;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Generic Secondary Extension Instance Header (Interface, Translator, Arbiter)
|
|
|
|
//
|
|
|
|
typedef struct PCI_SECONDARY_EXTENSION
|
|
|
|
{
|
|
|
|
SINGLE_LIST_ENTRY List;
|
|
|
|
PCI_SIGNATURE ExtensionType;
|
|
|
|
PVOID Destructor;
|
|
|
|
} PCI_SECONDARY_EXTENSION, *PPCI_SECONDARY_EXTENSION;
|
|
|
|
|
|
|
|
//
|
|
|
|
// PCI Arbiter Instance
|
|
|
|
//
|
|
|
|
typedef struct PCI_ARBITER_INSTANCE
|
|
|
|
{
|
|
|
|
PCI_SECONDARY_EXTENSION Header;
|
|
|
|
PPCI_INTERFACE Interface;
|
|
|
|
PPCI_FDO_EXTENSION BusFdoExtension;
|
|
|
|
WCHAR InstanceName[24];
|
|
|
|
//ARBITER_INSTANCE CommonInstance; FIXME: Need Arbiter Headers
|
|
|
|
} PCI_ARBITER_INSTANCE, *PPCI_ARBITER_INSTANCE;
|
|
|
|
|
2010-07-18 18:58:33 +00:00
|
|
|
//
|
|
|
|
// PCI Verifier Data
|
|
|
|
//
|
|
|
|
typedef struct _PCI_VERIFIER_DATA
|
|
|
|
{
|
|
|
|
ULONG FailureCode;
|
|
|
|
VF_FAILURE_CLASS FailureClass;
|
|
|
|
ULONG AssertionControl;
|
|
|
|
PCHAR DebuggerMessageText;
|
|
|
|
} PCI_VERIFIER_DATA, *PPCI_VERIFIER_DATA;
|
|
|
|
|
- Add support for PnP IRP to PDO: IRP_MN_QUERY_BUS_INFORMATION (PciQueryBusInformation), IRP_MN_QUERY_ID (PciQueryId), IRP_MN_QUERY_DEVICE_TEXT (PciQueryDeviceText), IRP_MN_QUERY_CAPABILITIES (PciQueryCapabilities), IRP_MN_QUERY_DEVICE_RELATIONS (PciQueryTargetDeviceRelations implement, PciQueryEjectionRelations, stub)
- Stub support for PnP IRP to PDO: IRP_MN_QUERY_RESOURCE_REQUIREMENTS (PciQueryRequirements), IRP_MN_QUERY_RESOURCES(PciQueryResources)
- Add support for PnP IRP to FDO: IRP_MN_QUERY_CAPABILITIES (handle in PciFdoIrpQueryDeviceCapabilities)
- Build device capability UI number (PciDetermineSlotNumber), use PIR$ (seem support broken, need to check loader) or device property for bus not root
- Use parent attachee device and this PDO for build device/system wake states, latency, device/system power mappings
- PCI-ID manage support: PciInitIdBuffer, PciIdPrintf, PciIdPrintfAppend
- Debug helper: PciDebugDumpQueryCapabilities
- Thanks richard for advise + beer
PCI-X driver now pass 10000 codes lines!
svn path=/trunk/; revision=48548
2010-08-14 17:09:20 +00:00
|
|
|
//
|
|
|
|
// PCI ID Buffer Descriptor
|
|
|
|
//
|
|
|
|
typedef struct _PCI_ID_BUFFER
|
|
|
|
{
|
|
|
|
ULONG Count;
|
|
|
|
ANSI_STRING Strings[MAX_ANSI_STRINGS];
|
|
|
|
ULONG StringSize[MAX_ANSI_STRINGS];
|
|
|
|
ULONG TotalLength;
|
|
|
|
PCHAR CharBuffer;
|
|
|
|
CHAR BufferData[256];
|
|
|
|
} PCI_ID_BUFFER, *PPCI_ID_BUFFER;
|
|
|
|
|
2010-07-19 16:35:52 +00:00
|
|
|
//
|
|
|
|
// PCI Configuration Callbacks
|
|
|
|
//
|
|
|
|
struct _PCI_CONFIGURATOR_CONTEXT;
|
|
|
|
|
|
|
|
typedef VOID (NTAPI *PCI_CONFIGURATOR_INITIALIZE)(
|
|
|
|
IN struct _PCI_CONFIGURATOR_CONTEXT* Context
|
|
|
|
);
|
|
|
|
|
|
|
|
typedef VOID (NTAPI *PCI_CONFIGURATOR_RESTORE_CURRENT)(
|
|
|
|
IN struct _PCI_CONFIGURATOR_CONTEXT* Context
|
|
|
|
);
|
|
|
|
|
|
|
|
typedef VOID (NTAPI *PCI_CONFIGURATOR_SAVE_LIMITS)(
|
|
|
|
IN struct _PCI_CONFIGURATOR_CONTEXT* Context
|
|
|
|
);
|
|
|
|
|
|
|
|
typedef VOID (NTAPI *PCI_CONFIGURATOR_SAVE_CURRENT_SETTINGS)(
|
|
|
|
IN struct _PCI_CONFIGURATOR_CONTEXT* Context
|
|
|
|
);
|
|
|
|
|
|
|
|
typedef VOID (NTAPI *PCI_CONFIGURATOR_CHANGE_RESOURCE_SETTINGS)(
|
2010-09-12 06:03:12 +00:00
|
|
|
IN PPCI_PDO_EXTENSION PdoExtension,
|
|
|
|
IN PPCI_COMMON_HEADER PciData
|
2010-07-19 16:35:52 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
typedef VOID (NTAPI *PCI_CONFIGURATOR_GET_ADDITIONAL_RESOURCE_DESCRIPTORS)(
|
|
|
|
IN struct _PCI_CONFIGURATOR_CONTEXT* Context,
|
|
|
|
IN PPCI_COMMON_HEADER PciData,
|
|
|
|
IN PIO_RESOURCE_DESCRIPTOR IoDescriptor
|
|
|
|
);
|
|
|
|
|
|
|
|
typedef VOID (NTAPI *PCI_CONFIGURATOR_RESET_DEVICE)(
|
2010-09-12 06:03:12 +00:00
|
|
|
IN PPCI_PDO_EXTENSION PdoExtension,
|
|
|
|
IN PPCI_COMMON_HEADER PciData
|
2010-07-19 16:35:52 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
//
|
|
|
|
// PCI Configurator
|
|
|
|
//
|
|
|
|
typedef struct _PCI_CONFIGURATOR
|
|
|
|
{
|
|
|
|
PCI_CONFIGURATOR_INITIALIZE Initialize;
|
|
|
|
PCI_CONFIGURATOR_RESTORE_CURRENT RestoreCurrent;
|
|
|
|
PCI_CONFIGURATOR_SAVE_LIMITS SaveLimits;
|
|
|
|
PCI_CONFIGURATOR_SAVE_CURRENT_SETTINGS SaveCurrentSettings;
|
|
|
|
PCI_CONFIGURATOR_CHANGE_RESOURCE_SETTINGS ChangeResourceSettings;
|
|
|
|
PCI_CONFIGURATOR_GET_ADDITIONAL_RESOURCE_DESCRIPTORS GetAdditionalResourceDescriptors;
|
|
|
|
PCI_CONFIGURATOR_RESET_DEVICE ResetDevice;
|
|
|
|
} PCI_CONFIGURATOR, *PPCI_CONFIGURATOR;
|
|
|
|
|
|
|
|
//
|
|
|
|
// PCI Configurator Context
|
|
|
|
//
|
|
|
|
typedef struct _PCI_CONFIGURATOR_CONTEXT
|
|
|
|
{
|
|
|
|
PPCI_PDO_EXTENSION PdoExtension;
|
|
|
|
PPCI_COMMON_HEADER Current;
|
|
|
|
PPCI_COMMON_HEADER PciData;
|
|
|
|
PPCI_CONFIGURATOR Configurator;
|
|
|
|
USHORT SecondaryStatus;
|
|
|
|
USHORT Status;
|
|
|
|
USHORT Command;
|
|
|
|
} PCI_CONFIGURATOR_CONTEXT, *PPCI_CONFIGURATOR_CONTEXT;
|
|
|
|
|
|
|
|
//
|
|
|
|
// PCI IPI Function
|
|
|
|
//
|
|
|
|
typedef VOID (NTAPI *PCI_IPI_FUNCTION)(
|
|
|
|
IN PVOID Reserved,
|
2010-09-12 06:03:12 +00:00
|
|
|
IN PVOID Context
|
2010-07-19 16:35:52 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
//
|
|
|
|
// PCI IPI Context
|
|
|
|
//
|
|
|
|
typedef struct _PCI_IPI_CONTEXT
|
|
|
|
{
|
|
|
|
LONG RunCount;
|
|
|
|
ULONG Barrier;
|
2010-09-12 06:03:12 +00:00
|
|
|
PVOID DeviceExtension;
|
2010-07-19 16:35:52 +00:00
|
|
|
PCI_IPI_FUNCTION Function;
|
|
|
|
PVOID Context;
|
|
|
|
} PCI_IPI_CONTEXT, *PPCI_IPI_CONTEXT;
|
|
|
|
|
2010-09-23 13:24:41 +00:00
|
|
|
//
|
|
|
|
// PCI Legacy Device Location Cache
|
|
|
|
//
|
|
|
|
typedef struct _PCI_LEGACY_DEVICE
|
|
|
|
{
|
|
|
|
struct _PCI_LEGACY_DEVICE *Next;
|
|
|
|
PDEVICE_OBJECT DeviceObject;
|
|
|
|
ULONG BusNumber;
|
|
|
|
ULONG SlotNumber;
|
|
|
|
UCHAR InterruptLine;
|
|
|
|
UCHAR InterruptPin;
|
|
|
|
UCHAR BaseClass;
|
|
|
|
UCHAR SubClass;
|
|
|
|
PDEVICE_OBJECT PhysicalDeviceObject;
|
|
|
|
ROUTING_TOKEN RoutingToken;
|
|
|
|
PPCI_PDO_EXTENSION PdoExtension;
|
|
|
|
} PCI_LEGACY_DEVICE, *PPCI_LEGACY_DEVICE;
|
|
|
|
|
Begin implement full PCI Bus Driver. code by me comments by sir_richard to avoid Engrish
DriverEntry full 100% implemented, ACPI WatchDog detect, PCI IRQ Routing detect, PCI errata/hackflag detect (PciGetDebugPorts not support, need PCI Debug Device to test)
Native (S)ATA, PCI BIOS Resource Lock, System Errata/Hackflag also is detect
HAL Hoooking enabled, callbacks stub
Stub PnP Interfaces: PciAddDevice, PciDriverUnload, PciDispatchIrp
PCI utility routines: PciUnicodeStringStrStr, PciStringToUSHORT, PciIsSuiteVersion, PciIsDatacenter, PciOpenKey, PciGetRegistryValue, PciBuildDefaultExclusionList done
PCI Verifier Support for future: PciVerifierInit/PciVerifierProfileChangeCallback (stub)
Thank you for much patience~ This 1200 first codes, have 12000 codes more to come!~~
svn path=/trunk/; revision=47894
2010-06-28 05:23:31 +00:00
|
|
|
//
|
|
|
|
// IRP Dispatch Routines
|
|
|
|
//
|
2013-05-10 10:22:01 +00:00
|
|
|
|
|
|
|
DRIVER_DISPATCH PciDispatchIrp;
|
|
|
|
|
Begin implement full PCI Bus Driver. code by me comments by sir_richard to avoid Engrish
DriverEntry full 100% implemented, ACPI WatchDog detect, PCI IRQ Routing detect, PCI errata/hackflag detect (PciGetDebugPorts not support, need PCI Debug Device to test)
Native (S)ATA, PCI BIOS Resource Lock, System Errata/Hackflag also is detect
HAL Hoooking enabled, callbacks stub
Stub PnP Interfaces: PciAddDevice, PciDriverUnload, PciDispatchIrp
PCI utility routines: PciUnicodeStringStrStr, PciStringToUSHORT, PciIsSuiteVersion, PciIsDatacenter, PciOpenKey, PciGetRegistryValue, PciBuildDefaultExclusionList done
PCI Verifier Support for future: PciVerifierInit/PciVerifierProfileChangeCallback (stub)
Thank you for much patience~ This 1200 first codes, have 12000 codes more to come!~~
svn path=/trunk/; revision=47894
2010-06-28 05:23:31 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciDispatchIrp(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp
|
|
|
|
);
|
|
|
|
|
Implement Root Bus FDO AddDevice codes, get boot config, connect to HAL or ACPI config handlers (PciQueryForPciBusInterface, PciGetConfigHandlers), read BUS FDO hack flag, get _HPP HotPlug PCI ACPI data and initialize arbiter support.
PciGetHotPlugParameters work but no PCI HotPlug support on my machines, so cannot test ACPI data, that part stub now
Add PciFdoDispatchTable, PciFdoDispatchPnpTable, PciFdoDispatchPowerTable but all stub to PciIrpNotSupported however set correct IRP Dispatch Style for the IRPS
Arbiter support in PciInitializeARbiters done, but PciInterfaces array is NULL (stub) at moment
Add PCI_SIGNATURE, PCI_STATE, PCI_DISAPTCH_STYLE type, add PciInitializeState to begin the state support
Add structure for PCI_FDO_EXTENSION, PCI_SECONDARY_EXTENSION, PCI_INTERFACE, PCI_ARBITER_INSTANCE, PCI_DISPATCH_TABLE
PCI utility functions added: PciFindParentPciFdoExtension, PciInsertEntryAtTail, PciInsertEntryAtHead, PcipLinkSecondaryExtension, PciGetDeviceProperty, PciSendIoctl
Need sir_richard to add arbiter.h header to define ARBITER_INSTANCE for finish support
This 1000 more codes done now~
svn path=/trunk/; revision=47898
2010-06-28 17:30:35 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciIrpNotSupported(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
Fix for code to handle IRP dispatching when unrecognized IRP (Thanks you sir_richard)
Add FDO IRP_MN_QUERY_INTERFACE support (it calls PciQueryInterface)
Add all PCI interface descriptor: PciLocationInterface (GUID_PNP_LOCATION_INTERFACE), PciPmeInterface (GUID_PCI_PME_INTERFACE), PciCardbusPrivateInterface (GUID_PCI_CARDBUS_INTERFACE_PRIVATE), PciLegacyDeviceDetectionInterface (GUID_LEGACY_DEVICE_DETECTION_STANDARD), AgpTargetInterface (GUID_AGP_TARGET_BUS_INTERFACE_STANDARD), PciRoutingInterface (GUID_INT_ROUTE_INTERFACE_STANDARD), BusHandlerInterface (GUID_BUS_INTERFACE_STANDARD) and stub initializer and constructor.
Add missing devhere.c interface file
Add all PCI arbiter descritptor: ArbiterInterfaceBusNumber, ArbiterInterfaceMemory, ArbiterInterfaceIo. Write constructor stub but not handled ArbitersInitialized == TRUE
Also add last-resort PCI interface: TranslatorInterfaceInterrupt (GUID_TRANSLATOR_INTERFACE_STANDARD) and part implement tranirq_Constructor
Add PciQueryInterface to find correct FDO/PDO/ROOT interface for a request and call interface constructor
Fix interface signatures, fix interface constructor type and PCI_INTERFACE, add interface flags (Thanks sir_richard)
Fix Aribtriter code (Thanks sir_richard)
Now another 1200 codes added, soon time for enumeration code!
svn path=/trunk/; revision=48074
2010-07-16 00:39:54 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPassIrpFromFdoToPdo(
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension,
|
|
|
|
IN PIRP Irp
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciCallDownIrpStack(
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension,
|
|
|
|
IN PIRP Irp
|
|
|
|
);
|
|
|
|
|
2010-07-17 15:59:09 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciIrpInvalidDeviceRequest(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
2010-06-30 01:39:21 +00:00
|
|
|
//
|
|
|
|
// Power Routines
|
|
|
|
//
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciFdoWaitWake(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciFdoSetPowerState(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciFdoIrpQueryPower(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
2010-07-18 18:58:33 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciSetPowerManagedDevicePowerState(
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension,
|
|
|
|
IN DEVICE_POWER_STATE DeviceState,
|
|
|
|
IN BOOLEAN IrpSet
|
|
|
|
);
|
|
|
|
|
Begin implement full PCI Bus Driver. code by me comments by sir_richard to avoid Engrish
DriverEntry full 100% implemented, ACPI WatchDog detect, PCI IRQ Routing detect, PCI errata/hackflag detect (PciGetDebugPorts not support, need PCI Debug Device to test)
Native (S)ATA, PCI BIOS Resource Lock, System Errata/Hackflag also is detect
HAL Hoooking enabled, callbacks stub
Stub PnP Interfaces: PciAddDevice, PciDriverUnload, PciDispatchIrp
PCI utility routines: PciUnicodeStringStrStr, PciStringToUSHORT, PciIsSuiteVersion, PciIsDatacenter, PciOpenKey, PciGetRegistryValue, PciBuildDefaultExclusionList done
PCI Verifier Support for future: PciVerifierInit/PciVerifierProfileChangeCallback (stub)
Thank you for much patience~ This 1200 first codes, have 12000 codes more to come!~~
svn path=/trunk/; revision=47894
2010-06-28 05:23:31 +00:00
|
|
|
//
|
|
|
|
// Bus FDO Routines
|
|
|
|
//
|
2013-05-10 10:22:01 +00:00
|
|
|
|
|
|
|
DRIVER_ADD_DEVICE PciAddDevice;
|
|
|
|
|
Begin implement full PCI Bus Driver. code by me comments by sir_richard to avoid Engrish
DriverEntry full 100% implemented, ACPI WatchDog detect, PCI IRQ Routing detect, PCI errata/hackflag detect (PciGetDebugPorts not support, need PCI Debug Device to test)
Native (S)ATA, PCI BIOS Resource Lock, System Errata/Hackflag also is detect
HAL Hoooking enabled, callbacks stub
Stub PnP Interfaces: PciAddDevice, PciDriverUnload, PciDispatchIrp
PCI utility routines: PciUnicodeStringStrStr, PciStringToUSHORT, PciIsSuiteVersion, PciIsDatacenter, PciOpenKey, PciGetRegistryValue, PciBuildDefaultExclusionList done
PCI Verifier Support for future: PciVerifierInit/PciVerifierProfileChangeCallback (stub)
Thank you for much patience~ This 1200 first codes, have 12000 codes more to come!~~
svn path=/trunk/; revision=47894
2010-06-28 05:23:31 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciAddDevice(
|
|
|
|
IN PDRIVER_OBJECT DriverObject,
|
|
|
|
IN PDEVICE_OBJECT PhysicalDeviceObject
|
|
|
|
);
|
|
|
|
|
2010-06-30 01:39:21 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciFdoIrpStartDevice(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciFdoIrpQueryRemoveDevice(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciFdoIrpRemoveDevice(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciFdoIrpCancelRemoveDevice(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciFdoIrpStopDevice(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciFdoIrpQueryStopDevice(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciFdoIrpCancelStopDevice(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciFdoIrpQueryDeviceRelations(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciFdoIrpQueryInterface(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciFdoIrpQueryCapabilities(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciFdoIrpDeviceUsageNotification(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciFdoIrpSurpriseRemoval(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciFdoIrpQueryLegacyBusInformation(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
2010-07-17 15:59:09 +00:00
|
|
|
//
|
|
|
|
// Device PDO Routines
|
|
|
|
//
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPdoCreate(
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension,
|
|
|
|
IN PCI_SLOT_NUMBER Slot,
|
|
|
|
OUT PDEVICE_OBJECT *PdoDeviceObject
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPdoWaitWake(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPdoSetPowerState(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPdoIrpQueryPower(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPdoIrpStartDevice(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPdoIrpQueryRemoveDevice(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPdoIrpRemoveDevice(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPdoIrpCancelRemoveDevice(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPdoIrpStopDevice(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPdoIrpQueryStopDevice(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPdoIrpCancelStopDevice(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPdoIrpQueryDeviceRelations(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPdoIrpQueryInterface(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPdoIrpQueryCapabilities(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPdoIrpQueryResources(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPdoIrpQueryResourceRequirements(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPdoIrpQueryDeviceText(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPdoIrpReadConfig(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPdoIrpWriteConfig(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPdoIrpQueryId(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPdoIrpQueryDeviceState(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPdoIrpQueryBusInformation(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPdoIrpDeviceUsageNotification(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPdoIrpSurpriseRemoval(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPdoIrpQueryLegacyBusInformation(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
|
Begin implement full PCI Bus Driver. code by me comments by sir_richard to avoid Engrish
DriverEntry full 100% implemented, ACPI WatchDog detect, PCI IRQ Routing detect, PCI errata/hackflag detect (PciGetDebugPorts not support, need PCI Debug Device to test)
Native (S)ATA, PCI BIOS Resource Lock, System Errata/Hackflag also is detect
HAL Hoooking enabled, callbacks stub
Stub PnP Interfaces: PciAddDevice, PciDriverUnload, PciDispatchIrp
PCI utility routines: PciUnicodeStringStrStr, PciStringToUSHORT, PciIsSuiteVersion, PciIsDatacenter, PciOpenKey, PciGetRegistryValue, PciBuildDefaultExclusionList done
PCI Verifier Support for future: PciVerifierInit/PciVerifierProfileChangeCallback (stub)
Thank you for much patience~ This 1200 first codes, have 12000 codes more to come!~~
svn path=/trunk/; revision=47894
2010-06-28 05:23:31 +00:00
|
|
|
//
|
|
|
|
// HAL Callback/Hook Routines
|
|
|
|
//
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PciHookHal(
|
|
|
|
VOID
|
|
|
|
);
|
|
|
|
|
|
|
|
//
|
|
|
|
// PCI Verifier Routines
|
|
|
|
//
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PciVerifierInit(
|
|
|
|
IN PDRIVER_OBJECT DriverObject
|
|
|
|
);
|
|
|
|
|
2010-07-18 18:58:33 +00:00
|
|
|
PPCI_VERIFIER_DATA
|
|
|
|
NTAPI
|
|
|
|
PciVerifierRetrieveFailureData(
|
|
|
|
IN ULONG FailureCode
|
|
|
|
);
|
|
|
|
|
Begin implement full PCI Bus Driver. code by me comments by sir_richard to avoid Engrish
DriverEntry full 100% implemented, ACPI WatchDog detect, PCI IRQ Routing detect, PCI errata/hackflag detect (PciGetDebugPorts not support, need PCI Debug Device to test)
Native (S)ATA, PCI BIOS Resource Lock, System Errata/Hackflag also is detect
HAL Hoooking enabled, callbacks stub
Stub PnP Interfaces: PciAddDevice, PciDriverUnload, PciDispatchIrp
PCI utility routines: PciUnicodeStringStrStr, PciStringToUSHORT, PciIsSuiteVersion, PciIsDatacenter, PciOpenKey, PciGetRegistryValue, PciBuildDefaultExclusionList done
PCI Verifier Support for future: PciVerifierInit/PciVerifierProfileChangeCallback (stub)
Thank you for much patience~ This 1200 first codes, have 12000 codes more to come!~~
svn path=/trunk/; revision=47894
2010-06-28 05:23:31 +00:00
|
|
|
//
|
|
|
|
// Utility Routines
|
|
|
|
//
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
PciStringToUSHORT(
|
|
|
|
IN PWCHAR String,
|
|
|
|
OUT PUSHORT Value
|
|
|
|
);
|
|
|
|
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
PciIsDatacenter(
|
|
|
|
VOID
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciBuildDefaultExclusionLists(
|
|
|
|
VOID
|
|
|
|
);
|
|
|
|
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
PciUnicodeStringStrStr(
|
|
|
|
IN PUNICODE_STRING InputString,
|
|
|
|
IN PCUNICODE_STRING EqualString,
|
|
|
|
IN BOOLEAN CaseInSensitive
|
|
|
|
);
|
|
|
|
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
PciOpenKey(
|
|
|
|
IN PWCHAR KeyName,
|
|
|
|
IN HANDLE RootKey,
|
|
|
|
IN ACCESS_MASK DesiredAccess,
|
|
|
|
OUT PHANDLE KeyHandle,
|
|
|
|
OUT PNTSTATUS KeyStatus
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciGetRegistryValue(
|
|
|
|
IN PWCHAR ValueName,
|
|
|
|
IN PWCHAR KeyName,
|
|
|
|
IN HANDLE RootHandle,
|
|
|
|
IN ULONG Type,
|
|
|
|
OUT PVOID *OutputBuffer,
|
|
|
|
OUT PULONG OutputLength
|
|
|
|
);
|
2010-04-01 19:07:40 +00:00
|
|
|
|
Implement Root Bus FDO AddDevice codes, get boot config, connect to HAL or ACPI config handlers (PciQueryForPciBusInterface, PciGetConfigHandlers), read BUS FDO hack flag, get _HPP HotPlug PCI ACPI data and initialize arbiter support.
PciGetHotPlugParameters work but no PCI HotPlug support on my machines, so cannot test ACPI data, that part stub now
Add PciFdoDispatchTable, PciFdoDispatchPnpTable, PciFdoDispatchPowerTable but all stub to PciIrpNotSupported however set correct IRP Dispatch Style for the IRPS
Arbiter support in PciInitializeARbiters done, but PciInterfaces array is NULL (stub) at moment
Add PCI_SIGNATURE, PCI_STATE, PCI_DISAPTCH_STYLE type, add PciInitializeState to begin the state support
Add structure for PCI_FDO_EXTENSION, PCI_SECONDARY_EXTENSION, PCI_INTERFACE, PCI_ARBITER_INSTANCE, PCI_DISPATCH_TABLE
PCI utility functions added: PciFindParentPciFdoExtension, PciInsertEntryAtTail, PciInsertEntryAtHead, PcipLinkSecondaryExtension, PciGetDeviceProperty, PciSendIoctl
Need sir_richard to add arbiter.h header to define ARBITER_INSTANCE for finish support
This 1000 more codes done now~
svn path=/trunk/; revision=47898
2010-06-28 17:30:35 +00:00
|
|
|
PPCI_FDO_EXTENSION
|
|
|
|
NTAPI
|
|
|
|
PciFindParentPciFdoExtension(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PKEVENT Lock
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PciInsertEntryAtTail(
|
|
|
|
IN PSINGLE_LIST_ENTRY ListHead,
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension,
|
|
|
|
IN PKEVENT Lock
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciGetDeviceProperty(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN DEVICE_REGISTRY_PROPERTY DeviceProperty,
|
|
|
|
OUT PVOID *OutputBuffer
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciSendIoctl(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN ULONG IoControlCode,
|
|
|
|
IN PVOID InputBuffer,
|
|
|
|
IN ULONG InputBufferLength,
|
|
|
|
IN PVOID OutputBuffer,
|
|
|
|
IN ULONG OutputBufferLength
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PcipLinkSecondaryExtension(
|
|
|
|
IN PSINGLE_LIST_ENTRY List,
|
|
|
|
IN PVOID Lock,
|
|
|
|
IN PPCI_SECONDARY_EXTENSION SecondaryExtension,
|
|
|
|
IN PCI_SIGNATURE ExtensionType,
|
|
|
|
IN PVOID Destructor
|
|
|
|
);
|
|
|
|
|
2010-07-16 01:14:52 +00:00
|
|
|
PPCI_SECONDARY_EXTENSION
|
|
|
|
NTAPI
|
|
|
|
PciFindNextSecondaryExtension(
|
|
|
|
IN PSINGLE_LIST_ENTRY ListHead,
|
|
|
|
IN PCI_SIGNATURE ExtensionType
|
|
|
|
);
|
|
|
|
|
2010-07-17 15:09:19 +00:00
|
|
|
ULONGLONG
|
|
|
|
NTAPI
|
|
|
|
PciGetHackFlags(
|
|
|
|
IN USHORT VendorId,
|
|
|
|
IN USHORT DeviceId,
|
|
|
|
IN USHORT SubVendorId,
|
|
|
|
IN USHORT SubSystemId,
|
|
|
|
IN UCHAR RevisionId
|
|
|
|
);
|
|
|
|
|
|
|
|
PPCI_PDO_EXTENSION
|
|
|
|
NTAPI
|
|
|
|
PciFindPdoByFunction(
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension,
|
|
|
|
IN ULONG FunctionNumber,
|
|
|
|
IN PPCI_COMMON_HEADER PciData
|
|
|
|
);
|
|
|
|
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
PciIsCriticalDeviceClass(
|
|
|
|
IN UCHAR BaseClass,
|
|
|
|
IN UCHAR SubClass
|
|
|
|
);
|
|
|
|
|
2010-07-17 16:53:18 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
PciIsDeviceOnDebugPath(
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciGetBiosConfig(
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension,
|
|
|
|
OUT PPCI_COMMON_HEADER PciData
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciSaveBiosConfig(
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension,
|
|
|
|
OUT PPCI_COMMON_HEADER PciData
|
|
|
|
);
|
|
|
|
|
2010-07-18 18:58:33 +00:00
|
|
|
UCHAR
|
|
|
|
NTAPI
|
|
|
|
PciReadDeviceCapability(
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension,
|
|
|
|
IN UCHAR Offset,
|
|
|
|
IN ULONG CapabilityId,
|
|
|
|
OUT PPCI_CAPABILITIES_HEADER Buffer,
|
|
|
|
IN ULONG Length
|
|
|
|
);
|
|
|
|
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
PciCanDisableDecodes(
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension,
|
|
|
|
IN PPCI_COMMON_HEADER Config,
|
|
|
|
IN ULONGLONG HackFlags,
|
|
|
|
IN BOOLEAN ForPowerDown
|
|
|
|
);
|
|
|
|
|
2010-08-09 19:07:52 +00:00
|
|
|
PCI_DEVICE_TYPES
|
|
|
|
NTAPI
|
|
|
|
PciClassifyDeviceType(
|
|
|
|
IN PPCI_PDO_EXTENSION PdoExtension
|
|
|
|
);
|
|
|
|
|
2013-05-10 10:22:01 +00:00
|
|
|
KIPI_BROADCAST_WORKER PciExecuteCriticalSystemRoutine;
|
|
|
|
|
2010-07-19 16:35:52 +00:00
|
|
|
ULONG_PTR
|
|
|
|
NTAPI
|
|
|
|
PciExecuteCriticalSystemRoutine(
|
|
|
|
IN ULONG_PTR IpiContext
|
|
|
|
);
|
|
|
|
|
Add all pci bridge control function (PciBridgeIoBase, PciBridgeIoLimit, PciBridgeMemoryBase, PciBridgeMemoryLimit, PciBridgePrefetchMemoryBase, PciBridgePrefetchMemoryLimit, PciBridgeMemoryWorstCasealignment, PciBridgeIsPositiveDecode, PciBridgeIsSubtractiveDecode)
More support ICH0/1/2/3/4 hub
Add all PCI2PCI bridge limit/current resource codes (PPBridge_*), now is BAR setup okay, and Device_* must be implement
Support ISA+VGA legacy decode, 20+64-bit decode, ROM BAR, prefetch BAR
svn path=/trunk/; revision=48298
2010-07-27 03:24:24 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
PciCreateIoDescriptorFromBarLimit(
|
|
|
|
PIO_RESOURCE_DESCRIPTOR ResourceDescriptor,
|
|
|
|
IN PULONG BarArray,
|
|
|
|
IN BOOLEAN Rom
|
|
|
|
);
|
|
|
|
|
Joint patch
By sir_richard: [PCIX]: - Implement PciIsSlotPresentInParentMethod for ACPI query, and PcoDecodeEnable utility function.
- Implement PciConfigureIdeController based on WDHC Whitepaper "How Windows Switches a Controller to Native Mode". Check for PciEanbleNativeModeATA in registry, InitSafeBootMode, and call the ACPI driver to evaluate if NATA is present on the slot. Only configure the controller if both channels support native mode, as this is a Windows restriction.
- Implement PciApplyHacks for enumeration and resource update cases. In the first case, we handle legacy DEC Alpha Intel i82375 and i82378 PCI-to-(E)ISA bridges with invalid class codes. In the second, we configure IDE controllers for Native mode, except the OPTi Viper-M, which is known to cause issues. We also support cards with legacy VGA decodes by telling the arbiter to enable full access to the rangesm and finally we completely disable the decodes on Compaq PCI Hotplug Controllers (Revision 17) on PAE systems, as they have bugs handling 64-bit addresses. Finally, on resource updates, we apply a vendor-specific errata to the IBM 20H2999 PCI Docking Bridge (Hotplug) used on Thinkpad 600 Series laptops, and we attempt to avoid issues that can happen on certain devices that are plugged into an ICH1/2/3/4 Intel Hub when it has been configured to do subtractive decode. Full information on these workarounds can be seen in the comments. Finally, we also enable CardBUS devices for ACPI-compliant mode, by crossing out the LegacyBaseAddress in the CardBUS Type 2 PCI Configuration Header.
- Miscelleaneous code cleanups.
By eVb: More PciScanBus support, for debug PCI caps that driver use are dump, and detect nonBIOS configure device (spec is said that CacheLineSize != 0, LatencyTimer != 0 (on PCI-X, != 64)), if found NeedsHotPlugConfiguration to be set
By eVb: Support PCI_HACK_VIDEO_LEGACY_DECODE (call ario_ApplyBrokenVideoHack, but no arb support to do work)
svn path=/trunk/; revision=48116
2010-07-19 15:15:39 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
PciIsSlotPresentInParentMethod(
|
|
|
|
IN PPCI_PDO_EXTENSION PdoExtension,
|
|
|
|
IN ULONG Method
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PciDecodeEnable(
|
|
|
|
IN PPCI_PDO_EXTENSION PdoExtension,
|
|
|
|
IN BOOLEAN Enable,
|
|
|
|
OUT PUSHORT Command
|
|
|
|
);
|
|
|
|
|
- Add support for PnP IRP to PDO: IRP_MN_QUERY_BUS_INFORMATION (PciQueryBusInformation), IRP_MN_QUERY_ID (PciQueryId), IRP_MN_QUERY_DEVICE_TEXT (PciQueryDeviceText), IRP_MN_QUERY_CAPABILITIES (PciQueryCapabilities), IRP_MN_QUERY_DEVICE_RELATIONS (PciQueryTargetDeviceRelations implement, PciQueryEjectionRelations, stub)
- Stub support for PnP IRP to PDO: IRP_MN_QUERY_RESOURCE_REQUIREMENTS (PciQueryRequirements), IRP_MN_QUERY_RESOURCES(PciQueryResources)
- Add support for PnP IRP to FDO: IRP_MN_QUERY_CAPABILITIES (handle in PciFdoIrpQueryDeviceCapabilities)
- Build device capability UI number (PciDetermineSlotNumber), use PIR$ (seem support broken, need to check loader) or device property for bus not root
- Use parent attachee device and this PDO for build device/system wake states, latency, device/system power mappings
- PCI-ID manage support: PciInitIdBuffer, PciIdPrintf, PciIdPrintfAppend
- Debug helper: PciDebugDumpQueryCapabilities
- Thanks richard for advise + beer
PCI-X driver now pass 10000 codes lines!
svn path=/trunk/; revision=48548
2010-08-14 17:09:20 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciQueryBusInformation(
|
|
|
|
IN PPCI_PDO_EXTENSION PdoExtension,
|
|
|
|
IN PPNP_BUS_INFORMATION* Buffer
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciQueryCapabilities(
|
|
|
|
IN PPCI_PDO_EXTENSION PdoExtension,
|
|
|
|
IN OUT PDEVICE_CAPABILITIES DeviceCapability
|
|
|
|
);
|
|
|
|
|
2010-09-12 06:03:12 +00:00
|
|
|
PCM_PARTIAL_RESOURCE_DESCRIPTOR
|
|
|
|
NTAPI
|
|
|
|
PciNextPartialDescriptor(
|
|
|
|
PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescriptor
|
|
|
|
);
|
|
|
|
|
Implement Root Bus FDO AddDevice codes, get boot config, connect to HAL or ACPI config handlers (PciQueryForPciBusInterface, PciGetConfigHandlers), read BUS FDO hack flag, get _HPP HotPlug PCI ACPI data and initialize arbiter support.
PciGetHotPlugParameters work but no PCI HotPlug support on my machines, so cannot test ACPI data, that part stub now
Add PciFdoDispatchTable, PciFdoDispatchPnpTable, PciFdoDispatchPowerTable but all stub to PciIrpNotSupported however set correct IRP Dispatch Style for the IRPS
Arbiter support in PciInitializeARbiters done, but PciInterfaces array is NULL (stub) at moment
Add PCI_SIGNATURE, PCI_STATE, PCI_DISAPTCH_STYLE type, add PciInitializeState to begin the state support
Add structure for PCI_FDO_EXTENSION, PCI_SECONDARY_EXTENSION, PCI_INTERFACE, PCI_ARBITER_INSTANCE, PCI_DISPATCH_TABLE
PCI utility functions added: PciFindParentPciFdoExtension, PciInsertEntryAtTail, PciInsertEntryAtHead, PcipLinkSecondaryExtension, PciGetDeviceProperty, PciSendIoctl
Need sir_richard to add arbiter.h header to define ARBITER_INSTANCE for finish support
This 1000 more codes done now~
svn path=/trunk/; revision=47898
2010-06-28 17:30:35 +00:00
|
|
|
//
|
|
|
|
// Configuration Routines
|
|
|
|
//
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciGetConfigHandlers(
|
|
|
|
IN PPCI_FDO_EXTENSION FdoExtension
|
|
|
|
);
|
|
|
|
|
2010-07-17 01:31:26 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PciReadSlotConfig(
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension,
|
|
|
|
IN PCI_SLOT_NUMBER Slot,
|
|
|
|
IN PVOID Buffer,
|
|
|
|
IN ULONG Offset,
|
|
|
|
IN ULONG Length
|
|
|
|
);
|
|
|
|
|
2010-07-17 16:53:18 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PciWriteDeviceConfig(
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension,
|
|
|
|
IN PVOID Buffer,
|
|
|
|
IN ULONG Offset,
|
|
|
|
IN ULONG Length
|
|
|
|
);
|
|
|
|
|
2010-07-18 18:58:33 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PciReadDeviceConfig(
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension,
|
|
|
|
IN PVOID Buffer,
|
|
|
|
IN ULONG Offset,
|
|
|
|
IN ULONG Length
|
|
|
|
);
|
|
|
|
|
2010-07-17 16:53:18 +00:00
|
|
|
UCHAR
|
|
|
|
NTAPI
|
|
|
|
PciGetAdjustedInterruptLine(
|
|
|
|
IN PPCI_PDO_EXTENSION PdoExtension
|
|
|
|
);
|
|
|
|
|
Implement Root Bus FDO AddDevice codes, get boot config, connect to HAL or ACPI config handlers (PciQueryForPciBusInterface, PciGetConfigHandlers), read BUS FDO hack flag, get _HPP HotPlug PCI ACPI data and initialize arbiter support.
PciGetHotPlugParameters work but no PCI HotPlug support on my machines, so cannot test ACPI data, that part stub now
Add PciFdoDispatchTable, PciFdoDispatchPnpTable, PciFdoDispatchPowerTable but all stub to PciIrpNotSupported however set correct IRP Dispatch Style for the IRPS
Arbiter support in PciInitializeARbiters done, but PciInterfaces array is NULL (stub) at moment
Add PCI_SIGNATURE, PCI_STATE, PCI_DISAPTCH_STYLE type, add PciInitializeState to begin the state support
Add structure for PCI_FDO_EXTENSION, PCI_SECONDARY_EXTENSION, PCI_INTERFACE, PCI_ARBITER_INSTANCE, PCI_DISPATCH_TABLE
PCI utility functions added: PciFindParentPciFdoExtension, PciInsertEntryAtTail, PciInsertEntryAtHead, PcipLinkSecondaryExtension, PciGetDeviceProperty, PciSendIoctl
Need sir_richard to add arbiter.h header to define ARBITER_INSTANCE for finish support
This 1000 more codes done now~
svn path=/trunk/; revision=47898
2010-06-28 17:30:35 +00:00
|
|
|
//
|
|
|
|
// State Machine Logic Transition Routines
|
|
|
|
//
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PciInitializeState(
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension
|
|
|
|
);
|
|
|
|
|
2010-07-16 01:14:52 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciBeginStateTransition(
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension,
|
|
|
|
IN PCI_STATE NewState
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciCancelStateTransition(
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension,
|
|
|
|
IN PCI_STATE NewState
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PciCommitStateTransition(
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension,
|
|
|
|
IN PCI_STATE NewState
|
|
|
|
);
|
|
|
|
|
Implement Root Bus FDO AddDevice codes, get boot config, connect to HAL or ACPI config handlers (PciQueryForPciBusInterface, PciGetConfigHandlers), read BUS FDO hack flag, get _HPP HotPlug PCI ACPI data and initialize arbiter support.
PciGetHotPlugParameters work but no PCI HotPlug support on my machines, so cannot test ACPI data, that part stub now
Add PciFdoDispatchTable, PciFdoDispatchPnpTable, PciFdoDispatchPowerTable but all stub to PciIrpNotSupported however set correct IRP Dispatch Style for the IRPS
Arbiter support in PciInitializeARbiters done, but PciInterfaces array is NULL (stub) at moment
Add PCI_SIGNATURE, PCI_STATE, PCI_DISAPTCH_STYLE type, add PciInitializeState to begin the state support
Add structure for PCI_FDO_EXTENSION, PCI_SECONDARY_EXTENSION, PCI_INTERFACE, PCI_ARBITER_INSTANCE, PCI_DISPATCH_TABLE
PCI utility functions added: PciFindParentPciFdoExtension, PciInsertEntryAtTail, PciInsertEntryAtHead, PcipLinkSecondaryExtension, PciGetDeviceProperty, PciSendIoctl
Need sir_richard to add arbiter.h header to define ARBITER_INSTANCE for finish support
This 1000 more codes done now~
svn path=/trunk/; revision=47898
2010-06-28 17:30:35 +00:00
|
|
|
//
|
|
|
|
// Arbiter Support
|
|
|
|
//
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciInitializeArbiters(
|
|
|
|
IN PPCI_FDO_EXTENSION FdoExtension
|
|
|
|
);
|
|
|
|
|
2010-07-16 01:14:52 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciInitializeArbiterRanges(
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension,
|
|
|
|
IN PCM_RESOURCE_LIST Resources
|
|
|
|
);
|
|
|
|
|
2010-06-30 01:39:21 +00:00
|
|
|
//
|
|
|
|
// Debug Helpers
|
|
|
|
//
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
PciDebugIrpDispatchDisplay(
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension,
|
|
|
|
IN USHORT MaxMinor
|
|
|
|
);
|
|
|
|
|
2010-07-17 01:31:26 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PciDebugDumpCommonConfig(
|
|
|
|
IN PPCI_COMMON_HEADER PciData
|
|
|
|
);
|
|
|
|
|
- Add support for PnP IRP to PDO: IRP_MN_QUERY_BUS_INFORMATION (PciQueryBusInformation), IRP_MN_QUERY_ID (PciQueryId), IRP_MN_QUERY_DEVICE_TEXT (PciQueryDeviceText), IRP_MN_QUERY_CAPABILITIES (PciQueryCapabilities), IRP_MN_QUERY_DEVICE_RELATIONS (PciQueryTargetDeviceRelations implement, PciQueryEjectionRelations, stub)
- Stub support for PnP IRP to PDO: IRP_MN_QUERY_RESOURCE_REQUIREMENTS (PciQueryRequirements), IRP_MN_QUERY_RESOURCES(PciQueryResources)
- Add support for PnP IRP to FDO: IRP_MN_QUERY_CAPABILITIES (handle in PciFdoIrpQueryDeviceCapabilities)
- Build device capability UI number (PciDetermineSlotNumber), use PIR$ (seem support broken, need to check loader) or device property for bus not root
- Use parent attachee device and this PDO for build device/system wake states, latency, device/system power mappings
- PCI-ID manage support: PciInitIdBuffer, PciIdPrintf, PciIdPrintfAppend
- Debug helper: PciDebugDumpQueryCapabilities
- Thanks richard for advise + beer
PCI-X driver now pass 10000 codes lines!
svn path=/trunk/; revision=48548
2010-08-14 17:09:20 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PciDebugDumpQueryCapabilities(
|
|
|
|
IN PDEVICE_CAPABILITIES DeviceCaps
|
|
|
|
);
|
|
|
|
|
2010-08-14 18:06:19 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PciDebugPrintIoResReqList(
|
|
|
|
IN PIO_RESOURCE_REQUIREMENTS_LIST Requirements
|
|
|
|
);
|
|
|
|
|
2010-09-12 06:03:12 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PciDebugPrintCmResList(
|
|
|
|
IN PCM_RESOURCE_LIST ResourceList
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PciDebugPrintPartialResource(
|
|
|
|
IN PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialResource
|
|
|
|
);
|
|
|
|
|
Fix for code to handle IRP dispatching when unrecognized IRP (Thanks you sir_richard)
Add FDO IRP_MN_QUERY_INTERFACE support (it calls PciQueryInterface)
Add all PCI interface descriptor: PciLocationInterface (GUID_PNP_LOCATION_INTERFACE), PciPmeInterface (GUID_PCI_PME_INTERFACE), PciCardbusPrivateInterface (GUID_PCI_CARDBUS_INTERFACE_PRIVATE), PciLegacyDeviceDetectionInterface (GUID_LEGACY_DEVICE_DETECTION_STANDARD), AgpTargetInterface (GUID_AGP_TARGET_BUS_INTERFACE_STANDARD), PciRoutingInterface (GUID_INT_ROUTE_INTERFACE_STANDARD), BusHandlerInterface (GUID_BUS_INTERFACE_STANDARD) and stub initializer and constructor.
Add missing devhere.c interface file
Add all PCI arbiter descritptor: ArbiterInterfaceBusNumber, ArbiterInterfaceMemory, ArbiterInterfaceIo. Write constructor stub but not handled ArbitersInitialized == TRUE
Also add last-resort PCI interface: TranslatorInterfaceInterrupt (GUID_TRANSLATOR_INTERFACE_STANDARD) and part implement tranirq_Constructor
Add PciQueryInterface to find correct FDO/PDO/ROOT interface for a request and call interface constructor
Fix interface signatures, fix interface constructor type and PCI_INTERFACE, add interface flags (Thanks sir_richard)
Fix Aribtriter code (Thanks sir_richard)
Now another 1200 codes added, soon time for enumeration code!
svn path=/trunk/; revision=48074
2010-07-16 00:39:54 +00:00
|
|
|
//
|
|
|
|
// Interface Support
|
|
|
|
//
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciQueryInterface(
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension,
|
|
|
|
IN CONST GUID* InterfaceType,
|
|
|
|
IN ULONG Size,
|
|
|
|
IN ULONG Version,
|
|
|
|
IN PVOID InterfaceData,
|
|
|
|
IN PINTERFACE Interface,
|
|
|
|
IN BOOLEAN LastChance
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPmeInterfaceInitializer(
|
|
|
|
IN PVOID Instance
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
routeintrf_Initializer(
|
|
|
|
IN PVOID Instance
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
arbusno_Initializer(
|
|
|
|
IN PVOID Instance
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
agpintrf_Initializer(
|
|
|
|
IN PVOID Instance
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
tranirq_Initializer(
|
|
|
|
IN PVOID Instance
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
busintrf_Initializer(
|
|
|
|
IN PVOID Instance
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
armem_Initializer(
|
|
|
|
IN PVOID Instance
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ario_Initializer(
|
|
|
|
IN PVOID Instance
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
locintrf_Initializer(
|
|
|
|
IN PVOID Instance
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
pcicbintrf_Initializer(
|
|
|
|
IN PVOID Instance
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
lddintrf_Initializer(
|
|
|
|
IN PVOID Instance
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
devpresent_Initializer(
|
|
|
|
IN PVOID Instance
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
agpintrf_Constructor(
|
|
|
|
IN PVOID DeviceExtension,
|
|
|
|
IN PVOID Instance,
|
|
|
|
IN PVOID InterfaceData,
|
|
|
|
IN USHORT Version,
|
|
|
|
IN USHORT Size,
|
|
|
|
IN PINTERFACE Interface
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
arbusno_Constructor(
|
|
|
|
IN PVOID DeviceExtension,
|
|
|
|
IN PVOID Instance,
|
|
|
|
IN PVOID InterfaceData,
|
|
|
|
IN USHORT Version,
|
|
|
|
IN USHORT Size,
|
|
|
|
IN PINTERFACE Interface
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
tranirq_Constructor(
|
|
|
|
IN PVOID DeviceExtension,
|
|
|
|
IN PVOID Instance,
|
|
|
|
IN PVOID InterfaceData,
|
|
|
|
IN USHORT Version,
|
|
|
|
IN USHORT Size,
|
|
|
|
IN PINTERFACE Interface
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
armem_Constructor(
|
|
|
|
IN PVOID DeviceExtension,
|
|
|
|
IN PVOID Instance,
|
|
|
|
IN PVOID InterfaceData,
|
|
|
|
IN USHORT Version,
|
|
|
|
IN USHORT Size,
|
|
|
|
IN PINTERFACE Interface
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
busintrf_Constructor(
|
|
|
|
IN PVOID DeviceExtension,
|
|
|
|
IN PVOID Instance,
|
|
|
|
IN PVOID InterfaceData,
|
|
|
|
IN USHORT Version,
|
|
|
|
IN USHORT Size,
|
|
|
|
IN PINTERFACE Interface
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ario_Constructor(
|
|
|
|
IN PVOID DeviceExtension,
|
|
|
|
IN PVOID Instance,
|
|
|
|
IN PVOID InterfaceData,
|
|
|
|
IN USHORT Version,
|
|
|
|
IN USHORT Size,
|
|
|
|
IN PINTERFACE Interface
|
|
|
|
);
|
|
|
|
|
Joint patch
By sir_richard: [PCIX]: - Implement PciIsSlotPresentInParentMethod for ACPI query, and PcoDecodeEnable utility function.
- Implement PciConfigureIdeController based on WDHC Whitepaper "How Windows Switches a Controller to Native Mode". Check for PciEanbleNativeModeATA in registry, InitSafeBootMode, and call the ACPI driver to evaluate if NATA is present on the slot. Only configure the controller if both channels support native mode, as this is a Windows restriction.
- Implement PciApplyHacks for enumeration and resource update cases. In the first case, we handle legacy DEC Alpha Intel i82375 and i82378 PCI-to-(E)ISA bridges with invalid class codes. In the second, we configure IDE controllers for Native mode, except the OPTi Viper-M, which is known to cause issues. We also support cards with legacy VGA decodes by telling the arbiter to enable full access to the rangesm and finally we completely disable the decodes on Compaq PCI Hotplug Controllers (Revision 17) on PAE systems, as they have bugs handling 64-bit addresses. Finally, on resource updates, we apply a vendor-specific errata to the IBM 20H2999 PCI Docking Bridge (Hotplug) used on Thinkpad 600 Series laptops, and we attempt to avoid issues that can happen on certain devices that are plugged into an ICH1/2/3/4 Intel Hub when it has been configured to do subtractive decode. Full information on these workarounds can be seen in the comments. Finally, we also enable CardBUS devices for ACPI-compliant mode, by crossing out the LegacyBaseAddress in the CardBUS Type 2 PCI Configuration Header.
- Miscelleaneous code cleanups.
By eVb: More PciScanBus support, for debug PCI caps that driver use are dump, and detect nonBIOS configure device (spec is said that CacheLineSize != 0, LatencyTimer != 0 (on PCI-X, != 64)), if found NeedsHotPlugConfiguration to be set
By eVb: Support PCI_HACK_VIDEO_LEGACY_DECODE (call ario_ApplyBrokenVideoHack, but no arb support to do work)
svn path=/trunk/; revision=48116
2010-07-19 15:15:39 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
ario_ApplyBrokenVideoHack(
|
|
|
|
IN PPCI_FDO_EXTENSION FdoExtension
|
|
|
|
);
|
|
|
|
|
Fix for code to handle IRP dispatching when unrecognized IRP (Thanks you sir_richard)
Add FDO IRP_MN_QUERY_INTERFACE support (it calls PciQueryInterface)
Add all PCI interface descriptor: PciLocationInterface (GUID_PNP_LOCATION_INTERFACE), PciPmeInterface (GUID_PCI_PME_INTERFACE), PciCardbusPrivateInterface (GUID_PCI_CARDBUS_INTERFACE_PRIVATE), PciLegacyDeviceDetectionInterface (GUID_LEGACY_DEVICE_DETECTION_STANDARD), AgpTargetInterface (GUID_AGP_TARGET_BUS_INTERFACE_STANDARD), PciRoutingInterface (GUID_INT_ROUTE_INTERFACE_STANDARD), BusHandlerInterface (GUID_BUS_INTERFACE_STANDARD) and stub initializer and constructor.
Add missing devhere.c interface file
Add all PCI arbiter descritptor: ArbiterInterfaceBusNumber, ArbiterInterfaceMemory, ArbiterInterfaceIo. Write constructor stub but not handled ArbitersInitialized == TRUE
Also add last-resort PCI interface: TranslatorInterfaceInterrupt (GUID_TRANSLATOR_INTERFACE_STANDARD) and part implement tranirq_Constructor
Add PciQueryInterface to find correct FDO/PDO/ROOT interface for a request and call interface constructor
Fix interface signatures, fix interface constructor type and PCI_INTERFACE, add interface flags (Thanks sir_richard)
Fix Aribtriter code (Thanks sir_richard)
Now another 1200 codes added, soon time for enumeration code!
svn path=/trunk/; revision=48074
2010-07-16 00:39:54 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
pcicbintrf_Constructor(
|
|
|
|
IN PVOID DeviceExtension,
|
|
|
|
IN PVOID Instance,
|
|
|
|
IN PVOID InterfaceData,
|
|
|
|
IN USHORT Version,
|
|
|
|
IN USHORT Size,
|
|
|
|
IN PINTERFACE Interface
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
lddintrf_Constructor(
|
|
|
|
IN PVOID DeviceExtension,
|
|
|
|
IN PVOID Instance,
|
|
|
|
IN PVOID InterfaceData,
|
|
|
|
IN USHORT Version,
|
|
|
|
IN USHORT Size,
|
|
|
|
IN PINTERFACE Interface
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
locintrf_Constructor(
|
|
|
|
IN PVOID DeviceExtension,
|
|
|
|
IN PVOID Instance,
|
|
|
|
IN PVOID InterfaceData,
|
|
|
|
IN USHORT Version,
|
|
|
|
IN USHORT Size,
|
|
|
|
IN PINTERFACE Interface
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciPmeInterfaceConstructor(
|
|
|
|
IN PVOID DeviceExtension,
|
|
|
|
IN PVOID Instance,
|
|
|
|
IN PVOID InterfaceData,
|
|
|
|
IN USHORT Version,
|
|
|
|
IN USHORT Size,
|
|
|
|
IN PINTERFACE Interface
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
routeintrf_Constructor(
|
|
|
|
IN PVOID DeviceExtension,
|
|
|
|
IN PVOID Instance,
|
|
|
|
IN PVOID InterfaceData,
|
|
|
|
IN USHORT Version,
|
|
|
|
IN USHORT Size,
|
|
|
|
IN PINTERFACE Interface
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
devpresent_Constructor(
|
|
|
|
IN PVOID DeviceExtension,
|
|
|
|
IN PVOID Instance,
|
|
|
|
IN PVOID InterfaceData,
|
|
|
|
IN USHORT Version,
|
|
|
|
IN USHORT Size,
|
|
|
|
IN PINTERFACE Interface
|
|
|
|
);
|
|
|
|
|
2010-07-17 01:31:26 +00:00
|
|
|
//
|
|
|
|
// PCI Enumeration and Resources
|
|
|
|
//
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciQueryDeviceRelations(
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension,
|
|
|
|
IN OUT PDEVICE_RELATIONS *pDeviceRelations
|
|
|
|
);
|
|
|
|
|
- Add support for PnP IRP to PDO: IRP_MN_QUERY_BUS_INFORMATION (PciQueryBusInformation), IRP_MN_QUERY_ID (PciQueryId), IRP_MN_QUERY_DEVICE_TEXT (PciQueryDeviceText), IRP_MN_QUERY_CAPABILITIES (PciQueryCapabilities), IRP_MN_QUERY_DEVICE_RELATIONS (PciQueryTargetDeviceRelations implement, PciQueryEjectionRelations, stub)
- Stub support for PnP IRP to PDO: IRP_MN_QUERY_RESOURCE_REQUIREMENTS (PciQueryRequirements), IRP_MN_QUERY_RESOURCES(PciQueryResources)
- Add support for PnP IRP to FDO: IRP_MN_QUERY_CAPABILITIES (handle in PciFdoIrpQueryDeviceCapabilities)
- Build device capability UI number (PciDetermineSlotNumber), use PIR$ (seem support broken, need to check loader) or device property for bus not root
- Use parent attachee device and this PDO for build device/system wake states, latency, device/system power mappings
- PCI-ID manage support: PciInitIdBuffer, PciIdPrintf, PciIdPrintfAppend
- Debug helper: PciDebugDumpQueryCapabilities
- Thanks richard for advise + beer
PCI-X driver now pass 10000 codes lines!
svn path=/trunk/; revision=48548
2010-08-14 17:09:20 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciQueryResources(
|
|
|
|
IN PPCI_PDO_EXTENSION PdoExtension,
|
|
|
|
OUT PCM_RESOURCE_LIST *Buffer
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciQueryTargetDeviceRelations(
|
|
|
|
IN PPCI_PDO_EXTENSION PdoExtension,
|
|
|
|
IN OUT PDEVICE_RELATIONS *pDeviceRelations
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciQueryEjectionRelations(
|
|
|
|
IN PPCI_PDO_EXTENSION PdoExtension,
|
|
|
|
IN OUT PDEVICE_RELATIONS *pDeviceRelations
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciQueryRequirements(
|
|
|
|
IN PPCI_PDO_EXTENSION PdoExtension,
|
|
|
|
IN OUT PIO_RESOURCE_REQUIREMENTS_LIST *RequirementsList
|
|
|
|
);
|
|
|
|
|
2010-09-12 06:03:12 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
PciComputeNewCurrentSettings(
|
|
|
|
IN PPCI_PDO_EXTENSION PdoExtension,
|
|
|
|
IN PCM_RESOURCE_LIST ResourceList
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciSetResources(
|
|
|
|
IN PPCI_PDO_EXTENSION PdoExtension,
|
|
|
|
IN BOOLEAN DoReset,
|
|
|
|
IN BOOLEAN SomethingSomethingDarkSide
|
|
|
|
);
|
|
|
|
|
2010-09-23 13:24:41 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciBuildRequirementsList(
|
|
|
|
IN PPCI_PDO_EXTENSION PdoExtension,
|
|
|
|
IN PPCI_COMMON_HEADER PciData,
|
|
|
|
OUT PIO_RESOURCE_REQUIREMENTS_LIST* Buffer
|
|
|
|
);
|
|
|
|
|
2010-07-17 01:31:26 +00:00
|
|
|
//
|
|
|
|
// Identification Functions
|
|
|
|
//
|
|
|
|
PWCHAR
|
|
|
|
NTAPI
|
|
|
|
PciGetDeviceDescriptionMessage(
|
|
|
|
IN UCHAR BaseClass,
|
|
|
|
IN UCHAR SubClass
|
|
|
|
);
|
|
|
|
|
- Add support for PnP IRP to PDO: IRP_MN_QUERY_BUS_INFORMATION (PciQueryBusInformation), IRP_MN_QUERY_ID (PciQueryId), IRP_MN_QUERY_DEVICE_TEXT (PciQueryDeviceText), IRP_MN_QUERY_CAPABILITIES (PciQueryCapabilities), IRP_MN_QUERY_DEVICE_RELATIONS (PciQueryTargetDeviceRelations implement, PciQueryEjectionRelations, stub)
- Stub support for PnP IRP to PDO: IRP_MN_QUERY_RESOURCE_REQUIREMENTS (PciQueryRequirements), IRP_MN_QUERY_RESOURCES(PciQueryResources)
- Add support for PnP IRP to FDO: IRP_MN_QUERY_CAPABILITIES (handle in PciFdoIrpQueryDeviceCapabilities)
- Build device capability UI number (PciDetermineSlotNumber), use PIR$ (seem support broken, need to check loader) or device property for bus not root
- Use parent attachee device and this PDO for build device/system wake states, latency, device/system power mappings
- PCI-ID manage support: PciInitIdBuffer, PciIdPrintf, PciIdPrintfAppend
- Debug helper: PciDebugDumpQueryCapabilities
- Thanks richard for advise + beer
PCI-X driver now pass 10000 codes lines!
svn path=/trunk/; revision=48548
2010-08-14 17:09:20 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciQueryDeviceText(
|
|
|
|
IN PPCI_PDO_EXTENSION PdoExtension,
|
|
|
|
IN DEVICE_TEXT_TYPE QueryType,
|
|
|
|
IN ULONG Locale,
|
|
|
|
OUT PWCHAR *Buffer
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciQueryId(
|
|
|
|
IN PPCI_PDO_EXTENSION DeviceExtension,
|
|
|
|
IN BUS_QUERY_ID_TYPE QueryType,
|
|
|
|
OUT PWCHAR *Buffer
|
|
|
|
);
|
|
|
|
|
2010-07-19 16:35:52 +00:00
|
|
|
//
|
|
|
|
// CardBUS Support
|
|
|
|
//
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
Cardbus_MassageHeaderForLimitsDetermination(
|
|
|
|
IN PPCI_CONFIGURATOR_CONTEXT Context
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
Cardbus_SaveCurrentSettings(
|
|
|
|
IN PPCI_CONFIGURATOR_CONTEXT Context
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
Cardbus_SaveLimits(
|
|
|
|
IN PPCI_CONFIGURATOR_CONTEXT Context
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
Cardbus_RestoreCurrent(
|
|
|
|
IN PPCI_CONFIGURATOR_CONTEXT Context
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
Cardbus_GetAdditionalResourceDescriptors(
|
|
|
|
IN PPCI_CONFIGURATOR_CONTEXT Context,
|
|
|
|
IN PPCI_COMMON_HEADER PciData,
|
|
|
|
IN PIO_RESOURCE_DESCRIPTOR IoDescriptor
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
Cardbus_ResetDevice(
|
2010-09-12 06:03:12 +00:00
|
|
|
IN PPCI_PDO_EXTENSION PdoExtension,
|
|
|
|
IN PPCI_COMMON_HEADER PciData
|
2010-07-19 16:35:52 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
Cardbus_ChangeResourceSettings(
|
2010-09-12 06:03:12 +00:00
|
|
|
IN PPCI_PDO_EXTENSION PdoExtension,
|
|
|
|
IN PPCI_COMMON_HEADER PciData
|
2010-07-19 16:35:52 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
//
|
|
|
|
// PCI Device Support
|
|
|
|
//
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
Device_MassageHeaderForLimitsDetermination(
|
|
|
|
IN PPCI_CONFIGURATOR_CONTEXT Context
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
Device_SaveCurrentSettings(
|
|
|
|
IN PPCI_CONFIGURATOR_CONTEXT Context
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
Device_SaveLimits(
|
|
|
|
IN PPCI_CONFIGURATOR_CONTEXT Context
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
Device_RestoreCurrent(
|
|
|
|
IN PPCI_CONFIGURATOR_CONTEXT Context
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
Device_GetAdditionalResourceDescriptors(
|
|
|
|
IN PPCI_CONFIGURATOR_CONTEXT Context,
|
|
|
|
IN PPCI_COMMON_HEADER PciData,
|
|
|
|
IN PIO_RESOURCE_DESCRIPTOR IoDescriptor
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
Device_ResetDevice(
|
2010-09-12 06:03:12 +00:00
|
|
|
IN PPCI_PDO_EXTENSION PdoExtension,
|
|
|
|
IN PPCI_COMMON_HEADER PciData
|
2010-07-19 16:35:52 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
Device_ChangeResourceSettings(
|
2010-09-12 06:03:12 +00:00
|
|
|
IN PPCI_PDO_EXTENSION PdoExtension,
|
|
|
|
IN PPCI_COMMON_HEADER PciData
|
2010-07-19 16:35:52 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
//
|
|
|
|
// PCI-to-PCI Bridge Device Support
|
|
|
|
//
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PPBridge_MassageHeaderForLimitsDetermination(
|
|
|
|
IN PPCI_CONFIGURATOR_CONTEXT Context
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PPBridge_SaveCurrentSettings(
|
|
|
|
IN PPCI_CONFIGURATOR_CONTEXT Context
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PPBridge_SaveLimits(
|
|
|
|
IN PPCI_CONFIGURATOR_CONTEXT Context
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PPBridge_RestoreCurrent(
|
|
|
|
IN PPCI_CONFIGURATOR_CONTEXT Context
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PPBridge_GetAdditionalResourceDescriptors(
|
|
|
|
IN PPCI_CONFIGURATOR_CONTEXT Context,
|
|
|
|
IN PPCI_COMMON_HEADER PciData,
|
|
|
|
IN PIO_RESOURCE_DESCRIPTOR IoDescriptor
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PPBridge_ResetDevice(
|
2010-09-12 06:03:12 +00:00
|
|
|
IN PPCI_PDO_EXTENSION PdoExtension,
|
|
|
|
IN PPCI_COMMON_HEADER PciData
|
2010-07-19 16:35:52 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PPBridge_ChangeResourceSettings(
|
2010-09-12 06:03:12 +00:00
|
|
|
IN PPCI_PDO_EXTENSION PdoExtension,
|
|
|
|
IN PPCI_COMMON_HEADER PciData
|
2010-07-19 16:35:52 +00:00
|
|
|
);
|
|
|
|
|
2010-09-23 13:24:41 +00:00
|
|
|
//
|
|
|
|
// Bus Number Routines
|
|
|
|
//
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
PciAreBusNumbersConfigured(
|
|
|
|
IN PPCI_PDO_EXTENSION PdoExtension
|
|
|
|
);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Routine Interface
|
|
|
|
//
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciCacheLegacyDeviceRouting(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN ULONG BusNumber,
|
|
|
|
IN ULONG SlotNumber,
|
|
|
|
IN UCHAR InterruptLine,
|
|
|
|
IN UCHAR InterruptPin,
|
|
|
|
IN UCHAR BaseClass,
|
|
|
|
IN UCHAR SubClass,
|
|
|
|
IN PDEVICE_OBJECT PhysicalDeviceObject,
|
|
|
|
IN PPCI_PDO_EXTENSION PdoExtension,
|
|
|
|
OUT PDEVICE_OBJECT *pFoundDeviceObject
|
|
|
|
);
|
|
|
|
|
Implement Root Bus FDO AddDevice codes, get boot config, connect to HAL or ACPI config handlers (PciQueryForPciBusInterface, PciGetConfigHandlers), read BUS FDO hack flag, get _HPP HotPlug PCI ACPI data and initialize arbiter support.
PciGetHotPlugParameters work but no PCI HotPlug support on my machines, so cannot test ACPI data, that part stub now
Add PciFdoDispatchTable, PciFdoDispatchPnpTable, PciFdoDispatchPowerTable but all stub to PciIrpNotSupported however set correct IRP Dispatch Style for the IRPS
Arbiter support in PciInitializeARbiters done, but PciInterfaces array is NULL (stub) at moment
Add PCI_SIGNATURE, PCI_STATE, PCI_DISAPTCH_STYLE type, add PciInitializeState to begin the state support
Add structure for PCI_FDO_EXTENSION, PCI_SECONDARY_EXTENSION, PCI_INTERFACE, PCI_ARBITER_INSTANCE, PCI_DISPATCH_TABLE
PCI utility functions added: PciFindParentPciFdoExtension, PciInsertEntryAtTail, PciInsertEntryAtHead, PcipLinkSecondaryExtension, PciGetDeviceProperty, PciSendIoctl
Need sir_richard to add arbiter.h header to define ARBITER_INSTANCE for finish support
This 1000 more codes done now~
svn path=/trunk/; revision=47898
2010-06-28 17:30:35 +00:00
|
|
|
//
|
|
|
|
// External Resources
|
|
|
|
//
|
|
|
|
extern SINGLE_LIST_ENTRY PciFdoExtensionListHead;
|
|
|
|
extern KEVENT PciGlobalLock;
|
|
|
|
extern PPCI_INTERFACE PciInterfaces[];
|
Fix for code to handle IRP dispatching when unrecognized IRP (Thanks you sir_richard)
Add FDO IRP_MN_QUERY_INTERFACE support (it calls PciQueryInterface)
Add all PCI interface descriptor: PciLocationInterface (GUID_PNP_LOCATION_INTERFACE), PciPmeInterface (GUID_PCI_PME_INTERFACE), PciCardbusPrivateInterface (GUID_PCI_CARDBUS_INTERFACE_PRIVATE), PciLegacyDeviceDetectionInterface (GUID_LEGACY_DEVICE_DETECTION_STANDARD), AgpTargetInterface (GUID_AGP_TARGET_BUS_INTERFACE_STANDARD), PciRoutingInterface (GUID_INT_ROUTE_INTERFACE_STANDARD), BusHandlerInterface (GUID_BUS_INTERFACE_STANDARD) and stub initializer and constructor.
Add missing devhere.c interface file
Add all PCI arbiter descritptor: ArbiterInterfaceBusNumber, ArbiterInterfaceMemory, ArbiterInterfaceIo. Write constructor stub but not handled ArbitersInitialized == TRUE
Also add last-resort PCI interface: TranslatorInterfaceInterrupt (GUID_TRANSLATOR_INTERFACE_STANDARD) and part implement tranirq_Constructor
Add PciQueryInterface to find correct FDO/PDO/ROOT interface for a request and call interface constructor
Fix interface signatures, fix interface constructor type and PCI_INTERFACE, add interface flags (Thanks sir_richard)
Fix Aribtriter code (Thanks sir_richard)
Now another 1200 codes added, soon time for enumeration code!
svn path=/trunk/; revision=48074
2010-07-16 00:39:54 +00:00
|
|
|
extern PCI_INTERFACE ArbiterInterfaceBusNumber;
|
|
|
|
extern PCI_INTERFACE ArbiterInterfaceMemory;
|
|
|
|
extern PCI_INTERFACE ArbiterInterfaceIo;
|
|
|
|
extern PCI_INTERFACE BusHandlerInterface;
|
|
|
|
extern PCI_INTERFACE PciRoutingInterface;
|
|
|
|
extern PCI_INTERFACE PciCardbusPrivateInterface;
|
|
|
|
extern PCI_INTERFACE PciLegacyDeviceDetectionInterface;
|
|
|
|
extern PCI_INTERFACE PciPmeInterface;
|
|
|
|
extern PCI_INTERFACE PciDevicePresentInterface;
|
|
|
|
//extern PCI_INTERFACE PciNativeIdeInterface;
|
|
|
|
extern PCI_INTERFACE PciLocationInterface;
|
|
|
|
extern PCI_INTERFACE AgpTargetInterface;
|
|
|
|
extern PCI_INTERFACE TranslatorInterfaceInterrupt;
|
2010-07-17 01:31:26 +00:00
|
|
|
extern PDRIVER_OBJECT PciDriverObject;
|
|
|
|
extern PWATCHDOG_TABLE WdTable;
|
2010-07-17 15:09:19 +00:00
|
|
|
extern PPCI_HACK_ENTRY PciHackTable;
|
2010-08-09 19:07:52 +00:00
|
|
|
extern BOOLEAN PciAssignBusNumbers;
|
Joint patch
By sir_richard: [PCIX]: - Implement PciIsSlotPresentInParentMethod for ACPI query, and PcoDecodeEnable utility function.
- Implement PciConfigureIdeController based on WDHC Whitepaper "How Windows Switches a Controller to Native Mode". Check for PciEanbleNativeModeATA in registry, InitSafeBootMode, and call the ACPI driver to evaluate if NATA is present on the slot. Only configure the controller if both channels support native mode, as this is a Windows restriction.
- Implement PciApplyHacks for enumeration and resource update cases. In the first case, we handle legacy DEC Alpha Intel i82375 and i82378 PCI-to-(E)ISA bridges with invalid class codes. In the second, we configure IDE controllers for Native mode, except the OPTi Viper-M, which is known to cause issues. We also support cards with legacy VGA decodes by telling the arbiter to enable full access to the rangesm and finally we completely disable the decodes on Compaq PCI Hotplug Controllers (Revision 17) on PAE systems, as they have bugs handling 64-bit addresses. Finally, on resource updates, we apply a vendor-specific errata to the IBM 20H2999 PCI Docking Bridge (Hotplug) used on Thinkpad 600 Series laptops, and we attempt to avoid issues that can happen on certain devices that are plugged into an ICH1/2/3/4 Intel Hub when it has been configured to do subtractive decode. Full information on these workarounds can be seen in the comments. Finally, we also enable CardBUS devices for ACPI-compliant mode, by crossing out the LegacyBaseAddress in the CardBUS Type 2 PCI Configuration Header.
- Miscelleaneous code cleanups.
By eVb: More PciScanBus support, for debug PCI caps that driver use are dump, and detect nonBIOS configure device (spec is said that CacheLineSize != 0, LatencyTimer != 0 (on PCI-X, != 64)), if found NeedsHotPlugConfiguration to be set
By eVb: Support PCI_HACK_VIDEO_LEGACY_DECODE (call ario_ApplyBrokenVideoHack, but no arb support to do work)
svn path=/trunk/; revision=48116
2010-07-19 15:15:39 +00:00
|
|
|
extern BOOLEAN PciEnableNativeModeATA;
|
- Add support for PnP IRP to PDO: IRP_MN_QUERY_BUS_INFORMATION (PciQueryBusInformation), IRP_MN_QUERY_ID (PciQueryId), IRP_MN_QUERY_DEVICE_TEXT (PciQueryDeviceText), IRP_MN_QUERY_CAPABILITIES (PciQueryCapabilities), IRP_MN_QUERY_DEVICE_RELATIONS (PciQueryTargetDeviceRelations implement, PciQueryEjectionRelations, stub)
- Stub support for PnP IRP to PDO: IRP_MN_QUERY_RESOURCE_REQUIREMENTS (PciQueryRequirements), IRP_MN_QUERY_RESOURCES(PciQueryResources)
- Add support for PnP IRP to FDO: IRP_MN_QUERY_CAPABILITIES (handle in PciFdoIrpQueryDeviceCapabilities)
- Build device capability UI number (PciDetermineSlotNumber), use PIR$ (seem support broken, need to check loader) or device property for bus not root
- Use parent attachee device and this PDO for build device/system wake states, latency, device/system power mappings
- PCI-ID manage support: PciInitIdBuffer, PciIdPrintf, PciIdPrintfAppend
- Debug helper: PciDebugDumpQueryCapabilities
- Thanks richard for advise + beer
PCI-X driver now pass 10000 codes lines!
svn path=/trunk/; revision=48548
2010-08-14 17:09:20 +00:00
|
|
|
extern PPCI_IRQ_ROUTING_TABLE PciIrqRoutingTable;
|
|
|
|
extern BOOLEAN PciRunningDatacenter;
|
Joint patch
By sir_richard: [PCIX]: - Implement PciIsSlotPresentInParentMethod for ACPI query, and PcoDecodeEnable utility function.
- Implement PciConfigureIdeController based on WDHC Whitepaper "How Windows Switches a Controller to Native Mode". Check for PciEanbleNativeModeATA in registry, InitSafeBootMode, and call the ACPI driver to evaluate if NATA is present on the slot. Only configure the controller if both channels support native mode, as this is a Windows restriction.
- Implement PciApplyHacks for enumeration and resource update cases. In the first case, we handle legacy DEC Alpha Intel i82375 and i82378 PCI-to-(E)ISA bridges with invalid class codes. In the second, we configure IDE controllers for Native mode, except the OPTi Viper-M, which is known to cause issues. We also support cards with legacy VGA decodes by telling the arbiter to enable full access to the rangesm and finally we completely disable the decodes on Compaq PCI Hotplug Controllers (Revision 17) on PAE systems, as they have bugs handling 64-bit addresses. Finally, on resource updates, we apply a vendor-specific errata to the IBM 20H2999 PCI Docking Bridge (Hotplug) used on Thinkpad 600 Series laptops, and we attempt to avoid issues that can happen on certain devices that are plugged into an ICH1/2/3/4 Intel Hub when it has been configured to do subtractive decode. Full information on these workarounds can be seen in the comments. Finally, we also enable CardBUS devices for ACPI-compliant mode, by crossing out the LegacyBaseAddress in the CardBUS Type 2 PCI Configuration Header.
- Miscelleaneous code cleanups.
By eVb: More PciScanBus support, for debug PCI caps that driver use are dump, and detect nonBIOS configure device (spec is said that CacheLineSize != 0, LatencyTimer != 0 (on PCI-X, != 64)), if found NeedsHotPlugConfiguration to be set
By eVb: Support PCI_HACK_VIDEO_LEGACY_DECODE (call ario_ApplyBrokenVideoHack, but no arb support to do work)
svn path=/trunk/; revision=48116
2010-07-19 15:15:39 +00:00
|
|
|
|
|
|
|
/* Exported by NTOS, should this go in the NDK? */
|
|
|
|
extern NTSYSAPI BOOLEAN InitSafeBootMode;
|
Implement Root Bus FDO AddDevice codes, get boot config, connect to HAL or ACPI config handlers (PciQueryForPciBusInterface, PciGetConfigHandlers), read BUS FDO hack flag, get _HPP HotPlug PCI ACPI data and initialize arbiter support.
PciGetHotPlugParameters work but no PCI HotPlug support on my machines, so cannot test ACPI data, that part stub now
Add PciFdoDispatchTable, PciFdoDispatchPnpTable, PciFdoDispatchPowerTable but all stub to PciIrpNotSupported however set correct IRP Dispatch Style for the IRPS
Arbiter support in PciInitializeARbiters done, but PciInterfaces array is NULL (stub) at moment
Add PCI_SIGNATURE, PCI_STATE, PCI_DISAPTCH_STYLE type, add PciInitializeState to begin the state support
Add structure for PCI_FDO_EXTENSION, PCI_SECONDARY_EXTENSION, PCI_INTERFACE, PCI_ARBITER_INSTANCE, PCI_DISPATCH_TABLE
PCI utility functions added: PciFindParentPciFdoExtension, PciInsertEntryAtTail, PciInsertEntryAtHead, PcipLinkSecondaryExtension, PciGetDeviceProperty, PciSendIoctl
Need sir_richard to add arbiter.h header to define ARBITER_INSTANCE for finish support
This 1000 more codes done now~
svn path=/trunk/; revision=47898
2010-06-28 17:30:35 +00:00
|
|
|
|
2014-02-06 11:18:34 +00:00
|
|
|
#endif /* _PCIX_PCH_ */
|