Sync with trunk head (part 1 of x)
[reactos.git] / drivers / usb / usbehci / pdo.c
1 /*
2 * PROJECT: ReactOS Universal Serial Bus Bulk Enhanced Host Controller Interface
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: drivers/usb/usbehci/pdo.c
5 * PURPOSE: USB EHCI device driver.
6 * PROGRAMMERS:
7 * Michael Martin
8 */
9
10 #define INITGUID
11 #define NDEBUG
12
13 #include "usbehci.h"
14 #include <wdmguid.h>
15 #include "usbiffn.h"
16 #include <stdio.h>
17 #include <debug.h>
18
19 /* Lifted from Linux with slight changes */
20 const UCHAR ROOTHUB2_DEVICE_DESCRIPTOR [] =
21 {
22 0x12, /* bLength; */
23 USB_DEVICE_DESCRIPTOR_TYPE, /* bDescriptorType; Device */
24 0x00, 0x20, /* bcdUSB; v1.1 */
25 USB_DEVICE_CLASS_HUB, /* bDeviceClass; HUB_CLASSCODE */
26 0x01, /* bDeviceSubClass; */
27 0x00, /* bDeviceProtocol; [ low/full speeds only ] */
28 0x08, /* bMaxPacketSize0; 8 Bytes */
29 /* Fill Vendor and Product in when init root hub */
30 0x00, 0x00, /* idVendor; */
31 0x00, 0x00, /* idProduct; */
32 0x00, 0x00, /* bcdDevice */
33 0x00, /* iManufacturer; */
34 0x00, /* iProduct; */
35 0x00, /* iSerialNumber; */
36 0x01 /* bNumConfigurations; */
37
38 };
39
40 const UCHAR ROOTHUB2_CONFIGURATION_DESCRIPTOR [] =
41 {
42 /* one configuration */
43 0x09, /* bLength; */
44 0x02, /* bDescriptorType; Configuration */
45 0x19, 0x00, /* wTotalLength; */
46 0x01, /* bNumInterfaces; (1) */
47 0x23, /* bConfigurationValue; */
48 0x00, /* iConfiguration; */
49 0x40, /* bmAttributes;
50 Bit 7: must be set,
51 6: Self-powered,
52 5: Remote wakeup,
53 4..0: reserved */
54 0x00, /* MaxPower; */
55
56 /* one interface */
57 0x09, /* bLength: Interface; */
58 0x04, /* bDescriptorType; Interface */
59 0x00, /* bInterfaceNumber; */
60 0x00, /* bAlternateSetting; */
61 0x01, /* bNumEndpoints; */
62 0x09, /* bInterfaceClass; HUB_CLASSCODE */
63 0x01, /* bInterfaceSubClass; */
64 0x00, /* bInterfaceProtocol: */
65 0x00, /* iInterface; */
66
67 /* one endpoint (status change endpoint) */
68 0x07, /* bLength; */
69 0x05, /* bDescriptorType; Endpoint */
70 0x81, /* bEndpointAddress; IN Endpoint 1 */
71 0x03, /* bmAttributes; Interrupt */
72 0x08, 0x00, /* wMaxPacketSize; 1 + (MAX_ROOT_PORTS / 8) */
73 0xFF /* bInterval; (255ms -- usb 2.0 spec) */
74 };
75
76 /* FIXME: Do something better */
77 VOID NTAPI
78 UrbWorkerThread(PVOID Context)
79 {
80 PPDO_DEVICE_EXTENSION PdoDeviceExtension = (PPDO_DEVICE_EXTENSION)Context;
81
82 while (PdoDeviceExtension->HaltUrbHandling == FALSE)
83 {
84 CompletePendingURBRequest(PdoDeviceExtension);
85 KeStallExecutionProcessor(10);
86 }
87 DPRINT1("Thread terminated\n");
88 }
89
90 /* FIXME: Do something better */
91 PVOID InternalCreateUsbDevice(UCHAR DeviceNumber, ULONG Port, PUSB_DEVICE Parent, BOOLEAN Hub)
92 {
93 PUSB_DEVICE UsbDevicePointer = NULL;
94 UsbDevicePointer = ExAllocatePool(NonPagedPool, sizeof(USB_DEVICE));
95 if (!UsbDevicePointer)
96 {
97 DPRINT1("Out of memory\n");
98 return NULL;
99 }
100
101 if ((Hub) && (!Parent))
102 {
103 DPRINT1("This is the root hub\n");
104 }
105
106 UsbDevicePointer->Address = DeviceNumber;
107 UsbDevicePointer->Port = Port;
108 UsbDevicePointer->ParentDevice = Parent;
109
110 UsbDevicePointer->IsHub = Hub;
111
112 return UsbDevicePointer;
113 }
114
115 NTSTATUS NTAPI
116 PdoDispatchInternalDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
117 {
118 PPDO_DEVICE_EXTENSION PdoDeviceExtension;
119 PFDO_DEVICE_EXTENSION FdoDeviceExtension;
120 PIO_STACK_LOCATION Stack = NULL;
121 NTSTATUS Status = STATUS_UNSUCCESSFUL;
122 ULONG_PTR Information = 0;
123
124 PdoDeviceExtension = (PPDO_DEVICE_EXTENSION) DeviceObject->DeviceExtension;
125 FdoDeviceExtension = (PFDO_DEVICE_EXTENSION) PdoDeviceExtension->ControllerFdo->DeviceExtension;
126
127 ASSERT(PdoDeviceExtension->Common.IsFdo == FALSE);
128
129 Stack = IoGetCurrentIrpStackLocation(Irp);
130
131 switch(Stack->Parameters.DeviceIoControl.IoControlCode)
132 {
133 case IOCTL_INTERNAL_USB_SUBMIT_URB:
134 {
135 URB *Urb;
136
137 Urb = (PURB) Stack->Parameters.Others.Argument1;
138 DPRINT("Header Length %d\n", Urb->UrbHeader.Length);
139 DPRINT("Header Function %d\n", Urb->UrbHeader.Function);
140
141 /* Queue all request for now, kernel thread will complete them */
142 QueueURBRequest(PdoDeviceExtension, Irp);
143 Information = 0;
144 IoMarkIrpPending(Irp);
145 Status = STATUS_PENDING;
146 break;
147 }
148 case IOCTL_INTERNAL_USB_CYCLE_PORT:
149 {
150 DPRINT1("IOCTL_INTERNAL_USB_CYCLE_PORT\n");
151 break;
152 }
153 case IOCTL_INTERNAL_USB_ENABLE_PORT:
154 {
155 DPRINT1("IOCTL_INTERNAL_USB_ENABLE_PORT\n");
156 break;
157 }
158 case IOCTL_INTERNAL_USB_GET_BUS_INFO:
159 {
160 DPRINT1("IOCTL_INTERNAL_USB_GET_BUS_INFO\n");
161 break;
162 }
163 case IOCTL_INTERNAL_USB_GET_BUSGUID_INFO:
164 {
165 DPRINT1("IOCTL_INTERNAL_USB_GET_BUSGUID_INFO\n");
166 break;
167 }
168 case IOCTL_INTERNAL_USB_GET_CONTROLLER_NAME:
169 {
170 DPRINT1("IOCTL_INTERNAL_USB_GET_CONTROLLER_NAME\n");
171 break;
172 }
173 case IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE:
174 {
175 DPRINT1("IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE\n");
176 break;
177 }
178 case IOCTL_INTERNAL_USB_GET_HUB_COUNT:
179 {
180 DPRINT1("IOCTL_INTERNAL_USB_GET_HUB_COUNT\n");
181
182 if (Stack->Parameters.Others.Argument1)
183 {
184 /* FIXME: Determine the number of hubs between the usb device and root hub */
185 /* For now return 0 */
186 *(PVOID *)Stack->Parameters.Others.Argument1 = 0;
187 }
188 break;
189 }
190 case IOCTL_INTERNAL_USB_GET_HUB_NAME:
191 {
192 DPRINT1("IOCTL_INTERNAL_USB_GET_HUB_NAME\n");
193 break;
194 }
195 case IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO:
196 {
197 DPRINT1("IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO\n");
198 break;
199 }
200 case IOCTL_INTERNAL_USB_GET_PORT_STATUS:
201 {
202 DPRINT1("IOCTL_INTERNAL_USB_GET_PORT_STATUS\n");
203 break;
204 }
205 case IOCTL_INTERNAL_USB_RESET_PORT:
206 {
207 DPRINT1("IOCTL_INTERNAL_USB_RESET_PORT\n");
208 break;
209 }
210 case IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO:
211 {
212 DPRINT1("IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO\n");
213
214 if (Stack->Parameters.Others.Argument1)
215 *(PVOID *)Stack->Parameters.Others.Argument1 = FdoDeviceExtension->Pdo;
216 if (Stack->Parameters.Others.Argument2)
217 *(PVOID *)Stack->Parameters.Others.Argument2 = IoGetAttachedDevice(FdoDeviceExtension->DeviceObject);
218
219 Irp->IoStatus.Information = 0;
220 Irp->IoStatus.Status = STATUS_SUCCESS;
221 return STATUS_SUCCESS;
222 break;
223 }
224 case IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION:
225 {
226 DPRINT1("IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION\n");
227 break;
228 }
229 default:
230 {
231 DPRINT1("Unhandled IoControlCode %x\n", Stack->Parameters.DeviceIoControl.IoControlCode);
232 break;
233 }
234 }
235
236 Irp->IoStatus.Information = Information;
237
238 if (Status != STATUS_PENDING)
239 IoCompleteRequest(Irp, IO_NO_INCREMENT);
240
241 return Status;
242 }
243
244 NTSTATUS
245 PdoQueryId(PDEVICE_OBJECT DeviceObject, PIRP Irp, ULONG_PTR* Information)
246 {
247 WCHAR Buffer[256];
248 ULONG Index = 0;
249 ULONG IdType;
250 UNICODE_STRING SourceString;
251 UNICODE_STRING String;
252 NTSTATUS Status;
253
254 IdType = IoGetCurrentIrpStackLocation(Irp)->Parameters.QueryId.IdType;
255
256 switch (IdType)
257 {
258 case BusQueryDeviceID:
259 {
260 RtlInitUnicodeString(&SourceString, L"USB\\ROOT_HUB20");
261 break;
262 }
263 case BusQueryHardwareIDs:
264 {
265 Index += swprintf(&Buffer[Index], L"USB\\ROOT_HUB20&VID8086&PID265C&REV0000") + 1;
266 Index += swprintf(&Buffer[Index], L"USB\\ROOT_HUB20&VID8086&PID265C") + 1;
267 Index += swprintf(&Buffer[Index], L"USB\\ROOT_HUB20") + 1;
268
269 Buffer[Index] = UNICODE_NULL;
270 SourceString.Length = SourceString.MaximumLength = Index * sizeof(WCHAR);
271 SourceString.Buffer = Buffer;
272 break;
273 }
274 case BusQueryCompatibleIDs:
275 {
276 /* We have none */
277 return STATUS_SUCCESS;
278 }
279 case BusQueryInstanceID:
280 {
281 return STATUS_SUCCESS;
282 }
283 default:
284 {
285 DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_ID / unknown query id type 0x%lx\n", IdType);
286 return STATUS_NOT_SUPPORTED;
287 }
288 }
289
290 /* Lifted from hpoussin */
291 Status = DuplicateUnicodeString(RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE,
292 &SourceString,
293 &String);
294
295 *Information = (ULONG_PTR)String.Buffer;
296 return Status;
297 }
298
299 NTSTATUS
300 PdoQueryDeviceRelations(PDEVICE_OBJECT DeviceObject, PDEVICE_RELATIONS* pDeviceRelations)
301 {
302 PDEVICE_RELATIONS DeviceRelations;
303
304 DeviceRelations = (PDEVICE_RELATIONS)ExAllocatePool(PagedPool, sizeof(DEVICE_RELATIONS));
305 if (!DeviceRelations)
306 return STATUS_INSUFFICIENT_RESOURCES;
307
308 DeviceRelations->Count = 1;
309 DeviceRelations->Objects[0] = DeviceObject;
310 ObReferenceObject(DeviceObject);
311
312 *pDeviceRelations = DeviceRelations;
313 return STATUS_SUCCESS;
314 }
315
316 NTSTATUS NTAPI
317 PdoDispatchPnp(
318 IN PDEVICE_OBJECT DeviceObject,
319 IN PIRP Irp)
320 {
321 ULONG MinorFunction;
322 PIO_STACK_LOCATION Stack;
323 ULONG_PTR Information = Irp->IoStatus.Information;
324 NTSTATUS Status = Irp->IoStatus.Status;
325
326 Stack = IoGetCurrentIrpStackLocation(Irp);
327 MinorFunction = Stack->MinorFunction;
328
329 switch (MinorFunction)
330 {
331 case IRP_MN_QUERY_REMOVE_DEVICE:
332 case IRP_MN_REMOVE_DEVICE:
333 case IRP_MN_CANCEL_REMOVE_DEVICE:
334 case IRP_MN_STOP_DEVICE:
335 case IRP_MN_QUERY_STOP_DEVICE:
336 case IRP_MN_CANCEL_STOP_DEVICE:
337 case IRP_MN_QUERY_DEVICE_TEXT:
338 case IRP_MN_SURPRISE_REMOVAL:
339 case IRP_MN_QUERY_RESOURCES:
340 case IRP_MN_QUERY_RESOURCE_REQUIREMENTS:
341 case IRP_MN_FILTER_RESOURCE_REQUIREMENTS:
342 {
343 Status = STATUS_SUCCESS;
344 break;
345 }
346
347 case IRP_MN_START_DEVICE:
348 {
349 PUSB_DEVICE RootHubDevice;
350 PPDO_DEVICE_EXTENSION PdoDeviceExtension;
351 PFDO_DEVICE_EXTENSION FdoDeviceExtension;
352 UNICODE_STRING InterfaceSymLinkName;
353
354 PdoDeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
355 FdoDeviceExtension = (PFDO_DEVICE_EXTENSION)PdoDeviceExtension->ControllerFdo->DeviceExtension;
356
357 /* Create the root hub */
358 RootHubDevice = InternalCreateUsbDevice(1, 0, NULL, TRUE);
359
360 RtlCopyMemory(&RootHubDevice->DeviceDescriptor,
361 ROOTHUB2_DEVICE_DESCRIPTOR,
362 sizeof(ROOTHUB2_DEVICE_DESCRIPTOR));
363
364 RootHubDevice->DeviceDescriptor.idVendor = FdoDeviceExtension->VendorId;
365 RootHubDevice->DeviceDescriptor.idProduct = FdoDeviceExtension->DeviceId;
366
367 RtlCopyMemory(&RootHubDevice->ConfigurationDescriptor,
368 ROOTHUB2_CONFIGURATION_DESCRIPTOR,
369 sizeof(ROOTHUB2_CONFIGURATION_DESCRIPTOR));
370
371 PdoDeviceExtension->UsbDevices[0] = RootHubDevice;
372
373 /* Create a thread to handle the URB's */
374 Status = PsCreateSystemThread(&PdoDeviceExtension->ThreadHandle,
375 THREAD_ALL_ACCESS,
376 NULL,
377 NULL,
378 NULL,
379 UrbWorkerThread,
380 (PVOID)PdoDeviceExtension);
381
382 if (!NT_SUCCESS(Status))
383 DPRINT1("Failed Thread Creation with Status: %x\n", Status);
384
385 Status = IoRegisterDeviceInterface(DeviceObject, &GUID_DEVINTERFACE_USB_HUB, NULL, &InterfaceSymLinkName);
386 if (!NT_SUCCESS(Status))
387 {
388 DPRINT1("Failed to register interface\n");
389 }
390 else
391 {
392 Status = IoSetDeviceInterfaceState(&InterfaceSymLinkName, TRUE);
393 DPRINT1("Set interface state %x\n", Status);
394 }
395
396
397 Status = STATUS_SUCCESS;
398 break;
399 }
400 case IRP_MN_QUERY_DEVICE_RELATIONS:
401 {
402 switch (Stack->Parameters.QueryDeviceRelations.Type)
403 {
404 case TargetDeviceRelation:
405 {
406 PDEVICE_RELATIONS DeviceRelations = NULL;
407 Status = PdoQueryDeviceRelations(DeviceObject, &DeviceRelations);
408 Information = (ULONG_PTR)DeviceRelations;
409 break;
410 }
411 case BusRelations:
412 case RemovalRelations:
413 case EjectionRelations:
414 default:
415 {
416 DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unhandled type 0x%lx\n",
417 Stack->Parameters.QueryDeviceRelations.Type);
418 Status = STATUS_NOT_SUPPORTED;
419 break;
420 }
421 }
422 break;
423 }
424 case IRP_MN_QUERY_CAPABILITIES:
425 {
426 PDEVICE_CAPABILITIES DeviceCapabilities;
427 ULONG i;
428
429 DeviceCapabilities = (PDEVICE_CAPABILITIES)Stack->Parameters.DeviceCapabilities.Capabilities;
430
431 DeviceCapabilities->LockSupported = FALSE;
432 DeviceCapabilities->EjectSupported = FALSE;
433 DeviceCapabilities->Removable = FALSE;
434 DeviceCapabilities->DockDevice = FALSE;
435 DeviceCapabilities->UniqueID = FALSE;
436 DeviceCapabilities->SilentInstall = FALSE;
437 DeviceCapabilities->RawDeviceOK = FALSE;
438 DeviceCapabilities->SurpriseRemovalOK = FALSE;
439 DeviceCapabilities->Address = 0;
440 DeviceCapabilities->UINumber = 0;
441 DeviceCapabilities->DeviceD2 = 1;
442
443 /* FIXME */
444 DeviceCapabilities->HardwareDisabled = FALSE;
445 //DeviceCapabilities->NoDisplayInUI = FALSE;
446 DeviceCapabilities->DeviceState[0] = PowerDeviceD0;
447 for (i = 0; i < PowerSystemMaximum; i++)
448 DeviceCapabilities->DeviceState[i] = PowerDeviceD3;
449 DeviceCapabilities->DeviceWake = 0;
450 DeviceCapabilities->D1Latency = 0;
451 DeviceCapabilities->D2Latency = 0;
452 DeviceCapabilities->D3Latency = 0;
453 Information = 0;
454 Status = STATUS_SUCCESS;
455 break;
456 }
457 /*case IRP_MN_QUERY_DEVICE_TEXT:
458 {
459 Status = STATUS_NOT_SUPPORTED;
460 break;
461 }*/
462
463 case IRP_MN_QUERY_ID:
464 {
465 Status = PdoQueryId(DeviceObject, Irp, &Information);
466 break;
467 }
468 case IRP_MN_QUERY_INTERFACE:
469 {
470 UNICODE_STRING GuidString;
471 PUSB_BUS_INTERFACE_HUB_V5 InterfaceHub;
472 PUSB_BUS_INTERFACE_USBDI_V2 InterfaceDI;
473 PPDO_DEVICE_EXTENSION PdoDeviceExtension;
474 PFDO_DEVICE_EXTENSION FdoDeviceExtension;
475
476 PdoDeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
477 FdoDeviceExtension = (PFDO_DEVICE_EXTENSION)PdoDeviceExtension->ControllerFdo->DeviceExtension;
478
479 Status = RtlStringFromGUID(Stack->Parameters.QueryInterface.InterfaceType, &GuidString);
480 if (!NT_SUCCESS(Status))
481 {
482 DPRINT1("Failed to create string from GUID!\n");
483 }
484 DPRINT1("Interface GUID requested %wZ\n", &GuidString);
485 DPRINT1("QueryInterface.Size %x\n", Stack->Parameters.QueryInterface.Size);
486 DPRINT1("QueryInterface.Version %x\n", Stack->Parameters.QueryInterface.Version);
487
488 Status = STATUS_SUCCESS;
489 Information = 0;
490
491 /* FIXME: Check the actual Guid */
492 if (Stack->Parameters.QueryInterface.Size == sizeof(USB_BUS_INTERFACE_USBDI_V2) && (Stack->Parameters.QueryInterface.Version == 2))
493 {
494 InterfaceDI = (PUSB_BUS_INTERFACE_USBDI_V2) Stack->Parameters.QueryInterface.Interface;
495 InterfaceDI->Size = sizeof(USB_BUS_INTERFACE_USBDI_V2);
496 InterfaceDI->Version = 2;
497 InterfaceDI->BusContext = PdoDeviceExtension->DeviceObject;
498 InterfaceDI->InterfaceReference = (PINTERFACE_REFERENCE)InterfaceReference;
499 InterfaceDI->InterfaceDereference = (PINTERFACE_DEREFERENCE)InterfaceDereference;
500 InterfaceDI->GetUSBDIVersion = GetUSBDIVersion;
501 InterfaceDI->QueryBusTime = QueryBusTime;
502 InterfaceDI->SubmitIsoOutUrb = SubmitIsoOutUrb;
503 InterfaceDI->QueryBusInformation = QueryBusInformation;
504 InterfaceDI->IsDeviceHighSpeed = IsDeviceHighSpeed;
505 InterfaceDI->EnumLogEntry = EnumLogEntry;
506 }
507 /* FIXME: Check the actual Guid */
508 else if (Stack->Parameters.QueryInterface.Size == sizeof(USB_BUS_INTERFACE_HUB_V5) &&
509 (Stack->Parameters.QueryInterface.Version == 5))
510 {
511 InterfaceHub = (PUSB_BUS_INTERFACE_HUB_V5)Stack->Parameters.QueryInterface.Interface;
512 InterfaceHub->Version = 5;
513 InterfaceHub->Size = sizeof(USB_BUS_INTERFACE_HUB_V5);
514 InterfaceHub->BusContext = PdoDeviceExtension->DeviceObject;
515 InterfaceHub->InterfaceReference = (PINTERFACE_REFERENCE)InterfaceReference;
516 InterfaceHub->InterfaceDereference = (PINTERFACE_DEREFERENCE)InterfaceDereference;
517 InterfaceHub->CreateUsbDevice = CreateUsbDevice;
518 InterfaceHub->InitializeUsbDevice = InitializeUsbDevice;
519 InterfaceHub->GetUsbDescriptors = GetUsbDescriptors;
520 InterfaceHub->RemoveUsbDevice = RemoveUsbDevice;
521 InterfaceHub->RestoreUsbDevice = RestoreUsbDevice;
522 InterfaceHub->GetPortHackFlags = GetPortHackFlags;
523 InterfaceHub->QueryDeviceInformation = QueryDeviceInformation;
524 InterfaceHub->GetControllerInformation = GetControllerInformation;
525 InterfaceHub->ControllerSelectiveSuspend = ControllerSelectiveSuspend;
526 InterfaceHub->GetExtendedHubInformation = GetExtendedHubInformation;
527 InterfaceHub->GetRootHubSymbolicName = GetRootHubSymbolicName;
528 InterfaceHub->GetDeviceBusContext = GetDeviceBusContext;
529 InterfaceHub->Initialize20Hub = Initialize20Hub;
530 InterfaceHub->RootHubInitNotification = RootHubInitNotification;
531 InterfaceHub->FlushTransfers = FlushTransfers;
532 InterfaceHub->SetDeviceHandleData = SetDeviceHandleData;
533 }
534 else
535 {
536 DPRINT1("Not Supported\n");
537 Status = STATUS_NOT_SUPPORTED;
538 }
539 break;
540 }
541 case IRP_MN_QUERY_BUS_INFORMATION:
542 {
543 PPNP_BUS_INFORMATION BusInfo;
544
545 BusInfo = (PPNP_BUS_INFORMATION)ExAllocatePool(PagedPool, sizeof(PNP_BUS_INFORMATION));
546 if (!BusInfo)
547 Status = STATUS_INSUFFICIENT_RESOURCES;
548 else
549 {
550 /* FIXME */
551 /*RtlCopyMemory(
552 &BusInfo->BusTypeGuid,
553 &GUID_DEVINTERFACE_XXX,
554 sizeof(GUID));*/
555
556 BusInfo->LegacyBusType = PNPBus;
557 BusInfo->BusNumber = 0;
558 Information = (ULONG_PTR)BusInfo;
559 Status = STATUS_SUCCESS;
560 }
561 break;
562 }
563 default:
564 {
565 /* We are the PDO. So ignore */
566 DPRINT1("IRP_MJ_PNP / Unknown minor function 0x%lx\n", MinorFunction);
567 break;
568 }
569 }
570
571 Irp->IoStatus.Information = Information;
572 Irp->IoStatus.Status = Status;
573 IoCompleteRequest(Irp, IO_NO_INCREMENT);
574 return Status;
575 }
576