VirtualBox

Changeset 20703 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Jun 19, 2009 9:04:22 AM (16 years ago)
Author:
vboxsync
Message:

DevPCNet.cpp: link down in function as I said.

File:
1 edited

Legend:

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

    r20631 r20703  
    42104210
    42114211/**
     4212 * Takes down the link temporarily if it's current status is up.
     4213 *
     4214 * This is used during restore and when replumbing the network link.
     4215 *
     4216 * The temporary link outage is supposed to indicate to the OS that all network
     4217 * connections have been lost and that it for instance is appropriate to
     4218 * renegotiate any DHCP lease.
     4219 *
     4220 * @param  pThis        The PCNet instance data.
     4221 */
     4222static void pcnetTempLinkDown(PCNetState *pThis)
     4223{
     4224    if (pThis->fLinkUp)
     4225    {
     4226        pThis->fLinkTempDown = true;
     4227        pThis->cLinkDownReported = 0;
     4228        pThis->aCSR[0] |= RT_BIT(15) | RT_BIT(13); /* ERR | CERR (this is probably wrong) */
     4229        pThis->Led.Asserted.s.fError = pThis->Led.Actual.s.fError = 1;
     4230        int rc = TMTimerSetMillies(pThis->pTimerRestore, 5000);
     4231        AssertRC(rc);
     4232    }
     4233}
     4234
     4235
     4236/**
    42124237 * Serializes the receive thread, it may be working inside the critsect.
    42134238 *
     
    43614386#endif
    43624387    /* Indicate link down to the guest OS that all network connections have been lost. */
    4363     if (pThis->fLinkUp)
    4364     {
    4365         pThis->fLinkTempDown = true;
    4366         pThis->cLinkDownReported = 0;
    4367         pThis->aCSR[0] |= RT_BIT(15) | RT_BIT(13); /* ERR | CERR (this is probably wrong) */
    4368         pThis->Led.Asserted.s.fError = pThis->Led.Actual.s.fError = 1;
    4369         return TMTimerSetMillies(pThis->pTimerRestore, 5000);
    4370     }
     4388    pcnetTempLinkDown(pThis);
     4389
    43714390    return VINF_SUCCESS;
    43724391}
     
    47354754     * network card
    47364755     */
    4737     if (pThis->fLinkUp && RT_SUCCESS(rc))
    4738     {
    4739         pThis->fLinkTempDown = true;
    4740         pThis->cLinkDownReported = 0;
    4741         pThis->aCSR[0] |= RT_BIT(15) | RT_BIT(13); /* ERR | CERR (this is probably wrong) */
    4742         pThis->Led.Asserted.s.fError = pThis->Led.Actual.s.fError = 1;
    4743         TMTimerSetMillies(pThis->pTimerRestore, 5000);
    4744     }
     4756    if (RT_SUCCESS(rc))
     4757        pcnetTempLinkDown(pThis);
    47454758
    47464759    PDMCritSectLeave(&pThis->CritSect);
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