summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/pci/pci_subr.c21
-rw-r--r--sys/dev/pci/pcivar.h8
2 files changed, 27 insertions, 2 deletions
diff --git a/sys/dev/pci/pci_subr.c b/sys/dev/pci/pci_subr.c
index b98b917d69a..e68a04aacf8 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.12 2001/05/08 20:13:18 mickey Exp $ */
+/* $OpenBSD: pci_subr.c,v 1.13 2002/01/03 20:52:24 nate Exp $ */
/* $NetBSD: pci_subr.c,v 1.19 1996/10/13 01:38:29 christos Exp $ */
/*
@@ -281,6 +281,25 @@ struct pci_known_product {
#include <dev/pci/pcidevs_data.h>
#endif /* PCIVERBOSE */
+const char *
+pci_findvendor(pcireg_t id_reg)
+{
+#ifdef PCIVERBOSE
+ pci_vendor_id_t vendor = PCI_VENDOR(id_reg);
+ const struct pci_known_vendor *kdp;
+
+ kdp = pci_known_vendors;
+ while (kdp->vendorname != NULL) { /* all have vendor name */
+ if (kdp->vendor == vendor)
+ break;
+ kdp++;
+ }
+ return (kdp->vendorname);
+#else
+ return (NULL);
+#endif
+}
+
void
pci_devinfo(id_reg, class_reg, showclass, cp)
pcireg_t id_reg, class_reg;
diff --git a/sys/dev/pci/pcivar.h b/sys/dev/pci/pcivar.h
index 012210e6b27..7367b63991b 100644
--- a/sys/dev/pci/pcivar.h
+++ b/sys/dev/pci/pcivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcivar.h,v 1.21 2001/08/19 05:17:37 art Exp $ */
+/* $OpenBSD: pcivar.h,v 1.22 2002/01/03 20:52:24 nate Exp $ */
/* $NetBSD: pcivar.h,v 1.23 1997/06/06 23:48:05 thorpej Exp $ */
/*
@@ -189,4 +189,10 @@ void pci_devinfo __P((pcireg_t, pcireg_t, int, char *));
void set_pci_isa_bridge_callback __P((void (*)(void *), void *));
const struct pci_quirkdata *
pci_lookup_quirkdata __P((pci_vendor_id_t, pci_product_id_t));
+
+/*
+ * Misc.
+ */
+const char *pci_findvendor __P((pcireg_t));
+
#endif /* _DEV_PCI_PCIVAR_H_ */