[USBCCGP]
[reactos.git] / drivers / usb / usbccgp / usbccgp.h
1 #ifndef USBEHCI_H__
2 #define USBEHCI_H__
3
4 #include <ntddk.h>
5 #define YDEBUG
6 #include <debug.h>
7 #include <initguid.h>
8 #include <hubbusif.h>
9 #include <usbbusif.h>
10 #include <usbioctl.h>
11 #include <usbdlib.h>
12
13 //
14 // FIXME:
15 // #include <usbprotocoldefs.h>
16 //
17 #include <usb.h>
18 #include <stdio.h>
19 #include <wdmguid.h>
20
21 typedef struct
22 {
23 BOOLEAN IsFDO; // is device a FDO or PDO
24 }COMMON_DEVICE_EXTENSION, *PCOMMON_DEVICE_EXTENSION;
25
26 typedef struct
27 {
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 }FDO_DEVICE_EXTENSION, *PFDO_DEVICE_EXTENSION;
43
44 #define USBCCPG_TAG 'cbsu'
45
46 typedef struct
47 {
48 COMMON_DEVICE_EXTENSION Common; // shared with FDO
49 PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor; // function descriptor
50 PDEVICE_OBJECT NextDeviceObject; // next device object
51 DEVICE_CAPABILITIES Capabilities; // device capabilities
52 ULONG FunctionIndex; // function index
53 }PDO_DEVICE_EXTENSION, *PPDO_DEVICE_EXTENSION;
54
55 /* descriptor.c */
56
57 NTSTATUS
58 USBCCGP_GetDescriptors(
59 IN PDEVICE_OBJECT DeviceObject);
60
61 NTSTATUS
62 USBCCGP_SelectConfiguration(
63 IN PDEVICE_OBJECT DeviceObject,
64 IN PFDO_DEVICE_EXTENSION DeviceExtension);
65
66 NTSTATUS
67 NTAPI
68 USBCCGP_GetDescriptor(
69 IN PDEVICE_OBJECT DeviceObject,
70 IN UCHAR DescriptorType,
71 IN ULONG DescriptorLength,
72 IN UCHAR DescriptorIndex,
73 IN LANGID LanguageId,
74 OUT PVOID *OutDescriptor);
75
76 /* misc.c */
77
78 NTSTATUS
79 NTAPI
80 USBCCGP_SyncForwardIrp(
81 PDEVICE_OBJECT DeviceObject,
82 PIRP Irp);
83
84 NTSTATUS
85 USBCCGP_SyncUrbRequest(
86 IN PDEVICE_OBJECT DeviceObject,
87 OUT PURB UrbRequest);
88
89 PVOID
90 AllocateItem(
91 IN POOL_TYPE PoolType,
92 IN ULONG ItemSize);
93
94 VOID
95 FreeItem(
96 IN PVOID Item);
97
98 /* fdo.c */
99
100 NTSTATUS
101 FDO_Dispatch(
102 PDEVICE_OBJECT DeviceObject,
103 PIRP Irp);
104
105 /* pdo.c */
106
107 NTSTATUS
108 PDO_Dispatch(
109 PDEVICE_OBJECT DeviceObject,
110 PIRP Irp);
111
112 /* function.c */
113
114 NTSTATUS
115 USBCCGP_QueryInterface(
116 IN PDEVICE_OBJECT DeviceObject,
117 OUT PUSBC_DEVICE_CONFIGURATION_INTERFACE_V1 BusInterface);
118
119 NTSTATUS
120 USBCCGP_EnumerateFunctions(
121 IN PDEVICE_OBJECT DeviceObject);
122
123 #endif