Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/macppc/dev Pass through the PCI configuration ioctl...



details:   https://anonhg.NetBSD.org/src/rev/6592f6fae24c
branches:  trunk
changeset: 533223:6592f6fae24c
user:      nathanw <nathanw%NetBSD.org@localhost>
date:      Mon Jun 24 21:08:37 2002 +0000

description:
Pass through the PCI configuration ioctls, like vga_pci.c does.

diffstat:

 sys/arch/macppc/dev/ofb.c    |  11 ++++++++++-
 sys/arch/macppc/dev/ofbvar.h |   5 ++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diffs (58 lines):

diff -r 3e8647b8f6cf -r 6592f6fae24c sys/arch/macppc/dev/ofb.c
--- a/sys/arch/macppc/dev/ofb.c Mon Jun 24 20:14:35 2002 +0000
+++ b/sys/arch/macppc/dev/ofb.c Mon Jun 24 21:08:37 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ofb.c,v 1.26 2002/03/17 19:40:44 atatat Exp $  */
+/*     $NetBSD: ofb.c,v 1.27 2002/06/24 21:08:37 nathanw Exp $ */
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -41,6 +41,7 @@
 #include <dev/pci/pcidevs.h>
 #include <dev/pci/pcireg.h>
 #include <dev/pci/pcivar.h>
+#include <dev/pci/pciio.h>
 
 #include <dev/wscons/wsconsio.h>
 #include <dev/wscons/wsdisplayvar.h>
@@ -175,6 +176,9 @@
        }
        sc->sc_dc = dc;
 
+       sc->sc_pc = pa->pa_pc;
+       sc->sc_pcitag = pa->pa_tag;
+
        /* XXX */
        if (OF_getprop(node, "assigned-addresses", sc->sc_addrs,
            sizeof(sc->sc_addrs)) == -1) {
@@ -347,6 +351,11 @@
                gm->gd_fbaddr = (caddr_t)dc->dc_paddr;
                gm->gd_fbrowbytes = dc->dc_ri.ri_stride;
                return 0;
+       /* PCI config read/write passthrough. */
+       case PCI_IOC_CFGREAD:
+       case PCI_IOC_CFGWRITE:
+               return (pci_devioctl(sc->sc_pc, sc->sc_pcitag,
+                   cmd, data, flag, p));
        }
        return EPASSTHROUGH;
 }
diff -r 3e8647b8f6cf -r 6592f6fae24c sys/arch/macppc/dev/ofbvar.h
--- a/sys/arch/macppc/dev/ofbvar.h      Mon Jun 24 20:14:35 2002 +0000
+++ b/sys/arch/macppc/dev/ofbvar.h      Mon Jun 24 21:08:37 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ofbvar.h,v 1.5 2001/06/10 13:56:13 tsubai Exp $        */
+/*     $NetBSD: ofbvar.h,v 1.6 2002/06/24 21:08:37 nathanw Exp $       */
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -37,6 +37,9 @@
 struct ofb_softc {
        struct  device sc_dev;
 
+       pci_chipset_tag_t sc_pc;
+       pcitag_t sc_pcitag;
+
        struct ofb_devconfig *sc_dc;    /* device configuration */
        int nscreens;
        u_int32_t sc_addrs[30];         /* "assigned-addresses" storage */



Home | Main Index | Thread Index | Old Index