VirtualBox

Changeset 5613 in vbox


Ignore:
Timestamp:
Nov 2, 2007 12:56:49 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
25906
Message:

EHCI: Added xml setting to enable the EHCI controller.

Location:
trunk/src/VBox/Main
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r5586 r5613  
    13551355
    13561356#ifdef VBOX_WITH_EHCI
    1357             rc = CFGMR3InsertNode(pDevices, "usb-ehci", &pDev);                         RC_CHECK();
    1358             rc = CFGMR3InsertNode(pDev,     "0", &pInst);                               RC_CHECK();
    1359             rc = CFGMR3InsertNode(pInst,    "Config", &pCfg);                           RC_CHECK();
    1360             rc = CFGMR3InsertInteger(pInst, "Trusted",              1); /* boolean */   RC_CHECK();
    1361             rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo",          11);                RC_CHECK();
    1362             Assert(!faPciDeviceNo[11]);
    1363             faPciDeviceNo[11] = true;
    1364             rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo",        0);                 RC_CHECK();
    1365 
    1366             rc = CFGMR3InsertNode(pInst,    "LUN#0", &pLunL0);                          RC_CHECK();
    1367             rc = CFGMR3InsertString(pLunL0, "Driver",               "VUSBRootHub");     RC_CHECK();
    1368             rc = CFGMR3InsertNode(pLunL0,   "Config", &pCfg);                           RC_CHECK();
    1369 
    1370             /*
    1371              * Attach the status driver.
    1372              */
    1373             rc = CFGMR3InsertNode(pInst,    "LUN#999", &pLunL0);                        RC_CHECK();
    1374             rc = CFGMR3InsertString(pLunL0, "Driver",               "MainStatus");      RC_CHECK();
    1375             rc = CFGMR3InsertNode(pLunL0,   "Config", &pCfg);                           RC_CHECK();
    1376             rc = CFGMR3InsertInteger(pCfg,  "papLeds", (uintptr_t)&pConsole->mapUSBLed);RC_CHECK();
    1377             rc = CFGMR3InsertInteger(pCfg,  "First",    0);                             RC_CHECK();
    1378             rc = CFGMR3InsertInteger(pCfg,  "Last",     0);                             RC_CHECK();
     1357            hrc = USBCtlPtr->COMGETTER(EnabledEhci)(&fEnabled);                         H();
     1358            if (fEnabled)
     1359            {
     1360                rc = CFGMR3InsertNode(pDevices, "usb-ehci", &pDev);                         RC_CHECK();
     1361                rc = CFGMR3InsertNode(pDev,     "0", &pInst);                               RC_CHECK();
     1362                rc = CFGMR3InsertNode(pInst,    "Config", &pCfg);                           RC_CHECK();
     1363                rc = CFGMR3InsertInteger(pInst, "Trusted",              1); /* boolean */   RC_CHECK();
     1364                rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo",          11);                RC_CHECK();
     1365                Assert(!faPciDeviceNo[11]);
     1366                faPciDeviceNo[11] = true;
     1367                rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo",        0);                 RC_CHECK();
     1368
     1369                rc = CFGMR3InsertNode(pInst,    "LUN#0", &pLunL0);                          RC_CHECK();
     1370                rc = CFGMR3InsertString(pLunL0, "Driver",               "VUSBRootHub");     RC_CHECK();
     1371                rc = CFGMR3InsertNode(pLunL0,   "Config", &pCfg);                           RC_CHECK();
     1372
     1373                /*
     1374                 * Attach the status driver.
     1375                 */
     1376                rc = CFGMR3InsertNode(pInst,    "LUN#999", &pLunL0);                        RC_CHECK();
     1377                rc = CFGMR3InsertString(pLunL0, "Driver",               "MainStatus");      RC_CHECK();
     1378                rc = CFGMR3InsertNode(pLunL0,   "Config", &pCfg);                           RC_CHECK();
     1379                rc = CFGMR3InsertInteger(pCfg,  "papLeds", (uintptr_t)&pConsole->mapUSBLed);RC_CHECK();
     1380                rc = CFGMR3InsertInteger(pCfg,  "First",    0);                             RC_CHECK();
     1381                rc = CFGMR3InsertInteger(pCfg,  "Last",     0);                             RC_CHECK();
     1382            }
    13791383#endif
    13801384        }
  • trunk/src/VBox/Main/USBControllerImpl.cpp

    r5162 r5613  
    241241}
    242242
     243STDMETHODIMP USBController::COMGETTER(EnabledEhci) (BOOL *aEnabled)
     244{
     245    if (!aEnabled)
     246        return E_POINTER;
     247
     248    AutoCaller autoCaller (this);
     249    CheckComRCReturnRC (autoCaller.rc());
     250
     251    AutoReaderLock alock (this);
     252
     253    *aEnabled = mData->mEnabledEhci;
     254
     255    return S_OK;
     256}
     257
     258STDMETHODIMP USBController::COMSETTER(EnabledEhci) (BOOL aEnabled)
     259{
     260    LogFlowThisFunc (("aEnabled=%RTbool\n", aEnabled));
     261
     262    AutoCaller autoCaller (this);
     263    CheckComRCReturnRC (autoCaller.rc());
     264
     265    /* the machine needs to be mutable */
     266    Machine::AutoMutableStateDependency adep (mParent);
     267    CheckComRCReturnRC (adep.rc());
     268
     269    AutoLock alock (this);
     270
     271    if (mData->mEnabledEhci != aEnabled)
     272    {
     273        mData.backup();
     274        mData->mEnabledEhci = aEnabled;
     275
     276        /* leave the lock for safety */
     277        alock.leave();
     278
     279        mParent->onUSBControllerChange();
     280    }
     281
     282    return S_OK;
     283}
     284
    243285STDMETHODIMP USBController::COMGETTER(USBStandard) (USHORT *aUSBStandard)
    244286{
     
    251293    /* not accessing data -- no need to lock */
    252294
     295    /** Note: This is no longer correct */
    253296    *aUSBStandard = 0x0101;
    254297
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r5528 r5613  
    77267726    </attribute>
    77277727
     7728    <attribute name="enabledEhci" type="boolean">
     7729      <desc>
     7730        Flag whether the USB EHCI controller is present in the
     7731        guest system. If disabled, the virtual guest hardware will
     7732        not contain a USB EHCI controller. Can only be changed when
     7733        the VM is powered off.
     7734      </desc>
     7735    </attribute>
     7736
    77287737    <attribute name="USBStandard" type="unsigned short" readonly="yes">
    77297738      <desc>
  • trunk/src/VBox/Main/include/USBControllerImpl.h

    r4071 r5613  
    4747    {
    4848        /* Constructor. */
    49         Data() : mEnabled (FALSE) { }
     49        Data() : mEnabled (FALSE), mEnabledEhci (FALSE) { }
    5050
    5151        bool operator== (const Data &that) const
    5252        {
    53             return this == &that || mEnabled == that.mEnabled;
     53            return this == &that || (mEnabled == that.mEnabled && mEnabledEhci == that.mEnabledEhci);
    5454        }
    5555
    5656        /** Enabled indicator. */
    5757        BOOL mEnabled;
     58
     59        /** Enabled indicator for EHCI. */
     60        BOOL mEnabledEhci;
    5861    };
    5962
     
    8790    STDMETHOD(COMGETTER(Enabled)) (BOOL *aEnabled);
    8891    STDMETHOD(COMSETTER(Enabled)) (BOOL aEnabled);
     92    STDMETHOD(COMGETTER(EnabledEhci)) (BOOL *aEnabled);
     93    STDMETHOD(COMSETTER(EnabledEhci)) (BOOL aEnabled);
    8994    STDMETHOD(COMGETTER(USBStandard)) (USHORT *aUSBStandard);
    9095    STDMETHOD(COMGETTER(DeviceFilters)) (IUSBDeviceFilterCollection **aDevicesFilters);
  • trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd

    r5361 r5613  
    534534  </xsd:sequence>
    535535  <xsd:attribute name="enabled" type="xsd:boolean" use="required"/>
     536  <xsd:attribute name="enabledEhci" type="xsd:boolean" default="false"/>
    536537</xsd:complexType>
    537538
Note: See TracChangeset for help on using the changeset viewer.

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