Sync with trunk (r48123)
[reactos.git] / drivers / usb / usbhub / usbhub.h
1 #include <debug.h>
2
3 #include <ntddk.h>
4 #include <usbioctl.h>
5
6 #include "../miniport/usb_wrapper.h"
7 #include "../usbport/hub.h"
8
9 #define USB_HUB_TAG 'hbsu'
10
11 typedef struct _HUB_DEVICE_EXTENSION
12 {
13 BOOLEAN IsFDO;
14 struct usb_device* dev;
15 PDEVICE_OBJECT LowerDevice;
16
17 PDEVICE_OBJECT Children[USB_MAXCHILDREN];
18
19 /* Fields valid only when IsFDO == FALSE */
20 UNICODE_STRING DeviceId; // REG_SZ
21 UNICODE_STRING InstanceId; // REG_SZ
22 UNICODE_STRING HardwareIds; // REG_MULTI_SZ
23 UNICODE_STRING CompatibleIds; // REG_MULTI_SZ
24 UNICODE_STRING SymbolicLinkName;
25 } HUB_DEVICE_EXTENSION, *PHUB_DEVICE_EXTENSION;
26
27 /* createclose.c */
28 NTSTATUS NTAPI
29 UsbhubCreate(
30 IN PDEVICE_OBJECT DeviceObject,
31 IN PIRP Irp);
32
33 NTSTATUS NTAPI
34 UsbhubClose(
35 IN PDEVICE_OBJECT DeviceObject,
36 IN PIRP Irp);
37
38 NTSTATUS NTAPI
39 UsbhubCleanup(
40 IN PDEVICE_OBJECT DeviceObject,
41 IN PIRP Irp);
42
43 /* fdo.c */
44 NTSTATUS NTAPI
45 UsbhubPnpFdo(
46 IN PDEVICE_OBJECT DeviceObject,
47 IN PIRP Irp);
48
49 NTSTATUS
50 UsbhubDeviceControlFdo(
51 IN PDEVICE_OBJECT DeviceObject,
52 IN PIRP Irp);
53
54 /* misc.c */
55 NTSTATUS
56 ForwardIrpAndWait(
57 IN PDEVICE_OBJECT DeviceObject,
58 IN PIRP Irp);
59
60 NTSTATUS NTAPI
61 ForwardIrpAndForget(
62 IN PDEVICE_OBJECT DeviceObject,
63 IN PIRP Irp);
64
65 NTSTATUS
66 UsbhubDuplicateUnicodeString(
67 OUT PUNICODE_STRING Destination,
68 IN PUNICODE_STRING Source,
69 IN POOL_TYPE PoolType);
70
71 NTSTATUS
72 UsbhubInitMultiSzString(
73 OUT PUNICODE_STRING Destination,
74 ... /* list of PCSZ */);
75
76 /* pdo.c */
77 NTSTATUS NTAPI
78 UsbhubPnpPdo(
79 IN PDEVICE_OBJECT DeviceObject,
80 IN PIRP Irp);
81
82 NTSTATUS
83 UsbhubInternalDeviceControlPdo(
84 IN PDEVICE_OBJECT DeviceObject,
85 IN PIRP Irp);