Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic don't call re_rxeof a second time when we've alre...



details:   https://anonhg.NetBSD.org/src/rev/baffe389823c
branches:  trunk
changeset: 573888:baffe389823c
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sun Feb 13 16:04:18 2005 +0000

description:
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

diffstat:

 sys/dev/ic/rtl8169.c |  24 +++++++++---------------
 1 files changed, 9 insertions(+), 15 deletions(-)

diffs (53 lines):

diff -r 6225d8b4c877 -r baffe389823c sys/dev/ic/rtl8169.c
--- a/sys/dev/ic/rtl8169.c      Sun Feb 13 15:43:33 2005 +0000
+++ b/sys/dev/ic/rtl8169.c      Sun Feb 13 16:04:18 2005 +0000
@@ -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 @@
                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 @@
        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.



Home | Main Index | Thread Index | Old Index