Clean up LD-BDN reset code(PC-98).

Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
This commit is contained in:
KATO Takenori 1999-01-27 11:05:12 +00:00
parent fea579e94e
commit f274af0063
2 changed files with 10 additions and 22 deletions

View File

@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: if_ed.c,v 1.57 1998/12/31 03:23:39 kato Exp $
* $Id: if_ed.c,v 1.58 1999/01/19 00:21:51 peter Exp $
*/
/*
@ -1269,11 +1269,7 @@ ed_probe_Novell_generic(sc, port, unit, flags)
int flags;
{
u_int memsize, n;
#ifdef PC98
u_char romdata[16], tmp, st1d01;
#else
u_char romdata[16], tmp;
#endif
static char test_pattern[32] = "THIS is A memory TEST pattern";
char test_buffer[32];
@ -1291,22 +1287,8 @@ ed_probe_Novell_generic(sc, port, unit, flags)
outb(sc->asic_addr + ED_NOVELL_RESET, 0);
DELAY(200);
#endif /* GWETHER */
#ifdef PC98
switch (sc->type) {
case ED_TYPE98_BDN:
st1d01 = inb(sc->nic_addr + ED_NOVELL_RESET);
outb(sc->asic_addr + 0xc000, st1d01 & 0xf0 | 0x08);
outb(sc->nic_addr + 0x4000, st1d01);
tmp = inb(sc->asic_addr + 0x8000);
outb(sc->asic_addr + 0x8000, st1d01);
outb(sc->asic_addr + 0x8000, st1d01 & 0x7f);
break;
default:
tmp = inb(sc->asic_addr + ED_NOVELL_RESET);
}
#else
tmp = inb(sc->asic_addr + ED_NOVELL_RESET);
#endif
/*
* I don't know if this is necessary; probably cruft leftover from
* Clarkson packet driver code. Doesn't do a thing on the boards I've
@ -1316,7 +1298,13 @@ ed_probe_Novell_generic(sc, port, unit, flags)
* do the invasive thing for now. Yuck.]
*/
#ifdef PC98
if (sc->type != ED_TYPE98_BDN)
if (sc->type == ED_TYPE98_BDN) {
outb(sc->asic_addr + ED_NOVELL_RESET, tmp & 0xf0 | 0x08);
outb(sc->nic_addr + 0x4000, tmp);
(void) inb(sc->asic_addr + 0x8000);
outb(sc->asic_addr + 0x8000, tmp);
outb(sc->asic_addr + 0x8000, tmp & 0x7f);
} else
#endif
outb(sc->asic_addr + ED_NOVELL_RESET, tmp);
#ifdef PC98

View File

@ -430,7 +430,7 @@ pc98_set_register_unit(struct ed_softc *sc, int type, int iobase)
ED_NOVELL_NIC_OFFSET = 0x0000;
ED_NOVELL_ASIC_OFFSET = 0x0100;
ED_NOVELL_DATA = 0x0000;
ED_NOVELL_RESET = 0xc100;
ED_NOVELL_RESET = 0xc000;
nports = 1;
break;