summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2018-05-28 08:22:42 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2018-05-28 08:22:42 +0000
commit81f41f23549c2bafe30bb8300dd8e978a227c911 (patch)
tree67758baef13b4cd3d858d13ec1f662517abf9e0a /sys
parent14f744c46fe559c631d29fe8a66d24d5b6e2a037 (diff)
Get MAC address from "local-mac-address" property if provided.
ok patrick@, visa@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/fdt/if_dwxe.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/fdt/if_dwxe.c b/sys/dev/fdt/if_dwxe.c
index e8a70487de0..d7ba5b72675 100644
--- a/sys/dev/fdt/if_dwxe.c
+++ b/sys/dev/fdt/if_dwxe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_dwxe.c,v 1.8 2018/05/27 16:19:25 kettenis Exp $ */
+/* $OpenBSD: if_dwxe.c,v 1.9 2018/05/28 08:22:41 kettenis Exp $ */
/*
* Copyright (c) 2008 Mark Kettenis
* Copyright (c) 2017 Patrick Wildt <patrick@blueri.se>
@@ -411,7 +411,9 @@ dwxe_attach(struct device *parent, struct device *self, void *aux)
else
sc->sc_clk = DWXE_MDIO_CMD_MDC_DIV_RATIO_M_16;
- dwxe_lladdr_read(sc, sc->sc_lladdr);
+ if (OF_getprop(faa->fa_node, "local-mac-address",
+ &sc->sc_lladdr, ETHER_ADDR_LEN) != ETHER_ADDR_LEN)
+ dwxe_lladdr_read(sc, sc->sc_lladdr);
printf(": address %s\n", ether_sprintf(sc->sc_lladdr));
/* Do hardware specific initializations. */