VirtualBox

Changeset 59700 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Feb 16, 2016 12:18:30 PM (9 years ago)
Author:
vboxsync
Message:

VUSB: Some structural cleanup (#2 Remove the HCI specific bits from the VUSBURB structure and let each controller manage it by itself just telling the root hub how much space it needs for each URB)

File:
1 edited

Legend:

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

    r59687 r59700  
    647647} VUSBIROOTHUBPORT;
    648648/** VUSBIROOTHUBPORT interface ID. */
    649 #define VUSBIROOTHUBPORT_IID                    "e38e2978-7aa2-4860-94b6-9ef4a066d8a0"
     649#define VUSBIROOTHUBPORT_IID                    "79a31188-043d-432c-82ac-9485c9ab9a49"
    650650
    651651/** Pointer to a VUSB RootHub connector interface. */
     
    658658typedef struct VUSBIROOTHUBCONNECTOR
    659659{
     660    /**
     661     * Sets the URB parameters for the caller.
     662     *
     663     * @returns VBox status code.
     664     * @param   pInterface  Pointer to this struct.
     665     * @param   cbHci       Size of the data private to the HCI for each URB when allocated.
     666     * @param   cbHciTd     Size of one transfer descriptor. The number of transfer descriptors
     667     *                      is given VUSBIROOTHUBCONNECTOR::pfnNewUrb for each URB to calculate the
     668     *                      final amount of memory required for the TDs.
     669     *
     670     * @note This must be called before starting to allocate any URB or otherwise there will be no
     671     *       data available for the HCI.
     672     */
     673    DECLR3CALLBACKMEMBER(int, pfnSetUrbParams, (PVUSBIROOTHUBCONNECTOR pInterface, size_t cbHci, size_t cbHciTd));
     674
    660675    /**
    661676     * Allocates a new URB for a transfer.
     
    763778} VUSBIROOTHUBCONNECTOR;
    764779/** VUSBIROOTHUBCONNECTOR interface ID. */
    765 #define VUSBIROOTHUBCONNECTOR_IID               "dba1a54e-9708-4702-8d7f-b9ac94dc17e6"
     780#define VUSBIROOTHUBCONNECTOR_IID               "481d7f23-f180-4fde-b636-094253eaf537"
    766781
    767782
    768783#ifdef IN_RING3
     784/** @copydoc VUSBIROOTHUBCONNECTOR::pfnSetUrbParams */
     785DECLINLINE(int) VUSBIRhSetUrbParams(PVUSBIROOTHUBCONNECTOR pInterface, size_t cbHci, size_t cbHciTd)
     786{
     787    return pInterface->pfnSetUrbParams(pInterface, cbHci, cbHciTd);
     788}
     789
    769790/** @copydoc VUSBIROOTHUBCONNECTOR::pfnNewUrb */
    770791DECLINLINE(PVUSBURB) VUSBIRhNewUrb(PVUSBIROOTHUBCONNECTOR pInterface, uint32_t DstAddress, VUSBXFERTYPE enmType,
     
    927948} VUSBIDEVICE;
    928949/** VUSBIDEVICE interface ID. */
    929 #define VUSBIDEVICE_IID                         "f3facb2b-edd3-4b5b-b07e-2cc4d52a471e"
     950#define VUSBIDEVICE_IID                         "79a31188-043d-432c-82ac-9485c9ab9a49"
    930951
    931952
     
    10901111typedef const VUSBURBISOCPKT *PCVUSBURBISOCPKT;
    10911112
     1113/** Private controller emulation specific data for the associated USB request descriptor. */
     1114typedef struct VUSBURBHCIINT *PVUSBURBHCI;
     1115/** Private controller emulation specific TD data. */
     1116typedef struct VUSBURBHCITDINT *PVUSBURBHCITD;
     1117
    10921118/**
    10931119 * Asynchronous USB request descriptor
     
    11291155         * This may be NULL if the destination address is invalid. */
    11301156        struct VUSBDEV *pDev;
    1131         /** Sepcific to the pfnFree function. */
     1157        /** Specific to the pfnFree function. */
    11321158        void           *pvFreeCtx;
    11331159        /**
     
    11401166        /** The allocated data length. */
    11411167        uint32_t        cbDataAllocated;
    1142         /** The allocated TD length. */
    1143         uint32_t        cTdsAllocated;
     1168        /** Opaque data holder when this is a read-ahead URB. */
     1169        void            *pvReadAhead;
    11441170    } VUsb;
    11451171
    1146     /** The host controller data. */
    1147     struct VUSBURBHCI
    1148     {
    1149         /** The endpoint descriptor address. */
    1150         RTGCPHYS32      EdAddr;
    1151         /** Number of Tds in the array. */
    1152         uint32_t        cTds;
    1153         /** Pointer to an array of TD info items.*/
    1154         struct VUSBURBHCITD
    1155         {
    1156             /** Type of TD (private) */
    1157             uint32_t        TdType;
    1158             /** The address of the */
    1159             RTGCPHYS32      TdAddr;
    1160             /** A copy of the TD. */
    1161             uint32_t        TdCopy[16];
    1162         }              *paTds;
    1163         /** URB chain pointer. */
    1164         PVUSBURB        pNext;
    1165         /** When this URB was created.
    1166          * (Used for isochronous frames and for logging.) */
    1167         uint32_t        u32FrameNo;
    1168         /** Flag indicating that the TDs have been unlinked. */
    1169         bool            fUnlinked;
    1170     } Hci;
     1172    /** Private host controller data associated with this URB. */
     1173    PVUSBURBHCI         pHci;
     1174    /** Pointer to the host controller transfer descriptor array. */
     1175    PVUSBURBHCITD       paTds;
    11711176
    11721177    /** The device data. */
     
    11791184    } Dev;
    11801185
    1181 #ifndef RDESKTOP
    1182     /** The USB device instance this belongs to.
    1183      * This is NULL if the device address is invalid, in which case this belongs to the hub. */
    1184     PPDMUSBINS      pUsbIns;
    1185 #endif
    11861186    /** The device address.
    11871187     * This is set at allocation time. */
     
    11931193    uint8_t         EndPt;
    11941194    /** The transfer type.
    1195      * IN: Must be set before submitting the URB. */
     1195     * IN: Set at allocation time. */
    11961196    VUSBXFERTYPE    enmType;
    11971197    /** The transfer direction.
    1198      * IN: Must be set before submitting the URB. */
     1198     * IN: Set at allocation time. */
    11991199    VUSBDIRECTION   enmDir;
    12001200    /** Indicates whether it is OK to receive/send less data than requested.
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