Thread (60 messages) flat view 60 messages, 3 authors, 2007-08-24
STALE6931d

[PATCH 19/20] bootwrapper: Only print MAC addresses when the node is actually present.

From: Scott Wood <hidden>
Date: 2007-08-20 17:40:21
Subsystem: linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Linus Torvalds

Some firmwares (such as PlanetCore) only provide a base MAC address, and
expect the kernel to set certain bits to generate the addresses for the
other ports.  As such, MAC addresses are generated that may not correspond
to actual hardware.

Signed-off-by: Scott Wood <redacted>
---
 arch/powerpc/boot/devtree.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/boot/devtree.c b/arch/powerpc/boot/devtree.c
index a92c8fb..73fa5a8 100644
--- a/arch/powerpc/boot/devtree.c
+++ b/arch/powerpc/boot/devtree.c
@@ -100,12 +100,14 @@ void __dt_fixup_mac_addresses(u32 startindex, ...)
 		devp = find_node_by_prop_value(NULL, "linux,network-index",
 					       (void*)&index, sizeof(index));
 
-		printf("ENET%d: local-mac-address <-"
-		       " %02x:%02x:%02x:%02x:%02x:%02x\n\r", index,
-		       addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
+		if (devp) {
+			printf("ENET%d: local-mac-address <-"
+			       " %02x:%02x:%02x:%02x:%02x:%02x\n\r", index,
+			       addr[0], addr[1], addr[2],
+			       addr[3], addr[4], addr[5]);
 
-		if (devp)
 			setprop(devp, "local-mac-address", addr, 6);
+		}
 
 		index++;
 	}
-- 
1.5.0.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help