third_party/virtualbox/src/VBox/Devices/Network/DevE1000.cpp
/**
 * Write handler for EEPROM/Flash Control/Data register.
 *
 * Handles EEPROM access requests; forwards writes to EEPROM device if access has been granted.
 *
 * @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/Flash Control/Data register.
Handles EEPROM access requests; forwards writes to EEPROM device if access has been granted.

@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 / Flash Control / Data register . Handles EEPROM access requests ; forwards writes to EEPROM device if access has been granted . @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 e1kRegWriteEECD(PE1KSTATE pThis, uint32_t offset, uint32_t index, uint32_t value)
{
    RT_NOREF(offset, index);
#ifdef IN_RING3
    if ((EECD & EECD_EE_GNT) || pThis->eChip == E1K_CHIP_82543GC)
    {
        STAM_PROFILE_ADV_START(&pThis->StatEEPROMWrite, a);
        pThis->eeprom.write(value & EECD_EE_WIRES);
        STAM_PROFILE_ADV_STOP(&pThis->StatEEPROMWrite, a);
    }
    if (value & EECD_EE_REQ)
        EECD |= EECD_EE_REQ|EECD_EE_GNT;
    else
        EECD &= ~EECD_EE_GNT;
    return VINF_SUCCESS;
#else 
    RT_NOREF(pThis, value);
    return VINF_IOM_R3_MMIO_WRITE;
#endif 
}
static int e1kRegWriteEECD ( PE1KSTATE pThis , uint32_t offset , uint32_t index , uint32_t value ) { RT_NOREF ( offset , index ) ; #ifdef IN_RING3 if ( ( EECD & EECD_EE_GNT ) || pThis -> eChip == E1K_CHIP_82543GC ) { STAM_PROFILE_ADV_START ( & pThis -> StatEEPROMWrite , a ) ; pThis -> eeprom . write ( value & EECD_EE_WIRES ) ; STAM_PROFILE_ADV_STOP ( & pThis -> StatEEPROMWrite , a ) ; } if ( value & EECD_EE_REQ ) EECD |= EECD_EE_REQ | EECD_EE_GNT ; else EECD &= ~ EECD_EE_GNT ; return VINF_SUCCESS ; #else RT_NOREF ( pThis , value ) ; return VINF_IOM_R3_MMIO_WRITE ; #endif }
Write handler for EEPROM/Flash Control/Data register.
Write handler for EEPROM / Flash Control / Data register .
/* So far we are concerned with lower byte only */ /* Access to EEPROM granted -- forward 4-wire bits to EEPROM device */ /* Note: 82543GC does not need to request EEPROM access */ //e1kRegWriteDefault(pThis, offset, index, value ); /* !IN_RING3 */ /* !IN_RING3 */