aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/pccbb
diff options
context:
space:
mode:
authorMike Smith <msmith@FreeBSD.org>2000-12-13 01:28:00 +0000
committerMike Smith <msmith@FreeBSD.org>2000-12-13 01:28:00 +0000
commit84c6b37d745b2bb8b7f7d5c36af293c28785cb3d (patch)
treec0a4803a6859183745a777f5c67f44995109567a /sys/dev/pccbb
parent8983cfbf278ba9c211d639409c4373eeb08f41e9 (diff)
Notes
Diffstat (limited to 'sys/dev/pccbb')
-rw-r--r--sys/dev/pccbb/pccbb.c30
-rw-r--r--sys/dev/pccbb/pccbbvar.h4
2 files changed, 33 insertions, 1 deletions
diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c
index b54cc0260095..0615a321b095 100644
--- a/sys/dev/pccbb/pccbb.c
+++ b/sys/dev/pccbb/pccbb.c
@@ -392,6 +392,8 @@ pccbb_attach(device_t dev)
sc->sc_flags = 0;
sc->sc_cbdev = NULL;
sc->sc_pccarddev = NULL;
+ sc->sc_secbus = pci_read_config(dev, PCIR_SECBUS_2, 1);
+ sc->sc_subbus = pci_read_config(dev, PCIR_SUBBUS_2, 1);
sc->memalloc = 0;
sc->ioalloc = 0;
SLIST_INIT(&sc->rl);
@@ -1779,6 +1781,32 @@ pccbb_release_resource(device_t self, device_t child, int type, int rid,
rid, r);
}
+static int
+pccbb_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
+{
+ struct pccbb_softc *sc = device_get_softc(dev);
+
+ switch (which) {
+ case PCIB_IVAR_BUS:
+ *result = sc->sc_secbus;
+ return(0);
+ }
+ return(ENOENT);
+}
+
+static int
+pccbb_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
+{
+ struct pccbb_softc *sc = device_get_softc(dev);
+
+ switch (which) {
+ case PCIB_IVAR_BUS:
+ sc->sc_secbus = value;
+ break;
+ }
+ return(ENOENT);
+}
+
/************************************************************************/
/* PCI compat methods */
/************************************************************************/
@@ -1820,6 +1848,8 @@ static device_method_t pccbb_methods[] = {
/* bus methods */
DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, pccbb_read_ivar),
+ DEVMETHOD(bus_write_ivar, pccbb_write_ivar),
DEVMETHOD(bus_alloc_resource, pccbb_alloc_resource),
DEVMETHOD(bus_release_resource, pccbb_release_resource),
DEVMETHOD(bus_activate_resource, pccbb_activate_resource),
diff --git a/sys/dev/pccbb/pccbbvar.h b/sys/dev/pccbb/pccbbvar.h
index 1270ec2551d3..2e4ef7cc8251 100644
--- a/sys/dev/pccbb/pccbbvar.h
+++ b/sys/dev/pccbb/pccbbvar.h
@@ -65,8 +65,10 @@ struct pccbb_softc {
struct resource *sc_irq_res;
void *sc_intrhand;
struct pccbb_socketreg *sc_socketreg;
- u_int32_t sc_flags;
+ u_int8_t sc_secbus;
+ u_int8_t sc_subbus;
struct mtx sc_mtx;
+ u_int32_t sc_flags;
#define PCCBB_PCIC_IO_RELOC 0x01
#define PCCBB_PCIC_MEM_32 0x02
#define PCCBB_CARDATTACHED 0x01000000