Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178162091
D62212.1796157126.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D62212.1796157126.diff
View Options
Index: sys/dev/rge/if_rge.c
===================================================================
--- sys/dev/rge/if_rge.c
+++ sys/dev/rge/if_rge.c
@@ -21,6 +21,8 @@
/* $OpenBSD: if_rge.c,v 1.38 2025/09/19 00:41:14 kevlo Exp $ */
+#include "opt_platform.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sockio.h>
@@ -59,6 +61,11 @@
#include <dev/pci/pcivar.h>
#include <dev/pci/pcireg.h>
+#ifdef FDT
+#include <dev/ofw/openfirm.h>
+#include <dev/ofw/ofw_bus.h>
+#endif
+
#include "if_rge_vendor.h"
#include "if_rgereg.h"
#include "if_rgevar.h"
@@ -476,6 +483,20 @@
}
rge_get_macaddr(sc, eaddr.octet);
+#ifdef FDT
+ {
+ phandle_t node;
+ uint8_t fdtmac[ETHER_ADDR_LEN];
+
+ node = ofw_bus_get_node(dev);
+ if (node > 0 && OF_getprop(node, "local-mac-address", fdtmac,
+ sizeof(fdtmac)) == sizeof(fdtmac) &&
+ !ETHER_IS_MULTICAST(fdtmac) && !ETHER_IS_ZERO(fdtmac)) {
+ memcpy(eaddr.octet, fdtmac, sizeof(fdtmac));
+ rge_set_macaddr(sc, eaddr.octet);
+ }
+ }
+#endif
RGE_UNLOCK(sc);
if (!ETHER_IS_VALID(eaddr)) {
Index: sys/modules/rge/Makefile
===================================================================
--- sys/modules/rge/Makefile
+++ sys/modules/rge/Makefile
@@ -3,5 +3,6 @@
KMOD= if_rge
SRCS= if_rge.c if_rge_hw.c if_rge_stats.c if_rge_sysctl.c
SRCS+= device_if.h bus_if.h pci_if.h
+SRCS+= opt_platform.h ofw_bus_if.h
.include <bsd.kmod.mk>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 1, 8:32 PM (6 m, 50 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42119972
Default Alt Text
D62212.1796157126.diff (1 KB)
Attached To
Mode
D62212: rge: read local-mac-address from FDT when available
Attached
Detach File
Event Timeline