VirtualBox

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


Ignore:
Timestamp:
Jan 20, 2025 5:20:14 PM (5 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167061
Message:

Dev3C501: Reduced Parfait complaints.

File:
1 edited

Legend:

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

    r106061 r107859  
    435435    uint32_t                            cMsLinkUpDelay;
    436436    /** The device instance number (for logging). */
    437     uint32_t                            iInstance;
     437    int32_t                             iInstance;
    438438
    439439    STAMCOUNTER                         StatReceiveBytes;
     
    13621362}
    13631363
    1364 static int elIoWrite(PPDMDEVINS pDevIns, PELNKSTATE pThis, uint32_t addr, uint32_t val)
     1364static int elIoWrite(PPDMDEVINS pDevIns, PELNKSTATE pThis, uint32_t addr, uint8_t val)
    13651365{
    13661366    int     reg = addr & 0xf;
     
    14381438}
    14391439
    1440 static uint32_t elIoRead(PPDMDEVINS pDevIns, PELNKSTATE pThis, uint32_t addr, int *pRC)
    1441 {
    1442     uint32_t val = UINT32_MAX;
     1440static uint8_t elIoRead(PPDMDEVINS pDevIns, PELNKSTATE pThis, uint32_t addr, int *pRC)
     1441{
     1442    uint8_t val = UINT8_MAX;
    14431443
    14441444    *pRC = VINF_SUCCESS;
     
    15001500    elnkUpdateIrq(pDevIns, pThis);
    15011501
    1502     Log2Func(("#%d: addr=%#06x val=%#04x\n", pThis->iInstance, addr, val & 0xff));
     1502    Log2Func(("#%d: addr=%#06x val=%#02x\n", pThis->iInstance, addr, val));
    15031503    return val;
    15041504}
     
    15581558    {
    15591559        case 1:
    1560             rc = elIoWrite(pDevIns, pThis, Port, RT_LOBYTE(u32));
     1560            rc = elIoWrite(pDevIns, pThis, Port, RT_LO_U8(RT_LO_U16(u32)));
    15611561            break;
    15621562        case 2:
    15631563            /* Manually split word access. */
    1564             rc = elIoWrite(pDevIns, pThis, Port + 0, RT_LOBYTE(u32));
     1564            rc = elIoWrite(pDevIns, pThis, Port + 0, RT_LO_U8(RT_LO_U16(u32)));
    15651565            if (!RT_SUCCESS(rc))
    15661566                break;
    1567             rc = elIoWrite(pDevIns, pThis, Port + 1, RT_HIBYTE(u32));
     1567            rc = elIoWrite(pDevIns, pThis, Port + 1, RT_HI_U8(RT_LO_U16(u32)));
    15681568            break;
    15691569        default:
     
    24852485     * We use our own critical section (historical reasons).
    24862486     */
    2487     rc = PDMDevHlpCritSectInit(pDevIns, &pThis->CritSect, RT_SRC_POS, "3C501#%u", iInstance);
     2487    rc = PDMDevHlpCritSectInit(pDevIns, &pThis->CritSect, RT_SRC_POS, "3C501#%d", iInstance);
    24882488    AssertRCReturn(rc, rc);
    24892489    rc = PDMDevHlpSetDeviceCritSect(pDevIns, &pThis->CritSect);
     
    25872587     * Register statistics counters.
    25882588     */
    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);
    25912591
    25922592    PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatReceiveBytes,       STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,          "Amount of data received",                "/Devices/EtherLink%d/ReceiveBytes", iInstance);
     
    26122612    PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatDropPktZeroLen,     STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES,     "Dropped zero length packet",             "/Devices/EtherLink%d/DropPktZeroLen", iInstance);
    26132613    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);
    26152615    PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatDropPktStaleRcv,    STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES,     "Dropped packet, status register unread", "/Devices/EtherLink%d/DropPktStaleRcv", iInstance);
    26162616#endif /* VBOX_WITH_STATISTICS */
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