2 * PROJECT: ReactOS Universal Serial Bus Hub Driver
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: drivers/usb/usbhub/fdo.c
7 * Hervé Poussineau (hpoussin@reactos.org)
8 * Michael Martin (michael.martin@reactos.org)
9 * Johannes Anderwald (johannes.anderwald@reactos.org)
14 #define IO_METHOD_FROM_CTL_CODE(ctlCode) (ctlCode&0x00000003)
19 PDEVICE_OBJECT DeviceObject
,
24 DPRINT("Entered Urb Completion\n");
27 // Get the original Irp
29 OriginalIrp
= (PIRP
)Context
;
32 // Update it to match what was returned for the IRP that was passed to RootHub
34 OriginalIrp
->IoStatus
.Status
= Irp
->IoStatus
.Status
;
35 OriginalIrp
->IoStatus
.Information
= Irp
->IoStatus
.Information
;
36 DPRINT("Status %x, Information %x\n", Irp
->IoStatus
.Status
, Irp
->IoStatus
.Information
);
39 // Complete the original Irp
41 IoCompleteRequest(OriginalIrp
, IO_NO_INCREMENT
);
44 // Return this status so the IO Manager doesnt mess with the Irp
46 return STATUS_MORE_PROCESSING_REQUIRED
;
51 PDEVICE_OBJECT RootHubDeviceObject
,
52 IN ULONG IoControlCode
,
54 OUT PVOID OutParameter1
,
55 OUT PVOID OutParameter2
)
58 IO_STATUS_BLOCK IoStatus
;
59 PIO_STACK_LOCATION ForwardStack
, CurrentStack
;
63 // Get the current stack location for the Irp
65 CurrentStack
= IoGetCurrentIrpStackLocation(Irp
);
69 // Pull the Urb from that stack, it will be reused in the Irp sent to RootHub
71 Urb
= (PURB
)CurrentStack
->Parameters
.Others
.Argument1
;
75 // Create the Irp to forward to RootHub
77 ForwardIrp
= IoBuildAsynchronousFsdRequest(IRP_MJ_SHUTDOWN
,
85 DPRINT1("Failed to allocate IRP\n");
86 return STATUS_INSUFFICIENT_RESOURCES
;
90 // Get the new Irps next stack
92 ForwardStack
= IoGetNextIrpStackLocation(ForwardIrp
);
95 // Copy the stack for the current irp into the next stack of new irp
97 RtlCopyMemory(ForwardStack
, CurrentStack
, sizeof(IO_STACK_LOCATION
));
99 IoStatus
.Status
= STATUS_NOT_SUPPORTED
;
100 IoStatus
.Information
= 0;
103 // Mark the Irp from upper driver as pending
105 IoMarkIrpPending(Irp
);
108 // Now set the completion routine for the new Irp.
110 IoSetCompletionRoutine(ForwardIrp
,
117 IoCallDriver(RootHubDeviceObject
, ForwardIrp
);
120 // Always return pending as the completion routine will take care of it
122 return STATUS_PENDING
;
127 IN PDEVICE_OBJECT DeviceObject
)
130 PHUB_DEVICE_EXTENSION HubDeviceExtension
;
131 PHUB_CHILDDEVICE_EXTENSION ChildDeviceExtension
;
134 ChildDeviceExtension
= (PHUB_CHILDDEVICE_EXTENSION
)DeviceObject
->DeviceExtension
;
135 ASSERT(ChildDeviceExtension
->Common
.IsFDO
== FALSE
);
136 HubDeviceExtension
= (PHUB_DEVICE_EXTENSION
)ChildDeviceExtension
->ParentDeviceObject
->DeviceExtension
;
138 for(Index
= 0; Index
< USB_MAXCHILDREN
; Index
++)
140 if (HubDeviceExtension
->ChildDeviceObject
[Index
] == DeviceObject
)
153 USBHUB_PdoHandleInternalDeviceControl(
154 IN PDEVICE_OBJECT DeviceObject
,
158 PIO_STACK_LOCATION Stack
;
159 ULONG_PTR Information
= 0;
160 PHUB_DEVICE_EXTENSION HubDeviceExtension
;
161 PHUB_CHILDDEVICE_EXTENSION ChildDeviceExtension
;
162 PDEVICE_OBJECT RootHubDeviceObject
;
165 //DPRINT1("UsbhubInternalDeviceControlPdo(%x) called\n", DeviceObject);
168 // get current stack location
170 Stack
= IoGetCurrentIrpStackLocation(Irp
);
174 // Set default status
176 Status
= Irp
->IoStatus
.Status
;
178 ChildDeviceExtension
= (PHUB_CHILDDEVICE_EXTENSION
)DeviceObject
->DeviceExtension
;
179 ASSERT(ChildDeviceExtension
->Common
.IsFDO
== FALSE
);
180 HubDeviceExtension
= (PHUB_DEVICE_EXTENSION
)ChildDeviceExtension
->ParentDeviceObject
->DeviceExtension
;
181 RootHubDeviceObject
= HubDeviceExtension
->RootHubPhysicalDeviceObject
;
183 if(!IsValidPDO(DeviceObject
))
185 DPRINT1("[USBHUB] Request for removed device object %p\n", DeviceObject
);
186 Irp
->IoStatus
.Status
= STATUS_DEVICE_NOT_CONNECTED
;
187 Irp
->IoStatus
.Information
= 0;
188 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
189 return STATUS_DEVICE_NOT_CONNECTED
;
192 switch (Stack
->Parameters
.DeviceIoControl
.IoControlCode
)
194 case IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO
:
196 DPRINT("IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO\n");
197 if (Irp
->AssociatedIrp
.SystemBuffer
== NULL
198 || Stack
->Parameters
.DeviceIoControl
.OutputBufferLength
!= sizeof(PVOID
))
200 Status
= STATUS_INVALID_PARAMETER
;
206 pHubPointer
= (PVOID
*)Irp
->AssociatedIrp
.SystemBuffer
;
209 Information
= sizeof(PVOID
);
210 Status
= STATUS_SUCCESS
;
214 case IOCTL_INTERNAL_USB_SUBMIT_URB
:
216 //DPRINT1("IOCTL_INTERNAL_USB_SUBMIT_URB\n");
221 Urb
= (PURB
)Stack
->Parameters
.Others
.Argument1
;
225 // Set the real device handle
227 //DPRINT("UsbdDeviceHandle %x, ChildDeviceHandle %x\n", Urb->UrbHeader.UsbdDeviceHandle, ChildDeviceExtension->UsbDeviceHandle);
229 Urb
->UrbHeader
.UsbdDeviceHandle
= ChildDeviceExtension
->UsbDeviceHandle
;
234 switch (Urb
->UrbHeader
.Function
)
239 case URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE
:
240 DPRINT("URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE\n");
242 case URB_FUNCTION_CLASS_DEVICE
:
243 DPRINT("URB_FUNCTION_CLASS_DEVICE\n");
245 case URB_FUNCTION_GET_STATUS_FROM_DEVICE
:
246 DPRINT("URB_FUNCTION_GET_STATUS_FROM_DEVICE\n");
248 case URB_FUNCTION_SELECT_CONFIGURATION
:
249 DPRINT("URB_FUNCTION_SELECT_CONFIGURATION\n");
251 case URB_FUNCTION_SELECT_INTERFACE
:
252 DPRINT("URB_FUNCTION_SELECT_INTERFACE\n");
254 case URB_FUNCTION_CLASS_OTHER
:
255 DPRINT("URB_FUNCTION_CLASS_OTHER\n");
257 case URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER
:
260 DPRINT1("URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER\n");
261 DPRINT1("PipeHandle %x\n", Urb->UrbBulkOrInterruptTransfer.PipeHandle);
262 DPRINT1("TransferFlags %x\n", Urb->UrbBulkOrInterruptTransfer.TransferFlags);
263 DPRINT1("Buffer %x\n", Urb->UrbBulkOrInterruptTransfer.TransferBuffer);
264 DPRINT1("BufferMDL %x\n", Urb->UrbBulkOrInterruptTransfer.TransferBufferMDL);
265 DPRINT1("Length %x\n", Urb->UrbBulkOrInterruptTransfer.TransferBufferLength);
266 DPRINT1("UrbLink %x\n", Urb->UrbBulkOrInterruptTransfer.UrbLink);
267 DPRINT1("hca %x\n", Urb->UrbBulkOrInterruptTransfer.hca);
268 if (Urb->UrbBulkOrInterruptTransfer.TransferFlags == USBD_SHORT_TRANSFER_OK)
275 case URB_FUNCTION_CLASS_INTERFACE
:
276 DPRINT("URB_FUNCTION_CLASS_INTERFACE\n");
278 case URB_FUNCTION_VENDOR_DEVICE
:
279 DPRINT("URB_FUNCTION_VENDOR_DEVICE\n");
282 DPRINT1("IOCTL_INTERNAL_USB_SUBMIT_URB Function %x NOT IMPLEMENTED\n", Urb
->UrbHeader
.Function
);
285 Urb
->UrbHeader
.UsbdDeviceHandle
= ChildDeviceExtension
->UsbDeviceHandle
;
286 //DPRINT1("Stack->CompletionRoutine %x\n", Stack->CompletionRoutine);
288 // Send the request to RootHub
290 Status
= FowardUrbToRootHub(RootHubDeviceObject
, IOCTL_INTERNAL_USB_SUBMIT_URB
, Irp
, Urb
, NULL
);
295 // FIXME: Can these be sent to RootHub?
297 case IOCTL_INTERNAL_USB_RESET_PORT
:
298 DPRINT1("IOCTL_INTERNAL_USB_RESET_PORT\n");
300 case IOCTL_INTERNAL_USB_GET_PORT_STATUS
:
302 PORT_STATUS_CHANGE PortStatus
;
304 PUCHAR PortStatusBits
;
306 PortStatusBits
= (PUCHAR
)Stack
->Parameters
.Others
.Argument1
;
308 // USBD_PORT_ENABLED (bit 0) or USBD_PORT_CONNECTED (bit 1)
310 DPRINT1("IOCTL_INTERNAL_USB_GET_PORT_STATUS\n");
311 DPRINT("Arg1 %x\n", *PortStatusBits
);
313 if (Stack
->Parameters
.Others
.Argument1
)
315 for (PortId
= 1; PortId
<= HubDeviceExtension
->UsbExtHubInfo
.NumberOfPorts
; PortId
++)
317 Status
= GetPortStatusAndChange(RootHubDeviceObject
, PortId
, &PortStatus
);
318 if (NT_SUCCESS(Status
))
320 DPRINT("Connect %x\n", ((PortStatus
.Status
& USB_PORT_STATUS_CONNECT
) << 1) << ((PortId
- 1) * 2));
321 DPRINT("Enable %x\n", ((PortStatus
.Status
& USB_PORT_STATUS_ENABLE
) >> 1) << ((PortId
- 1) * 2));
323 (((PortStatus
.Status
& USB_PORT_STATUS_CONNECT
) << 1) << ((PortId
- 1) * 2)) +
324 (((PortStatus
.Status
& USB_PORT_STATUS_ENABLE
) >> 1) << ((PortId
- 1) * 2));
330 DPRINT1("Arg1 %x\n", *PortStatusBits
);
331 Status
= STATUS_SUCCESS
;
334 case IOCTL_INTERNAL_USB_ENABLE_PORT
:
335 DPRINT1("IOCTL_INTERNAL_USB_ENABLE_PORT\n");
337 case IOCTL_INTERNAL_USB_CYCLE_PORT
:
338 DPRINT1("IOCTL_INTERNAL_USB_CYCLE_PORT\n");
340 case IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE
:
342 DPRINT1("IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE\n");
343 if (Stack
->Parameters
.Others
.Argument1
)
345 // store device handle
346 *(PVOID
*)Stack
->Parameters
.Others
.Argument1
= (PVOID
)ChildDeviceExtension
->UsbDeviceHandle
;
347 Status
= STATUS_SUCCESS
;
352 Status
= STATUS_INVALID_PARAMETER
;
356 case IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO
:
358 if (Stack
->Parameters
.Others
.Argument1
)
360 // inform caller that it is a real usb hub
361 *(PVOID
*)Stack
->Parameters
.Others
.Argument1
= NULL
;
364 if (Stack
->Parameters
.Others
.Argument2
)
366 // output device object
367 *(PVOID
*)Stack
->Parameters
.Others
.Argument2
= DeviceObject
;
371 Status
= STATUS_SUCCESS
;
376 DPRINT1("Unknown IOCTL code 0x%lx\n", Stack
->Parameters
.DeviceIoControl
.IoControlCode
);
377 Information
= Irp
->IoStatus
.Information
;
378 Status
= Irp
->IoStatus
.Status
;
382 if (Status
!= STATUS_PENDING
)
384 Irp
->IoStatus
.Information
= Information
;
385 Irp
->IoStatus
.Status
= Status
;
386 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
392 USBHUB_PdoStartDevice(
393 IN PDEVICE_OBJECT DeviceObject
,
396 PHUB_CHILDDEVICE_EXTENSION ChildDeviceExtension
;
398 DPRINT("USBHUB_PdoStartDevice %x\n", DeviceObject
);
399 ChildDeviceExtension
= (PHUB_CHILDDEVICE_EXTENSION
)DeviceObject
->DeviceExtension
;
402 // This should be a PDO
404 ASSERT(ChildDeviceExtension
->Common
.IsFDO
== FALSE
);
407 // FIXME: Fow now assume success
411 return STATUS_SUCCESS
;
416 IN PDEVICE_OBJECT DeviceObject
,
418 OUT ULONG_PTR
* Information
)
420 PHUB_CHILDDEVICE_EXTENSION ChildDeviceExtension
;
422 PUNICODE_STRING SourceString
= NULL
;
423 PWCHAR ReturnString
= NULL
;
424 NTSTATUS Status
= STATUS_SUCCESS
;
426 IdType
= IoGetCurrentIrpStackLocation(Irp
)->Parameters
.QueryId
.IdType
;
427 ChildDeviceExtension
= (PHUB_CHILDDEVICE_EXTENSION
)DeviceObject
->DeviceExtension
;
431 case BusQueryDeviceID
:
433 DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryDeviceID\n");
434 SourceString
= &ChildDeviceExtension
->usDeviceId
;
437 case BusQueryHardwareIDs
:
439 DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryHardwareIDs\n");
440 SourceString
= &ChildDeviceExtension
->usHardwareIds
;
443 case BusQueryCompatibleIDs
:
445 DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryCompatibleIDs\n");
446 SourceString
= &ChildDeviceExtension
->usCompatibleIds
;
449 case BusQueryInstanceID
:
451 DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryInstanceID\n");
452 SourceString
= &ChildDeviceExtension
->usInstanceId
;
456 DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_ID / unknown query id type 0x%lx\n", IdType
);
457 return STATUS_NOT_SUPPORTED
;
465 ReturnString
= ExAllocatePool(PagedPool
, SourceString
->MaximumLength
);
471 return STATUS_INSUFFICIENT_RESOURCES
;
477 RtlCopyMemory(ReturnString
, SourceString
->Buffer
, SourceString
->MaximumLength
);
480 *Information
= (ULONG_PTR
)ReturnString
;
486 USBHUB_PdoQueryDeviceText(
487 IN PDEVICE_OBJECT DeviceObject
,
489 OUT ULONG_PTR
* Information
)
491 PHUB_CHILDDEVICE_EXTENSION ChildDeviceExtension
;
492 DEVICE_TEXT_TYPE DeviceTextType
;
493 PUNICODE_STRING SourceString
= NULL
;
494 PWCHAR ReturnString
= NULL
;
495 NTSTATUS Status
= STATUS_SUCCESS
;
497 DeviceTextType
= IoGetCurrentIrpStackLocation(Irp
)->Parameters
.QueryDeviceText
.DeviceTextType
;
498 ChildDeviceExtension
= (PHUB_CHILDDEVICE_EXTENSION
)DeviceObject
->DeviceExtension
;
504 switch (DeviceTextType
)
506 case DeviceTextDescription
:
507 case DeviceTextLocationInformation
:
509 DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / DeviceTextDescription\n");
512 // does the device provide a text description
514 if (ChildDeviceExtension
->usTextDescription
.Buffer
&& ChildDeviceExtension
->usTextDescription
.Length
)
519 SourceString
= &ChildDeviceExtension
->usTextDescription
;
525 DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / unknown device text type 0x%lx\n", DeviceTextType
);
526 Status
= STATUS_NOT_SUPPORTED
;
533 ReturnString
= ExAllocatePool(PagedPool
, SourceString
->MaximumLength
);
534 RtlCopyMemory(ReturnString
, SourceString
->Buffer
, SourceString
->MaximumLength
);
535 DPRINT1("%S\n", ReturnString
);
536 *Information
= (ULONG_PTR
)ReturnString
;
544 IN PDEVICE_OBJECT DeviceObject
,
549 PIO_STACK_LOCATION Stack
;
550 ULONG_PTR Information
= 0;
551 PHUB_CHILDDEVICE_EXTENSION UsbChildExtension
;
554 PDEVICE_RELATIONS DeviceRelation
;
555 PDEVICE_OBJECT ParentDevice
;
557 UsbChildExtension
= (PHUB_CHILDDEVICE_EXTENSION
)DeviceObject
->DeviceExtension
;
558 Stack
= IoGetCurrentIrpStackLocation(Irp
);
559 MinorFunction
= Stack
->MinorFunction
;
561 switch (MinorFunction
)
563 case IRP_MN_START_DEVICE
:
565 DPRINT("IRP_MJ_PNP / IRP_MN_START_DEVICE\n");
566 Status
= USBHUB_PdoStartDevice(DeviceObject
, Irp
);
569 case IRP_MN_QUERY_CAPABILITIES
:
571 PDEVICE_CAPABILITIES DeviceCapabilities
;
573 DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_CAPABILITIES\n");
575 DeviceCapabilities
= (PDEVICE_CAPABILITIES
)Stack
->Parameters
.DeviceCapabilities
.Capabilities
;
576 // FIXME: capabilities can change with connected device
577 DeviceCapabilities
->LockSupported
= FALSE
;
578 DeviceCapabilities
->EjectSupported
= FALSE
;
579 DeviceCapabilities
->Removable
= TRUE
;
580 DeviceCapabilities
->DockDevice
= FALSE
;
581 DeviceCapabilities
->UniqueID
= FALSE
;
582 DeviceCapabilities
->SilentInstall
= FALSE
;
583 DeviceCapabilities
->RawDeviceOK
= FALSE
;
584 DeviceCapabilities
->SurpriseRemovalOK
= FALSE
;
585 DeviceCapabilities
->HardwareDisabled
= FALSE
;
586 //DeviceCapabilities->NoDisplayInUI = FALSE;
587 DeviceCapabilities
->Address
= UsbChildExtension
->PortNumber
;
588 DeviceCapabilities
->UINumber
= 0;
589 DeviceCapabilities
->DeviceState
[0] = PowerDeviceD0
;
590 for (i
= 1; i
< PowerSystemMaximum
; i
++)
591 DeviceCapabilities
->DeviceState
[i
] = PowerDeviceD3
;
592 //DeviceCapabilities->DeviceWake = PowerDeviceUndefined;
593 DeviceCapabilities
->D1Latency
= 0;
594 DeviceCapabilities
->D2Latency
= 0;
595 DeviceCapabilities
->D3Latency
= 0;
596 Status
= STATUS_SUCCESS
;
599 case IRP_MN_QUERY_RESOURCES
:
601 DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_RESOURCES\n");
603 Information
= Irp
->IoStatus
.Information
;
604 Status
= Irp
->IoStatus
.Status
;
607 case IRP_MN_QUERY_RESOURCE_REQUIREMENTS
:
609 DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_RESOURCE_REQUIREMENTS\n");
611 Information
= Irp
->IoStatus
.Information
;
612 Status
= Irp
->IoStatus
.Status
;
615 case IRP_MN_QUERY_DEVICE_TEXT
:
617 Status
= USBHUB_PdoQueryDeviceText(DeviceObject
, Irp
, &Information
);
620 case IRP_MN_QUERY_ID
:
622 Status
= USBHUB_PdoQueryId(DeviceObject
, Irp
, &Information
);
625 case IRP_MN_QUERY_BUS_INFORMATION
:
627 PPNP_BUS_INFORMATION BusInfo
;
628 BusInfo
= (PPNP_BUS_INFORMATION
)ExAllocatePool(PagedPool
, sizeof(PNP_BUS_INFORMATION
));
629 RtlCopyMemory(&BusInfo
->BusTypeGuid
,
631 sizeof(BusInfo
->BusTypeGuid
));
632 BusInfo
->LegacyBusType
= PNPBus
;
634 BusInfo
->BusNumber
= 0;
635 Information
= (ULONG_PTR
)BusInfo
;
636 Status
= STATUS_SUCCESS
;
639 case IRP_MN_REMOVE_DEVICE
:
641 PHUB_DEVICE_EXTENSION HubDeviceExtension
= (PHUB_DEVICE_EXTENSION
)UsbChildExtension
->ParentDeviceObject
->DeviceExtension
;
642 PUSB_BUS_INTERFACE_HUB_V5 HubInterface
= &HubDeviceExtension
->HubInterface
;
643 ParentDevice
= UsbChildExtension
->ParentDeviceObject
;
645 DPRINT("IRP_MJ_PNP / IRP_MN_REMOVE_DEVICE\n");
647 /* remove us from pdo list */
649 for(Index
= 0; Index
< USB_MAXCHILDREN
; Index
++)
651 if (HubDeviceExtension
->ChildDeviceObject
[Index
] == DeviceObject
)
653 /* Remove the device */
654 Status
= HubInterface
->RemoveUsbDevice(HubDeviceExtension
->UsbDInterface
.BusContext
, UsbChildExtension
->UsbDeviceHandle
, 0);
656 /* FIXME handle error */
657 ASSERT(Status
== STATUS_SUCCESS
);
660 HubDeviceExtension
->ChildDeviceObject
[Index
] = NULL
;
666 /* Complete the IRP */
667 Irp
->IoStatus
.Status
= STATUS_SUCCESS
;
668 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
671 IoDeleteDevice(DeviceObject
);
675 /* invalidate device relations */
676 IoInvalidateDeviceRelations(ParentDevice
, BusRelations
);
679 return STATUS_SUCCESS
;
681 case IRP_MN_QUERY_DEVICE_RELATIONS
:
683 /* only target relations are supported */
684 if (Stack
->Parameters
.QueryDeviceRelations
.Type
!= TargetDeviceRelation
)
687 Status
= Irp
->IoStatus
.Status
;
691 /* allocate device relations */
692 DeviceRelation
= (PDEVICE_RELATIONS
)ExAllocatePool(NonPagedPool
, sizeof(DEVICE_RELATIONS
));
696 Status
= STATUS_INSUFFICIENT_RESOURCES
;
700 /* init device relation */
701 DeviceRelation
->Count
= 1;
702 DeviceRelation
->Objects
[0] = DeviceObject
;
703 ObReferenceObject(DeviceRelation
->Objects
[0]);
706 Irp
->IoStatus
.Information
= (ULONG_PTR
)DeviceRelation
;
707 Status
= STATUS_SUCCESS
;
710 case IRP_MN_QUERY_STOP_DEVICE
:
711 case IRP_MN_QUERY_REMOVE_DEVICE
:
713 /* Sure, no problem */
714 Status
= STATUS_SUCCESS
;
718 case IRP_MN_QUERY_INTERFACE
:
720 DPRINT1("IRP_MN_QUERY_INTERFACE\n");
721 if (IsEqualGUIDAligned(Stack
->Parameters
.QueryInterface
.InterfaceType
, &USB_BUS_INTERFACE_USBDI_GUID
))
723 DPRINT1("USB_BUS_INTERFACE_USBDI_GUID\n");
724 RtlCopyMemory(Stack
->Parameters
.QueryInterface
.Interface
, &UsbChildExtension
->DeviceInterface
, Stack
->Parameters
.QueryInterface
.Size
);
725 Status
= STATUS_SUCCESS
;
730 IoSkipCurrentIrpStackLocation(Irp
);
731 return IoCallDriver(UsbChildExtension
->ParentDeviceObject
, Irp
);
733 case IRP_MN_SURPRISE_REMOVAL
:
735 DPRINT("[USBHUB] HandlePnp IRP_MN_SURPRISE_REMOVAL\n");
736 Status
= STATUS_SUCCESS
;
741 DPRINT1("PDO IRP_MJ_PNP / unknown minor function 0x%lx\n", MinorFunction
);
742 Information
= Irp
->IoStatus
.Information
;
743 Status
= Irp
->IoStatus
.Status
;
747 Irp
->IoStatus
.Information
= Information
;
748 Irp
->IoStatus
.Status
= Status
;
749 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);