summaryrefslogtreecommitdiff
path: root/sys/dev/pci/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/pci/pci.c')
-rw-r--r--sys/dev/pci/pci.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index a12bbde504d..2cc0be21242 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci.c,v 1.28 2002/03/27 15:10:44 jason Exp $ */
+/* $OpenBSD: pci.c,v 1.29 2002/04/04 17:11:46 jason Exp $ */
/* $NetBSD: pci.c,v 1.31 1997/06/06 23:48:04 thorpej Exp $ */
/*
@@ -169,13 +169,33 @@ pciattach(parent, self, aux)
for (device = 0; device < maxndevs; device++) {
#endif
pcitag_t tag;
- pcireg_t id, class, intr, bhlcr;
+ pcireg_t id, class, intr;
+#ifndef __sparc64__
+ pcireg_t bhlcr;
+#endif
struct pci_attach_args pa;
int pin;
tag = pci_make_tag(pc, bus, device, 0);
id = pci_conf_read(pc, tag, PCI_ID_REG);
+#ifdef __sparc64__
+ pci_dev_funcorder(pc, bus, device, funcs);
+ nfunctions = 8;
+
+ /* Invalid vendor ID value or 0 (see below for zero)
+ * ... of course, if the pci_dev_funcorder found
+ * functions other than zero, we probably want
+ * to attach them.
+ */
+ if (PCI_VENDOR(id) == PCI_VENDOR_INVALID || PCI_VENDOR(id) == 0)
+ if (funcs[0] < 0)
+ continue;
+
+ for (j = 0; (function = funcs[j]) < nfunctions &&
+ function >= 0; j++) {
+#else
+
/* Invalid vendor ID value? */
if (PCI_VENDOR(id) == PCI_VENDOR_INVALID)
continue;
@@ -193,6 +213,7 @@ pciattach(parent, self, aux)
#else
for (function = 0; function < nfunctions; function++) {
#endif
+#endif
tag = pci_make_tag(pc, bus, device, function);
id = pci_conf_read(pc, tag, PCI_ID_REG);