1 | /* $Id: UsbTestServiceGadgetInternal.h 82968 2020-02-04 10:35:17Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * UsbTestServ - Remote USB test configuration and execution server, Interal gadget interfaces.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2016-2020 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | *
|
---|
17 | * The contents of this file may alternatively be used under the terms
|
---|
18 | * of the Common Development and Distribution License Version 1.0
|
---|
19 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
20 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
21 | * CDDL are applicable instead of those of the GPL.
|
---|
22 | *
|
---|
23 | * You may elect to license modified versions of this file under the
|
---|
24 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
25 | */
|
---|
26 |
|
---|
27 | #ifndef VBOX_INCLUDED_SRC_usb_UsbTestServiceGadgetInternal_h
|
---|
28 | #define VBOX_INCLUDED_SRC_usb_UsbTestServiceGadgetInternal_h
|
---|
29 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
30 | # pragma once
|
---|
31 | #endif
|
---|
32 |
|
---|
33 | #include <iprt/cdefs.h>
|
---|
34 | #include <iprt/types.h>
|
---|
35 |
|
---|
36 | #include "UsbTestServiceGadget.h"
|
---|
37 |
|
---|
38 | RT_C_DECLS_BEGIN
|
---|
39 |
|
---|
40 | /** Pointer to an opaque type dependent gadget host instance data. */
|
---|
41 | typedef struct UTSGADGETCLASSINT *PUTSGADGETCLASSINT;
|
---|
42 | /** Pointer to a gadget host instance pointer. */
|
---|
43 | typedef PUTSGADGETCLASSINT *PPUTSGADGETCLASSINT;
|
---|
44 |
|
---|
45 | /**
|
---|
46 | * Gadget class interface.
|
---|
47 | */
|
---|
48 | typedef struct UTSGADGETCLASSIF
|
---|
49 | {
|
---|
50 | /** The gadget class type implemented. */
|
---|
51 | UTSGADGETCLASS enmClass;
|
---|
52 | /** Description. */
|
---|
53 | const char *pszDesc;
|
---|
54 | /** Size of the class specific instance data. */
|
---|
55 | size_t cbClass;
|
---|
56 |
|
---|
57 | /**
|
---|
58 | * Initializes the gadget class instance.
|
---|
59 | *
|
---|
60 | * @returns IPRT status code.
|
---|
61 | * @param pClass The interface specific instance data.
|
---|
62 | * @param paCfg The configuration of the interface.
|
---|
63 | */
|
---|
64 | DECLR3CALLBACKMEMBER(int, pfnInit, (PUTSGADGETCLASSINT pClass, PCUTSGADGETCFGITEM paCfg));
|
---|
65 |
|
---|
66 | /**
|
---|
67 | * Terminates the gadget class instance.
|
---|
68 | *
|
---|
69 | * @returns nothing.
|
---|
70 | * @param pClass The interface specific instance data.
|
---|
71 | */
|
---|
72 | DECLR3CALLBACKMEMBER(void, pfnTerm, (PUTSGADGETCLASSINT pClass));
|
---|
73 |
|
---|
74 | /**
|
---|
75 | * Returns the bus ID of the class instance.
|
---|
76 | *
|
---|
77 | * @returns Bus ID.
|
---|
78 | * @param pClass The interface specific instance data.
|
---|
79 | */
|
---|
80 | DECLR3CALLBACKMEMBER(uint32_t, pfnGetBusId, (PUTSGADGETCLASSINT pClass));
|
---|
81 |
|
---|
82 | /**
|
---|
83 | * Connects the gadget.
|
---|
84 | *
|
---|
85 | * @returns IPRT status code.
|
---|
86 | * @param pClass The interface specific instance data.
|
---|
87 | */
|
---|
88 | DECLR3CALLBACKMEMBER(int, pfnConnect, (PUTSGADGETCLASSINT pClass));
|
---|
89 |
|
---|
90 | /**
|
---|
91 | * Disconnect the gadget.
|
---|
92 | *
|
---|
93 | * @returns IPRT status code.
|
---|
94 | * @param pClass The interface specific instance data.
|
---|
95 | */
|
---|
96 | DECLR3CALLBACKMEMBER(int, pfnDisconnect, (PUTSGADGETCLASSINT pClass));
|
---|
97 |
|
---|
98 | } UTSGADGETCLASSIF;
|
---|
99 | /** Pointer to a gadget class callback table. */
|
---|
100 | typedef UTSGADGETCLASSIF *PUTSGADGETCLASSIF;
|
---|
101 | /** Pointer to a const gadget host callback table. */
|
---|
102 | typedef const struct UTSGADGETCLASSIF *PCUTSGADGETCLASSIF;
|
---|
103 |
|
---|
104 | extern UTSGADGETCLASSIF const g_UtsGadgetClassTest;
|
---|
105 |
|
---|
106 | RT_C_DECLS_END
|
---|
107 |
|
---|
108 | #endif /* !VBOX_INCLUDED_SRC_usb_UsbTestServiceGadgetInternal_h */
|
---|
109 |
|
---|