HomeFreeBSD

hidraw(4): Add additional hidraw input/output report ioctls

Description

hidraw(4): Add additional hidraw input/output report ioctls

to Linux hidraw compatibility API.

Respective Linux commit f43d3870cafa made by Dean Camera message is:

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).

FreeBSD native uhid(4) compatible API already has similar ioctls.

MFC after: 3 days

Details

Provenance
wulfAuthored on Apr 27 2025, 9:07 AM
Parents
rG59597032c948: mail: Don't trap signals we shouldn't.
Branches
Unknown
Tags
Unknown