don't call re_rxeof a second time when we've already done the work

pull common code out from if and else clauses

from FreeBSD if_re.c rev. 1.33
This commit is contained in:
jdolecek 2005-02-13 16:04:18 +00:00
parent ac81d6249a
commit 4737695e07
1 changed files with 9 additions and 15 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: rtl8169.c,v 1.7 2005/02/13 15:43:33 jdolecek Exp $ */
/* $NetBSD: rtl8169.c,v 1.8 2005/02/13 16:04:18 jdolecek Exp $ */
/*
* Copyright (c) 1997, 1998-2003
@ -1483,10 +1483,8 @@ re_intr(void *arg)
if ((status & RTK_INTRS_CPLUS) == 0)
break;
if (status & RTK_ISR_RX_OK)
re_rxeof(sc);
if (status & RTK_ISR_RX_ERR)
if ((status & RTK_ISR_RX_OK) ||
(status & RTK_ISR_RX_ERR))
re_rxeof(sc);
if ((status & RTK_ISR_TIMEOUT_EXPIRED) ||
@ -1797,24 +1795,20 @@ re_init(struct ifnet *ifp)
rxcfg |= RTK_RXCFG_RX_INDIV;
/* If we want promiscuous mode, set the allframes bit. */
if (ifp->if_flags & IFF_PROMISC) {
if (ifp->if_flags & IFF_PROMISC)
rxcfg |= RTK_RXCFG_RX_ALLPHYS;
CSR_WRITE_4(sc, RTK_RXCFG, rxcfg);
} else {
else
rxcfg &= ~RTK_RXCFG_RX_ALLPHYS;
CSR_WRITE_4(sc, RTK_RXCFG, rxcfg);
}
CSR_WRITE_4(sc, RTK_RXCFG, rxcfg);
/*
* Set capture broadcast bit to capture broadcast frames.
*/
if (ifp->if_flags & IFF_BROADCAST) {
if (ifp->if_flags & IFF_BROADCAST)
rxcfg |= RTK_RXCFG_RX_BROAD;
CSR_WRITE_4(sc, RTK_RXCFG, rxcfg);
} else {
else
rxcfg &= ~RTK_RXCFG_RX_BROAD;
CSR_WRITE_4(sc, RTK_RXCFG, rxcfg);
}
CSR_WRITE_4(sc, RTK_RXCFG, rxcfg);
/*
* Program the multicast filter, if necessary.