为什么设备显示为hidraw而不是hiddev?


8

我阅读了有关hidraw和hiddev的内核文档,并且了解了它们之间的区别,但是我想知道内核如何决定设备是否应显示为/dev/hidraw*/dev/usb/hiddev*

Answers:


1

作为每个驱动程序的参数传递给hid_hw_start()/ hid_connect()。例如:

hid-thingm.c:   err = hid_hw_start(hdev, HID_CONNECT_HIDRAW);

我想大多数司机都会做这样的事情:

hid-logitech-dj.c:  retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT);

HID_CONNECT_DEFAULT包括HID_CONNECT_HIDRAW

#define HID_CONNECT_DEFAULT     (HID_CONNECT_HIDINPUT|HID_CONNECT_HIDRAW| \
                HID_CONNECT_HIDDEV|HID_CONNECT_FF)

hidraw和都会发生完全相同的事情hiddev

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.