예제 #1
0
파일: elink3.c 프로젝트: AgamAgarwal/minix
/*
 * get_e: gets a 16 bits word from the EEPROM. we must have set the window
 * before
 */
int
ep_get_e(int offset)
{
	if (!eeprom_rdy())
		return 0xffff;
	outw(IS_BASE + EP_W0_EEPROM_COMMAND, EEPROM_CMD_RD | offset);
	if (!eeprom_rdy())
		return 0xffff;
	return inw(IS_BASE + EP_W0_EEPROM_DATA);
}
예제 #2
0
파일: if_ep.c 프로젝트: Gwenio/DragonFlyBSD
/*
 * get_e: gets a 16 bits word from the EEPROM. we must have set the window
 * before
 */
u_int16_t
get_e(struct ep_softc *sc, int offset)
{
    if (!eeprom_rdy(sc))
	return (0);
    outw(BASE + EP_W0_EEPROM_COMMAND, (EEPROM_CMD_RD << sc->epb.cmd_off) | offset);
    if (!eeprom_rdy(sc))
	return (0);
    return (inw(BASE + EP_W0_EEPROM_DATA));
}