summaryrefslogtreecommitdiffstats
path: root/sys/dev/ep
diff options
context:
space:
mode:
authormdodd <mdodd@FreeBSD.org>1999-12-06 08:59:52 +0000
committermdodd <mdodd@FreeBSD.org>1999-12-06 08:59:52 +0000
commit3f475828f27a59a5be6db1dcfe1691fe632cfab3 (patch)
treece71f1d193f09a7d956c7d9ec3257909d890da1c /sys/dev/ep
parenta7e03f2c68bb435ac7339efb3e4867168e80a23e (diff)
downloadFreeBSD-src-3f475828f27a59a5be6db1dcfe1691fe632cfab3.zip
FreeBSD-src-3f475828f27a59a5be6db1dcfe1691fe632cfab3.tar.gz
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".
Diffstat (limited to 'sys/dev/ep')
-rw-r--r--sys/dev/ep/if_ep_isa.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/sys/dev/ep/if_ep_isa.c b/sys/dev/ep/if_ep_isa.c
index 445484b..bc4d8d2 100644
--- a/sys/dev/ep/if_ep_isa.c
+++ b/sys/dev/ep/if_ep_isa.c
@@ -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 *
OpenPOWER on IntegriCloud