From 01e8e49aa19b9e64c43644bdbc1a88277652137c Mon Sep 17 00:00:00 2001 From: dufault Date: Sun, 31 Jan 1999 22:41:51 +0000 Subject: Move the "fetch serial data" delay so that it is an inter-bit delay. Increase the overall length of the delay by 10. Without this a 3C509 card on my MediaGX crash box can't be reliably read. With this it is solid. I've left a delay multiplier in instead of just changing the base delay because I'm surprised I had to increase it so much and expect there may be another problem. --- sys/dev/ep/if_ep.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'sys/dev/ep/if_ep.c') diff --git a/sys/dev/ep/if_ep.c b/sys/dev/ep/if_ep.c index e325ada..387184e 100644 --- a/sys/dev/ep/if_ep.c +++ b/sys/dev/ep/if_ep.c @@ -38,7 +38,7 @@ */ /* - * $Id: if_ep.c,v 1.77 1998/10/22 05:58:39 bde Exp $ + * $Id: if_ep.c,v 1.78 1999/01/19 00:21:39 peter Exp $ * * Promiscuous mode added and interrupt logic slightly changed * to reduce the number of adapter failures. Transceiver select @@ -105,6 +105,12 @@ #include #include +/* DELAY_MULTIPLE: How much to boost "base" delays, except + * for the inter-bit delays in get_eeprom_data. A cyrix Media GX needed this. + */ +#define DELAY_MULTIPLE 10 +#define BIT_DELAY_MULTIPLE 10 + /* Exported variables */ u_long ep_unit; int ep_boards; @@ -305,7 +311,7 @@ ep_look_for_board_at(is) elink_idseq(0xCF); elink_reset(); - DELAY(10000); + DELAY(DELAY_MULTIPLE * 10000); for (i = 0; i < EP_MAX_BOARDS; i++) { outb(id_port, 0); outb(id_port, 0); @@ -743,7 +749,7 @@ epinit(sc) case ACF_CONNECTOR_BNC: if (sc->ep_connectors & BNC) { outw(BASE + EP_COMMAND, START_TRANSCEIVER); - DELAY(1000); + DELAY(DELAY_MULTIPLE * 1000); } break; case ACF_CONNECTOR_AUI: @@ -1389,6 +1395,7 @@ send_ID_sequence(port) * the AX register which is conveniently returned to us by inb(). Hence; we * read 16 times getting one bit of data with each read. */ + static int get_eeprom_data(id_port, offset) int id_port; @@ -1396,9 +1403,10 @@ get_eeprom_data(id_port, offset) { int i, data = 0; outb(id_port, 0x80 + offset); - DELAY(1000); - for (i = 0; i < 16; i++) + for (i = 0; i < 16; i++) { + DELAY(BIT_DELAY_MULTIPLE * 1000); data = (data << 1) | (inw(id_port) & 1); + } return (data); } -- cgit v1.1