1 | /* $Id: UsbTestServicePlatform.h 76579 2019-01-01 06:14:44Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * UsbTestServ - Remote USB test configuration and execution server, Platform specific helpers.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2016-2019 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_UsbTestServicePlatform_h
|
---|
28 | #define VBOX_INCLUDED_SRC_usb_UsbTestServicePlatform_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 | RT_C_DECLS_BEGIN
|
---|
37 |
|
---|
38 | /**
|
---|
39 | * Initializes the platform specific structures for UTS.
|
---|
40 | *
|
---|
41 | * @returns IPRT status code.
|
---|
42 | */
|
---|
43 | DECLHIDDEN(int) utsPlatformInit(void);
|
---|
44 |
|
---|
45 | /**
|
---|
46 | * Frees all platform specific structures for UTS.
|
---|
47 | */
|
---|
48 | DECLHIDDEN(void) utsPlatformTerm(void);
|
---|
49 |
|
---|
50 | /**
|
---|
51 | * Loads the specified kernel module on the platform.
|
---|
52 | *
|
---|
53 | * @returns IPRT status code.
|
---|
54 | * @param pszModule The module to load.
|
---|
55 | * @param papszArgv Array of arguments to pass to the module.
|
---|
56 | * @param cArgv Number of argument array entries.
|
---|
57 | */
|
---|
58 | DECLHIDDEN(int) utsPlatformModuleLoad(const char *pszModule, const char **papszArgv,
|
---|
59 | unsigned cArgv);
|
---|
60 |
|
---|
61 | /**
|
---|
62 | * Unloads the specified kernel module on the platform.
|
---|
63 | *
|
---|
64 | * @returns IPRT status code.
|
---|
65 | * @param pszModule The module to unload.
|
---|
66 | */
|
---|
67 | DECLHIDDEN(int) utsPlatformModuleUnload(const char *pszModule);
|
---|
68 |
|
---|
69 | #ifdef RT_OS_LINUX
|
---|
70 |
|
---|
71 | /**
|
---|
72 | * Acquires a free UDC to attach a gadget to.
|
---|
73 | *
|
---|
74 | * @returns IPRT status code.
|
---|
75 | * @param fSuperSpeed Flag whether a super speed bus is required.
|
---|
76 | * @param ppszUdc Where to store the pointer to the name of the UDC on success.
|
---|
77 | * Free with RTStrFree().
|
---|
78 | * @param puBusId Where to store the bus ID the UDC is attached to on the host side.
|
---|
79 | */
|
---|
80 | DECLHIDDEN(int) utsPlatformLnxAcquireUDC(bool fSuperSpeed, char **ppszUdc, uint32_t *puBusId);
|
---|
81 |
|
---|
82 | /**
|
---|
83 | * Releases the given UDC for other use.
|
---|
84 | *
|
---|
85 | * @returns IPRT status code.
|
---|
86 | * @param pszUdc The UDC to release.
|
---|
87 | */
|
---|
88 | DECLHIDDEN(int) utsPlatformLnxReleaseUDC(const char *pszUdc);
|
---|
89 |
|
---|
90 | #endif
|
---|
91 |
|
---|
92 | RT_C_DECLS_END
|
---|
93 |
|
---|
94 | #endif /* !VBOX_INCLUDED_SRC_usb_UsbTestServicePlatform_h */
|
---|
95 |
|
---|