VirtualBox

Changeset 59704 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Feb 16, 2016 2:13:25 PM (9 years ago)
Author:
vboxsync
Message:

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)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vusb.h

    r59700 r59704  
    684684     * @param   pInterface  Pointer to this struct.
    685685     * @param   DstAddress  The destination address of the URB.
     686     * @param   pDev        Optional device pointer the URB is for.
    686687     * @param   enmType     Type of the URB.
    687688     * @param   enmDir      Data transfer direction.
     
    690691     * @param   pszTag      Custom URB tag assigned by the caller, only for
    691692     *                      logged builds and optional.
    692      */
    693     DECLR3CALLBACKMEMBER(PVUSBURB, pfnNewUrb,(PVUSBIROOTHUBCONNECTOR pInterface, uint8_t DstAddress, VUSBXFERTYPE enmType,
    694                                               VUSBDIRECTION enmDir, uint32_t cbData, uint32_t cTds, const char *pszTag));
     693     *
     694     * @note pDev should be NULL in most cases. The only useful case is for USB3 where
     695     *       it is required for the SET_ADDRESS request because USB3 uses unicast traffic.
     696     */
     697    DECLR3CALLBACKMEMBER(PVUSBURB, pfnNewUrb,(PVUSBIROOTHUBCONNECTOR pInterface, uint8_t DstAddress, PVUSBIDEVICE pDev,
     698                                              VUSBXFERTYPE enmType, VUSBDIRECTION enmDir, uint32_t cbData, uint32_t cTds, const char *pszTag));
     699
     700    /**
     701     * Free an URB not submitted yet.
     702     *
     703     * @returns VBox status code.
     704     * @param   pInterface  Pointer to this struct.
     705     * @param   pUrb        Pointer to the URB to free returned by VUSBIROOTHUBCONNECTOR::pfnNewUrb.
     706     */
     707    DECLR3CALLBACKMEMBER(int, pfnFreeUrb, (PVUSBIROOTHUBCONNECTOR pInterface, PVUSBURB pUrb));
    695708
    696709    /**
     
    778791} VUSBIROOTHUBCONNECTOR;
    779792/** VUSBIROOTHUBCONNECTOR interface ID. */
    780 #define VUSBIROOTHUBCONNECTOR_IID               "481d7f23-f180-4fde-b636-094253eaf537"
     793#define VUSBIROOTHUBCONNECTOR_IID               "a593cc64-a821-4e57-af2d-f86b2a052ea4"
    781794
    782795
     
    789802
    790803/** @copydoc VUSBIROOTHUBCONNECTOR::pfnNewUrb */
    791 DECLINLINE(PVUSBURB) VUSBIRhNewUrb(PVUSBIROOTHUBCONNECTOR pInterface, uint32_t DstAddress, VUSBXFERTYPE enmType,
    792                                    VUSBDIRECTION enmDir, uint32_t cbData, uint32_t cTds, const char *pszTag)
    793 {
    794     return pInterface->pfnNewUrb(pInterface, DstAddress, enmType, enmDir, cbData, cTds, pszTag);
     804DECLINLINE(PVUSBURB) VUSBIRhNewUrb(PVUSBIROOTHUBCONNECTOR pInterface, uint32_t DstAddress, PVUSBIDEVICE pDev,
     805                                   VUSBXFERTYPE enmType, VUSBDIRECTION enmDir, uint32_t cbData, uint32_t cTds, const char *pszTag)
     806{
     807    return pInterface->pfnNewUrb(pInterface, DstAddress, pDev, enmType, enmDir, cbData, cTds, pszTag);
     808}
     809
     810/** @copydoc VUSBIROOTHUBCONNECTOR::pfnSubmitUrb */
     811DECLINLINE(int) VUSBIRhFreeUrb(PVUSBIROOTHUBCONNECTOR pInterface, PVUSBURB pUrb)
     812{
     813    return pInterface->pfnFreeUrb(pInterface, pUrb);
    795814}
    796815
     
    948967} VUSBIDEVICE;
    949968/** VUSBIDEVICE interface ID. */
    950 #define VUSBIDEVICE_IID                         "79a31188-043d-432c-82ac-9485c9ab9a49"
     969#define VUSBIDEVICE_IID                         "af576b38-e8ca-4db7-810a-2596d8d57ca0"
    951970
    952971
     
    11151134/** Private controller emulation specific TD data. */
    11161135typedef struct VUSBURBHCITDINT *PVUSBURBHCITD;
     1136/** Private VUSB/roothub related state for the associated URB. */
     1137typedef struct VUSBURBVUSBINT *PVUSBURBVUSB;
    11171138
    11181139/**
     
    11431164#endif
    11441165
    1145     /** The VUSB data. */
    1146     struct VUSBURBVUSB
    1147     {
    1148         /** URB chain pointer. */
    1149         PVUSBURB        pNext;
    1150         /** URB chain pointer. */
    1151         PVUSBURB       *ppPrev;
    1152         /** Pointer to the original for control messages. */
    1153         PVUSBURB        pCtrlUrb;
    1154         /** Pointer to the VUSB device.
    1155          * This may be NULL if the destination address is invalid. */
    1156         struct VUSBDEV *pDev;
    1157         /** Specific to the pfnFree function. */
    1158         void           *pvFreeCtx;
    1159         /**
    1160          * Callback which will free the URB once it's reaped and completed.
    1161          * @param   pUrb    The URB.
    1162          */
    1163         DECLCALLBACKMEMBER(void, pfnFree)(PVUSBURB pUrb);
    1164         /** Submit timestamp. (logging only) */
    1165         uint64_t        u64SubmitTS;
    1166         /** The allocated data length. */
    1167         uint32_t        cbDataAllocated;
    1168         /** Opaque data holder when this is a read-ahead URB. */
    1169         void            *pvReadAhead;
    1170     } VUsb;
    1171 
     1166    /** The VUSB stack private data. */
     1167    PVUSBURBVUSB        pVUsb;
    11721168    /** Private host controller data associated with this URB. */
    11731169    PVUSBURBHCI         pHci;
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