summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmatthew <jmatthew@openbsd.org>2020-06-21 05:15:14 +0000
committerjmatthew <jmatthew@openbsd.org>2020-06-21 05:15:14 +0000
commit12b3627c33a815ce80f370e6fc6c0a80276e1ddd (patch)
treecd779019a7a13a7292e979d1d376b32b2669386b
parentknf: the inp_upcall line was too long. (diff)
downloadwireguard-openbsd-12b3627c33a815ce80f370e6fc6c0a80276e1ddd.tar.xz
wireguard-openbsd-12b3627c33a815ce80f370e6fc6c0a80276e1ddd.zip
The onboard interfaces on T7/S7 machines don't provide a valid MAC address
for themselves, so use the "local-mac-address" Open Firmware property instead, as done in ix(4). ok dlg@
Diffstat (limited to '')
-rw-r--r--sys/dev/pci/if_ixl.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/dev/pci/if_ixl.c b/sys/dev/pci/if_ixl.c
index 2ce6e7db675..2401f09e76c 100644
--- a/sys/dev/pci/if_ixl.c
+++ b/sys/dev/pci/if_ixl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ixl.c,v 1.48 2020/05/09 08:39:11 jmatthew Exp $ */
+/* $OpenBSD: if_ixl.c,v 1.49 2020/06/21 05:15:14 jmatthew Exp $ */
/*
* Copyright (c) 2013-2015, Intel Corporation
@@ -81,6 +81,10 @@
#include <dev/pci/pcivar.h>
#include <dev/pci/pcidevs.h>
+#ifdef __sparc64__
+#include <dev/ofw/openfirm.h>
+#endif
+
#define I40E_MASK(mask, shift) ((mask) << (shift))
#define I40E_PF_RESET_WAIT_COUNT 200
#define I40E_AQ_LARGE_BUF 512
@@ -3313,6 +3317,12 @@ ixl_get_mac(struct ixl_softc *sc)
struct ixl_aq_mac_addresses *addrs;
int rv;
+#ifdef __sparc64__
+ if (OF_getprop(PCITAG_NODE(sc->sc_tag), "local-mac-address",
+ sc->sc_ac.ac_enaddr, ETHER_ADDR_LEN) == ETHER_ADDR_LEN)
+ return (0);
+#endif
+
if (ixl_dmamem_alloc(sc, &idm, sizeof(*addrs), 0) != 0) {
printf(", unable to allocate mac addresses\n");
return (-1);