summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_myx.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2011-06-22 04:03:02 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2011-06-22 04:03:02 +0000
commitfd59343da639bc6f8a931ae121c393a31fb56dd0 (patch)
treed071b01ec78e66da3777ac29568a7269e0b3bb57 /sys/dev/pci/if_myx.c
parent6ea77c720c86d80556e217bd293f549f6376e151 (diff)
set the mac address on the chip correctly (repair the byte order)
it now works on sparc64, too ok dlg
Diffstat (limited to 'sys/dev/pci/if_myx.c')
-rw-r--r--sys/dev/pci/if_myx.c7
1 files changed, 4 insertions, 3 deletions
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 <reyk@openbsd.org>
@@ -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);