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/usbccgp/pdo.c
5 * PURPOSE: USB device driver.
7 * Michael Martin (michael.martin@reactos.org)
8 * Johannes Anderwald (johannes.anderwald@reactos.org)
15 USBCCGP_PdoHandleQueryDeviceText(
16 IN PDEVICE_OBJECT DeviceObject
,
20 PPDO_DEVICE_EXTENSION PDODeviceExtension
;
21 LPWSTR GenericString
= L
"Composite USB Device";
23 // get device extension
25 PDODeviceExtension
= (PPDO_DEVICE_EXTENSION
)DeviceObject
->DeviceExtension
;
28 // is there a device description
30 if (PDODeviceExtension
->FunctionDescriptor
->FunctionDescription
.Length
)
35 Buffer
= AllocateItem(NonPagedPool
, PDODeviceExtension
->FunctionDescriptor
->FunctionDescription
.Length
+ sizeof(WCHAR
));
41 return STATUS_INSUFFICIENT_RESOURCES
;
47 Irp
->IoStatus
.Information
= (ULONG_PTR
)Buffer
;
48 RtlCopyMemory(Buffer
, PDODeviceExtension
->FunctionDescriptor
->FunctionDescription
.Buffer
, PDODeviceExtension
->FunctionDescriptor
->FunctionDescription
.Length
);
49 return STATUS_SUCCESS
;
53 // FIXME use GenericCompositeUSBDeviceString
56 Buffer
= AllocateItem(PagedPool
, (wcslen(GenericString
) + 1) * sizeof(WCHAR
));
62 return STATUS_INSUFFICIENT_RESOURCES
;
64 RtlCopyMemory(Buffer
, GenericString
, (wcslen(GenericString
) + 1) * sizeof(WCHAR
));
65 Irp
->IoStatus
.Information
= (ULONG_PTR
)Buffer
;
67 return STATUS_SUCCESS
;
71 USBCCGP_PdoHandleDeviceRelations(
72 IN PDEVICE_OBJECT DeviceObject
,
75 PDEVICE_RELATIONS DeviceRelations
;
76 PIO_STACK_LOCATION IoStack
;
78 DPRINT1("USBCCGP_PdoHandleDeviceRelations\n");
81 // get current irp stack location
83 IoStack
= IoGetCurrentIrpStackLocation(Irp
);
86 // check if relation type is BusRelations
88 if (IoStack
->Parameters
.QueryDeviceRelations
.Type
!= TargetDeviceRelation
)
91 // PDO handles only target device relation
93 return Irp
->IoStatus
.Status
;
97 // allocate device relations
99 DeviceRelations
= (PDEVICE_RELATIONS
)AllocateItem(PagedPool
, sizeof(DEVICE_RELATIONS
));
100 if (!DeviceRelations
)
105 return STATUS_INSUFFICIENT_RESOURCES
;
109 // initialize device relations
111 DeviceRelations
->Count
= 1;
112 DeviceRelations
->Objects
[0] = DeviceObject
;
113 ObReferenceObject(DeviceObject
);
118 Irp
->IoStatus
.Information
= (ULONG_PTR
)DeviceRelations
;
121 // completed successfully
123 return STATUS_SUCCESS
;
127 USBCCGP_PdoAppendInterfaceNumber(
129 IN ULONG InterfaceNumber
,
130 OUT LPWSTR
*OutString
)
132 ULONG Length
= 0, StringLength
;
136 // count length of string
141 StringLength
= wcslen(String
) + 1;
142 Length
+= StringLength
;
143 Length
+= 6; //&MI_XX
144 String
+= StringLength
;
148 // now allocate the buffer
150 String
= AllocateItem(NonPagedPool
, (Length
+ 2) * sizeof(WCHAR
));
156 return STATUS_INSUFFICIENT_RESOURCES
;
166 StringLength
= swprintf(String
, L
"%s&MI_%02x", DeviceId
) + 1;
167 Length
= wcslen(DeviceId
) + 1;
168 DPRINT1("String %p\n", String
);
173 String
+= StringLength
;
180 return STATUS_SUCCESS
;
185 USBCCGP_PdoHandleQueryId(
186 PDEVICE_OBJECT DeviceObject
,
189 PIO_STACK_LOCATION IoStack
;
190 PUNICODE_STRING DeviceString
= NULL
;
191 PPDO_DEVICE_EXTENSION PDODeviceExtension
;
196 // get current irp stack location
198 IoStack
= IoGetCurrentIrpStackLocation(Irp
);
201 // get device extension
203 PDODeviceExtension
= (PPDO_DEVICE_EXTENSION
)DeviceObject
->DeviceExtension
;
206 if (IoStack
->Parameters
.QueryId
.IdType
== BusQueryDeviceID
)
209 // handle query device id
211 Status
= USBCCGP_SyncForwardIrp(PDODeviceExtension
->NextDeviceObject
, Irp
);
212 if (NT_SUCCESS(Status
))
217 Buffer
= AllocateItem(NonPagedPool
, (wcslen((LPWSTR
)Irp
->IoStatus
.Information
) + 7) * sizeof(WCHAR
));
221 // append interface number
223 ASSERT(Irp
->IoStatus
.Information
);
224 swprintf(Buffer
, L
"%s&MI_%02x", (LPWSTR
)Irp
->IoStatus
.Information
, PDODeviceExtension
->FunctionDescriptor
->FunctionNumber
);
225 DPRINT1("BusQueryDeviceID %S\n", Buffer
);
227 ExFreePool((PVOID
)Irp
->IoStatus
.Information
);
228 Irp
->IoStatus
.Information
= (ULONG_PTR
)Buffer
;
235 Status
= STATUS_INSUFFICIENT_RESOURCES
;
240 else if (IoStack
->Parameters
.QueryId
.IdType
== BusQueryHardwareIDs
)
243 // handle instance id
245 DeviceString
= &PDODeviceExtension
->FunctionDescriptor
->HardwareId
;
247 else if (IoStack
->Parameters
.QueryId
.IdType
== BusQueryInstanceID
)
250 // handle instance id
252 Buffer
= AllocateItem(NonPagedPool
, 5 * sizeof(WCHAR
));
258 return STATUS_INSUFFICIENT_RESOURCES
;
262 // use function number
264 swprintf(Buffer
, L
"%04x", PDODeviceExtension
->FunctionDescriptor
->FunctionNumber
);
265 Irp
->IoStatus
.Information
= (ULONG_PTR
)Buffer
;
266 return STATUS_SUCCESS
;
268 else if (IoStack
->Parameters
.QueryId
.IdType
== BusQueryCompatibleIDs
)
271 // handle instance id
273 DeviceString
= &PDODeviceExtension
->FunctionDescriptor
->CompatibleId
;
279 ASSERT(DeviceString
!= NULL
);
284 Buffer
= AllocateItem(NonPagedPool
, DeviceString
->Length
+ sizeof(WCHAR
));
290 return STATUS_INSUFFICIENT_RESOURCES
;
296 RtlCopyMemory(Buffer
, DeviceString
->Buffer
, DeviceString
->Length
);
297 Irp
->IoStatus
.Information
= (ULONG_PTR
)Buffer
;
299 return STATUS_SUCCESS
;
304 PDEVICE_OBJECT DeviceObject
,
307 PIO_STACK_LOCATION IoStack
;
308 PPDO_DEVICE_EXTENSION PDODeviceExtension
;
313 // get current stack location
315 IoStack
= IoGetCurrentIrpStackLocation(Irp
);
318 // get device extension
320 PDODeviceExtension
= (PPDO_DEVICE_EXTENSION
)DeviceObject
->DeviceExtension
;
325 ASSERT(PDODeviceExtension
->Common
.IsFDO
== FALSE
);
327 switch(IoStack
->MinorFunction
)
329 case IRP_MN_QUERY_DEVICE_RELATIONS
:
332 // handle device relations
334 Status
= USBCCGP_PdoHandleDeviceRelations(DeviceObject
, Irp
);
337 case IRP_MN_QUERY_DEVICE_TEXT
:
340 // handle query device text
342 Status
= USBCCGP_PdoHandleQueryDeviceText(DeviceObject
, Irp
);
345 case IRP_MN_QUERY_ID
:
350 Status
= USBCCGP_PdoHandleQueryId(DeviceObject
, Irp
);
353 case IRP_MN_REMOVE_DEVICE
:
356 // remove us from the fdo's pdo list
358 for(Index
= 0; Index
< PDODeviceExtension
->FDODeviceExtension
->FunctionDescriptorCount
; Index
++)
360 if (PDODeviceExtension
->FDODeviceExtension
->ChildPDO
[Index
] == DeviceObject
)
365 PDODeviceExtension
->FDODeviceExtension
->ChildPDO
[Index
] = NULL
;
373 Irp
->IoStatus
.Status
= STATUS_SUCCESS
;
374 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
377 // Delete the device object
379 IoDeleteDevice(DeviceObject
);
380 return STATUS_SUCCESS
;
382 case IRP_MN_QUERY_CAPABILITIES
:
385 // copy device capabilities
387 RtlCopyMemory(IoStack
->Parameters
.DeviceCapabilities
.Capabilities
, &PDODeviceExtension
->Capabilities
, sizeof(DEVICE_CAPABILITIES
));
389 /* Complete the IRP */
390 Irp
->IoStatus
.Status
= STATUS_SUCCESS
;
391 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
392 return STATUS_SUCCESS
;
394 case IRP_MN_START_DEVICE
:
399 DPRINT1("[USBCCGP] PDO IRP_MN_START\n");
400 Status
= STATUS_SUCCESS
;
408 Status
= Irp
->IoStatus
.Status
;
415 if (Status
!= STATUS_PENDING
)
420 Irp
->IoStatus
.Status
= Status
;
425 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
436 USBCCGP_BuildConfigurationDescriptor(
437 PDEVICE_OBJECT DeviceObject
,
440 PIO_STACK_LOCATION IoStack
;
441 PPDO_DEVICE_EXTENSION PDODeviceExtension
;
442 PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
;
443 PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor
;
444 ULONG TotalSize
, Index
;
450 // get current stack location
452 IoStack
= IoGetCurrentIrpStackLocation(Irp
);
454 DPRINT1("USBCCGP_BuildConfigurationDescriptor\n");
457 // get device extension
459 PDODeviceExtension
= (PPDO_DEVICE_EXTENSION
)DeviceObject
->DeviceExtension
;
462 // get configuration descriptor
464 ConfigurationDescriptor
= PDODeviceExtension
->ConfigurationDescriptor
;
467 // calculate size of configuration descriptor
469 TotalSize
= sizeof(USB_CONFIGURATION_DESCRIPTOR
);
471 for(Index
= 0; Index
< PDODeviceExtension
->FunctionDescriptor
->NumberOfInterfaces
; Index
++)
474 // get current interface descriptor
476 InterfaceDescriptor
= PDODeviceExtension
->FunctionDescriptor
->InterfaceDescriptorList
[Index
];
479 // add to size and move to next descriptor
481 TotalSize
+= InterfaceDescriptor
->bLength
;
482 InterfaceDescriptor
= (PUSB_INTERFACE_DESCRIPTOR
)((ULONG_PTR
)InterfaceDescriptor
+ InterfaceDescriptor
->bLength
);
486 if ((ULONG_PTR
)InterfaceDescriptor
>= ((ULONG_PTR
)ConfigurationDescriptor
+ ConfigurationDescriptor
->wTotalLength
))
489 // reached end of configuration descriptor
495 // association descriptors are removed
497 if (InterfaceDescriptor
->bDescriptorType
!= USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE
)
499 if (InterfaceDescriptor
->bDescriptorType
== USB_INTERFACE_DESCRIPTOR_TYPE
)
502 // reached next descriptor
510 TotalSize
+= InterfaceDescriptor
->bLength
;
514 // move to next descriptor
516 InterfaceDescriptor
= (PUSB_INTERFACE_DESCRIPTOR
)((ULONG_PTR
)InterfaceDescriptor
+ InterfaceDescriptor
->bLength
);
521 // now allocate temporary buffer for the configuration descriptor
523 Buffer
= AllocateItem(NonPagedPool
, TotalSize
);
527 // failed to allocate buffer
529 DPRINT1("[USBCCGP] Failed to allocate %lu Bytes\n", TotalSize
);
530 return STATUS_INSUFFICIENT_RESOURCES
;
534 // first copy the configuration descriptor
536 RtlCopyMemory(Buffer
, ConfigurationDescriptor
, sizeof(USB_CONFIGURATION_DESCRIPTOR
));
537 BufferPtr
= (PUCHAR
)((ULONG_PTR
)Buffer
+ ConfigurationDescriptor
->bLength
);
539 for(Index
= 0; Index
< PDODeviceExtension
->FunctionDescriptor
->NumberOfInterfaces
; Index
++)
542 // get current interface descriptor
544 InterfaceDescriptor
= PDODeviceExtension
->FunctionDescriptor
->InterfaceDescriptorList
[Index
];
547 // copy descriptor and move to next descriptor
549 RtlCopyMemory(BufferPtr
, InterfaceDescriptor
, InterfaceDescriptor
->bLength
);
550 BufferPtr
+= InterfaceDescriptor
->bLength
;
551 InterfaceDescriptor
= (PUSB_INTERFACE_DESCRIPTOR
)((ULONG_PTR
)InterfaceDescriptor
+ InterfaceDescriptor
->bLength
);
555 if ((ULONG_PTR
)InterfaceDescriptor
>= ((ULONG_PTR
)ConfigurationDescriptor
+ ConfigurationDescriptor
->wTotalLength
))
558 // reached end of configuration descriptor
564 // association descriptors are removed
566 if (InterfaceDescriptor
->bDescriptorType
!= USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE
)
568 if (InterfaceDescriptor
->bDescriptorType
== USB_INTERFACE_DESCRIPTOR_TYPE
)
571 // reached next descriptor
579 RtlCopyMemory(BufferPtr
, InterfaceDescriptor
, InterfaceDescriptor
->bLength
);
580 BufferPtr
+= InterfaceDescriptor
->bLength
;
584 // move to next descriptor
586 InterfaceDescriptor
= (PUSB_INTERFACE_DESCRIPTOR
)((ULONG_PTR
)InterfaceDescriptor
+ InterfaceDescriptor
->bLength
);
591 // modify configuration descriptor
593 ConfigurationDescriptor
= Buffer
;
594 ConfigurationDescriptor
->wTotalLength
= TotalSize
;
595 ConfigurationDescriptor
->bNumInterfaces
= PDODeviceExtension
->FunctionDescriptor
->NumberOfInterfaces
;
600 Urb
= (PURB
)IoStack
->Parameters
.Others
.Argument1
;
606 RtlCopyMemory(Urb
->UrbControlDescriptorRequest
.TransferBuffer
, Buffer
, min(TotalSize
, Urb
->UrbControlDescriptorRequest
.TransferBufferLength
));
611 Urb
->UrbControlDescriptorRequest
.TransferBufferLength
= TotalSize
;
621 return STATUS_SUCCESS
;
625 USBCCGP_PDOSelectConfiguration(
626 PDEVICE_OBJECT DeviceObject
,
629 PIO_STACK_LOCATION IoStack
;
630 PPDO_DEVICE_EXTENSION PDODeviceExtension
;
632 PUSBD_INTERFACE_INFORMATION InterfaceInformation
;
633 ULONG InterfaceInformationCount
, Index
, InterfaceIndex
;
634 PUSBD_INTERFACE_LIST_ENTRY Entry
;
635 ULONG NeedSelect
, FoundInterface
;
639 // get current stack location
641 IoStack
= IoGetCurrentIrpStackLocation(Irp
);
644 // get device extension
646 PDODeviceExtension
= (PPDO_DEVICE_EXTENSION
)DeviceObject
->DeviceExtension
;
651 Urb
= (PURB
)IoStack
->Parameters
.Others
.Argument1
;
655 // is there already an configuration handle
657 if (Urb
->UrbSelectConfiguration
.ConfigurationHandle
)
662 return STATUS_SUCCESS
;
666 // count interface information
668 InterfaceInformationCount
= 0;
669 InterfaceInformation
= &Urb
->UrbSelectConfiguration
.Interface
;
672 InterfaceInformationCount
++;
673 InterfaceInformation
= (PUSBD_INTERFACE_INFORMATION
)((ULONG_PTR
)InterfaceInformation
+ InterfaceInformation
->Length
);
674 }while((ULONG_PTR
)InterfaceInformation
< (ULONG_PTR
)Urb
+ Urb
->UrbSelectConfiguration
.Hdr
.Length
);
677 // check all interfaces
679 InterfaceInformation
= &Urb
->UrbSelectConfiguration
.Interface
;
682 DPRINT1("Count %x\n", InterfaceInformationCount
);
685 DPRINT1("[USBCCGP] SelectConfiguration Function %x InterfaceNumber %x Alternative %x\n", PDODeviceExtension
->FunctionDescriptor
->FunctionNumber
, InterfaceInformation
->InterfaceNumber
, InterfaceInformation
->AlternateSetting
);
688 // search for the interface in the local interface list
690 FoundInterface
= FALSE
;
691 for(InterfaceIndex
= 0; InterfaceIndex
< PDODeviceExtension
->FunctionDescriptor
->NumberOfInterfaces
; InterfaceIndex
++)
693 if (PDODeviceExtension
->FunctionDescriptor
->InterfaceDescriptorList
[InterfaceIndex
]->bInterfaceNumber
== InterfaceInformation
->InterfaceNumber
)
695 // found interface entry
696 FoundInterface
= TRUE
;
706 DPRINT1("InterfaceInformation InterfaceNumber %x Alternative %x NumberOfPipes %x not found\n", InterfaceInformation
->InterfaceNumber
, InterfaceInformation
->AlternateSetting
, InterfaceInformation
->NumberOfPipes
);
708 return STATUS_INVALID_PARAMETER
;
712 // now query the total interface list
715 for(InterfaceIndex
= 0; InterfaceIndex
< PDODeviceExtension
->InterfaceListCount
; InterfaceIndex
++)
717 if (PDODeviceExtension
->InterfaceList
[InterfaceIndex
].Interface
->InterfaceNumber
== InterfaceInformation
->InterfaceNumber
)
722 Entry
= &PDODeviceExtension
->InterfaceList
[InterfaceIndex
];
733 // corruption detected
739 if (Entry
->InterfaceDescriptor
->bAlternateSetting
== InterfaceInformation
->AlternateSetting
)
742 for(InterfaceIndex
= 0; InterfaceIndex
< InterfaceInformation
->NumberOfPipes
; InterfaceIndex
++)
744 if (InterfaceInformation
->Pipes
[InterfaceIndex
].MaximumTransferSize
!= Entry
->Interface
->Pipes
[InterfaceIndex
].MaximumTransferSize
)
756 // need select as the interface number differ
764 // interface is already selected
766 RtlCopyMemory(InterfaceInformation
, Entry
->Interface
, min(InterfaceInformation
->Length
, Entry
->Interface
->Length
));
773 DPRINT1("Selecting InterfaceIndex %lu AlternateSetting %lu NumberOfPipes %lu\n", InterfaceInformation
->InterfaceNumber
, InterfaceInformation
->AlternateSetting
, InterfaceInformation
->NumberOfPipes
);
774 ASSERT(InterfaceInformation
->Length
== Entry
->Interface
->Length
);
779 NewUrb
= AllocateItem(NonPagedPool
, GET_SELECT_INTERFACE_REQUEST_SIZE(InterfaceInformation
->NumberOfPipes
));
785 return STATUS_INSUFFICIENT_RESOURCES
;
789 // now prepare interface urb
791 UsbBuildSelectInterfaceRequest(NewUrb
, GET_SELECT_INTERFACE_REQUEST_SIZE(InterfaceInformation
->NumberOfPipes
), PDODeviceExtension
->ConfigurationHandle
, InterfaceInformation
->InterfaceNumber
, InterfaceInformation
->AlternateSetting
);
794 // now select the interface
796 Status
= USBCCGP_SyncUrbRequest(PDODeviceExtension
->NextDeviceObject
, NewUrb
);
797 DPRINT1("SelectInterface Status %x\n", Status
);
802 if (NT_SUCCESS(Status
))
805 // update configuration info
807 ASSERT(Entry
->Interface
->Length
== NewUrb
->UrbSelectInterface
.Interface
.Length
);
808 ASSERT(InterfaceInformation
->Length
== NewUrb
->UrbSelectInterface
.Interface
.Length
);
809 RtlCopyMemory(Entry
->Interface
, &NewUrb
->UrbSelectInterface
.Interface
, NewUrb
->UrbSelectInterface
.Interface
.Length
);
812 // update provided interface information
814 RtlCopyMemory(InterfaceInformation
, Entry
->Interface
, Entry
->Interface
->Length
);
824 // move to next information
826 InterfaceInformation
= (PUSBD_INTERFACE_INFORMATION
)((ULONG_PTR
)InterfaceInformation
+ InterfaceInformation
->Length
);
828 }while(Index
< InterfaceInformationCount
);
831 // store configuration handle
833 Urb
->UrbSelectConfiguration
.ConfigurationHandle
= PDODeviceExtension
->ConfigurationHandle
;
835 DPRINT1("[USBCCGP] SelectConfiguration Function %x Completed\n", PDODeviceExtension
->FunctionDescriptor
->FunctionNumber
);
840 return STATUS_SUCCESS
;
844 PDO_HandleInternalDeviceControl(
845 PDEVICE_OBJECT DeviceObject
,
848 PIO_STACK_LOCATION IoStack
;
849 PPDO_DEVICE_EXTENSION PDODeviceExtension
;
854 // get current stack location
856 IoStack
= IoGetCurrentIrpStackLocation(Irp
);
859 // get device extension
861 PDODeviceExtension
= (PPDO_DEVICE_EXTENSION
)DeviceObject
->DeviceExtension
;
863 if (IoStack
->Parameters
.DeviceIoControl
.IoControlCode
== IOCTL_INTERNAL_USB_SUBMIT_URB
)
868 Urb
= (PURB
)IoStack
->Parameters
.Others
.Argument1
;
870 DPRINT("IOCTL_INTERNAL_USB_SUBMIT_URB Function %x\n", Urb
->UrbHeader
.Function
);
872 if (Urb
->UrbHeader
.Function
== URB_FUNCTION_SELECT_CONFIGURATION
)
875 // select configuration
877 Status
= USBCCGP_PDOSelectConfiguration(DeviceObject
, Irp
);
878 Irp
->IoStatus
.Status
= Status
;
879 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
882 else if (Urb
->UrbHeader
.Function
== URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE
)
884 if(Urb
->UrbControlDescriptorRequest
.DescriptorType
== USB_DEVICE_DESCRIPTOR_TYPE
)
887 // is the buffer big enough
889 if (Urb
->UrbControlDescriptorRequest
.TransferBufferLength
< sizeof(USB_DEVICE_DESCRIPTOR
))
892 // invalid buffer size
894 DPRINT1("[USBCCGP] invalid device descriptor size %lu\n", Urb
->UrbControlDescriptorRequest
.TransferBufferLength
);
895 Urb
->UrbControlDescriptorRequest
.TransferBufferLength
= sizeof(USB_DEVICE_DESCRIPTOR
);
896 Irp
->IoStatus
.Status
= STATUS_INVALID_BUFFER_SIZE
;
897 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
898 return STATUS_INVALID_BUFFER_SIZE
;
902 // copy device descriptor
904 ASSERT(Urb
->UrbControlDescriptorRequest
.TransferBuffer
);
905 RtlCopyMemory(Urb
->UrbControlDescriptorRequest
.TransferBuffer
, &PDODeviceExtension
->DeviceDescriptor
, sizeof(USB_DEVICE_DESCRIPTOR
));
906 Irp
->IoStatus
.Status
= STATUS_SUCCESS
;
907 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
908 return STATUS_SUCCESS
;
910 else if (Urb
->UrbControlDescriptorRequest
.DescriptorType
== USB_CONFIGURATION_DESCRIPTOR_TYPE
)
913 // build configuration descriptor
915 Status
= USBCCGP_BuildConfigurationDescriptor(DeviceObject
, Irp
);
916 Irp
->IoStatus
.Status
= Status
;
917 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
923 IoSkipCurrentIrpStackLocation(Irp
);
924 Status
= IoCallDriver(PDODeviceExtension
->NextDeviceObject
, Irp
);
931 DPRINT1("IOCTL %x\n", IoStack
->Parameters
.DeviceIoControl
.IoControlCode
);
932 DPRINT1("InputBufferLength %lu\n", IoStack
->Parameters
.DeviceIoControl
.InputBufferLength
);
933 DPRINT1("OutputBufferLength %lu\n", IoStack
->Parameters
.DeviceIoControl
.OutputBufferLength
);
934 DPRINT1("Type3InputBuffer %p\n", IoStack
->Parameters
.DeviceIoControl
.Type3InputBuffer
);
938 Irp
->IoStatus
.Status
= STATUS_NOT_IMPLEMENTED
;
939 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
940 return STATUS_NOT_IMPLEMENTED
;
946 PDEVICE_OBJECT DeviceObject
,
949 PIO_STACK_LOCATION IoStack
;
952 /* get stack location */
953 IoStack
= IoGetCurrentIrpStackLocation(Irp
);
955 switch(IoStack
->MajorFunction
)
958 return PDO_HandlePnp(DeviceObject
, Irp
);
959 case IRP_MJ_INTERNAL_DEVICE_CONTROL
:
960 return PDO_HandleInternalDeviceControl(DeviceObject
, Irp
);
962 DPRINT1("PDO_Dispatch Function %x not implemented\n", IoStack
->MajorFunction
);
964 Status
= Irp
->IoStatus
.Status
;
965 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);