Pass devinfo of the base device (subunit == 0 of the same port)

to sub-drivers.
This commit is contained in:
itohy 2002-12-06 15:49:31 +00:00
parent 8f6d7bef0a
commit f972b5535e
2 changed files with 8 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: maple.c,v 1.21 2002/11/15 13:30:21 itohy Exp $ */
/* $NetBSD: maple.c,v 1.22 2002/12/06 15:49:31 itohy Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -610,8 +610,9 @@ maple_print_unit(void *aux, const char *pnp)
printf(" subunit %d", subunit);
#ifdef MAPLE_DEBUG
printf(": a %#x fn %#x d %#x,%#x,%#x",
printf(": a %#x c %#x fn %#x d %#x,%#x,%#x",
ma->ma_devinfo->di_area_code,
ma->ma_devinfo->di_connector_direction,
ntohl(ma->ma_devinfo->di_func),
ntohl(ma->ma_devinfo->di_function_data[0]),
ntohl(ma->ma_devinfo->di_function_data[1]),
@ -676,6 +677,7 @@ maple_attach_unit(struct maple_softc *sc, struct maple_unit *u)
ma.ma_unit = u;
ma.ma_devinfo = &u->devinfo;
ma.ma_basedevinfo = &sc->sc_unit[u->port][0].devinfo;
func = ntohl(ma.ma_devinfo->di_func);
maple_print_unit(&ma, sc->sc_dev.dv_xname);
@ -683,7 +685,7 @@ maple_attach_unit(struct maple_softc *sc, struct maple_unit *u)
strcpy(oldxname, sc->sc_dev.dv_xname);
maple_unit_name(sc->sc_dev.dv_xname, u->port, u->subunit);
for (f = 0; f < MAPLE_NFUNC; f++, ma.ma_function <<= 1) {
for (f = 0; f < MAPLE_NFUNC; f++) {
u->u_func[f].f_callback = NULL;
u->u_func[f].f_arg = NULL;
u->u_func[f].f_cmdstat = MAPLE_CMDSTAT_NONE;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mapleconf.h,v 1.5 2002/11/15 13:30:21 itohy Exp $ */
/* $NetBSD: mapleconf.h,v 1.6 2002/12/06 15:49:32 itohy Exp $ */
/*-
* Copyright (c) 2001 Marcus Comstedt
@ -34,8 +34,9 @@
struct maple_attach_args {
struct maple_unit *ma_unit;
u_int32_t ma_function;
int ma_function;
struct maple_devinfo *ma_devinfo;
struct maple_devinfo *ma_basedevinfo;
};
#define MAPLE_MATCH_FUNC 2