Skip to content
Snippets Groups Projects
  1. Aug 19, 2024
  2. Jun 27, 2024
  3. Jun 14, 2024
  4. May 06, 2024
  5. Apr 10, 2024
  6. Aug 07, 2023
  7. Feb 06, 2023
  8. Jan 31, 2023
  9. Jan 18, 2023
    • Benjamin Tissoires's avatar
      HID: bpf: rework how programs are attached and stored in the kernel · 4b9a3f49
      Benjamin Tissoires authored
      
      Previously, HID-BPF was relying on a bpf tracing program to be notified
      when a program was released from userspace. This is error prone, as
      LLVM sometimes inline the function and sometimes not.
      
      So instead of messing up with the bpf prog ref count, we can use the
      bpf_link concept which actually matches exactly what we want:
      - a bpf_link represents the fact that a given program is attached to a
        given HID device
      - as long as the bpf_link has fd opened (either by the userspace program
        still being around or by pinning the bpf object in the bpffs), the
        program stays attached to the HID device
      - once every user has closed the fd, we get called by
        hid_bpf_link_release() that we no longer have any users, and we can
        disconnect the program to the device in 2 passes: first atomically clear
        the bit saying that the link is active, and then calling release_work in
        a scheduled work item.
      
      This solves entirely the problems of BPF tracing not showing up and is
      definitely cleaner.
      
      Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      4b9a3f49
  10. Nov 15, 2022
  11. Mar 31, 2021
  12. Jan 04, 2021
  13. Nov 27, 2020
    • Dean Camera's avatar
      HID: hidraw: Add additional hidraw input/output report ioctls. · f43d3870
      Dean Camera authored
      
      Currently the hidraw module can only read and write feature HID reports on
      demand, via dedicated ioctls. Input reports are read from the device through
      the read() interface, while output reports are written through the write
      interface().
      
      This is insufficient; it is desirable in many situations to be able to read and
      write input and output reports through the control interface to cover
      additional scenarios:
      
        - Reading an input report by its report ID, to get initial state
        - Writing an input report, to set initial input state in the device
        - Reading an output report by its report ID, to obtain current state
        - Writing an output report by its report ID, out of band
      
      This patch adds these missing ioctl requests to read and write the remaining
      HID report types. Note that not all HID backends will neccesarily support this
      (e.g. while the USB link layer supports setting Input reports, others may not).
      
      Also included are documentation and example updates. The current hidraw
      documentation states that feature reports read from the device does *not*
      include the report ID, however this is not the case and the returned report
      will have its report ID prepended by conforming HID devices, as the report data
      sent from the device over the control endpoint must be indentical in format to
      those sent over the regular transport.
      
      Signed-off-by: default avatarDean Camera <dean@fourwalledcubicle.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      f43d3870
  14. Nov 03, 2020
  15. Oct 22, 2020
  16. Jul 13, 2020
  17. Jul 15, 2019
  18. Jul 02, 2019
  19. Jun 20, 2019
  20. Dec 18, 2018
  21. Oct 12, 2017
  22. Mar 13, 2017
  23. Aug 17, 2016
  24. Jun 17, 2016
  25. Apr 10, 2015
  26. Aug 25, 2014
  27. May 05, 2014
  28. Apr 01, 2014
    • Petri Gynther's avatar
      HID: uhid: Add UHID_CREATE2 + UHID_INPUT2 · 4522643a
      Petri Gynther authored
      
      UHID_CREATE2:
      HID report descriptor data (rd_data) is an array in struct uhid_create2_req,
      instead of a pointer. Enables use from languages that don't support pointers,
      e.g. Python.
      
      UHID_INPUT2:
      Data array is the last field of struct uhid_input2_req. Enables userspace to
      write only the required bytes to kernel (ev.type + ev.u.input2.size + the part
      of the data array that matters), instead of the entire struct uhid_input2_req.
      
      Note:
      UHID_CREATE2 increases the total size of struct uhid_event slightly, thus
      increasing the size of messages that are queued for userspace. However, this
      won't affect the userspace processing of these events.
      
      [Jiri Kosina <jkosina@suse.cz>: adjust to hid_get_raw_report() and
      				hid_output_raw_report() API changes]
      
      Signed-off-by: default avatarPetri Gynther <pgynther@google.com>
      Reviewed-by: default avatarDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      4522643a
  29. Feb 24, 2014
Loading