summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorcgd <cgd@NetBSD.org>1996-03-05 23:15:05 +0000
committercgd <cgd@NetBSD.org>1996-03-05 23:15:05 +0000
commitd43ef3b959f74f913bc25fe0fcff46ed4d51bb17 (patch)
tree142a339ccb876854f49d2d083b355ddf4dd92809 /sys/dev
parent34e5c9dc84798b7dccaa2dd27c0eec8fb2dc8f1e (diff)
split device info into driver name and human readable description.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/tc/devlist2h.awk24
-rw-r--r--sys/dev/tc/tc.c16
2 files changed, 26 insertions, 14 deletions
diff --git a/sys/dev/tc/devlist2h.awk b/sys/dev/tc/devlist2h.awk
index abee1e85ac9..b1b1baba49c 100644
--- a/sys/dev/tc/devlist2h.awk
+++ b/sys/dev/tc/devlist2h.awk
@@ -1,5 +1,5 @@
#! /usr/bin/awk -f
-# $NetBSD: devlist2h.awk,v 1.1 1996/03/02 01:16:49 cgd Exp $
+# $NetBSD: devlist2h.awk,v 1.2 1996/03/05 23:15:05 cgd Exp $
#
# Copyright (c) 1995, 1996 Christopher G. Demetriou
# All rights reserved.
@@ -62,10 +62,17 @@ $1 == "device" {
devices[ndevices, 0] = $2; # devices id
devices[ndevices, 1] = $2; # C identifier for device
gsub("-", "_", devices[ndevices, 1]);
- printf("#define\tTC_PRODUCT_%s\t\"", devices[ndevices, 1]) > hfile
- f = 3;
- i = 2;
+ devices[ndevices, 2] = $3; /* driver name */
+
+ printf("\n") > hfile
+ printf("#define\tTC_DEVICE_%s\t\"%s\"\n", devices[ndevices, 1],
+ devices[ndevices, 2]) > hfile
+
+ printf("#define\tTC_DESCRIPTION_%s\t\"", devices[ndevices, 1]) > hfile
+
+ f = 4;
+ i = 3;
# comments
ocomment = oparen = 0
@@ -103,7 +110,8 @@ $1 == "device" {
{
if ($0 == "")
blanklines++
- print $0 > hfile
+ if (blanklines < 2)
+ print $0 > hfile
if (blanklines < 2)
print $0 > dfile
}
@@ -117,11 +125,13 @@ END {
printf("\t{\n") > dfile
printf("\t \"%-8s\",\n", devices[i, 0]) \
> dfile
- printf("\t TC_PRODUCT_%s,\n", devices[i, 1]) \
+ printf("\t TC_DEVICE_%s,\n", devices[i, 1]) \
+ > dfile
+ printf("\t TC_DESCRIPTION_%s,\n", devices[i, 1]) \
> dfile
printf("\t},\n") > dfile
}
- printf("\t{ NULL, NULL, }\n") > dfile
+ printf("\t{ NULL, NULL, NULL, }\n") > dfile
printf("};\n") > dfile
}
diff --git a/sys/dev/tc/tc.c b/sys/dev/tc/tc.c
index f47b242ce6d..dcd25996a61 100644
--- a/sys/dev/tc/tc.c
+++ b/sys/dev/tc/tc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tc.c,v 1.9 1996/03/02 02:44:29 cgd Exp $ */
+/* $NetBSD: tc.c,v 1.10 1996/03/05 23:15:07 cgd Exp $ */
/*
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
@@ -291,7 +291,7 @@ tc_intr_disestablish(dev, cookie)
* Descriptions of of known devices.
*/
struct tc_knowndev {
- const char *id, *name;
+ const char *id, *driver, *description;
};
#include <dev/tc/tcdevs_data.h>
@@ -302,7 +302,7 @@ tc_devinfo(id, cp)
const char *id;
char *cp;
{
- const char *name;
+ const char *driver, *description;
#ifdef TCVERBOSE
struct tc_knowndev *tdp;
int match;
@@ -311,7 +311,8 @@ tc_devinfo(id, cp)
const char *unmatched = "";
#endif
- name = NULL;
+ driver = NULL;
+ description = id;
#ifdef TCVERBOSE
/* find the device in the table, if possible. */
@@ -320,15 +321,16 @@ tc_devinfo(id, cp)
/* check this entry for a match */
match = !strcmp(tdp->id, id);
if (match) {
- name = tdp->name;
+ driver = tdp->driver;
+ description = tdp->description;
break;
}
tdp++;
}
#endif
- if (name == NULL)
+ if (driver == NULL)
cp += sprintf(cp, "%sdevice %s", unmatched, id);
else
- cp += sprintf(cp, "%s (%s)", name, id);
+ cp += sprintf(cp, "%s (%s)", driver, description);
}