1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-03 09:00:21 +00:00

Add a delay (per the databook) to the get_eeprom_data() loop so

that the read EEPROM command has time to execute.

I didn't observe any difference in behavior on my test system but
this is the documented "correct behavior".
This commit is contained in:
Matthew N. Dodd 1999-12-06 08:59:52 +00:00
parent 0613716013
commit 8d133d9561
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=54198

View File

@ -102,18 +102,21 @@ static struct isa_pnp_id ep_ids[] = {
* read 16 times getting one bit of data with each read.
*/
static int
static u_int16_t
get_eeprom_data(id_port, offset)
int id_port;
int offset;
int id_port;
int offset;
{
int i, data = 0;
outb(id_port, 0x80 + offset);
for (i = 0; i < 16; i++) {
int i;
u_int16_t data = 0;
outb(id_port, EEPROM_CMD_RD|offset);
DELAY(BIT_DELAY_MULTIPLE * 1000);
data = (data << 1) | (inw(id_port) & 1);
}
return (data);
for (i = 0; i < 16; i++) {
DELAY(50);
data = (data << 1) | (inw(id_port) & 1);
}
return (data);
}
const char *