Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/evbppc/walnut Set the mac-addr property of the on-c...



details:   https://anonhg.NetBSD.org/src/rev/ef645c821c8a
branches:  trunk
changeset: 549041:ef645c821c8a
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Jul 04 02:35:38 2003 +0000

description:
Set the mac-addr property of the on-chip emac device.

diffstat:

 sys/arch/evbppc/walnut/autoconf.c |  15 ++++++++++++++-
 sys/arch/evbppc/walnut/machdep.c  |   5 +----
 2 files changed, 15 insertions(+), 5 deletions(-)

diffs (46 lines):

diff -r 8afc90007add -r ef645c821c8a sys/arch/evbppc/walnut/autoconf.c
--- a/sys/arch/evbppc/walnut/autoconf.c Fri Jul 04 02:34:47 2003 +0000
+++ b/sys/arch/evbppc/walnut/autoconf.c Fri Jul 04 02:35:38 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.4 2003/07/04 02:21:50 thorpej Exp $     */
+/*     $NetBSD: autoconf.c,v 1.5 2003/07/04 02:35:38 thorpej Exp $     */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -106,4 +106,17 @@
                            "property for %s\n", dev->dv_xname);
                return;
        }
+
+       if (strcmp(dev->dv_cfdata->cf_name, "emac") == 0 &&
+           strcmp(parent->dv_cfdata->cf_name, "opb") == 0) {
+               /* Set the mac-addr of the on-chip Ethernet. */
+               /* XXX 405GP only has one; what about CPUs with two? */
+               if (prop_set(dev_propdb, dev, "mac-addr",
+                            &board_data.mac_address_local,
+                            sizeof(board_data.mac_address_local),
+                            PROP_CONST, 0) != 0)
+                       printf("WARNING: unable to set mac-addr "
+                           "property for %s\n", dev->dv_xname);
+               return;
+       }
 }
diff -r 8afc90007add -r ef645c821c8a sys/arch/evbppc/walnut/machdep.c
--- a/sys/arch/evbppc/walnut/machdep.c  Fri Jul 04 02:34:47 2003 +0000
+++ b/sys/arch/evbppc/walnut/machdep.c  Fri Jul 04 02:35:38 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.10 2003/07/04 02:21:50 thorpej Exp $     */
+/*     $NetBSD: machdep.c,v 1.11 2003/07/04 02:35:38 thorpej Exp $     */
 
 /*
  * Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -479,9 +479,6 @@
        if (board_info_set("mem-size", &board_data.mem_size, 
                sizeof(&board_data.mem_size), PROP_CONST, 0))
                panic("setting mem-size");
-       if (board_info_set("emac-mac-addr", &board_data.mac_address_local, 
-               sizeof(&board_data.mac_address_local), PROP_CONST, 0))
-               panic("setting emac-mac-addr");
        if (board_info_set("sip0-mac-addr", &board_data.mac_address_pci, 
                sizeof(&board_data.mac_address_pci), PROP_CONST, 0))
                panic("setting sip0-mac-addr");



Home | Main Index | Thread Index | Old Index