aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2002-11-14 05:20:39 +0000
committerWarner Losh <imp@FreeBSD.org>2002-11-14 05:20:39 +0000
commitb20360c8e61e495956ec9c2ad2c3abb310a0048f (patch)
tree68504e41c88104d7df6999d7cb76a740ca69acb2 /sys
parentdfe5056e8029aabf479fded7204a13925fc79b95 (diff)
Notes
Diffstat (limited to 'sys')
-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 c919b67346c43..3f4eea36a5843 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),