From 7610d0c490318d078a8887c9b15be062366c0896 Mon Sep 17 00:00:00 2001 From: downsj Date: Wed, 5 Feb 1997 16:01:09 +0000 Subject: [PATCH] Non-console ITE devices need to be initialized properly, too, ya know. Add enough glue to the aux attach structure to do so, and teach all the device drivers how to set it. This fixes the last ITE panic I know of... --- sys/arch/hp300/dev/grf_dv.c | 14 +++++++++++--- sys/arch/hp300/dev/grf_gb.c | 14 +++++++++++--- sys/arch/hp300/dev/grf_hy.c | 8 ++++++-- sys/arch/hp300/dev/grf_rb.c | 14 +++++++++++--- sys/arch/hp300/dev/grf_subr.c | 8 ++++++-- sys/arch/hp300/dev/grf_tc.c | 8 ++++++-- sys/arch/hp300/dev/grfvar.h | 6 ++++-- sys/arch/hp300/dev/ite.c | 4 +++- 8 files changed, 58 insertions(+), 18 deletions(-) diff --git a/sys/arch/hp300/dev/grf_dv.c b/sys/arch/hp300/dev/grf_dv.c index 401f8d34ee3..80b80f40679 100644 --- a/sys/arch/hp300/dev/grf_dv.c +++ b/sys/arch/hp300/dev/grf_dv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grf_dv.c,v 1.4 1997/02/03 04:47:26 downsj Exp $ */ +/* $OpenBSD: grf_dv.c,v 1.5 1997/02/05 16:01:09 downsj Exp $ */ /* $NetBSD: grf_dv.c,v 1.10 1997/01/30 09:18:45 thorpej Exp $ */ /* @@ -151,7 +151,11 @@ dvbox_intio_attach(parent, self, aux) grf = (caddr_t)IIOV(GRFIADDR); sc->sc_scode = -1; /* XXX internal i/o */ - grfdev_attach(sc, dv_init, grf, &dvbox_grfsw); +#if NITE > 0 + grfdev_attach(sc, dv_init, grf, &dvbox_grfsw, &dvbox_itesw); +#else + grfdev_attach(sc, dv_init, grf, &dvbox_grfsw, NULL); +#endif /* NITE > 0 */ } int @@ -189,7 +193,11 @@ dvbox_dio_attach(parent, self, aux) } } - grfdev_attach(sc, dv_init, grf, &dvbox_grfsw); +#if NITE > 0 + grfdev_attach(sc, dv_init, grf, &dvbox_grfsw, &dvbox_itesw); +#else + grfdev_attach(sc, dv_init, grf, &dvbox_grfsw, NULL); +#endif } /* diff --git a/sys/arch/hp300/dev/grf_gb.c b/sys/arch/hp300/dev/grf_gb.c index ad53e886b58..7d11b1bc48d 100644 --- a/sys/arch/hp300/dev/grf_gb.c +++ b/sys/arch/hp300/dev/grf_gb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grf_gb.c,v 1.4 1997/02/03 04:47:27 downsj Exp $ */ +/* $OpenBSD: grf_gb.c,v 1.5 1997/02/05 16:01:11 downsj Exp $ */ /* $NetBSD: grf_gb.c,v 1.10 1997/01/30 09:18:45 thorpej Exp $ */ /* @@ -161,7 +161,11 @@ gbox_intio_attach(parent, self, aux) grf = (caddr_t)IIOV(GRFIADDR); sc->sc_scode = -1; /* XXX internal i/o */ - grfdev_attach(sc, gb_init, grf, &gbox_grfsw); +#if NITE > 0 + grfdev_attach(sc, gb_init, grf, &gbox_grfsw, &gbox_itesw); +#else + grfdev_attach(sc, gb_init, grf, &gbox_grfsw, NULL); +#endif /* NITE > 0 */ } int @@ -199,7 +203,11 @@ gbox_dio_attach(parent, self, aux) } } - grfdev_attach(sc, gb_init, grf, &gbox_grfsw); +#if NITE > 0 + grfdev_attach(sc, gb_init, grf, &gbox_grfsw, &gbox_itesw); +#else + grfdev_attach(sc, gb_init, grf, &gbox_grfsw, NULL); +#endif /* NITE > 0 */ } /* diff --git a/sys/arch/hp300/dev/grf_hy.c b/sys/arch/hp300/dev/grf_hy.c index 52f7ddf6ae0..b73a68406db 100644 --- a/sys/arch/hp300/dev/grf_hy.c +++ b/sys/arch/hp300/dev/grf_hy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grf_hy.c,v 1.4 1997/02/03 04:47:28 downsj Exp $ */ +/* $OpenBSD: grf_hy.c,v 1.5 1997/02/05 16:01:12 downsj Exp $ */ /* $NetBSD: grf_hy.c,v 1.8 1997/01/30 09:18:47 thorpej Exp $ */ /* @@ -152,7 +152,11 @@ hyper_dio_attach(parent, self, aux) } } - grfdev_attach(sc, hy_init, grf, &hyper_grfsw); +#if NITE > 0 + grfdev_attach(sc, hy_init, grf, &hyper_grfsw, &hyper_itesw); +#else + grfdev_attach(sc, hy_init, grf, &hyper_grfsw, NULL); +#endif /* NITE > 0 */ } /* diff --git a/sys/arch/hp300/dev/grf_rb.c b/sys/arch/hp300/dev/grf_rb.c index 4689c88657c..68beb5b2dce 100644 --- a/sys/arch/hp300/dev/grf_rb.c +++ b/sys/arch/hp300/dev/grf_rb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grf_rb.c,v 1.4 1997/02/03 04:47:30 downsj Exp $ */ +/* $OpenBSD: grf_rb.c,v 1.5 1997/02/05 16:01:14 downsj Exp $ */ /* $NetBSD: grf_rb.c,v 1.10 1997/01/30 09:18:48 thorpej Exp $ */ /* @@ -150,7 +150,11 @@ rbox_intio_attach(parent, self, aux) grf = (caddr_t)IIOV(GRFIADDR); sc->sc_scode = -1; /* XXX internal i/o */ - grfdev_attach(sc, rb_init, grf, &rbox_grfsw); +#if NITE > 0 + grfdev_attach(sc, rb_init, grf, &rbox_grfsw, &rbox_itesw); +#else + grfdev_attach(sc, rb_init, grf, &rbox_grfsw, NULL); +#endif /* NITE > 0 */ } int @@ -188,7 +192,11 @@ rbox_dio_attach(parent, self, aux) } } - grfdev_attach(sc, rb_init, grf, &rbox_grfsw); +#if NITE > 0 + grfdev_attach(sc, rb_init, grf, &rbox_grfsw, &rbox_itesw); +#else + grfdev_attach(sc, rb_init, grf, &rbox_grfsw, NULL); +#endif /* NITE > 0 */ } /* diff --git a/sys/arch/hp300/dev/grf_subr.c b/sys/arch/hp300/dev/grf_subr.c index cd8ca3fce4f..6798b8051ea 100644 --- a/sys/arch/hp300/dev/grf_subr.c +++ b/sys/arch/hp300/dev/grf_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grf_subr.c,v 1.3 1997/02/04 07:15:26 downsj Exp $ */ +/* $OpenBSD: grf_subr.c,v 1.4 1997/02/05 16:01:15 downsj Exp $ */ /* $NetBSD: grf_subr.c,v 1.3 1997/01/31 21:16:50 carrel Exp $ */ /*- @@ -52,14 +52,17 @@ #include #include +#include + int grfdevprint __P((void *, const char *)); void -grfdev_attach(sc, init, regs, sw) +grfdev_attach(sc, init, regs, sw, isw) struct grfdev_softc *sc; int (*init) __P((struct grf_data *, int, caddr_t)); caddr_t regs; struct grfsw *sw; + struct itesw *isw; { struct grfdev_attach_args ga; struct grf_data *gp; @@ -106,6 +109,7 @@ grfdev_attach(sc, init, regs, sw) ga.ga_scode = sc->sc_scode; /* XXX */ ga.ga_isconsole = isconsole; ga.ga_data = (void *)sc->sc_data; + ga.ga_ite = (void *)isw; (void)config_found(&sc->sc_dev, &ga, grfdevprint); } diff --git a/sys/arch/hp300/dev/grf_tc.c b/sys/arch/hp300/dev/grf_tc.c index c44b6d04967..c5093815de7 100644 --- a/sys/arch/hp300/dev/grf_tc.c +++ b/sys/arch/hp300/dev/grf_tc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grf_tc.c,v 1.4 1997/02/03 04:47:31 downsj Exp $ */ +/* $OpenBSD: grf_tc.c,v 1.5 1997/02/05 16:01:16 downsj Exp $ */ /* $NetBSD: grf_tc.c,v 1.10 1997/01/30 09:18:50 thorpej Exp $ */ /* @@ -261,7 +261,11 @@ topcat_common_attach(sc, grf, secid) panic("topcat_common_attach"); } - grfdev_attach(sc, tc_init, grf, sw); +#if NITE > 0 + grfdev_attach(sc, tc_init, grf, sw, &topcat_itesw); +#else + grfdev_attach(sc, tc_init, grf, sw, NULL); +#endif /* NITE > 0 */ } /* diff --git a/sys/arch/hp300/dev/grfvar.h b/sys/arch/hp300/dev/grfvar.h index d3f5c6b47e3..5eaa0d3fe3c 100644 --- a/sys/arch/hp300/dev/grfvar.h +++ b/sys/arch/hp300/dev/grfvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: grfvar.h,v 1.4 1997/02/03 04:47:32 downsj Exp $ */ +/* $OpenBSD: grfvar.h,v 1.5 1997/02/05 16:01:17 downsj Exp $ */ /* $NetBSD: grfvar.h,v 1.9 1997/01/30 09:18:51 thorpej Exp $ */ /* @@ -98,6 +98,7 @@ struct grfdev_attach_args { int ga_scode; /* XXX select code, -1 for intio */ int ga_isconsole; /* from hardware; is console? */ void *ga_data; /* hardware-dependent data */ + void *ga_ite; /* ITE switch table */ }; /* flags */ @@ -125,7 +126,8 @@ struct grfdev_attach_args { #ifdef _KERNEL extern struct grf_data grf_cn; /* grf_data for console device */ +struct itesw; void grfdev_attach __P((struct grfdev_softc *, int (*init)(struct grf_data *, int, caddr_t), - caddr_t, struct grfsw *)); + caddr_t, struct grfsw *, struct itesw *itesw)); #endif /* _KERNEL */ diff --git a/sys/arch/hp300/dev/ite.c b/sys/arch/hp300/dev/ite.c index 22c49075407..e9261da7790 100644 --- a/sys/arch/hp300/dev/ite.c +++ b/sys/arch/hp300/dev/ite.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ite.c,v 1.8 1997/02/04 06:21:26 downsj Exp $ */ +/* $OpenBSD: ite.c,v 1.9 1997/02/05 16:01:19 downsj Exp $ */ /* $NetBSD: ite.c,v 1.37 1997/02/02 09:40:31 thorpej Exp $ */ /* @@ -167,6 +167,8 @@ iteattach(parent, self, aux) return; } bzero(ite->sc_data, sizeof(struct ite_data)); + ite->sc_data->isw = (struct itesw *)ga->ga_ite; + ite->sc_data->grf = (struct grf_data *)ga->ga_data; ite->sc_data->flags = ITE_ALIVE; } -- 2.20.1