summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authordrochner <drochner@NetBSD.org>2005-08-25 18:35:38 +0000
committerdrochner <drochner@NetBSD.org>2005-08-25 18:35:38 +0000
commitfa3cb84d6262bbf1db28e9d4d55ca3842a1d09e3 (patch)
tree11ffeefbbae1cf974abb0fbc0c79eaffe1f7a506 /sys
parentede55d75e5923dcb6b25383599fa8f9c8b8a36c0 (diff)
replace the "locdesc_t" structure carrying the number of locators
explicitely by a plain integer array the length in now known to all relevant parties, so this avoids duplication of information, and we can allocate that thing in drivers without hacks
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/alpha/jensenio/jensenio.c16
-rw-r--r--sys/arch/alpha/mcbus/mcbus.c28
-rw-r--r--sys/arch/alpha/sableio/sableio.c16
-rw-r--r--sys/arch/alpha/tlsb/gbus.c18
-rw-r--r--sys/arch/alpha/tlsb/tlsb.c29
-rw-r--r--sys/arch/i386/pnpbios/pnpbios.c18
-rw-r--r--sys/arch/mips/alchemy/aubus.c16
-rw-r--r--sys/arch/mips/sibyte/dev/sbobio.c22
-rw-r--r--sys/arch/mips/sibyte/dev/sbscd.c22
-rw-r--r--sys/arch/mips/sibyte/dev/sbsmbus.c20
-rw-r--r--sys/arch/pmax/ibus/ibus.c18
-rw-r--r--sys/arch/sparc64/dev/sab.c16
-rw-r--r--sys/dev/ata/ata_raid.c20
-rw-r--r--sys/dev/cardbus/cardbus.c20
-rw-r--r--sys/dev/eisa/eisa.c16
-rw-r--r--sys/dev/i2o/iop.c24
-rw-r--r--sys/dev/ic/aac.c24
-rw-r--r--sys/dev/ic/cac.c16
-rw-r--r--sys/dev/ic/i82365.c22
-rw-r--r--sys/dev/ic/icp.c29
-rw-r--r--sys/dev/ic/mlx.c18
-rw-r--r--sys/dev/ic/tcic2.c22
-rw-r--r--sys/dev/ic/upc.c24
-rw-r--r--sys/dev/ieee1394/firewire.c8
-rw-r--r--sys/dev/isa/isa.c40
-rw-r--r--sys/dev/mca/edc_mca.c16
-rw-r--r--sys/dev/mca/mca.c18
-rw-r--r--sys/dev/mii/mii.c16
-rw-r--r--sys/dev/pci/amr.c16
-rw-r--r--sys/dev/pci/pci.c20
-rw-r--r--sys/dev/pci/puc.c16
-rw-r--r--sys/dev/pci/twe.c16
-rw-r--r--sys/dev/pckbport/pckbport.c16
-rw-r--r--sys/dev/pcmcia/pcmcia.c20
-rw-r--r--sys/dev/pcmcia/pcmcom.c18
-rw-r--r--sys/dev/scsipi/scsiconf.c22
-rw-r--r--sys/dev/tc/ioasic_subr.c16
-rw-r--r--sys/dev/tc/tc.c29
-rw-r--r--sys/dev/tc/tcds.c18
-rw-r--r--sys/dev/tc/zs_ioasic.c18
-rw-r--r--sys/dev/usb/uhidev.c18
-rw-r--r--sys/kern/subr_autoconf.c12
-rw-r--r--sys/sys/device.h11
43 files changed, 365 insertions, 473 deletions
diff --git a/sys/arch/alpha/jensenio/jensenio.c b/sys/arch/alpha/jensenio/jensenio.c
index ce22df77a37..a527e612399 100644
--- a/sys/arch/alpha/jensenio/jensenio.c
+++ b/sys/arch/alpha/jensenio/jensenio.c
@@ -1,4 +1,4 @@
-/* $NetBSD: jensenio.c,v 1.10 2004/09/14 19:57:37 drochner Exp $ */
+/* $NetBSD: jensenio.c,v 1.11 2005/08/25 18:35:38 drochner Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: jensenio.c,v 1.10 2004/09/14 19:57:37 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: jensenio.c,v 1.11 2005/08/25 18:35:38 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -158,8 +158,7 @@ jensenio_attach(struct device *parent, struct device *self, void *aux)
struct jensenio_attach_args ja;
struct jensenio_config *jcp = &jensenio_configuration;
int i;
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[JENSENIOCF_NLOCS];
printf("\n");
@@ -193,9 +192,8 @@ jensenio_attach(struct device *parent, struct device *self, void *aux)
ja.ja_iot = &jcp->jc_internal_iot;
ja.ja_ec = &jcp->jc_ec;
- ldesc->len = 1;
- ldesc->locs[JENSENIOCF_PORT] = jensenio_devs[i].jd_ioaddr;
- (void) config_found_sm_loc(self, "jensenio", ldesc, &ja,
+ locs[JENSENIOCF_PORT] = jensenio_devs[i].jd_ioaddr;
+ (void) config_found_sm_loc(self, "jensenio", locs, &ja,
jensenio_print, jensenio_submatch);
}
@@ -225,11 +223,11 @@ jensenio_attach(struct device *parent, struct device *self, void *aux)
int
jensenio_submatch(struct device *parent, struct cfdata *cf,
- const locdesc_t *ldesc, void *aux)
+ const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[JENSENIOCF_PORT] != JENSENIOCF_PORT_DEFAULT &&
- cf->cf_loc[JENSENIOCF_PORT] != ldesc->locs[JENSENIOCF_PORT])
+ cf->cf_loc[JENSENIOCF_PORT] != locs[JENSENIOCF_PORT])
return (0);
return (config_match(parent, cf, aux));
diff --git a/sys/arch/alpha/mcbus/mcbus.c b/sys/arch/alpha/mcbus/mcbus.c
index ebf3dec8e61..7881df4c6ce 100644
--- a/sys/arch/alpha/mcbus/mcbus.c
+++ b/sys/arch/alpha/mcbus/mcbus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mcbus.c,v 1.15 2005/06/02 13:17:45 drochner Exp $ */
+/* $NetBSD: mcbus.c,v 1.16 2005/08/25 18:35:38 drochner Exp $ */
/*
* Copyright (c) 1998 by Matthew Jacob
@@ -37,7 +37,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: mcbus.c,v 1.15 2005/06/02 13:17:45 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mcbus.c,v 1.16 2005/08/25 18:35:38 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -103,15 +103,15 @@ mcbusprint(aux, cp)
}
static int
-mcbussbm(parent, cf, ldesc, aux)
+mcbussbm(parent, cf, locs, aux)
struct device *parent;
struct cfdata *cf;
- const locdesc_t *ldesc;
+ const locdesc_t *locs;
void *aux;
{
if (cf->cf_loc[MCBUSCF_MID] != MCBUSCF_MID_DEFAULT &&
- cf->cf_loc[MCBUSCF_MID] != ldesc->locs[MCBUSCF_MID])
+ cf->cf_loc[MCBUSCF_MID] != locs[MCBUSCF_MID])
return (0);
return (config_match(parent, cf, aux));
@@ -149,8 +149,7 @@ mcbusattach(parent, self, aux)
struct mcbus_dev_attach_args ta;
mcbus_softc_t *mbp = (mcbus_softc_t *)self;
int i, mid;
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[MCBUSCF_NLOCS];
printf(": %s BCache\n", mcbus_primary.mcbus_valid ?
bcs[mcbus_primary.mcbus_bcache] : "Unknown");
@@ -172,9 +171,8 @@ mcbusattach(parent, self, aux)
ta.ma_mid = 1;
ta.ma_type = MCBUS_TYPE_MEM;
mbp->mcbus_types[1] = MCBUS_TYPE_MEM;
- ldesc->len = 1;
- ldesc->locs[MCBUSCF_MID] = 1;
- (void) config_found_sm_loc(self, "mcbus", ldesc, &ta,
+ locs[MCBUSCF_MID] = 1;
+ (void) config_found_sm_loc(self, "mcbus", locs, &ta,
mcbusprint, mcbussbm);
/*
@@ -190,10 +188,9 @@ mcbusattach(parent, self, aux)
ta.ma_gid = MCBUS_GID_FROM_INSTANCE(0);
ta.ma_mid = mid;
ta.ma_type = MCBUS_TYPE_PCI;
- ldesc->len = 1;
- ldesc->locs[MCBUSCF_MID] = mid;
+ locs[MCBUSCF_MID] = mid;
if (MCPCIA_EXISTS(ta.ma_mid, ta.ma_gid))
- (void) config_found_sm_loc(self, "mcbus", ldesc, &ta,
+ (void) config_found_sm_loc(self, "mcbus", locs, &ta,
mcbusprint, mcbussbm);
}
@@ -220,9 +217,8 @@ mcbusattach(parent, self, aux)
ta.ma_mid = mid;
ta.ma_type = MCBUS_TYPE_CPU;
mbp->mcbus_types[mid] = MCBUS_TYPE_CPU;
- ldesc->len = 1;
- ldesc->locs[MCBUSCF_MID] = mid;
- (void) config_found_sm_loc(self, "mcbus", ldesc, &ta,
+ locs[MCBUSCF_MID] = mid;
+ (void) config_found_sm_loc(self, "mcbus", locs, &ta,
mcbusprint, mcbussbm);
}
#endif
diff --git a/sys/arch/alpha/sableio/sableio.c b/sys/arch/alpha/sableio/sableio.c
index 31ad06ea3f1..fcabe026bef 100644
--- a/sys/arch/alpha/sableio/sableio.c
+++ b/sys/arch/alpha/sableio/sableio.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sableio.c,v 1.8 2004/09/13 14:57:31 drochner Exp $ */
+/* $NetBSD: sableio.c,v 1.9 2005/08/25 18:35:38 drochner Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: sableio.c,v 1.8 2004/09/13 14:57:31 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sableio.c,v 1.9 2005/08/25 18:35:38 drochner Exp $");
#include "isadma.h"
@@ -148,8 +148,7 @@ sableio_attach(struct device *parent, struct device *self, void *aux)
struct sableio_attach_args sa;
bus_dma_tag_t dmat;
int i;
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[SABLEIOCF_NLOCS];
printf(": Sable STDIO module\n");
@@ -176,21 +175,20 @@ sableio_attach(struct device *parent, struct device *self, void *aux)
sa.sa_ic = &sc->sc_isa_chipset;
sa.sa_pc = pba->pba_pc;
- ldesc->len = 1;
- ldesc->locs[SABLEIOCF_PORT] = sableio_devs[i].sd_ioaddr;
+ locs[SABLEIOCF_PORT] = sableio_devs[i].sd_ioaddr;
- (void) config_found_sm_loc(self, "sableio", ldesc, &sa,
+ (void) config_found_sm_loc(self, "sableio", locs, &sa,
sableio_print, sableio_submatch);
}
}
int
sableio_submatch(struct device *parent, struct cfdata *cf,
- const locdesc_t *ldesc, void *aux)
+ const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[SABLEIOCF_PORT] != SABLEIOCF_PORT_DEFAULT &&
- cf->cf_loc[SABLEIOCF_PORT] != ldesc->locs[SABLEIOCF_PORT])
+ cf->cf_loc[SABLEIOCF_PORT] != locs[SABLEIOCF_PORT])
return (0);
return (config_match(parent, cf, aux));
diff --git a/sys/arch/alpha/tlsb/gbus.c b/sys/arch/alpha/tlsb/gbus.c
index 0e94fa4dfa7..39c2c6026d9 100644
--- a/sys/arch/alpha/tlsb/gbus.c
+++ b/sys/arch/alpha/tlsb/gbus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: gbus.c,v 1.15 2004/09/13 14:57:31 drochner Exp $ */
+/* $NetBSD: gbus.c,v 1.16 2005/08/25 18:35:38 drochner Exp $ */
/*
* Copyright (c) 1997 by Matthew Jacob
@@ -37,7 +37,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: gbus.c,v 1.15 2004/09/13 14:57:31 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gbus.c,v 1.16 2005/08/25 18:35:38 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -123,8 +123,7 @@ gbusattach(parent, self, aux)
struct gbus_softc *sc = (struct gbus_softc *)self;
struct tlsb_dev_attach_args *ta = aux;
struct gbus_attach_args *ga;
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[GBUSCF_NLOCS];
printf("\n");
@@ -132,23 +131,22 @@ gbusattach(parent, self, aux)
/* Attach the children. */
for (ga = gbus_children; ga->ga_name != NULL; ga++) {
- ldesc->len = 1;
- ldesc->locs[GBUSCF_OFFSET] = ga->ga_offset;
- (void) config_found_sm_loc(self, "gbus", ldesc, ga,
+ locs[GBUSCF_OFFSET] = ga->ga_offset;
+ (void) config_found_sm_loc(self, "gbus", locs, ga,
gbusprint, gbussubmatch);
}
}
static int
-gbussubmatch(parent, cf, ldesc, aux)
+gbussubmatch(parent, cf, locs, aux)
struct device *parent;
struct cfdata *cf;
- const locdesc_t *ldesc;
+ const locdesc_t *locs;
void *aux;
{
if (cf->cf_loc[GBUSCF_OFFSET] != GBUSCF_OFFSET_DEFAULT &&
- cf->cf_loc[GBUSCF_OFFSET] != ldesc->locs[GBUSCF_OFFSET])
+ cf->cf_loc[GBUSCF_OFFSET] != locs[GBUSCF_OFFSET])
return (0);
return (config_match(parent, cf, aux));
diff --git a/sys/arch/alpha/tlsb/tlsb.c b/sys/arch/alpha/tlsb/tlsb.c
index d42d6a0b0fa..ffdf648feca 100644
--- a/sys/arch/alpha/tlsb/tlsb.c
+++ b/sys/arch/alpha/tlsb/tlsb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tlsb.c,v 1.28 2005/06/02 13:17:45 drochner Exp $ */
+/* $NetBSD: tlsb.c,v 1.29 2005/08/25 18:35:38 drochner Exp $ */
/*
* Copyright (c) 1997 by Matthew Jacob
* NASA AMES Research Center.
@@ -39,7 +39,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: tlsb.c,v 1.28 2005/06/02 13:17:45 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tlsb.c,v 1.29 2005/08/25 18:35:38 drochner Exp $");
#include "opt_multiprocessor.h"
@@ -104,18 +104,18 @@ tlsbprint(aux, pnp)
}
static int
-tlsbsubmatch(parent, cf, ldesc, aux)
+tlsbsubmatch(parent, cf, locs, aux)
struct device *parent;
struct cfdata *cf;
- const locdesc_t *ldesc;
+ const locdesc_t *locs;
void *aux;
{
if (cf->cf_loc[TLSBCF_NODE] != TLSBCF_NODE_DEFAULT &&
- cf->cf_loc[TLSBCF_NODE] != ldesc->locs[TLSBCF_NODE])
+ cf->cf_loc[TLSBCF_NODE] != locs[TLSBCF_NODE])
return (0);
if (cf->cf_loc[TLSBCF_OFFSET] != TLSBCF_OFFSET_DEFAULT &&
- cf->cf_loc[TLSBCF_OFFSET] != ldesc->locs[TLSBCF_OFFSET])
+ cf->cf_loc[TLSBCF_OFFSET] != locs[TLSBCF_OFFSET])
return (0);
return (config_match(parent, cf, aux));
@@ -153,8 +153,7 @@ tlsbattach(parent, self, aux)
struct tlsb_dev_attach_args ta;
u_int32_t tldev;
int node;
- int help[3];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[TLSBCF_NLOCS];
printf("\n");
@@ -206,11 +205,10 @@ tlsbattach(parent, self, aux)
/*
* Attach any children nodes, including a CPU's GBus
*/
- ldesc->len = 2;
- ldesc->locs[TLSBCF_NODE] = node;
- ldesc->locs[TLSBCF_OFFSET] = 0; /* XXX unused? */
+ locs[TLSBCF_NODE] = node;
+ locs[TLSBCF_OFFSET] = 0; /* XXX unused? */
- config_found_sm_loc(self, "tlsb", ldesc, &ta,
+ config_found_sm_loc(self, "tlsb", locs, &ta,
tlsbprint, tlsbsubmatch);
}
/*
@@ -253,11 +251,10 @@ tlsbattach(parent, self, aux)
ta.ta_swrev = TLDEV_SWREV(tldev);
ta.ta_hwrev = TLDEV_HWREV(tldev);
- ldesc->len = 2;
- ldesc->locs[TLSBCF_NODE] = node;
- ldesc->locs[TLSBCF_OFFSET] = 0; /* XXX unused? */
+ locs[TLSBCF_NODE] = node;
+ locs[TLSBCF_OFFSET] = 0; /* XXX unused? */
- config_found_sm_loc(self, "tlsb", ldesc, &ta,
+ config_found_sm_loc(self, "tlsb", locs, &ta,
tlsbprint, tlsbsubmatch);
}
}
diff --git a/sys/arch/i386/pnpbios/pnpbios.c b/sys/arch/i386/pnpbios/pnpbios.c
index 05397aae137..2e12f6a99c4 100644
--- a/sys/arch/i386/pnpbios/pnpbios.c
+++ b/sys/arch/i386/pnpbios/pnpbios.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pnpbios.c,v 1.49 2005/06/01 16:49:14 drochner Exp $ */
+/* $NetBSD: pnpbios.c,v 1.50 2005/08/25 18:35:38 drochner Exp $ */
/*
* Copyright (c) 2000 Jason R. Thorpe. All rights reserved.
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pnpbios.c,v 1.49 2005/06/01 16:49:14 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pnpbios.c,v 1.50 2005/08/25 18:35:38 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -768,11 +768,11 @@ pnpbios_print_devres(struct device *dev, struct pnpbiosdev_attach_args *aa)
static int
pnpbios_submatch(struct device *parent, struct cfdata *match,
- const locdesc_t *ldesc, void *aux)
+ const locdesc_t *locs, void *aux)
{
if (match->cf_loc[PNPBIOSCF_INDEX] != PNPBIOSCF_INDEX_DEFAULT &&
- match->cf_loc[PNPBIOSCF_INDEX] != ldesc->locs[PNPBIOSCF_INDEX])
+ match->cf_loc[PNPBIOSCF_INDEX] != locs[PNPBIOSCF_INDEX])
return (0);
return (config_match(parent, match, aux));
@@ -782,18 +782,16 @@ static int
pnpbios_attachchild(struct pnpbios_softc *sc,
struct pnpbiosdev_attach_args *aa, int matchonly)
{
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[PNPBIOSCF_NLOCS];
- ldesc->len = 1;
- ldesc->locs[PNPBIOSCF_INDEX] = aa->idx;
+ locs[PNPBIOSCF_INDEX] = aa->idx;
if (matchonly)
return (config_search_loc(pnpbios_submatch, (struct device *)sc,
- "pnpbios", ldesc, aa) != NULL);
+ "pnpbios", locs, aa) != NULL);
else
return (config_found_sm_loc((struct device *)sc, "pnpbios",
- ldesc, aa, pnpbios_print, pnpbios_submatch)
+ locs, aa, pnpbios_print, pnpbios_submatch)
!= NULL);
}
diff --git a/sys/arch/mips/alchemy/aubus.c b/sys/arch/mips/alchemy/aubus.c
index 966c13e7600..d6791293a44 100644
--- a/sys/arch/mips/alchemy/aubus.c
+++ b/sys/arch/mips/alchemy/aubus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: aubus.c,v 1.13 2005/06/28 19:46:47 drochner Exp $ */
+/* $NetBSD: aubus.c,v 1.14 2005/08/25 18:35:39 drochner Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aubus.c,v 1.13 2005/06/28 19:46:47 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aubus.c,v 1.14 2005/08/25 18:35:39 drochner Exp $");
#include "locators.h"
@@ -181,11 +181,11 @@ aubus_match(struct device *parent, struct cfdata *match, void *aux)
static int
aubus_submatch(struct device *parent, struct cfdata *cf,
- const locdesc_t *ldesc, void *aux)
+ const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[AUBUSCF_ADDR] != AUBUSCF_ADDR_DEFAULT &&
- cf->cf_loc[AUBUSCF_ADDR] != ldesc->locs[AUBUSCF_ADDR])
+ cf->cf_loc[AUBUSCF_ADDR] != locs[AUBUSCF_ADDR])
return (0);
return (config_match(parent, cf, aux));
@@ -200,8 +200,7 @@ aubus_attach(struct device *parent, struct device *self, void *aux)
struct aubus_attach_args aa;
struct device *sc = (struct device *)self;
const struct au1x00_dev *ad;
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[AUBUSCF_NLOCS];
printf("\n");
@@ -231,10 +230,9 @@ aubus_attach(struct device *parent, struct device *self, void *aux)
aa.aa_irq[0] = ad->irq[0];
aa.aa_irq[1] = ad->irq[1];
- ldesc->len = 1;
- ldesc->locs[AUBUSCF_ADDR] = ad->addr[0];
+ locs[AUBUSCF_ADDR] = ad->addr[0];
- (void) config_found_sm_loc(self, "aubus", ldesc, &aa,
+ (void) config_found_sm_loc(self, "aubus", locs, &aa,
aubus_print, aubus_submatch);
}
}
diff --git a/sys/arch/mips/sibyte/dev/sbobio.c b/sys/arch/mips/sibyte/dev/sbobio.c
index f6bd61636ea..4f28b0075fd 100644
--- a/sys/arch/mips/sibyte/dev/sbobio.c
+++ b/sys/arch/mips/sibyte/dev/sbobio.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sbobio.c,v 1.13 2004/09/13 14:57:31 drochner Exp $ */
+/* $NetBSD: sbobio.c,v 1.14 2005/08/25 18:35:39 drochner Exp $ */
/*
* Copyright 2000, 2001
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sbobio.c,v 1.13 2004/09/13 14:57:31 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbobio.c,v 1.14 2005/08/25 18:35:39 drochner Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -137,8 +137,7 @@ sbobio_attach(struct device *parent, struct device *self, void *aux)
const struct sbobio_attach_locs *devs;
uint64_t sysrev;
int i, devcount;
- int help[4];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[SBOBIOCF_NLOCS];
sysrev = mips3_ld((u_int64_t *)MIPS_PHYS_TO_KSEG1(A_SCD_SYSTEM_REVISION));
switch (SYS_SOC_TYPE(sysrev)) {
@@ -175,12 +174,11 @@ sbobio_attach(struct device *parent, struct device *self, void *aux)
sa.sa_base = A_PHYS_IO_SYSTEM;
sa.sa_locs = devs[i];
- ldesc->len = 3;
- ldesc->locs[SBOBIOCF_OFFSET] = devs[i].sa_offset;
- ldesc->locs[SBOBIOCF_INTR + 0] = devs[i].sa_intr[0];
- ldesc->locs[SBOBIOCF_INTR + 1] = devs[i].sa_intr[1];
+ locs[SBOBIOCF_OFFSET] = devs[i].sa_offset;
+ locs[SBOBIOCF_INTR + 0] = devs[i].sa_intr[0];
+ locs[SBOBIOCF_INTR + 1] = devs[i].sa_intr[1];
- config_found_sm_loc(self, "sbobio", ldesc, &sa,
+ config_found_sm_loc(self, "sbobio", locs, &sa,
sbobio_print, sbobio_submatch);
}
return;
@@ -206,18 +204,18 @@ sbobio_print(void *aux, const char *pnp)
static int
sbobio_submatch(struct device *parent, struct cfdata *cf,
- const locdesc_t *ldesc, void *aux)
+ const locdesc_t *locs, void *aux)
{
int i;
if (cf->cf_loc[SBOBIOCF_OFFSET] != SBOBIOCF_OFFSET_DEFAULT &&
- cf->cf_loc[SBOBIOCF_OFFSET] != ldesc->locs[SBOBIOCF_OFFSET])
+ cf->cf_loc[SBOBIOCF_OFFSET] != locs[SBOBIOCF_OFFSET])
return (0);
for (i = 0; i < 2; i++) {
if (cf->cf_loc[SBOBIOCF_INTR + i] != SBOBIOCF_INTR_DEFAULT &&
cf->cf_loc[SBOBIOCF_INTR + i]
- != ldesc->locs[SBOBIOCF_INTR + i])
+ != locs[SBOBIOCF_INTR + i])
return (0);
}
diff --git a/sys/arch/mips/sibyte/dev/sbscd.c b/sys/arch/mips/sibyte/dev/sbscd.c
index 0c3d59c9189..784612e86f3 100644
--- a/sys/arch/mips/sibyte/dev/sbscd.c
+++ b/sys/arch/mips/sibyte/dev/sbscd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sbscd.c,v 1.9 2004/09/13 14:57:31 drochner Exp $ */
+/* $NetBSD: sbscd.c,v 1.10 2005/08/25 18:35:39 drochner Exp $ */
/*
* Copyright 2000, 2001
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sbscd.c,v 1.9 2004/09/13 14:57:31 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbscd.c,v 1.10 2005/08/25 18:35:39 drochner Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -87,8 +87,7 @@ sbscd_attach(struct device *parent, struct device *self, void *aux)
{
struct sbscd_attach_args sa;
int i;
- int help[4];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[SBSCDCF_NLOCS];
printf("\n");
@@ -97,14 +96,13 @@ sbscd_attach(struct device *parent, struct device *self, void *aux)
sa.sa_base = 0x10000000; /* XXXCGD */
sa.sa_locs = sb1250_sbscd_devs[i];
- ldesc->len = 3;
- ldesc->locs[SBSCDCF_OFFSET] = sb1250_sbscd_devs[i].sa_offset;
- ldesc->locs[SBSCDCF_INTR + 0] =
+ locs[SBSCDCF_OFFSET] = sb1250_sbscd_devs[i].sa_offset;
+ locs[SBSCDCF_INTR + 0] =
sb1250_sbscd_devs[i].sa_intr[0];
- ldesc->locs[SBSCDCF_INTR + 1] =
+ locs[SBSCDCF_INTR + 1] =
sb1250_sbscd_devs[i].sa_intr[1];
- config_found_sm_loc(self, "sbscd", ldesc, &sa,
+ config_found_sm_loc(self, "sbscd", locs, &sa,
sbscd_print, sbscd_submatch);
}
return;
@@ -130,18 +128,18 @@ sbscd_print(void *aux, const char *pnp)
static int
sbscd_submatch(struct device *parent, struct cfdata *cf,
- const locdesc_t *ldesc, void *aux)
+ const locdesc_t *locs, void *aux)
{
int i;
if (cf->cf_loc[SBSCDCF_OFFSET] != SBSCDCF_OFFSET_DEFAULT &&
- cf->cf_loc[SBSCDCF_OFFSET] != ldesc->locs[SBSCDCF_OFFSET])
+ cf->cf_loc[SBSCDCF_OFFSET] != locs[SBSCDCF_OFFSET])
return (0);
for (i = 0; i < 2; i++) {
if (cf->cf_loc[SBSCDCF_INTR + i] != SBSCDCF_INTR_DEFAULT &&
cf->cf_loc[SBSCDCF_INTR + i]
- != ldesc->locs[SBSCDCF_INTR + i])
+ != locs[SBSCDCF_INTR + i])
return (0);
}
diff --git a/sys/arch/mips/sibyte/dev/sbsmbus.c b/sys/arch/mips/sibyte/dev/sbsmbus.c
index e8c1ba72ff8..c2dd5d77186 100644
--- a/sys/arch/mips/sibyte/dev/sbsmbus.c
+++ b/sys/arch/mips/sibyte/dev/sbsmbus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sbsmbus.c,v 1.9 2004/09/13 14:57:31 drochner Exp $ */
+/* $NetBSD: sbsmbus.c,v 1.10 2005/08/25 18:35:39 drochner Exp $ */
/*
* Copyright 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sbsmbus.c,v 1.9 2004/09/13 14:57:31 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbsmbus.c,v 1.10 2005/08/25 18:35:39 drochner Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -87,8 +87,7 @@ smbus_attach(struct device *parent, struct device *self, void *aux)
{
struct smbus_attach_args sa;
int i;
- int help[3];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[SMBUSCF_NLOCS];
found++;
printf("\n");
@@ -101,11 +100,10 @@ smbus_attach(struct device *parent, struct device *self, void *aux)
sa.sa_interface = smbus_devs[i].sa_interface;
sa.sa_device = smbus_devs[i].sa_device;
- ldesc->len = 2;
- ldesc->locs[SMBUSCF_CHAN] = 0; /* XXX */
- ldesc->locs[SMBUSCF_DEV] = smbus_devs[i].sa_device;
+ locs[SMBUSCF_CHAN] = 0; /* XXX */
+ locs[SMBUSCF_DEV] = smbus_devs[i].sa_device;
- config_found_sm_loc(self, "smbus", ldesc, &sa,
+ config_found_sm_loc(self, "smbus", locs, &sa,
smbus_print, smbus_submatch);
}
}
@@ -125,14 +123,14 @@ smbus_print(void *aux, const char *pnp)
static int
smbus_submatch(struct device *parent, struct cfdata *cf,
- const locdesc_t *ldesc, void *aux)
+ const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[SMBUSCF_CHAN] != SMBUSCF_CHAN_DEFAULT &&
- cf->cf_loc[SMBUSCF_CHAN] != ldesc->locs[SMBUSCF_CHAN])
+ cf->cf_loc[SMBUSCF_CHAN] != locs[SMBUSCF_CHAN])
return (0);
if (cf->cf_loc[SMBUSCF_DEV] != SMBUSCF_DEV_DEFAULT &&
- cf->cf_loc[SMBUSCF_DEV] != ldesc->locs[SMBUSCF_DEV])
+ cf->cf_loc[SMBUSCF_DEV] != locs[SMBUSCF_DEV])
return (0);
return (config_match(parent, cf, aux));
diff --git a/sys/arch/pmax/ibus/ibus.c b/sys/arch/pmax/ibus/ibus.c
index 21de4c11e34..7a965393092 100644
--- a/sys/arch/pmax/ibus/ibus.c
+++ b/sys/arch/pmax/ibus/ibus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ibus.c,v 1.10 2004/09/13 14:57:31 drochner Exp $ */
+/* $NetBSD: ibus.c,v 1.11 2005/08/25 18:35:39 drochner Exp $ */
/*
* Copyright (c) 1998 Jonathan Stone. All rights reserved.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: ibus.c,v 1.10 2004/09/13 14:57:31 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibus.c,v 1.11 2005/08/25 18:35:39 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -53,8 +53,7 @@ ibusattach(parent, self, aux)
struct ibus_dev_attach_args *ida = aux;
struct ibus_attach_args *ia;
int i;
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[IBUSCF_NLOCS];
printf("\n");
@@ -69,24 +68,23 @@ ibusattach(parent, self, aux)
badaddr((caddr_t)ia->ia_addr, ia->ia_basz) != 0)
continue;
- ldesc->len = 1;
- ldesc->locs[IBUSCF_ADDR] = MIPS_KSEG1_TO_PHYS(ia->ia_addr);
+ locs[IBUSCF_ADDR] = MIPS_KSEG1_TO_PHYS(ia->ia_addr);
- config_found_sm_loc(self, "ibus", ldesc, ia,
+ config_found_sm_loc(self, "ibus", locs, ia,
ibusprint, ibussubmatch);
}
}
static int
-ibussubmatch(parent, cf, ldesc, aux)
+ibussubmatch(parent, cf, locs, aux)
struct device *parent;
struct cfdata *cf;
- const locdesc_t *ldesc;
+ const locdesc_t *locs;
void *aux;
{
if (cf->cf_loc[IBUSCF_ADDR] != IBUSCF_ADDR_DEFAULT &&
- cf->cf_loc[IBUSCF_ADDR] != ldesc->locs[IBUSCF_ADDR])
+ cf->cf_loc[IBUSCF_ADDR] != locs[IBUSCF_ADDR])
return (0);
return (config_match(parent, cf, aux));
diff --git a/sys/arch/sparc64/dev/sab.c b/sys/arch/sparc64/dev/sab.c
index 2d213190b0a..a998592cbae 100644
--- a/sys/arch/sparc64/dev/sab.c
+++ b/sys/arch/sparc64/dev/sab.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sab.c,v 1.21 2005/05/31 00:50:28 christos Exp $ */
+/* $NetBSD: sab.c,v 1.22 2005/08/25 18:35:39 drochner Exp $ */
/* $OpenBSD: sab.c,v 1.7 2002/04/08 17:49:42 jason Exp $ */
/*
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sab.c,v 1.21 2005/05/31 00:50:28 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sab.c,v 1.22 2005/08/25 18:35:39 drochner Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -242,8 +242,7 @@ sab_attach(parent, self, aux)
struct ebus_attach_args *ea = aux;
u_int8_t r;
u_int i;
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[SABCF_NLOCS];
sc->sc_bt = ea->ea_bustag;
sc->sc_node = ea->ea_node;
@@ -303,12 +302,11 @@ sab_attach(parent, self, aux)
stax.sbt_portno = i;
- ldesc->len = 1;
- ldesc->locs[SABCF_CHANNEL] = i;
+ locs[SABCF_CHANNEL] = i;
sc->sc_child[i] =
(struct sabtty_softc *)config_found_sm_loc(self,
- "sab", ldesc, &stax, sab_print, sab_submatch);
+ "sab", locs, &stax, sab_print, sab_submatch);
if (sc->sc_child[i] != NULL)
sc->sc_nchild++;
}
@@ -316,11 +314,11 @@ sab_attach(parent, self, aux)
int
sab_submatch(struct device *parent, struct cfdata *cf,
- const locdesc_t *ldesc, void *aux)
+ const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[SABCF_CHANNEL] != SABCF_CHANNEL_DEFAULT &&
- cf->cf_loc[SABCF_CHANNEL] != ldesc->locs[SABCF_CHANNEL])
+ cf->cf_loc[SABCF_CHANNEL] != locs[SABCF_CHANNEL])
return (0);
return (config_match(parent, cf, aux));
diff --git a/sys/dev/ata/ata_raid.c b/sys/dev/ata/ata_raid.c
index e02fae13c85..2c03cfe5b92 100644
--- a/sys/dev/ata/ata_raid.c
+++ b/sys/dev/ata/ata_raid.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ata_raid.c,v 1.14 2005/07/18 15:21:48 briggs Exp $ */
+/* $NetBSD: ata_raid.c,v 1.15 2005/08/25 18:35:39 drochner Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ata_raid.c,v 1.14 2005/07/18 15:21:48 briggs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata_raid.c,v 1.15 2005/08/25 18:35:39 drochner Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@@ -191,8 +191,7 @@ static void
ataraid_attach(struct device *parent, struct device *self, void *aux)
{
struct ataraid_array_info *aai;
- int help[3];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[ATARAIDCF_NLOCS];
/*
* We're a pseudo-device, so we get to announce our own
@@ -203,11 +202,10 @@ ataraid_attach(struct device *parent, struct device *self, void *aux)
ataraid_array_info_count == 1 ? "" : "s");
TAILQ_FOREACH(aai, &ataraid_array_info_list, aai_list) {
- ldesc->len = 2;
- ldesc->locs[ATARAIDCF_VENDTYPE] = aai->aai_type;
- ldesc->locs[ATARAIDCF_UNIT] = aai->aai_arrayno;
+ locs[ATARAIDCF_VENDTYPE] = aai->aai_type;
+ locs[ATARAIDCF_UNIT] = aai->aai_arrayno;
- config_found_sm_loc(self, "ataraid", NULL, aai,
+ config_found_sm_loc(self, "ataraid", locs, aai,
ataraid_print, ataraid_submatch);
}
}
@@ -235,15 +233,15 @@ ataraid_print(void *aux, const char *pnp)
*/
static int
ataraid_submatch(struct device *parent, struct cfdata *cf,
- const locdesc_t *ldesc, void *aux)
+ const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[ATARAIDCF_VENDTYPE] != ATARAIDCF_VENDTYPE_DEFAULT &&
- cf->cf_loc[ATARAIDCF_VENDTYPE] != ldesc->locs[ATARAIDCF_VENDTYPE])
+ cf->cf_loc[ATARAIDCF_VENDTYPE] != locs[ATARAIDCF_VENDTYPE])
return (0);
if (cf->cf_loc[ATARAIDCF_UNIT] != ATARAIDCF_UNIT_DEFAULT &&
- cf->cf_loc[ATARAIDCF_UNIT] != ldesc->locs[ATARAIDCF_UNIT])
+ cf->cf_loc[ATARAIDCF_UNIT] != locs[ATARAIDCF_UNIT])
return (0);
return (config_match(parent, cf, aux));
diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c
index ca27ba13e8c..7a144fee593 100644
--- a/sys/dev/cardbus/cardbus.c
+++ b/sys/dev/cardbus/cardbus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cardbus.c,v 1.61 2005/02/27 00:26:59 perry Exp $ */
+/* $NetBSD: cardbus.c,v 1.62 2005/08/25 18:35:39 drochner Exp $ */
/*
* Copyright (c) 1997, 1998, 1999 and 2000
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cardbus.c,v 1.61 2005/02/27 00:26:59 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cardbus.c,v 1.62 2005/08/25 18:35:39 drochner Exp $");
#include "opt_cardbus.h"
@@ -477,8 +477,7 @@ cardbus_rescan(struct device *self, const char *ifattr, const int *locators)
for (function = 0; function < nfunction; function++) {
struct cardbus_attach_args ca;
- int help[3];
- locdesc_t *ldesc = (void *)&help; /* XXX */
+ int locs[CARDBUSCF_NLOCS];
if (locators[CARDBUSCF_FUNCTION] !=
CARDBUSCF_FUNCTION_DEFAULT &&
@@ -592,11 +591,10 @@ cardbus_rescan(struct device *self, const char *ifattr, const int *locators)
}
}
- ldesc->len = 2;
- ldesc->locs[CARDBUSCF_DEV] = sc->sc_device; /* always 0 */
- ldesc->locs[CARDBUSCF_FUNCTION] = function;
+ locs[CARDBUSCF_DEV] = sc->sc_device; /* always 0 */
+ locs[CARDBUSCF_FUNCTION] = function;
- if ((csc = config_found_sm_loc((void *)sc, "cardbus", ldesc,
+ if ((csc = config_found_sm_loc((void *)sc, "cardbus", locs,
&ca, cardbusprint, cardbussubmatch)) == NULL) {
/* do not match */
disable_function(sc, function);
@@ -618,16 +616,16 @@ cardbus_rescan(struct device *self, const char *ifattr, const int *locators)
static int
cardbussubmatch(struct device *parent, struct cfdata *cf,
- const locdesc_t *ldesc, void *aux)
+ const locdesc_t *locs, void *aux)
{
/* ldesc->locs[CARDBUSCF_DEV] is always 0 */
if (cf->cf_loc[CARDBUSCF_DEV] != CARDBUSCF_DEV_DEFAULT &&
- cf->cf_loc[CARDBUSCF_DEV] != ldesc->locs[CARDBUSCF_DEV]) {
+ cf->cf_loc[CARDBUSCF_DEV] != locs[CARDBUSCF_DEV]) {
return (0);
}
if (cf->cf_loc[CARDBUSCF_FUNCTION] != CARDBUSCF_FUNCTION_DEFAULT &&
- cf->cf_loc[CARDBUSCF_FUNCTION] != ldesc->locs[CARDBUSCF_FUNCTION]) {
+ cf->cf_loc[CARDBUSCF_FUNCTION] != locs[CARDBUSCF_FUNCTION]) {
return (0);
}
diff --git a/sys/dev/eisa/eisa.c b/sys/dev/eisa/eisa.c
index fe3151a4cfd..900a3a1d9d5 100644
--- a/sys/dev/eisa/eisa.c
+++ b/sys/dev/eisa/eisa.c
@@ -1,4 +1,4 @@
-/* $NetBSD: eisa.c,v 1.36 2005/02/27 00:26:59 perry Exp $ */
+/* $NetBSD: eisa.c,v 1.37 2005/08/25 18:35:39 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.36 2005/02/27 00:26:59 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: eisa.c,v 1.37 2005/08/25 18:35:39 drochner Exp $");
#include "opt_eisaverbose.h"
@@ -90,11 +90,11 @@ eisaprint(void *aux, const char *pnp)
static int
eisasubmatch(struct device *parent, struct cfdata *cf,
- const locdesc_t * ldesc, void *aux)
+ const locdesc_t * locs, void *aux)
{
if (cf->cf_loc[EISACF_SLOT] != EISACF_SLOT_DEFAULT &&
- cf->cf_loc[EISACF_SLOT] != ldesc->locs[EISACF_SLOT])
+ cf->cf_loc[EISACF_SLOT] != locs[EISACF_SLOT])
return (0);
return (config_match(parent, cf, aux));
}
@@ -128,8 +128,7 @@ eisaattach(struct device *parent, struct device *self, void *aux)
u_int slotaddr;
bus_space_handle_t slotioh;
int i;
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[EISACF_NLOCS];
ea.ea_iot = iot;
ea.ea_memt = memt;
@@ -192,11 +191,10 @@ eisaattach(struct device *parent, struct device *self, void *aux)
/* We no longer need the I/O handle; free it. */
bus_space_unmap(iot, slotioh, EISA_SLOT_SIZE);
- ldesc->len = 1;
- ldesc->locs[EISACF_SLOT] = slot;
+ locs[EISACF_SLOT] = slot;
/* Attach matching device. */
- config_found_sm_loc(self, "eisa", ldesc, &ea,
+ config_found_sm_loc(self, "eisa", locs, &ea,
eisaprint, eisasubmatch);
}
}
diff --git a/sys/dev/i2o/iop.c b/sys/dev/i2o/iop.c
index 217da22c0eb..b54a91964e5 100644
--- a/sys/dev/i2o/iop.c
+++ b/sys/dev/i2o/iop.c
@@ -1,4 +1,4 @@
-/* $NetBSD: iop.c,v 1.48 2005/05/30 04:37:42 christos Exp $ */
+/* $NetBSD: iop.c,v 1.49 2005/08/25 18:35:39 drochner Exp $ */
/*-
* Copyright (c) 2000, 2001, 2002 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: iop.c,v 1.48 2005/05/30 04:37:42 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iop.c,v 1.49 2005/08/25 18:35:39 drochner Exp $");
#include "opt_i2o.h"
#include "iop.h"
@@ -486,8 +486,7 @@ iop_config_interrupts(struct device *self)
struct iop_softc *sc, *iop;
struct i2o_systab_entry *ste;
int rv, i, niop;
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[IOPCF_NLOCS];
sc = (struct iop_softc *)self;
LIST_INIT(&sc->sc_iilist);
@@ -591,9 +590,8 @@ iop_config_interrupts(struct device *self)
*/
ia.ia_class = I2O_CLASS_ANY;
ia.ia_tid = I2O_TID_IOP;
- ldesc->len = 1;
- ldesc->locs[IOPCF_TID] = I2O_TID_IOP;
- config_found_sm_loc(self, "iop", ldesc, &ia, iop_print, iop_submatch);
+ locs[IOPCF_TID] = I2O_TID_IOP;
+ config_found_sm_loc(self, "iop", locs, &ia, iop_print, iop_submatch);
/*
* Start device configuration.
@@ -803,8 +801,7 @@ iop_configure_devices(struct iop_softc *sc, int mask, int maskval)
struct device *dv;
int i, j, nent;
u_int usertid;
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[IOPCF_NLOCS];
nent = sc->sc_nlctent;
for (i = 0, le = sc->sc_lct->entry; i < nent; i++, le++) {
@@ -841,10 +838,9 @@ iop_configure_devices(struct iop_softc *sc, int mask, int maskval)
if (ii != NULL)
continue;
- ldesc->len = 1;
- ldesc->locs[IOPCF_TID] = ia.ia_tid;
+ locs[IOPCF_TID] = ia.ia_tid;
- dv = config_found_sm_loc(&sc->sc_dv, "iop", ldesc, &ia,
+ dv = config_found_sm_loc(&sc->sc_dv, "iop", locs, &ia,
iop_print, iop_submatch);
if (dv != NULL) {
sc->sc_tidmap[i].it_flags |= IT_CONFIGURED;
@@ -904,11 +900,11 @@ iop_print(void *aux, const char *pnp)
static int
iop_submatch(struct device *parent, struct cfdata *cf,
- const locdesc_t *ldesc, void *aux)
+ const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[IOPCF_TID] != IOPCF_TID_DEFAULT &&
- cf->cf_loc[IOPCF_TID] != ldesc->locs[IOPCF_TID])
+ cf->cf_loc[IOPCF_TID] != locs[IOPCF_TID])
return (0);
return (config_match(parent, cf, aux));
diff --git a/sys/dev/ic/aac.c b/sys/dev/ic/aac.c
index 8c38c2b3da2..b30608f98bd 100644
--- a/sys/dev/ic/aac.c
+++ b/sys/dev/ic/aac.c
@@ -1,4 +1,4 @@
-/* $NetBSD: aac.c,v 1.21 2005/06/20 20:40:21 darcy Exp $ */
+/* $NetBSD: aac.c,v 1.22 2005/08/25 18:35:39 drochner Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aac.c,v 1.21 2005/06/20 20:40:21 darcy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aac.c,v 1.22 2005/08/25 18:35:39 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -154,13 +154,7 @@ aac_attach(struct aac_softc *sc)
struct aac_ccb *ac;
struct aac_fib *fib;
bus_addr_t fibpa;
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX - Not clean
- The big plan is to let config(8) issue information
- about the length of the locator array in a useful way.
- Then the allocation can be centralized. See also
- http://mail-index.netbsd.org/tech-kern/2005/02/09/0025.html
- */
+ int locs[AACCF_NLOCS];
SIMPLEQ_INIT(&sc->sc_ccb_free);
SIMPLEQ_INIT(&sc->sc_ccb_queue);
@@ -259,10 +253,9 @@ aac_attach(struct aac_softc *sc)
continue;
aaca.aaca_unit = i;
- ldesc->len = 1;
- ldesc->locs[AACCF_UNIT] = i;
+ locs[AACCF_UNIT] = i;
- config_found_sm_loc(&sc->sc_dv, "aac", ldesc, &aaca,
+ config_found_sm_loc(&sc->sc_dv, "aac", locs, &aaca,
aac_print, aac_submatch);
}
@@ -316,14 +309,11 @@ aac_print(void *aux, const char *pnp)
*/
static int
aac_submatch(struct device *parent, struct cfdata *cf,
- const locdesc_t *ldesc, void *aux)
+ const locdesc_t *locs, void *aux)
{
- struct aac_attach_args *aaca;
-
- aaca = aux;
if (cf->cf_loc[AACCF_UNIT] != AACCF_UNIT_DEFAULT &&
- cf->cf_loc[AACCF_UNIT] != ldesc->locs[AACCF_UNIT])
+ cf->cf_loc[AACCF_UNIT] != locs[AACCF_UNIT])
return (0);
return (config_match(parent, cf, aux));
diff --git a/sys/dev/ic/cac.c b/sys/dev/ic/cac.c
index 50efd0e7673..cb00282f2cc 100644
--- a/sys/dev/ic/cac.c
+++ b/sys/dev/ic/cac.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cac.c,v 1.30 2005/05/30 04:43:46 christos Exp $ */
+/* $NetBSD: cac.c,v 1.31 2005/08/25 18:35:39 drochner Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cac.c,v 1.30 2005/05/30 04:43:46 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cac.c,v 1.31 2005/08/25 18:35:39 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -101,8 +101,7 @@ cac_init(struct cac_softc *sc, const char *intrstr, int startfw)
int error, rseg, size, i;
bus_dma_segment_t seg;
struct cac_ccb *ccb;
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[CACCF_NLOCS];
if (intrstr != NULL)
aprint_normal("%s: interrupting at %s\n", sc->sc_dv.dv_xname,
@@ -185,10 +184,9 @@ cac_init(struct cac_softc *sc, const char *intrstr, int startfw)
for (i = 0; i < cinfo.num_drvs; i++) {
caca.caca_unit = i;
- ldesc->len = 1;
- ldesc->locs[CACCF_UNIT] = i;
+ locs[CACCF_UNIT] = i;
- config_found_sm_loc(&sc->sc_dv, "cac", ldesc, &caca,
+ config_found_sm_loc(&sc->sc_dv, "cac", locs, &caca,
cac_print, cac_submatch);
}
@@ -242,11 +240,11 @@ cac_print(void *aux, const char *pnp)
*/
static int
cac_submatch(struct device *parent, struct cfdata *cf,
- const locdesc_t *ldesc, void *aux)
+ const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[CACCF_UNIT] != CACCF_UNIT_DEFAULT &&
- cf->cf_loc[CACCF_UNIT] != ldesc->locs[CACCF_UNIT])
+ cf->cf_loc[CACCF_UNIT] != locs[CACCF_UNIT])
return (0);
return (config_match(parent, cf, aux));
diff --git a/sys/dev/ic/i82365.c b/sys/dev/ic/i82365.c
index 5b5d946c591..a51891f1ad9 100644
--- a/sys/dev/ic/i82365.c
+++ b/sys/dev/ic/i82365.c
@@ -1,4 +1,4 @@
-/* $NetBSD: i82365.c,v 1.90 2005/05/30 04:43:46 christos Exp $ */
+/* $NetBSD: i82365.c,v 1.91 2005/08/25 18:35:39 drochner Exp $ */
/*
* Copyright (c) 2004 Charles M. Hannum. All rights reserved.
@@ -49,7 +49,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i82365.c,v 1.90 2005/05/30 04:43:46 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i82365.c,v 1.91 2005/08/25 18:35:39 drochner Exp $");
#define PCICDEBUG
@@ -396,8 +396,7 @@ pcic_attach_socket(h)
{
struct pcmciabus_attach_args paa;
struct pcic_softc *sc = (struct pcic_softc *)h->ph_parent;
- int help[3];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[PCMCIABUSCF_NLOCS];
/* initialize the rest of the handle */
@@ -414,11 +413,10 @@ pcic_attach_socket(h)
paa.iobase = sc->iobase;
paa.iosize = sc->iosize;
- ldesc->len = 2;
- ldesc->locs[PCMCIABUSCF_CONTROLLER] = h->chip;
- ldesc->locs[PCMCIABUSCF_SOCKET] = h->socket;
+ locs[PCMCIABUSCF_CONTROLLER] = h->chip;
+ locs[PCMCIABUSCF_SOCKET] = h->socket;
- h->pcmcia = config_found_sm_loc(&sc->dev, "pcmciabus", ldesc, &paa,
+ h->pcmcia = config_found_sm_loc(&sc->dev, "pcmciabus", locs, &paa,
pcic_print, pcic_submatch);
if (h->pcmcia == NULL) {
h->flags &= ~PCIC_FLAG_SOCKETP;
@@ -642,18 +640,18 @@ pcic_event_thread(arg)
}
int
-pcic_submatch(parent, cf, ldesc, aux)
+pcic_submatch(parent, cf, locs, aux)
struct device *parent;
struct cfdata *cf;
- const locdesc_t *ldesc;
+ const locdesc_t *locs;
void *aux;
{
if (cf->cf_loc[PCMCIABUSCF_CONTROLLER] != PCMCIABUSCF_CONTROLLER_DEFAULT &&
- cf->cf_loc[PCMCIABUSCF_CONTROLLER] != ldesc->locs[PCMCIABUSCF_CONTROLLER])
+ cf->cf_loc[PCMCIABUSCF_CONTROLLER] != locs[PCMCIABUSCF_CONTROLLER])
return 0;
if (cf->cf_loc[PCMCIABUSCF_SOCKET] != PCMCIABUSCF_SOCKET_DEFAULT &&
- cf->cf_loc[PCMCIABUSCF_SOCKET] != ldesc->locs[PCMCIABUSCF_SOCKET])
+ cf->cf_loc[PCMCIABUSCF_SOCKET] != locs[PCMCIABUSCF_SOCKET])
return 0;
return (config_match(parent, cf, aux));
diff --git a/sys/dev/ic/icp.c b/sys/dev/ic/icp.c
index 3ceb352da33..940e5c75d8e 100644
--- a/sys/dev/ic/icp.c
+++ b/sys/dev/ic/icp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: icp.c,v 1.14 2005/02/27 00:27:01 perry Exp $ */
+/* $NetBSD: icp.c,v 1.15 2005/08/25 18:35:39 drochner Exp $ */
/*-
* Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -83,7 +83,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: icp.c,v 1.14 2005/02/27 00:27:01 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: icp.c,v 1.15 2005/08/25 18:35:39 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -141,8 +141,7 @@ icp_init(struct icp_softc *icp, const char *intrstr)
struct icp_ccb *ic;
u_int16_t cdev_cnt;
int i, j, state, feat, nsegs, rv;
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[ICPCF_NLOCS];
state = 0;
@@ -385,11 +384,10 @@ icp_init(struct icp_softc *icp, const char *intrstr)
icpa.icpa_unit = j + ICPA_UNIT_SCSI;
- ldesc->len = 1;
- ldesc->locs[ICPCF_UNIT] = j + ICPA_UNIT_SCSI;
+ locs[ICPCF_UNIT] = j + ICPA_UNIT_SCSI;
icp->icp_children[icpa.icpa_unit] =
- config_found_sm_loc(&icp->icp_dv, "icp", ldesc,
+ config_found_sm_loc(&icp->icp_dv, "icp", locs,
&icpa, icp_print, icp_submatch);
}
}
@@ -404,11 +402,10 @@ icp_init(struct icp_softc *icp, const char *intrstr)
icpa.icpa_unit = j;
- ldesc->len = 1;
- ldesc->locs[ICPCF_UNIT] = j;
+ locs[ICPCF_UNIT] = j;
icp->icp_children[icpa.icpa_unit] =
- config_found_sm_loc(&icp->icp_dv, "icp", ldesc,
+ config_found_sm_loc(&icp->icp_dv, "icp", locs,
&icpa, icp_print, icp_submatch);
}
}
@@ -457,8 +454,7 @@ icp_rescan(struct icp_softc *icp, int unit)
{
struct icp_attach_args icpa;
u_int newsize, newtype;
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[ICPCF_NLOCS];
/*
* NOTE: It is very important that the queue be frozen and not
@@ -531,11 +527,10 @@ icp_rescan(struct icp_softc *icp, int unit)
icpa.icpa_unit = unit;
- ldesc->len = 1;
- ldesc->locs[ICPCF_UNIT] = unit;
+ locs[ICPCF_UNIT] = unit;
icp->icp_children[unit] = config_found_sm_loc(&icp->icp_dv,
- "icp", ldesc, &icpa, icp_print, icp_submatch);
+ "icp", locs, &icpa, icp_print, icp_submatch);
}
icp_recompute_openings(icp);
@@ -649,11 +644,11 @@ icp_print(void *aux, const char *pnp)
int
icp_submatch(struct device *parent, struct cfdata *cf,
- const locdesc_t *ldesc, void *aux)
+ const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[ICPCF_UNIT] != ICPCF_UNIT_DEFAULT &&
- cf->cf_loc[ICPCF_UNIT] != ldesc->locs[ICPCF_UNIT])
+ cf->cf_loc[ICPCF_UNIT] != locs[ICPCF_UNIT])
return (0);
return (config_match(parent, cf, aux));
diff --git a/sys/dev/ic/mlx.c b/sys/dev/ic/mlx.c
index b6770bd82de..d5fda26844f 100644
--- a/sys/dev/ic/mlx.c
+++ b/sys/dev/ic/mlx.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mlx.c,v 1.34 2005/07/30 17:37:11 mhitch Exp $ */
+/* $NetBSD: mlx.c,v 1.35 2005/08/25 18:35:39 drochner Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mlx.c,v 1.34 2005/07/30 17:37:11 mhitch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mlx.c,v 1.35 2005/08/25 18:35:39 drochner Exp $");
#include "ld.h"
@@ -577,8 +577,7 @@ mlx_configure(struct mlx_softc *mlx, int waitok)
struct mlx_attach_args mlxa;
int i, nunits;
u_int size;
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[MLXCF_NLOCS];
mlx->mlx_flags |= MLXF_RESCANNING;
@@ -643,11 +642,10 @@ mlx_configure(struct mlx_softc *mlx, int waitok)
*/
mlxa.mlxa_unit = i;
- ldesc->len = 1;
- ldesc->locs[MLXCF_UNIT] = i;
+ locs[MLXCF_UNIT] = i;
- ms->ms_dv = config_found_sm_loc(&mlx->mlx_dv, "mlx", NULL, &mlxa, mlx_print,
- mlx_submatch);
+ ms->ms_dv = config_found_sm_loc(&mlx->mlx_dv, "mlx", locs,
+ &mlxa, mlx_print, mlx_submatch);
nunits += (ms->ms_dv != NULL);
}
@@ -681,11 +679,11 @@ mlx_print(void *aux, const char *pnp)
*/
static int
mlx_submatch(struct device *parent, struct cfdata *cf,
- const locdesc_t *ldesc, void *aux)
+ const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[MLXCF_UNIT] != MLXCF_UNIT_DEFAULT &&
- cf->cf_loc[MLXCF_UNIT] != ldesc->locs[MLXCF_UNIT])
+ cf->cf_loc[MLXCF_UNIT] != locs[MLXCF_UNIT])
return (0);
return (config_match(parent, cf, aux));
diff --git a/sys/dev/ic/tcic2.c b/sys/dev/ic/tcic2.c
index 4bcf668ea04..82f03761446 100644
--- a/sys/dev/ic/tcic2.c
+++ b/sys/dev/ic/tcic2.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tcic2.c,v 1.20 2005/05/30 04:43:47 christos Exp $ */
+/* $NetBSD: tcic2.c,v 1.21 2005/08/25 18:35:39 drochner Exp $ */
/*
* Copyright (c) 1998, 1999 Christoph Badura. All rights reserved.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcic2.c,v 1.20 2005/05/30 04:43:47 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcic2.c,v 1.21 2005/08/25 18:35:39 drochner Exp $");
#undef TCICDEBUG
@@ -412,8 +412,7 @@ tcic_attach_socket(h)
struct tcic_handle *h;
{
struct pcmciabus_attach_args paa;
- int help[3];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[PCMCIABUSCF_NLOCS];
/* initialize the rest of the handle */
@@ -430,11 +429,10 @@ tcic_attach_socket(h)
paa.iobase = h->sc->iobase;
paa.iosize = h->sc->iosize;
- ldesc->len = 2;
- ldesc->locs[PCMCIABUSCF_CONTROLLER] = 0;
- ldesc->locs[PCMCIABUSCF_SOCKET] = h->sock;
+ locs[PCMCIABUSCF_CONTROLLER] = 0;
+ locs[PCMCIABUSCF_SOCKET] = h->sock;
- h->pcmcia = config_found_sm_loc(&h->sc->dev, "pcmciabus", ldesc, &paa,
+ h->pcmcia = config_found_sm_loc(&h->sc->dev, "pcmciabus", locs, &paa,
tcic_print, tcic_submatch);
/* if there's actually a pcmcia device attached, initialize the slot */
@@ -538,18 +536,18 @@ tcic_init_socket(h)
}
int
-tcic_submatch(parent, cf, ldesc, aux)
+tcic_submatch(parent, cf, locs, aux)
struct device *parent;
struct cfdata *cf;
- const locdesc_t *ldesc;
+ const locdesc_t *locs;
void *aux;
{
if (cf->cf_loc[PCMCIABUSCF_CONTROLLER] != PCMCIABUSCF_CONTROLLER_DEFAULT &&
- cf->cf_loc[PCMCIABUSCF_CONTROLLER] != ldesc->locs[PCMCIABUSCF_CONTROLLER])
+ cf->cf_loc[PCMCIABUSCF_CONTROLLER] != locs[PCMCIABUSCF_CONTROLLER])
return 0;
if (cf->cf_loc[PCMCIABUSCF_SOCKET] != PCMCIABUSCF_SOCKET_DEFAULT &&
- cf->cf_loc[PCMCIABUSCF_SOCKET] != ldesc->locs[PCMCIABUSCF_SOCKET])
+ cf->cf_loc[PCMCIABUSCF_SOCKET] != locs[PCMCIABUSCF_SOCKET])
return 0;
return (config_match(parent, cf, aux));
diff --git a/sys/dev/ic/upc.c b/sys/dev/ic/upc.c
index 92add4fa2e3..428a225ddc2 100644
--- a/sys/dev/ic/upc.c
+++ b/sys/dev/ic/upc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: upc.c,v 1.9 2005/02/27 00:27:03 perry Exp $ */
+/* $NetBSD: upc.c,v 1.10 2005/08/25 18:35:39 drochner Exp $ */
/*-
* Copyright (c) 2000, 2003 Ben Harris
* All rights reserved.
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: upc.c,v 1.9 2005/02/27 00:27:03 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: upc.c,v 1.10 2005/08/25 18:35:39 drochner Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -211,8 +211,7 @@ upc_found(struct upc_softc *sc, char const *devtype, int offset, int size,
struct upc_irqhandle *uih)
{
struct upc_attach_args ua;
- int help[2];
- locdesc_t *ldesc = (void *)help;
+ int locs[UPCCF_NLOCS];
ua.ua_devtype = devtype;
ua.ua_offset = offset;
@@ -220,10 +219,9 @@ upc_found(struct upc_softc *sc, char const *devtype, int offset, int size,
bus_space_subregion(sc->sc_iot, sc->sc_ioh, offset, size, &ua.ua_ioh);
ua.ua_irqhandle = uih;
- ldesc->len = 1;
- ldesc->locs[UPCCF_OFFSET] = offset;
+ locs[UPCCF_OFFSET] = offset;
- config_found_sm_loc(&sc->sc_dev, "upc", ldesc, &ua,
+ config_found_sm_loc(&sc->sc_dev, "upc", locs, &ua,
upc_print, upc_submatch);
}
@@ -232,8 +230,7 @@ upc_found2(struct upc_softc *sc, char const *devtype, int offset, int size,
int offset2, int size2, struct upc_irqhandle *uih)
{
struct upc_attach_args ua;
- int help[2];
- locdesc_t *ldesc = (void *)help;
+ int locs[UPCCF_NLOCS];
ua.ua_devtype = devtype;
ua.ua_offset = offset;
@@ -243,10 +240,9 @@ upc_found2(struct upc_softc *sc, char const *devtype, int offset, int size,
&ua.ua_ioh2);
ua.ua_irqhandle = uih;
- ldesc->len = 1;
- ldesc->locs[UPCCF_OFFSET] = offset;
+ locs[UPCCF_OFFSET] = offset;
- config_found_sm_loc(&sc->sc_dev, "upc", ldesc, &ua,
+ config_found_sm_loc(&sc->sc_dev, "upc", locs, &ua,
upc_print, upc_submatch);
}
@@ -307,13 +303,13 @@ upc_print(void *aux, char const *pnp)
static int
upc_submatch(struct device *parent, struct cfdata *cf,
- const locdesc_t *ldesc, void *aux)
+ const locdesc_t *locs, void *aux)
{
struct upc_attach_args *ua = aux;
if (strcmp(cf->cf_name, ua->ua_devtype) == 0 &&
(cf->cf_loc[UPCCF_OFFSET] == UPCCF_OFFSET_DEFAULT ||
- cf->cf_loc[UPCCF_OFFSET] == ldesc->locs[UPCCF_OFFSET]))
+ cf->cf_loc[UPCCF_OFFSET] == locs[UPCCF_OFFSET]))
return config_match(parent, cf, aux);
return 0;
}
diff --git a/sys/dev/ieee1394/firewire.c b/sys/dev/ieee1394/firewire.c
index c9a26e84b28..ef8bee5936d 100644
--- a/sys/dev/ieee1394/firewire.c
+++ b/sys/dev/ieee1394/firewire.c
@@ -1,4 +1,4 @@
-/* $NetBSD: firewire.c,v 1.2 2005/07/20 15:11:57 drochner Exp $ */
+/* $NetBSD: firewire.c,v 1.3 2005/08/25 18:35:39 drochner Exp $ */
/*-
* Copyright (c) 2003 Hidetoshi Shimokawa
* Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
@@ -558,14 +558,14 @@ firewire_resume(device_t dev)
#elif defined(__NetBSD__)
static int
firewiresubmatch(
- struct device *parent, struct cfdata *cf, const locdesc_t *ldesc, void *aux)
+ struct device *parent, struct cfdata *cf, const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[IEEE1394IFCF_EUIHI] != IEEE1394IFCF_EUIHI_DEFAULT &&
- cf->cf_loc[IEEE1394IFCF_EUIHI] != ldesc->locs[0])
+ cf->cf_loc[IEEE1394IFCF_EUIHI] != locs[IEEE1394IFCF_EUIHI])
return (0);
if (cf->cf_loc[IEEE1394IFCF_EUILO] != IEEE1394IFCF_EUILO_DEFAULT &&
- cf->cf_loc[IEEE1394IFCF_EUILO] != ldesc->locs[1])
+ cf->cf_loc[IEEE1394IFCF_EUILO] != locs[IEEE1394IFCF_EUILO])
return (0);
return (config_match(parent, cf, aux));
}
diff --git a/sys/dev/isa/isa.c b/sys/dev/isa/isa.c
index 88e5f4ba113..ecd291cde7e 100644
--- a/sys/dev/isa/isa.c
+++ b/sys/dev/isa/isa.c
@@ -1,4 +1,4 @@
-/* $NetBSD: isa.c,v 1.120 2005/05/29 22:12:37 christos Exp $ */
+/* $NetBSD: isa.c,v 1.121 2005/08/25 18:35:39 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.120 2005/05/29 22:12:37 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isa.c,v 1.121 2005/08/25 18:35:39 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -139,11 +139,9 @@ isaattach(struct device *parent, struct device *self, void *aux)
int
isarescan(struct device *self, const char *ifattr, const int *locators)
{
- int help[8];
- locdesc_t *ldesc = (void *)help; /* XXX */;
+ int locs[ISACF_NLOCS];
- ldesc->len = 7;
- memcpy(&ldesc->locs, locators, 7 * sizeof(int));
+ memcpy(locs, locators, sizeof(locs));
/*
* XXX Bus independant code calling this function does not
@@ -151,12 +149,12 @@ isarescan(struct device *self, const char *ifattr, const int *locators)
* (should be made available by "config" one day)
* So fixup where the "-1" is not correct.
*/
- if (ldesc->locs[ISACF_SIZE] == -1)
- ldesc->locs[ISACF_SIZE] = ISACF_SIZE_DEFAULT;
- if (ldesc->locs[ISACF_IOSIZ] == -1)
- ldesc->locs[ISACF_IOSIZ] = ISACF_IOSIZ_DEFAULT;
+ if (locs[ISACF_SIZE] == -1)
+ locs[ISACF_SIZE] = ISACF_SIZE_DEFAULT;
+ if (locs[ISACF_IOSIZ] == -1)
+ locs[ISACF_IOSIZ] = ISACF_IOSIZ_DEFAULT;
- config_search_loc(isasearch, self, ifattr, ldesc, NULL);
+ config_search_loc(isasearch, self, ifattr, locs, NULL);
return (0);
}
@@ -390,8 +388,7 @@ isasearch(struct device *parent, struct cfdata *cf,
struct isa_drq res_drq[2];
struct isa_softc *sc = (struct isa_softc *)parent;
struct isa_attach_args ia;
- int help[8];
- locdesc_t *locs = (void *)&help; /* XXX */
+ int locs[ISACF_NLOCS];
int tryagain;
do {
@@ -427,7 +424,7 @@ isasearch(struct device *parent, struct cfdata *cf,
ia.ia_drq = res_drq;
ia.ia_ndrq = 2;
- if (!checkattachargs(&ia, ldesc->locs))
+ if (!checkattachargs(&ia, locs))
return (0);
tryagain = 0;
@@ -436,14 +433,13 @@ isasearch(struct device *parent, struct cfdata *cf,
* This is not necessary for detach, but might
* still be useful to collect device information.
*/
- locs->len = 7;
- locs->locs[ISACF_PORT] = ia.ia_io[0].ir_addr;
- locs->locs[ISACF_SIZE] = ia.ia_io[0].ir_size;
- locs->locs[ISACF_IOMEM] = ia.ia_iomem[0].ir_addr;
- locs->locs[ISACF_IOSIZ] = ia.ia_iomem[0].ir_size;
- locs->locs[ISACF_IRQ] = ia.ia_irq[0].ir_irq;
- locs->locs[ISACF_DRQ] = ia.ia_drq[0].ir_drq;
- locs->locs[ISACF_DRQ2] = ia.ia_drq[1].ir_drq;
+ locs[ISACF_PORT] = ia.ia_io[0].ir_addr;
+ locs[ISACF_SIZE] = ia.ia_io[0].ir_size;
+ locs[ISACF_IOMEM] = ia.ia_iomem[0].ir_addr;
+ locs[ISACF_IOSIZ] = ia.ia_iomem[0].ir_size;
+ locs[ISACF_IRQ] = ia.ia_irq[0].ir_irq;
+ locs[ISACF_DRQ] = ia.ia_drq[0].ir_drq;
+ locs[ISACF_DRQ2] = ia.ia_drq[1].ir_drq;
config_attach_loc(parent, cf, locs, &ia, isaprint);
tryagain = (cf->cf_fstate == FSTATE_STAR);
}
diff --git a/sys/dev/mca/edc_mca.c b/sys/dev/mca/edc_mca.c
index 62a8c2ee2e4..687af9ae459 100644
--- a/sys/dev/mca/edc_mca.c
+++ b/sys/dev/mca/edc_mca.c
@@ -1,4 +1,4 @@
-/* $NetBSD: edc_mca.c,v 1.28 2005/02/27 00:27:21 perry Exp $ */
+/* $NetBSD: edc_mca.c,v 1.29 2005/08/25 18:35:39 drochner Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: edc_mca.c,v 1.28 2005/02/27 00:27:21 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: edc_mca.c,v 1.29 2005/08/25 18:35:39 drochner Exp $");
#include "rnd.h"
@@ -153,11 +153,11 @@ edc_mca_probe(parent, match, aux)
static int
edcsubmatch(struct device *parent, struct cfdata *cf,
- const locdesc_t *ldesc, void *aux)
+ const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[EDCCF_DRIVE] != EDCCF_DRIVE_DEFAULT &&
- cf->cf_loc[EDCCF_DRIVE] != ldesc->locs[EDCCF_DRIVE])
+ cf->cf_loc[EDCCF_DRIVE] != locs[EDCCF_DRIVE])
return (0);
return (config_match(parent, cf, aux));
@@ -175,8 +175,7 @@ edc_mca_attach(parent, self, aux)
int irq, drq, iobase;
const char *typestr;
int devno, error;
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[EDCCF_NLOCS];
pos2 = mca_conf_read(ma->ma_mc, ma->ma_slot, 2);
pos3 = mca_conf_read(ma->ma_mc, ma->ma_slot, 3);
@@ -324,10 +323,9 @@ edc_mca_attach(parent, self, aux)
/* check for attached disks */
for (devno = 0; devno < sc->sc_maxdevs; devno++) {
eda.edc_drive = devno;
- ldesc->len = 1;
- ldesc->locs[EDCCF_DRIVE] = devno;
+ locs[EDCCF_DRIVE] = devno;
sc->sc_ed[devno] =
- (void *) config_found_sm_loc(self, "edc", ldesc, &eda,
+ (void *) config_found_sm_loc(self, "edc", locs, &eda,
NULL, edcsubmatch);
/* If initialization did not succeed, NULL the pointer. */
diff --git a/sys/dev/mca/mca.c b/sys/dev/mca/mca.c
index caec15560d8..c5e13933524 100644
--- a/sys/dev/mca/mca.c
+++ b/sys/dev/mca/mca.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mca.c,v 1.17 2005/02/04 02:10:43 perry Exp $ */
+/* $NetBSD: mca.c,v 1.18 2005/08/25 18:35:39 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.17 2005/02/04 02:10:43 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mca.c,v 1.18 2005/08/25 18:35:39 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -118,15 +118,15 @@ mca_print(aux, pnp)
}
int
-mca_submatch(parent, cf, ldesc, aux)
+mca_submatch(parent, cf, locs, aux)
struct device *parent;
struct cfdata *cf;
- const locdesc_t *ldesc;
+ const locdesc_t *locs;
void *aux;
{
if (cf->cf_loc[MCACF_SLOT] != MCACF_SLOT_DEFAULT &&
- cf->cf_loc[MCACF_SLOT] != ldesc->locs[MCACF_SLOT])
+ cf->cf_loc[MCACF_SLOT] != locs[MCACF_SLOT])
return 0;
return (config_match(parent, cf, aux));
}
@@ -162,8 +162,7 @@ mca_attach(parent, self, aux)
for (slot = 0; slot < MCA_MAX_SLOTS; slot++) {
struct mca_attach_args ma;
int reg;
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[MCACF_NLOCS];
ma.ma_iot = iot;
ma.ma_memt = memt;
@@ -178,12 +177,11 @@ mca_attach(parent, self, aux)
if (ma.ma_id == 0xffff) /* no adapter here */
continue;
- ldesc->len = 1;
- ldesc->locs[MCACF_SLOT] = slot;
+ locs[MCACF_SLOT] = slot;
if (ma.ma_pos[2] & MCA_POS2_ENABLE
|| mca_match_disabled(ma.ma_id))
- config_found_sm_loc(self, "mca", ldesc, &ma,
+ config_found_sm_loc(self, "mca", locs, &ma,
mca_print, mca_submatch);
else {
mca_print(&ma, self->dv_xname);
diff --git a/sys/dev/mii/mii.c b/sys/dev/mii/mii.c
index fb2e5f830ed..36720eebbb6 100644
--- a/sys/dev/mii/mii.c
+++ b/sys/dev/mii/mii.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mii.c,v 1.37 2004/09/13 12:55:48 drochner Exp $ */
+/* $NetBSD: mii.c,v 1.38 2005/08/25 18:35:39 drochner Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mii.c,v 1.37 2004/09/13 12:55:48 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mii.c,v 1.38 2005/08/25 18:35:39 drochner Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -74,8 +74,7 @@ mii_attach(struct device *parent, struct mii_data *mii, int capmask,
struct mii_softc *child;
int bmsr, offset = 0;
int phymin, phymax;
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[MIICF_NLOCS];
if (phyloc != MII_PHY_ANY && offloc != MII_OFFSET_ANY)
panic("mii_attach: phyloc and offloc specified");
@@ -144,11 +143,10 @@ mii_attach(struct device *parent, struct mii_data *mii, int capmask,
ma.mii_capmask = capmask;
ma.mii_flags = flags | (mii->mii_flags & MIIF_INHERIT_MASK);
- ldesc->len = 1;
- ldesc->locs[MIICF_PHY] = ma.mii_phyno;
+ locs[MIICF_PHY] = ma.mii_phyno;
child = (struct mii_softc *)config_found_sm_loc(parent, "mii",
- ldesc, &ma, mii_print, mii_submatch);
+ locs, &ma, mii_print, mii_submatch);
if (child) {
/*
* Link it up in the parent's MII data.
@@ -239,11 +237,11 @@ mii_print(void *aux, const char *pnp)
static int
mii_submatch(struct device *parent, struct cfdata *cf,
- const locdesc_t *ldesc, void *aux)
+ const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[MIICF_PHY] != MIICF_PHY_DEFAULT &&
- cf->cf_loc[MIICF_PHY] != ldesc->locs[MIICF_PHY])
+ cf->cf_loc[MIICF_PHY] != locs[MIICF_PHY])
return (0);
return (config_match(parent, cf, aux));
diff --git a/sys/dev/pci/amr.c b/sys/dev/pci/amr.c
index ffc0ee6772d..a643d5c5c28 100644
--- a/sys/dev/pci/amr.c
+++ b/sys/dev/pci/amr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: amr.c,v 1.27 2005/06/28 00:28:41 thorpej Exp $ */
+/* $NetBSD: amr.c,v 1.28 2005/08/25 18:35:39 drochner Exp $ */
/*-
* Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amr.c,v 1.27 2005/06/28 00:28:41 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amr.c,v 1.28 2005/08/25 18:35:39 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -257,8 +257,7 @@ amr_attach(struct device *parent, struct device *self, void *aux)
pcireg_t reg;
int rseg, i, j, size, rv, memreg, ioreg;
struct amr_ccb *ac;
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[AMRCF_NLOCS];
aprint_naive(": RAID controller\n");
@@ -464,11 +463,10 @@ amr_attach(struct device *parent, struct device *self, void *aux)
continue;
amra.amra_unit = j;
- ldesc->len = 1;
- ldesc->locs[AMRCF_UNIT] = j;
+ locs[AMRCF_UNIT] = j;
amr->amr_drive[j].al_dv = config_found_sm_loc(&amr->amr_dv,
- "amr", ldesc, &amra, amr_print, amr_submatch);
+ "amr", locs, &amra, amr_print, amr_submatch);
}
SIMPLEQ_INIT(&amr->amr_ccb_queue);
@@ -539,14 +537,14 @@ amr_print(void *aux, const char *pnp)
*/
static int
amr_submatch(struct device *parent, struct cfdata *cf,
- const locdesc_t *ldesc, void *aux)
+ const locdesc_t *locs, void *aux)
{
struct amr_attach_args *amra;
amra = (struct amr_attach_args *)aux;
if (cf->cf_loc[AMRCF_UNIT] != AMRCF_UNIT_DEFAULT &&
- cf->cf_loc[AMRCF_UNIT] != ldesc->locs[AMRCF_UNIT])
+ cf->cf_loc[AMRCF_UNIT] != locs[AMRCF_UNIT])
return (0);
return (config_match(parent, cf, aux));
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index 96df3f9bdc3..12191a9e4f9 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pci.c,v 1.93 2005/06/28 00:28:42 thorpej Exp $ */
+/* $NetBSD: pci.c,v 1.94 2005/08/25 18:35:39 drochner Exp $ */
/*
* Copyright (c) 1995, 1996, 1997, 1998
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.93 2005/06/28 00:28:42 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.94 2005/08/25 18:35:39 drochner Exp $");
#include "opt_pci.h"
@@ -245,14 +245,14 @@ pciprint(void *aux, const char *pnp)
int
pcisubmatch(struct device *parent, struct cfdata *cf,
- const locdesc_t *ldesc, void *aux)
+ const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[PCICF_DEV] != PCICF_DEV_DEFAULT &&
- cf->cf_loc[PCICF_DEV] != ldesc->locs[PCICF_DEV])
+ cf->cf_loc[PCICF_DEV] != locs[PCICF_DEV])
return (0);
if (cf->cf_loc[PCICF_FUNCTION] != PCICF_FUNCTION_DEFAULT &&
- cf->cf_loc[PCICF_FUNCTION] != ldesc->locs[PCICF_FUNCTION])
+ cf->cf_loc[PCICF_FUNCTION] != locs[PCICF_FUNCTION])
return (0);
return (config_match(parent, cf, aux));
}
@@ -265,8 +265,7 @@ pci_probe_device(struct pci_softc *sc, pcitag_t tag,
struct pci_attach_args pa;
pcireg_t id, csr, class, intr, bhlcr;
int ret, pin, bus, device, function;
- int help[3];
- locdesc_t *ldp = (void *)&help; /* XXX XXX */
+ int locs[PCICF_NLOCS];
struct device *subdev;
pci_decompose_tag(pc, tag, &bus, &device, &function);
@@ -350,11 +349,10 @@ pci_probe_device(struct pci_softc *sc, pcitag_t tag,
if (ret != 0 && pap != NULL)
*pap = pa;
} else {
- ldp->len = 2;
- ldp->locs[PCICF_DEV] = device;
- ldp->locs[PCICF_FUNCTION] = function;
+ locs[PCICF_DEV] = device;
+ locs[PCICF_FUNCTION] = function;
- subdev = config_found_sm_loc(&sc->sc_dev, "pci", ldp, &pa,
+ subdev = config_found_sm_loc(&sc->sc_dev, "pci", locs, &pa,
pciprint, pcisubmatch);
sc->PCI_SC_DEVICESC(device, function) = subdev;
ret = (subdev != NULL);
diff --git a/sys/dev/pci/puc.c b/sys/dev/pci/puc.c
index 87c643bb2a8..630fb066692 100644
--- a/sys/dev/pci/puc.c
+++ b/sys/dev/pci/puc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: puc.c,v 1.24 2005/06/28 00:28:42 thorpej Exp $ */
+/* $NetBSD: puc.c,v 1.25 2005/08/25 18:35:39 drochner Exp $ */
/*
* Copyright (c) 1996, 1998, 1999
@@ -53,7 +53,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: puc.c,v 1.24 2005/06/28 00:28:42 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puc.c,v 1.25 2005/08/25 18:35:39 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -155,8 +155,7 @@ puc_attach(struct device *parent, struct device *self, void *aux)
#ifdef PUCCN
bus_space_handle_t ioh;
#endif
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[PUCCF_NLOCS];
subsys = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_SUBSYS_ID_REG);
sc->sc_desc = puc_find_description(PCI_VENDOR(pa->pa_id),
@@ -301,11 +300,10 @@ puc_attach(struct device *parent, struct device *self, void *aux)
(long)paa.t, (long)paa.h);
#endif
- ldesc->len = 1;
- ldesc->locs[PUCCF_PORT] = i;
+ locs[PUCCF_PORT] = i;
/* and configure it */
- sc->sc_ports[i].dev = config_found_sm_loc(self, "puc", ldesc,
+ sc->sc_ports[i].dev = config_found_sm_loc(self, "puc", locs,
&paa, puc_print, puc_submatch);
}
}
@@ -326,11 +324,11 @@ puc_print(void *aux, const char *pnp)
static int
puc_submatch(struct device *parent, struct cfdata *cf,
- const locdesc_t *ldesc, void *aux)
+ const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[PUCCF_PORT] != PUCCF_PORT_DEFAULT &&
- cf->cf_loc[PUCCF_PORT] != ldesc->locs[PUCCF_PORT])
+ cf->cf_loc[PUCCF_PORT] != locs[PUCCF_PORT])
return 0;
return (config_match(parent, cf, aux));
diff --git a/sys/dev/pci/twe.c b/sys/dev/pci/twe.c
index 14107a15626..55d9111a457 100644
--- a/sys/dev/pci/twe.c
+++ b/sys/dev/pci/twe.c
@@ -1,4 +1,4 @@
-/* $NetBSD: twe.c,v 1.68 2005/06/28 00:28:42 thorpej Exp $ */
+/* $NetBSD: twe.c,v 1.69 2005/08/25 18:35:39 drochner Exp $ */
/*-
* Copyright (c) 2000, 2001, 2002, 2003, 2004 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: twe.c,v 1.68 2005/06/28 00:28:42 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: twe.c,v 1.69 2005/08/25 18:35:39 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -551,8 +551,7 @@ twe_add_unit(struct twe_softc *sc, int unit)
int rv;
uint16_t dsize;
uint8_t newtype, newstripe;
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[TWECF_NLOCS];
if (unit < 0 || unit >= TWE_MAX_UNITS)
return (EINVAL);
@@ -640,10 +639,9 @@ twe_add_unit(struct twe_softc *sc, int unit)
twea.twea_unit = unit;
- ldesc->len = 1;
- ldesc->locs[TWECF_UNIT] = unit;
+ locs[TWECF_UNIT] = unit;
- td->td_dev = config_found_sm_loc(&sc->sc_dv, "twe", NULL, &twea,
+ td->td_dev = config_found_sm_loc(&sc->sc_dv, "twe", locs, &twea,
twe_print, twe_submatch);
rv = 0;
@@ -780,11 +778,11 @@ twe_print(void *aux, const char *pnp)
*/
static int
twe_submatch(struct device *parent, struct cfdata *cf,
- const locdesc_t *ldesc, void *aux)
+ const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[TWECF_UNIT] != TWECF_UNIT_DEFAULT &&
- cf->cf_loc[TWECF_UNIT] != ldesc->locs[TWECF_UNIT])
+ cf->cf_loc[TWECF_UNIT] != locs[TWECF_UNIT])
return (0);
return (config_match(parent, cf, aux));
diff --git a/sys/dev/pckbport/pckbport.c b/sys/dev/pckbport/pckbport.c
index 666a929e705..e2ff5603d87 100644
--- a/sys/dev/pckbport/pckbport.c
+++ b/sys/dev/pckbport/pckbport.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pckbport.c,v 1.4 2004/09/13 12:55:48 drochner Exp $ */
+/* $NetBSD: pckbport.c,v 1.5 2005/08/25 18:35:39 drochner Exp $ */
/*
* Copyright (c) 2004 Ben Harris
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pckbport.c,v 1.4 2004/09/13 12:55:48 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pckbport.c,v 1.5 2005/08/25 18:35:39 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -120,11 +120,11 @@ pckbport_send_devcmd(struct pckbport_tag *t, pckbport_slot_t slot, u_char val)
static int
pckbport_submatch(struct device *parent, struct cfdata *cf,
- const locdesc_t *ldesc, void *aux)
+ const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[PCKBPORTCF_SLOT] != PCKBPORTCF_SLOT_DEFAULT &&
- cf->cf_loc[PCKBPORTCF_SLOT] != ldesc->locs[PCKBPORTCF_SLOT])
+ cf->cf_loc[PCKBPORTCF_SLOT] != locs[PCKBPORTCF_SLOT])
return 0;
return config_match(parent, cf, aux);
}
@@ -152,8 +152,7 @@ pckbport_attach_slot(struct device *dev, pckbport_tag_t t,
void *sdata;
struct device *found;
int alloced = 0;
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[PCKBPORTCF_NLOCS];
pa.pa_tag = t;
pa.pa_slot = slot;
@@ -170,10 +169,9 @@ pckbport_attach_slot(struct device *dev, pckbport_tag_t t,
alloced++;
}
- ldesc->len = 1;
- ldesc->locs[PCKBPORTCF_SLOT] = slot;
+ locs[PCKBPORTCF_SLOT] = slot;
- found = config_found_sm_loc(dev, "pckbport", ldesc, &pa,
+ found = config_found_sm_loc(dev, "pckbport", locs, &pa,
pckbportprint, pckbport_submatch);
if (found == NULL && alloced) {
diff --git a/sys/dev/pcmcia/pcmcia.c b/sys/dev/pcmcia/pcmcia.c
index fc99a4ba4a5..1d655384bd0 100644
--- a/sys/dev/pcmcia/pcmcia.c
+++ b/sys/dev/pcmcia/pcmcia.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pcmcia.c,v 1.74 2005/08/15 18:58:24 christos Exp $ */
+/* $NetBSD: pcmcia.c,v 1.75 2005/08/25 18:35:39 drochner Exp $ */
/*
* Copyright (c) 2004 Charles M. Hannum. All rights reserved.
@@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pcmcia.c,v 1.74 2005/08/15 18:58:24 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcmcia.c,v 1.75 2005/08/25 18:35:39 drochner Exp $");
#include "opt_pcmciaverbose.h"
@@ -214,8 +214,7 @@ pcmcia_rescan(struct device *self, const char *ifattr, const int *locators)
struct pcmcia_softc *sc = (struct pcmcia_softc *)self;
struct pcmcia_function *pf;
struct pcmcia_attach_args paa;
- int help[3];
- locdesc_t *ldesc = (void *)&help; /* XXX */
+ int locs[PCMCIACF_NLOCS];
if (sc->card.error ||
SIMPLEQ_EMPTY(&sc->card.pf_head)) {
@@ -234,16 +233,15 @@ pcmcia_rescan(struct device *self, const char *ifattr, const int *locators)
if (pf->child)
continue;
- ldesc->len = 2;
- ldesc->locs[PCMCIACF_FUNCTION] = pf->number;
- ldesc->locs[PCMCIACF_IRQ] = PCMCIACF_IRQ_DEFAULT;
+ locs[PCMCIACF_FUNCTION] = pf->number;
+ locs[PCMCIACF_IRQ] = PCMCIACF_IRQ_DEFAULT;
paa.manufacturer = sc->card.manufacturer;
paa.product = sc->card.product;
paa.card = &sc->card;
paa.pf = pf;
- pf->child = config_found_sm_loc(self, "pcmcia", ldesc, &paa,
+ pf->child = config_found_sm_loc(self, "pcmcia", locs, &paa,
pcmcia_print, pcmcia_submatch);
}
@@ -332,15 +330,15 @@ pcmcia_card_deactivate(dev)
}
int
-pcmcia_submatch(parent, cf, ldesc, aux)
+pcmcia_submatch(parent, cf, locs, aux)
struct device *parent;
- const locdesc_t *ldesc;
+ const locdesc_t *locs;
struct cfdata *cf;
void *aux;
{
if (cf->cf_loc[PCMCIACF_FUNCTION] != PCMCIACF_FUNCTION_DEFAULT &&
- cf->cf_loc[PCMCIACF_FUNCTION] != ldesc->locs[PCMCIACF_FUNCTION])
+ cf->cf_loc[PCMCIACF_FUNCTION] != locs[PCMCIACF_FUNCTION])
return (0);
return (config_match(parent, cf, aux));
diff --git a/sys/dev/pcmcia/pcmcom.c b/sys/dev/pcmcia/pcmcom.c
index d5916b8fe25..7952152d715 100644
--- a/sys/dev/pcmcia/pcmcom.c
+++ b/sys/dev/pcmcia/pcmcom.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pcmcom.c,v 1.22 2005/02/27 00:27:43 perry Exp $ */
+/* $NetBSD: pcmcom.c,v 1.23 2005/08/25 18:35:39 drochner Exp $ */
/*-
* Copyright (c) 1998, 2000, 2004 The NetBSD Foundation, Inc.
@@ -51,7 +51,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pcmcom.c,v 1.22 2005/02/27 00:27:43 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcmcom.c,v 1.23 2005/08/25 18:35:39 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -154,8 +154,7 @@ pcmcom_attach(parent, self, aux)
struct pcmcia_config_entry *cfe;
int slave;
int error;
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[PCMCOMCF_NLOCS];
sc->sc_pf = pa->pf;
@@ -183,11 +182,10 @@ pcmcom_attach(parent, self, aux)
pca.pca_ioh = cfe->iospace[slave].handle.ioh;
pca.pca_slave = slave;
- ldesc->len = 1;
- ldesc->locs[PCMCOMCF_SLAVE] = slave;
+ locs[PCMCOMCF_SLAVE] = slave;
sc->sc_slaves[slave] = config_found_sm_loc(&sc->sc_dev,
- "pcmcom", ldesc,
+ "pcmcom", locs,
&pca, pcmcom_print, pcmcom_submatch);
}
@@ -275,15 +273,15 @@ pcmcom_print(aux, pnp)
}
int
-pcmcom_submatch(parent, cf, ldesc, aux)
+pcmcom_submatch(parent, cf, locs, aux)
struct device *parent;
struct cfdata *cf;
- const locdesc_t *ldesc;
+ const locdesc_t *locs;
void *aux;
{
if (cf->cf_loc[PCMCOMCF_SLAVE] != PCMCOMCF_SLAVE_DEFAULT &&
- cf->cf_loc[PCMCOMCF_SLAVE] != ldesc->locs[PCMCOMCF_SLAVE]);
+ cf->cf_loc[PCMCOMCF_SLAVE] != locs[PCMCOMCF_SLAVE]);
return (0);
return (config_match(parent, cf, aux));
diff --git a/sys/dev/scsipi/scsiconf.c b/sys/dev/scsipi/scsiconf.c
index 25c7f582c1d..e5e625a5cc8 100644
--- a/sys/dev/scsipi/scsiconf.c
+++ b/sys/dev/scsipi/scsiconf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: scsiconf.c,v 1.230 2005/05/30 04:25:32 christos Exp $ */
+/* $NetBSD: scsiconf.c,v 1.231 2005/08/25 18:35:40 drochner Exp $ */
/*-
* Copyright (c) 1998, 1999, 2004 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.230 2005/05/30 04:25:32 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.231 2005/08/25 18:35:40 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -244,14 +244,14 @@ scsibus_config(struct scsipi_channel *chan, void *arg)
static int
scsibussubmatch(struct device *parent, struct cfdata *cf,
- const locdesc_t *ldesc, void *aux)
+ const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[SCSIBUSCF_TARGET] != SCSIBUSCF_TARGET_DEFAULT &&
- cf->cf_loc[SCSIBUSCF_TARGET] != ldesc->locs[0])
+ cf->cf_loc[SCSIBUSCF_TARGET] != locs[SCSIBUSCF_TARGET])
return (0);
if (cf->cf_loc[SCSIBUSCF_LUN] != SCSIBUSCF_LUN_DEFAULT &&
- cf->cf_loc[SCSIBUSCF_LUN] != ldesc->locs[1])
+ cf->cf_loc[SCSIBUSCF_LUN] != locs[SCSIBUSCF_LUN])
return (0);
return (config_match(parent, cf, aux));
}
@@ -739,8 +739,7 @@ scsi_probe_device(struct scsibus_softc *sc, int target, int lun)
int checkdtype, priority, docontinue, quirks;
struct scsipibus_attach_args sa;
struct cfdata *cf;
- int help[3];
- locdesc_t *locd = (void *)&help;
+ int locs[SCSIBUSCF_NLOCS];
struct device *chld;
/*
@@ -954,19 +953,18 @@ scsi_probe_device(struct scsibus_softc *sc, int target, int lun)
if ((periph->periph_quirks & PQUIRK_NOLUNS) == 0)
docontinue = 1;
- locd->len = 2;
- locd->locs[0] = target;
- locd->locs[1] = lun;
+ locs[SCSIBUSCF_TARGET] = target;
+ locs[SCSIBUSCF_LUN] = lun;
if ((cf = config_search_loc(scsibussubmatch, &sc->sc_dev,
- "scsibus", locd, &sa)) != NULL) {
+ "scsibus", locs, &sa)) != NULL) {
scsipi_insert_periph(chan, periph);
/*
* XXX Can't assign periph_dev here, because we'll
* XXX need it before config_attach() returns. Must
* XXX assign it in periph driver.
*/
- chld = config_attach_loc(&sc->sc_dev, cf, locd, &sa,
+ chld = config_attach_loc(&sc->sc_dev, cf, locs, &sa,
scsibusprint);
} else {
scsibusprint(&sa, sc->sc_dev.dv_xname);
diff --git a/sys/dev/tc/ioasic_subr.c b/sys/dev/tc/ioasic_subr.c
index 2f8b146f483..1d4b2d9bd90 100644
--- a/sys/dev/tc/ioasic_subr.c
+++ b/sys/dev/tc/ioasic_subr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ioasic_subr.c,v 1.8 2005/02/27 00:27:49 perry Exp $ */
+/* $NetBSD: ioasic_subr.c,v 1.9 2005/08/25 18:35:40 drochner Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -29,7 +29,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ioasic_subr.c,v 1.8 2005/02/27 00:27:49 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ioasic_subr.c,v 1.9 2005/08/25 18:35:40 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -58,11 +58,11 @@ ioasicprint(aux, pnp)
int
ioasicsubmatch(struct device *parent, struct cfdata *cf,
- const locdesc_t *ldesc, void *aux)
+ const locdesc_t *locs, void *aux)
{
if ((cf->cf_loc[IOASICCF_OFFSET] != IOASICCF_OFFSET_DEFAULT) &&
- (cf->cf_loc[IOASICCF_OFFSET] != ldesc->locs[IOASICCF_OFFSET]))
+ (cf->cf_loc[IOASICCF_OFFSET] != locs[IOASICCF_OFFSET]))
return (0);
return (config_match(parent, cf, aux));
@@ -76,8 +76,7 @@ ioasic_attach_devs(sc, ioasic_devs, ioasic_ndevs)
{
struct ioasicdev_attach_args idev;
int i;
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[IOASICCF_NLOCS];
/*
* Try to configure each device.
@@ -90,9 +89,8 @@ ioasic_attach_devs(sc, ioasic_devs, ioasic_ndevs)
idev.iada_cookie = ioasic_devs[i].iad_cookie;
/* Tell the autoconfig machinery we've found the hardware. */
- ldesc->len = 1;
- ldesc->locs[IOASICCF_OFFSET] = ioasic_devs[i].iad_offset;
- config_found_sm_loc(&sc->sc_dv, "ioasic", ldesc, &idev,
+ locs[IOASICCF_OFFSET] = ioasic_devs[i].iad_offset;
+ config_found_sm_loc(&sc->sc_dv, "ioasic", locs, &idev,
ioasicprint, ioasicsubmatch);
}
}
diff --git a/sys/dev/tc/tc.c b/sys/dev/tc/tc.c
index 56567cf5b6d..c29572a356d 100644
--- a/sys/dev/tc/tc.c
+++ b/sys/dev/tc/tc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tc.c,v 1.40 2005/02/04 02:10:48 perry Exp $ */
+/* $NetBSD: tc.c,v 1.41 2005/08/25 18:35:40 drochner Exp $ */
/*
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tc.c,v 1.40 2005/02/04 02:10:48 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tc.c,v 1.41 2005/08/25 18:35:40 drochner Exp $");
#include "opt_tcverbose.h"
@@ -82,8 +82,7 @@ tcattach(parent, self, aux)
struct tc_slotdesc *slot;
tc_addr_t tcaddr;
int i;
- int help[3];
- locdesc_t *ldesc = (void *)&help; /* XXX */
+ int locs[TCCF_NLOCS];
printf(": %s MHz clock\n",
tba->tba_speed == TC_SPEED_25_MHZ ? "25" : "12.5");
@@ -136,13 +135,12 @@ tcattach(parent, self, aux)
*/
sc->sc_slots[builtin->tcb_slot].tcs_used = 1;
- ldesc->len = 2;
- ldesc->locs[TCCF_SLOT] = builtin->tcb_slot;
- ldesc->locs[TCCF_OFFSET] = builtin->tcb_offset;
+ locs[TCCF_SLOT] = builtin->tcb_slot;
+ locs[TCCF_OFFSET] = builtin->tcb_offset;
/*
* Attach the device.
*/
- config_found_sm_loc(self, "tc", ldesc, &ta,
+ config_found_sm_loc(self, "tc", locs, &ta,
tcprint, tcsubmatch);
}
@@ -180,13 +178,12 @@ tcattach(parent, self, aux)
*/
slot->tcs_used = 1;
- ldesc->len = 2;
- ldesc->locs[TCCF_SLOT] = i;
- ldesc->locs[TCCF_OFFSET] = 0;
+ locs[TCCF_SLOT] = i;
+ locs[TCCF_OFFSET] = 0;
/*
* Attach the device.
*/
- config_found_sm_loc(self, "tc", ldesc, &ta,
+ config_found_sm_loc(self, "tc", locs, &ta,
tcprint, tcsubmatch);
}
}
@@ -208,18 +205,18 @@ tcprint(aux, pnp)
}
int
-tcsubmatch(parent, cf, ldesc, aux)
+tcsubmatch(parent, cf, locs, aux)
struct device *parent;
struct cfdata *cf;
- const locdesc_t *ldesc;
+ const locdesc_t *locs;
void *aux;
{
if ((cf->cf_loc[TCCF_SLOT] != TCCF_SLOT_DEFAULT) &&
- (cf->cf_loc[TCCF_SLOT] != ldesc->locs[TCCF_SLOT]))
+ (cf->cf_loc[TCCF_SLOT] != locs[TCCF_SLOT]))
return 0;
if ((cf->cf_loc[TCCF_OFFSET] != TCCF_OFFSET_DEFAULT) &&
- (cf->cf_loc[TCCF_OFFSET] != ldesc->locs[TCCF_OFFSET]))
+ (cf->cf_loc[TCCF_OFFSET] != locs[TCCF_OFFSET]))
return 0;
return (config_match(parent, cf, aux));
diff --git a/sys/dev/tc/tcds.c b/sys/dev/tc/tcds.c
index edb1dadd555..04caf2e434f 100644
--- a/sys/dev/tc/tcds.c
+++ b/sys/dev/tc/tcds.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tcds.c,v 1.14 2005/02/27 00:27:49 perry Exp $ */
+/* $NetBSD: tcds.c,v 1.15 2005/08/25 18:35:40 drochner Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcds.c,v 1.14 2005/02/27 00:27:49 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcds.c,v 1.15 2005/08/25 18:35:40 drochner Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -171,8 +171,7 @@ tcdsattach(parent, self, aux)
bus_space_handle_t sbsh[2];
int i, gpi2;
const struct evcnt *pevcnt;
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[TCDSCF_NLOCS];
td = tcds_lookup(ta->ta_modname);
if (td == NULL)
@@ -308,10 +307,9 @@ tcdsattach(parent, self, aux)
tcds_scsi_reset(tcdsdev.tcdsda_sc);
- ldesc->len = 1;
- ldesc->locs[TCDSCF_CHIP] = i;
+ locs[TCDSCF_CHIP] = i;
- config_found_sm_loc(self, "tcds", ldesc, &tcdsdev,
+ config_found_sm_loc(self, "tcds", locs, &tcdsdev,
tcdsprint, tcdssubmatch);
#ifdef __alpha__
/*
@@ -326,15 +324,15 @@ tcdsattach(parent, self, aux)
}
int
-tcdssubmatch(parent, cf, ldesc, aux)
+tcdssubmatch(parent, cf, locs, aux)
struct device *parent;
struct cfdata *cf;
- const locdesc_t *ldesc;
+ const locdesc_t *locs;
void *aux;
{
if (cf->cf_loc[TCDSCF_CHIP] != TCDSCF_CHIP_DEFAULT &&
- cf->cf_loc[TCDSCF_CHIP] != ldesc->locs[TCDSCF_CHIP])
+ cf->cf_loc[TCDSCF_CHIP] != locs[TCDSCF_CHIP])
return (0);
return (config_match(parent, cf, aux));
diff --git a/sys/dev/tc/zs_ioasic.c b/sys/dev/tc/zs_ioasic.c
index d2094902c4d..086cad8bac3 100644
--- a/sys/dev/tc/zs_ioasic.c
+++ b/sys/dev/tc/zs_ioasic.c
@@ -1,4 +1,4 @@
-/* $NetBSD: zs_ioasic.c,v 1.26 2005/06/02 13:11:39 drochner Exp $ */
+/* $NetBSD: zs_ioasic.c,v 1.27 2005/08/25 18:35:40 drochner Exp $ */
/*-
* Copyright (c) 1996, 1998 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: zs_ioasic.c,v 1.26 2005/06/02 13:11:39 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs_ioasic.c,v 1.27 2005/08/25 18:35:40 drochner Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -249,8 +249,7 @@ zs_ioasic_attach(parent, self, aux)
struct zshan *zc;
int s, channel;
u_long zflg;
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[ZSCCF_NLOCS];
printf("\n");
@@ -319,14 +318,13 @@ zs_ioasic_attach(parent, self, aux)
else
cs->cs_ctl_chan = NULL;
- ldesc->len = 1;
- ldesc->locs[ZSCCF_CHANNEL] = channel;
+ locs[ZSCCF_CHANNEL] = channel;
/*
* Look for a child driver for this channel.
* The child attach will setup the hardware.
*/
- if (config_found_sm_loc(self, "zsc", ldesc, (void *)&zs_args,
+ if (config_found_sm_loc(self, "zsc", locs, (void *)&zs_args,
zs_ioasic_print, zs_ioasic_submatch) == NULL) {
/* No sub-driver. Just reset it. */
u_char reset = (channel == 0) ?
@@ -386,10 +384,10 @@ zs_ioasic_print(aux, name)
}
int
-zs_ioasic_submatch(parent, cf, ldesc, aux)
+zs_ioasic_submatch(parent, cf, locs, aux)
struct device *parent;
struct cfdata *cf;
- const locdesc_t *ldesc;
+ const locdesc_t *locs;
void *aux;
{
struct zsc_softc *zs = (void *)parent;
@@ -397,7 +395,7 @@ zs_ioasic_submatch(parent, cf, ldesc, aux)
const char *defname = "";
if (cf->cf_loc[ZSCCF_CHANNEL] != ZSCCF_CHANNEL_DEFAULT &&
- cf->cf_loc[ZSCCF_CHANNEL] != ldesc->locs[ZSCCF_CHANNEL])
+ cf->cf_loc[ZSCCF_CHANNEL] != locs[ZSCCF_CHANNEL])
return (0);
if (cf->cf_loc[ZSCCF_CHANNEL] == ZSCCF_CHANNEL_DEFAULT) {
diff --git a/sys/dev/usb/uhidev.c b/sys/dev/usb/uhidev.c
index 8f276eb2d1e..2cf42b523b4 100644
--- a/sys/dev/usb/uhidev.c
+++ b/sys/dev/usb/uhidev.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uhidev.c,v 1.27 2005/06/19 10:29:47 augustss Exp $ */
+/* $NetBSD: uhidev.c,v 1.28 2005/08/25 18:35:40 drochner Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhidev.c,v 1.27 2005/06/19 10:29:47 augustss Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhidev.c,v 1.28 2005/08/25 18:35:40 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -117,8 +117,7 @@ USB_ATTACH(uhidev)
const void *descptr;
usbd_status err;
char *devinfop;
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[UHIDBUSCF_NLOCS];
sc->sc_udev = uaa->device;
sc->sc_iface = iface;
@@ -286,11 +285,10 @@ USB_ATTACH(uhidev)
; /* already NULL in sc->sc_subdevs[repid] */
} else {
uha.reportid = repid;
- ldesc->len = 1;
- ldesc->locs[UHIDBUSCF_REPORTID] = repid;
+ locs[UHIDBUSCF_REPORTID] = repid;
dev = (struct uhidev *)config_found_sm_loc(self,
- "uhidbus", ldesc, &uha,
+ "uhidbus", locs, &uha,
uhidevprint, uhidevsubmatch);
sc->sc_subdevs[repid] = dev;
if (dev != NULL) {
@@ -346,15 +344,15 @@ uhidevprint(void *aux, const char *pnp)
int
uhidevsubmatch(struct device *parent, struct cfdata *cf,
- const locdesc_t *ldesc, void *aux)
+ const locdesc_t *locs, void *aux)
{
struct uhidev_attach_arg *uha = aux;
if (cf->cf_loc[UHIDBUSCF_REPORTID] != UHIDBUSCF_REPORTID_DEFAULT &&
- cf->cf_loc[UHIDBUSCF_REPORTID] != ldesc->locs[UHIDBUSCF_REPORTID])
+ cf->cf_loc[UHIDBUSCF_REPORTID] != locs[UHIDBUSCF_REPORTID])
return (0);
- if (cf->cf_loc[UHIDBUSCF_REPORTID] == ldesc->locs[UHIDBUSCF_REPORTID])
+ if (cf->cf_loc[UHIDBUSCF_REPORTID] == locs[UHIDBUSCF_REPORTID])
uha->matchlvl = UMATCH_VENDOR_PRODUCT;
else
uha->matchlvl = 0;
diff --git a/sys/kern/subr_autoconf.c b/sys/kern/subr_autoconf.c
index 8fb87268f0d..c11e96dfb12 100644
--- a/sys/kern/subr_autoconf.c
+++ b/sys/kern/subr_autoconf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_autoconf.c,v 1.96 2005/08/25 15:06:28 drochner Exp $ */
+/* $NetBSD: subr_autoconf.c,v 1.97 2005/08/25 18:35:40 drochner Exp $ */
/*
* Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.96 2005/08/25 15:06:28 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.97 2005/08/25 18:35:40 drochner Exp $");
#include "opt_ddb.h"
@@ -855,7 +855,7 @@ config_makeroom(int n, struct cfdriver *cd)
*/
struct device *
config_attach_loc(struct device *parent, struct cfdata *cf,
- const locdesc_t *ldesc, void *aux, cfprint_t print)
+ const locdesc_t *locs, void *aux, cfprint_t print)
{
struct device *dev;
struct cftable *ct;
@@ -923,15 +923,13 @@ config_attach_loc(struct device *parent, struct cfdata *cf,
memcpy(dev->dv_xname + lname, xunit, lunit);
dev->dv_parent = parent;
dev->dv_flags = DVF_ACTIVE; /* always initially active */
- if (ldesc) {
+ if (locs) {
KASSERT(parent); /* no locators at root */
ia = cfiattr_lookup(cf->cf_pspec->cfp_iattr,
parent->dv_cfdriver);
- KASSERT(ldesc->len == ia->ci_loclen); /* XXX will go away */
dev->dv_locators = malloc(ia->ci_loclen * sizeof(int),
M_DEVBUF, cold ? M_NOWAIT : M_WAITOK);
- memcpy(dev->dv_locators, ldesc->locs,
- ia->ci_loclen * sizeof(int));
+ memcpy(dev->dv_locators, locs, ia->ci_loclen * sizeof(int));
}
if (config_do_twiddle)
diff --git a/sys/sys/device.h b/sys/sys/device.h
index be10fa72f03..d9a399cd41a 100644
--- a/sys/sys/device.h
+++ b/sys/sys/device.h
@@ -1,4 +1,4 @@
-/* $NetBSD: device.h,v 1.76 2005/08/25 15:06:28 drochner Exp $ */
+/* $NetBSD: device.h,v 1.77 2005/08/25 18:35:40 drochner Exp $ */
/*
* Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -232,14 +232,9 @@ struct cftable {
TAILQ_HEAD(cftablelist, cftable);
/*
- * XXX the "locdesc_t" is unnecessary; the len is known to "config" and
- * available through cfdata->cf_pspec->cfp_iattr.
- * So just an "int *" should do it.
+ * XXX the "locdesc_t" is unnecessary
*/
-typedef struct {
- int len;
- int locs[1];
-} locdesc_t;
+typedef int locdesc_t;
typedef int (*cfsubmatch_t)(struct device *, struct cfdata *,
const locdesc_t *, void *);