summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2014-11-26 17:03:53 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2014-11-26 17:03:53 +0000
commit2f7493581a9839b2d6cd9a750211ce06bf3b991c (patch)
tree1503ae4a0350ab25a1d705e7da0fa1f8fd752b2a
parente82d03611859820429347da0fccf2b93fa57b2ac (diff)
The onboard ix(4) interfaces on the SPARC T5 machines don't have a valid MAC
address in their EEPROM. Use the MAC address given by the "local-mac-address" Open Firmware property instead. ok mikeb@, deraadt@
-rw-r--r--sys/dev/pci/ixgbe.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/dev/pci/ixgbe.c b/sys/dev/pci/ixgbe.c
index 8eb42ab30db..301903a8eb9 100644
--- a/sys/dev/pci/ixgbe.c
+++ b/sys/dev/pci/ixgbe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ixgbe.c,v 1.13 2013/08/05 19:58:05 mikeb Exp $ */
+/* $OpenBSD: ixgbe.c,v 1.14 2014/11/26 17:03:52 kettenis Exp $ */
/******************************************************************************
@@ -37,6 +37,10 @@
#include <dev/pci/ixgbe.h>
+#ifdef __sparc64__
+#include <dev/ofw/openfirm.h>
+#endif
+
void ixgbe_set_pci_config_data_generic(struct ixgbe_hw *hw,
uint16_t link_status);
@@ -618,6 +622,14 @@ int32_t ixgbe_get_mac_addr_generic(struct ixgbe_hw *hw, uint8_t *mac_addr)
DEBUGFUNC("ixgbe_get_mac_addr_generic");
+#ifdef __sparc64__
+ struct ixgbe_osdep *os = hw->back;
+
+ if (OF_getprop(PCITAG_NODE(os->os_pa.pa_tag), "local-mac-address",
+ mac_addr, ETHER_ADDR_LEN) == ETHER_ADDR_LEN)
+ return IXGBE_SUCCESS;
+#endif
+
rar_high = IXGBE_READ_REG(hw, IXGBE_RAH(0));
rar_low = IXGBE_READ_REG(hw, IXGBE_RAL(0));