[FZH] 关于查看允许设置值

Alvin qzhang.g在gmail.com
星期六 十二月 4 15:04:45 UTC 2010


2010/12/3 will <kovchou at gmail.com>

> 各位大虾么。。
> 问个问题
> 我现在在弄个东西想设置 /sys/bus/usb/devices/1-2/power/level这个的值。
>
> 在弄这个的时候,我想知道。有什么命令可以获得这个level允许设置那些值?用什么命令获得? 或者是看kernel的doc但是我到底怎么查了?
>
localhost:/usr/src/linux-2.6.22.1/drivers/usb/core # ls
/sys/bus/usb/devices/1-1/power/

autosuspend  level  state  wakeup

这里的这个level就是反映的设备的电源级别,确切的说它就是通过sysfs为用户提供了一个自己挂起设备的方法.

localhost:/usr/src/linux-2.6.22.1/drivers/usb/core # cat
/sys/bus/usb/devices/1-1/power/level

auto

它可以为auto/on/suspend,这里我们看到它是auto,auto是最为常见的级别,而on就意味着我们不允许设备进行autosuspend,即
autosuspend被disable了,或者说这里的autosuspend_disabled被 设置为了1.如果是suspend,就意味
着我们不允许设备进行autoresume,并且强迫设备进入suspended状态.即我们设置autoresume_disabled为1,并且调用
usb_external_suspend_device()去挂起设备,这就是sysfs提供给用户的suspend单个设备的方法.
而auto状态意味着autosuspend_disabled和autoresume_disabled都没有设置,即都为0,任其自然.

http://blog.csdn.net/fudan_abc/archive/2007/09/28/1805471.aspx


> 帮帮忙。。很急阿。。。呵呵。。
>
> 谢啦!!
> _______________________________________________
> Chinese mailing list
> Chinese at lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/chinese
>



-- 

~Alvin


关于邮件列表 Chinese 的更多信息