VirtualBox

Changeset 545 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Feb 2, 2007 12:41:40 PM (18 years ago)
Author:
vboxsync
Message:

Added disabled option to postpone interrupts until we deliver the packets in R3.

File:
1 edited

Legend:

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

    r512 r545  
    161161    uint32_t                            iFrame;
    162162    /** The xmit buffer. */
    163     uint8_t                             abFrameBuf[12288];
     163    uint8_t                             abFrameBuf[PCNET_TRQUEUE_DEPTH*1536];
    164164    /** The recv buffer. */
    165165    uint8_t                             abRecvBuf[4096];
     
    534534*   Internal Functions                                                         *
    535535*******************************************************************************/
    536 #define PRINT_TMD(T) Log((    \
     536#define PRINT_TMD(T) Log2((    \
    537537        "TMD0 : TBADR=0x%08x\n" \
    538538        "TMD1 : OWN=%d, ERR=%d, FCS=%d, LTI=%d, "       \
     
    551551        (T)->tmd2.tdr, (T)->tmd2.trc))
    552552
    553 #define PRINT_RMD(R) Log((    \
     553#define PRINT_RMD(R) Log2((    \
    554554        "RMD0 : RBADR=0x%08x\n" \
    555555        "RMD1 : OWN=%d, ERR=%d, FRAM=%d, OFLO=%d, "     \
     
    17771777    }
    17781778
     1779#ifdef PCNET_DELAY_INT
     1780    /* Update TXSTRT and TINT. */
     1781    pData->aCSR[4] |=  0x0004;       /* set TXSTRT */
     1782    pData->aCSR[0] |= 0x0200;    /* set TINT */
     1783    pcnetUpdateIrq(pData);
     1784#endif
     1785
    17791786    pData->fTransmitting = false;
    17801787
     
    19631970
    19641971#ifdef PCNET_DEBUG_TMD
    1965         Log(("#%d TMDLOAD 0x%08x\n", PCNETSTATE_2_DEVINS(pData)->iInstance, PHYSADDR(pData, CSR_CXDA(pData))));
     1972        Log2(("#%d TMDLOAD 0x%08x\n", PCNETSTATE_2_DEVINS(pData)->iInstance, PHYSADDR(pData, CSR_CXDA(pData))));
    19661973        PRINT_TMD(&tmd);
    19671974#endif
     
    21022109            break;
    21032110        }
    2104 
    21052111        /* Update TDMD, TXSTRT and TINT. */
    21062112        pData->aCSR[0] &= ~0x0008;       /* clear TDMD */
     2113
     2114#ifndef PCNET_DELAY_INT
    21072115        pData->aCSR[4] |=  0x0004;       /* set TXSTRT */
    21082116        if (    !CSR_TOKINTD(pData)      /* Transmit OK Interrupt Disable, no infl. on errors. */
     
    21102118            ||  tmd.tmd1.err)
    21112119            pData->aCSR[0] |= 0x0200;    /* set TINT */
    2112 
     2120#endif
    21132121        STAM_COUNTER_INC(&pData->aStatXmitChainCounts[RT_MIN(cBuffers,
    21142122                                                      ELEMENTS(pData->aStatXmitChainCounts)) - 1]);
     
    21272135        PPDMQUEUEITEMCORE pItem = PDMQueueAlloc(CTXSUFF(pData->pXmitQueue));
    21282136        if (pItem)
     2137        {
    21292138# if 0 /* send before resuming guest (last argument isn't implemented yet and read as 0). */
    21302139            PDMQueueInsertEx(CTXSUFF(pData->pXmitQueue), pItem, 50000);
     
    21322141            PDMQueueInsert(CTXSUFF(pData->pXmitQueue), pItem);
    21332142# endif
     2143        }
    21342144    }
    21352145#endif
     
    23942404    u32RAP &= 0x7f;
    23952405#ifdef PCNET_DEBUG_BCR
    2396     Log(("#%d pcnetBCRWriteU16: u32RAP=%d val=0x%04x\n", PCNETSTATE_2_DEVINS(pData)->iInstance,
     2406    Log2(("#%d pcnetBCRWriteU16: u32RAP=%d val=0x%04x\n", PCNETSTATE_2_DEVINS(pData)->iInstance,
    23972407         u32RAP, val));
    23982408#endif
     
    25772587    }
    25782588#ifdef PCNET_DEBUG_BCR
    2579     Log(("#%d pcnetBCRReadU16: u32RAP=%d val=0x%04x\n", PCNETSTATE_2_DEVINS(pData)->iInstance,
     2589    Log2(("#%d pcnetBCRReadU16: u32RAP=%d val=0x%04x\n", PCNETSTATE_2_DEVINS(pData)->iInstance,
    25802590         u32RAP, val));
    25812591#endif
     
    26412651
    26422652#ifdef PCNET_DEBUG_IO
    2643     Log(("#%d pcnetIoportWriteU16: addr=0x%08x val=0x%04x\n", PCNETSTATE_2_DEVINS(pData)->iInstance,
     2653    Log2(("#%d pcnetIoportWriteU16: addr=0x%08x val=0x%04x\n", PCNETSTATE_2_DEVINS(pData)->iInstance,
    26442654         addr, val));
    26452655#endif
     
    26762686        {
    26772687            case 0x00: /* RDP */
    2678                 pcnetPollTimer(pData);
     2688                /** @note if we're not polling, then the guest will tell us when to poll by setting TDMD in CSR0 */
     2689                /** Polling is then useless here and very expensive. */
     2690                if (!CSR_DPOLL(pData))
     2691                    pcnetPollTimer(pData);
     2692
    26792693                val = pcnetCSRReadU16(pData, pData->u32RAP);
    26802694                if (pData->u32RAP == 0)  // pcnetUpdateIrq() already called by pcnetCSRReadU16()
     
    26972711skip_update_irq:
    26982712#ifdef PCNET_DEBUG_IO
    2699     Log(("#%d pcnetIoportReadU16: addr=0x%08x val=0x%04x\n", PCNETSTATE_2_DEVINS(pData)->iInstance,
     2713    Log2(("#%d pcnetIoportReadU16: addr=0x%08x val=0x%04x\n", PCNETSTATE_2_DEVINS(pData)->iInstance,
    27002714         addr, val & 0xffff));
    27012715#endif
     
    27082722
    27092723#ifdef PCNET_DEBUG_IO
    2710     Log(("#%d pcnetIoportWriteU32: addr=0x%08x val=0x%08x\n", PCNETSTATE_2_DEVINS(pData)->iInstance,
     2724    Log2(("#%d pcnetIoportWriteU32: addr=0x%08x val=0x%08x\n", PCNETSTATE_2_DEVINS(pData)->iInstance,
    27112725         addr, val));
    27122726#endif
     
    27332747        pcnetBCRWriteU16(pData, BCR_BSBC, pcnetBCRReadU16(pData, BCR_BSBC) | 0x0080);
    27342748#ifdef PCNET_DEBUG_IO
    2735         Log(("device switched into dword i/o mode\n"));
     2749        Log2(("device switched into dword i/o mode\n"));
    27362750#endif
    27372751    }
     
    27512765        {
    27522766            case 0x00: /* RDP */
    2753                 pcnetPollTimer(pData);
     2767                /** @note if we're not polling, then the guest will tell us when to poll by setting TDMD in CSR0 */
     2768                /** Polling is then useless here and very expensive. */
     2769                if (!CSR_DPOLL(pData))
     2770                    pcnetPollTimer(pData);
     2771
    27542772                val = pcnetCSRReadU16(pData, pData->u32RAP);
    27552773                if (pData->u32RAP == 0)  // pcnetUpdateIrq() already called by pcnetCSRReadU16()
     
    27722790skip_update_irq:
    27732791#ifdef PCNET_DEBUG_IO
    2774     Log(("#%d pcnetIoportReadU32: addr=0x%08x val=0x%08x\n", PCNETSTATE_2_DEVINS(pData)->iInstance,
     2792    Log2(("#%d pcnetIoportReadU32: addr=0x%08x val=0x%08x\n", PCNETSTATE_2_DEVINS(pData)->iInstance,
    27752793         addr, val));
    27762794#endif
     
    27812799{
    27822800#ifdef PCNET_DEBUG_IO
    2783     Log(("#%d pcnetMMIOWriteU8: addr=0x%08x val=0x%02x\n", PCNETSTATE_2_DEVINS(pData)->iInstance,
     2801    Log2(("#%d pcnetMMIOWriteU8: addr=0x%08x val=0x%02x\n", PCNETSTATE_2_DEVINS(pData)->iInstance,
    27842802         addr, val));
    27852803#endif
     
    27942812        val = pcnetAPROMReadU8(pData, addr);
    27952813#ifdef PCNET_DEBUG_IO
    2796     Log(("#%d pcnetMMIOReadU8: addr=0x%08x val=0x%02x\n", PCNETSTATE_2_DEVINS(pData)->iInstance,
     2814    Log2(("#%d pcnetMMIOReadU8: addr=0x%08x val=0x%02x\n", PCNETSTATE_2_DEVINS(pData)->iInstance,
    27972815         addr, val & 0xff));
    27982816#endif
     
    28032821{
    28042822#ifdef PCNET_DEBUG_IO
    2805     Log(("#%d pcnetMMIOWriteU16: addr=0x%08x val=0x%04x\n", PCNETSTATE_2_DEVINS(pData)->iInstance,
     2823    Log2(("#%d pcnetMMIOWriteU16: addr=0x%08x val=0x%04x\n", PCNETSTATE_2_DEVINS(pData)->iInstance,
    28062824         addr, val));
    28072825#endif
     
    28292847    }
    28302848#ifdef PCNET_DEBUG_IO
    2831     Log(("#%d pcnetMMIOReadU16: addr=0x%08x val = 0x%04x\n", PCNETSTATE_2_DEVINS(pData)->iInstance,
     2849    Log2(("#%d pcnetMMIOReadU16: addr=0x%08x val = 0x%04x\n", PCNETSTATE_2_DEVINS(pData)->iInstance,
    28322850         addr, val & 0xffff));
    28332851#endif
     
    28382856{
    28392857#ifdef PCNET_DEBUG_IO
    2840     Log(("#%d pcnetMMIOWriteU32: addr=0x%08x val=0x%08x\n", PCNETSTATE_2_DEVINS(pData)->iInstance,
     2858    Log2(("#%d pcnetMMIOWriteU32: addr=0x%08x val=0x%08x\n", PCNETSTATE_2_DEVINS(pData)->iInstance,
    28412859         addr, val));
    28422860#endif
     
    28702888    }
    28712889#ifdef PCNET_DEBUG_IO
    2872     Log(("#%d pcnetMMIOReadU32: addr=0x%08x val=0x%08x\n", PCNETSTATE_2_DEVINS(pData)->iInstance,
     2890    Log2(("#%d pcnetMMIOReadU32: addr=0x%08x val=0x%08x\n", PCNETSTATE_2_DEVINS(pData)->iInstance,
    28732891         addr, val));
    28742892#endif
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