From: briggs Date: Mon, 14 Apr 1997 00:45:41 +0000 (+0000) Subject: Use an offset parameter when loading the reg_map--some cards use the "other" X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=455611b2a5ff2e57bda2552bfed6f772b55cbe2d;p=openbsd Use an offset parameter when loading the reg_map--some cards use the "other" 16 bits of the words. --- diff --git a/sys/arch/mac68k/dev/if_sn_nubus.c b/sys/arch/mac68k/dev/if_sn_nubus.c index 6831488e29f..d495ccfacea 100644 --- a/sys/arch/mac68k/dev/if_sn_nubus.c +++ b/sys/arch/mac68k/dev/if_sn_nubus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sn_nubus.c,v 1.8 1997/04/13 16:44:01 briggs Exp $ */ +/* $OpenBSD: if_sn_nubus.c,v 1.9 1997/04/14 00:45:41 briggs Exp $ */ /* * Copyright (C) 1997 Allen Briggs @@ -104,7 +104,7 @@ sn_nubus_attach(parent, self, aux) { struct sn_softc *sc = (void *)self; struct nubus_attach_args *na = (struct nubus_attach_args *)aux; - int i, success; + int i, success, offset; bus_space_tag_t bst; bus_space_handle_t bsh, tmp_bsh; @@ -142,6 +142,7 @@ sn_nubus_attach(parent, self, aux) sn_get_enaddr(bst, tmp_bsh, 0, sc->sc_arpcom.ac_enaddr); + offset = 2; success = 1; break; @@ -164,6 +165,7 @@ sn_nubus_attach(parent, self, aux) sn_get_enaddr(bst, tmp_bsh, 0, sc->sc_arpcom.ac_enaddr); + offset = 0; success = 1; break; @@ -189,7 +191,7 @@ sn_nubus_attach(parent, self, aux) snsetup(sc); /* Regs are addressed as words, big endian. */ for (i = 0; i < SN_NREGS; i++) { - sc->sc_reg_map[i] = (bus_size_t)((i * 4) + 2); + sc->sc_reg_map[i] = (bus_size_t)((i * 4) + offset); } /* snsetup returns 1 if something fails */