VirtualBox

Changeset 927 in vbox


Ignore:
Timestamp:
Feb 15, 2007 3:52:58 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
18660
Message:

Workaround for Windows NT4 pcnet problems. Also tighten packet
size overflow check.

File:
1 edited

Legend:

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

    r813 r927  
    130130#if HC_ARCH_BITS == 64
    131131    uint32_t Alignment;
    132 #endif 
     132#endif
    133133    /** The virtual address of the frame (copied or direct pointer) */
    134134    RTR3PTR  pvBuf;
     
    219219#if HC_ARCH_BITS == 64 || GC_ARCH_BITS == 64
    220220    RTUINT                              Alignment;
    221 #endif 
     221#endif
    222222    /** The configured MAC address. */
    223223    PDMMAC                              MacConfigured;
     
    20822082                    }
    20832083                }
     2084                else if (cb == 4096)
     2085                {
     2086                    /* The Windows NT4 pcnet driver sometimes marks the first
     2087                     * unused descriptor as owned by us. Ignore that (by
     2088                     * passing it back). Do not update the ring counter in this
     2089                     * case (otherwise that driver becomes even more confused,
     2090                     * which causes transmit to stall for about 10 seconds).
     2091                     * This is just a workaround, not a final solution. */
     2092                    LogRel(("PCNET: pcnetAsyncTransmit: illegal 4kb frame -> ignoring\n"));
     2093                    pcnetTmdStorePassHost(pData, &tmd, PHYSADDR(pData, CSR_CXDA(pData)));
     2094                    break;
     2095                }
    20842096                else
    20852097                {
     
    21072119             * Read TMDs until end-of-packet or tdte poll fails (underflow).
    21082120             */
    2109             const unsigned cbMaxFrame = 4096;
     2121            const unsigned cbMaxFrame = 1536;
    21102122            bool fDropFrame = false;
    21112123            unsigned cb = 4096 - tmd.tmd1.bcnt;
     
    22192231    } while (CSR_TXON(pData));          /* transfer on */
    22202232
    2221     if (cFlushIrq) 
     2233    if (cFlushIrq)
    22222234    {
    22232235        STAM_COUNTER_INC(&pData->aStatXmitFlush[RT_MIN(cFlushIrq, ELEMENTS(pData->aStatXmitFlush)) - 1]);
     
    42604272    PDMDevHlpSTAMRegisterF(pDevIns, &pData->StatTmdStoreGC,         STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_TICKS_PER_CALL, "Profiling PCNet TmdStore in GC",     "/Devices/PCNet%d/TmdStoreGC", iInstance);
    42614273    PDMDevHlpSTAMRegisterF(pDevIns, &pData->StatTmdStoreHC,         STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_TICKS_PER_CALL, "Profiling PCNet TmdStore in HC",     "/Devices/PCNet%d/TmdStoreHC", iInstance);
    4262    
     4274
    42634275    unsigned i;
    42644276    for (i = 0; i < ELEMENTS(pData->aStatXmitFlush) - 1; i++)
     
    42714283
    42724284    PDMDevHlpSTAMRegisterF(pDevIns, &pData->StatXmitSkipCurrent,    STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES,    "",                                    "/Devices/PCNet%d/Xmit/Skipped", iInstance, i + 1);
    4273    
     4285
    42744286    PDMDevHlpSTAMRegisterF(pDevIns, &pData->StatInterrupt,          STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_TICKS_PER_CALL, "Profiling PCNet interrupt checks",   "/Devices/PCNet%d/Interrupt", iInstance);
    42754287    PDMDevHlpSTAMRegisterF(pDevIns, &pData->StatPollTimer,          STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_TICKS_PER_CALL, "Profiling PCNet poll timer",         "/Devices/PCNet%d/PollTimer", iInstance);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette