On Feb 16, 2009, at 6:59 PM, searockcliff wrote:
Now I have another question about the IOCommandGate.
Should I put all the IO request to runAction()?
This depends on your device and queueing model. The ::runAction() method is the normal way of ensuring mutual exclusion for your driver.
When should I call commandSleep() and commandWakeup()?
Use commandSleep() like you would use msleep() in a BSD system; it atomically drops the workloop lock and puts the calling thread to sleep.
Use commandWakeup() to wake up threads that you might have put to sleep with commandSleep().
When system goes to sleep, should I call commandSleep()?
When system goes to wakeup, should I call comandWakeup()?
But the system cannot be waken up if I use above methods.
Put the text editor down and back slowly away from the kernel.
It's clear from the above questions that you have not yet understood how device drivers are typically structured, and the way that that structure is expressed in I/O Kit. Please take some time to familiarise yourself with the way that drivers like yours are normally organised, and how they get their work done. Right now, you're just confusing yourself...
= Mike