summaryrefslogtreecommitdiffstats
path: root/sys/pccard/pcic.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2001-07-26 23:23:36 +0000
committerimp <imp@FreeBSD.org>2001-07-26 23:23:36 +0000
commite690685887f95fff0e83e9fd65135e3153d5ac88 (patch)
treec038590e13d28dfe58f9483c5b6130a4fc06f937 /sys/pccard/pcic.c
parent94613ac7dab9074f1f2e33d5a7552c510f1c4397 (diff)
downloadFreeBSD-src-e690685887f95fff0e83e9fd65135e3153d5ac88.zip
FreeBSD-src-e690685887f95fff0e83e9fd65135e3153d5ac88.tar.gz
Check the state of the slot when we resume. Set it to empty if we no
longer have a pccard in the slot. This fixes the problem where pccard would say that a card had been inserted on resume. This also appears to make the insert/remove events more reliable after a resume as well, but that may be a different bug I need to hunt down.
Diffstat (limited to 'sys/pccard/pcic.c')
-rw-r--r--sys/pccard/pcic.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/pccard/pcic.c b/sys/pccard/pcic.c
index a57336e..2ee54df6 100644
--- a/sys/pccard/pcic.c
+++ b/sys/pccard/pcic.c
@@ -314,7 +314,7 @@ pcic_attach(device_t dev)
struct pcic_softc *sc;
struct slot *slt;
struct pcic_slot *sp;
- int stat;
+ u_int8_t stat;
sc = (struct pcic_softc *) device_get_softc(dev);
callout_handle_init(&sc->timeout_ch);
@@ -600,12 +600,16 @@ static void
pcic_resume(struct slot *slt)
{
struct pcic_slot *sp = slt->cdata;
+ u_int8_t stat;
pcic_do_mgt_irq(sp, slt->irq);
if (sp->controller == PCIC_PD672X) {
pcic_setb(sp, PCIC_MISC1, PCIC_MISC1_SPEAKER);
pcic_setb(sp, PCIC_MISC2, PCIC_LPDM_EN);
}
+ stat = sp->getb(sp, PCIC_STATUS);
+ if ((stat & PCIC_CD) != PCIC_CD)
+ sp->slt->laststate = sp->slt->state = empty;
}
int
OpenPOWER on IntegriCloud