diff options
author | Garrett Wollman <wollman@FreeBSD.org> | 1995-04-12 20:48:13 +0000 |
---|---|---|
committer | Garrett Wollman <wollman@FreeBSD.org> | 1995-04-12 20:48:13 +0000 |
commit | 6c0081e92ba843bef15fe7b01e7479f7ac01f762 (patch) | |
tree | 3733f361a8298b0f38c2e4586c976a9240816ec2 /sys/sys/devconf.h | |
parent | fd7e139eeddd7de2fad7ff77bf9c427bdc7bef6b (diff) | |
download | src-6c0081e92ba843bef15fe7b01e7479f7ac01f762.tar.gz src-6c0081e92ba843bef15fe7b01e7479f7ac01f762.zip |
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.
Notes
Notes:
svn path=/head/; revision=7780
Diffstat (limited to 'sys/sys/devconf.h')
-rw-r--r-- | sys/sys/devconf.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/sys/sys/devconf.h b/sys/sys/devconf.h index e38abbc4cb69..6d3b42acb80a 100644 --- a/sys/sys/devconf.h +++ b/sys/sys/devconf.h @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: devconf.h,v 1.3 1994/10/23 21:28:03 wollman Exp $ + * $Id: devconf.h,v 1.4 1995/03/17 04:18:07 davidg Exp $ */ /* @@ -46,6 +46,32 @@ enum dc_state { DC_BUSY /* driver supports state and is currently busy */ }; +#define DC_STATENAMES \ + { \ + "unknown", "unconfigured", "idle", "busy" \ + } + +enum dc_class { + DC_CLS_UNKNOWN = 0, /* old drivers don't set class */ + DC_CLS_CPU = 1, /* CPU devices */ + DC_CLS_BUS = 2, /* busses */ + DC_CLS_DISK = 4, /* disks */ + DC_CLS_TAPE = 8, /* tapes */ + DC_CLS_RDISK = 16, /* read-only disks */ + DC_CLS_DISPLAY = 32, /* display devices */ + DC_CLS_SERIAL = 64, /* serial I/O devices */ + DC_CLS_PARALLEL = 128, /* parallel I/O devices */ + DC_CLS_NETIF = 256, /* network interfaces */ + DC_CLS_MISC = 512 /* anything else */ +}; + +#define DC_CLASSNAMES \ + { \ + "unknown", "CPU", "bus", "disk", "tape", "read-only disk", \ + "display", "serial", "parallel", "network interface", \ + "miscellaneous" \ + } + struct devconf { char dc_name[MAXDEVNAME]; /* name */ char dc_descr[MAXDEVDESCR]; /* description */ @@ -56,6 +82,7 @@ struct devconf { int dc_pnumber; /* unique id of the parent */ struct machdep_devconf dc_md; /* machine-dependent stuff */ enum dc_state dc_state; /* state of the device (see above) */ + enum dc_class dc_class; /* type of device (see above) */ size_t dc_datalen; /* length of data */ char dc_data[1]; /* variable-length data */ }; @@ -100,6 +127,7 @@ struct kern_devconf { void *kdc_parentdata; /* filled in by driver */ enum dc_state kdc_state; /* filled in by driver dynamically */ const char *kdc_description; /* filled in by driver; maybe dyn. */ + enum dc_class kdc_class; /* filled in by driver */ }; int dev_attach(struct kern_devconf *); |