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

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

Modified Files:
src/sys/arch/playstation2/dev: if_smap.c

Log Message:
Adopt .


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/playstation2/dev/if_smap.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/playstation2/dev/if_smap.c
diff -u src/sys/arch/playstation2/dev/if_smap.c:1.31 src/sys/arch/playstation2/dev/if_smap.c:1.32
--- src/sys/arch/playstation2/dev/if_smap.c:1.31	Sun Nov 10 21:16:31 2019
+++ src/sys/arch/playstation2/dev/if_smap.c	Wed Jan 29 05:32:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smap.c,v 1.31 2019/11/10 21:16:31 chs Exp $	*/
+/*	$NetBSD: if_smap.c,v 1.32 2020/01/29 05:32:04 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_smap.c,v 1.31 2019/11/10 21:16:31 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_smap.c,v 1.32 2020/01/29 05:32:04 thorpej Exp $");
 
 #include "debug_playstation2.h"
 
@@ -336,7 +336,7 @@ smap_rxeof(void *arg)
 		if ((stat & SMAP_RXDESC_EMPTY) != 0) {
 			break;
 		} else if (stat & 0x7fff) {
-			ifp->if_ierrors++;
+			if_statinc(ifp, if_ierrors);
 			goto next_packet;
 		}
 
@@ -357,7 +357,7 @@ smap_rxeof(void *arg)
 		MGETHDR(m, M_DONTWAIT, MT_DATA);
 		if (m == NULL) {
 			printf("%s: unable to allocate Rx mbuf\n", DEVNAME);
-			ifp->if_ierrors++;
+			if_statinc(ifp, if_ierrors);
 			goto next_packet;
 		}
 
@@ -368,7 +368,7 @@ smap_rxeof(void *arg)
 DEVNAME);
 m_freem(m);
 m = NULL;
-ifp->if_ierrors++;
+if_statinc(ifp, if_ierrors);
 goto next_packet;
 			}
 		}
@@ -426,11 +426,11 @@ smap_txeof(void *arg)
 		} else if (stat & 0x7fff) {
 			if (stat & (SMAP_TXDESC_ECOLL | SMAP_TXDESC_LCOLL |
 			SMAP_TXDESC_MCOLL | SMAP_TXDESC_SCOLL))
-ifp->if_collisions++;
+if_statinc(ifp, if_collisions);
 			else
-ifp->if_oerrors++;
+if_statinc(ifp, if_oerrors);
 		} else {
-			ifp->if_opackets++;
+			if_statinc(ifp, if_opackets);
 		}
 
 		if (sc->tx_desc_cnt == 0)
@@ -546,7 +546,7 @@ smap_watchdog(struct ifnet *ifp)
 	struct smap_softc *sc = ifp->if_softc;
 
 	printf("%s: watchdog timeout\n", DEVNAME);
-	sc->ethercom.ec_if.if_oerrors++;
+	if_statinc(ifp, if_oerrors);
 
 	smap_fifo_init(sc);
 	smap_desc_init(sc);



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

2019-01-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Jan 11 08:30:19 UTC 2019

Modified Files:
src/sys/arch/playstation2/dev: emac3.c

Log Message:
 Add missing semicolon.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/playstation2/dev/emac3.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/playstation2/dev/emac3.c
diff -u src/sys/arch/playstation2/dev/emac3.c:1.11 src/sys/arch/playstation2/dev/emac3.c:1.12
--- src/sys/arch/playstation2/dev/emac3.c:1.11	Sun Apr  3 10:03:04 2016
+++ src/sys/arch/playstation2/dev/emac3.c	Fri Jan 11 08:30:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: emac3.c,v 1.11 2016/04/03 10:03:04 martin Exp $	*/
+/*	$NetBSD: emac3.c,v 1.12 2019/01/11 08:30:19 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: emac3.c,v 1.11 2016/04/03 10:03:04 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emac3.c,v 1.12 2019/01/11 08:30:19 msaitoh Exp $");
 
 #include "debug_playstation2.h"
 
@@ -248,7 +248,7 @@ allmulti:
 		ETHER_ADDR_LEN) != 0)
 			goto allmulti;
 
-		ETHER_NEXT_MULTI(step, enm)
+		ETHER_NEXT_MULTI(step, enm);
 	}
 
 	/* XXX always multicast promiscuous mode. XXX use hash table.. */



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

2016-07-18 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Jul 18 22:07:38 UTC 2016

Modified Files:
src/sys/arch/playstation2/dev: sbus.c

Log Message:
Don't use old-style definitions.
Appeases GCC.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/playstation2/dev/sbus.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/playstation2/dev/sbus.c
diff -u src/sys/arch/playstation2/dev/sbus.c:1.14 src/sys/arch/playstation2/dev/sbus.c:1.15
--- src/sys/arch/playstation2/dev/sbus.c:1.14	Mon Jul 18 22:05:53 2016
+++ src/sys/arch/playstation2/dev/sbus.c	Mon Jul 18 22:07:38 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: sbus.c,v 1.14 2016/07/18 22:05:53 maya Exp $	*/
+/*	$NetBSD: sbus.c,v 1.15 2016/07/18 22:07:38 maya Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sbus.c,v 1.14 2016/07/18 22:05:53 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbus.c,v 1.15 2016/07/18 22:07:38 maya Exp $");
 
 #include 
 #include 
@@ -247,7 +247,7 @@ sbus_spurious_intr(void *arg)
 
 /* SCPH-18000 */
 void
-sbus_type2_pcmcia_intr_clear()
+sbus_type2_pcmcia_intr_clear(void)
 {
 
 	if (_reg_read_2(SBUS_PCMCIA_CSC1_REG16) & 0x080)
@@ -255,21 +255,21 @@ sbus_type2_pcmcia_intr_clear()
 }
 
 void
-sbus_type2_pcmcia_intr_enable()
+sbus_type2_pcmcia_intr_enable(void)
 {
 
 	_reg_write_2(SBUS_PCMCIA_TIMR_REG16, 0);
 }
 
 void
-sbus_type2_pcmcia_intr_disable()
+sbus_type2_pcmcia_intr_disable(void)
 {
 
 	_reg_write_2(SBUS_PCMCIA_TIMR_REG16, 1);
 }
 
 void
-sbus_type2_pcmcia_intr_reinstall()
+sbus_type2_pcmcia_intr_reinstall(void)
 {
 	u_int16_t r = _reg_read_2(SBUS_PCMCIA_TIMR_REG16);
 
@@ -279,27 +279,27 @@ sbus_type2_pcmcia_intr_reinstall()
 
 /* SCPH-3/35000 */
 void
-sbus_type3_pcmcia_intr_clear()
+sbus_type3_pcmcia_intr_clear(void)
 {
 	/* nothing */
 }
 
 void
-sbus_type3_pcmcia_intr_enable()
+sbus_type3_pcmcia_intr_enable(void)
 {
 
 	_reg_write_2(SBUS_PCMCIA3_TIMR_REG16, 0);
 }
 
 void
-sbus_type3_pcmcia_intr_disable()
+sbus_type3_pcmcia_intr_disable(void)
 {
 
 	_reg_write_2(SBUS_PCMCIA3_TIMR_REG16, 1);
 }
 
 void
-sbus_type3_pcmcia_intr_reinstall()
+sbus_type3_pcmcia_intr_reinstall(void)
 {
 	u_int16_t r = _reg_read_2(SBUS_PCMCIA3_TIMR_REG16);
 



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

2016-04-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Apr  3 10:03:05 UTC 2016

Modified Files:
src/sys/arch/playstation2/dev: emac3.c

Log Message:
Adopt to device_t/struct ifnet* changes


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/playstation2/dev/emac3.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/playstation2/dev/emac3.c
diff -u src/sys/arch/playstation2/dev/emac3.c:1.10 src/sys/arch/playstation2/dev/emac3.c:1.11
--- src/sys/arch/playstation2/dev/emac3.c:1.10	Mon Jul  7 10:12:24 2014
+++ src/sys/arch/playstation2/dev/emac3.c	Sun Apr  3 10:03:04 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: emac3.c,v 1.10 2014/07/07 10:12:24 martin Exp $	*/
+/*	$NetBSD: emac3.c,v 1.11 2016/04/03 10:03:04 martin Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: emac3.c,v 1.10 2014/07/07 10:12:24 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emac3.c,v 1.11 2016/04/03 10:03:04 martin Exp $");
 
 #include "debug_playstation2.h"
 
@@ -309,7 +309,7 @@ emac3_config(const u_int8_t *eaddr)
  * PHY/MII
  */
 void
-emac3_phy_writereg(struct device *self, int phy, int reg, int data)
+emac3_phy_writereg(device_t self, int phy, int reg, int data)
 {
 
 	if (emac3_phy_ready() != 0)
@@ -325,7 +325,7 @@ emac3_phy_writereg(struct device *self, 
 }
 
 int
-emac3_phy_readreg(struct device *self, int phy, int reg)
+emac3_phy_readreg(device_t self, int phy, int reg)
 {
 
 	if (emac3_phy_ready() != 0)
@@ -342,10 +342,10 @@ emac3_phy_readreg(struct device *self, i
 }
 
 void
-emac3_phy_statchg(struct device *dev)
+emac3_phy_statchg(struct ifnet *ifp)
 {
 #define EMAC3_FDX	(MR1_FDE | MR1_EIFC | MR1_APP)
-	struct emac3_softc *sc = (void *)dev;
+	struct emac3_softc *sc = ifp->if_softc;
 	int media;
 	u_int32_t r;
 	



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

2016-04-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Apr  3 10:01:52 UTC 2016

Modified Files:
src/sys/arch/playstation2/dev: emac3var.h

Log Message:
Use device_t/struct ifnet* for phy callbacks


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/playstation2/dev/emac3var.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/playstation2/dev/emac3var.h
diff -u src/sys/arch/playstation2/dev/emac3var.h:1.5 src/sys/arch/playstation2/dev/emac3var.h:1.6
--- src/sys/arch/playstation2/dev/emac3var.h:1.5	Mon Mar 31 11:25:49 2014
+++ src/sys/arch/playstation2/dev/emac3var.h	Sun Apr  3 10:01:52 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: emac3var.h,v 1.5 2014/03/31 11:25:49 martin Exp $	*/
+/*	$NetBSD: emac3var.h,v 1.6 2016/04/03 10:01:52 martin Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -53,6 +53,6 @@ int emac3_tx_done(void);
 
 void emac3_setmulti(struct emac3_softc *, struct ethercom *);
 
-int emac3_phy_readreg(struct device *, int, int);
-void emac3_phy_writereg(struct device *, int, int, int);
-void emac3_phy_statchg(struct device *);
+int emac3_phy_readreg(device_t, int, int);
+void emac3_phy_writereg(device_t, int, int, int);
+void emac3_phy_statchg(struct ifnet *);



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

2016-04-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Apr  3 09:58:45 UTC 2016

Modified Files:
src/sys/arch/playstation2/dev: if_smap.c

Log Message:
Fix bpf_mtap argument


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/playstation2/dev/if_smap.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/playstation2/dev/if_smap.c
diff -u src/sys/arch/playstation2/dev/if_smap.c:1.19 src/sys/arch/playstation2/dev/if_smap.c:1.20
--- src/sys/arch/playstation2/dev/if_smap.c:1.19	Tue Feb  9 08:32:09 2016
+++ src/sys/arch/playstation2/dev/if_smap.c	Sun Apr  3 09:58:45 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smap.c,v 1.19 2016/02/09 08:32:09 ozaki-r Exp $	*/
+/*	$NetBSD: if_smap.c,v 1.20 2016/04/03 09:58:45 martin Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,22 +30,21 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_smap.c,v 1.19 2016/02/09 08:32:09 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_smap.c,v 1.20 2016/04/03 09:58:45 martin Exp $");
 
 #include "debug_playstation2.h"
 
 #include 
 #include 
-
+#include 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
 
-#include 
-
 #include 
 #include 
 #include 
@@ -53,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_smap.c,v 
 #include 
 #include 
 
-#include 
 #include 
 
 #include 
@@ -119,7 +117,7 @@ struct smap_softc {
 STATIC int smap_match(struct device *, struct cfdata *, void *);
 STATIC void smap_attach(struct device *, struct device *, void *);
 
-CFATTACH_DECL(smap, sizeof (struct smap_softc),
+CFATTACH_DECL_NEW(smap, sizeof (struct smap_softc),
 smap_match, smap_attach, NULL, NULL);
 
 STATIC int smap_intr(void *);
@@ -260,7 +258,6 @@ int
 smap_ioctl(struct ifnet *ifp, u_long command, void *data)
 {
 	struct smap_softc *sc = ifp->if_softc;
-	struct ifreq *ifr = (struct ifreq *) data;
 	int error, s;
 
 	s = splnet();
@@ -409,7 +406,7 @@ smap_rxeof(void *arg)
 		
 		if (m != NULL) {
 			if (ifp->if_bpf)
-bpf_mtap(ifp->if_bpf, m);
+bpf_mtap(ifp, m);
 			if_percpuq_enqueue(ifp->if_percpuq, m);
 		}
 	}
@@ -509,7 +506,7 @@ smap_start(struct ifnet *ifp)
 		IFQ_DEQUEUE(&ifp->if_snd, m0);
 		KDASSERT(m0 != NULL);
 		if (ifp->if_bpf)
-			bpf_mtap(ifp->if_bpf, m0);
+			bpf_mtap(ifp, m0);
 
 		p = (u_int8_t *)sc->tx_buf;
 		q = p + sz;



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

2014-07-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jul  7 10:12:24 UTC 2014

Modified Files:
src/sys/arch/playstation2/dev: emac3.c

Log Message:
Add missing includes, use new style function declarations.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/playstation2/dev/emac3.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/playstation2/dev/emac3.c
diff -u src/sys/arch/playstation2/dev/emac3.c:1.9 src/sys/arch/playstation2/dev/emac3.c:1.10
--- src/sys/arch/playstation2/dev/emac3.c:1.9	Mon Mar 31 11:25:49 2014
+++ src/sys/arch/playstation2/dev/emac3.c	Mon Jul  7 10:12:24 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: emac3.c,v 1.9 2014/03/31 11:25:49 martin Exp $	*/
+/*	$NetBSD: emac3.c,v 1.10 2014/07/07 10:12:24 martin Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -34,14 +34,16 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: emac3.c,v 1.9 2014/03/31 11:25:49 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emac3.c,v 1.10 2014/07/07 10:12:24 martin Exp $");
 
 #include "debug_playstation2.h"
 
 #include 
 #include 
 
+#include 
 #include 
+#include 
 
 #include 
 #include 
@@ -62,7 +64,7 @@ int	emac3_debug = 0;
 		printf("%s: " fmt, __func__ , ##args) 
 #define	DPRINTFN(n, arg)		\
 	if (emac3_debug > (n))		\
-n		printf("%s: " fmt, __func__ , ##args) 
+		printf("%s: " fmt, __func__ , ##args) 
 #else
 #define STATIC			static
 #define	DPRINTF(arg...)		((void)0)
@@ -151,14 +153,14 @@ emac3_reset(struct emac3_softc *sc)
 }
 
 void
-emac3_enable()
+emac3_enable(void)
 {
 
 	_emac3_reg_write_4(EMAC3_MR0, MR0_TXE | MR0_RXE);
 }
 
 void
-emac3_disable()
+emac3_disable(void)
 {
 	int retry = 1;
 
@@ -175,21 +177,21 @@ emac3_disable()
 }
 
 void
-emac3_intr_enable()
+emac3_intr_enable(void)
 {
 
 	_emac3_reg_write_4(EMAC3_ISER, ~0);
 }
 
 void
-emac3_intr_disable()
+emac3_intr_disable(void)
 {
 
 	_emac3_reg_write_4(EMAC3_ISER, 0);
 }
 
 void
-emac3_intr_clear()
+emac3_intr_clear(void)
 {
 
 	_emac3_reg_write_4(EMAC3_ISR, _emac3_reg_read_4(EMAC3_ISR));
@@ -207,14 +209,14 @@ emac3_intr(void *arg)
 }
 
 void
-emac3_tx_kick()
+emac3_tx_kick(void)
 {
 	
 	_emac3_reg_write_4(EMAC3_TMR0, TMR0_GNP0);
 }
 
 int
-emac3_tx_done()
+emac3_tx_done(void)
 {
 
 	return (_emac3_reg_read_4(EMAC3_TMR0) & TMR0_GNP0);
@@ -256,7 +258,7 @@ allmulti:
 }
 
 int
-emac3_soft_reset()
+emac3_soft_reset(void)
 {
 	int retry = 1;
 
@@ -378,7 +380,7 @@ emac3_phy_statchg(struct device *dev)
 }
 
 int
-emac3_phy_ready()
+emac3_phy_ready(void)
 {
 	int retry = 1;
 



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

2014-06-29 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jun 29 11:18:40 UTC 2014

Modified Files:
src/sys/arch/playstation2/dev: if_smap.c

Log Message:
NBPFILTER is no more.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/playstation2/dev/if_smap.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/playstation2/dev/if_smap.c
diff -u src/sys/arch/playstation2/dev/if_smap.c:1.15 src/sys/arch/playstation2/dev/if_smap.c:1.16
--- src/sys/arch/playstation2/dev/if_smap.c:1.15	Mon Mar 31 11:25:49 2014
+++ src/sys/arch/playstation2/dev/if_smap.c	Sun Jun 29 11:18:40 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smap.c,v 1.15 2014/03/31 11:25:49 martin Exp $	*/
+/*	$NetBSD: if_smap.c,v 1.16 2014/06/29 11:18:40 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,11 +30,10 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_smap.c,v 1.15 2014/03/31 11:25:49 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_smap.c,v 1.16 2014/06/29 11:18:40 mrg Exp $");
 
 #include "debug_playstation2.h"
 
-#include "bpfilter.h"
 #include "rnd.h"
 
 #include 
@@ -67,10 +66,8 @@ __KERNEL_RCSID(0, "$NetBSD: if_smap.c,v 
 #include 
 #include 
 
-#if NBPFILTER > 0
 #include 
 #include 
-#endif
 
 #include 
 #include 
@@ -421,10 +418,8 @@ smap_rxeof(void *arg)
 		_wbflush();
 		
 		if (m != NULL) {
-#if NBPFILTER > 0
 			if (ifp->if_bpf)
 bpf_mtap(ifp->if_bpf, m);
-#endif
 			(*ifp->if_input)(ifp, m);
 		}
 	}
@@ -523,10 +518,8 @@ smap_start(struct ifnet *ifp)
 
 		IFQ_DEQUEUE(&ifp->if_snd, m0);
 		KDASSERT(m0 != NULL);
-#if NBPFILTER > 0
 		if (ifp->if_bpf)
 			bpf_mtap(ifp->if_bpf, m0);
-#endif
 
 		p = (u_int8_t *)sc->tx_buf;
 		q = p + sz;