summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authortsutsui <tsutsui@NetBSD.org>2009-09-08 18:15:17 +0000
committertsutsui <tsutsui@NetBSD.org>2009-09-08 18:15:17 +0000
commit26a7078461abd96268afcfbfa2cdded4a06396b0 (patch)
treefb86f682bfbceca67c33ab94e7e86355a567c973 /sys/dev
parent3d4351e6823ccaae853e8477f1a5caf7286f53a1 (diff)
Fix botch on device_t/softc split caused by awful casts around
registration of (*sd_reset)(device_t) in struct sbusdev via sbus_establish(). XXX: (*sd_reset)() in struct sbusdev seems called from only sbusreset(), XXX: but there is no function which calls sbusreset()???
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/sbus/esp_sbus.c21
-rw-r--r--sys/dev/sbus/if_hme_sbus.c17
-rw-r--r--sys/dev/sbus/if_le.c17
-rw-r--r--sys/dev/sbus/if_le_lebuffer.c17
-rw-r--r--sys/dev/sbus/if_le_ledma.c17
5 files changed, 72 insertions, 17 deletions
diff --git a/sys/dev/sbus/esp_sbus.c b/sys/dev/sbus/esp_sbus.c
index 0a61c44c414..186dd829477 100644
--- a/sys/dev/sbus/esp_sbus.c
+++ b/sys/dev/sbus/esp_sbus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: esp_sbus.c,v 1.48 2009/05/12 14:43:59 cegger Exp $ */
+/* $NetBSD: esp_sbus.c,v 1.49 2009/09/08 18:15:17 tsutsui Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: esp_sbus.c,v 1.48 2009/05/12 14:43:59 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: esp_sbus.c,v 1.49 2009/09/08 18:15:17 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -101,6 +101,8 @@ static void esp_dma_go(struct ncr53c9x_softc *);
static void esp_dma_stop(struct ncr53c9x_softc *);
static int esp_dma_isactive(struct ncr53c9x_softc *);
+static void esp_sbus_reset(device_t);
+
#ifdef DDB
static void esp_init_ddb_cmds(void);
#endif
@@ -287,7 +289,7 @@ espattach_sbus(device_t parent, device_t self, void *aux)
esc->sc_pri = sa->sa_pri;
/* add me to the sbus structures */
- esc->sc_sd.sd_reset = (void *)ncr53c9x_reset;
+ esc->sc_sd.sd_reset = esp_sbus_reset;
sbus_establish(&esc->sc_sd, self);
espattach(esc, &esp_sbus_glue);
@@ -347,7 +349,7 @@ espattach_sbus(device_t parent, device_t self, void *aux)
esc->sc_pri = sa->sa_pri;
/* add me to the sbus structures */
- esc->sc_sd.sd_reset = (void *)ncr53c9x_reset;
+ esc->sc_sd.sd_reset = esp_sbus_reset;
sbus_establish(&esc->sc_sd, self);
if (strcmp("ptscII", sa->sa_name) == 0) {
@@ -407,7 +409,7 @@ espattach_dma(device_t parent, device_t self, void *aux)
esc->sc_pri = sa->sa_pri;
/* Assume SBus is grandparent */
- esc->sc_sd.sd_reset = (void *)ncr53c9x_reset;
+ esc->sc_sd.sd_reset = esp_sbus_reset;
sbus_establish(&esc->sc_sd, parent);
espattach(esc, &esp_sbus_glue);
@@ -700,6 +702,15 @@ esp_dma_isactive(struct ncr53c9x_softc *sc)
return DMA_ISACTIVE(esc->sc_dma);
}
+void
+esp_sbus_reset(device_t self)
+{
+ struct esp_softc *esc = device_private(self);
+ struct ncr53c9x_softc *sc = &esc->sc_ncr53c9x;
+
+ ncr53c9x_reset(sc);
+}
+
#ifdef DDB
#include <machine/db_machdep.h>
#include <ddb/db_output.h>
diff --git a/sys/dev/sbus/if_hme_sbus.c b/sys/dev/sbus/if_hme_sbus.c
index e1f683cd086..4b18f186ce3 100644
--- a/sys/dev/sbus/if_hme_sbus.c
+++ b/sys/dev/sbus/if_hme_sbus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_hme_sbus.c,v 1.31 2009/05/17 01:33:24 tsutsui Exp $ */
+/* $NetBSD: if_hme_sbus.c,v 1.32 2009/09/08 18:15:17 tsutsui Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_hme_sbus.c,v 1.31 2009/05/17 01:33:24 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_hme_sbus.c,v 1.32 2009/09/08 18:15:17 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -66,6 +66,8 @@ struct hmesbus_softc {
int hmematch_sbus(device_t, cfdata_t, void *);
void hmeattach_sbus(device_t, device_t, void *);
+static void hme_sbus_reset(device_t);
+
CFATTACH_DECL_NEW(hme_sbus, sizeof(struct hmesbus_softc),
hmematch_sbus, hmeattach_sbus, NULL, NULL);
@@ -157,7 +159,7 @@ hmeattach_sbus(device_t parent, device_t self, void *aux)
return;
}
- sd->sd_reset = (void *)hme_reset;
+ sd->sd_reset = hme_sbus_reset;
sbus_establish(sd, self);
prom_getether(node, sc->sc_enaddr);
@@ -190,3 +192,12 @@ hmeattach_sbus(device_t parent, device_t self, void *aux)
(void)bus_intr_establish(sa->sa_bustag, sa->sa_pri, IPL_NET,
hme_intr, sc);
}
+
+void
+hme_sbus_reset(device_t self)
+{
+ struct hmesbus_softc *hsc = device_private(self);
+ struct hme_softc *sc = &hsc->hsc_hme;
+
+ hme_reset(sc);
+}
diff --git a/sys/dev/sbus/if_le.c b/sys/dev/sbus/if_le.c
index ea2121f6949..3f61b181799 100644
--- a/sys/dev/sbus/if_le.c
+++ b/sys/dev/sbus/if_le.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_le.c,v 1.36 2008/04/28 20:23:57 martin Exp $ */
+/* $NetBSD: if_le.c,v 1.37 2009/09/08 18:15:17 tsutsui Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_le.c,v 1.36 2008/04/28 20:23:57 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_le.c,v 1.37 2009/09/08 18:15:17 tsutsui Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@@ -82,6 +82,8 @@ struct le_softc {
int lematch_sbus(device_t, cfdata_t, void *);
void leattach_sbus(device_t, device_t, void *);
+static void le_sbus_reset(device_t);
+
/*
* Media types supported.
*/
@@ -191,7 +193,7 @@ leattach_sbus(device_t parent, device_t self, void *aux)
break;
}
- lesc->sc_sd.sd_reset = (void *)lance_reset;
+ lesc->sc_sd.sd_reset = le_sbus_reset;
sbus_establish(&lesc->sc_sd, self);
if (sc->sc_mem == 0) {
@@ -264,3 +266,12 @@ leattach_sbus(device_t parent, device_t self, void *aux)
(void)bus_intr_establish(lesc->sc_bustag, sa->sa_pri,
IPL_NET, am7990_intr, sc);
}
+
+void
+le_sbus_reset(device_t self)
+{
+ struct le_softc *lesc = device_private(self);
+ struct lance_softc *sc = &lesc->sc_am7990.lsc;
+
+ lance_reset(sc);
+}
diff --git a/sys/dev/sbus/if_le_lebuffer.c b/sys/dev/sbus/if_le_lebuffer.c
index 3cfc2dc5ac4..17d0d55e04c 100644
--- a/sys/dev/sbus/if_le_lebuffer.c
+++ b/sys/dev/sbus/if_le_lebuffer.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_le_lebuffer.c,v 1.24 2008/04/28 20:23:57 martin Exp $ */
+/* $NetBSD: if_le_lebuffer.c,v 1.25 2009/09/08 18:15:17 tsutsui Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_le_lebuffer.c,v 1.24 2008/04/28 20:23:57 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_le_lebuffer.c,v 1.25 2009/09/08 18:15:17 tsutsui Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@@ -85,6 +85,8 @@ struct le_softc {
int lematch_lebuffer(device_t, cfdata_t, void *);
void leattach_lebuffer(device_t, device_t, void *);
+static void le_lebuffer_reset(device_t);
+
/*
* Media types supported.
*/
@@ -174,7 +176,7 @@ leattach_lebuffer(device_t parent, device_t self, void *aux)
LE_C3_BSWP | LE_C3_ACON | LE_C3_BCON);
/* Assume SBus is grandparent */
- lesc->sc_sd.sd_reset = (void *)lance_reset;
+ lesc->sc_sd.sd_reset = le_lebuffer_reset;
sbus_establish(&lesc->sc_sd, parent);
sc->sc_supmedia = lemedia;
@@ -199,3 +201,12 @@ leattach_lebuffer(device_t parent, device_t self, void *aux)
(void)bus_intr_establish(lesc->sc_bustag, sa->sa_pri,
IPL_NET, am7990_intr, sc);
}
+
+void
+le_lebuffer_reset(device_t self)
+{
+ struct le_softc *lesc = device_private(self);
+ struct lance_softc *sc = &lesc->sc_am7990.lsc;
+
+ lance_reset(sc);
+}
diff --git a/sys/dev/sbus/if_le_ledma.c b/sys/dev/sbus/if_le_ledma.c
index 343bc02c1a1..50475998e7b 100644
--- a/sys/dev/sbus/if_le_ledma.c
+++ b/sys/dev/sbus/if_le_ledma.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_le_ledma.c,v 1.31 2009/04/12 11:10:28 tsutsui Exp $ */
+/* $NetBSD: if_le_ledma.c,v 1.32 2009/09/08 18:15:17 tsutsui Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_le_ledma.c,v 1.31 2009/04/12 11:10:28 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_le_ledma.c,v 1.32 2009/09/08 18:15:17 tsutsui Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@@ -93,6 +93,8 @@ struct le_softc {
int lematch_ledma(device_t, cfdata_t, void *);
void leattach_ledma(device_t, device_t, void *);
+static void le_ledma_reset(device_t);
+
/*
* Media types supported by the Sun4m.
*/
@@ -390,7 +392,7 @@ leattach_ledma(device_t parent, device_t self, void *aux)
lesc->sc_lostcount = 0;
/* Assume SBus is grandparent */
- lesc->sc_sd.sd_reset = (void *)lance_reset;
+ lesc->sc_sd.sd_reset = le_ledma_reset;
sbus_establish(&lesc->sc_sd, parent);
sc->sc_mediachange = lemediachange;
@@ -423,3 +425,12 @@ leattach_ledma(device_t parent, device_t self, void *aux)
/* now initialize DMA */
lehwreset(sc);
}
+
+void
+le_ledma_reset(device_t self)
+{
+ struct le_softc *lesc = device_private(self);
+ struct lance_softc *sc = &lesc->sc_am7990.lsc;
+
+ lance_reset(sc);
+}