summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2010-02-08 12:28:42 +0000
committerjsing <jsing@openbsd.org>2010-02-08 12:28:42 +0000
commitc418e8c3f1252623c182ae736a8b73c2432dae17 (patch)
tree1aa58dc632af4a8d7e36910ea30fcb03f375ba42
parentMore destatic and ansification. (diff)
downloadwireguard-openbsd-c418e8c3f1252623c182ae736a8b73c2432dae17.tar.xz
wireguard-openbsd-c418e8c3f1252623c182ae736a8b73c2432dae17.zip
When initialising the chip actually set the hardware MAC address, thus
allowing the MAC address to be changed/set via ifconfig.
-rw-r--r--sys/dev/pci/if_lii.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/pci/if_lii.c b/sys/dev/pci/if_lii.c
index 4eedee45f5c..eeab433449d 100644
--- a/sys/dev/pci/if_lii.c
+++ b/sys/dev/pci/if_lii.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_lii.c,v 1.25 2010/02/03 14:08:41 jsing Exp $ */
+/* $OpenBSD: if_lii.c,v 1.26 2010/02/08 12:28:42 jsing Exp $ */
/*
* Copyright (c) 2007 The NetBSD Foundation.
@@ -691,6 +691,13 @@ lii_init(struct ifnet *ifp)
LII_WRITE_4(sc, LII_MACC, val);
+ /* Set the hardware MAC address. */
+ LII_WRITE_4(sc, LII_MAC_ADDR_0, letoh32((sc->sc_ac.ac_enaddr[2] << 24) |
+ (sc->sc_ac.ac_enaddr[3] << 16) | (sc->sc_ac.ac_enaddr[4] << 8) |
+ sc->sc_ac.ac_enaddr[5]));
+ LII_WRITE_4(sc, LII_MAC_ADDR_1,
+ letoh32((sc->sc_ac.ac_enaddr[0] << 8) | sc->sc_ac.ac_enaddr[1]));
+
/* Program promiscuous mode and multicast filters. */
lii_iff(sc);