标签:min port rom tail epo www 有用 command author
http://www.jianshu.com/p/57293f9be558
今天工作中遇到一个问题, 要用代码实现USB的enable和disable. 谷歌了一番, 最终找到理想答案, 我在这里做一个简短porting. 来源:墙外某博
/: Bus 02.Port 1: Dev 1, class="root_hub", Driver=ehci-pci/3p, 480M
|__ Port 1: Dev 2, If 0, class="hub", Driver=hub/8p, 480M
|__ Port 6: Dev 78, If 0, class="vend"., Driver=, 480M
|__ Port 6: Dev 78, If 1, class="vend"., Driver=usbfs, 480M
|__ Port 6: Dev 78, If 2, class="comm"., Driver=cdc_acm, 480M
|__ Port 6: Dev 78, If 3, class="data", Driver=cdc_acm, 480M
|__ Port 6: Dev 78, If 4, class="comm"., Driver=cdc_acm, 480M
|__ Port 6: Dev 78, If 5, class="data", Driver=cdc_acm, 480M
|__ Port 6: Dev 78, If 6, class="comm"., Driver=cdc_acm, 480M
|__ Port 6: Dev 78, If 7, class="data", Driver=cdc_acm, 480M
/: Bus 01.Port 1: Dev 1, class="root_hub", Driver=ehci-pci/3p, 480M
|__ Port 1: Dev 2, If 0, class="hub", Driver=hub/6p, 480M
|__ Port 1: Dev 6, If 0, class="HID", Driver=usbhid, 1.5M
|__ Port 1: Dev 6, If 1, class="HID", Driver=usbhid, 1.5M
|__ Port 3: Dev 9, If 0, class="HID", Driver=usbhid, 1.5M
(注: 你可以插拔一下要控制的USB, 来确定到底是哪个BUS的哪个port.)echo ‘2-1.6‘ | sudo tee /sys/bus/usb/drivers/usb/unbind
其实用不用tee都行, 直接重定向也可以. 需要注意的是, 所要echo的字符串:"$bus_num"-"$port1_num"."$port2_num"
echo ‘2-1.6‘ | sudo tee /sys/bus/usb/drivers/usb/bind
That‘s it.
标签:min port rom tail epo www 有用 command author
原文地址:http://www.cnblogs.com/LiuYanYGZ/p/7656172.html