Avoid "false positives" in match routines.

This commit is contained in:
pk 1997-06-10 20:59:10 +00:00
parent 2851bca951
commit 1ab49e584f
3 changed files with 35 additions and 24 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ie.c,v 1.30 1997/05/24 20:16:24 pk Exp $ */
/* $NetBSD: if_ie.c,v 1.31 1997/06/10 20:59:14 pk Exp $ */
/*-
* Copyright (c) 1993, 1994, 1995 Charles Hannum.
@ -411,23 +411,22 @@ iematch(parent, cf, aux)
if (strcmp(cf->cf_driver->cd_name, ra->ra_name)) /* correct name? */
return (0);
if (ca->ca_bustype == BUS_SBUS)
switch (ca->ca_bustype) {
case BUS_SBUS:
default:
return (0);
if (CPU_ISSUN4) {
/*
* XXX need better probe here so we can figure out what we've got
*/
if (ca->ca_bustype == BUS_OBIO) {
if (probeget(ra->ra_vaddr, 1) == -1)
return (0);
return(1);
}
if (probeget(ra->ra_vaddr, 2) == -1)
return (0);
case BUS_OBIO:
if (probeget(ra->ra_vaddr, 1) != -1)
return (1);
break;
case BUS_VME16:
case BUS_VME32:
if (probeget(ra->ra_vaddr, 2) != -1)
return (1);
break;
}
return (1);
return (0);
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: xd.c,v 1.31 1997/05/24 20:16:34 pk Exp $ */
/* $NetBSD: xd.c,v 1.32 1997/06/10 20:59:12 pk Exp $ */
/*
*
@ -36,7 +36,7 @@
* x d . c x y l o g i c s 7 5 3 / 7 0 5 3 v m e / s m d d r i v e r
*
* author: Chuck Cranor <chuck@ccrc.wustl.edu>
* id: $NetBSD: xd.c,v 1.31 1997/05/24 20:16:34 pk Exp $
* id: $NetBSD: xd.c,v 1.32 1997/06/10 20:59:12 pk Exp $
* started: 27-Feb-95
* references: [1] Xylogics Model 753 User's Manual
* part number: 166-753-001, Revision B, May 21, 1988.
@ -360,7 +360,13 @@ int xdcmatch(parent, cf, aux)
if (strcmp(cf->cf_driver->cd_name, ra->ra_name))
return (0);
if (CPU_ISSUN4) {
switch (ca->ca_bustype) {
case BUS_OBIO:
case BUS_SBUS:
case BUS_VME16:
default:
return (0);
case BUS_VME32:
xdc = (struct xdc *) ra->ra_vaddr;
if (probeget((caddr_t) &xdc->xdc_csr, 1) == -1)
return (0);
@ -368,8 +374,8 @@ int xdcmatch(parent, cf, aux)
XDC_WAIT(xdc, del, XDC_RESETUSEC, XDC_RESET);
if (del <= 0)
return (0);
return (1);
}
return (1);
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: xy.c,v 1.21 1997/05/24 20:16:37 pk Exp $ */
/* $NetBSD: xy.c,v 1.22 1997/06/10 20:59:10 pk Exp $ */
/*
*
@ -36,7 +36,7 @@
* x y . c x y l o g i c s 4 5 0 / 4 5 1 s m d d r i v e r
*
* author: Chuck Cranor <chuck@ccrc.wustl.edu>
* id: $NetBSD: xy.c,v 1.21 1997/05/24 20:16:37 pk Exp $
* id: $NetBSD: xy.c,v 1.22 1997/06/10 20:59:10 pk Exp $
* started: 14-Sep-95
* references: [1] Xylogics Model 753 User's Manual
* part number: 166-753-001, Revision B, May 21, 1988.
@ -299,14 +299,20 @@ int xycmatch(parent, cf, aux)
if (strcmp(cf->cf_driver->cd_name, ra->ra_name))
return (0);
if (CPU_ISSUN4) {
switch (ca->ca_bustype) {
case BUS_OBIO:
case BUS_SBUS:
case BUS_VME32:
default:
return (0);
case BUS_VME16:
xyc = (struct xyc *) ra->ra_vaddr;
if (probeget((caddr_t) &xyc->xyc_rsetup, 1) == -1)
return (0);
if (xyc_unbusy(xyc, XYC_RESETUSEC) == XY_ERR_FAIL)
return(0);
return (1);
}
return (1);
}
/*