diff options
author | dg <dg@FreeBSD.org> | 1993-10-15 11:06:41 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1993-10-15 11:06:41 +0000 |
commit | b1c9fd13a6f4df8e4c6f21f5996e6356171f84ad (patch) | |
tree | 46a870def24d1eae351888c423d26c2d093cc8d4 /sys/dev/ed/if_ed.c | |
parent | 98dbbc53998595e1b7b1ea3fef2e47953b042007 (diff) | |
download | FreeBSD-src-b1c9fd13a6f4df8e4c6f21f5996e6356171f84ad.zip FreeBSD-src-b1c9fd13a6f4df8e4c6f21f5996e6356171f84ad.tar.gz |
* Revision 2.8 1993/10/15 10:59:56 davidg
* increase maximum time to wait for transmit DMA to complete to 120us.
* call ed_reset() if the time limit is reached instead of trying
* to abort the remote DMA.
*
* Revision 2.7 1993/10/15 10:49:10 davidg
* minor change to way the mbuf pointer temp variable is assigned in
* ed_start (slightly improves code readability)
*
* Revision 2.6 93/10/02 01:12:20 davidg
* use ETHER_ADDR_LEN in NE probe rather than '6'.
Diffstat (limited to 'sys/dev/ed/if_ed.c')
-rw-r--r-- | sys/dev/ed/if_ed.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c index 936ba58..cbbb5a8 100644 --- a/sys/dev/ed/if_ed.c +++ b/sys/dev/ed/if_ed.c @@ -20,12 +20,24 @@ */ /* - * $Id: if_ed.c,v 2.5 93/09/30 17:44:14 davidg Exp Locker: davidg $ + * $Id: if_ed.c,v 2.8 1993/10/15 10:59:56 davidg Exp davidg $ */ /* * Modification history * + * Revision 2.8 1993/10/15 10:59:56 davidg + * increase maximum time to wait for transmit DMA to complete to 120us. + * call ed_reset() if the time limit is reached instead of trying + * to abort the remote DMA. + * + * Revision 2.7 1993/10/15 10:49:10 davidg + * minor change to way the mbuf pointer temp variable is assigned in + * ed_start (slightly improves code readability) + * + * Revision 2.6 93/10/02 01:12:20 davidg + * use ETHER_ADDR_LEN in NE probe rather than '6'. + * * Revision 2.5 93/09/30 17:44:14 davidg * patch from vak@zebub.msk.su (Serge V.Vakulenko) to work around * a hardware bug in cheap WD clone boards where the PROM checksum @@ -916,7 +928,7 @@ ed_probe_Novell(isa_dev) sc->mem_ring = sc->mem_start + sc->txb_cnt * ED_PAGE_SIZE * ED_TXBUF_SIZE; ed_pio_readmem(sc, 0, romdata, 16); - for (n = 0; n < 6; n++) + for (n = 0; n < ETHER_ADDR_LEN; n++) sc->arpcom.ac_enaddr[n] = romdata[n*(sc->isa16bit+1)]; /* clear any pending interrupts that might have occurred above */ @@ -1336,6 +1348,8 @@ outloop: * Copy the mbuf chain into the transmit buffer */ + m0 = m; + /* txb_new points to next open buffer slot */ buffer = sc->mem_start + (sc->txb_new * ED_TXBUF_SIZE * ED_PAGE_SIZE); @@ -1367,7 +1381,7 @@ outloop: } } - for (len = 0, m0 = m; m != 0; m = m->m_next) { + for (len = 0; m != 0; m = m->m_next) { bcopy(mtod(m, caddr_t), buffer, m->m_len); buffer += m->m_len; len += m->m_len; @@ -1388,7 +1402,7 @@ outloop: } } } else { - len = ed_pio_write_mbufs(sc, m0 = m, buffer); + len = ed_pio_write_mbufs(sc, m, buffer); } sc->txb_len[sc->txb_new] = MAX(len, ETHER_MIN_LEN); @@ -2108,7 +2122,7 @@ ed_pio_writemem(sc,src,dst,len) unsigned short dst; unsigned short len; { - int maxwait=20; /* about 25us */ + int maxwait=100; /* about 120us */ /* select page 0 registers */ outb(sc->nic_addr + ED_P0_CR, ED_CR_RD2|ED_CR_STA); @@ -2154,7 +2168,7 @@ ed_pio_write_mbufs(sc,m,dst) unsigned short len, mb_offset; struct mbuf *mp; unsigned char residual[2]; - int maxwait=20; /* about 25us */ + int maxwait=100; /* about 120us */ /* First, count up the total number of bytes to copy */ for (len = 0, mp = m; mp; mp = mp->m_next) @@ -2239,10 +2253,7 @@ ed_pio_write_mbufs(sc,m,dst) if (!maxwait) { log(LOG_WARNING, "ed%d: remote transmit DMA failed to complete\n", sc->arpcom.ac_if.if_unit); - /* attempt to abort the remote DMA */ - outb(sc->nic_addr + ED_P0_RBCR0, 0); - outb(sc->nic_addr + ED_P0_RBCR1, 0); - outb(sc->nic_addr + ED_P0_CR, ED_CR_RD2|ED_CR_STA); + ed_reset(sc->arpcom.ac_if.if_unit); } return(len); |