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
;
68 DumpConfigurationDescriptor(
69 IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
);
72 USBCCGP_GetDescriptors(
73 IN PDEVICE_OBJECT DeviceObject
);
76 USBCCGP_SelectConfiguration(
77 IN PDEVICE_OBJECT DeviceObject
,
78 IN PFDO_DEVICE_EXTENSION DeviceExtension
);
82 USBCCGP_GetDescriptor(
83 IN PDEVICE_OBJECT DeviceObject
,
84 IN UCHAR DescriptorType
,
85 IN ULONG DescriptorLength
,
86 IN UCHAR DescriptorIndex
,
88 OUT PVOID
*OutDescriptor
);
92 USBCCGP_GetStringDescriptor(
93 IN PDEVICE_OBJECT DeviceObject
,
94 IN ULONG DescriptorLength
,
95 IN UCHAR DescriptorIndex
,
97 OUT PVOID
*OutDescriptor
);
100 CountInterfaceDescriptors(
101 IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
);
104 AllocateInterfaceDescriptorsArray(
105 IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
,
106 OUT PUSB_INTERFACE_DESCRIPTOR
**OutArray
);
112 USBCCGP_SyncForwardIrp(
113 PDEVICE_OBJECT DeviceObject
,
117 USBCCGP_SyncUrbRequest(
118 IN PDEVICE_OBJECT DeviceObject
,
119 OUT PURB UrbRequest
);
123 IN POOL_TYPE PoolType
,
131 DumpFunctionDescriptor(
132 IN PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor
,
133 IN ULONG FunctionDescriptorCount
);
139 PDEVICE_OBJECT DeviceObject
,
146 PDEVICE_OBJECT DeviceObject
,
152 USBCCGP_QueryInterface(
153 IN PDEVICE_OBJECT DeviceObject
,
154 OUT PUSBC_DEVICE_CONFIGURATION_INTERFACE_V1 BusInterface
);
157 USBCCGP_EnumerateFunctions(
158 IN PDEVICE_OBJECT DeviceObject
);