Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci follow the lead of genfb_pci and call pci_mapreg...



details:   https://anonhg.NetBSD.org/src/rev/374179f176a9
branches:  trunk
changeset: 762768:374179f176a9
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Feb 27 18:10:25 2011 +0000

description:
follow the lead of genfb_pci and call pci_mapreg_probe before pci_mapreg_info

diffstat:

 sys/dev/pci/pci.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (33 lines):

diff -r 3f670ddd90ca -r 374179f176a9 sys/dev/pci/pci.c
--- a/sys/dev/pci/pci.c Sun Feb 27 18:07:42 2011 +0000
+++ b/sys/dev/pci/pci.c Sun Feb 27 18:10:25 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci.c,v 1.133 2011/02/24 03:37:02 macallan Exp $       */
+/*     $NetBSD: pci.c,v 1.134 2011/02/27 18:10:25 jmcneill Exp $       */
 
 /*
  * Copyright (c) 1995, 1996, 1997, 1998
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.133 2011/02/24 03:37:02 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.134 2011/02/27 18:10:25 jmcneill Exp $");
 
 #include "opt_pci.h"
 
@@ -302,10 +302,13 @@
            sizeof(sc->PCI_SC_DEVICESC(device, function).c_range));
        i = 0;
        for (bar = PCI_MAPREG_START; bar < PCI_MAPREG_END; bar += width) {
-               int type = pci_mapreg_type(pc, tag, bar);
                struct pci_range *r;
+               pcireg_t type;
 
                width = 4;
+               if (pci_mapreg_probe(pc, tag, bar, &type) == 0)
+                       continue;
+
                if (PCI_MAPREG_TYPE(type) == PCI_MAPREG_TYPE_MEM) {
                        if (PCI_MAPREG_MEM_TYPE(type) ==
                            PCI_MAPREG_MEM_TYPE_64BIT)



Home | Main Index | Thread Index | Old Index