summaryrefslogtreecommitdiffstats
path: root/sys/dev/pccbb
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2002-11-14 05:20:39 +0000
committerimp <imp@FreeBSD.org>2002-11-14 05:20:39 +0000
commit7e20f49bf65628e70023397eca24c864ab2e456f (patch)
tree68504e41c88104d7df6999d7cb76a740ca69acb2 /sys/dev/pccbb
parent7ed8f6e719795485c28573cbdd979653edfe8bfe (diff)
downloadFreeBSD-src-7e20f49bf65628e70023397eca24c864ab2e456f.zip
FreeBSD-src-7e20f49bf65628e70023397eca24c864ab2e456f.tar.gz
MFp4:
o Add support for bus_child_present call by implementing that method for cbb.
Diffstat (limited to 'sys/dev/pccbb')
-rw-r--r--sys/dev/pccbb/pccbb.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c
index c919b67..3f4eea3 100644
--- a/sys/dev/pccbb/pccbb.c
+++ b/sys/dev/pccbb/pccbb.c
@@ -1933,6 +1933,17 @@ cbb_resume(device_t self)
return (error);
}
+static int
+cbb_child_present(device_t self)
+{
+ struct cbb_softc *sc = (struct cbb_softc *)device_get_softc(self);
+ uint32_t sockstate;
+
+ sockstate = cbb_get(sc, CBB_SOCKET_STATE);
+ return ((sockstate & CBB_SOCKET_STAT_CD) != 0 &&
+ (sc->flags & CBB_CARD_OK) != 0);
+}
+
static device_method_t cbb_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, cbb_probe),
@@ -1954,6 +1965,7 @@ static device_method_t cbb_methods[] = {
DEVMETHOD(bus_child_detached, cbb_child_detached),
DEVMETHOD(bus_setup_intr, cbb_setup_intr),
DEVMETHOD(bus_teardown_intr, cbb_teardown_intr),
+ DEVMETHOD(bus_child_present, cbb_child_present),
/* 16-bit card interface */
DEVMETHOD(card_set_res_flags, cbb_pcic_set_res_flags),
OpenPOWER on IntegriCloud