FreeBSD/sys/dev/ste/if_ste.c
/*
 * Read a sequence of words from the EEPROM. Note that ethernet address
 * data is stored in the EEPROM in network byte order.
 */
Read a sequence of words from the EEPROM. Note that ethernet address
data is stored in the EEPROM in network byte order.
Read a sequence of words from the EEPROM . Note that ethernet address data is stored in the EEPROM in network byte order .
static int
ste_read_eeprom(struct ste_softc *sc, uint16_t *dest, int off, int cnt)
{
	int err = 0, i;
	if (ste_eeprom_wait(sc))
		return (1);
	for (i = 0; i < cnt; i++) {
		CSR_WRITE_2(sc, STE_EEPROM_CTL, STE_EEOPCODE_READ | (off + i));
		err = ste_eeprom_wait(sc);
		if (err)
			break;
		*dest = le16toh(CSR_READ_2(sc, STE_EEPROM_DATA));
		dest++;
	}
	return (err ? 1 : 0);
}
static int ste_read_eeprom ( struct ste_softc * sc , uint16_t * dest , int off , int cnt ) { int err = 0 , i ; if ( ste_eeprom_wait ( sc ) ) return ( 1 ) ; for ( i = 0 ; i < cnt ; i ++ ) { CSR_WRITE_2 ( sc , STE_EEPROM_CTL , STE_EEOPCODE_READ | ( off + i ) ) ; err = ste_eeprom_wait ( sc ) ; if ( err ) break ; * dest = le16toh ( CSR_READ_2 ( sc , STE_EEPROM_DATA ) ) ; dest ++ ; } return ( err ? 1 : 0 ) ; }
Read a sequence of words from the EEPROM.
Read a sequence of words from the EEPROM .