diff options
| author | scw <scw@NetBSD.org> | 2003-11-26 14:29:37 +0000 |
|---|---|---|
| committer | scw <scw@NetBSD.org> | 2003-11-26 14:29:37 +0000 |
| commit | 91c88f7f6bf33be01160aac078d1af4d9985c62b (patch) | |
| tree | 588949e83549df0bb79ab2c3d80536ed0a354093 /sys/dev | |
| parent | e6085b4b12de95651a198c865cff163b5dbdc8e7 (diff) | |
In the match routine, check to see if we can access the SCSI controller's
registers without generating a bus error. This can happen on some board
variants which have no SCSI controller.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/mvme/osiop_pcctwo.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sys/dev/mvme/osiop_pcctwo.c b/sys/dev/mvme/osiop_pcctwo.c index 620ee102699..a6f78e77ad1 100644 --- a/sys/dev/mvme/osiop_pcctwo.c +++ b/sys/dev/mvme/osiop_pcctwo.c @@ -1,4 +1,4 @@ -/* $NetBSD: osiop_pcctwo.c,v 1.5 2003/07/14 15:47:20 lukem Exp $ */ +/* $NetBSD: osiop_pcctwo.c,v 1.6 2003/11/26 14:29:37 scw Exp $ */ /*- * Copyright (c) 1999, 2002 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: osiop_pcctwo.c,v 1.5 2003/07/14 15:47:20 lukem Exp $"); +__KERNEL_RCSID(0, "$NetBSD: osiop_pcctwo.c,v 1.6 2003/11/26 14:29:37 scw Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -87,12 +87,24 @@ osiop_pcctwo_match(parent, cf, args) void *args; { struct pcctwo_attach_args *pa; + bus_space_handle_t bsh; + int rv; pa = args; if (strcmp(pa->pa_name, osiop_cd.cd_name)) return (0); + /* + * See if the SCSI controller is responding. + */ + if (bus_space_map(pa->pa_bust, pa->pa_offset, OSIOP_NREGS, 0, &bsh)) + return (0); + rv = bus_space_peek_1(pa->pa_bust, bsh, OSIOP_CTEST8, NULL); + bus_space_unmap(pa->pa_bust, bsh, OSIOP_NREGS); + if (rv) + return (0); + pa->pa_ipl = cf->pcctwocf_ipl; return (1); |
