1 | /* $Id: VBoxUsbRt.h 60498 2016-04-14 15:23:51Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox USB R0 runtime
|
---|
4 | */
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2011-2015 Oracle Corporation
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | * General Public License (GPL) as published by the Free Software
|
---|
12 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
13 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
14 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 | */
|
---|
16 | #ifndef ___VBoxUsbRt_h___
|
---|
17 | #define ___VBoxUsbRt_h___
|
---|
18 |
|
---|
19 | #include "VBoxUsbCmn.h"
|
---|
20 | #include "../cmn/VBoxUsbIdc.h"
|
---|
21 |
|
---|
22 | #define VBOXUSBRT_MAX_CFGS 4
|
---|
23 |
|
---|
24 | typedef struct VBOXUSB_PIPE_INFO {
|
---|
25 | UCHAR EndpointAddress;
|
---|
26 | ULONG NextScheduledFrame;
|
---|
27 | } VBOXUSB_PIPE_INFO;
|
---|
28 |
|
---|
29 | typedef struct VBOXUSB_IFACE_INFO {
|
---|
30 | USBD_INTERFACE_INFORMATION *pInterfaceInfo;
|
---|
31 | VBOXUSB_PIPE_INFO *pPipeInfo;
|
---|
32 | } VBOXUSB_IFACE_INFO;
|
---|
33 |
|
---|
34 | typedef struct VBOXUSB_RT
|
---|
35 | {
|
---|
36 | UNICODE_STRING IfName;
|
---|
37 |
|
---|
38 | HANDLE hPipe0;
|
---|
39 | HANDLE hConfiguration;
|
---|
40 | uint32_t uConfigValue;
|
---|
41 |
|
---|
42 | uint32_t uNumInterfaces;
|
---|
43 | USB_DEVICE_DESCRIPTOR *devdescr;
|
---|
44 | USB_CONFIGURATION_DESCRIPTOR *cfgdescr[VBOXUSBRT_MAX_CFGS];
|
---|
45 |
|
---|
46 | VBOXUSB_IFACE_INFO *pVBIfaceInfo;
|
---|
47 |
|
---|
48 | uint16_t idVendor, idProduct, bcdDevice;
|
---|
49 | char szSerial[MAX_USB_SERIAL_STRING];
|
---|
50 | BOOLEAN fIsHighSpeed;
|
---|
51 |
|
---|
52 | HVBOXUSBIDCDEV hMonDev;
|
---|
53 | PFILE_OBJECT pOwner;
|
---|
54 | } VBOXUSB_RT, *PVBOXUSB_RT;
|
---|
55 |
|
---|
56 | typedef struct VBOXUSBRT_IDC
|
---|
57 | {
|
---|
58 | PDEVICE_OBJECT pDevice;
|
---|
59 | PFILE_OBJECT pFile;
|
---|
60 | } VBOXUSBRT_IDC, *PVBOXUSBRT_IDC;
|
---|
61 |
|
---|
62 | DECLHIDDEN(NTSTATUS) vboxUsbRtGlobalsInit();
|
---|
63 | DECLHIDDEN(VOID) vboxUsbRtGlobalsTerm();
|
---|
64 |
|
---|
65 | DECLHIDDEN(NTSTATUS) vboxUsbRtInit(PVBOXUSBDEV_EXT pDevExt);
|
---|
66 | DECLHIDDEN(VOID) vboxUsbRtClear(PVBOXUSBDEV_EXT pDevExt);
|
---|
67 | DECLHIDDEN(NTSTATUS) vboxUsbRtRm(PVBOXUSBDEV_EXT pDevExt);
|
---|
68 | DECLHIDDEN(NTSTATUS) vboxUsbRtStart(PVBOXUSBDEV_EXT pDevExt);
|
---|
69 |
|
---|
70 | DECLHIDDEN(NTSTATUS) vboxUsbRtDispatch(PVBOXUSBDEV_EXT pDevExt, PIRP pIrp);
|
---|
71 | DECLHIDDEN(NTSTATUS) vboxUsbRtCreate(PVBOXUSBDEV_EXT pDevExt, PIRP pIrp);
|
---|
72 | DECLHIDDEN(NTSTATUS) vboxUsbRtClose(PVBOXUSBDEV_EXT pDevExt, PIRP pIrp);
|
---|
73 |
|
---|
74 | #endif /* #ifndef ___VBoxUsbRt_h___ */
|
---|