最終更新:2018-01-12 (金) 08:13:42 (2296d)  

usbhid
Top / usbhid

USB HID transport layer

メモ

.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

exit

  • module_exit?(hid_exit?);
    • usb_deregister?

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?

drivers/hid/usbhid/hid-pidff.c?

  • Force feedback driver for USB HID PID compliant devices (CONFIG_HID_PID?)

ブートモードのドライバ

関連