VirtualBox

Changeset 107242 in vbox


Ignore:
Timestamp:
Dec 6, 2024 2:11:11 PM (6 weeks ago)
Author:
vboxsync
Message:

UsbNet: bugref:10779 Simply renamed UsbEth to UsbNet (part 1)

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/log.h

    r107113 r107242  
    808808    LOG_GROUP_USB_DRV,
    809809    /** USB Ethernet device group. */
    810     LOG_GROUP_USB_ETH,
     810    LOG_GROUP_USB_NET,
    811811    /** USBFilter group. */
    812812    LOG_GROUP_USB_FILTER,
  • trunk/src/VBox/Devices/Network/UsbEth.cpp

    r106348 r107242  
    11/* $Id$ */
    22/** @file
    3  * UsbMSD - USB Mass Storage Device Emulation.
     3 * UsbNet - USB NCM Ethernet Device Emulation.
    44 */
    55
     
    3030*   Header Files                                                                                                                 *
    3131*********************************************************************************************************************************/
    32 #define LOG_GROUP   LOG_GROUP_USB_ETH
     32#define LOG_GROUP   LOG_GROUP_USB_NET
    3333#include <VBox/vmm/pdmusb.h>
    3434#include <VBox/vmm/pdmnetifs.h>
     
    5151/** @name USB Ethernet string IDs
    5252 * @{ */
    53 #define USBETH_STR_ID_MANUFACTURER  1
    54 #define USBETH_STR_ID_PRODUCT       2
    55 #define USBETH_STR_ID_MAC_ADDRESS   3
     53#define USBNET_STR_ID_MANUFACTURER  1
     54#define USBNET_STR_ID_PRODUCT       2
     55#define USBNET_STR_ID_MAC_ADDRESS   3
    5656/** @} */
    5757
    58 /** @name USB MSD vendor and product IDs
     58/** @name USB Ethernet vendor and product IDs
    5959 * @{ */
    6060#define VBOX_USB_VENDOR             0x80EE
    61 #define USBETH_PID                  0x0040
     61#define USBNET_PID                  0x0040
    6262/** @} */
    6363
     
    315315 * Endpoint status data.
    316316 */
    317 typedef struct USBETHEP
     317typedef struct USBNETEP
    318318{
    319319    bool                fHalted;
    320 } USBETHEP;
     320} USBNETEP;
    321321/** Pointer to the endpoint status. */
    322 typedef USBETHEP *PUSBETHEP;
     322typedef USBNETEP *PUSBNETEP;
    323323
    324324
     
    326326 * A URB queue.
    327327 */
    328 typedef struct USBETHURBQUEUE
     328typedef struct USBNETURBQUEUE
    329329{
    330330    /** The head pointer. */
     
    332332    /** Where to insert the next entry. */
    333333    PVUSBURB           *ppTail;
    334 } USBETHURBQUEUE;
     334} USBNETURBQUEUE;
    335335/** Pointer to a URB queue. */
    336 typedef USBETHURBQUEUE *PUSBETHURBQUEUE;
     336typedef USBNETURBQUEUE *PUSBNETURBQUEUE;
    337337/** Pointer to a const URB queue. */
    338 typedef USBETHURBQUEUE const *PCUSBETHURBQUEUE;
     338typedef USBNETURBQUEUE const *PCUSBNETURBQUEUE;
    339339
    340340
     
    342342 * The USB Ethernet instance data.
    343343 */
    344 typedef struct USBETH
     344typedef struct USBNET
    345345{
    346346    /** Pointer back to the PDM USB Device instance structure. */
     
    359359    /** Endpoint 0 is the default control pipe, 1 is the host->dev bulk pipe and 2
    360360     * is the dev->host one, and 3 is the interrupt dev -> host one. */
    361     USBETHEP                            aEps[4];
     361    USBNETEP                            aEps[4];
    362362
    363363    /** The "hardware" MAC address. */
     
    385385     * data or status to become available.
    386386     */
    387     USBETHURBQUEUE                      ToHostQueue;
     387    USBNETURBQUEUE                      ToHostQueue;
    388388    /** Pending to-host interrupt queue.
    389389     * The URBs waiting here are pending the completion of the current request and
    390390     * data or status to become available.
    391391     */
    392     USBETHURBQUEUE                      ToHostIntrQueue;
     392    USBNETURBQUEUE                      ToHostIntrQueue;
    393393    /** Done queue
    394394     * The URBs stashed here are waiting to be reaped. */
    395     USBETHURBQUEUE                      DoneQueue;
     395    USBNETURBQUEUE                      DoneQueue;
    396396    /** Signalled when adding an URB to the done queue and fHaveDoneQueueWaiter
    397397     *  is set. */
     
    407407    /** Whether to signal the reset semaphore when the current request completes. */
    408408    bool                                fSignalResetSem;
    409     /** Semaphore usbMsdUsbReset waits on when a request is executing at reset
     409    /** Semaphore usbNetUsbReset waits on when a request is executing at reset
    410410     *  time.  Only signalled when fSignalResetSem is set. */
    411411    RTSEMEVENTMULTI                     hEvtReset;
     
    432432    } Lun0;
    433433
    434 } USBETH;
     434} USBNET;
    435435/** Pointer to the USB Ethernet instance data. */
    436 typedef USBETH *PUSBETH;
     436typedef USBNET *PUSBNET;
    437437
    438438
     
    440440*   Global Variables                                                                                                             *
    441441*********************************************************************************************************************************/
    442 static const USBNCMFUNCDESC g_UsbEthFuncDesc =
     442static const USBNCMFUNCDESC g_UsbNetFuncDesc =
    443443{
    444444    {
     
    453453    {
    454454        { 13, USB_CDC_DESCRIPTOR_TYPE_INTERFACE, USB_CDC_DESCRIPTOR_SUB_TYPE_ETHERNET_NETWORKING },
    455         USBETH_STR_ID_MAC_ADDRESS,
     455        USBNET_STR_ID_MAC_ADDRESS,
    456456        0,
    457457        1514,
     
    467467
    468468
    469 static const VUSBDESCIAD g_UsbEthInterfaceIad =
     469static const VUSBDESCIAD g_UsbNetInterfaceIad =
    470470{
    471471    sizeof(VUSBDESCIAD), // bLength;
     
    480480
    481481
    482 static const VUSBDESCENDPOINTEX g_aUsbEthEndpointDescsAlt1FS[3] =
     482static const VUSBDESCENDPOINTEX g_aUsbNetEndpointDescsAlt1FS[3] =
    483483{
    484484    {
     
    527527};
    528528
    529 static const VUSBDESCENDPOINTEX g_aUsbEthEndpointDescsAlt1HS[3] =
     529static const VUSBDESCENDPOINTEX g_aUsbNetEndpointDescsAlt1HS[3] =
    530530{
    531531    {
     
    574574};
    575575
    576 static const VUSBDESCSSEPCOMPANION g_aUsbEthEpCompanionSS =
     576static const VUSBDESCSSEPCOMPANION g_aUsbNetEpCompanionSS =
    577577{
    578578    /* .bLength = */            sizeof(VUSBDESCSSEPCOMPANION),
     
    583583};
    584584
    585 static const VUSBDESCENDPOINTEX g_aUsbEthEndpointDescsAlt1SS[3] =
     585static const VUSBDESCENDPOINTEX g_aUsbNetEndpointDescsAlt1SS[3] =
    586586{
    587587    {
     
    597597        /* .pvClass = */    NULL,
    598598        /* .cbClass = */    0,
    599         /* .pvSsepc = */    &g_aUsbEthEpCompanionSS,
    600         /* .cbSsepc = */    sizeof(g_aUsbEthEpCompanionSS)
     599        /* .pvSsepc = */    &g_aUsbNetEpCompanionSS,
     600        /* .cbSsepc = */    sizeof(g_aUsbNetEpCompanionSS)
    601601    },
    602602    {
     
    612612        /* .pvClass = */    NULL,
    613613        /* .cbClass = */    0,
    614         /* .pvSsepc = */    &g_aUsbEthEpCompanionSS,
    615         /* .cbSsepc = */    sizeof(g_aUsbEthEpCompanionSS)
     614        /* .pvSsepc = */    &g_aUsbNetEpCompanionSS,
     615        /* .cbSsepc = */    sizeof(g_aUsbNetEpCompanionSS)
    616616    },
    617617    {
     
    627627        /* .pvClass = */    NULL,
    628628        /* .cbClass = */    0,
    629         /* .pvSsepc = */    &g_aUsbEthEpCompanionSS,
    630         /* .cbSsepc = */    sizeof(g_aUsbEthEpCompanionSS)
     629        /* .pvSsepc = */    &g_aUsbNetEpCompanionSS,
     630        /* .cbSsepc = */    sizeof(g_aUsbNetEpCompanionSS)
    631631    },
    632632};
    633633
    634634
    635 static const VUSBDESCINTERFACEEX g_aUsbEthInterfaceDescFS_0[] =
     635static const VUSBDESCINTERFACEEX g_aUsbNetInterfaceDescFS_0[] =
    636636{
    637637    {
     
    648648        },
    649649        /* .pvMore = */      NULL,
    650         /* .pvClass = */     &g_UsbEthFuncDesc,
    651         /* .cbClass = */     sizeof(g_UsbEthFuncDesc),
    652         /* .paEndpoints = */  &g_aUsbEthEndpointDescsAlt1FS[2],
    653         /* .pIAD = */        &g_UsbEthInterfaceIad,
    654         /* .cbIAD = */       sizeof(g_UsbEthInterfaceIad)
     650        /* .pvClass = */     &g_UsbNetFuncDesc,
     651        /* .cbClass = */     sizeof(g_UsbNetFuncDesc),
     652        /* .paEndpoints = */  &g_aUsbNetEndpointDescsAlt1FS[2],
     653        /* .pIAD = */        &g_UsbNetInterfaceIad,
     654        /* .cbIAD = */       sizeof(g_UsbNetInterfaceIad)
    655655    }
    656656};
    657657
    658 static const VUSBDESCINTERFACEEX g_aUsbEthInterfaceDescFS_1[] =
     658static const VUSBDESCINTERFACEEX g_aUsbNetInterfaceDescFS_1[] =
    659659{
    660660    {
     
    692692        /* .pvClass = */    NULL,
    693693        /* .cbClass = */    0,
    694         &g_aUsbEthEndpointDescsAlt1FS[0],
    695         /* .pIAD = */        NULL, //&g_UsbEthInterfaceIad,
    696         /* .cbIAD = */       0, //sizeof(g_UsbEthInterfaceIad)
     694        &g_aUsbNetEndpointDescsAlt1FS[0],
     695        /* .pIAD = */        NULL, //&g_UsbNetInterfaceIad,
     696        /* .cbIAD = */       0, //sizeof(g_UsbNetInterfaceIad)
    697697    }
    698698};
    699699
    700700
    701 static const VUSBDESCINTERFACEEX g_aUsbEthInterfaceDescHS_0[] =
     701static const VUSBDESCINTERFACEEX g_aUsbNetInterfaceDescHS_0[] =
    702702{
    703703    {
     
    714714        },
    715715        /* .pvMore = */      NULL,
    716         /* .pvClass = */     &g_UsbEthFuncDesc,
    717         /* .cbClass = */     sizeof(g_UsbEthFuncDesc),
    718         /* .paEndpoints = */  &g_aUsbEthEndpointDescsAlt1HS[2],
    719         /* .pIAD = */        &g_UsbEthInterfaceIad,
    720         /* .cbIAD = */       sizeof(g_UsbEthInterfaceIad)
     716        /* .pvClass = */     &g_UsbNetFuncDesc,
     717        /* .cbClass = */     sizeof(g_UsbNetFuncDesc),
     718        /* .paEndpoints = */  &g_aUsbNetEndpointDescsAlt1HS[2],
     719        /* .pIAD = */        &g_UsbNetInterfaceIad,
     720        /* .cbIAD = */       sizeof(g_UsbNetInterfaceIad)
    721721    }
    722722};
    723723
    724 static const VUSBDESCINTERFACEEX g_aUsbEthInterfaceDescHS_1[] =
     724static const VUSBDESCINTERFACEEX g_aUsbNetInterfaceDescHS_1[] =
    725725{
    726726    {
     
    758758        /* .pvClass = */    NULL,
    759759        /* .cbClass = */    0,
    760         &g_aUsbEthEndpointDescsAlt1HS[0],
    761         /* .pIAD = */        NULL, //&g_UsbEthInterfaceIad,
    762         /* .cbIAD = */       0, //sizeof(g_UsbEthInterfaceIad)
     760        &g_aUsbNetEndpointDescsAlt1HS[0],
     761        /* .pIAD = */        NULL, //&g_UsbNetInterfaceIad,
     762        /* .cbIAD = */       0, //sizeof(g_UsbNetInterfaceIad)
    763763    }
    764764};
    765765
    766766
    767 static const VUSBDESCINTERFACEEX g_aUsbEthInterfaceDescSS_0[] =
     767static const VUSBDESCINTERFACEEX g_aUsbNetInterfaceDescSS_0[] =
    768768{
    769769    {
     
    780780        },
    781781        /* .pvMore = */      NULL,
    782         /* .pvClass = */     &g_UsbEthFuncDesc,
    783         /* .cbClass = */     sizeof(g_UsbEthFuncDesc),
    784         /* .paEndpoints = */  &g_aUsbEthEndpointDescsAlt1SS[2],
    785         /* .pIAD = */        &g_UsbEthInterfaceIad,
    786         /* .cbIAD = */       sizeof(g_UsbEthInterfaceIad)
     782        /* .pvClass = */     &g_UsbNetFuncDesc,
     783        /* .cbClass = */     sizeof(g_UsbNetFuncDesc),
     784        /* .paEndpoints = */  &g_aUsbNetEndpointDescsAlt1SS[2],
     785        /* .pIAD = */        &g_UsbNetInterfaceIad,
     786        /* .cbIAD = */       sizeof(g_UsbNetInterfaceIad)
    787787    }
    788788};
    789789
    790 static const VUSBDESCINTERFACEEX g_aUsbEthInterfaceDescSS_1[] =
     790static const VUSBDESCINTERFACEEX g_aUsbNetInterfaceDescSS_1[] =
    791791{
    792792    {
     
    824824        /* .pvClass = */    NULL,
    825825        /* .cbClass = */    0,
    826         &g_aUsbEthEndpointDescsAlt1SS[0],
    827         /* .pIAD = */        NULL, //&g_UsbEthInterfaceIad,
    828         /* .cbIAD = */       0, //sizeof(g_UsbEthInterfaceIad)
     826        &g_aUsbNetEndpointDescsAlt1SS[0],
     827        /* .pIAD = */        NULL, //&g_UsbNetInterfaceIad,
     828        /* .cbIAD = */       0, //sizeof(g_UsbNetInterfaceIad)
    829829    }
    830830};
    831831
    832 static const VUSBINTERFACE g_aUsbEthInterfacesFS[] =
    833 {
    834     { g_aUsbEthInterfaceDescFS_0, /* .cSettings = */ RT_ELEMENTS(g_aUsbEthInterfaceDescFS_0) },
    835     { g_aUsbEthInterfaceDescFS_1, /* .cSettings = */ RT_ELEMENTS(g_aUsbEthInterfaceDescFS_1) },
     832static const VUSBINTERFACE g_aUsbNetInterfacesFS[] =
     833{
     834    { g_aUsbNetInterfaceDescFS_0, /* .cSettings = */ RT_ELEMENTS(g_aUsbNetInterfaceDescFS_0) },
     835    { g_aUsbNetInterfaceDescFS_1, /* .cSettings = */ RT_ELEMENTS(g_aUsbNetInterfaceDescFS_1) },
    836836};
    837837
    838 static const VUSBINTERFACE g_aUsbEthInterfacesHS[] =
    839 {
    840     { g_aUsbEthInterfaceDescHS_0, /* .cSettings = */ RT_ELEMENTS(g_aUsbEthInterfaceDescHS_0) },
    841     { g_aUsbEthInterfaceDescHS_1, /* .cSettings = */ RT_ELEMENTS(g_aUsbEthInterfaceDescHS_1) },
     838static const VUSBINTERFACE g_aUsbNetInterfacesHS[] =
     839{
     840    { g_aUsbNetInterfaceDescHS_0, /* .cSettings = */ RT_ELEMENTS(g_aUsbNetInterfaceDescHS_0) },
     841    { g_aUsbNetInterfaceDescHS_1, /* .cSettings = */ RT_ELEMENTS(g_aUsbNetInterfaceDescHS_1) },
    842842};
    843843
    844 static const VUSBINTERFACE g_aUsbEthInterfacesSS[] =
    845 {
    846     { g_aUsbEthInterfaceDescSS_0, /* .cSettings = */ RT_ELEMENTS(g_aUsbEthInterfaceDescSS_0) },
    847     { g_aUsbEthInterfaceDescSS_1, /* .cSettings = */ RT_ELEMENTS(g_aUsbEthInterfaceDescSS_1) },
     844static const VUSBINTERFACE g_aUsbNetInterfacesSS[] =
     845{
     846    { g_aUsbNetInterfaceDescSS_0, /* .cSettings = */ RT_ELEMENTS(g_aUsbNetInterfaceDescSS_0) },
     847    { g_aUsbNetInterfaceDescSS_1, /* .cSettings = */ RT_ELEMENTS(g_aUsbNetInterfaceDescSS_1) },
    848848};
    849849
    850 static const VUSBDESCCONFIGEX g_UsbEthConfigDescFS =
     850static const VUSBDESCCONFIGEX g_UsbNetConfigDescFS =
    851851{
    852852    {
     
    854854        /* .bDescriptorType = */    VUSB_DT_CONFIG,
    855855        /* .wTotalLength = */       0 /* recalculated on read */,
    856         /* .bNumInterfaces = */     RT_ELEMENTS(g_aUsbEthInterfacesFS),
     856        /* .bNumInterfaces = */     RT_ELEMENTS(g_aUsbNetInterfacesFS),
    857857        /* .bConfigurationValue =*/ 1,
    858858        /* .iConfiguration = */     0,
     
    863863    NULL,                           /* pvClass */
    864864    0,                              /* cbClass */
    865     &g_aUsbEthInterfacesFS[0],
     865    &g_aUsbNetInterfacesFS[0],
    866866    NULL                            /* pvOriginal */
    867867};
    868868
    869 static const VUSBDESCCONFIGEX g_UsbEthConfigDescHS =
     869static const VUSBDESCCONFIGEX g_UsbNetConfigDescHS =
    870870{
    871871    {
     
    873873        /* .bDescriptorType = */    VUSB_DT_CONFIG,
    874874        /* .wTotalLength = */       0 /* recalculated on read */,
    875         /* .bNumInterfaces = */     RT_ELEMENTS(g_aUsbEthInterfacesHS),
     875        /* .bNumInterfaces = */     RT_ELEMENTS(g_aUsbNetInterfacesHS),
    876876        /* .bConfigurationValue =*/ 1,
    877877        /* .iConfiguration = */     0,
     
    882882    NULL,                           /* pvClass */
    883883    0,                              /* cbClass */
    884     &g_aUsbEthInterfacesHS[0],
     884    &g_aUsbNetInterfacesHS[0],
    885885    NULL                            /* pvOriginal */
    886886};
    887887
    888 static const VUSBDESCCONFIGEX g_UsbEthConfigDescSS =
     888static const VUSBDESCCONFIGEX g_UsbNetConfigDescSS =
    889889{
    890890    {
     
    901901    NULL,                           /* pvClass */
    902902    0,                              /* cbClass */
    903     &g_aUsbEthInterfacesSS[0],
     903    &g_aUsbNetInterfacesSS[0],
    904904    NULL                            /* pvOriginal */
    905905};
    906906
    907 static const VUSBDESCDEVICE g_UsbEthDeviceDesc20 =
    908 {
    909     /* .bLength = */                sizeof(g_UsbEthDeviceDesc20),
     907static const VUSBDESCDEVICE g_UsbNetDeviceDesc20 =
     908{
     909    /* .bLength = */                sizeof(g_UsbNetDeviceDesc20),
    910910    /* .bDescriptorType = */        VUSB_DT_DEVICE,
    911911    /* .bcdUsb = */                 0x200, /* USB 2.0 */
     
    915915    /* .bMaxPacketSize0 = */        64,
    916916    /* .idVendor = */               VBOX_USB_VENDOR,
    917     /* .idProduct = */              USBETH_PID,
     917    /* .idProduct = */              USBNET_PID,
    918918    /* .bcdDevice = */              0x0100, /* 1.0 */
    919     /* .iManufacturer = */          USBETH_STR_ID_MANUFACTURER,
    920     /* .iProduct = */               USBETH_STR_ID_PRODUCT,
     919    /* .iManufacturer = */          USBNET_STR_ID_MANUFACTURER,
     920    /* .iProduct = */               USBNET_STR_ID_PRODUCT,
    921921    /* .iSerialNumber = */          0,
    922922    /* .bNumConfigurations = */     1
    923923};
    924924
    925 static const VUSBDESCDEVICE g_UsbEthDeviceDesc30 =
    926 {
    927     /* .bLength = */                sizeof(g_UsbEthDeviceDesc30),
     925static const VUSBDESCDEVICE g_UsbNetDeviceDesc30 =
     926{
     927    /* .bLength = */                sizeof(g_UsbNetDeviceDesc30),
    928928    /* .bDescriptorType = */        VUSB_DT_DEVICE,
    929929    /* .bcdUsb = */                 0x300, /* USB 2.0 */
     
    933933    /* .bMaxPacketSize0 = */        9 /* 512, the only option for USB3. */,
    934934    /* .idVendor = */               VBOX_USB_VENDOR,
    935     /* .idProduct = */              USBETH_PID,
     935    /* .idProduct = */              USBNET_PID,
    936936    /* .bcdDevice = */              0x0110, /* 1.10 */
    937     /* .iManufacturer = */          USBETH_STR_ID_MANUFACTURER,
    938     /* .iProduct = */               USBETH_STR_ID_PRODUCT,
     937    /* .iManufacturer = */          USBNET_STR_ID_MANUFACTURER,
     938    /* .iProduct = */               USBNET_STR_ID_PRODUCT,
    939939    /* .iSerialNumber = */          0,
    940940    /* .bNumConfigurations = */     1
    941941};
    942942
    943 static const VUSBDEVICEQUALIFIER g_UsbEthDeviceQualifier =
    944 {
    945     /* .bLength = */                sizeof(g_UsbEthDeviceQualifier),
     943static const VUSBDEVICEQUALIFIER g_UsbNetDeviceQualifier =
     944{
     945    /* .bLength = */                sizeof(g_UsbNetDeviceQualifier),
    946946    /* .bDescriptorType = */        VUSB_DT_DEVICE_QUALIFIER,
    947947    /* .bcdUsb = */                 0x200, /* USB 2.0 */
     
    957957    VUSBDESCBOS         bos;
    958958    VUSBDESCSSDEVCAP    sscap;
    959 } g_UsbEthBOS =
    960 {
    961     {
    962         /* .bLength = */                sizeof(g_UsbEthBOS.bos),
     959} g_UsbNetBOS =
     960{
     961    {
     962        /* .bLength = */                sizeof(g_UsbNetBOS.bos),
    963963        /* .bDescriptorType = */        VUSB_DT_BOS,
    964         /* .wTotalLength = */           sizeof(g_UsbEthBOS),
     964        /* .wTotalLength = */           sizeof(g_UsbNetBOS),
    965965        /* .bNumDeviceCaps = */         1
    966966    },
     
    981981*   Internal Functions                                                                                                           *
    982982*********************************************************************************************************************************/
    983 static int  usbEthHandleBulkDevToHost(PUSBETH pThis, PUSBETHEP pEp, PVUSBURB pUrb);
     983static int  usbNetHandleBulkDevToHost(PUSBNET pThis, PUSBNETEP pEp, PVUSBURB pUrb);
    984984
    985985
     
    989989 * @param   pQueue              The URB queue.
    990990 */
    991 static void usbEthQueueInit(PUSBETHURBQUEUE pQueue)
     991static void usbNetQueueInit(PUSBNETURBQUEUE pQueue)
    992992{
    993993    pQueue->pHead = NULL;
     
    10031003 * @param   pUrb                The URB to insert.
    10041004 */
    1005 DECLINLINE(void) usbEthQueueAddTail(PUSBETHURBQUEUE pQueue, PVUSBURB pUrb)
     1005DECLINLINE(void) usbNetQueueAddTail(PUSBNETURBQUEUE pQueue, PVUSBURB pUrb)
    10061006{
    10071007    pUrb->Dev.pNext = NULL;
     
    10171017 * @param   pQueue              The URB queue.
    10181018 */
    1019 DECLINLINE(PVUSBURB) usbEthQueueRemoveHead(PUSBETHURBQUEUE pQueue)
     1019DECLINLINE(PVUSBURB) usbNetQueueRemoveHead(PUSBNETURBQUEUE pQueue)
    10201020{
    10211021    PVUSBURB pUrb = pQueue->pHead;
     
    10401040 * @param   pUrb                The URB to remove.
    10411041 */
    1042 DECLINLINE(bool) usbEthQueueRemove(PUSBETHURBQUEUE pQueue, PVUSBURB pUrb)
     1042DECLINLINE(bool) usbNetQueueRemove(PUSBNETURBQUEUE pQueue, PVUSBURB pUrb)
    10431043{
    10441044    PVUSBURB pCur = pQueue->pHead;
     
    10711071 * @param   pQueue              The URB queue.
    10721072 */
    1073 DECLINLINE(bool) usbEthQueueIsEmpty(PCUSBETHURBQUEUE pQueue)
     1073DECLINLINE(bool) usbNetQueueIsEmpty(PCUSBNETURBQUEUE pQueue)
    10741074{
    10751075    return pQueue->pHead == NULL;
     
    10801080 * Links an URB into the done queue.
    10811081 *
    1082  * @param   pThis               The ETH instance.
     1082 * @param   pThis               The USBNET instance.
    10831083 * @param   pUrb                The URB.
    10841084 */
    1085 static void usbEthLinkDone(PUSBETH pThis, PVUSBURB pUrb)
    1086 {
    1087     usbEthQueueAddTail(&pThis->DoneQueue, pUrb);
     1085static void usbNetLinkDone(PUSBNET pThis, PVUSBURB pUrb)
     1086{
     1087    usbNetQueueAddTail(&pThis->DoneQueue, pUrb);
    10881088
    10891089    if (pThis->fHaveDoneQueueWaiter)
     
    10981098 * Completes the URB with a stalled state, halting the pipe.
    10991099 */
    1100 static int usbEthCompleteStall(PUSBETH pThis, PUSBETHEP pEp, PVUSBURB pUrb, const char *pszWhy)
     1100static int usbNetCompleteStall(PUSBNET pThis, PUSBNETEP pEp, PVUSBURB pUrb, const char *pszWhy)
    11011101{
    11021102    RT_NOREF(pszWhy);
    1103     Log(("usbEthCompleteStall/#%u: pUrb=%p:%s: %s\n", pThis->pUsbIns->iInstance, pUrb, pUrb->pszDesc, pszWhy));
     1103    Log(("usbNetCompleteStall/#%u: pUrb=%p:%s: %s\n", pThis->pUsbIns->iInstance, pUrb, pUrb->pszDesc, pszWhy));
    11041104
    11051105    pUrb->enmStatus = VUSBSTATUS_STALL;
     
    11151115    }
    11161116
    1117     usbEthLinkDone(pThis, pUrb);
     1117    usbNetLinkDone(pThis, pUrb);
    11181118    return VINF_SUCCESS;
    11191119}
     
    11231123 * Completes the URB with a OK state.
    11241124 */
    1125 static int usbEthCompleteOk(PUSBETH pThis, PVUSBURB pUrb, size_t cbData)
    1126 {
    1127     Log(("usbEthCompleteOk/#%u: pUrb=%p:%s cbData=%#zx\n", pThis->pUsbIns->iInstance, pUrb, pUrb->pszDesc, cbData));
     1125static int usbNetCompleteOk(PUSBNET pThis, PVUSBURB pUrb, size_t cbData)
     1126{
     1127    Log(("usbNetCompleteOk/#%u: pUrb=%p:%s cbData=%#zx\n", pThis->pUsbIns->iInstance, pUrb, pUrb->pszDesc, cbData));
    11281128
    11291129    pUrb->enmStatus = VUSBSTATUS_OK;
    11301130    pUrb->cbData    = (uint32_t)cbData;
    11311131
    1132     usbEthLinkDone(pThis, pUrb);
     1132    usbNetLinkDone(pThis, pUrb);
    11331133    return VINF_SUCCESS;
    11341134}
     
    11391139 * into the URB. May still generate an error if the URB is not big enough.
    11401140 */
    1141 static void usbEthCompleteNotificationOk(PUSBETH pThis, PVUSBURB pUrb, const void *pSrc, size_t cbSrc)
    1142 {
    1143     Log(("usbEthCompleteNotificationOk/#%u: pUrb=%p:%s (cbData=%#x) cbSrc=%#zx\n", pThis->pUsbIns->iInstance, pUrb, pUrb->pszDesc, pUrb->cbData, cbSrc));
     1141static void usbNetCompleteNotificationOk(PUSBNET pThis, PVUSBURB pUrb, const void *pSrc, size_t cbSrc)
     1142{
     1143    Log(("usbNetCompleteNotificationOk/#%u: pUrb=%p:%s (cbData=%#x) cbSrc=%#zx\n", pThis->pUsbIns->iInstance, pUrb, pUrb->pszDesc, pUrb->cbData, cbSrc));
    11441144
    11451145    pUrb->enmStatus = VUSBSTATUS_OK;
     
    11701170        Assert(cbSrc == 0); /* Make up your mind, caller! */
    11711171
    1172     usbEthLinkDone(pThis, pUrb);
    1173 }
    1174 
    1175 
    1176 /**
    1177  * Reset worker for usbMsdUsbReset, usbMsdUsbSetConfiguration and
    1178  * usbMsdUrbHandleDefaultPipe.
     1172    usbNetLinkDone(pThis, pUrb);
     1173}
     1174
     1175
     1176/**
     1177 * Reset worker for usbNetUsbReset, usbNetUsbSetConfiguration and
     1178 * usbNetUrbHandleDefaultPipe.
    11791179 *
    11801180 * @returns VBox status code.
    11811181 * @param   pThis               The MSD instance.
    1182  * @param   pUrb                Set when usbMsdUrbHandleDefaultPipe is the
     1182 * @param   pUrb                Set when usbNetUrbHandleDefaultPipe is the
    11831183 *                              caller.
    1184  * @param   fSetConfig          Set when usbMsdUsbSetConfiguration is the
     1184 * @param   fSetConfig          Set when usbNetUsbSetConfiguration is the
    11851185 *                              caller.
    11861186 */
    1187 static int usbEthResetWorker(PUSBETH pThis, PVUSBURB pUrb, bool fSetConfig)
     1187static int usbNetResetWorker(PUSBNET pThis, PVUSBURB pUrb, bool fSetConfig)
    11881188{
    11891189    for (unsigned i = 0; i < RT_ELEMENTS(pThis->aEps); i++)
     
    11991199     */
    12001200    PVUSBURB pCurUrb;
    1201     while ((pCurUrb = usbEthQueueRemoveHead(&pThis->ToHostQueue)) != NULL)
     1201    while ((pCurUrb = usbNetQueueRemoveHead(&pThis->ToHostQueue)) != NULL)
    12021202    {
    12031203        pCurUrb->enmStatus = VUSBSTATUS_CRC;
    1204         usbEthLinkDone(pThis, pCurUrb);
    1205     }
    1206 
    1207     while ((pCurUrb = usbEthQueueRemoveHead(&pThis->ToHostIntrQueue)) != NULL)
     1204        usbNetLinkDone(pThis, pCurUrb);
     1205    }
     1206
     1207    while ((pCurUrb = usbNetQueueRemoveHead(&pThis->ToHostIntrQueue)) != NULL)
    12081208    {
    12091209        pCurUrb->enmStatus = VUSBSTATUS_CRC;
    1210         usbEthLinkDone(pThis, pCurUrb);
     1210        usbNetLinkDone(pThis, pCurUrb);
    12111211    }
    12121212
     
    12161216        pThis->pResetUrb = NULL;
    12171217        pCurUrb->enmStatus  = VUSBSTATUS_CRC;
    1218         usbEthLinkDone(pThis, pCurUrb);
     1218        usbNetLinkDone(pThis, pCurUrb);
    12191219    }
    12201220
    12211221    if (pUrb)
    1222         return usbEthCompleteOk(pThis, pUrb, 0);
     1222        return usbNetCompleteOk(pThis, pUrb, 0);
    12231223    return VINF_SUCCESS;
    12241224}
     
    12281228 * @interface_method_impl{PDMIBASE,pfnQueryInterface}
    12291229 */
    1230 static DECLCALLBACK(void *) usbEthLun0QueryInterface(PPDMIBASE pInterface, const char *pszIID)
    1231 {
    1232     PUSBETH pThis = RT_FROM_MEMBER(pInterface, USBETH, Lun0.IBase);
     1230static DECLCALLBACK(void *) usbNetLun0QueryInterface(PPDMIBASE pInterface, const char *pszIID)
     1231{
     1232    PUSBNET pThis = RT_FROM_MEMBER(pInterface, USBNET, Lun0.IBase);
    12331233    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pThis->Lun0.IBase);
    12341234    PDMIBASE_RETURN_INTERFACE(pszIID, PDMINETWORKCONFIG, &pThis->Lun0.INetworkConfig);
     
    12381238
    12391239
    1240 static DECLCALLBACK(int) usbEthNetworkDown_WaitReceiveAvail(PPDMINETWORKDOWN pInterface, RTMSINTERVAL cMillies)
    1241 {
    1242     PUSBETH pThis = RT_FROM_MEMBER(pInterface, USBETH, Lun0.INetworkDown);
     1240static DECLCALLBACK(int) usbNetNetworkDown_WaitReceiveAvail(PPDMINETWORKDOWN pInterface, RTMSINTERVAL cMillies)
     1241{
     1242    PUSBNET pThis = RT_FROM_MEMBER(pInterface, USBNET, Lun0.INetworkDown);
    12431243
    12441244    RTCritSectEnter(&pThis->CritSect);
    1245     if (!usbEthQueueIsEmpty(&pThis->ToHostQueue))
     1245    if (!usbNetQueueIsEmpty(&pThis->ToHostQueue))
    12461246    {
    12471247        RTCritSectLeave(&pThis->CritSect);
     
    12651265 * @param   cb          Frame size.
    12661266 */
    1267 static DECLCALLBACK(int) usbEthNetworkDown_Receive(PPDMINETWORKDOWN pInterface, const void *pvBuf, size_t cb)
    1268 {
    1269     PUSBETH pThis = RT_FROM_MEMBER(pInterface, USBETH, Lun0.INetworkDown);
     1267static DECLCALLBACK(int) usbNetNetworkDown_Receive(PPDMINETWORKDOWN pInterface, const void *pvBuf, size_t cb)
     1268{
     1269    PUSBNET pThis = RT_FROM_MEMBER(pInterface, USBNET, Lun0.INetworkDown);
    12701270
    12711271    RTCritSectEnter(&pThis->CritSect);
    12721272
    1273     if (usbEthQueueIsEmpty(&pThis->ToHostQueue))
     1273    if (usbNetQueueIsEmpty(&pThis->ToHostQueue))
    12741274    {
    12751275        RTCritSectLeave(&pThis->CritSect);
     
    12771277    }
    12781278
    1279     PVUSBURB pUrb = usbEthQueueRemoveHead(&pThis->ToHostQueue);
    1280     PUSBETHEP pEp = &pThis->aEps[2];
     1279    PVUSBURB pUrb = usbNetQueueRemoveHead(&pThis->ToHostQueue);
     1280    PUSBNETEP pEp = &pThis->aEps[2];
    12811281
    12821282    if (RT_UNLIKELY(pEp->fHalted))
    12831283    {
    1284         usbEthCompleteStall(pThis, NULL, pUrb, "Halted pipe");
     1284        usbNetCompleteStall(pThis, NULL, pUrb, "Halted pipe");
    12851285        RTCritSectLeave(&pThis->CritSect);
    12861286        return VINF_SUCCESS;
     
    12891289    if (pUrb->cbData < sizeof(USBNCMNTH16) + sizeof(USBNCMNDP16) + cb)
    12901290    {
    1291         Log(("UsbEth: Receive URB too small (%#x vs %#x)\n", pUrb->cbData, sizeof(USBNCMNTH16) + sizeof(USBNCMNDP16) + cb));
     1291        Log(("UsbNet: Receive URB too small (%#x vs %#x)\n", pUrb->cbData, sizeof(USBNCMNTH16) + sizeof(USBNCMNDP16) + cb));
    12921292        pUrb->enmStatus = VUSBSTATUS_DATA_OVERRUN;
    1293         usbEthLinkDone(pThis, pUrb);
     1293        usbNetLinkDone(pThis, pUrb);
    12941294        RTCritSectLeave(&pThis->CritSect);
    12951295        return VINF_SUCCESS;
     
    13191319
    13201320    pUrb->cbData = (uint32_t)(sizeof(*pNth16) + sizeof(*pNdp16) + cb);
    1321     usbEthLinkDone(pThis, pUrb);
     1321    usbNetLinkDone(pThis, pUrb);
    13221322    RTCritSectLeave(&pThis->CritSect);
    13231323
     
    13291329 * @interface_method_impl{PDMINETWORKDOWN,pfnXmitPending}
    13301330 */
    1331 static DECLCALLBACK(void) usbEthNetworkDown_XmitPending(PPDMINETWORKDOWN pInterface)
     1331static DECLCALLBACK(void) usbNetNetworkDown_XmitPending(PPDMINETWORKDOWN pInterface)
    13321332{
    13331333    RT_NOREF(pInterface);
     
    13351335
    13361336
    1337 /* -=-=-=-=-=- USBETH::INetworkConfig -=-=-=-=-=- */
     1337/* -=-=-=-=-=- USBNET::INetworkConfig -=-=-=-=-=- */
    13381338
    13391339/**
    13401340 * @interface_method_impl{PDMINETWORKCONFIG,pfnGetMac}
    13411341 */
    1342 static DECLCALLBACK(int) usbEthGetMac(PPDMINETWORKCONFIG pInterface, PRTMAC pMac)
    1343 {
    1344     PUSBETH pThis = RT_FROM_MEMBER(pInterface, USBETH, Lun0.INetworkConfig);
     1342static DECLCALLBACK(int) usbNetGetMac(PPDMINETWORKCONFIG pInterface, PRTMAC pMac)
     1343{
     1344    PUSBNET pThis = RT_FROM_MEMBER(pInterface, USBNET, Lun0.INetworkConfig);
    13451345
    13461346    LogFlowFunc(("#%d\n", pThis->pUsbIns->iInstance));
     
    13531353 * @interface_method_impl{PDMINETWORKCONFIG,pfnGetLinkState}
    13541354 */
    1355 static DECLCALLBACK(PDMNETWORKLINKSTATE) usbEthGetLinkState(PPDMINETWORKCONFIG pInterface)
    1356 {
    1357     PUSBETH pThis = RT_FROM_MEMBER(pInterface, USBETH, Lun0.INetworkConfig);
     1355static DECLCALLBACK(PDMNETWORKLINKSTATE) usbNetGetLinkState(PPDMINETWORKCONFIG pInterface)
     1356{
     1357    PUSBNET pThis = RT_FROM_MEMBER(pInterface, USBNET, Lun0.INetworkConfig);
    13581358
    13591359    if (pThis->fLinkUp && !pThis->fLinkTempDown)
     
    13711371 * @interface_method_impl{PDMINETWORKCONFIG,pfnSetLinkState}
    13721372 */
    1373 static DECLCALLBACK(int) usbEthSetLinkState(PPDMINETWORKCONFIG pInterface, PDMNETWORKLINKSTATE enmState)
    1374 {
    1375     PUSBETH pThis = RT_FROM_MEMBER(pInterface, USBETH, Lun0.INetworkConfig);
     1373static DECLCALLBACK(int) usbNetSetLinkState(PPDMINETWORKCONFIG pInterface, PDMNETWORKLINKSTATE enmState)
     1374{
     1375    PUSBNET pThis = RT_FROM_MEMBER(pInterface, USBNET, Lun0.INetworkConfig);
    13761376
    13771377    //bool            fLinkUp;
     
    14281428 * @interface_method_impl{PDMUSBREG,pfnUrbReap}
    14291429 */
    1430 static DECLCALLBACK(PVUSBURB) usbEthUrbReap(PPDMUSBINS pUsbIns, RTMSINTERVAL cMillies)
    1431 {
    1432     PUSBETH pThis = PDMINS_2_DATA(pUsbIns, PUSBETH);
    1433     LogFlow(("usbEthUrbReap/#%u: cMillies=%u\n", pUsbIns->iInstance, cMillies));
     1430static DECLCALLBACK(PVUSBURB) usbNetUrbReap(PPDMUSBINS pUsbIns, RTMSINTERVAL cMillies)
     1431{
     1432    PUSBNET pThis = PDMINS_2_DATA(pUsbIns, PUSBNET);
     1433    LogFlow(("usbNetUrbReap/#%u: cMillies=%u\n", pUsbIns->iInstance, cMillies));
    14341434
    14351435    RTCritSectEnter(&pThis->CritSect);
    14361436
    1437     PVUSBURB pUrb = usbEthQueueRemoveHead(&pThis->DoneQueue);
     1437    PVUSBURB pUrb = usbNetQueueRemoveHead(&pThis->DoneQueue);
    14381438    if (!pUrb && cMillies)
    14391439    {
     
    14471447        pThis->fHaveDoneQueueWaiter = false;
    14481448
    1449         pUrb = usbEthQueueRemoveHead(&pThis->DoneQueue);
     1449        pUrb = usbNetQueueRemoveHead(&pThis->DoneQueue);
    14501450    }
    14511451
     
    14531453
    14541454    if (pUrb)
    1455         Log(("usbEthUrbReap/#%u: pUrb=%p:%s\n", pUsbIns->iInstance, pUrb, pUrb->pszDesc));
     1455        Log(("usbNetUrbReap/#%u: pUrb=%p:%s\n", pUsbIns->iInstance, pUrb, pUrb->pszDesc));
    14561456    return pUrb;
    14571457}
     
    14611461 * @interface_method_impl{PDMUSBREG,pfnWakeup}
    14621462 */
    1463 static DECLCALLBACK(int) usbEthWakeup(PPDMUSBINS pUsbIns)
    1464 {
    1465     PUSBETH pThis = PDMINS_2_DATA(pUsbIns, PUSBETH);
    1466     LogFlow(("usbMsdUrbReap/#%u:\n", pUsbIns->iInstance));
     1463static DECLCALLBACK(int) usbNetWakeup(PPDMUSBINS pUsbIns)
     1464{
     1465    PUSBNET pThis = PDMINS_2_DATA(pUsbIns, PUSBNET);
     1466    LogFlow(("usbNetUrbReap/#%u:\n", pUsbIns->iInstance));
    14671467
    14681468    return RTSemEventSignal(pThis->hEvtDoneQueue);
     
    14731473 * @interface_method_impl{PDMUSBREG,pfnUrbCancel}
    14741474 */
    1475 static DECLCALLBACK(int) usbEthUrbCancel(PPDMUSBINS pUsbIns, PVUSBURB pUrb)
    1476 {
    1477     PUSBETH pThis = PDMINS_2_DATA(pUsbIns, PUSBETH);
    1478     LogFlow(("usbMsdUrbCancel/#%u: pUrb=%p:%s\n", pUsbIns->iInstance, pUrb, pUrb->pszDesc));
     1475static DECLCALLBACK(int) usbNetUrbCancel(PPDMUSBINS pUsbIns, PVUSBURB pUrb)
     1476{
     1477    PUSBNET pThis = PDMINS_2_DATA(pUsbIns, PUSBNET);
     1478    LogFlow(("usbNetUrbCancel/#%u: pUrb=%p:%s\n", pUsbIns->iInstance, pUrb, pUrb->pszDesc));
    14791479    RTCritSectEnter(&pThis->CritSect);
    14801480
     
    14821482     * Remove the URB from the to-host queue and move it onto the done queue.
    14831483     */
    1484     if (usbEthQueueRemove(&pThis->ToHostQueue, pUrb))
    1485         usbEthLinkDone(pThis, pUrb);
    1486 
    1487     if (usbEthQueueRemove(&pThis->ToHostIntrQueue, pUrb))
    1488         usbEthLinkDone(pThis, pUrb);
     1484    if (usbNetQueueRemove(&pThis->ToHostQueue, pUrb))
     1485        usbNetLinkDone(pThis, pUrb);
     1486
     1487    if (usbNetQueueRemove(&pThis->ToHostIntrQueue, pUrb))
     1488        usbNetLinkDone(pThis, pUrb);
    14891489
    14901490    RTCritSectLeave(&pThis->CritSect);
     
    14961496 * Handle requests sent to the outbound (to device) bulk pipe.
    14971497 */
    1498 static int usbEthHandleBulkHostToDev(PUSBETH pThis, PUSBETHEP pEp, PVUSBURB pUrb)
     1498static int usbNetHandleBulkHostToDev(PUSBNET pThis, PUSBNETEP pEp, PVUSBURB pUrb)
    14991499{
    15001500    /*
     
    15021502     */
    15031503    if (RT_UNLIKELY(pEp->fHalted))
    1504         return usbEthCompleteStall(pThis, NULL, pUrb, "Halted pipe");
     1504        return usbNetCompleteStall(pThis, NULL, pUrb, "Halted pipe");
    15051505
    15061506    /*
     
    15101510    if (pUrb->cbData < sizeof(*pNth16))
    15111511    {
    1512         Log(("UsbEth: Bad NTH16: cbData=%#x < min=%#x\n", pUrb->cbData, sizeof(*pNth16) ));
    1513         return usbEthCompleteStall(pThis, NULL, pUrb, "BAD NTH16");
     1512        Log(("UsbNet: Bad NTH16: cbData=%#x < min=%#x\n", pUrb->cbData, sizeof(*pNth16) ));
     1513        return usbNetCompleteStall(pThis, NULL, pUrb, "BAD NTH16");
    15141514    }
    15151515    if (pNth16->dwSignature != USBNCMNTH16_SIGNATURE)
    15161516    {
    1517         Log(("UsbEth: NTH16: Invalid dwSignature value: %#x\n", pNth16->dwSignature));
    1518         return usbEthCompleteStall(pThis, NULL, pUrb, "Bad NTH16");
    1519     }
    1520     Log(("UsbEth: NTH16: wHeaderLength=%#x wSequence=%#x wBlockLength=%#x wNdpIndex=%#x cbData=%#x fShortNotOk=%RTbool\n",
     1517        Log(("UsbNet: NTH16: Invalid dwSignature value: %#x\n", pNth16->dwSignature));
     1518        return usbNetCompleteStall(pThis, NULL, pUrb, "Bad NTH16");
     1519    }
     1520    Log(("UsbNet: NTH16: wHeaderLength=%#x wSequence=%#x wBlockLength=%#x wNdpIndex=%#x cbData=%#x fShortNotOk=%RTbool\n",
    15211521         pNth16->wHeaderLength, pNth16->wSequence, pNth16->wBlockLength, pNth16->wNdpIndex, pUrb->cbData, pUrb->fShortNotOk));
    15221522    if (pNth16->wHeaderLength != sizeof(*pNth16))
    15231523    {
    1524         Log(("UsbEth: NTH16: Bad wHeaderLength value: %#x\n", pNth16->wHeaderLength));
    1525         return usbEthCompleteStall(pThis, NULL, pUrb, "Bad NTH16");
     1524        Log(("UsbNet: NTH16: Bad wHeaderLength value: %#x\n", pNth16->wHeaderLength));
     1525        return usbNetCompleteStall(pThis, NULL, pUrb, "Bad NTH16");
    15261526
    15271527    }
    15281528    if (pNth16->wBlockLength > pUrb->cbData)
    15291529    {
    1530         Log(("UsbEth: NTH16: Bad wBlockLength value: %#x\n", pNth16->wBlockLength));
    1531         return usbEthCompleteStall(pThis, NULL, pUrb, "Bad NTH16");
     1530        Log(("UsbNet: NTH16: Bad wBlockLength value: %#x\n", pNth16->wBlockLength));
     1531        return usbNetCompleteStall(pThis, NULL, pUrb, "Bad NTH16");
    15321532    }
    15331533
    15341534    if (pNth16->wNdpIndex < sizeof(*pNth16))
    15351535    {
    1536         Log(("UsbEth: NTH16: wNdpIndex is too small: %#x (%u), at least required %#x\n",
     1536        Log(("UsbNet: NTH16: wNdpIndex is too small: %#x (%u), at least required %#x\n",
    15371537             pNth16->wNdpIndex, pNth16->wNdpIndex, sizeof(*pNth16) ));
    1538         return usbEthCompleteStall(pThis, NULL, pUrb, "Bad NTH16");
     1538        return usbNetCompleteStall(pThis, NULL, pUrb, "Bad NTH16");
    15391539    }
    15401540
     
    15451545        if (offNdp16Next >= pUrb->cbData)
    15461546        {
    1547             Log(("UsbEth: Bad NDP16: offNdp16Next=%#x >= cbData=%#x\n", offNdp16Next, pUrb->cbData));
    1548             return usbEthCompleteStall(pThis, NULL, pUrb, "BAD NDP16");
     1547            Log(("UsbNet: Bad NDP16: offNdp16Next=%#x >= cbData=%#x\n", offNdp16Next, pUrb->cbData));
     1548            return usbNetCompleteStall(pThis, NULL, pUrb, "BAD NDP16");
    15491549        }
    15501550
     
    15531553        if (cbNdpMax < sizeof(*pNdp16))
    15541554        {
    1555             Log(("UsbEth: Bad NDP16: cbNdpMax=%#x < min=%#x\n", cbNdpMax, sizeof(*pNdp16) ));
    1556             return usbEthCompleteStall(pThis, NULL, pUrb, "BAD NDP16");
     1555            Log(("UsbNet: Bad NDP16: cbNdpMax=%#x < min=%#x\n", cbNdpMax, sizeof(*pNdp16) ));
     1556            return usbNetCompleteStall(pThis, NULL, pUrb, "BAD NDP16");
    15571557        }
    15581558
     
    15601560            && pNdp16->dwSignature != USBNCMNDP16_SIGNATURE_NCM1)
    15611561        {
    1562             Log(("UsbEth: NDP16: Invalid dwSignature value: %#x\n", pNdp16->dwSignature));
    1563             return usbEthCompleteStall(pThis, NULL, pUrb, "Bad NDP16");
     1562            Log(("UsbNet: NDP16: Invalid dwSignature value: %#x\n", pNdp16->dwSignature));
     1563            return usbNetCompleteStall(pThis, NULL, pUrb, "Bad NDP16");
    15641564        }
    15651565
     
    15681568            || pNdp16->wLength > cbNdpMax)
    15691569        {
    1570             Log(("UsbEth: NDP16: Invalid size value: %#x, req. (min %#x max %#x)\n",
     1570            Log(("UsbNet: NDP16: Invalid size value: %#x, req. (min %#x max %#x)\n",
    15711571                 pNdp16->wLength, sizeof(*pNdp16), cbNdpMax));
    1572             return usbEthCompleteStall(pThis, NULL, pUrb, "Bad NDP16");
     1572            return usbNetCompleteStall(pThis, NULL, pUrb, "Bad NDP16");
    15731573        }
    15741574
     
    15801580            int rc = pThis->Lun0.pINetwork->pfnBeginXmit(pThis->Lun0.pINetwork, true /* fOnWorkerThread */);
    15811581            if (RT_FAILURE(rc))
    1582                 return usbEthCompleteStall(pThis, NULL, pUrb, "BeginXmit failed");
     1582                return usbNetCompleteStall(pThis, NULL, pUrb, "BeginXmit failed");
    15831583
    15841584            for (uint32_t i = 0; i < cEntries; i++)
     
    15921592                    || pDGram->wDatagramIndex >= pUrb->cbData)
    15931593                {
    1594                     Log(("UsbEth: DGRAM16: Invalid wDatagramIndex value: %#x\n", pDGram->wDatagramIndex));
    1595                     return usbEthCompleteStall(pThis, NULL, pUrb, "Bad DGRAM16");
     1594                    Log(("UsbNet: DGRAM16: Invalid wDatagramIndex value: %#x\n", pDGram->wDatagramIndex));
     1595                    return usbNetCompleteStall(pThis, NULL, pUrb, "Bad DGRAM16");
    15961596                }
    15971597
    15981598                if (pUrb->cbData - pDGram->wDatagramIndex < pDGram->wDatagramLength)
    15991599                {
    1600                     Log(("UsbEth: DGRAM16: Invalid wDatagramLength value: %#x (max %#x)\n",
     1600                    Log(("UsbNet: DGRAM16: Invalid wDatagramLength value: %#x (max %#x)\n",
    16011601                         pDGram->wDatagramLength, pUrb->cbData - pDGram->wDatagramIndex));
    1602                     return usbEthCompleteStall(pThis, NULL, pUrb, "Bad DGRAM16");
     1602                    return usbNetCompleteStall(pThis, NULL, pUrb, "Bad DGRAM16");
    16031603                }
    16041604
     
    16121612                    rc = pThis->Lun0.pINetwork->pfnSendBuf(pThis->Lun0.pINetwork, pSgBuf, true /* fOnWorkerThread */);
    16131613                    if (RT_FAILURE(rc))
    1614                         return usbEthCompleteStall(pThis, NULL, pUrb, "SendBuf failed");
     1614                        return usbNetCompleteStall(pThis, NULL, pUrb, "SendBuf failed");
    16151615                }
    16161616                else
    1617                     return usbEthCompleteStall(pThis, NULL, pUrb, "AllocBuf failed");
     1617                    return usbNetCompleteStall(pThis, NULL, pUrb, "AllocBuf failed");
    16181618
    16191619                pDGram++;
     
    16241624        else
    16251625        {
    1626             Log(("UsbEth: NDP16: Not implemented\n"));
    1627             return usbEthCompleteStall(pThis, NULL, pUrb, "Bad NDP16");
     1626            Log(("UsbNet: NDP16: Not implemented\n"));
     1627            return usbNetCompleteStall(pThis, NULL, pUrb, "Bad NDP16");
    16281628        }
    16291629
     
    16311631    }
    16321632
    1633     return usbEthCompleteOk(pThis, pUrb, pUrb->cbData);
     1633    return usbNetCompleteOk(pThis, pUrb, pUrb->cbData);
    16341634}
    16351635
     
    16381638 * Handle requests sent to the inbound (to host) bulk pipe.
    16391639 */
    1640 static int usbEthHandleBulkDevToHost(PUSBETH pThis, PUSBETHEP pEp, PVUSBURB pUrb)
     1640static int usbNetHandleBulkDevToHost(PUSBNET pThis, PUSBNETEP pEp, PVUSBURB pUrb)
    16411641{
    16421642    /*
     
    16451645     */
    16461646    if (RT_UNLIKELY(pEp->fHalted))
    1647         return usbEthCompleteStall(pThis, NULL, pUrb, pEp->fHalted ? "Halted pipe" : "No request");
    1648 
    1649     usbEthQueueAddTail(&pThis->ToHostQueue, pUrb);
     1647        return usbNetCompleteStall(pThis, NULL, pUrb, pEp->fHalted ? "Halted pipe" : "No request");
     1648
     1649    usbNetQueueAddTail(&pThis->ToHostQueue, pUrb);
    16501650    if (pThis->fHaveToHostQueueWaiter)
    16511651        RTSemEventSignal(pThis->hEvtToHostQueue);
    16521652
    1653     LogFlow(("usbEthHandleBulkDevToHost: Added %p:%s to the to-host queue\n", pUrb, pUrb->pszDesc));
     1653    LogFlow(("usbNetHandleBulkDevToHost: Added %p:%s to the to-host queue\n", pUrb, pUrb->pszDesc));
    16541654    return VINF_SUCCESS;
    16551655}
     
    16591659 * Handle requests sent to the inbound (to host) interrupt pipe.
    16601660 */
    1661 static int usbEthHandleIntrDevToHost(PUSBETH pThis, PUSBETHEP pEp, PVUSBURB pUrb)
     1661static int usbNetHandleIntrDevToHost(PUSBNET pThis, PUSBNETEP pEp, PVUSBURB pUrb)
    16621662{
    16631663    /* Stall the request if the pipe is halted. */
    16641664    if (RT_UNLIKELY(pEp->fHalted))
    1665         return usbEthCompleteStall(pThis, NULL, pUrb, pEp->fHalted ? "Halted pipe" : "No request");
     1665        return usbNetCompleteStall(pThis, NULL, pUrb, pEp->fHalted ? "Halted pipe" : "No request");
    16661666
    16671667    if (!pThis->fInitialLinkStatusSent)
     
    16731673        LinkNotification.wIndex            = 0;
    16741674        LinkNotification.wLength           = 0;
    1675         usbEthCompleteNotificationOk(pThis, pUrb, &LinkNotification, sizeof(LinkNotification));
     1675        usbNetCompleteNotificationOk(pThis, pUrb, &LinkNotification, sizeof(LinkNotification));
    16761676        pThis->fInitialLinkStatusSent = true;
    16771677    }
     
    16861686        SpeedChange.DLBitRate             = UINT32_MAX;
    16871687        SpeedChange.ULBitRate             = UINT32_MAX;
    1688         usbEthCompleteNotificationOk(pThis, pUrb, &SpeedChange, sizeof(SpeedChange));
     1688        usbNetCompleteNotificationOk(pThis, pUrb, &SpeedChange, sizeof(SpeedChange));
    16891689        pThis->fInitialSpeedChangeSent = true;
    16901690    }
    16911691    else
    1692         usbEthQueueAddTail(&pThis->ToHostIntrQueue, pUrb);
    1693 
    1694     LogFlow(("usbEthHandleIntrDevToHost: Added %p:%s to the to-host interrupt queue\n", pUrb, pUrb->pszDesc));
     1692        usbNetQueueAddTail(&pThis->ToHostIntrQueue, pUrb);
     1693
     1694    LogFlow(("usbNetHandleIntrDevToHost: Added %p:%s to the to-host interrupt queue\n", pUrb, pUrb->pszDesc));
    16951695    return VINF_SUCCESS;
    16961696}
     
    17001700 * Handles request send to the default control pipe.
    17011701 */
    1702 static int usbEthHandleDefaultPipe(PUSBETH pThis, PUSBETHEP pEp, PVUSBURB pUrb)
     1702static int usbNetHandleDefaultPipe(PUSBNET pThis, PUSBNETEP pEp, PVUSBURB pUrb)
    17031703{
    17041704    PVUSBSETUP pSetup = (PVUSBSETUP)&pUrb->abData[0];
     
    17131713                if (pSetup->bmRequestType != (VUSB_TO_DEVICE | VUSB_REQ_STANDARD | VUSB_DIR_TO_HOST))
    17141714                {
    1715                     Log(("UsbEth: Bad GET_DESCRIPTOR req: bmRequestType=%#x\n", pSetup->bmRequestType));
    1716                     return usbEthCompleteStall(pThis, pEp, pUrb, "Bad GET_DESCRIPTOR");
     1715                    Log(("UsbNet: Bad GET_DESCRIPTOR req: bmRequestType=%#x\n", pSetup->bmRequestType));
     1716                    return usbNetCompleteStall(pThis, pEp, pUrb, "Bad GET_DESCRIPTOR");
    17171717                }
    17181718
     
    17221722
    17231723                    case VUSB_DT_STRING:
    1724                         Log(("UsbEth: GET_DESCRIPTOR DT_STRING wValue=%#x wIndex=%#x\n", pSetup->wValue, pSetup->wIndex));
     1724                        Log(("UsbNet: GET_DESCRIPTOR DT_STRING wValue=%#x wIndex=%#x\n", pSetup->wValue, pSetup->wIndex));
    17251725                        break;
    17261726                    case VUSB_DT_DEVICE_QUALIFIER:
    1727                         Log(("UsbEth: GET_DESCRIPTOR DT_DEVICE_QUALIFIER wValue=%#x wIndex=%#x\n", pSetup->wValue, pSetup->wIndex));
     1727                        Log(("UsbNet: GET_DESCRIPTOR DT_DEVICE_QUALIFIER wValue=%#x wIndex=%#x\n", pSetup->wValue, pSetup->wIndex));
    17281728                        /* Returned data is written after the setup message. */
    17291729                        cbCopy = pUrb->cbData - sizeof(*pSetup);
    1730                         cbCopy = RT_MIN(cbCopy, sizeof(g_UsbEthDeviceQualifier));
    1731                         memcpy(&pUrb->abData[sizeof(*pSetup)], &g_UsbEthDeviceQualifier, cbCopy);
    1732                         return usbEthCompleteOk(pThis, pUrb, cbCopy + sizeof(*pSetup));
     1730                        cbCopy = RT_MIN(cbCopy, sizeof(g_UsbNetDeviceQualifier));
     1731                        memcpy(&pUrb->abData[sizeof(*pSetup)], &g_UsbNetDeviceQualifier, cbCopy);
     1732                        return usbNetCompleteOk(pThis, pUrb, cbCopy + sizeof(*pSetup));
    17331733                    case VUSB_DT_BOS:
    1734                         Log(("UsbEth: GET_DESCRIPTOR DT_BOS wValue=%#x wIndex=%#x\n", pSetup->wValue, pSetup->wIndex));
     1734                        Log(("UsbNet: GET_DESCRIPTOR DT_BOS wValue=%#x wIndex=%#x\n", pSetup->wValue, pSetup->wIndex));
    17351735                        /* Returned data is written after the setup message. */
    17361736                        cbCopy = pUrb->cbData - sizeof(*pSetup);
    1737                         cbCopy = RT_MIN(cbCopy, sizeof(g_UsbEthBOS));
    1738                         memcpy(&pUrb->abData[sizeof(*pSetup)], &g_UsbEthBOS, cbCopy);
    1739                         return usbEthCompleteOk(pThis, pUrb, cbCopy + sizeof(*pSetup));
     1737                        cbCopy = RT_MIN(cbCopy, sizeof(g_UsbNetBOS));
     1738                        memcpy(&pUrb->abData[sizeof(*pSetup)], &g_UsbNetBOS, cbCopy);
     1739                        return usbNetCompleteOk(pThis, pUrb, cbCopy + sizeof(*pSetup));
    17401740                    default:
    1741                         Log(("UsbEth: GET_DESCRIPTOR, huh? wValue=%#x wIndex=%#x\n", pSetup->wValue, pSetup->wIndex));
     1741                        Log(("UsbNet: GET_DESCRIPTOR, huh? wValue=%#x wIndex=%#x\n", pSetup->wValue, pSetup->wIndex));
    17421742                        break;
    17431743                }
     
    17521752                if (pSetup->wLength != 2)
    17531753                {
    1754                     LogRelFlow(("UsbEth: Bad GET_STATUS req: wLength=%#x\n",
     1754                    LogRelFlow(("UsbNet: Bad GET_STATUS req: wLength=%#x\n",
    17551755                                pSetup->wLength));
    17561756                    break;
     
    17621762                    {
    17631763                        Assert(pSetup->wIndex == 0);
    1764                         LogRelFlow(("UsbEth: GET_STATUS (device)\n"));
     1764                        LogRelFlow(("UsbNet: GET_STATUS (device)\n"));
    17651765                        wRet = 0;   /* Not self-powered, no remote wakeup. */
    17661766                        cbCopy = pUrb->cbData - sizeof(*pSetup);
    17671767                        cbCopy = RT_MIN(cbCopy, sizeof(wRet));
    17681768                        memcpy(&pUrb->abData[sizeof(*pSetup)], &wRet, cbCopy);
    1769                         return usbEthCompleteOk(pThis, pUrb, cbCopy + sizeof(*pSetup));
     1769                        return usbNetCompleteOk(pThis, pUrb, cbCopy + sizeof(*pSetup));
    17701770                    }
    17711771
     
    17771777                            cbCopy = RT_MIN(cbCopy, sizeof(wRet));
    17781778                            memcpy(&pUrb->abData[sizeof(*pSetup)], &wRet, cbCopy);
    1779                             return usbEthCompleteOk(pThis, pUrb, cbCopy + sizeof(*pSetup));
     1779                            return usbNetCompleteOk(pThis, pUrb, cbCopy + sizeof(*pSetup));
    17801780                        }
    1781                         LogRelFlow(("UsbEth: GET_STATUS (interface) invalid, wIndex=%#x\n", pSetup->wIndex));
     1781                        LogRelFlow(("UsbNet: GET_STATUS (interface) invalid, wIndex=%#x\n", pSetup->wIndex));
    17821782                        break;
    17831783                    }
     
    17911791                            cbCopy = RT_MIN(cbCopy, sizeof(wRet));
    17921792                            memcpy(&pUrb->abData[sizeof(*pSetup)], &wRet, cbCopy);
    1793                             return usbEthCompleteOk(pThis, pUrb, cbCopy + sizeof(*pSetup));
     1793                            return usbNetCompleteOk(pThis, pUrb, cbCopy + sizeof(*pSetup));
    17941794                        }
    1795                         LogRelFlow(("UsbEth: GET_STATUS (endpoint) invalid, wIndex=%#x\n", pSetup->wIndex));
     1795                        LogRelFlow(("UsbNet: GET_STATUS (endpoint) invalid, wIndex=%#x\n", pSetup->wIndex));
    17961796                        break;
    17971797                    }
    17981798
    17991799                    default:
    1800                         LogRelFlow(("UsbEth: Bad GET_STATUS req: bmRequestType=%#x\n",
     1800                        LogRelFlow(("UsbNet: Bad GET_STATUS req: bmRequestType=%#x\n",
    18011801                                    pSetup->bmRequestType));
    1802                         return usbEthCompleteStall(pThis, pEp, pUrb, "Bad GET_STATUS");
     1802                        return usbNetCompleteStall(pThis, pEp, pUrb, "Bad GET_STATUS");
    18031803                }
    18041804                break;
     
    18131813
    18141814        /** @todo implement this. */
    1815         Log(("UsbEth: Implement standard request: bmRequestType=%#x bRequest=%#x wValue=%#x wIndex=%#x wLength=%#x\n",
     1815        Log(("UsbNet: Implement standard request: bmRequestType=%#x bRequest=%#x wValue=%#x wIndex=%#x wLength=%#x\n",
    18161816             pSetup->bmRequestType, pSetup->bRequest, pSetup->wValue, pSetup->wIndex, pSetup->wLength));
    18171817
    1818         usbEthCompleteStall(pThis, pEp, pUrb, "TODO: standard request stuff");
     1818        usbNetCompleteStall(pThis, pEp, pUrb, "TODO: standard request stuff");
    18191819    }
    18201820    else if ((pSetup->bmRequestType & VUSB_REQ_MASK) == VUSB_REQ_CLASS)
     
    18261826                if (pSetup->bmRequestType != (VUSB_TO_INTERFACE | VUSB_REQ_CLASS | VUSB_DIR_TO_HOST))
    18271827                {
    1828                     Log(("UsbEth: Bad GET_NTB_PARAMETERS req: bmRequestType=%#x\n", pSetup->bmRequestType));
    1829                     return usbEthCompleteStall(pThis, pEp, pUrb, "Bad GET_NTB_PARAMETERS");
     1828                    Log(("UsbNet: Bad GET_NTB_PARAMETERS req: bmRequestType=%#x\n", pSetup->bmRequestType));
     1829                    return usbNetCompleteStall(pThis, pEp, pUrb, "Bad GET_NTB_PARAMETERS");
    18301830                }
    18311831
     
    18481848                cbCopy = RT_MIN(cbCopy, sizeof(NtbParams));
    18491849                memcpy(&pUrb->abData[sizeof(*pSetup)], &NtbParams, cbCopy);
    1850                 return usbEthCompleteOk(pThis, pUrb, cbCopy + sizeof(*pSetup));
     1850                return usbNetCompleteOk(pThis, pUrb, cbCopy + sizeof(*pSetup));
    18511851            }
    18521852
     
    18551855        }
    18561856
    1857         usbEthCompleteStall(pThis, pEp, pUrb, "CLASS_REQ");
     1857        usbNetCompleteStall(pThis, pEp, pUrb, "CLASS_REQ");
    18581858    }
    18591859    else
    18601860    {
    1861         Log(("UsbEth: Unknown control msg: bmRequestType=%#x bRequest=%#x wValue=%#x wIndex=%#x wLength=%#x\n",
     1861        Log(("UsbNet: Unknown control msg: bmRequestType=%#x bRequest=%#x wValue=%#x wIndex=%#x wLength=%#x\n",
    18621862             pSetup->bmRequestType, pSetup->bRequest, pSetup->wValue, pSetup->wIndex, pSetup->wLength));
    1863         return usbEthCompleteStall(pThis, pEp, pUrb, "Unknown control msg");
     1863        return usbNetCompleteStall(pThis, pEp, pUrb, "Unknown control msg");
    18641864    }
    18651865
     
    18711871 * @interface_method_impl{PDMUSBREG,pfnUrbQueue}
    18721872 */
    1873 static DECLCALLBACK(int) usbEthQueue(PPDMUSBINS pUsbIns, PVUSBURB pUrb)
    1874 {
    1875     PUSBETH pThis = PDMINS_2_DATA(pUsbIns, PUSBETH);
    1876     LogFlow(("usbEthQueue/#%u: pUrb=%p:%s EndPt=%#x\n", pUsbIns->iInstance, pUrb, pUrb->pszDesc, pUrb->EndPt));
     1873static DECLCALLBACK(int) usbNetQueue(PPDMUSBINS pUsbIns, PVUSBURB pUrb)
     1874{
     1875    PUSBNET pThis = PDMINS_2_DATA(pUsbIns, PUSBNET);
     1876    LogFlow(("usbNetQueue/#%u: pUrb=%p:%s EndPt=%#x\n", pUsbIns->iInstance, pUrb, pUrb->pszDesc, pUrb->EndPt));
    18771877    RTCritSectEnter(&pThis->CritSect);
    18781878
     
    18841884    {
    18851885        case 0:
    1886             rc = usbEthHandleDefaultPipe(pThis, &pThis->aEps[0], pUrb);
     1886            rc = usbNetHandleDefaultPipe(pThis, &pThis->aEps[0], pUrb);
    18871887            break;
    18881888
     
    18911891            RT_FALL_THRU();
    18921892        case 0x01:
    1893             rc = usbEthHandleBulkDevToHost(pThis, &pThis->aEps[1], pUrb);
     1893            rc = usbNetHandleBulkDevToHost(pThis, &pThis->aEps[1], pUrb);
    18941894            break;
    18951895
    18961896        case 0x02:
    1897             rc = usbEthHandleBulkHostToDev(pThis, &pThis->aEps[2], pUrb);
     1897            rc = usbNetHandleBulkHostToDev(pThis, &pThis->aEps[2], pUrb);
    18981898            break;
    18991899
    19001900        case 0x03:
    1901             rc = usbEthHandleIntrDevToHost(pThis, &pThis->aEps[3], pUrb);
     1901            rc = usbNetHandleIntrDevToHost(pThis, &pThis->aEps[3], pUrb);
    19021902            break;
    19031903
     
    19161916 * @interface_method_impl{PDMUSBREG,pfnUsbClearHaltedEndpoint}
    19171917 */
    1918 static DECLCALLBACK(int) usbEthUsbClearHaltedEndpoint(PPDMUSBINS pUsbIns, unsigned uEndpoint)
    1919 {
    1920     PUSBETH pThis = PDMINS_2_DATA(pUsbIns, PUSBETH);
    1921     LogFlow(("usbEthUsbClearHaltedEndpoint/#%u: uEndpoint=%#x\n", pUsbIns->iInstance, uEndpoint));
     1918static DECLCALLBACK(int) usbNetUsbClearHaltedEndpoint(PPDMUSBINS pUsbIns, unsigned uEndpoint)
     1919{
     1920    PUSBNET pThis = PDMINS_2_DATA(pUsbIns, PUSBNET);
     1921    LogFlow(("usbNetUsbClearHaltedEndpoint/#%u: uEndpoint=%#x\n", pUsbIns->iInstance, uEndpoint));
    19221922
    19231923    if ((uEndpoint & ~0x80) < RT_ELEMENTS(pThis->aEps))
     
    19351935 * @interface_method_impl{PDMUSBREG,pfnUsbSetInterface}
    19361936 */
    1937 static DECLCALLBACK(int) usbEthUsbSetInterface(PPDMUSBINS pUsbIns, uint8_t bInterfaceNumber, uint8_t bAlternateSetting)
     1937static DECLCALLBACK(int) usbNetUsbSetInterface(PPDMUSBINS pUsbIns, uint8_t bInterfaceNumber, uint8_t bAlternateSetting)
    19381938{
    19391939    RT_NOREF(bInterfaceNumber);
    1940     PUSBETH pThis = PDMINS_2_DATA(pUsbIns, PUSBETH);
    1941     LogFlow(("usbEthUsbSetInterface/#%u: bInterfaceNumber=%u bAlternateSetting=%u\n", pUsbIns->iInstance, bInterfaceNumber, bAlternateSetting));
     1940    PUSBNET pThis = PDMINS_2_DATA(pUsbIns, PUSBNET);
     1941    LogFlow(("usbNetUsbSetInterface/#%u: bInterfaceNumber=%u bAlternateSetting=%u\n", pUsbIns->iInstance, bInterfaceNumber, bAlternateSetting));
    19421942    Assert(bAlternateSetting == 0 || bAlternateSetting == 1);
    19431943    if (pThis->bAlternateSetting != bAlternateSetting)
     
    19461946        {
    19471947            /* This is some kind of reset. */
    1948             usbEthResetWorker(pThis, NULL, true /*fSetConfig*/);
     1948            usbNetResetWorker(pThis, NULL, true /*fSetConfig*/);
    19491949        }
    19501950        else
     
    19641964 * @interface_method_impl{PDMUSBREG,pfnUsbSetConfiguration}
    19651965 */
    1966 static DECLCALLBACK(int) usbEthUsbSetConfiguration(PPDMUSBINS pUsbIns, uint8_t bConfigurationValue,
     1966static DECLCALLBACK(int) usbNetUsbSetConfiguration(PPDMUSBINS pUsbIns, uint8_t bConfigurationValue,
    19671967                                                   const void *pvOldCfgDesc, const void *pvOldIfState, const void *pvNewCfgDesc)
    19681968{
    19691969    RT_NOREF(pvOldCfgDesc, pvOldIfState,  pvNewCfgDesc);
    1970     PUSBETH pThis = PDMINS_2_DATA(pUsbIns, PUSBETH);
    1971     LogFlow(("usbEthUsbSetConfiguration/#%u: bConfigurationValue=%u\n", pUsbIns->iInstance, bConfigurationValue));
     1970    PUSBNET pThis = PDMINS_2_DATA(pUsbIns, PUSBNET);
     1971    LogFlow(("usbNetUsbSetConfiguration/#%u: bConfigurationValue=%u\n", pUsbIns->iInstance, bConfigurationValue));
    19721972    Assert(bConfigurationValue == 1);
    19731973    RTCritSectEnter(&pThis->CritSect);
     
    19771977     */
    19781978    if (pThis->bConfigurationValue == bConfigurationValue)
    1979         usbEthResetWorker(pThis, NULL, true /*fSetConfig*/); /** @todo figure out the exact difference */
     1979        usbNetResetWorker(pThis, NULL, true /*fSetConfig*/); /** @todo figure out the exact difference */
    19801980    pThis->bConfigurationValue = bConfigurationValue;
    19811981
     
    19881988 * @interface_method_impl{PDMUSBREG,pfnUsbGetDescriptorCache}
    19891989 */
    1990 static DECLCALLBACK(PCPDMUSBDESCCACHE) usbEthUsbGetDescriptorCache(PPDMUSBINS pUsbIns)
    1991 {
    1992     PUSBETH pThis = PDMINS_2_DATA(pUsbIns, PUSBETH);
    1993     LogFlow(("usbEthUsbGetDescriptorCache/#%u:\n", pUsbIns->iInstance));
     1990static DECLCALLBACK(PCPDMUSBDESCCACHE) usbNetUsbGetDescriptorCache(PPDMUSBINS pUsbIns)
     1991{
     1992    PUSBNET pThis = PDMINS_2_DATA(pUsbIns, PUSBNET);
     1993    LogFlow(("usbNetUsbGetDescriptorCache/#%u:\n", pUsbIns->iInstance));
    19941994    return &pThis->UsbDescCache;
    19951995}
     
    19991999 * @interface_method_impl{PDMUSBREG,pfnUsbReset}
    20002000 */
    2001 static DECLCALLBACK(int) usbEthUsbReset(PPDMUSBINS pUsbIns, bool fResetOnLinux)
     2001static DECLCALLBACK(int) usbNetUsbReset(PPDMUSBINS pUsbIns, bool fResetOnLinux)
    20022002{
    20032003    RT_NOREF(fResetOnLinux);
    2004     PUSBETH pThis = PDMINS_2_DATA(pUsbIns, PUSBETH);
    2005     LogFlow(("usbEthUsbReset/#%u:\n", pUsbIns->iInstance));
     2004    PUSBNET pThis = PDMINS_2_DATA(pUsbIns, PUSBNET);
     2005    LogFlow(("usbNetUsbReset/#%u:\n", pUsbIns->iInstance));
    20062006    RTCritSectEnter(&pThis->CritSect);
    20072007
    2008     int rc = usbEthResetWorker(pThis, NULL, false /*fSetConfig*/);
     2008    int rc = usbNetResetWorker(pThis, NULL, false /*fSetConfig*/);
    20092009
    20102010    RTCritSectLeave(&pThis->CritSect);
     
    20162016 * @interface_method_impl{PDMUSBREG,pfnDriverAttach}
    20172017 */
    2018 static DECLCALLBACK(int) usbEthDriverAttach(PPDMUSBINS pUsbIns, unsigned iLUN, uint32_t fFlags)
     2018static DECLCALLBACK(int) usbNetDriverAttach(PPDMUSBINS pUsbIns, unsigned iLUN, uint32_t fFlags)
    20192019{
    20202020    RT_NOREF(fFlags);
    2021     PUSBETH pThis = PDMINS_2_DATA(pUsbIns, PUSBETH);
    2022 
    2023     LogFlow(("usbEthDriverAttach/#%u:\n", pUsbIns->iInstance));
    2024 
    2025     AssertMsg(iLUN == 0, ("UsbEth: No other LUN than 0 is supported\n"));
     2021    PUSBNET pThis = PDMINS_2_DATA(pUsbIns, PUSBNET);
     2022
     2023    LogFlow(("usbNetDriverAttach/#%u:\n", pUsbIns->iInstance));
     2024
     2025    AssertMsg(iLUN == 0, ("UsbNet: No other LUN than 0 is supported\n"));
    20262026    AssertMsg(fFlags & PDM_TACH_FLAGS_NOT_HOT_PLUG,
    2027               ("UsbEth: Device does not support hotplugging\n"));
     2027              ("UsbNet: Device does not support hotplugging\n"));
    20282028
    20292029    /* the usual paranoia */
     
    20572057 * @interface_method_impl{PDMUSBREG,pfnDriverDetach}
    20582058 */
    2059 static DECLCALLBACK(void) usbEthDriverDetach(PPDMUSBINS pUsbIns, unsigned iLUN, uint32_t fFlags)
     2059static DECLCALLBACK(void) usbNetDriverDetach(PPDMUSBINS pUsbIns, unsigned iLUN, uint32_t fFlags)
    20602060{
    20612061    RT_NOREF(iLUN, fFlags);
    2062     PUSBETH pThis = PDMINS_2_DATA(pUsbIns, PUSBETH);
    2063 
    2064     LogFlow(("usbEthDriverDetach/#%u:\n", pUsbIns->iInstance));
    2065 
    2066     AssertMsg(iLUN == 0, ("UsbEth: No other LUN than 0 is supported\n"));
     2062    PUSBNET pThis = PDMINS_2_DATA(pUsbIns, PUSBNET);
     2063
     2064    LogFlow(("usbNetDriverDetach/#%u:\n", pUsbIns->iInstance));
     2065
     2066    AssertMsg(iLUN == 0, ("UsbNet: No other LUN than 0 is supported\n"));
    20672067    AssertMsg(fFlags & PDM_TACH_FLAGS_NOT_HOT_PLUG,
    2068               ("UsbEth: Device does not support hotplugging\n"));
     2068              ("UsbNet: Device does not support hotplugging\n"));
    20692069
    20702070    /*
     
    20792079 * @interface_method_impl{PDMUSBREG,pfnVMReset}
    20802080 */
    2081 static DECLCALLBACK(void) usbEthVMReset(PPDMUSBINS pUsbIns)
    2082 {
    2083     PUSBETH pThis = PDMINS_2_DATA(pUsbIns, PUSBETH);
    2084 
    2085     int rc = usbEthResetWorker(pThis, NULL, false /*fSetConfig*/);
     2081static DECLCALLBACK(void) usbNetVMReset(PPDMUSBINS pUsbIns)
     2082{
     2083    PUSBNET pThis = PDMINS_2_DATA(pUsbIns, PUSBNET);
     2084
     2085    int rc = usbNetResetWorker(pThis, NULL, false /*fSetConfig*/);
    20862086    AssertRC(rc);
    20872087}
     
    20912091 * @interface_method_impl{PDMUSBREG,pfnDestruct}
    20922092 */
    2093 static DECLCALLBACK(void) usbEthDestruct(PPDMUSBINS pUsbIns)
     2093static DECLCALLBACK(void) usbNetDestruct(PPDMUSBINS pUsbIns)
    20942094{
    20952095    PDMUSB_CHECK_VERSIONS_RETURN_VOID(pUsbIns);
    2096     PUSBETH pThis = PDMINS_2_DATA(pUsbIns, PUSBETH);
    2097     LogFlow(("usbEthDestruct/#%u:\n", pUsbIns->iInstance));
     2096    PUSBNET pThis = PDMINS_2_DATA(pUsbIns, PUSBNET);
     2097    LogFlow(("usbNetDestruct/#%u:\n", pUsbIns->iInstance));
    20982098
    20992099    if (RTCritSectIsInitialized(&pThis->CritSect))
     
    21272127 * @interface_method_impl{PDMUSBREG,pfnConstruct}
    21282128 */
    2129 static DECLCALLBACK(int) usbEthConstruct(PPDMUSBINS pUsbIns, int iInstance, PCFGMNODE pCfg, PCFGMNODE pCfgGlobal)
     2129static DECLCALLBACK(int) usbNetConstruct(PPDMUSBINS pUsbIns, int iInstance, PCFGMNODE pCfg, PCFGMNODE pCfgGlobal)
    21302130{
    21312131    RT_NOREF(pCfgGlobal);
    21322132    PDMUSB_CHECK_VERSIONS_RETURN(pUsbIns);
    2133     PUSBETH     pThis = PDMINS_2_DATA(pUsbIns, PUSBETH);
     2133    PUSBNET     pThis = PDMINS_2_DATA(pUsbIns, PUSBNET);
    21342134    PCPDMUSBHLP pHlp  = pUsbIns->pHlpR3;
    21352135
    2136     Log(("usbMsdConstruct/#%u:\n", iInstance));
     2136    Log(("usbNetConstruct/#%u:\n", iInstance));
    21372137
    21382138    /*
     
    21452145    pThis->hEvtReset                                    = NIL_RTSEMEVENTMULTI;
    21462146    /* IBase */
    2147     pThis->Lun0.IBase.pfnQueryInterface                 = usbEthLun0QueryInterface;
     2147    pThis->Lun0.IBase.pfnQueryInterface                 = usbNetLun0QueryInterface;
    21482148    /* INetworkPort */
    2149     pThis->Lun0.INetworkDown.pfnWaitReceiveAvail        = usbEthNetworkDown_WaitReceiveAvail;
    2150     pThis->Lun0.INetworkDown.pfnReceive                 = usbEthNetworkDown_Receive;
    2151     pThis->Lun0.INetworkDown.pfnXmitPending             = usbEthNetworkDown_XmitPending;
     2149    pThis->Lun0.INetworkDown.pfnWaitReceiveAvail        = usbNetNetworkDown_WaitReceiveAvail;
     2150    pThis->Lun0.INetworkDown.pfnReceive                 = usbNetNetworkDown_Receive;
     2151    pThis->Lun0.INetworkDown.pfnXmitPending             = usbNetNetworkDown_XmitPending;
    21522152    /* INetworkConfig */
    2153     pThis->Lun0.INetworkConfig.pfnGetMac                = usbEthGetMac;
    2154     pThis->Lun0.INetworkConfig.pfnGetLinkState          = usbEthGetLinkState;
    2155     pThis->Lun0.INetworkConfig.pfnSetLinkState          = usbEthSetLinkState;
    2156 
    2157     usbEthQueueInit(&pThis->ToHostQueue);
    2158     usbEthQueueInit(&pThis->ToHostIntrQueue);
    2159     usbEthQueueInit(&pThis->DoneQueue);
     2153    pThis->Lun0.INetworkConfig.pfnGetMac                = usbNetGetMac;
     2154    pThis->Lun0.INetworkConfig.pfnGetLinkState          = usbNetGetLinkState;
     2155    pThis->Lun0.INetworkConfig.pfnSetLinkState          = usbNetSetLinkState;
     2156
     2157    usbNetQueueInit(&pThis->ToHostQueue);
     2158    usbNetQueueInit(&pThis->ToHostIntrQueue);
     2159    usbNetQueueInit(&pThis->DoneQueue);
    21602160
    21612161    int rc = RTCritSectInit(&pThis->CritSect);
     
    21782178                                     "CableConnected|"
    21792179                                     "LinkUpDelay|"
    2180                                      , "Config", "UsbEth", iInstance);
     2180                                     , "Config", "UsbNet", iInstance);
    21812181    if (RT_FAILURE(rc))
    21822182        return rc;
     
    21992199    rc = PDMUsbHlpDriverAttach(pUsbIns, 0 /*iLun*/, &pThis->Lun0.IBase, &pThis->Lun0.pIBase, "Network Port");
    22002200    if (RT_FAILURE(rc))
    2201         return PDMUsbHlpVMSetError(pUsbIns, rc, RT_SRC_POS, N_("USBETH failed to attach network driver"));
     2201        return PDMUsbHlpVMSetError(pUsbIns, rc, RT_SRC_POS, N_("USBNET failed to attach network driver"));
    22022202    pThis->Lun0.pINetwork = PDMIBASE_QUERY_INTERFACE(pThis->Lun0.pIBase, PDMINETWORKUP);
    22032203    if (!pThis->Lun0.pINetwork)
    22042204        return PDMUsbHlpVMSetError(pUsbIns, VERR_PDM_MISSING_INTERFACE_BELOW, RT_SRC_POS,
    2205                                    N_("USBETH failed to query the PDMINETWORKUP from the driver below it"));
     2205                                   N_("USBNET failed to query the PDMINETWORKUP from the driver below it"));
    22062206
    22072207    /*
    22082208     * Build the USB descriptors.
    22092209     */
    2210     pThis->aUsbStringsEnUs[0].idx = USBETH_STR_ID_MANUFACTURER;
     2210    pThis->aUsbStringsEnUs[0].idx = USBNET_STR_ID_MANUFACTURER;
    22112211    pThis->aUsbStringsEnUs[0].psz = "VirtualBox";
    22122212
    2213     pThis->aUsbStringsEnUs[1].idx = USBETH_STR_ID_PRODUCT;
     2213    pThis->aUsbStringsEnUs[1].idx = USBNET_STR_ID_PRODUCT;
    22142214    pThis->aUsbStringsEnUs[1].psz = "USB Ethernet";
    22152215
     
    22182218    AssertReturn(cch + 1 == sizeof(pThis->aszMac), VERR_INTERNAL_ERROR_4);
    22192219
    2220     pThis->aUsbStringsEnUs[2].idx = USBETH_STR_ID_MAC_ADDRESS;
     2220    pThis->aUsbStringsEnUs[2].idx = USBNET_STR_ID_MAC_ADDRESS;
    22212221    pThis->aUsbStringsEnUs[2].psz = &pThis->aszMac[0];
    22222222
     
    22352235        case VUSB_SPEED_SUPERPLUS:
    22362236        {
    2237             pThis->UsbDescCache.pDevice   = &g_UsbEthDeviceDesc30;
    2238             pThis->UsbDescCache.paConfigs = &g_UsbEthConfigDescSS;
     2237            pThis->UsbDescCache.pDevice   = &g_UsbNetDeviceDesc30;
     2238            pThis->UsbDescCache.paConfigs = &g_UsbNetConfigDescSS;
    22392239            break;
    22402240        }
    22412241        case VUSB_SPEED_HIGH:
    22422242        {
    2243             pThis->UsbDescCache.pDevice   = &g_UsbEthDeviceDesc20;
    2244             pThis->UsbDescCache.paConfigs = &g_UsbEthConfigDescHS;
     2243            pThis->UsbDescCache.pDevice   = &g_UsbNetDeviceDesc20;
     2244            pThis->UsbDescCache.paConfigs = &g_UsbNetConfigDescHS;
    22452245            break;
    22462246        }
     
    22482248        case VUSB_SPEED_LOW:
    22492249        {
    2250             pThis->UsbDescCache.pDevice   = &g_UsbEthDeviceDesc20;
    2251             pThis->UsbDescCache.paConfigs = &g_UsbEthConfigDescFS;
     2250            pThis->UsbDescCache.pDevice   = &g_UsbNetDeviceDesc20;
     2251            pThis->UsbDescCache.paConfigs = &g_UsbNetConfigDescFS;
    22522252            break;
    22532253        }
     
    22632263 * The USB Communications Device Class, Network Control Model (CDC NCM) registration record.
    22642264 */
    2265 const PDMUSBREG g_UsbEth =
     2265const PDMUSBREG g_UsbNet =
    22662266{
    22672267    /* u32Version */
    22682268    PDM_USBREG_VERSION,
    22692269    /* szName */
    2270     "UsbEth",
     2270    "UsbNet",
    22712271    /* pszDescription */
    22722272    "USB Communications Device Class, one LUN.",
     
    22762276    ~0U,
    22772277    /* cbInstance */
    2278     sizeof(USBETH),
     2278    sizeof(USBNET),
    22792279    /* pfnConstruct */
    2280     usbEthConstruct,
     2280    usbNetConstruct,
    22812281    /* pfnDestruct */
    2282     usbEthDestruct,
     2282    usbNetDestruct,
    22832283    /* pfnVMInitComplete */
    22842284    NULL,
     
    22862286    NULL,
    22872287    /* pfnVMReset */
    2288     usbEthVMReset,
     2288    usbNetVMReset,
    22892289    /* pfnVMSuspend */
    22902290    NULL,
     
    22982298    NULL,
    22992299    /* pfnDriverAttach */
    2300     usbEthDriverAttach,
     2300    usbNetDriverAttach,
    23012301    /* pfnDriverDetach */
    2302     usbEthDriverDetach,
     2302    usbNetDriverDetach,
    23032303    /* pfnQueryInterface */
    23042304    NULL,
    23052305    /* pfnUsbReset */
    2306     usbEthUsbReset,
    2307     /* pfnUsbGetCachedDescriptors */
    2308     usbEthUsbGetDescriptorCache,
     2306    usbNetUsbReset,
     2307    /* pfnUsbGetDescriptorCache */
     2308    usbNetUsbGetDescriptorCache,
    23092309    /* pfnUsbSetConfiguration */
    2310     usbEthUsbSetConfiguration,
     2310    usbNetUsbSetConfiguration,
    23112311    /* pfnUsbSetInterface */
    2312     usbEthUsbSetInterface,
     2312    usbNetUsbSetInterface,
    23132313    /* pfnUsbClearHaltedEndpoint */
    2314     usbEthUsbClearHaltedEndpoint,
     2314    usbNetUsbClearHaltedEndpoint,
    23152315    /* pfnUrbNew */
    2316     NULL/*usbEthUrbNew*/,
     2316    NULL/*usbNetUrbNew*/,
    23172317    /* pfnQueue */
    2318     usbEthQueue,
     2318    usbNetQueue,
    23192319    /* pfnUrbCancel */
    2320     usbEthUrbCancel,
     2320    usbNetUrbCancel,
    23212321    /* pfnUrbReap */
    2322     usbEthUrbReap,
     2322    usbNetUrbReap,
    23232323    /* pfnWakeup */
    2324     usbEthWakeup,
     2324    usbNetWakeup,
    23252325    /* u32TheEnd */
    23262326    PDM_USBREG_VERSION
  • trunk/src/VBox/Devices/build/VBoxDD.cpp

    r106345 r107242  
    534534    if (RT_FAILURE(rc))
    535535        return rc;
    536     rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbEth);
     536    rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbNet);
    537537    if (RT_FAILURE(rc))
    538538        return rc;
  • trunk/src/VBox/Devices/build/VBoxDD.h

    r106521 r107242  
    205205extern const PDMUSBREG g_UsbHidKbd;
    206206extern const PDMUSBREG g_UsbHidMou;
    207 extern const PDMUSBREG g_UsbEth;
     207extern const PDMUSBREG g_UsbNet;
    208208#endif
    209209#ifdef VBOX_WITH_USB_VIDEO_IMPL
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