diff --git a/sys/arch/alpha/pci/cia.c b/sys/arch/alpha/pci/cia.c index 59d0dad0ff84..9026804668b6 100644 --- a/sys/arch/alpha/pci/cia.c +++ b/sys/arch/alpha/pci/cia.c @@ -1,4 +1,4 @@ -/* $NetBSD: cia.c,v 1.2 1996/03/17 01:06:31 thorpej Exp $ */ +/* $NetBSD: cia.c,v 1.3 1996/04/12 04:40:49 cgd Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. @@ -51,12 +51,9 @@ int ciamatch __P((struct device *, void *, void *)); void ciaattach __P((struct device *, struct device *, void *)); -struct cfattach cia_ca = { - sizeof(struct cia_softc), ciamatch, ciaattach -}; - -struct cfdriver cia_cd = { - NULL, "cia", DV_DULL +struct cfdriver ciacd = { + NULL, "cia", ciamatch, ciaattach, DV_DULL, + sizeof(struct cia_softc) }; static int ciaprint __P((void *, char *pnp)); @@ -76,7 +73,7 @@ ciamatch(parent, match, aux) struct confargs *ca = aux; /* Make sure that we're looking for a CIA. */ - if (strcmp(ca->ca_name, cia_cd.cd_name) != 0) + if (strcmp(ca->ca_name, ciacd.cd_name) != 0) return (0); if (ciafound) diff --git a/sys/arch/alpha/pci/ciavar.h b/sys/arch/alpha/pci/ciavar.h index d9241010d893..6b7564738acc 100644 --- a/sys/arch/alpha/pci/ciavar.h +++ b/sys/arch/alpha/pci/ciavar.h @@ -1,4 +1,4 @@ -/* $NetBSD: ciavar.h,v 1.1 1995/11/23 02:37:35 cgd Exp $ */ +/* $NetBSD: ciavar.h,v 1.2 1996/04/12 04:40:51 cgd Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. @@ -37,20 +37,8 @@ * do their dirty work (and more!). */ struct cia_config { - __const struct pci_conf_fns *cc_conffns; - void *cc_confarg; - - __const struct pci_dma_fns *cc_dmafns; - void *cc_dmaarg; - - __const struct pci_intr_fns *cc_intrfns; - void *cc_intrarg; - - __const struct pci_mem_fns *cc_memfns; - void *cc_memarg; - - __const struct pci_pio_fns *cc_piofns; - void *cc_pioarg; + struct alpha_bus_chipset cc_bc; + struct alpha_pci_chipset cc_pc; }; struct cia_softc { @@ -60,10 +48,5 @@ struct cia_softc { /* XXX SGMAP info */ }; -extern __const struct pci_conf_fns cia_conf_fns; -extern __const struct pci_dma_fns cia_dma_fns; -/* pci interrupt functions handled elsewhere */ -extern __const struct pci_mem_fns cia_mem_fns; -extern __const struct pci_pio_fns cia_pio_fns; - void cia_init __P((struct cia_config *)); +void cia_pci_init __P((pci_chipset_tag_t, void *)); diff --git a/sys/arch/alpha/pci/lca.c b/sys/arch/alpha/pci/lca.c index 0ecbc848d9b6..19585e9c0f0d 100644 --- a/sys/arch/alpha/pci/lca.c +++ b/sys/arch/alpha/pci/lca.c @@ -1,10 +1,10 @@ -/* $NetBSD: lca.c,v 1.2 1996/03/17 01:06:33 thorpej Exp $ */ +/* $NetBSD: lca.c,v 1.3 1996/04/12 04:40:52 cgd Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. * - * Author: Jeffrey Hsu + * Authors: Jeffrey Hsu and Chris G. Demetriou * * Permission to use, copy, modify and distribute this software and * its documentation is hereby granted, provided that both the copyright @@ -49,11 +49,11 @@ int lcamatch __P((struct device *, void *, void *)); void lcaattach __P((struct device *, struct device *, void *)); struct cfattach lca_ca = { - sizeof(struct lca_softc), lcamatch, lcaattach + sizeof(struct lca_softc), lcamatch, lcaattach, }; struct cfdriver lca_cd = { - NULL, "lca", DV_DULL + NULL, "lca", DV_DULL, }; static int lcaprint __P((void *, char *pnp)); @@ -92,15 +92,9 @@ lca_init(lcp) * Can't set up SGMAP data here; can be called before malloc(). */ - lcp->lc_conffns = &lca_conf_fns; - lcp->lc_confarg = lcp; - lcp->lc_dmafns = &lca_dma_fns; - lcp->lc_dmaarg = lcp; - /* Interrupt routines set up in 'attach' */ - lcp->lc_memfns = &lca_mem_fns; - lcp->lc_memarg = lcp; - lcp->lc_piofns = &lca_pio_fns; - lcp->lc_pioarg = lcp; + apecs_lca_bus_io_init(&lcp->lc_bc, lcp); + apecs_lca_bus_mem_init(&lcp->lc_bc, lcp); + lca_pci_init(&lcp->lc_pc, lcp); /* printf("lca_init: before IOC_HAE=0x%x\n", REGVAL(LCA_IOC_HAE)); @@ -145,10 +139,9 @@ lcaattach(parent, self, aux) struct device *parent, *self; void *aux; { - struct confargs *ca = aux; struct lca_softc *sc = (struct lca_softc *)self; struct lca_config *lcp; - struct pci_attach_args pa; + struct pcibus_attach_args pba; /* note that we've attached the chipset; can't have 2 LCAs. */ /* Um, not sure about this. XXX JH */ @@ -170,31 +163,18 @@ lcaattach(parent, self, aux) switch (hwrpb->rpb_type) { #if defined(DEC_AXPPCI_33) case ST_DEC_AXPPCI_33: - pci_axppci_33_pickintr(lcp->lc_conffns, lcp->lc_confarg, - lcp->lc_piofns, lcp->lc_pioarg, - &lcp->lc_intrfns, &lcp->lc_intrarg); + pci_axppci_33_pickintr(lcp); break; #endif default: panic("lcaattach: shouldn't be here, really..."); } - pa.pa_bus = 0; - pa.pa_maxdev = 13; - pa.pa_burstlog2 = 8; - - pa.pa_conffns = lcp->lc_conffns; - pa.pa_confarg = lcp->lc_confarg; - pa.pa_dmafns = lcp->lc_dmafns; - pa.pa_dmaarg = lcp->lc_dmaarg; - pa.pa_intrfns = lcp->lc_intrfns; - pa.pa_intrarg = lcp->lc_intrarg; - pa.pa_memfns = lcp->lc_memfns; - pa.pa_memarg = lcp->lc_memarg; - pa.pa_piofns = lcp->lc_piofns; - pa.pa_pioarg = lcp->lc_pioarg; - - config_found(self, &pa, lcaprint); + pba.pba_busname = "pci"; + pba.pba_bc = &lcp->lc_bc; + pba.pba_pc = &lcp->lc_pc; + pba.pba_bus = 0; + config_found(self, &pba, lcaprint); } static int @@ -202,12 +182,11 @@ lcaprint(aux, pnp) void *aux; char *pnp; { - register struct pci_attach_args *pa = aux; + register struct pcibus_attach_args *pba = aux; - /* what does this do? XXX JH */ /* only PCIs can attach to LCAes; easy. */ if (pnp) - printf("pci at %s", pnp); - printf(" bus %d", pa->pa_bus); + printf("%s at %s", pba->pba_busname, pnp); + printf(" bus %d", pba->pba_bus); return (UNCONF); } diff --git a/sys/arch/alpha/pci/lcavar.h b/sys/arch/alpha/pci/lcavar.h index 80c708071725..421bc5fa3b13 100644 --- a/sys/arch/alpha/pci/lcavar.h +++ b/sys/arch/alpha/pci/lcavar.h @@ -1,4 +1,4 @@ -/* $NetBSD: lcavar.h,v 1.1 1995/11/23 02:37:47 cgd Exp $ */ +/* $NetBSD: lcavar.h,v 1.2 1996/04/12 04:40:54 cgd Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. @@ -37,20 +37,8 @@ * do their dirty work (and more!). */ struct lca_config { - __const struct pci_conf_fns *lc_conffns; - void *lc_confarg; - - __const struct pci_dma_fns *lc_dmafns; - void *lc_dmaarg; - - __const struct pci_intr_fns *lc_intrfns; - void *lc_intrarg; - - __const struct pci_mem_fns *lc_memfns; - void *lc_memarg; - - __const struct pci_pio_fns *lc_piofns; - void *lc_pioarg; + struct alpha_bus_chipset lc_bc; + struct alpha_pci_chipset lc_pc; }; struct lca_softc { @@ -59,10 +47,5 @@ struct lca_softc { struct lca_config *sc_lcp; }; -extern __const struct pci_conf_fns lca_conf_fns; -extern __const struct pci_dma_fns lca_dma_fns; -/* pci interrupt functions handled elsewhere */ -extern __const struct pci_mem_fns lca_mem_fns; -extern __const struct pci_pio_fns lca_pio_fns; - void lca_init __P((struct lca_config *)); +void lca_pci_init __P((pci_chipset_tag_t, void *));