summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/tc/Makefile6
-rw-r--r--sys/dev/tc/devlist2h.awk79
-rw-r--r--sys/dev/tc/tc.c25
-rw-r--r--sys/dev/tc/tcdevs.h172
4 files changed, 19 insertions, 263 deletions
diff --git a/sys/dev/tc/Makefile b/sys/dev/tc/Makefile
index dc3b4cbef74..2933f297a97 100644
--- a/sys/dev/tc/Makefile
+++ b/sys/dev/tc/Makefile
@@ -1,8 +1,8 @@
-# $OpenBSD: Makefile,v 1.1 1996/04/18 23:48:19 niklas Exp $
+# $OpenBSD: Makefile,v 1.2 2006/03/13 22:00:31 miod Exp $
# $NetBSD: Makefile,v 1.1 1996/03/02 01:16:47 cgd Exp $
AWK= awk
-tcdevs.h tcdevs_data.h: tcdevs devlist2h.awk
- /bin/rm -f tcdevs.h tcdevs_data.h
+tcdevs_data.h: tcdevs devlist2h.awk
+ /bin/rm -f tcdevs_data.h
${AWK} -f devlist2h.awk tcdevs
diff --git a/sys/dev/tc/devlist2h.awk b/sys/dev/tc/devlist2h.awk
index 6cbcb71bbee..3378113515d 100644
--- a/sys/dev/tc/devlist2h.awk
+++ b/sys/dev/tc/devlist2h.awk
@@ -1,5 +1,5 @@
#! /usr/bin/awk -f
-# $OpenBSD: devlist2h.awk,v 1.5 2002/05/03 20:27:44 miod Exp $
+# $OpenBSD: devlist2h.awk,v 1.6 2006/03/13 22:00:31 miod Exp $
# $NetBSD: devlist2h.awk,v 1.3 1996/06/05 18:32:19 cgd Exp $
#
# Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -31,9 +31,7 @@
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
BEGIN {
- nproducts = 0
dfile="tcdevs_data.h"
- hfile="tcdevs.h"
}
NR == 1 {
VERSION = $0
@@ -48,79 +46,22 @@ NR == 1 {
printf(" *\t%s\n", VERSION) > dfile
printf(" */\n") > dfile
- printf("/*\t\$OpenBSD\$\t*/\n\n") > hfile
- printf("/*\n") > hfile
- printf(" * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.\n") \
- > hfile
- printf(" *\n") > hfile
- printf(" * generated from:\n") > hfile
- printf(" *\t%s\n", VERSION) > hfile
- printf(" */\n") > hfile
-
next
}
$1 == "device" {
ndevices++
- devices[ndevices, 0] = $2; # devices id
- devices[ndevices, 1] = $2; # C identifier for device
- gsub("-", "_", devices[ndevices, 1]);
-
- printf("\n") > hfile
- if ($3 == "???") { # driver name
- printf("#define\tTC_DEVICE_%s\tNULL\n",
- devices[ndevices, 1]) > hfile
- } else {
- printf("#define\tTC_DEVICE_%s\t\"%s\"\n",
- devices[ndevices, 1], $3) > hfile
- }
-
- printf("#define\tTC_DESCRIPTION_%s\t\"", devices[ndevices, 1]) > hfile
+ devices[ndevices] = $2; # devices id
+ description[ndevices] = $4
- f = 4;
- i = 3;
-
- # comments
- ocomment = oparen = 0
- if (f <= NF) {
- ocomment = 1;
- }
+ f = 5;
while (f <= NF) {
- if ($f == "#") {
- printf("(") > hfile
- oparen = 1
- f++
- continue
- }
- if (oparen) {
- printf("%s", $f) > hfile
- if (f < NF)
- printf(" ") > hfile
- f++
- continue
- }
- devices[ndevices, i] = $f
- printf("%s", devices[ndevices, i]) > hfile
- if (f < NF)
- printf(" ") > hfile
- i++; f++;
+ description[ndevices] = sprintf("%s %s", description[ndevices], $f)
+ f++;
}
- if (oparen)
- printf(")") > hfile
- if (ocomment)
- printf("\"") > hfile
- printf("\n") > hfile
next
}
-{
- if ($0 == "")
- blanklines++
- if (blanklines < 2)
- print $0 > hfile
- if (blanklines < 2)
- print $0 > dfile
-}
END {
# print out the match tables
@@ -129,15 +70,13 @@ END {
printf("struct tc_knowndev tc_knowndevs[] = {\n") > dfile
for (i = 1; i <= ndevices; i++) {
printf("\t{\n") > dfile
- printf("\t \"%-8s\",\n", devices[i, 0]) \
- > dfile
- printf("\t TC_DEVICE_%s,\n", devices[i, 1]) \
+ printf("\t \"%-8s\",\n", devices[i]) \
> dfile
- printf("\t TC_DESCRIPTION_%s,\n", devices[i, 1]) \
+ printf("\t \"%s\"\n", description[i]) \
> dfile
printf("\t},\n") > dfile
}
- printf("\t{ NULL, NULL, NULL, }\n") > dfile
+ printf("\t{ NULL, NULL }\n") > dfile
printf("};\n") > dfile
}
diff --git a/sys/dev/tc/tc.c b/sys/dev/tc/tc.c
index 73f5a1cd040..9c4d286b741 100644
--- a/sys/dev/tc/tc.c
+++ b/sys/dev/tc/tc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tc.c,v 1.15 2004/06/28 02:28:43 aaron Exp $ */
+/* $OpenBSD: tc.c,v 1.16 2006/03/13 22:00:31 miod Exp $ */
/* $NetBSD: tc.c,v 1.29 2001/11/13 06:26:10 lukem Exp $ */
/*
@@ -34,7 +34,6 @@
#include <dev/tc/tcreg.h>
#include <dev/tc/tcvar.h>
-#include <dev/tc/tcdevs.h>
/* Definition of the driver for autoconfig. */
@@ -288,7 +287,7 @@ tc_intr_disestablish(dev, cookie)
* Descriptions of of known devices.
*/
struct tc_knowndev {
- const char *id, *driver, *description;
+ const char *id, *description;
};
#include <dev/tc/tcdevs_data.h>
@@ -297,32 +296,22 @@ struct tc_knowndev {
void
tc_devinfo(const char *id, char *cp, size_t cp_len)
{
- const char *driver;
#ifdef TCVERBOSE
struct tc_knowndev *tdp;
- int match;
const char *description;
-#endif
-
- driver = NULL;
-#ifdef TCVERBOSE
/* find the device in the table, if possible. */
description = NULL;
- tdp = tc_knowndevs;
- while (tdp->id != NULL) {
+ for (tdp = tc_knowndevs; tdp->id != NULL; tdp++) {
/* check this entry for a match */
- match = !strcmp(tdp->id, id);
- if (match) {
- driver = tdp->driver;
+ if (strcmp(tdp->id, id) == 0) {
description = tdp->description;
break;
}
- tdp++;
}
- if (driver != NULL)
- snprintf(cp, cp_len, "%s (%s)", driver, description);
+ if (description != NULL)
+ snprintf(cp, cp_len, "\"%s\" (%s)", id, description);
else
#endif
- snprintf(cp, cp_len, "%s", id);
+ snprintf(cp, cp_len, "\"%s\"", id);
}
diff --git a/sys/dev/tc/tcdevs.h b/sys/dev/tc/tcdevs.h
deleted file mode 100644
index 7b319490359..00000000000
--- a/sys/dev/tc/tcdevs.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/* $OpenBSD: tcdevs.h,v 1.7 2002/05/03 20:27:58 miod Exp $ */
-
-/*
- * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.
- *
- * generated from:
- * OpenBSD: tcdevs,v 1.7 2002/05/03 20:27:44 miod Exp
- */
-/* $NetBSD: tcdevs,v 1.17 2000/12/17 13:56:05 ad Exp $ */
-
-/*
- * Copyright (c) 1996 Christopher G. Demetriou
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Christopher G. Demetriou
- * for the NetBSD Project.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#define TC_DEVICE_AV01B_AA "lofi"
-#define TC_DESCRIPTION_AV01B_AA "DecAudio \"LoFi\" audio/isdn"
-
-#define TC_DEVICE_AV300_AA NULL
-#define TC_DESCRIPTION_AV300_AA "Video capture option card"
-
-#define TC_DEVICE_DGLTA_FA "otto"
-#define TC_DESCRIPTION_DGLTA_FA "DGLTA ATM"
-
-#define TC_DEVICE_FORE_ATM "fa"
-#define TC_DESCRIPTION_FORE_ATM "Fore TCA-100 ATM"
-
-#define TC_DEVICE_KZTSA_AA "tza"
-#define TC_DESCRIPTION_KZTSA_AA "TZA FWD SCSI"
-
-#define TC_DEVICE_OTTO "otto"
-#define TC_DESCRIPTION_OTTO "DEC SRC \"OTTO\" ATM"
-
-#define TC_DEVICE_PMAD_AA "le"
-#define TC_DESCRIPTION_PMAD_AA "LANCE Ethernet"
-
-#define TC_DEVICE_PMAD_AB "le"
-#define TC_DESCRIPTION_PMAD_AB "LANCE Ethernet"
-
-#define TC_DEVICE_PMAF_AA "fza"
-#define TC_DESCRIPTION_PMAF_AA "DEC FDDIcontroller 700 (DEFZA; fiber optic)"
-
-#define TC_DEVICE_PMAF_FA "fta"
-#define TC_DESCRIPTION_PMAF_FA "DEFTA FDDI"
-
-#define TC_DEVICE_PMAG_AA "mfb"
-#define TC_DESCRIPTION_PMAG_AA "Monochrome Frame Buffer"
-
-#define TC_DEVICE_PMAG_BA "cfb"
-#define TC_DESCRIPTION_PMAG_BA "Color Frame Buffer"
-
-#define TC_DEVICE_PMAG_CA "px"
-#define TC_DESCRIPTION_PMAG_CA "2D Graphics (PX 2DA)"
-
-#define TC_DEVICE_PMAG_CB "px"
-#define TC_DESCRIPTION_PMAG_CB "2D Graphics (PX 2DA)"
-
-#define TC_DEVICE_PMAG_DA "pxg"
-#define TC_DESCRIPTION_PMAG_DA "3D Graphics (PXG LM-3DA)"
-
-#define TC_DEVICE_PMAG_DB "pxg"
-#define TC_DESCRIPTION_PMAG_DB "3D Graphics (PXG LM-3DA)"
-
-#define TC_DEVICE_PMAG_EB "pxg"
-#define TC_DESCRIPTION_PMAG_EB "3D Graphics (PXG MID-3DA)"
-
-#define TC_DEVICE_PMAG_FA "pxg"
-#define TC_DESCRIPTION_PMAG_FA "3D Graphics (PXG HE-3DA)"
-
-#define TC_DEVICE_PMAG_FB "pxg"
-#define TC_DESCRIPTION_PMAG_FB "3D Graphics (PXG HE+3DA)"
-
-#define TC_DEVICE_PMAGB_BA "sfb"
-#define TC_DESCRIPTION_PMAGB_BA "Smart Frame Buffer (HX8)"
-
-#define TC_DEVICE_PMAGB_FA "pxg"
-#define TC_DESCRIPTION_PMAGB_FA "3D Graphics (PXG HE+3DA)"
-
-#define TC_DEVICE_PMAGB_FB "pxg"
-#define TC_DESCRIPTION_PMAGB_FB "3D Graphics (PXG HE+3DA)"
-
-#define TC_DEVICE_PMAGC_AA "pvg"
-#define TC_DESCRIPTION_PMAGC_AA "2D Graphics (PV-LO)"
-
-#define TC_DEVICE_PMAGC_BA "pvg"
-#define TC_DESCRIPTION_PMAGC_BA "2D Graphics (PV-MID)"
-
-#define TC_DEVICE_PMAGD_AA "sfbp"
-#define TC_DESCRIPTION_PMAGD_AA "Smart Frame Buffer Plus, 8bpp (ZLX-E1)"
-
-#define TC_DEVICE_PMAGD_BA "sfbp"
-#define TC_DESCRIPTION_PMAGD_BA "Smart Frame Buffer Plus, 32bpp (ZLX-E2)"
-
-#define TC_DEVICE_PMAGD_CA "sfbp"
-#define TC_DESCRIPTION_PMAGD_CA "Smart Frame Buffer Plus, 32bpp (ZLX-E3)"
-
-#define TC_DEVICE_PMAZ_AB "asc"
-#define TC_DESCRIPTION_PMAZ_AB "53c94 SCSI Controller"
-
-#define TC_DEVICE_KWS_TD NULL
-#define TC_DESCRIPTION_KWS_TD "Kubota Denali"
-
-#define TC_DEVICE_PMABV_AA "vba"
-#define TC_DESCRIPTION_PMABV_AA "VME Adapter"
-
-#define TC_DEVICE_PMAG_DV "xcfb"
-#define TC_DESCRIPTION_PMAG_DV "Maxine Color Frame Buffer"
-
-#define TC_DEVICE_PMAG_JA NULL
-#define TC_DESCRIPTION_PMAG_JA "24-plane True Color Frame Buffer (TX)"
-
-#define TC_DEVICE_PMAGD "sfbp"
-#define TC_DESCRIPTION_PMAGD "Smart Frame Buffer Plus, unknown bpp"
-
-#define TC_DEVICE_PMAP_AA NULL
-#define TC_DESCRIPTION_PMAP_AA "Prestoserve"
-
-#define TC_DEVICE_PMAT_AA "tra"
-#define TC_DESCRIPTION_PMAT_AA "DEC TurboChannel Token Ring Controller"
-
-#define TC_DEVICE_PMAZ_AA "asc"
-#define TC_DESCRIPTION_PMAZ_AA "53c94 SCSI Controller"
-
-#define TC_DEVICE_PMAZ_DS "tcds"
-#define TC_DESCRIPTION_PMAZ_DS "53c94 TCDS SCSI Controller (baseboard)"
-
-#define TC_DEVICE_PMAZ_FS "tcds"
-#define TC_DESCRIPTION_PMAZ_FS "53c94 TCDS Fast SCSI Controller (baseboard)"
-
-#define TC_DEVICE_PMAZB_AA "tcds"
-#define TC_DESCRIPTION_PMAZB_AA "53c94 TCDS SCSI Controller option card"
-
-#define TC_DEVICE_PMAZB_AB "tcds"
-#define TC_DESCRIPTION_PMAZB_AB "53c94 TCDS SCSI Controller option card"
-
-#define TC_DEVICE_PMAZC_AA "tcds"
-#define TC_DESCRIPTION_PMAZC_AA "53c94 TCDS Fast SCSI Controller option card"
-
-#define TC_DEVICE_PMTNV_AA NULL
-#define TC_DESCRIPTION_PMTNV_AA "Non-volatile RAM option card"
-
-#define TC_DEVICE_T1D4PKT "ds"
-#define TC_DESCRIPTION_T1D4PKT "DECWRL Turbochannel T1"
-
-#define TC_DEVICE_T3PKT "tt"
-#define TC_DESCRIPTION_T3PKT "DECWRL Turbochannel T3"