ReactOS 0.4.15-dev-5863-g1fe3ab7
fdo.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: PCI IDE bus driver extension
4 * FILE: drivers/storage/pciidex/fdo.c
5 * PURPOSE: IRP_MJ_PNP operations for FDOs
6 * PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org)
7 */
8
9#include "pciidex.h"
10
11#define NDEBUG
12#include <debug.h>
13
14#include <initguid.h>
15#include <wdmguid.h>
16
17static NTSTATUS
19 IN PFDO_DEVICE_EXTENSION DeviceExtension)
20{
21 PBUS_INTERFACE_STANDARD BusInterface = NULL;
24 PIRP Irp;
27
28 if (DeviceExtension->BusInterface)
29 {
30 DPRINT("We already have the bus interface\n");
31 goto cleanup;
32 }
33
34 BusInterface = ExAllocatePool(PagedPool, sizeof(BUS_INTERFACE_STANDARD));
35 if (!BusInterface)
36 {
37 DPRINT("ExAllocatePool() failed\n");
39 goto cleanup;
40 }
41
45 DeviceExtension->LowerDevice,
46 NULL,
47 0,
48 NULL,
49 &Event,
50 &IoStatus);
51 if (!Irp)
52 {
53 DPRINT("IoBuildSynchronousFsdRequest() failed\n");
55 goto cleanup;
56 }
57
58 Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
59 Irp->IoStatus.Information = 0;
60
62 Stack->MajorFunction = IRP_MJ_PNP;
63 Stack->MinorFunction = IRP_MN_QUERY_INTERFACE;
64 Stack->Parameters.QueryInterface.InterfaceType = (LPGUID)&GUID_BUS_INTERFACE_STANDARD;
65 Stack->Parameters.QueryInterface.Version = 1;
66 Stack->Parameters.QueryInterface.Size = sizeof(BUS_INTERFACE_STANDARD);
67 Stack->Parameters.QueryInterface.Interface = (PINTERFACE)BusInterface;
68 Stack->Parameters.QueryInterface.InterfaceSpecificData = NULL;
69
70 Status = IoCallDriver(DeviceExtension->LowerDevice, Irp);
72 {
74 Status = IoStatus.Status;
75 }
76 if (!NT_SUCCESS(Status))
77 goto cleanup;
78
79 DeviceExtension->BusInterface = BusInterface;
80 BusInterface = NULL;
82
84 if (BusInterface) ExFreePool(BusInterface);
85 return Status;
86}
87
88static NTSTATUS
90 IN PFDO_DEVICE_EXTENSION DeviceExtension)
91{
93
94 if (DeviceExtension->BusInterface)
95 {
96 (*DeviceExtension->BusInterface->InterfaceDereference)(
97 DeviceExtension->BusInterface->Context);
98 DeviceExtension->BusInterface = NULL;
100 }
101
102 return Status;
103}
104
109{
111 PFDO_DEVICE_EXTENSION DeviceExtension;
114 PCI_COMMON_CONFIG PciConfig;
116
117 DPRINT("PciIdeXAddDevice(%p %p)\n", DriverObject, Pdo);
118
121
124 sizeof(FDO_DEVICE_EXTENSION) + DriverExtension->MiniControllerExtensionSize,
125 NULL,
128 TRUE,
129 &Fdo);
130 if (!NT_SUCCESS(Status))
131 {
132 DPRINT("IoCreateDevice() failed with status 0x%08lx\n", Status);
133 return Status;
134 }
135
136 DeviceExtension = (PFDO_DEVICE_EXTENSION)Fdo->DeviceExtension;
137 RtlZeroMemory(DeviceExtension, sizeof(FDO_DEVICE_EXTENSION));
138
139 DeviceExtension->Common.IsFDO = TRUE;
140
142 if (!NT_SUCCESS(Status))
143 {
144 DPRINT("IoAttachDeviceToDeviceStackSafe() failed with status 0x%08lx\n", Status);
145 return Status;
146 }
147
148 Status = GetBusInterface(DeviceExtension);
149 if (!NT_SUCCESS(Status))
150 {
151 DPRINT("GetBusInterface() failed with status 0x%08lx\n", Status);
152 IoDetachDevice(DeviceExtension->LowerDevice);
153 return Status;
154 }
155
156 BytesRead = (*DeviceExtension->BusInterface->GetBusData)(
157 DeviceExtension->BusInterface->Context,
159 &PciConfig,
160 0,
163 {
164 DPRINT("BusInterface->GetBusData() failed()\n");
165 ReleaseBusInterface(DeviceExtension);
166 IoDetachDevice(DeviceExtension->LowerDevice);
168 }
169
170 DeviceExtension->VendorId = PciConfig.VendorID;
171 DeviceExtension->DeviceId = PciConfig.DeviceID;
172
173 Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
174
175 return STATUS_SUCCESS;
176}
177
178static NTSTATUS NTAPI
180 IN IDENTIFY_DATA IdentifyData,
181 OUT PULONG BestXferMode,
182 OUT PULONG CurrentXferMode)
183{
184 ULONG Best = PIO_MODE0;
185 ULONG Current = PIO_MODE0;
186
187 DPRINT("PciIdeXUdmaModesSupported(%lu, %p %p)\n",
188 IdentifyData, BestXferMode, CurrentXferMode);
189
190 /* FIXME: if current mode is a PIO mode, how to get it?
191 * At the moment, PIO_MODE0 is always returned...
192 */
193
194 if (IdentifyData.TranslationFieldsValid & 0x2)
195 {
196 /* PIO modes and some DMA modes are supported */
197 if (IdentifyData.AdvancedPIOModes & 0x10)
198 Best = PIO_MODE4;
199 else if (IdentifyData.AdvancedPIOModes & 0x8)
200 Best = PIO_MODE3;
201 else if (IdentifyData.AdvancedPIOModes & 0x4)
202 Best = PIO_MODE2;
203 else if (IdentifyData.AdvancedPIOModes & 0x2)
204 Best = PIO_MODE1;
205 else if (IdentifyData.AdvancedPIOModes & 0x1)
206 Best = PIO_MODE0;
207
208 if (IdentifyData.SingleWordDMASupport & 0x4)
209 Best = SWDMA_MODE2;
210 else if (IdentifyData.SingleWordDMASupport & 0x2)
211 Best = SWDMA_MODE1;
212 else if (IdentifyData.SingleWordDMASupport & 0x1)
213 Best = SWDMA_MODE0;
214
215 if (IdentifyData.SingleWordDMAActive & 0x4)
216 Current = SWDMA_MODE2;
217 else if (IdentifyData.SingleWordDMAActive & 0x2)
218 Current = SWDMA_MODE1;
219 else if (IdentifyData.SingleWordDMAActive & 0x1)
220 Current = SWDMA_MODE0;
221
222 if (IdentifyData.MultiWordDMASupport & 0x4)
223 Best = MWDMA_MODE2;
224 else if (IdentifyData.MultiWordDMASupport & 0x2)
225 Best = MWDMA_MODE1;
226 else if (IdentifyData.MultiWordDMASupport & 0x1)
227 Best = MWDMA_MODE0;
228
229 if (IdentifyData.MultiWordDMAActive & 0x4)
230 Current = MWDMA_MODE2;
231 else if (IdentifyData.MultiWordDMAActive & 0x2)
232 Current = MWDMA_MODE1;
233 else if (IdentifyData.MultiWordDMAActive & 0x1)
234 Current = MWDMA_MODE0;
235 }
236
237 if (IdentifyData.TranslationFieldsValid & 0x4)
238 {
239 /* UDMA modes are supported */
240 if (IdentifyData.UltraDMAActive & 0x10)
241 Current = UDMA_MODE4;
242 else if (IdentifyData.UltraDMAActive & 0x8)
243 Current = UDMA_MODE3;
244 else if (IdentifyData.UltraDMAActive & 0x4)
245 Current = UDMA_MODE2;
246 else if (IdentifyData.UltraDMAActive & 0x2)
247 Current = UDMA_MODE1;
248 else if (IdentifyData.UltraDMAActive & 0x1)
249 Current = UDMA_MODE0;
250
251 if (IdentifyData.UltraDMASupport & 0x10)
252 Best = UDMA_MODE4;
253 else if (IdentifyData.UltraDMASupport & 0x8)
254 Best = UDMA_MODE3;
255 else if (IdentifyData.UltraDMASupport & 0x4)
256 Best = UDMA_MODE2;
257 else if (IdentifyData.UltraDMASupport & 0x2)
258 Best = UDMA_MODE1;
259 else if (IdentifyData.UltraDMASupport & 0x1)
260 Best = UDMA_MODE0;
261 }
262
263 *BestXferMode = Best;
264 *CurrentXferMode = Current;
265 return TRUE;
266}
267
268static NTSTATUS
271 IN PIRP Irp)
272{
274 PFDO_DEVICE_EXTENSION DeviceExtension;
277
278 DPRINT("PciIdeXStartDevice(%p %p)\n", DeviceObject, Irp);
279
282 DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
283 ASSERT(DeviceExtension);
284 ASSERT(DeviceExtension->Common.IsFDO);
285
286 DeviceExtension->Properties.Size = sizeof(IDE_CONTROLLER_PROPERTIES);
287 DeviceExtension->Properties.ExtensionSize = DriverExtension->MiniControllerExtensionSize;
288 Status = DriverExtension->HwGetControllerProperties(
289 DeviceExtension->MiniControllerExtension,
290 &DeviceExtension->Properties);
291 if (!NT_SUCCESS(Status))
292 return Status;
293
294 DriverExtension->HwUdmaModesSupported = DeviceExtension->Properties.PciIdeUdmaModesSupported;
295 if (!DriverExtension->HwUdmaModesSupported)
296 /* This method is optional, so provide our own one */
297 DriverExtension->HwUdmaModesSupported = PciIdeXUdmaModesSupported;
298
299 /* Get bus master port base, if any */
300 ResourceList = IoGetCurrentIrpStackLocation(Irp)->Parameters.StartDevice.AllocatedResources;
301 if (ResourceList
302 && ResourceList->Count == 1
303 && ResourceList->List[0].PartialResourceList.Count == 1
304 && ResourceList->List[0].PartialResourceList.Version == 1
305 && ResourceList->List[0].PartialResourceList.Revision == 1
306 && ResourceList->List[0].PartialResourceList.PartialDescriptors[0].Type == CmResourceTypePort
307 && ResourceList->List[0].PartialResourceList.PartialDescriptors[0].u.Port.Length == 16)
308 {
309 DeviceExtension->BusMasterPortBase = ResourceList->List[0].PartialResourceList.PartialDescriptors[0].u.Port.Start;
310 }
311 return STATUS_SUCCESS;
312}
313
314static NTSTATUS
317 OUT PDEVICE_RELATIONS* pDeviceRelations)
318{
319 PFDO_DEVICE_EXTENSION DeviceExtension;
320 PDEVICE_RELATIONS DeviceRelations = NULL;
322 PPDO_DEVICE_EXTENSION PdoDeviceExtension;
323 ULONG i, j;
324 ULONG PDOs = 0;
325 IDE_CHANNEL_STATE ChannelState;
327
328 DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
329 ASSERT(DeviceExtension);
330 ASSERT(DeviceExtension->Common.IsFDO);
331
332 for (i = 0; i < MAX_IDE_CHANNEL; i++)
333 {
334 if (DeviceExtension->Pdo[i])
335 {
336 PDOs++;
337 continue;
338 }
339 ChannelState = DeviceExtension->Properties.PciIdeChannelEnabled(
340 DeviceExtension->MiniControllerExtension, i);
341 if (ChannelState == ChannelDisabled)
342 {
343 DPRINT("Channel %lu is disabled\n", i);
344 continue;
345 }
346
347 /* Need to create a PDO */
349 DeviceObject->DriverObject,
350 sizeof(PDO_DEVICE_EXTENSION),
351 NULL,
354 FALSE,
355 &Pdo);
356 if (!NT_SUCCESS(Status))
357 /* FIXME: handle error */
358 continue;
359
360 PdoDeviceExtension = (PPDO_DEVICE_EXTENSION)Pdo->DeviceExtension;
361 RtlZeroMemory(PdoDeviceExtension, sizeof(PDO_DEVICE_EXTENSION));
362 PdoDeviceExtension->Common.IsFDO = FALSE;
363 PdoDeviceExtension->Channel = i;
364 PdoDeviceExtension->ControllerFdo = DeviceObject;
366 Pdo->Flags &= ~DO_DEVICE_INITIALIZING;
367
368 DeviceExtension->Pdo[i] = Pdo;
369 PDOs++;
370 }
371
372 if (PDOs == 0)
373 {
374 DeviceRelations = (PDEVICE_RELATIONS)ExAllocatePool(
375 PagedPool,
376 sizeof(DEVICE_RELATIONS));
377 }
378 else
379 {
380 DeviceRelations = (PDEVICE_RELATIONS)ExAllocatePool(
381 PagedPool,
382 sizeof(DEVICE_RELATIONS) + sizeof(PDEVICE_OBJECT) * (PDOs - 1));
383 }
384 if (!DeviceRelations)
386
387 DeviceRelations->Count = PDOs;
388 for (i = 0, j = 0; i < MAX_IDE_CHANNEL; i++)
389 {
390 if (DeviceExtension->Pdo[i])
391 {
392 ObReferenceObject(DeviceExtension->Pdo[i]);
393 DeviceRelations->Objects[j++] = DeviceExtension->Pdo[i];
394 }
395 }
396
397 *pDeviceRelations = DeviceRelations;
398 return STATUS_SUCCESS;
399}
400
404 IN PIRP Irp)
405{
409 ULONG_PTR Information = Irp->IoStatus.Information;
411
413 MinorFunction = Stack->MinorFunction;
414
415 switch (MinorFunction)
416 {
417 case IRP_MN_START_DEVICE: /* 0x00 */
418 {
419 DPRINT("IRP_MJ_PNP / IRP_MN_START_DEVICE\n");
420
421 /* Call lower driver */
422 FdoExtension = DeviceObject->DeviceExtension;
424
425 if (IoForwardIrpSynchronously(FdoExtension->LowerDevice, Irp))
426 {
427 Status = Irp->IoStatus.Status;
428 if (NT_SUCCESS(Status))
429 {
431 }
432 }
433 break;
434 }
435 case IRP_MN_QUERY_REMOVE_DEVICE: /* 0x01 */
436 {
437 DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_REMOVE_DEVICE\n");
439 break;
440 }
441 case IRP_MN_QUERY_DEVICE_RELATIONS: /* 0x07 */
442 {
443 switch (Stack->Parameters.QueryDeviceRelations.Type)
444 {
445 case BusRelations:
446 {
447 PDEVICE_RELATIONS DeviceRelations = NULL;
448 DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n");
450 Information = (ULONG_PTR)DeviceRelations;
451 break;
452 }
453 default:
454 {
455 DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
456 Stack->Parameters.QueryDeviceRelations.Type);
458 break;
459 }
460 }
461 break;
462 }
463 case IRP_MN_QUERY_PNP_DEVICE_STATE: /* 0x14 */
464 {
465 DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_PNP_DEVICE_STATE\n");
468 break;
469 }
471 {
472 DPRINT("IRP_MJ_PNP / IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n");
474 }
475 case IRP_MN_QUERY_CAPABILITIES: /* 0x09 */
476 {
477 DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_CAPABILITIES\n");
479 }
480 default:
481 {
482 DPRINT1("IRP_MJ_PNP / Unknown minor function 0x%lx\n", MinorFunction);
484 }
485 }
486
487 Irp->IoStatus.Information = Information;
488 Irp->IoStatus.Status = Status;
490 return Status;
491}
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define FILE_DEVICE_SECURE_OPEN
Definition: cdrw_usr.h:46
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
_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
static void cleanup(void)
Definition: main.c:1335
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
struct _PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
#define ULONG_PTR
Definition: config.h:101
@ FdoExtension
Definition: precomp.h:48
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
Definition: env_spec_w32.h:478
struct _DEVICE_OBJECT * PDEVICE_OBJECT
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define PagedPool
Definition: env_spec_w32.h:308
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
Status
Definition: gdiplustypes.h:25
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define CmResourceTypePort
Definition: hwresource.cpp:123
DRIVER_DISPATCH ForwardIrpAndForget
Definition: i8042prt.h:341
struct _IDE_CONTROLLER_PROPERTIES IDE_CONTROLLER_PROPERTIES
#define SWDMA_MODE2
Definition: ide.h:284
#define UDMA_MODE0
Definition: ide.h:290
#define UDMA_MODE2
Definition: ide.h:292
#define PIO_MODE4
Definition: ide.h:280
#define MWDMA_MODE0
Definition: ide.h:286
#define PIO_MODE0
Definition: ide.h:276
#define UDMA_MODE4
Definition: ide.h:294
#define PIO_MODE2
Definition: ide.h:278
IDE_CHANNEL_STATE
Definition: ide.h:196
@ ChannelDisabled
Definition: ide.h:197
#define UDMA_MODE1
Definition: ide.h:291
#define PIO_MODE3
Definition: ide.h:279
#define SWDMA_MODE1
Definition: ide.h:283
#define PIO_MODE1
Definition: ide.h:277
#define SWDMA_MODE0
Definition: ide.h:282
#define MWDMA_MODE1
Definition: ide.h:287
#define MWDMA_MODE2
Definition: ide.h:288
#define MAX_IDE_CHANNEL
Definition: ide.h:30
#define UDMA_MODE3
Definition: ide.h:293
#define ASSERT(a)
Definition: mode.c:44
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
Definition: mxum.h:159
#define KernelMode
Definition: asm.h:34
#define FILE_AUTOGENERATED_DEVICE_NAME
Definition: iotypes.h:138
@ SynchronizationEvent
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
NTSTATUS NTAPI IoAttachDeviceToDeviceStackSafe(IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice, IN OUT PDEVICE_OBJECT *AttachedToDeviceObject)
Definition: device.c:980
VOID NTAPI IoDetachDevice(IN PDEVICE_OBJECT TargetDevice)
Definition: device.c:1296
PVOID NTAPI IoGetDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress)
Definition: driver.c:1889
PIRP NTAPI IoBuildSynchronousFsdRequest(IN ULONG MajorFunction, IN PDEVICE_OBJECT DeviceObject, IN PVOID Buffer, IN ULONG Length, IN PLARGE_INTEGER StartingOffset, IN PKEVENT Event, IN PIO_STATUS_BLOCK IoStatusBlock)
Definition: irp.c:1069
#define IoCompleteRequest
Definition: irp.c:1240
BOOLEAN NTAPI IoForwardIrpSynchronously(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1625
#define IoCallDriver
Definition: irp.c:1225
#define STATUS_PENDING
Definition: ntstatus.h:82
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:423
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239
PPCI_DRIVER_EXTENSION DriverExtension
Definition: pci.c:31
DRIVER_ADD_DEVICE PciIdeXAddDevice
Definition: pciidex.h:43
GUID * LPGUID
Definition: guiddef.h:81
#define FILE_DEVICE_BUS_EXTENDER
Definition: winioctl.h:148
#define FILE_DEVICE_CONTROLLER
Definition: winioctl.h:110
struct _INTERFACE * PINTERFACE
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:71
static NTSTATUS PciIdeXFdoStartDevice(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: fdo.c:269
NTSTATUS NTAPI PciIdeXFdoPnpDispatch(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: fdo.c:402
static NTSTATUS NTAPI PciIdeXUdmaModesSupported(IN IDENTIFY_DATA IdentifyData, OUT PULONG BestXferMode, OUT PULONG CurrentXferMode)
Definition: fdo.c:179
static NTSTATUS GetBusInterface(IN PFDO_DEVICE_EXTENSION DeviceExtension)
Definition: fdo.c:18
static NTSTATUS ReleaseBusInterface(IN PFDO_DEVICE_EXTENSION DeviceExtension)
Definition: fdo.c:89
static NTSTATUS PciIdeXFdoQueryBusRelations(IN PDEVICE_OBJECT DeviceObject, OUT PDEVICE_RELATIONS *pDeviceRelations)
Definition: fdo.c:315
PGET_SET_DEVICE_DATA GetBusData
Definition: iotypes.h:916
PDEVICE_OBJECT Objects[1]
Definition: iotypes.h:2163
IDE_CONTROLLER_PROPERTIES Properties
Definition: pciidex.h:24
PHYSICAL_ADDRESS BusMasterPortBase
Definition: pciidex.h:25
PDEVICE_OBJECT LowerDevice
Definition: i8042prt.h:130
COMMON_DEVICE_EXTENSION Common
Definition: pci.h:84
PBUS_INTERFACE_STANDARD BusInterface
Definition: pciidex.h:23
PUCHAR MiniControllerExtension[0]
Definition: pciidex.h:30
PDEVICE_OBJECT Pdo
Definition: i8042prt.h:128
PCIIDE_CHANNEL_ENABLED PciIdeChannelEnabled
Definition: ide.h:233
PCIIDE_UDMA_MODES_SUPPORTED PciIdeUdmaModesSupported
Definition: ide.h:241
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:3128
PDEVICE_OBJECT ControllerFdo
Definition: pciidex.h:38
COMMON_DEVICE_EXTENSION Common
Definition: pci.h:59
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
#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 OUT
Definition: typedefs.h:40
#define STATUS_IO_DEVICE_ERROR
Definition: udferr_usr.h:179
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
struct _LARGE_INTEGER::@2268 u
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ UCHAR _In_ UCHAR MinorFunction
Definition: wdfdevice.h:1699
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_Must_inspect_result_ _In_ WDFDEVICE Fdo
Definition: wdffdo.h:461
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead
Definition: wdfiotarget.h:870
WDF_EXTERN_C_START typedef _Must_inspect_result_ _In_ WDFDRIVER _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT Pdo
Definition: wdfminiport.h:72
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:639
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
Definition: wdfrequest.h:1049
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:309
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2695
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2793
@ BusRelations
Definition: iotypes.h:2152
#define IRP_MN_QUERY_PNP_DEVICE_STATE
#define PNP_DEVICE_NOT_DISABLEABLE
Definition: iotypes.h:1006
#define PCI_WHICHSPACE_CONFIG
Definition: iotypes.h:3644
#define IO_NO_INCREMENT
Definition: iotypes.h:598
#define IRP_MN_QUERY_INTERFACE
#define DO_BUS_ENUMERATED_DEVICE
#define IRP_MN_START_DEVICE
#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS
struct _BUS_INTERFACE_STANDARD BUS_INTERFACE_STANDARD
struct _DEVICE_RELATIONS * PDEVICE_RELATIONS
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define PCI_COMMON_HDR_LENGTH
Definition: iotypes.h:3594
#define IRP_MN_QUERY_CAPABILITIES
#define IRP_MN_QUERY_REMOVE_DEVICE
@ Executive
Definition: ketypes.h:403
#define ObReferenceObject
Definition: obfuncs.h:204