From a8c167fabd0b1b421bf655f44e1fd3f300db33e0 Mon Sep 17 00:00:00 2001 From: matt Date: Fri, 3 Jun 2011 07:35:37 +0000 Subject: [PATCH] device_t, cfdata_t, device_private, device_xname cleanup CFATTACH_DECL_NEW for struct device only devices bump SYMTAB_SPACE for EB7500ATX --- sys/arch/acorn32/acorn32/autoconf.c | 6 +-- sys/arch/acorn32/conf/EB7500ATX | 6 +-- sys/arch/acorn32/eb7500atx/rsbus.c | 23 ++++++----- sys/arch/acorn32/include/podulebus_machdep.h | 6 +-- sys/arch/acorn32/mainbus/com_pioc.c | 8 ++-- sys/arch/acorn32/mainbus/fd.c | 41 ++++++++++---------- sys/arch/acorn32/mainbus/lpt_pioc.c | 8 ++-- sys/arch/acorn32/mainbus/pioc.c | 32 +++++++-------- sys/arch/acorn32/mainbus/wdc_pioc.c | 8 ++-- sys/arch/acorn32/podulebus/amps.c | 18 ++++----- sys/arch/acorn32/podulebus/asc.c | 12 +++--- sys/arch/acorn32/podulebus/cosc.c | 28 +++++++------ sys/arch/acorn32/podulebus/csc.c | 12 +++--- sys/arch/acorn32/podulebus/if_ie.c | 18 ++++----- sys/arch/acorn32/podulebus/netslot.c | 6 +-- sys/arch/acorn32/podulebus/podulebus.c | 29 +++++++------- sys/arch/acorn32/podulebus/ptsc.c | 26 ++++++------- 17 files changed, 141 insertions(+), 146 deletions(-) diff --git a/sys/arch/acorn32/acorn32/autoconf.c b/sys/arch/acorn32/acorn32/autoconf.c index 4e08b355885f..e91700c489fe 100644 --- a/sys/arch/acorn32/acorn32/autoconf.c +++ b/sys/arch/acorn32/acorn32/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.16 2009/05/12 06:56:59 cegger Exp $ */ +/* $NetBSD: autoconf.c,v 1.17 2011/06/03 07:35:37 matt Exp $ */ /* * Copyright (c) 1994-1998 Mark Brinicombe. @@ -43,7 +43,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.16 2009/05/12 06:56:59 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.17 2011/06/03 07:35:37 matt Exp $"); #include "opt_md.h" @@ -185,7 +185,7 @@ cpu_configure(void) } void -device_register(struct device *dev, void *aux) +device_register(device_t dev, void *aux) { } /* End of autoconf.c */ diff --git a/sys/arch/acorn32/conf/EB7500ATX b/sys/arch/acorn32/conf/EB7500ATX index 405f52411f97..19d02fdc62ad 100644 --- a/sys/arch/acorn32/conf/EB7500ATX +++ b/sys/arch/acorn32/conf/EB7500ATX @@ -1,4 +1,4 @@ -# $NetBSD: EB7500ATX,v 1.42 2011/03/06 17:08:18 bouyer Exp $ +# $NetBSD: EB7500ATX,v 1.43 2011/06/03 07:35:37 matt Exp $ # # EB7500ATX --- NetBSD/acorn32 complete configuration # @@ -22,7 +22,7 @@ include "arch/acorn32/conf/std.acorn32" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "EB7500ATX-$Revision: 1.42 $" +#ident "EB7500ATX-$Revision: 1.43 $" # estimated number of users maxusers 32 @@ -144,7 +144,7 @@ options KMEMSTATS # kernel memory statistics options USERCONF # userconf(4) support #options PIPE_SOCKETPAIR # smaller, but slower pipe(2) #options SYSCTL_INCLUDE_DESCR # Include sysctl descriptions in kernel -options SYMTAB_SPACE=262144 +options SYMTAB_SPACE=275000 # Enable experimental buffer queue strategy for better responsiveness under # high disk I/O load. Use it with caution - it's not proven to be stable yet. diff --git a/sys/arch/acorn32/eb7500atx/rsbus.c b/sys/arch/acorn32/eb7500atx/rsbus.c index e7cc3743ddf9..aa8034f4f585 100644 --- a/sys/arch/acorn32/eb7500atx/rsbus.c +++ b/sys/arch/acorn32/eb7500atx/rsbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: rsbus.c,v 1.7 2009/10/21 16:16:24 rmind Exp $ */ +/* $NetBSD: rsbus.c,v 1.8 2011/06/03 07:35:37 matt Exp $ */ /* * Copyright (c) 2002 @@ -29,7 +29,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: rsbus.c,v 1.7 2009/10/21 16:16:24 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rsbus.c,v 1.8 2011/06/03 07:35:37 matt Exp $"); #include #include @@ -45,25 +45,25 @@ extern struct bus_space rsbus_bs_tag; /* Declare prototypes */ -static int rsbus_match(struct device *, struct cfdata *, void *); -static void rsbus_attach(struct device *, struct device *, void *); +static int rsbus_match(device_t, cfdata_t, void *); +static void rsbus_attach(device_t, device_t, void *); static int rsbus_print(void *, const char *); -static int rsbus_search(struct device *, struct cfdata *, +static int rsbus_search(device_t, cfdata_t, const int *, void *); CFATTACH_DECL(rsbus, sizeof(struct rsbus_softc), rsbus_match, rsbus_attach, NULL, NULL); static int -rsbus_match(struct device *parent, struct cfdata *cf, void *aux) +rsbus_match(device_t parent, cfdata_t cf, void *aux) { return(1); } static void -rsbus_attach(struct device *parent, struct device *self, void *aux) +rsbus_attach(device_t parent, device_t self, void *aux) { - struct rsbus_softc *sc = (void *) self; + struct rsbus_softc *sc = device_private(self); sc->sc_iot = &rsbus_bs_tag; printf("\n"); @@ -75,9 +75,9 @@ rsbus_attach(struct device *parent, struct device *self, void *aux) } static int -rsbus_search(struct device *parent, struct cfdata *cf, const int *ldesc, void *aux) +rsbus_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux) { - struct rsbus_softc *sc = (struct rsbus_softc *)parent; + struct rsbus_softc *sc = device_private(parent); struct rsbus_attach_args sa; sa.sa_iot = sc->sc_iot; @@ -94,7 +94,7 @@ rsbus_search(struct device *parent, struct cfdata *cf, const int *ldesc, void *a static int rsbus_print(void *aux, const char *name) { - struct rsbus_attach_args *sa = (struct rsbus_attach_args*)aux; + struct rsbus_attach_args *sa = aux; if (sa->sa_size) aprint_normal(" addr 0x%lx", sa->sa_addr); @@ -105,4 +105,3 @@ rsbus_print(void *aux, const char *name) return (UNCONF); } - diff --git a/sys/arch/acorn32/include/podulebus_machdep.h b/sys/arch/acorn32/include/podulebus_machdep.h index 4120b05b96b8..57085514a3c1 100644 --- a/sys/arch/acorn32/include/podulebus_machdep.h +++ b/sys/arch/acorn32/include/podulebus_machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: podulebus_machdep.h,v 1.2 2009/03/14 14:45:51 dsl Exp $ */ +/* $NetBSD: podulebus_machdep.h,v 1.3 2011/06/03 07:35:37 matt Exp $ */ /* * Copyright (c) 1995 Mark Brinicombe. @@ -161,8 +161,8 @@ extern void podulebus_shift_tag(bus_space_tag_t, u_int, bus_space_tag_t *); /* Used internally by the podulebus code */ -extern void netslotscan(struct device *); -extern void poduleexamine(podule_t *, struct device *, int); +extern void netslotscan(device_t); +extern void poduleexamine(podule_t *, device_t, int); #endif diff --git a/sys/arch/acorn32/mainbus/com_pioc.c b/sys/arch/acorn32/mainbus/com_pioc.c index dbf1c526cea7..2cbb83b62813 100644 --- a/sys/arch/acorn32/mainbus/com_pioc.c +++ b/sys/arch/acorn32/mainbus/com_pioc.c @@ -1,4 +1,4 @@ -/* $NetBSD: com_pioc.c,v 1.14 2008/04/28 20:23:09 martin Exp $ */ +/* $NetBSD: com_pioc.c,v 1.15 2011/06/03 07:35:37 matt Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: com_pioc.c,v 1.14 2008/04/28 20:23:09 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: com_pioc.c,v 1.15 2011/06/03 07:35:37 matt Exp $"); #include #include @@ -103,7 +103,7 @@ CFATTACH_DECL_NEW(com_pioc, sizeof(struct com_pioc_softc), extern bus_space_tag_t comconstag; /* From pioc.c */ /* - * int com_pioc_probe(struct device *parent, struct cfdata *cf, void *aux) + * int com_pioc_probe(device_t parent, cfdata_t cf, void *aux) * * Make sure we are trying to attach a com device and then * probe for one. @@ -141,7 +141,7 @@ com_pioc_probe(device_t parent, cfdata_t cf, void *aux) } /* - * void com_pioc_attach(struct device *parent, struct device *self, void *aux) + * void com_pioc_attach(device_t parent, device_t self, void *aux) * * attach the com device */ diff --git a/sys/arch/acorn32/mainbus/fd.c b/sys/arch/acorn32/mainbus/fd.c index 55e3ac5f1497..d5eddc796946 100644 --- a/sys/arch/acorn32/mainbus/fd.c +++ b/sys/arch/acorn32/mainbus/fd.c @@ -1,4 +1,4 @@ -/* $NetBSD: fd.c,v 1.49 2010/12/09 05:14:28 uebayasi Exp $ */ +/* $NetBSD: fd.c,v 1.50 2011/06/03 07:35:37 matt Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -82,7 +82,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.49 2010/12/09 05:14:28 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.50 2011/06/03 07:35:37 matt Exp $"); #include "opt_ddb.h" @@ -174,9 +174,9 @@ struct fdc_softc { }; /* controller driver configuration */ -int fdcprobe(struct device *, struct cfdata *, void *); +int fdcprobe(device_t, cfdata_t, void *); int fdprint(void *, const char *); -void fdcattach(struct device *, struct device *, void *); +void fdcattach(device_t, device_t, void *); CFATTACH_DECL(fdc, sizeof(struct fdc_softc), fdcprobe, fdcattach, NULL, NULL); @@ -249,8 +249,8 @@ struct fd_softc { }; /* floppy driver configuration */ -int fdprobe(struct device *, struct cfdata *, void *); -void fdattach(struct device *, struct device *, void *); +int fdprobe(device_t, cfdata_t, void *); +void fdattach(device_t, device_t, void *); extern char floppy_read_fiq[], floppy_read_fiq_end[]; extern char floppy_write_fiq[], floppy_write_fiq_end[]; @@ -289,7 +289,7 @@ void fd_motor_on(void *arg); int fdcresult(struct fdc_softc *fdc); int out_fdc(bus_space_tag_t iot, bus_space_handle_t ioh, u_char x); void fdcstart(struct fdc_softc *fdc); -void fdcstatus(struct device *dv, int n, const char *s); +void fdcstatus(device_t dv, int n, const char *s); void fdctimeout(void *arg); void fdcpseudointr(void *arg); int fdcintr(void *); @@ -299,7 +299,7 @@ inline struct fd_type *fd_dev_to_type(struct fd_softc *, dev_t); int fdformat(dev_t, struct ne7_fd_formb *, struct lwp *); int -fdcprobe(struct device *parent, struct cfdata *cf, void *aux) +fdcprobe(device_t parent, cfdata_t cf, void *aux) { struct pioc_attach_args *pa = aux; bus_space_tag_t iot; @@ -361,9 +361,9 @@ fdprint(void *aux, const char *fdc) } void -fdcattach(struct device *parent, struct device *self, void *aux) +fdcattach(device_t parent, device_t self, void *aux) { - struct fdc_softc *fdc = (void *)self; + struct fdc_softc *fdc = device_private(self); bus_space_tag_t iot; bus_space_handle_t ioh; struct pioc_attach_args *pa = aux; @@ -388,10 +388,10 @@ fdcattach(struct device *parent, struct device *self, void *aux) callout_init(&fdc->sc_timo_ch, 0); callout_init(&fdc->sc_intr_ch, 0); - fdc->sc_ih = intr_claim(pa->pa_irq, IPL_BIO, "fdc", - fdcintr, fdc); + fdc->sc_ih = intr_claim(pa->pa_irq, IPL_BIO, "fdc", fdcintr, fdc); if (!fdc->sc_ih) - panic("%s: Cannot claim IRQ %d", self->dv_xname, pa->pa_irq); + panic("%s: Cannot claim IRQ %d", + device_xname(self), pa->pa_irq); #if 0 /* @@ -417,9 +417,9 @@ fdcattach(struct device *parent, struct device *self, void *aux) } int -fdprobe(struct device *parent, struct cfdata *cf, void *aux) +fdprobe(device_t parent, cfdata_t cf, void *aux) { - struct fdc_softc *fdc = (void *)parent; + struct fdc_softc *fdc = device_private(parent); struct fdc_attach_args *fa = aux; int drive = fa->fa_drive; bus_space_tag_t iot = fdc->sc_iot; @@ -472,10 +472,10 @@ fdprobe(struct device *parent, struct cfdata *cf, void *aux) * Controller is working, and drive responded. Attach it. */ void -fdattach(struct device *parent, struct device *self, void *aux) +fdattach(device_t parent, device_t self, void *aux) { - struct fdc_softc *fdc = (void *)parent; - struct fd_softc *fd = (void *)self; + struct fdc_softc *fdc = device_private(parent); + struct fd_softc *fd = device_private(self); struct fdc_attach_args *fa = aux; struct fd_type *type = fa->fa_deftype; int drive = fa->fa_drive; @@ -840,7 +840,7 @@ fdcpstatus(int n, struct fdc_softc *fdc) } void -fdcstatus(struct device *dv, int n, const char *s) +fdcstatus(device_t dv, int n, const char *s) { struct fdc_softc *fdc = (void *) device_parent(dv); @@ -1028,7 +1028,8 @@ loop: fdc->sc_fr.fh_r12, (u_int)bp->b_data, fd->sc_skip); #endif if (fiq_claim(&fdc->sc_fh) == -1) - panic("%s: Cannot claim FIQ vector", fdc->sc_dev.dv_xname); + panic("%s: Cannot claim FIQ vector", + device_xname(&fdc->sc_dev)); IOMD_WRITE_BYTE(IOMD_FIQMSK, 0x01); bus_space_write_2(iot, ioh, fdctl, type->rate); #ifdef FD_DEBUG diff --git a/sys/arch/acorn32/mainbus/lpt_pioc.c b/sys/arch/acorn32/mainbus/lpt_pioc.c index bdd8df8eddf4..0ea1b314da1a 100644 --- a/sys/arch/acorn32/mainbus/lpt_pioc.c +++ b/sys/arch/acorn32/mainbus/lpt_pioc.c @@ -1,4 +1,4 @@ -/* $NetBSD: lpt_pioc.c,v 1.10 2008/04/13 01:14:26 chris Exp $ */ +/* $NetBSD: lpt_pioc.c,v 1.11 2011/06/03 07:35:37 matt Exp $ */ /* * Copyright (c) 1997 Mark Brinicombe @@ -36,7 +36,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: lpt_pioc.c,v 1.10 2008/04/13 01:14:26 chris Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lpt_pioc.c,v 1.11 2011/06/03 07:35:37 matt Exp $"); #include #include @@ -152,7 +152,7 @@ out: } /* - * int lpt_pioc_probe(struct device *parent, struct cfdata *cf, void *aux) + * int lpt_pioc_probe(device_t parent, cfdata_t cf, void *aux) * * Make sure we are trying to attach a lpt device and then * probe for one. @@ -181,7 +181,7 @@ lpt_pioc_probe(device_t parent, cfdata_t match, void *aux) } /* - * void lpt_pioc_attach(struct device *parent, struct device *self, void *aux) + * void lpt_pioc_attach(device_t parent, device_t self, void *aux) * * attach the lpt device */ diff --git a/sys/arch/acorn32/mainbus/pioc.c b/sys/arch/acorn32/mainbus/pioc.c index f3521e99bb71..19af62ee0952 100644 --- a/sys/arch/acorn32/mainbus/pioc.c +++ b/sys/arch/acorn32/mainbus/pioc.c @@ -1,4 +1,4 @@ -/* $NetBSD: pioc.c,v 1.15 2009/05/12 07:07:44 cegger Exp $ */ +/* $NetBSD: pioc.c,v 1.16 2011/06/03 07:35:37 matt Exp $ */ /* * Copyright (c) 1997 Mark Brinicombe. @@ -41,7 +41,7 @@ /*#define PIOC_DEBUG*/ #include -__KERNEL_RCSID(0, "$NetBSD: pioc.c,v 1.15 2009/05/12 07:07:44 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pioc.c,v 1.16 2011/06/03 07:35:37 matt Exp $"); #include #include @@ -91,13 +91,13 @@ bus_space_tag_t comconstag = &mainbus_bs_tag; /* Prototypes for functions */ -static int piocmatch(struct device *, struct cfdata *, void *); -static void piocattach(struct device *, struct device *, void *); +static int piocmatch(device_t, cfdata_t, void *); +static void piocattach(device_t, device_t, void *); static int piocprint(void *aux, const char *name); #if 0 -static int piocsearch(struct device *, struct cfdata *, void *); +static int piocsearch(device_t, cfdata_t, void *); #endif -static int piocsubmatch(struct device *, struct cfdata *, +static int piocsubmatch(device_t, cfdata_t, const int *, void *); static void piocgetid(bus_space_tag_t iot, bus_space_handle_t ioh, int config_entry, int *id, int *revision); @@ -132,7 +132,7 @@ piocgetid(bus_space_tag_t iot, bus_space_handle_t ioh, int config_entry, int *id } /* - * int piocmatch(struct device *parent, struct cfdata *cf, void *aux) + * int piocmatch(device_t parent, cfdata_t cf, void *aux) * * Put the controller into config mode and probe the ID to see if * we recognise it. @@ -141,7 +141,7 @@ piocgetid(bus_space_tag_t iot, bus_space_handle_t ioh, int config_entry, int *id */ static int -piocmatch(struct device *parent, struct cfdata *cf, void *aux) +piocmatch(device_t parent, cfdata_t cf, void *aux) { struct mainbus_attach_args *mb = aux; bus_space_tag_t iot; @@ -203,7 +203,7 @@ piocprint(void *aux, const char *name) #if 0 /* - * int piocsearch(struct device *parent, struct cfdata *cf, void *aux) + * int piocsearch(device_t parent, cfdata_t cf, void *aux) * * search function used to probe and attach the child devices. * @@ -212,9 +212,9 @@ piocprint(void *aux, const char *name) */ static int -piocsearch(struct device *parent, struct cfdata *cf, const int *ldesc, void *aux) +piocsearch(device_t parent, cfdata_t cf, const int *ldesc, void *aux) { - struct pioc_softc *sc = (struct pioc_softc *)parent; + struct pioc_softc *sc = device_private(parent); struct pioc_attach_args pa; int tryagain; @@ -245,7 +245,7 @@ piocsearch(struct device *parent, struct cfdata *cf, const int *ldesc, void *aux #endif /* - * int piocsubmatch(struct device *parent, struct cfdata *cf, void *aux) + * int piocsubmatch(device_t parent, cfdata_t cf, void *aux) * * search function used to probe and attach the child devices. * @@ -254,7 +254,7 @@ piocsearch(struct device *parent, struct cfdata *cf, const int *ldesc, void *aux */ static int -piocsubmatch(struct device *parent, struct cfdata *cf, const int *ldesc, void *aux) +piocsubmatch(device_t parent, cfdata_t cf, const int *ldesc, void *aux) { struct pioc_attach_args *pa = aux; int tryagain; @@ -277,17 +277,17 @@ piocsubmatch(struct device *parent, struct cfdata *cf, const int *ldesc, void *a } /* - * void piocattach(struct device *parent, struct device *dev, void *aux) + * void piocattach(device_t parent, device_t dev, void *aux) * * Identify the PIOC and read the config registers into the softc. * Search and configure all children */ static void -piocattach(struct device *parent, struct device *self, void *aux) +piocattach(device_t parent, device_t self, void *aux) { struct mainbus_attach_args *mb = aux; - struct pioc_softc *sc = (struct pioc_softc *)self; + struct pioc_softc *sc = device_private(self); bus_space_tag_t iot; bus_space_handle_t ioh; int id, rev; diff --git a/sys/arch/acorn32/mainbus/wdc_pioc.c b/sys/arch/acorn32/mainbus/wdc_pioc.c index e1d30965aca5..6688252629ea 100644 --- a/sys/arch/acorn32/mainbus/wdc_pioc.c +++ b/sys/arch/acorn32/mainbus/wdc_pioc.c @@ -1,4 +1,4 @@ -/* $NetBSD: wdc_pioc.c,v 1.23 2008/03/18 23:52:16 cube Exp $ */ +/* $NetBSD: wdc_pioc.c,v 1.24 2011/06/03 07:35:37 matt Exp $ */ /* * Copyright (c) 1997-1998 Mark Brinicombe. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wdc_pioc.c,v 1.23 2008/03/18 23:52:16 cube Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wdc_pioc.c,v 1.24 2011/06/03 07:35:37 matt Exp $"); #include #include @@ -74,7 +74,7 @@ CFATTACH_DECL_NEW(wdc_pioc, sizeof(struct wdc_pioc_softc), wdc_pioc_probe, wdc_pioc_attach, NULL, NULL); /* - * int wdc_pioc_probe(struct device *parent, struct cfdata *cf, void *aux) + * int wdc_pioc_probe(device_t parent, cfdata_t cf, void *aux) * * Make sure we are trying to attach a wdc device and then * probe for one. @@ -137,7 +137,7 @@ wdc_pioc_probe(device_t parent, cfdata_t cf, void *aux) } /* - * void wdc_pioc_attach(struct device *parent, struct device *self, void *aux) + * void wdc_pioc_attach(device_t parent, device_t self, void *aux) * * attach the wdc device */ diff --git a/sys/arch/acorn32/podulebus/amps.c b/sys/arch/acorn32/podulebus/amps.c index f32c10379003..6b5ceac1942a 100644 --- a/sys/arch/acorn32/podulebus/amps.c +++ b/sys/arch/acorn32/podulebus/amps.c @@ -1,4 +1,4 @@ -/* $NetBSD: amps.c,v 1.17 2009/11/27 03:23:03 rmind Exp $ */ +/* $NetBSD: amps.c,v 1.18 2011/06/03 07:35:37 matt Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: amps.c,v 1.17 2009/11/27 03:23:03 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: amps.c,v 1.18 2011/06/03 07:35:37 matt Exp $"); #include #include @@ -85,8 +85,8 @@ struct amps_softc { bus_space_tag_t sc_iot; /* Bus tag */ }; -int amps_probe(struct device *, struct cfdata *, void *); -void amps_attach(struct device *, struct device *, void *); +int amps_probe(device_t, cfdata_t, void *); +void amps_attach(device_t, device_t, void *); CFATTACH_DECL(amps, sizeof(struct amps_softc), amps_probe, amps_attach, NULL, NULL); @@ -130,9 +130,9 @@ amps_print(void *aux, const char *name) */ int -amps_probe(struct device *parent, struct cfdata *cf, void *aux) +amps_probe(device_t parent, cfdata_t cf, void *aux) { - struct podule_attach_args *pa = (void *)aux; + struct podule_attach_args *pa = aux; return (pa->pa_product == PODULE_ATOMWIDE_SERIAL); } @@ -145,10 +145,10 @@ amps_probe(struct device *parent, struct cfdata *cf, void *aux) */ void -amps_attach(struct device *parent, struct device *self, void *aux) +amps_attach(device_t parent, device_t self, void *aux) { - struct amps_softc *sc = (void *)self; - struct podule_attach_args *pa = (void *)aux; + struct amps_softc *sc = device_private(self); + struct podule_attach_args *pa = aux; struct amps_attach_args aa; /* Note the podule number and validate */ diff --git a/sys/arch/acorn32/podulebus/asc.c b/sys/arch/acorn32/podulebus/asc.c index fec720af8d46..26c898d41db0 100644 --- a/sys/arch/acorn32/podulebus/asc.c +++ b/sys/arch/acorn32/podulebus/asc.c @@ -1,4 +1,4 @@ -/* $NetBSD: asc.c,v 1.16 2009/05/12 06:54:10 cegger Exp $ */ +/* $NetBSD: asc.c,v 1.17 2011/06/03 07:35:37 matt Exp $ */ /* * Copyright (c) 2001 Richard Earnshaw @@ -98,7 +98,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: asc.c,v 1.16 2009/05/12 06:54:10 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: asc.c,v 1.17 2011/06/03 07:35:37 matt Exp $"); #include #include @@ -126,8 +126,8 @@ __KERNEL_RCSID(0, "$NetBSD: asc.c,v 1.16 2009/05/12 06:54:10 cegger Exp $"); #include #include -void ascattach (struct device *, struct device *, void *); -int ascmatch (struct device *, struct cfdata *, void *); +void ascattach (device_t, device_t, void *); +int ascmatch (device_t, cfdata_t, void *); void asc_enintr (struct sbic_softc *); @@ -160,7 +160,7 @@ int asc_poll = 0; #endif int -ascmatch(struct device *pdp, struct cfdata *cf, void *auxp) +ascmatch(device_t pdp, cfdata_t cf, void *auxp) { struct podule_attach_args *pa = (struct podule_attach_args *)auxp; @@ -181,7 +181,7 @@ ascmatch(struct device *pdp, struct cfdata *cf, void *auxp) } void -ascattach(struct device *pdp, struct device *dp, void *auxp) +ascattach(device_t pdp, device_t dp, void *auxp) { /* volatile struct sdmac *rp;*/ struct asc_softc *sc; diff --git a/sys/arch/acorn32/podulebus/cosc.c b/sys/arch/acorn32/podulebus/cosc.c index 2fb74827575d..09bb625e35c4 100644 --- a/sys/arch/acorn32/podulebus/cosc.c +++ b/sys/arch/acorn32/podulebus/cosc.c @@ -1,4 +1,4 @@ -/* $NetBSD: cosc.c,v 1.16 2009/05/12 06:54:10 cegger Exp $ */ +/* $NetBSD: cosc.c,v 1.17 2011/06/03 07:35:37 matt Exp $ */ /* * Copyright (c) 1996 Mark Brinicombe @@ -42,7 +42,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cosc.c,v 1.16 2009/05/12 06:54:10 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cosc.c,v 1.17 2011/06/03 07:35:37 matt Exp $"); #include #include @@ -65,8 +65,8 @@ __KERNEL_RCSID(0, "$NetBSD: cosc.c,v 1.16 2009/05/12 06:54:10 cegger Exp $"); #include #include -void coscattach(struct device *, struct device *, void *); -int coscmatch(struct device *, struct cfdata *, void *); +void coscattach(device_t, device_t, void *); +int coscmatch(device_t, cfdata_t, void *); CFATTACH_DECL(cosc, sizeof(struct cosc_softc), coscmatch, coscattach, NULL, NULL); @@ -86,9 +86,9 @@ int cosc_poll = 1; #endif int -coscmatch(struct device *pdp, struct cfdata *cf, void *auxp) +coscmatch(device_t parent, cfdata_t cf, void *aux) { - struct podule_attach_args *pa = (struct podule_attach_args *)auxp; + struct podule_attach_args *pa = aux; /* Look for the card */ @@ -106,15 +106,13 @@ coscmatch(struct device *pdp, struct cfdata *cf, void *auxp) static int dummy[6]; void -coscattach(struct device *pdp, struct device *dp, void *auxp) +coscattach(device_t parent, device_t self, void *aux) { - struct cosc_softc *sc = (struct cosc_softc *)dp; - struct podule_attach_args *pa; + struct cosc_softc *sc = device_private(self); + struct podule_attach_args *pa = aux; cosc_regmap_p rp = &sc->sc_regmap; vu_char *esc; - pa = (struct podule_attach_args *)auxp; - if (pa->pa_podule_number == -1) panic("Podule has disappeared !"); @@ -236,7 +234,7 @@ coscattach(struct device *pdp, struct device *dp, void *auxp) sc->sc_softc.sc_bump_sz = PAGE_SIZE; sc->sc_softc.sc_bump_pa = 0x0; - escinitialize((struct esc_softc *)sc); + escinitialize(&sc->sc_softc); sc->sc_softc.sc_adapter.adapt_dev = &sc->sc_softc.sc_dev; sc->sc_softc.sc_adapter.adapt_nchannels = 1; @@ -271,18 +269,18 @@ coscattach(struct device *pdp, struct device *dp, void *auxp) #endif { evcnt_attach_dynamic(&sc->sc_intrcnt, EVCNT_TYPE_INTR, NULL, - device_xname(dp), "intr"); + device_xname(self), "intr"); sc->sc_ih = podulebus_irq_establish(pa->pa_ih, IPL_BIO, cosc_intr, sc, &sc->sc_intrcnt); if (sc->sc_ih == NULL) panic("%s: Cannot install IRQ handler", - dp->dv_xname); + device_xname(self)); } printf("\n"); /* attach all scsi units on us */ - config_found(dp, &sc->sc_softc.sc_channel, scsiprint); + config_found(self, &sc->sc_softc.sc_channel, scsiprint); } diff --git a/sys/arch/acorn32/podulebus/csc.c b/sys/arch/acorn32/podulebus/csc.c index 849d16f8d4c7..8aedfaff9a88 100644 --- a/sys/arch/acorn32/podulebus/csc.c +++ b/sys/arch/acorn32/podulebus/csc.c @@ -1,4 +1,4 @@ -/* $NetBSD: csc.c,v 1.16 2009/05/12 06:54:10 cegger Exp $ */ +/* $NetBSD: csc.c,v 1.17 2011/06/03 07:35:37 matt Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: csc.c,v 1.16 2009/05/12 06:54:10 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: csc.c,v 1.17 2011/06/03 07:35:37 matt Exp $"); #include #include @@ -57,8 +57,8 @@ __KERNEL_RCSID(0, "$NetBSD: csc.c,v 1.16 2009/05/12 06:54:10 cegger Exp $"); #include #include -int cscmatch(struct device *, struct cfdata *, void *); -void cscattach(struct device *, struct device *, void *); +int cscmatch(device_t, cfdata_t, void *); +void cscattach(device_t, device_t, void *); CFATTACH_DECL(csc, sizeof(struct csc_softc), cscmatch, cscattach, NULL, NULL); @@ -77,7 +77,7 @@ void csc_set_dma_mode(struct sfas_softc *, int); * if we are a Cumana SCSI-2 card */ int -cscmatch(struct device *pdp, struct cfdata *cf, void *auxp) +cscmatch(device_t pdp, cfdata_t cf, void *auxp) { struct podule_attach_args *pa = (struct podule_attach_args *)auxp; @@ -95,7 +95,7 @@ cscmatch(struct device *pdp, struct cfdata *cf, void *auxp) } void -cscattach(struct device *pdp, struct device *dp, void *auxp) +cscattach(device_t pdp, device_t dp, void *auxp) { struct csc_softc *sc = (struct csc_softc *)dp; struct podule_attach_args *pa; diff --git a/sys/arch/acorn32/podulebus/if_ie.c b/sys/arch/acorn32/podulebus/if_ie.c index 9a3a05235073..2064ac8f9a83 100644 --- a/sys/arch/acorn32/podulebus/if_ie.c +++ b/sys/arch/acorn32/podulebus/if_ie.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ie.c,v 1.29 2010/04/05 07:19:28 joerg Exp $ */ +/* $NetBSD: if_ie.c,v 1.30 2011/06/03 07:35:37 matt Exp $ */ /* * Copyright (c) 1995 Melvin Tang-Richardson. @@ -53,7 +53,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.29 2010/04/05 07:19:28 joerg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.30 2011/06/03 07:35:37 matt Exp $"); #define IGNORE_ETHER1_IDROM_CHECKSUM @@ -173,8 +173,8 @@ static int command_and_wait( struct ie_softc *sc, u_short cmd, struct ie_sys_ctl_block *pscb, void *pcmd, int ocmd, int scmd, int mask ); -int ieprobe(struct device *, struct cfdata *, void *); -void ieattach(struct device *, struct device *, void *); +int ieprobe(device_t, cfdata_t, void *); +void ieattach(device_t, device_t, void *); static inline void ie_cli(struct ie_softc *); static inline void ieattn(struct ie_softc *); @@ -292,9 +292,9 @@ crc32(u_char *p, int l) */ int -ieprobe(struct device *parent, struct cfdata *cf, void *aux) +ieprobe(device_t parent, cfdata_t cf, void *aux) { - struct podule_attach_args *pa = (void *)aux; + struct podule_attach_args *pa = aux; /* Look for a network slot interface */ @@ -305,10 +305,10 @@ ieprobe(struct device *parent, struct cfdata *cf, void *aux) * Attach our driver to the interfaces it uses */ -void ieattach ( struct device *parent, struct device *self, void *aux ) +void ieattach ( device_t parent, device_t self, void *aux ) { - struct ie_softc *sc = (void *)self; - struct podule_attach_args *pa = (void *)aux; + struct ie_softc *sc = device_private(self); + struct podule_attach_args *pa = aux; struct ifnet *ifp = &sc->sc_ethercom.ec_if; int i; char idrom[32]; diff --git a/sys/arch/acorn32/podulebus/netslot.c b/sys/arch/acorn32/podulebus/netslot.c index 054a6a3369d4..77eba8039f9e 100644 --- a/sys/arch/acorn32/podulebus/netslot.c +++ b/sys/arch/acorn32/podulebus/netslot.c @@ -1,4 +1,4 @@ -/* $NetBSD: netslot.c,v 1.8 2009/03/14 15:35:59 dsl Exp $ */ +/* $NetBSD: netslot.c,v 1.9 2011/06/03 07:35:37 matt Exp $ */ /* * Copyright (c) 1994-1996 Mark Brinicombe. @@ -35,7 +35,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: netslot.c,v 1.8 2009/03/14 15:35:59 dsl Exp $"); +__KERNEL_RCSID(1, "$NetBSD: netslot.c,v 1.9 2011/06/03 07:35:37 matt Exp $"); #include #include @@ -73,7 +73,7 @@ netslotread(u_int address, int offset) } void -netslotscan(struct device *dev) +netslotscan(device_t dev) { podule_t *podule; volatile u_char *address; diff --git a/sys/arch/acorn32/podulebus/podulebus.c b/sys/arch/acorn32/podulebus/podulebus.c index 5d760ddfc3cc..89b7e42c398d 100644 --- a/sys/arch/acorn32/podulebus/podulebus.c +++ b/sys/arch/acorn32/podulebus/podulebus.c @@ -1,4 +1,4 @@ -/* $NetBSD: podulebus.c,v 1.25 2009/05/12 06:54:10 cegger Exp $ */ +/* $NetBSD: podulebus.c,v 1.26 2011/06/03 07:35:37 matt Exp $ */ /* * Copyright (c) 1994-1996 Mark Brinicombe. @@ -43,7 +43,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: podulebus.c,v 1.25 2009/05/12 06:54:10 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: podulebus.c,v 1.26 2011/06/03 07:35:37 matt Exp $"); #include #include @@ -73,23 +73,22 @@ extern struct bus_space podulebus_bs_tag; /* Declare prototypes */ u_int poduleread(u_int, int); -int podulebusmatch(struct device *, struct cfdata *, void *); -void podulebusattach(struct device *, struct device *, void *); +int podulebusmatch(device_t, cfdata_t, void *); +void podulebusattach(device_t, device_t, void *); int podulebusprint(void *, const char *); -int podulebussubmatch(struct device *, struct cfdata *, - const int *, void *); +int podulebussubmatch(device_t, cfdata_t, const int *, void *); void podulechunkdirectory(podule_t *); -void podulescan(struct device *); +void podulescan(device_t); /* - * int podulebusmatch(struct device *parent, void *match, void *aux) + * int podulebusmatch(device_t parent, void *match, void *aux) * * Probe for the podule bus. Currently all this does is return 1 to * indicate that the podule bus was found. */ int -podulebusmatch(struct device *parent, struct cfdata *cf, void *aux) +podulebusmatch(device_t parent, cfdata_t cf, void *aux) { switch (IOMD_ID) { case RPC600_IOMD_ID: @@ -123,7 +122,7 @@ podulebusprint(void *aux, const char *name) int -podulebussubmatch(struct device *parent, struct cfdata *cf, const int *ldesc, void *aux) +podulebussubmatch(device_t parent, cfdata_t cf, const int *ldesc, void *aux) { struct podule_attach_args *pa = aux; @@ -226,7 +225,7 @@ podulechunkdirectory(podule_t *podule) void -poduleexamine(podule_t *podule, struct device *dev, int slottype) +poduleexamine(podule_t *podule, device_t dev, int slottype) { struct manufacturer_description *man_desc; struct podule_description *pod_desc; @@ -300,7 +299,7 @@ poduleread(u_int address, int offset) } void -podulescan(struct device *dev) +podulescan(device_t dev) { int loop; podule_t *podule; @@ -391,7 +390,7 @@ podulescan(struct device *dev) /* - * void podulebusattach(struct device *parent, struct device *dev, void *aux) + * void podulebusattach(device_t parent, device_t dev, void *aux) * * Attach podulebus. * This probes all the podules and sets up the podules array with @@ -401,7 +400,7 @@ podulescan(struct device *dev) */ void -podulebusattach(struct device *parent, struct device *self, void *aux) +podulebusattach(device_t parent, device_t self, void *aux) { int loop; struct podule_attach_args pa; @@ -511,7 +510,7 @@ podulebusattach(struct device *parent, struct device *self, void *aux) } -CFATTACH_DECL(podulebus, sizeof(struct device), +CFATTACH_DECL_NEW(podulebus, 0, podulebusmatch, podulebusattach, NULL, NULL); /* Useful functions that drivers may share */ diff --git a/sys/arch/acorn32/podulebus/ptsc.c b/sys/arch/acorn32/podulebus/ptsc.c index 05139995bd69..55d4ff8f13df 100644 --- a/sys/arch/acorn32/podulebus/ptsc.c +++ b/sys/arch/acorn32/podulebus/ptsc.c @@ -1,4 +1,4 @@ -/* $NetBSD: ptsc.c,v 1.16 2009/05/12 06:54:10 cegger Exp $ */ +/* $NetBSD: ptsc.c,v 1.17 2011/06/03 07:35:37 matt Exp $ */ /* * Copyright (c) 1982, 1990 The Regents of the University of California. @@ -75,7 +75,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ptsc.c,v 1.16 2009/05/12 06:54:10 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ptsc.c,v 1.17 2011/06/03 07:35:37 matt Exp $"); #include #include @@ -98,8 +98,8 @@ __KERNEL_RCSID(0, "$NetBSD: ptsc.c,v 1.16 2009/05/12 06:54:10 cegger Exp $"); #include #include -int ptscmatch(struct device *, struct cfdata *, void *); -void ptscattach(struct device *, struct device *, void *); +int ptscmatch(device_t, cfdata_t, void *); +void ptscattach(device_t, device_t, void *); CFATTACH_DECL(ptsc, sizeof(struct ptsc_softc), ptscmatch, ptscattach, NULL, NULL); @@ -118,9 +118,9 @@ void ptsc_set_dma_mode(struct sfas_softc *, int); * if we are a Power-tec SCSI-2 card */ int -ptscmatch(struct device *pdp, struct cfdata *cf, void *auxp) +ptscmatch(device_t parent, cfdata_t cf, void *aux) { - struct podule_attach_args *pa = (struct podule_attach_args *)auxp; + struct podule_attach_args *pa = aux; /* Look for the card */ @@ -138,15 +138,13 @@ ptscmatch(struct device *pdp, struct cfdata *cf, void *auxp) } void -ptscattach(struct device *pdp, struct device *dp, void *auxp) +ptscattach(device_t parent, device_t self, void *aux) { - struct ptsc_softc *sc = (struct ptsc_softc *)dp; - struct podule_attach_args *pa; + struct ptsc_softc *sc = device_private(self); + struct podule_attach_args *pa = aux; ptsc_regmap_p rp = &sc->sc_regmap; vu_char *fas; - pa = (struct podule_attach_args *)auxp; - if (pa->pa_podule_number == -1) panic("Podule has disappeared !"); @@ -225,11 +223,11 @@ ptscattach(struct device *pdp, struct device *dp, void *auxp) #if PTSC_POLL == 0 evcnt_attach_dynamic(&sc->sc_softc.sc_intrcnt, EVCNT_TYPE_INTR, NULL, - device_xname(dp), "intr"); + device_xname(self), "intr"); sc->sc_softc.sc_ih = podulebus_irq_establish(pa->pa_ih, IPL_BIO, ptsc_intr, &sc->sc_softc, &sc->sc_softc.sc_intrcnt); if (sc->sc_softc.sc_ih == NULL) - panic("%s: Cannot install IRQ handler", dp->dv_xname); + panic("%s: Cannot install IRQ handler", device_xname(self)); #else printf(" polling"); sc->sc_softc.sc_adapter.adapt_flags = SCSIPI_ADAPT_POLL_ONLY; @@ -238,7 +236,7 @@ ptscattach(struct device *pdp, struct device *dp, void *auxp) printf("\n"); /* attach all scsi units on us */ - config_found(dp, &sc->sc_softc.sc_channel, scsiprint); + config_found(self, &sc->sc_softc.sc_channel, scsiprint); }