From 0c91b926acc0ae0ce3d822fe4252fa83c3a4cae4 Mon Sep 17 00:00:00 2001 From: pk Date: Mon, 15 Mar 2004 23:57:27 +0000 Subject: [PATCH] Replace myetheraddr() by prom_getether(). Convert the file descriptor to deivce tree node (if possible) to support the "local-mac-address' property. --- sys/arch/sparc/stand/common/netif_sun.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sys/arch/sparc/stand/common/netif_sun.c b/sys/arch/sparc/stand/common/netif_sun.c index 8fa652ecfcc3..b38e41844199 100644 --- a/sys/arch/sparc/stand/common/netif_sun.c +++ b/sys/arch/sparc/stand/common/netif_sun.c @@ -1,4 +1,4 @@ -/* $NetBSD: netif_sun.c,v 1.6 2003/03/13 12:02:54 hannken Exp $ */ +/* $NetBSD: netif_sun.c,v 1.7 2004/03/15 23:57:27 pk Exp $ */ /* * Copyright (c) 1995 Gordon W. Ross @@ -77,6 +77,7 @@ netif_open(machdep_hint) { struct promdata *pd = machdep_hint; struct iodesc *io; + int node; /* find a free socket */ io = sockets; @@ -93,7 +94,16 @@ netif_open(machdep_hint) io->io_netif = &netif_prom; /* Put our ethernet address in io->myea */ - prom_getether(io->myea); + switch (prom_version()) { + case PROM_OBP_V2: + case PROM_OBP_V3: + case PROM_OPENFIRM: + node = prom_instance_to_package(pd->fd); + break; + default: + node = 0; + } + prom_getether(node, io->myea); return(0); }