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/pcivrify.c
|
|
|
|
* PURPOSE: PCI Driver Verifier Support
|
|
|
|
* PROGRAMMERS: ReactOS Portable Systems Group
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* INCLUDES *******************************************************************/
|
|
|
|
|
|
|
|
#include <pci.h>
|
2014-01-04 12:05:02 +00:00
|
|
|
|
2010-04-01 19:07:40 +00:00
|
|
|
#define NDEBUG
|
|
|
|
#include <debug.h>
|
|
|
|
|
|
|
|
/* GLOBALS ********************************************************************/
|
|
|
|
|
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
|
|
|
BOOLEAN PciVerifierRegistered;
|
|
|
|
PVOID PciVerifierNotificationHandle;
|
|
|
|
|
2010-07-18 18:58:33 +00:00
|
|
|
PCI_VERIFIER_DATA PciVerifierFailureTable[PCI_VERIFIER_CODES] =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
1,
|
|
|
|
VFFAILURE_FAIL_LOGO,
|
|
|
|
0,
|
|
|
|
"The BIOS has reprogrammed the bus numbers of an active PCI device "
|
|
|
|
"(!devstack %DevObj) during a dock or undock!"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
2,
|
|
|
|
VFFAILURE_FAIL_LOGO,
|
|
|
|
0,
|
|
|
|
"A device in the system did not update it's PMCSR register in the spec "
|
|
|
|
"mandated time (!devstack %DevObj, Power state D%Ulong)"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
3,
|
|
|
|
VFFAILURE_FAIL_LOGO,
|
|
|
|
0,
|
|
|
|
"A driver controlling a PCI device has tried to access OS controlled "
|
|
|
|
"configuration space registers (!devstack %DevObj, Offset 0x%Ulong1, "
|
|
|
|
"Length 0x%Ulong2)"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
4,
|
|
|
|
VFFAILURE_FAIL_UNDER_DEBUGGER,
|
|
|
|
0,
|
|
|
|
"A driver controlling a PCI device has tried to read or write from an "
|
|
|
|
"invalid space using IRP_MN_READ/WRITE_CONFIG or via BUS_INTERFACE_STANDARD."
|
|
|
|
" NB: These functions take WhichSpace parameters of the form PCI_WHICHSPACE_*"
|
|
|
|
" and not a BUS_DATA_TYPE (!devstack %DevObj, WhichSpace 0x%Ulong1)"
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2010-04-01 19:07:40 +00:00
|
|
|
/* FUNCTIONS ******************************************************************/
|
|
|
|
|
2010-07-18 18:58:33 +00:00
|
|
|
PPCI_VERIFIER_DATA
|
|
|
|
NTAPI
|
|
|
|
PciVerifierRetrieveFailureData(IN ULONG FailureCode)
|
|
|
|
{
|
|
|
|
PPCI_VERIFIER_DATA VerifierData;
|
|
|
|
|
|
|
|
/* Scan the verifier failure table for this code */
|
|
|
|
VerifierData = PciVerifierFailureTable;
|
|
|
|
while (VerifierData->FailureCode != FailureCode)
|
|
|
|
{
|
|
|
|
/* Keep searching */
|
|
|
|
++VerifierData;
|
|
|
|
ASSERT(VerifierData < &PciVerifierFailureTable[PCI_VERIFIER_CODES]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return the entry for this code */
|
|
|
|
return VerifierData;
|
|
|
|
}
|
|
|
|
|
2013-05-10 10:22:01 +00:00
|
|
|
DRIVER_NOTIFICATION_CALLBACK_ROUTINE PciVerifierProfileChangeCallback;
|
|
|
|
|
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
|
|
|
|
PciVerifierProfileChangeCallback(IN PVOID NotificationStructure,
|
|
|
|
IN PVOID Context)
|
|
|
|
{
|
2013-05-10 10:22:01 +00:00
|
|
|
UNREFERENCED_PARAMETER(NotificationStructure);
|
|
|
|
UNREFERENCED_PARAMETER(Context);
|
|
|
|
|
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
|
|
|
/* This function is not yet implemented */
|
2013-01-10 01:45:22 +00:00
|
|
|
UNIMPLEMENTED_DBGBREAK();
|
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
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PciVerifierInit(IN PDRIVER_OBJECT DriverObject)
|
|
|
|
{
|
|
|
|
NTSTATUS Status;
|
|
|
|
|
|
|
|
/* Check if the kernel driver verifier is enabled */
|
|
|
|
if (VfIsVerificationEnabled(VFOBJTYPE_SYSTEM_BIOS, NULL))
|
|
|
|
{
|
|
|
|
/* Register a notification for changes, to keep track of the PCI tree */
|
|
|
|
Status = IoRegisterPlugPlayNotification(EventCategoryHardwareProfileChange,
|
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
DriverObject,
|
|
|
|
PciVerifierProfileChangeCallback,
|
|
|
|
NULL,
|
|
|
|
&PciVerifierNotificationHandle);
|
|
|
|
if (NT_SUCCESS(Status)) PciVerifierRegistered = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-04-01 19:07:40 +00:00
|
|
|
/* EOF */
|