VirtualBox

source: vbox/trunk/include/VBox/vmm/pdmusb.h@ 73285

Last change on this file since 73285 was 73097, checked in by vboxsync, 6 years ago

*: Made RT_UOFFSETOF, RT_OFFSETOF, RT_UOFFSETOF_ADD and RT_OFFSETOF_ADD work like builtin_offsetof() and require compile time resolvable requests, adding RT_UOFFSETOF_DYN for the dynamic questions that can only be answered at runtime.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 42.3 KB
Line 
1/** @file
2 * PDM - Pluggable Device Manager, USB Devices.
3 */
4
5/*
6 * Copyright (C) 2006-2017 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 * The contents of this file may alternatively be used under the terms
17 * of the Common Development and Distribution License Version 1.0
18 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
19 * VirtualBox OSE distribution, in which case the provisions of the
20 * CDDL are applicable instead of those of the GPL.
21 *
22 * You may elect to license modified versions of this file under the
23 * terms and conditions of either the GPL or the CDDL or both.
24 */
25
26#ifndef ___VBox_vmm_pdmusb_h
27#define ___VBox_vmm_pdmusb_h
28
29#include <VBox/vmm/pdmqueue.h>
30#include <VBox/vmm/pdmcritsect.h>
31#include <VBox/vmm/pdmthread.h>
32#include <VBox/vmm/pdmifs.h>
33#include <VBox/vmm/pdmins.h>
34#include <VBox/vmm/pdmcommon.h>
35#include <VBox/vmm/tm.h>
36#include <VBox/vmm/ssm.h>
37#include <VBox/vmm/cfgm.h>
38#include <VBox/vmm/dbgf.h>
39#include <VBox/vmm/mm.h>
40#include <VBox/err.h>
41#include <VBox/vusb.h>
42#include <iprt/stdarg.h>
43
44RT_C_DECLS_BEGIN
45
46/** @defgroup grp_pdm_usbdev The USB Devices API
47 * @ingroup grp_pdm
48 * @{
49 */
50
51
52/**
53 * A string entry for the USB descriptor cache.
54 */
55typedef struct PDMUSBDESCCACHESTRING
56{
57 /** The string index. */
58 uint8_t idx;
59 /** The UTF-8 representation of the string. */
60 const char *psz;
61} PDMUSBDESCCACHESTRING;
62/** Pointer to a const string entry. */
63typedef PDMUSBDESCCACHESTRING const *PCPDMUSBDESCCACHESTRING;
64
65
66/**
67 * A language entry for the USB descriptor cache.
68 */
69typedef struct PDMUSBDESCCACHELANG
70{
71 /** The language ID for the strings in this block. */
72 uint16_t idLang;
73 /** The number of strings in the array. */
74 uint16_t cStrings;
75 /** Pointer to an array of associated strings.
76 * This must be sorted in ascending order by string index as a binary lookup
77 * will be performed. */
78 PCPDMUSBDESCCACHESTRING paStrings;
79} PDMUSBDESCCACHELANG;
80/** Pointer to a const language entry. */
81typedef PDMUSBDESCCACHELANG const *PCPDMUSBDESCCACHELANG;
82
83
84/**
85 * USB descriptor cache.
86 *
87 * This structure is owned by the USB device but provided to the PDM/VUSB layer
88 * thru the PDMUSBREG::pfnGetDescriptorCache method. PDM/VUSB will use the
89 * information here to map addresses to endpoints, perform SET_CONFIGURATION
90 * requests, and optionally perform GET_DESCRIPTOR requests (see flag).
91 *
92 * Currently, only device and configuration descriptors are cached.
93 */
94typedef struct PDMUSBDESCCACHE
95{
96 /** USB device descriptor */
97 PCVUSBDESCDEVICE pDevice;
98 /** USB Descriptor arrays (pDev->bNumConfigurations) */
99 PCVUSBDESCCONFIGEX paConfigs;
100 /** Language IDs and their associated strings.
101 * This must be sorted in ascending order by language ID as a binary lookup
102 * will be used. */
103 PCPDMUSBDESCCACHELANG paLanguages;
104 /** The number of entries in the array pointed to by paLanguages. */
105 uint16_t cLanguages;
106 /** Use the cached descriptors for GET_DESCRIPTOR requests. */
107 bool fUseCachedDescriptors;
108 /** Use the cached string descriptors. */
109 bool fUseCachedStringsDescriptors;
110} PDMUSBDESCCACHE;
111/** Pointer to an USB descriptor cache. */
112typedef PDMUSBDESCCACHE *PPDMUSBDESCCACHE;
113/** Pointer to a const USB descriptor cache. */
114typedef const PDMUSBDESCCACHE *PCPDMUSBDESCCACHE;
115
116
117/** PDM Device Flags.
118 * @{ */
119/** A high-speed capable USB 2.0 device (also required to support full-speed). */
120#define PDM_USBREG_HIGHSPEED_CAPABLE RT_BIT(0)
121/** Indicates that the device implements the saved state handlers. */
122#define PDM_USBREG_SAVED_STATE_SUPPORTED RT_BIT(1)
123/** A SuperSpeed USB 3.0 device. */
124#define PDM_USBREG_SUPERSPEED_CAPABLE RT_BIT(2)
125/** @} */
126
127/** PDM USB Device Registration Structure,
128 *
129 * This structure is used when registering a device from VBoxUsbRegister() in HC Ring-3.
130 * The PDM will make use of this structure until the VM is destroyed.
131 */
132typedef struct PDMUSBREG
133{
134 /** Structure version. PDM_DEVREG_VERSION defines the current version. */
135 uint32_t u32Version;
136 /** Device name. */
137 char szName[32];
138 /** The description of the device. The UTF-8 string pointed to shall, like this structure,
139 * remain unchanged from registration till VM destruction. */
140 const char *pszDescription;
141
142 /** Flags, combination of the PDM_USBREG_FLAGS_* \#defines. */
143 RTUINT fFlags;
144 /** Maximum number of instances (per VM). */
145 RTUINT cMaxInstances;
146 /** Size of the instance data. */
147 RTUINT cbInstance;
148
149
150 /**
151 * Construct an USB device instance for a VM.
152 *
153 * @returns VBox status.
154 * @param pUsbIns The USB device instance data.
155 * If the registration structure is needed, it will be
156 * accessible thru pUsbDev->pReg.
157 * @param iInstance Instance number. Use this to figure out which registers
158 * and such to use. The instance number is also found in
159 * pUsbDev->iInstance, but since it's likely to be
160 * frequently used PDM passes it as parameter.
161 * @param pCfg Configuration node handle for the device. Use this to
162 * obtain the configuration of the device instance. It is
163 * also found in pUsbDev->pCfg, but since it is primary
164 * usage will in this function it is passed as a parameter.
165 * @param pCfgGlobal Handle to the global device configuration. Also found
166 * in pUsbDev->pCfgGlobal.
167 * @remarks This callback is required.
168 */
169 DECLR3CALLBACKMEMBER(int, pfnConstruct,(PPDMUSBINS pUsbIns, int iInstance, PCFGMNODE pCfg, PCFGMNODE pCfgGlobal));
170
171 /**
172 * Destruct an USB device instance.
173 *
174 * Most VM resources are freed by the VM. This callback is provided so that any non-VM
175 * resources can be freed correctly.
176 *
177 * This method will be called regardless of the pfnConstruct result to avoid
178 * complicated failure paths.
179 *
180 * @param pUsbIns The USB device instance data.
181 * @remarks Optional.
182 */
183 DECLR3CALLBACKMEMBER(void, pfnDestruct,(PPDMUSBINS pUsbIns));
184
185
186 /**
187 * Init complete notification.
188 *
189 * This can be done to do communication with other devices and other
190 * initialization which requires everything to be in place.
191 *
192 * @returns VBOX status code.
193 * @param pUsbIns The USB device instance data.
194 * @remarks Optional.
195 * @remarks Not called when hotplugged.
196 */
197 DECLR3CALLBACKMEMBER(int, pfnVMInitComplete,(PPDMUSBINS pUsbIns));
198
199 /**
200 * VM Power On notification.
201 *
202 * @returns VBox status.
203 * @param pUsbIns The USB device instance data.
204 * @remarks Optional.
205 */
206 DECLR3CALLBACKMEMBER(void, pfnVMPowerOn,(PPDMUSBINS pUsbIns));
207
208 /**
209 * VM Reset notification.
210 *
211 * @returns VBox status.
212 * @param pUsbIns The USB device instance data.
213 * @remarks Optional.
214 */
215 DECLR3CALLBACKMEMBER(void, pfnVMReset,(PPDMUSBINS pUsbIns));
216
217 /**
218 * VM Suspend notification.
219 *
220 * @returns VBox status.
221 * @param pUsbIns The USB device instance data.
222 * @remarks Optional.
223 */
224 DECLR3CALLBACKMEMBER(void, pfnVMSuspend,(PPDMUSBINS pUsbIns));
225
226 /**
227 * VM Resume notification.
228 *
229 * @returns VBox status.
230 * @param pUsbIns The USB device instance data.
231 * @remarks Optional.
232 */
233 DECLR3CALLBACKMEMBER(void, pfnVMResume,(PPDMUSBINS pUsbIns));
234
235 /**
236 * VM Power Off notification.
237 *
238 * This is only called when the VMR3PowerOff call is made on a running VM. This
239 * means that there is no notification if the VM was suspended before being
240 * powered of. There will also be no callback when hot plugging devices.
241 *
242 * @param pUsbIns The USB device instance data.
243 */
244 DECLR3CALLBACKMEMBER(void, pfnVMPowerOff,(PPDMUSBINS pUsbIns));
245
246 /**
247 * Called after the constructor when attaching a device at run time.
248 *
249 * This can be used to do tasks normally assigned to pfnInitComplete and/or pfnVMPowerOn.
250 *
251 * @returns VBox status.
252 * @param pUsbIns The USB device instance data.
253 * @remarks Optional.
254 */
255 DECLR3CALLBACKMEMBER(void, pfnHotPlugged,(PPDMUSBINS pUsbIns));
256
257 /**
258 * Called before the destructor when a device is unplugged at run time.
259 *
260 * This can be used to do tasks normally assigned to pfnVMSuspend and/or pfnVMPowerOff.
261 *
262 * @returns VBox status.
263 * @param pUsbIns The USB device instance data.
264 * @remarks Optional.
265 */
266 DECLR3CALLBACKMEMBER(void, pfnHotUnplugged,(PPDMUSBINS pUsbIns));
267 /**
268 * Driver Attach command.
269 *
270 * This is called to let the USB device attach to a driver for a specified LUN
271 * at runtime. This is not called during VM construction, the device constructor
272 * have to attach to all the available drivers.
273 *
274 * @returns VBox status code.
275 * @param pUsbIns The USB device instance data.
276 * @param iLUN The logical unit which is being detached.
277 * @param fFlags Flags, combination of the PDM_TACH_FLAGS_* \#defines.
278 * @remarks Optional.
279 */
280 DECLR3CALLBACKMEMBER(int, pfnDriverAttach,(PPDMUSBINS pUsbIns, unsigned iLUN, uint32_t fFlags));
281
282 /**
283 * Driver Detach notification.
284 *
285 * This is called when a driver is detaching itself from a LUN of the device.
286 * The device should adjust it's state to reflect this.
287 *
288 * @param pUsbIns The USB device instance data.
289 * @param iLUN The logical unit which is being detached.
290 * @param fFlags Flags, combination of the PDM_TACH_FLAGS_* \#defines.
291 * @remarks Optional.
292 */
293 DECLR3CALLBACKMEMBER(void, pfnDriverDetach,(PPDMUSBINS pUsbIns, unsigned iLUN, uint32_t fFlags));
294
295 /**
296 * Query the base interface of a logical unit.
297 *
298 * @returns VBOX status code.
299 * @param pUsbIns The USB device instance data.
300 * @param iLUN The logicial unit to query.
301 * @param ppBase Where to store the pointer to the base interface of the LUN.
302 * @remarks Optional.
303 */
304 DECLR3CALLBACKMEMBER(int, pfnQueryInterface,(PPDMUSBINS pUsbIns, unsigned iLUN, PPDMIBASE *ppBase));
305
306 /**
307 * Requests the USB device to reset.
308 *
309 * @returns VBox status code.
310 * @param pUsbIns The USB device instance.
311 * @param fResetOnLinux A hint to the usb proxy.
312 * Don't use this unless you're the linux proxy device.
313 * @thread Any thread.
314 * @remarks Optional.
315 */
316 DECLR3CALLBACKMEMBER(int, pfnUsbReset,(PPDMUSBINS pUsbIns, bool fResetOnLinux));
317
318 /**
319 * Query device and configuration descriptors for the caching and servicing
320 * relevant GET_DESCRIPTOR requests.
321 *
322 * @returns Pointer to the descriptor cache (read-only).
323 * @param pUsbIns The USB device instance.
324 * @remarks Mandatory.
325 */
326 DECLR3CALLBACKMEMBER(PCPDMUSBDESCCACHE, pfnUsbGetDescriptorCache,(PPDMUSBINS pUsbIns));
327
328 /**
329 * SET_CONFIGURATION request.
330 *
331 * @returns VBox status code.
332 * @param pUsbIns The USB device instance.
333 * @param bConfigurationValue The bConfigurationValue of the new configuration.
334 * @param pvOldCfgDesc Internal - for the device proxy.
335 * @param pvOldIfState Internal - for the device proxy.
336 * @param pvNewCfgDesc Internal - for the device proxy.
337 * @remarks Optional.
338 */
339 DECLR3CALLBACKMEMBER(int, pfnUsbSetConfiguration,(PPDMUSBINS pUsbIns, uint8_t bConfigurationValue,
340 const void *pvOldCfgDesc, const void *pvOldIfState, const void *pvNewCfgDesc));
341
342 /**
343 * SET_INTERFACE request.
344 *
345 * @returns VBox status code.
346 * @param pUsbIns The USB device instance.
347 * @param bInterfaceNumber The interface number.
348 * @param bAlternateSetting The alternate setting.
349 * @remarks Optional.
350 */
351 DECLR3CALLBACKMEMBER(int, pfnUsbSetInterface,(PPDMUSBINS pUsbIns, uint8_t bInterfaceNumber, uint8_t bAlternateSetting));
352
353 /**
354 * Clears the halted state of an endpoint. (Optional)
355 *
356 * This called when VUSB sees a CLEAR_FEATURE(ENDPOINT_HALT) on request
357 * on the zero pipe.
358 *
359 * @returns VBox status code.
360 * @param pUsbIns The USB device instance.
361 * @param uEndpoint The endpoint to clear.
362 * @remarks Optional.
363 */
364 DECLR3CALLBACKMEMBER(int, pfnUsbClearHaltedEndpoint,(PPDMUSBINS pUsbIns, unsigned uEndpoint));
365
366 /**
367 * Allocates an URB.
368 *
369 * This can be used to make use of shared user/kernel mode buffers.
370 *
371 * @returns VBox status code.
372 * @param pUsbIns The USB device instance.
373 * @param cbData The size of the data buffer.
374 * @param cTds The number of TDs.
375 * @param enmType The type of URB.
376 * @param ppUrb Where to store the allocated URB.
377 * @remarks Optional.
378 * @remarks Not implemented yet.
379 */
380 DECLR3CALLBACKMEMBER(int, pfnUrbNew,(PPDMUSBINS pUsbIns, size_t cbData, size_t cTds, VUSBXFERTYPE enmType, PVUSBURB *ppUrb));
381
382 /**
383 * Queues an URB for processing.
384 *
385 * @returns VBox status code.
386 * @retval VINF_SUCCESS on success.
387 * @retval VERR_VUSB_DEVICE_NOT_ATTACHED if the device has been disconnected.
388 * @retval VERR_VUSB_FAILED_TO_QUEUE_URB as a general failure kind of thing.
389 * @retval TBD - document new stuff!
390 *
391 * @param pUsbIns The USB device instance.
392 * @param pUrb The URB to process.
393 * @remarks Mandatory.
394 */
395 DECLR3CALLBACKMEMBER(int, pfnUrbQueue,(PPDMUSBINS pUsbIns, PVUSBURB pUrb));
396
397 /**
398 * Cancels an URB.
399 *
400 * @returns VBox status code.
401 * @param pUsbIns The USB device instance.
402 * @param pUrb The URB to cancel.
403 * @remarks Mandatory.
404 */
405 DECLR3CALLBACKMEMBER(int, pfnUrbCancel,(PPDMUSBINS pUsbIns, PVUSBURB pUrb));
406
407 /**
408 * Reaps an URB.
409 *
410 * @returns A ripe URB, NULL if none.
411 * @param pUsbIns The USB device instance.
412 * @param cMillies How log to wait for an URB to become ripe.
413 * @remarks Mandatory.
414 */
415 DECLR3CALLBACKMEMBER(PVUSBURB, pfnUrbReap,(PPDMUSBINS pUsbIns, RTMSINTERVAL cMillies));
416
417 /**
418 * Wakes a thread waiting in pfnUrbReap.
419 *
420 * @returns VBox status code.
421 * @param pUsbIns The USB device instance.
422 */
423 DECLR3CALLBACKMEMBER(int, pfnWakeup,(PPDMUSBINS pUsbIns));
424
425 /** Just some init precaution. Must be set to PDM_USBREG_VERSION. */
426 uint32_t u32TheEnd;
427} PDMUSBREG;
428/** Pointer to a PDM USB Device Structure. */
429typedef PDMUSBREG *PPDMUSBREG;
430/** Const pointer to a PDM USB Device Structure. */
431typedef PDMUSBREG const *PCPDMUSBREG;
432
433/** Current USBREG version number. */
434#define PDM_USBREG_VERSION PDM_VERSION_MAKE(0xeeff, 1, 0)
435
436/** PDM USB Device Flags.
437 * @{ */
438/* none yet */
439/** @} */
440
441
442#ifdef IN_RING3
443
444/**
445 * PDM USB Device API.
446 */
447typedef struct PDMUSBHLP
448{
449 /** Structure version. PDM_USBHLP_VERSION defines the current version. */
450 uint32_t u32Version;
451
452 /**
453 * Attaches a driver (chain) to the USB device.
454 *
455 * The first call for a LUN this will serve as a registration of the LUN. The pBaseInterface and
456 * the pszDesc string will be registered with that LUN and kept around for PDMR3QueryUSBDeviceLun().
457 *
458 * @returns VBox status code.
459 * @param pUsbIns The USB device instance.
460 * @param iLun The logical unit to attach.
461 * @param pBaseInterface Pointer to the base interface for that LUN. (device side / down)
462 * @param ppBaseInterface Where to store the pointer to the base interface. (driver side / up)
463 * @param pszDesc Pointer to a string describing the LUN. This string must remain valid
464 * for the live of the device instance.
465 */
466 DECLR3CALLBACKMEMBER(int, pfnDriverAttach,(PPDMUSBINS pUsbIns, RTUINT iLun, PPDMIBASE pBaseInterface, PPDMIBASE *ppBaseInterface, const char *pszDesc));
467
468 /**
469 * Assert that the current thread is the emulation thread.
470 *
471 * @returns True if correct.
472 * @returns False if wrong.
473 * @param pUsbIns The USB device instance.
474 * @param pszFile Filename of the assertion location.
475 * @param iLine Linenumber of the assertion location.
476 * @param pszFunction Function of the assertion location.
477 */
478 DECLR3CALLBACKMEMBER(bool, pfnAssertEMT,(PPDMUSBINS pUsbIns, const char *pszFile, unsigned iLine, const char *pszFunction));
479
480 /**
481 * Assert that the current thread is NOT the emulation thread.
482 *
483 * @returns True if correct.
484 * @returns False if wrong.
485 * @param pUsbIns The USB device instance.
486 * @param pszFile Filename of the assertion location.
487 * @param iLine Linenumber of the assertion location.
488 * @param pszFunction Function of the assertion location.
489 */
490 DECLR3CALLBACKMEMBER(bool, pfnAssertOther,(PPDMUSBINS pUsbIns, const char *pszFile, unsigned iLine, const char *pszFunction));
491
492 /**
493 * Stops the VM and enters the debugger to look at the guest state.
494 *
495 * Use the PDMUsbDBGFStop() inline function with the RT_SRC_POS macro instead of
496 * invoking this function directly.
497 *
498 * @returns VBox status code which must be passed up to the VMM.
499 * @param pUsbIns The USB device instance.
500 * @param pszFile Filename of the assertion location.
501 * @param iLine The linenumber of the assertion location.
502 * @param pszFunction Function of the assertion location.
503 * @param pszFormat Message. (optional)
504 * @param va Message parameters.
505 */
506 DECLR3CALLBACKMEMBER(int, pfnDBGFStopV,(PPDMUSBINS pUsbIns, const char *pszFile, unsigned iLine, const char *pszFunction,
507 const char *pszFormat, va_list va) RT_IPRT_FORMAT_ATTR(5, 0));
508
509 /**
510 * Register a info handler with DBGF,
511 *
512 * @returns VBox status code.
513 * @param pUsbIns The USB device instance.
514 * @param pszName The identifier of the info.
515 * @param pszDesc The description of the info and any arguments the handler may take.
516 * @param pfnHandler The handler function to be called to display the info.
517 */
518 DECLR3CALLBACKMEMBER(int, pfnDBGFInfoRegister,(PPDMUSBINS pUsbIns, const char *pszName, const char *pszDesc, PFNDBGFHANDLERUSB pfnHandler));
519
520 /**
521 * Allocate memory which is associated with current VM instance
522 * and automatically freed on it's destruction.
523 *
524 * @returns Pointer to allocated memory. The memory is *NOT* zero-ed.
525 * @param pUsbIns The USB device instance.
526 * @param cb Number of bytes to allocate.
527 */
528 DECLR3CALLBACKMEMBER(void *, pfnMMHeapAlloc,(PPDMUSBINS pUsbIns, size_t cb));
529
530 /**
531 * Allocate memory which is associated with current VM instance
532 * and automatically freed on it's destruction. The memory is ZEROed.
533 *
534 * @returns Pointer to allocated memory. The memory is *NOT* zero-ed.
535 * @param pUsbIns The USB device instance.
536 * @param cb Number of bytes to allocate.
537 */
538 DECLR3CALLBACKMEMBER(void *, pfnMMHeapAllocZ,(PPDMUSBINS pUsbIns, size_t cb));
539
540 /**
541 * Create a queue.
542 *
543 * @returns VBox status code.
544 * @param pUsbIns The USB device instance.
545 * @param cbItem Size a queue item.
546 * @param cItems Number of items in the queue.
547 * @param cMilliesInterval Number of milliseconds between polling the queue.
548 * If 0 then the emulation thread will be notified whenever an item arrives.
549 * @param pfnCallback The consumer function.
550 * @param pszName The queue base name. The instance number will be
551 * appended automatically.
552 * @param ppQueue Where to store the queue handle on success.
553 * @thread The emulation thread.
554 */
555 DECLR3CALLBACKMEMBER(int, pfnPDMQueueCreate,(PPDMUSBINS pUsbIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval,
556 PFNPDMQUEUEUSB pfnCallback, const char *pszName, PPDMQUEUE *ppQueue));
557
558 /**
559 * Register a save state data unit.
560 *
561 * @returns VBox status.
562 * @param pUsbIns The USB device instance.
563 * @param uVersion Data layout version number.
564 * @param cbGuess The approximate amount of data in the unit.
565 * Only for progress indicators.
566 *
567 * @param pfnLivePrep Prepare live save callback, optional.
568 * @param pfnLiveExec Execute live save callback, optional.
569 * @param pfnLiveVote Vote live save callback, optional.
570 *
571 * @param pfnSavePrep Prepare save callback, optional.
572 * @param pfnSaveExec Execute save callback, optional.
573 * @param pfnSaveDone Done save callback, optional.
574 *
575 * @param pfnLoadPrep Prepare load callback, optional.
576 * @param pfnLoadExec Execute load callback, optional.
577 * @param pfnLoadDone Done load callback, optional.
578 */
579 DECLR3CALLBACKMEMBER(int, pfnSSMRegister,(PPDMUSBINS pUsbIns, uint32_t uVersion, size_t cbGuess,
580 PFNSSMUSBLIVEPREP pfnLivePrep, PFNSSMUSBLIVEEXEC pfnLiveExec, PFNSSMUSBLIVEVOTE pfnLiveVote,
581 PFNSSMUSBSAVEPREP pfnSavePrep, PFNSSMUSBSAVEEXEC pfnSaveExec, PFNSSMUSBSAVEDONE pfnSaveDone,
582 PFNSSMUSBLOADPREP pfnLoadPrep, PFNSSMUSBLOADEXEC pfnLoadExec, PFNSSMUSBLOADDONE pfnLoadDone));
583
584 /**
585 * Register a STAM sample.
586 *
587 * Use the PDMUsbHlpSTAMRegister wrapper.
588 *
589 * @returns VBox status.
590 * @param pUsbIns The USB device instance.
591 * @param pvSample Pointer to the sample.
592 * @param enmType Sample type. This indicates what pvSample is pointing at.
593 * @param enmVisibility Visibility type specifying whether unused statistics should be visible or not.
594 * @param enmUnit Sample unit.
595 * @param pszDesc Sample description.
596 * @param pszName The sample name format string.
597 * @param va Arguments to the format string.
598 */
599 DECLR3CALLBACKMEMBER(void, pfnSTAMRegisterV,(PPDMUSBINS pUsbIns, void *pvSample, STAMTYPE enmType,
600 STAMVISIBILITY enmVisibility, STAMUNIT enmUnit, const char *pszDesc,
601 const char *pszName, va_list va) RT_IPRT_FORMAT_ATTR(7, 0));
602
603 /**
604 * Creates a timer.
605 *
606 * @returns VBox status.
607 * @param pUsbIns The USB device instance.
608 * @param enmClock The clock to use on this timer.
609 * @param pfnCallback Callback function.
610 * @param pvUser User argument for the callback.
611 * @param fFlags Flags, see TMTIMER_FLAGS_*.
612 * @param pszDesc Pointer to description string which must stay around
613 * until the timer is fully destroyed (i.e. a bit after TMTimerDestroy()).
614 * @param ppTimer Where to store the timer on success.
615 */
616 DECLR3CALLBACKMEMBER(int, pfnTMTimerCreate,(PPDMUSBINS pUsbIns, TMCLOCK enmClock, PFNTMTIMERUSB pfnCallback, void *pvUser,
617 uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer));
618
619 /**
620 * Set the VM error message
621 *
622 * @returns rc.
623 * @param pUsbIns The USB device instance.
624 * @param rc VBox status code.
625 * @param SRC_POS Use RT_SRC_POS.
626 * @param pszFormat Error message format string.
627 * @param va Error message arguments.
628 */
629 DECLR3CALLBACKMEMBER(int, pfnVMSetErrorV,(PPDMUSBINS pUsbIns, int rc, RT_SRC_POS_DECL,
630 const char *pszFormat, va_list va) RT_IPRT_FORMAT_ATTR(6, 0));
631
632 /**
633 * Set the VM runtime error message
634 *
635 * @returns VBox status code.
636 * @param pUsbIns The USB device instance.
637 * @param fFlags The action flags. See VMSETRTERR_FLAGS_*.
638 * @param pszErrorId Error ID string.
639 * @param pszFormat Error message format string.
640 * @param va Error message arguments.
641 */
642 DECLR3CALLBACKMEMBER(int, pfnVMSetRuntimeErrorV,(PPDMUSBINS pUsbIns, uint32_t fFlags, const char *pszErrorId,
643 const char *pszFormat, va_list va) RT_IPRT_FORMAT_ATTR(4, 0));
644
645 /**
646 * Gets the VM state.
647 *
648 * @returns VM state.
649 * @param pUsbIns The USB device instance.
650 * @thread Any thread (just keep in mind that it's volatile info).
651 */
652 DECLR3CALLBACKMEMBER(VMSTATE, pfnVMState, (PPDMUSBINS pUsbIns));
653
654 /**
655 * Creates a PDM thread.
656 *
657 * This differs from the RTThreadCreate() API in that PDM takes care of suspending,
658 * resuming, and destroying the thread as the VM state changes.
659 *
660 * @returns VBox status code.
661 * @param pUsbIns The USB device instance.
662 * @param ppThread Where to store the thread 'handle'.
663 * @param pvUser The user argument to the thread function.
664 * @param pfnThread The thread function.
665 * @param pfnWakeup The wakup callback. This is called on the EMT
666 * thread when a state change is pending.
667 * @param cbStack See RTThreadCreate.
668 * @param enmType See RTThreadCreate.
669 * @param pszName See RTThreadCreate.
670 */
671 DECLR3CALLBACKMEMBER(int, pfnThreadCreate,(PPDMUSBINS pUsbIns, PPPDMTHREAD ppThread, void *pvUser, PFNPDMTHREADUSB pfnThread,
672 PFNPDMTHREADWAKEUPUSB pfnWakeup, size_t cbStack, RTTHREADTYPE enmType, const char *pszName));
673
674 /**
675 * Set up asynchronous handling of a suspend, reset or power off notification.
676 *
677 * This shall only be called when getting the notification. It must be called
678 * for each one.
679 *
680 * @returns VBox status code.
681 * @param pUsbIns The USB device instance.
682 * @param pfnAsyncNotify The callback.
683 * @thread EMT(0)
684 */
685 DECLR3CALLBACKMEMBER(int, pfnSetAsyncNotification, (PPDMUSBINS pUSbIns, PFNPDMUSBASYNCNOTIFY pfnAsyncNotify));
686
687 /**
688 * Notify EMT(0) that the device has completed the asynchronous notification
689 * handling.
690 *
691 * This can be called at any time, spurious calls will simply be ignored.
692 *
693 * @param pUsbIns The USB device instance.
694 * @thread Any
695 */
696 DECLR3CALLBACKMEMBER(void, pfnAsyncNotificationCompleted, (PPDMUSBINS pUsbIns));
697
698 /**
699 * Gets the reason for the most recent VM suspend.
700 *
701 * @returns The suspend reason. VMSUSPENDREASON_INVALID is returned if no
702 * suspend has been made or if the pUsbIns is invalid.
703 * @param pUsbIns The driver instance.
704 */
705 DECLR3CALLBACKMEMBER(VMSUSPENDREASON, pfnVMGetSuspendReason,(PPDMUSBINS pUsbIns));
706
707 /**
708 * Gets the reason for the most recent VM resume.
709 *
710 * @returns The resume reason. VMRESUMEREASON_INVALID is returned if no
711 * resume has been made or if the pUsbIns is invalid.
712 * @param pUsbIns The driver instance.
713 */
714 DECLR3CALLBACKMEMBER(VMRESUMEREASON, pfnVMGetResumeReason,(PPDMUSBINS pUsbIns));
715
716 /** @name Space reserved for minor interface changes.
717 * @{ */
718 DECLR3CALLBACKMEMBER(void, pfnReserved0,(PPDMUSBINS pUsbIns));
719 DECLR3CALLBACKMEMBER(void, pfnReserved1,(PPDMUSBINS pUsbIns));
720 DECLR3CALLBACKMEMBER(void, pfnReserved2,(PPDMUSBINS pUsbIns));
721 DECLR3CALLBACKMEMBER(void, pfnReserved3,(PPDMUSBINS pUsbIns));
722 DECLR3CALLBACKMEMBER(void, pfnReserved4,(PPDMUSBINS pUsbIns));
723 DECLR3CALLBACKMEMBER(void, pfnReserved5,(PPDMUSBINS pUsbIns));
724 DECLR3CALLBACKMEMBER(void, pfnReserved6,(PPDMUSBINS pUsbIns));
725 DECLR3CALLBACKMEMBER(void, pfnReserved7,(PPDMUSBINS pUsbIns));
726 DECLR3CALLBACKMEMBER(void, pfnReserved8,(PPDMUSBINS pUsbIns));
727 DECLR3CALLBACKMEMBER(void, pfnReserved9,(PPDMUSBINS pUsbIns));
728 /** @} */
729
730 /** Just a safety precaution. */
731 uint32_t u32TheEnd;
732} PDMUSBHLP;
733/** Pointer PDM USB Device API. */
734typedef PDMUSBHLP *PPDMUSBHLP;
735/** Pointer const PDM USB Device API. */
736typedef const PDMUSBHLP *PCPDMUSBHLP;
737
738/** Current USBHLP version number. */
739#define PDM_USBHLP_VERSION PDM_VERSION_MAKE(0xeefe, 3, 0)
740
741#endif /* IN_RING3 */
742
743/**
744 * PDM USB Device Instance.
745 */
746typedef struct PDMUSBINS
747{
748 /** Structure version. PDM_USBINS_VERSION defines the current version. */
749 uint32_t u32Version;
750 /** USB device instance number. */
751 uint32_t iInstance;
752 /** The base interface of the device.
753 * The device constructor initializes this if it has any device level
754 * interfaces to export. To obtain this interface call PDMR3QueryUSBDevice(). */
755 PDMIBASE IBase;
756#if HC_ARCH_BITS == 32
757 uint32_t u32Alignment; /**< Alignment padding. */
758#endif
759
760 /** Internal data. */
761 union
762 {
763#ifdef PDMUSBINSINT_DECLARED
764 PDMUSBINSINT s;
765#endif
766 uint8_t padding[HC_ARCH_BITS == 32 ? 96 : 128];
767 } Internal;
768
769 /** Pointer the PDM USB Device API. */
770 R3PTRTYPE(PCPDMUSBHLP) pHlpR3;
771 /** Pointer to the USB device registration structure. */
772 R3PTRTYPE(PCPDMUSBREG) pReg;
773 /** Configuration handle. */
774 R3PTRTYPE(PCFGMNODE) pCfg;
775 /** The (device) global configuration handle. */
776 R3PTRTYPE(PCFGMNODE) pCfgGlobal;
777 /** Pointer to device instance data. */
778 R3PTRTYPE(void *) pvInstanceDataR3;
779 /** Pointer to the VUSB Device structure.
780 * Internal to VUSB, don't touch.
781 * @todo Moved this to PDMUSBINSINT. */
782 R3PTRTYPE(void *) pvVUsbDev2;
783 /** Device name for using when logging.
784 * The constructor sets this and the destructor frees it. */
785 R3PTRTYPE(char *) pszName;
786 /** Tracing indicator. */
787 uint32_t fTracing;
788 /** The tracing ID of this device. */
789 uint32_t idTracing;
790 /** The port/device speed. HCs and emulated devices need to know. */
791 VUSBSPEED enmSpeed;
792
793 /** Padding to make achInstanceData aligned at 32 byte boundary. */
794 uint32_t au32Padding[HC_ARCH_BITS == 32 ? 2 : 3];
795
796 /** Device instance data. The size of this area is defined
797 * in the PDMUSBREG::cbInstanceData field. */
798 char achInstanceData[8];
799} PDMUSBINS;
800
801/** Current USBINS version number. */
802#define PDM_USBINS_VERSION PDM_VERSION_MAKE(0xeefd, 3, 0)
803
804/**
805 * Checks the structure versions of the USB device instance and USB device
806 * helpers, returning if they are incompatible.
807 *
808 * This shall be the first statement of the constructor!
809 *
810 * @param pUsbIns The USB device instance pointer.
811 */
812#define PDMUSB_CHECK_VERSIONS_RETURN(pUsbIns) \
813 do \
814 { \
815 PPDMUSBINS pUsbInsTypeCheck = (pUsbIns); NOREF(pUsbInsTypeCheck); \
816 AssertLogRelMsgReturn(PDM_VERSION_ARE_COMPATIBLE((pUsbIns)->u32Version, PDM_USBINS_VERSION), \
817 ("DevIns=%#x mine=%#x\n", (pUsbIns)->u32Version, PDM_USBINS_VERSION), \
818 VERR_PDM_USBINS_VERSION_MISMATCH); \
819 AssertLogRelMsgReturn(PDM_VERSION_ARE_COMPATIBLE((pUsbIns)->pHlpR3->u32Version, PDM_USBHLP_VERSION), \
820 ("DevHlp=%#x mine=%#x\n", (pUsbIns)->pHlpR3->u32Version, PDM_USBHLP_VERSION), \
821 VERR_PDM_USBHLPR3_VERSION_MISMATCH); \
822 } while (0)
823
824/**
825 * Quietly checks the structure versions of the USB device instance and
826 * USB device helpers, returning if they are incompatible.
827 *
828 * This shall be invoked as the first statement in the destructor!
829 *
830 * @param pUsbIns The USB device instance pointer.
831 */
832#define PDMUSB_CHECK_VERSIONS_RETURN_VOID(pUsbIns) \
833 do \
834 { \
835 PPDMUSBINS pUsbInsTypeCheck = (pUsbIns); NOREF(pUsbInsTypeCheck); \
836 if (RT_LIKELY(PDM_VERSION_ARE_COMPATIBLE((pUsbIns)->u32Version, PDM_USBINS_VERSION) )) \
837 { /* likely */ } else return; \
838 if (RT_LIKELY(PDM_VERSION_ARE_COMPATIBLE((pUsbIns)->pHlpR3->u32Version, PDM_USBHLP_VERSION) )) \
839 { /* likely */ } else return; \
840 } while (0)
841
842
843/** Converts a pointer to the PDMUSBINS::IBase to a pointer to PDMUSBINS. */
844#define PDMIBASE_2_PDMUSB(pInterface) ( (PPDMUSBINS)((char *)(pInterface) - RT_UOFFSETOF(PDMUSBINS, IBase)) )
845
846
847/** @def PDMUSB_ASSERT_EMT
848 * Assert that the current thread is the emulation thread.
849 */
850#ifdef VBOX_STRICT
851# define PDMUSB_ASSERT_EMT(pUsbIns) pUsbIns->pHlpR3->pfnAssertEMT(pUsbIns, __FILE__, __LINE__, __FUNCTION__)
852#else
853# define PDMUSB_ASSERT_EMT(pUsbIns) do { } while (0)
854#endif
855
856/** @def PDMUSB_ASSERT_OTHER
857 * Assert that the current thread is NOT the emulation thread.
858 */
859#ifdef VBOX_STRICT
860# define PDMUSB_ASSERT_OTHER(pUsbIns) pUsbIns->pHlpR3->pfnAssertOther(pUsbIns, __FILE__, __LINE__, __FUNCTION__)
861#else
862# define PDMUSB_ASSERT_OTHER(pUsbIns) do { } while (0)
863#endif
864
865/** @def PDMUSB_SET_ERROR
866 * Set the VM error. See PDMUsbHlpVMSetError() for printf like message
867 * formatting.
868 */
869#define PDMUSB_SET_ERROR(pUsbIns, rc, pszError) \
870 PDMUsbHlpVMSetError(pUsbIns, rc, RT_SRC_POS, "%s", pszError)
871
872/** @def PDMUSB_SET_RUNTIME_ERROR
873 * Set the VM runtime error. See PDMUsbHlpVMSetRuntimeError() for printf like
874 * message formatting.
875 */
876#define PDMUSB_SET_RUNTIME_ERROR(pUsbIns, fFlags, pszErrorId, pszError) \
877 PDMUsbHlpVMSetRuntimeError(pUsbIns, fFlags, pszErrorId, "%s", pszError)
878
879
880#ifdef IN_RING3
881
882/**
883 * @copydoc PDMUSBHLP::pfnDriverAttach
884 */
885DECLINLINE(int) PDMUsbHlpDriverAttach(PPDMUSBINS pUsbIns, RTUINT iLun, PPDMIBASE pBaseInterface, PPDMIBASE *ppBaseInterface, const char *pszDesc)
886{
887 return pUsbIns->pHlpR3->pfnDriverAttach(pUsbIns, iLun, pBaseInterface, ppBaseInterface, pszDesc);
888}
889
890/**
891 * VBOX_STRICT wrapper for pHlpR3->pfnDBGFStopV.
892 *
893 * @returns VBox status code which must be passed up to the VMM.
894 * @param pUsbIns Device instance.
895 * @param SRC_POS Use RT_SRC_POS.
896 * @param pszFormat Message. (optional)
897 * @param ... Message parameters.
898 */
899DECLINLINE(int) RT_IPRT_FORMAT_ATTR(5, 6) PDMUsbDBGFStop(PPDMUSBINS pUsbIns, RT_SRC_POS_DECL, const char *pszFormat, ...)
900{
901#ifdef VBOX_STRICT
902 int rc;
903 va_list va;
904 va_start(va, pszFormat);
905 rc = pUsbIns->pHlpR3->pfnDBGFStopV(pUsbIns, RT_SRC_POS_ARGS, pszFormat, va);
906 va_end(va);
907 return rc;
908#else
909 NOREF(pUsbIns);
910 NOREF(pszFile);
911 NOREF(iLine);
912 NOREF(pszFunction);
913 NOREF(pszFormat);
914 return VINF_SUCCESS;
915#endif
916}
917
918/**
919 * @copydoc PDMUSBHLP::pfnVMState
920 */
921DECLINLINE(VMSTATE) PDMUsbHlpVMState(PPDMUSBINS pUsbIns)
922{
923 return pUsbIns->pHlpR3->pfnVMState(pUsbIns);
924}
925
926/**
927 * @copydoc PDMUSBHLP::pfnThreadCreate
928 */
929DECLINLINE(int) PDMUsbHlpThreadCreate(PPDMUSBINS pUsbIns, PPPDMTHREAD ppThread, void *pvUser, PFNPDMTHREADUSB pfnThread,
930 PFNPDMTHREADWAKEUPUSB pfnWakeup, size_t cbStack, RTTHREADTYPE enmType, const char *pszName)
931{
932 return pUsbIns->pHlpR3->pfnThreadCreate(pUsbIns, ppThread, pvUser, pfnThread, pfnWakeup, cbStack, enmType, pszName);
933}
934
935
936/**
937 * @copydoc PDMUSBHLP::pfnSetAsyncNotification
938 */
939DECLINLINE(int) PDMUsbHlpSetAsyncNotification(PPDMUSBINS pUsbIns, PFNPDMUSBASYNCNOTIFY pfnAsyncNotify)
940{
941 return pUsbIns->pHlpR3->pfnSetAsyncNotification(pUsbIns, pfnAsyncNotify);
942}
943
944/**
945 * @copydoc PDMUSBHLP::pfnAsyncNotificationCompleted
946 */
947DECLINLINE(void) PDMUsbHlpAsyncNotificationCompleted(PPDMUSBINS pUsbIns)
948{
949 pUsbIns->pHlpR3->pfnAsyncNotificationCompleted(pUsbIns);
950}
951
952/**
953 * Set the VM error message
954 *
955 * @returns rc.
956 * @param pUsbIns The USB device instance.
957 * @param rc VBox status code.
958 * @param SRC_POS Use RT_SRC_POS.
959 * @param pszFormat Error message format string.
960 * @param ... Error message arguments.
961 */
962DECLINLINE(int) RT_IPRT_FORMAT_ATTR(6, 7) PDMUsbHlpVMSetError(PPDMUSBINS pUsbIns, int rc, RT_SRC_POS_DECL,
963 const char *pszFormat, ...)
964{
965 va_list va;
966 va_start(va, pszFormat);
967 rc = pUsbIns->pHlpR3->pfnVMSetErrorV(pUsbIns, rc, RT_SRC_POS_ARGS, pszFormat, va);
968 va_end(va);
969 return rc;
970}
971
972/**
973 * @copydoc PDMUSBHLP::pfnMMHeapAlloc
974 */
975DECLINLINE(void *) PDMUsbHlpMMHeapAlloc(PPDMUSBINS pUsbIns, size_t cb)
976{
977 return pUsbIns->pHlpR3->pfnMMHeapAlloc(pUsbIns, cb);
978}
979
980/**
981 * @copydoc PDMUSBHLP::pfnMMHeapAllocZ
982 */
983DECLINLINE(void *) PDMUsbHlpMMHeapAllocZ(PPDMUSBINS pUsbIns, size_t cb)
984{
985 return pUsbIns->pHlpR3->pfnMMHeapAllocZ(pUsbIns, cb);
986}
987
988/**
989 * Frees memory allocated by PDMUsbHlpMMHeapAlloc or PDMUsbHlpMMHeapAllocZ.
990 *
991 * @param pUsbIns The USB device instance.
992 * @param pv The memory to free. NULL is fine.
993 */
994DECLINLINE(void) PDMUsbHlpMMHeapFree(PPDMUSBINS pUsbIns, void *pv)
995{
996 NOREF(pUsbIns);
997 MMR3HeapFree(pv);
998}
999
1000/**
1001 * @copydoc PDMUSBHLP::pfnTMTimerCreate
1002 */
1003DECLINLINE(int) PDMUsbHlpTMTimerCreate(PPDMUSBINS pUsbIns, TMCLOCK enmClock, PFNTMTIMERUSB pfnCallback, void *pvUser,
1004 uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer)
1005{
1006 return pUsbIns->pHlpR3->pfnTMTimerCreate(pUsbIns, enmClock, pfnCallback, pvUser, fFlags, pszDesc, ppTimer);
1007}
1008
1009/**
1010 * @copydoc PDMUSBHLP::pfnSSMRegister
1011 */
1012DECLINLINE(int) PDMUsbHlpSSMRegister(PPDMUSBINS pUsbIns, uint32_t uVersion, size_t cbGuess,
1013 PFNSSMUSBLIVEPREP pfnLivePrep, PFNSSMUSBLIVEEXEC pfnLiveExec, PFNSSMUSBLIVEVOTE pfnLiveVote,
1014 PFNSSMUSBSAVEPREP pfnSavePrep, PFNSSMUSBSAVEEXEC pfnSaveExec, PFNSSMUSBSAVEDONE pfnSaveDone,
1015 PFNSSMUSBLOADPREP pfnLoadPrep, PFNSSMUSBLOADEXEC pfnLoadExec, PFNSSMUSBLOADDONE pfnLoadDone)
1016{
1017 return pUsbIns->pHlpR3->pfnSSMRegister(pUsbIns, uVersion, cbGuess,
1018 pfnLivePrep, pfnLiveExec, pfnLiveVote,
1019 pfnSavePrep, pfnSaveExec, pfnSaveDone,
1020 pfnLoadPrep, pfnLoadExec, pfnLoadDone);
1021}
1022
1023#endif /* IN_RING3 */
1024
1025
1026
1027/** Pointer to callbacks provided to the VBoxUsbRegister() call. */
1028typedef const struct PDMUSBREGCB *PCPDMUSBREGCB;
1029
1030/**
1031 * Callbacks for VBoxUSBDeviceRegister().
1032 */
1033typedef struct PDMUSBREGCB
1034{
1035 /** Interface version.
1036 * This is set to PDM_USBREG_CB_VERSION. */
1037 uint32_t u32Version;
1038
1039 /**
1040 * Registers a device with the current VM instance.
1041 *
1042 * @returns VBox status code.
1043 * @param pCallbacks Pointer to the callback table.
1044 * @param pReg Pointer to the USB device registration record.
1045 * This data must be permanent and readonly.
1046 */
1047 DECLR3CALLBACKMEMBER(int, pfnRegister,(PCPDMUSBREGCB pCallbacks, PCPDMUSBREG pReg));
1048} PDMUSBREGCB;
1049
1050/** Current version of the PDMUSBREGCB structure. */
1051#define PDM_USBREG_CB_VERSION PDM_VERSION_MAKE(0xeefc, 1, 0)
1052
1053
1054/**
1055 * The VBoxUsbRegister callback function.
1056 *
1057 * PDM will invoke this function after loading a USB device module and letting
1058 * the module decide which devices to register and how to handle conflicts.
1059 *
1060 * @returns VBox status code.
1061 * @param pCallbacks Pointer to the callback table.
1062 * @param u32Version VBox version number.
1063 */
1064typedef DECLCALLBACK(int) FNPDMVBOXUSBREGISTER(PCPDMUSBREGCB pCallbacks, uint32_t u32Version);
1065
1066VMMR3DECL(int) PDMR3UsbCreateEmulatedDevice(PUVM pUVM, const char *pszDeviceName, PCFGMNODE pDeviceNode, PCRTUUID pUuid,
1067 const char *pszCaptureFilename);
1068VMMR3DECL(int) PDMR3UsbCreateProxyDevice(PUVM pUVM, PCRTUUID pUuid, const char *pszBackend, const char *pszAddress, void *pvBackend,
1069 VUSBSPEED enmSpeed, uint32_t fMaskedIfs, const char *pszCaptureFilename);
1070VMMR3DECL(int) PDMR3UsbDetachDevice(PUVM pUVM, PCRTUUID pUuid);
1071VMMR3DECL(bool) PDMR3UsbHasHub(PUVM pUVM);
1072VMMR3DECL(int) PDMR3UsbDriverAttach(PUVM pUVM, const char *pszDevice, unsigned iDevIns, unsigned iLun, uint32_t fFlags,
1073 PPPDMIBASE ppBase);
1074VMMR3DECL(int) PDMR3UsbDriverDetach(PUVM pUVM, const char *pszDevice, unsigned iDevIns, unsigned iLun,
1075 const char *pszDriver, unsigned iOccurrence, uint32_t fFlags);
1076VMMR3DECL(int) PDMR3UsbQueryLun(PUVM pUVM, const char *pszDevice, unsigned iInstance, unsigned iLun, PPDMIBASE *ppBase);
1077VMMR3DECL(int) PDMR3UsbQueryDriverOnLun(PUVM pUVM, const char *pszDevice, unsigned iInstance, unsigned iLun,
1078 const char *pszDriver, PPPDMIBASE ppBase);
1079
1080/** @} */
1081
1082RT_C_DECLS_END
1083
1084#endif
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette