Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/alpha Major cleanup of alpha device drivers.



details:   https://anonhg.NetBSD.org/src/rev/f8c3baf6d0dc
branches:  trunk
changeset: 766069:f8c3baf6d0dc
user:      matt <matt%NetBSD.org@localhost>
date:      Tue Jun 14 15:34:21 2011 +0000

description:
Major cleanup of alpha device drivers.
Switch to CFATTACH_DECL_NEW.
struct device * -> device_t
struct cfdata * -> cfdata_t
Use of device_xname.  No direct access to struct device members.
Use aprint* (not complete).

diffstat:

 sys/arch/alpha/a12/a12dc.c             |   20 ++---
 sys/arch/alpha/a12/if_xb.c             |   22 ++---
 sys/arch/alpha/a12/if_xb.h             |    4 +-
 sys/arch/alpha/alpha/api_up1000.c      |   22 ++--
 sys/arch/alpha/alpha/autoconf.c        |    6 +-
 sys/arch/alpha/alpha/avalon_a12.c      |   20 ++--
 sys/arch/alpha/alpha/cpu.c             |  122 +++++++++++++++++---------------
 sys/arch/alpha/alpha/dec_1000a.c       |   22 ++--
 sys/arch/alpha/alpha/dec_2000_300.c    |   18 ++--
 sys/arch/alpha/alpha/dec_2100_a50.c    |   20 ++--
 sys/arch/alpha/alpha/dec_2100_a500.c   |   22 ++--
 sys/arch/alpha/alpha/dec_3000_300.c    |   24 +++---
 sys/arch/alpha/alpha/dec_3000_500.c    |   24 +++---
 sys/arch/alpha/alpha/dec_550.c         |   22 ++--
 sys/arch/alpha/alpha/dec_6600.c        |   28 +++---
 sys/arch/alpha/alpha/dec_alphabook1.c  |   20 ++--
 sys/arch/alpha/alpha/dec_axppci_33.c   |   20 ++--
 sys/arch/alpha/alpha/dec_eb164.c       |   22 ++--
 sys/arch/alpha/alpha/dec_eb64plus.c    |   20 ++--
 sys/arch/alpha/alpha/dec_eb66.c        |   20 ++--
 sys/arch/alpha/alpha/dec_kn20aa.c      |   20 ++--
 sys/arch/alpha/alpha/dec_kn300.c       |   24 +++---
 sys/arch/alpha/alpha/dec_kn8ae.c       |   22 ++--
 sys/arch/alpha/alpha/disksubr.c        |    6 +-
 sys/arch/alpha/alpha/ipifuncs.c        |   14 +-
 sys/arch/alpha/include/cpuvar.h        |    4 +-
 sys/arch/alpha/jensenio/com_jensenio.c |    6 +-
 sys/arch/alpha/pci/a12c.c              |   25 +++---
 sys/arch/alpha/pci/a12c_pci.c          |    8 +-
 sys/arch/alpha/pci/a12cvar.h           |    4 +-
 sys/arch/alpha/pci/apecs.c             |   12 +-
 sys/arch/alpha/pci/apecs_pci.c         |   11 +-
 sys/arch/alpha/pci/cia.c               |   30 ++++----
 sys/arch/alpha/pci/cia_pci.c           |   11 +-
 sys/arch/alpha/pci/ciavar.h            |    4 +-
 sys/arch/alpha/pci/dwlpx.c             |   73 ++++++++++---------
 sys/arch/alpha/pci/dwlpx_dma.c         |    6 +-
 sys/arch/alpha/pci/dwlpx_pci.c         |   10 +-
 sys/arch/alpha/pci/dwlpxvar.h          |    4 +-
 sys/arch/alpha/pci/irongate.c          |   20 ++--
 sys/arch/alpha/pci/irongate_pci.c      |    8 +-
 sys/arch/alpha/pci/irongatevar.h       |    4 +-
 sys/arch/alpha/pci/lca.c               |   19 ++--
 sys/arch/alpha/pci/lca_pci.c           |   11 +-
 sys/arch/alpha/pci/lcavar.h            |    4 +-
 sys/arch/alpha/pci/mcpcia.c            |   23 +++--
 sys/arch/alpha/pci/mcpcia_pci.c        |    8 +-
 sys/arch/alpha/pci/mcpciavar.h         |    4 +-
 sys/arch/alpha/pci/pci_550.c           |   10 +-
 sys/arch/alpha/pci/pci_6600.c          |   10 +-
 sys/arch/alpha/pci/pci_eb164.c         |    6 +-
 sys/arch/alpha/pci/pci_up1000.c        |    6 +-
 sys/arch/alpha/pci/sio.c               |   45 ++++++-----
 sys/arch/alpha/pci/tsp_pci.c           |    8 +-
 sys/arch/alpha/pci/ttwoga.c            |   14 +--
 sys/arch/alpha/pci/ttwoga_pci.c        |    8 +-
 sys/arch/alpha/sableio/sableio.c       |   21 ++--
 sys/arch/alpha/tlsb/gbus.c             |   32 ++++----
 sys/arch/alpha/tlsb/kftxx.c            |   37 +++++----
 sys/arch/alpha/tlsb/tlsb.c             |   10 +-
 sys/arch/alpha/tlsb/tlsbmem.c          |   24 +++--
 61 files changed, 568 insertions(+), 556 deletions(-)

diffs (truncated from 3871 to 300 lines):

diff -r 44b37f500aa1 -r f8c3baf6d0dc sys/arch/alpha/a12/a12dc.c
--- a/sys/arch/alpha/a12/a12dc.c        Tue Jun 14 15:29:11 2011 +0000
+++ b/sys/arch/alpha/a12/a12dc.c        Tue Jun 14 15:34:21 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: a12dc.c,v 1.25 2011/04/24 16:26:52 rmind Exp $ */
+/* $NetBSD: a12dc.c,v 1.26 2011/06/14 15:34:21 matt Exp $ */
 
 /* [Notice revision 2.2]
  * Copyright (c) 1997, 1998 Avalon Computer Systems, Inc.
@@ -64,7 +64,7 @@
 #ifndef BSIDE
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: a12dc.c,v 1.25 2011/04/24 16:26:52 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: a12dc.c,v 1.26 2011/06/14 15:34:21 matt Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -93,14 +93,10 @@
 
 #define        MAX_MODULES 1
 
-int    a12dcmatch(struct device *, struct cfdata *, void *);
-void   a12dcattach(struct device *, struct device *, void *);
+int    a12dcmatch(device_t, cfdata_t, void *);
+void   a12dcattach(device_t, device_t, void *);
 
-struct a12dc_softc {
-       struct  device sc_dev;
-} a12dc_softc;
-
-CFATTACH_DECL(a12dc, sizeof(struct a12dc_softc),
+CFATTACH_DECL_NEW(a12dc, 0,
     a12dcmatch, a12dcattach, NULL, NULL);
 
 extern struct cfdriver a12dc_cd;
@@ -140,7 +136,7 @@
 static void A12InitBackDriver(int);
 
 int
-a12dcmatch(struct device *parent, struct cfdata *match, void *aux)
+a12dcmatch(device_t parent, cfdata_t match, void *aux)
 {
        struct pcibus_attach_args *pba = aux;
 
@@ -149,7 +145,7 @@
 }
 
 void
-a12dcattach(struct device *parent, struct device *self, void *aux)
+a12dcattach(device_t parent, device_t self, void *aux)
 {
        struct tty *tp;
        struct a12dc_config *ccp;
@@ -157,7 +153,7 @@
        /* note that we've attached the chipset; can't have 2 A12Cs. */
        a12dcfound = 1;
 
-       printf(": driver %s\n", "$Revision: 1.25 $");
+       aprintf_normal(": driver %s\n", "$Revision: 1.26 $");
 
        tp = a12dc_tty[0] = tty_alloc();
        tp->t_oproc = a12dcstart;
diff -r 44b37f500aa1 -r f8c3baf6d0dc sys/arch/alpha/a12/if_xb.c
--- a/sys/arch/alpha/a12/if_xb.c        Tue Jun 14 15:29:11 2011 +0000
+++ b/sys/arch/alpha/a12/if_xb.c        Tue Jun 14 15:34:21 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_xb.c,v 1.26 2010/04/05 07:19:28 joerg Exp $ */
+/* $NetBSD: if_xb.c,v 1.27 2011/06/14 15:34:21 matt Exp $ */
 
 /* [Notice revision 2.2]
  * Copyright (c) 1997, 1998 Avalon Computer Systems, Inc.
@@ -74,7 +74,7 @@
 #include "opt_avalon_a12.h"            /* Config options headers */
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: if_xb.c,v 1.26 2010/04/05 07:19:28 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_xb.c,v 1.27 2011/06/14 15:34:21 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -133,14 +133,10 @@
 static int  xb_put(struct mbuf *);
 static long xb_fifo_empty(void);
 
-int    xbmatch(struct device *, struct cfdata *, void *);
-void   xbattach(struct device *, struct device *, void *);
+int    xbmatch(device_t, cfdata_t, void *);
+void   xbattach(device_t, device_t, void *);
 
-struct xb_softc {
-       struct  device d;
-} xb_softc;
-
-CFATTACH_DECL(xb, sizeof(struct xb_softc),
+CFATTACH_DECL_NEW(xb, 0,
     xbmatch, xbattach, NULL, NULL);
 
 extern struct cfdriver xb_cd;
@@ -210,7 +206,7 @@
 int xbfound;
 
 int
-xbmatch(struct device *parent, struct cfdata *match, void *aux)
+xbmatch(device_t parent, cfdata_t match, void *aux)
 {
 
        return  cputype == ST_AVALON_A12
@@ -218,15 +214,15 @@
 }
 
 void
-xbattach(struct device *parent, struct device *self, void *aux)
+xbattach(device_t parent, device_t self, void *aux)
 {
        struct xb_config *ccp;
 
-       strcpy(xbi.if_xname, self->dv_xname);
+       strcpy(xbi.if_xname, device_xname(self));
        xbfound = 1;
        ccp = &xb_configuration;
        xb_init_config(ccp, 1);
-       printf(": driver %s mtu %lu\n", "$Revision: 1.26 $", xbi.if_mtu);
+       printf(": driver %s mtu %lu\n", "$Revision: 1.27 $", xbi.if_mtu);
 }
 
 static void
diff -r 44b37f500aa1 -r f8c3baf6d0dc sys/arch/alpha/a12/if_xb.h
--- a/sys/arch/alpha/a12/if_xb.h        Tue Jun 14 15:29:11 2011 +0000
+++ b/sys/arch/alpha/a12/if_xb.h        Tue Jun 14 15:34:21 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_xb.h,v 1.2 2009/03/14 14:45:52 dsl Exp $ */
+/* $NetBSD: if_xb.h,v 1.3 2011/06/14 15:34:21 matt Exp $ */
 
 /* [Notice revision 2.2]
  * Copyright (c) 1997, 1998 Avalon Computer Systems, Inc.
@@ -65,7 +65,7 @@
 };
 
 struct a12c_softc {
-       struct  device sc_dev;
+       device_t sc_dev;
 
        struct  a12c_config *sc_ccp;
 };
diff -r 44b37f500aa1 -r f8c3baf6d0dc sys/arch/alpha/alpha/api_up1000.c
--- a/sys/arch/alpha/alpha/api_up1000.c Tue Jun 14 15:29:11 2011 +0000
+++ b/sys/arch/alpha/alpha/api_up1000.c Tue Jun 14 15:34:21 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: api_up1000.c,v 1.26 2009/03/18 07:42:36 cegger Exp $ */
+/* $NetBSD: api_up1000.c,v 1.27 2011/06/14 15:34:21 matt Exp $ */
 
 /*
  * Copyright (c) 1995, 1996, 1997 Carnegie-Mellon University.
@@ -34,7 +34,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: api_up1000.c,v 1.26 2009/03/18 07:42:36 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: api_up1000.c,v 1.27 2011/06/14 15:34:21 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -78,7 +78,7 @@
 
 void api_up1000_init(void);
 static void api_up1000_cons_init(void);
-static void api_up1000_device_register(struct device *, void *);
+static void api_up1000_device_register(device_t, void *);
 
 #ifdef KGDB
 #include <machine/db_machdep.h>
@@ -170,12 +170,12 @@
 }
 
 static void
-api_up1000_device_register(struct device *dev, void *aux)
+api_up1000_device_register(device_t dev, void *aux)
 {
        static int found, initted, diskboot, netboot;
-       static struct device *pcidev, *ctrlrdev;
+       static device_t pcidev, ctrlrdev;
        struct bootdev_data *b = bootdev_data;
-       struct device *parent = device_parent(dev);
+       device_t parent = device_parent(dev);
 
        if (found)
                return;
@@ -199,7 +199,7 @@
                                return;
        
                        pcidev = dev;
-                       DPRINTF(("\npcidev = %s\n", dev->dv_xname));
+                       DPRINTF(("\npcidev = %s\n", device_xname(dev)));
                        return;
                }
        }
@@ -219,11 +219,11 @@
                        if (netboot) {
                                booted_device = dev;
                                DPRINTF(("\nbooted_device = %s\n",
-                                   dev->dv_xname));
+                                   device_xname(dev)));
                                found = 1;
                        } else {
                                ctrlrdev = dev;
-                               DPRINTF(("\nctrlrdev = %s\n", dev->dv_xname));
+                               DPRINTF(("\nctrlrdev = %s\n", device_xname(dev)));
                        }
                        return;
                }
@@ -250,7 +250,7 @@
 
                /* we've found it! */
                booted_device = dev;
-               DPRINTF(("\nbooted_device = %s\n", dev->dv_xname));
+               DPRINTF(("\nbooted_device = %s\n", device_xname(dev)));
                found = 1;
        }
 
@@ -275,7 +275,7 @@
 
                /* we've found it! */
                booted_device = dev;
-               DPRINTF(("booted_device = %s\n", dev->dv_xname));
+               DPRINTF(("booted_device = %s\n", device_xname(dev)));
                found = 1;
        }
 }
diff -r 44b37f500aa1 -r f8c3baf6d0dc sys/arch/alpha/alpha/autoconf.c
--- a/sys/arch/alpha/alpha/autoconf.c   Tue Jun 14 15:29:11 2011 +0000
+++ b/sys/arch/alpha/alpha/autoconf.c   Tue Jun 14 15:34:21 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.47 2009/03/18 07:42:36 cegger Exp $ */
+/* $NetBSD: autoconf.c,v 1.48 2011/06/14 15:34:21 matt Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -42,7 +42,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.47 2009/03/18 07:42:36 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.48 2011/06/14 15:34:21 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -188,7 +188,7 @@
 }
 
 void
-device_register(struct device *dev, void *aux)
+device_register(device_t dev, void *aux)
 {
        if (bootdev_data == NULL) {
                /*
diff -r 44b37f500aa1 -r f8c3baf6d0dc sys/arch/alpha/alpha/avalon_a12.c
--- a/sys/arch/alpha/alpha/avalon_a12.c Tue Jun 14 15:29:11 2011 +0000
+++ b/sys/arch/alpha/alpha/avalon_a12.c Tue Jun 14 15:34:21 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: avalon_a12.c,v 1.15 2009/03/14 15:35:59 dsl Exp $ */
+/* $NetBSD: avalon_a12.c,v 1.16 2011/06/14 15:34:21 matt Exp $ */
 
 /* [Notice revision 2.2]
  * Copyright (c) 1997, 1998 Avalon Computer Systems, Inc.
@@ -64,7 +64,7 @@
 #include "opt_avalon_a12.h"            /* Config options headers */
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: avalon_a12.c,v 1.15 2009/03/14 15:35:59 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: avalon_a12.c,v 1.16 2011/06/14 15:34:21 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -100,7 +100,7 @@
 
 void avalon_a12_init(void);
 static void avalon_a12_cons_init(void);
-static void avalon_a12_device_register(struct device *, void *);
+static void avalon_a12_device_register(device_t, void *);
 static int  a12env(int);
 
 void
@@ -145,12 +145,12 @@
 }
 
 void
-avalon_a12_device_register(struct device *dev, void *aux)
+avalon_a12_device_register(device_t dev, void *aux)
 {
        static int found, initted, diskboot, netboot;
-       static struct device *pcidev, *ctrlrdev;
+       static device_t pcidev, *ctrlrdev;
        struct bootdev_data *b = bootdev_data;
-       struct device *parent = device_parent(dev);
+       device_t parent = device_parent(dev);
 
        if (found)
                return;
@@ -176,7 +176,7 @@



Home | Main Index | Thread Index | Old Index