Fix a wrong calculation bug around RX ring buffer memory address

slipped in about sixteen years ago.  Fortunately, it had been working
for ages because some devices used address zero and other devices
ignored wrong higher bits.

Tested on we(4) (SMC Elite Ultra) and ne(4) (NE2000 compatible
named UL0001) on ISA.
Note FreeBSD also uses the same correct value in their ed(4) driver.
This commit is contained in:
tsutsui 2010-02-24 13:10:26 +00:00
parent d32fd438b1
commit 07b15f7d28

View File

@ -1,4 +1,4 @@
/* $NetBSD: dp8390.c,v 1.73 2010/01/19 22:06:24 pooka Exp $ */
/* $NetBSD: dp8390.c,v 1.74 2010/02/24 13:10:26 tsutsui Exp $ */
/*
* Device driver for National Semiconductor DS8390/WD83C690 based ethernet
@ -14,7 +14,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: dp8390.c,v 1.73 2010/01/19 22:06:24 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: dp8390.c,v 1.74 2010/02/24 13:10:26 tsutsui Exp $");
#include "opt_ipkdb.h"
#include "opt_inet.h"
@ -114,7 +114,8 @@ dp8390_config(struct dp8390_softc *sc)
sc->tx_page_start = sc->mem_start >> ED_PAGE_SHIFT;
sc->rec_page_start = sc->tx_page_start + sc->txb_cnt * ED_TXBUF_SIZE;
sc->rec_page_stop = sc->tx_page_start + (sc->mem_size >> ED_PAGE_SHIFT);
sc->mem_ring = sc->mem_start + (sc->rec_page_start << ED_PAGE_SHIFT);
sc->mem_ring = sc->mem_start +
((sc->txb_cnt * ED_TXBUF_SIZE) << ED_PAGE_SHIFT);
sc->mem_end = sc->mem_start + sc->mem_size;
/* Now zero memory and verify that it is clear. */