14 #include <usbprotocoldefs.h> */
22 BOOLEAN IsFDO
; // is device a FDO or PDO
23 }COMMON_DEVICE_EXTENSION
, *PCOMMON_DEVICE_EXTENSION
;
27 COMMON_DEVICE_EXTENSION Common
; // shared with PDO
28 PDRIVER_OBJECT DriverObject
; // driver object
29 PDEVICE_OBJECT PhysicalDeviceObject
; // physical device object
30 PDEVICE_OBJECT NextDeviceObject
; // lower device object
31 PUSB_DEVICE_DESCRIPTOR DeviceDescriptor
; // usb device descriptor
32 PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
; // usb configuration descriptor
33 DEVICE_CAPABILITIES Capabilities
; // device capabilities
34 PUSBD_INTERFACE_LIST_ENTRY InterfaceList
; // interface list
35 ULONG InterfaceListCount
; // interface list count
36 USBD_CONFIGURATION_HANDLE ConfigurationHandle
; // configuration handle
37 USBC_DEVICE_CONFIGURATION_INTERFACE_V1 BusInterface
; // bus custom enumeration interface
38 PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor
; // usb function descriptor
39 ULONG FunctionDescriptorCount
; // number of function descriptor
40 PDEVICE_OBJECT
* ChildPDO
; // child pdos
41 LIST_ENTRY ResetPortListHead
; // reset port list head
42 LIST_ENTRY CyclePortListHead
; // cycle port list head
43 UCHAR ResetPortActive
; // reset port active
44 UCHAR CyclePortActive
; // cycle port active
45 KSPIN_LOCK Lock
; // reset / cycle port list lock
46 }FDO_DEVICE_EXTENSION
, *PFDO_DEVICE_EXTENSION
;
48 #define USBCCPG_TAG 'cbsu'
52 COMMON_DEVICE_EXTENSION Common
; // shared with FDO
53 PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor
; // function descriptor
54 PDEVICE_OBJECT NextDeviceObject
; // next device object
55 DEVICE_CAPABILITIES Capabilities
; // device capabilities
56 ULONG FunctionIndex
; // function index
57 USB_DEVICE_DESCRIPTOR DeviceDescriptor
; // usb device descriptor
58 PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
; // usb configuration descriptor
59 USBD_CONFIGURATION_HANDLE ConfigurationHandle
; // configuration handle
60 PUSBD_INTERFACE_LIST_ENTRY InterfaceList
; // interface list
61 ULONG InterfaceListCount
; // interface list count
62 PFDO_DEVICE_EXTENSION FDODeviceExtension
; // pointer to fdo's pdo list
63 }PDO_DEVICE_EXTENSION
, *PPDO_DEVICE_EXTENSION
;
67 USBCCGP_GetDescriptors(
68 IN PDEVICE_OBJECT DeviceObject
);
71 USBCCGP_SelectConfiguration(
72 IN PDEVICE_OBJECT DeviceObject
,
73 IN PFDO_DEVICE_EXTENSION DeviceExtension
);
77 USBCCGP_GetDescriptor(
78 IN PDEVICE_OBJECT DeviceObject
,
79 IN UCHAR DescriptorType
,
80 IN ULONG DescriptorLength
,
81 IN UCHAR DescriptorIndex
,
83 OUT PVOID
*OutDescriptor
);
87 USBCCGP_GetStringDescriptor(
88 IN PDEVICE_OBJECT DeviceObject
,
89 IN ULONG DescriptorLength
,
90 IN UCHAR DescriptorIndex
,
92 OUT PVOID
*OutDescriptor
);
95 CountInterfaceDescriptors(
96 IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
);
99 AllocateInterfaceDescriptorsArray(
100 IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
,
101 OUT PUSB_INTERFACE_DESCRIPTOR
**OutArray
);
107 USBCCGP_SyncForwardIrp(
108 PDEVICE_OBJECT DeviceObject
,
112 USBCCGP_SyncUrbRequest(
113 IN PDEVICE_OBJECT DeviceObject
,
114 OUT PURB UrbRequest
);
118 IN POOL_TYPE PoolType
,
126 DumpFunctionDescriptor(
127 IN PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor
,
128 IN ULONG FunctionDescriptorCount
);
134 PDEVICE_OBJECT DeviceObject
,
141 PDEVICE_OBJECT DeviceObject
,
147 USBCCGP_QueryInterface(
148 IN PDEVICE_OBJECT DeviceObject
,
149 OUT PUSBC_DEVICE_CONFIGURATION_INTERFACE_V1 BusInterface
);
152 USBCCGP_EnumerateFunctions(
153 IN PDEVICE_OBJECT DeviceObject
);