1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00

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.
This commit is contained in:
Peter Dufault 1999-01-31 22:41:51 +00:00
parent a257733c19
commit e419eecba9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=43487
2 changed files with 26 additions and 10 deletions

View File

@ -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 <i386/isa/if_epreg.h>
#include <i386/isa/elink.h>
/* 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);
}

View File

@ -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 <i386/isa/if_epreg.h>
#include <i386/isa/elink.h>
/* 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);
}