Source-Changes-HG archive

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

[src/trunk]: src/sys Remove struct sbusdev and related functions sbus_establi...



details:   https://anonhg.NetBSD.org/src/rev/d207364a1de5
branches:  trunk
changeset: 747490:d207364a1de5
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Thu Sep 17 16:28:12 2009 +0000

description:
Remove struct sbusdev and related functions sbus_establish() and sbusreset().
They are derived from 4.4BSD/sparc and have been there since initial import
of NetBSD/sparc in 1993, but the struct sbusdev is almost unused for years,
nothing calls sbusreset(), and all (*sd->sd_reset)() functions look bogus.

Suggested by mrg@ and martin@, and tested on SS1+ and SS20.

diffstat:

 sys/arch/sparc/dev/sbus.c      |  58 +---------------------------------------
 sys/arch/sparc/dev/sbusvar.h   |   3 +-
 sys/arch/sparc/dev/ts102.c     |   5 +--
 sys/arch/sparc64/dev/sbus.c    |  59 +----------------------------------------
 sys/arch/sparc64/dev/sbusvar.h |   3 +-
 sys/dev/sbus/agten.c           |   7 +---
 sys/dev/sbus/be.c              |   5 +--
 sys/dev/sbus/bpp.c             |   9 +----
 sys/dev/sbus/bwtwo_sbus.c      |  14 ++-------
 sys/dev/sbus/cgsix_sbus.c      |  17 ++---------
 sys/dev/sbus/cgthree_sbus.c    |  12 +-------
 sys/dev/sbus/cs4231_sbus.c     |   7 +---
 sys/dev/sbus/dbri.c            |   6 +--
 sys/dev/sbus/dbrivar.h         |   3 +-
 sys/dev/sbus/dma_sbus.c        |   7 ++--
 sys/dev/sbus/esp_sbus.c        |  28 +------------------
 sys/dev/sbus/genfb_sbus.c      |   7 +---
 sys/dev/sbus/if_en.c           |  13 +++-----
 sys/dev/sbus/if_gem_sbus.c     |   6 +--
 sys/dev/sbus/if_hme_sbus.c     |  21 ++------------
 sys/dev/sbus/if_le.c           |  19 +------------
 sys/dev/sbus/if_le_lebuffer.c  |  20 +------------
 sys/dev/sbus/if_le_ledma.c     |  20 +------------
 sys/dev/sbus/isp_sbus.c        |   6 +--
 sys/dev/sbus/lebuffer.c        |   6 +--
 sys/dev/sbus/lebuffervar.h     |   3 +-
 sys/dev/sbus/magma.c           |   6 +--
 sys/dev/sbus/magmareg.h        |   3 +-
 sys/dev/sbus/p9100.c           |   6 +--
 sys/dev/sbus/qe.c              |   5 +--
 sys/dev/sbus/qec.c             |   6 +--
 sys/dev/sbus/qecvar.h          |   3 +-
 sys/dev/sbus/sbusvar.h         |  14 +---------
 sys/dev/sbus/sio16.c           |   8 +----
 sys/dev/sbus/spifvar.h         |   3 +-
 sys/dev/sbus/stp4020.c         |   7 +---
 sys/dev/sbus/tcx.c             |   6 +--
 sys/dev/sbus/zx.c              |   5 +--
 sys/dev/sbus/zxvar.h           |   3 +-
 39 files changed, 76 insertions(+), 363 deletions(-)

diffs (truncated from 1463 to 300 lines):

diff -r 2a14b108b7ed -r d207364a1de5 sys/arch/sparc/dev/sbus.c
--- a/sys/arch/sparc/dev/sbus.c Thu Sep 17 16:13:32 2009 +0000
+++ b/sys/arch/sparc/dev/sbus.c Thu Sep 17 16:28:12 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sbus.c,v 1.72 2009/03/18 16:00:14 cegger Exp $ */
+/*     $NetBSD: sbus.c,v 1.73 2009/09/17 16:28:12 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sbus.c,v 1.72 2009/03/18 16:00:14 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbus.c,v 1.73 2009/09/17 16:28:12 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/malloc.h>
@@ -510,60 +510,6 @@
 
 
 /*
- * Each attached device calls sbus_establish after it initializes
- * its sbusdev portion.
- */
-void
-sbus_establish(struct sbusdev *sd, device_t dev)
-{
-       register struct sbus_softc *sc;
-       register device_t curdev;
-
-       /*
-        * We have to look for the sbus by name, since it is not necessarily
-        * our immediate parent (i.e. sun4m /iommu/sbus/espdma/esp)
-        * We don't just use the device structure of the above-attached
-        * sbus, since we might (in the future) support multiple sbus's.
-        */
-       for (curdev = device_parent(dev); ; curdev = device_parent(curdev)) {
-               if ((curdev == NULL) || (device_xname(curdev) == NULL))
-                       panic("sbus_establish: can't find sbus parent for %s",
-                             device_xname(dev)
-                                       ? device_xname(dev)
-                                       : "<unknown>" );
-
-               if (strncmp(device_xname(curdev), "sbus", 4) == 0)
-                       break;
-       }
-       sc = device_private(curdev);
-
-       sd->sd_dev = dev;
-       sd->sd_bchain = sc->sc_sbdev;
-       sc->sc_sbdev = sd;
-}
-
-/*
- * Reset the given sbus. (???)
- */
-void
-sbusreset(int sbus)
-{
-       register struct sbusdev *sd;
-       struct sbus_softc *sc = device_lookup_private(&sbus_cd, sbus);
-       device_t dev;
-
-       printf("reset %s:", device_xname(sc->sc_dev));
-       for (sd = sc->sc_sbdev; sd != NULL; sd = sd->sd_bchain) {
-               if (sd->sd_reset) {
-                       dev = sd->sd_dev;
-                       (*sd->sd_reset)(dev);
-                       printf(" %s", device_xname(dev));
-               }
-       }
-}
-
-
-/*
  * Get interrupt attributes for an Sbus device.
  */
 static int
diff -r 2a14b108b7ed -r d207364a1de5 sys/arch/sparc/dev/sbusvar.h
--- a/sys/arch/sparc/dev/sbusvar.h      Thu Sep 17 16:13:32 2009 +0000
+++ b/sys/arch/sparc/dev/sbusvar.h      Thu Sep 17 16:28:12 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sbusvar.h,v 1.19 2008/05/17 18:11:32 macallan Exp $ */
+/*     $NetBSD: sbusvar.h,v 1.20 2009/09/17 16:28:12 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -80,7 +80,6 @@
        bus_dma_tag_t   sc_dmatag;
        bus_space_handle_t sc_bh;       /* SBus control registers */
        int     sc_clockfreq;           /* clock frequency (in Hz) */
-       struct  sbusdev *sc_sbdev;      /* list of all children */
        int     sc_burst;               /* burst transfer sizes supported */
 
        /* MD fields follow here */
diff -r 2a14b108b7ed -r d207364a1de5 sys/arch/sparc/dev/ts102.c
--- a/sys/arch/sparc/dev/ts102.c        Thu Sep 17 16:13:32 2009 +0000
+++ b/sys/arch/sparc/dev/ts102.c        Thu Sep 17 16:28:12 2009 +0000
@@ -1,5 +1,5 @@
 /*     $OpenBSD: ts102.c,v 1.14 2005/01/27 17:03:23 millert Exp $      */
-/*     $NetBSD: ts102.c,v 1.13 2008/08/04 03:14:43 macallan Exp $ */
+/*     $NetBSD: ts102.c,v 1.14 2009/09/17 16:28:12 tsutsui Exp $ */
 /*
  * Copyright (c) 2003, 2004, Miodrag Vallat.
  * Copyright (c) 2005, Michael Lorenz.
@@ -137,7 +137,6 @@
 
 struct tslot_softc {
        device_t        sc_dev;
-       struct sbusdev  sc_sd;
        
        bus_space_tag_t sc_bustag;              /* socket control io    */
        bus_space_handle_t      sc_regh;        /*  space               */
@@ -337,8 +336,6 @@
        tag->sparc_write_4 = ts102_write_4;
        tag->sparc_write_8 = ts102_write_8;
 
-       sbus_establish(&sc->sc_sd, self);
-
        bus_intr_establish(sa->sa_bustag, sa->sa_intr[0].oi_pri,
            IPL_NONE, tslot_intr, sc);
 
diff -r 2a14b108b7ed -r d207364a1de5 sys/arch/sparc64/dev/sbus.c
--- a/sys/arch/sparc64/dev/sbus.c       Thu Sep 17 16:13:32 2009 +0000
+++ b/sys/arch/sparc64/dev/sbus.c       Thu Sep 17 16:28:12 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sbus.c,v 1.84 2009/05/17 01:28:27 tsutsui Exp $ */
+/*     $NetBSD: sbus.c,v 1.85 2009/09/17 16:28:12 tsutsui Exp $ */
 
 /*
  * Copyright (c) 1999-2002 Eduardo Horvath
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sbus.c,v 1.84 2009/05/17 01:28:27 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbus.c,v 1.85 2009/09/17 16:28:12 tsutsui Exp $");
 
 #include "opt_ddb.h"
 
@@ -408,61 +408,6 @@
 
 
 /*
- * Each attached device calls sbus_establish after it initializes
- * its sbusdev portion.
- */
-void
-sbus_establish(struct sbusdev *sd, device_t dev)
-{
-       register struct sbus_softc *sc;
-       register device_t curdev;
-
-       /*
-        * We have to look for the sbus by name, since it is not necessarily
-        * our immediate parent (i.e. sun4m /iommu/sbus/espdma/esp)
-        * We don't just use the device structure of the above-attached
-        * sbus, since we might (in the future) support multiple sbus's.
-        */
-       for (curdev = device_parent(dev); ; curdev = device_parent(curdev)) {
-               if ((curdev == NULL) || (device_xname(curdev) == NULL))
-                       panic("sbus_establish: can't find sbus parent for %s",
-                             device_xname(dev)
-                                       ? device_xname(dev)
-                                       : "<unknown>" );
-
-               if (strncmp(device_xname(curdev), "sbus", 4) == 0)
-                       break;
-       }
-       sc = device_private(curdev);
-
-       sd->sd_dev = dev;
-       sd->sd_bchain = sc->sc_sbdev;
-       sc->sc_sbdev = sd;
-}
-
-/*
- * Reset the given sbus.
- */
-void
-sbusreset(int sbus)
-{
-       register struct sbusdev *sd;
-       struct sbus_softc *sc = device_lookup_private(&sbus_cd, sbus);
-       device_t dev;
-
-       printf("reset %s:", device_xname(sc->sc_dev));
-       for (sd = sc->sc_sbdev; sd != NULL; sd = sd->sd_bchain) {
-               if (sd->sd_reset) {
-                       dev = sd->sd_dev;
-                       (*sd->sd_reset)(dev);
-                       printf(" %s", device_xname(dev));
-               }
-       }
-       /* Reload iommu regs */
-       iommu_reset(&sc->sc_is);
-}
-
-/*
  * Handle an overtemp situation.
  *
  * SPARCs have temperature sensors which generate interrupts
diff -r 2a14b108b7ed -r d207364a1de5 sys/arch/sparc64/dev/sbusvar.h
--- a/sys/arch/sparc64/dev/sbusvar.h    Thu Sep 17 16:13:32 2009 +0000
+++ b/sys/arch/sparc64/dev/sbusvar.h    Thu Sep 17 16:28:12 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sbusvar.h,v 1.16 2009/05/17 01:28:27 tsutsui Exp $ */
+/*     $NetBSD: sbusvar.h,v 1.17 2009/09/17 16:28:12 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -100,7 +100,6 @@
        bus_space_handle_t      sc_bh;
        bus_dma_tag_t           sc_dmatag;
        int                     sc_clockfreq;   /* clock frequency (in Hz) */
-       struct sbusdev          *sc_sbdev;      /* list of all children */
        int                     sc_burst;       /* burst transfer sizes supported */
        int                     *sc_intr2ipl;   /* Interrupt level translation */
        int                     *sc_intr_compat;/* `intr' property to sbus compat */
diff -r 2a14b108b7ed -r d207364a1de5 sys/dev/sbus/agten.c
--- a/sys/dev/sbus/agten.c      Thu Sep 17 16:13:32 2009 +0000
+++ b/sys/dev/sbus/agten.c      Thu Sep 17 16:28:12 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: agten.c,v 1.20 2009/08/20 02:29:16 macallan Exp $ */
+/*     $NetBSD: agten.c,v 1.21 2009/09/17 16:28:12 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: agten.c,v 1.20 2009/08/20 02:29:16 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: agten.c,v 1.21 2009/09/17 16:28:12 tsutsui Exp $");
 
 /*
  * a driver for the Fujitsu AG-10e SBus framebuffer
@@ -85,7 +85,6 @@
 
 struct agten_softc {
        device_t        sc_dev;         /* base device */
-       struct sbusdev  sc_sd;          /* sbus device */
        struct fbdevice sc_fb;          /* frame buffer device */
 
        struct vcons_screen sc_console_screen;
@@ -282,8 +281,6 @@
        sc->sc_glint_regs = sbus_bus_addr(sc->sc_bustag,
            sa->sa_reg[0].oa_space, sa->sa_reg[0].oa_base + reg);
 
-       sbus_establish(&sc->sc_sd, sc->sc_dev);
-
 #if 0
        bus_intr_establish(sc->sc_bustag, sa->sa_pri, IPL_BIO,
            agten_intr, sc);
diff -r 2a14b108b7ed -r d207364a1de5 sys/dev/sbus/be.c
--- a/sys/dev/sbus/be.c Thu Sep 17 16:13:32 2009 +0000
+++ b/sys/dev/sbus/be.c Thu Sep 17 16:28:12 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: be.c,v 1.65 2009/05/12 14:43:59 cegger Exp $   */
+/*     $NetBSD: be.c,v 1.66 2009/09/17 16:28:12 tsutsui Exp $  */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: be.c,v 1.65 2009/05/12 14:43:59 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: be.c,v 1.66 2009/09/17 16:28:12 tsutsui Exp $");
 
 #include "opt_ddb.h"
 #include "opt_inet.h"
@@ -115,7 +115,6 @@
 
 struct be_softc {
        struct  device  sc_dev;
-       struct  sbusdev sc_sd;          /* sbus device */
        bus_space_tag_t sc_bustag;      /* bus & DMA tags */
        bus_dma_tag_t   sc_dmatag;
        bus_dmamap_t    sc_dmamap;
diff -r 2a14b108b7ed -r d207364a1de5 sys/dev/sbus/bpp.c
--- a/sys/dev/sbus/bpp.c        Thu Sep 17 16:13:32 2009 +0000
+++ b/sys/dev/sbus/bpp.c        Thu Sep 17 16:28:12 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bpp.c,v 1.38 2008/04/28 20:23:57 martin Exp $ */
+/*     $NetBSD: bpp.c,v 1.39 2009/09/17 16:28:12 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bpp.c,v 1.38 2008/04/28 20:23:57 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpp.c,v 1.39 2009/09/17 16:28:12 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/ioctl.h>
@@ -87,7 +87,6 @@



Home | Main Index | Thread Index | Old Index