Changeset 107859 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Jan 20, 2025 5:20:14 PM (5 weeks ago)
- svn:sync-xref-src-repo-rev:
- 167061
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/Dev3C501.cpp
r106061 r107859 435 435 uint32_t cMsLinkUpDelay; 436 436 /** The device instance number (for logging). */ 437 uint32_tiInstance;437 int32_t iInstance; 438 438 439 439 STAMCOUNTER StatReceiveBytes; … … 1362 1362 } 1363 1363 1364 static int elIoWrite(PPDMDEVINS pDevIns, PELNKSTATE pThis, uint32_t addr, uint 32_t val)1364 static int elIoWrite(PPDMDEVINS pDevIns, PELNKSTATE pThis, uint32_t addr, uint8_t val) 1365 1365 { 1366 1366 int reg = addr & 0xf; … … 1438 1438 } 1439 1439 1440 static uint 32_t elIoRead(PPDMDEVINS pDevIns, PELNKSTATE pThis, uint32_t addr, int *pRC)1441 { 1442 uint 32_t val = UINT32_MAX;1440 static uint8_t elIoRead(PPDMDEVINS pDevIns, PELNKSTATE pThis, uint32_t addr, int *pRC) 1441 { 1442 uint8_t val = UINT8_MAX; 1443 1443 1444 1444 *pRC = VINF_SUCCESS; … … 1500 1500 elnkUpdateIrq(pDevIns, pThis); 1501 1501 1502 Log2Func(("#%d: addr=%#06x val=%#0 4x\n", pThis->iInstance, addr, val & 0xff));1502 Log2Func(("#%d: addr=%#06x val=%#02x\n", pThis->iInstance, addr, val)); 1503 1503 return val; 1504 1504 } … … 1558 1558 { 1559 1559 case 1: 1560 rc = elIoWrite(pDevIns, pThis, Port, RT_LO BYTE(u32));1560 rc = elIoWrite(pDevIns, pThis, Port, RT_LO_U8(RT_LO_U16(u32))); 1561 1561 break; 1562 1562 case 2: 1563 1563 /* Manually split word access. */ 1564 rc = elIoWrite(pDevIns, pThis, Port + 0, RT_LO BYTE(u32));1564 rc = elIoWrite(pDevIns, pThis, Port + 0, RT_LO_U8(RT_LO_U16(u32))); 1565 1565 if (!RT_SUCCESS(rc)) 1566 1566 break; 1567 rc = elIoWrite(pDevIns, pThis, Port + 1, RT_HI BYTE(u32));1567 rc = elIoWrite(pDevIns, pThis, Port + 1, RT_HI_U8(RT_LO_U16(u32))); 1568 1568 break; 1569 1569 default: … … 2485 2485 * We use our own critical section (historical reasons). 2486 2486 */ 2487 rc = PDMDevHlpCritSectInit(pDevIns, &pThis->CritSect, RT_SRC_POS, "3C501#% u", iInstance);2487 rc = PDMDevHlpCritSectInit(pDevIns, &pThis->CritSect, RT_SRC_POS, "3C501#%d", iInstance); 2488 2488 AssertRCReturn(rc, rc); 2489 2489 rc = PDMDevHlpSetDeviceCritSect(pDevIns, &pThis->CritSect); … … 2587 2587 * Register statistics counters. 2588 2588 */ 2589 PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatReceiveBytes, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES, "Amount of data received", "/Public/Net/EtherLink% u/BytesReceived", iInstance);2590 PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatTransmitBytes, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES, "Amount of data transmitted", "/Public/Net/EtherLink% u/BytesTransmitted", iInstance);2589 PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatReceiveBytes, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES, "Amount of data received", "/Public/Net/EtherLink%d/BytesReceived", iInstance); 2590 PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatTransmitBytes, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES, "Amount of data transmitted", "/Public/Net/EtherLink%d/BytesTransmitted", iInstance); 2591 2591 2592 2592 PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatReceiveBytes, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES, "Amount of data received", "/Devices/EtherLink%d/ReceiveBytes", iInstance); … … 2612 2612 PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatDropPktZeroLen, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Dropped zero length packet", "/Devices/EtherLink%d/DropPktZeroLen", iInstance); 2613 2613 PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatDropPktVMNotRunning,STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Dropped packet, VM not running", "/Devices/EtherLink%d/DropPktVMNotRunning", iInstance); 2614 PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatDropPktNoLink, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Dropped packet, no link", "/Devices/EtherLink%d/DropPktNoLink", iInstance);2614 PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatDropPktNoLink, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Dropped packet, no link", "/Devices/EtherLink%d/DropPktNoLink", iInstance); 2615 2615 PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatDropPktStaleRcv, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Dropped packet, status register unread", "/Devices/EtherLink%d/DropPktStaleRcv", iInstance); 2616 2616 #endif /* VBOX_WITH_STATISTICS */
Note:
See TracChangeset
for help on using the changeset viewer.