Source-Changes-HG archive

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

[src/trunk]: src/sys Tell a pci(4) instance its subordinate PCI buses using a...



details:   https://anonhg.NetBSD.org/src/rev/1459bc22c73c
branches:  trunk
changeset: 770548:1459bc22c73c
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Fri Oct 21 21:35:28 2011 +0000

description:
Tell a pci(4) instance its subordinate PCI buses using a new member
in the pcibus_attach_args, pba_sub. pciN attaches to pba_bus itself.
If pba_bus < pba_sub, then [pba_bus + 1, pba_sub] are subordinate to
pba_bus.

On i386, make mainbus0 attach pci0 with pba_sub = 255 because all buses
1 and up must be subordinate to pci0.

XXX Deal with other architectures.

diffstat:

 sys/arch/i386/i386/mainbus.c |   5 +++--
 sys/dev/pci/pcivar.h         |  10 +++++++++-
 sys/dev/pci/ppb.c            |   5 +++--
 3 files changed, 15 insertions(+), 5 deletions(-)

diffs (76 lines):

diff -r be99fe46696e -r 1459bc22c73c sys/arch/i386/i386/mainbus.c
--- a/sys/arch/i386/i386/mainbus.c      Fri Oct 21 17:57:45 2011 +0000
+++ b/sys/arch/i386/i386/mainbus.c      Fri Oct 21 21:35:28 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mainbus.c,v 1.91 2011/05/17 17:34:50 dyoung Exp $      */
+/*     $NetBSD: mainbus.c,v 1.92 2011/10/21 21:35:28 dyoung Exp $      */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.91 2011/05/17 17:34:50 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.92 2011/10/21 21:35:28 dyoung Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -406,6 +406,7 @@
                mba.mba_pba.pba_pc = NULL;
                mba.mba_pba.pba_flags = pci_bus_flags();
                mba.mba_pba.pba_bus = 0;
+               mba.mba_pba.pba_sub = 255;
                mba.mba_pba.pba_bridgetag = NULL;
 #if NACPICA > 0 && defined(ACPI_SCANPCI)
                if (npcibus == 0 && sc->sc_mpacpi_active)
diff -r be99fe46696e -r 1459bc22c73c sys/dev/pci/pcivar.h
--- a/sys/dev/pci/pcivar.h      Fri Oct 21 17:57:45 2011 +0000
+++ b/sys/dev/pci/pcivar.h      Fri Oct 21 21:35:28 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pcivar.h,v 1.95 2011/08/24 20:27:36 dyoung Exp $       */
+/*     $NetBSD: pcivar.h,v 1.96 2011/10/21 21:35:28 dyoung Exp $       */
 
 /*
  * Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
@@ -104,6 +104,14 @@
        int             pba_flags;      /* flags; see below */
 
        int             pba_bus;        /* PCI bus number */
+       int             pba_sub;        /* pba_bus >= pba_sub: no
+                                        * buses are subordinate to
+                                        * pba_bus.
+                                        *
+                                        * pba_bus < pba_sub: buses
+                                        * [pba_bus + 1, pba_sub] are
+                                        * subordinate to pba_bus.
+                                        */
 
        /*
         * Pointer to the pcitag of our parent bridge.  If there is no
diff -r be99fe46696e -r 1459bc22c73c sys/dev/pci/ppb.c
--- a/sys/dev/pci/ppb.c Fri Oct 21 17:57:45 2011 +0000
+++ b/sys/dev/pci/ppb.c Fri Oct 21 21:35:28 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ppb.c,v 1.46 2011/08/17 00:59:47 dyoung Exp $  */
+/*     $NetBSD: ppb.c,v 1.47 2011/10/21 21:35:28 dyoung Exp $  */
 
 /*
  * Copyright (c) 1996, 1998 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ppb.c,v 1.46 2011/08/17 00:59:47 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ppb.c,v 1.47 2011/10/21 21:35:28 dyoung Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -206,6 +206,7 @@
        pba.pba_pc = pc;
        pba.pba_flags = pa->pa_flags & ~PCI_FLAGS_MRM_OKAY;
        pba.pba_bus = PPB_BUSINFO_SECONDARY(busdata);
+       pba.pba_sub = PPB_BUSINFO_SUBORDINATE(busdata);
        pba.pba_bridgetag = &sc->sc_tag;
        pba.pba_intrswiz = pa->pa_intrswiz;
        pba.pba_intrtag = pa->pa_intrtag;



Home | Main Index | Thread Index | Old Index