CVS commit: src/sys/arch/next68k/dev

2020-01-28 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jan 29 05:31:10 UTC 2020

Modified Files:
src/sys/arch/next68k/dev: mb8795.c

Log Message:
Adopt .


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/next68k/dev/mb8795.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/next68k/dev/mb8795.c
diff -u src/sys/arch/next68k/dev/mb8795.c:1.65 src/sys/arch/next68k/dev/mb8795.c:1.66
--- src/sys/arch/next68k/dev/mb8795.c:1.65	Wed May 29 10:07:29 2019
+++ src/sys/arch/next68k/dev/mb8795.c	Wed Jan 29 05:31:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mb8795.c,v 1.65 2019/05/29 10:07:29 msaitoh Exp $	*/
+/*	$NetBSD: mb8795.c,v 1.66 2020/01/29 05:31:10 thorpej Exp $	*/
 /*
  * Copyright (c) 1998 Darrin B. Jewell
  * All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mb8795.c,v 1.65 2019/05/29 10:07:29 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mb8795.c,v 1.66 2020/01/29 05:31:10 thorpej Exp $");
 
 #include "opt_inet.h"
 
@@ -283,7 +283,7 @@ mb8795_rint(struct mb8795_softc *sc)
 	}
 
 	if (error) {
-		ifp->if_ierrors++;
+		if_statinc(ifp, if_ierrors);
 		/* @@@ handle more gracefully, free memory, etc. */
 	}
 
@@ -385,20 +385,20 @@ mb8795_tint(struct mb8795_softc *sc)
 
 	if (txstat & MB8795_TXSTAT_SHORTED) {
 		printf("%s: tx cable shorted\n", device_xname(sc->sc_dev));
-		ifp->if_oerrors++;
+		if_statinc(ifp, if_oerrors);
 	}
 	if (txstat & MB8795_TXSTAT_UNDERFLOW) {
 		printf("%s: tx underflow\n", device_xname(sc->sc_dev));
-		ifp->if_oerrors++;
+		if_statinc(ifp, if_oerrors);
 	}
 	if (txstat & MB8795_TXSTAT_COLLERR) {
 		DPRINTF(("%s: tx collision\n", device_xname(sc->sc_dev)));
-		ifp->if_collisions++;
+		if_statinc(ifp, if_collisions);
 	}
 	if (txstat & MB8795_TXSTAT_COLLERR16) {
 		printf("%s: tx 16th collision\n", device_xname(sc->sc_dev));
-		ifp->if_oerrors++;
-		ifp->if_collisions += 16;
+		if_statinc(ifp, if_oerrors);
+		if_statadd(ifp, if_collisions, 16);
 	}
 
 #if 0
@@ -483,10 +483,7 @@ mb8795_watchdog(struct ifnet *ifp)
 	struct mb8795_softc *sc = ifp->if_softc;
 
 	log(LOG_ERR, "%s: device timeout\n", device_xname(sc->sc_dev));
-	++ifp->if_oerrors;
-
-	DPRINTF(("%s: %lld input errors, %lld input packets\n",
-		device_xname(sc->sc_dev), ifp->if_ierrors, ifp->if_ipackets));
+	if_statinc(ifp, if_oerrors);
 
 	ifp->if_flags &= ~IFF_RUNNING;
 	mb8795_init(sc);
@@ -762,7 +759,7 @@ mb8795_start_dma(struct mb8795_softc *sc
 		MB_WRITE_REG(sc, MB8795_TXMODE,
 		MB8795_TXMODE_TURBO1 | MB8795_TXMODE_TURBOSTART);
 
-	ifp->if_opackets++;
+	if_statinc(ifp, if_opackets);
 }
 
 //



CVS commit: src/sys/arch/next68k/dev

2019-04-25 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Apr 25 08:31:33 UTC 2019

Modified Files:
src/sys/arch/next68k/dev: if_xe.c

Log Message:
- KNF.
- Use __arraycount.
- Remove extra 'n' from debug printf.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/next68k/dev/if_xe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/next68k/dev/if_xe.c
diff -u src/sys/arch/next68k/dev/if_xe.c:1.24 src/sys/arch/next68k/dev/if_xe.c:1.25
--- src/sys/arch/next68k/dev/if_xe.c:1.24	Fri Jun 10 13:27:12 2016
+++ src/sys/arch/next68k/dev/if_xe.c	Thu Apr 25 08:31:33 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_xe.c,v 1.24 2016/06/10 13:27:12 ozaki-r Exp $	*/
+/*	$NetBSD: if_xe.c,v 1.25 2019/04/25 08:31:33 msaitoh Exp $	*/
 /*
  * Copyright (c) 1998 Darrin B. Jewell
  * All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_xe.c,v 1.24 2016/06/10 13:27:12 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_xe.c,v 1.25 2019/04/25 08:31:33 msaitoh Exp $");
 
 #include "opt_inet.h"
 
@@ -82,26 +82,26 @@ void	xe_attach(device_t, device_t, void 
 int	xe_tint(void *);
 int	xe_rint(void *);
 
-struct mbuf * xe_dma_rxmap_load(struct mb8795_softc *, bus_dmamap_t);
+struct mbuf *xe_dma_rxmap_load(struct mb8795_softc *, bus_dmamap_t);
 
 bus_dmamap_t xe_dma_rx_continue(void *);
-void xe_dma_rx_completed(bus_dmamap_t, void *);
+void	xe_dma_rx_completed(bus_dmamap_t, void *);
 bus_dmamap_t xe_dma_tx_continue(void *);
-void xe_dma_tx_completed(bus_dmamap_t, void *);
-void xe_dma_rx_shutdown(void *);
-void xe_dma_tx_shutdown(void *);
+void	xe_dma_tx_completed(bus_dmamap_t, void *);
+void	xe_dma_rx_shutdown(void *);
+void	xe_dma_tx_shutdown(void *);
 
-static void	findchannel_defer(device_t);
+static void findchannel_defer(device_t);
 
 CFATTACH_DECL_NEW(xe, sizeof(struct xe_softc),
 xe_match, xe_attach, NULL, NULL);
 
 static int xe_dma_medias[] = {
-	IFM_ETHER|IFM_AUTO,
-	IFM_ETHER|IFM_10_T,
-	IFM_ETHER|IFM_10_2,
+	IFM_ETHER | IFM_AUTO,
+	IFM_ETHER | IFM_10_T,
+	IFM_ETHER | IFM_10_2,
 };
-static int nxe_dma_medias = (sizeof(xe_dma_medias)/sizeof(xe_dma_medias[0]));
+static int nxe_dma_medias = __arraycount(xe_dma_medias);
 
 static int attached = 0;
 
@@ -138,11 +138,11 @@ xe_match(device_t parent, cfdata_t match
 	struct intio_attach_args *ia = (struct intio_attach_args *)aux;
 
 	if (attached)
-		return (0);
+		return 0;
 
 	ia->ia_addr = (void *)NEXT_P_ENET;
 
-	return (1);
+	return 1;
 }
 
 static void
@@ -180,17 +180,17 @@ findchannel_defer(device_t self)
 
 	/* Initialize the DMA maps */
 	error = bus_dmamap_create(xsc->sc_txdma->sc_dmat, MCLBYTES,
-  (MCLBYTES/MSIZE), MCLBYTES, 0, BUS_DMA_ALLOCNOW,
-  >sc_tx_dmamap);
+	(MCLBYTES/MSIZE), MCLBYTES, 0, BUS_DMA_ALLOCNOW,
+	>sc_tx_dmamap);
 	if (error) {
-		aprint_error_dev(sc->sc_dev, "can't create tx DMA map, error = %d",
-		  error);
+		aprint_error_dev(sc->sc_dev,
+		"can't create tx DMA map, error = %d", error);
 	}
 
 	for(i = 0; i < MB8795_NRXBUFS; i++) {
 		error = bus_dmamap_create(xsc->sc_rxdma->sc_dmat, MCLBYTES,
-	  (MCLBYTES/MSIZE), MCLBYTES, 0, BUS_DMA_ALLOCNOW,
-	  >sc_rx_dmamap[i]);
+		(MCLBYTES/MSIZE), MCLBYTES, 0, BUS_DMA_ALLOCNOW,
+		>sc_rx_dmamap[i]);
 		if (error) {
 			panic("%s: can't create rx DMA map, error = %d",
 			  device_xname(sc->sc_dev), error);
@@ -207,7 +207,8 @@ findchannel_defer(device_t self)
 	 */
 	xsc->sc_txbuf = malloc(2000, M_DEVBUF, M_NOWAIT);
 	if (!xsc->sc_txbuf)
-		panic("%s: can't malloc tx DMA buffer", device_xname(sc->sc_dev));
+		panic("%s: can't malloc tx DMA buffer",
+		device_xname(sc->sc_dev));
 	
 	xsc->sc_tx_mb_head = NULL;
 	xsc->sc_tx_loaded = 0;
@@ -231,11 +232,12 @@ xe_attach(device_t parent, device_t self
 	DPRINTF(("%s: xe_attach()\n", device_xname(self)));
 
 	{
-		extern u_char rom_enetaddr[6]; /* kludge from machdep.c:next68k_bootargs() */
+		/* kludge from machdep.c:next68k_bootargs() */
+		extern u_char rom_enetaddr[6];
 		int i;
-		for(i=0;i<6;i++) {
+
+		for (i = 0; i < 6; i++)
 			sc->sc_enaddr[i] = rom_enetaddr[i];
-		}
 	}
 
 	printf("\n%s: MAC address %02x:%02x:%02x:%02x:%02x:%02x\n",
@@ -252,23 +254,18 @@ xe_attach(device_t parent, device_t self
 
 	sc->sc_bmap_bst = ia->ia_bst;
 	if (bus_space_map(sc->sc_bmap_bst, NEXT_P_BMAP,
-			  BMAP_SIZE, 0, >sc_bmap_bsh)) {
-		panic("\n%s: can't map bmap registers",
-		  device_xname(self));
-	}
+	BMAP_SIZE, 0, >sc_bmap_bsh))
+		panic("\n%s: can't map bmap registers", device_xname(self));
 
-	/*
-	 * Set up glue for MI code.
-	 */
+	/* Set up glue for MI code. */
 	sc->sc_glue = _glue;
 
 	xsc->sc_txdma = nextdma_findchannel("enetx");
 	xsc->sc_rxdma = nextdma_findchannel("enetr");
-	if (xsc->sc_rxdma && xsc->sc_txdma) {
+	if (xsc->sc_rxdma && xsc->sc_txdma)
 		findchannel_defer(self);
-	} else {
+	else
 		config_defer(self, 

CVS commit: src/sys/arch/next68k/dev

2019-04-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Apr 24 07:32:50 UTC 2019

Modified Files:
src/sys/arch/next68k/dev: mb8795.c

Log Message:
 KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/next68k/dev/mb8795.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/next68k/dev/mb8795.c
diff -u src/sys/arch/next68k/dev/mb8795.c:1.61 src/sys/arch/next68k/dev/mb8795.c:1.62
--- src/sys/arch/next68k/dev/mb8795.c:1.61	Tue Feb  5 06:17:01 2019
+++ src/sys/arch/next68k/dev/mb8795.c	Wed Apr 24 07:32:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: mb8795.c,v 1.61 2019/02/05 06:17:01 msaitoh Exp $	*/
+/*	$NetBSD: mb8795.c,v 1.62 2019/04/24 07:32:50 msaitoh Exp $	*/
 /*
  * Copyright (c) 1998 Darrin B. Jewell
  * All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mb8795.c,v 1.61 2019/02/05 06:17:01 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mb8795.c,v 1.62 2019/04/24 07:32:50 msaitoh Exp $");
 
 #include "opt_inet.h"
 
@@ -87,10 +87,10 @@ extern int turbo;
  * and the Fujitsu Manchester Encoder/Decoder (MB502).
  */
 
-void mb8795_shutdown(void *);
+void	mb8795_shutdown(void *);
 
 bus_dmamap_t mb8795_txdma_restart(bus_dmamap_t, void *);
-void mb8795_start_dma(struct mb8795_softc *);
+void	mb8795_start_dma(struct mb8795_softc *);
 
 int	mb8795_mediachange(struct ifnet *);
 void	mb8795_mediastatus(struct ifnet *, struct ifmediareq *);
@@ -100,7 +100,7 @@ mb8795_config(struct mb8795_softc *sc, i
 {
 	struct ifnet *ifp = >sc_ethercom.ec_if;
 
-	DPRINTF(("%s: mb8795_config()\n",device_xname(sc->sc_dev)));
+	DPRINTF(("%s: mb8795_config()\n", device_xname(sc->sc_dev)));
 
 	/* Initialize ifnet structure. */
 	memcpy(ifp->if_xname, device_xname(sc->sc_dev), IFNAMSIZ);
@@ -119,22 +119,22 @@ mb8795_config(struct mb8795_softc *sc, i
 			ifmedia_add(>sc_media, media[i], 0, NULL);
 		ifmedia_set(>sc_media, defmedia);
 	} else {
-		ifmedia_add(>sc_media, IFM_ETHER|IFM_MANUAL, 0, NULL);
-		ifmedia_set(>sc_media, IFM_ETHER|IFM_MANUAL);
+		ifmedia_add(>sc_media, IFM_ETHER | IFM_MANUAL, 0, NULL);
+		ifmedia_set(>sc_media, IFM_ETHER | IFM_MANUAL);
 	}
 
-  /* Attach the interface. */
-  if_attach(ifp);
-  ether_ifattach(ifp, sc->sc_enaddr);
+	/* Attach the interface. */
+	if_attach(ifp);
+	ether_ifattach(ifp, sc->sc_enaddr);
 
-  sc->sc_sh = shutdownhook_establish(mb8795_shutdown, sc);
-  if (sc->sc_sh == NULL)
-panic("mb8795_config: can't establish shutdownhook");
+	sc->sc_sh = shutdownhook_establish(mb8795_shutdown, sc);
+	if (sc->sc_sh == NULL)
+		panic("mb8795_config: can't establish shutdownhook");
 
-  rnd_attach_source(>rnd_source, device_xname(sc->sc_dev),
-RND_TYPE_NET, RND_FLAG_DEFAULT);
+	rnd_attach_source(>rnd_source, device_xname(sc->sc_dev),
+	RND_TYPE_NET, RND_FLAG_DEFAULT);
 
-	DPRINTF(("%s: leaving mb8795_config()\n",device_xname(sc->sc_dev)));
+	DPRINTF(("%s: leaving mb8795_config()\n", device_xname(sc->sc_dev)));
 }
 
 /*
@@ -147,14 +147,14 @@ mb8795_mediachange(struct ifnet *ifp)
 	int data;
 
 	if (turbo)
-		return (0);
+		return 0;
 
 	switch IFM_SUBTYPE(sc->sc_media.ifm_media) {
 	case IFM_AUTO:
-		if ((bus_space_read_1(sc->sc_bmap_bst, sc->sc_bmap_bsh, BMAP_DATA) &
-		 BMAP_DATA_UTPENABLED_MASK) ||
-		!(bus_space_read_1(sc->sc_bmap_bst, sc->sc_bmap_bsh, BMAP_DATA) &
-		  BMAP_DATA_UTPCARRIER_MASK)) {
+		if ((bus_space_read_1(sc->sc_bmap_bst, sc->sc_bmap_bsh,
+			BMAP_DATA) & BMAP_DATA_UTPENABLED_MASK) ||
+		!(bus_space_read_1(sc->sc_bmap_bst, sc->sc_bmap_bsh,
+			BMAP_DATA) & BMAP_DATA_UTPCARRIER_MASK)) {
 			data = BMAP_DATA_UTPENABLE;
 			sc->sc_media.ifm_cur->ifm_data = IFM_ETHER|IFM_10_T;
 		} else {
@@ -169,7 +169,7 @@ mb8795_mediachange(struct ifnet *ifp)
 		data = BMAP_DATA_BNCENABLE;
 		break;
 	default:
-		return (1);
+		return 1;
 		break;
 	}
 
@@ -178,7 +178,7 @@ mb8795_mediachange(struct ifnet *ifp)
 	bus_space_write_1(sc->sc_bmap_bst, sc->sc_bmap_bsh,
 			  BMAP_DATA, data);
 
-	return (0);
+	return 0;
 }
 
 /*
@@ -192,17 +192,17 @@ mb8795_mediastatus(struct ifnet *ifp, st
 	if (turbo)
 		return;
 
-	if (IFM_SUBTYPE(ifmr->ifm_active) == IFM_AUTO) {
+	if (IFM_SUBTYPE(ifmr->ifm_active) == IFM_AUTO)
 		ifmr->ifm_active = sc->sc_media.ifm_cur->ifm_data;
-	}
+
 	if (IFM_SUBTYPE(ifmr->ifm_active) == IFM_10_T) {
 		ifmr->ifm_status = IFM_AVALID;
-		if (!(bus_space_read_1(sc->sc_bmap_bst, sc->sc_bmap_bsh, BMAP_DATA) &
-		  BMAP_DATA_UTPCARRIER_MASK))
+		if (!(bus_space_read_1(sc->sc_bmap_bst, sc->sc_bmap_bsh,
+		BMAP_DATA) & BMAP_DATA_UTPCARRIER_MASK))
 			ifmr->ifm_status |= IFM_ACTIVE;
-	} else {
+	} else
 		ifmr->ifm_status &= ~IFM_AVALID; /* don't know for 10_2 */
-	}
+
 	return;
 }
 
@@ -223,11 +223,14 @@ mb8795_hex_dump(unsigned char *pkt, size
 		if ((i+1) % 16 == 0) {
 			printf(" %c", '|');
 			for(j=0; j<16; j++) {
-printf("%c", 

CVS commit: src/sys/arch/next68k/dev

2017-05-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May  1 10:25:47 UTC 2017

Modified Files:
src/sys/arch/next68k/dev: zs.c

Log Message:
PR port-next68k/52205 from Miod Vallat: cosmetic change to print the
physical address when attaching zs devices.
For the real work, zs_get_chan_addr() will still use the virtual address.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/next68k/dev/zs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/next68k/dev/zs.c
diff -u src/sys/arch/next68k/dev/zs.c:1.33 src/sys/arch/next68k/dev/zs.c:1.34
--- src/sys/arch/next68k/dev/zs.c:1.33	Fri Jun 13 12:26:55 2008
+++ src/sys/arch/next68k/dev/zs.c	Mon May  1 10:25:47 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: zs.c,v 1.33 2008/06/13 12:26:55 cegger Exp $	*/
+/*	$NetBSD: zs.c,v 1.34 2017/05/01 10:25:47 martin Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.33 2008/06/13 12:26:55 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.34 2017/05/01 10:25:47 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -183,7 +183,7 @@ zs_match(device_t parent, cfdata_t cf, v
 	if (zs_attached)
 		return 0;
 
-	ia->ia_addr = (void *)IIOV(NEXT_P_SCC);
+	ia->ia_addr = (void *)NEXT_P_SCC;
 
 	return 1;
 }



CVS commit: src/sys/arch/next68k/dev

2014-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Mar 29 19:20:14 UTC 2014

Modified Files:
src/sys/arch/next68k/dev: esp.c

Log Message:
fix misplaced line


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/next68k/dev/esp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/next68k/dev/esp.c
diff -u src/sys/arch/next68k/dev/esp.c:1.62 src/sys/arch/next68k/dev/esp.c:1.63
--- src/sys/arch/next68k/dev/esp.c:1.62	Thu Mar 27 14:22:56 2014
+++ src/sys/arch/next68k/dev/esp.c	Sat Mar 29 15:20:14 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: esp.c,v 1.62 2014/03/27 18:22:56 christos Exp $	*/
+/*	$NetBSD: esp.c,v 1.63 2014/03/29 19:20:14 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: esp.c,v 1.62 2014/03/27 18:22:56 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: esp.c,v 1.63 2014/03/29 19:20:14 christos Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -1186,9 +1186,9 @@ esp_dma_store(struct ncr53c9x_softc *sc)
 		return;
 
 	l += snprintf(p + l, len - l, %s: sc_begin = %p, sc_begin_size = 0x%08x\n,
+	device_xname(sc-sc_dev), esc-sc_begin, esc-sc_begin_size);
 	if (l  len)
 		return;
-	device_xname(sc-sc_dev), esc-sc_begin, esc-sc_begin_size);
 	l += snprintf(p + l, len - l, %s: sc_main = %p, sc_main_size = 0x%08x\n,
 	device_xname(sc-sc_dev), esc-sc_main, esc-sc_main_size);
 	if (l  len)



CVS commit: src/sys/arch/next68k/dev

2014-03-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar 25 19:41:32 UTC 2014

Modified Files:
src/sys/arch/next68k/dev: esp.c if_xe.c nextdma.c nextdmavar.h

Log Message:
fix sprintf debugging mess.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/next68k/dev/esp.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/next68k/dev/if_xe.c
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/next68k/dev/nextdma.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/next68k/dev/nextdmavar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/next68k/dev/esp.c
diff -u src/sys/arch/next68k/dev/esp.c:1.60 src/sys/arch/next68k/dev/esp.c:1.61
--- src/sys/arch/next68k/dev/esp.c:1.60	Sat Oct 27 13:18:05 2012
+++ src/sys/arch/next68k/dev/esp.c	Tue Mar 25 15:41:32 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: esp.c,v 1.60 2012/10/27 17:18:05 chs Exp $	*/
+/*	$NetBSD: esp.c,v 1.61 2014/03/25 19:41:32 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: esp.c,v 1.60 2012/10/27 17:18:05 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: esp.c,v 1.61 2014/03/25 19:41:32 christos Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -118,10 +118,7 @@ __KERNEL_RCSID(0, $NetBSD: esp.c,v 1.60
 #ifdef ESP_DEBUG
 int esp_debug = 0;
 #define DPRINTF(x) if (esp_debug) printf x;
-extern char *ndtracep;
-extern char ndtrace[];
-extern int ndtraceshow;
-#define NDTRACEIF(x) if (10  ndtracep  (ndtrace + 8192)) do {x;} while (0)
+#define NDTRACEIF(x) if (10) do {x;} while (0)
 #else
 #define DPRINTF(x)
 #define NDTRACEIF(x)
@@ -145,6 +142,7 @@ struct ncr53c9x_softc *esp_debug_sc = 0;
 void esp_dma_store(struct ncr53c9x_softc *);
 void esp_dma_print(struct ncr53c9x_softc *);
 int esp_dma_nest = 0;
+int esptraceshow;
 #endif
 
 
@@ -461,7 +459,7 @@ esp_dma_isintr(struct ncr53c9x_softc *sc
 	struct esp_softc *esc = (struct esp_softc *)sc;
 
 	if (INTR_OCCURRED(NEXT_I_SCSI)) {
-		NDTRACEIF (*ndtracep++ = 'i');
+		NDTRACEIF (ndtrace_addc('i'));
 		NCR_WRITE_REG(sc, ESP_DCTL,
 		ESPDCTL_16MHZ | ESPDCTL_INTENB |
 		(esc-sc_datain ? ESPDCTL_DMARD : 0));
@@ -487,7 +485,7 @@ esp_dma_intr(struct ncr53c9x_softc *sc)
 
 	r = 1;
 
-	NDTRACEIF (*ndtracep++ = 'I');
+	NDTRACEIF (ndtrace_addc('I'));
 	if (r) {
 		/* printf (esp_dma_isintr start\n); */
 		{
@@ -513,14 +511,13 @@ esp_dma_intr(struct ncr53c9x_softc *sc)
 
 			while (!nextdma_finished(nsc)) {
 			/* esp_dma_isactive(sc)) { */
-NDTRACEIF (*ndtracep++ = 'w');
+NDTRACEIF (ndtrace_addc('w'));
 NDTRACEIF (
-	sprintf(ndtracep, f%dm%dl%dw,
+	ndtrace_printf(f%dm%dl%dw,
 	NCR_READ_REG(sc, NCR_FFLAG) 
 	NCRFIFO_FF,
 	NCR_READ_REG((sc), NCR_TCM),
 	NCR_READ_REG((sc), NCR_TCL));
-	ndtracep += strlen(ndtracep);
 );
 if (NCR_READ_REG(sc, NCR_FFLAG)  NCRFIFO_FF)
 	flushcount = 5;
@@ -535,7 +532,7 @@ esp_dma_intr(struct ncr53c9x_softc *sc)
 (nd_bsr4 (DD_CSR)  0x0800) == 0
    ++flushcount  5) {
 	splx(s);
-	NDTRACEIF (*ndtracep++ = 'F');
+	NDTRACEIF (ndtrace_addc('F'));
 	NCR_WRITE_REG(sc, ESP_DCTL,
 	ESPDCTL_FLUSH | ESPDCTL_16MHZ |
 	ESPDCTL_INTENB | ESPDCTL_DMAMOD |
@@ -550,7 +547,7 @@ esp_dma_intr(struct ncr53c9x_softc *sc)
 	doze(0x32);
 	s = spldma();
 }
-NDTRACEIF (*ndtracep++ = '0' + flushcount);
+NDTRACEIF (ndtrace_addc('0' + flushcount));
 if (flushcount  4) {
 	int next;
 	int onext = 0;
@@ -563,18 +560,17 @@ esp_dma_intr(struct ncr53c9x_softc *sc)
 		onext = next;
 		DELAY(50);
 	}
-	NDTRACEIF (*ndtracep++ = 'R');
+	NDTRACEIF (ndtrace_addc('R'));
 	NCR_WRITE_REG(sc, ESP_DCTL,
 	ESPDCTL_16MHZ | ESPDCTL_INTENB);
 	NDTRACEIF (
-		sprintf(ndtracep,
+		ndtrace_printf(
 		ff:%d tcm:%d tcl:%d ,
 		NCR_READ_REG(sc, NCR_FFLAG)
 		 NCRFIFO_FF,
 		NCR_READ_REG((sc), NCR_TCM),
 		NCR_READ_REG((sc),
 		NCR_TCL));
-		ndtracep += strlen (ndtracep);
 		);
 	s = spldma();
 	nextdma_reset (nsc);
@@ -585,7 +581,7 @@ esp_dma_intr(struct ncr53c9x_softc *sc)
 
 #ifdef DIAGNOSTIC
 if (flushcount  4) {
-	NDTRACEIF (*ndtracep++ = '+');
+	NDTRACEIF (ndtrace_addc('+'));
 	printf(%s: unexpected flushcount
 	 %d on %s\n,
 	device_xname(sc-sc_dev),
@@ -596,7 +592,7 @@ esp_dma_intr(struct ncr53c9x_softc *sc)
 
 if (!nextdma_finished(nsc)) {
 /* esp_dma_isactive(sc)) { */
-	NDTRACEIF (*ndtracep++ = '1');
+	NDTRACEIF (ndtrace_addc('1'));
 }
 flushcount = 0;
 s = spldma();
@@ -618,7 +614,7 @@ esp_dma_intr(struct ncr53c9x_softc *sc)
 		NCR_WRITE_REG(sc, ESP_DCTL,
 		ESPDCTL_16MHZ | ESPDCTL_INTENB |
 		(esc-sc_datain ? ESPDCTL_DMARD : 0));
-		NDTRACEIF (*ndtracep++ = 'b');
+		NDTRACEIF (ndtrace_addc('b'));
 
 		

CVS commit: src/sys/arch/next68k/dev

2011-01-02 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jan  2 08:19:03 UTC 2011

Modified Files:
src/sys/arch/next68k/dev: intiovar.h

Log Message:
Explicitly include machine/bus.h here for bus_space_tag_t and bus_dma_tag_t.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/next68k/dev/intiovar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/next68k/dev/intiovar.h
diff -u src/sys/arch/next68k/dev/intiovar.h:1.6 src/sys/arch/next68k/dev/intiovar.h:1.7
--- src/sys/arch/next68k/dev/intiovar.h:1.6	Mon Apr 28 20:23:30 2008
+++ src/sys/arch/next68k/dev/intiovar.h	Sun Jan  2 08:19:03 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: intiovar.h,v 1.6 2008/04/28 20:23:30 martin Exp $	*/
+/*	$NetBSD: intiovar.h,v 1.7 2011/01/02 08:19:03 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -34,6 +34,8 @@
  * internal i/o space.
  */
 
+#include machine/bus.h
+
 /*
  * Arguments used to attach a device to the internal i/o space.
  */



CVS commit: src/sys/arch/next68k/dev

2010-06-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jun  6 02:51:46 UTC 2010

Modified Files:
src/sys/arch/next68k/dev: nextdma.c

Log Message:
fix some errors in debug code, found by henning petersen in PR#42529.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/next68k/dev/nextdma.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/next68k/dev/nextdma.c
diff -u src/sys/arch/next68k/dev/nextdma.c:1.46 src/sys/arch/next68k/dev/nextdma.c:1.47
--- src/sys/arch/next68k/dev/nextdma.c:1.46	Sat Apr 24 19:58:13 2010
+++ src/sys/arch/next68k/dev/nextdma.c	Sun Jun  6 02:51:46 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: nextdma.c,v 1.46 2010/04/24 19:58:13 dbj Exp $	*/
+/*	$NetBSD: nextdma.c,v 1.47 2010/06/06 02:51:46 mrg Exp $	*/
 /*
  * Copyright (c) 1998 Darrin B. Jewell
  * All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nextdma.c,v 1.46 2010/04/24 19:58:13 dbj Exp $);
+__KERNEL_RCSID(0, $NetBSD: nextdma.c,v 1.47 2010/06/06 02:51:46 mrg Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -204,7 +204,7 @@
 		char sbuf[256];
 
 		snprintb(sbuf, sizeof(sbuf), NEXT_INTR_BITS,
-		(NEXT_I_BIT(nsc-sc_chan-nd_intr));
+		NEXT_I_BIT(nsc-sc_chan-nd_intr));
 		printf(DMA init ipl (%ld) intr(0x%s)\n,
 			NEXT_I_IPL(nsc-sc_chan-nd_intr), sbuf);
 	}
@@ -488,7 +488,7 @@
 		char sbuf[256];
 
 		snprintb(sbuf, sizeof(sbuf), NEXT_INTR_BITS,
-		(NEXT_I_BIT(nsc-sc_chan-nd_intr));
+		NEXT_I_BIT(nsc-sc_chan-nd_intr));
 		printf(DMA interrupt ipl (%ld) intr(0x%s)\n,
 		   NEXT_I_IPL(nsc-sc_chan-nd_intr), sbuf);
 	}
@@ -901,7 +901,7 @@
 	printf(NDMAP: dd-dd_stop = 0x%08lx\n, dd_stop);
 
 	snprintb(sbuf, sizeof(sbuf), NEXT_INTR_BITS,
-	(NEXT_I_BIT(nsc-sc_chan-nd_intr)));
+	NEXT_I_BIT(nsc-sc_chan-nd_intr));
 	printf(NDMAP: interrupt ipl (%ld) intr(0x%s)\n,
 			NEXT_I_IPL(nsc-sc_chan-nd_intr), sbuf);
 }