[SYSSETUP][INF] Add lockout setup to the security profile
[reactos.git] / drivers / usb / usbccgp / usbccgp.h
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
14 }COMMON_DEVICE_EXTENSION, *PCOMMON_DEVICE_EXTENSION;
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
25 PUSBD_INTERFACE_LIST_ENTRY InterfaceList; // interface list
26 ULONG InterfaceListCount; // interface list count
27 USBD_CONFIGURATION_HANDLE ConfigurationHandle; // configuration handle
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
37 }FDO_DEVICE_EXTENSION, *PFDO_DEVICE_EXTENSION;
38
39 #define USBCCPG_TAG 'cbsu'
40
41 typedef struct
42 {
43 COMMON_DEVICE_EXTENSION Common; // shared with FDO
44 PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor; // function descriptor
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
50 USBD_CONFIGURATION_HANDLE ConfigurationHandle; // configuration handle
51 PUSBD_INTERFACE_LIST_ENTRY InterfaceList; // interface list
52 ULONG InterfaceListCount; // interface list count
53 PFDO_DEVICE_EXTENSION FDODeviceExtension; // pointer to fdo's pdo list
54 }PDO_DEVICE_EXTENSION, *PPDO_DEVICE_EXTENSION;
55
56 /* descriptor.c */
57
58 VOID
59 DumpConfigurationDescriptor(
60 IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor);
61
62 NTSTATUS
63 USBCCGP_GetDescriptors(
64 IN PDEVICE_OBJECT DeviceObject);
65
66 NTSTATUS
67 USBCCGP_SelectConfiguration(
68 IN PDEVICE_OBJECT DeviceObject,
69 IN PFDO_DEVICE_EXTENSION DeviceExtension);
70
71 NTSTATUS
72 NTAPI
73 USBCCGP_GetDescriptor(
74 IN PDEVICE_OBJECT DeviceObject,
75 IN UCHAR DescriptorType,
76 IN ULONG DescriptorLength,
77 IN UCHAR DescriptorIndex,
78 IN LANGID LanguageId,
79 OUT PVOID *OutDescriptor);
80
81 NTSTATUS
82 NTAPI
83 USBCCGP_GetStringDescriptor(
84 IN PDEVICE_OBJECT DeviceObject,
85 IN ULONG DescriptorLength,
86 IN UCHAR DescriptorIndex,
87 IN LANGID LanguageId,
88 OUT PVOID *OutDescriptor);
89
90 ULONG
91 CountInterfaceDescriptors(
92 IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor);
93
94 NTSTATUS
95 AllocateInterfaceDescriptorsArray(
96 IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
97 OUT PUSB_INTERFACE_DESCRIPTOR **OutArray);
98
99 /* misc.c */
100
101 NTSTATUS
102 NTAPI
103 USBCCGP_SyncForwardIrp(
104 PDEVICE_OBJECT DeviceObject,
105 PIRP Irp);
106
107 NTSTATUS
108 USBCCGP_SyncUrbRequest(
109 IN PDEVICE_OBJECT DeviceObject,
110 OUT PURB UrbRequest);
111
112 PVOID
113 AllocateItem(
114 IN POOL_TYPE PoolType,
115 IN ULONG ItemSize);
116
117 VOID
118 FreeItem(
119 IN PVOID Item);
120
121 VOID
122 DumpFunctionDescriptor(
123 IN PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor,
124 IN ULONG FunctionDescriptorCount);
125
126 /* fdo.c */
127
128 NTSTATUS
129 FDO_Dispatch(
130 PDEVICE_OBJECT DeviceObject,
131 PIRP Irp);
132
133 /* pdo.c */
134
135 NTSTATUS
136 PDO_Dispatch(
137 PDEVICE_OBJECT DeviceObject,
138 PIRP Irp);
139
140 /* function.c */
141
142 NTSTATUS
143 USBCCGP_QueryInterface(
144 IN PDEVICE_OBJECT DeviceObject,
145 OUT PUSBC_DEVICE_CONFIGURATION_INTERFACE_V1 BusInterface);
146
147 NTSTATUS
148 USBCCGP_EnumerateFunctions(
149 IN PDEVICE_OBJECT DeviceObject);
150
151 #endif /* USBEHCI_H__ */