From 6a8d3a357d2d39cf1274d89e9ee73459574e038d Mon Sep 17 00:00:00 2001 From: wollman Date: Wed, 12 Apr 1995 20:48:13 +0000 Subject: Add a class field to devconf and mst drivers. For those where it was easy, drivers were also fixed to call dev_attach() during probe rather than attach (in keeping with the new design articulated in a mail message five months ago). For a few that were really easy, correct state tracking was added as well. The `fd' driver was fixed to correctly fill in the description. The CPU identify code was fixed to attach a `cpu' device. The code was also massively reordered to fill in cpu_model with somethingremotely resembling what identifycpu() prints out. A few bytes saved by using %b to format the features list rather than lots of ifs. --- sys/i386/isa/ctx.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'sys/i386/isa/ctx.c') diff --git a/sys/i386/isa/ctx.c b/sys/i386/isa/ctx.c index 9d0f621..3c7f1f3 100644 --- a/sys/i386/isa/ctx.c +++ b/sys/i386/isa/ctx.c @@ -8,7 +8,7 @@ * of this software, nor does the author assume any responsibility * for damages incurred with its use. * - * $Id: ctx.c,v 1.3 1994/10/21 01:19:05 wollman Exp $ + * $Id: ctx.c,v 1.4 1994/10/23 21:27:11 wollman Exp $ */ /* @@ -160,8 +160,9 @@ static struct kern_devconf kdc_ctx[NCTX] = { { isa_generic_externalize, 0, 0, ISA_EXTERNALLEN, &kdc_isa0, /* parent */ 0, /* parentdata */ - DC_UNKNOWN, /* not supported */ - "CORTEX-I frame grabber" + DC_UNCONFIGURED, /* always start out here */ + "CORTEX-I frame grabber", + DC_CLS_MISC } }; static inline void @@ -179,6 +180,8 @@ ctxprobe(struct isa_device * devp) { int status; + ctx_registerdev(devp); + if (inb(devp->id_iobase) == 0xff) /* 0xff only if board absent */ status = 0; else @@ -198,7 +201,7 @@ ctxattach(struct isa_device * devp) sr->iobase = devp->id_iobase; sr->maddr = devp->id_maddr; sr->msize = devp->id_msize; - ctx_registerdev(devp); + kdc_ctx[devp->id_unit].kdc_state = DC_IDLE; return (1); } @@ -227,6 +230,7 @@ ctxopen(dev_t dev, int flag) return (ENOMEM); sr->flag = OPEN; + kdc_ctx[unit].kdc_state = DC_BUSY; /* Set up the shadow registers. We don't actually write these @@ -264,6 +268,7 @@ ctxclose(dev_t dev, int flag) unit = UNIT(minor(dev)); ctx_sr[unit].flag = 0; + kdc_ctx[unit].kdc_state = DC_IDLE; free(ctx_sr[unit].lutp, M_DEVBUF); ctx_sr[unit].lutp = NULL; return (0); -- cgit v1.1