ReactOS 0.4.15-dev-7924-g5949c20
fdo.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS PCI Bus Driver
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: drivers/bus/pci/fdo.c
5 * PURPOSE: FDO Device Management
6 * PROGRAMMERS: ReactOS Portable Systems Group
7 */
8
9/* INCLUDES *******************************************************************/
10
11#include <pci.h>
12
13#define NDEBUG
14#include <debug.h>
15
16/* GLOBALS ********************************************************************/
17
20
22{
28};
29
31{
58};
59
61{
70};
71
72/* FUNCTIONS ******************************************************************/
73
77 IN PIO_STACK_LOCATION IoStackLocation,
78 IN PPCI_FDO_EXTENSION DeviceExtension)
79{
82 PAGED_CODE();
83
84 /* The device stack must be starting the FDO in a success path */
85 if (!NT_SUCCESS(Irp->IoStatus.Status)) return STATUS_NOT_SUPPORTED;
86
87 /* Attempt to switch the state machine to the started state */
88 Status = PciBeginStateTransition(DeviceExtension, PciStarted);
89 if (!NT_SUCCESS(Status)) return Status;
90
91 /* Check for any boot-provided resources */
92 Resources = IoStackLocation->Parameters.StartDevice.AllocatedResources;
93 if ((Resources) && !(PCI_IS_ROOT_FDO(DeviceExtension)))
94 {
95 /* These resources would only be for non-root FDOs, unhandled for now */
96 ASSERT(Resources->Count == 1);
98 }
99
100 /* Initialize the arbiter for this FDO */
101 Status = PciInitializeArbiterRanges(DeviceExtension, Resources);
102 if (!NT_SUCCESS(Status))
103 {
104 /* Cancel the transition if this failed */
105 PciCancelStateTransition(DeviceExtension, PciStarted);
106 return Status;
107 }
108
109 /* Again, check for boot-provided resources for non-root FDO */
110 if ((Resources) && !(PCI_IS_ROOT_FDO(DeviceExtension)))
111 {
112 /* Unhandled for now */
113 ASSERT(Resources->Count == 1);
115 }
116
117 /* Commit the transition to the started state */
118 PciCommitStateTransition(DeviceExtension, PciStarted);
119 return STATUS_SUCCESS;
120}
121
123NTAPI
125 IN PIO_STACK_LOCATION IoStackLocation,
126 IN PPCI_FDO_EXTENSION DeviceExtension)
127{
129 UNREFERENCED_PARAMETER(IoStackLocation);
130 UNREFERENCED_PARAMETER(DeviceExtension);
131
134}
135
137NTAPI
139 IN PIO_STACK_LOCATION IoStackLocation,
140 IN PPCI_FDO_EXTENSION DeviceExtension)
141{
143 UNREFERENCED_PARAMETER(IoStackLocation);
144 UNREFERENCED_PARAMETER(DeviceExtension);
145
148}
149
151NTAPI
153 IN PIO_STACK_LOCATION IoStackLocation,
154 IN PPCI_FDO_EXTENSION DeviceExtension)
155{
157 UNREFERENCED_PARAMETER(IoStackLocation);
158 UNREFERENCED_PARAMETER(DeviceExtension);
159
162}
163
165NTAPI
167 IN PIO_STACK_LOCATION IoStackLocation,
168 IN PPCI_FDO_EXTENSION DeviceExtension)
169{
171 UNREFERENCED_PARAMETER(IoStackLocation);
172 UNREFERENCED_PARAMETER(DeviceExtension);
173
176}
177
179NTAPI
181 IN PIO_STACK_LOCATION IoStackLocation,
182 IN PPCI_FDO_EXTENSION DeviceExtension)
183{
185 UNREFERENCED_PARAMETER(IoStackLocation);
186 UNREFERENCED_PARAMETER(DeviceExtension);
187
190}
191
193NTAPI
195 IN PIO_STACK_LOCATION IoStackLocation,
196 IN PPCI_FDO_EXTENSION DeviceExtension)
197{
199 UNREFERENCED_PARAMETER(IoStackLocation);
200 UNREFERENCED_PARAMETER(DeviceExtension);
201
204}
205
207NTAPI
209 IN PIO_STACK_LOCATION IoStackLocation,
210 IN PPCI_FDO_EXTENSION DeviceExtension)
211{
213 PAGED_CODE();
214
215 /* Are bus relations being queried? */
216 if (IoStackLocation->Parameters.QueryDeviceRelations.Type != BusRelations)
217 {
218 /* The FDO is a bus, so only bus relations can be obtained */
220 }
221 else
222 {
223 /* Scan the PCI bus and build the device relations for the caller */
224 Status = PciQueryDeviceRelations(DeviceExtension,
226 &Irp->IoStatus.Information);
227 }
228
229 /* Return the enumeration status back */
230 return Status;
231}
232
234NTAPI
236 IN PIO_STACK_LOCATION IoStackLocation,
237 IN PPCI_FDO_EXTENSION DeviceExtension)
238{
240 PAGED_CODE();
241 ASSERT(DeviceExtension->ExtensionType == PciFdoExtensionType);
242
243 /* Deleted extensions don't respond to IRPs */
244 if (DeviceExtension->DeviceState == PciDeleted)
245 {
246 /* Hand it back to try to deal with it */
247 return PciPassIrpFromFdoToPdo(DeviceExtension, Irp);
248 }
249
250 /* Query our driver for this interface */
251 Status = PciQueryInterface(DeviceExtension,
252 IoStackLocation->Parameters.QueryInterface.
254 IoStackLocation->Parameters.QueryInterface.
255 Size,
256 IoStackLocation->Parameters.QueryInterface.
257 Version,
258 IoStackLocation->Parameters.QueryInterface.
260 IoStackLocation->Parameters.QueryInterface.
261 Interface,
262 FALSE);
263 if (NT_SUCCESS(Status))
264 {
265 /* We found it, let the PDO handle it */
266 Irp->IoStatus.Status = Status;
267 return PciPassIrpFromFdoToPdo(DeviceExtension, Irp);
268 }
269 else if (Status == STATUS_NOT_SUPPORTED)
270 {
271 /* Otherwise, we can't handle it, let someone else down the stack try */
272 Status = PciCallDownIrpStack(DeviceExtension, Irp);
274 {
275 /* They can't either, try a last-resort interface lookup */
276 Status = PciQueryInterface(DeviceExtension,
277 IoStackLocation->Parameters.QueryInterface.
279 IoStackLocation->Parameters.QueryInterface.
280 Size,
281 IoStackLocation->Parameters.QueryInterface.
282 Version,
283 IoStackLocation->Parameters.QueryInterface.
285 IoStackLocation->Parameters.QueryInterface.
286 Interface,
287 TRUE);
288 }
289 }
290
291 /* Has anyone claimed this interface yet? */
293 {
294 /* No, return the original IRP status */
295 Status = Irp->IoStatus.Status;
296 }
297 else
298 {
299 /* Yes, set the new IRP status */
300 Irp->IoStatus.Status = Status;
301 }
302
303 /* Complete this IRP */
305 return Status;
306}
307
309NTAPI
311 IN PIO_STACK_LOCATION IoStackLocation,
312 IN PPCI_FDO_EXTENSION DeviceExtension)
313{
315 PAGED_CODE();
316 ASSERT_FDO(DeviceExtension);
317
319
320 /* Get the capabilities */
321 Capabilities = IoStackLocation->Parameters.DeviceCapabilities.Capabilities;
322
323 /* Inherit wake levels and power mappings from the higher-up capabilities */
324 DeviceExtension->PowerState.SystemWakeLevel = Capabilities->SystemWake;
325 DeviceExtension->PowerState.DeviceWakeLevel = Capabilities->DeviceWake;
326 RtlCopyMemory(DeviceExtension->PowerState.SystemStateMapping,
327 Capabilities->DeviceState,
328 sizeof(DeviceExtension->PowerState.SystemStateMapping));
329
330 /* Dump the capabilities and return success */
332 return STATUS_SUCCESS;
333}
334
336NTAPI
338 IN PIO_STACK_LOCATION IoStackLocation,
339 IN PPCI_FDO_EXTENSION DeviceExtension)
340{
342 UNREFERENCED_PARAMETER(IoStackLocation);
343 UNREFERENCED_PARAMETER(DeviceExtension);
344
347}
348
350NTAPI
352 IN PIO_STACK_LOCATION IoStackLocation,
353 IN PPCI_FDO_EXTENSION DeviceExtension)
354{
356 UNREFERENCED_PARAMETER(IoStackLocation);
357 UNREFERENCED_PARAMETER(DeviceExtension);
358
361}
362
364NTAPI
366 IN PIO_STACK_LOCATION IoStackLocation,
367 IN PPCI_FDO_EXTENSION DeviceExtension)
368{
370 UNREFERENCED_PARAMETER(IoStackLocation);
371 UNREFERENCED_PARAMETER(DeviceExtension);
372
375}
376
377VOID
378NTAPI
380{
385 PAGED_CODE();
386
387 /* We should receive 4 parameters, per the HPP specification */
389
390 /* Allocate the buffer to hold the parameters */
392 if (!OutputBuffer) return;
393
394 /* Initialize the output and input buffers. The method is _HPP */
396 *(PULONG)InputBuffer.MethodName = 'PPH_';
398 do
399 {
400 /* Send the IOCTL to the ACPI driver */
401 Status = PciSendIoctl(FdoExtension->PhysicalDeviceObject,
404 sizeof(InputBuffer),
406 Length);
407 if (!NT_SUCCESS(Status))
408 {
409 /* The method failed, check if we can salvage data from parent */
411 {
412 /* Copy the root bus' hot plug parameters */
413 FdoExtension->HotPlugParameters = FdoExtension->ParentFdoExtension->HotPlugParameters;
414 }
415
416 /* Nothing more to do on this path */
417 break;
418 }
419
420 /* ACPI sent back some data. 4 parameters are expected in the output */
421 if (OutputBuffer->Count != 4) break;
422
423 /* HotPlug PCI Support not yet implemented */
425 } while (FALSE);
426
427 /* Free the buffer and return */
429}
430
431VOID
432NTAPI
436{
437 /* Initialize the extension */
439
440 /* Setup the common fields */
441 FdoExtension->PhysicalDeviceObject = PhysicalDeviceObject;
442 FdoExtension->FunctionalDeviceObject = DeviceObject;
443 FdoExtension->ExtensionType = PciFdoExtensionType;
444 FdoExtension->PowerState.CurrentSystemState = PowerSystemWorking;
445 FdoExtension->PowerState.CurrentDeviceState = PowerDeviceD0;
446 FdoExtension->IrpDispatchTable = &PciFdoDispatchTable;
447
448 /* Initialize the extension locks */
451
452 /* Initialize the default state */
454}
455
457NTAPI
460{
462 PDEVICE_OBJECT AttachedTo;
464 PPCI_FDO_EXTENSION ParentExtension;
473 PAGED_CODE();
474 DPRINT1("PCI - AddDevice (a new bus). PDO: %p (Driver: %wZ)\n",
475 PhysicalDeviceObject, &PhysicalDeviceObject->DriverObject->DriverName);
476
477 /* Zero out variables so failure path knows what to do */
478 AttachedTo = NULL;
482
483 do
484 {
485 /* Check if there's already a device extension for this bus */
488 if (ParentExtension)
489 {
490 /* Make sure we find a real PDO */
493
494 /* Make sure it's a PCI-to-PCI bridge */
495 if ((PdoExtension->BaseClass != PCI_CLASS_BRIDGE_DEV) ||
497 {
498 /* This should never happen */
499 DPRINT1("PCI - PciAddDevice for Non-Root/Non-PCI-PCI bridge,\n"
500 " Class %02x, SubClass %02x, will not add.\n",
501 PdoExtension->BaseClass,
502 PdoExtension->SubClass);
503 ASSERT((PdoExtension->BaseClass == PCI_CLASS_BRIDGE_DEV) &&
505
506 /* Enter the failure path */
508 break;
509 }
510
511 /* Subordinate bus on the bridge */
512 DPRINT1("PCI - AddDevice (new bus is child of bus 0x%x).\n",
513 ParentExtension->BaseBus);
514
515 /* Make sure PCI bus numbers are configured */
517 {
518 /* This is a critical failure */
519 DPRINT1("PCI - Bus numbers not configured for bridge (0x%x.0x%x.0x%x)\n",
520 ParentExtension->BaseBus,
521 PdoExtension->Slot.u.bits.DeviceNumber,
522 PdoExtension->Slot.u.bits.FunctionNumber);
523
524 /* Enter the failure path */
526 break;
527 }
528 }
529
530 /* Create the FDO for the bus */
532 sizeof(PCI_FDO_EXTENSION),
533 NULL,
535 0,
536 0,
537 &DeviceObject);
538 if (!NT_SUCCESS(Status)) break;
539
540 /* Initialize the extension for the FDO */
541 FdoExtension = DeviceObject->DeviceExtension;
545
546 /* Attach to the root PDO */
550 ASSERT(AttachedTo != NULL);
551 if (!AttachedTo) break;
552 FdoExtension->AttachedDeviceObject = AttachedTo;
553
554 /* Check if this is a child bus, or the root */
555 if (ParentExtension)
556 {
557 /* The child inherits root data */
558 FdoExtension->BaseBus = PdoExtension->Dependent.type1.SecondaryBus;
559 FdoExtension->BusRootFdoExtension = ParentExtension->BusRootFdoExtension;
560 PdoExtension->BridgeFdoExtension = FdoExtension;
561 FdoExtension->ParentFdoExtension = ParentExtension;
562 }
563 else
564 {
565 /* Query the boot configuration */
568 (PVOID*)&Descriptor);
569 if (!NT_SUCCESS(Status))
570 {
571 /* No configuration has been set */
573 }
574 else
575 {
576 /* Root PDO in ReactOS does not assign boot resources */
577 UNIMPLEMENTED_DBGBREAK("Encountered during setup\n");
579 }
580
581 if (Descriptor)
582 {
583 /* Root PDO in ReactOS does not assign boot resources */
585 }
586 else
587 {
588 /* Default configuration isn't the normal path on Windows */
590 {
591 /* If a second bus is found and there's still no data, crash */
592 KeBugCheckEx(PCI_BUS_DRIVER_INTERNAL,
593 0xDEAD0010u,
595 0,
596 0);
597 }
598
599 /* Warn that a default configuration will be used, and set bus 0 */
600 DPRINT1("PCI Will use default configuration.\n");
602 FdoExtension->BaseBus = 0;
603 }
604
605 /* This is the root bus */
606 FdoExtension->BusRootFdoExtension = FdoExtension;
607 }
608
609 /* Get the HAL or ACPI Bus Handler Callbacks for Configuration Access */
611 if (!NT_SUCCESS(Status)) break;
612
613 /* Initialize all the supported PCI arbiters */
615 if (!NT_SUCCESS(Status)) break;
616
617 /* This is a real FDO, insert it into the list */
618 FdoExtension->Fake = FALSE;
622
623 /* Open the device registry key so that we can query the errata flags */
627 &KeyHandle),
628
629 /* Open the value that contains errata flags for this bus instance */
630 RtlInitUnicodeString(&ValueName, L"HackFlags");
631 Status = ZwQueryValueKey(KeyHandle,
632 &ValueName,
634 ValueInfo,
635 sizeof(Buffer),
636 &ResultLength);
638 if (NT_SUCCESS(Status))
639 {
640 /* Make sure the data is of expected type and size */
641 if ((ValueInfo->Type == REG_DWORD) &&
642 (ValueInfo->DataLength == sizeof(ULONG)))
643 {
644 /* Read the flags for this bus */
645 FdoExtension->BusHackFlags = *(PULONG)&ValueInfo->Data;
646 }
647 }
648
649 /* Query ACPI for PCI HotPlug Support */
651
652 /* The Bus FDO is now initialized */
653 DeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
654 return STATUS_SUCCESS;
655 } while (FALSE);
656
657 /* This is the failure path */
659
660 /* Check if the FDO extension exists */
661 if (FdoExtension) DPRINT1("Should destroy secondaries\n");
662
663 /* Delete device objects */
664 if (AttachedTo) IoDetachDevice(AttachedTo);
666 return Status;
667}
668
669/* EOF */
#define PAGED_CODE()
unsigned char BOOLEAN
struct _ACPI_EVAL_OUTPUT_BUFFER ACPI_EVAL_OUTPUT_BUFFER
#define ACPI_EVAL_INPUT_BUFFER_SIGNATURE
Definition: acpiioct.h:7
#define IOCTL_ACPI_EVAL_METHOD
Definition: acpiioct.h:178
ACPI_EVAL_OUTPUT_BUFFER UNALIGNED * PACPI_EVAL_OUTPUT_BUFFER
Definition: acpiioct.h:90
NTSTATUS NTAPI PciInitializeArbiterRanges(IN PPCI_FDO_EXTENSION DeviceExtension, IN PCM_RESOURCE_LIST Resources)
Definition: arb_comn.c:128
NTSTATUS NTAPI PciInitializeArbiters(IN PPCI_FDO_EXTENSION FdoExtension)
Definition: arb_comn.c:40
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define UNIMPLEMENTED
Definition: debug.h:115
PDEVICE_OBJECT PhysicalDeviceObject
Definition: btrfs_drv.h:1157
PCI_MN_DISPATCH_TABLE PciFdoDispatchPnpTable[]
Definition: fdo.c:30
NTSTATUS NTAPI PciFdoIrpQueryLegacyBusInformation(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension)
Definition: fdo.c:365
NTSTATUS NTAPI PciFdoIrpStartDevice(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension)
Definition: fdo.c:76
NTSTATUS NTAPI PciFdoIrpStopDevice(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension)
Definition: fdo.c:166
NTSTATUS NTAPI PciFdoIrpSurpriseRemoval(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension)
Definition: fdo.c:351
PCI_MJ_DISPATCH_TABLE PciFdoDispatchTable
Definition: fdo.c:60
VOID NTAPI PciInitializeFdoExtensionCommonFields(PPCI_FDO_EXTENSION FdoExtension, IN PDEVICE_OBJECT DeviceObject, IN PDEVICE_OBJECT PhysicalDeviceObject)
Definition: fdo.c:433
NTSTATUS NTAPI PciFdoIrpQueryDeviceRelations(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension)
Definition: fdo.c:208
NTSTATUS NTAPI PciFdoIrpQueryRemoveDevice(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension)
Definition: fdo.c:124
PCI_MN_DISPATCH_TABLE PciFdoDispatchPowerTable[]
Definition: fdo.c:21
NTSTATUS NTAPI PciFdoIrpCancelRemoveDevice(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension)
Definition: fdo.c:152
NTSTATUS NTAPI PciFdoIrpQueryInterface(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension)
Definition: fdo.c:235
NTSTATUS NTAPI PciFdoIrpQueryCapabilities(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension)
Definition: fdo.c:310
BOOLEAN PciBreakOnDefault
Definition: fdo.c:19
SINGLE_LIST_ENTRY PciFdoExtensionListHead
Definition: fdo.c:18
NTSTATUS NTAPI PciFdoIrpDeviceUsageNotification(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension)
Definition: fdo.c:337
NTSTATUS NTAPI PciFdoIrpQueryStopDevice(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension)
Definition: fdo.c:180
VOID NTAPI PciGetHotPlugParameters(IN PPCI_FDO_EXTENSION FdoExtension)
Definition: fdo.c:379
NTSTATUS NTAPI PciFdoIrpCancelStopDevice(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension)
Definition: fdo.c:194
NTSTATUS NTAPI PciFdoIrpRemoveDevice(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension)
Definition: fdo.c:138
Definition: bufpool.h:45
_In_ PIRP Irp
Definition: csq.h:116
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
VOID NTAPI PciDebugDumpQueryCapabilities(IN PDEVICE_CAPABILITIES DeviceCaps)
Definition: debug.c:221
NTSTATUS NTAPI PciIrpNotSupported(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension)
Definition: dispatch.c:261
NTSTATUS NTAPI PciCallDownIrpStack(IN PPCI_FDO_EXTENSION DeviceExtension, IN PIRP Irp)
Definition: dispatch.c:39
NTSTATUS NTAPI PciPassIrpFromFdoToPdo(IN PPCI_FDO_EXTENSION DeviceExtension, IN PIRP Irp)
Definition: dispatch.c:70
NTSTATUS NTAPI PciQueryDeviceRelations(IN PPCI_FDO_EXTENSION DeviceExtension, IN OUT PDEVICE_RELATIONS *pDeviceRelations)
Definition: enum.c:2034
KEVENT PciGlobalLock
Definition: init.c:20
VOID NTAPI PciInsertEntryAtTail(IN PSINGLE_LIST_ENTRY ListHead, IN PPCI_FDO_EXTENSION DeviceExtension, IN PKEVENT Lock)
Definition: utils.c:400
NTSTATUS NTAPI PciFdoWaitWake(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension)
Definition: power.c:206
@ PciDeleted
Definition: pci.h:131
@ PciStarted
Definition: pci.h:130
NTSTATUS NTAPI PciFdoSetPowerState(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension)
Definition: power.c:221
NTSTATUS NTAPI PciCancelStateTransition(IN PPCI_FDO_EXTENSION DeviceExtension, IN PCI_STATE NewState)
Definition: state.c:145
NTSTATUS NTAPI PciBeginStateTransition(IN PPCI_FDO_EXTENSION DeviceExtension, IN PCI_STATE NewState)
Definition: state.c:97
BOOLEAN NTAPI PciAreBusNumbersConfigured(IN PPCI_PDO_EXTENSION PdoExtension)
Definition: busno.c:20
@ IRP_UPWARD
Definition: pci.h:145
@ IRP_DISPATCH
Definition: pci.h:146
@ IRP_DOWNWARD
Definition: pci.h:144
NTSTATUS(NTAPI * PCI_DISPATCH_FUNCTION)(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PVOID DeviceExtension)
Definition: pci.h:325
#define PCI_IS_ROOT_FDO(x)
Definition: pci.h:32
PPCI_FDO_EXTENSION NTAPI PciFindParentPciFdoExtension(IN PDEVICE_OBJECT DeviceObject, IN PKEVENT Lock)
Definition: utils.c:340
NTSTATUS NTAPI PciGetDeviceProperty(IN PDEVICE_OBJECT DeviceObject, IN DEVICE_REGISTRY_PROPERTY DeviceProperty, OUT PVOID *OutputBuffer)
Definition: utils.c:475
#define PCI_POOL_TAG
Definition: pci.h:27
VOID NTAPI PciCommitStateTransition(IN PPCI_FDO_EXTENSION DeviceExtension, IN PCI_STATE NewState)
Definition: state.c:181
#define ASSERT_FDO(x)
Definition: pci.h:37
#define ASSERT_PDO(x)
Definition: pci.h:38
NTSTATUS NTAPI PciFdoIrpQueryPower(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension)
Definition: power.c:236
VOID NTAPI PciInitializeState(IN PPCI_FDO_EXTENSION DeviceExtension)
Definition: state.c:88
NTSTATUS NTAPI PciGetConfigHandlers(IN PPCI_FDO_EXTENSION FdoExtension)
Definition: config.c:224
NTSTATUS NTAPI PciSendIoctl(IN PDEVICE_OBJECT DeviceObject, IN ULONG IoControlCode, IN PVOID InputBuffer, IN ULONG InputBufferLength, IN PVOID OutputBuffer, IN ULONG OutputBufferLength)
Definition: utils.c:531
@ PciFdoExtensionType
Definition: pci.h:95
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57
@ PdoExtension
Definition: precomp.h:49
@ FdoExtension
Definition: precomp.h:48
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
#define PagedPool
Definition: env_spec_w32.h:308
Status
Definition: gdiplustypes.h:25
_Must_inspect_result_ typedef _Out_ PHIDP_CAPS Capabilities
Definition: hidclass.h:103
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)
Definition: intrface.c:45
#define ASSERT(a)
Definition: mode.c:44
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
Definition: ndis.h:4715
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
@ KeyValuePartialInformation
Definition: nt_native.h:1182
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
struct _KEY_VALUE_PARTIAL_INFORMATION KEY_VALUE_PARTIAL_INFORMATION
struct _KEY_VALUE_PARTIAL_INFORMATION * PKEY_VALUE_PARTIAL_INFORMATION
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
@ SynchronizationEvent
PDEVICE_OBJECT NTAPI IoAttachDeviceToDeviceStack(IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice)
Definition: device.c:966
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1031
VOID NTAPI IoDetachDevice(IN PDEVICE_OBJECT TargetDevice)
Definition: device.c:1296
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
#define IoCompleteRequest
Definition: irp.c:1240
@ PowerSystemWorking
Definition: ntpoapi.h:36
@ PowerDeviceD0
Definition: ntpoapi.h:49
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:423
#define L(x)
Definition: ntvdm.h:50
static DRIVER_ADD_DEVICE PciAddDevice
Definition: pci.c:20
NTSTATUS NTAPI IoOpenDeviceRegistryKey(IN PDEVICE_OBJECT DeviceObject, IN ULONG DevInstKeyType, IN ACCESS_MASK DesiredAccess, OUT PHANDLE DevInstRegKey)
Definition: pnpmgr.c:1621
#define FILE_DEVICE_BUS_EXTENDER
Definition: winioctl.h:148
VOID NTAPI KeBugCheckEx(_In_ ULONG BugCheckCode, _In_ ULONG_PTR BugCheckParameter1, _In_ ULONG_PTR BugCheckParameter2, _In_ ULONG_PTR BugCheckParameter3, _In_ ULONG_PTR BugCheckParameter4)
Definition: rtlcompat.c:108
#define REG_DWORD
Definition: sdbapi.c:596
#define STATUS_SUCCESS
Definition: shellext.h:65
PVOID DeviceExtension
Definition: env_spec_w32.h:418
BOOLEAN BaseBus
Definition: pci.h:211
struct _PCI_FDO_EXTENSION * BusRootFdoExtension
Definition: pci.h:205
Definition: ntbasedef.h:628
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define STATUS_NO_SUCH_DEVICE
Definition: udferr_usr.h:136
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
Definition: wdfdevice.h:3776
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID InterfaceType
Definition: wdffdo.h:463
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT Version
Definition: wdffdo.h:469
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT _In_opt_ PVOID InterfaceSpecificData
Definition: wdffdo.h:472
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR OutputBuffer
Definition: wdfiotarget.h:863
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
Definition: wdfiotarget.h:953
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:243
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:342
#define PLUGPLAY_REGKEY_DEVICE
Definition: iofuncs.h:2786
@ BusRelations
Definition: iotypes.h:2152
#define IO_NO_INCREMENT
Definition: iotypes.h:598
#define PCI_SUBCLASS_BR_PCI_TO_PCI
Definition: iotypes.h:4165
@ DevicePropertyBootConfiguration
Definition: iotypes.h:1198
#define PCI_CLASS_BRIDGE_DEV
Definition: iotypes.h:4109
* PDEVICE_CAPABILITIES
Definition: iotypes.h:965
#define IRP_MN_QUERY_POWER
#define IRP_MN_QUERY_LEGACY_BUS_INFORMATION
Definition: iotypes.h:4427
unsigned char UCHAR
Definition: xmlstorage.h:181