620a1066e6b65b1270ae409d9d50fe2f38b6ebf4
[reactos.git] / reactos / lib / drivers / libusb / libusb.h
1 #ifndef LIBUSB_H__
2 #define LIBUSB_H__
3
4 #include <ntddk.h>
5 #define NDEBUG
6 #include <debug.h>
7 #include <hubbusif.h>
8 #include <usbbusif.h>
9 #include <usbioctl.h>
10
11 extern "C"
12 {
13 #include <usbdlib.h>
14 }
15
16
17 //
18 // FIXME:
19 // #include <usbprotocoldefs.h>
20 //
21 #include <usb.h>
22 #include <stdio.h>
23 #include <wdmguid.h>
24
25 //
26 // FIXME:
27 // the following includes are required to get kcom to compile
28 //
29 #include <portcls.h>
30 #include <dmusicks.h>
31 #include <kcom.h>
32
33 #include "common_interfaces.h"
34
35 //
36 // flags for handling USB_REQUEST_SET_FEATURE / USB_REQUEST_GET_FEATURE
37 //
38 #define PORT_ENABLE 1
39 #define PORT_SUSPEND 2
40 #define PORT_OVER_CURRENT 3
41 #define PORT_RESET 4
42 #define PORT_POWER 8
43 #define C_PORT_CONNECTION 16
44 #define C_PORT_ENABLE 17
45 #define C_PORT_SUSPEND 18
46 #define C_PORT_OVER_CURRENT 19
47 #define C_PORT_RESET 20
48
49 typedef struct
50 {
51 BOOLEAN IsFDO; // is device a FDO or PDO
52 BOOLEAN IsHub; // is device a hub / child - not yet used
53 PDISPATCHIRP Dispatcher; // dispatches the code
54 }COMMON_DEVICE_EXTENSION, *PCOMMON_DEVICE_EXTENSION;
55
56 //
57 // tag for allocations
58 //
59 #define TAG_USBLIB 'LBSU'
60
61 //
62 // assert for c++ - taken from portcls
63 //
64 #define PC_ASSERT(exp) \
65 (VOID)((!(exp)) ? \
66 RtlAssert((PVOID) #exp, (PVOID)__FILE__, __LINE__, NULL ), FALSE : TRUE)
67
68 // hcd_controller.cpp
69 NTSTATUS CreateHCDController(PHCDCONTROLLER *HcdController);
70
71 // hardware.cpp
72 NTSTATUS CreateUSBHardware(PUSBHARDWAREDEVICE *OutHardware);
73
74 // misc.cpp
75 NTSTATUS NTAPI SyncForwardIrp(PDEVICE_OBJECT DeviceObject, PIRP Irp);
76 NTSTATUS NTAPI GetBusInterface(PDEVICE_OBJECT DeviceObject, PBUS_INTERFACE_STANDARD busInterface);
77
78 // root_hub_controller.cpp
79 NTSTATUS CreateHubController(PHUBCONTROLLER * OutHubController);
80
81 // memory_manager.cpp
82 NTSTATUS CreateDMAMemoryManager(PDMAMEMORYMANAGER *OutMemoryManager);
83
84
85 // usb_device.cpp
86 NTSTATUS CreateUSBDevice(PUSBDEVICE *OutDevice);
87
88 // usb_queue.cpp
89 NTSTATUS CreateUSBQueue(PUSBQUEUE *OutUsbQueue);
90
91 // usb_request.cpp
92 NTSTATUS InternalCreateUSBRequest(PUSBREQUEST *OutRequest);
93
94 // libusb.cpp
95 NTSTATUS NTAPI USBLIB_AddDevice(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT PhysicalDeviceObject);
96 NTSTATUS NTAPI USBLIB_Dispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp);
97
98
99
100 #endif