diff --git a/sys/arch/mac68k/dev/if_sn_obio.c b/sys/arch/mac68k/dev/if_sn_obio.c index 11f0d4f3a868..1cc5593f2830 100644 --- a/sys/arch/mac68k/dev/if_sn_obio.c +++ b/sys/arch/mac68k/dev/if_sn_obio.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_sn_obio.c,v 1.11 1997/08/11 22:53:34 scottr Exp $ */ +/* $NetBSD: if_sn_obio.c,v 1.12 1997/10/09 00:08:00 briggs Exp $ */ /* * Copyright (C) 1997 Allen Briggs @@ -74,10 +74,23 @@ sn_obio_match(parent, cf, aux) struct cfdata *cf; void *aux; { - if (mac68k_machine.sonic) - return 1; + struct obio_attach_args *oa = (struct obio_attach_args *)aux; + bus_space_handle_t bsh; + int found = 0; - return 0; + if (!mac68k_machine.sonic) + return 0; + + if (bus_space_map(oa->oa_tag, + SONIC_REG_BASE, SN_REGSIZE, 0, &bsh)) + return 0; + + if (bus_probe(oa->oa_tag, bsh, 0, 4)) + found = 1; + + bus_space_unmap(oa->oa_tag, bsh, SN_REGSIZE); + + return found; } /* diff --git a/sys/arch/mac68k/obio/if_sn_obio.c b/sys/arch/mac68k/obio/if_sn_obio.c index 11f0d4f3a868..1cc5593f2830 100644 --- a/sys/arch/mac68k/obio/if_sn_obio.c +++ b/sys/arch/mac68k/obio/if_sn_obio.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_sn_obio.c,v 1.11 1997/08/11 22:53:34 scottr Exp $ */ +/* $NetBSD: if_sn_obio.c,v 1.12 1997/10/09 00:08:00 briggs Exp $ */ /* * Copyright (C) 1997 Allen Briggs @@ -74,10 +74,23 @@ sn_obio_match(parent, cf, aux) struct cfdata *cf; void *aux; { - if (mac68k_machine.sonic) - return 1; + struct obio_attach_args *oa = (struct obio_attach_args *)aux; + bus_space_handle_t bsh; + int found = 0; - return 0; + if (!mac68k_machine.sonic) + return 0; + + if (bus_space_map(oa->oa_tag, + SONIC_REG_BASE, SN_REGSIZE, 0, &bsh)) + return 0; + + if (bus_probe(oa->oa_tag, bsh, 0, 4)) + found = 1; + + bus_space_unmap(oa->oa_tag, bsh, SN_REGSIZE); + + return found; } /*