Fix confusion about the return value from the internal MI probe routine.
Make the ISA probe actually (silently) fail if no card is found. XXX - need to aquire the SBUS variant of this card some day or have Jaromir find an MCA one.
This commit is contained in:
parent
642b1a7163
commit
8a2d9422bd
|
@ -30,7 +30,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: daic.c,v 1.8 2002/03/24 20:35:45 martin Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: daic.c,v 1.9 2002/03/25 09:08:10 martin Exp $");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
|
@ -141,15 +141,15 @@ cardtypename(cardtype)
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
* Probe for presence of device at given io space.
|
* Probe for presence of device at given io space.
|
||||||
* Return: 0 no card identified
|
* Return the card type (stupid ISA needs to know this in advance, to
|
||||||
* 1 card found
|
* calculate the share memory size).
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
int
|
int
|
||||||
daic_probe(bus, io)
|
daic_probe(bus, io)
|
||||||
bus_space_tag_t bus;
|
bus_space_tag_t bus;
|
||||||
bus_space_handle_t io;
|
bus_space_handle_t io;
|
||||||
{
|
{
|
||||||
return (daic_reset(bus, io, 0, NULL) > 0);
|
return (daic_reset(bus, io, 0, NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: daic_isa.c,v 1.5 2002/03/22 09:54:17 martin Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: daic_isa.c,v 1.6 2002/03/25 09:08:09 martin Exp $");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/errno.h>
|
#include <sys/errno.h>
|
||||||
|
@ -82,7 +82,7 @@ daic_isa_probe(parent, cf, aux)
|
||||||
struct isa_attach_args *ia = aux;
|
struct isa_attach_args *ia = aux;
|
||||||
bus_space_tag_t memt = ia->ia_memt;
|
bus_space_tag_t memt = ia->ia_memt;
|
||||||
bus_space_handle_t memh;
|
bus_space_handle_t memh;
|
||||||
int card;
|
int card, need_unmap = 0;
|
||||||
|
|
||||||
/* We need some controller memory to comunicate! */
|
/* We need some controller memory to comunicate! */
|
||||||
if (ia->ia_iomem[0].ir_addr == 0 || ia->ia_iomem[0].ir_size == -1)
|
if (ia->ia_iomem[0].ir_addr == 0 || ia->ia_iomem[0].ir_size == -1)
|
||||||
|
@ -97,6 +97,7 @@ daic_isa_probe(parent, cf, aux)
|
||||||
if (bus_space_map(memt, ia->ia_iomem[0].ir_addr, ia->ia_iomem[0].ir_size,
|
if (bus_space_map(memt, ia->ia_iomem[0].ir_addr, ia->ia_iomem[0].ir_size,
|
||||||
0, &memh))
|
0, &memh))
|
||||||
goto bad;
|
goto bad;
|
||||||
|
need_unmap = 1;
|
||||||
|
|
||||||
/* MI check for card at this location */
|
/* MI check for card at this location */
|
||||||
card = daic_probe(memt, memh);
|
card = daic_probe(memt, memh);
|
||||||
|
@ -109,8 +110,9 @@ daic_isa_probe(parent, cf, aux)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
bad:
|
bad:
|
||||||
/* unmap card RAM */
|
/* unmap card RAM if already mapped */
|
||||||
bus_space_unmap(memt, memh, DAIC_ISA_MEMSIZE);
|
if (need_unmap)
|
||||||
|
bus_space_unmap(memt, memh, DAIC_ISA_MEMSIZE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue