summaryrefslogtreecommitdiffstats
path: root/sys/pccard/cardinfo.h
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2001-07-27 07:21:42 +0000
committerimp <imp@FreeBSD.org>2001-07-27 07:21:42 +0000
commit5323d94f5056a1cff6da3a58669e5415800777c0 (patch)
tree5b691587f87ab221ca6af7189cb77ce890ed6ca1 /sys/pccard/cardinfo.h
parent3e6aed8fdce718dceb09e51b82d2eec614603224 (diff)
downloadFreeBSD-src-5323d94f5056a1cff6da3a58669e5415800777c0.zip
FreeBSD-src-5323d94f5056a1cff6da3a58669e5415800777c0.tar.gz
Attempt to fix and document interactions between suspend/resume and pccardc
power x 0. pccardc power x 0 used to disable the slot. But a suspend/resume would reactivate the pccard. It no longer does that. Now the disabling of the slot is sticy until it is reset with power x 1 or the card is ejected. This seems closer to correct behavior to me. o Process all card state changes the same using pccard_do_stat_change(). o Cleanup disabling the card so that we can preserve the state after the change. Basically, don't set it to empty as often as we do. o On suspend, the new state is "empty" and the laststate is "suspend" o Document state machine with a diagram of states and edges. The edges are labeld to tell the reader what event causes the external state changes. o "machdep.pccard.pcic_resume_reset" may be obsolete now. We always call the bridge driver's resume method on resume now. Otherwise cards won't automatically show up. If it needs to stay, I'll add it back.
Diffstat (limited to 'sys/pccard/cardinfo.h')
-rw-r--r--sys/pccard/cardinfo.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/sys/pccard/cardinfo.h b/sys/pccard/cardinfo.h
index b4926e7..0c48451 100644
--- a/sys/pccard/cardinfo.h
+++ b/sys/pccard/cardinfo.h
@@ -58,7 +58,35 @@
/*
* Slot states for PIOCGSTATE
+ *
+ * Here's a state diagram of all the possible states:
+ *
+ * power x 1
+ * -------------------
+ * / \
+ * / v
+ * resume +----------+ power x 0 +----------+
+ * ------->| inactive |<--------------| filled |
+ * / +----------+ +----------+
+ * / / \ ^ |
+ * nil <--------- \ insert or | | suspend or
+ * suspend \ power x 1 | | eject
+ * \ | v
+ * \ +----------+
+ * ------------->| empty |
+ * eject +----------+
+ *
+ * Note, the above diagram is for the state. On suspend, the laststate
+ * gets set to suspend to tell pccardd what happened. Also the nil state
+ * means that when the no state change has happened.
+ *
+ * Some might argue that inactive should be sticky forever and
+ * eject/insert shouldn't take it out of that state. They might be
+ * right. On the other hand, some would argue that eject resets all
+ * state. They might be right. They both can't be right. The above
+ * represents a reasonable compromise between the two.
*/
+
enum cardstate { noslot, empty, suspend, filled, inactive };
/*
OpenPOWER on IntegriCloud