diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2018-05-28 08:22:42 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2018-05-28 08:22:42 +0000 |
commit | 81f41f23549c2bafe30bb8300dd8e978a227c911 (patch) | |
tree | 67758baef13b4cd3d858d13ec1f662517abf9e0a /sys | |
parent | 14f744c46fe559c631d29fe8a66d24d5b6e2a037 (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.c | 6 |
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. */ |