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
);
88 CountInterfaceDescriptors(
89 IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
);
92 AllocateInterfaceDescriptorsArray(
93 IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
,
94 OUT PUSB_INTERFACE_DESCRIPTOR
**OutArray
);
100 USBCCGP_SyncForwardIrp(
101 PDEVICE_OBJECT DeviceObject
,
105 USBCCGP_SyncUrbRequest(
106 IN PDEVICE_OBJECT DeviceObject
,
107 OUT PURB UrbRequest
);
111 IN POOL_TYPE PoolType
,
119 DumpFunctionDescriptor(
120 IN PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor
,
121 IN ULONG FunctionDescriptorCount
);
127 PDEVICE_OBJECT DeviceObject
,
134 PDEVICE_OBJECT DeviceObject
,
140 USBCCGP_QueryInterface(
141 IN PDEVICE_OBJECT DeviceObject
,
142 OUT PUSBC_DEVICE_CONFIGURATION_INTERFACE_V1 BusInterface
);
145 USBCCGP_EnumerateFunctions(
146 IN PDEVICE_OBJECT DeviceObject
);