diff options
author | Hajimu UMEMOTO <ume@FreeBSD.org> | 2000-08-20 16:16:57 +0000 |
---|---|---|
committer | Hajimu UMEMOTO <ume@FreeBSD.org> | 2000-08-20 16:16:57 +0000 |
commit | e0faad6850ddd7593f869132fc7647c1576e0f6d (patch) | |
tree | d1b7cc418ae14fcf9c1d490ddace1f1dbeced259 /sys/pccard | |
parent | 59e8700a14cdbf24833a94233df0a49ed7cc61d9 (diff) | |
download | src-e0faad6850ddd7593f869132fc7647c1576e0f6d.tar.gz src-e0faad6850ddd7593f869132fc7647c1576e0f6d.zip |
Add UNIX domain socket feature to pccardd. This makes pccard
related PAO3/ports such as gxcardmon work.
Reviewed by: imp
Obtained from: PAO3
Notes
Notes:
svn path=/head/; revision=64878
Diffstat (limited to 'sys/pccard')
-rw-r--r-- | sys/pccard/cardinfo.h | 2 | ||||
-rw-r--r-- | sys/pccard/pccard.c | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/sys/pccard/cardinfo.h b/sys/pccard/cardinfo.h index 06c6f4d63005..f71cd6f2237f 100644 --- a/sys/pccard/cardinfo.h +++ b/sys/pccard/cardinfo.h @@ -58,7 +58,7 @@ /* * Slot states for PIOCGSTATE */ -enum cardstate { noslot, empty, suspend, filled }; +enum cardstate { noslot, empty, suspend, filled, inactive }; /* * Descriptor structure for memory map. diff --git a/sys/pccard/pccard.c b/sys/pccard/pccard.c index 298fbb54e046..97c2294b79b9 100644 --- a/sys/pccard/pccard.c +++ b/sys/pccard/pccard.c @@ -318,7 +318,7 @@ pccard_event(struct slot *slt, enum card_event event) * The slot and devices are disabled, but the * data structures are not unlinked. */ - if (slt->state == filled) { + if (slt->state == filled || slt->state == inactive) { slt->state = empty; disable_slot_to(slt); } @@ -600,11 +600,13 @@ crdioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct proc *p) if (!pwval) { if (slt->state != filled) return EINVAL; + pccard_event(slt, card_removed); + slt->state = inactive; } else { - if (slt->state != empty) + if (slt->state != empty && slt->state != inactive) return EINVAL; + pccard_event(slt, card_inserted); } - pccard_event(slt, pwval == 0 ? card_removed : card_inserted); break; case PIOCSBEEP: if (pccard_beep_select(*(int *)data)) { |