diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2007-04-16 22:17:55 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2007-04-16 22:17:55 +0000 |
commit | 2f9e8b9c080bddf7b7ce74dae7d994089ddeff91 (patch) | |
tree | 9bb424af7d10aa7d6d2132903d648abdcd9e0c23 /sys/dev/pci/if_tht.c | |
parent | 809da57b02f9ec3b3ab8d64f7e08a8cdcabf55f3 (diff) |
do some byteswapping to make the mac address look more believable. i dont
know if this will work on big endian machines but its should be trivial
to fix.
Diffstat (limited to 'sys/dev/pci/if_tht.c')
-rw-r--r-- | sys/dev/pci/if_tht.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/dev/pci/if_tht.c b/sys/dev/pci/if_tht.c index 687ad57b411..61fa862db75 100644 --- a/sys/dev/pci/if_tht.c +++ b/sys/dev/pci/if_tht.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tht.c,v 1.13 2007/04/16 15:14:38 dlg Exp $ */ +/* $OpenBSD: if_tht.c,v 1.14 2007/04/16 22:17:54 dlg Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -287,9 +287,15 @@ tht_intr(void *arg) void tht_read_lladdr(struct tht_softc *sc) { - sc->sc_lladdr[0] = tht_read(sc, THT_REG_RG_RX_UNC_MAC2); - sc->sc_lladdr[1] = tht_read(sc, THT_REG_RG_RX_UNC_MAC1); - sc->sc_lladdr[2] = tht_read(sc, THT_REG_RG_RX_UNC_MAC0); + const static bus_size_t r[3] = { + THT_REG_RG_RX_UNC_MAC2, + THT_REG_RG_RX_UNC_MAC1, + THT_REG_RG_RX_UNC_MAC0 + }; + int i; + + for (i = 0; i < sizeofa(r); i++) + sc->sc_lladdr[i] = swap16(tht_read(sc, r[i])); } u_int32_t |