I'm developing a kernel driver for a USB device on OS X. After adding the setPowerState
handler, I'm noticing that it's called for a wake event immediately after the start
method is called. This happens on OS X 10.6 when I load the driver, and when I plug the USB device in.
The kernel.log shows the iolog entries I'm making on each method call:
...(attach device)
MyDriver: Initializing
MyDriver: Probing
MyDriver: Starting
MyDriver: Waking
...(detach device)
MyDriver: Stopping
MyDriver: Freeing
Can I expect wakeup to occur after start every time?
If so is it reasonable to put most of my initialization code into the setPowerState
handler, knowing it will be called after start?
Is this true for OS X 10.4 and 10.5 as well?