VirtualBox

Changeset 5721 in vbox


Ignore:
Timestamp:
Nov 13, 2007 12:15:51 PM (17 years ago)
Author:
vboxsync
Message:

Cleaned out some old (pre-PDMUSB) code.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r5718 r5721  
    205205# Enable the USB 2.0 controller
    206206VBOX_WITH_EHCI = 1
    207 # Enable the new PDM USB management code (work in progress).
    208 VBOX_WITH_PDMUSB = 1
    209207# Enable the ISCSI feature.
    210208VBOX_WITH_ISCSI = 1
  • trunk/src/VBox/Devices/Makefile.kmk

    r5719 r5721  
    102102ifdef VBOX_WITH_USB
    103103 VBoxDD_DEFS           += VBOX_WITH_USB IN_USB_R3
    104  ifdef VBOX_WITH_PDMUSB
    105   VBoxDD_DEFS          += VBOX_WITH_PDMUSB
    106  endif
    107104 ifdef VBOX_WITH_EHCI
    108105  VBoxDD_DEFS          += VBOX_WITH_EHCI
     
    224221ifdef VBOX_WITH_USB
    225222DevicesR3_DEFS         += VBOX_WITH_USB IN_USB_R3
    226  ifdef VBOX_WITH_PDMUSB
    227   DevicesR3_DEFS       += VBOX_WITH_PDMUSB
    228  endif
    229223
    230224DevicesR3_SOURCES      += \
     
    561555ifdef VBOX_WITH_USB
    562556 Drivers_DEFS         += VBOX_WITH_USB IN_USB_R3
    563  ifdef VBOX_WITH_PDMUSB
    564   Drivers_DEFS        += VBOX_WITH_PDMUSB
    565  endif
    566557 Drivers_SOURCES      += \
    567558        USB/DrvVUSBRootHub.cpp \
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r5713 r5721  
    33983398    }
    33993399
    3400 #ifndef VBOX_WITH_PDMUSB
    3401     /* Don't proceed unless we've found the usb controller. */
    3402     PPDMIBASE pBase = NULL;
    3403     int vrc = PDMR3QueryLun (mpVM, "usb-ohci", 0, 0, &pBase);
    3404     if (VBOX_FAILURE (vrc))
     3400    /* Don't proceed unless there's at least one USB hub. */
     3401    if (!PDMR3USBHasHub (mpVM))
    34053402    {
    34063403        LogFlowThisFunc (("Attach request ignored (no USB controller).\n"));
     
    34083405    }
    34093406
    3410     PVUSBIRHCONFIG pRhConfig = (PVUSBIRHCONFIG) pBase->
    3411         pfnQueryInterface (pBase, PDMINTERFACE_VUSB_RH_CONFIG);
    3412     ComAssertRet (pRhConfig, E_FAIL);
    3413 
    3414     HRESULT rc = attachUSBDevice (aDevice, pRhConfig);
    3415 #else /* PDMUsb */
    3416     /* Don't proceed unless there's at least one USB hub. */
    3417     if (!PDMR3USBHasHub (mpVM))
    3418     {
    3419         LogFlowThisFunc (("Attach request ignored (no USB controller).\n"));
    3420         return E_FAIL;
    3421     }
    3422 
    34233407    HRESULT rc = attachUSBDevice (aDevice, aMaskedIfs);
    3424 #endif /* PDMUsb */
    3425 
    34263408    if (FAILED (rc))
    34273409    {
     
    47064688 *  @note Must be called from under this object's lock.
    47074689 */
    4708 #ifndef VBOX_WITH_PDMUSB
    4709 HRESULT Console::attachUSBDevice (IUSBDevice *aHostDevice, PVUSBIRHCONFIG aConfig)
    4710 {
    4711     AssertReturn (aHostDevice && aConfig, E_FAIL);
    4712 #else /* PDMUsb */
    47134690HRESULT Console::attachUSBDevice (IUSBDevice *aHostDevice, ULONG aMaskedIfs)
    47144691{
    47154692    AssertReturn (aHostDevice, E_FAIL);
    4716 #endif
    4717 
    47184693    AssertReturn (isLockedOnCurrentThread(), E_FAIL);
    47194694
     
    47384713
    47394714    BOOL fRemote = FALSE;
    4740 #ifndef VBOX_WITH_PDMUSB
    4741     void *pvRemote = NULL;
    4742 #endif
    4743 
    47444715    hrc = aHostDevice->COMGETTER (Remote) (&fRemote);
    47454716    ComAssertComRCRetRC (hrc);
     
    47554726    alock.leave();
    47564727
    4757 #ifndef VBOX_WITH_PDMUSB
    4758     PVMREQ pReq = NULL;
    4759     int vrc = VMR3ReqCall (mpVM, &pReq, RT_INDEFINITE_WAIT,
    4760                            (PFNRT) usbAttachCallback, 7,
    4761                            this, aHostDevice,
    4762                            aConfig, Uuid.ptr(), fRemote, Address.raw(), pvRemote);
    4763 #else /* PDMUsb */
    47644728/**@todo just do everything here */
    47654729    PVMREQ pReq = NULL;
    47664730    int vrc = VMR3ReqCall (mpVM, &pReq, RT_INDEFINITE_WAIT,
    47674731                           (PFNRT) usbAttachCallback, 6, this, aHostDevice, Uuid.ptr(), fRemote, Address.raw(), aMaskedIfs);
    4768 #endif /* PDMUsb */
    47694732    if (VBOX_SUCCESS (vrc))
    47704733        vrc = pReq->iStatus;
     
    48104773 *  @note Locks the console object for writing.
    48114774 */
    4812 #ifndef VBOX_WITH_PDMUSB
     4775//static
    48134776DECLCALLBACK(int)
    4814 Console::usbAttachCallback (Console *that, IUSBDevice *aHostDevice,
    4815                             PVUSBIRHCONFIG aConfig, PCRTUUID aUuid, bool aRemote,
    4816                             const char *aAddress, void *aRemoteBackend)
     4777Console::usbAttachCallback (Console *that, IUSBDevice *aHostDevice, PCRTUUID aUuid, bool aRemote, const char *aAddress, ULONG aMaskedIfs)
    48174778{
    48184779    LogFlowFuncEnter();
    48194780    LogFlowFunc (("that={%p}\n", that));
    48204781
    4821     AssertReturn (that && aConfig && aUuid, VERR_INVALID_PARAMETER);
    4822 
     4782    AssertReturn (that && aUuid, VERR_INVALID_PARAMETER);
     4783
     4784    void *pvRemoteBackend = NULL;
    48234785    if (aRemote)
    48244786    {
    4825         /* @todo aRemoteBackend input parameter is not needed. */
    4826         Assert (aRemoteBackend == NULL);
    4827 
    48284787        RemoteUSBDevice *pRemoteUSBDevice = static_cast <RemoteUSBDevice *> (aHostDevice);
    4829 
    48304788        Guid guid (*aUuid);
    48314789
    4832         aRemoteBackend = that->consoleVRDPServer ()->USBBackendRequestPointer (pRemoteUSBDevice->clientId (), &guid);
    4833 
    4834         if (aRemoteBackend == NULL)
    4835         {
    4836             /* The clientId is invalid then. */
    4837             return VERR_INVALID_PARAMETER;
    4838         }
    4839     }
    4840 
    4841     int vrc = aConfig->pfnCreateProxyDevice (aConfig, aUuid, aRemote, aAddress,
    4842                                              aRemoteBackend);
    4843 
     4790        pvRemoteBackend = that->consoleVRDPServer ()->USBBackendRequestPointer (pRemoteUSBDevice->clientId (), &guid);
     4791        if (!pvRemoteBackend)
     4792            return VERR_INVALID_PARAMETER;  /* The clientId is invalid then. */
     4793    }
     4794
     4795    USHORT portVersion = 1;
     4796    HRESULT hrc = aHostDevice->COMGETTER(PortVersion)(&portVersion);
     4797    AssertComRCReturn(hrc, VERR_GENERAL_FAILURE);
     4798    Assert(portVersion == 1 || portVersion == 2);
     4799
     4800    int vrc = PDMR3USBCreateProxyDevice (that->mpVM, aUuid, aRemote, aAddress, pvRemoteBackend,
     4801                                         portVersion == 1 ? VUSB_STDVER_11 : VUSB_STDVER_20, aMaskedIfs);
    48444802    if (VBOX_SUCCESS (vrc))
    48454803    {
     
    48624820    return vrc;
    48634821}
    4864 #else /* PDMUsb */
    4865 //static
    4866 DECLCALLBACK(int)
    4867 Console::usbAttachCallback (Console *that, IUSBDevice *aHostDevice, PCRTUUID aUuid, bool aRemote, const char *aAddress, ULONG aMaskedIfs)
    4868 {
    4869     LogFlowFuncEnter();
    4870     LogFlowFunc (("that={%p}\n", that));
    4871 
    4872     AssertReturn (that && aUuid, VERR_INVALID_PARAMETER);
    4873 
    4874     void *pvRemoteBackend = NULL;
    4875     if (aRemote)
    4876     {
    4877         RemoteUSBDevice *pRemoteUSBDevice = static_cast <RemoteUSBDevice *> (aHostDevice);
    4878         Guid guid (*aUuid);
    4879 
    4880         pvRemoteBackend = that->consoleVRDPServer ()->USBBackendRequestPointer (pRemoteUSBDevice->clientId (), &guid);
    4881         if (!pvRemoteBackend)
    4882             return VERR_INVALID_PARAMETER;  /* The clientId is invalid then. */
    4883     }
    4884 
    4885     USHORT portVersion = 1;
    4886     HRESULT hrc = aHostDevice->COMGETTER(PortVersion)(&portVersion);
    4887     AssertComRCReturn(hrc, VERR_GENERAL_FAILURE);
    4888     Assert(portVersion == 1 || portVersion == 2);
    4889 
    4890     int vrc = PDMR3USBCreateProxyDevice (that->mpVM, aUuid, aRemote, aAddress, pvRemoteBackend,
    4891                                          portVersion == 1 ? VUSB_STDVER_11 : VUSB_STDVER_20, aMaskedIfs);
    4892     if (VBOX_SUCCESS (vrc))
    4893     {
    4894         /* Create a OUSBDevice and add it to the device list */
    4895         ComObjPtr <OUSBDevice> device;
    4896         device.createObject();
    4897         HRESULT hrc = device->init (aHostDevice);
    4898         AssertComRC (hrc);
    4899 
    4900         AutoLock alock (that);
    4901         that->mUSBDevices.push_back (device);
    4902         LogFlowFunc (("Attached device {%Vuuid}\n", device->id().raw()));
    4903 
    4904         /* notify callbacks */
    4905         that->onUSBDeviceStateChange (device, true /* aAttached */, NULL);
    4906     }
    4907 
    4908     LogFlowFunc (("vrc=%Vrc\n", vrc));
    4909     LogFlowFuncLeave();
    4910     return vrc;
    4911 }
    4912 #endif /* PDMUsb */
    49134822
    49144823/**
     
    49334842    CheckComRCReturnRC (autoVMCaller.rc());
    49344843
    4935 #ifndef VBOX_WITH_PDMUSB
    4936     PPDMIBASE pBase = NULL;
    4937     int vrc = PDMR3QueryLun (mpVM, "usb-ohci", 0, 0, &pBase);
    4938 
    4939     /* if the device is attached, then there must be a USB controller */
    4940     AssertRCReturn (vrc, E_FAIL);
    4941 
    4942     PVUSBIRHCONFIG pRhConfig = (PVUSBIRHCONFIG) pBase->
    4943         pfnQueryInterface (pBase, PDMINTERFACE_VUSB_RH_CONFIG);
    4944     AssertReturn (pRhConfig, E_FAIL);
    4945 #else
    49464844    /* if the device is attached, then there must at least one USB hub. */
    49474845    AssertReturn (PDMR3USBHasHub (mpVM), E_FAIL);
    4948 #endif
    49494846
    49504847    LogFlowThisFunc (("Detaching USB proxy device {%Vuuid}...\n",
     
    49554852
    49564853    PVMREQ pReq;
    4957 #ifndef VBOX_WITH_PDMUSB
    4958     vrc = VMR3ReqCall (mpVM, &pReq, RT_INDEFINITE_WAIT,
    4959                        (PFNRT) usbDetachCallback, 5,
    4960                        this, &aIt, pRhConfig, (*aIt)->id().raw());
    4961 #else
    49624854/** @todo just do everything here */
    49634855    int vrc = VMR3ReqCall (mpVM, &pReq, RT_INDEFINITE_WAIT,
    49644856                           (PFNRT) usbDetachCallback, 4,
    49654857                           this, &aIt, (*aIt)->id().raw());
    4966 #endif
    49674858    if (VBOX_SUCCESS (vrc))
    49684859        vrc = pReq->iStatus;
     
    49834874 *  @note Locks the console object for writing.
    49844875 */
    4985 #ifndef VBOX_WITH_PDMUSB
    49864876//static
    49874877DECLCALLBACK(int)
    4988 Console::usbDetachCallback (Console *that, USBDeviceList::iterator *aIt,
    4989                             PVUSBIRHCONFIG aConfig, PCRTUUID aUuid)
     4878Console::usbDetachCallback (Console *that, USBDeviceList::iterator *aIt, PCRTUUID aUuid)
    49904879{
    49914880    LogFlowFuncEnter();
    49924881    LogFlowFunc (("that={%p}\n", that));
    49934882
    4994     AssertReturn (that && aConfig && aUuid, VERR_INVALID_PARAMETER);
     4883    AssertReturn (that && aUuid, VERR_INVALID_PARAMETER);
    49954884
    49964885    /*
     
    50094898    }
    50104899
    5011     int vrc = aConfig->pfnDestroyProxyDevice (aConfig, aUuid);
     4900    int vrc = PDMR3USBDetachDevice (that->mpVM, aUuid);
    50124901
    50134902    if (VBOX_SUCCESS (vrc))
     
    50274916    return vrc;
    50284917}
    5029 #else /* VBOX_WITH_PDMUSB */
    5030 //static
    5031 DECLCALLBACK(int)
    5032 Console::usbDetachCallback (Console *that, USBDeviceList::iterator *aIt, PCRTUUID aUuid)
    5033 {
    5034     LogFlowFuncEnter();
    5035     LogFlowFunc (("that={%p}\n", that));
    5036 
    5037     AssertReturn (that && aUuid, VERR_INVALID_PARAMETER);
    5038 
    5039     /*
    5040      * If that was a remote device, release the backend pointer.
    5041      * The pointer was requested in usbAttachCallback.
    5042      */
    5043     BOOL fRemote = FALSE;
    5044 
    5045     HRESULT hrc2 = (**aIt)->COMGETTER (Remote) (&fRemote);
    5046     ComAssertComRC (hrc2);
    5047 
    5048     if (fRemote)
    5049     {
    5050         Guid guid (*aUuid);
    5051         that->consoleVRDPServer ()->USBBackendReleasePointer (&guid);
    5052     }
    5053 
    5054     int vrc = PDMR3USBDetachDevice (that->mpVM, aUuid);
    5055 
    5056     if (VBOX_SUCCESS (vrc))
    5057     {
    5058         AutoLock alock (that);
    5059 
    5060         /* Remove the device from the collection */
    5061         that->mUSBDevices.erase (*aIt);
    5062         LogFlowFunc (("Detached device {%Vuuid}\n", (**aIt)->id().raw()));
    5063 
    5064         /* notify callbacks */
    5065         that->onUSBDeviceStateChange (**aIt, false /* aAttached */, NULL);
    5066     }
    5067 
    5068     LogFlowFunc (("vrc=%Vrc\n", vrc));
    5069     LogFlowFuncLeave();
    5070     return vrc;
    5071 }
    5072 #endif /* VBOX_WITH_PDMUSB */
    50734918
    50744919/**
  • trunk/src/VBox/Main/Makefile.kmk

    r5652 r5721  
    112112ifdef VBOX_WITH_EHCI
    113113VBoxSVC_DEFS += VBOX_WITH_EHCI
    114 endif
    115 ifdef VBOX_WITH_PDMUSB
    116 VBoxSVC_DEFS += VBOX_WITH_PDMUSB
    117114endif
    118115endif
     
    295292VBoxC_DEFS += VBOX_WITH_EHCI
    296293endif
    297 ifdef VBOX_WITH_PDMUSB
    298 VBoxC_DEFS += VBOX_WITH_PDMUSB
    299 endif
    300294endif
    301295ifdef VBOX_WITH_ALSA
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r5713 r5721  
    404404                                          const char *pszPath, bool fPassthrough);
    405405
    406 #ifndef VBOX_WITH_PDMUSB
    407     HRESULT attachUSBDevice (IUSBDevice *aHostDevice, PVUSBIRHCONFIG aConfig);
    408     HRESULT detachUSBDevice (USBDeviceList::iterator &aIt);
    409 
    410     static DECLCALLBACK(int)
    411     usbAttachCallback (Console *that, IUSBDevice *aHostDevice,
    412                        PVUSBIRHCONFIG aConfig, PCRTUUID aUuid, bool aRemote,
    413                        const char *aAddress, void *aRemoteBackend);
    414     static DECLCALLBACK(int)
    415     usbDetachCallback (Console *that, USBDeviceList::iterator *aIt,
    416                        PVUSBIRHCONFIG aConfig, PCRTUUID aUuid);
    417 #else /* PDMUsb coding. */
    418406    HRESULT attachUSBDevice (IUSBDevice *aHostDevice, ULONG aMaskedIfs);
    419407    HRESULT detachUSBDevice (USBDeviceList::iterator &aIt);
     
    424412    static DECLCALLBACK(int)
    425413    usbDetachCallback (Console *that, USBDeviceList::iterator *aIt, PCRTUUID aUuid);
    426 #endif /* PDMUsb coding. */
    427414
    428415    static DECLCALLBACK (int)
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