diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2009-04-13 21:14:42 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2009-04-13 21:14:42 +0000 |
commit | 965d0314e696574208eb46763d7b45a3989da26e (patch) | |
tree | b99b032e389e1eb51094788895f6192df929d9e1 /sys/arch | |
parent | 06f86f5b126a0db318a3036151c0c5eade275c88 (diff) |
Also match on Uniqueware family 0x91, and correctly report the third byte
of the Ethernet address.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/sgi/dev/owmac.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/sys/arch/sgi/dev/owmac.c b/sys/arch/sgi/dev/owmac.c index c178a3591aa..bd8f60f4704 100644 --- a/sys/arch/sgi/dev/owmac.c +++ b/sys/arch/sgi/dev/owmac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: owmac.c,v 1.1 2008/04/07 22:55:57 miod Exp $ */ +/* $OpenBSD: owmac.c,v 1.2 2009/04/13 21:14:41 miod Exp $ */ /* * Copyright (c) 2008 Miodrag Vallat. @@ -61,8 +61,20 @@ void owmac_read_mac(struct owmac_softc *); int owmac_match(struct device *parent, void *match, void *aux) { - return (onewire_matchbyfam(aux, owmac_fams, - sizeof(owmac_fams) /sizeof(owmac_fams[0]))); + struct onewire_attach_args *oa = aux; + + if (ONEWIRE_ROM_FAMILY_TYPE(oa->oa_rom) == ONEWIRE_FAMILY_DS1982) + return 1; + + /* + * Also match on UniqueWare devices with specific 0x91 family code. + */ + if ((ONEWIRE_ROM_SN(oa->oa_rom) >> (48 - 12)) == 0x5e7 && + ONEWIRE_ROM_FAMILY_CUSTOM(oa->oa_rom) && + ONEWIRE_ROM_FAMILY(oa->oa_rom) == 0x91) + return 1; + + return 0; } void @@ -174,7 +186,7 @@ owmac_read_mac(struct owmac_softc *sc) sc->sc_enaddr[0] = buf[10]; sc->sc_enaddr[1] = buf[9]; - sc->sc_enaddr[2] = buf[0]; + sc->sc_enaddr[2] = buf[8]; sc->sc_enaddr[3] = buf[7]; sc->sc_enaddr[4] = buf[6]; sc->sc_enaddr[5] = buf[5]; |