Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/playstation2/dev playstation2: Somewhat belated dev...



details:   https://anonhg.NetBSD.org/src/rev/5ee6e70dd191
branches:  trunk
changeset: 361136:5ee6e70dd191
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Fri Feb 11 23:49:19 2022 +0000

description:
playstation2: Somewhat belated device_t/softc split.

diffstat:

 sys/arch/playstation2/dev/emac3.c    |  10 +++++-----
 sys/arch/playstation2/dev/emac3var.h |   4 ++--
 sys/arch/playstation2/dev/if_smap.c  |  12 +++++++-----
 3 files changed, 14 insertions(+), 12 deletions(-)

diffs (117 lines):

diff -r 3d500093303b -r 5ee6e70dd191 sys/arch/playstation2/dev/emac3.c
--- a/sys/arch/playstation2/dev/emac3.c Fri Feb 11 23:48:50 2022 +0000
+++ b/sys/arch/playstation2/dev/emac3.c Fri Feb 11 23:49:19 2022 +0000
@@ -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 <sys/cdefs.h>
-__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 @@
        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 @@
                ;
 
        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 @@
 {
 
        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);
        }
 
diff -r 3d500093303b -r 5ee6e70dd191 sys/arch/playstation2/dev/emac3var.h
--- a/sys/arch/playstation2/dev/emac3var.h      Fri Feb 11 23:48:50 2022 +0000
+++ b/sys/arch/playstation2/dev/emac3var.h      Fri Feb 11 23:49:19 2022 +0000
@@ -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;
diff -r 3d500093303b -r 5ee6e70dd191 sys/arch/playstation2/dev/if_smap.c
--- a/sys/arch/playstation2/dev/if_smap.c       Fri Feb 11 23:48:50 2022 +0000
+++ b/sys/arch/playstation2/dev/if_smap.c       Fri Feb 11 23:49:19 2022 +0000
@@ -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 <sys/cdefs.h>
-__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 @@
        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 @@
 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 = &sc->emac3;
        struct ifnet *ifp = &sc->ethercom.ec_if;
        struct mii_data *mii = &emac3->mii;
@@ -158,6 +158,8 @@
        __sc = sc;
 #endif
 
+       sc->dev = self;
+
        printf(": %s\n", spa->spa_product_name);
 
        /* SPD EEPROM */
@@ -219,7 +221,7 @@
        mii->mii_statchg        = emac3_phy_statchg;
        sc->ethercom.ec_mii = mii;
        ifmedia_init(&mii->mii_media, 0, ether_mediachange, ether_mediastatus);
-       mii_attach(&emac3->dev, mii, 0xffffffff, MII_PHY_ANY,
+       mii_attach(emac3->dev, mii, 0xffffffff, MII_PHY_ANY,
            MII_OFFSET_ANY, 0);
 
        /* Choose a default media. */



Home | Main Index | Thread Index | Old Index