最終更新:2018-01-12 (金) 08:13:42 (2465d)
usbhid
Top / usbhid
USB HID transport layer
メモ
- Linux 3.4まではHIDの汎用ドライバの処理(generic-usb)を含んでいた
- Linux 3.5からはhid-genericに分割された
.config
メモ
- usbhid is the largest and most complex driver of the whole suite. It handles all HID devices, and because there is a very wide variety of them, and because the USB HID specification isn't simple, it needs to be this big.
- Currently, it handles USB mice, joysticks, gamepads, steering wheels keyboards, trackballs and digitizers.
- However, USB uses HID also for monitor controls, speaker controls, UPSs, LCDs and many other purposes.
- The monitor and speaker controls should be easy to add to the hid/input interface, but for the UPSs and LCDs it doesn't make much sense. For this, the hiddev interface was designed. See kernel.org/doc/Documentation/hid/hiddev.txt for more information about it.
- The usage of the usbhid module is very simple, it takes no parameters, detects everything automatically and when a HID device is inserted, it detects it appropriately.
- However, because the devices vary wildly, you might happen to have a device that doesn't work well. In that case #define DEBUG at the beginning of hid-core.c and send me the syslog traces.
ソースコード
drivers/hid/usbhid/usbhid.h?
drivers/hid/usbhid/hid-core.c
- USB HID support for Linux
init
- module_init(hid_init);
- usbhid_quirks_init?
- usb_register(hid_driver); - usbhid
exit
probe
- usb_endpoint_is_int_in?
- hid_allocate_device?
- usb_set_intfdata?
- hid->ll_driver = usb_hid_driver;
static struct hid_ll_driver usb_hid_driver = { .parse = usbhid_parse, .start = usbhid_start, .stop = usbhid_stop, .open = usbhid_open, .close = usbhid_close, .power = usbhid_power, .request = usbhid_request, .wait = usbhid_wait_io, .idle = usbhid_idle, };
- #ifdef CONFIG_USB_HIDDEV
- hid->hiddev_connect = hiddev_connect;
- hid->hiddev_disconnect = hiddev_disconnect;
- hid->hiddev_hid_event = hiddev_hid_event;
- hid->hiddev_report_event = hiddev_report_event;
- #endif
- usb_make_path?
- hid_add_device
drivers/hid/usbhid/hid-quirks.c
- USB HID quirks support for Linux
drivers/hid/usbhid/hiddev.c?
- HID char devices, giving access to raw HID device events. (CONFIG_USB_HIDDEV)
- hiddev
drivers/hid/usbhid/hid-pidff.c?
- Force feedback driver for USB HID PID compliant devices (CONFIG_HID_PID?)
ブートモードのドライバ
- usbkbd - CONFIG_USB_KBD - USB HIDBP Keyboard (simple Boot) support
- usbmouse - CONFIG_USB_MOUSE? - USB HIDBP Mouse (simple Boot) support