VirtualBox

Changeset 39011 in vbox


Ignore:
Timestamp:
Oct 18, 2011 6:51:21 AM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
74416
Message:

e1000: CG/R0 config parameters (#5923), info callback

File:
1 edited

Legend:

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

    r38980 r39011  
    55555555
    55565556/**
     5557 * Status info callback.
     5558 *
     5559 * @param   pDevIns     The device instance.
     5560 * @param   pHlp        The output helpers.
     5561 * @param   pszArgs     The arguments.
     5562 */
     5563static DECLCALLBACK(void) e1kInfo(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
     5564{
     5565    E1KSTATE* pState = PDMINS_2_DATA(pDevIns, E1KSTATE*);
     5566    int       i;
     5567    bool        fRcvRing = false;
     5568    bool        fXmtRing = false;
     5569
     5570    /*
     5571     * Parse args.
     5572     */
     5573    if (pszArgs)
     5574    {
     5575        fRcvRing = strstr(pszArgs, "verbose") || strstr(pszArgs, "rcv");
     5576        fXmtRing = strstr(pszArgs, "verbose") || strstr(pszArgs, "xmt");
     5577    }
     5578
     5579    /*
     5580     * Show info.
     5581     */
     5582    pHlp->pfnPrintf(pHlp, "E1000 #%d: port=%RTiop mmio=%RX32 mac-cfg=%RTmac %s%s%s\n",
     5583                    pDevIns->iInstance, pState->addrIOPort, pState->addrMMReg,
     5584                    &pState->macConfigured, g_Chips[pState->eChip].pcszName,
     5585                    pState->fGCEnabled ? " GC" : "", pState->fR0Enabled ? " R0" : "");
     5586
     5587    e1kCsEnter(pState, VERR_INTERNAL_ERROR); /* Not sure why but PCNet does it */
     5588
     5589    for (i = 0; i < E1K_NUM_OF_32BIT_REGS; ++i)
     5590        pHlp->pfnPrintf(pHlp, "%8.8s = %08x\n", s_e1kRegMap[i].abbrev, pState->auRegs[i]);
     5591
     5592    for (i = 0; i < RT_ELEMENTS(pState->aRecAddr.array); i++)
     5593    {
     5594        E1KRAELEM* ra = pState->aRecAddr.array + i;
     5595        if (ra->ctl & RA_CTL_AV)
     5596        {
     5597            const char *pcszTmp;
     5598            switch (ra->ctl & RA_CTL_AS)
     5599            {
     5600                case 0:  pcszTmp = "DST"; break;
     5601                case 1:  pcszTmp = "SRC"; break;
     5602                default: pcszTmp = "reserved";
     5603            }
     5604            pHlp->pfnPrintf(pHlp, "RA%02d: %s %RTmac\n", i, pcszTmp, ra->addr);
     5605        }
     5606    }
     5607
     5608
     5609#ifdef E1K_INT_STATS
     5610    pHlp->pfnPrintf(pHlp, "Interrupt attempts: %d\n", pState->uStatIntTry);
     5611    pHlp->pfnPrintf(pHlp, "Interrupts raised : %d\n", pState->uStatInt);
     5612    pHlp->pfnPrintf(pHlp, "Interrupts lowered: %d\n", pState->uStatIntLower);
     5613    pHlp->pfnPrintf(pHlp, "Interrupts delayed: %d\n", pState->uStatIntDly);
     5614    pHlp->pfnPrintf(pHlp, "Disabled delayed:   %d\n", pState->uStatDisDly);
     5615    pHlp->pfnPrintf(pHlp, "Interrupts skipped: %d\n", pState->uStatIntSkip);
     5616    pHlp->pfnPrintf(pHlp, "Masked interrupts : %d\n", pState->uStatIntMasked);
     5617    pHlp->pfnPrintf(pHlp, "Early interrupts  : %d\n", pState->uStatIntEarly);
     5618    pHlp->pfnPrintf(pHlp, "Late interrupts   : %d\n", pState->uStatIntLate);
     5619    pHlp->pfnPrintf(pHlp, "Lost interrupts   : %d\n", pState->iStatIntLost);
     5620    pHlp->pfnPrintf(pHlp, "Interrupts by RX  : %d\n", pState->uStatIntRx);
     5621    pHlp->pfnPrintf(pHlp, "Interrupts by TX  : %d\n", pState->uStatIntTx);
     5622    pHlp->pfnPrintf(pHlp, "Interrupts by ICS : %d\n", pState->uStatIntICS);
     5623    pHlp->pfnPrintf(pHlp, "Interrupts by RDTR: %d\n", pState->uStatIntRDTR);
     5624    pHlp->pfnPrintf(pHlp, "Interrupts by RDMT: %d\n", pState->uStatIntRXDMT0);
     5625    pHlp->pfnPrintf(pHlp, "Interrupts by TXQE: %d\n", pState->uStatIntTXQE);
     5626    pHlp->pfnPrintf(pHlp, "TX int delay asked: %d\n", pState->uStatTxIDE);
     5627    pHlp->pfnPrintf(pHlp, "TX no report asked: %d\n", pState->uStatTxNoRS);
     5628    pHlp->pfnPrintf(pHlp, "TX abs timer expd : %d\n", pState->uStatTAD);
     5629    pHlp->pfnPrintf(pHlp, "TX int timer expd : %d\n", pState->uStatTID);
     5630    pHlp->pfnPrintf(pHlp, "RX abs timer expd : %d\n", pState->uStatRAD);
     5631    pHlp->pfnPrintf(pHlp, "RX int timer expd : %d\n", pState->uStatRID);
     5632    pHlp->pfnPrintf(pHlp, "TX CTX descriptors: %d\n", pState->uStatDescCtx);
     5633    pHlp->pfnPrintf(pHlp, "TX DAT descriptors: %d\n", pState->uStatDescDat);
     5634    pHlp->pfnPrintf(pHlp, "TX LEG descriptors: %d\n", pState->uStatDescLeg);
     5635    pHlp->pfnPrintf(pHlp, "Received frames   : %d\n", pState->uStatRxFrm);
     5636    pHlp->pfnPrintf(pHlp, "Transmitted frames: %d\n", pState->uStatTxFrm);
     5637#endif /* E1K_INT_STATS */
     5638
     5639    e1kCsLeave(pState);
     5640}
     5641
     5642/**
    55575643 * Sets 8-bit register in PCI configuration space.
    55585644 * @param   refPciDev   The PCI device.
     
    56835769     * Validate configuration.
    56845770     */
    5685     if (!CFGMR3AreValuesValid(pCfg, "MAC\0" "CableConnected\0" "AdapterType\0" "LineSpeed\0"))
     5771    if (!CFGMR3AreValuesValid(pCfg, "MAC\0" "CableConnected\0" "AdapterType\0" "LineSpeed\0" "GCEnabled\0" "R0Enabled\0"))
    56865772        return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES,
    56875773                                N_("Invalid configuration for E1000 device"));
    56885774
    56895775    /** @todo: LineSpeed unused! */
     5776
     5777    pState->fR0Enabled   = true;
     5778    pState->fGCEnabled   = true;
    56905779
    56915780    /* Get config params */
     
    57045793                                N_("Configuration error: Failed to get the value of 'AdapterType'"));
    57055794    Assert(pState->eChip <= E1K_CHIP_82545EM);
     5795    rc = CFGMR3QueryBoolDef(pCfg, "GCEnabled", &pState->fGCEnabled, true);
     5796    if (RT_FAILURE(rc))
     5797        return PDMDEV_SET_ERROR(pDevIns, rc,
     5798                                N_("Configuration error: Failed to get the value of 'GCEnabled'"));
     5799
     5800    rc = CFGMR3QueryBoolDef(pCfg, "R0Enabled", &pState->fR0Enabled, true);
     5801    if (RT_FAILURE(rc))
     5802        return PDMDEV_SET_ERROR(pDevIns, rc,
     5803                                N_("Configuration error: Failed to get the value of 'R0Enabled'"));
    57065804
    57075805    E1kLog(("%s Chip=%s\n", INSTANCE(pState), g_Chips[pState->eChip].pcszName));
    57085806
    57095807    /* Initialize state structure */
    5710     pState->fR0Enabled   = true;
    5711     pState->fGCEnabled   = true;
    57125808    pState->pDevInsR3    = pDevIns;
    57135809    pState->pDevInsR0    = PDMDEVINS_2_R0PTR(pDevIns);
     
    58985994    pState->pLUTimerR0 = TMTimerR0Ptr(pState->pLUTimerR3);
    58995995    pState->pLUTimerRC = TMTimerRCPtr(pState->pLUTimerR3);
     5996
     5997    /* Register the info item */
     5998    char szTmp[20];
     5999    RTStrPrintf(szTmp, sizeof(szTmp), "e1k%d", iInstance);
     6000    PDMDevHlpDBGFInfoRegister(pDevIns, szTmp, "E1000 info.", e1kInfo);
    59006001
    59016002    /* Status driver */
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