Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Split device_t/softc of i82586. No crash on TME emulati...
details: https://anonhg.NetBSD.org/src/rev/9eca96c372c5
branches: trunk
changeset: 765712:9eca96c372c5
user: tsutsui <tsutsui%NetBSD.org@localhost>
date: Fri Jun 03 16:28:40 2011 +0000
description:
Split device_t/softc of i82586. No crash on TME emulating sun2.
diffstat:
sys/arch/hp700/gsc/if_ie_gsc.c | 13 +++--
sys/arch/sparc/dev/if_ie_obio.c | 7 +-
sys/arch/sun2/dev/if_ie_mbmem.c | 21 ++++----
sys/arch/sun2/dev/if_ie_obio.c | 25 +++++-----
sys/dev/ic/i82586.c | 92 ++++++++++++++++++++--------------------
sys/dev/ic/i82586var.h | 4 +-
sys/dev/isa/if_ai.c | 18 ++++---
sys/dev/isa/if_ef.c | 21 ++++----
sys/dev/isa/if_ix.c | 21 ++++----
sys/dev/mca/if_elmc_mca.c | 23 +++++----
sys/dev/podulebus/if_ei.c | 20 ++++----
sys/dev/vme/if_ie_vme.c | 11 ++--
12 files changed, 144 insertions(+), 132 deletions(-)
diffs (truncated from 1135 to 300 lines):
diff -r 08377c86eefe -r 9eca96c372c5 sys/arch/hp700/gsc/if_ie_gsc.c
--- a/sys/arch/hp700/gsc/if_ie_gsc.c Fri Jun 03 15:34:46 2011 +0000
+++ b/sys/arch/hp700/gsc/if_ie_gsc.c Fri Jun 03 16:28:40 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ie_gsc.c,v 1.23 2011/02/01 18:33:24 skrll Exp $ */
+/* $NetBSD: if_ie_gsc.c,v 1.24 2011/06/03 16:28:40 tsutsui Exp $ */
/* $OpenBSD: if_ie_gsc.c,v 1.6 2001/01/12 22:57:04 mickey Exp $ */
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ie_gsc.c,v 1.23 2011/02/01 18:33:24 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ie_gsc.c,v 1.24 2011/06/03 16:28:40 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -123,7 +123,7 @@
int ie_gsc_probe(device_t, cfdata_t, void *);
void ie_gsc_attach(device_t, device_t, void *);
-CFATTACH_DECL(ie_gsc, sizeof(struct ie_gsc_softc),
+CFATTACH_DECL_NEW(ie_gsc, sizeof(struct ie_gsc_softc),
ie_gsc_probe, ie_gsc_attach, NULL, NULL);
static int ie_gsc_media[] = {
@@ -340,7 +340,7 @@
/* Make sure that BUSY got cleared. */
if (sc->ie_bus_read16(sc, IE_ISCP_BUSY(sc->iscp))) {
#if I82596_DEBUG
- printf ("%s: ISCP set failed\n", sc->sc_dev.dv_xname);
+ printf ("%s: ISCP set failed\n", device_xname(sc->sc_dev));
#endif
return 0;
}
@@ -360,7 +360,7 @@
printf (": test %x:%x\n%s",
*((volatile int32_t *)((char *)sc->sc_maddr + 0)),
*((volatile int32_t *)((char *)sc->sc_maddr + 4)),
- sc->sc_dev.dv_xname);
+ device_xname(sc->sc_dev));
#endif
return 1;
}
@@ -407,6 +407,7 @@
}
/* Set up some initial glue. */
+ sc->sc_dev = self;
gsc->iot = ga->ga_iot;
gsc->iemt = ga->ga_dmatag;
sc->bt = ga->ga_iot;
@@ -471,7 +472,7 @@
(u_int)sc->sc_dmamap->dm_segs[0].ds_addr,
sc->sc_maddr,
sc->sc_msize,
- sc->sc_dev.dv_xname);
+ device_xname(self));
sc->sc_debug = IED_ALL;
#endif
diff -r 08377c86eefe -r 9eca96c372c5 sys/arch/sparc/dev/if_ie_obio.c
--- a/sys/arch/sparc/dev/if_ie_obio.c Fri Jun 03 15:34:46 2011 +0000
+++ b/sys/arch/sparc/dev/if_ie_obio.c Fri Jun 03 16:28:40 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ie_obio.c,v 1.38 2011/02/01 20:19:31 chuck Exp $ */
+/* $NetBSD: if_ie_obio.c,v 1.39 2011/06/03 16:28:40 tsutsui Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ie_obio.c,v 1.38 2011/02/01 20:19:31 chuck Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ie_obio.c,v 1.39 2011/06/03 16:28:40 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -123,7 +123,7 @@
int ie_obio_match(device_t, cfdata_t, void *);
void ie_obio_attach(device_t, device_t, void *);
-CFATTACH_DECL(ie_obio, sizeof(struct ie_softc),
+CFATTACH_DECL_NEW(ie_obio, sizeof(struct ie_softc),
ie_obio_match, ie_obio_attach, NULL, NULL);
/* Supported media */
@@ -259,6 +259,7 @@
u_long iebase;
uint8_t myaddr[ETHER_ADDR_LEN];
+ sc->sc_dev = self;
sc->bt = oba->oba_bustag;
sc->hwreset = ie_obreset;
diff -r 08377c86eefe -r 9eca96c372c5 sys/arch/sun2/dev/if_ie_mbmem.c
--- a/sys/arch/sun2/dev/if_ie_mbmem.c Fri Jun 03 15:34:46 2011 +0000
+++ b/sys/arch/sun2/dev/if_ie_mbmem.c Fri Jun 03 16:28:40 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ie_mbmem.c,v 1.10 2011/02/01 20:19:31 chuck Exp $ */
+/* $NetBSD: if_ie_mbmem.c,v 1.11 2011/06/03 16:28:40 tsutsui Exp $ */
/*
* Copyright (c) 1995 Charles D. Cranor
@@ -140,7 +140,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ie_mbmem.c,v 1.10 2011/02/01 20:19:31 chuck Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ie_mbmem.c,v 1.11 2011/06/03 16:28:40 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -232,8 +232,8 @@
static void ie_mbmemrun(struct ie_softc *);
static int ie_mbmemintr(struct ie_softc *, int);
-int ie_mbmem_match(struct device *, struct cfdata *, void *);
-void ie_mbmem_attach(struct device *, struct device *, void *);
+int ie_mbmem_match(device_t, cfdata_t, void *);
+void ie_mbmem_attach(device_t, device_t, void *);
struct ie_mbmem_softc {
struct ie_softc ie;
@@ -241,7 +241,7 @@
bus_space_handle_t ievh;
};
-CFATTACH_DECL(ie_mbmem, sizeof(struct ie_mbmem_softc),
+CFATTACH_DECL_NEW(ie_mbmem, sizeof(struct ie_mbmem_softc),
ie_mbmem_match, ie_mbmem_attach, NULL, NULL);
#define read_iev(sc, reg) \
@@ -294,7 +294,7 @@
*/
if (read_iev(vsc, status) & IEMBMEM_PERR) {
printf("%s: parity error (ctrl 0x%x @ 0x%02x%04x)\n",
- sc->sc_dev.dv_xname, read_iev(vsc, pectrl),
+ device_xname(sc->sc_dev), read_iev(vsc, pectrl),
read_iev(vsc, pectrl) & IEMBMEM_HADDR,
read_iev(vsc, peaddr));
write_iev(vsc, pectrl, read_iev(vsc, pectrl) | IEMBMEM_PARACK);
@@ -367,7 +367,7 @@
}
int
-ie_mbmem_match(struct device *parent, struct cfdata *cf, void *aux)
+ie_mbmem_match(device_t parent, cfdata_t cf, void *aux)
{
struct mbmem_attach_args *mbma = aux;
bus_space_handle_t bh;
@@ -394,10 +394,10 @@
}
void
-ie_mbmem_attach(struct device *parent, struct device *self, void *aux)
+ie_mbmem_attach(device_t parent, device_t self, void *aux)
{
uint8_t myaddr[ETHER_ADDR_LEN];
- struct ie_mbmem_softc *vsc = (void *) self;
+ struct ie_mbmem_softc *vsc = device_private(self);
struct mbmem_attach_args *mbma = aux;
struct ie_softc *sc;
bus_size_t memsize;
@@ -405,6 +405,7 @@
int lcv;
sc = &vsc->ie;
+ sc->sc_dev = self;
sc->hwreset = ie_mbmemreset;
sc->hwinit = ie_mbmemrun;
@@ -486,7 +487,7 @@
sc->do_xmitnopchain = 0;
- printf("\n%s:", self->dv_xname);
+ printf("\n%s:", device_xname(self));
/* Set the ethernet address. */
idprom_etheraddr(myaddr);
diff -r 08377c86eefe -r 9eca96c372c5 sys/arch/sun2/dev/if_ie_obio.c
--- a/sys/arch/sun2/dev/if_ie_obio.c Fri Jun 03 15:34:46 2011 +0000
+++ b/sys/arch/sun2/dev/if_ie_obio.c Fri Jun 03 16:28:40 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ie_obio.c,v 1.14 2011/02/01 20:19:31 chuck Exp $ */
+/* $NetBSD: if_ie_obio.c,v 1.15 2011/06/03 16:28:40 tsutsui Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ie_obio.c,v 1.14 2011/02/01 20:19:31 chuck Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ie_obio.c,v 1.15 2011/06/03 16:28:40 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -121,10 +121,10 @@
static void ie_obattend(struct ie_softc *, int);
static void ie_obrun(struct ie_softc *);
-int ie_obio_match(struct device *, struct cfdata *, void *);
-void ie_obio_attach(struct device *, struct device *, void *);
+int ie_obio_match(device_t, cfdata_t, void *);
+void ie_obio_attach(device_t, device_t, void *);
-CFATTACH_DECL(ie_obio, sizeof(struct ie_softc),
+CFATTACH_DECL_NEW(ie_obio, sizeof(struct ie_softc),
ie_obio_match, ie_obio_attach, NULL, NULL);
/* Supported media */
@@ -220,7 +220,7 @@
}
int
-ie_obio_match(struct device *parent, struct cfdata *cf, void *aux)
+ie_obio_match(device_t parent, cfdata_t cf, void *aux)
{
struct obio_attach_args *oba = aux;
bus_space_handle_t bh;
@@ -250,10 +250,10 @@
}
void
-ie_obio_attach(struct device *parent, struct device *self, void *aux)
+ie_obio_attach(device_t parent, device_t self, void *aux)
{
struct obio_attach_args *oba = aux;
- struct ie_softc *sc = (void *) self;
+ struct ie_softc *sc = device_private(self);
bus_dma_tag_t dmatag = oba->oba_dmatag;
bus_space_handle_t bh;
bus_dma_segment_t seg;
@@ -265,6 +265,7 @@
u_long iebase;
uint8_t myaddr[ETHER_ADDR_LEN];
+ sc->sc_dev = self;
sc->bt = oba->oba_bustag;
sc->hwreset = ie_obreset;
@@ -291,14 +292,14 @@
BUS_DMA_NOWAIT|BUS_DMA_24BIT,
&sc->sc_dmamap)) != 0) {
printf("%s: DMA map create error %d\n",
- sc->sc_dev.dv_xname, error);
+ device_xname(self), error);
return;
}
if ((error = bus_dmamem_alloc(dmatag, memsize, 64*1024, 0,
&seg, 1, &rseg,
BUS_DMA_NOWAIT | BUS_DMA_24BIT)) != 0) {
printf("%s: DMA memory allocation error %d\n",
- self->dv_xname, error);
+ device_xname(self), error);
return;
}
@@ -307,7 +308,7 @@
(void **)&sc->sc_maddr,
BUS_DMA_NOWAIT|BUS_DMA_COHERENT)) != 0) {
printf("%s: DMA buffer map error %d\n",
- sc->sc_dev.dv_xname, error);
+ device_xname(self), error);
bus_dmamem_free(dmatag, &seg, rseg);
return;
}
@@ -317,7 +318,7 @@
sc->sc_maddr, memsize, NULL,
BUS_DMA_NOWAIT)) != 0) {
printf("%s: DMA buffer map load error %d\n",
- sc->sc_dev.dv_xname, error);
+ device_xname(self), error);
bus_dmamem_unmap(dmatag, sc->sc_maddr, memsize);
bus_dmamem_free(dmatag, &seg, rseg);
return;
diff -r 08377c86eefe -r 9eca96c372c5 sys/dev/ic/i82586.c
--- a/sys/dev/ic/i82586.c Fri Jun 03 15:34:46 2011 +0000
+++ b/sys/dev/ic/i82586.c Fri Jun 03 16:28:40 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i82586.c,v 1.68 2010/04/05 07:19:34 joerg Exp $ */
+/* $NetBSD: i82586.c,v 1.69 2011/06/03 16:28:40 tsutsui Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -137,7 +137,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i82586.c,v 1.68 2010/04/05 07:19:34 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i82586.c,v 1.69 2011/06/03 16:28:40 tsutsui Exp $");
#include <sys/param.h>
@@ -236,7 +236,7 @@
int i;
Home |
Main Index |
Thread Index |
Old Index