summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/sparc64/dev')
-rw-r--r--sys/arch/sparc64/dev/pci_machdep.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/arch/sparc64/dev/pci_machdep.c b/sys/arch/sparc64/dev/pci_machdep.c
index 359e7373808..7b7c6469a75 100644
--- a/sys/arch/sparc64/dev/pci_machdep.c
+++ b/sys/arch/sparc64/dev/pci_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.c,v 1.20 2005/09/04 20:40:53 brad Exp $ */
+/* $OpenBSD: pci_machdep.c,v 1.21 2006/01/06 20:30:09 kettenis Exp $ */
/* $NetBSD: pci_machdep.c,v 1.22 2001/07/20 00:07:13 eeh Exp $ */
/*
@@ -159,7 +159,8 @@ pci_dev_funcorder(pc, busno, device, funcs)
char *funcs;
{
struct ofw_pci_register reg;
- int node, len, i = 0;
+ int node, len, function, i = 0;
+ u_int8_t done = 0;
#ifdef DEBUG
char name[80];
#endif
@@ -188,7 +189,14 @@ pci_dev_funcorder(pc, busno, device, funcs)
if (device != OFW_PCI_PHYS_HI_DEVICE(reg.phys_hi))
continue;
- funcs[i++] = OFW_PCI_PHYS_HI_FUNCTION(reg.phys_hi);
+
+ function = OFW_PCI_PHYS_HI_FUNCTION(reg.phys_hi);
+
+ if (done & (1 << function))
+ continue;
+
+ funcs[i++] = function;
+ done |= 1 << function;
#ifdef DEBUG
if (sparc_pci_debug & SPDB_PROBE) {
OF_getprop(node, "name", &name, sizeof(name));