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

2024-05-24 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri May 24 20:09:10 UTC 2024

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

Log Message:
s/boradcast/broadcast/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 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.15 src/sys/arch/playstation2/dev/emac3.c:1.16
--- src/sys/arch/playstation2/dev/emac3.c:1.15	Fri Feb 11 23:49:19 2022
+++ src/sys/arch/playstation2/dev/emac3.c	Fri May 24 20:09:09 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: emac3.c,v 1.15 2022/02/11 23:49:19 riastradh Exp $	*/
+/*	$NetBSD: emac3.c,v 1.16 2024/05/24 20:09:09 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: emac3.c,v 1.15 2022/02/11 23:49:19 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emac3.c,v 1.16 2024/05/24 20:09:09 andvar Exp $");
 
 #include "debug_playstation2.h"
 
@@ -292,7 +292,7 @@ emac3_config(const u_int8_t *eaddr)
 	RMR_SP |	/* strip padding */
 	RMR_SFCS |	/* strip FCS */
 	RMR_IAE |	/* individual address enable */
-	RMR_BAE);	/* boradcast address enable */
+	RMR_BAE);	/* broadcast address enable */
 
 	/* TX mode */
 	_emac3_reg_write_4(EMAC3_TMR1, 



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

2024-05-24 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri May 24 20:09:10 UTC 2024

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

Log Message:
s/boradcast/broadcast/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 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.



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

2023-11-05 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Nov  5 21:50:27 UTC 2023

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

Log Message:
Use DPRINTF instead of __gsfb_print() to print smap status.

__gsfb_printf() is defined only with the GSFB_DEBUG_MONITOR option.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 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.35 src/sys/arch/playstation2/dev/if_smap.c:1.36
--- src/sys/arch/playstation2/dev/if_smap.c:1.35	Sun Sep 18 13:03:51 2022
+++ src/sys/arch/playstation2/dev/if_smap.c	Sun Nov  5 21:50:27 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smap.c,v 1.35 2022/09/18 13:03:51 thorpej Exp $	*/
+/*	$NetBSD: if_smap.c,v 1.36 2023/11/05 21:50:27 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_smap.c,v 1.35 2022/09/18 13:03:51 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_smap.c,v 1.36 2023/11/05 21:50:27 andvar Exp $");
 
 #include "debug_playstation2.h"
 
@@ -712,7 +712,7 @@ void
 __smap_status(int msg)
 {
 	static int cnt;
-	__gsfb_print(1, "%d: tx=%d rx=%d txcnt=%d free=%d cnt=%d\n", msg,
+	DPRINTF("%d: tx=%d rx=%d txcnt=%d free=%d cnt=%d\n", msg,
 	_reg_read_1(SMAP_TXFIFO_FRAME_REG8),
 	_reg_read_1(SMAP_RXFIFO_FRAME_REG8), __sc->tx_desc_cnt,
 	__sc->tx_buf_freesize, cnt++);



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

2023-11-05 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Nov  5 21:50:27 UTC 2023

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

Log Message:
Use DPRINTF instead of __gsfb_print() to print smap status.

__gsfb_printf() is defined only with the GSFB_DEBUG_MONITOR option.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 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.



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

2022-09-18 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Sep 18 13:03:51 UTC 2022

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

Log Message:
Eliminate use of IFF_OACTIVE.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 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.34 src/sys/arch/playstation2/dev/if_smap.c:1.35
--- src/sys/arch/playstation2/dev/if_smap.c:1.34	Fri Feb 11 23:49:19 2022
+++ src/sys/arch/playstation2/dev/if_smap.c	Sun Sep 18 13:03:51 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smap.c,v 1.34 2022/02/11 23:49:19 riastradh Exp $	*/
+/*	$NetBSD: if_smap.c,v 1.35 2022/09/18 13:03:51 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_smap.c,v 1.34 2022/02/11 23:49:19 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_smap.c,v 1.35 2022/09/18 13:03:51 thorpej Exp $");
 
 #include "debug_playstation2.h"
 
@@ -158,7 +158,7 @@ smap_attach(struct device *parent, struc
 	__sc = sc;
 #endif
 
-	sc->dev = self;
+	sc->emac3.dev = self;
 
 	printf(": %s\n", spa->spa_product_name);
 
@@ -448,9 +448,6 @@ smap_txeof(void *arg)
 	}
 	sc->tx_done_index = i;
 
-	/* OK to start transmit */
-	ifp->if_flags &= ~IFF_OACTIVE;
-
 	FUNC_EXIT();
 }
 
@@ -481,7 +478,6 @@ smap_start(struct ifnet *ifp)
 		if (sz > sc->tx_buf_freesize ||
 		sc->tx_desc_cnt >= SMAP_DESC_MAX ||
 		emac3_tx_done() != 0) {
-			ifp->if_flags |= IFF_OACTIVE;
 			goto end;
 		}
 
@@ -599,7 +595,7 @@ smap_stop(struct ifnet *ifp, int disable
 
 	mii_down(>emac3.mii);
 
-	ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+	ifp->if_flags &= ~IFF_RUNNING;
 
 	if (disable)
 		emac3_disable();



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

2022-09-18 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Sep 18 13:03:51 UTC 2022

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

Log Message:
Eliminate use of IFF_OACTIVE.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 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.



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

2022-02-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Feb 11 23:49:19 UTC 2022

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

Log Message:
playstation2: Somewhat belated device_t/softc split.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/playstation2/dev/emac3.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/playstation2/dev/emac3var.h
cvs rdiff -u -r1.33 -r1.34 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/emac3.c
diff -u src/sys/arch/playstation2/dev/emac3.c:1.14 src/sys/arch/playstation2/dev/emac3.c:1.15
--- src/sys/arch/playstation2/dev/emac3.c:1.14	Tue May 28 07:41:47 2019
+++ src/sys/arch/playstation2/dev/emac3.c	Fri Feb 11 23:49:19 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: emac3.c,v 1.14 2019/05/28 07:41:47 msaitoh Exp $	*/
+/*	$NetBSD: emac3.c,v 1.15 2022/02/11 23:49:19 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: emac3.c,v 1.14 2019/05/28 07:41:47 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emac3.c,v 1.15 2022/02/11 23:49:19 riastradh Exp $");
 
 #include "debug_playstation2.h"
 
@@ -103,7 +103,7 @@ emac3_init(struct emac3_softc *sc)
 	r = _emac3_reg_read_4(EMAC3_MR1);
 
 	if (emac3_soft_reset() != 0) {
-		printf("%s: reset failed.\n", sc->dev.dv_xname);
+		printf("%s: reset failed.\n", device_xname(sc->dev));
 		return (1);
 	}
 
@@ -132,7 +132,7 @@ emac3_exit(struct emac3_softc *sc)
 		;
 
 	if (retry == 0)
-		printf("%s: still running.\n", sc->dev.dv_xname);
+		printf("%s: still running.\n", device_xname(sc->dev));
 }
 
 int
@@ -140,7 +140,7 @@ emac3_reset(struct emac3_softc *sc)
 {
 
 	if (emac3_soft_reset() != 0) {
-		printf("%s: reset failed.\n", sc->dev.dv_xname);
+		printf("%s: reset failed.\n", device_xname(sc->dev));
 		return (1);
 	}
 

Index: src/sys/arch/playstation2/dev/emac3var.h
diff -u src/sys/arch/playstation2/dev/emac3var.h:1.7 src/sys/arch/playstation2/dev/emac3var.h:1.8
--- src/sys/arch/playstation2/dev/emac3var.h:1.7	Tue Jan 22 03:42:26 2019
+++ src/sys/arch/playstation2/dev/emac3var.h	Fri Feb 11 23:49:19 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: emac3var.h,v 1.7 2019/01/22 03:42:26 msaitoh Exp $	*/
+/*	$NetBSD: emac3var.h,v 1.8 2022/02/11 23:49:19 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 struct emac3_softc {
-	struct device dev;
+	device_t dev;
 	struct mii_data mii;
 	u_int8_t eaddr[ETHER_ADDR_LEN];
 	u_int32_t mode1_reg;

Index: src/sys/arch/playstation2/dev/if_smap.c
diff -u src/sys/arch/playstation2/dev/if_smap.c:1.33 src/sys/arch/playstation2/dev/if_smap.c:1.34
--- src/sys/arch/playstation2/dev/if_smap.c:1.33	Sat Nov 21 17:46:08 2020
+++ src/sys/arch/playstation2/dev/if_smap.c	Fri Feb 11 23:49:19 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smap.c,v 1.33 2020/11/21 17:46:08 thorpej Exp $	*/
+/*	$NetBSD: if_smap.c,v 1.34 2022/02/11 23:49:19 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_smap.c,v 1.33 2020/11/21 17:46:08 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_smap.c,v 1.34 2022/02/11 23:49:19 riastradh Exp $");
 
 #include "debug_playstation2.h"
 
@@ -108,7 +108,7 @@ struct smap_softc {
 	krndsource_t rnd_source;
 };
 
-#define DEVNAME		(sc->emac3.dev.dv_xname)
+#define DEVNAME		(device_xname(sc->emac3.dev))
 #define ROUND4(x)	(((x) + 3) & ~3)
 #define ROUND16(x)	(((x) + 15) & ~15)
 
@@ -147,7 +147,7 @@ void
 smap_attach(struct device *parent, struct device *self, void *aux)
 {
 	struct spd_attach_args *spa = aux;
-	struct smap_softc *sc = (void *)self;
+	struct smap_softc *sc = device_private(self);
 	struct emac3_softc *emac3 = >emac3;
 	struct ifnet *ifp = >ethercom.ec_if;
 	struct mii_data *mii = >mii;
@@ -158,6 +158,8 @@ smap_attach(struct device *parent, struc
 	__sc = sc;
 #endif
 
+	sc->dev = self;
+
 	printf(": %s\n", spa->spa_product_name);
 
 	/* SPD EEPROM */
@@ -219,7 +221,7 @@ smap_attach(struct device *parent, struc
 	mii->mii_statchg	= emac3_phy_statchg;
 	sc->ethercom.ec_mii = mii;
 	ifmedia_init(>mii_media, 0, ether_mediachange, ether_mediastatus);
-	mii_attach(>dev, mii, 0x, MII_PHY_ANY,
+	mii_attach(emac3->dev, mii, 0x, MII_PHY_ANY,
 	MII_OFFSET_ANY, 0);
 
 	/* Choose a default media. */



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

2022-02-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Feb 11 23:49:19 UTC 2022

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

Log Message:
playstation2: Somewhat belated device_t/softc split.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/playstation2/dev/emac3.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/playstation2/dev/emac3var.h
cvs rdiff -u -r1.33 -r1.34 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.