VirtualBox

Changeset 76766 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jan 11, 2019 8:56:40 AM (6 years ago)
Author:
vboxsync
Message:

PCnet: Improved loopback mode emulation.

File:
1 edited

Legend:

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

    r76765 r76766  
    293293 * There were also non-busmastering LANCE adapters, such as the BICC 4110-1, DEC DEPCA,
    294294 * or NTI 16. Those are uninteresting.
    295  * 
     295 *
    296296 * Newer adapters based on the integrated PCnet-ISA (Am79C960) and later have a fixed
    297297 * register layout compatible with the NE2100. However, they may still require different
     
    18741874 * Write data into guest receive buffers.
    18751875 */
    1876 static void pcnetReceiveNoSync(PPCNETSTATE pThis, const uint8_t *buf, size_t cbToRecv, bool fAddFCS)
     1876static void pcnetReceiveNoSync(PPCNETSTATE pThis, const uint8_t *buf, size_t cbToRecv, bool fAddFCS, bool fLoopback)
    18771877{
    18781878    PPDMDEVINS pDevIns = PCNETSTATE_2_DEVINS(pThis);
     
    19591959
    19601960            if (!fStrip) {
    1961                 while (cbToRecv < 60)
    1962                     src[cbToRecv++] = 0;
     1961                /* In loopback mode, Runt Packed Accept is always enabled internally;
     1962                 * don't do any padding because guest may be looping back very short packets.
     1963                 */
     1964                if (!fLoopback)
     1965                    while (cbToRecv < 60)
     1966                        src[cbToRecv++] = 0;
    19631967
    19641968                if (fAddFCS)
     
    21092113    /* see description of TXDPOLL:
    21102114     * ``transmit polling will take place following receive activities'' */
    2111     pcnetPollRxTx(pThis);
     2115    if (!fLoopback)
     2116        pcnetPollRxTx(pThis);
    21122117    pcnetUpdateIrq(pThis);
    21132118}
     
    22342239            pcnetRdtePoll(pThis);
    22352240
    2236         pcnetReceiveNoSync(pThis, pThis->abLoopBuf, pSgBuf->cbUsed, true /* fAddFCS */);
     2241        pcnetReceiveNoSync(pThis, pThis->abLoopBuf, pSgBuf->cbUsed, true /* fAddFCS */, fLoopback);
    22372242        pThis->Led.Actual.s.fReading = 0;
    22382243        rc = VINF_SUCCESS;
     
    46764681        if (cb > 70) /* unqualified guess */
    46774682            pThis->Led.Asserted.s.fReading = pThis->Led.Actual.s.fReading = 1;
    4678         pcnetReceiveNoSync(pThis, (const uint8_t *)pvBuf, cb, fAddFCS);
     4683        pcnetReceiveNoSync(pThis, (const uint8_t *)pvBuf, cb, fAddFCS, false);
    46794684        pThis->Led.Actual.s.fReading = 0;
    46804685    }
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