Changeset 63478 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Aug 15, 2016 2:04:10 PM (8 years ago)
- Location:
- trunk/src/VBox/Devices/Network
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevE1000.cpp
r63218 r63478 218 218 #define E1K_CHIP_82545EM 2 219 219 220 #ifdef IN_RING3 220 221 /** Different E1000 chips. */ 221 222 static const struct E1kChips … … 226 227 uint16_t uPCISubsystemId; 227 228 const char *pcszName; 228 } g_ Chips[] =229 } g_aChips[] = 229 230 { 230 231 /* Vendor Device SSVendor SubSys Name */ 231 232 { 0x8086, 232 233 /* Temporary code, as MSI-aware driver dislike 0x100E. How to do that right? */ 233 # ifdef E1K_WITH_MSI234 # ifdef E1K_WITH_MSI 234 235 0x105E, 235 # else236 # else 236 237 0x100E, 237 # endif238 # endif 238 239 0x8086, 0x001E, "82540EM" }, /* Intel 82540EM-A in Intel PRO/1000 MT Desktop */ 239 240 { 0x8086, 0x1004, 0x8086, 0x1004, "82543GC" }, /* Intel 82543GC in Intel PRO/1000 T Server */ 240 241 { 0x8086, 0x100F, 0x15AD, 0x0750, "82545EM" } /* Intel 82545EM-A in VMWare Network Adapter */ 241 242 }; 243 #endif /* IN_RING3 */ 242 244 243 245 … … 1552 1554 } 1553 1555 1556 #ifdef IN_RING3 1554 1557 /** 1555 1558 * Cancel a timer. … … 1568 1571 RT_NOREF1(pThis); 1569 1572 } 1573 #endif /* IN_RING3 */ 1570 1574 1571 1575 #define e1kCsEnter(ps, rc) PDMCritSectEnter(&ps->cs, rc) … … 1748 1752 } 1749 1753 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 */ 1750 1756 /** 1751 1757 * Dump receive descriptor to debug log. … … 1777 1783 E1K_SPEC_PRI(pDesc->status.u16Special))); 1778 1784 } 1785 #endif /* E1K_WITH_RXD_CACHE && IN_RING3 */ 1779 1786 1780 1787 /** … … 1954 1961 } 1955 1962 1963 #ifdef IN_RING3 /* currently only used in ring-3 due to stack space requirements of the caller */ 1956 1964 /** 1957 1965 * Advance the head pointer of the receive descriptor queue. … … 1992 2000 //e1kCsLeave(pThis); 1993 2001 } 2002 #endif /* IN_RING3 */ 1994 2003 1995 2004 #ifdef E1K_WITH_RXD_CACHE 2005 1996 2006 /** 1997 2007 * Return the number of RX descriptor that belong to the hardware. … … 2087 2097 } 2088 2098 2099 # ifdef IN_RING3 /* currently only used in ring-3 due to stack space requirements of the caller */ 2100 2089 2101 /** 2090 2102 * Obtain the next RX descriptor from RXD cache, fetching descriptors from the … … 2111 2123 return NULL; 2112 2124 } 2125 2113 2126 2114 2127 /** … … 2136 2149 } 2137 2150 2138 # ifdef IN_RING3 /* currently only used in ring-3 due to stack space requirements of the caller */2139 2151 /** 2140 2152 * Store a fragment of received packet at the specifed address. … … 2154 2166 STAM_PROFILE_ADV_STOP(&pThis->StatReceiveStore, a); 2155 2167 } 2168 2156 2169 # endif 2157 2170 … … 2206 2219 STAM_PROFILE_ADV_STOP(&pThis->StatReceiveStore, a); 2207 2220 } 2221 2208 2222 #endif /* !E1K_WITH_RXD_CACHE */ 2209 2223 … … 3244 3258 # ifndef E1K_NO_TAD 3245 3259 e1kCancelTimer(pThis, pThis->CTX_SUFF(pTADTimer)); 3246 # endif /* E1K_NO_TAD */3260 # endif 3247 3261 e1kRaiseInterrupt(pThis, ICR_TXDW); 3248 3262 } … … 4451 4465 /* Cancel both timers if armed and fire immediately. */ 4452 4466 e1kCancelTimer(pThis, pThis->CTX_SUFF(pTADTimer)); 4453 # endif /* E1K_NO_TAD */4467 # endif 4454 4468 #endif /* E1K_USE_TX_TIMERS */ 4455 4469 E1K_INC_ISTAT_CNT(pThis->uStatIntTx); … … 7018 7032 pHlp->pfnPrintf(pHlp, "E1000 #%d: port=%RTiop mmio=%RGp mac-cfg=%RTmac %s%s%s\n", 7019 7033 pDevIns->iInstance, pThis->IOPortBase, pThis->addrMMReg, 7020 &pThis->macConfigured, g_ Chips[pThis->eChip].pcszName,7034 &pThis->macConfigured, g_aChips[pThis->eChip].pcszName, 7021 7035 pThis->fRCEnabled ? " GC" : "", pThis->fR0Enabled ? " R0" : ""); 7022 7036 … … 7375 7389 static DECLCALLBACK(void) e1kConfigurePciDev(PPCIDEVICE pPciDev, E1KCHIP eChip) 7376 7390 { 7377 Assert(eChip < RT_ELEMENTS(g_ Chips));7391 Assert(eChip < RT_ELEMENTS(g_aChips)); 7378 7392 /* 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); 7383 7397 7384 7398 PCIDevSetWord( pPciDev, VBOX_PCI_COMMAND, 0x0000); … … 7568 7582 7569 7583 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, 7571 7585 pThis->fEthernetCRC ? "on" : "off", 7572 7586 pThis->fGSOEnabled ? "enabled" : "disabled", -
trunk/src/VBox/Devices/Network/DevVirtioNet.cpp
r62962 r63478 274 274 AssertCompileSize(VNETCTLHDR, 2); 275 275 276 #ifdef IN_RING3 277 276 278 /** Returns true if large packets are written into several RX buffers. */ 277 279 DECLINLINE(bool) vnetMergeableRxBuffers(PVNETSTATE pThis) … … 289 291 vpciCsLeave(&pThis->VPCI); 290 292 } 293 294 #endif /* IN_RING3 */ 291 295 292 296 DECLINLINE(int) vnetCsRxEnter(PVNETSTATE pThis, int rcBusy) … … 307 311 } 308 312 313 #ifdef IN_RING3 309 314 /** 310 315 * Dump a packet to debug log. … … 317 322 DECLINLINE(void) vnetPacketDump(PVNETSTATE pThis, const uint8_t *pbPacket, size_t cb, const char *pszText) 318 323 { 319 # ifdef DEBUG324 # ifdef DEBUG 320 325 Log(("%s %s packet #%d (%d bytes):\n", 321 326 INSTANCE(pThis), pszText, ++pThis->u32PktNo, cb)); 322 327 Log3(("%.*Rhxd\n", cb, pbPacket)); 323 # else328 # else 324 329 RT_NOREF4(pThis, pbPacket, cb, pszText); 325 #endif 326 } 330 # endif 331 } 332 #endif /* IN_RING3 */ 327 333 328 334 /** -
trunk/src/VBox/Devices/Network/DrvIntNet.cpp
r63461 r63478 269 269 * @param pThis The instance data.. 270 270 */ 271 DECLINLINE(int) drv IntNetSignalXmit(PDRVINTNET pThis)271 DECLINLINE(int) drvR0IntNetSignalXmit(PDRVINTNET pThis) 272 272 { 273 273 /// @todo if (!ASMAtomicXchgBool(&pThis->fXmitSignalled, true)) - needs careful optimizing. … … 279 279 return VERR_TRY_AGAIN; 280 280 } 281 #endif 281 #endif /* !IN_RING3 */ 282 282 283 283 … … 306 306 { 307 307 ASMAtomicUoWriteBool(&pThis->fXmitProcessRing, true); 308 drv IntNetSignalXmit(pThis);308 drvR0IntNetSignalXmit(pThis); 309 309 rc = VINF_SUCCESS; 310 310 } … … 351 351 rc = VERR_TRY_AGAIN; 352 352 #else /* IN_RING0 */ 353 rc = drv IntNetSignalXmit(pThis);353 rc = drvR0IntNetSignalXmit(pThis); 354 354 #endif /* IN_RING0 */ 355 355 } … … 381 381 PPDMSCATTERGATHER pSgBuf = &pThis->u.Sg; 382 382 if (RT_UNLIKELY(pSgBuf->fFlags != 0)) 383 return drv IntNetSignalXmit(pThis);383 return drvR0IntNetSignalXmit(pThis); 384 384 #endif 385 385 … … 444 444 { 445 445 pThis->fXmitProcessRing = true; 446 rc = drv IntNetSignalXmit(pThis);446 rc = drvR0IntNetSignalXmit(pThis); 447 447 } 448 448 else -
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r63214 r63478 1145 1145 else 1146 1146 LogRel(("NAT: DNS server list is empty (2)\n")); 1147 #else 1148 RT_NOREF(hDynStor); 1147 1149 #endif 1148 1150 drvNATUpdateDNS(pThis, /* fFlapLink */ true); -
trunk/src/VBox/Devices/Network/SrvIntNetR0.cpp
r63458 r63478 897 897 return Addr.u == UINT32_MAX; 898 898 } 899 #endif 899 #endif /* unused */ 900 900 901 901 … … 1032 1032 return intnetR0IfAddrCacheLookup(pCache, pAddr, cbAddr); 1033 1033 } 1034 1035 1034 1036 1035 #if 0 /* unused */ … … 1220 1219 1221 1220 #if 0 /* unused */ 1222 1223 1221 /** 1224 1222 * Deletes the address from all the interface caches except the specified one. … … 1252 1250 RTSpinlockRelease(pNetwork->hAddrSpinlock); 1253 1251 } 1254 1255 #endif 1252 #endif /* unused */ 1256 1253 1257 1254 -
trunk/src/VBox/Devices/Network/slirp/ip_icmp.c
r63459 r63478 64 64 /* The message sent when emulating PING */ 65 65 /* Be nice and tell them it's just a psuedo-ping packet */ 66 #if 0 66 #if 0 /* unused */ 67 67 static const char icmp_ping_msg[] = "This is a psuedo-PING packet used by Slirp to emulate ICMP ECHO-REQUEST packets.\n"; 68 68 #endif -
trunk/src/VBox/Devices/Network/slirp/tftp.c
r63014 r63478 196 196 197 197 198 #if 0 /* unused */ 198 199 DECLINLINE(bool) tftpIsAcceptableOption(const char *pszOptionName) 199 200 { … … 214 215 return false; 215 216 } 217 #endif /* unused */ 216 218 217 219
Note:
See TracChangeset
for help on using the changeset viewer.