ReactOS  0.4.14-dev-41-g31d7680
pdo.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/pdo.c
5  * PURPOSE: PDO 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 
19 
21 C_ASSERT(FIELD_OFFSET(PCI_FDO_EXTENSION, TentativeNextState) == FIELD_OFFSET(PCI_PDO_EXTENSION, TentativeNextState));
23 
25 {
31 };
32 
34 {
61 };
62 
64 {
73 };
74 
75 /* FUNCTIONS ******************************************************************/
76 
78 NTAPI
80  IN PIO_STACK_LOCATION IoStackLocation,
81  IN PPCI_PDO_EXTENSION DeviceExtension)
82 {
84  UNREFERENCED_PARAMETER(IoStackLocation);
85  UNREFERENCED_PARAMETER(DeviceExtension);
86 
88  return STATUS_NOT_SUPPORTED;
89 }
90 
92 NTAPI
94  IN PIO_STACK_LOCATION IoStackLocation,
95  IN PPCI_PDO_EXTENSION DeviceExtension)
96 {
98  UNREFERENCED_PARAMETER(IoStackLocation);
99  UNREFERENCED_PARAMETER(DeviceExtension);
100 
102  return STATUS_NOT_SUPPORTED;
103 }
104 
105 NTSTATUS
106 NTAPI
108  IN PIO_STACK_LOCATION IoStackLocation,
109  IN PPCI_PDO_EXTENSION DeviceExtension)
110 {
112  UNREFERENCED_PARAMETER(IoStackLocation);
113  UNREFERENCED_PARAMETER(DeviceExtension);
114 
116  return STATUS_NOT_SUPPORTED;
117 }
118 
119 NTSTATUS
120 NTAPI
122  IN PIO_STACK_LOCATION IoStackLocation,
123  IN PPCI_PDO_EXTENSION DeviceExtension)
124 {
126  BOOLEAN Changed, DoReset;
128  PAGED_CODE();
129 
131 
132  DoReset = FALSE;
133 
134  /* Begin entering the start phase */
135  Status = PciBeginStateTransition((PVOID)DeviceExtension, PciStarted);
136  if (!NT_SUCCESS(Status)) return Status;
137 
138  /* Check if this is a VGA device */
139  if (((DeviceExtension->BaseClass == PCI_CLASS_PRE_20) &&
140  (DeviceExtension->SubClass == PCI_SUBCLASS_PRE_20_VGA)) ||
141  ((DeviceExtension->BaseClass == PCI_CLASS_DISPLAY_CTLR) &&
142  (DeviceExtension->SubClass == PCI_SUBCLASS_VID_VGA_CTLR)))
143  {
144  /* Always force it on */
145  DeviceExtension->CommandEnables |= (PCI_ENABLE_IO_SPACE |
147  }
148 
149  /* Check if native IDE is enabled and it owns the I/O ports */
150  if (DeviceExtension->IoSpaceUnderNativeIdeControl)
151  {
152  /* Then don't allow I/O access */
153  DeviceExtension->CommandEnables &= ~PCI_ENABLE_IO_SPACE;
154  }
155 
156  /* Always enable bus mastering */
157  DeviceExtension->CommandEnables |= PCI_ENABLE_BUS_MASTER;
158 
159  /* Check if the OS assigned resources differ from the PCI configuration */
160  Changed = PciComputeNewCurrentSettings(DeviceExtension,
161  IoStackLocation->Parameters.
162  StartDevice.AllocatedResources);
163  if (Changed)
164  {
165  /* Remember this for later */
166  DeviceExtension->MovedDevice = TRUE;
167  }
168  else
169  {
170  /* All good */
171  DPRINT1("PCI - START not changing resource settings.\n");
172  }
173 
174  /* Check if the device was sleeping */
175  if (DeviceExtension->PowerState.CurrentDeviceState != PowerDeviceD0)
176  {
177  /* Power it up */
178  Status = PciSetPowerManagedDevicePowerState(DeviceExtension,
180  FALSE);
181  if (!NT_SUCCESS(Status))
182  {
183  /* Powerup fail, fail the request */
184  PciCancelStateTransition((PVOID)DeviceExtension, PciStarted);
186  }
187 
188  /* Tell the power manager that the device is powered up */
190  PoSetPowerState(DeviceExtension->PhysicalDeviceObject,
192  PowerState);
193 
194  /* Update internal state */
195  DeviceExtension->PowerState.CurrentDeviceState = PowerDeviceD0;
196 
197  /* This device's resources and decodes will need to be reset */
198  DoReset = TRUE;
199  }
200 
201  /* Update resource information now that the device is powered up and active */
202  Status = PciSetResources(DeviceExtension, DoReset, TRUE);
203  if (!NT_SUCCESS(Status))
204  {
205  /* That failed, so cancel the transition */
206  PciCancelStateTransition((PVOID)DeviceExtension, PciStarted);
207  }
208  else
209  {
210  /* Fully commit, as the device is now started up and ready to go */
211  PciCommitStateTransition((PVOID)DeviceExtension, PciStarted);
212  }
213 
214  /* Return the result of the start request */
215  return Status;
216 }
217 
218 NTSTATUS
219 NTAPI
221  IN PIO_STACK_LOCATION IoStackLocation,
222  IN PPCI_PDO_EXTENSION DeviceExtension)
223 {
225  UNREFERENCED_PARAMETER(IoStackLocation);
226  UNREFERENCED_PARAMETER(DeviceExtension);
227 
229  return STATUS_NOT_SUPPORTED;
230 }
231 
232 NTSTATUS
233 NTAPI
235  IN PIO_STACK_LOCATION IoStackLocation,
236  IN PPCI_PDO_EXTENSION DeviceExtension)
237 {
239  UNREFERENCED_PARAMETER(IoStackLocation);
240  UNREFERENCED_PARAMETER(DeviceExtension);
241 
243  return STATUS_NOT_SUPPORTED;
244 }
245 
246 NTSTATUS
247 NTAPI
249  IN PIO_STACK_LOCATION IoStackLocation,
250  IN PPCI_PDO_EXTENSION DeviceExtension)
251 {
253  UNREFERENCED_PARAMETER(IoStackLocation);
254  UNREFERENCED_PARAMETER(DeviceExtension);
255 
257  return STATUS_NOT_SUPPORTED;
258 }
259 
260 NTSTATUS
261 NTAPI
263  IN PIO_STACK_LOCATION IoStackLocation,
264  IN PPCI_PDO_EXTENSION DeviceExtension)
265 {
267  UNREFERENCED_PARAMETER(IoStackLocation);
268  UNREFERENCED_PARAMETER(DeviceExtension);
269 
271  return STATUS_NOT_SUPPORTED;
272 }
273 
274 NTSTATUS
275 NTAPI
277  IN PIO_STACK_LOCATION IoStackLocation,
278  IN PPCI_PDO_EXTENSION DeviceExtension)
279 {
281  UNREFERENCED_PARAMETER(IoStackLocation);
282  UNREFERENCED_PARAMETER(DeviceExtension);
283 
285  return STATUS_NOT_SUPPORTED;
286 }
287 
288 NTSTATUS
289 NTAPI
291  IN PIO_STACK_LOCATION IoStackLocation,
292  IN PPCI_PDO_EXTENSION DeviceExtension)
293 {
295  UNREFERENCED_PARAMETER(IoStackLocation);
296  UNREFERENCED_PARAMETER(DeviceExtension);
297 
299  return STATUS_NOT_SUPPORTED;
300 }
301 
302 NTSTATUS
303 NTAPI
305  IN PIO_STACK_LOCATION IoStackLocation,
306  IN PPCI_PDO_EXTENSION DeviceExtension)
307 {
309  UNREFERENCED_PARAMETER(IoStackLocation);
310  UNREFERENCED_PARAMETER(DeviceExtension);
311 
313  return STATUS_NOT_SUPPORTED;
314 }
315 
316 NTSTATUS
317 NTAPI
319  IN PIO_STACK_LOCATION IoStackLocation,
320  IN PPCI_PDO_EXTENSION DeviceExtension)
321 {
323  PAGED_CODE();
324 
325  /* Are ejection relations being queried? */
326  if (IoStackLocation->Parameters.QueryDeviceRelations.Type == EjectionRelations)
327  {
328  /* Call the worker function */
329  Status = PciQueryEjectionRelations(DeviceExtension,
331  IoStatus.Information);
332  }
333  else if (IoStackLocation->Parameters.QueryDeviceRelations.Type == TargetDeviceRelation)
334  {
335  /* The only other relation supported is the target device relation */
336  Status = PciQueryTargetDeviceRelations(DeviceExtension,
338  IoStatus.Information);
339  }
340  else
341  {
342  /* All other relations are unsupported */
344  }
345 
346  /* Return either the result of the worker function, or unsupported status */
347  return Status;
348 }
349 
350 NTSTATUS
351 NTAPI
353  IN PIO_STACK_LOCATION IoStackLocation,
354  IN PPCI_PDO_EXTENSION DeviceExtension)
355 {
356  PAGED_CODE();
357 
359 
360  /* Call the worker function */
361  return PciQueryCapabilities(DeviceExtension,
362  IoStackLocation->
363  Parameters.DeviceCapabilities.Capabilities);
364 }
365 
366 NTSTATUS
367 NTAPI
369  IN PIO_STACK_LOCATION IoStackLocation,
370  IN PPCI_PDO_EXTENSION DeviceExtension)
371 {
372  PAGED_CODE();
373 
374  UNREFERENCED_PARAMETER(IoStackLocation);
375 
376  /* Call the worker function */
377  return PciQueryResources(DeviceExtension,
378  (PCM_RESOURCE_LIST*)&Irp->IoStatus.Information);
379 }
380 
381 NTSTATUS
382 NTAPI
384  IN PIO_STACK_LOCATION IoStackLocation,
385  IN PPCI_PDO_EXTENSION DeviceExtension)
386 {
387  PAGED_CODE();
388 
389  UNREFERENCED_PARAMETER(IoStackLocation);
390 
391  /* Call the worker function */
392  return PciQueryRequirements(DeviceExtension,
394  IoStatus.Information);
395 }
396 
397 NTSTATUS
398 NTAPI
400  IN PIO_STACK_LOCATION IoStackLocation,
401  IN PPCI_PDO_EXTENSION DeviceExtension)
402 {
403  PAGED_CODE();
404 
405  /* Call the worker function */
406  return PciQueryDeviceText(DeviceExtension,
407  IoStackLocation->
408  Parameters.QueryDeviceText.DeviceTextType,
409  IoStackLocation->
410  Parameters.QueryDeviceText.LocaleId,
411  (PWCHAR*)&Irp->IoStatus.Information);
412 }
413 
414 NTSTATUS
415 NTAPI
417  IN PIO_STACK_LOCATION IoStackLocation,
418  IN PPCI_PDO_EXTENSION DeviceExtension)
419 {
420  PAGED_CODE();
421 
422  /* Call the worker function */
423  return PciQueryId(DeviceExtension,
424  IoStackLocation->Parameters.QueryId.IdType,
425  (PWCHAR*)&Irp->IoStatus.Information);
426 }
427 
428 NTSTATUS
429 NTAPI
431  IN PIO_STACK_LOCATION IoStackLocation,
432  IN PPCI_PDO_EXTENSION DeviceExtension)
433 {
434  PAGED_CODE();
435 
436  UNREFERENCED_PARAMETER(IoStackLocation);
437 
438  /* Call the worker function */
439  return PciQueryBusInformation(DeviceExtension,
441  IoStatus.Information);
442 }
443 
444 NTSTATUS
445 NTAPI
447  IN PIO_STACK_LOCATION IoStackLocation,
448  IN PPCI_PDO_EXTENSION DeviceExtension)
449 {
451  UNREFERENCED_PARAMETER(IoStackLocation);
452  UNREFERENCED_PARAMETER(DeviceExtension);
453 
455  return STATUS_NOT_SUPPORTED;
456 }
457 
458 NTSTATUS
459 NTAPI
461  IN PIO_STACK_LOCATION IoStackLocation,
462  IN PPCI_PDO_EXTENSION DeviceExtension)
463 {
465  UNREFERENCED_PARAMETER(IoStackLocation);
466  UNREFERENCED_PARAMETER(DeviceExtension);
467 
469  return STATUS_NOT_SUPPORTED;
470 }
471 
472 NTSTATUS
473 NTAPI
475  IN PIO_STACK_LOCATION IoStackLocation,
476  IN PPCI_PDO_EXTENSION DeviceExtension)
477 {
479  UNREFERENCED_PARAMETER(IoStackLocation);
480  UNREFERENCED_PARAMETER(DeviceExtension);
481 
483  return STATUS_NOT_SUPPORTED;
484 }
485 
486 NTSTATUS
487 NTAPI
489  IN PIO_STACK_LOCATION IoStackLocation,
490  IN PPCI_PDO_EXTENSION DeviceExtension)
491 {
493  UNREFERENCED_PARAMETER(IoStackLocation);
494  UNREFERENCED_PARAMETER(DeviceExtension);
495 
497  return STATUS_NOT_SUPPORTED;
498 }
499 
500 NTSTATUS
501 NTAPI
503  IN PIO_STACK_LOCATION IoStackLocation,
504  IN PPCI_PDO_EXTENSION DeviceExtension)
505 {
507  UNREFERENCED_PARAMETER(IoStackLocation);
508  UNREFERENCED_PARAMETER(DeviceExtension);
509 
511  return STATUS_NOT_SUPPORTED;
512 }
513 
514 NTSTATUS
515 NTAPI
517  IN PIO_STACK_LOCATION IoStackLocation,
518  IN PPCI_PDO_EXTENSION DeviceExtension)
519 {
521  UNREFERENCED_PARAMETER(IoStackLocation);
522  UNREFERENCED_PARAMETER(DeviceExtension);
523 
525  return STATUS_NOT_SUPPORTED;
526 }
527 
528 NTSTATUS
529 NTAPI
531  IN PCI_SLOT_NUMBER Slot,
533 {
534  WCHAR DeviceName[32];
535  UNICODE_STRING DeviceString;
539  ULONG SequenceNumber;
540  PAGED_CODE();
541 
542  /* Pick an atomically unique sequence number for this device */
543  SequenceNumber = InterlockedIncrement(&PciPdoSequenceNumber);
544 
545  /* Create the standard PCI device name for a PDO */
546  swprintf(DeviceName, L"\\Device\\NTPNP_PCI%04d", SequenceNumber);
547  RtlInitUnicodeString(&DeviceString, DeviceName);
548 
549  /* Create the actual device now */
550  Status = IoCreateDevice(DeviceExtension->FunctionalDeviceObject->DriverObject,
551  sizeof(PCI_PDO_EXTENSION),
552  &DeviceString,
554  0,
555  0,
556  &DeviceObject);
558 
559  /* Get the extension for it */
561  DPRINT1("PCI: New PDO (b=0x%x, d=0x%x, f=0x%x) @ %p, ext @ %p\n",
562  DeviceExtension->BaseBus,
563  Slot.u.bits.DeviceNumber,
564  Slot.u.bits.FunctionNumber,
565  DeviceObject,
567 
568  /* Configure the extension */
569  PdoExtension->ExtensionType = PciPdoExtensionType;
570  PdoExtension->IrpDispatchTable = &PciPdoDispatchTable;
571  PdoExtension->PhysicalDeviceObject = DeviceObject;
572  PdoExtension->Slot = Slot;
573  PdoExtension->PowerState.CurrentSystemState = PowerDeviceD0;
574  PdoExtension->PowerState.CurrentDeviceState = PowerDeviceD0;
575  PdoExtension->ParentFdoExtension = DeviceExtension;
576 
577  /* Initialize the lock for arbiters and other interfaces */
579 
580  /* Initialize the state machine */
582 
583  /* Add the PDO to the parent's list */
584  PdoExtension->Next = NULL;
585  PciInsertEntryAtTail((PSINGLE_LIST_ENTRY)&DeviceExtension->ChildPdoList,
587  &DeviceExtension->ChildListLock);
588 
589  /* And finally return it to the caller */
591  return STATUS_SUCCESS;
592 }
593 
594 /* EOF */
VOID NTAPI PciInsertEntryAtTail(IN PSINGLE_LIST_ENTRY ListHead, IN PPCI_FDO_EXTENSION DeviceExtension, IN PKEVENT Lock)
Definition: utils.c:400
VOID NTAPI PciCommitStateTransition(IN PPCI_FDO_EXTENSION DeviceExtension, IN PCI_STATE NewState)
Definition: state.c:181
#define IN
Definition: typedefs.h:38
BOOLEAN NTAPI PciComputeNewCurrentSettings(IN PPCI_PDO_EXTENSION PdoExtension, IN PCM_RESOURCE_LIST ResourceList)
Definition: enum.c:55
#define TRUE
Definition: types.h:120
_In_ UCHAR _In_ POWER_STATE PowerState
Definition: pofuncs.h:42
NTSTATUS NTAPI PciPdoIrpQueryRemoveDevice(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:220
#define IRP_MN_QUERY_POWER
Definition: ntbasedef.h:635
#define PCI_ENABLE_IO_SPACE
Definition: iotypes.h:3260
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
NTSTATUS NTAPI PciPdoIrpWriteConfig(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:460
_In_ PIRP Irp
Definition: csq.h:116
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
NTSTATUS NTAPI PciPdoIrpQueryDeviceRelations(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:318
NTSTATUS NTAPI PciPdoIrpCancelRemoveDevice(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:248
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI PciPdoIrpQueryDeviceState(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:474
NTSTATUS NTAPI PciQueryId(IN PPCI_PDO_EXTENSION DeviceExtension, IN BUS_QUERY_ID_TYPE QueryType, OUT PWCHAR *Buffer)
Definition: id.c:200
NTSTATUS NTAPI PciQueryResources(IN PPCI_PDO_EXTENSION PdoExtension, OUT PCM_RESOURCE_LIST *Buffer)
Definition: enum.c:354
NTSTATUS NTAPI PciPdoCreate(IN PPCI_FDO_EXTENSION DeviceExtension, IN PCI_SLOT_NUMBER Slot, OUT PDEVICE_OBJECT *PdoDeviceObject)
Definition: pdo.c:530
LONG PciPdoSequenceNumber
Definition: pdo.c:18
NTSTATUS NTAPI PciPdoIrpQueryInterface(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:304
NTSTATUS NTAPI PciPdoIrpQueryLegacyBusInformation(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:516
#define IRP_MN_QUERY_LEGACY_BUS_INFORMATION
Definition: iotypes.h:4071
_Outptr_ PUSB_DEVICE_HANDLE _In_ PUSB_DEVICE_HANDLE _In_ USHORT _In_ PUSB_PORT_PATH _Out_ PUSB_CD_ERROR_INFORMATION _In_ USHORT _In_ PDEVICE_OBJECT PdoDeviceObject
Definition: hubbusif.h:89
NTSTATUS NTAPI PciQueryRequirements(IN PPCI_PDO_EXTENSION PdoExtension, IN OUT PIO_RESOURCE_REQUIREMENTS_LIST *RequirementsList)
Definition: enum.c:583
uint16_t * PWCHAR
Definition: typedefs.h:54
WCHAR DeviceName[]
Definition: adapter.cpp:21
NTSTATUS NTAPI PciPdoIrpQueryResourceRequirements(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:383
NTSTATUS NTAPI PciPdoIrpQueryPower(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:107
struct _PCI_PDO_EXTENSION * PPCI_PDO_EXTENSION
#define PAGED_CODE()
Definition: video.h:57
NTSTATUS NTAPI PciPdoIrpCancelStopDevice(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:290
NTSTATUS NTAPI PciPdoIrpRemoveDevice(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:234
NTSTATUS NTAPI PciSetPowerManagedDevicePowerState(IN PPCI_PDO_EXTENSION DeviceExtension, IN DEVICE_POWER_STATE DeviceState, IN BOOLEAN IrpSet)
Definition: power.c:121
NTSTATUS NTAPI PciPdoIrpDeviceUsageNotification(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:488
NTSTATUS NTAPI PciQueryEjectionRelations(IN PPCI_PDO_EXTENSION PdoExtension, IN OUT PDEVICE_RELATIONS *pDeviceRelations)
Definition: enum.c:538
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
C_ASSERT(FIELD_OFFSET(PCI_FDO_EXTENSION, DeviceState)==FIELD_OFFSET(PCI_PDO_EXTENSION, DeviceState))
long LONG
Definition: pedump.c:60
NTSTATUS NTAPI PciPdoWaitWake(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:79
NTSTATUS NTAPI PciSetResources(IN PPCI_PDO_EXTENSION PdoExtension, IN BOOLEAN DoReset, IN BOOLEAN SomethingSomethingDarkSide)
Definition: enum.c:2155
PCI_MN_DISPATCH_TABLE PciPdoDispatchPnpTable[]
Definition: pdo.c:33
NTSTATUS NTAPI PciCancelStateTransition(IN PPCI_FDO_EXTENSION DeviceExtension, IN PCI_STATE StateNotEntered)
Definition: state.c:145
PVOID DeviceExtension
Definition: env_spec_w32.h:418
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
NTSTATUS NTAPI PciPdoSetPowerState(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:93
NTSTATUS NTAPI PciPdoIrpQueryId(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:416
NTSTATUS NTAPI PciPdoIrpQueryResources(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:368
PCI_MJ_DISPATCH_TABLE PciPdoDispatchTable
Definition: pdo.c:63
#define PCI_SUBCLASS_VID_VGA_CTLR
Definition: iotypes.h:3788
NTSTATUS NTAPI PciPdoIrpQueryStopDevice(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:276
LIST_ENTRY List
Definition: psmgr.c:57
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define PCI_ENABLE_BUS_MASTER
Definition: iotypes.h:3262
#define swprintf(buf, format,...)
Definition: sprintf.c:56
NTSTATUS NTAPI PciQueryCapabilities(IN PPCI_PDO_EXTENSION PdoExtension, IN OUT PDEVICE_CAPABILITIES DeviceCapability)
Definition: utils.c:1727
DEVICE_POWER_STATE DeviceState
Definition: ntpoapi.h:58
NTSTATUS NTAPI PciPdoIrpSurpriseRemoval(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:502
static BOOL StartDevice(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DevInfoData OPTIONAL, IN BOOL bEnable, IN DWORD HardwareProfile OPTIONAL, OUT BOOL *bNeedReboot OPTIONAL)
Definition: wizard.c:142
NTSTATUS NTAPI PciQueryTargetDeviceRelations(IN PPCI_PDO_EXTENSION PdoExtension, IN OUT PDEVICE_RELATIONS *pDeviceRelations)
Definition: enum.c:511
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define PCI_CLASS_DISPLAY_CTLR
Definition: iotypes.h:3750
NTSTATUS NTAPI PciPdoIrpStartDevice(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:121
NTSTATUS NTAPI PciBeginStateTransition(IN PPCI_FDO_EXTENSION DeviceExtension, IN PCI_STATE NewState)
Definition: state.c:97
_In_ PPCI_DEVICE_PRESENCE_PARAMETERS Parameters
Definition: iotypes.h:872
static const WCHAR L[]
Definition: oid.c:1250
NTSTATUS NTAPI PciQueryDeviceText(IN PPCI_PDO_EXTENSION PdoExtension, IN DEVICE_TEXT_TYPE QueryType, IN ULONG Locale, OUT PWCHAR *Buffer)
Definition: id.c:394
NTSTATUS NTAPI PciPdoIrpReadConfig(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:446
NTSTATUS NTAPI PciPdoIrpQueryDeviceText(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:399
NTSTATUS NTAPI PciPdoIrpStopDevice(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:262
VOID NTAPI PciInitializeState(IN PPCI_FDO_EXTENSION DeviceExtension)
Definition: state.c:88
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI PciPdoIrpQueryBusInformation(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:430
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
#define InterlockedIncrement
Definition: armddk.h:53
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57
#define DPRINT1
Definition: precomp.h:8
#define PCI_ENABLE_MEMORY_SPACE
Definition: iotypes.h:3261
#define PCI_SUBCLASS_PRE_20_VGA
Definition: iotypes.h:3769
#define OUT
Definition: typedefs.h:39
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
PCI_MN_DISPATCH_TABLE PciPdoDispatchPowerTable[]
Definition: pdo.c:24
NTSTATUS(NTAPI * PCI_DISPATCH_FUNCTION)(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PVOID DeviceExtension)
Definition: pci.h:323
unsigned int ULONG
Definition: retypes.h:1
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
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define UNIMPLEMENTED
Definition: debug.h:114
POWER_STATE NTAPI PoSetPowerState(IN PDEVICE_OBJECT DeviceObject, IN POWER_STATE_TYPE Type, IN POWER_STATE State)
Definition: power.c:597
#define STATUS_DEVICE_POWER_FAILURE
Definition: ntstatus.h:380
NTSTATUS NTAPI PciPdoIrpQueryCapabilities(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:352
return STATUS_SUCCESS
Definition: btrfs.c:2966
#define FILE_DEVICE_BUS_EXTENDER
Definition: winioctl.h:147
NTSTATUS NTAPI PciIrpNotSupported(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension)
Definition: dispatch.c:261
NTSTATUS NTAPI PciIrpInvalidDeviceRequest(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension)
Definition: dispatch.c:277
NTSTATUS NTAPI PciQueryBusInformation(IN PPCI_PDO_EXTENSION PdoExtension, IN PPNP_BUS_INFORMATION *Buffer)
Definition: utils.c:1316
#define PCI_CLASS_PRE_20
Definition: iotypes.h:3747