diff options
Diffstat (limited to 'sys/arch/amiga')
46 files changed, 1007 insertions, 509 deletions
diff --git a/sys/arch/amiga/amiga/amiga_init.c b/sys/arch/amiga/amiga/amiga_init.c index 74298382da4..d05074ca9a8 100644 --- a/sys/arch/amiga/amiga/amiga_init.c +++ b/sys/arch/amiga/amiga/amiga_init.c @@ -1,5 +1,5 @@ -/* $OpenBSD: amiga_init.c,v 1.6 1996/03/24 15:59:41 niklas Exp $ */ -/* $NetBSD: amiga_init.c,v 1.35 1996/02/24 07:43:14 chopps Exp $ */ +/* $OpenBSD: amiga_init.c,v 1.7 1996/04/21 22:14:47 deraadt Exp $ */ +/* $NetBSD: amiga_init.c,v 1.36 1996/03/19 11:12:10 is Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch diff --git a/sys/arch/amiga/amiga/autoconf.c b/sys/arch/amiga/amiga/autoconf.c index 2c07e53f5ad..c7955a02819 100644 --- a/sys/arch/amiga/amiga/autoconf.c +++ b/sys/arch/amiga/amiga/autoconf.c @@ -1,4 +1,5 @@ -/* $NetBSD: autoconf.c,v 1.29 1995/10/05 12:40:54 chopps Exp $ */ +/* $OpenBSD: autoconf.c,v 1.2 1996/04/21 22:14:49 deraadt Exp $ */ +/* $NetBSD: autoconf.c,v 1.31 1996/04/04 06:25:07 cgd Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -45,7 +46,7 @@ void setroot __P((void)); void swapconf __P((void)); void mbattach __P((struct device *, struct device *, void *)); int mbprint __P((void *, char *)); -int mbmatch __P((struct device *, struct cfdata *, void *)); +int mbmatch __P((struct device *, void *, void *)); int cold; /* 1 if still booting */ #include <sys/kernel.h> @@ -61,7 +62,7 @@ configure() amiga_realconfig = 1; custom.intena = INTF_INTEN; - if (config_rootfound("mainbus", "mainbus") == 0) + if (config_rootfound("mainbus", "mainbus") == NULL) panic("no mainbus found"); custom.intena = INTF_SETCLR | INTF_INTEN; @@ -120,14 +121,14 @@ amiga_config_found(pcfp, pdp, auxp, pfn) struct cfdata *cf; if (amiga_realconfig) - return(config_found(pdp, auxp, pfn)); + return(config_found(pdp, auxp, pfn) != NULL); if (pdp == NULL) pdp = &temp; pdp->dv_cfdata = pcfp; if ((cf = config_search((cfmatch_t)NULL, pdp, auxp)) != NULL) { - cf->cf_driver->cd_attach(pdp, NULL, auxp); + cf->cf_attach->ca_attach(pdp, NULL, auxp); pdp->dv_cfdata = NULL; return(1); } @@ -165,17 +166,21 @@ config_console() /* * mainbus driver */ -struct cfdriver mainbuscd = { - NULL, "mainbus", (cfmatch_t)mbmatch, mbattach, - DV_DULL, sizeof(struct device), NULL, 0 +struct cfattach mainbus_ca = { + sizeof(struct device), mbmatch, mbattach +}; + +struct cfdriver mainbus_cd = { + NULL, "mainbus", DV_DULL, NULL, 0 }; int -mbmatch(pdp, cfp, auxp) +mbmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cfp; - void *auxp; + void *match, *auxp; { + struct cfdata *cfp = match; + if (cfp->cf_unit > 0) return(0); /* diff --git a/sys/arch/amiga/amiga/disksubr.c b/sys/arch/amiga/amiga/disksubr.c index 157132dcef4..95030a86692 100644 --- a/sys/arch/amiga/amiga/disksubr.c +++ b/sys/arch/amiga/amiga/disksubr.c @@ -1,4 +1,5 @@ -/* $NetBSD: disksubr.c,v 1.21 1996/01/07 22:01:44 thorpej Exp $ */ +/* $OpenBSD: disksubr.c,v 1.3 1996/04/21 22:14:50 deraadt Exp $ */ +/* $NetBSD: disksubr.c,v 1.22 1996/04/05 04:50:26 mhitch Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -311,13 +312,30 @@ readdisklabel(dev, strat, lp, clp) pp = &lp->d_partitions[lp->d_npartitions]; break; } + if (lp->d_npartitions <= (pp - lp->d_partitions)) + lp->d_npartitions = (pp - lp->d_partitions) + 1; + +#ifdef DIAGNOSTIC + if (lp->d_secpercyl != (pbp->e.secpertrk * pbp->e.numheads)) { + if (pbp->partname[0] < sizeof(pbp->partname)) + pbp->partname[pbp->partname[0] + 1] = 0; + else + pbp->partname[sizeof(pbp->partname) - 1] = 0; + printf("Partition '%s' geometry %d/%d differs", + pbp->partname + 1, pbp->e.numheads, + pbp->e.secpertrk); + printf(" from RDB %d/%d\n", lp->d_ntracks, + lp->d_nsectors); + } +#endif /* * insert sort in increasing offset order */ while ((pp - lp->d_partitions) > RAW_PART + 1) { daddr_t boff; - boff = pbp->e.lowcyl * lp->d_secpercyl; + boff = pbp->e.lowcyl * pbp->e.secpertrk + * pbp->e.numheads; if (boff > (pp - 1)->p_offset) break; *pp = *(pp - 1); /* struct copy */ @@ -344,29 +362,28 @@ readdisklabel(dev, strat, lp, clp) nopname = 0; } - if (lp->d_npartitions <= i) - lp->d_npartitions = i + 1; - pp->p_size = (pbp->e.highcyl - pbp->e.lowcyl + 1) - * lp->d_secpercyl; - pp->p_offset = pbp->e.lowcyl * lp->d_secpercyl; + * pbp->e.secpertrk * pbp->e.numheads; + pp->p_offset = pbp->e.lowcyl * pbp->e.secpertrk + * pbp->e.numheads; pp->p_fstype = adt.fstype; - if (pbp->e.tabsize > 22 && ISFSARCH_NETBSD(adt)) { - pp->p_fsize = pbp->e.fsize; - pp->p_frag = pbp->e.frag; - pp->p_cpg = pbp->e.cpg; - } else { - pp->p_fsize = 1024; - pp->p_frag = 8; - pp->p_cpg = 0; - } if (adt.archtype == ADT_AMIGADOS) { /* * Save reserved blocks at begin in cpg and * adjust size by reserved blocks at end */ + pp->p_fsize = 512; + pp->p_frag = pbp->e.secperblk; pp->p_cpg = pbp->e.resvblocks; pp->p_size -= pbp->e.prefac; + } else if (pbp->e.tabsize > 22 && ISFSARCH_NETBSD(adt)) { + pp->p_fsize = pbp->e.fsize; + pp->p_frag = pbp->e.frag; + pp->p_cpg = pbp->e.cpg; + } else { + pp->p_fsize = 1024; + pp->p_frag = 8; + pp->p_cpg = 0; } /* @@ -543,10 +560,16 @@ getadostype(dostype) return(adt); case DOST_MUFS: /* check for 'muFS'? */ - case DOST_DOS: adt.archtype = ADT_AMIGADOS; adt.fstype = FS_ADOS; return(adt); + case DOST_DOS: + adt.archtype = ADT_AMIGADOS; + if (b1 > 5) + adt.fstype = FS_UNUSED; + else + adt.fstype = FS_ADOS; + return(adt); case DOST_AMIX: adt.archtype = ADT_AMIX; if (b1 == 2) diff --git a/sys/arch/amiga/amiga/swapgeneric.c b/sys/arch/amiga/amiga/swapgeneric.c index 3cb570e0f75..b619de64638 100644 --- a/sys/arch/amiga/amiga/swapgeneric.c +++ b/sys/arch/amiga/amiga/swapgeneric.c @@ -1,4 +1,5 @@ -/* $NetBSD: swapgeneric.c,v 1.20 1996/01/07 22:01:46 thorpej Exp $ */ +/* $OpenBSD: swapgeneric.c,v 1.3 1996/04/21 22:14:51 deraadt Exp $ */ +/* $NetBSD: swapgeneric.c,v 1.21 1996/03/17 05:54:41 mhitch Exp $ */ /* * Copyright (c) 1982, 1986 Regents of the University of California. @@ -68,13 +69,13 @@ struct swdevt swdevt[] = { }; #if NFD > 0 -extern struct cfdriver fdcd; +extern struct cfdriver fd_cd; #endif #if NSD > 0 -extern struct cfdriver sdcd; +extern struct cfdriver sd_cd; #endif #if NCD > 0 -extern struct cfdriver cdcd; +extern struct cfdriver cd_cd; #endif struct genericconf { @@ -91,13 +92,13 @@ struct genericconf { */ struct genericconf genericconf[] = { #if NFD > 0 - {&fdcd, makedev(2, 0)}, + {&fd_cd, makedev(2, 0)}, #endif #if NSD > 0 - {&sdcd, makedev(4, 0)}, + {&sd_cd, makedev(4, 0)}, #endif #if NCD > 0 - {&cdcd, makedev(7, 0)}, + {&cd_cd, makedev(7, 0)}, #endif { 0 }, }; diff --git a/sys/arch/amiga/conf/files.amiga b/sys/arch/amiga/conf/files.amiga index e41c0d53964..90ba56bc492 100644 --- a/sys/arch/amiga/conf/files.amiga +++ b/sys/arch/amiga/conf/files.amiga @@ -1,54 +1,65 @@ -# $OpenBSD: files.amiga,v 1.8 1996/03/30 22:18:10 niklas Exp $ -# $NetBSD: files.amiga,v 1.36 1996/03/02 14:00:32 veego Exp $ +# $OpenBSD: files.amiga,v 1.9 1996/04/21 22:14:53 deraadt Exp $ +# $NetBSD: files.amiga,v 1.41 1996/03/28 18:41:55 is Exp $ # maxpartitions must be first item in files.${ARCH} maxpartitions 16 # NOTE THAT AMIGA IS SPECIAL! maxusers 2 8 64 -device mainbus at root {} +device mainbus {} +attach mainbus at root -device cpu at mainbus +device cpu +attach cpu at mainbus # zorro II expansion bus. -device zbus at mainbus {} +device zbus {} +attach zbus at mainbus file arch/amiga/dev/zbus.c zbus define event {} file arch/amiga/dev/event.c event -device clock at mainbus +device clock +attach clock at mainbus file arch/amiga/dev/clock.c # keyboard -device kbd at mainbus: event +device kbd: event +attach kbd at mainbus file arch/amiga/dev/kbd.c kbd needs-flag # serial port -device ser at mainbus: tty +device ser: tty +attach ser at mainbus file arch/amiga/dev/ser.c ser needs-count # parellel port -device par at mainbus +device par +attach par at mainbus file arch/amiga/dev/par.c par needs-count # mouse pseudo-device mouse file arch/amiga/dev/ms.c mouse needs-count -device fdc at mainbus { unit = -1 } +device fdc { unit = -1 } +attach fdc at mainbus -device fd at fdc +device fd +attach fd at fdc file arch/amiga/dev/fd.c fd needs-flag major {fd = 2} # graphic devices define grfbus {} -device grf at grfbus {} +device grf {} +attach grf at grfbus file arch/amiga/dev/grf.c grf needs-count -device ite at grf +device ite +attach ite at grf file arch/amiga/dev/ite.c ite needs-flag file arch/amiga/dev/kbdmap.c ite file arch/amiga/dev/kf_8x8.c ite @@ -56,75 +67,92 @@ file arch/amiga/dev/kf_8x11.c kfont_8x11 file arch/amiga/dev/kf_custom.c kfont_custom # custom chips grf -device grfcc at mainbus: grfbus +device grfcc: grfbus +attach grfcc at mainbus file arch/amiga/dev/grf_cc.c grfcc needs-flag -file arch/amiga/dev/ite_cc.c grfcc ite +file arch/amiga/dev/ite_cc.c grfcc & ite pseudo-device view -file arch/amiga/dev/view.c view grfcc needs-count -file arch/amiga/dev/grfabs.c grfcc view -file arch/amiga/dev/grfabs_cc.c grfcc view -file arch/amiga/dev/grfabs_ccglb.c grfcc view +file arch/amiga/dev/view.c view | grfcc needs-count +file arch/amiga/dev/grfabs.c grfcc | view +file arch/amiga/dev/grfabs_cc.c grfcc | view +file arch/amiga/dev/grfabs_ccglb.c grfcc | view # retina grf -device grfrt at zbus: grfbus +device grfrt: grfbus +attach grfrt at zbus file arch/amiga/dev/grf_rt.c grfrt needs-flag -file arch/amiga/dev/ite_rt.c grfrt ite +file arch/amiga/dev/ite_rt.c grfrt & ite # cirrus grf -device grfcl at zbus: grfbus +device grfcl: grfbus +attach grfcl at zbus file arch/amiga/dev/grf_cl.c grfcl needs-flag -file arch/amiga/dev/ite_cl.c grfcl ite +file arch/amiga/dev/ite_cl.c grfcl & ite # CyberVison 64 grf -device grfcv at zbus: grfbus +device grfcv: grfbus +attach grfcv at zbus file arch/amiga/dev/grf_cv.c grfcv needs-flag -file arch/amiga/dev/ite_cv.c grfcv ite +file arch/amiga/dev/ite_cv.c grfcv & ite # A2410 grf -device grful at zbus: grfbus +device grful: grfbus +attach grful at zbus file arch/amiga/dev/grf_ul.c grful needs-flag -file arch/amiga/dev/ite_ul.c grful ite -file arch/amiga/dev/grf_ultms.g grful +file arch/amiga/dev/ite_ul.c grful & ite +file arch/amiga/dev/grf_ultms.g grful # retina ZIII grf -device grfrh at zbus: grfbus +device grfrh: grfbus +attach grfrh at zbus file arch/amiga/dev/grf_rh.c grfrh needs-flag -file arch/amiga/dev/ite_rh.c grfrh ite +file arch/amiga/dev/ite_rh.c grfrh & ite # handle gvp's odd autoconf info.. -device gvpbus at zbus {} +device gvpbus {} +attach gvpbus at zbus file arch/amiga/dev/gvpbus.c gvpbus -device le at zbus: ifnet, ether -file arch/amiga/dev/if_le.c le needs-flag +device le: ifnet, ether +attach le at zbus with le_zbus +file arch/amiga/dev/if_le.c le_zbus needs-flag -device ed at zbus: ifnet, ether -file arch/amiga/dev/if_ed.c ed needs-flag +device ed: ifnet, ether +attach ed at zbus with ed_zbus +file arch/amiga/dev/if_ed.c ed_zbus needs-flag # C=/Ameristar A2060 / 560 -device bah at zbus: ifnet, arc -file arch/amiga/dev/if_bah.c bah needs-flag +device bah: ifnet, arc +attach bah at zbus with bah_zbus +file arch/amiga/dev/if_bah.c bah_zbus needs-flag -device es at zbus: ifnet, ether +device es: ifnet, ether +attach es at zbus file arch/amiga/dev/if_es.c es needs-flag -device qn at zbus: ifnet, ether +device qn: ifnet, ether +attach qn at zbus file arch/amiga/dev/if_qn.c qn needs-flag -device ae at zbus: ifnet, ether +device ae: ifnet, ether +attach ae at zbus file arch/amiga/dev/if_ae.c ae needs-count # A2232 msc serial ports -device msc at zbus: tty +device msc: tty +attach msc at zbus file arch/amiga/dev/msc.c msc needs-count # bsc/Alf Data MultiFaceCard -device mfc at zbus { unit = -1 } +device mfc { unit = -1 } +attach mfc at zbus -device mfcs at mfc -device mfcp at mfc -file arch/amiga/dev/mfc.c mfcs mfcp needs-count +device mfcs +attach mfcs at mfc +device mfcp +attach mfcp at mfc +file arch/amiga/dev/mfc.c mfcs | mfcp needs-count include "../../../scsi/files.scsi" @@ -133,15 +161,18 @@ define sbic file arch/amiga/dev/sbic.c sbic # C= A2091 -device atzsc at zbus: scsi, sbic +device atzsc: scsi, sbic +attach atzsc at zbus file arch/amiga/dev/atzsc.c atzsc needs-flag # GVP series II -device gtsc at gvpbus: scsi, sbic +device gtsc: scsi, sbic +attach gtsc at gvpbus file arch/amiga/dev/gtsc.c gtsc needs-flag # Amiga 3000 internal -device ahsc at mainbus: scsi, sbic +device ahsc: scsi, sbic +attach ahsc at mainbus file arch/amiga/dev/ahsc.c ahsc needs-flag # ncr 57c710 controllers @@ -149,56 +180,73 @@ define siop file arch/amiga/dev/siop.c siop # PPI Zeus -device zssc at zbus: scsi, siop +device zssc: scsi, siop +attach zssc at zbus file arch/amiga/dev/zssc.c zssc needs-flag # CSA Magnum -device mgnsc at zbus: scsi, siop +device mgnsc: scsi, siop +attach mgnsc at zbus file arch/amiga/dev/mgnsc.c mgnsc needs-flag # MacroSystems Warp Engine -device wesc at zbus: scsi, siop +device wesc: scsi, siop +attach wesc at zbus file arch/amiga/dev/wesc.c wesc needs-flag # C= A4091 -device afsc at zbus: scsi, siop -device aftsc at mainbus: scsi, siop -file arch/amiga/dev/afsc.c afsc aftsc needs-flag +device afsc: scsi, siop +attach afsc at zbus +device aftsc: scsi, siop +attach aftsc at mainbus +file arch/amiga/dev/afsc.c afsc | aftsc needs-flag # ncr 5380 controllers define sci file arch/amiga/dev/sci.c sci # Supra Wordsync II -device wstsc at zbus: scsi, sci +device wstsc: scsi, sci +attach wstsc at zbus file arch/amiga/dev/wstsc.c wstsc needs-flag # IVS -device ivsc at zbus: scsi, sci +device ivsc: scsi, sci +attach ivsc at zbus file arch/amiga/dev/ivsc.c ivsc needs-flag # CSA twelve gauge. -device otgsc at zbus: scsi, sci +device otgsc: scsi, sci +attach otgsc at zbus file arch/amiga/dev/otgsc.c otgsc needs-flag # MLH -device mlhsc at zbus: scsi, sci +device mlhsc: scsi, sci +attach mlhsc at zbus file arch/amiga/dev/mlhsc.c mlhsc needs-flag +# Emplant +device empsc: scsi, sci +attach empsc at zbus +file arch/amiga/dev/empsc.c empsc needs-flag + # Emulex ESP216 & FAS216 controllers define sfas file arch/amiga/dev/sfas.c sfas # FastlaneZ3 -device flsc at zbus: scsi, sfas +device flsc: scsi, sfas +attach flsc at zbus file arch/amiga/dev/flsc.c flsc needs-flag # Blizzard1230 -device bzsc at zbus: scsi, sfas +device bzsc: scsi, sfas +attach bzsc at zbus file arch/amiga/dev/bzsc.c bzsc needs-flag # Amiga 4000/1200 IDE masquerading as SCSI -device idesc at mainbus: scsi +device idesc: scsi +attach idesc at mainbus file arch/amiga/dev/idesc.c idesc needs-flag # @@ -233,8 +281,8 @@ device isaed at isa: ifnet, ether file arch/amiga/isa/if_isaed.c isaed # list of standard files... -file dev/cons.c ite ser -file dev/cninit.c ite ser +file dev/cons.c ite | ser +file dev/cninit.c ite | ser file arch/amiga/amiga/amiga_init.c file arch/amiga/amiga/autoconf.c file arch/amiga/amiga/cia.c diff --git a/sys/arch/amiga/dev/afsc.c b/sys/arch/amiga/dev/afsc.c index 0f0aa0f04c7..39faa7e19be 100644 --- a/sys/arch/amiga/dev/afsc.c +++ b/sys/arch/amiga/dev/afsc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: afsc.c,v 1.3 1996/03/30 22:18:12 niklas Exp $ */ -/* $NetBSD: afsc.c,v 1.11 1996/03/15 22:11:09 mhitch Exp $ */ +/* $OpenBSD: afsc.c,v 1.4 1996/04/21 22:14:56 deraadt Exp $ */ +/* $NetBSD: afsc.c,v 1.13 1996/03/18 04:58:36 mhitch Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -53,7 +53,7 @@ int afscprint __P((void *auxp, char *)); void afscattach __P((struct device *, struct device *, void *)); -int afscmatch __P((struct device *, struct cfdata *, void *)); +int afscmatch __P((struct device *, void *, void *)); int siopintr __P((struct siop_softc *)); int afsc_dmaintr __P((struct siop_softc *)); @@ -75,22 +75,31 @@ struct scsi_device afsc_scsidev = { #ifdef DEBUG #endif -struct cfdriver afsccd = { - NULL, "afsc", (cfmatch_t)afscmatch, afscattach, - DV_DULL, sizeof(struct siop_softc), NULL, 0 }; -struct cfdriver aftsccd = { - NULL, "aftsc", (cfmatch_t)afscmatch, afscattach, - DV_DULL, sizeof(struct siop_softc), NULL, 0 }; +struct cfattach afsc_ca = { + sizeof(struct siop_softc), afscmatch, afscattach +}; + +struct cfdriver afsc_cd = { + NULL, "afsc", DV_DULL, NULL, 0 +}; + +struct cfattach aftsc_ca = { + sizeof(struct siop_softc), afscmatch, afscattach +}; + +struct cfdriver aftsc_cd = { + NULL, "aftsc", DV_DULL, NULL, 0 +}; /* * if we are a Commodore Amiga A4091 or possibly an A4000T */ int -afscmatch(pdp, cdp, auxp) +afscmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cdp; - void *auxp; + void *match, *auxp; { + struct cfdata *cdp = match; struct zbus_args *zap; siop_regmap_p rp; u_long temp, scratch; @@ -205,8 +214,8 @@ afsc_dump() { int i; - for (i = 0; i < afsccd.cd_ndevs; ++i) - if (afsccd.cd_devs[i]) - siop_dump(afsccd.cd_devs[i]); + for (i = 0; i < afsc_cd.cd_ndevs; ++i) + if (afsc_cd.cd_devs[i]) + siop_dump(afsc_cd.cd_devs[i]); } #endif diff --git a/sys/arch/amiga/dev/ahsc.c b/sys/arch/amiga/dev/ahsc.c index baca99e6475..45c698e8755 100644 --- a/sys/arch/amiga/dev/ahsc.c +++ b/sys/arch/amiga/dev/ahsc.c @@ -1,4 +1,5 @@ -/* $NetBSD: ahsc.c,v 1.10 1995/09/04 13:04:40 chopps Exp $ */ +/* $OpenBSD: ahsc.c,v 1.2 1996/04/21 22:14:57 deraadt Exp $ */ +/* $NetBSD: ahsc.c,v 1.11 1996/03/17 01:17:00 thorpej Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -53,7 +54,7 @@ int ahscprint __P((void *auxp, char *)); void ahscattach __P((struct device *, struct device *, void *)); -int ahscmatch __P((struct device *, struct cfdata *, void *)); +int ahscmatch __P((struct device *, void *, void *)); void ahsc_enintr __P((struct sbic_softc *)); void ahsc_dmastop __P((struct sbic_softc *)); @@ -80,19 +81,23 @@ struct scsi_device ahsc_scsidev = { int ahsc_dmadebug = 0; #endif -struct cfdriver ahsccd = { - NULL, "ahsc", (cfmatch_t)ahscmatch, ahscattach, - DV_DULL, sizeof(struct sbic_softc), NULL, 0 }; +struct cfattach ahsc_ca = { + sizeof(struct sbic_softc), ahscmatch, ahscattach +}; + +struct cfdriver ahsc_cd = { + NULL, "ahsc", DV_DULL, NULL, 0 +}; /* * if we are an A3000 we are here. */ int -ahscmatch(pdp, cdp, auxp) +ahscmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cdp; - void *auxp; + void *match, *auxp; { + struct cfdata *cdp = match; char *mbusstr; mbusstr = auxp; @@ -322,8 +327,8 @@ ahsc_dump() { int i; - for (i = 0; i < ahsccd.cd_ndevs; ++i) - if (ahsccd.cd_devs[i]) - sbic_dump(ahsccd.cd_devs[i]); + for (i = 0; i < ahsc_cd.cd_ndevs; ++i) + if (ahsc_cd.cd_devs[i]) + sbic_dump(ahsc_cd.cd_devs[i]); } #endif diff --git a/sys/arch/amiga/dev/atzsc.c b/sys/arch/amiga/dev/atzsc.c index 55d69a25e42..2073fda49a5 100644 --- a/sys/arch/amiga/dev/atzsc.c +++ b/sys/arch/amiga/dev/atzsc.c @@ -1,4 +1,5 @@ -/* $NetBSD: atzsc.c,v 1.13 1995/09/04 13:04:42 chopps Exp $ */ +/* $OpenBSD: atzsc.c,v 1.2 1996/04/21 22:14:59 deraadt Exp $ */ +/* $NetBSD: atzsc.c,v 1.15 1996/03/18 04:58:37 mhitch Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -53,7 +54,7 @@ int atzscprint __P((void *auxp, char *)); void atzscattach __P((struct device *, struct device *, void *)); -int atzscmatch __P((struct device *, struct cfdata *, void *)); +int atzscmatch __P((struct device *, void *, void *)); void atzsc_enintr __P((struct sbic_softc *)); void atzsc_dmastop __P((struct sbic_softc *)); @@ -80,19 +81,23 @@ struct scsi_device atzsc_scsidev = { int atzsc_dmadebug = 0; #endif -struct cfdriver atzsccd = { - NULL, "atzsc", (cfmatch_t)atzscmatch, atzscattach, - DV_DULL, sizeof(struct sbic_softc), NULL, 0 }; +struct cfattach atzsc_ca = { + sizeof(struct sbic_softc), atzscmatch, atzscattach +}; + +struct cfdriver atzsc_cd = { + NULL, "atzsc", DV_DULL, NULL, 0 +}; /* * if we are an A3000 we are here. */ int -atzscmatch(pdp, cdp, auxp) +atzscmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cdp; - void *auxp; + void *match, *auxp; { + struct cfdata *cdp = match; struct zbus_args *zap; zap = auxp; @@ -346,8 +351,8 @@ atzsc_dump() { int i; - for (i = 0; i < atzsccd.cd_ndevs; ++i) - if (atzsccd.cd_devs[i]) - sbic_dump(atzsccd.cd_devs[i]); + for (i = 0; i < atzsc_cd.cd_ndevs; ++i) + if (atzsc_cd.cd_devs[i]) + sbic_dump(atzsc_cd.cd_devs[i]); } #endif diff --git a/sys/arch/amiga/dev/bzsc.c b/sys/arch/amiga/dev/bzsc.c index a3adf7ea4a5..1cd4456ab1f 100644 --- a/sys/arch/amiga/dev/bzsc.c +++ b/sys/arch/amiga/dev/bzsc.c @@ -1,3 +1,5 @@ +/* $OpenBSD: bzsc.c,v 1.2 1996/04/21 22:15:00 deraadt Exp $ */ + /* * Copyright (c) 1995 Daniel Widenfalk * Copyright (c) 1994 Christian E. Hopps @@ -57,7 +59,7 @@ int bzscprint __P((void *auxp, char *)); void bzscattach __P((struct device *, struct device *, void *)); -int bzscmatch __P((struct device *, struct cfdata *, void *)); +int bzscmatch __P((struct device *, void *, void *)); struct scsi_adapter bzsc_scsiswitch = { sfas_scsicmd, @@ -73,10 +75,13 @@ struct scsi_device bzsc_scsidev = { NULL, /* Use default done routine */ }; +struct cfattach bzsc_ca = { + sizeof(struct bzsc_softc), bzscmatch, bzscattach +}; -struct cfdriver bzsccd = { - NULL, "bzsc", (cfmatch_t)bzscmatch, bzscattach, - DV_DULL, sizeof(struct bzsc_softc), NULL, 0 }; +struct cfdriver bzsc_cd = { + NULL, "bzsc", DV_DULL, NULL, 0 +}; int bzsc_intr __P((struct sfas_softc *dev)); int bzsc_setup_dma __P((struct sfas_softc *sc, void *ptr, int len, @@ -89,7 +94,7 @@ void bzsc_led_dummy __P((struct sfas_softc *sc)); /* * if we are an Advanced Systems & Software FastlaneZ3 */ -int bzscmatch(struct device *pdp, struct cfdata *cdp, void *auxp) +int bzscmatch(struct device *pdp, void *match, void *auxp) { struct zbus_args *zap; diff --git a/sys/arch/amiga/dev/clock.c b/sys/arch/amiga/dev/clock.c index 481841c958f..00d38bb3133 100644 --- a/sys/arch/amiga/dev/clock.c +++ b/sys/arch/amiga/dev/clock.c @@ -1,4 +1,5 @@ -/* $NetBSD: clock.c,v 1.10 1995/02/20 00:53:42 chopps Exp $ */ +/* $OpenBSD: clock.c,v 1.4 1996/04/21 22:15:01 deraadt Exp $ */ +/* $NetBSD: clock.c,v 1.12 1996/03/17 05:58:30 mhitch Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -93,19 +94,23 @@ struct clockframe hardclock_frame; * periods where N is the value loaded into the counter. */ -int clockmatch __P((struct device *, struct cfdata *, void *)); +int clockmatch __P((struct device *, void *, void *)); void clockattach __P((struct device *, struct device *, void *)); -struct cfdriver clockcd = { - NULL, "clock", (cfmatch_t)clockmatch, clockattach, - DV_DULL, sizeof(struct device), NULL, 0 }; +struct cfattach clock_ca = { + sizeof(struct device), clockmatch, clockattach +}; + +struct cfdriver clock_cd = { + NULL, "clock", DV_DULL, NULL, 0 }; int -clockmatch(pdp, cfp, auxp) +clockmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cfp; - void *auxp; + void *match, *auxp; { + struct cfdata *cfp = match; + if (matchname("clock", auxp)) return(1); return(0); diff --git a/sys/arch/amiga/dev/empsc.c b/sys/arch/amiga/dev/empsc.c new file mode 100644 index 00000000000..9618c00b696 --- /dev/null +++ b/sys/arch/amiga/dev/empsc.c @@ -0,0 +1,182 @@ +/* $OpenBSD: empsc.c,v 1.1 1996/04/21 22:15:02 deraadt Exp $ */ +/* $NetBSD: empsc.c,v 1.4 1996/04/05 15:53:41 is Exp $ */ + +/* + + * Copyright (c) 1995 Sean Riddle, Bo Najdrovsky + * Copyright (c) 1994 Michael L. Hitch + * Copyright (c) 1982, 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/kernel.h> +#include <sys/device.h> +#include <scsi/scsi_all.h> +#include <scsi/scsiconf.h> +#include <amiga/amiga/custom.h> +#include <amiga/amiga/device.h> +#include <amiga/amiga/isr.h> +#include <amiga/dev/scireg.h> +#include <amiga/dev/scivar.h> +#include <amiga/dev/zbusvar.h> + +int empscprint __P((void *auxp, char *)); +void empscattach __P((struct device *, struct device *, void *)); +int empscmatch __P((struct device *, struct cfdata *, void *)); +int empsc_intr __P((struct sci_softc *)); + +struct scsi_adapter empsc_scsiswitch = { + sci_scsicmd, + sci_minphys, + 0, /* no lun support */ + 0, /* no lun support */ +}; + +struct scsi_device empsc_scsidev = { + NULL, /* use default error handler */ + NULL, /* do not have a start functio */ + NULL, /* have no async handler */ + NULL, /* Use default done routine */ +}; + +#define QPRINTF + +#ifdef DEBUG +extern int sci_debug; +#endif + +extern int sci_data_wait; + +struct cfattach empsc_ca = { + sizeof(struct sci_softc), empscmatch, empscattach +}; + +struct cfdriver empsc_cd = { + NULL, "empsc", DV_DULL, NULL, 0 +}; + +/* + * if this is an EMPLANT board + */ +int +empscmatch(pdp, match, auxp) + struct device *pdp; + void *match, *auxp; +{ + struct zbus_args *zap; + + zap = auxp; + + /* + * Check manufacturer and product id. + */ + if (zap->manid == 2171 && ((zap->prodid == 21)||(zap->prodid==32))) + return(1); + else + return(0); +} + +void +empscattach(pdp, dp, auxp) + struct device *pdp, *dp; + void *auxp; +{ + volatile u_char *rp; + struct sci_softc *sc; + struct zbus_args *zap; + + printf("\n"); + + zap = auxp; + + sc = (struct sci_softc *)dp; + rp = zap->va + 0x5000; + + sc->sci_data = rp; + sc->sci_odata = rp; + sc->sci_icmd = rp + 0x10; + sc->sci_mode = rp + 0x20; + sc->sci_tcmd = rp + 0x30; + sc->sci_bus_csr = rp + 0x40; + sc->sci_sel_enb = rp + 0x40; + sc->sci_csr = rp + 0x50; + sc->sci_dma_send = rp + 0x50; + sc->sci_idata = rp + 0x60; + sc->sci_trecv = rp + 0x60; + sc->sci_iack = rp + 0x70; + sc->sci_irecv = rp + 0x70; + sc->sc_isr.isr_intr = empsc_intr; + sc->sc_isr.isr_arg = sc; + sc->sc_isr.isr_ipl = 2; + add_isr(&sc->sc_isr); + + scireset(sc); + + sc->sc_link.adapter_softc = sc; + sc->sc_link.adapter_target = 7; + sc->sc_link.adapter = &empsc_scsiswitch; + sc->sc_link.device = &empsc_scsidev; + sc->sc_link.openings = 1; + TAILQ_INIT(&sc->sc_xslist); + + /* + * attach all scsi units on us + */ + config_found(dp, &sc->sc_link, empscprint); +} + +/* + * print diag if pnp is NULL else just extra + */ +int +empscprint(auxp, pnp) + void *auxp; + char *pnp; +{ + if (pnp == NULL) + return(UNCONF); + return(QUIET); +} + +int +empsc_intr(dev) + struct sci_softc *dev; +{ + u_char stat; + + if ((*dev->sci_csr & SCI_CSR_INT) == 0) + return(0); + stat = *dev->sci_iack; + /* XXXX is: something is missing here, at least a: */ + return(1); +} diff --git a/sys/arch/amiga/dev/fd.c b/sys/arch/amiga/dev/fd.c index 699b917edce..86c76049a14 100644 --- a/sys/arch/amiga/dev/fd.c +++ b/sys/arch/amiga/dev/fd.c @@ -1,4 +1,5 @@ -/* $NetBSD: fd.c,v 1.25 1996/01/28 19:48:39 chopps Exp $ */ +/* $OpenBSD: fd.c,v 1.5 1996/04/21 22:15:04 deraadt Exp $ */ +/* $NetBSD: fd.c,v 1.28 1996/04/05 05:08:07 mhitch Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -149,8 +150,8 @@ struct fdcargs { int unit; }; -int fdmatch __P((struct device *, struct cfdata *, void *)); -int fdcmatch __P((struct device *, struct cfdata *, void *)); +int fdmatch __P((struct device *, void *, void *)); +int fdcmatch __P((struct device *, void *, void *)); int fdcprint __P((void *, char *)); void fdcattach __P((struct device *, struct device *, void *)); void fdattach __P((struct device *, struct device *, void *)); @@ -190,13 +191,21 @@ struct fdtype fdtype[] = { }; int nfdtype = sizeof(fdtype) / sizeof(*fdtype); -struct cfdriver fdcd = { - NULL, "fd", (cfmatch_t)fdmatch, fdattach, DV_DISK, - sizeof(struct fd_softc), NULL, 0 }; +struct cfattach fd_ca = { + sizeof(struct fd_softc), fdmatch, fdattach +}; + +struct cfdriver fd_cd = { + NULL, "fd", DV_DISK, NULL, 0 +}; + +struct cfattach fdc_ca = { + sizeof(struct device), fdcmatch, fdcattach +}; -struct cfdriver fdccd = { - NULL, "fdc", (cfmatch_t)fdcmatch, fdcattach, DV_DULL, - sizeof(struct device), NULL, 0 }; +struct cfdriver fdc_cd = { + NULL, "fdc", DV_DULL, NULL, 0 +}; /* * all hw access through macros, this helps to hide the active low @@ -256,11 +265,12 @@ struct cfdriver fdccd = { int -fdcmatch(pdp, cfp, auxp) +fdcmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cfp; - void *auxp; + void *match, *auxp; { + struct cfdata *cfp = match; + if (matchname("fdc", auxp) == 0 || cfp->cf_unit != 0) return(0); if ((fdc_dmap = alloc_chipmem(DMABUFSZ)) == NULL) { @@ -305,11 +315,12 @@ fdcprint(auxp, pnp) /*ARGSUSED*/ int -fdmatch(pdp, cfp, auxp) +fdmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cfp; - void *auxp; + void *match, *auxp; { + struct cfdata *cfp = match; + #define cf_unit cf_loc[0] struct fdcargs *fdap; @@ -381,7 +392,7 @@ Fdopen(dev, flags, devtype, p) if (FDPART(dev) >= FDMAXPARTS) return(ENXIO); - if ((sc = getsoftc(fdcd, FDUNIT(dev))) == NULL) + if ((sc = getsoftc(fd_cd, FDUNIT(dev))) == NULL) return(ENXIO); if (sc->flags & FDF_NOTRACK0) return(ENXIO); @@ -457,7 +468,7 @@ fdclose(dev, flags, devtype, p) #ifdef FDDEBUG printf("fdclose()\n"); #endif - sc = getsoftc(fdcd, FDUNIT(dev)); + sc = getsoftc(fd_cd, FDUNIT(dev)); s = splbio(); if (sc->flags & FDF_MOTORON) { sc->flags |= FDF_WMOTOROFF; @@ -482,7 +493,7 @@ fdioctl(dev, cmd, addr, flag, p) void *data; int error, wlab; - sc = getsoftc(fdcd, FDUNIT(dev)); + sc = getsoftc(fd_cd, FDUNIT(dev)); if ((sc->flags & FDF_HAVELABEL) == 0) return(EBADF); @@ -581,7 +592,7 @@ fdstrategy(bp) unit = FDUNIT(bp->b_dev); part = FDPART(bp->b_dev); - sc = getsoftc(fdcd, unit); + sc = getsoftc(fd_cd, unit); #ifdef FDDEBUG printf("fdstrategy: 0x%x\n", bp); @@ -690,6 +701,7 @@ fdgetdisklabel(sc, dev) lp->d_partitions[part].p_fstype = FS_UNUSED; lp->d_partitions[part].p_fsize = 1024; lp->d_partitions[part].p_frag = 8; + lp->d_partitions[part].p_cpg = 2; /* for adosfs: reserved blks */ sc->flags |= FDF_HAVELABEL; @@ -731,6 +743,7 @@ nolabel: lp->d_partitions[part].p_fstype = FS_UNUSED; lp->d_partitions[part].p_fsize = 1024; lp->d_partitions[part].p_frag = 8; + lp->d_partitions[part].p_cpg = 2; /* adosfs: reserved blocks */ lp->d_npartitions = part + 1; lp->d_magic = lp->d_magic2 = DISKMAGIC; lp->d_checksum = dkcksum(lp); @@ -1530,11 +1543,11 @@ fdfindwork(unit) for (i = unit + 1; last == 0; i++) { if (i == unit) last = 1; - if (i >= fdcd.cd_ndevs) { + if (i >= fd_cd.cd_ndevs) { i = -1; continue; } - if ((sc = fdcd.cd_devs[i]) == NULL) + if ((sc = fd_cd.cd_devs[i]) == NULL) continue; /* @@ -1579,7 +1592,7 @@ fdminphys(bp) struct fd_softc *sc; int trk, sec, toff, tsz; - if ((sc = getsoftc(fdcd, FDUNIT(bp->b_dev))) == NULL) + if ((sc = getsoftc(fd_cd, FDUNIT(bp->b_dev))) == NULL) panic("fdminphys: couldn't get softc"); trk = bp->b_blkno / sc->nsectors; diff --git a/sys/arch/amiga/dev/flsc.c b/sys/arch/amiga/dev/flsc.c index 6411c79eeda..9da31524678 100644 --- a/sys/arch/amiga/dev/flsc.c +++ b/sys/arch/amiga/dev/flsc.c @@ -1,3 +1,5 @@ +/* $OpenBSD: flsc.c,v 1.2 1996/04/21 22:15:05 deraadt Exp $ */ + /* * Copyright (c) 1995 Daniel Widenfalk * Copyright (c) 1994 Christian E. Hopps @@ -57,7 +59,7 @@ int flscprint __P((void *auxp, char *)); void flscattach __P((struct device *, struct device *, void *)); -int flscmatch __P((struct device *, struct cfdata *, void *)); +int flscmatch __P((struct device *, void *, void *)); struct scsi_adapter flsc_scsiswitch = { sfas_scsicmd, @@ -73,10 +75,13 @@ struct scsi_device flsc_scsidev = { NULL, /* Use default done routine */ }; +struct cfattach flsc_ca = { + sizeof(struct flsc_softc), flscmatch, flscattach +}; -struct cfdriver flsccd = { - NULL, "flsc", (cfmatch_t)flscmatch, flscattach, - DV_DULL, sizeof(struct flsc_softc), NULL, 0 }; +struct cfdriver flsc_cd = { + NULL, "flsc", DV_DULL, NULL, 0 +}; int flsc_intr __P((struct sfas_softc *dev)); int flsc_setup_dma __P((struct sfas_softc *sc, void *ptr, int len, @@ -90,10 +95,9 @@ void flsc_led __P((struct sfas_softc *sc, int mode)); * if we are an Advanced Systems & Software FastlaneZ3 */ int -flscmatch(pdp, cdp, auxp) +flscmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cdp; - void *auxp; + void *match, *auxp; { struct zbus_args *zap; diff --git a/sys/arch/amiga/dev/grf.c b/sys/arch/amiga/dev/grf.c index ac6c11e24c7..7979bd4de62 100644 --- a/sys/arch/amiga/dev/grf.c +++ b/sys/arch/amiga/dev/grf.c @@ -1,4 +1,5 @@ -/* $NetBSD: grf.c,v 1.23.2.1 1995/10/20 11:01:06 chopps Exp $ */ +/* $OpenBSD: grf.c,v 1.3 1996/04/21 22:15:08 deraadt Exp $ */ +/* $NetBSD: grf.c,v 1.25 1996/03/17 01:17:09 thorpej Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -97,17 +98,20 @@ int grfbanked_set __P((dev_t, int)); #endif void grfattach __P((struct device *, struct device *, void *)); -int grfmatch __P((struct device *, struct cfdata *, void *)); +int grfmatch __P((struct device *, void *, void *)); int grfprint __P((void *, char *)); /* * pointers to grf drivers device structs */ struct grf_softc *grfsp[NGRF]; +struct cfattach grf_ca = { + sizeof(struct device), grfmatch, grfattach +}; -struct cfdriver grfcd = { - NULL, "grf", (cfmatch_t)grfmatch, grfattach, DV_DULL, - sizeof(struct device), NULL, 0 }; +struct cfdriver grf_cd = { + NULL, "grf", DV_DULL, NULL, 0 +}; /* * only used in console init. @@ -119,11 +123,12 @@ static struct cfdata *cfdata; * low level board driver. */ int -grfmatch(pdp, cfp, auxp) +grfmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cfp; - void *auxp; + void *match, *auxp; { + struct cfdata *cfp = match; + if (cfp->cf_unit != ((struct grf_softc *)pdp)->g_unit) return(0); cfdata = cfp; diff --git a/sys/arch/amiga/dev/grf_cc.c b/sys/arch/amiga/dev/grf_cc.c index 52ec52d4236..fbf57ad92e3 100644 --- a/sys/arch/amiga/dev/grf_cc.c +++ b/sys/arch/amiga/dev/grf_cc.c @@ -1,4 +1,5 @@ -/* $NetBSD: grf_cc.c,v 1.17 1995/02/16 21:57:34 chopps Exp $ */ +/* $OpenBSD: grf_cc.c,v 1.2 1996/04/21 22:15:09 deraadt Exp $ */ +/* $NetBSD: grf_cc.c,v 1.18 1996/03/17 01:17:10 thorpej Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -54,14 +55,18 @@ #include <amiga/dev/viewioctl.h> -int grfccmatch __P((struct device *, struct cfdata *, void *)); +int grfccmatch __P((struct device *, void *, void *)); int grfccprint __P((void *, char *)); void grfccattach __P((struct device *, struct device *, void *)); void grf_cc_on __P((struct grf_softc *)); -struct cfdriver grfcccd = { - NULL, "grfcc", (cfmatch_t)grfccmatch, grfccattach, - DV_DULL, sizeof(struct grf_softc), NULL, 0 }; +struct cfattach grfcc_ca = { + sizeof(struct grf_softc), grfccmatch, grfccattach +}; + +struct cfdriver grfcc_cd = { + NULL, "grfcc", DV_DULL, NULL, 0 +}; /* * only used in console init @@ -73,11 +78,11 @@ static struct cfdata *cfdata; * tricky regarding the console. */ int -grfccmatch(pdp, cfp, auxp) +grfccmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cfp; - void *auxp; + void *match, *auxp; { + struct cfdata *cfp = match; static int ccconunit = -1; char *mainbus_name = auxp; diff --git a/sys/arch/amiga/dev/grf_cl.c b/sys/arch/amiga/dev/grf_cl.c index c1e2910ce3d..16fec232a85 100644 --- a/sys/arch/amiga/dev/grf_cl.c +++ b/sys/arch/amiga/dev/grf_cl.c @@ -1,5 +1,5 @@ -/* $OpenBSD: grf_cl.c,v 1.2 1996/03/30 22:18:13 niklas Exp $ */ -/* $NetBSD: grf_cl.c,v 1.6 1996/03/05 18:08:33 is Exp $ */ +/* $OpenBSD: grf_cl.c,v 1.3 1996/04/21 22:15:10 deraadt Exp $ */ +/* $NetBSD: grf_cl.c,v 1.8 1996/03/17 05:58:35 mhitch Exp $ */ /* * Copyright (c) 1995 Ezra Story @@ -98,7 +98,7 @@ static int cl_blank __P((struct grf_softc * gp, int * on)); void grfclattach __P((struct device *, struct device *, void *)); int grfclprint __P((void *, char *)); -int grfclmatch __P((struct device *, struct cfdata *, void *)); +int grfclmatch __P((struct device *, void *, void *)); void cl_memset __P((unsigned char *d, unsigned char c, int l)); /* Graphics display definitions. @@ -163,18 +163,21 @@ static unsigned char cl_imageptr[8 * 64], cl_maskptr[8 * 64]; static unsigned char cl_sprred[2], cl_sprgreen[2], cl_sprblue[2]; /* standard driver stuff */ -struct cfdriver grfclcd = { - NULL, "grfcl", (cfmatch_t) grfclmatch, grfclattach, - DV_DULL, sizeof(struct grf_softc), NULL, 0 +struct cfattach grfcl_ca = { + sizeof(struct grf_softc), grfclmatch, grfclattach +}; + +struct cfdriver grfcl_cd = { + NULL, "grfcl", DV_DULL, NULL, 0 }; static struct cfdata *cfdata; int -grfclmatch(pdp, cfp, auxp) +grfclmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cfp; - void *auxp; + void *match, *auxp; { + struct cfdata *cfp = match; struct zbus_args *zap; static int regprod, fbprod; diff --git a/sys/arch/amiga/dev/grf_cv.c b/sys/arch/amiga/dev/grf_cv.c index 685db9513e5..f1114344dc6 100644 --- a/sys/arch/amiga/dev/grf_cv.c +++ b/sys/arch/amiga/dev/grf_cv.c @@ -1,5 +1,5 @@ -/* $OpenBSD: grf_cv.c,v 1.6 1996/03/30 22:18:15 niklas Exp $ */ -/* $NetBSD: grf_cv.c,v 1.9 1996/03/06 16:40:16 is Exp $ */ +/* $OpenBSD: grf_cv.c,v 1.7 1996/04/21 22:15:11 deraadt Exp $ */ +/* $NetBSD: grf_cv.c,v 1.11 1996/03/17 05:58:36 mhitch Exp $ */ /* * Copyright (c) 1995 Michael Teske @@ -64,7 +64,7 @@ #include <amiga/dev/grf_cvreg.h> #include <amiga/dev/zbusvar.h> -int grfcvmatch __P((struct device *, struct cfdata *, void *)); +int grfcvmatch __P((struct device *, void *, void *)); void grfcvattach __P((struct device *, struct device *, void *)); int grfcvprint __P((void *, char *)); @@ -228,9 +228,12 @@ long cv_memclk = 45000000; #endif /* standard driver stuff */ -struct cfdriver grfcvcd = { - NULL, "grfcv", (cfmatch_t)grfcvmatch, grfcvattach, - DV_DULL, sizeof(struct grf_softc), NULL, 0 +struct cfattach grfcv_ca = { + sizeof(struct grf_softc), grfcvmatch, grfcvattach +}; + +struct cfdriver grfcv_cd = { + NULL, "grfcv", DV_DULL, NULL, 0 }; static struct cfdata *cfdata; @@ -270,11 +273,11 @@ cv_has_4mb(fb) } int -grfcvmatch(pdp, cfp, auxp) +grfcvmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cfp; - void *auxp; + void *match, *auxp; { + struct cfdata *cfp = match; struct zbus_args *zap; static int cvcons_unit = -1; diff --git a/sys/arch/amiga/dev/grf_rh.c b/sys/arch/amiga/dev/grf_rh.c index 3eff16d0a52..0ce33cc0238 100644 --- a/sys/arch/amiga/dev/grf_rh.c +++ b/sys/arch/amiga/dev/grf_rh.c @@ -1,5 +1,5 @@ -/* $OpenBSD: grf_rh.c,v 1.3 1996/03/30 22:18:18 niklas Exp $ */ -/* $NetBSD: grf_rh.c,v 1.11 1996/03/06 20:13:28 is Exp $ */ +/* $OpenBSD: grf_rh.c,v 1.4 1996/04/21 22:15:13 deraadt Exp $ */ +/* $NetBSD: grf_rh.c,v 1.13 1996/03/17 05:58:39 mhitch Exp $ */ /* * Copyright (c) 1994 Markus Wild @@ -1418,21 +1418,24 @@ static struct MonDef *current_mon; int rh_mode __P((struct grf_softc *, int, void *, int, int)); void grfrhattach __P((struct device *, struct device *, void *)); int grfrhprint __P((void *, char *)); -int grfrhmatch __P((struct device *, struct cfdata *, void *)); +int grfrhmatch __P((struct device *, void *, void *)); -struct cfdriver grfrhcd = { - NULL, "grfrh", (cfmatch_t)grfrhmatch, grfrhattach, - DV_DULL, sizeof(struct grf_softc), NULL, 0 +struct cfattach grfrh_ca = { + sizeof(struct grf_softc), grfrhmatch, grfrhattach +}; + +struct cfdriver grfrh_cd = { + NULL, "grfrh", DV_DULL, NULL, 0 }; static struct cfdata *cfdata; int -grfrhmatch(pdp, cfp, auxp) +grfrhmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cfp; - void *auxp; + void *match, *auxp; { + struct cfdata *cfp = match; #ifdef RETINACONSOLE static int rhconunit = -1; #endif diff --git a/sys/arch/amiga/dev/grf_rt.c b/sys/arch/amiga/dev/grf_rt.c index 4103c6238d8..3fc46f63b83 100644 --- a/sys/arch/amiga/dev/grf_rt.c +++ b/sys/arch/amiga/dev/grf_rt.c @@ -1,4 +1,5 @@ -/* $NetBSD: grf_rt.c,v 1.23 1996/01/28 19:19:12 chopps Exp $ */ +/* $OpenBSD: grf_rt.c,v 1.3 1996/04/21 22:15:15 deraadt Exp $ */ +/* $NetBSD: grf_rt.c,v 1.24 1996/03/17 01:17:18 thorpej Exp $ */ /* * Copyright (c) 1993 Markus Wild @@ -763,11 +764,15 @@ int rt_mode __P((struct grf_softc *, int, void *, int , int)); void grfrtattach __P((struct device *, struct device *, void *)); int grfrtprint __P((void *, char *)); -int grfrtmatch __P((struct device *, struct cfdata *, void *)); +int grfrtmatch __P((struct device *, void *, void *)); + +struct cfattach grfrt_ca = { + sizeof(struct grf_softc), grfrtmatch, grfrtattach +}; -struct cfdriver grfrtcd = { - NULL, "grfrt", (cfmatch_t)grfrtmatch, grfrtattach, - DV_DULL, sizeof(struct grf_softc), NULL, 0 }; +struct cfdriver grfrt_cd = { + NULL, "grfrt", DV_DULL, NULL, 0 +}; /* * only used in console init @@ -779,11 +784,11 @@ static struct cfdata *cfdata; * tricky regarding the console. */ int -grfrtmatch(pdp, cfp, auxp) +grfrtmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cfp; - void *auxp; + void *match, *auxp; { + struct cfdata *cfp = match; #ifdef RETINACONSOLE static int rtconunit = -1; #endif diff --git a/sys/arch/amiga/dev/grf_ul.c b/sys/arch/amiga/dev/grf_ul.c index 192013fab43..43ddbf1e3fb 100644 --- a/sys/arch/amiga/dev/grf_ul.c +++ b/sys/arch/amiga/dev/grf_ul.c @@ -1,5 +1,5 @@ -/* $OpenBSD: grf_ul.c,v 1.5 1996/03/30 22:18:19 niklas Exp $ */ -/* $NetBSD: grf_ul.c,v 1.12 1996/03/04 19:49:11 is Exp $ */ +/* $OpenBSD: grf_ul.c,v 1.6 1996/04/21 22:15:16 deraadt Exp $ */ +/* $NetBSD: grf_ul.c,v 1.14 1996/03/17 05:58:41 mhitch Exp $ */ #define UL_DEBUG @@ -430,11 +430,15 @@ int ul_mode __P((struct grf_softc *, int, void *, int , int)); void grfulattach __P((struct device *, struct device *, void *)); int grfulprint __P((void *, char *)); -int grfulmatch __P((struct device *, struct cfdata *, void *)); +int grfulmatch __P((struct device *, void *, void *)); -struct cfdriver grfulcd = { - NULL, "grful", (cfmatch_t)grfulmatch, grfulattach, - DV_DULL, sizeof(struct grf_ul_softc), NULL, 0 }; +struct cfattach grful_ca = { + sizeof(struct grf_ul_softc), grfulmatch, grfulattach +}; + +struct cfdriver grful_cd = { + NULL, "grful", DV_DULL, NULL, 0 +}; /* * only used in console init @@ -446,11 +450,11 @@ static struct cfdata *cfdata; * tricky regarding the console. */ int -grfulmatch(pdp, cfp, auxp) +grfulmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cfp; - void *auxp; + void *match, *auxp; { + struct cfdata *cfp = match; #ifdef ULOWELLCONSOLE static int ulconunit = -1; #endif diff --git a/sys/arch/amiga/dev/gtsc.c b/sys/arch/amiga/dev/gtsc.c index b21d3ad8995..55a3de1b297 100644 --- a/sys/arch/amiga/dev/gtsc.c +++ b/sys/arch/amiga/dev/gtsc.c @@ -1,4 +1,5 @@ -/* $NetBSD: gtsc.c,v 1.13 1995/09/04 13:04:43 chopps Exp $ */ +/* $OpenBSD: gtsc.c,v 1.2 1996/04/21 22:15:17 deraadt Exp $ */ +/* $NetBSD: gtsc.c,v 1.14 1996/03/17 01:17:22 thorpej Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -53,7 +54,7 @@ #include <amiga/dev/gvpbusvar.h> void gtscattach __P((struct device *, struct device *, void *)); -int gtscmatch __P((struct device *, struct cfdata *, void *)); +int gtscmatch __P((struct device *, void *, void *)); int gtscprint __P((void *auxp, char *)); void gtsc_enintr __P((struct sbic_softc *)); @@ -85,16 +86,20 @@ int gtsc_clock_override = 0; int gtsc_debug = 0; #endif -struct cfdriver gtsccd = { - NULL, "gtsc", (cfmatch_t)gtscmatch, gtscattach, - DV_DULL, sizeof(struct sbic_softc), NULL, 0 }; +struct cfattach gtsc_ca = { + sizeof(struct sbic_softc), gtscmatch, gtscattach +}; + +struct cfdriver gtsc_cd = { + NULL, "gtsc", DV_DULL, NULL, 0 +}; int -gtscmatch(pdp, cdp, auxp) +gtscmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cdp; - void *auxp; + void *match, *auxp; { + struct cfdata *cdp = match; struct gvpbus_args *gap; gap = auxp; @@ -364,8 +369,8 @@ gtsc_dump() { int i; - for (i = 0; i < gtsccd.cd_ndevs; ++i) - if (gtsccd.cd_devs[i]) - sbic_dump(gtsccd.cd_devs[i]); + for (i = 0; i < gtsc_cd.cd_ndevs; ++i) + if (gtsc_cd.cd_devs[i]) + sbic_dump(gtsc_cd.cd_devs[i]); } #endif diff --git a/sys/arch/amiga/dev/gvpbus.c b/sys/arch/amiga/dev/gvpbus.c index a8105d10899..fded8d442b2 100644 --- a/sys/arch/amiga/dev/gvpbus.c +++ b/sys/arch/amiga/dev/gvpbus.c @@ -1,4 +1,5 @@ -/* $NetBSD: gvpbus.c,v 1.9 1995/08/18 15:27:54 chopps Exp $ */ +/* $OpenBSD: gvpbus.c,v 1.2 1996/04/21 22:15:18 deraadt Exp $ */ +/* $NetBSD: gvpbus.c,v 1.10 1996/03/17 01:17:23 thorpej Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -36,21 +37,25 @@ #include <amiga/dev/gvpbusvar.h> void gvpbusattach __P((struct device *, struct device *, void *)); -int gvpbusmatch __P((struct device *, struct cfdata *, void *)); +int gvpbusmatch __P((struct device *, void *, void *)); int gvpbusprint __P((void *auxp, char *)); extern int sbic_no_dma; /* Kludge for A1291 - mlh */ -struct cfdriver gvpbuscd = { - NULL, "gvpbus", (cfmatch_t)gvpbusmatch, gvpbusattach, - DV_DULL, sizeof(struct device), NULL, 0 }; +struct cfattach gvpbus_ca = { + sizeof(struct device), gvpbusmatch, gvpbusattach +}; + +struct cfdriver gvpbus_cd = { + NULL, "gvpbus", DV_DULL, NULL, 0 +}; int -gvpbusmatch(pdp, cdp, auxp) +gvpbusmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cdp; - void *auxp; + void *match, *auxp; { + struct cfdata *cdp = match; struct zbus_args *zap; zap = auxp; diff --git a/sys/arch/amiga/dev/idesc.c b/sys/arch/amiga/dev/idesc.c index d27d5c25043..0d83dd598b6 100644 --- a/sys/arch/amiga/dev/idesc.c +++ b/sys/arch/amiga/dev/idesc.c @@ -1,4 +1,5 @@ -/* $NetBSD: idesc.c,v 1.15 1996/01/07 22:01:53 thorpej Exp $ */ +/* $OpenBSD: idesc.c,v 1.3 1996/04/21 22:15:20 deraadt Exp $ */ +/* $NetBSD: idesc.c,v 1.18 1996/03/24 04:12:27 mhitch Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -238,7 +239,7 @@ int ide_scsicmd __P((struct scsi_xfer *)); int idescprint __P((void *auxp, char *)); void idescattach __P((struct device *, struct device *, void *)); -int idescmatch __P((struct device *, struct cfdata *, void *)); +int idescmatch __P((struct device *, void *, void *)); int ideicmd __P((struct idec_softc *, int, void *, int, void *, int)); int idego __P((struct idec_softc *, struct scsi_xfer *)); @@ -266,9 +267,13 @@ struct scsi_device idesc_scsidev = { NULL, /* Use default done routine */ }; -struct cfdriver idesccd = { - NULL, "idesc", (cfmatch_t)idescmatch, idescattach, - DV_DULL, sizeof(struct idec_softc), NULL, 0 }; +struct cfattach idesc_ca = { + sizeof(struct idec_softc), idescmatch, idescattach +}; + +struct cfdriver idesc_cd = { + NULL, "idesc", DV_DULL, NULL, 0 +}; struct { short ide_err; @@ -319,10 +324,9 @@ int ide_debug = 0; * if we are an A4000 we are here. */ int -idescmatch(pdp, cdp, auxp) +idescmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cdp; - void *auxp; + void *match, *auxp; { char *mbusstr; @@ -923,12 +927,8 @@ ideicmd(dev, target, cbuf, clen, buf, len) mdsnbuf->blk_desc.blklen[1] = 512 >> 8; mdsnbuf->pages.rigid_geometry.pg_code = 4; mdsnbuf->pages.rigid_geometry.pg_length = 16; - mdsnbuf->pages.rigid_geometry.ncyl_2 = - ide->sc_params.idep_fixedcyl >> 16; - mdsnbuf->pages.rigid_geometry.ncyl_1 = - ide->sc_params.idep_fixedcyl >> 8; - mdsnbuf->pages.rigid_geometry.ncyl_0 = - ide->sc_params.idep_fixedcyl; + _lto3b(ide->sc_params.idep_fixedcyl, + mdsnbuf->pages.rigid_geometry.ncyl); mdsnbuf->pages.rigid_geometry.nheads = ide->sc_params.idep_heads; dev->sc_stat[0] = 0; @@ -1090,7 +1090,7 @@ idesc_intr(dev) int i; #if 0 - if (idesccd.cd_ndevs == 0 || (dev = idesccd.cd_devs[0]) == NULL) + if (idesc_cd.cd_ndevs == 0 || (dev = idesc_cd.cd_devs[0]) == NULL) return (0); #endif regs = dev->sc_cregs; diff --git a/sys/arch/amiga/dev/if_ae.c b/sys/arch/amiga/dev/if_ae.c index 8fbbddcf533..e9f98cf8503 100644 --- a/sys/arch/amiga/dev/if_ae.c +++ b/sys/arch/amiga/dev/if_ae.c @@ -1,5 +1,5 @@ -/* $OpenBSD: if_ae.c,v 1.3 1996/02/26 21:11:40 niklas Exp $ */ -/* $NetBSD: if_ae.c,v 1.5 1996/02/24 07:47:36 chopps Exp $ */ +/* $OpenBSD: if_ae.c,v 1.4 1996/04/21 22:15:21 deraadt Exp $ */ +/* $NetBSD: if_ae.c,v 1.6 1996/03/17 01:17:28 thorpej Exp $ */ /* * Copyright (c) 1995 Bernd Ernesti and Klaus Burkert. All rights reserved. @@ -150,8 +150,12 @@ struct mbuf *aeget __P((struct ae_softc *,u_char *, int)); int aeioctl __P((struct ifnet *, u_long, caddr_t)); void aesetladrf __P((struct arpcom *, u_int16_t *)); -struct cfdriver aecd = { - NULL, "ae", aematch, aeattach, DV_IFNET, sizeof(struct ae_softc) +struct cfattach ae_ca = { + sizeof(struct ae_softc), aematch, aeattach +}; + +struct cfdriver ae_cd = { + NULL, "ae", DV_IFNET }; int @@ -229,7 +233,7 @@ aeattach(parent, self, aux) splx (s); ifp->if_unit = sc->sc_dev.dv_unit; - ifp->if_name = aecd.cd_name; + ifp->if_name = ae_cd.cd_name; ifp->if_ioctl = aeioctl; ifp->if_watchdog = aewatchdog; ifp->if_output = ether_output; @@ -254,7 +258,7 @@ void aewatchdog(unit) short unit; { - struct ae_softc *sc = aecd.cd_devs[unit]; + struct ae_softc *sc = ae_cd.cd_devs[unit]; log(LOG_ERR, "%s: device timeout\n", sc->sc_dev.dv_xname); ++sc->sc_arpcom.ac_if.if_oerrors; @@ -439,7 +443,7 @@ void aestart(ifp) struct ifnet *ifp; { - register struct ae_softc *sc = aecd.cd_devs[ifp->if_unit]; + register struct ae_softc *sc = ae_cd.cd_devs[ifp->if_unit]; register int bix; register struct aetmd *tmd; register struct mbuf *m; @@ -949,7 +953,7 @@ aeioctl(ifp, cmd, data) u_long cmd; caddr_t data; { - struct ae_softc *sc = aecd.cd_devs[ifp->if_unit]; + struct ae_softc *sc = ae_cd.cd_devs[ifp->if_unit]; struct ifaddr *ifa = (struct ifaddr *)data; struct ifreq *ifr = (struct ifreq *)data; int s, error = 0; diff --git a/sys/arch/amiga/dev/if_bah.c b/sys/arch/amiga/dev/if_bah.c index 1bd0a3fbfda..b3e86d21518 100644 --- a/sys/arch/amiga/dev/if_bah.c +++ b/sys/arch/amiga/dev/if_bah.c @@ -1,4 +1,5 @@ -/* $NetBSD: if_bah.c,v 1.14 1995/12/27 07:51:40 chopps Exp $ */ +/* $OpenBSD: if_bah.c,v 1.4 1996/04/21 22:15:23 deraadt Exp $ */ +/* $NetBSD: if_bah.c,v 1.16 1996/03/20 13:28:50 is Exp $ */ /* * Copyright (c) 1994, 1995 Ignatios Souvatzis @@ -41,6 +42,12 @@ /* #define BAHTIMINGS */ /* #define BAH_DEBUG 3 */ +/* zeroth version of M68060 support */ + +#if defined(M68060) && defined(BAHASMCOPY) +#undef BAHASMCOPY +#endif + #include "bpfilter.h" #include <sys/param.h> @@ -169,8 +176,8 @@ struct bah_softc { #endif }; -int bahmatch __P((struct device *, void *, void *)); -void bahattach __P((struct device *, struct device *, void *)); +int bah_zbus_match __P((struct device *, void *, void *)); +void bah_zbus_attach __P((struct device *, struct device *, void *)); void bah_init __P((struct bah_softc *)); void bah_reset __P((struct bah_softc *)); void bah_stop __P((struct bah_softc *)); @@ -187,12 +194,16 @@ void callstart __P((void *vsc, void *dummy)); int clkread(); #endif -struct cfdriver bahcd = { - NULL, "bah", bahmatch, bahattach, DV_IFNET, sizeof(struct bah_softc) +struct cfattach bah_zbus_ca = { + sizeof(struct bah_softc), bah_zbus_match, bah_zbus_attach +}; + +struct cfdriver bah_cd = { + NULL, "bah", DV_IFNET }; int -bahmatch(parent, match, aux) +bah_zbus_match(parent, match, aux) struct device *parent; void *match, *aux; { @@ -205,7 +216,7 @@ bahmatch(parent, match, aux) } void -bahattach(parent, self, aux) +bah_zbus_attach(parent, self, aux) struct device *parent, *self; void *aux; { @@ -263,7 +274,7 @@ bahattach(parent, self, aux) bah_stop(sc); ifp->if_unit = sc->sc_dev.dv_unit; - ifp->if_name = bahcd.cd_name; + ifp->if_name = bah_cd.cd_name; ifp->if_output = arc_output; ifp->if_start = bah_start; ifp->if_ioctl = bah_ioctl; @@ -530,7 +541,7 @@ bah_start(ifp) u_long copystart, lencopy, perbyte; #endif - sc = bahcd.cd_devs[ifp->if_unit]; + sc = bah_cd.cd_devs[ifp->if_unit]; #if defined(BAH_DEBUG) && (BAH_DEBUG > 3) printf("%s: start(0x%x)\n", sc->sc_dev.dv_xname, ifp); @@ -878,6 +889,8 @@ cleanup: if (head != NULL) m_freem(head); + /* mark buffer as invalid by source id 0 */ + sc->sc_base->buffers[buffer*512*2] = 0; s = splnet(); if (--sc->sc_rx_fillcount == 2 - 1) { @@ -1070,13 +1083,23 @@ bahintr(sc) if (maskedisr & ARC_RI) { #if defined(BAH_DEBUG) && (BAH_DEBUG > 1) - printf("%s: intr: hard rint, act %ld 2:%ld 3:%ld\n", - sc->sc_dev.dv_xname, - sc->sc_rx_act, sc->sc_bufstat[2], sc->sc_bufstat[3]); + printf("%s: intr: hard rint, act %ld\n", + sc->sc_dev.dv_xname, sc->sc_rx_act); #endif buffer = sc->sc_rx_act; - if (++sc->sc_rx_fillcount > 1) { + /* look if buffer is marked invalid: */ + if (sc->sc_base->buffers[buffer*512*2] == 0) { + /* invalid marked buffer (or illegally configured sender) */ + log(LOG_WARNING, + "%s: spurious RX interrupt or sender 0 (ignored)\n", + sc->sc_dev.dv_xname); + /* + * restart receiver on same buffer. + */ + sc->sc_base->command = ARC_RXBC(buffer); + + } else if (++sc->sc_rx_fillcount > 1) { sc->sc_intmask &= ~ARC_RI; sc->sc_base->status = sc->sc_intmask; } else { @@ -1128,7 +1151,7 @@ bah_ioctl(ifp, command, data) int s, error; error = 0; - sc = bahcd.cd_devs[ifp->if_unit]; + sc = bah_cd.cd_devs[ifp->if_unit]; ifa = (struct ifaddr *)data; s = splnet(); @@ -1191,7 +1214,7 @@ bah_ioctl(ifp, command, data) * and the int handler will have to decide not to retransmit (in case * retransmission is implemented). * - * This one assumes being called inside splnet(), and that imp >= ipl2 + * This one assumes being called inside splnet(), and that net >= ipl2 */ void @@ -1201,7 +1224,7 @@ int unit; struct bah_softc *sc; struct ifnet *ifp; - sc = bahcd.cd_devs[unit]; + sc = bah_cd.cd_devs[unit]; ifp = &(sc->sc_arccom.ac_if); sc->sc_base->command = ARC_TXDIS; diff --git a/sys/arch/amiga/dev/if_ed.c b/sys/arch/amiga/dev/if_ed.c index 4052fced067..95ae95e7091 100644 --- a/sys/arch/amiga/dev/if_ed.c +++ b/sys/arch/amiga/dev/if_ed.c @@ -1,4 +1,5 @@ -/* $NetBSD: if_ed.c,v 1.17 1995/12/24 02:29:57 mycroft Exp $ */ +/* $OpenBSD: if_ed.c,v 1.3 1996/04/21 22:15:25 deraadt Exp $ */ +/* $NetBSD: if_ed.c,v 1.19 1996/03/21 21:00:21 is Exp $ */ /* * Device driver for National Semiconductor DS8390/WD83C690 based ethernet @@ -95,8 +96,8 @@ struct ed_softc { u_char next_packet; /* pointer to next unread RX packet */ }; -int edmatch __P((struct device *, void *, void *)); -void edattach __P((struct device *, struct device *, void *)); +int ed_zbus_match __P((struct device *, void *, void *)); +void ed_zbus_attach __P((struct device *, struct device *, void *)); int edintr __P((struct ed_softc *)); int ed_ioctl __P((struct ifnet *, u_long, caddr_t)); void ed_start __P((struct ifnet *)); @@ -115,8 +116,12 @@ static inline void ed_xmit __P((struct ed_softc *)); static inline caddr_t ed_ring_copy __P((/* struct ed_softc *, caddr_t, caddr_t, u_short */)); -struct cfdriver edcd = { - NULL, "ed", edmatch, edattach, DV_IFNET, sizeof(struct ed_softc) +struct cfattach ed_zbus_ca = { + sizeof(struct ed_softc), ed_zbus_match, ed_zbus_attach +}; + +struct cfdriver ed_cd = { + NULL, "ed", DV_IFNET }; #define ETHER_MIN_LEN 64 @@ -176,7 +181,7 @@ word_copy(a, b, len) } int -edmatch(parent, match, aux) +ed_zbus_match(parent, match, aux) struct device *parent; void *match, *aux; { @@ -190,7 +195,7 @@ edmatch(parent, match, aux) } void -edattach(parent, self, aux) +ed_zbus_attach(parent, self, aux) struct device *parent, *self; void *aux; { @@ -234,6 +239,14 @@ edattach(parent, self, aux) sc->mem_start + ((sc->txb_cnt * ED_TXBUF_SIZE) << ED_PAGE_SHIFT); /* + * Interupts must be inactive when reading the prom, as the interupt + * line is shared with one of its address lines. + */ + + NIC_PUT(sc, ED_P0_IMR, 0x00); /* disable ints */ + NIC_PUT(sc, ED_P0_ISR, 0xff); /* clear ints */ + + /* * read the ethernet address from the board */ for (i = 0; i < ETHER_ADDR_LEN; i++) @@ -244,7 +257,7 @@ edattach(parent, self, aux) /* Initialize ifnet structure. */ ifp->if_unit = sc->sc_dev.dv_unit; - ifp->if_name = edcd.cd_name; + ifp->if_name = ed_cd.cd_name; ifp->if_start = ed_start; ifp->if_ioctl = ed_ioctl; ifp->if_watchdog = ed_watchdog; @@ -312,7 +325,7 @@ void ed_watchdog(unit) short unit; { - struct ed_softc *sc = edcd.cd_devs[unit]; + struct ed_softc *sc = ed_cd.cd_devs[unit]; log(LOG_ERR, "%s: device timeout\n", sc->sc_dev.dv_xname); ++sc->sc_arpcom.ac_if.if_oerrors; @@ -486,7 +499,7 @@ void ed_start(ifp) struct ifnet *ifp; { - struct ed_softc *sc = edcd.cd_devs[ifp->if_unit]; + struct ed_softc *sc = ed_cd.cd_devs[ifp->if_unit]; struct mbuf *m0, *m; caddr_t buffer; int len; @@ -845,7 +858,7 @@ ed_ioctl(ifp, command, data) u_long command; caddr_t data; { - struct ed_softc *sc = edcd.cd_devs[ifp->if_unit]; + struct ed_softc *sc = ed_cd.cd_devs[ifp->if_unit]; register struct ifaddr *ifa = (struct ifaddr *)data; struct ifreq *ifr = (struct ifreq *)data; int s, error = 0; diff --git a/sys/arch/amiga/dev/if_es.c b/sys/arch/amiga/dev/if_es.c index a7ce3b227a8..078430b9f5c 100644 --- a/sys/arch/amiga/dev/if_es.c +++ b/sys/arch/amiga/dev/if_es.c @@ -1,4 +1,5 @@ -/* $NetBSD: if_es.c,v 1.8 1995/12/24 02:29:59 mycroft Exp $ */ +/* $OpenBSD: if_es.c,v 1.3 1996/04/21 22:15:26 deraadt Exp $ */ +/* $NetBSD: if_es.c,v 1.10 1996/03/17 05:58:45 mhitch Exp $ */ /* * Copyright (c) 1995 Michael L. Hitch @@ -124,8 +125,12 @@ void esreset __P((struct es_softc *)); int esmatch __P((struct device *, void *, void *)); void esattach __P((struct device *, struct device *, void *)); -struct cfdriver escd = { - NULL, "es", esmatch, esattach, DV_IFNET, sizeof(struct es_softc) +struct cfattach es_ca = { + sizeof(struct es_softc), esmatch, esattach +}; + +struct cfdriver es_cd = { + NULL, "es", DV_IFNET }; int @@ -187,7 +192,7 @@ esattach(parent, self, aux) /* Initialize ifnet structure. */ ifp->if_unit = sc->sc_dev.dv_unit; - ifp->if_name = escd.cd_name; + ifp->if_name = es_cd.cd_name; ifp->if_output = ether_output; ifp->if_ioctl = esioctl; ifp->if_start = esstart; @@ -750,7 +755,7 @@ void esstart(ifp) struct ifnet *ifp; { - struct es_softc *sc = escd.cd_devs[ifp->if_unit]; + struct es_softc *sc = es_cd.cd_devs[ifp->if_unit]; union smcregs *smc = sc->sc_base; struct mbuf *m0, *m; #ifdef USEPKTBUF @@ -929,7 +934,7 @@ esioctl(ifp, command, data) u_long command; caddr_t data; { - struct es_softc *sc = escd.cd_devs[ifp->if_unit]; + struct es_softc *sc = es_cd.cd_devs[ifp->if_unit]; register struct ifaddr *ifa = (struct ifaddr *)data; struct ifreq *ifr = (struct ifreq *)data; int s, error = 0; @@ -1045,7 +1050,7 @@ void eswatchdog(unit) int unit; { - struct es_softc *sc = escd.cd_devs[unit]; + struct es_softc *sc = es_cd.cd_devs[unit]; log(LOG_ERR, "%s: device timeout\n", sc->sc_dev.dv_xname); ++sc->sc_arpcom.ac_if.if_oerrors; diff --git a/sys/arch/amiga/dev/if_le.c b/sys/arch/amiga/dev/if_le.c index 4979dd60ddd..f4c4bf5fe8a 100644 --- a/sys/arch/amiga/dev/if_le.c +++ b/sys/arch/amiga/dev/if_le.c @@ -1,4 +1,5 @@ -/* $NetBSD: if_le.c,v 1.16 1995/12/27 07:09:37 chopps Exp $ */ +/* $OpenBSD: if_le.c,v 1.3 1996/04/21 22:15:28 deraadt Exp $ */ +/* $NetBSD: if_le.c,v 1.17 1996/03/17 01:17:35 thorpej Exp $ */ /*- * Copyright (c) 1995 Charles M. Hannum. All rights reserved. @@ -69,15 +70,19 @@ /* offsets for: ID, REGS, MEM */ int lestd[] = { 0, 0x4000, 0x8000 }; -#define LE_SOFTC(unit) lecd.cd_devs[unit] +#define LE_SOFTC(unit) le_cd.cd_devs[unit] #define LE_DELAY(x) DELAY(x) -int lematch __P((struct device *, void *, void *)); -void leattach __P((struct device *, struct device *, void *)); +int le_zbus_match __P((struct device *, void *, void *)); +void le_zbus_attach __P((struct device *, struct device *, void *)); int leintr __P((void *)); -struct cfdriver lecd = { - NULL, "le", lematch, leattach, DV_IFNET, sizeof(struct le_softc) +struct cfattach le_zbus_ca = { + sizeof(struct le_softc), le_zbus_match, le_zbus_attach +}; + +struct cfdriver le_cd = { + NULL, "le", DV_IFNET }; integrate void @@ -105,7 +110,7 @@ lerdcsr(sc, port) } int -lematch(parent, match, aux) +le_zbus_match(parent, match, aux) struct device *parent; void *match, *aux; { @@ -123,7 +128,7 @@ lematch(parent, match, aux) } void -leattach(parent, self, aux) +le_zbus_attach(parent, self, aux) struct device *parent, *self; void *aux; { @@ -177,7 +182,7 @@ leattach(parent, self, aux) sc->sc_arpcom.ac_enaddr[4] = (ser >> 8) & 0xff; sc->sc_arpcom.ac_enaddr[5] = (ser ) & 0xff; - sc->sc_arpcom.ac_if.if_name = lecd.cd_name; + sc->sc_arpcom.ac_if.if_name = le_cd.cd_name; leconfig(sc); sc->sc_isr.isr_intr = leintr; diff --git a/sys/arch/amiga/dev/if_le_zbus.c b/sys/arch/amiga/dev/if_le_zbus.c index 4979dd60ddd..75a0c5b694a 100644 --- a/sys/arch/amiga/dev/if_le_zbus.c +++ b/sys/arch/amiga/dev/if_le_zbus.c @@ -1,4 +1,5 @@ -/* $NetBSD: if_le.c,v 1.16 1995/12/27 07:09:37 chopps Exp $ */ +/* $OpenBSD: if_le_zbus.c,v 1.3 1996/04/21 22:15:28 deraadt Exp $ */ +/* $NetBSD: if_le.c,v 1.17 1996/03/17 01:17:35 thorpej Exp $ */ /*- * Copyright (c) 1995 Charles M. Hannum. All rights reserved. @@ -69,15 +70,19 @@ /* offsets for: ID, REGS, MEM */ int lestd[] = { 0, 0x4000, 0x8000 }; -#define LE_SOFTC(unit) lecd.cd_devs[unit] +#define LE_SOFTC(unit) le_cd.cd_devs[unit] #define LE_DELAY(x) DELAY(x) -int lematch __P((struct device *, void *, void *)); -void leattach __P((struct device *, struct device *, void *)); +int le_zbus_match __P((struct device *, void *, void *)); +void le_zbus_attach __P((struct device *, struct device *, void *)); int leintr __P((void *)); -struct cfdriver lecd = { - NULL, "le", lematch, leattach, DV_IFNET, sizeof(struct le_softc) +struct cfattach le_zbus_ca = { + sizeof(struct le_softc), le_zbus_match, le_zbus_attach +}; + +struct cfdriver le_cd = { + NULL, "le", DV_IFNET }; integrate void @@ -105,7 +110,7 @@ lerdcsr(sc, port) } int -lematch(parent, match, aux) +le_zbus_match(parent, match, aux) struct device *parent; void *match, *aux; { @@ -123,7 +128,7 @@ lematch(parent, match, aux) } void -leattach(parent, self, aux) +le_zbus_attach(parent, self, aux) struct device *parent, *self; void *aux; { @@ -177,7 +182,7 @@ leattach(parent, self, aux) sc->sc_arpcom.ac_enaddr[4] = (ser >> 8) & 0xff; sc->sc_arpcom.ac_enaddr[5] = (ser ) & 0xff; - sc->sc_arpcom.ac_if.if_name = lecd.cd_name; + sc->sc_arpcom.ac_if.if_name = le_cd.cd_name; leconfig(sc); sc->sc_isr.isr_intr = leintr; diff --git a/sys/arch/amiga/dev/if_qn.c b/sys/arch/amiga/dev/if_qn.c index 4a046032627..7f40c0fb277 100644 --- a/sys/arch/amiga/dev/if_qn.c +++ b/sys/arch/amiga/dev/if_qn.c @@ -1,4 +1,5 @@ -/* $NetBSD: if_qn.c,v 1.3 1995/12/24 02:30:02 mycroft Exp $ */ +/* $OpenBSD: if_qn.c,v 1.4 1996/04/21 22:15:29 deraadt Exp $ */ +/* $NetBSD: if_qn.c,v 1.4 1996/03/17 01:17:37 thorpej Exp $ */ /* * Copyright (c) 1995 Mika Kortelainen @@ -171,8 +172,12 @@ static void qn_flush __P((struct qn_softc *)); static void qn_dump __P((struct qn_softc *)); #endif -struct cfdriver qncd = { - NULL, "qn", qnmatch, qnattach, DV_IFNET, sizeof(struct qn_softc) +struct cfattach qn_ca = { + sizeof(struct qn_softc), qnmatch, qnattach +}; + +struct cfdriver qn_cd = { + NULL, "qn", DV_IFNET }; @@ -237,7 +242,7 @@ qnattach(parent, self, aux) qnstop(sc); ifp->if_unit = sc->sc_dev.dv_unit; - ifp->if_name = qncd.cd_name; + ifp->if_name = qn_cd.cd_name; ifp->if_ioctl = qnioctl; ifp->if_watchdog = qnwatchdog; ifp->if_output = ether_output; @@ -319,7 +324,7 @@ void qnwatchdog(unit) int unit; { - struct qn_softc *sc = qncd.cd_devs[unit]; + struct qn_softc *sc = qn_cd.cd_devs[unit]; log(LOG_INFO, "qn: device timeout (watchdog)\n"); ++sc->sc_arpcom.ac_if.if_oerrors; @@ -402,7 +407,7 @@ void qnstart(ifp) struct ifnet *ifp; { - struct qn_softc *sc = qncd.cd_devs[ifp->if_unit]; + struct qn_softc *sc = qn_cd.cd_devs[ifp->if_unit]; struct mbuf *m; u_short len; int timout = 60000; @@ -859,7 +864,7 @@ qnioctl(ifp, command, data) u_long command; caddr_t data; { - struct qn_softc *sc = qncd.cd_devs[ifp->if_unit]; + struct qn_softc *sc = qn_cd.cd_devs[ifp->if_unit]; register struct ifaddr *ifa = (struct ifaddr *)data; #if 0 struct ifreg *ifr = (struct ifreg *)data; diff --git a/sys/arch/amiga/dev/ite.c b/sys/arch/amiga/dev/ite.c index 6f4f812ea16..4293975c9b2 100644 --- a/sys/arch/amiga/dev/ite.c +++ b/sys/arch/amiga/dev/ite.c @@ -1,5 +1,5 @@ -/* $OpenBSD: ite.c,v 1.4 1996/03/30 22:18:20 niklas Exp $ */ -/* $NetBSD: ite.c,v 1.36 1996/03/16 08:19:43 mhitch Exp $ */ +/* $OpenBSD: ite.c,v 1.5 1996/04/21 22:15:30 deraadt Exp $ */ +/* $NetBSD: ite.c,v 1.38 1996/03/17 05:58:48 mhitch Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -115,21 +115,24 @@ static void ite_sifilter __P((void *, void *)); void iteputchar __P((int c, struct ite_softc *ip)); void ite_putstr __P((const char * s, int len, dev_t dev)); void iteattach __P((struct device *, struct device *, void *)); -int itematch __P((struct device *, struct cfdata *, void *)); +int itematch __P((struct device *, void *, void *)); static void iteprecheckwrap __P((struct ite_softc *)); static void itecheckwrap __P((struct ite_softc *)); +struct cfattach ite_ca = { + sizeof(struct ite_softc), itematch, iteattach +}; -struct cfdriver itecd = { - NULL, "ite", (cfmatch_t)itematch, iteattach, DV_DULL, - sizeof(struct ite_softc), NULL, 0 }; +struct cfdriver ite_cd = { + NULL, "ite", DV_DULL, NULL, 0 +}; int -itematch(pdp, cdp, auxp) +itematch(pdp, match, auxp) struct device *pdp; - struct cfdata *cdp; - void *auxp; + void *match, *auxp; { + struct cfdata *cdp = match; struct grf_softc *gp; int maj; @@ -212,7 +215,7 @@ getitesp(dev) dev_t dev; { if (amiga_realconfig && con_itesoftc.grf == NULL) - return(itecd.cd_devs[ITEUNIT(dev)]); + return(ite_cd.cd_devs[ITEUNIT(dev)]); if (con_itesoftc.grf == NULL) panic("no ite_softc for console"); diff --git a/sys/arch/amiga/dev/ivsc.c b/sys/arch/amiga/dev/ivsc.c index e447ce0e5ef..8e816465f9c 100644 --- a/sys/arch/amiga/dev/ivsc.c +++ b/sys/arch/amiga/dev/ivsc.c @@ -1,4 +1,5 @@ -/* $NetBSD: ivsc.c,v 1.12 1995/08/18 15:28:00 chopps Exp $ */ +/* $OpenBSD: ivsc.c,v 1.2 1996/04/21 22:15:32 deraadt Exp $ */ +/* $NetBSD: ivsc.c,v 1.14 1996/03/28 19:23:34 is Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -50,7 +51,7 @@ int ivscprint __P((void *auxp, char *)); void ivscattach __P((struct device *, struct device *, void *)); -int ivscmatch __P((struct device *, struct cfdata *, void *)); +int ivscmatch __P((struct device *, void *, void *)); int ivsc_intr __P((struct sci_softc *)); int ivsc_dma_xfer_in __P((struct sci_softc *dev, int len, @@ -82,18 +83,21 @@ extern int sci_data_wait; int ivsdma_pseudo = 1; /* 0=off, 1=on */ -struct cfdriver ivsccd = { - NULL, "ivsc", (cfmatch_t)ivscmatch, ivscattach, - DV_DULL, sizeof(struct sci_softc), NULL, 0 }; +struct cfattach ivsc_ca = { + sizeof(struct sci_softc), ivscmatch, ivscattach +}; + +struct cfdriver ivsc_cd = { + NULL, "ivsc", DV_DULL, NULL, 0 +}; /* * if this is an IVS board */ int -ivscmatch(pdp, cdp, auxp) +ivscmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cdp; - void *auxp; + void *match, *auxp; { struct zbus_args *zap; @@ -324,4 +328,6 @@ ivsc_intr(dev) if ((*dev->sci_csr & SCI_CSR_INT) == 0) return(0); stat = *dev->sci_iack; + /* XXXX is: something is missing here, at least a: */ + return(1); } diff --git a/sys/arch/amiga/dev/kbd.c b/sys/arch/amiga/dev/kbd.c index 55d668baf9e..3d031f9f972 100644 --- a/sys/arch/amiga/dev/kbd.c +++ b/sys/arch/amiga/dev/kbd.c @@ -1,4 +1,5 @@ -/* $NetBSD: kbd.c,v 1.15 1995/05/07 15:37:11 chopps Exp $ */ +/* $OpenBSD: kbd.c,v 1.2 1996/04/21 22:15:33 deraadt Exp $ */ +/* $NetBSD: kbd.c,v 1.17 1996/03/17 05:58:50 mhitch Exp $ */ /* * Copyright (c) 1982, 1986, 1990 The Regents of the University of California. @@ -61,20 +62,25 @@ struct kbd_softc { }; struct kbd_softc kbd_softc; +int kbdmatch __P((struct device *, void *, void *)); void kbdattach __P((struct device *, struct device *, void *)); -int kbdmatch __P((struct device *, struct cfdata *, void *)); -struct cfdriver kbdcd = { - NULL, "kbd", (cfmatch_t)kbdmatch, kbdattach, DV_DULL, - sizeof(struct device), NULL, 0 }; +struct cfattach kbd_ca = { + sizeof(struct device), kbdmatch, kbdattach +}; + +struct cfdriver kbd_cd = { + NULL, "kbd", DV_DULL, NULL, 0 +}; /*ARGSUSED*/ int -kbdmatch(pdp, cfp, auxp) +kbdmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cfp; - void *auxp; + void *match, *auxp; { + struct cfdata *cfp = match; + if (matchname((char *)auxp, "kbd")) return(1); return(0); diff --git a/sys/arch/amiga/dev/mfc.c b/sys/arch/amiga/dev/mfc.c index f9f4a037e87..d519a9f0c1c 100644 --- a/sys/arch/amiga/dev/mfc.c +++ b/sys/arch/amiga/dev/mfc.c @@ -1,4 +1,5 @@ -/* $NetBSD: mfc.c,v 1.8.2.1 1995/10/20 11:01:12 chopps Exp $ */ +/* $OpenBSD: mfc.c,v 1.5 1996/04/21 22:15:34 deraadt Exp $ */ +/* $NetBSD: mfc.c,v 1.11 1996/03/17 05:58:52 mhitch Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -180,32 +181,44 @@ struct mfc_args { int mfcprint __P((void *auxp, char *)); void mfcattach __P((struct device *, struct device *, void *)); -int mfcmatch __P((struct device *, struct cfdata *, void *)); +int mfcmatch __P((struct device *, void *, void *)); #if NMFCS > 0 void mfcsattach __P((struct device *, struct device *, void *)); -int mfcsmatch __P((struct device *, struct cfdata *, void *)); +int mfcsmatch __P((struct device *, void *, void *)); #endif #if NMFCP > 0 void mfcpattach __P((struct device *, struct device *, void *)); -int mfcpmatch __P((struct device *, struct cfdata *, void *)); +int mfcpmatch __P((struct device *, void *, void *)); #endif int mfcintr __P((struct mfc_softc *)); void mfcsmint __P((register int unit)); -struct cfdriver mfccd = { - NULL, "mfc", (cfmatch_t) mfcmatch, mfcattach, - DV_DULL, sizeof(struct mfc_softc), NULL, 0 }; +struct cfattach mfc_ca = { + sizeof(struct mfc_softc), mfcmatch, mfcattach +}; + +struct cfdriver mfc_cd = { + NULL, "mfc", DV_DULL, NULL, 0 +}; #if NMFCS > 0 -struct cfdriver mfcscd = { - NULL, "mfcs", (cfmatch_t) mfcsmatch, mfcsattach, - DV_TTY, sizeof(struct mfcs_softc), NULL, 0 }; +struct cfattach mfcs_ca = { + sizeof(struct mfcs_softc), mfcsmatch, mfcsattach +}; + +struct cfdriver mfcs_cd = { + NULL, "mfcs", DV_TTY, NULL, 0 +}; #endif #if NMFCP > 0 -struct cfdriver mfcpcd = { - NULL, "mfcp", (cfmatch_t) mfcpmatch, mfcpattach, - DV_DULL, sizeof(struct mfcp_softc), NULL, 0 }; +struct cfattach mfcp_ca = { + sizeof(struct mfcp_softc, mfcpmatch, mfcpattach +}; + +struct cfdriver mfcp_cd = { + NULL, "mfcp", DV_DULL, NULL, 0 +}; #endif int mfcsstart(), mfcsparam(), mfcshwiflow(); @@ -299,11 +312,11 @@ struct speedtab mfcs2speedtab2[] = { * if we are an bsc/Alf Data MultFaceCard (I, II, and III) */ int -mfcmatch(pdp, cdp, auxp) +mfcmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cdp; - void *auxp; + void *match, *auxp; { + struct cfdata *cdp = match; struct zbus_args *zap; zap = auxp; @@ -384,11 +397,11 @@ mfcattach(pdp, dp, auxp) * */ int -mfcsmatch(pdp, cdp, auxp) +mfcsmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cdp; - void *auxp; + void *match, *auxp; { + struct cfdata *cdp = match; struct mfc_args *ma; ma = auxp; @@ -459,9 +472,9 @@ mfcsopen(dev, flag, mode, p) error = 0; unit = dev & 0x1f; - if (unit >= mfcscd.cd_ndevs || (mfcs_active & (1 << unit)) == 0) + if (unit >= mfcs_cd.cd_ndevs || (mfcs_active & (1 << unit)) == 0) return (ENXIO); - sc = mfcscd.cd_devs[unit]; + sc = mfcs_cd.cd_devs[unit]; s = spltty(); @@ -554,7 +567,7 @@ mfcsclose(dev, flag, mode, p) { struct tty *tp; int unit; - struct mfcs_softc *sc = mfcscd.cd_devs[dev & 31]; + struct mfcs_softc *sc = mfcs_cd.cd_devs[dev & 31]; struct mfc_softc *scc= sc->sc_mfc; unit = dev & 31; @@ -596,7 +609,7 @@ mfcsread(dev, uio, flag) struct uio *uio; int flag; { - struct mfcs_softc *sc = mfcscd.cd_devs[dev & 31]; + struct mfcs_softc *sc = mfcs_cd.cd_devs[dev & 31]; struct tty *tp = sc->sc_tty; if (tp == NULL) return(ENXIO); @@ -609,7 +622,7 @@ mfcswrite(dev, uio, flag) struct uio *uio; int flag; { - struct mfcs_softc *sc = mfcscd.cd_devs[dev & 31]; + struct mfcs_softc *sc = mfcs_cd.cd_devs[dev & 31]; struct tty *tp = sc->sc_tty; if (tp == NULL) @@ -621,7 +634,7 @@ struct tty * mfcstty(dev) dev_t dev; { - struct mfcs_softc *sc = mfcscd.cd_devs[dev & 31]; + struct mfcs_softc *sc = mfcs_cd.cd_devs[dev & 31]; return (sc->sc_tty); } @@ -635,7 +648,7 @@ mfcsioctl(dev, cmd, data, flag, p) register struct tty *tp; register int unit = dev & 31; register int error; - struct mfcs_softc *sc = mfcscd.cd_devs[dev & 31]; + struct mfcs_softc *sc = mfcs_cd.cd_devs[dev & 31]; tp = sc->sc_tty; if (!tp) @@ -707,7 +720,7 @@ mfcsparam(tp, t) struct termios *t; { int cfcr, cflag, unit, ospeed; - struct mfcs_softc *sc = mfcscd.cd_devs[tp->t_dev & 31]; + struct mfcs_softc *sc = mfcs_cd.cd_devs[tp->t_dev & 31]; struct mfc_softc *scc= sc->sc_mfc; cflag = t->c_cflag; @@ -775,7 +788,7 @@ int mfcshwiflow(tp, flag) struct tty *tp; int flag; { - struct mfcs_softc *sc = mfcscd.cd_devs[tp->t_dev & 31]; + struct mfcs_softc *sc = mfcs_cd.cd_devs[tp->t_dev & 31]; int unit = tp->t_dev & 1; if (flag) @@ -790,7 +803,7 @@ mfcsstart(tp) struct tty *tp; { int cc, s, unit; - struct mfcs_softc *sc = mfcscd.cd_devs[tp->t_dev & 31]; + struct mfcs_softc *sc = mfcs_cd.cd_devs[tp->t_dev & 31]; struct mfc_softc *scc= sc->sc_mfc; if ((tp->t_state & TS_ISOPEN) == 0) @@ -871,7 +884,7 @@ mfcsmctl(dev, bits, how) { int unit, s; u_char ub; - struct mfcs_softc *sc = mfcscd.cd_devs[dev & 31]; + struct mfcs_softc *sc = mfcs_cd.cd_devs[dev & 31]; unit = dev & 1; @@ -947,7 +960,7 @@ mfcintr (scc) return (0); unit = scc->sc_dev.dv_unit * 2; if (istat & 0x02) { /* channel A receive interrupt */ - sc = mfcscd.cd_devs[unit]; + sc = mfcs_cd.cd_devs[unit]; while (1) { c = regs->du_sra << 8; if ((c & 0x0100) == 0) @@ -968,7 +981,7 @@ mfcintr (scc) } } if (istat & 0x20) { /* channel B receive interrupt */ - sc = mfcscd.cd_devs[unit + 1]; + sc = mfcs_cd.cd_devs[unit + 1]; while (1) { c = regs->du_srb << 8; if ((c & 0x0100) == 0) @@ -989,7 +1002,7 @@ mfcintr (scc) } } if (istat & 0x01) { /* channel A transmit interrupt */ - sc = mfcscd.cd_devs[unit]; + sc = mfcs_cd.cd_devs[unit]; tp = sc->sc_tty; if (sc->ptr == sc->end) { tp->t_state &= ~(TS_BUSY | TS_FLUSH); @@ -1010,7 +1023,7 @@ mfcintr (scc) regs->du_tba = *sc->ptr++; } if (istat & 0x10) { /* channel B transmit interrupt */ - sc = mfcscd.cd_devs[unit + 1]; + sc = mfcs_cd.cd_devs[unit + 1]; tp = sc->sc_tty; if (sc->ptr == sc->end) { tp->t_state &= ~(TS_BUSY | TS_FLUSH); @@ -1042,7 +1055,7 @@ mfcsxintr(unit) int unit; { int s1, s2, ovfl; - struct mfcs_softc *sc = mfcscd.cd_devs[unit]; + struct mfcs_softc *sc = mfcs_cd.cd_devs[unit]; struct tty *tp = sc->sc_tty; /* @@ -1086,7 +1099,7 @@ int mfcseint(unit, stat) int unit, stat; { - struct mfcs_softc *sc = mfcscd.cd_devs[unit]; + struct mfcs_softc *sc = mfcs_cd.cd_devs[unit]; struct tty *tp; u_char ch; int c; @@ -1114,7 +1127,7 @@ mfcseint(unit, stat) if (stat & 0x1000) log(LOG_WARNING, "%s: fifo overflow\n", - ((struct mfcs_softc *)mfcscd.cd_devs[unit])->sc_dev.dv_xname); + ((struct mfcs_softc *)mfcs_cd.cd_devs[unit])->sc_dev.dv_xname); (*linesw[tp->t_line].l_rint)(c, tp); } @@ -1130,7 +1143,7 @@ mfcsmint(unit) int unit; { struct tty *tp; - struct mfcs_softc *sc = mfcscd.cd_devs[unit]; + struct mfcs_softc *sc = mfcs_cd.cd_devs[unit]; u_char stat, last, istat; tp = sc->sc_tty; diff --git a/sys/arch/amiga/dev/mgnsc.c b/sys/arch/amiga/dev/mgnsc.c index e513d8f48d3..6342d2f0fef 100644 --- a/sys/arch/amiga/dev/mgnsc.c +++ b/sys/arch/amiga/dev/mgnsc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: mgnsc.c,v 1.4 1996/03/30 22:18:22 niklas Exp $ */ -/* $NetBSD: mgnsc.c,v 1.16 1996/03/15 22:11:12 mhitch Exp $ */ +/* $OpenBSD: mgnsc.c,v 1.5 1996/04/21 22:15:36 deraadt Exp $ */ +/* $NetBSD: mgnsc.c,v 1.17 1996/03/17 01:17:45 thorpej Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -54,7 +54,7 @@ int mgnscprint __P((void *auxp, char *)); void mgnscattach __P((struct device *, struct device *, void *)); -int mgnscmatch __P((struct device *, struct cfdata *, void *)); +int mgnscmatch __P((struct device *, void *, void *)); int siopintr __P((struct siop_softc *)); int mgnsc_dmaintr __P((struct siop_softc *)); @@ -76,19 +76,23 @@ struct scsi_device mgnsc_scsidev = { #ifdef DEBUG #endif -struct cfdriver mgnsccd = { - NULL, "mgnsc", (cfmatch_t)mgnscmatch, mgnscattach, - DV_DULL, sizeof(struct siop_softc), NULL, 0 }; +struct cfattach mgnsc_ca = { + sizeof(struct siop_softc), mgnscmatch, mgnscattach +}; + +struct cfdriver mgnsc_cd = { + NULL, "mgnsc", DV_DULL, NULL, 0 +}; /* * if we are a CSA Magnum 40 SCSI */ int -mgnscmatch(pdp, cdp, auxp) +mgnscmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cdp; - void *auxp; + void *match, *auxp; { + struct cfdata *cdp = match; struct zbus_args *zap; zap = auxp; @@ -204,8 +208,8 @@ mgnsc_dump() { int i; - for (i = 0; i < mgnsccd.cd_ndevs; ++i) - if (mgnsccd.cd_devs[i]) - siop_dump(mgnsccd.cd_devs[i]); + for (i = 0; i < mgnsc_cd.cd_ndevs; ++i) + if (mgnsc_cd.cd_devs[i]) + siop_dump(mgnsc_cd.cd_devs[i]); } #endif diff --git a/sys/arch/amiga/dev/mlhsc.c b/sys/arch/amiga/dev/mlhsc.c index 269d2e22dc6..a46a1c80669 100644 --- a/sys/arch/amiga/dev/mlhsc.c +++ b/sys/arch/amiga/dev/mlhsc.c @@ -1,4 +1,5 @@ -/* $NetBSD: mlhsc.c,v 1.8 1995/02/12 19:19:18 chopps Exp $ */ +/* $OpenBSD: mlhsc.c,v 1.2 1996/04/21 22:15:38 deraadt Exp $ */ +/* $NetBSD: mlhsc.c,v 1.9 1996/03/17 01:17:46 thorpej Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -49,7 +50,7 @@ int mlhscprint __P((void *auxp, char *)); void mlhscattach __P((struct device *, struct device *, void *)); -int mlhscmatch __P((struct device *, struct cfdata *, void *)); +int mlhscmatch __P((struct device *, void *, void *)); int mlhsc_dma_xfer_in __P((struct sci_softc *dev, int len, register u_char *buf, int phase)); @@ -78,18 +79,21 @@ extern int sci_debug; extern int sci_data_wait; -struct cfdriver mlhsccd = { - NULL, "mlhsc", (cfmatch_t)mlhscmatch, mlhscattach, - DV_DULL, sizeof(struct sci_softc), NULL, 0 }; +struct cfattach mlhsc_ca = { + sizeof(struct sci_softc), mlhscmatch, mlhscattach +}; + +struct cfdriver mlhsc_cd = { + NULL, "mlhsc", DV_DULL, NULL, 0 +}; /* * if we are my Hacker's SCSI board we are here. */ int -mlhscmatch(pdp, cdp, auxp) +mlhscmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cdp; - void *auxp; + void *match, *auxp; { struct zbus_args *zap; diff --git a/sys/arch/amiga/dev/msc.c b/sys/arch/amiga/dev/msc.c index 0020893280d..fa93d077c83 100644 --- a/sys/arch/amiga/dev/msc.c +++ b/sys/arch/amiga/dev/msc.c @@ -1,4 +1,5 @@ -/* $NetBSD: msc.c,v 1.3 1996/02/02 18:05:44 mycroft Exp $ */ +/* $OpenBSD: msc.c,v 1.3 1996/04/21 22:15:39 deraadt Exp $ */ +/* $NetBSD: msc.c,v 1.5 1996/03/17 05:58:54 mhitch Exp $ */ /* * Copyright (c) 1993 Zik. @@ -162,16 +163,19 @@ struct speedtab *mscspeedtab; int mscmctl __P((dev_t dev, int bits, int howto)); void mscmint __P((register void *data)); -int mscmatch __P((struct device *, struct cfdata *, void *)); +int mscmatch __P((struct device *, void *, void *)); void mscattach __P((struct device *, struct device *, void *)); #define SWFLAGS(dev) (msc->openflags | (MSCDIALIN(dev) ? 0 : TIOCFLAG_SOFTCAR)) #define DEBUG_MSC 0 #define DEBUG_CD 0 -struct cfdriver msccd = { - NULL, "msc", (cfmatch_t) mscmatch, mscattach, DV_TTY, - sizeof(struct device), NULL, 0 +struct cfattach msc_ca = { + sizeof(struct device), mscmatch, mscattach +}; + +struct cfdriver msc_cd = { + NULL, "msc",DV_TTY, NULL, 0 }; #if DEBUG_MSC @@ -199,11 +203,11 @@ bugi(msc, string) #endif int -mscmatch(pdp, cdp, auxp) +mscmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cdp; - void *auxp; + void *match, *auxp; { + struct cfdata *cdp = match; struct zbus_args *zap; zap = auxp; diff --git a/sys/arch/amiga/dev/otgsc.c b/sys/arch/amiga/dev/otgsc.c index 53e1f533ea9..768dc520642 100644 --- a/sys/arch/amiga/dev/otgsc.c +++ b/sys/arch/amiga/dev/otgsc.c @@ -1,4 +1,5 @@ -/* $NetBSD: otgsc.c,v 1.9 1995/09/16 16:11:24 chopps Exp $ */ +/* $OpenBSD: otgsc.c,v 1.2 1996/04/21 22:15:40 deraadt Exp $ */ +/* $NetBSD: otgsc.c,v 1.10 1996/03/17 01:17:50 thorpej Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -49,7 +50,7 @@ int otgscprint __P((void *auxp, char *)); void otgscattach __P((struct device *, struct device *, void *)); -int otgscmatch __P((struct device *, struct cfdata *, void *)); +int otgscmatch __P((struct device *, void *, void *)); int otgsc_dma_xfer_in __P((struct sci_softc *dev, int len, register u_char *buf, int phase)); @@ -79,18 +80,21 @@ extern int sci_debug; extern int sci_data_wait; -struct cfdriver otgsccd = { - NULL, "otgsc", (cfmatch_t)otgscmatch, otgscattach, - DV_DULL, sizeof(struct sci_softc), NULL, 0 }; +struct cfattach otgsc_ca = { + sizeof(struct sci_softc), otgscmatch, otgscattach +}; + +struct cfdriver otgsc_cd = { + NULL, "otgsc", DV_DULL, NULL, 0 +}; /* * if we are my Hacker's SCSI board we are here. */ int -otgscmatch(pdp, cdp, auxp) +otgscmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cdp; - void *auxp; + void *match, *auxp; { struct zbus_args *zap; diff --git a/sys/arch/amiga/dev/par.c b/sys/arch/amiga/dev/par.c index bcd5def57f6..2021f3617e9 100644 --- a/sys/arch/amiga/dev/par.c +++ b/sys/arch/amiga/dev/par.c @@ -1,4 +1,5 @@ -/* $NetBSD: par.c,v 1.11 1994/12/01 17:25:33 chopps Exp $ */ +/* $OpenBSD: par.c,v 1.2 1996/04/21 22:15:41 deraadt Exp $ */ +/* $NetBSD: par.c,v 1.12 1996/03/17 01:17:51 thorpej Exp $ */ /* * Copyright (c) 1982, 1990 The Regents of the University of California. @@ -89,19 +90,24 @@ void parstart __P((void *)); void parintr __P((void *)); void parattach __P((struct device *, struct device *, void *)); -int parmatch __P((struct device *, struct cfdata *, void *)); +int parmatch __P((struct device *, void *, void *)); -struct cfdriver parcd = { - NULL, "par", (cfmatch_t)parmatch, parattach, DV_DULL, - sizeof(struct device), NULL, 0 }; +struct cfattach par_ca = { + sizeof(struct device), parmatch, parattach +}; + +struct cfdriver par_cd = { + NULL, "par", DV_DULL, NULL, 0 +}; /*ARGSUSED*/ int -parmatch(pdp, cfp, auxp) +parmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cfp; - void *auxp; + void *match, *auxp; { + struct cfdata *cfp = match; + if (matchname((char *)auxp, "par") && cfp->cf_unit == 0) return(1); return(0); diff --git a/sys/arch/amiga/dev/sbic.c b/sys/arch/amiga/dev/sbic.c index dbf6c7ec3b9..8e40232e6ed 100644 --- a/sys/arch/amiga/dev/sbic.c +++ b/sys/arch/amiga/dev/sbic.c @@ -1,4 +1,5 @@ -/* $NetBSD: sbic.c,v 1.21 1996/01/07 22:01:54 thorpej Exp $ */ +/* $OpenBSD: sbic.c,v 1.4 1996/04/21 22:15:43 deraadt Exp $ */ +/* $NetBSD: sbic.c,v 1.22 1996/03/23 15:09:54 is Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -618,8 +619,8 @@ sbic_scsidone(acb, stat) xs->error = XS_SENSE; #ifdef DEBUG if (report_sense) - printf(" => %02x %02x\n", xs->sense.extended_flags, - xs->sense.extended_extra_bytes[3]); + printf(" => %02x %02x\n", xs->sense.flags, + xs->sense.extra_bytes[3]); #endif } else { xs->resid = 0; /* XXXX */ diff --git a/sys/arch/amiga/dev/ser.c b/sys/arch/amiga/dev/ser.c index e9bcac294cd..9eaf8a5c653 100644 --- a/sys/arch/amiga/dev/ser.c +++ b/sys/arch/amiga/dev/ser.c @@ -1,4 +1,5 @@ -/* $NetBSD: ser.c,v 1.27.2.1 1995/10/20 11:01:14 chopps Exp $ */ +/* $OpenBSD: ser.c,v 1.3 1996/04/21 22:15:45 deraadt Exp $ */ +/* $NetBSD: ser.c,v 1.30 1996/03/17 05:58:58 mhitch Exp $ */ /* * Copyright (c) 1982, 1986, 1990 The Regents of the University of California. @@ -65,16 +66,20 @@ #if NSER > 0 void serattach __P((struct device *, struct device *, void *)); -int sermatch __P((struct device *, struct cfdata *, void *)); +int sermatch __P((struct device *, void *, void *)); struct ser_softc { struct device dev; struct tty *ser_tty; }; -struct cfdriver sercd = { - NULL, "ser", (cfmatch_t)sermatch, serattach, DV_TTY, - sizeof(struct ser_softc), NULL, 0 }; +struct cfattach ser_ca = { + sizeof(struct ser_softc), sermatch, serattach +}; + +struct cfdriver ser_cd = { + NULL, "ser", DV_TTY, NULL, 0 +}; #ifndef SEROBUF_SIZE #define SEROBUF_SIZE 32 @@ -174,11 +179,12 @@ long sermintcount[16]; void sermint __P((register int unit)); int -sermatch(pdp, cfp, auxp) +sermatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cfp; - void *auxp; + void *match, *auxp; { + struct cfdata *cfp = match; + if (matchname("ser", (char *)auxp) == 0 || cfp->cf_unit != 0) return(0); if (serconsole != 0 && amiga_realconfig == 0) @@ -253,7 +259,7 @@ seropen(dev, flag, mode, p) if (ser_tty[unit]) tp = ser_tty[unit]; else - tp = ((struct ser_softc *)sercd.cd_devs[unit])->ser_tty = + tp = ((struct ser_softc *)ser_cd.cd_devs[unit])->ser_tty = ser_tty[unit] = ttymalloc(); tp->t_oproc = (void (*) (struct tty *)) serstart; diff --git a/sys/arch/amiga/dev/wesc.c b/sys/arch/amiga/dev/wesc.c index eaffbe8e548..f76ca1491fc 100644 --- a/sys/arch/amiga/dev/wesc.c +++ b/sys/arch/amiga/dev/wesc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: wesc.c,v 1.2 1996/03/30 22:18:24 niklas Exp $ */ -/* $NetBSD: wesc.c,v 1.11 1996/03/15 22:11:19 mhitch Exp $ */ +/* $OpenBSD: wesc.c,v 1.3 1996/04/21 22:15:47 deraadt Exp $ */ +/* $NetBSD: wesc.c,v 1.12 1996/03/17 01:17:55 thorpej Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -53,7 +53,7 @@ int wescprint __P((void *auxp, char *)); void wescattach __P((struct device *, struct device *, void *)); -int wescmatch __P((struct device *, struct cfdata *, void *)); +int wescmatch __P((struct device *, void *, void *)); int wesc_dmaintr __P((struct siop_softc *)); struct scsi_adapter wesc_scsiswitch = { @@ -74,19 +74,23 @@ struct scsi_device wesc_scsidev = { #ifdef DEBUG #endif -struct cfdriver wesccd = { - NULL, "wesc", (cfmatch_t)wescmatch, wescattach, - DV_DULL, sizeof(struct siop_softc), NULL, 0 }; +struct cfattach wesc_ca = { + sizeof(struct siop_softc), wescmatch, wescattach +}; + +struct cfdriver wesc_cd = { + NULL, "wesc", DV_DULL, NULL, 0 +}; /* * if we are an MacroSystemsUS Warp Engine */ int -wescmatch(pdp, cdp, auxp) +wescmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cdp; - void *auxp; + void *match, *auxp; { + struct cfdata *cdp = match; struct zbus_args *zap; zap = auxp; @@ -181,8 +185,8 @@ wesc_dump() { int i; - for (i = 0; i < wesccd.cd_ndevs; ++i) - if (wesccd.cd_devs[i]) - siop_dump(wesccd.cd_devs[i]); + for (i = 0; i < wesc_cd.cd_ndevs; ++i) + if (wesc_cd.cd_devs[i]) + siop_dump(wesc_cd.cd_devs[i]); } #endif diff --git a/sys/arch/amiga/dev/wstsc.c b/sys/arch/amiga/dev/wstsc.c index 0b129834227..760c4fb6613 100644 --- a/sys/arch/amiga/dev/wstsc.c +++ b/sys/arch/amiga/dev/wstsc.c @@ -1,4 +1,5 @@ -/* $NetBSD: wstsc.c,v 1.9 1995/08/18 15:28:17 chopps Exp $ */ +/* $OpenBSD: wstsc.c,v 1.2 1996/04/21 22:15:48 deraadt Exp $ */ +/* $NetBSD: wstsc.c,v 1.10 1996/03/17 01:17:56 thorpej Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -49,7 +50,7 @@ int wstscprint __P((void *auxp, char *)); void wstscattach __P((struct device *, struct device *, void *)); -int wstscmatch __P((struct device *, struct cfdata *, void *)); +int wstscmatch __P((struct device *, void *, void *)); int wstsc_dma_xfer_in __P((struct sci_softc *dev, int len, register u_char *buf, int phase)); @@ -85,19 +86,23 @@ extern int sci_data_wait; int supradma_pseudo = 0; /* 0=none, 1=byte, 2=word */ -struct cfdriver wstsccd = { - NULL, "wstsc", (cfmatch_t)wstscmatch, wstscattach, - DV_DULL, sizeof(struct sci_softc), NULL, 0 }; +struct cfattach wstsc_ca = { + sizeof(struct sci_softc), wstscmatch, wstscattach +}; + +struct cfdriver wstsc_cd = { + NULL, "wstsc", DV_DULL, NULL, 0 +}; /* * if this a Supra WordSync board */ int -wstscmatch(pdp, cdp, auxp) +wstscmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cdp; - void *auxp; + void *match, *auxp; { + struct cfdata *cdp = match; struct zbus_args *zap; zap = auxp; diff --git a/sys/arch/amiga/dev/zbus.c b/sys/arch/amiga/dev/zbus.c index d71ae27bce2..95089df0010 100644 --- a/sys/arch/amiga/dev/zbus.c +++ b/sys/arch/amiga/dev/zbus.c @@ -1,5 +1,5 @@ -/* $OpenBSD: zbus.c,v 1.3 1996/03/30 22:18:25 niklas Exp $ */ -/* $NetBSD: zbus.c,v 1.15 1996/03/06 20:13:32 is Exp $ */ +/* $OpenBSD: zbus.c,v 1.4 1996/04/21 22:15:50 deraadt Exp $ */ +/* $NetBSD: zbus.c,v 1.17 1996/03/28 18:41:49 is Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -126,7 +126,9 @@ static struct aconfdata aconftab[] = { /* Hacker Inc. */ { "mlhsc", 2011, 1 }, /* Resource Management Force */ - { "qn", 2011, 2 } /* QuickNet Ethernet */ + { "qn", 2011, 2 }, /* QuickNet Ethernet */ + /* ??? */ + { "empsc", 2171, 21 } /* Emplant SCSI */ }; static int naconfent = sizeof(aconftab) / sizeof(struct aconfdata); @@ -153,7 +155,7 @@ static int npreconfent = sizeof(preconftab) / sizeof(struct preconfdata); void zbusattach __P((struct device *, struct device *, void *)); int zbusprint __P((void *, char *)); -int zbusmatch __P((struct device *, struct cfdata *,void *)); +int zbusmatch __P((struct device *, void *, void *)); caddr_t zbusmap __P((caddr_t, u_int)); static char *aconflookup __P((int, int)); @@ -177,20 +179,25 @@ aconflookup(mid, pid) /* * mainbus driver */ -struct cfdriver zbuscd = { - NULL, "zbus", (cfmatch_t)zbusmatch, zbusattach, - DV_DULL, sizeof(struct device), NULL, 0 + +struct cfattach zbus_ca = { + sizeof(struct device), zbusmatch, zbusattach +}; + +struct cfdriver zbus_cd = { + NULL, "zbus", DV_DULL, NULL, 0 }; static struct cfdata *early_cfdata; /*ARGSUSED*/ int -zbusmatch(pdp, cfp, auxp) +zbusmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cfp; - void *auxp; + void *match, *auxp; { + struct cfdata *cfp = match; + if (matchname(auxp, "zbus") == 0) return(0); if (amiga_realconfig == 0) @@ -286,11 +293,11 @@ zbusprint(auxp, pnp) } /* - * this function is used to map Zorro physical I/O addresses into kernel virtual - * addresses. We don't keep track which address we map where, we don't NEED - * to know this. We made sure in amiga_init.c (by scanning all available Zorro - * devices) to have enough kva-space available, so there is no extra range - * check done here. + * this function is used to map Zorro physical I/O addresses into kernel + * virtual addresses. We don't keep track which address we map where, we don't + * NEED to know this. We made sure in amiga_init.c (by scanning all available + * Zorro devices) to have enough kva-space available, so there is no extra + * range check done here. */ caddr_t zbusmap (pa, size) diff --git a/sys/arch/amiga/dev/zssc.c b/sys/arch/amiga/dev/zssc.c index 9f9a889157e..26b734b26f0 100644 --- a/sys/arch/amiga/dev/zssc.c +++ b/sys/arch/amiga/dev/zssc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: zssc.c,v 1.4 1996/03/30 22:18:25 niklas Exp $ */ -/* $NetBSD: zssc.c,v 1.14 1996/03/15 22:11:22 mhitch Exp $ */ +/* $OpenBSD: zssc.c,v 1.5 1996/04/21 22:15:51 deraadt Exp $ */ +/* $NetBSD: zssc.c,v 1.15 1996/03/17 01:18:00 thorpej Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -52,7 +52,7 @@ int zsscprint __P((void *auxp, char *)); void zsscattach __P((struct device *, struct device *, void *)); -int zsscmatch __P((struct device *, struct cfdata *, void *)); +int zsscmatch __P((struct device *, void *, void *)); int siopintr __P((struct siop_softc *)); int zssc_dmaintr __P((struct siop_softc *)); @@ -74,19 +74,23 @@ struct scsi_device zssc_scsidev = { #ifdef DEBUG #endif -struct cfdriver zssccd = { - NULL, "zssc", (cfmatch_t)zsscmatch, zsscattach, - DV_DULL, sizeof(struct siop_softc), NULL, 0 }; +struct cfattach zssc_ca = { + sizeof(struct siop_softc), zsscmatch, zsscattach +}; + +struct cfdriver zssc_cd = { + NULL, "zssc", DV_DULL, NULL, 0 +}; /* * if we are a PPI Zeus */ int -zsscmatch(pdp, cdp, auxp) +zsscmatch(pdp, match, auxp) struct device *pdp; - struct cfdata *cdp; - void *auxp; + void *match, *auxp; { + struct cfdata *cdp = match; struct zbus_args *zap; zap = auxp; @@ -205,8 +209,8 @@ zssc_dump() { int i; - for (i = 0; i < zssccd.cd_ndevs; ++i) - if (zssccd.cd_devs[i]) - siop_dump(zssccd.cd_devs[i]); + for (i = 0; i < zssc_cd.cd_ndevs; ++i) + if (zssc_cd.cd_devs[i]) + siop_dump(zssc_cd.cd_devs[i]); } #endif diff --git a/sys/arch/amiga/include/cpu.h b/sys/arch/amiga/include/cpu.h index 35cfe4bfc1e..c500a5e565b 100644 --- a/sys/arch/amiga/include/cpu.h +++ b/sys/arch/amiga/include/cpu.h @@ -1,5 +1,5 @@ -/* $OpenBSD: cpu.h,v 1.4 1996/03/30 22:18:27 niklas Exp $ */ -/* $NetBSD: cpu.h,v 1.26 1996/03/15 19:47:48 is Exp $ */ +/* $OpenBSD: cpu.h,v 1.5 1996/04/21 22:15:55 deraadt Exp $ */ +/* $NetBSD: cpu.h,v 1.28 1996/03/30 16:22:55 is Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -175,6 +175,21 @@ int machineid, mmutype, fputype; #define IC40_ENABLE 0x00008000 /* enable instruction cache */ #define DC40_ENABLE 0x80000000 /* enable data cache */ +/* additional fields in the 68060 cache control register */ + +#define DC60_NAD 0x40000000 /* no allocate mode, data cache */ +#define DC60_ESB 0x20000000 /* enable store buffer */ +#define DC60_DPI 0x10000000 /* disable CPUSH invalidation */ +#define DC60_FOC 0x08000000 /* four kB data cache mode (else 8) */ + +#define IC60_EBC 0x00800000 /* enable branch cache */ +#define IC60_CABC 0x00400000 /* clear all branch cache entries */ +#define IC60_CUBC 0x00200000 /* clear user branch cache entries */ + +#define IC60_NAI 0x00004000 /* no allocate mode, instr. cache */ +#define IC60_FIC 0x00002000 /* four kB instr. cache (else 8) */ + + #define CACHE_ON (DC_WA|DC_BE|DC_CLR|DC_ENABLE|IC_BE|IC_CLR|IC_ENABLE) #define CACHE_OFF (DC_CLR|IC_CLR) #define CACHE_CLR (CACHE_ON) @@ -185,6 +200,9 @@ int machineid, mmutype, fputype; #define CACHE40_ON (IC40_ENABLE|DC40_ENABLE) #define CACHE40_OFF 0x00000000 +#define CACHE60_ON (CACHE40_ON |IC60_CABC|IC60_EBC|DC60_ESB) +#define CACHE60_OFF (CACHE40_OFF|IC60_CABC) + /* * CTL_MACHDEP definitions. */ |