VirtualBox

source: vbox/trunk/src/VBox/Devices/USB/VUSBInternal.h@ 59704

Last change on this file since 59704 was 59704, checked in by vboxsync, 9 years ago

VUSB: Some structural cleanup (#3 Make the VUSB URB specific data private to the VUSB stack, some interface changes required for XHCI because it previously required access to some VUsb members)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 18.6 KB
Line 
1/* $Id: VUSBInternal.h 59704 2016-02-16 14:13:25Z vboxsync $ */
2/** @file
3 * Virtual USB - Internal header.
4 *
5 * This subsystem implements USB devices in a host controller independent
6 * way. All the host controller code has to do is use VUSBHUB for its
7 * root hub implementation and any emulated USB device may be plugged into
8 * the virtual bus.
9 */
10
11/*
12 * Copyright (C) 2006-2015 Oracle Corporation
13 *
14 * This file is part of VirtualBox Open Source Edition (OSE), as
15 * available from http://www.virtualbox.org. This file is free software;
16 * you can redistribute it and/or modify it under the terms of the GNU
17 * General Public License (GPL) as published by the Free Software
18 * Foundation, in version 2 as it comes in the "COPYING" file of the
19 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
20 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
21 */
22
23#ifndef ___VUSBInternal_h
24#define ___VUSBInternal_h
25
26#include <VBox/cdefs.h>
27#include <VBox/types.h>
28#include <VBox/vusb.h>
29#include <VBox/vmm/stam.h>
30#include <iprt/assert.h>
31#include <iprt/req.h>
32
33#include "VUSBSniffer.h"
34
35RT_C_DECLS_BEGIN
36
37
38/** @name Internal Device Operations, Structures and Constants.
39 * @{
40 */
41
42/** Pointer to a Virtual USB device (core). */
43typedef struct VUSBDEV *PVUSBDEV;
44/** Pointer to a VUSB hub device. */
45typedef struct VUSBHUB *PVUSBHUB;
46/** Pointer to a VUSB root hub. */
47typedef struct VUSBROOTHUB *PVUSBROOTHUB;
48
49
50/** Number of the default control endpoint */
51#define VUSB_PIPE_DEFAULT 0
52
53/** @name Device addresses
54 * @{ */
55#define VUSB_DEFAULT_ADDRESS 0
56#define VUSB_INVALID_ADDRESS UINT8_C(0xff)
57/** @} */
58
59/** @name Feature bits (1<<FEATURE for the u16Status bit)
60 * @{ */
61#define VUSB_DEV_SELF_POWERED 0
62#define VUSB_DEV_REMOTE_WAKEUP 1
63#define VUSB_EP_HALT 0
64/** @} */
65
66/** Maximum number of endpoint addresses */
67#define VUSB_PIPE_MAX 16
68
69/**
70 * The VUSB URB data.
71 */
72typedef struct VUSBURBVUSBINT
73{
74 /** URB chain pointer. */
75 PVUSBURB pNext;
76 /** URB chain pointer. */
77 PVUSBURB *ppPrev;
78 /** Pointer to the original for control messages. */
79 PVUSBURB pCtrlUrb;
80 /** Pointer to the VUSB device.
81 * This may be NULL if the destination address is invalid. */
82 PVUSBDEV pDev;
83 /** Specific to the pfnFree function. */
84 void *pvFreeCtx;
85 /**
86 * Callback which will free the URB once it's reaped and completed.
87 * @param pUrb The URB.
88 */
89 DECLCALLBACKMEMBER(void, pfnFree)(PVUSBURB pUrb);
90 /** Submit timestamp. (logging only) */
91 uint64_t u64SubmitTS;
92 /** The allocated data length. */
93 uint32_t cbDataAllocated;
94 /** Opaque data holder when this is a read-ahead URB. */
95 void *pvReadAhead;
96} VUSBURBVUSBINT;
97
98/**
99 * Control-pipe stages.
100 */
101typedef enum CTLSTAGE
102{
103 /** the control pipe is in the setup stage. */
104 CTLSTAGE_SETUP = 0,
105 /** the control pipe is in the data stage. */
106 CTLSTAGE_DATA,
107 /** the control pipe is in the status stage. */
108 CTLSTAGE_STATUS
109} CTLSTAGE;
110
111/**
112 * Extra data for a control pipe.
113 *
114 * This is state information needed for the special multi-stage
115 * transfers performed on this kind of pipes.
116 */
117typedef struct vusb_ctrl_extra
118{
119 /** Current pipe stage. */
120 CTLSTAGE enmStage;
121 /** Success indicator. */
122 bool fOk;
123 /** Set if the message URB has been submitted. */
124 bool fSubmitted;
125 /** Pointer to the SETUP.
126 * This is a pointer to Urb->abData[0]. */
127 PVUSBSETUP pMsg;
128 /** Current DATA pointer.
129 * This starts at pMsg + 1 and is incremented at we read/write data. */
130 uint8_t *pbCur;
131 /** The amount of data left to read on IN operations.
132 * On OUT operations this is not used. */
133 uint32_t cbLeft;
134 /** The amount of data we can house.
135 * This starts at the default 8KB, and this structure will be reallocated to
136 * accommodate any larger request (unlikely). */
137 uint32_t cbMax;
138 /** The message URB. */
139 VUSBURB Urb;
140} VUSBCTRLEXTRA, *PVUSBCTRLEXTRA;
141
142void vusbMsgFreeExtraData(PVUSBCTRLEXTRA pExtra);
143void vusbMsgResetExtraData(PVUSBCTRLEXTRA pExtra);
144
145/** Opaque VUSB read ahead buffer management handle. */
146typedef struct VUSBREADAHEADINT *VUSBREADAHEAD;
147
148/**
149 * A VUSB pipe
150 */
151typedef struct vusb_pipe
152{
153 PCVUSBDESCENDPOINTEX in;
154 PCVUSBDESCENDPOINTEX out;
155 /** Pointer to the extra state data required to run a control pipe. */
156 PVUSBCTRLEXTRA pCtrl;
157 /** Critical section serializing access to the extra state data for a control pipe. */
158 RTCRITSECT CritSectCtrl;
159 /** Count of active async transfers. */
160 volatile uint32_t async;
161 /** Read ahead handle. */
162 VUSBREADAHEAD hReadAhead;
163} VUSBPIPE;
164/** Pointer to a VUSB pipe structure. */
165typedef VUSBPIPE *PVUSBPIPE;
166
167
168/**
169 * Interface state and possible settings.
170 */
171typedef struct vusb_interface_state
172{
173 /** Pointer to the interface descriptor of the currently selected (active)
174 * interface. */
175 PCVUSBDESCINTERFACEEX pCurIfDesc;
176 /** Pointer to the interface settings. */
177 PCVUSBINTERFACE pIf;
178} VUSBINTERFACESTATE;
179/** Pointer to interface state. */
180typedef VUSBINTERFACESTATE *PVUSBINTERFACESTATE;
181/** Pointer to const interface state. */
182typedef const VUSBINTERFACESTATE *PCVUSBINTERFACESTATE;
183
184
185/**
186 * A Virtual USB device (core).
187 *
188 * @implements VUSBIDEVICE
189 */
190typedef struct VUSBDEV
191{
192 /** The device interface exposed to the HCI. */
193 VUSBIDEVICE IDevice;
194 /** Pointer to the PDM USB device instance. */
195 PPDMUSBINS pUsbIns;
196 /** Next device in the chain maintained by the roothub. */
197 PVUSBDEV pNext;
198 /** Pointer to the next device with the same address hash. */
199 PVUSBDEV pNextHash;
200 /** Pointer to the hub this device is attached to. */
201 PVUSBHUB pHub;
202 /** The device state. */
203 VUSBDEVICESTATE volatile enmState;
204
205 /** The device address. */
206 uint8_t u8Address;
207 /** The new device address. */
208 uint8_t u8NewAddress;
209 /** The port. */
210 int16_t i16Port;
211 /** Device status. (VUSB_DEV_SELF_POWERED or not.) */
212 uint16_t u16Status;
213
214 /** Pointer to the descriptor cache.
215 * (Provided by the device thru the pfnGetDescriptorCache method.) */
216 PCPDMUSBDESCCACHE pDescCache;
217 /** Current configuration. */
218 PCVUSBDESCCONFIGEX pCurCfgDesc;
219
220 /** Current interface state (including alternate interface setting) - maximum
221 * valid index is config->bNumInterfaces
222 */
223 PVUSBINTERFACESTATE paIfStates;
224
225 /** Pipe/direction -> endpoint descriptor mapping */
226 VUSBPIPE aPipes[VUSB_PIPE_MAX];
227 /** Critical section protecting the active URB list. */
228 RTCRITSECT CritSectAsyncUrbs;
229 /** List of active async URBs. */
230 PVUSBURB pAsyncUrbHead;
231
232 /** Dumper state. */
233 union VUSBDEVURBDUMPERSTATE
234 {
235 /** The current scsi command. */
236 uint8_t u8ScsiCmd;
237 } Urb;
238
239 /** The reset timer handle. */
240 PTMTIMER pResetTimer;
241 /** Reset handler arguments. */
242 void *pvArgs;
243 /** URB submit and reap thread. */
244 RTTHREAD hUrbIoThread;
245 /** Request queue for executing tasks on the I/O thread which should be done
246 * synchronous and without any other thread accessing the USB device. */
247 RTREQQUEUE hReqQueueSync;
248 /** Sniffer instance for this device if configured. */
249 VUSBSNIFFER hSniffer;
250 /** Flag whether the URB I/O thread should terminate. */
251 bool volatile fTerminate;
252 /** Flag whether the I/O thread was woken up. */
253 bool volatile fWokenUp;
254#if HC_ARCH_BITS == 32
255 /** Align the size to a 8 byte boundary. */
256 bool afAlignment0[2];
257#endif
258} VUSBDEV;
259AssertCompileSizeAlignment(VUSBDEV, 8);
260
261
262int vusbDevInit(PVUSBDEV pDev, PPDMUSBINS pUsbIns, const char *pszCaptureFilename);
263void vusbDevDestroy(PVUSBDEV pDev);
264
265DECLINLINE(bool) vusbDevIsRh(PVUSBDEV pDev)
266{
267 return (pDev->pHub == (PVUSBHUB)pDev);
268}
269
270bool vusbDevDoSelectConfig(PVUSBDEV dev, PCVUSBDESCCONFIGEX pCfg);
271void vusbDevMapEndpoint(PVUSBDEV dev, PCVUSBDESCENDPOINTEX ep);
272int vusbDevDetach(PVUSBDEV pDev);
273DECLINLINE(PVUSBROOTHUB) vusbDevGetRh(PVUSBDEV pDev);
274size_t vusbDevMaxInterfaces(PVUSBDEV dev);
275
276void vusbDevSetAddress(PVUSBDEV pDev, uint8_t u8Address);
277bool vusbDevStandardRequest(PVUSBDEV pDev, int EndPt, PVUSBSETUP pSetup, void *pvBuf, uint32_t *pcbBuf);
278
279
280/** @} */
281
282
283/** @name Internal Hub Operations, Structures and Constants.
284 * @{
285 */
286
287
288/** Virtual method table for USB hub devices.
289 * Hub and roothub drivers need to implement these functions in addition to the
290 * vusb_dev_ops.
291 */
292typedef struct VUSBHUBOPS
293{
294 int (*pfnAttach)(PVUSBHUB pHub, PVUSBDEV pDev);
295 void (*pfnDetach)(PVUSBHUB pHub, PVUSBDEV pDev);
296} VUSBHUBOPS;
297/** Pointer to a const HUB method table. */
298typedef const VUSBHUBOPS *PCVUSBHUBOPS;
299
300/** A VUSB Hub Device - Hub and roothub drivers need to use this struct
301 * @todo eliminate this (PDM / roothubs only).
302 */
303typedef struct VUSBHUB
304{
305 VUSBDEV Dev;
306 PCVUSBHUBOPS pOps;
307 PVUSBROOTHUB pRootHub;
308 uint16_t cPorts;
309 uint16_t cDevices;
310 /** Name of the hub. Used for logging. */
311 char *pszName;
312} VUSBHUB;
313AssertCompileMemberAlignment(VUSBHUB, pOps, 8);
314AssertCompileSizeAlignment(VUSBHUB, 8);
315
316/** @} */
317
318
319/** @name Internal Root Hub Operations, Structures and Constants.
320 * @{
321 */
322
323/**
324 * Per transfer type statistics.
325 */
326typedef struct VUSBROOTHUBTYPESTATS
327{
328 STAMCOUNTER StatUrbsSubmitted;
329 STAMCOUNTER StatUrbsFailed;
330 STAMCOUNTER StatUrbsCancelled;
331
332 STAMCOUNTER StatReqBytes;
333 STAMCOUNTER StatReqReadBytes;
334 STAMCOUNTER StatReqWriteBytes;
335
336 STAMCOUNTER StatActBytes;
337 STAMCOUNTER StatActReadBytes;
338 STAMCOUNTER StatActWriteBytes;
339} VUSBROOTHUBTYPESTATS, *PVUSBROOTHUBTYPESTATS;
340
341
342
343/** The address hash table size. */
344#define VUSB_ADDR_HASHSZ 5
345
346/**
347 * The instance data of a root hub driver.
348 *
349 * This extends the generic VUSB hub.
350 *
351 * @implements VUSBIROOTHUBCONNECTOR
352 */
353typedef struct VUSBROOTHUB
354{
355 /** The HUB.
356 * @todo remove this? */
357 VUSBHUB Hub;
358 /** Address hash table. */
359 PVUSBDEV apAddrHash[VUSB_ADDR_HASHSZ];
360 /** The default address. */
361 PVUSBDEV pDefaultAddress;
362
363 /** Pointer to the driver instance. */
364 PPDMDRVINS pDrvIns;
365 /** Pointer to the root hub port interface we're attached to. */
366 PVUSBIROOTHUBPORT pIRhPort;
367 /** Connector interface exposed upwards. */
368 VUSBIROOTHUBCONNECTOR IRhConnector;
369
370 /** Critical section protecting the device list. */
371 RTCRITSECT CritSectDevices;
372 /** Chain of devices attached to this hub. */
373 PVUSBDEV pDevices;
374
375#if HC_ARCH_BITS == 32
376 uint32_t Alignment1;
377#endif
378
379 /** Availability Bitmap. */
380 VUSBPORTBITMAP Bitmap;
381
382 /** Critical section protecting the free list. */
383 RTCRITSECT CritSectFreeUrbs;
384 /** Chain of free URBs. (Singly linked) */
385 PVUSBURB pFreeUrbs;
386 /** Sniffer instance for the root hub. */
387 VUSBSNIFFER hSniffer;
388 /** The number of URBs in the pool. */
389 uint32_t cUrbsInPool;
390 /** Version of the attached Host Controller. */
391 uint32_t fHcVersions;
392 /** Size of the HCI specific data for each URB. */
393 size_t cbHci;
394 /** Size of the HCI specific TD. */
395 size_t cbHciTd;
396#ifdef LOG_ENABLED
397 /** A serial number for URBs submitted on the roothub instance.
398 * Only logging builds. */
399 uint32_t iSerial;
400 /** Alignment */
401 uint32_t Alignment2;
402#endif
403#ifdef VBOX_WITH_STATISTICS
404 VUSBROOTHUBTYPESTATS Total;
405 VUSBROOTHUBTYPESTATS aTypes[VUSBXFERTYPE_MSG];
406 STAMCOUNTER StatIsocReqPkts;
407 STAMCOUNTER StatIsocReqReadPkts;
408 STAMCOUNTER StatIsocReqWritePkts;
409 STAMCOUNTER StatIsocActPkts;
410 STAMCOUNTER StatIsocActReadPkts;
411 STAMCOUNTER StatIsocActWritePkts;
412 struct
413 {
414 STAMCOUNTER Pkts;
415 STAMCOUNTER Ok;
416 STAMCOUNTER Ok0;
417 STAMCOUNTER DataUnderrun;
418 STAMCOUNTER DataUnderrun0;
419 STAMCOUNTER DataOverrun;
420 STAMCOUNTER NotAccessed;
421 STAMCOUNTER Misc;
422 STAMCOUNTER Bytes;
423 } aStatIsocDetails[8];
424
425 STAMPROFILE StatReapAsyncUrbs;
426 STAMPROFILE StatSubmitUrb;
427#endif
428} VUSBROOTHUB;
429AssertCompileMemberAlignment(VUSBROOTHUB, IRhConnector, 8);
430AssertCompileMemberAlignment(VUSBROOTHUB, Bitmap, 8);
431AssertCompileMemberAlignment(VUSBROOTHUB, CritSectDevices, 8);
432AssertCompileMemberAlignment(VUSBROOTHUB, CritSectFreeUrbs, 8);
433#ifdef VBOX_WITH_STATISTICS
434AssertCompileMemberAlignment(VUSBROOTHUB, Total, 8);
435#endif
436
437/** Converts a pointer to VUSBROOTHUB::IRhConnector to a PVUSBROOTHUB. */
438#define VUSBIROOTHUBCONNECTOR_2_VUSBROOTHUB(pInterface) (PVUSBROOTHUB)( (uintptr_t)(pInterface) - RT_OFFSETOF(VUSBROOTHUB, IRhConnector) )
439
440/**
441 * URB cancellation modes
442 */
443typedef enum CANCELMODE
444{
445 /** complete the URB with an error (CRC). */
446 CANCELMODE_FAIL = 0,
447 /** do not change the URB contents. */
448 CANCELMODE_UNDO
449} CANCELMODE;
450
451/* @} */
452
453
454
455/** @name Internal URB Operations, Structures and Constants.
456 * @{ */
457int vusbUrbSubmit(PVUSBURB pUrb);
458void vusbUrbTrace(PVUSBURB pUrb, const char *pszMsg, bool fComplete);
459void vusbUrbDoReapAsync(PVUSBURB pHead, RTMSINTERVAL cMillies);
460void vusbUrbDoReapAsyncDev(PVUSBDEV pDev, RTMSINTERVAL cMillies);
461void vusbUrbCancel(PVUSBURB pUrb, CANCELMODE mode);
462void vusbUrbCancelAsync(PVUSBURB pUrb, CANCELMODE mode);
463void vusbUrbRipe(PVUSBURB pUrb);
464void vusbUrbCompletionRh(PVUSBURB pUrb);
465int vusbUrbSubmitHardError(PVUSBURB pUrb);
466int vusbUrbErrorRh(PVUSBURB pUrb);
467int vusbDevUrbIoThreadWakeup(PVUSBDEV pDev);
468int vusbDevUrbIoThreadCreate(PVUSBDEV pDev);
469int vusbDevUrbIoThreadDestroy(PVUSBDEV pDev);
470DECLHIDDEN(int) vusbDevIoThreadExecV(PVUSBDEV pDev, uint32_t fFlags, PFNRT pfnFunction, unsigned cArgs, va_list Args);
471DECLHIDDEN(int) vusbDevIoThreadExec(PVUSBDEV pDev, uint32_t fFlags, PFNRT pfnFunction, unsigned cArgs, ...);
472DECLHIDDEN(int) vusbDevIoThreadExecSync(PVUSBDEV pDev, PFNRT pfnFunction, unsigned cArgs, ...);
473DECLHIDDEN(int) vusbUrbCancelWorker(PVUSBURB pUrb, CANCELMODE enmMode);
474
475void vusbUrbCompletionReadAhead(PVUSBURB pUrb);
476VUSBREADAHEAD vusbReadAheadStart(PVUSBDEV pDev, PVUSBPIPE pPipe);
477void vusbReadAheadStop(VUSBREADAHEAD hReadAhead);
478int vusbUrbQueueAsyncRh(PVUSBURB pUrb);
479int vusbUrbSubmitBufferedRead(PVUSBURB pUrb, VUSBREADAHEAD hReadAhead);
480PVUSBURB vusbRhNewUrb(PVUSBROOTHUB pRh, uint8_t DstAddress, PVUSBDEV pDev, VUSBXFERTYPE enmType,
481 VUSBDIRECTION enmDir, uint32_t cbData, uint32_t cTds, const char *pszTag);
482
483
484DECLINLINE(void) vusbUrbUnlink(PVUSBURB pUrb)
485{
486 PVUSBDEV pDev = pUrb->pVUsb->pDev;
487
488 RTCritSectEnter(&pDev->CritSectAsyncUrbs);
489 *pUrb->pVUsb->ppPrev = pUrb->pVUsb->pNext;
490 if (pUrb->pVUsb->pNext)
491 pUrb->pVUsb->pNext->pVUsb->ppPrev = pUrb->pVUsb->ppPrev;
492 pUrb->pVUsb->pNext = NULL;
493 pUrb->pVUsb->ppPrev = NULL;
494 RTCritSectLeave(&pDev->CritSectAsyncUrbs);
495}
496
497/** @def vusbUrbAssert
498 * Asserts that a URB is valid.
499 */
500#ifdef VBOX_STRICT
501# define vusbUrbAssert(pUrb) do { \
502 AssertMsg(VALID_PTR((pUrb)), ("%p\n", (pUrb))); \
503 AssertMsg((pUrb)->u32Magic == VUSBURB_MAGIC, ("%#x", (pUrb)->u32Magic)); \
504 AssertMsg((pUrb)->enmState > VUSBURBSTATE_INVALID && (pUrb)->enmState < VUSBURBSTATE_END, \
505 ("%d\n", (pUrb)->enmState)); \
506 } while (0)
507#else
508# define vusbUrbAssert(pUrb) do {} while (0)
509#endif
510
511/**
512 * @def VUSBDEV_ASSERT_VALID_STATE
513 * Asserts that the give device state is valid.
514 */
515#define VUSBDEV_ASSERT_VALID_STATE(enmState) \
516 AssertMsg((enmState) > VUSB_DEVICE_STATE_INVALID && (enmState) < VUSB_DEVICE_STATE_DESTROYED, ("enmState=%#x\n", enmState));
517
518/** Executes a function synchronously. */
519#define VUSB_DEV_IO_THREAD_EXEC_FLAGS_SYNC RT_BIT_32(0)
520
521/** @} */
522
523
524
525
526/**
527 * Addresses are between 0 and 127 inclusive
528 */
529DECLINLINE(uint8_t) vusbHashAddress(uint8_t Address)
530{
531 uint8_t u8Hash = Address;
532 u8Hash ^= (Address >> 2);
533 u8Hash ^= (Address >> 3);
534 u8Hash %= VUSB_ADDR_HASHSZ;
535 return u8Hash;
536}
537
538
539/**
540 * Gets the roothub of a device.
541 *
542 * @returns Pointer to the roothub instance the device is attached to.
543 * @returns NULL if not attached to any hub.
544 * @param pDev Pointer to the device in question.
545 */
546DECLINLINE(PVUSBROOTHUB) vusbDevGetRh(PVUSBDEV pDev)
547{
548 if (!pDev->pHub)
549 return NULL;
550 return pDev->pHub->pRootHub;
551}
552
553
554/**
555 * Returns the state of the USB device.
556 *
557 * @returns State of the USB device.
558 * @param pDev Pointer to the device.
559 */
560DECLINLINE(VUSBDEVICESTATE) vusbDevGetState(PVUSBDEV pDev)
561{
562 VUSBDEVICESTATE enmState = (VUSBDEVICESTATE)ASMAtomicReadU32((volatile uint32_t *)&pDev->enmState);
563 VUSBDEV_ASSERT_VALID_STATE(enmState);
564 return enmState;
565}
566
567
568/**
569 * Sets the given state for the USB device.
570 *
571 * @returns The old state of the device.
572 * @param pDev Pointer to the device.
573 * @param enmState The new state to set.
574 */
575DECLINLINE(VUSBDEVICESTATE) vusbDevSetState(PVUSBDEV pDev, VUSBDEVICESTATE enmState)
576{
577 VUSBDEV_ASSERT_VALID_STATE(enmState);
578 VUSBDEVICESTATE enmStateOld = (VUSBDEVICESTATE)ASMAtomicXchgU32((volatile uint32_t *)&pDev->enmState, enmState);
579 VUSBDEV_ASSERT_VALID_STATE(enmStateOld);
580 return enmStateOld;
581}
582
583
584/**
585 * Compare and exchange the states for the given USB device.
586 *
587 * @returns true if the state was changed.
588 * @returns false if the state wasn't changed.
589 * @param pDev Pointer to the device.
590 * @param enmStateNew The new state to set.
591 * @param enmStateOld The old state to compare with.
592 */
593DECLINLINE(bool) vusbDevSetStateCmp(PVUSBDEV pDev, VUSBDEVICESTATE enmStateNew, VUSBDEVICESTATE enmStateOld)
594{
595 VUSBDEV_ASSERT_VALID_STATE(enmStateNew);
596 VUSBDEV_ASSERT_VALID_STATE(enmStateOld);
597 return ASMAtomicCmpXchgU32((volatile uint32_t *)&pDev->enmState, enmStateNew, enmStateOld);
598}
599
600/** Strings for the CTLSTAGE enum values. */
601extern const char * const g_apszCtlStates[4];
602/** Default message pipe. */
603extern const VUSBDESCENDPOINTEX g_Endpoint0;
604/** Default configuration. */
605extern const VUSBDESCCONFIGEX g_Config0;
606
607RT_C_DECLS_END
608#endif
609
Note: See TracBrowser for help on using the repository browser.

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