Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Patch from HITOSHI Osada:



details:   https://anonhg.NetBSD.org/src/rev/6b36c22a06b1
branches:  trunk
changeset: 566649:6b36c22a06b1
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun May 16 02:41:46 2004 +0000

description:
Patch from HITOSHI Osada:
* Newer chips do not need the receiver lock-up workaround; detect when it
  is required.

diffstat:

 sys/dev/ic/i82557.c    |  14 +++++++++++---
 sys/dev/ic/i82557var.h |   3 ++-
 2 files changed, 13 insertions(+), 4 deletions(-)

diffs (59 lines):

diff -r 37d08e972b2b -r 6b36c22a06b1 sys/dev/ic/i82557.c
--- a/sys/dev/ic/i82557.c       Sun May 16 02:34:47 2004 +0000
+++ b/sys/dev/ic/i82557.c       Sun May 16 02:41:46 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i82557.c,v 1.84 2004/04/28 15:25:45 briggs Exp $       */
+/*     $NetBSD: i82557.c,v 1.85 2004/05/16 02:41:46 thorpej Exp $      */
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.84 2004/04/28 15:25:45 briggs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.85 2004/05/16 02:41:46 thorpej Exp $");
 
 #include "bpfilter.h"
 #include "rnd.h"
@@ -654,6 +654,14 @@
                        fxp_eeprom_update_cksum(sc);
                }
        }
+
+       /* Receiver lock-up workaround detection. */
+       fxp_read_eeprom(sc, &data, 3, 1);
+       if ((data & 0x03) != 0x03) {
+               aprint_verbose("%s: Enabling receiver lock-up workaround\n",
+                   sc->sc_dev.dv_xname);
+               sc->sc_flags |= FXPF_RECV_WORKAROUND;
+       }
 }
 
 static void
@@ -1431,7 +1439,7 @@
        if (sp->rx_good) {
                ifp->if_ipackets += le32toh(sp->rx_good);
                sc->sc_rxidle = 0;
-       } else {
+       } else if (sc->sc_flags & FXPF_RECV_WORKAROUND) {
                sc->sc_rxidle++;
        }
        ifp->if_ierrors +=
diff -r 37d08e972b2b -r 6b36c22a06b1 sys/dev/ic/i82557var.h
--- a/sys/dev/ic/i82557var.h    Sun May 16 02:34:47 2004 +0000
+++ b/sys/dev/ic/i82557var.h    Sun May 16 02:41:46 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i82557var.h,v 1.31 2003/05/26 16:14:49 yamt Exp $      */
+/*     $NetBSD: i82557var.h,v 1.32 2004/05/16 02:41:46 thorpej Exp $   */
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2001 The NetBSD Foundation, Inc.
@@ -224,6 +224,7 @@
 #define        FXPF_UCODE_LOADED       0x0100  /* microcode is loaded */
 #define        FXPF_EXT_RFA            0x0200  /* enable extended RFD */
 #define        FXPF_IPCB               0x0400  /* use IPCB */
+#define        FXPF_RECV_WORKAROUND    0x0800  /* receiver lock-up workaround */
 
        int     sc_int_delay;           /* interrupt delay */
        int     sc_bundle_max;          /* max packet bundle */



Home | Main Index | Thread Index | Old Index