VirtualBox

Changeset 3857

Show
Ignore:
Timestamp:
07/26/07 00:02:21 (1 year ago)
Author:
vboxsync
Message:

PDMUsb - work in progress.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/include/VBox/err.h

    r3749 r3857  
    892892#define VERR_PDM_HIF_INVALID_VERSION                (-2855) 
    893893 
     894/** The version of the USB device registration structure is unknown 
     895 * to this VBox version. Either mixing incompatible versions or 
     896 * the structure isn't correctly initialized. */ 
     897#define VERR_PDM_UNKNOWN_USBREG_VERSION             (-2856) 
     898/** Invalid entry in the device registration structure. */ 
     899#define VERR_PDM_INVALID_USB_REGISTRATION           (-2857) 
     900/** Driver name clash. Another driver with the same name as the 
     901 * one begin registred exists. */ 
     902#define VERR_PDM_USB_NAME_CLASH                     (-2858) 
     903/** The USB hub is already registered. */ 
     904#define VERR_PDM_USB_HUB_EXISTS                     (-2859) 
     905/** Couldn't find any USB hubs to attach the device to. */ 
     906#define VERR_PDM_NO_USB_HUBS                        (-2860) 
     907/** Couldn't find any free USB ports to attach the device to. */ 
     908#define VERR_PDM_NO_USB_PORTS                       (-2861) 
     909/** Couldn't find the USB Proxy device. Using OSE? */ 
     910#define VERR_PDM_NO_USBPROXY                        (-2862) 
     911 
    894912/** @} */ 
    895913 
  • trunk/include/VBox/pdmusb.h

    r3856 r3857  
    3636/** PDM USB Device Registration Structure, 
    3737 * 
    38  * This structure is used when registering a device from VBoxUSBRegister() in HC Ring-3. 
     38 * This structure is used when registering a device from VBoxUsbRegister() in HC Ring-3. 
    3939 * The PDM will make use of this structure untill the VM is destroyed. 
    4040 */ 
     
    394394 
    395395/** Current USBHLP version number. */ 
    396 #define PDM_USBHLP_VERSION  0xec0020000 
     396#define PDM_USBHLP_VERSION  0xec020000 
    397397 
    398398#endif /* IN_RING3 */ 
     
    421421    } Internal; 
    422422 
    423     /** Pointer the HC PDM Device API. */ 
    424     R3PTRTYPE(PCPDMUSBHLP)      pDevHlp; 
     423    /** Pointer the PDM USB Device API. */ 
     424    R3PTRTYPE(PCPDMUSBHLP)      pUsbHlp; 
    425425    /** Pointer to the USB device registration structure.  */ 
    426     R3PTRTYPE(PCPDMUSBREG)      pDevReg; 
     426    R3PTRTYPE(PCPDMUSBREG)      pUsbReg; 
    427427    /** Configuration handle. */ 
    428428    R3PTRTYPE(PCFGMNODE)        pCfg; 
     
    449449 */ 
    450450#ifdef VBOX_STRICT 
    451 # define PDMUSB_ASSERT_EMT(pDevIns)  pDevIns->pDevHlp->pfnAssertEMT(pDevIns, __FILE__, __LINE__, __FUNCTION__) 
     451# define PDMUSB_ASSERT_EMT(pUsbIns)  pUsbIns->pUsbHlp->pfnAssertEMT(pUsbIns, __FILE__, __LINE__, __FUNCTION__) 
    452452#else 
    453 # define PDMUSB_ASSERT_EMT(pDevIns)  do { } while (0) 
     453# define PDMUSB_ASSERT_EMT(pUsbIns)  do { } while (0) 
    454454#endif 
    455455 
     
    458458 */ 
    459459#ifdef VBOX_STRICT 
    460 # define PDMUSB_ASSERT_OTHER(pDevIns)  pDevIns->pDevHlp->pfnAssertOther(pDevIns, __FILE__, __LINE__, __FUNCTION__) 
     460# define PDMUSB_ASSERT_OTHER(pUsbIns)  pUsbIns->pUsbHlp->pfnAssertOther(pUsbIns, __FILE__, __LINE__, __FUNCTION__) 
    461461#else 
    462 # define PDMUSB_ASSERT_OTHER(pDevIns)  do { } while (0) 
     462# define PDMUSB_ASSERT_OTHER(pUsbIns)  do { } while (0) 
    463463#endif 
    464464 
     
    466466 * Set the VM error. See PDMDevHlpVMSetError() for printf like message formatting. 
    467467 */ 
    468 #define PDMUSB_SET_ERROR(pDevIns, rc, pszError) \ 
    469     PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS, "%s", pszError) 
     468#define PDMUSB_SET_ERROR(pUsbIns, rc, pszError) \ 
     469    PDMDevHlpVMSetError(pUsbIns, rc, RT_SRC_POS, "%s", pszError) 
    470470 
    471471/** @def PDMUSB_SET_RUNTIME_ERROR 
    472472 * Set the VM runtime error. See PDMDevHlpVMSetRuntimeError() for printf like message formatting. 
    473473 */ 
    474 #define PDMUSB_SET_RUNTIME_ERROR(pDevIns, fFatal, pszErrorID, pszError) \ 
    475     PDMDevHlpVMSetRuntimeError(pDevIns, fFatal, pszErrorID, "%s", pszError) 
     474#define PDMUSB_SET_RUNTIME_ERROR(pUsbIns, fFatal, pszErrorID, pszError) \ 
     475    PDMDevHlpVMSetRuntimeError(pUsbIns, fFatal, pszErrorID, "%s", pszError) 
    476476 
    477477 
     
    479479 
    480480/** 
    481  * VBOX_STRICT wrapper for pDevHlp->pfnDBGFStopV. 
     481 * VBOX_STRICT wrapper for pUsbHlp->pfnDBGFStopV. 
    482482 * 
    483483 * @returns VBox status code which must be passed up to the VMM. 
    484  * @param   pDevIns             Device instance. 
     484 * @param   pUsbIns             Device instance. 
    485485 * @param   RT_SRC_POS_DECL     Use RT_SRC_POS. 
    486486 * @param   pszFormat           Message. (optional) 
     
    493493    va_list va; 
    494494    va_start(va, pszFormat); 
    495     rc = pUsbIns->pDevHlp->pfnDBGFStopV(pUsbIns, RT_SRC_POS_ARGS, pszFormat, va); 
     495    rc = pUsbIns->pUsbHlp->pfnDBGFStopV(pUsbIns, RT_SRC_POS_ARGS, pszFormat, va); 
    496496    va_end(va); 
    497497    return rc; 
     
    508508 
    509509 
    510 /** Pointer to callbacks provided to the VBoxUSBRegister() call. */ 
     510/** Pointer to callbacks provided to the VBoxUsbRegister() call. */ 
    511511typedef const struct PDMUSBREGCB *PCPDMUSBREGCB; 
    512512 
     
    546546 
    547547/** 
    548  * The VBoxUSBRegister callback function. 
     548 * The VBoxUsbRegister callback function. 
    549549 * 
    550550 * PDM will invoke this function after loading a USB device module and letting 
  • trunk/src/VBox/VMM/Makefile.kmk

    r3548 r3857  
    138138        VMMSwitcher/AMD64ToPAE.asm 
    139139 
     140ifdef VBOX_WITH_USB 
     141VMMR3_DEFS += VBOX_WITH_USB 
     142VMMR3_SOURCES += PDMUsb.cpp 
     143endif 
     144 
    140145 
    141146# 
  • trunk/src/VBox/VMM/PDMDevice.cpp

    r3112 r3857  
    688688    } 
    689689 
     690#ifdef VBOX_WITH_USB 
     691    /* ditto for USB Devices. */ 
     692    rc = pdmR3UsbLoadModules(pVM); 
     693    if (RT_FAILURE(rc)) 
     694        return rc; 
     695#endif 
     696 
    690697 
    691698    /* 
     
    906913    } /* for device instances */ 
    907914 
     915#ifdef VBOX_WITH_USB 
     916    /* ditto for USB Devices. */ 
     917    rc = pdmR3UsbInstantiateDevices(pVM); 
     918    if (RT_FAILURE(rc)) 
     919        return rc; 
     920#endif 
     921 
    908922 
    909923    /* 
     
    937951        } 
    938952    } 
     953 
     954#ifdef VBOX_WITH_USB 
     955    /* ditto for USB Devices. */ 
     956    rc = pdmR3UsbInitComplete(pVM); 
     957    if (RT_FAILURE(rc)) 
     958        return rc; 
     959#endif 
    939960 
    940961    LogFlow(("pdmR3DevInit: returns %Vrc\n", VINF_SUCCESS)); 
  • trunk/src/VBox/VMM/PDMDriver.cpp

    r3853 r3857  
    4949/** 
    5050 * Internal callback structure pointer. 
     51 * 
    5152 * The main purpose is to define the extra data we associate 
    5253 * with PDMDRVREGCB so we can find the VM instance and so on. 
  • trunk/src/VBox/VMM/PDMInternal.h

    r3852 r3857  
    314314    /** Registration structure. */ 
    315315    R3PTRTYPE(const struct PDMUSBREG *) pUsbReg; 
    316     /** Number of instances. */ 
    317     RTUINT                              cInstances
     316    /** Next instance number. */ 
     317    RTUINT                              iNextInstance
    318318    /** Pointer to chain of instances (R3 Ptr). */ 
    319319    R3PTRTYPE(PPDMUSBINS)               pInstances; 
     
    784784    HCPTRTYPE(PPDMRTC)              pRtc; 
    785785    /** The registered USB HUBs. (FIFO) */ 
    786     R3PTRTYPE(PPDMUSBHUB)           pUSBHubs; 
     786    R3PTRTYPE(PPDMUSBHUB)           pUsbHubs; 
    787787 
    788788    /** Queue in which devhlp tasks are queued for R3 execution - HC Ptr. */ 
     
    864864int         pdmR3DevFindLun(PVM pVM, const char *pszDevice, unsigned iInstance, unsigned iLun, PPDMLUN *ppLun); 
    865865 
    866 int         pdmR3UsbInit(PVM pVM); 
     866int         pdmR3UsbLoadModules(PVM pVM); 
     867int         pdmR3UsbInstantiateDevices(PVM pVM); 
     868int         pdmR3UsbInitComplete(PVM pVM); 
    867869PPDMUSB     pdmR3UsbLookup(PVM pVM, const char *pszName); 
    868870int         pdmR3UsbFindLun(PVM pVM, const char *pszDevice, unsigned iInstance, unsigned iLun, PPDMLUN *ppLun); 
  • trunk/src/VBox/VMM/testcase/tstVMStructGC.cpp

    r3852 r3857  
    235235    GEN_CHECK_OFF(PDM, pDmac); 
    236236    GEN_CHECK_OFF(PDM, pRtc); 
    237     GEN_CHECK_OFF(PDM, pUSBHubs); 
     237    GEN_CHECK_OFF(PDM, pUsbHubs); 
    238238    GEN_CHECK_OFF(PDM, pDevHlpQueueGC); 
    239239    GEN_CHECK_OFF(PDM, pDevHlpQueueHC); 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy