Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ofw in ofnet_read(), interpret returns of either -2 ...



details:   https://anonhg.NetBSD.org/src/rev/370c4b2dd63f
branches:  trunk
changeset: 538531:370c4b2dd63f
user:      chs <chs%NetBSD.org@localhost>
date:      Tue Oct 22 06:28:50 2002 +0000

description:
in ofnet_read(), interpret returns of either -2 or 0 from OF_read() as
meaning that there is no packet available.  the OF spec reportedly
says that it's supposed to return 0 in this case, but my Firepower box
uses -2, so this is probably another of those FIRMWORKSBUGS things.
we'll accept both values in any case.

diffstat:

 sys/dev/ofw/ofnet.c |  13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diffs (34 lines):

diff -r 126110410343 -r 370c4b2dd63f sys/dev/ofw/ofnet.c
--- a/sys/dev/ofw/ofnet.c       Tue Oct 22 04:50:38 2002 +0000
+++ b/sys/dev/ofw/ofnet.c       Tue Oct 22 06:28:50 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ofnet.c,v 1.29 2002/10/02 16:34:34 thorpej Exp $       */
+/*     $NetBSD: ofnet.c,v 1.30 2002/10/22 06:28:50 chs Exp $   */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofnet.c,v 1.29 2002/10/02 16:34:34 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofnet.c,v 1.30 2002/10/22 06:28:50 chs Exp $");
 
 #include "ofnet.h"
 #include "opt_inet.h"
@@ -181,12 +181,9 @@
        ipkdbrint(kifp, ifp);
 #endif 
        for (;;) {
-               if ((len = OF_read(of->sc_ihandle, buf, sizeof buf)) < 0) {
-                       if (len == -2 || len == 0)
-                               break;
-                       ifp->if_ierrors++;
-                       continue;
-               }
+               len = OF_read(of->sc_ihandle, buf, sizeof buf);
+               if (len == -2 || len == 0)
+                       break;
                if (len < sizeof(struct ether_header)) {
                        ifp->if_ierrors++;
                        continue;



Home | Main Index | Thread Index | Old Index