VirtualBox

Changeset 50721 in vbox


Ignore:
Timestamp:
Mar 6, 2014 9:40:39 PM (11 years ago)
Author:
vboxsync
Message:

Updated USB configuration.

Location:
trunk/src/VBox
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp

    r49621 r50721  
    17771777        bool fOhciEnabled = false;
    17781778        bool fEhciEnabled = false;
     1779        bool fXhciEnabled = false;
    17791780
    17801781        for (unsigned i = 0; i < USBCtlColl.size(); i++)
     
    17931794                        fEhciEnabled = true;
    17941795                        break;
     1796                    case USBControllerType_XHCI:
     1797                        fXhciEnabled = true;
     1798                        break;
    17951799                    default:
    17961800                        break;
     
    18081812        else
    18091813            RTPrintf("EHCI:            %s\n", fEhciEnabled ? "enabled" : "disabled");
     1814
     1815        if (details == VMINFO_MACHINEREADABLE)
     1816            RTPrintf("xhci=\"%s\"\n", fXhciEnabled ? "on" : "off");
     1817        else
     1818            RTPrintf("XHCI:            %s\n", fXhciEnabled ? "enabled" : "disabled");
    18101819    }
    18111820
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp

    r49983 r50721  
    161161    MODIFYVM_VRDE,
    162162    MODIFYVM_RTCUSEUTC,
     163    MODIFYVM_USBXHCI,
    163164    MODIFYVM_USBEHCI,
    164165    MODIFYVM_USB,
     
    323324    { "--vrdeextpack",              MODIFYVM_VRDE_EXTPACK,              RTGETOPT_REQ_STRING },
    324325    { "--vrde",                     MODIFYVM_VRDE,                      RTGETOPT_REQ_BOOL_ONOFF },
     326    { "--usbxhci",                  MODIFYVM_USBXHCI,                   RTGETOPT_REQ_BOOL_ONOFF },
    325327    { "--usbehci",                  MODIFYVM_USBEHCI,                   RTGETOPT_REQ_BOOL_ONOFF },
    326328    { "--usb",                      MODIFYVM_USB,                       RTGETOPT_REQ_BOOL_ONOFF },
     
    23632365            }
    23642366
     2367            case MODIFYVM_USBXHCI:
     2368            {
     2369                ULONG cXhciCtrls = 0;
     2370                rc = machine->GetUSBControllerCountByType(USBControllerType_XHCI, &cXhciCtrls);
     2371                if (SUCCEEDED(rc))
     2372                {
     2373                    if (!cXhciCtrls && ValueUnion.f)
     2374                    {
     2375                        ComPtr<IUSBController> UsbCtl;
     2376                        CHECK_ERROR(machine, AddUSBController(Bstr("XHCI").raw(), USBControllerType_XHCI,
     2377                                                              UsbCtl.asOutParam()));
     2378                    }
     2379                    else if (cXhciCtrls && !ValueUnion.f)
     2380                        CHECK_ERROR(machine, RemoveUSBController(Bstr("XHCI").raw()));
     2381                }
     2382                break;
     2383            }
     2384
    23652385            case MODIFYVM_USBEHCI:
    23662386            {
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r50447 r50721  
    1689916899    <const name="OHCI"      value="1"/>
    1690016900    <const name="EHCI"      value="2"/>
    16901     <const name="Last"      value="3">
     16901    <const name="XHCI"      value="3"/>
     16902    <const name="Last"      value="4">
    1690216903      <desc>Last element (invalid). Used for parameter checks.</desc>
    1690316904    </const>
  • trunk/src/VBox/Main/src-client/BusAssignmentManager.cpp

    r47223 r50721  
    7272    {"usb-ohci",      0,  6,  0, 0},
    7373    {"usb-ehci",      0, 11,  0, 0},
     74    {"usb-xhci",      0, 12,  0, 0},
    7475
    7576    /* ACPI controller */
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r50686 r50721  
    16911691        hrc = pMachine->COMGETTER(USBControllers)(ComSafeArrayAsOutParam(usbCtrls));        H();
    16921692        bool fOhciPresent = false; /**< Flag whether at least one OHCI controller is present. */
     1693        bool fXhciPresent = false; /**< Flag whether at least one XHCI controller is present. */
    16931694
    16941695        for (size_t i = 0; i < usbCtrls.size(); ++i)
     
    17011702                break;
    17021703            }
     1704            else if (enmCtrlType == USBControllerType_XHCI)
     1705            {
     1706                fXhciPresent = true;
     1707                break;
     1708            }
    17031709        }
    17041710
    17051711        /*
    1706          * Currently EHCI is only enabled when a OHCI controller is present too.
    1707          * This might change when XHCI is supported.
     1712         * Currently EHCI is only enabled when an OHCI or XHCI controller is present as well.
    17081713         */
    1709         if (fOhciPresent)
     1714        if (fOhciPresent || fXhciPresent)
    17101715            mfVMHasUsbController = true;
    17111716
     
    17811786                }
    17821787#endif
     1788                else if (enmCtrlType == USBControllerType_XHCI)
     1789                {
     1790                    /*
     1791                     * USB 3.0 is only available if the proper ExtPack is installed.
     1792                     *
     1793                     * Note. Configuring EHCI here and providing messages about
     1794                     * the missing extpack isn't exactly clean, but it is a
     1795                     * necessary evil to patch over legacy compatability issues
     1796                     * introduced by the new distribution model.
     1797                     */
     1798                    static const char *s_pszUsbExtPackName = "Oracle VM VirtualBox Extension Pack";
     1799# ifdef VBOX_WITH_EXTPACK
     1800                    if (mptrExtPackManager->isExtPackUsable(s_pszUsbExtPackName))
     1801# endif
     1802                    {
     1803                        InsertConfigNode(pDevices, "usb-xhci", &pDev);
     1804                        InsertConfigNode(pDev,     "0", &pInst);
     1805                        InsertConfigNode(pInst,    "Config", &pCfg);
     1806                        InsertConfigInteger(pInst, "Trusted", 1); /* boolean */
     1807                        hrc = pBusMgr->assignPCIDevice("usb-xhci", pInst);                  H();
     1808
     1809                        InsertConfigNode(pInst,    "LUN#0", &pLunL0);
     1810                        InsertConfigString(pLunL0, "Driver",               "VUSBRootHub");
     1811                        InsertConfigNode(pLunL0,   "Config", &pCfg);
     1812
     1813                        /*
     1814                         * Attach the status driver.
     1815                         */
     1816                        attachStatusDriver(pInst, &mapUSBLed[1], 0, 0, NULL, NULL, 0);
     1817                    }
     1818# ifdef VBOX_WITH_EXTPACK
     1819                    else
     1820                    {
     1821                        /* Always fatal. */
     1822                        return VMR3SetError(pUVM, VERR_NOT_FOUND, RT_SRC_POS,
     1823                                N_("Implementation of the USB 3.0 controller not found!\n"
     1824                                   "Because the USB 3.0 controller state is part of the saved "
     1825                                   "VM state, the VM cannot be started. To fix "
     1826                                   "this problem, either install the '%s' or disable USB 3.0 "
     1827                                   "support in the VM settings"),
     1828                                s_pszUsbExtPackName);
     1829                    }
     1830# endif
     1831                }
    17831832            } /* for every USB controller. */
    17841833
  • trunk/src/VBox/Main/src-server/SystemPropertiesImpl.cpp

    r50455 r50721  
    575575        case USBControllerType_OHCI:
    576576        case USBControllerType_EHCI:
     577        case USBControllerType_XHCI:
    577578        {
    578579            cCtrs = 1;
  • trunk/src/VBox/Main/src-server/USBControllerImpl.cpp

    r49871 r50721  
    101101    ComAssertRet(aParent && !aName.isEmpty(), E_INVALIDARG);
    102102    if (   (enmType <= USBControllerType_Null)
    103         || (enmType >  USBControllerType_EHCI))
     103        || (enmType >  USBControllerType_XHCI))
    104104        return setError(E_INVALIDARG,
    105105                        tr("Invalid USB controller type"));
     
    263263            break;
    264264        case USBControllerType_EHCI:
     265            *aUSBStandard = 0x0200;
     266            break;
     267        case USBControllerType_XHCI:
    265268            *aUSBStandard = 0x0200;
    266269            break;
  • trunk/src/VBox/Main/xml/Settings.cpp

    r50196 r50721  
    30853085                        else if (strCtrlType == "EHCI")
    30863086                            ctrl.enmType = USBControllerType_EHCI;
     3087                        else if (strCtrlType == "XHCI")
     3088                            ctrl.enmType = USBControllerType_XHCI;
    30873089                        else
    30883090                            throw ConfigFileError(this, pelmCtrl, N_("Invalid value '%s' for Controller/@type attribute"), strCtrlType.c_str());
     
    43914393                    strType = "EHCI";
    43924394                    break;
     4395                case USBControllerType_XHCI:
     4396                    strType = "XHCI";
     4397                    break;
    43934398                default:
    43944399                    AssertMsgFailed(("Unknown USB controller type %d\n", ctrl.enmType));
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