summaryrefslogtreecommitdiffstats
path: root/sys/dev/pccbb
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2003-08-18 21:59:24 +0000
committerimp <imp@FreeBSD.org>2003-08-18 21:59:24 +0000
commit6e857b820905ce0d0001f66afcc266e431a6aaa1 (patch)
treea9eba85e164a08850d88b0beb6fcb389b446d61d /sys/dev/pccbb
parent3ec6a9ddab775f7ba7316584afaccef465a1d401 (diff)
downloadFreeBSD-src-6e857b820905ce0d0001f66afcc266e431a6aaa1.zip
FreeBSD-src-6e857b820905ce0d0001f66afcc266e431a6aaa1.tar.gz
The CD bits in the CBB_SOCKET_STATE register are 0 when the card is
present, and non-zero when it is (or may be) absent. The test cbb_child_present was backwards. However, typical usage in the tree would cause it to do the right thing because the card really wasn't there the OK flag would be turned on. Also, assume that if any of these bits are turned on we don't have a card, rather than requiring both of them in the suspend/resume routines. Noticed by: cognet
Diffstat (limited to 'sys/dev/pccbb')
-rw-r--r--sys/dev/pccbb/pccbb.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c
index a3435b4..9b47123 100644
--- a/sys/dev/pccbb/pccbb.c
+++ b/sys/dev/pccbb/pccbb.c
@@ -1376,8 +1376,7 @@ cbb_cardbus_power_enable_socket(device_t brdev, device_t child)
struct cbb_softc *sc = device_get_softc(brdev);
int err;
- if ((cbb_get(sc, CBB_SOCKET_STATE) & CBB_STATE_CD) ==
- CBB_STATE_CD)
+ if ((cbb_get(sc, CBB_SOCKET_STATE) & CBB_STATE_CD) != 0)
return (ENODEV);
err = cbb_do_power(brdev);
@@ -2027,8 +2026,8 @@ cbb_child_present(device_t self)
uint32_t sockstate;
sockstate = cbb_get(sc, CBB_SOCKET_STATE);
- return ((sockstate & CBB_STATE_CD) != 0 &&
- (sc->flags & CBB_CARD_OK) != 0);
+ return ((sockstate & CBB_STATE_CD) == 0 &&
+ (sc->flags & CBB_CARD_OK) == CBB_CARD_OK);
}
static device_method_t cbb_methods[] = {
OpenPOWER on IntegriCloud