Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use

config_search instead.
This commit is contained in:
ragge 1998-01-24 14:16:11 +00:00
parent d664bf39b8
commit eda1eecede
25 changed files with 200 additions and 191 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: bi.c,v 1.5 1998/01/12 20:52:29 thorpej Exp $ */
/* $NetBSD: bi.c,v 1.6 1998/01/24 14:17:09 ragge Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -50,7 +50,7 @@
#include <arch/vax/bi/bireg.h>
#include <arch/vax/bi/bivar.h>
static int bi_match __P((struct device *, void *, void *));
static int bi_match __P((struct device *, struct cfdata *, void *));
static void bi_attach __P((struct device *, struct device *, void*));
static int bi_print __P((void *, const char *));
@ -103,7 +103,8 @@ bi_print(aux, name)
int
bi_match(parent, match, aux)
struct device *parent;
void *match, *aux;
struct cfdata *match;
void *aux;
{
struct bp_conf *bp = aux;

View File

@ -1,4 +1,4 @@
/* $NetBSD: kdb.c,v 1.10 1998/01/18 22:09:16 ragge Exp $ */
/* $NetBSD: kdb.c,v 1.11 1998/01/24 14:17:07 ragge Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -79,7 +79,7 @@ struct kdb_softc {
struct mscp *sc_mscp; /* Keep pointer to active mscp */
};
int kdbmatch __P((struct device *, void *, void *));
int kdbmatch __P((struct device *, struct cfdata *, void *));
void kdbattach __P((struct device *, struct device *, void *));
void kdbreset __P((int));
void kdbintr __P((int));
@ -117,11 +117,11 @@ kdbprint(aux, name)
* Poke at a supposed KDB to see if it is there.
*/
int
kdbmatch(parent, match, aux)
kdbmatch(parent, cf, aux)
struct device *parent;
void *match, *aux;
struct cfdata *cf;
void *aux;
{
struct cfdata *cf = match;
struct bi_attach_args *ba = aux;
if (ba->ba_node->biic.bi_dtype != BIDT_KDB50)

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_de.c,v 1.28 1998/01/12 20:52:33 thorpej Exp $ */
/* $NetBSD: if_de.c,v 1.29 1998/01/24 14:17:04 ragge Exp $ */
/*
* Copyright (c) 1982, 1986, 1989 Regents of the University of California.
@ -139,7 +139,7 @@ struct de_softc {
int ds_nxmit; /* # of transmits in progress */
};
int dematch __P((struct device *, void *, void *));
int dematch __P((struct device *, struct cfdata *, void *));
void deattach __P((struct device *, struct device *, void *));
int dewait __P((struct de_softc *, char *));
void deinit __P((struct de_softc *));
@ -691,9 +691,10 @@ dewait(ds, fn)
}
int
dematch(parent, match, aux)
struct device *parent;
void *match, *aux;
dematch(parent, cf, aux)
struct device *parent;
struct cfdata *cf;
void *aux;
{
struct uba_attach_args *ua = aux;
volatile struct dedevice *addr = (struct dedevice *)ua->ua_addr;

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_le.c,v 1.9 1998/01/12 20:52:34 thorpej Exp $ */
/* $NetBSD: if_le.c,v 1.10 1998/01/24 14:17:02 ragge Exp $ */
/* #define LE_CHIP_IS_POKEY /* does VS2000 need this ??? */
@ -97,7 +97,7 @@ extern u_long le_ioaddr; /* le_iomem is virt, le_ioaddr is phys */
#define LE_SOFTC(unit) le_cd.cd_devs[unit]
#define LE_DELAY(x) DELAY(x)
int lematch __P((struct device *, void *, void *));
int lematch __P((struct device *, struct cfdata *, void *));
void leattach __P((struct device *, struct device *, void *));
int leintr __P((void *sc));
@ -152,11 +152,11 @@ lehwinit(sc)
}
int
lematch(parent, match, aux)
lematch(parent, cf, aux)
struct device *parent;
void *match, *aux;
struct cfdata *cf;
void *aux;
{
struct cfdata *cf = match;
struct confargs *ca = aux;
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_qe.c,v 1.23 1998/01/12 20:52:36 thorpej Exp $ */
/* $NetBSD: if_qe.c,v 1.24 1998/01/24 14:17:00 ragge Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
@ -244,7 +244,7 @@ struct qe_softc {
int qe_restarts; /* timeouts */
};
int qematch __P((struct device *, void *, void *));
int qematch __P((struct device *, struct cfdata *, void *));
void qeattach __P((struct device *, struct device *, void *));
void qereset __P((int));
void qeinit __P((struct qe_softc *));
@ -279,11 +279,12 @@ extern struct cfdriver qe_cd;
* Probe the QNA to see if it's there
*/
int
qematch(parent, match, aux)
qematch(parent, cf, aux)
struct device *parent;
void *match, *aux;
struct cfdata *cf;
void *aux;
{
struct qe_softc *sc = match;
struct qe_softc sc;
struct uba_attach_args *ua = aux;
struct uba_softc *ubasc = (struct uba_softc *)parent;
struct qe_ring *rp;
@ -300,14 +301,15 @@ qematch(parent, match, aux)
addr->qe_csr &= ~QE_RESET;
addr->qe_vector = (ubasc->uh_lastiv -= 4);
bzero(&sc, sizeof(struct qe_softc));
/*
* Map the communications area and the setup packet.
*/
sc->setupaddr =
uballoc(ubasc, (caddr_t)sc->setup_pkt, sizeof(sc->setup_pkt), 0);
sc->rringaddr = (struct qe_ring *) uballoc(ubasc, (caddr_t)sc->rring,
sc.setupaddr =
uballoc(ubasc, (caddr_t)sc.setup_pkt, sizeof(sc.setup_pkt), 0);
sc.rringaddr = (struct qe_ring *) uballoc(ubasc, (caddr_t)sc.rring,
sizeof(struct qe_ring) * (NTOT+2), 0);
prp = (struct qe_ring *)UBAI_ADDR((int)sc->rringaddr);
prp = (struct qe_ring *)UBAI_ADDR((int)sc.rringaddr);
/*
* The QNA will loop the setup packet back to the receive ring
@ -315,18 +317,18 @@ qematch(parent, match, aux)
* receive & transmit ring descriptors and link the setup packet
* to them.
*/
qeinitdesc(sc->tring, (caddr_t)UBAI_ADDR(sc->setupaddr),
sizeof(sc->setup_pkt));
qeinitdesc(sc->rring, (caddr_t)UBAI_ADDR(sc->setupaddr),
sizeof(sc->setup_pkt));
qeinitdesc(sc.tring, (caddr_t)UBAI_ADDR(sc.setupaddr),
sizeof(sc.setup_pkt));
qeinitdesc(sc.rring, (caddr_t)UBAI_ADDR(sc.setupaddr),
sizeof(sc.setup_pkt));
rp = (struct qe_ring *)sc->tring;
rp = (struct qe_ring *)sc.tring;
rp->qe_setup = 1;
rp->qe_eomsg = 1;
rp->qe_flag = rp->qe_status1 = QE_NOTYET;
rp->qe_valid = 1;
rp = (struct qe_ring *)sc->rring;
rp = (struct qe_ring *)sc.rring;
rp->qe_flag = rp->qe_status1 = QE_NOTYET;
rp->qe_valid = 1;
@ -336,9 +338,9 @@ qematch(parent, match, aux)
* is placed in the setup packet in col. major order.
*/
for (i = 0; i < 6; i++)
sc->setup_pkt[i][1] = addr->qe_sta_addr[i];
sc.setup_pkt[i][1] = addr->qe_sta_addr[i];
qesetup(sc);
qesetup(&sc);
/*
* Start the interface and wait for the packet.
*/
@ -352,9 +354,8 @@ qematch(parent, match, aux)
/*
* All done with the bus resources.
*/
ubarelse(ubasc, &sc->setupaddr);
ubarelse(ubasc, (int *)&sc->rringaddr);
sc->ipl = 0x15;
ubarelse(ubasc, &sc.setupaddr);
ubarelse(ubasc, (int *)&sc.rringaddr);
ua->ua_ivec = qeintr;
return 1;
}
@ -377,6 +378,7 @@ qeattach(parent, self, aux)
u_int8_t myaddr[ETHER_ADDR_LEN];
printf("\n");
sc->ipl = 0x15;
sc->qe_vaddr = addr;
bcopy(sc->qe_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
ifp->if_softc = sc;

View File

@ -1,4 +1,4 @@
/* $NetBSD: types.h,v 1.11 1997/11/05 04:36:36 thorpej Exp $ */
/* $NetBSD: types.h,v 1.12 1998/01/24 14:16:57 ragge Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -72,6 +72,4 @@ typedef unsigned long long u_int64_t;
typedef int32_t register_t;
#define __BROKEN_INDIRECT_CONFIG
#endif /* _MACHTYPES_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: hp.c,v 1.17 1998/01/12 20:52:37 thorpej Exp $ */
/* $NetBSD: hp.c,v 1.18 1998/01/24 14:16:54 ragge Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -75,7 +75,7 @@ struct hp_softc {
int sc_physnr; /* Physical disk number */
};
int hpmatch __P((struct device *, void *, void *));
int hpmatch __P((struct device *, struct cfdata *, void *));
void hpattach __P((struct device *, struct device *, void *));
void hpstrategy __P((struct buf *));
void hpstart __P((struct mba_device *));
@ -99,11 +99,11 @@ extern struct cfdriver hp_cd;
* Check if this is a disk drive; done by checking type from mbaattach.
*/
int
hpmatch(parent, match, aux)
hpmatch(parent, cf, aux)
struct device *parent;
void *match, *aux;
struct cfdata *cf;
void *aux;
{
struct cfdata *cf = match;
struct mba_attach_args *ma = aux;
if (cf->cf_loc[MBACF_DRIVE] != MBACF_DRIVE_DEFAULT &&

View File

@ -1,4 +1,4 @@
/* $NetBSD: mba.c,v 1.12 1998/01/18 22:09:15 ragge Exp $ */
/* $NetBSD: mba.c,v 1.13 1998/01/24 14:16:50 ragge Exp $ */
/*
* Copyright (c) 1994, 1996 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -69,7 +69,7 @@ struct mbaunit mbaunit[] = {
{0, 0, 0}
};
int mbamatch __P((struct device *, void *, void *));
int mbamatch __P((struct device *, struct cfdata *, void *));
void mbaattach __P((struct device *, struct device *, void *));
void mbaintr __P((int));
int mbaprint __P((void *, const char *));
@ -91,12 +91,12 @@ extern struct cfdriver mba_cd;
* Look if this is a massbuss adapter.
*/
int
mbamatch(parent, match, aux)
mbamatch(parent, cf, aux)
struct device *parent;
void *match, *aux;
struct cfdata *cf;
void *aux;
{
struct sbi_attach_args *sa = (struct sbi_attach_args *)aux;
struct cfdata *cf = match;
if ((cf->cf_loc[0] != sa->nexnum) && (cf->cf_loc[0] > -1 ))
return 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mscp_disk.c,v 1.15 1998/01/12 20:52:41 thorpej Exp $ */
/* $NetBSD: mscp_disk.c,v 1.16 1998/01/24 14:16:47 ragge Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
* Copyright (c) 1988 Regents of the University of California.
@ -84,7 +84,7 @@ struct ra_softc {
int ra_isafloppy; /* unit is a floppy disk */
};
int ramatch __P((struct device *, void *, void *));
int ramatch __P((struct device *, struct cfdata *, void *));
void raattach __P((struct device *, struct device *, void *));
void radgram __P((struct device *, struct mscp *, struct mscp_softc *));
void raiodone __P((struct device *, struct buf *));
@ -145,11 +145,11 @@ extern struct cfdriver ra_cd;
extern int cold;
int
ramatch(parent, match, aux)
ramatch(parent, cf, aux)
struct device *parent;
void *match, *aux;
struct cfdata *cf;
void *aux;
{
struct cfdata *cf = match;
struct drive_attach_args *da = aux;
struct mscp *mp = da->da_mp;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mscp_subr.c,v 1.7 1998/01/12 20:52:43 thorpej Exp $ */
/* $NetBSD: mscp_subr.c,v 1.8 1998/01/24 14:16:45 ragge Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
* Copyright (c) 1988 Regents of the University of California.
@ -59,7 +59,7 @@
#define b_forw b_hash.le_next
int mscp_match __P((struct device *, void *, void *));
int mscp_match __P((struct device *, struct cfdata *, void *));
void mscp_attach __P((struct device *, struct device *, void *));
void mscp_start __P((struct mscp_softc *));
int mscp_init __P((struct mscp_softc *));
@ -103,7 +103,8 @@ mscp_waitstep(mi, mask, result)
int
mscp_match(parent, match, aux)
struct device *parent;
void *match, *aux;
struct cfdata *match;
void *aux;
{
struct mscp_attach_args *ma = aux;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mscp_tape.c,v 1.7 1998/01/12 20:52:44 thorpej Exp $ */
/* $NetBSD: mscp_tape.c,v 1.8 1998/01/24 14:16:42 ragge Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -72,7 +72,7 @@ struct mt_softc {
#define MT_OFFLINE 0
#define MT_ONLINE 1
int mtmatch __P((struct device *, void *, void *));
int mtmatch __P((struct device *, struct cfdata *, void *));
void mtattach __P((struct device *, struct device *, void *));
void mtdgram __P((struct device *, struct mscp *, struct mscp_softc *));
void mtiodone __P((struct device *, struct buf *));
@ -118,11 +118,11 @@ extern struct cfdriver mt_cd;
*/
int
mtmatch(parent, match, aux)
mtmatch(parent, cf, aux)
struct device *parent;
void *match, *aux;
struct cfdata *cf;
void *aux;
{
struct cfdata *cf = match;
struct drive_attach_args *da = aux;
struct mscp *mp = da->da_mp;

View File

@ -1,4 +1,4 @@
/* $NetBSD: dhu.c,v 1.10 1998/01/12 20:52:45 thorpej Exp $ */
/* $NetBSD: dhu.c,v 1.11 1998/01/24 14:16:39 ragge Exp $ */
/*
* Copyright (c) 1996 Ken C. Wellsch. All rights reserved.
* Copyright (c) 1992, 1993
@ -119,7 +119,7 @@ static struct speedtab dhuspeedtab[] = {
{ -1, -1 }
};
static int dhu_match __P((struct device *, void *, void *));
static int dhu_match __P((struct device *, struct cfdata *, void *));
static void dhu_attach __P((struct device *, struct device *, void *));
static void dhurint __P((int));
static void dhuxint __P((int));
@ -145,9 +145,10 @@ extern struct cfdriver dhu_cd;
/* then complete the housecleaning for full operation */
static int
dhu_match(parent, match, aux)
dhu_match(parent, cf, aux)
struct device *parent;
void *match, *aux;
struct cfdata *cf;
void *aux;
{
struct uba_attach_args *ua = aux;
register dhuregs *dhuaddr;

View File

@ -1,4 +1,4 @@
/* $NetBSD: dl.c,v 1.3 1998/01/12 20:52:46 thorpej Exp $ */
/* $NetBSD: dl.c,v 1.4 1998/01/24 14:16:37 ragge Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -111,7 +111,7 @@ struct dl_softc {
struct tty* sc_tty;
};
static int dl_match __P((struct device *, void *, void *));
static int dl_match __P((struct device *, struct cfdata *, void *));
static void dl_attach __P((struct device *, struct device *, void *));
static void dlrint __P((int));
static void dlxint __P((int));
@ -136,9 +136,10 @@ extern struct cfdriver dl_cd;
/* then complete the housecleaning for full operation */
static int
dl_match (parent, match, aux)
dl_match (parent, cf, aux)
struct device * parent;
void *match, *aux;
struct cfdata *cf;
void *aux;
{
struct uba_attach_args *ua = aux;
register dlregs *dladdr;

View File

@ -1,4 +1,4 @@
/* $NetBSD: dz.c,v 1.5 1998/01/12 20:52:47 thorpej Exp $ */
/* $NetBSD: dz.c,v 1.6 1998/01/24 14:16:35 ragge Exp $ */
/*
* Copyright (c) 1996 Ken C. Wellsch. All rights reserved.
* Copyright (c) 1992, 1993
@ -107,7 +107,7 @@ static struct speedtab dzspeedtab[] =
{ -1, -1 }
};
static int dz_match __P((struct device *, void *, void *));
static int dz_match __P((struct device *, struct cfdata *, void *));
static void dz_attach __P((struct device *, struct device *, void *));
static void dzrint __P((int));
static void dzxint __P((int));
@ -142,9 +142,10 @@ static int dz_timer = 0; /* true if timer started */
/* then complete the housecleaning for full operation */
static int
dz_match (parent, match, aux)
dz_match (parent, cf, aux)
struct device *parent;
void *match, *aux;
struct cfdata *cf;
void *aux;
{
struct uba_attach_args *ua = aux;
register dzregs *dzaddr;

View File

@ -1,4 +1,4 @@
/* $NetBSD: uba.c,v 1.31 1998/01/18 22:09:14 ragge Exp $ */
/* $NetBSD: uba.c,v 1.32 1998/01/24 14:16:33 ragge Exp $ */
/*
* Copyright (c) 1996 Jonathan Stone.
* Copyright (c) 1994, 1996 Ludd, University of Lule}, Sweden.
@ -68,7 +68,7 @@
volatile int rbr, rcvec, svec;
static void ubascan __P((struct device *, void *));
static int ubasearch __P((struct device *, struct cfdata *, void *));
static int ubaprint __P((void *, const char *));
static void ubastray __P((int));
static void ubainitmaps __P((struct uba_softc *));
@ -81,15 +81,15 @@ extern struct cfdriver uba_cd;
#if defined(DW780) || defined(DW750)
int dw_match __P((struct device *, void *, void *));
int dw_match __P((struct device *, struct cfdata *, void *));
int
dw_match(parent, vcf, aux)
dw_match(parent, cf, aux)
struct device *parent;
void *vcf, *aux;
struct cfdata *cf;
void *aux;
{
struct sbi_attach_args *sa = (struct sbi_attach_args *)aux;
struct cfdata *cf = vcf;
if ((cf->cf_loc[0] != sa->nexnum) && (cf->cf_loc[0] > -1 ))
return 0;
@ -383,7 +383,7 @@ dw750_purge(sc, bdp)
* This driver can only handle map registers up to 1MB due to map info
* storage, but that should be enough for normal purposes.
*/
int qba_match __P((struct device *, void *, void *));
int qba_match __P((struct device *, struct cfdata *, void *));
void qba_attach __P((struct device *, struct device *, void *));
void qba_beforescan __P((struct uba_softc*));
void qba_init __P((struct uba_softc*));
@ -395,7 +395,8 @@ struct cfattach uba_backplane_ca = {
int
qba_match(parent, vcf, aux)
struct device *parent;
void *vcf, *aux;
struct cfdata *vcf;
void *aux;
{
struct bp_conf *bp = aux;
@ -832,7 +833,6 @@ uba_attach(sc, iopagephys)
vm_offset_t mini, maxi;
extern struct ivec_dsp idsptch;
uba_cd.cd_indirect = 1; /* XXX */
/*
* Set last free interrupt vector for devices with
* programmable interrupt vectors. Use is to decrement
@ -890,19 +890,18 @@ uba_attach(sc, iopagephys)
/*
* Now start searching for devices.
*/
config_scan(ubascan,(struct device *)sc);
config_search(ubasearch,(struct device *)sc, NULL);
if (sc->uh_afterscan)
(*sc->uh_afterscan)(sc);
}
void
ubascan(parent, match)
int
ubasearch(parent, cf, aux)
struct device *parent;
void *match;
struct cfdata *cf;
void *aux;
{
struct device *dev = match;
struct cfdata *cf = dev->dv_cfdata;
struct uba_softc *sc = (struct uba_softc *)parent;
struct uba_attach_args ua;
int i;
@ -914,7 +913,7 @@ ubascan(parent, match)
goto forgetit;
rcvec = 0x200;
i = (*cf->cf_attach->ca_match) (parent, dev, &ua);
i = (*cf->cf_attach->ca_match) (parent, cf, &ua);
if (sc->uh_errchk)
if ((*sc->uh_errchk)(sc))
@ -926,37 +925,38 @@ ubascan(parent, match)
goto fail;
sc->uh_idsp[rcvec].hoppaddr = ua.ua_ivec;
sc->uh_idsp[rcvec].pushlarg = dev->dv_unit;
if (ua.ua_reset) { /* device wants ubraeset */
sc->uh_idsp[rcvec].pushlarg = cf->cf_unit;
if (ua.ua_reset) { /* device wants ubareset */
if (sc->uh_resno == 0) {
sc->uh_reset = malloc(1024, M_DEVBUF, M_NOWAIT);
sc->uh_resarg = (int *)sc->uh_reset + 128;
}
#ifdef DIAGNOSTIC
if (sc->uh_resno > 127) {
printf("%s: Expand reset table, skipping reset %s\n",
sc->uh_dev.dv_xname, dev->dv_xname);
printf("%s: Expand reset table, skipping reset %s%d\n",
sc->uh_dev.dv_xname, cf->cf_driver->cd_name,
cf->cf_unit);
} else
#endif
{
sc->uh_resarg[sc->uh_resno] = dev->dv_unit;
sc->uh_resarg[sc->uh_resno] = cf->cf_unit;
sc->uh_reset[sc->uh_resno++] = ua.ua_reset;
}
}
ua.ua_br = rbr;
ua.ua_cvec = rcvec;
ua.ua_iaddr = dev->dv_cfdata->cf_loc[0];
ua.ua_iaddr = cf->cf_loc[0];
config_attach(parent, dev, &ua, ubaprint);
return;
config_attach(parent, cf, &ua, ubaprint);
return 0;
fail:
printf("%s at %s csr %o %s\n", dev->dv_cfdata->cf_driver->cd_name,
parent->dv_xname, dev->dv_cfdata->cf_loc[0],
printf("%s%d at %s csr %o %s\n", cf->cf_driver->cd_name, cf->cf_unit,
parent->dv_xname, cf->cf_loc[0],
rcvec ? "didn't interrupt\n" : "zero vector\n");
forgetit:
free(dev, M_DEVBUF);
return 0;
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: uda.c,v 1.27 1998/01/12 20:52:54 thorpej Exp $ */
/* $NetBSD: uda.c,v 1.28 1998/01/24 14:16:30 ragge Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
* Copyright (c) 1988 Regents of the University of California.
@ -88,7 +88,7 @@ struct uda_softc {
int sc_wticks; /* watchdog timer ticks */
};
static int udamatch __P((struct device *, void *, void *));
static int udamatch __P((struct device *, struct cfdata *, void *));
static void udaattach __P((struct device *, struct device *, void *));
static void udareset __P((int));
static void mtcreset __P((int));
@ -142,12 +142,12 @@ udaprint(aux, name)
* Poke at a supposed UDA50 to see if it is there.
*/
int
udamatch(parent, match, aux)
struct device *parent;
void *match, *aux;
udamatch(parent, cf, aux)
struct device *parent;
struct cfdata *cf;
void *aux;
{
struct uba_attach_args *ua = aux;
struct device *dev = match;
struct mscp_softc mi; /* Nice hack */
struct uba_softc *ubasc;
int tries;
@ -193,7 +193,7 @@ again:
#if 0
rbr = qbgetpri();
#endif
if (strcmp(dev->dv_cfdata->cf_driver->cd_name, mtc_cd.cd_name)) {
if (strcmp(cf->cf_driver->cd_name, mtc_cd.cd_name)) {
ua->ua_ivec = udaintr;
ua->ua_reset = udareset;
} else {

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.29 1998/01/12 20:52:55 thorpej Exp $ */
/* $NetBSD: autoconf.c,v 1.30 1998/01/24 14:16:27 ragge Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@ -95,7 +95,7 @@ cpu_rootconf()
}
int printut __P((void *, const char *));
int backplane_match __P((struct device *, void *, void *));
int backplane_match __P((struct device *, struct cfdata *, void *));
void backplane_attach __P((struct device *, struct device *, void *));
int
@ -110,12 +110,11 @@ printut(aux, hej)
}
int
backplane_match(parent, gcf, aux)
backplane_match(parent, cf, aux)
struct device *parent;
void *gcf, *aux;
struct cfdata *cf;
void *aux;
{
struct cfdata *cf = gcf;
if (cf->cf_unit == 0 &&
strcmp(cf->cf_driver->cd_name, "backplane") == 0)
return 1; /* First (and only) backplane */
@ -245,16 +244,16 @@ find_sbi(self, bp, print)
}
#endif
int cpu_match __P((struct device *, void *, void *));
int cpu_match __P((struct device *, struct cfdata *, void *));
void cpu_attach __P((struct device *, struct device *, void *));
int
cpu_match(parent, gcf, aux)
cpu_match(parent, cf, aux)
struct device *parent;
void *gcf, *aux;
struct cfdata *cf;
void *aux;
{
struct cfdata *cf = gcf;
struct bp_conf *bp = aux;
if (strcmp(bp->type, "cpu"))
@ -285,15 +284,15 @@ cpu_attach(parent, self, aux)
(*dep_call->cpu_conf)(parent, self, aux);
}
int mem_match __P((struct device *, void *, void *));
int mem_match __P((struct device *, struct cfdata *, void *));
void mem_attach __P((struct device *, struct device *, void *));
int
mem_match(parent, gcf, aux)
mem_match(parent, cf, aux)
struct device *parent;
void *gcf, *aux;
struct cfdata *cf;
void *aux;
{
struct cfdata *cf = gcf;
struct sbi_attach_args *sa = (struct sbi_attach_args *)aux;
struct bp_conf *bp = aux;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ka750.c,v 1.21 1998/01/12 20:52:57 thorpej Exp $ */
/* $NetBSD: ka750.c,v 1.22 1998/01/24 14:16:25 ragge Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 The Regents of the University of California.
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@ -104,7 +104,7 @@ ka750_conf(parent, self, aux)
ctuattach();
}
static int ka750_memmatch __P((struct device *, void *, void *));
static int ka750_memmatch __P((struct device *, struct cfdata *, void *));
static void ka750_memenable __P((struct device *, struct device *, void *));
struct cfattach mem_cmi_ca = {
@ -112,12 +112,12 @@ struct cfattach mem_cmi_ca = {
};
int
ka750_memmatch(parent, gcf, aux)
ka750_memmatch(parent, cf, aux)
struct device *parent;
void *gcf, *aux;
struct cfdata *cf;
void *aux;
{
struct sbi_attach_args *sa = (struct sbi_attach_args *)aux;
struct cfdata *cf = gcf;
if (cf->cf_loc[SBICF_TR] != sa->nexnum && cf->cf_loc[SBICF_TR] > -1)
return 0;
@ -281,7 +281,7 @@ ka750_steal_pages()
}
static int cmi_print __P((void *, const char *));
static int cmi_match __P((struct device *, void *, void *));
static int cmi_match __P((struct device *, struct cfdata *, void *));
static void cmi_attach __P((struct device *, struct device *, void*));
struct cfattach cmi_ca = {
@ -306,7 +306,8 @@ cmi_print(aux, name)
int
cmi_match(parent, cf, aux)
struct device *parent;
void *cf, *aux;
struct cfdata *cf;
void *aux;
{
struct bp_conf *bp = aux;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ka820.c,v 1.7 1998/01/12 20:52:59 thorpej Exp $ */
/* $NetBSD: ka820.c,v 1.8 1998/01/24 14:16:22 ragge Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
* All rights reserved.
@ -66,7 +66,7 @@ struct ka820port *ka820port_ptr;
struct rx50device *rx50device_ptr;
void *bi_nodebase; /* virtual base address for all possible bi nodes */
static int ka820_match __P((struct device *, void *, void *));
static int ka820_match __P((struct device *, struct cfdata *, void *));
static void ka820_attach __P((struct device *, struct device *, void*));
struct cpu_dep ka820_calls = {
@ -150,11 +150,11 @@ ka820_steal_pages()
}
int
ka820_match(parent, match, aux)
ka820_match(parent, cf, aux)
struct device *parent;
void *match, *aux;
struct cfdata *cf;
void *aux;
{
struct cfdata *cf = match;
struct bi_attach_args *ba = aux;
if (ba->ba_node->biic.bi_dtype != BIDT_KA820)
@ -240,7 +240,7 @@ struct ms820regs {
#define MS2_INTLVADDR 0x00000100 /* error was in bank 1 (ro) */
#define MS2_SYN 0x0000007f /* error syndrome (ro, rw diag) */
static int ms820_match __P((struct device *, void *, void *));
static int ms820_match __P((struct device *, struct cfdata *, void *));
static void ms820_attach __P((struct device *, struct device *, void*));
struct mem_bi_softc {
@ -253,11 +253,11 @@ struct cfattach mem_bi_ca = {
};
static int
ms820_match(parent, match, aux)
ms820_match(parent, cf, aux)
struct device *parent;
void *match, *aux;
struct cfdata *cf;
void *aux;
{
struct cfdata *cf = match;
struct bi_attach_args *ba = aux;
if (ba->ba_node->biic.bi_dtype != BIDT_MS820)

View File

@ -1,4 +1,4 @@
/* $NetBSD: sbi.c,v 1.16 1998/01/12 20:53:00 thorpej Exp $ */
/* $NetBSD: sbi.c,v 1.17 1998/01/24 14:16:19 ragge Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -39,7 +39,7 @@
#include <machine/nexus.h>
static int sbi_print __P((void *, const char *));
static int sbi_match __P((struct device *, void *, void *));
static int sbi_match __P((struct device *, struct cfdata *, void *));
static void sbi_attach __P((struct device *, struct device *, void*));
int
@ -66,8 +66,9 @@ sbi_print(aux, name)
int
sbi_match(parent, cf, aux)
struct device *parent;
void *cf, *aux;
struct device *parent;
struct cfdata *cf;
void *aux;
{
struct bp_conf *bp = aux;

View File

@ -1,4 +1,4 @@
/* $NetBSD: hdc9224.c,v 1.7 1998/01/12 20:53:03 thorpej Exp $ */
/* $NetBSD: hdc9224.c,v 1.8 1998/01/24 14:16:15 ragge Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -178,7 +178,7 @@ struct hdcsoftc {
/*
* Device definition for (new) autoconfiguration.
*/
int hdcmatch __P((struct device *parent, void *cfdata, void *aux));
int hdcmatch __P((struct device *parent, struct cfdata *, void *aux));
void hdcattach __P((struct device *parent, struct device *self, void *aux));
int hdcprint __P((void *aux, const char *name));
@ -186,7 +186,7 @@ struct cfattach hdc_ca = {
sizeof(struct hdcsoftc), hdcmatch, hdcattach
};
int rdmatch __P((struct device *parent, void *cfdata, void *aux));
int rdmatch __P((struct device *parent, struct cfdata *cfdata, void *aux));
void rdattach __P((struct device *parent, struct device *self, void *aux));
int rdprint __P((void *aux, const char *name));
void rdstrategy __P((struct buf *bp));
@ -218,11 +218,11 @@ void rdgetlabel __P((struct rdsoftc *sc));
* is not yet allocated. Thus we do this in hdcattach()...
*/
int
hdcmatch(parent, match, aux)
hdcmatch(parent, cf, aux)
struct device *parent;
void *match, *aux;
struct cfdata *cf;
void *aux;
{
struct cfdata *cf = match;
struct confargs *ca = aux;
trace(("hdcmatch(0x%x, %d, %s)\n", parent, cf->cf_unit, ca->ca_name));
@ -322,12 +322,12 @@ hdcattach(parent, self, aux)
* rdmatch() probes for the existence of a RD-type disk/floppy
*/
int
rdmatch(parent, match, aux)
rdmatch(parent, cf, aux)
struct device *parent;
void *match, *aux;
struct cfdata *cf;
void *aux;
{
struct hdcsoftc *hdc = (void*)parent;
struct cfdata *cf = match;
struct hdc_attach_args *ha = aux;
int drive = ha->ha_drive;
int res;

View File

@ -1,4 +1,4 @@
/* $NetBSD: vsbus.c,v 1.8 1998/01/12 20:53:05 thorpej Exp $ */
/* $NetBSD: vsbus.c,v 1.9 1998/01/24 14:16:11 ragge Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -63,7 +63,7 @@
#define trace(x)
#define debug(x)
int vsbus_match __P((struct device *, void *, void *));
int vsbus_match __P((struct device *, struct cfdata *, void *));
void vsbus_attach __P((struct device *, struct device *, void *));
int vsbus_print __P((void *, const char *));
@ -169,7 +169,7 @@ vsbus_print(aux, name)
int
vsbus_match(parent, cf, aux)
struct device *parent;
void *cf;
struct cfdata *cf;
void *aux;
{
struct bp_conf *bp = aux;

View File

@ -1,4 +1,4 @@
/* $NetBSD: dl.c,v 1.3 1998/01/12 20:52:46 thorpej Exp $ */
/* $NetBSD: dl.c,v 1.4 1998/01/24 14:16:37 ragge Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -111,7 +111,7 @@ struct dl_softc {
struct tty* sc_tty;
};
static int dl_match __P((struct device *, void *, void *));
static int dl_match __P((struct device *, struct cfdata *, void *));
static void dl_attach __P((struct device *, struct device *, void *));
static void dlrint __P((int));
static void dlxint __P((int));
@ -136,9 +136,10 @@ extern struct cfdriver dl_cd;
/* then complete the housecleaning for full operation */
static int
dl_match (parent, match, aux)
dl_match (parent, cf, aux)
struct device * parent;
void *match, *aux;
struct cfdata *cf;
void *aux;
{
struct uba_attach_args *ua = aux;
register dlregs *dladdr;

View File

@ -1,4 +1,4 @@
/* $NetBSD: dz.c,v 1.5 1998/01/12 20:52:47 thorpej Exp $ */
/* $NetBSD: dz.c,v 1.6 1998/01/24 14:16:35 ragge Exp $ */
/*
* Copyright (c) 1996 Ken C. Wellsch. All rights reserved.
* Copyright (c) 1992, 1993
@ -107,7 +107,7 @@ static struct speedtab dzspeedtab[] =
{ -1, -1 }
};
static int dz_match __P((struct device *, void *, void *));
static int dz_match __P((struct device *, struct cfdata *, void *));
static void dz_attach __P((struct device *, struct device *, void *));
static void dzrint __P((int));
static void dzxint __P((int));
@ -142,9 +142,10 @@ static int dz_timer = 0; /* true if timer started */
/* then complete the housecleaning for full operation */
static int
dz_match (parent, match, aux)
dz_match (parent, cf, aux)
struct device *parent;
void *match, *aux;
struct cfdata *cf;
void *aux;
{
struct uba_attach_args *ua = aux;
register dzregs *dzaddr;

View File

@ -1,4 +1,4 @@
/* $NetBSD: uba.c,v 1.31 1998/01/18 22:09:14 ragge Exp $ */
/* $NetBSD: uba.c,v 1.32 1998/01/24 14:16:33 ragge Exp $ */
/*
* Copyright (c) 1996 Jonathan Stone.
* Copyright (c) 1994, 1996 Ludd, University of Lule}, Sweden.
@ -68,7 +68,7 @@
volatile int rbr, rcvec, svec;
static void ubascan __P((struct device *, void *));
static int ubasearch __P((struct device *, struct cfdata *, void *));
static int ubaprint __P((void *, const char *));
static void ubastray __P((int));
static void ubainitmaps __P((struct uba_softc *));
@ -81,15 +81,15 @@ extern struct cfdriver uba_cd;
#if defined(DW780) || defined(DW750)
int dw_match __P((struct device *, void *, void *));
int dw_match __P((struct device *, struct cfdata *, void *));
int
dw_match(parent, vcf, aux)
dw_match(parent, cf, aux)
struct device *parent;
void *vcf, *aux;
struct cfdata *cf;
void *aux;
{
struct sbi_attach_args *sa = (struct sbi_attach_args *)aux;
struct cfdata *cf = vcf;
if ((cf->cf_loc[0] != sa->nexnum) && (cf->cf_loc[0] > -1 ))
return 0;
@ -383,7 +383,7 @@ dw750_purge(sc, bdp)
* This driver can only handle map registers up to 1MB due to map info
* storage, but that should be enough for normal purposes.
*/
int qba_match __P((struct device *, void *, void *));
int qba_match __P((struct device *, struct cfdata *, void *));
void qba_attach __P((struct device *, struct device *, void *));
void qba_beforescan __P((struct uba_softc*));
void qba_init __P((struct uba_softc*));
@ -395,7 +395,8 @@ struct cfattach uba_backplane_ca = {
int
qba_match(parent, vcf, aux)
struct device *parent;
void *vcf, *aux;
struct cfdata *vcf;
void *aux;
{
struct bp_conf *bp = aux;
@ -832,7 +833,6 @@ uba_attach(sc, iopagephys)
vm_offset_t mini, maxi;
extern struct ivec_dsp idsptch;
uba_cd.cd_indirect = 1; /* XXX */
/*
* Set last free interrupt vector for devices with
* programmable interrupt vectors. Use is to decrement
@ -890,19 +890,18 @@ uba_attach(sc, iopagephys)
/*
* Now start searching for devices.
*/
config_scan(ubascan,(struct device *)sc);
config_search(ubasearch,(struct device *)sc, NULL);
if (sc->uh_afterscan)
(*sc->uh_afterscan)(sc);
}
void
ubascan(parent, match)
int
ubasearch(parent, cf, aux)
struct device *parent;
void *match;
struct cfdata *cf;
void *aux;
{
struct device *dev = match;
struct cfdata *cf = dev->dv_cfdata;
struct uba_softc *sc = (struct uba_softc *)parent;
struct uba_attach_args ua;
int i;
@ -914,7 +913,7 @@ ubascan(parent, match)
goto forgetit;
rcvec = 0x200;
i = (*cf->cf_attach->ca_match) (parent, dev, &ua);
i = (*cf->cf_attach->ca_match) (parent, cf, &ua);
if (sc->uh_errchk)
if ((*sc->uh_errchk)(sc))
@ -926,37 +925,38 @@ ubascan(parent, match)
goto fail;
sc->uh_idsp[rcvec].hoppaddr = ua.ua_ivec;
sc->uh_idsp[rcvec].pushlarg = dev->dv_unit;
if (ua.ua_reset) { /* device wants ubraeset */
sc->uh_idsp[rcvec].pushlarg = cf->cf_unit;
if (ua.ua_reset) { /* device wants ubareset */
if (sc->uh_resno == 0) {
sc->uh_reset = malloc(1024, M_DEVBUF, M_NOWAIT);
sc->uh_resarg = (int *)sc->uh_reset + 128;
}
#ifdef DIAGNOSTIC
if (sc->uh_resno > 127) {
printf("%s: Expand reset table, skipping reset %s\n",
sc->uh_dev.dv_xname, dev->dv_xname);
printf("%s: Expand reset table, skipping reset %s%d\n",
sc->uh_dev.dv_xname, cf->cf_driver->cd_name,
cf->cf_unit);
} else
#endif
{
sc->uh_resarg[sc->uh_resno] = dev->dv_unit;
sc->uh_resarg[sc->uh_resno] = cf->cf_unit;
sc->uh_reset[sc->uh_resno++] = ua.ua_reset;
}
}
ua.ua_br = rbr;
ua.ua_cvec = rcvec;
ua.ua_iaddr = dev->dv_cfdata->cf_loc[0];
ua.ua_iaddr = cf->cf_loc[0];
config_attach(parent, dev, &ua, ubaprint);
return;
config_attach(parent, cf, &ua, ubaprint);
return 0;
fail:
printf("%s at %s csr %o %s\n", dev->dv_cfdata->cf_driver->cd_name,
parent->dv_xname, dev->dv_cfdata->cf_loc[0],
printf("%s%d at %s csr %o %s\n", cf->cf_driver->cd_name, cf->cf_unit,
parent->dv_xname, cf->cf_loc[0],
rcvec ? "didn't interrupt\n" : "zero vector\n");
forgetit:
free(dev, M_DEVBUF);
return 0;
}
/*