VirtualBox

Changeset 7795 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 8, 2008 12:02:15 PM (17 years ago)
Author:
vboxsync
Message:

PCNet: allow the guest to disable/enable the private interface

File:
1 edited

Legend:

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

    r7772 r7795  
    13611361}
    13621362
     1363/**
     1364 * Enable/disable the private guest interface.
     1365 */
     1366static void pcnetEnablePrivateIf(PCNetState *pData)
     1367{
     1368    bool fPrivIfEnabled =       pData->pSharedMMIOHC
     1369                          && !!(pData->CTXSUFF(pSharedMMIO)->fFlags & PCNET_GUEST_FLAGS_ADMIT_GUEST);
     1370    if (fPrivIfEnabled != pData->fPrivIfEnabled)
     1371    {
     1372        pData->fPrivIfEnabled = fPrivIfEnabled;
     1373        LogRel(("PCNet#%d: %s private interface\n", PCNET_INST_NR, fPrivIfEnabled ? "Enabling" : "Disabling"));
     1374    }
     1375}
     1376
    13631377#ifdef IN_RING3
    13641378#ifdef PCNET_NO_POLLING
     
    14761490} while (0)
    14771491
    1478     bool fPrivIfEnabled =       pData->pSharedMMIOHC
    1479                           && !!(pData->pSharedMMIOHC->fFlags & PCNET_GUEST_FLAGS_ADMIT_GUEST);
    1480     if (fPrivIfEnabled != pData->fPrivIfEnabled)
    1481     {
    1482         pData->fPrivIfEnabled = fPrivIfEnabled;
    1483         LogRel(("PCNet#%d: %s private interface\n", PCNET_INST_NR, fPrivIfEnabled ? "Enabling" : "Disabling"));
    1484     }
     1492    pcnetEnablePrivateIf(pData);
     1493
    14851494    if (BCR_SSIZE32(pData))
    14861495    {
     
    15351544    if (!CSR_DRX(pData))
    15361545        pData->aCSR[0] |= 0x0020;    /* set RXON */
     1546    pcnetEnablePrivateIf(pData);
    15371547    pData->aCSR[0] &= ~0x0004;       /* clear STOP bit */
    15381548    pData->aCSR[0] |=  0x0002;       /* STRT */
     
    15491559    pData->aCSR[4] &= ~0x02c2;
    15501560    pData->aCSR[5] &= ~0x0011;
     1561    pcnetEnablePrivateIf(pData);
    15511562    pcnetPollTimer(pData);
    15521563}
     
    15611572}
    15621573#endif
     1574
    15631575
    15641576/**
     
    44114423    pData->pXmitQueueGC  = PDMQueueGCPtr(pData->pXmitQueueHC);
    44124424    pData->pCanRxQueueGC = PDMQueueGCPtr(pData->pCanRxQueueHC);
    4413     pData->pSharedMMIOGC += offDelta;
     4425    if (pData->pSharedMMIOHC)
     4426        pData->pSharedMMIOGC += offDelta;
    44144427#ifdef PCNET_NO_POLLING
    44154428    *(RTHCUINTPTR *)&pData->pfnEMInterpretInstructionGC += offDelta;
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