Nuke the "alchemy_info" stuff, and just use the dev_propdb to set

the mac-addr property for the Au1x00 on-chip MACs.
This commit is contained in:
thorpej 2003-07-04 01:19:58 +00:00
parent fc401b7586
commit d876aa082a
4 changed files with 14 additions and 34 deletions

View File

@ -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 @@ device_register(struct device *dev, void *aux)
/* 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 @@ device_register(struct device *dev, void *aux)
*/
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);
}
}
}
}

View File

@ -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 @@ phys_ram_seg_t mem_clusters[VM_PHYSSEG_MAX];
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 @@ cpu_startup(void)
* 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

View File

@ -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 @@ aumac_match(struct device *parent, struct cfdata *cf, void *aux)
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 @@ aumac_attach(struct device *parent, struct device *self, void *aux)
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;
}

View File

@ -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 *);