third_party/virtualbox/src/VBox/Devices/Network/DevE1000.cpp
/**
 * Write handler for EEPROM Read register.
 *
 * Handles EEPROM word access requests, reads EEPROM and stores the result
 * into DATA field.
 *
 * @param   pThis       The device state structure.
 * @param   offset      Register offset in memory-mapped frame.
 * @param   index       Register index in register array.
 * @param   value       The value to store.
 * @param   mask        Used to implement partial writes (8 and 16-bit).
 * @thread  EMT
 */
Write handler for EEPROM Read register.
Handles EEPROM word access requests, reads EEPROM and stores the result
into DATA field.

@param   pThis       The device state structure.
@param   offset      Register offset in memory-mapped frame.
@param   index       Register index in register array.
@param   value       The value to store.
@param   mask        Used to implement partial writes (8 and 16-bit).
@thread  EMT
Write handler for EEPROM Read register . Handles EEPROM word access requests reads EEPROM and stores the result into DATA field . @param pThis The device state structure . @param offset Register offset in memory - mapped frame . @param index Register index in register array . @param value The value to store . @param mask Used to implement partial writes ( 8 and 16 - bit ) . @thread EMT
static int e1kRegWriteEERD(PE1KSTATE pThis, uint32_t offset, uint32_t index, uint32_t value)
{
#ifdef IN_RING3
    e1kRegWriteDefault(pThis, offset, index, value);
    if (value & EERD_START)
    {
        uint16_t tmp;
        STAM_PROFILE_ADV_START(&pThis->StatEEPROMRead, a);
        if (pThis->eeprom.readWord(GET_BITS_V(value, EERD, ADDR), &tmp))
            SET_BITS(EERD, DATA, tmp);
        EERD |= EERD_DONE;
        STAM_PROFILE_ADV_STOP(&pThis->StatEEPROMRead, a);
    }
    return VINF_SUCCESS;
#else 
    RT_NOREF_PV(pThis); RT_NOREF_PV(offset); RT_NOREF_PV(index); RT_NOREF_PV(value);
    return VINF_IOM_R3_MMIO_WRITE;
#endif 
}
static int e1kRegWriteEERD ( PE1KSTATE pThis , uint32_t offset , uint32_t index , uint32_t value ) { #ifdef IN_RING3 e1kRegWriteDefault ( pThis , offset , index , value ) ; if ( value & EERD_START ) { uint16_t tmp ; STAM_PROFILE_ADV_START ( & pThis -> StatEEPROMRead , a ) ; if ( pThis -> eeprom . readWord ( GET_BITS_V ( value , EERD , ADDR ) , & tmp ) ) SET_BITS ( EERD , DATA , tmp ) ; EERD |= EERD_DONE ; STAM_PROFILE_ADV_STOP ( & pThis -> StatEEPROMRead , a ) ; } return VINF_SUCCESS ; #else RT_NOREF_PV ( pThis ) ; RT_NOREF_PV ( offset ) ; RT_NOREF_PV ( index ) ; RT_NOREF_PV ( value ) ; return VINF_IOM_R3_MMIO_WRITE ; #endif }
Write handler for EEPROM Read register.
Write handler for EEPROM Read register .
/* Make use of 'writable' and 'readable' masks. */ /* DONE and DATA are set only if read was triggered by START. */ /* !IN_RING3 */ /* !IN_RING3 */