1 | /* $Id: VBoxDD.cpp 106345 2024-10-16 09:11:47Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBoxDD - Built-in drivers & devices (part 1).
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2024 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 |
|
---|
29 | /*********************************************************************************************************************************
|
---|
30 | * Header Files *
|
---|
31 | *********************************************************************************************************************************/
|
---|
32 | #define LOG_GROUP LOG_GROUP_DEV
|
---|
33 | #include <VBox/vmm/pdm.h>
|
---|
34 | #include <VBox/version.h>
|
---|
35 | #include <iprt/errcore.h>
|
---|
36 | #include <VBox/usb.h>
|
---|
37 |
|
---|
38 | #include <VBox/log.h>
|
---|
39 | #include <iprt/assert.h>
|
---|
40 |
|
---|
41 | #include "VBoxDD.h"
|
---|
42 |
|
---|
43 |
|
---|
44 | /*********************************************************************************************************************************
|
---|
45 | * Global Variables *
|
---|
46 | *********************************************************************************************************************************/
|
---|
47 | const void *g_apvVBoxDDDependencies[] =
|
---|
48 | {
|
---|
49 | NULL,
|
---|
50 | };
|
---|
51 |
|
---|
52 |
|
---|
53 | /**
|
---|
54 | * Register builtin devices.
|
---|
55 | *
|
---|
56 | * @returns VBox status code.
|
---|
57 | * @param pCallbacks Pointer to the callback table.
|
---|
58 | * @param u32Version VBox version number.
|
---|
59 | */
|
---|
60 | extern "C" DECLEXPORT(int) VBoxDevicesRegister(PPDMDEVREGCB pCallbacks, uint32_t u32Version)
|
---|
61 | {
|
---|
62 | LogFlow(("VBoxDevicesRegister: u32Version=%#x\n", u32Version));
|
---|
63 | AssertReleaseMsg(u32Version == VBOX_VERSION, ("u32Version=%#x VBOX_VERSION=%#x\n", u32Version, VBOX_VERSION));
|
---|
64 | int rc;
|
---|
65 |
|
---|
66 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePCI);
|
---|
67 | if (RT_FAILURE(rc))
|
---|
68 | return rc;
|
---|
69 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePciIch9);
|
---|
70 | if (RT_FAILURE(rc))
|
---|
71 | return rc;
|
---|
72 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePcArch);
|
---|
73 | if (RT_FAILURE(rc))
|
---|
74 | return rc;
|
---|
75 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePcBios);
|
---|
76 | if (RT_FAILURE(rc))
|
---|
77 | return rc;
|
---|
78 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceIOAPIC);
|
---|
79 | if (RT_FAILURE(rc))
|
---|
80 | return rc;
|
---|
81 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePS2KeyboardMouse);
|
---|
82 | if (RT_FAILURE(rc))
|
---|
83 | return rc;
|
---|
84 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePIIX3IDE);
|
---|
85 | if (RT_FAILURE(rc))
|
---|
86 | return rc;
|
---|
87 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceI8254);
|
---|
88 | if (RT_FAILURE(rc))
|
---|
89 | return rc;
|
---|
90 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceI8259);
|
---|
91 | if (RT_FAILURE(rc))
|
---|
92 | return rc;
|
---|
93 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceHPET);
|
---|
94 | if (RT_FAILURE(rc))
|
---|
95 | return rc;
|
---|
96 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceSmc);
|
---|
97 | if (RT_FAILURE(rc))
|
---|
98 | return rc;
|
---|
99 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceFlash);
|
---|
100 | if (RT_FAILURE(rc))
|
---|
101 | return rc;
|
---|
102 | #ifdef VBOX_WITH_EFI
|
---|
103 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceEFI);
|
---|
104 | if (RT_FAILURE(rc))
|
---|
105 | return rc;
|
---|
106 | #endif
|
---|
107 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceMC146818);
|
---|
108 | if (RT_FAILURE(rc))
|
---|
109 | return rc;
|
---|
110 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceVga);
|
---|
111 | if (RT_FAILURE(rc))
|
---|
112 | return rc;
|
---|
113 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceVMMDev);
|
---|
114 | if (RT_FAILURE(rc))
|
---|
115 | return rc;
|
---|
116 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePCNet);
|
---|
117 | if (RT_FAILURE(rc))
|
---|
118 | return rc;
|
---|
119 | #ifdef VBOX_WITH_E1000
|
---|
120 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceE1000);
|
---|
121 | if (RT_FAILURE(rc))
|
---|
122 | return rc;
|
---|
123 | #endif
|
---|
124 | #ifdef VBOX_WITH_VIRTIO
|
---|
125 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceVirtioNet);
|
---|
126 | if (RT_FAILURE(rc))
|
---|
127 | return rc;
|
---|
128 | #endif
|
---|
129 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceDP8390);
|
---|
130 | if (RT_FAILURE(rc))
|
---|
131 | return rc;
|
---|
132 | rc = pCallbacks->pfnRegister(pCallbacks, &g_Device3C501);
|
---|
133 | if (RT_FAILURE(rc))
|
---|
134 | return rc;
|
---|
135 | #ifdef VBOX_WITH_INIP
|
---|
136 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceINIP);
|
---|
137 | if (RT_FAILURE(rc))
|
---|
138 | return rc;
|
---|
139 | #endif
|
---|
140 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceICHAC97);
|
---|
141 | if (RT_FAILURE(rc))
|
---|
142 | return rc;
|
---|
143 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceSB16);
|
---|
144 | if (RT_FAILURE(rc))
|
---|
145 | return rc;
|
---|
146 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceHDA);
|
---|
147 | if (RT_FAILURE(rc))
|
---|
148 | return rc;
|
---|
149 | #ifdef VBOX_WITH_VUSB
|
---|
150 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceOHCI);
|
---|
151 | if (RT_FAILURE(rc))
|
---|
152 | return rc;
|
---|
153 | #endif
|
---|
154 | #ifdef VBOX_WITH_EHCI_IMPL
|
---|
155 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceEHCI);
|
---|
156 | if (RT_FAILURE(rc))
|
---|
157 | return rc;
|
---|
158 | #endif
|
---|
159 | #ifdef VBOX_WITH_XHCI_IMPL
|
---|
160 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceXHCI);
|
---|
161 | if (RT_FAILURE(rc))
|
---|
162 | return rc;
|
---|
163 | #endif
|
---|
164 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceACPI);
|
---|
165 | if (RT_FAILURE(rc))
|
---|
166 | return rc;
|
---|
167 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceDMA);
|
---|
168 | if (RT_FAILURE(rc))
|
---|
169 | return rc;
|
---|
170 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceFloppyController);
|
---|
171 | if (RT_FAILURE(rc))
|
---|
172 | return rc;
|
---|
173 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceSerialPort);
|
---|
174 | if (RT_FAILURE(rc))
|
---|
175 | return rc;
|
---|
176 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceOxPcie958);
|
---|
177 | if (RT_FAILURE(rc))
|
---|
178 | return rc;
|
---|
179 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceParallelPort);
|
---|
180 | if (RT_FAILURE(rc))
|
---|
181 | return rc;
|
---|
182 | #ifdef VBOX_WITH_AHCI
|
---|
183 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceAHCI);
|
---|
184 | if (RT_FAILURE(rc))
|
---|
185 | return rc;
|
---|
186 | #endif
|
---|
187 | #ifdef VBOX_WITH_BUSLOGIC
|
---|
188 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceBusLogic);
|
---|
189 | if (RT_FAILURE(rc))
|
---|
190 | return rc;
|
---|
191 | #endif
|
---|
192 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePCIBridge);
|
---|
193 | if (RT_FAILURE(rc))
|
---|
194 | return rc;
|
---|
195 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePciIch9Bridge);
|
---|
196 | if (RT_FAILURE(rc))
|
---|
197 | return rc;
|
---|
198 | #ifdef VBOX_WITH_LSILOGIC
|
---|
199 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceLsiLogicSCSI);
|
---|
200 | if (RT_FAILURE(rc))
|
---|
201 | return rc;
|
---|
202 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceLsiLogicSAS);
|
---|
203 | if (RT_FAILURE(rc))
|
---|
204 | return rc;
|
---|
205 | #endif
|
---|
206 | #ifdef VBOX_WITH_NVME_IMPL
|
---|
207 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceNVMe);
|
---|
208 | if (RT_FAILURE(rc))
|
---|
209 | return rc;
|
---|
210 | #endif
|
---|
211 | #ifdef VBOX_WITH_VIRTIO_SCSI
|
---|
212 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceVirtioSCSI);
|
---|
213 | if (RT_FAILURE(rc))
|
---|
214 | return rc;
|
---|
215 | #endif
|
---|
216 | #ifdef VBOX_WITH_PCI_PASSTHROUGH_IMPL
|
---|
217 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePciRaw);
|
---|
218 | if (RT_FAILURE(rc))
|
---|
219 | return rc;
|
---|
220 | #endif
|
---|
221 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceGIMDev);
|
---|
222 | if (RT_FAILURE(rc))
|
---|
223 | return rc;
|
---|
224 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceLPC);
|
---|
225 | if (RT_FAILURE(rc))
|
---|
226 | return rc;
|
---|
227 | #ifdef VBOX_WITH_VIRTUALKD
|
---|
228 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceVirtualKD);
|
---|
229 | if (RT_FAILURE(rc))
|
---|
230 | return rc;
|
---|
231 | #endif
|
---|
232 | #ifdef VBOX_WITH_IOMMU_AMD
|
---|
233 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceIommuAmd);
|
---|
234 | if (RT_FAILURE(rc))
|
---|
235 | return rc;
|
---|
236 | #endif
|
---|
237 | #ifdef VBOX_WITH_IOMMU_INTEL
|
---|
238 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceIommuIntel);
|
---|
239 | if (RT_FAILURE(rc))
|
---|
240 | return rc;
|
---|
241 | #endif
|
---|
242 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceQemuFwCfg);
|
---|
243 | if (RT_FAILURE(rc))
|
---|
244 | return rc;
|
---|
245 | #ifdef VBOX_WITH_TPM
|
---|
246 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceTpm);
|
---|
247 | if (RT_FAILURE(rc))
|
---|
248 | return rc;
|
---|
249 |
|
---|
250 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceTpmPpi);
|
---|
251 | if (RT_FAILURE(rc))
|
---|
252 | return rc;
|
---|
253 | #endif
|
---|
254 | #ifdef VBOX_WITH_VIRT_ARMV8
|
---|
255 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceEfiArmV8);
|
---|
256 | if (RT_FAILURE(rc))
|
---|
257 | return rc;
|
---|
258 |
|
---|
259 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePl011);
|
---|
260 | if (RT_FAILURE(rc))
|
---|
261 | return rc;
|
---|
262 |
|
---|
263 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePl031Rtc);
|
---|
264 | if (RT_FAILURE(rc))
|
---|
265 | return rc;
|
---|
266 |
|
---|
267 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePl061Gpio);
|
---|
268 | if (RT_FAILURE(rc))
|
---|
269 | return rc;
|
---|
270 |
|
---|
271 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceFlashCFI);
|
---|
272 | if (RT_FAILURE(rc))
|
---|
273 | return rc;
|
---|
274 |
|
---|
275 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePciGenericEcam);
|
---|
276 | if (RT_FAILURE(rc))
|
---|
277 | return rc;
|
---|
278 |
|
---|
279 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePciGenericEcamBridge);
|
---|
280 | if (RT_FAILURE(rc))
|
---|
281 | return rc;
|
---|
282 |
|
---|
283 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePlatform);
|
---|
284 | if (RT_FAILURE(rc))
|
---|
285 | return rc;
|
---|
286 | #endif
|
---|
287 |
|
---|
288 | return VINF_SUCCESS;
|
---|
289 | }
|
---|
290 |
|
---|
291 |
|
---|
292 | /**
|
---|
293 | * Register builtin drivers.
|
---|
294 | *
|
---|
295 | * @returns VBox status code.
|
---|
296 | * @param pCallbacks Pointer to the callback table.
|
---|
297 | * @param u32Version VBox version number.
|
---|
298 | */
|
---|
299 | extern "C" DECLEXPORT(int) VBoxDriversRegister(PCPDMDRVREGCB pCallbacks, uint32_t u32Version)
|
---|
300 | {
|
---|
301 | LogFlow(("VBoxDriversRegister: u32Version=%#x\n", u32Version));
|
---|
302 | AssertReleaseMsg(u32Version == VBOX_VERSION, ("u32Version=%#x VBOX_VERSION=%#x\n", u32Version, VBOX_VERSION));
|
---|
303 |
|
---|
304 | int rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvMouseQueue);
|
---|
305 | if (RT_FAILURE(rc))
|
---|
306 | return rc;
|
---|
307 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvKeyboardQueue);
|
---|
308 | if (RT_FAILURE(rc))
|
---|
309 | return rc;
|
---|
310 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvVD);
|
---|
311 | if (RT_FAILURE(rc))
|
---|
312 | return rc;
|
---|
313 | #if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_WINDOWS) || defined(RT_OS_FREEBSD)
|
---|
314 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostDVD);
|
---|
315 | if (RT_FAILURE(rc))
|
---|
316 | return rc;
|
---|
317 | #endif
|
---|
318 | #if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
|
---|
319 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostFloppy);
|
---|
320 | if (RT_FAILURE(rc))
|
---|
321 | return rc;
|
---|
322 | #endif
|
---|
323 | #ifndef VBOX_WITH_LIBSLIRP
|
---|
324 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNAT);
|
---|
325 | if (RT_FAILURE(rc))
|
---|
326 | return rc;
|
---|
327 | #endif
|
---|
328 | #ifdef VBOX_WITH_LIBSLIRP
|
---|
329 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNATlibslirp);
|
---|
330 | if (RT_FAILURE(rc))
|
---|
331 | return rc;
|
---|
332 | #endif
|
---|
333 | #if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)
|
---|
334 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostInterface);
|
---|
335 | if (RT_FAILURE(rc))
|
---|
336 | return rc;
|
---|
337 | #endif
|
---|
338 | #ifdef VBOX_WITH_UDPTUNNEL
|
---|
339 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvUDPTunnel);
|
---|
340 | if (RT_FAILURE(rc))
|
---|
341 | return rc;
|
---|
342 | #endif
|
---|
343 | #ifdef VBOX_WITH_VDE
|
---|
344 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvVDE);
|
---|
345 | if (RT_FAILURE(rc))
|
---|
346 | return rc;
|
---|
347 | #endif
|
---|
348 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvIntNet);
|
---|
349 | if (RT_FAILURE(rc))
|
---|
350 | return rc;
|
---|
351 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvDedicatedNic);
|
---|
352 | if (RT_FAILURE(rc))
|
---|
353 | return rc;
|
---|
354 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNetSniffer);
|
---|
355 | if (RT_FAILURE(rc))
|
---|
356 | return rc;
|
---|
357 | #ifdef VBOX_WITH_NETSHAPER
|
---|
358 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNetShaper);
|
---|
359 | if (RT_FAILURE(rc))
|
---|
360 | return rc;
|
---|
361 | #endif
|
---|
362 | #ifdef VBOX_WITH_VMNET
|
---|
363 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvVMNet);
|
---|
364 | if (RT_FAILURE(rc))
|
---|
365 | return rc;
|
---|
366 | #endif /* VBOX_WITH_VMNET */
|
---|
367 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvAUDIO);
|
---|
368 | if (RT_FAILURE(rc))
|
---|
369 | return rc;
|
---|
370 | #ifdef VBOX_WITH_AUDIO_DEBUG
|
---|
371 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostDebugAudio);
|
---|
372 | if (RT_FAILURE(rc))
|
---|
373 | return rc;
|
---|
374 | #endif
|
---|
375 | #ifdef VBOX_WITH_AUDIO_VALIDATIONKIT
|
---|
376 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostValidationKitAudio);
|
---|
377 | if (RT_FAILURE(rc))
|
---|
378 | return rc;
|
---|
379 | #endif
|
---|
380 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostNullAudio);
|
---|
381 | if (RT_FAILURE(rc))
|
---|
382 | return rc;
|
---|
383 | #if defined(RT_OS_WINDOWS)
|
---|
384 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostDSound);
|
---|
385 | if (RT_FAILURE(rc))
|
---|
386 | return rc;
|
---|
387 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostAudioWas);
|
---|
388 | if (RT_FAILURE(rc))
|
---|
389 | return rc;
|
---|
390 | #endif
|
---|
391 | #if defined(RT_OS_DARWIN)
|
---|
392 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostCoreAudio);
|
---|
393 | if (RT_FAILURE(rc))
|
---|
394 | return rc;
|
---|
395 | #endif
|
---|
396 | #ifdef VBOX_WITH_AUDIO_ALSA
|
---|
397 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostALSAAudio);
|
---|
398 | if (RT_FAILURE(rc))
|
---|
399 | return rc;
|
---|
400 | #endif
|
---|
401 | #ifdef VBOX_WITH_AUDIO_OSS
|
---|
402 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostOSSAudio);
|
---|
403 | if (RT_FAILURE(rc))
|
---|
404 | return rc;
|
---|
405 | #endif
|
---|
406 | #ifdef VBOX_WITH_AUDIO_PULSE
|
---|
407 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostPulseAudio);
|
---|
408 | if (RT_FAILURE(rc))
|
---|
409 | return rc;
|
---|
410 | #endif
|
---|
411 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvACPI);
|
---|
412 | if (RT_FAILURE(rc))
|
---|
413 | return rc;
|
---|
414 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvAcpiCpu);
|
---|
415 | if (RT_FAILURE(rc))
|
---|
416 | return rc;
|
---|
417 | #ifdef VBOX_WITH_VUSB
|
---|
418 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvVUSBRootHub);
|
---|
419 | if (RT_FAILURE(rc))
|
---|
420 | return rc;
|
---|
421 | #endif
|
---|
422 | #ifdef VBOX_WITH_USB_VIDEO_IMPL
|
---|
423 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostWebcam);
|
---|
424 | if (RT_FAILURE(rc))
|
---|
425 | return rc;
|
---|
426 | #endif
|
---|
427 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNamedPipe);
|
---|
428 | if (RT_FAILURE(rc))
|
---|
429 | return rc;
|
---|
430 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvTCP);
|
---|
431 | if (RT_FAILURE(rc))
|
---|
432 | return rc;
|
---|
433 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvUDP);
|
---|
434 | if (RT_FAILURE(rc))
|
---|
435 | return rc;
|
---|
436 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvRawFile);
|
---|
437 | if (RT_FAILURE(rc))
|
---|
438 | return rc;
|
---|
439 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvChar);
|
---|
440 | if (RT_FAILURE(rc))
|
---|
441 | return rc;
|
---|
442 | #if defined(RT_OS_LINUX) || defined(VBOX_WITH_WIN_PARPORT_SUP)
|
---|
443 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostParallel);
|
---|
444 | if (RT_FAILURE(rc))
|
---|
445 | return rc;
|
---|
446 | #endif
|
---|
447 | #if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_WINDOWS) || defined(RT_OS_FREEBSD)
|
---|
448 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostSerial);
|
---|
449 | if (RT_FAILURE(rc))
|
---|
450 | return rc;
|
---|
451 | #endif
|
---|
452 | #ifdef VBOX_WITH_SCSI
|
---|
453 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvSCSI);
|
---|
454 | if (RT_FAILURE(rc))
|
---|
455 | return rc;
|
---|
456 | #endif
|
---|
457 | #ifdef VBOX_WITH_DRV_DISK_INTEGRITY
|
---|
458 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvDiskIntegrity);
|
---|
459 | if (RT_FAILURE(rc))
|
---|
460 | return rc;
|
---|
461 |
|
---|
462 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvRamDisk);
|
---|
463 | if (RT_FAILURE(rc))
|
---|
464 | return rc;
|
---|
465 | #endif
|
---|
466 | #ifdef VBOX_WITH_PCI_PASSTHROUGH_IMPL
|
---|
467 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvPciRaw);
|
---|
468 | if (RT_FAILURE(rc))
|
---|
469 | return rc;
|
---|
470 | #endif
|
---|
471 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvIfTrace);
|
---|
472 | if (RT_FAILURE(rc))
|
---|
473 | return rc;
|
---|
474 | #ifdef VBOX_WITH_TPM
|
---|
475 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvTpmEmu);
|
---|
476 | if (RT_FAILURE(rc))
|
---|
477 | return rc;
|
---|
478 |
|
---|
479 | # ifdef RT_OS_LINUX
|
---|
480 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvTpmHost);
|
---|
481 | if (RT_FAILURE(rc))
|
---|
482 | return rc;
|
---|
483 | # endif
|
---|
484 |
|
---|
485 | # ifdef VBOX_WITH_LIBTPMS
|
---|
486 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvTpmEmuTpms);
|
---|
487 | if (RT_FAILURE(rc))
|
---|
488 | return rc;
|
---|
489 | # endif
|
---|
490 |
|
---|
491 | # ifdef VBOX_WITH_CLOUD_NET
|
---|
492 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvCloudTunnel);
|
---|
493 | if (RT_FAILURE(rc))
|
---|
494 | return rc;
|
---|
495 | # endif
|
---|
496 | #endif
|
---|
497 |
|
---|
498 | #ifdef VBOX_WITH_VIRT_ARMV8
|
---|
499 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvGpioButton);
|
---|
500 | if (RT_FAILURE(rc))
|
---|
501 | return rc;
|
---|
502 | #endif
|
---|
503 | return VINF_SUCCESS;
|
---|
504 | }
|
---|
505 |
|
---|
506 |
|
---|
507 | /**
|
---|
508 | * Register builtin USB device.
|
---|
509 | *
|
---|
510 | * @returns VBox status code.
|
---|
511 | * @param pCallbacks Pointer to the callback table.
|
---|
512 | * @param u32Version VBox version number.
|
---|
513 | */
|
---|
514 | extern "C" DECLEXPORT(int) VBoxUsbRegister(PCPDMUSBREGCB pCallbacks, uint32_t u32Version)
|
---|
515 | {
|
---|
516 | int rc = VINF_SUCCESS;
|
---|
517 | RT_NOREF1(u32Version);
|
---|
518 |
|
---|
519 | #ifdef VBOX_WITH_USB
|
---|
520 | rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbDevProxy);
|
---|
521 | if (RT_FAILURE(rc))
|
---|
522 | return rc;
|
---|
523 | # ifdef VBOX_WITH_SCSI
|
---|
524 | rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbMsd);
|
---|
525 | if (RT_FAILURE(rc))
|
---|
526 | return rc;
|
---|
527 | # endif
|
---|
528 | #endif
|
---|
529 | #ifdef VBOX_WITH_VUSB
|
---|
530 | rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbHidKbd);
|
---|
531 | if (RT_FAILURE(rc))
|
---|
532 | return rc;
|
---|
533 | rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbHidMou);
|
---|
534 | if (RT_FAILURE(rc))
|
---|
535 | return rc;
|
---|
536 | rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbEth);
|
---|
537 | if (RT_FAILURE(rc))
|
---|
538 | return rc;
|
---|
539 | #endif
|
---|
540 | #ifdef VBOX_WITH_USB_VIDEO_IMPL
|
---|
541 | rc = pCallbacks->pfnRegister(pCallbacks, &g_DevWebcam);
|
---|
542 | if (RT_FAILURE(rc))
|
---|
543 | return rc;
|
---|
544 | #endif
|
---|
545 |
|
---|
546 | return rc;
|
---|
547 | }
|
---|