快速业务通道

《Linux内核修炼之道》精华分享与讨论(6)——分析内核源码如何入手?(上)

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-04-23
选项. 15 config USB_DEVICEFS
16 bool "USB device filesystem"
17 depends on USB
18 ---help---
19 If you say Y here (and to "/proc file system support" in the "File
20 systems" section, above), you will get a file /proc/bus/usb/devices
21 which lists the devices currently connected to your USB bus or
22 busses, and for every connected device a file named
23 "/proc/bus/usb/xxx/yyy", where xxx is the bus number and yyy the
24 device number; the latter files can be used by user space programs
25 to talk directly to the device. These files are "virtual", meaning
26 they are generated on the fly and not stored on the hard drive.
27
28 You may need to mount the usbfs file system to see the files, use
29 mount -t usbfs none /proc/bus/usb
30
31 For the format of the various /proc/bus/usb/ files, please read
32 <file:Documentation/usb/proc_usb_info.txt>.
33
34 Usbfs files can''t handle Access Control Lists (ACL), which are the
35 default way to grant access to USB devices for untrusted users of a
36 desktop system. The usbfs functionality is replaced by real
37 device-nodes managed by udev. These nodes live in /dev/bus/usb and
38 are used by libusb.
选项USB_DEVICEFS与usbfs文件系统有关.usbfs文件系统挂载在/proc/bus/usb目录,显示了当前连接的所有USB设备及总线的各种信息,每个连接的USB设备在其中都会有一个对应的文件进行描述.比如文件/proc/bus/usb/xxx/yyy,xxx表示总线的序号,yyy表示设备所在总线的地址.不过不能够依赖它们来稳定地访问设备,同一设备两次连接对应的描述文件可能会不同,比如,第一次连接一个设备时,它可能是002/027,一段时间后再次连接,它可能就已经改变为002/048. 就好比好不容易你暗恋的mm今天见你的时候对你抛了个媚眼,你心花怒放,赶快去买了100块彩票庆祝,到第二天再见到她的时候,她对你说你是谁啊,你悲痛欲绝的刮开那100块彩票,上面清一色的谢谢你. usbfs文件系统并不属于USB子系统实现的核心部分,与之相关的代码我们可以不必关注. 74 config USB_SUSPEND
75 bool "USB selective suspend/resume and wakeup (EXPERIMENTAL)"
76 depends on USB && PM && EXPERIMENTAL
77 help
78 If you say Y here, you can use driver calls or the sysfs
79 "power/state" file to suspend or resume individual USB
80 peripherals.
81
82 Also, USB "remote wakeup" signaling is supported, whereby some
83 USB devices (like keyboards and network adapters) can wake up
84 their parent hub. That wakeup cascades up the USB tree, and
85 could wake the system from states like suspend-to-RAM.
86
87 If you are unsure about this, say N here.
这一项是有关USB设备的挂起和恢复.开发USB的人都是节电节能的好孩子,协议里就规定了,所有的设备都支持挂起状态,就是说为了达到节电的目的,当设备在指定的时间内,如果没有发生总线传输,就要进入挂起

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号