126 for(
Index = 0;
Index < FDODeviceExtension->FunctionDescriptorCount;
Index++)
128 if (FDODeviceExtension->ChildPDO[
Index])
138 if (!DeviceRelations)
145 for(
Index = 0;
Index < FDODeviceExtension->FunctionDescriptorCount;
Index++)
147 if (FDODeviceExtension->ChildPDO[
Index])
150 DeviceRelations->
Objects[DeviceRelations->
Count] = FDODeviceExtension->ChildPDO[
Index];
156 DeviceRelations->
Count++;
184 sizeof(
PDEVICE_OBJECT) * FDODeviceExtension->FunctionDescriptorCount);
185 if (!FDODeviceExtension->ChildPDO)
192 for (
Index = 0;
Index < FDODeviceExtension->FunctionDescriptorCount;
Index++)
194 if (FDODeviceExtension->FunctionDescriptor[
Index].NumberOfInterfaces == 0)
197 DPRINT1(
"[USBCCGP] Found descriptor with 0 interfaces\n");
217 FDODeviceExtension->ChildPDO[
Index] = PDODeviceObject;
225 PDODeviceExtension->FunctionDescriptor = &FDODeviceExtension->FunctionDescriptor[
Index];
227 PDODeviceExtension->FunctionIndex =
Index;
228 PDODeviceExtension->FDODeviceExtension = FDODeviceExtension;
229 PDODeviceExtension->InterfaceList = FDODeviceExtension->InterfaceList;
230 PDODeviceExtension->InterfaceListCount = FDODeviceExtension->InterfaceListCount;
231 PDODeviceExtension->ConfigurationHandle = FDODeviceExtension->ConfigurationHandle;
232 PDODeviceExtension->ConfigurationDescriptor = FDODeviceExtension->ConfigurationDescriptor;
243 PDODeviceObject->
Flags &= ~DO_DEVICE_INITIALIZING;
275 DPRINT1(
"FDO_StartDevice lower device failed to start with %x\n",
Status);
284 DPRINT1(
"FDO_StartDevice failed to get descriptors with %x\n",
Status);
290 &FDODeviceExtension->Capabilities);
294 DPRINT1(
"FDO_StartDevice failed to get capabilities with %x\n",
Status);
303 DPRINT1(
"FDO_StartDevice failed to get capabilities with %x\n",
Status);
321 ASSERT(FDODeviceExtension->FunctionDescriptorCount);
322 ASSERT(FDODeviceExtension->FunctionDescriptor);
324 FDODeviceExtension->FunctionDescriptorCount);
340 DPRINT(
"[USBCCGP] FDO initialized successfully\n");
357 if (FDODeviceExtension->ConfigurationDescriptor ==
NULL ||
358 FDODeviceExtension->InterfaceList ==
NULL)
365 FDODeviceExtension->InterfaceList);
380 DPRINT1(
"USBCCGP_SyncUrbRequest failed to unconfigure device\n",
Status);
410 DPRINT1(
"[USBCCGP] FDO IRP_MN_REMOVE\n");
450 &FDODeviceExtension->Capabilities,
514 ListHead = &FDODeviceExtension->ResetPortListHead;
515 ResetActive = &FDODeviceExtension->ResetPortActive;
520 ListHead = &FDODeviceExtension->CyclePortListHead;
521 ResetActive = &FDODeviceExtension->CyclePortActive;
554 *ResetActive =
FALSE;
664 return PoCallDriver(FDODeviceExtension->NextDeviceObject,
Irp);
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define STATUS_NOT_SUPPORTED
#define NT_SUCCESS(StatCode)
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
struct _PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
NTSTATUS USBCCGP_SelectConfiguration(IN PDEVICE_OBJECT DeviceObject, IN PFDO_DEVICE_EXTENSION DeviceExtension)
NTSTATUS USBCCGP_GetDescriptors(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS USBCCGP_EnumerateFunctions(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS USBCCGP_QueryInterface(IN PDEVICE_OBJECT DeviceObject, OUT PUSBC_DEVICE_CONFIGURATION_INTERFACE_V1 BusInterface)
NTSTATUS USBCCGP_SyncUrbRequest(IN PDEVICE_OBJECT DeviceObject, OUT PURB UrbRequest)
VOID DumpFunctionDescriptor(IN PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor, IN ULONG FunctionDescriptorCount)
#define InsertTailList(ListHead, Entry)
#define IsListEmpty(ListHead)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define KeInitializeEvent(pEvt, foo, foo2)
#define KeReleaseSpinLock(sl, irql)
#define KeSetEvent(pEvt, foo, foo2)
#define KeAcquireSpinLock(sl, irql)
#define RemoveHeadList(ListHead)
#define InitializeListHead(ListHead)
_Must_inspect_result_ typedef _Out_ PHIDP_CAPS Capabilities
#define IoSetCompletionRoutine(_Irp, _CompletionRoutine, _Context, _InvokeOnSuccess, _InvokeOnError, _InvokeOnCancel)
PVOID AllocateItem(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes)
#define FILE_AUTOGENERATED_DEVICE_NAME
#define IoSkipCurrentIrpStackLocation(Irp)
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)
VOID NTAPI IoDetachDevice(IN PDEVICE_OBJECT TargetDevice)
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
#define IoCompleteRequest
PIRP NTAPI IoAllocateIrp(IN CCHAR StackSize, IN BOOLEAN ChargeQuota)
BOOLEAN NTAPI IoForwardIrpSynchronously(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
VOID NTAPI IoFreeIrp(IN PIRP Irp)
VOID NTAPI PoStartNextPowerIrp(IN PIRP Irp)
VOID NTAPI IoInvalidateDeviceRelations(IN PDEVICE_OBJECT DeviceObject, IN DEVICE_RELATION_TYPE Type)
#define STATUS_MORE_PROCESSING_REQUIRED
base of all file and directory entries
PDEVICE_OBJECT Objects[1]
COMMON_DEVICE_EXTENSION Common
PDRIVER_OBJECT DriverObject
BUS_INTERFACE_STANDARD BusInterface
struct _IO_STACK_LOCATION::@4065::@4090 QueryDeviceRelations
struct _IO_STACK_LOCATION::@4065::@4092 DeviceCapabilities
struct _IO_STACK_LOCATION::@1605::@1606 DeviceIoControl
union _IO_STACK_LOCATION::@1605 Parameters
COMMON_DEVICE_EXTENSION Common
struct _URB_SELECT_CONFIGURATION UrbSelectConfiguration
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_UNSUCCESSFUL
#define STATUS_INSUFFICIENT_RESOURCES
NTSTATUS FDO_HandleResetCyclePort(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS NTAPI FDO_QueryCapabilitiesCompletionRoutine(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context)
NTSTATUS FDO_StartDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS FDO_DeviceRelations(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS FDO_Dispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS FDO_CloseConfiguration(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS FDO_CreateChildPdo(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS FDO_QueryCapabilities(IN PDEVICE_OBJECT DeviceObject, IN OUT PDEVICE_CAPABILITIES Capabilities)
NTSTATUS FDO_HandleSystemControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS FDO_HandleInternalDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS FDO_HandlePnp(PDEVICE_OBJECT DeviceObject, PIRP Irp)
PURB NTAPI USBD_CreateConfigurationRequestEx(PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, PUSBD_INTERFACE_LIST_ENTRY InterfaceList)
#define IOCTL_INTERNAL_USB_RESET_PORT
#define IOCTL_INTERNAL_USB_CYCLE_PORT
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ PDEVICE_OBJECT DeviceObject
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
#define IRP_MN_START_DEVICE
#define IRP_MN_REMOVE_DEVICE
struct _DEVICE_RELATIONS * PDEVICE_RELATIONS
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define IRP_MN_QUERY_STOP_DEVICE
#define IRP_MJ_SYSTEM_CONTROL
#define IRP_MN_QUERY_CAPABILITIES
#define IRP_MJ_INTERNAL_DEVICE_CONTROL
#define IRP_MN_QUERY_REMOVE_DEVICE
#define ObReferenceObject