From 4a0340a5b3a28ae46032148f8564890f3536e543 Mon Sep 17 00:00:00 2001 From: marius Date: Mon, 30 Jan 2006 22:30:51 +0000 Subject: [PATCH] MFC: sys/sparc64/central/central.c 1.11, sys/sparc64/ebus/ebus.c 1.25 (partial), sys/sparc64/fhc/fhc_central.c 1.10, sys/sparc64/fhc/fhc_nexus.c 1.9, sys/sparc64/pci/psycho.c 1.59, sys/sparc64/sbus/dma_sbus.c 1.3 - 1.4, sys/sparc64/sbus/sbus.c 1.37 - Register the generic implementations for the device shutdown, suspend and resume methods so these events propagate through the device driver hierarchy. - Remove dma_setup_intr() (was commented out in RELENG_6). --- sys/sparc64/central/central.c | 3 +++ sys/sparc64/ebus/ebus.c | 3 +++ sys/sparc64/fhc/fhc_central.c | 3 +++ sys/sparc64/fhc/fhc_nexus.c | 3 +++ sys/sparc64/pci/psycho.c | 3 +++ sys/sparc64/sbus/dma_sbus.c | 32 +++----------------------------- sys/sparc64/sbus/sbus.c | 3 +++ 7 files changed, 21 insertions(+), 29 deletions(-) diff --git a/sys/sparc64/central/central.c b/sys/sparc64/central/central.c index ef3ef3701899..dc96f2e143be 100644 --- a/sys/sparc64/central/central.c +++ b/sys/sparc64/central/central.c @@ -77,6 +77,9 @@ static device_method_t central_methods[] = { /* Device interface. */ DEVMETHOD(device_probe, central_probe), DEVMETHOD(device_attach, central_attach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface. */ DEVMETHOD(bus_print_child, central_print_child), diff --git a/sys/sparc64/ebus/ebus.c b/sys/sparc64/ebus/ebus.c index 73f83379dd32..4d54075ddc44 100644 --- a/sys/sparc64/ebus/ebus.c +++ b/sys/sparc64/ebus/ebus.c @@ -125,6 +125,9 @@ static device_method_t ebus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ebus_probe), DEVMETHOD(device_attach, ebus_attach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ DEVMETHOD(bus_print_child, ebus_print_child), diff --git a/sys/sparc64/fhc/fhc_central.c b/sys/sparc64/fhc/fhc_central.c index a63fb3e7a8b3..26043e1fea73 100644 --- a/sys/sparc64/fhc/fhc_central.c +++ b/sys/sparc64/fhc/fhc_central.c @@ -51,6 +51,9 @@ static device_method_t fhc_central_methods[] = { /* Device interface. */ DEVMETHOD(device_probe, fhc_central_probe), DEVMETHOD(device_attach, fhc_central_attach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface. */ DEVMETHOD(bus_print_child, fhc_print_child), diff --git a/sys/sparc64/fhc/fhc_nexus.c b/sys/sparc64/fhc/fhc_nexus.c index c6c286005387..864c1c1b8377 100644 --- a/sys/sparc64/fhc/fhc_nexus.c +++ b/sys/sparc64/fhc/fhc_nexus.c @@ -54,6 +54,9 @@ static device_method_t fhc_nexus_methods[] = { /* Device interface. */ DEVMETHOD(device_probe, fhc_nexus_probe), DEVMETHOD(device_attach, fhc_nexus_attach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface. */ DEVMETHOD(bus_print_child, fhc_print_child), diff --git a/sys/sparc64/pci/psycho.c b/sys/sparc64/pci/psycho.c index 387a4c37e7f2..f03305e17ac2 100644 --- a/sys/sparc64/pci/psycho.c +++ b/sys/sparc64/pci/psycho.c @@ -124,6 +124,9 @@ static device_method_t psycho_methods[] = { /* Device interface */ DEVMETHOD(device_probe, psycho_probe), DEVMETHOD(device_attach, psycho_attach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ DEVMETHOD(bus_print_child, bus_generic_print_child), diff --git a/sys/sparc64/sbus/dma_sbus.c b/sys/sparc64/sbus/dma_sbus.c index 9f34a8fc3b23..c9176109c1f4 100644 --- a/sys/sparc64/sbus/dma_sbus.c +++ b/sys/sparc64/sbus/dma_sbus.c @@ -109,9 +109,6 @@ static device_attach_t dma_attach; static bus_print_child_t dma_print_child; static bus_probe_nomatch_t dma_probe_nomatch; static bus_get_resource_list_t dma_get_resource_list; -#if 0 -static bus_setup_intr_t dma_setup_intr; -#endif static ofw_bus_get_compat_t dma_get_compat; static ofw_bus_get_model_t dma_get_model; static ofw_bus_get_name_t dma_get_name; @@ -125,15 +122,14 @@ static device_method_t dma_methods[] = { /* Device interface */ DEVMETHOD(device_probe, dma_probe), DEVMETHOD(device_attach, dma_attach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ DEVMETHOD(bus_print_child, dma_print_child), DEVMETHOD(bus_probe_nomatch, dma_probe_nomatch), -#if 0 - DEVMETHOD(bus_setup_intr, dma_setup_intr), -#else DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), -#endif DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource), DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), @@ -188,7 +184,6 @@ dma_attach(device_t dev) int error, burst, children; dsc = device_get_softc(dev); - bzero(dsc, sizeof(struct dma_softc)); lsc = &dsc->sc_lsi64854; name = ofw_bus_get_name(dev); @@ -439,27 +434,6 @@ dma_get_resource_list(device_t dev, device_t child) return (&ddi->ddi_rl); } -#if 0 -static int -dma_setup_intr(device_t dev, device_t child, struct resource *ires, int flags, - driver_intr_t *intr, void *arg, void **cookiep) -{ - struct lsi64854_softc *sc; - - sc = (struct lsi64854_softc *)device_get_softc(dev); - /* XXX - for now only le; do ESP later */ - if (sc->sc_channel == L64854_CHANNEL_ENET) { - sc->sc_intrchain = intr; - sc->sc_intrchainarg = arg; - intr = (driver_intr_t *)lsi64854_enet_intr; - arg = sc; - } - - return (BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, - intr, arg, cookiep)); -} -#endif - static const char * dma_get_compat(device_t bus, device_t dev) { diff --git a/sys/sparc64/sbus/sbus.c b/sys/sparc64/sbus/sbus.c index 1c245d342786..1b9f02700f49 100644 --- a/sys/sparc64/sbus/sbus.c +++ b/sys/sparc64/sbus/sbus.c @@ -225,6 +225,9 @@ static device_method_t sbus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, sbus_probe), DEVMETHOD(device_attach, sbus_attach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ DEVMETHOD(bus_print_child, sbus_print_child),