Subject: kern/3723: if_de.c won't compile if TULIP_DEBUG is defined and original
To: None <gnats-bugs@gnats.netbsd.org>
From: None <enami@ba2.so-net.or.jp>
List: netbsd-bugs
Date: 06/08/1997 12:18:01
>Number:         3723
>Category:       kern
>Synopsis:       if_de.c won't compile if TULIP_DEBUG is defined and original RCSid is gone.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jun  8 01:35:05 1997
>Last-Modified:
>Originator:     enami tsugutomo
>Organization:
>Release:        NetBSD-current 1997 June 06
>Environment:
System: NetBSD pavlov.enami.ba2.so-net.or.jp 1.2E NetBSD 1.2E (PAVLOV) #277: Tue Jun 3 23:19:09 JST 1997 enami@pavlov.enami.ba2.so-net.or.jp:/b/netbsd/kernel/compile/PAVLOV i386

>Description:
	(1) if_de.c (1.42) won't compile if TULIP_DEBUG is defined.

	(2) Unlike previous version of if_de.c, if_devar.h and dc21040reg.h,
	this version of those files seems to be imported without modifing
	original RCSids.  So, they are expaneded as if they are NetBSD's.
	I think it is better to leave original RCSid for record.

>How-To-Repeat:
	For (1), add options TULIP_DEBUG to kernel config file and
	compile it.

	In my case, compile fails as follows (long lines are folded by
	79 columns):

cc  -O2 -Werror -Wall -Wmissing-prototypes -Wstrict-prototypes -I. -I/usr/src/s
ys/arch -I/usr/src/sys -nostdinc -DSWAPPAGER -DVNODEPAGER -DDEVPAGER -DEXEC_AOU
T -DEXEC_SCRIPT -DI486_CPU -DI586_CPU -DXSERVER -DUCONSOLE -DINSECURE -DRTC_OFF
SET="0xfffffde4" -DDDB -DDIAGNOSTIC -DKTRACE -DSYSVMSG -DSYSVSEM -DSYSVSHM -DCO
MPAT_12 -DCOMPAT_43 -DFFS -DMFS -DNFS -DFDESC -DUNION -DFIFO -DINET -DEISAVERBO
SE -DPCIVERBOSE -DCOM_HAYESP -DTULIP_DEBUG -DMAXUSERS=32 -D_KERNEL  -Di386  -c 
/usr/src/sys/dev/pci/if_de.c
/usr/src/sys/dev/pci/if_de.c: In function `tulip_ifstart':
/usr/src/sys/dev/pci/if_de.c:4234: structure has no member named `tulip_txpipe'
/usr/src/sys/dev/pci/if_de.c:4241: structure has no member named `tulip_txpipes
tats'
/usr/src/sys/dev/pci/if_de.c:4241: structure has no member named `tulip_txpipe'
/usr/src/sys/dev/pci/if_de.c:4242: structure has no member named `tulip_txpipe'
*** Error code 1

Stop.

	For (2), just take a diff between previous and current version.
	For example:

Index: if_de.c
===================================================================
RCS file: /a/cvsroot/NetBSD/src/sys/dev/pci/if_de.c,v
retrieving revision 1.1.1.14
retrieving revision 1.1.1.15
diff -u -r1.1.1.14 -r1.1.1.15
--- if_de.c	1997/05/08 13:12:27	1.1.1.14
+++ if_de.c	1997/06/07 23:02:51	1.1.1.15
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_de.c,v 1.41 1997/05/07 18:45:01 thorpej Exp $	*/
+/*	$NetBSD: if_de.c,v 1.42 1997/06/06 23:14:58 mellon Exp $	*/
 
 /*-
  * Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com)
@@ -23,7 +23,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * Id: if_de.c,v 1.84 1997/03/26 23:27:20 thomas Exp
+ * $Id: if_de.c,v 1.42 1997/06/06 23:14:58 mellon Exp $
  *
  */
 

>Fix:
	Probably, using tulip_dgb.dbg_txpipe and tulip_dbg.dbg_txpipestats
	(they are newly added to if_devar.h) instead of tulip_txpipe and
	tulip_txpipestats is correct, i.e:

Index: if_de.c
===================================================================
RCS file: /a/cvsroot/NetBSD/src/sys/dev/pci/if_de.c,v
retrieving revision 1.1.1.15
diff -u -r1.1.1.15 if_de.c
--- if_de.c	1997/06/07 23:02:51	1.1.1.15
+++ if_de.c	1997/06/08 02:13:46
@@ -4231,15 +4231,15 @@
 	if (sc->tulip_flags & TULIP_TXINTPENDING) {
 	    eop->d_flag |= TULIP_DFLAG_TxLASTSEG;
 #if defined(TULIP_DEBUG)
-	    sc->tulip_txpipe++;
+	    sc->tulip_dbg.dbg_txpipe++;
 #endif
 	} else {
 	    eop->d_flag |= TULIP_DFLAG_TxLASTSEG|TULIP_DFLAG_TxWANTINTR;
 	    if ((sc->tulip_flags & TULIP_TXPROBE_ACTIVE) == 0) {
 		sc->tulip_flags |= TULIP_TXINTPENDING;
 #if defined(TULIP_DEBUG)
-		sc->tulip_txpipestats[sc->tulip_txpipe]++;
-		sc->tulip_txpipe = 0;
+		sc->tulip_dbg.dbg_txpipestats[sc->tulip_dbg.dbg_txpipe]++;
+		sc->tulip_dbg.dbg_txpipe = 0;
 #endif
 	    }
 	}

>Audit-Trail:
>Unformatted: