VirtualBox

Changeset 23578 in vbox


Ignore:
Timestamp:
Oct 6, 2009 9:22:37 AM (15 years ago)
Author:
vboxsync
Message:

#3987: Virtio: LEDs are done.

File:
1 edited

Legend:

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

    r23498 r23578  
    757757    }
    758758    return rc;
     759}
     760
     761/**
     762 * Turns on/off the write status LED.
     763 *
     764 * @returns VBox status code.
     765 * @param   pState          Pointer to the device state structure.
     766 * @param   fOn             New LED state.
     767 */
     768void vpciSetWriteLed(PVPCISTATE pState, bool fOn)
     769{
     770    LogFlow(("%s vpciSetWriteLed: %s\n", INSTANCE(pState), fOn?"on":"off"));
     771    if (fOn)
     772        pState->led.Asserted.s.fWriting = pState->led.Actual.s.fWriting = 1;
     773    else
     774        pState->led.Actual.s.fWriting = fOn;
     775}
     776
     777/**
     778 * Turns on/off the read status LED.
     779 *
     780 * @returns VBox status code.
     781 * @param   pState          Pointer to the device state structure.
     782 * @param   fOn             New LED state.
     783 */
     784void vpciSetReadLed(PVPCISTATE pState, bool fOn)
     785{
     786    LogFlow(("%s vpciSetReadLed: %s\n", INSTANCE(pState), fOn?"on":"off"));
     787    if (fOn)
     788        pState->led.Asserted.s.fReading = pState->led.Actual.s.fReading = 1;
     789    else
     790        pState->led.Actual.s.fReading = fOn;
    759791}
    760792
     
    13561388        return rc;
    13571389
     1390    vpciSetReadLed(&pState->VPCI, true);
    13581391    if (vnetAddressFilter(pState, pvBuf, cb))
     1392    {
    13591393        rc = vnetHandleRxPacket(pState, pvBuf, cb);
     1394    }
     1395    vpciSetReadLed(&pState->VPCI, false);
    13601396
    13611397    return rc;
     
    14421478        return;
    14431479    }
     1480
     1481    vpciSetWriteLed(&pState->VPCI, true);
    14441482
    14451483    VQUEUEELEM elem;
     
    14861524        vqueueSync(&pState->VPCI, pQueue);
    14871525    }
     1526    vpciSetWriteLed(&pState->VPCI, false);
    14881527}
    14891528
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