ReactOS 0.4.16-dev-125-g798ea90
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
11typedef struct
12{
13 BOOLEAN IsFDO; // is device a FDO or PDO
15
16typedef 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
24 DEVICE_CAPABILITIES Capabilities; // device capabilities
26 ULONG InterfaceListCount; // interface list count
28 USBC_DEVICE_CONFIGURATION_INTERFACE_V1 BusInterface; // bus custom enumeration interface
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
41typedef 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
52 ULONG InterfaceListCount; // interface list count
53 PFDO_DEVICE_EXTENSION FDODeviceExtension; // pointer to fdo's pdo list
55
56/* descriptor.c */
57
58VOID
60 IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor);
61
65
69 IN PFDO_DEVICE_EXTENSION DeviceExtension);
70
76 IN ULONG DescriptorLength,
77 IN UCHAR DescriptorIndex,
78 IN LANGID LanguageId,
79 OUT PVOID *OutDescriptor);
80
85 IN ULONG DescriptorLength,
86 IN UCHAR DescriptorIndex,
87 IN LANGID LanguageId,
88 OUT PVOID *OutDescriptor);
89
92 IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor);
93
96 IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
98
99/* misc.c */
100
104 OUT PURB UrbRequest);
105
106PVOID
110
111VOID
113 IN PVOID Item);
114
115VOID
117 IN PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor,
118 IN ULONG FunctionDescriptorCount);
119
120/* fdo.c */
121
125 PIRP Irp);
126
127/* pdo.c */
128
132 PIRP Irp);
133
134/* function.c */
135
140
144
145#endif /* USBEHCI_H__ */
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
_In_ PIRP Irp
Definition: csq.h:116
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
USHORT LANGID
Definition: mui.h:9
static UCHAR ItemSize[4]
Definition: parser.c:16
DEVICE_CAPABILITIES Capabilities
Definition: usbccgp.h:24
COMMON_DEVICE_EXTENSION Common
Definition: usbccgp.h:18
ULONG InterfaceListCount
Definition: usbccgp.h:26
UCHAR CyclePortActive
Definition: usbccgp.h:35
UCHAR ResetPortActive
Definition: usbccgp.h:34
PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor
Definition: usbccgp.h:29
LIST_ENTRY ResetPortListHead
Definition: usbccgp.h:32
PDRIVER_OBJECT DriverObject
Definition: usbccgp.h:19
ULONG FunctionDescriptorCount
Definition: usbccgp.h:30
PUSB_DEVICE_DESCRIPTOR DeviceDescriptor
Definition: usbccgp.h:22
USBD_CONFIGURATION_HANDLE ConfigurationHandle
Definition: usbccgp.h:27
PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
Definition: usbccgp.h:23
PDEVICE_OBJECT PhysicalDeviceObject
Definition: usbccgp.h:20
PDEVICE_OBJECT NextDeviceObject
Definition: usbccgp.h:21
USBC_DEVICE_CONFIGURATION_INTERFACE_V1 BusInterface
Definition: usbccgp.h:28
PUSBD_INTERFACE_LIST_ENTRY InterfaceList
Definition: usbccgp.h:25
PDEVICE_OBJECT * ChildPDO
Definition: usbccgp.h:31
LIST_ENTRY CyclePortListHead
Definition: usbccgp.h:33
KSPIN_LOCK Lock
Definition: usbccgp.h:36
PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor
Definition: usbccgp.h:44
ULONG InterfaceListCount
Definition: usbccgp.h:52
USB_DEVICE_DESCRIPTOR DeviceDescriptor
Definition: usbccgp.h:48
DEVICE_CAPABILITIES Capabilities
Definition: usbccgp.h:46
PFDO_DEVICE_EXTENSION FDODeviceExtension
Definition: usbccgp.h:53
PUSBD_INTERFACE_LIST_ENTRY InterfaceList
Definition: usbccgp.h:51
PDEVICE_OBJECT NextDeviceObject
Definition: usbccgp.h:45
PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
Definition: usbccgp.h:49
COMMON_DEVICE_EXTENSION Common
Definition: usbccgp.h:43
USBD_CONFIGURATION_HANDLE ConfigurationHandle
Definition: usbccgp.h:50
Definition: typedefs.h:120
Definition: usb.h:529
Definition: usbdlib.h:7
INT POOL_TYPE
Definition: typedefs.h:78
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
struct PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
NTSTATUS USBCCGP_SelectConfiguration(IN PDEVICE_OBJECT DeviceObject, IN PFDO_DEVICE_EXTENSION DeviceExtension)
Definition: descriptor.c:467
NTSTATUS NTAPI USBCCGP_GetStringDescriptor(IN PDEVICE_OBJECT DeviceObject, IN ULONG DescriptorLength, IN UCHAR DescriptorIndex, IN LANGID LanguageId, OUT PVOID *OutDescriptor)
Definition: descriptor.c:102
NTSTATUS FDO_Dispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: fdo.c:633
NTSTATUS USBCCGP_EnumerateFunctions(IN PDEVICE_OBJECT DeviceObject)
Definition: function.c:829
struct FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
NTSTATUS USBCCGP_SyncUrbRequest(IN PDEVICE_OBJECT DeviceObject, OUT PURB UrbRequest)
Definition: misc.c:35
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
VOID DumpConfigurationDescriptor(IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor)
NTSTATUS AllocateInterfaceDescriptorsArray(IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, OUT PUSB_INTERFACE_DESCRIPTOR **OutArray)
Definition: descriptor.c:227
NTSTATUS PDO_Dispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: pdo.c:1125
PVOID AllocateItem(IN POOL_TYPE PoolType, IN ULONG ItemSize)
Definition: misc.c:29
VOID DumpFunctionDescriptor(IN PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor, IN ULONG FunctionDescriptorCount)
Definition: misc.c:111
NTSTATUS USBCCGP_GetDescriptors(IN PDEVICE_OBJECT DeviceObject)
Definition: descriptor.c:160
struct COMMON_DEVICE_EXTENSION * PCOMMON_DEVICE_EXTENSION
VOID FreeItem(IN PVOID Item)
Definition: misc.c:37
NTSTATUS USBCCGP_QueryInterface(IN PDEVICE_OBJECT DeviceObject, OUT PUSBC_DEVICE_CONFIGURATION_INTERFACE_V1 BusInterface)
Definition: function.c:18
ULONG CountInterfaceDescriptors(IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor)
_In_ ULONG _In_ PVOID _In_ LONG DescriptorType
Definition: usbdlib.h:160
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3815
DEVICE_CAPABILITIES
Definition: iotypes.h:965
unsigned char UCHAR
Definition: xmlstorage.h:181