From 81f41f23549c2bafe30bb8300dd8e978a227c911 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Mon, 28 May 2018 08:22:42 +0000 Subject: Get MAC address from "local-mac-address" property if provided. ok patrick@, visa@ --- sys/dev/fdt/if_dwxe.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sys') 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 @@ -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. */ -- cgit v1.2.3