Possible fix for NE2000 problems...the remote byte count wasn't word

aligned even though the transfers are 16bit.
This commit is contained in:
David Greenman 1995-01-01 06:38:14 +00:00
parent c38c2f7f9b
commit 84bcd8659a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=5333
2 changed files with 16 additions and 8 deletions

View File

@ -13,7 +13,7 @@
* the SMC Elite Ultra (8216), the 3Com 3c503, the NE1000 and NE2000, * the SMC Elite Ultra (8216), the 3Com 3c503, the NE1000 and NE2000,
* and a variety of similar clones. * and a variety of similar clones.
* *
* $Id: if_ed.c,v 1.60 1994/12/31 17:09:56 jkh Exp $ * $Id: if_ed.c,v 1.61 1995/01/01 03:54:34 davidg Exp $
*/ */
#include "ed.h" #include "ed.h"
@ -2234,7 +2234,7 @@ ed_pio_write_mbufs(sc, m, dst)
struct mbuf *m; struct mbuf *m;
unsigned short dst; unsigned short dst;
{ {
unsigned short len; unsigned short len, dma_len;
struct mbuf *mp; struct mbuf *mp;
int maxwait = 100; /* about 120us */ int maxwait = 100; /* about 120us */
@ -2242,6 +2242,10 @@ ed_pio_write_mbufs(sc, m, dst)
for (len = 0, mp = m; mp; mp = mp->m_next) for (len = 0, mp = m; mp; mp = mp->m_next)
len += mp->m_len; len += mp->m_len;
dma_len = len;
if (sc->isa16bit && (dma_len & 1))
dma_len++;
/* select page 0 registers */ /* select page 0 registers */
outb(sc->nic_addr + ED_P0_CR, ED_CR_RD2 | ED_CR_STA); outb(sc->nic_addr + ED_P0_CR, ED_CR_RD2 | ED_CR_STA);
@ -2249,8 +2253,8 @@ ed_pio_write_mbufs(sc, m, dst)
outb(sc->nic_addr + ED_P0_ISR, ED_ISR_RDC); outb(sc->nic_addr + ED_P0_ISR, ED_ISR_RDC);
/* set up DMA byte count */ /* set up DMA byte count */
outb(sc->nic_addr + ED_P0_RBCR0, len); outb(sc->nic_addr + ED_P0_RBCR0, dma_len);
outb(sc->nic_addr + ED_P0_RBCR1, len >> 8); outb(sc->nic_addr + ED_P0_RBCR1, dma_len >> 8);
/* set up destination address in NIC mem */ /* set up destination address in NIC mem */
outb(sc->nic_addr + ED_P0_RSAR0, dst); outb(sc->nic_addr + ED_P0_RSAR0, dst);

View File

@ -13,7 +13,7 @@
* the SMC Elite Ultra (8216), the 3Com 3c503, the NE1000 and NE2000, * the SMC Elite Ultra (8216), the 3Com 3c503, the NE1000 and NE2000,
* and a variety of similar clones. * and a variety of similar clones.
* *
* $Id: if_ed.c,v 1.60 1994/12/31 17:09:56 jkh Exp $ * $Id: if_ed.c,v 1.61 1995/01/01 03:54:34 davidg Exp $
*/ */
#include "ed.h" #include "ed.h"
@ -2234,7 +2234,7 @@ ed_pio_write_mbufs(sc, m, dst)
struct mbuf *m; struct mbuf *m;
unsigned short dst; unsigned short dst;
{ {
unsigned short len; unsigned short len, dma_len;
struct mbuf *mp; struct mbuf *mp;
int maxwait = 100; /* about 120us */ int maxwait = 100; /* about 120us */
@ -2242,6 +2242,10 @@ ed_pio_write_mbufs(sc, m, dst)
for (len = 0, mp = m; mp; mp = mp->m_next) for (len = 0, mp = m; mp; mp = mp->m_next)
len += mp->m_len; len += mp->m_len;
dma_len = len;
if (sc->isa16bit && (dma_len & 1))
dma_len++;
/* select page 0 registers */ /* select page 0 registers */
outb(sc->nic_addr + ED_P0_CR, ED_CR_RD2 | ED_CR_STA); outb(sc->nic_addr + ED_P0_CR, ED_CR_RD2 | ED_CR_STA);
@ -2249,8 +2253,8 @@ ed_pio_write_mbufs(sc, m, dst)
outb(sc->nic_addr + ED_P0_ISR, ED_ISR_RDC); outb(sc->nic_addr + ED_P0_ISR, ED_ISR_RDC);
/* set up DMA byte count */ /* set up DMA byte count */
outb(sc->nic_addr + ED_P0_RBCR0, len); outb(sc->nic_addr + ED_P0_RBCR0, dma_len);
outb(sc->nic_addr + ED_P0_RBCR1, len >> 8); outb(sc->nic_addr + ED_P0_RBCR1, dma_len >> 8);
/* set up destination address in NIC mem */ /* set up destination address in NIC mem */
outb(sc->nic_addr + ED_P0_RSAR0, dst); outb(sc->nic_addr + ED_P0_RSAR0, dst);