summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2007-02-21 13:08:23 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2007-02-21 13:08:23 +0000
commit9872eac08f83b189fadd92483bd3e5948d2e0dfd (patch)
treeaa5a93f8beafa5744ba6243ecbb71fe6312798c1
parentd416e035bc192bb2d7566e0f08b3b1d7f64deaed (diff)
put the structs defining the content of pcidevs_data.h into that header
file, rather than in pci_subr.c before theyre used. this allows the header to be used elsewhere without needing to copy a chunk out of pci_subr.c. ok miod@ deraadt@
-rw-r--r--sys/dev/pci/devlist2h.awk16
-rw-r--r--sys/dev/pci/pci_subr.c21
2 files changed, 16 insertions, 21 deletions
diff --git a/sys/dev/pci/devlist2h.awk b/sys/dev/pci/devlist2h.awk
index 58588c55c09..c15a3e125a5 100644
--- a/sys/dev/pci/devlist2h.awk
+++ b/sys/dev/pci/devlist2h.awk
@@ -1,5 +1,5 @@
#! /usr/bin/awk -f
-# $OpenBSD: devlist2h.awk,v 1.6 2001/01/27 01:19:11 deraadt Exp $
+# $OpenBSD: devlist2h.awk,v 1.7 2007/02/21 13:08:22 dlg Exp $
# $NetBSD: devlist2h.awk,v 1.2 1996/01/22 21:08:09 cgd Exp $
#
# Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -45,7 +45,19 @@ NR == 1 {
printf(" *\n") > dfile
printf(" * generated from:\n") > dfile
printf(" *\t%s\n", VERSION) > dfile
- printf(" */\n") > dfile
+ printf(" */\n\n") > dfile
+
+ printf("/* Descriptions of known vendors and devices. */\n") > dfile
+ printf("struct pci_known_vendor {\n") > dfile
+ printf("\tpci_vendor_id_t vendor;\n") > dfile
+ printf("\tconst char *vendorname;\n") > dfile
+ printf("};\n\n") > dfile
+
+ printf("struct pci_known_product {\n") > dfile
+ printf("\tpci_vendor_id_t vendor;\n") > dfile
+ printf("\tpci_product_id_t product;\n") > dfile
+ printf("\tconst char *productname;\n") > dfile
+ printf("};\n\n") > dfile
printf("/*\n") > hfile
printf(" * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.\n") \
diff --git a/sys/dev/pci/pci_subr.c b/sys/dev/pci/pci_subr.c
index 5fc0be8093a..d6010180b87 100644
--- a/sys/dev/pci/pci_subr.c
+++ b/sys/dev/pci/pci_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_subr.c,v 1.20 2007/01/02 19:22:38 mbalmer Exp $ */
+/* $OpenBSD: pci_subr.c,v 1.21 2007/02/21 13:08:22 dlg Exp $ */
/* $NetBSD: pci_subr.c,v 1.19 1996/10/13 01:38:29 christos Exp $ */
/*
@@ -43,6 +43,7 @@
#include <dev/pci/pcivar.h>
#ifdef PCIVERBOSE
#include <dev/pci/pcidevs.h>
+#include <dev/pci/pcidevs_data.h>
#endif
/*
@@ -275,24 +276,6 @@ const struct pci_class pci_class[] = {
{ 0 },
};
-#ifdef PCIVERBOSE
-/*
- * Descriptions of known vendors and devices ("products").
- */
-struct pci_known_vendor {
- pci_vendor_id_t vendor;
- const char *vendorname;
-};
-
-struct pci_known_product {
- pci_vendor_id_t vendor;
- pci_product_id_t product;
- const char *productname;
-};
-
-#include <dev/pci/pcidevs_data.h>
-#endif /* PCIVERBOSE */
-
const char *
pci_findvendor(pcireg_t id_reg)
{