third_party/virtualbox/src/VBox/Devices/Network/DevE1000.cpp
/**
 * Read handler for EEPROM/Flash Control/Data register.
 *
 * Lower 4 bits come from EEPROM device if EEPROM access has been granted.
 *
 * @returns VBox status code.
 *
 * @param   pThis       The device state structure.
 * @param   offset      Register offset in memory-mapped frame.
 * @param   index       Register index in register array.
 * @param   mask        Used to implement partial reads (8 and 16-bit).
 * @thread  EMT
 */
Read handler for EEPROM/Flash Control/Data register.
Lower 4 bits come from EEPROM device if EEPROM access has been granted.

@returns VBox status code.

@param   pThis       The device state structure.
@param   offset      Register offset in memory-mapped frame.
@param   index       Register index in register array.
@param   mask        Used to implement partial reads (8 and 16-bit).
@thread  EMT
Read handler for EEPROM / Flash Control / Data register . Lower 4 bits come from EEPROM device if EEPROM access has been granted . @returns VBox status code . @param pThis The device state structure . @param offset Register offset in memory - mapped frame . @param index Register index in register array . @param mask Used to implement partial reads ( 8 and 16 - bit ) . @thread EMT
static int e1kRegReadEECD(PE1KSTATE pThis, uint32_t offset, uint32_t index, uint32_t *pu32Value)
{
#ifdef IN_RING3
    uint32_t value;
    int      rc = e1kRegReadDefault(pThis, offset, index, &value);
    if (RT_SUCCESS(rc))
    {
        if ((value & EECD_EE_GNT) || pThis->eChip == E1K_CHIP_82543GC)
        {
            STAM_PROFILE_ADV_START(&pThis->StatEEPROMRead, a);
            value |= pThis->eeprom.read();
            STAM_PROFILE_ADV_STOP(&pThis->StatEEPROMRead, a);
        }
        *pu32Value = value;
    }
    return rc;
#else 
    RT_NOREF_PV(pThis); RT_NOREF_PV(offset); RT_NOREF_PV(index); RT_NOREF_PV(pu32Value);
    return VINF_IOM_R3_MMIO_READ;
#endif 
}
static int e1kRegReadEECD ( PE1KSTATE pThis , uint32_t offset , uint32_t index , uint32_t * pu32Value ) { #ifdef IN_RING3 uint32_t value ; int rc = e1kRegReadDefault ( pThis , offset , index , & value ) ; if ( RT_SUCCESS ( rc ) ) { if ( ( value & EECD_EE_GNT ) || pThis -> eChip == E1K_CHIP_82543GC ) { STAM_PROFILE_ADV_START ( & pThis -> StatEEPROMRead , a ) ; value |= pThis -> eeprom . read ( ) ; STAM_PROFILE_ADV_STOP ( & pThis -> StatEEPROMRead , a ) ; } * pu32Value = value ; } return rc ; #else RT_NOREF_PV ( pThis ) ; RT_NOREF_PV ( offset ) ; RT_NOREF_PV ( index ) ; RT_NOREF_PV ( pu32Value ) ; return VINF_IOM_R3_MMIO_READ ; #endif }
Read handler for EEPROM/Flash Control/Data register.
Read handler for EEPROM / Flash Control / Data register .
/* Note: 82543GC does not need to request EEPROM access */ /* Access to EEPROM granted -- get 4-wire bits to EEPROM device */ /* !IN_RING3 */ /* !IN_RING3 */