Remove the use16bit softc field, replacing the functionality with dcr_reg.

This allows the front end to override the default DCR (byte-wide DMA,
x86 byte order, 8-byte FIFO) with different transfer size, byte order, DMA
parameters, and FIFO threshhold.  If the loopback select bit is not set for
normal operation, the default is used instead.

Inspired by thoughts from Bernd Ernesti.
This commit is contained in:
scottr 1997-04-30 18:09:14 +00:00
parent 3a4d449e5b
commit c0d7fd03ae
2 changed files with 7 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: dp8390.c,v 1.1 1997/04/29 04:32:07 scottr Exp $ */
/* $NetBSD: dp8390.c,v 1.2 1997/04/30 18:09:14 scottr Exp $ */
/*
* Device driver for National Semiconductor DS8390/WD83C690 based ethernet
@ -223,15 +223,13 @@ dp8390_init(sc)
NIC_PUT(regt, regh, ED_P0_CR,
sc->cr_proto | ED_CR_PAGE_0 | ED_CR_STP);
if (sc->use16bit) {
if (sc->dcr_reg & ED_DCR_LS) {
NIC_PUT(regt, regh, sc->dcr_reg);
} else {
/*
* Set FIFO threshold to 8, No auto-init Remote DMA, byte
* order=80x86, word-wide DMA xfers,
* order=80x86, byte-wide DMA xfers,
*/
NIC_PUT(regt, regh, ED_P0_DCR,
ED_DCR_FT1 | ED_DCR_WTS | ED_DCR_LS);
} else {
/* Same as above, but byte-wide DMA xfers. */
NIC_PUT(regt, regh, ED_P0_DCR, ED_DCR_FT1 | ED_DCR_LS);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: dp8390var.h,v 1.1 1997/04/29 04:32:09 scottr Exp $ */
/* $NetBSD: dp8390var.h,v 1.2 1997/04/30 18:09:16 scottr Exp $ */
/*
* Device driver for National Semiconductor DS8390/WD83C690 based ethernet
@ -36,10 +36,10 @@ struct dp8390_softc {
bus_size_t sc_reg_map[16]; /* register map (offsets) */
u_char use16bit; /* use word-width transfers */
u_char is790; /* NIC is a 790 */
u_int8_t cr_proto; /* values always set in CR */
u_int8_t dcr_reg; /* override DCR iff LS is set */
int mem_start; /* offset of NIC memory */
int mem_end; /* offset of NIC memory end */