Autoresume与 autosuspend
如果配置了电源管理,那么usb就有了上面的2种状态
在device 中有如下结构体
struct dev_pm_info {
pm_message_t power_state;
unsigned can_wakeup:1;
#ifdef CONFIG_PM
unsigned should_wakeup:1;
pm_message_t prev_state;
void * saved_state;
struct device * pm_parent;
struct list_head entry;
#endif
};
can_wakeup 表示能不能唤醒
can_wakeup 表示应不应该被唤醒
如果2者都为1,就将usb_device中相应的成员do_remote_wakeup 设置成1
那么就创建了一个单进程的工作队列ksuspend_usb_wq