VirtualBox

Changeset 107267 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Dec 10, 2024 7:37:35 AM (2 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
166288
Message:

Main/API,UI: bugref:10810 Based on Brent's patch, added UsbNet support into Main API and UI

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r107239 r107267  
    2244822448        <desc>3Com EtherLink network card (3C501/3C500).</desc>
    2244922449    </const>
     22450    <const name="UsbNet"                value="14">
     22451        <desc>Ethernet over USB device (usbnet).</desc>
     22452    </const>
    2245022453  </enum>
    2245122454
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r106960 r107267  
    877877    int i_configNetworkCtrls(ComPtr<IMachine> pMachine, ComPtr<IPlatformProperties> pPlatformProperties,
    878878                             ChipsetType_T enmChipset, BusAssignmentManager *pBusMgr, PCVMMR3VTABLE pVMM, PUVM pUVM,
    879                              PCFGMNODE pDevices, std::list<BootNic> &llBootNics);
     879                             PCFGMNODE pDevices, PCFGMNODE pUsbDevices, std::list<BootNic> &llBootNics);
    880880#if defined(VBOX_WITH_TPM)
    881881    int i_configTpm(ComPtr<ITrustedPlatformModule> pTpm, TpmType_T enmTpmType, PCFGMNODE pDevices,
  • trunk/src/VBox/Main/src-all/PlatformPropertiesImpl.cpp

    r107017 r107267  
    781781              , NetworkAdapterType_Virtio
    782782#endif
     783              , NetworkAdapterType_UsbNet
    783784            };
    784785            aSupportedNetworkAdapterTypes.assign(aNetworkAdapterTypes + 1 /* Don't include _Null */,
     
    800801              , NetworkAdapterType_Virtio
    801802#endif
     803              , NetworkAdapterType_UsbNet
    802804            };
    803805            aSupportedNetworkAdapterTypes.assign(aNetworkAdapterTypes + 1 /* Don't include _Null */,
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r107116 r107267  
    16981698        case NetworkAdapterType_ELNK1:
    16991699            return "3c501";
     1700        case NetworkAdapterType_UsbNet:
     1701            return "usbnet";
    17001702        default:
    17011703            AssertFailed();
     
    43534355
    43544356                    PPDMIBASE pBase = NULL;
    4355                     int vrc = ptrVM.vtable()->pfnPDMR3QueryDeviceLun(ptrVM.rawUVM(), pszAdapterName, ulInstance, 0, &pBase);
     4357                    int vrc = VINF_SUCCESS;
     4358                    if (adapterType == NetworkAdapterType_UsbNet)
     4359                        vrc = ptrVM.vtable()->pfnPDMR3UsbQueryLun(ptrVM.rawUVM(), pszAdapterName, ulInstance, 0, &pBase);
     4360                    else
     4361                        vrc = ptrVM.vtable()->pfnPDMR3QueryDeviceLun(ptrVM.rawUVM(), pszAdapterName, ulInstance, 0, &pBase);
     4362                    if (RT_FAILURE(vrc))
    43564363                    if (RT_SUCCESS(vrc))
    43574364                    {
  • trunk/src/VBox/Main/src-client/ConsoleImplConfigArmV8.cpp

    r107168 r107267  
    919919        std::list<BootNic> llBootNics;
    920920        vrc = i_configNetworkCtrls(pMachine, pPlatformProperties, chipsetType, pBusMgr,
    921                                    pVMM, pUVM, pDevices, llBootNics);                            VRC();
     921                                   pVMM, pUVM, pDevices, pUsbDevices, llBootNics);               VRC();
    922922
    923923        /*
  • trunk/src/VBox/Main/src-client/ConsoleImplConfigCommon.cpp

    r106960 r107267  
    46464646int Console::i_configNetworkCtrls(ComPtr<IMachine> pMachine, ComPtr<IPlatformProperties> pPlatformProperties,
    46474647                                  ChipsetType_T enmChipset, BusAssignmentManager *pBusMgr, PCVMMR3VTABLE pVMM, PUVM pUVM,
    4648                                   PCFGMNODE pDevices, std::list<BootNic> &llBootNics)
     4648                                  PCFGMNODE pDevices, PCFGMNODE pUsbDevices, std::list<BootNic> &llBootNics)
    46494649{
    46504650/* Comment out the following line to remove VMWare compatibility hack. */
     
    46764676    PCFGMNODE pDev3C501 = NULL;          /* EtherLink-type devices */
    46774677    InsertConfigNode(pDevices, "3c501",  &pDev3C501);
     4678    PCFGMNODE pUsbNet = NULL;            /* USB NCM Ethernet devices */
    46784679
    46794680    for (ULONG uInstance = 0; uInstance < maxNetworkAdapters; ++uInstance)
     
    47234724                pDev = pDev3C501;
    47244725                break;
     4726            case NetworkAdapterType_UsbNet:
     4727                if (!pUsbNet)
     4728                    InsertConfigNode(pUsbDevices, "UsbNet",  &pUsbNet);
     4729                pDev = pUsbNet;
     4730                pszAdapterName = "UsbNet";
     4731                break;
    47254732            default:
    47264733                AssertMsgFailed(("Invalid network adapter type '%d' for slot '%d'", adapterType, uInstance));
     
    47304737
    47314738        InsertConfigNode(pDev, Utf8StrFmt("%u", uInstance).c_str(), &pInst);
     4739        /* USB Ethernet is not attached to PCI bus, skip irrelevant bits. */
     4740        if (adapterType != NetworkAdapterType_UsbNet)
     4741        {
    47324742        InsertConfigInteger(pInst, "Trusted",              1); /* boolean */
    47334743
     
    48344844            case NetworkAdapterType_ELNK1:
    48354845                break;
     4846            case NetworkAdapterType_UsbNet:    /* fall through */
    48364847            case NetworkAdapterType_Null:      AssertFailedBreak(); /* (compiler warnings) */
    48374848#ifdef VBOX_WITH_XPCOM_CPP_ENUM_HACK
     
    48394850#endif
    48404851        }
     4852        }
     4853        else
     4854            InsertConfigNode(pInst, "Config", &pCfg);
    48414855
    48424856        /*
     
    48844898        InsertConfigInteger(pCfg, "CableConnected", fCableConnected ? 1 : 0);
    48854899
     4900        /* No line speed for USB Ethernet. */
     4901        if (adapterType != NetworkAdapterType_UsbNet)
     4902        {
    48864903        /*
    48874904         * Line speed to report from custom drivers
     
    48904907        hrc = networkAdapter->COMGETTER(LineSpeed)(&ulLineSpeed);                       H();
    48914908        InsertConfigInteger(pCfg, "LineSpeed", ulLineSpeed);
     4909        }
    48924910
    48934911        /*
  • trunk/src/VBox/Main/src-client/ConsoleImplConfigX86.cpp

    r107139 r107267  
    16941694        std::list<BootNic> llBootNics;
    16951695        vrc = i_configNetworkCtrls(pMachine, platformProperties, chipsetType, pBusMgr,
    1696                                    pVMM, pUVM, pDevices, llBootNics);                        VRC();
     1696                                   pVMM, pUVM, pDevices, pUsbDevices, llBootNics);           VRC();
    16971697
    16981698        /*
  • trunk/src/VBox/Main/src-server/NetworkAdapterImpl.cpp

    r106061 r107267  
    268268        case NetworkAdapterType_ELNK2:
    269269        case NetworkAdapterType_ELNK1:
     270        case NetworkAdapterType_UsbNet:
    270271            break;
    271272        default:
  • trunk/src/VBox/Main/xml/Settings.cpp

    r106384 r107267  
    46914691            else if (strTemp == "3C501")
    46924692                nic.type = NetworkAdapterType_ELNK1;
     4693            else if (strTemp == "usbnet")
     4694                nic.type = NetworkAdapterType_UsbNet;
    46934695            else
    46944696                throw ConfigFileError(this, pelmAdapter, N_("Invalid value '%s' in Adapter/@type attribute"), strTemp.c_str());
     
    81068108                        case NetworkAdapterType_ELNK2:      pcszType = "3C503"; break;
    81078109                        case NetworkAdapterType_ELNK1:      pcszType = "3C501"; break;
     8110                        case NetworkAdapterType_UsbNet:     pcszType = "usbnet"; break;
    81088111                        default: /*case NetworkAdapterType_Am79C970A:*/  pcszType = "Am79C970A"; break;
    81098112                    }
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