FreeBSD/sys/dev/stge/if_stge.c
/*
 * stge_read_eeprom:
 *
 *	Read data from the serial EEPROM.
 */
Read data from the serial EEPROM.
Read data from the serial EEPROM .
static void
stge_read_eeprom(struct stge_softc *sc, int offset, uint16_t *data)
{
	if (stge_eeprom_wait(sc))
		device_printf(sc->sc_dev, "EEPROM failed to come ready\n");
	CSR_WRITE_2(sc, STGE_EepromCtrl,
	    EC_EepromAddress(offset) | EC_EepromOpcode(EC_OP_RR));
	if (stge_eeprom_wait(sc))
		device_printf(sc->sc_dev, "EEPROM read timed out\n");
	*data = CSR_READ_2(sc, STGE_EepromData);
}
static void stge_read_eeprom ( struct stge_softc * sc , int offset , uint16_t * data ) { if ( stge_eeprom_wait ( sc ) ) device_printf ( sc -> sc_dev , " \n " ) ; CSR_WRITE_2 ( sc , STGE_EepromCtrl , EC_EepromAddress ( offset ) | EC_EepromOpcode ( EC_OP_RR ) ) ; if ( stge_eeprom_wait ( sc ) ) device_printf ( sc -> sc_dev , " \n " ) ; * data = CSR_READ_2 ( sc , STGE_EepromData ) ; }
stge_read_eeprom:
      Read data from the serial EEPROM.
stge_read_eeprom : Read data from the serial EEPROM .