From smpatel@xi.dorm.umd.edu  Mon Jan 29 17:31:12 1996
Received: from xi.dorm.umd.edu (xi.dorm.umd.edu [129.2.152.45])
          by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id RAA03634
          for <FreeBSD-gnats-submit@freebsd.org>; Mon, 29 Jan 1996 17:31:10 -0800 (PST)
Received: (from smpatel@localhost) by xi.dorm.umd.edu (8.6.12/8.6.12) id UAA11903; Mon, 29 Jan 1996 20:30:58 -0500
Message-Id: <199601300130.UAA11903@xi.dorm.umd.edu>
Date: Mon, 29 Jan 1996 20:30:58 -0500
From: smpatel@wam.umd.edu
Reply-To: smpatel@xi.dorm.umd.edu
To: FreeBSD-gnats-submit@freebsd.org
Subject: Lance device timeout causes panic [patch]
X-Send-Pr-Version: 3.2

>Number:         980
>Category:       kern
>Synopsis:       Lance device timeout causes panic [patch]
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 29 17:40:05 PST 1996
>Closed-Date:    Mon Jan 29 23:26:15 PST 1996
>Last-Modified:  Mon Jan 29 23:27:26 PST 1996
>Originator:     Sujal Patel
>Release:        FreeBSD FreeBSD 2.2-CURRENT i386
>Organization:
>Environment:

2.2-CURRENT, if_lnc.c v1.19

>Description:

version 1.18 of if_lnc.c reversed davidg's changes in 1.15.  This causes
Lance timeouts to panic the system.

>How-To-Repeat:
>Fix:

--- if_lnc.c    Fri Jan 26 04:48:39 1996
+++ /xi2/smpatel/usr/src/sys-new/i386/isa/if_lnc.c      Sun Jan 28 23:27:20 1996
@@ -151,7 +151,7 @@
 static struct mbuf *chain_to_cluster __P((struct mbuf *m));
 static void lnc_start __P((struct ifnet *ifp));
 static int lnc_ioctl __P((struct ifnet *ifp, int command, caddr_t data));
-static void lnc_watchdog __P((int unit));
+static void lnc_watchdog __P((struct ifnet *ifp));
 #ifdef DEBUG
 static void lnc_dump_state __P((int unit));
 static void mbuf_dump_chain __P((struct mbuf *m));
@@ -1749,12 +1749,12 @@
 }
 
 static void
-lnc_watchdog(int unit)
+lnc_watchdog(ifp)
+        struct ifnet *ifp;
 {
-       struct lnc_softc *sc = &lnc_softc[unit];
-       log(LOG_ERR, "lnc%d: Device timeout -- Resetting\n", unit);
-       ++sc->arpcom.ac_if.if_oerrors;
-       lnc_reset(unit);
+       log(LOG_ERR, "lnc%d: Device timeout -- Resetting\n", ifp->if_unit);
+        ifp->if_oerrors++;
+       lnc_reset(ifp->if_unit);
 }
 
 #ifdef DEBUG

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: davidg 
State-Changed-When: Mon Jan 29 23:26:15 PST 1996 
State-Changed-Why:  
This has been fixed. Thanks for pointing it out. 
>Unformatted:
