Subject: kern/13263: an(4) driver tx-ring patch
To: None <gnats-bugs@gnats.netbsd.org>
From: Wolfgang Rupprecht <wolfgang@wsrcc.com>
List: netbsd-bugs
Date: 06/20/2001 14:17:27
>Number:         13263
>Category:       kern
>Synopsis:       an(4) driver tx-ring patch
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 20 14:16:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Wolfgang Rupprecht
>Release:        NetBSD-current Wed Jun 20 14:14:55 PDT 2001
>Organization:
W S Rupprecht Computer Consulting, Fremont CA
>Environment:
	
System: NetBSD capsicum.wsrcc.com 1.5W NetBSD 1.5W (WSRCC_ATHLON) #27: Sun Jun 17 20:14:59 PDT 2001 wolfgang@capsicum.wsrcc.com:/v/src/netbsd/src/sys/arch/i386/compile/WSRCC_ATHLON i386
Architecture: i386
Machine: i386
>Description:

	an(4) driver tx-ring patch from Doug Ambrisko.  This fix
	mirrors changes to the freebsd an(4) driver.

>How-To-Repeat:
	inspection
>Fix:

Index: an.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/ic/an.c,v
retrieving revision 1.14
diff -u -r1.14 an.c
--- an.c	2001/05/28 00:46:35	1.14
+++ an.c	2001/06/20 21:12:06
@@ -471,7 +471,7 @@
 	int			status;
 {
 	struct ifnet		*ifp;
-	int			id;
+	int			id, i;
 
 	/* TX DONE enable lan monitor DJA
 	   an_enable_sniff();
@@ -496,7 +496,14 @@
 		    sc->an_rdata.an_tx_ring[sc->an_rdata.an_tx_cons], id);
 #endif
 
-	sc->an_rdata.an_tx_ring[sc->an_rdata.an_tx_cons] = 0;
+				/* fix from Doug Ambrisko -wsr */
+	/* sc->an_rdata.an_tx_ring[sc->an_rdata.an_tx_cons] = 0; */
+	for (i = 0; i < AN_TX_RING_CNT; i++ ) {
+               if (id == sc->an_rdata.an_tx_ring[i]) {
+                      sc->an_rdata.an_tx_ring[i] = 0;
+                       break;
+               }
+	}
 	AN_INC(sc->an_rdata.an_tx_cons, AN_TX_RING_CNT);
 
 	return;

>Release-Note:
>Audit-Trail:
>Unformatted: