解除绑定后,某些USB设备会自动重新连接,如何长时间禁用它?

时间:2019-03-28 07:30:49

标签: linux kernel usb udev sysfs

我正在尝试在Linux系统上禁用我的两个USB键盘,一个键盘可以取消绑定很长时间,直到我拔下电源然后插入插件,并且在此期间数字锁定指示灯熄灭。但是另一个不能长时间解除绑定,也许5秒钟后,它将重新连接,并且在此期间数字锁定指示灯亮起,另一个指示灯将闪烁一次,日志如下所示:

[505545.210490] usb 3-3.1: USB disconnect, device number 47
[505547.687005] usb 3-3.1: new low-speed USB device number 49 using xhci_hcd
[505547.984255] usb 3-3.1: New USB device found, idVendor=17ef, idProduct=6099
[505547.984258] usb 3-3.1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[505547.984260] usb 3-3.1: Product: Lenovo Traditional USB Keyboard
[505548.019948] input: Lenovo Traditional USB Keyboard as /devices/pci0000:00/0000:00:15.0/0000:03:00.0/usb3/3-3/3-3.1/3-3.1:1.0/input/input40
[505548.071999] hid-generic 0003:17EF:6099.002A: input,hidraw1: USB HID v1.10 Keyboard [Lenovo Traditional USB Keyboard] on usb-0000:03:00.0-3.1/input0

以下是我用于禁用键盘的shell命令:

echo "3-3.1"  > /sys/bus/usb/drivers/usb/unbind

echo "0003:17EF:6099.002A" > /sys/bus/hid/drivers/hid-generic/unbind

造成这种差异的原因是什么?有办法禁用第二个键盘吗?

非常感谢

0 个答案:

没有答案