12 #include <usbprotocoldefs.h> */
20 BOOLEAN IsFDO
; // is device a FDO or PDO
21 }COMMON_DEVICE_EXTENSION
, *PCOMMON_DEVICE_EXTENSION
;
25 COMMON_DEVICE_EXTENSION Common
; // shared with PDO
26 PDRIVER_OBJECT DriverObject
; // driver object
27 PDEVICE_OBJECT PhysicalDeviceObject
; // physical device object
28 PDEVICE_OBJECT NextDeviceObject
; // lower device object
29 PUSB_DEVICE_DESCRIPTOR DeviceDescriptor
; // usb device descriptor
30 PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
; // usb configuration descriptor
31 DEVICE_CAPABILITIES Capabilities
; // device capabilities
32 PUSBD_INTERFACE_LIST_ENTRY InterfaceList
; // interface list
33 ULONG InterfaceListCount
; // interface list count
34 USBD_CONFIGURATION_HANDLE ConfigurationHandle
; // configuration handle
35 USBC_DEVICE_CONFIGURATION_INTERFACE_V1 BusInterface
; // bus custom enumeration interface
36 PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor
; // usb function descriptor
37 ULONG FunctionDescriptorCount
; // number of function descriptor
38 PDEVICE_OBJECT
* ChildPDO
; // child pdos
39 LIST_ENTRY ResetPortListHead
; // reset port list head
40 LIST_ENTRY CyclePortListHead
; // cycle port list head
41 UCHAR ResetPortActive
; // reset port active
42 UCHAR CyclePortActive
; // cycle port active
43 KSPIN_LOCK Lock
; // reset / cycle port list lock
44 }FDO_DEVICE_EXTENSION
, *PFDO_DEVICE_EXTENSION
;
46 #define USBCCPG_TAG 'cbsu'
50 COMMON_DEVICE_EXTENSION Common
; // shared with FDO
51 PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor
; // function descriptor
52 PDEVICE_OBJECT NextDeviceObject
; // next device object
53 DEVICE_CAPABILITIES Capabilities
; // device capabilities
54 ULONG FunctionIndex
; // function index
55 USB_DEVICE_DESCRIPTOR DeviceDescriptor
; // usb device descriptor
56 PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
; // usb configuration descriptor
57 USBD_CONFIGURATION_HANDLE ConfigurationHandle
; // configuration handle
58 PUSBD_INTERFACE_LIST_ENTRY InterfaceList
; // interface list
59 ULONG InterfaceListCount
; // interface list count
60 PFDO_DEVICE_EXTENSION FDODeviceExtension
; // pointer to fdo's pdo list
61 }PDO_DEVICE_EXTENSION
, *PPDO_DEVICE_EXTENSION
;
66 DumpConfigurationDescriptor(
67 IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
);
70 USBCCGP_GetDescriptors(
71 IN PDEVICE_OBJECT DeviceObject
);
74 USBCCGP_SelectConfiguration(
75 IN PDEVICE_OBJECT DeviceObject
,
76 IN PFDO_DEVICE_EXTENSION DeviceExtension
);
80 USBCCGP_GetDescriptor(
81 IN PDEVICE_OBJECT DeviceObject
,
82 IN UCHAR DescriptorType
,
83 IN ULONG DescriptorLength
,
84 IN UCHAR DescriptorIndex
,
86 OUT PVOID
*OutDescriptor
);
90 USBCCGP_GetStringDescriptor(
91 IN PDEVICE_OBJECT DeviceObject
,
92 IN ULONG DescriptorLength
,
93 IN UCHAR DescriptorIndex
,
95 OUT PVOID
*OutDescriptor
);
98 CountInterfaceDescriptors(
99 IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
);
102 AllocateInterfaceDescriptorsArray(
103 IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
,
104 OUT PUSB_INTERFACE_DESCRIPTOR
**OutArray
);
110 USBCCGP_SyncForwardIrp(
111 PDEVICE_OBJECT DeviceObject
,
115 USBCCGP_SyncUrbRequest(
116 IN PDEVICE_OBJECT DeviceObject
,
117 OUT PURB UrbRequest
);
121 IN POOL_TYPE PoolType
,
129 DumpFunctionDescriptor(
130 IN PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor
,
131 IN ULONG FunctionDescriptorCount
);
137 PDEVICE_OBJECT DeviceObject
,
144 PDEVICE_OBJECT DeviceObject
,
150 USBCCGP_QueryInterface(
151 IN PDEVICE_OBJECT DeviceObject
,
152 OUT PUSBC_DEVICE_CONFIGURATION_INTERFACE_V1 BusInterface
);
155 USBCCGP_EnumerateFunctions(
156 IN PDEVICE_OBJECT DeviceObject
);