VirtualBox

Changeset 63478 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Aug 15, 2016 2:04:10 PM (8 years ago)
Author:
vboxsync
Message:

Devices: warnings (clang)

Location:
trunk/src/VBox/Devices/Network
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DevE1000.cpp

    r63218 r63478  
    218218#define E1K_CHIP_82545EM 2
    219219
     220#ifdef IN_RING3
    220221/** Different E1000 chips. */
    221222static const struct E1kChips
     
    226227    uint16_t uPCISubsystemId;
    227228    const char *pcszName;
    228 } g_Chips[] =
     229} g_aChips[] =
    229230{
    230231    /* Vendor Device SSVendor SubSys  Name */
    231232    { 0x8086,
    232233      /* Temporary code, as MSI-aware driver dislike 0x100E. How to do that right? */
    233 #ifdef E1K_WITH_MSI
     234# ifdef E1K_WITH_MSI
    234235      0x105E,
    235 #else
     236# else
    236237      0x100E,
    237 #endif
     238# endif
    238239                      0x8086, 0x001E, "82540EM" }, /* Intel 82540EM-A in Intel PRO/1000 MT Desktop */
    239240    { 0x8086, 0x1004, 0x8086, 0x1004, "82543GC" }, /* Intel 82543GC   in Intel PRO/1000 T  Server */
    240241    { 0x8086, 0x100F, 0x15AD, 0x0750, "82545EM" }  /* Intel 82545EM-A in VMWare Network Adapter */
    241242};
     243#endif /* IN_RING3 */
    242244
    243245
     
    15521554}
    15531555
     1556#ifdef IN_RING3
    15541557/**
    15551558 * Cancel a timer.
     
    15681571    RT_NOREF1(pThis);
    15691572}
     1573#endif /* IN_RING3 */
    15701574
    15711575#define e1kCsEnter(ps, rc) PDMCritSectEnter(&ps->cs, rc)
     
    17481752}
    17491753
     1754
     1755#if defined(E1K_WITH_RXD_CACHE) && defined(IN_RING3) /* currently only used in ring-3 due to stack space requirements of the caller */
    17501756/**
    17511757 * Dump receive descriptor to debug log.
     
    17771783             E1K_SPEC_PRI(pDesc->status.u16Special)));
    17781784}
     1785#endif /* E1K_WITH_RXD_CACHE && IN_RING3 */
    17791786
    17801787/**
     
    19541961}
    19551962
     1963#ifdef IN_RING3 /* currently only used in ring-3 due to stack space requirements of the caller */
    19561964/**
    19571965 * Advance the head pointer of the receive descriptor queue.
     
    19922000    //e1kCsLeave(pThis);
    19932001}
     2002#endif /* IN_RING3 */
    19942003
    19952004#ifdef E1K_WITH_RXD_CACHE
     2005
    19962006/**
    19972007 * Return the number of RX descriptor that belong to the hardware.
     
    20872097}
    20882098
     2099# ifdef IN_RING3 /* currently only used in ring-3 due to stack space requirements of the caller */
     2100
    20892101/**
    20902102 * Obtain the next RX descriptor from RXD cache, fetching descriptors from the
     
    21112123    return NULL;
    21122124}
     2125
    21132126
    21142127/**
     
    21362149}
    21372150
    2138 # ifdef IN_RING3 /* currently only used in ring-3 due to stack space requirements of the caller */
    21392151/**
    21402152 * Store a fragment of received packet at the specifed address.
     
    21542166    STAM_PROFILE_ADV_STOP(&pThis->StatReceiveStore, a);
    21552167}
     2168
    21562169# endif
    21572170
     
    22062219    STAM_PROFILE_ADV_STOP(&pThis->StatReceiveStore, a);
    22072220}
     2221
    22082222#endif /* !E1K_WITH_RXD_CACHE */
    22092223
     
    32443258#  ifndef E1K_NO_TAD
    32453259    e1kCancelTimer(pThis, pThis->CTX_SUFF(pTADTimer));
    3246 #  endif /* E1K_NO_TAD */
     3260#  endif
    32473261    e1kRaiseInterrupt(pThis, ICR_TXDW);
    32483262}
     
    44514465                /* Cancel both timers if armed and fire immediately. */
    44524466                e1kCancelTimer(pThis, pThis->CTX_SUFF(pTADTimer));
    4453 # endif /* E1K_NO_TAD */
     4467# endif
    44544468#endif /* E1K_USE_TX_TIMERS */
    44554469                E1K_INC_ISTAT_CNT(pThis->uStatIntTx);
     
    70187032    pHlp->pfnPrintf(pHlp, "E1000 #%d: port=%RTiop mmio=%RGp mac-cfg=%RTmac %s%s%s\n",
    70197033                    pDevIns->iInstance, pThis->IOPortBase, pThis->addrMMReg,
    7020                     &pThis->macConfigured, g_Chips[pThis->eChip].pcszName,
     7034                    &pThis->macConfigured, g_aChips[pThis->eChip].pcszName,
    70217035                    pThis->fRCEnabled ? " GC" : "", pThis->fR0Enabled ? " R0" : "");
    70227036
     
    73757389static DECLCALLBACK(void) e1kConfigurePciDev(PPCIDEVICE pPciDev, E1KCHIP eChip)
    73767390{
    7377     Assert(eChip < RT_ELEMENTS(g_Chips));
     7391    Assert(eChip < RT_ELEMENTS(g_aChips));
    73787392    /* Configure PCI Device, assume 32-bit mode ******************************/
    7379     PCIDevSetVendorId(pPciDev, g_Chips[eChip].uPCIVendorId);
    7380     PCIDevSetDeviceId(pPciDev, g_Chips[eChip].uPCIDeviceId);
    7381     PCIDevSetWord( pPciDev, VBOX_PCI_SUBSYSTEM_VENDOR_ID, g_Chips[eChip].uPCISubsystemVendorId);
    7382     PCIDevSetWord( pPciDev, VBOX_PCI_SUBSYSTEM_ID, g_Chips[eChip].uPCISubsystemId);
     7393    PCIDevSetVendorId(pPciDev, g_aChips[eChip].uPCIVendorId);
     7394    PCIDevSetDeviceId(pPciDev, g_aChips[eChip].uPCIDeviceId);
     7395    PCIDevSetWord( pPciDev, VBOX_PCI_SUBSYSTEM_VENDOR_ID, g_aChips[eChip].uPCISubsystemVendorId);
     7396    PCIDevSetWord( pPciDev, VBOX_PCI_SUBSYSTEM_ID, g_aChips[eChip].uPCISubsystemId);
    73837397
    73847398    PCIDevSetWord( pPciDev, VBOX_PCI_COMMAND,            0x0000);
     
    75687582
    75697583    LogRel(("%s Chip=%s LinkUpDelay=%ums EthernetCRC=%s GSO=%s Itr=%s ItrRx=%s R0=%s GC=%s\n", pThis->szPrf,
    7570             g_Chips[pThis->eChip].pcszName, pThis->cMsLinkUpDelay,
     7584            g_aChips[pThis->eChip].pcszName, pThis->cMsLinkUpDelay,
    75717585            pThis->fEthernetCRC ? "on" : "off",
    75727586            pThis->fGSOEnabled ? "enabled" : "disabled",
  • trunk/src/VBox/Devices/Network/DevVirtioNet.cpp

    r62962 r63478  
    274274AssertCompileSize(VNETCTLHDR, 2);
    275275
     276#ifdef IN_RING3
     277
    276278/** Returns true if large packets are written into several RX buffers. */
    277279DECLINLINE(bool) vnetMergeableRxBuffers(PVNETSTATE pThis)
     
    289291    vpciCsLeave(&pThis->VPCI);
    290292}
     293
     294#endif /* IN_RING3 */
    291295
    292296DECLINLINE(int) vnetCsRxEnter(PVNETSTATE pThis, int rcBusy)
     
    307311}
    308312
     313#ifdef IN_RING3
    309314/**
    310315 * Dump a packet to debug log.
     
    317322DECLINLINE(void) vnetPacketDump(PVNETSTATE pThis, const uint8_t *pbPacket, size_t cb, const char *pszText)
    318323{
    319 #ifdef DEBUG
     324# ifdef DEBUG
    320325    Log(("%s %s packet #%d (%d bytes):\n",
    321326         INSTANCE(pThis), pszText, ++pThis->u32PktNo, cb));
    322327    Log3(("%.*Rhxd\n", cb, pbPacket));
    323 #else
     328# else
    324329    RT_NOREF4(pThis, pbPacket, cb, pszText);
    325 #endif
    326 }
     330# endif
     331}
     332#endif /* IN_RING3 */
    327333
    328334/**
  • trunk/src/VBox/Devices/Network/DrvIntNet.cpp

    r63461 r63478  
    269269 * @param   pThis               The instance data..
    270270 */
    271 DECLINLINE(int) drvIntNetSignalXmit(PDRVINTNET pThis)
     271DECLINLINE(int) drvR0IntNetSignalXmit(PDRVINTNET pThis)
    272272{
    273273    /// @todo if (!ASMAtomicXchgBool(&pThis->fXmitSignalled, true)) - needs careful optimizing.
     
    279279    return VERR_TRY_AGAIN;
    280280}
    281 #endif
     281#endif /* !IN_RING3 */
    282282
    283283
     
    306306    {
    307307        ASMAtomicUoWriteBool(&pThis->fXmitProcessRing, true);
    308         drvIntNetSignalXmit(pThis);
     308        drvR0IntNetSignalXmit(pThis);
    309309        rc = VINF_SUCCESS;
    310310    }
     
    351351        rc = VERR_TRY_AGAIN;
    352352#else  /* IN_RING0 */
    353         rc = drvIntNetSignalXmit(pThis);
     353        rc = drvR0IntNetSignalXmit(pThis);
    354354#endif /* IN_RING0 */
    355355    }
     
    381381    PPDMSCATTERGATHER pSgBuf = &pThis->u.Sg;
    382382    if (RT_UNLIKELY(pSgBuf->fFlags != 0))
    383         return drvIntNetSignalXmit(pThis);
     383        return drvR0IntNetSignalXmit(pThis);
    384384#endif
    385385
     
    444444    {
    445445        pThis->fXmitProcessRing = true;
    446         rc = drvIntNetSignalXmit(pThis);
     446        rc = drvR0IntNetSignalXmit(pThis);
    447447    }
    448448    else
  • trunk/src/VBox/Devices/Network/DrvNAT.cpp

    r63214 r63478  
    11451145            else
    11461146                LogRel(("NAT: DNS server list is empty (2)\n"));
     1147#else
     1148            RT_NOREF(hDynStor);
    11471149#endif
    11481150            drvNATUpdateDNS(pThis, /* fFlapLink */ true);
  • trunk/src/VBox/Devices/Network/SrvIntNetR0.cpp

    r63458 r63478  
    897897    return Addr.u == UINT32_MAX;
    898898}
    899 #endif
     899#endif /* unused */
    900900
    901901
     
    10321032    return intnetR0IfAddrCacheLookup(pCache, pAddr, cbAddr);
    10331033}
    1034 
    10351034
    10361035#if 0 /* unused */
     
    12201219
    12211220#if 0 /* unused */
    1222 
    12231221/**
    12241222 * Deletes the address from all the interface caches except the specified one.
     
    12521250    RTSpinlockRelease(pNetwork->hAddrSpinlock);
    12531251}
    1254 
    1255 #endif
     1252#endif /* unused */
    12561253
    12571254
  • trunk/src/VBox/Devices/Network/slirp/ip_icmp.c

    r63459 r63478  
    6464/* The message sent when emulating PING */
    6565/* Be nice and tell them it's just a psuedo-ping packet */
    66 #if 0
     66#if 0 /* unused */
    6767static const char icmp_ping_msg[] = "This is a psuedo-PING packet used by Slirp to emulate ICMP ECHO-REQUEST packets.\n";
    6868#endif
  • trunk/src/VBox/Devices/Network/slirp/tftp.c

    r63014 r63478  
    196196
    197197
     198#if 0 /* unused */
    198199DECLINLINE(bool) tftpIsAcceptableOption(const char *pszOptionName)
    199200{
     
    214215    return false;
    215216}
     217#endif /* unused */
    216218
    217219
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