opnsense-src/sys/dev/usb
Vladimir Kondratyev 7545c8c116 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

(cherry picked from commit fd6690e2d5cd5b15fce2c74ab0cac77a83514f6a)
2025-04-30 10:32:22 +03:00
..
controller usb: Kill left-over cdefs.h includes 2025-03-11 09:41:19 -06:00
gadget sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
input usb: Kill left-over cdefs.h includes 2025-03-11 09:41:19 -06:00
misc usb: Kill left-over cdefs.h includes 2025-03-11 09:41:19 -06:00
net usb: Kill left-over cdefs.h includes 2025-03-11 09:41:19 -06:00
quirk Move support of Realtek 8156/8156B from cdce(4) to ure(4) 2024-10-21 10:58:35 +08:00
serial usb: Kill left-over cdefs.h includes 2025-03-11 09:41:19 -06:00
storage usb: Kill left-over cdefs.h includes 2025-03-11 09:41:19 -06:00
template usb: Kill left-over cdefs.h includes 2025-03-11 09:41:19 -06:00
video sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
wlan usb: Kill left-over cdefs.h includes 2025-03-11 09:41:19 -06:00
ufm_ioctl.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
uftdiio.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
uled_ioctl.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
usb.h usb: increase USB_PORT_RESET_RECOVERY 2025-03-25 19:28:38 -06:00
usb_bus.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_busdma.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_busdma.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_cdc.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_controller.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_core.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_core.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_debug.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_debug.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_dev.c kern: Make fileops and filterops tables const where possible 2024-12-03 01:03:42 +00:00
usb_dev.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_device.c usb: fix loop in usb_config_parse 2024-11-13 09:26:44 -05:00
usb_device.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_dynamic.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_dynamic.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_endian.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_error.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_fdt_support.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
usb_fdt_support.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
usb_freebsd.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_freebsd_loader.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_generic.c ugen: fix USB_IFACE_DRIVER_ACTIVE after detaching a driver 2024-03-16 17:11:37 +02:00
usb_generic.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_handle_request.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_hid.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_hub.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_hub.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_hub_acpi.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_hub_private.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_if.m sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
usb_ioctl.h hidraw(4): Add additional hidraw input/output report ioctls 2025-04-30 10:32:22 +03:00
usb_lookup.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_mbuf.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_mbuf.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_msctest.c usb-msctest: Be more conservative setting GETMAXLUN quirk 2025-03-24 21:01:56 -06:00
usb_msctest.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_parse.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_pci.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_pf.c bpf: Add IfAPI analogue for bpf_peers_present() 2024-09-24 12:30:48 +08:00
usb_pf.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
usb_process.c usb: serial: allow the open/close sleep to be interruptible 2024-12-31 23:45:24 -06:00
usb_process.h usb: serial: allow the open/close sleep to be interruptible 2024-12-31 23:45:24 -06:00
usb_request.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_request.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_transfer.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_transfer.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_util.c usb: use only usb_devinfo() in device_set_usb_desc() 2024-01-30 13:07:29 +02:00
usb_util.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usbdevs ure(4): Add support for ELECOM EDC-QUA3C 2025-02-07 14:46:53 +00:00
usbdi.h usb: serial: allow the open/close sleep to be interruptible 2024-12-31 23:45:24 -06:00
usbdi_util.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
usbhid.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00