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

This commit is contained in:
nathanw 2002-06-24 21:08:37 +00:00
parent 7595143319
commit 4ce40595e2
2 changed files with 14 additions and 2 deletions

View File

@ -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 @@ ofbattach(parent, self, aux)
}
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 @@ ofb_ioctl(v, cmd, data, flag, p)
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;
}

View File

@ -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_devconfig {
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 */