summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authordrochner <drochner@NetBSD.org>2004-08-30 15:05:15 +0000
committerdrochner <drochner@NetBSD.org>2004-08-30 15:05:15 +0000
commit46289e1fef5fa25a922e2a968d7fa98e43a0c809 (patch)
tree080859cbc4f0a6d9272ba00d1276ee6ee550d91b /sys/dev
parentd55b8a219009ead8fd52bed03a6f9559595c9fd8 (diff)
Phase out the use of a string as first "attach args" member to control
which bustype should be attached with a specific call to config_found() (from a "mainbus" or a bus bridge). Do it for isa/eisa/mca and pci/agp for now. These buses all attach to an mi interface attribute "isabus", "eisabus" etc., and the autoconf framework now allows to specify an interface attribute on config_found() and config_search(), which limits the search of matching config data to these which attach to that specific attribute. So we basically have to call config_found_ia(..., "foobus", ...) where such a bus is attached. As a consequence, where a "mainbus" or alike also attaches other devices (eg CPUs) which do not attach to a specific attribute yet, we need at least pass an attribute name (different from "foobus") so that the foo bus is not found at these places. This made some minor changes necessary which are not obviously related to the mentioned buses.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/acpi/acpi.c9
-rw-r--r--sys/dev/cardbus/rbus_ppb.c9
-rw-r--r--sys/dev/eisa/eisa.c9
-rw-r--r--sys/dev/eisa/eisavar.h4
-rw-r--r--sys/dev/ic/cpc700.c25
-rw-r--r--sys/dev/isa/isa.c9
-rw-r--r--sys/dev/isa/isavar.h4
-rw-r--r--sys/dev/marvell/gtpci.c7
-rw-r--r--sys/dev/mca/mca.c7
-rw-r--r--sys/dev/mca/mcavar.h4
-rw-r--r--sys/dev/pci/agp.c7
-rw-r--r--sys/dev/pci/agpvar.h4
-rw-r--r--sys/dev/pci/pci.c7
-rw-r--r--sys/dev/pci/pcivar.h4
-rw-r--r--sys/dev/pci/ppb.c23
15 files changed, 39 insertions, 93 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index d79763026bf..339fd648ff1 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi.c,v 1.66 2004/06/07 15:33:17 kochi Exp $ */
+/* $NetBSD: acpi.c,v 1.67 2004/08/30 15:05:19 drochner Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.66 2004/06/07 15:33:17 kochi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.67 2004/08/30 15:05:19 drochner Exp $");
#include "opt_acpi.h"
@@ -223,11 +223,6 @@ acpi_probe(void)
static int
acpi_match(struct device *parent, struct cfdata *match, void *aux)
{
- struct acpibus_attach_args *aa = aux;
-
- if (strcmp(aa->aa_busname, acpi_cd.cd_name) != 0)
- return 0;
-
/*
* XXX Check other locators? Hard to know -- machine
* dependent code has already checked for the presence
diff --git a/sys/dev/cardbus/rbus_ppb.c b/sys/dev/cardbus/rbus_ppb.c
index f37fc958985..5107823be50 100644
--- a/sys/dev/cardbus/rbus_ppb.c
+++ b/sys/dev/cardbus/rbus_ppb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rbus_ppb.c,v 1.12 2004/08/02 19:14:28 mycroft Exp $ */
+/* $NetBSD: rbus_ppb.c,v 1.13 2004/08/30 15:05:19 drochner Exp $ */
/*
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rbus_ppb.c,v 1.12 2004/08/02 19:14:28 mycroft Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rbus_ppb.c,v 1.13 2004/08/30 15:05:19 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -768,8 +768,7 @@ ppb_cardbus_attach(parent, self, aux)
*
* XXX Don't pass-through Memory Read Multiple. Should we?
* XXX Consult the spec...
- */
- pba.pba_busname = "pci";
+ */
pba.pba_iot = ca->ca_iot;
pba.pba_memt = ca->ca_memt;
pba.pba_dmat = ca->ca_dmat;
@@ -780,7 +779,7 @@ ppb_cardbus_attach(parent, self, aux)
/*pba.pba_intrswiz = parent_sc->sc_intrswiz; */
pba.pba_intrtag = psc->sc_pa.pa_intrtag;
- config_found(self, &pba, rppbprint);
+ config_found_ia(self, "pcibus", &pba, rppbprint);
}
void
diff --git a/sys/dev/eisa/eisa.c b/sys/dev/eisa/eisa.c
index 5726cd44018..0bf59af1718 100644
--- a/sys/dev/eisa/eisa.c
+++ b/sys/dev/eisa/eisa.c
@@ -1,4 +1,4 @@
-/* $NetBSD: eisa.c,v 1.33 2004/08/23 05:50:02 thorpej Exp $ */
+/* $NetBSD: eisa.c,v 1.34 2004/08/30 15:05:19 drochner Exp $ */
/*
* Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: eisa.c,v 1.33 2004/08/23 05:50:02 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: eisa.c,v 1.34 2004/08/30 15:05:19 drochner Exp $");
#include "opt_eisaverbose.h"
@@ -66,11 +66,6 @@ static void eisa_devinfo(const char *, char *, size_t);
static int
eisamatch(struct device *parent, struct cfdata *cf, void *aux)
{
- struct eisabus_attach_args *eba = aux;
-
- if (strcmp(eba->eba_busname, cf->cf_name))
- return (0);
-
/* XXX check other indicators */
return (1);
diff --git a/sys/dev/eisa/eisavar.h b/sys/dev/eisa/eisavar.h
index cf08e27bb54..a958e5680b5 100644
--- a/sys/dev/eisa/eisavar.h
+++ b/sys/dev/eisa/eisavar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: eisavar.h,v 1.18 2004/08/30 10:30:38 drochner Exp $ */
+/* $NetBSD: eisavar.h,v 1.19 2004/08/30 15:05:19 drochner Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -102,7 +102,7 @@ typedef int eisa_slot_t; /* really only needs to be 4 bits */
* EISA bus attach arguments.
*/
struct eisabus_attach_args {
- const char *eba_busname; /* XXX should be common */
+ const char *_eba_busname; /* XXX placeholder */
bus_space_tag_t eba_iot; /* eisa i/o space tag */
bus_space_tag_t eba_memt; /* eisa mem space tag */
bus_dma_tag_t eba_dmat; /* DMA tag */
diff --git a/sys/dev/ic/cpc700.c b/sys/dev/ic/cpc700.c
index cb8b7d72123..a7091a95d9b 100644
--- a/sys/dev/ic/cpc700.c
+++ b/sys/dev/ic/cpc700.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cpc700.c,v 1.7 2003/11/07 17:06:42 augustss Exp $ */
+/* $NetBSD: cpc700.c,v 1.8 2004/08/30 15:05:19 drochner Exp $ */
/*
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpc700.c,v 1.7 2003/11/07 17:06:42 augustss Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpc700.c,v 1.8 2004/08/30 15:05:19 drochner Exp $");
#include "pci.h"
#include "opt_pci.h"
@@ -80,7 +80,6 @@ __KERNEL_RCSID(0, "$NetBSD: cpc700.c,v 1.7 2003/11/07 17:06:42 augustss Exp $");
#include <dev/ic/cpc700uic.h>
union attach_args {
- const char *busname; /* first elem of all */
struct pcibus_attach_args pba;
struct cpcbus_attach_args cba;
};
@@ -112,18 +111,8 @@ cpc_print(void *aux, const char *pnp)
}
static int
-cpcpci_print(void *aux, const char *pnp)
-{
- union attach_args *aa = aux;
-
- if (pnp)
- aprint_normal("%s at %s", aa->busname, pnp);
-
- return (UNCONF);
-}
-
-static int
-cpc_submatch(struct device *parent, struct cfdata *cf, void *aux)
+cpc_submatch(struct device *parent, struct cfdata *cf,
+ const locdesc_t *ldesc, void *aux)
{
struct cpcbus_attach_args *caa = aux;
@@ -182,12 +171,12 @@ cpc_attach(struct device *self, pci_chipset_tag_t pc, bus_space_tag_t mem,
aa.cba.cpca_name = devs[i].name;
aa.cba.cpca_addr = devs[i].addr;
aa.cba.cpca_irq = devs[i].irq;
- config_found_sm(self, &aa.cba, cpc_print, cpc_submatch);
+ config_found_sm_loc(self, "cpcbus", NULL, &aa.cba,
+ cpc_print, cpc_submatch);
}
tag = pci_make_tag(pc, 0, 0, 0);
- aa.pba.pba_busname = "pci";
aa.pba.pba_iot = pciio;
aa.pba.pba_memt = mem;
aa.pba.pba_dmat = dma;
@@ -219,7 +208,7 @@ cpc_attach(struct device *self, pci_chipset_tag_t pc, bus_space_tag_t mem,
extent_destroy(memext);
#endif
- config_found(self, &aa.pba, cpcpci_print);
+ config_found_ia(self, "pcibus", &aa.pba, pcibusprint);
/* Restore error triggers, and clear errors */
pci_conf_write(pc, tag, CPC_PCI_BRDGERR, erren | CPC_PCI_CLEARERR);
diff --git a/sys/dev/isa/isa.c b/sys/dev/isa/isa.c
index 942adefa750..a6561cafa11 100644
--- a/sys/dev/isa/isa.c
+++ b/sys/dev/isa/isa.c
@@ -1,4 +1,4 @@
-/* $NetBSD: isa.c,v 1.117 2004/08/18 11:54:47 drochner Exp $ */
+/* $NetBSD: isa.c,v 1.118 2004/08/30 15:05:19 drochner Exp $ */
/*-
* Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isa.c,v 1.117 2004/08/18 11:54:47 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isa.c,v 1.118 2004/08/30 15:05:19 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -77,11 +77,6 @@ int isasearch(struct device *, struct cfdata *, const locdesc_t *, void *);
int
isamatch(struct device *parent, struct cfdata *cf, void *aux)
{
- struct isabus_attach_args *iba = aux;
-
- if (strcmp(iba->iba_busname, cf->cf_name))
- return (0);
-
/* XXX check other indicators */
return (1);
diff --git a/sys/dev/isa/isavar.h b/sys/dev/isa/isavar.h
index 45c9d6b5ff3..b7dcbe58e77 100644
--- a/sys/dev/isa/isavar.h
+++ b/sys/dev/isa/isavar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: isavar.h,v 1.42 2004/08/30 10:30:38 drochner Exp $ */
+/* $NetBSD: isavar.h,v 1.43 2004/08/30 15:05:19 drochner Exp $ */
/*-
* Copyright (c) 1997, 2001 The NetBSD Foundation, Inc.
@@ -93,7 +93,7 @@ struct isabus_attach_args;
* ISA bus attach arguments
*/
struct isabus_attach_args {
- char *iba_busname; /* XXX should be common */
+ char *_iba_busname; /* XXX placeholder */
bus_space_tag_t iba_iot; /* isa i/o space tag */
bus_space_tag_t iba_memt; /* isa mem space tag */
bus_dma_tag_t iba_dmat; /* isa DMA tag */
diff --git a/sys/dev/marvell/gtpci.c b/sys/dev/marvell/gtpci.c
index 680d8ed8dcf..cc13c8c5d1d 100644
--- a/sys/dev/marvell/gtpci.c
+++ b/sys/dev/marvell/gtpci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: gtpci.c,v 1.10 2003/07/14 15:47:17 lukem Exp $ */
+/* $NetBSD: gtpci.c,v 1.11 2004/08/30 15:05:19 drochner Exp $ */
/*
* Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gtpci.c,v 1.10 2003/07/14 15:47:17 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gtpci.c,v 1.11 2004/08/30 15:05:19 drochner Exp $");
#include "opt_marvell.h"
#include <sys/param.h>
@@ -307,7 +307,6 @@ gtpci_attach(struct device *parent, struct device *self, void *aux)
*/
pba.pba_pc = pc;
pba.pba_bus = 0;
- pba.pba_busname = "pci";
pba.pba_iot = gtpc->gtpc_io_bs;
pba.pba_memt = gtpc->gtpc_mem_bs;
pba.pba_dmat = gt->gt_dmat;
@@ -328,7 +327,7 @@ gtpci_attach(struct device *parent, struct device *self, void *aux)
/*
* Configure the pci bus.
*/
- config_found(self, &pba, gtpci_cfprint);
+ config_found_ia(self, "pcibus", &pba, gtpci_cfprint);
gt_watchdog_service();
diff --git a/sys/dev/mca/mca.c b/sys/dev/mca/mca.c
index 31dc5bf2ef7..98af97cb4bb 100644
--- a/sys/dev/mca/mca.c
+++ b/sys/dev/mca/mca.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mca.c,v 1.14 2004/04/22 00:17:12 itojun Exp $ */
+/* $NetBSD: mca.c,v 1.15 2004/08/30 15:05:19 drochner Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mca.c,v 1.14 2004/04/22 00:17:12 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mca.c,v 1.15 2004/08/30 15:05:19 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -71,9 +71,6 @@ mca_match(parent, cf, aux)
{
struct mcabus_attach_args *mba = aux;
- if (strcmp(mba->mba_busname, cf->cf_name))
- return (0);
-
/* sanity (only mca0 supported currently) */
if (mba->mba_bus < 0 || mba->mba_bus > 0)
return (0);
diff --git a/sys/dev/mca/mcavar.h b/sys/dev/mca/mcavar.h
index e46631faf1b..38e97236aa3 100644
--- a/sys/dev/mca/mcavar.h
+++ b/sys/dev/mca/mcavar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: mcavar.h,v 1.5 2004/08/30 10:30:38 drochner Exp $ */
+/* $NetBSD: mcavar.h,v 1.6 2004/08/30 15:05:19 drochner Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
#include <machine/mca_machdep.h>
struct mcabus_attach_args {
- const char *mba_busname;
+ const char *_mba_busname; /* XXX placeholder */
bus_space_tag_t mba_iot; /* MCA I/O space tag */
bus_space_tag_t mba_memt; /* MCA mem space tag */
bus_dma_tag_t mba_dmat; /* MCA DMA tag */
diff --git a/sys/dev/pci/agp.c b/sys/dev/pci/agp.c
index 45bb3bd3dff..ac88341affc 100644
--- a/sys/dev/pci/agp.c
+++ b/sys/dev/pci/agp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: agp.c,v 1.32 2004/02/13 11:36:22 wiz Exp $ */
+/* $NetBSD: agp.c,v 1.33 2004/08/30 15:05:19 drochner Exp $ */
/*-
* Copyright (c) 2000 Doug Rabson
@@ -65,7 +65,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: agp.c,v 1.32 2004/02/13 11:36:22 wiz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: agp.c,v 1.33 2004/08/30 15:05:19 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -228,9 +228,6 @@ agpmatch(struct device *parent, struct cfdata *match, void *aux)
struct agpbus_attach_args *apa = aux;
struct pci_attach_args *pa = &apa->apa_pci_args;
- if (strcmp(apa->apa_busname, "agp") != 0)
- return (0);
-
if (agp_lookup(pa) == NULL)
return (0);
diff --git a/sys/dev/pci/agpvar.h b/sys/dev/pci/agpvar.h
index 14c13d69c93..a63352ca97a 100644
--- a/sys/dev/pci/agpvar.h
+++ b/sys/dev/pci/agpvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: agpvar.h,v 1.7 2004/08/30 10:30:38 drochner Exp $ */
+/* $NetBSD: agpvar.h,v 1.8 2004/08/30 15:05:20 drochner Exp $ */
/*-
* Copyright (c) 2000 Doug Rabson
@@ -35,7 +35,7 @@
#include <sys/lock.h>
struct agpbus_attach_args {
- char *apa_busname;
+ char *_apa_busname; /* XXX placeholder */
struct pci_attach_args apa_pci_args;
};
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index 2614b78bbc2..6d541704bd5 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pci.c,v 1.87 2004/08/17 23:20:10 drochner Exp $ */
+/* $NetBSD: pci.c,v 1.88 2004/08/30 15:05:20 drochner Exp $ */
/*
* Copyright (c) 1995, 1996, 1997, 1998
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.87 2004/08/17 23:20:10 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.88 2004/08/30 15:05:20 drochner Exp $");
#include "opt_pci.h"
@@ -111,9 +111,6 @@ pcimatch(parent, cf, aux)
{
struct pcibus_attach_args *pba = aux;
- if (strcmp(pba->pba_busname, cf->cf_name))
- return (0);
-
/* Check the locators */
if (cf->pcibuscf_bus != PCIBUS_UNK_BUS &&
cf->pcibuscf_bus != pba->pba_bus)
diff --git a/sys/dev/pci/pcivar.h b/sys/dev/pci/pcivar.h
index 3dbd38b6f04..08df3cf212c 100644
--- a/sys/dev/pci/pcivar.h
+++ b/sys/dev/pci/pcivar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: pcivar.h,v 1.65 2004/08/30 10:30:38 drochner Exp $ */
+/* $NetBSD: pcivar.h,v 1.66 2004/08/30 15:05:20 drochner Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@@ -62,7 +62,7 @@ struct pci_softc;
* PCI bus attach arguments.
*/
struct pcibus_attach_args {
- char *pba_busname; /* XXX should be common */
+ char *_pba_busname; /* XXX placeholder */
bus_space_tag_t pba_iot; /* pci i/o space tag */
bus_space_tag_t pba_memt; /* pci mem space tag */
bus_dma_tag_t pba_dmat; /* DMA tag */
diff --git a/sys/dev/pci/ppb.c b/sys/dev/pci/ppb.c
index 317dd6a8776..ae08214214a 100644
--- a/sys/dev/pci/ppb.c
+++ b/sys/dev/pci/ppb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ppb.c,v 1.28 2004/04/23 21:13:07 itojun Exp $ */
+/* $NetBSD: ppb.c,v 1.29 2004/08/30 15:05:20 drochner Exp $ */
/*
* Copyright (c) 1996, 1998 Christopher G. Demetriou. All rights reserved.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ppb.c,v 1.28 2004/04/23 21:13:07 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ppb.c,v 1.29 2004/08/30 15:05:20 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -54,8 +54,6 @@ void ppbattach __P((struct device *, struct device *, void *));
CFATTACH_DECL(ppb, sizeof(struct ppb_softc),
ppbmatch, ppbattach, NULL, NULL);
-int ppbprint __P((void *, const char *pnp));
-
int
ppbmatch(parent, match, aux)
struct device *parent;
@@ -122,7 +120,6 @@ ppbattach(parent, self, aux)
* XXX Don't pass-through Memory Read Multiple. Should we?
* XXX Consult the spec...
*/
- pba.pba_busname = "pci"; /* XXX should be pci_ppb attachment */
pba.pba_iot = pa->pa_iot;
pba.pba_memt = pa->pa_memt;
pba.pba_dmat = pa->pa_dmat;
@@ -134,19 +131,5 @@ ppbattach(parent, self, aux)
pba.pba_intrswiz = pa->pa_intrswiz;
pba.pba_intrtag = pa->pa_intrtag;
- config_found(self, &pba, ppbprint);
-}
-
-int
-ppbprint(aux, pnp)
- void *aux;
- const char *pnp;
-{
- struct pcibus_attach_args *pba = aux;
-
- /* only PCIs can attach to PPBs; easy. */
- if (pnp)
- aprint_normal("pci at %s", pnp);
- aprint_normal(" bus %d", pba->pba_bus);
- return (UNCONF);
+ config_found_ia(self, "pcibus", &pba, pcibusprint);
}