[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 }FDO_DEVICE_EXTENSION, *PFDO_DEVICE_EXTENSION;
42
43 #define USBCCPG_TAG 'cbsu'
44
45 typedef struct
46 {
47 COMMON_DEVICE_EXTENSION Common; // shared with FDO
48
49 }PDO_DEVICE_EXTENSION, *PPDO_DEVICE_EXTENSION;
50
51 /* descriptor.c */
52
53 NTSTATUS
54 USBCCGP_GetDescriptors(
55 IN PDEVICE_OBJECT DeviceObject);
56
57 NTSTATUS
58 USBCCGP_SelectConfiguration(
59 IN PDEVICE_OBJECT DeviceObject,
60 IN PFDO_DEVICE_EXTENSION DeviceExtension);
61
62 NTSTATUS
63 NTAPI
64 USBCCGP_GetDescriptor(
65 IN PDEVICE_OBJECT DeviceObject,
66 IN UCHAR DescriptorType,
67 IN ULONG DescriptorLength,
68 IN UCHAR DescriptorIndex,
69 IN LANGID LanguageId,
70 OUT PVOID *OutDescriptor);
71
72 /* misc.c */
73
74 NTSTATUS
75 NTAPI
76 USBCCGP_SyncForwardIrp(
77 PDEVICE_OBJECT DeviceObject,
78 PIRP Irp);
79
80 NTSTATUS
81 USBCCGP_SyncUrbRequest(
82 IN PDEVICE_OBJECT DeviceObject,
83 OUT PURB UrbRequest);
84
85 PVOID
86 AllocateItem(
87 IN POOL_TYPE PoolType,
88 IN ULONG ItemSize);
89
90 VOID
91 FreeItem(
92 IN PVOID Item);
93
94 /* fdo.c */
95
96 NTSTATUS
97 FDO_Dispatch(
98 PDEVICE_OBJECT DeviceObject,
99 PIRP Irp);
100
101 /* pdo.c */
102
103 NTSTATUS
104 PDO_Dispatch(
105 PDEVICE_OBJECT DeviceObject,
106 PIRP Irp);
107
108 /* function.c */
109
110 NTSTATUS
111 USBCCGP_QueryInterface(
112 IN PDEVICE_OBJECT DeviceObject,
113 OUT PUSBC_DEVICE_CONFIGURATION_INTERFACE_V1 BusInterface);
114
115 NTSTATUS
116 USBCCGP_EnumerateFunctions(
117 IN PDEVICE_OBJECT DeviceObject);
118
119 #endif