15 // #include <usbprotocoldefs.h>
23 BOOLEAN IsFDO
; // is device a FDO or PDO
24 }COMMON_DEVICE_EXTENSION
, *PCOMMON_DEVICE_EXTENSION
;
28 COMMON_DEVICE_EXTENSION Common
; // shared with PDO
29 PDRIVER_OBJECT DriverObject
; // driver object
30 PDEVICE_OBJECT PhysicalDeviceObject
; // physical device object
31 PDEVICE_OBJECT NextDeviceObject
; // lower device object
32 PUSB_DEVICE_DESCRIPTOR DeviceDescriptor
; // usb device descriptor
33 PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
; // usb configuration descriptor
34 DEVICE_CAPABILITIES Capabilities
; // device capabilities
35 PUSBD_INTERFACE_LIST_ENTRY InterfaceList
; // interface list
36 ULONG InterfaceListCount
; // interface list count
37 USBD_CONFIGURATION_HANDLE ConfigurationHandle
; // configuration handle
38 USBC_DEVICE_CONFIGURATION_INTERFACE_V1 BusInterface
; // bus custom enumeration interface
39 PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor
; // usb function descriptor
40 ULONG FunctionDescriptorCount
; // number of function descriptor
41 PDEVICE_OBJECT
* ChildPDO
; // child pdos
42 LIST_ENTRY ResetPortListHead
; // reset port list head
43 LIST_ENTRY CyclePortListHead
; // cycle port list head
44 UCHAR ResetPortActive
; // reset port active
45 UCHAR CyclePortActive
; // cycle port active
46 KSPIN_LOCK Lock
; // reset / cycle port list lock
47 }FDO_DEVICE_EXTENSION
, *PFDO_DEVICE_EXTENSION
;
49 #define USBCCPG_TAG 'cbsu'
53 COMMON_DEVICE_EXTENSION Common
; // shared with FDO
54 PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor
; // function descriptor
55 PDEVICE_OBJECT NextDeviceObject
; // next device object
56 DEVICE_CAPABILITIES Capabilities
; // device capabilities
57 ULONG FunctionIndex
; // function index
58 USB_DEVICE_DESCRIPTOR DeviceDescriptor
; // usb device descriptor
59 PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
; // usb configuration descriptor
60 USBD_CONFIGURATION_HANDLE ConfigurationHandle
; // configuration handle
61 PUSBD_INTERFACE_LIST_ENTRY InterfaceList
; // interface list
62 ULONG InterfaceListCount
; // interface list count
63 PFDO_DEVICE_EXTENSION FDODeviceExtension
; // pointer to fdo's pdo list
64 }PDO_DEVICE_EXTENSION
, *PPDO_DEVICE_EXTENSION
;
69 USBCCGP_GetDescriptors(
70 IN PDEVICE_OBJECT DeviceObject
);
73 USBCCGP_SelectConfiguration(
74 IN PDEVICE_OBJECT DeviceObject
,
75 IN PFDO_DEVICE_EXTENSION DeviceExtension
);
79 USBCCGP_GetDescriptor(
80 IN PDEVICE_OBJECT DeviceObject
,
81 IN UCHAR DescriptorType
,
82 IN ULONG DescriptorLength
,
83 IN UCHAR DescriptorIndex
,
85 OUT PVOID
*OutDescriptor
);
89 USBCCGP_GetStringDescriptor(
90 IN PDEVICE_OBJECT DeviceObject
,
91 IN ULONG DescriptorLength
,
92 IN UCHAR DescriptorIndex
,
94 OUT PVOID
*OutDescriptor
);
97 CountInterfaceDescriptors(
98 IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
);
101 AllocateInterfaceDescriptorsArray(
102 IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
,
103 OUT PUSB_INTERFACE_DESCRIPTOR
**OutArray
);
109 USBCCGP_SyncForwardIrp(
110 PDEVICE_OBJECT DeviceObject
,
114 USBCCGP_SyncUrbRequest(
115 IN PDEVICE_OBJECT DeviceObject
,
116 OUT PURB UrbRequest
);
120 IN POOL_TYPE PoolType
,
128 DumpFunctionDescriptor(
129 IN PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor
,
130 IN ULONG FunctionDescriptorCount
);
136 PDEVICE_OBJECT DeviceObject
,
143 PDEVICE_OBJECT DeviceObject
,
149 USBCCGP_QueryInterface(
150 IN PDEVICE_OBJECT DeviceObject
,
151 OUT PUSBC_DEVICE_CONFIGURATION_INTERFACE_V1 BusInterface
);
154 USBCCGP_EnumerateFunctions(
155 IN PDEVICE_OBJECT DeviceObject
);