diff options
author | briggs <briggs@cvs.openbsd.org> | 1997-04-13 14:14:53 +0000 |
---|---|---|
committer | briggs <briggs@cvs.openbsd.org> | 1997-04-13 14:14:53 +0000 |
commit | 46d303c50eacb3e3911a1d487c30b64bdbbc6bd7 (patch) | |
tree | 95568fd6b090e18f973cb0e6664de393bc51cee3 /sys/arch/mac68k/dev/if_sn_nubus.c | |
parent | aab789203464cef522ee13e6b3d5c5f3e3f70ab8 (diff) |
Some updates based on information from Bob Nestor <rnestor@metronet.com>
about his SONIC-T LC/PDS card.
Diffstat (limited to 'sys/arch/mac68k/dev/if_sn_nubus.c')
-rw-r--r-- | sys/arch/mac68k/dev/if_sn_nubus.c | 51 |
1 files changed, 14 insertions, 37 deletions
diff --git a/sys/arch/mac68k/dev/if_sn_nubus.c b/sys/arch/mac68k/dev/if_sn_nubus.c index 37cf8af20ae..2c0b47e0dce 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.6 1997/04/10 00:17:42 briggs Exp $ */ +/* $OpenBSD: if_sn_nubus.c,v 1.7 1997/04/13 14:14:51 briggs Exp $ */ /* * Copyright (C) 1997 Allen Briggs @@ -54,8 +54,6 @@ static int sn_nubus_match __P((struct device *, void *, void *)); static void sn_nubus_attach __P((struct device *, struct device *, void *)); static int sn_nb_card_vendor __P((struct nubus_attach_args *)); -static int sn_nb_get_enaddr __P((struct nubus_attach_args *, - u_int8_t *, int)); struct cfattach sn_nubus_ca = { sizeof(struct sn_softc), sn_nubus_match, sn_nubus_attach @@ -142,17 +140,9 @@ sn_nubus_attach(parent, self, aux) break; } - /* - * Copy out the ethernet address from the card's ROM - * - * See if_sn_obio.c for a discussion of bit reversal - * in Apple's MAC address PROMs. As far as I can tell - * Dayna stores their Mac address in ethernet format, - * not Token Ring. - */ - for (i = 0; i < ETHER_ADDR_LEN; ++i) - sc->sc_arpcom.ac_enaddr[i] = - bus_space_read_1(bst, tmp_bsh, i); + sn_get_enaddr(bst, tmp_bsh, 0, sc->sc_arpcom.ac_enaddr); + + bus_space_unmap(bst, tmp_bsh, ETHER_ADDR_LEN); success = 1; break; @@ -162,13 +152,21 @@ sn_nubus_attach(parent, self, aux) DCR_DMABLOCK | DCR_RFT16 | DCR_TFT16; sc->snr_dcr2 = 0; - if (bus_space_subregion(bst, bsh, 0x00180000, SN_REGSIZE, + if (bus_space_subregion(bst, bsh, 0x0, SN_REGSIZE, &sc->sc_regh)) { printf(": failed to map register space.\n"); break; } - sn_nb_get_enaddr(na, sc->sc_arpcom.ac_enaddr, 0x8); + if (bus_space_subregion(bst, bsh, 0x40000, ETHER_ADDR_LEN, + &tmp_bsh)) { + printf(": failed to map ROM space.\n"); + break; + } + + sn_get_enaddr(bst, tmp_bsh, 0, sc->sc_arpcom.ac_enaddr); + + bus_space_unmap(bst, tmp_bsh, ETHER_ADDR_LEN); success = 1; break; @@ -265,24 +263,3 @@ sn_nb_card_vendor(na) } return vendor; } - -static int -sn_nb_get_enaddr(na, ep, rsrc1) - struct nubus_attach_args *na; - u_int8_t *ep; - int rsrc1; -{ - nubus_dir dir; - nubus_dirent dirent; - - nubus_get_main_dir(na->fmt, &dir); - if (nubus_find_rsrc(na->fmt, &dir, na->rsrcid, &dirent) <= 0) - return 1; - nubus_get_dir_from_rsrc(na->fmt, &dirent, &dir); - if (nubus_find_rsrc(na->fmt, &dir, rsrc1, &dirent) <= 0) - return 1; - if (nubus_get_ind_data(na->fmt, &dirent, ep, ETHER_ADDR_LEN) <= 0) - return 1; - - return 0; -} |