compile with -Wall, update for changes to dev/ofw
This commit is contained in:
parent
0a2c48d07f
commit
09cde3ae17
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: com_ofisa.c,v 1.1 1998/02/07 00:46:45 cgd Exp $ */
|
||||
/* $NetBSD: com_ofisa.c,v 1.2 1998/03/21 02:06:17 cgd Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997, 1998
|
||||
|
@ -39,7 +39,7 @@
|
|||
|
||||
#include <sys/param.h>
|
||||
#include <sys/device.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/tty.h>
|
||||
|
||||
#include <machine/intr.h>
|
||||
|
@ -76,7 +76,7 @@ com_ofisa_probe(parent, cf, aux)
|
|||
const char *compatible_strings[] = { "pnpPNP,501", NULL };
|
||||
int rv = 0;
|
||||
|
||||
if (of_compatible(aa->ofp.phandle, compatible_strings) != -1)
|
||||
if (of_compatible(aa->oba.oba_phandle, compatible_strings) != -1)
|
||||
rv = 5;
|
||||
#ifdef _COM_OFISA_MD_MATCH
|
||||
if (!rv)
|
||||
|
@ -106,7 +106,7 @@ com_ofisa_attach(parent, self, aux)
|
|||
* We expect exactly one register region and one interrupt.
|
||||
*/
|
||||
|
||||
n = ofisa_reg_get(aa->ofp.phandle, ®, 1);
|
||||
n = ofisa_reg_get(aa->oba.oba_phandle, ®, 1);
|
||||
#ifdef _COM_OFISA_MD_REG_FIXUP
|
||||
n = com_ofisa_md_reg_fixup(parent, self, aux, ®, 1, n);
|
||||
#endif
|
||||
|
@ -115,11 +115,12 @@ com_ofisa_attach(parent, self, aux)
|
|||
return;
|
||||
}
|
||||
if (reg.len != 8) {
|
||||
printf(": weird register size (%d, expected 8)\n", reg.len);
|
||||
printf(": weird register size (%lu, expected 8)\n",
|
||||
(unsigned long)reg.len);
|
||||
return;
|
||||
}
|
||||
|
||||
n = ofisa_intr_get(aa->ofp.phandle, &intr, 1);
|
||||
n = ofisa_intr_get(aa->oba.oba_phandle, &intr, 1);
|
||||
#ifdef _COM_OFISA_MD_INTR_FIXUP
|
||||
n = com_ofisa_md_intr_fixup(parent, self, aux, &intr, 1, n);
|
||||
#endif
|
||||
|
@ -128,8 +129,8 @@ com_ofisa_attach(parent, self, aux)
|
|||
return;
|
||||
}
|
||||
|
||||
if (OF_getproplen(aa->ofp.phandle, "clock-frequency") != 4 ||
|
||||
OF_getprop(aa->ofp.phandle, "clock-frequency", freqbuf,
|
||||
if (OF_getproplen(aa->oba.oba_phandle, "clock-frequency") != 4 ||
|
||||
OF_getprop(aa->oba.oba_phandle, "clock-frequency", freqbuf,
|
||||
sizeof freqbuf) != 4)
|
||||
freq = COM_FREQ;
|
||||
else
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
# $NetBSD: files.ofisa,v 1.3 1998/02/16 22:12:50 thorpej Exp $
|
||||
# $NetBSD: files.ofisa,v 1.4 1998/03/21 02:06:17 cgd Exp $
|
||||
|
||||
# OFW ISA bus support
|
||||
# XXX eventually we should do something with these locators
|
||||
define ofisa { [i = -1], [it = -1], [iv = -1], [m = -1] }
|
||||
device ofisa: ofisa, openfirm
|
||||
attach ofisa at openfirm
|
||||
device ofisa: ofisa, ofbus
|
||||
attach ofisa at ofbus
|
||||
file dev/ofisa/ofisa.c ofisa
|
||||
|
||||
# attachment for MI com driver
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: lpt_ofisa.c,v 1.1 1998/02/07 00:46:50 cgd Exp $ */
|
||||
/* $NetBSD: lpt_ofisa.c,v 1.2 1998/03/21 02:06:17 cgd Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997, 1998
|
||||
|
@ -39,7 +39,7 @@
|
|||
|
||||
#include <sys/param.h>
|
||||
#include <sys/device.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/tty.h>
|
||||
|
||||
#include <machine/intr.h>
|
||||
|
@ -76,7 +76,7 @@ lpt_ofisa_probe(parent, cf, aux)
|
|||
const char *compatible_strings[] = { "pnpPNP,401", NULL };
|
||||
int rv = 0;
|
||||
|
||||
if (of_compatible(aa->ofp.phandle, compatible_strings) != -1)
|
||||
if (of_compatible(aa->oba.oba_phandle, compatible_strings) != -1)
|
||||
rv = 5;
|
||||
#ifdef _LPT_OFISA_MD_MATCH
|
||||
if (!rv)
|
||||
|
@ -104,7 +104,7 @@ lpt_ofisa_attach(parent, self, aux)
|
|||
* We expect exactly one register region and one interrupt.
|
||||
*/
|
||||
|
||||
n = ofisa_reg_get(aa->ofp.phandle, ®, 1);
|
||||
n = ofisa_reg_get(aa->oba.oba_phandle, ®, 1);
|
||||
#ifdef _LPT_OFISA_MD_REG_FIXUP
|
||||
n = lpt_ofisa_md_reg_fixup(parent, self, aux, ®, 1, n);
|
||||
#endif
|
||||
|
@ -113,12 +113,12 @@ lpt_ofisa_attach(parent, self, aux)
|
|||
return;
|
||||
}
|
||||
if (reg.len != 4 && reg.len != 8) {
|
||||
printf(": weird register size (%d, expected 4 or 8)\n",
|
||||
reg.len);
|
||||
printf(": weird register size (%lu, expected 4 or 8)\n",
|
||||
(unsigned long)reg.len);
|
||||
return;
|
||||
}
|
||||
|
||||
n = ofisa_intr_get(aa->ofp.phandle, &intr, 1);
|
||||
n = ofisa_intr_get(aa->oba.oba_phandle, &intr, 1);
|
||||
#ifdef _LPT_OFISA_MD_INTR_FIXUP
|
||||
n = lpt_ofisa_md_intr_fixup(parent, self, aux, &intr, 1, n);
|
||||
#endif
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ofisa.c,v 1.1 1998/02/07 00:46:52 cgd Exp $ */
|
||||
/* $NetBSD: ofisa.c,v 1.2 1998/03/21 02:06:17 cgd Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997, 1998
|
||||
|
@ -53,9 +53,7 @@ struct cfattach ofisa_ca = {
|
|||
sizeof(struct device), ofisamatch, ofisaattach
|
||||
};
|
||||
|
||||
struct cfdriver ofisa_cd = {
|
||||
NULL, "ofisa", DV_DULL
|
||||
};
|
||||
extern struct cfdriver ofisa_cd;
|
||||
|
||||
static int ofisaprint __P((void *, const char *));
|
||||
|
||||
|
@ -64,10 +62,10 @@ ofisaprint(aux, pnp)
|
|||
void *aux;
|
||||
const char *pnp;
|
||||
{
|
||||
struct ofprobe *ofp = aux;
|
||||
struct ofbus_attach_args *oba = aux;
|
||||
char name[64];
|
||||
|
||||
(void)of_packagename(ofp->phandle, name, sizeof name);
|
||||
(void)of_packagename(oba->oba_phandle, name, sizeof name);
|
||||
if (pnp)
|
||||
printf("%s at %s", name, pnp);
|
||||
else
|
||||
|
@ -81,11 +79,11 @@ ofisamatch(parent, cf, aux)
|
|||
struct cfdata *cf;
|
||||
void *aux;
|
||||
{
|
||||
struct ofprobe *ofp = aux;
|
||||
struct ofbus_attach_args *oba = aux;
|
||||
const char *compatible_strings[] = { "pnpPNP,a00", NULL };
|
||||
int rv = 0;
|
||||
|
||||
if (of_compatible(ofp->phandle, compatible_strings) != -1)
|
||||
if (of_compatible(oba->oba_phandle, compatible_strings) != -1)
|
||||
rv = 5;
|
||||
|
||||
#ifdef _OFISA_MD_MATCH
|
||||
|
@ -102,26 +100,27 @@ ofisaattach(parent, dev, aux)
|
|||
void *aux;
|
||||
{
|
||||
|
||||
struct ofprobe *ofp = aux;
|
||||
struct ofbus_attach_args *oba = aux;
|
||||
struct isabus_attach_args iba;
|
||||
struct ofisa_attach_args aa;
|
||||
int child;
|
||||
|
||||
if (ofisa_get_isabus_data(ofp->phandle, &iba) < 0) {
|
||||
if (ofisa_get_isabus_data(oba->oba_phandle, &iba) < 0) {
|
||||
printf(": couldn't get essential bus data\n");
|
||||
return;
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
|
||||
for (child = OF_child(ofp->phandle); child;
|
||||
for (child = OF_child(oba->oba_phandle); child;
|
||||
child = OF_peer(child)) {
|
||||
if (ofisa_ignore_child(ofp->phandle, child))
|
||||
if (ofisa_ignore_child(oba->oba_phandle, child))
|
||||
continue;
|
||||
|
||||
bzero(&aa, sizeof aa);
|
||||
|
||||
aa.ofp.phandle = child;
|
||||
aa.oba.oba_busname = "ofw"; /* XXX */
|
||||
aa.oba.oba_phandle = child;
|
||||
aa.iot = iba.iba_iot;
|
||||
aa.memt = iba.iba_memt;
|
||||
aa.dmat = iba.iba_dmat;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ofisavar.h,v 1.1 1998/02/07 00:46:54 cgd Exp $ */
|
||||
/* $NetBSD: ofisavar.h,v 1.2 1998/03/21 02:06:17 cgd Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1998
|
||||
|
@ -37,7 +37,7 @@
|
|||
#define _DEV_OFISA_OFISAVAR_H_
|
||||
|
||||
struct ofisa_attach_args {
|
||||
struct ofprobe ofp; /* common */
|
||||
struct ofbus_attach_args oba; /* common */
|
||||
|
||||
bus_space_tag_t iot; /* i/o space tag */
|
||||
bus_space_tag_t memt; /* mem space tag */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: wdc_ofisa.c,v 1.1 1998/02/07 00:46:56 cgd Exp $ */
|
||||
/* $NetBSD: wdc_ofisa.c,v 1.2 1998/03/21 02:06:17 cgd Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997, 1998
|
||||
|
@ -39,7 +39,7 @@
|
|||
|
||||
#include <sys/param.h>
|
||||
#include <sys/device.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/tty.h>
|
||||
|
||||
#include <machine/intr.h>
|
||||
|
@ -76,7 +76,7 @@ wdc_ofisa_probe(parent, cf, aux)
|
|||
const char *compatible_strings[] = { "pnpPNP,600", NULL };
|
||||
int rv = 0;
|
||||
|
||||
if (of_compatible(aa->ofp.phandle, compatible_strings) != -1)
|
||||
if (of_compatible(aa->oba.oba_phandle, compatible_strings) != -1)
|
||||
rv = 5;
|
||||
#ifdef _WDC_OFISA_MD_MATCH
|
||||
if (!rv)
|
||||
|
@ -104,7 +104,7 @@ wdc_ofisa_attach(parent, self, aux)
|
|||
* We expect exactly two register regions and one interrupt.
|
||||
*/
|
||||
|
||||
n = ofisa_reg_get(aa->ofp.phandle, reg, 2);
|
||||
n = ofisa_reg_get(aa->oba.oba_phandle, reg, 2);
|
||||
#ifdef _WDC_OFISA_MD_REG_FIXUP
|
||||
n = wdc_ofisa_md_reg_fixup(parent, self, aux, reg, 2, n);
|
||||
#endif
|
||||
|
@ -113,12 +113,12 @@ wdc_ofisa_attach(parent, self, aux)
|
|||
return;
|
||||
}
|
||||
if (reg[0].len != 8 || reg[1].len != 2) {
|
||||
printf(": weird register size (%d/%d, expected 8/2)\n",
|
||||
reg[0].len, reg[1].len);
|
||||
printf(": weird register size (%lu/%lu, expected 8/2)\n",
|
||||
(unsigned long)reg[0].len, (unsigned long)reg[1].len);
|
||||
return;
|
||||
}
|
||||
|
||||
n = ofisa_intr_get(aa->ofp.phandle, &intr, 1);
|
||||
n = ofisa_intr_get(aa->oba.oba_phandle, &intr, 1);
|
||||
#ifdef _WDC_OFISA_MD_INTR_FIXUP
|
||||
n = wdc_ofisa_md_intr_fixup(parent, self, aux, &intr, 1, n);
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue