VirtualBox

Changeset 107267 in vbox


Ignore:
Timestamp:
Dec 10, 2024 7:37:35 AM (7 weeks ago)
Author:
vboxsync
Message:

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

Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/manual/en_US/dita/topics/nichardware.dita

    r105941 r107267  
    33<topic xml:lang="en-us" id="nichardware">
    44  <title>Virtual Networking Hardware</title>
    5  
     5
    66  <body>
    77    <p>For each card, you can individually select what kind of <i>hardware</i> will be presented to the virtual machine.
     
    2525      <li>
    2626        <p>Paravirtualized network adapter (virtio-net) </p>
     27      </li>
     28      <li>
     29        <p>Ethernet over USB network adapter (usbnet) </p>
    2730      </li>
    2831    </ul>
     
    6164      be explicitly enabled. </p>
    6265  </body>
    63  
     66
    6467</topic>
  • trunk/doc/manual/en_US/man_VBoxManage-modifyvm.xml

    r106061 r107267  
    311311          <arg choice="plain">82545EM</arg>
    312312          <arg choice="plain">virtio</arg>
     313          <arg choice="plain">usbnet</arg>
    313314        </group></arg>
    314315      <arg>--cable-connected<replaceable>N</replaceable>=<group choice="plain">
     
    14671468        </varlistentry>
    14681469        <varlistentry>
    1469           <term><option>--nic-type<replaceable>N</replaceable>=Am79C970A | Am79C973 | 82540EM | 82543GC | 82545EM | virtio</option></term>
     1470          <term><option>--nic-type<replaceable>N</replaceable>=Am79C970A | Am79C973 | 82540EM | 82543GC | 82545EM | virtio | usbnet</option></term>
    14701471          <listitem><para>
    14711472              Identifies the type of networking hardware that
     
    14981499                  <literal>virtio</literal> represents a paravirtualized
    14991500                  network adapter.
     1501                </para></listitem>
     1502              <listitem><para>
     1503                  <literal>usbnet</literal> represents an Ethernet over
     1504                  USB network adapter.
    15001505                </para></listitem>
    15011506            </itemizedlist></listitem>
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp

    r106209 r107267  
    19521952                    case NetworkAdapterType_ELNK2:      pszNICType = "3C503";       break;
    19531953                    case NetworkAdapterType_ELNK1:      pszNICType = "3C501";       break;
     1954                    case NetworkAdapterType_UsbNet:     pszNICType = "usbnet";      break;
    19541955                    default:
    19551956                        AssertFailed();
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp

    r106384 r107267  
    17401740                    CHECK_ERROR(nic, COMSETTER(AdapterType)(NetworkAdapterType_ELNK1));
    17411741                }
     1742                else if (!RTStrICmp(ValueUnion.psz, "usbnet"))
     1743                {
     1744                    CHECK_ERROR(nic, COMSETTER(AdapterType)(NetworkAdapterType_UsbNet));
     1745                }
    17421746                else
    17431747                {
  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendCOM.cpp

    r106061 r107267  
    432432        case KNetworkAdapterType_ELNK2:      return QApplication::translate("UICommon", "3Com EtherLink II (3C503)", "NetworkAdapterType");
    433433        case KNetworkAdapterType_ELNK1:      return QApplication::translate("UICommon", "3Com EtherLink (3C501)", "NetworkAdapterType");
     434        case KNetworkAdapterType_UsbNet:     return QApplication::translate("UICommon", "Ethernet over USB (usbnet)", "NetworkAdapterType");
    434435        default: AssertMsgFailed(("No text for %d", type)); break;
    435436    }
  • 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