Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Add a __PCI_DEV_FUNCORDER hook.



details:   https://anonhg.NetBSD.org/src/rev/2af1b4c5768e
branches:  trunk
changeset: 782190:2af1b4c5768e
user:      matt <matt%NetBSD.org@localhost>
date:      Sat Oct 20 06:04:01 2012 +0000

description:
Add a __PCI_DEV_FUNCORDER hook.

diffstat:

 sys/dev/pci/pci.c |  21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diffs (43 lines):

diff -r 32e50aa7899f -r 2af1b4c5768e sys/dev/pci/pci.c
--- a/sys/dev/pci/pci.c Sat Oct 20 06:03:38 2012 +0000
+++ b/sys/dev/pci/pci.c Sat Oct 20 06:04:01 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci.c,v 1.142 2011/08/29 14:47:08 jmcneill Exp $       */
+/*     $NetBSD: pci.c,v 1.143 2012/10/20 06:04:01 matt Exp $   */
 
 /*
  * Copyright (c) 1995, 1996, 1997, 1998
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.142 2011/08/29 14:47:08 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.143 2012/10/20 06:04:01 matt Exp $");
 
 #include "opt_pci.h"
 
@@ -580,7 +580,24 @@
                else
                        nfunctions = PCI_HDRTYPE_MULTIFN(bhlcr) ? 8 : 1;
 
+#ifdef __PCI_DEV_FUNCORDER
+               char funcs[8];
+               int j;
+               for (j = 0; j < nfunctions; j++) {
+                       funcs[j] = j;
+               }
+               if (j < __arraycount(funcs))
+                       funcs[j] = -1;
+               if (nfunctions > 1) {
+                       pci_dev_funcorder(sc->sc_pc, sc->sc_bus, device,
+                           nfunctions, funcs);
+               }
+               for (j = 0;
+                    j < 8 && (function = funcs[j]) < 8 && function >= 0;
+                    j++) {
+#else
                for (function = 0; function < nfunctions; function++) {
+#endif
                        if ((locators[PCICF_FUNCTION] != PCICF_FUNCTION_DEFAULT)
                            && (locators[PCICF_FUNCTION] != function))
                                continue;



Home | Main Index | Thread Index | Old Index