VirtualBox

Changeset 5525 in vbox


Ignore:
Timestamp:
Oct 26, 2007 6:03:37 PM (17 years ago)
Author:
vboxsync
Message:

PDMUsb changes.

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r5501 r5525  
    199199# Enable the USB feature.
    200200VBOX_WITH_USB = 1
     201# Enable the new PDM USB management code (work in progress).
     202VBOX_WITH_PDMUSB = 1
    201203# Enable the ISCSI feature.
    202204VBOX_WITH_ISCSI = 1
  • trunk/include/VBox/mm.h

    r4688 r5525  
    4343 * Normal MMIO may set it but that depends on whether the RAM range was
    4444 * created specially for the MMIO or not.
    45  * 
    46  * @remarks The current implementation will always reserve backing 
     45 *
     46 * @remarks The current implementation will always reserve backing
    4747 *          memory for reserved  ranges to simplify things.
    4848 */
     
    5151 * The page have a HC physical address which contains the BIOS code. All write
    5252 * access is trapped and ignored.
    53  * 
    54  * HACK: Writable shadow ROM is indicated by both ROM and MMIO2 being 
     53 *
     54 * HACK: Writable shadow ROM is indicated by both ROM and MMIO2 being
    5555 *       set. (We're out of bits.)
    5656 */
     
    108108 * @{
    109109 */
    110 typedef enum 
     110typedef enum
    111111{
    112112    /** Normal physical region (flags specify exact page type) */
     
    166166    MM_TAG_PDM_DRIVER,
    167167    MM_TAG_PDM_DRIVER_USER,
     168    MM_TAG_PDM_USB,
     169    MM_TAG_PDM_USB_USER,
    168170    MM_TAG_PDM_LUN,
    169171    MM_TAG_PDM_QUEUE,
     
    654656/**
    655657 * Reset notification.
    656  * 
    657  * MM will reload shadow ROMs into RAM at this point and make 
     658 *
     659 * MM will reload shadow ROMs into RAM at this point and make
    658660 * the ROM writable.
    659  * 
     661 *
    660662 * @param   pVM             The VM handle.
    661663 */
     
    924926 *                              This must be cbRange bytes big.
    925927 *                              It will be copied and doesn't have to stick around.
    926  *                              It will be copied and doesn't have to stick around if fShadow is clear. 
     928 *                              It will be copied and doesn't have to stick around if fShadow is clear.
    927929 * @param   fShadow             Whether to emulate ROM shadowing. This involves leaving
    928930 *                              the ROM writable for a while during the POST and refreshing
     
    938940/**
    939941 * Write-protects a shadow ROM range.
    940  * 
     942 *
    941943 * This is called late in the POST for shadow ROM ranges.
    942  * 
     944 *
    943945 * @returns VBox status code.
    944946 * @param   pVM         The VM handle.
    945  * @param   GCPhys      Start of the registered shadow ROM range 
     947 * @param   GCPhys      Start of the registered shadow ROM range
    946948 * @param   cbRange     The length of the registered shadow ROM range.
    947949 *                      This can be NULL (not sure about the BIOS interface yet).
  • trunk/include/VBox/pdmdev.h

    r5040 r5525  
    385385
    386386/**
    387  * PCI Bus registaration structure.
     387 * PCI Bus registration structure.
    388388 * All the callbacks, except the PCIBIOS hack, are working on PCI devices.
    389389 */
     
    17911791     * @param   pvBinary            Pointer to the binary data backing the ROM image.
    17921792     *                              This must be cbRange bytes big.
    1793      *                              It will be copied and doesn't have to stick around if fShadow is clear. 
     1793     *                              It will be copied and doesn't have to stick around if fShadow is clear.
    17941794     * @param   fShadow             Whether to emulate ROM shadowing. This involves leaving
    17951795     *                              the ROM writable for a while during the POST and refreshing
     
    17971797     *                              pvBinary has to stick around for the lifespan of the VM.
    17981798     * @param   pszDesc             Pointer to description string. This must not be freed.
    1799      * 
     1799     *
    18001800     * @remark  There is no way to remove the rom, automatically on device cleanup or
    18011801     *          manually from the device yet. At present I doubt we need such features...
     
    21782178    /**
    21792179     * Creates a PDM thread.
    2180      * 
    2181      * This differs from the RTThreadCreate() API in that PDM takes care of suspending, 
     2180     *
     2181     * This differs from the RTThreadCreate() API in that PDM takes care of suspending,
    21822182     * resuming, and destroying the thread as the VM state changes.
    2183      * 
     2183     *
    21842184     * @returns VBox status code.
    21852185     * @param   pDevIns     The device instance.
     
    25492549    /**
    25502550     * Write protects a shadow ROM mapping.
    2551      * 
    2552      * This is intented for use by the system BIOS or by the device that 
     2551     *
     2552     * This is intented for use by the system BIOS or by the device that
    25532553     * employs a shadow ROM BIOS, so that the shadow ROM mapping can be
    25542554     * write protected once the POST is over.
    2555      * 
     2555     *
    25562556     * @param   pDevIns     Device instance.
    25572557     * @param   GCPhysStart Where the shadow ROM mapping starts.
  • trunk/include/VBox/pdmdrv.h

    r5266 r5525  
    255255
    256256/**
     257 * USB hub registration structure.
     258 */
     259typedef struct PDMUSBHUBREG
     260{
     261    /** Structure version number. PDM_USBHUBREG_VERSION defines the current version. */
     262    uint32_t            u32Version;
     263
     264    /**
     265     * Request the hub to attach of the specified device.
     266     *
     267     * @returns VBox status code.
     268     * @param   pDrvIns     The hub instance.
     269     * @param   pUsbIns     The device to attach.
     270     * @param   piPort      Where to store the port number the device was attached to.
     271     * @thread EMT.
     272     */
     273    DECLR3CALLBACKMEMBER(int, pfnAttachDevice,(PPDMDRVINS pDrvIns, PPDMUSBINS pUsbIns, uint32_t *piPort));
     274
     275    /**
     276     * Request the hub to detach of the specified device.
     277     *
     278     * The device has previously been attached to the hub with the
     279     * pfnAttachDevice call. This call is not currently expected to
     280     * fail.
     281     *
     282     * @returns VBox status code.
     283     * @param   pDrvIns     The hub instance.
     284     * @param   pUsbIns     The device to detach.
     285     * @param   iPort       The port number returned by the attach call.
     286     * @thread EMT.
     287     */
     288    DECLR3CALLBACKMEMBER(int, pfnDetachDevice,(PPDMDRVINS pDrvIns, PPDMUSBINS pUsbIns, uint32_t iPort));
     289
     290    /** Counterpart to u32Version, same value. */
     291    uint32_t            u32TheEnd;
     292} PDMUSBHUBREG;
     293/** Pointer to a const USB hub registration structure. */
     294typedef const PDMUSBHUBREG *PCPDMUSBHUBREG;
     295
     296/** Current PDMUSBHUBREG version number. */
     297#define PDM_USBHUBREG_VERSION       0xeb010000
     298
     299
     300/**
     301 * USB hub helpers.
     302 * This is currently just a place holder.
     303 */
     304typedef struct PDMUSBHUBHLP
     305{
     306    /** Structure version. PDM_USBHUBHLP_VERSION defines the current version. */
     307    uint32_t                    u32Version;
     308
     309    /** Just a safety precaution. */
     310    uint32_t                    u32TheEnd;
     311} PDMUSBHUBHLP;
     312/** Pointer to PCI helpers. */
     313typedef PDMUSBHUBHLP *PPDMUSBHUBHLP;
     314/** Pointer to const PCI helpers. */
     315typedef const PDMUSBHUBHLP *PCPDMUSBHUBHLP;
     316/** Pointer to const PCI helpers pointer. */
     317typedef PCPDMUSBHUBHLP *PPCPDMUSBHUBHLP;
     318
     319/** Current PDMUSBHUBHLP version number. */
     320#define PDM_USBHUBHLP_VERSION       0xea010000
     321
     322
     323
     324/**
    257325 * Poller callback.
    258326 *
     
    546614     * @returns VBox status code.
    547615     * @param   pDrvIns         The driver instance.
    548      * @param   pvReserved      Reserved for future inteface callback structure.
    549      * @param   ppvReservedHlp  Reserved for future helper callback structure.
     616     * @param   fVersions       Indicates the kinds of USB devices that can be attached to this HUB.
     617     * @param   cPorts          The number of ports.
     618     * @param   pUsbHubReg      The hub callback structure that PDMUsb uses to interact with it.
     619     * @param   ppUsbHubHlp     The helper callback structure that the hub uses to talk to PDMUsb.
    550620     *
    551621     * @thread  EMT.
    552622     */
    553     DECLR3CALLBACKMEMBER(int, pfnUSBRegisterHub,(PPDMDRVINS pDrvIns, void *pvReservedIn, void **ppvReservedHlp));
     623    DECLR3CALLBACKMEMBER(int, pfnUSBRegisterHub,(PPDMDRVINS pDrvIns, uint32_t fVersions, uint32_t cPorts, PCPDMUSBHUBREG pUsbHubReg, PPCPDMUSBHUBHLP ppUsbHubHlp));
    554624
    555625    /**
     
    716786 * @copydoc PDMDRVHLP::pfnUSBRegisterHub
    717787 */
    718 DECLINLINE(int) PDMDrvHlpUSBRegisterHub(PPDMDRVINS pDrvIns, void *pvReservedIn, void **ppvReservedHlp)
    719 {
    720     return pDrvIns->pDrvHlp->pfnUSBRegisterHub(pDrvIns, pvReservedIn, ppvReservedHlp);
     788DECLINLINE(int) PDMDrvHlpUSBRegisterHub(PPDMDRVINS pDrvIns, uint32_t fVersions, uint32_t cPorts, PCPDMUSBHUBREG pUsbHubReg, PPCPDMUSBHUBHLP ppUsbHubHlp)
     789{
     790    return pDrvIns->pDrvHlp->pfnUSBRegisterHub(pDrvIns, fVersions, cPorts, pUsbHubReg, ppUsbHubHlp);
    721791}
    722792
  • trunk/include/VBox/pdmusb.h

    r4071 r5525  
    9999     * complicated failure paths.
    100100     *
    101      * @returns VBox status.
    102      * @param   pUsbIns     The USB device instance data.
    103      * @remarks Optional.
    104      */
    105     DECLR3CALLBACKMEMBER(int, pfnDestruct,(PPDMUSBINS pUsbIns));
     101     * @param   pUsbIns     The USB device instance data.
     102     * @remarks Optional.
     103     */
     104    DECLR3CALLBACKMEMBER(void, pfnDestruct,(PPDMUSBINS pUsbIns));
    106105
    107106    /**
     
    435434    /** Pointer to device instance data. */
    436435    R3PTRTYPE(void *)           pvInstanceDataR3;
    437     /* padding to make achInstanceData aligned at 32 byte boundrary. */
    438     uint32_t                    au32Padding[HC_ARCH_BITS == 32 ? 4 : 6];
     436    /** Pointer to the VUSB Device structure.
     437     * The constructor sets this.
     438     * @todo Integrate VUSBDEV into this structure. */
     439    R3PTRTYPE(void *)           pvVUsbDev;
     440    /** Padding to make achInstanceData aligned at 32 byte boundrary. */
     441    uint32_t                    au32Padding[HC_ARCH_BITS == 32 ? 3 : 4];
    439442    /** Device instance data. The size of this area is defined
    440443     * in the PDMUSBREG::cbInstanceData field. */
     
    561564typedef DECLCALLBACK(int) FNPDMVBOXUSBREGISTER(PCPDMUSBREGCB pCallbacks, uint32_t u32Version);
    562565
     566
     567/**
     568 * Creates a USB proxy device instance.
     569 *
     570 * This will find an appropriate HUB for the USB device, create the necessary CFGM stuff
     571 * and try instantiate the proxy device.
     572 *
     573 * @returns VBox status code.
     574 * @param   pVM             The VM handle.
     575 * @param   pUuid           The UUID thats to be associated with the device.
     576 * @param   fRemote         Whether it's a remove or local device.
     577 * @param   pszAddress      The address string.
     578 * @param   pvBackend       Pointer to the backend.
     579 * @param   iUsbVersion     The preferred USB version.
     580 */
     581PDMR3DECL(int) PDMR3USBCreateProxyDevice(PVM pVM, PCRTUUID pUuid, bool fRemote, const char *pszAddress, void *pvBackend, uint32_t iUsbVersion);
     582
     583/**
     584 * Detaches and destroys a USB device.
     585 *
     586 * @returns VBox status code.
     587 * @param   pVM             The VM handle.
     588 * @param   pUuid           The UUID associated with the device to detach.
     589 * @thread  EMT
     590 */
     591PDMR3DECL(int) PDMR3USBDetachDevice(PVM pVM, PCRTUUID pUuid);
     592
     593/**
     594 * Checks if there are any USB hubs attached.
     595 *
     596 * @returns true / false accordingly.
     597 * @param   pVM     Pointer to the shared VM structure.
     598 */
     599PDMR3DECL(bool) PDMR3USBHasHub(PVM pVM);
     600
     601
    563602/** @} */
    564603
  • trunk/include/VBox/vusb.h

    r5515 r5525  
    3030#define VUSB_BUS_HZ                 12000000
    3131
    32 /** @name USB Standard version flags. 
     32/** @name USB Standard version flags.
    3333 * @{ */
    34 /** Indicates USB 1.1 support. */
    35 #define VUSB_STDVER_11              BIT(1)
    36 /** Indicates USB 2.0 support. */
    37 #define VUSB_STDVER_20              BIT(2)
    38 /** @} */
    39 
    40 /** @name USB Standard version
    41  * @{ */
    42  typedef enum VUSBREVISION
    43 {
    44     /** Indicates USB 1.1 support. */
    45     VUSBREVISION_11 = 0x10,
    46     /** Indicates USB 2.0 support. */
    47     VUSBREVISION_20 = 0x20
    48 } VUSBREVISION;
     34/** Indicates USB 1.1 support. */
     35#define VUSB_STDVER_11              BIT(1)
     36/** Indicates USB 2.0 support. */
     37#define VUSB_STDVER_20              BIT(2)
    4938/** @} */
    5039
     
    5847
    5948/** Pointer to an USB request descriptor. */
    60 typedef struct vusb_urb *PVUSBURB;
     49typedef struct VUSBURB          *PVUSBURB;
    6150
    6251
     
    9483
    9584    /**
    96      * Get the supported USB revision
    97      *
    98      * @returns The supported revision
     85     * Gets the supported USB versions.
     86     *
     87     * @returns The mask of supported USB versions.
    9988     * @param   pInterface      Pointer to this structure.
    10089     */
    101     DECLR3CALLBACKMEMBER(VUSBREVISION, pfnGetRevision, (PVUSBIROOTHUBPORT pInterface));
     90    DECLR3CALLBACKMEMBER(uint32_t, pfnGetUSBVersions,(PVUSBIROOTHUBPORT pInterface));
    10291
    10392    /**
     
    150139     */
    151140    DECLR3CALLBACKMEMBER(bool, pfnXferError,(PVUSBIROOTHUBPORT pInterface, PVUSBURB pUrb));
     141
     142    /** Alignment dummy. */
     143    RTR3PTR Alignment;
    152144
    153145} VUSBIROOTHUBPORT;
     
    188180     * @param   pLed        Pointer to USB Status LED
    189181     */
    190     DECLR3CALLBACKMEMBER(int, pfnSubmitUrb,(PVUSBIROOTHUBCONNECTOR pInterface, PVUSBURB pUrb, PPDMLED pLed));
     182    DECLR3CALLBACKMEMBER(int, pfnSubmitUrb,(PVUSBIROOTHUBCONNECTOR pInterface, PVUSBURB pUrb, struct PDMLED *pLed));
    191183
    192184    /**
     
    245237
    246238/** @copydoc VUSBIROOTHUBCONNECTOR::pfnSubmitUrb */
    247 DECLINLINE(int) VUSBIRhSubmitUrb(PVUSBIROOTHUBCONNECTOR pInterface, PVUSBURB pUrb, PPDMLED pLed)
     239DECLINLINE(int) VUSBIRhSubmitUrb(PVUSBIROOTHUBCONNECTOR pInterface, PVUSBURB pUrb, struct PDMLED *pLed)
    248240{
    249241    return pInterface->pfnSubmitUrb(pInterface, pUrb, pLed);
     
    620612 * Asynchronous USB request descriptor
    621613 */
    622 typedef struct vusb_urb
     614typedef struct VUSBURB
    623615{
    624616    /** URB magic value. */
     
    688680    /** The device - NULL until a submit has been is attempted.
    689681     * This is set when allocating the URB. */
    690     struct vusb_dev *pDev;
     682    struct VUSBDEV *pDev;
    691683    /** The device address.
    692684     * This is set at allocation time. */
  • trunk/src/VBox/Devices/Makefile.kmk

    r5518 r5525  
    9090ifdef VBOX_WITH_USB
    9191 VBoxDD_DEFS           += VBOX_WITH_USB IN_USB_R3
     92 ifdef VBOX_WITH_PDMUSB
     93  VBoxDD_DEFS          += VBOX_WITH_PDMUSB
     94 endif
    9295endif
    9396ifdef VBOX_WITH_AHCI
     
    203206ifdef VBOX_WITH_USB
    204207DevicesR3_DEFS         += VBOX_WITH_USB IN_USB_R3
     208 ifdef VBOX_WITH_PDMUSB
     209  DevicesR3_DEFS       += VBOX_WITH_PDMUSB
     210 endif
    205211DevicesR3_SOURCES      += \
    206212        USB/DevOHCI.cpp \
     
    499505ifdef VBOX_WITH_USB
    500506 Drivers_DEFS         += VBOX_WITH_USB IN_USB_R3
     507 ifdef VBOX_WITH_PDMUSB
     508  Drivers_DEFS        += VBOX_WITH_PDMUSB
     509 endif
    501510 Drivers_SOURCES      += \
    502511        USB/DrvVUSBRootHub.cpp \
  • trunk/src/VBox/Devices/testcase/tstDeviceStructSizeGC.cpp

    r5516 r5525  
    797797    GEN_CHECK_OFF(EHCI, pDevInsGC);
    798798    GEN_CHECK_OFF(EHCI, pLoad);
     799    GEN_CHECK_OFF(EHCI, fAsyncTraversalTimerActive);
    799800# ifdef VBOX_WITH_STATISTICS
    800801    GEN_CHECK_OFF(EHCI, StatCanceledIsocUrbs);
  • trunk/src/VBox/Runtime/testcase/tstCritSect.cpp

    r4071 r5525  
    2424#endif
    2525#include <iprt/critsect.h>
     26#include <iprt/lock.h>
    2627#include <iprt/thread.h>
    2728#include <iprt/log.h>
  • trunk/src/VBox/VMM/MMHeap.cpp

    r4688 r5525  
    596596        TAG2STR(PDM_DRIVER);
    597597        TAG2STR(PDM_DRIVER_USER);
     598        TAG2STR(PDM_USB);
     599        TAG2STR(PDM_USB_USER);
    598600        TAG2STR(PDM_LUN);
    599601        TAG2STR(PDM_QUEUE);
  • trunk/src/VBox/VMM/PDMDevice.cpp

    r5440 r5525  
    613613    {
    614614        /* make filename */
    615         char *pszFilename = pdmR3FileR3("VBoxDD", /*fShared=*/true);
     615        char *pszFilename = pdmR3FileR3("VBoxDD", /* fShared = */ true);
    616616        if (!pszFilename)
    617617            return VERR_NO_TMP_MEMORY;
     
    622622
    623623        /* make filename */
    624         pszFilename = pdmR3FileR3("VBoxDD2", /*fShared=*/true);
     624        pszFilename = pdmR3FileR3("VBoxDD2", /* fShared = */ true);
    625625        if (!pszFilename)
    626626            return VERR_NO_TMP_MEMORY;
     
    24222422    int rc = pdmR3ThreadCreateDevice(pDevIns->Internal.s.pVMHC, pDevIns, ppThread, pvUser, pfnThread, pfnWakeup, cbStack, enmType, pszName);
    24232423
    2424     LogFlow(("pdmR3DevHlp_PDMThreadCreate: caller='%s'/%d: returns %Vrc *ppThread=%RTthrd\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, 
     2424    LogFlow(("pdmR3DevHlp_PDMThreadCreate: caller='%s'/%d: returns %Vrc *ppThread=%RTthrd\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance,
    24252425            rc, *ppThread));
    24262426    return rc;
  • trunk/src/VBox/VMM/PDMDriver.cpp

    r5283 r5525  
    9090static DECLCALLBACK(void) pdmR3DrvHlp_STAMRegisterV(PPDMDRVINS pDrvIns, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility, STAMUNIT enmUnit, const char *pszDesc, const char *pszName, va_list args);
    9191static DECLCALLBACK(int) pdmR3DrvHlp_SUPCallVMMR0Ex(PPDMDRVINS pDrvIns, unsigned uOperation, void *pvArg, unsigned cbArg);
    92 static DECLCALLBACK(int) pdmR3DrvHlp_USBRegisterHub(PPDMDRVINS pDrvIns, void *pvReservedIn, void **ppvReservedHlp);
     92static DECLCALLBACK(int) pdmR3DrvHlp_USBRegisterHub(PPDMDRVINS pDrvIns, uint32_t fVersions, uint32_t cPorts, PCPDMUSBHUBREG pUsbHubReg, PPCPDMUSBHUBHLP ppUsbHubHlp);
    9393static DECLCALLBACK(int) pdmR3DrvHlp_PDMThreadCreate(PPDMDRVINS pDrvIns, PPPDMTHREAD ppThread, void *pvUser, PFNPDMTHREADDRV pfnThread,
    9494                                                     PFNPDMTHREADWAKEUPDRV pfnWakeup, size_t cbStack, RTTHREADTYPE enmType, const char *pszName);
     
    10041004
    10051005/** @copydoc PDMDRVHLP::pfnUSBRegisterHub */
    1006 static DECLCALLBACK(int) pdmR3DrvHlp_USBRegisterHub(PPDMDRVINS pDrvIns, void *pvReservedIn, void **ppvReservedHlp)
    1007 {
    1008     PDMDRV_ASSERT_DRVINS(pDrvIns);
    1009     VM_ASSERT_EMT(pDrvIns->Internal.s.pVM);
    1010     LogFlow(("pdmR3DrvHlp_USBRegisterHub: caller='%s'/%d: pvReservedIn=%p ppvReservedHlp=%p\n",
    1011              pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance, pvReservedIn, ppvReservedHlp));
    1012 
    1013 /// @todo    int rc = PDMUSBRegisterHub(pDrvIns->Internal.s.pVM, pvReservedIn, ppvReservedHlp);
    1014     int rc = VINF_SUCCESS;
     1006static DECLCALLBACK(int) pdmR3DrvHlp_USBRegisterHub(PPDMDRVINS pDrvIns, uint32_t fVersions, uint32_t cPorts, PCPDMUSBHUBREG pUsbHubReg, PPCPDMUSBHUBHLP ppUsbHubHlp)
     1007{
     1008    PDMDRV_ASSERT_DRVINS(pDrvIns);
     1009    VM_ASSERT_EMT(pDrvIns->Internal.s.pVM);
     1010    LogFlow(("pdmR3DrvHlp_USBRegisterHub: caller='%s'/%d: fVersions=%#x cPorts=%#x pUsbHubReg=%p ppUsbHubHlp=%p\n",
     1011             pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance, fVersions, cPorts, pUsbHubReg, ppUsbHubHlp));
     1012
     1013    int rc = pdmR3UsbRegisterHub(pDrvIns->Internal.s.pVM, pDrvIns, fVersions, cPorts, pUsbHubReg, ppUsbHubHlp);
    10151014
    10161015    LogFlow(("pdmR3DrvHlp_USBRegisterHub: caller='%s'/%d: returns %Vrc\n", pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance, rc));
  • trunk/src/VBox/VMM/PDMInternal.h

    r4787 r5525  
    2424#include <VBox/cfgm.h>
    2525#include <VBox/stam.h>
     26#include <VBox/vusb.h>
    2627#include <iprt/critsect.h>
    2728#ifdef IN_RING3
     
    115116typedef struct PDMUSBINSINT
    116117{
     118    /** The UUID of this instance. */
     119    RTUUID                          Uuid;
    117120    /** Pointer to the next instance.
    118121     * (Head is pointed to by PDM::pUsbInstances.) */
     
    123126
    124127    /** Pointer to device structure. */
    125     R3PTRTYPE(PPDMUSB)              pUsb;
     128    R3PTRTYPE(PPDMUSB)              pUsbDev;
    126129
    127130    /** Pointer to the VM this instance was created for. */
     
    131134    /** The per instance device configuration. */
    132135    R3PTRTYPE(PCFGMNODE)            pCfg;
     136    /** Same as pCfg if the configuration should be deleted when detaching the device. */
     137    R3PTRTYPE(PCFGMNODE)            pCfgDelete;
    133138    /** The global device configuration. */
    134139    R3PTRTYPE(PCFGMNODE)            pCfgGlobal;
    135140
    136     /** Pointer to the USB hub this device is connected to. */
     141    /** Pointer to the USB hub this device is attached to.
     142     * This is NULL if the device isn't connected to any HUB. */
    137143    R3PTRTYPE(PPDMUSBHUB)           pHub;
    138144    /** The port number that we're connected to. */
     
    726732     * Note that 1.1 hubs can take on 2.0 devices. */
    727733    uint32_t            fVersions;
    728     /** The number of occupied ports. */
     734    /** The number of ports on the hub. */
     735    uint32_t            cPorts;
     736    /** The number of available ports (0..cPorts). */
    729737    uint32_t            cAvailablePorts;
     738    /** The driver instance of the hub. */
     739    PPDMDRVINS          pDrvIns;
     740    /** Copy of the to the registration structure. */
     741    PDMUSBHUBREG        Reg;
     742
    730743    /** Pointer to the next hub in the list. */
    731744    struct PDMUSBHUB   *pNext;
    732     /** The driver instance of the hub.. */
    733     PPDMDRVINS          pDrvIns;
    734 
    735745} PDMUSBHUB;
    736746
     
    872882PPDMUSB     pdmR3UsbLookup(PVM pVM, const char *pszName);
    873883int         pdmR3UsbFindLun(PVM pVM, const char *pszDevice, unsigned iInstance, unsigned iLun, PPDMLUN *ppLun);
     884int         pdmR3UsbRegisterHub(PVM pVM, PPDMDRVINS pDrvIns, uint32_t fVersions, uint32_t cPorts, PCPDMUSBHUBREG pUsbHubReg, PPCPDMUSBHUBHLP ppUsbHubHlp);
    874885
    875886int         pdmR3DrvInit(PVM pVM);
     
    897908int         pdmR3ThreadSuspendAll(PVM pVM);
    898909
     910
    899911#endif /* IN_RING3 */
    900912
Note: See TracChangeset for help on using the changeset viewer.

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