/* Read a word from the EEPROM using the regular EEPROM access register. Assume that we are in register window zero.  */
static word read_eeprom(dword ioaddr, int index)
/* Read a word from the EEPROM using the regular EEPROM access register. Assume that we are in register window zero.  */
static word read_eeprom(dword ioaddr, int index)
{
    int i;
    outw(EEPROM_READ + index, ioaddr + 0xa);
    for (i = 1620; i >= 0; i--)
	if ((inw(ioaddr + 10) & EEPROM_BUSY) == 0)
	    break;
    return inw(ioaddr + 0xc);
}