To support selective suspend feature, the driver needs to submit an idle
request Irp with IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION
device I/O control code. This idle request Irp will not be returned until
it's cancelled or some other conditions. Currently, I never see the status
is
success when the complete routine is called. What kind of condition will
cause the status is success?
The complete routine will power on the device if the status is not success.
If I try to suspend the system when the device has been in suspended mode ,
the idle request Irp is also cancelled. The complete routine try to power on
the
device since the status is not success. However, the system is currently
trying
to suspend. They will conflict!!
If the complete routine power on the device before system suspend, it will
be OK since the device will be power down again. However, if the complete
power on the device after the system suspend, the system suspend will fail.
I think the complete routine should not power on the device in this case.
However, how do I know the idle request Irp is cancelled is due to system
suspend?
What should be the correct sequence for this condition??
Best Regards
Jackal Huang