Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Nuke the "alchemy_info" stuff, and just use the dev...



details:   https://anonhg.NetBSD.org/src/rev/bcc267036963
branches:  trunk
changeset: 549036:bcc267036963
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Jul 04 01:19:58 2003 +0000

description:
Nuke the "alchemy_info" stuff, and just use the dev_propdb to set
the mac-addr property for the Au1x00 on-chip MACs.

diffstat:

 sys/arch/evbmips/alchemy/autoconf.c   |  15 ++++++---------
 sys/arch/evbmips/alchemy/machdep.c    |  11 ++---------
 sys/arch/mips/alchemy/dev/if_aumac.c  |  11 +++++------
 sys/arch/mips/alchemy/include/auvar.h |  11 +----------
 4 files changed, 14 insertions(+), 34 deletions(-)

diffs (139 lines):

diff -r bdec2a0455bc -r bcc267036963 sys/arch/evbmips/alchemy/autoconf.c
--- a/sys/arch/evbmips/alchemy/autoconf.c       Fri Jul 04 00:49:18 2003 +0000
+++ b/sys/arch/evbmips/alchemy/autoconf.c       Fri Jul 04 01:19:58 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.4 2002/09/27 02:24:13 thorpej Exp $ */
+/* $NetBSD: autoconf.c,v 1.5 2003/07/04 01:19:59 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -92,7 +92,6 @@
        /* Fetch the MAC addresses from YAMON. */
        if (strcmp(name, "aumac") == 0) {
                uint8_t ethaddr[ETHER_ADDR_LEN];
-               char prop_name[sizeof("0xffffffff:mac-addr") + 1];
                const char *cp;
                char *cp0;
                int i;
@@ -118,13 +117,11 @@
                                 */
                                ethaddr[4] += 0x10;
                        }
-
-                       snprintf(prop_name, sizeof(prop_name), "%p:mac-addr",
-                           dev);
-                       if (alchemy_info_set(prop_name, ethaddr,
-                           sizeof(ethaddr), 0, 0))
-                               panic("can't set mac address property for "
-                                   "aumac");
+                       if (prop_set(dev_propdb, dev, "mac-addr",
+                                    ethaddr, sizeof(ethaddr), 0, 0) != 0) {
+                               printf("WARNING: unable to set mac-addr "
+                                   "property for %s\n", dev->dv_xname);
+                       }
                }
        }
 }
diff -r bdec2a0455bc -r bcc267036963 sys/arch/evbmips/alchemy/machdep.c
--- a/sys/arch/evbmips/alchemy/machdep.c        Fri Jul 04 00:49:18 2003 +0000
+++ b/sys/arch/evbmips/alchemy/machdep.c        Fri Jul 04 01:19:58 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.9 2003/06/27 07:39:35 he Exp $ */
+/* $NetBSD: machdep.c,v 1.10 2003/07/04 01:19:59 thorpej Exp $ */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.9 2003/06/27 07:39:35 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.10 2003/07/04 01:19:59 thorpej Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -119,7 +119,6 @@
 
 yamon_env_var *yamon_envp;
 struct pb1000_config pb1000_configuration;
-struct propdb *alchemy_prop_info;
 
 void   mach_init(int, char **, yamon_env_var *, u_long); /* XXX */
 
@@ -435,12 +434,6 @@
         * Set up buffers, so they can be used to read disklabels.
         */
        bufinit();
-
-       /*
-        * Set up the chip/board properties database.
-        */
-       if (!(alchemy_prop_info = propdb_create("board info")))
-               panic("Cannot create board info database");
 }
 
 void
diff -r bdec2a0455bc -r bcc267036963 sys/arch/mips/alchemy/dev/if_aumac.c
--- a/sys/arch/mips/alchemy/dev/if_aumac.c      Fri Jul 04 00:49:18 2003 +0000
+++ b/sys/arch/mips/alchemy/dev/if_aumac.c      Fri Jul 04 01:19:58 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_aumac.c,v 1.10 2003/03/27 01:21:52 simonb Exp $ */
+/* $NetBSD: if_aumac.c,v 1.11 2003/07/04 01:19:58 thorpej Exp $ */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_aumac.c,v 1.10 2003/03/27 01:21:52 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aumac.c,v 1.11 2003/07/04 01:19:58 thorpej Exp $");
 
 #include "bpfilter.h"
 
@@ -219,7 +219,6 @@
 static void
 aumac_attach(struct device *parent, struct device *self, void *aux)
 {
-       char prop_name[sizeof("0xffffffff:mac-addr") + 1];
        uint8_t enaddr[ETHER_ADDR_LEN];
        struct aumac_softc *sc = (void *) self;
        struct aubus_attach_args *aa = aux;
@@ -236,9 +235,9 @@
        sc->sc_st = aa->aa_st;
 
        /* Get the MAC address. */
-       snprintf(prop_name, sizeof(prop_name), "%p:mac-addr", self);
-       if (alchemy_info_get(prop_name, enaddr, sizeof(enaddr)) == -1) {
-               printf("%s: unable to determine MAC address\n",
+       if (prop_get(dev_propdb, &sc->sc_dev, "mac-addr", enaddr,
+                    sizeof(enaddr), NULL) != sizeof(enaddr)) {
+               printf("%s: unable to get mac-addr property\n",
                    sc->sc_dev.dv_xname);
                return;
        }
diff -r bdec2a0455bc -r bcc267036963 sys/arch/mips/alchemy/include/auvar.h
--- a/sys/arch/mips/alchemy/include/auvar.h     Fri Jul 04 00:49:18 2003 +0000
+++ b/sys/arch/mips/alchemy/include/auvar.h     Fri Jul 04 01:19:58 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: auvar.h,v 1.1 2002/07/29 15:39:15 simonb Exp $ */
+/* $NetBSD: auvar.h,v 1.2 2003/07/04 01:19:59 thorpej Exp $ */
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -38,15 +38,6 @@
 #ifndef _MIPS_ALCHEMY_AUVAR_H_
 #define        _MIPS_ALCHEMY_AUVAR_H_
 
-/* Chip/board info database */
-#include <sys/properties.h>
-extern struct propdb *alchemy_prop_info;
-
-#define        alchemy_info_set(n, v, l, f, w)                                 \
-           prop_set(alchemy_prop_info, 0, (n), (v), (l), (f), (w))
-#define        alchemy_info_get(n, v, l)                                       \
-           prop_get(alchemy_prop_info, 0, (n), (v), (l), NULL)
-
 void   au_intr_init(void);
 void   *au_intr_establish(int, int, int, int, int (*)(void *), void *);
 void   au_intr_disestablish(void *);



Home | Main Index | Thread Index | Old Index