From fd59343da639bc6f8a931ae121c393a31fb56dd0 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Wed, 22 Jun 2011 04:03:02 +0000 Subject: set the mac address on the chip correctly (repair the byte order) it now works on sparc64, too ok dlg --- sys/dev/pci/if_myx.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sys/dev/pci/if_myx.c') diff --git a/sys/dev/pci/if_myx.c b/sys/dev/pci/if_myx.c index c7b38e9fb23..972decd5684 100644 --- a/sys/dev/pci/if_myx.c +++ b/sys/dev/pci/if_myx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_myx.c,v 1.21 2011/06/22 03:54:31 dlg Exp $ */ +/* $OpenBSD: if_myx.c,v 1.22 2011/06/22 04:03:01 deraadt Exp $ */ /* * Copyright (c) 2007 Reyk Floeter @@ -1222,8 +1222,9 @@ myx_setlladdr(struct myx_softc *sc, u_int32_t cmd, u_int8_t *addr) struct myx_cmd mc; bzero(&mc, sizeof(mc)); - mc.mc_data0 = addr[0] | addr[1] << 8 | addr[2] << 16 | addr[3] << 24; - mc.mc_data1 = addr[4] << 16 | addr[5] << 24; + mc.mc_data0 = htobe32(addr[0] << 24 | addr[1] << 16 | addr[2] << 8 | addr[3]); + mc.mc_data1 = htobe32(addr[4] << 8 | addr[5]); + if (myx_cmd(sc, cmd, &mc, NULL) != 0) { printf("%s: failed to set the lladdr\n", DEVNAME(sc)); return (-1); -- cgit v1.2.3