Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenpci.h
Go to the documentation of this file.
00001 #include <ntifs.h> 00002 #include <wdmguid.h> 00003 #include <stdio.h> 00004 #include <ntddk.h> 00005 00006 #define TAG_PCI '0ICP' 00007 00008 typedef struct _PCI_DEVICE 00009 { 00010 // Entry on device list 00011 LIST_ENTRY ListEntry; 00012 // Physical Device Object of device 00013 PDEVICE_OBJECT Pdo; 00014 // PCI bus number 00015 ULONG BusNumber; 00016 // PCI slot number 00017 PCI_SLOT_NUMBER SlotNumber; 00018 // PCI configuration data 00019 PCI_COMMON_CONFIG PciConfig; 00020 // Enable memory space 00021 BOOLEAN EnableMemorySpace; 00022 // Enable I/O space 00023 BOOLEAN EnableIoSpace; 00024 // Enable bus master 00025 BOOLEAN EnableBusMaster; 00026 } PCI_DEVICE, *PPCI_DEVICE; 00027 00028 00029 typedef enum { 00030 dsStopped, 00031 dsStarted, 00032 dsPaused, 00033 dsRemoved, 00034 dsSurpriseRemoved 00035 } PCI_DEVICE_STATE; 00036 00037 00038 typedef struct _COMMON_DEVICE_EXTENSION 00039 { 00040 // Pointer to device object, this device extension is associated with 00041 PDEVICE_OBJECT DeviceObject; 00042 // Wether this device extension is for an FDO or PDO 00043 BOOLEAN IsFDO; 00044 // Wether the device is removed 00045 BOOLEAN Removed; 00046 // Current device power state for the device 00047 DEVICE_POWER_STATE DevicePowerState; 00048 } COMMON_DEVICE_EXTENSION, *PCOMMON_DEVICE_EXTENSION; 00049 00050 /* Physical Device Object device extension for a child device */ 00051 typedef struct _PDO_DEVICE_EXTENSION 00052 { 00053 // Common device data 00054 COMMON_DEVICE_EXTENSION Common; 00055 // Functional device object 00056 PDEVICE_OBJECT Fdo; 00057 // Pointer to PCI Device informations 00058 PPCI_DEVICE PciDevice; 00059 // Device ID 00060 UNICODE_STRING DeviceID; 00061 // Instance ID 00062 UNICODE_STRING InstanceID; 00063 // Hardware IDs 00064 UNICODE_STRING HardwareIDs; 00065 // Compatible IDs 00066 UNICODE_STRING CompatibleIDs; 00067 // Textual description of device 00068 UNICODE_STRING DeviceDescription; 00069 // Textual description of device location 00070 UNICODE_STRING DeviceLocation; 00071 // Number of interfaces references 00072 LONG References; 00073 } PDO_DEVICE_EXTENSION, *PPDO_DEVICE_EXTENSION; 00074 00075 /* Functional Device Object device extension for the PCI driver device object */ 00076 typedef struct _FDO_DEVICE_EXTENSION 00077 { 00078 // Common device data 00079 COMMON_DEVICE_EXTENSION Common; 00080 // Entry on device list 00081 LIST_ENTRY ListEntry; 00082 // PCI bus number serviced by this FDO 00083 ULONG BusNumber; 00084 // Current state of the driver 00085 PCI_DEVICE_STATE State; 00086 // Namespace device list 00087 LIST_ENTRY DeviceListHead; 00088 // Number of (not removed) devices in device list 00089 ULONG DeviceListCount; 00090 // Lock for namespace device list 00091 KSPIN_LOCK DeviceListLock; 00092 // Lower device object 00093 PDEVICE_OBJECT Ldo; 00094 } FDO_DEVICE_EXTENSION, *PFDO_DEVICE_EXTENSION; 00095 00096 00097 /* Driver extension associated with PCI driver */ 00098 typedef struct _PCI_DRIVER_EXTENSION 00099 { 00100 // 00101 LIST_ENTRY BusListHead; 00102 // Lock for namespace bus list 00103 KSPIN_LOCK BusListLock; 00104 } PCI_DRIVER_EXTENSION, *PPCI_DRIVER_EXTENSION; 00105 00106 00107 /* We need a global variable to get the driver extension, 00108 * because at least InterfacePciDevicePresent has no 00109 * other way to get it... */ 00110 extern PPCI_DRIVER_EXTENSION DriverExtension; 00111 00112 /* fdo.c */ 00113 00114 NTSTATUS 00115 FdoPnpControl( 00116 PDEVICE_OBJECT DeviceObject, 00117 PIRP Irp); 00118 00119 NTSTATUS 00120 FdoPowerControl( 00121 PDEVICE_OBJECT DeviceObject, 00122 PIRP Irp); 00123 00124 /* pci.c */ 00125 00126 NTSTATUS 00127 PciCreateDeviceIDString( 00128 PUNICODE_STRING DeviceID, 00129 PPCI_DEVICE Device); 00130 00131 NTSTATUS 00132 PciCreateInstanceIDString( 00133 PUNICODE_STRING InstanceID, 00134 PPCI_DEVICE Device); 00135 00136 NTSTATUS 00137 PciCreateHardwareIDsString( 00138 PUNICODE_STRING HardwareIDs, 00139 PPCI_DEVICE Device); 00140 00141 NTSTATUS 00142 PciCreateCompatibleIDsString( 00143 PUNICODE_STRING HardwareIDs, 00144 PPCI_DEVICE Device); 00145 00146 NTSTATUS 00147 PciCreateDeviceDescriptionString( 00148 PUNICODE_STRING DeviceDescription, 00149 PPCI_DEVICE Device); 00150 00151 NTSTATUS 00152 PciCreateDeviceLocationString( 00153 PUNICODE_STRING DeviceLocation, 00154 PPCI_DEVICE Device); 00155 00156 NTSTATUS 00157 PciDuplicateUnicodeString( 00158 IN ULONG Flags, 00159 IN PCUNICODE_STRING SourceString, 00160 OUT PUNICODE_STRING DestinationString); 00161 00162 /* pdo.c */ 00163 00164 NTSTATUS 00165 PdoPnpControl( 00166 PDEVICE_OBJECT DeviceObject, 00167 PIRP Irp); 00168 00169 NTSTATUS 00170 PdoPowerControl( 00171 PDEVICE_OBJECT DeviceObject, 00172 PIRP Irp); 00173 00174 NTSTATUS 00175 NTAPI 00176 DriverEntry( 00177 IN PDRIVER_OBJECT DriverObject, 00178 IN PUNICODE_STRING RegistryPath); Generated on Mon May 28 2012 04:27:19 for ReactOS by
1.7.6.1
|