ReactOS  0.4.14-dev-606-g14ebc0b
usbccgp.h
Go to the documentation of this file.
1 #ifndef USBEHCI_H__
2 #define USBEHCI_H__
3 
4 #include <wdm.h>
5 #include <hubbusif.h>
6 #include <usbbusif.h>
7 #include <usbdlib.h>
8 
9 #include <stdio.h>
10 
11 typedef struct
12 {
13  BOOLEAN IsFDO; // is device a FDO or PDO
15 
16 typedef struct
17 {
18  COMMON_DEVICE_EXTENSION Common; // shared with PDO
19  PDRIVER_OBJECT DriverObject; // driver object
20  PDEVICE_OBJECT PhysicalDeviceObject; // physical device object
21  PDEVICE_OBJECT NextDeviceObject; // lower device object
22  PUSB_DEVICE_DESCRIPTOR DeviceDescriptor; // usb device descriptor
23  PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor; // usb configuration descriptor
24  DEVICE_CAPABILITIES Capabilities; // device capabilities
26  ULONG InterfaceListCount; // interface list count
28  USBC_DEVICE_CONFIGURATION_INTERFACE_V1 BusInterface; // bus custom enumeration interface
29  PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor; // usb function descriptor
30  ULONG FunctionDescriptorCount; // number of function descriptor
31  PDEVICE_OBJECT * ChildPDO; // child pdos
32  LIST_ENTRY ResetPortListHead; // reset port list head
33  LIST_ENTRY CyclePortListHead; // cycle port list head
34  UCHAR ResetPortActive; // reset port active
35  UCHAR CyclePortActive; // cycle port active
36  KSPIN_LOCK Lock; // reset / cycle port list lock
38 
39 #define USBCCPG_TAG 'cbsu'
40 
41 typedef struct
42 {
43  COMMON_DEVICE_EXTENSION Common; // shared with FDO
45  PDEVICE_OBJECT NextDeviceObject; // next device object
46  DEVICE_CAPABILITIES Capabilities; // device capabilities
47  ULONG FunctionIndex; // function index
48  USB_DEVICE_DESCRIPTOR DeviceDescriptor; // usb device descriptor
49  PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor; // usb configuration descriptor
52  ULONG InterfaceListCount; // interface list count
53  PFDO_DEVICE_EXTENSION FDODeviceExtension; // pointer to fdo's pdo list
55 
56 /* descriptor.c */
57 
58 VOID
60  IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor);
61 
65 
69  IN PFDO_DEVICE_EXTENSION DeviceExtension);
70 
72 NTAPI
76  IN ULONG DescriptorLength,
77  IN UCHAR DescriptorIndex,
78  IN LANGID LanguageId,
79  OUT PVOID *OutDescriptor);
80 
82 NTAPI
85  IN ULONG DescriptorLength,
86  IN UCHAR DescriptorIndex,
87  IN LANGID LanguageId,
88  OUT PVOID *OutDescriptor);
89 
90 ULONG
92  IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor);
93 
96  IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
97  OUT PUSB_INTERFACE_DESCRIPTOR **OutArray);
98 
99 /* misc.c */
100 
101 NTSTATUS
102 NTAPI
105  PIRP Irp);
106 
107 NTSTATUS
110  OUT PURB UrbRequest);
111 
112 PVOID
115  IN ULONG ItemSize);
116 
117 VOID
118 FreeItem(
119  IN PVOID Item);
120 
121 VOID
123  IN PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor,
124  IN ULONG FunctionDescriptorCount);
125 
126 /* fdo.c */
127 
128 NTSTATUS
131  PIRP Irp);
132 
133 /* pdo.c */
134 
135 NTSTATUS
138  PIRP Irp);
139 
140 /* function.c */
141 
142 NTSTATUS
146 
147 NTSTATUS
150 
151 #endif /* USBEHCI_H__ */
NTSTATUS USBCCGP_EnumerateFunctions(IN PDEVICE_OBJECT DeviceObject)
Definition: function.c:829
PDEVICE_OBJECT NextDeviceObject
Definition: usbccgp.h:45
struct COMMON_DEVICE_EXTENSION * PCOMMON_DEVICE_EXTENSION
#define IN
Definition: typedefs.h:38
NTSTATUS NTAPI USBCCGP_GetStringDescriptor(IN PDEVICE_OBJECT DeviceObject, IN ULONG DescriptorLength, IN UCHAR DescriptorIndex, IN LANGID LanguageId, OUT PVOID *OutDescriptor)
Definition: descriptor.c:102
PDEVICE_OBJECT NextDeviceObject
Definition: usbccgp.h:21
PDEVICE_OBJECT PhysicalDeviceObject
Definition: usbccgp.h:20
struct _COMMON_DEVICE_EXTENSION COMMON_DEVICE_EXTENSION
ULONG InterfaceListCount
Definition: usbccgp.h:52
_In_ PIRP Irp
Definition: csq.h:116
LONG NTSTATUS
Definition: precomp.h:26
DEVICE_CAPABILITIES
Definition: iotypes.h:928
WORD LANGID
Definition: typedefs.h:79
struct PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
PVOID AllocateItem(IN POOL_TYPE PoolType, IN ULONG ItemSize)
Definition: misc.c:30
NTSTATUS USBCCGP_GetDescriptors(IN PDEVICE_OBJECT DeviceObject)
Definition: descriptor.c:160
COMMON_DEVICE_EXTENSION Common
Definition: usbccgp.h:18
PDEVICE_OBJECT * ChildPDO
Definition: usbccgp.h:31
PUSBD_INTERFACE_LIST_ENTRY InterfaceList
Definition: usbccgp.h:51
Definition: usbdlib.h:7
NTSTATUS USBCCGP_SyncUrbRequest(IN PDEVICE_OBJECT DeviceObject, OUT PURB UrbRequest)
Definition: misc.c:75
NTSTATUS NTAPI USBCCGP_GetDescriptor(IN PDEVICE_OBJECT DeviceObject, IN UCHAR DescriptorType, IN ULONG DescriptorLength, IN UCHAR DescriptorIndex, IN LANGID LanguageId, OUT PVOID *OutDescriptor)
Definition: descriptor.c:19
NTSTATUS NTAPI USBCCGP_SyncForwardIrp(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: misc.c:36
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
VOID DumpConfigurationDescriptor(IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor)
USBD_CONFIGURATION_HANDLE ConfigurationHandle
Definition: usbccgp.h:50
unsigned char BOOLEAN
VOID FreeItem(IN PVOID Item)
Definition: misc.c:43
PFDO_DEVICE_EXTENSION FDODeviceExtension
Definition: usbccgp.h:53
NTSTATUS FDO_Dispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: fdo.c:615
PUSBD_INTERFACE_LIST_ENTRY InterfaceList
Definition: usbccgp.h:25
DEVICE_CAPABILITIES Capabilities
Definition: usbccgp.h:24
UCHAR ResetPortActive
Definition: usbccgp.h:34
NTSTATUS AllocateInterfaceDescriptorsArray(IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, OUT PUSB_INTERFACE_DESCRIPTOR **OutArray)
Definition: descriptor.c:227
INT POOL_TYPE
Definition: typedefs.h:76
USB_DEVICE_DESCRIPTOR DeviceDescriptor
Definition: usbccgp.h:48
struct _FDO_DEVICE_EXTENSION FDO_DEVICE_EXTENSION
COMMON_DEVICE_EXTENSION Common
Definition: usbccgp.h:43
VOID DumpFunctionDescriptor(IN PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor, IN ULONG FunctionDescriptorCount)
Definition: misc.c:160
struct FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
unsigned char UCHAR
Definition: xmlstorage.h:181
ULONG CountInterfaceDescriptors(IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor)
Definition: typedefs.h:117
LIST_ENTRY CyclePortListHead
Definition: usbccgp.h:33
static UCHAR ItemSize[4]
Definition: parser.c:16
USBD_CONFIGURATION_HANDLE ConfigurationHandle
Definition: usbccgp.h:27
PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
Definition: usbccgp.h:23
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
struct _PDO_DEVICE_EXTENSION PDO_DEVICE_EXTENSION
NTSTATUS USBCCGP_QueryInterface(IN PDEVICE_OBJECT DeviceObject, OUT PUSBC_DEVICE_CONFIGURATION_INTERFACE_V1 BusInterface)
Definition: function.c:18
Definition: usb.h:529
PDRIVER_OBJECT DriverObject
Definition: usbccgp.h:19
UCHAR CyclePortActive
Definition: usbccgp.h:35
PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
Definition: usbccgp.h:49
ULONG FunctionDescriptorCount
Definition: usbccgp.h:30
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
LIST_ENTRY ResetPortListHead
Definition: usbccgp.h:32
NTSTATUS USBCCGP_SelectConfiguration(IN PDEVICE_OBJECT DeviceObject, IN PFDO_DEVICE_EXTENSION DeviceExtension)
Definition: descriptor.c:467
KSPIN_LOCK Lock
Definition: usbccgp.h:36
#define OUT
Definition: typedefs.h:39
NTSTATUS PDO_Dispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: pdo.c:1075
unsigned int ULONG
Definition: retypes.h:1
ULONG InterfaceListCount
Definition: usbccgp.h:26
DEVICE_CAPABILITIES Capabilities
Definition: usbccgp.h:46
USBC_DEVICE_CONFIGURATION_INTERFACE_V1 BusInterface
Definition: usbccgp.h:28
_Must_inspect_result_ _In_ FLT_CONTEXT_TYPE _In_ SIZE_T _In_ POOL_TYPE PoolType
Definition: fltkernel.h:1444
_In_ ULONG _In_ PVOID _In_ LONG DescriptorType
Definition: usbdlib.h:145
PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor
Definition: usbccgp.h:44
PUSB_DEVICE_DESCRIPTOR DeviceDescriptor
Definition: usbccgp.h:22
PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor
Definition: usbccgp.h:29