[Bug 286155] hidraw/uhid modes documentation implementation inconsistency

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 17 Apr 2025 11:46:13 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=286155

            Bug ID: 286155
           Summary: hidraw/uhid modes documentation implementation
                    inconsistency
           Product: Base System
           Version: 15.0-CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: usb
          Assignee: usb@FreeBSD.org
          Reporter: ihor.youw@gmail.com

As per hidraw(4) documentation:
https://github.com/freebsd/freebsd-src/blob/a962800a09a45b8f702ebd1a06b8f20bc84e97b1/share/man/man4/hidraw.4#L266

> In the hidraw mode, the first byte should be set to 0 and the report data itself should begin at  the second  byte. In the uhid(4) mode, the report data should begin at the first byte. **The modes can be switched with issuing one of HIDIOCGRDESC or HID_GET_REPORT_DESC ioctl(2) accordingly**.

The fact is that HID_GET_REPORT_DESC switches mode to uhid:
https://github.com/freebsd/freebsd-src/blob/d8cf519492523f6dd239ab153029db62749afa52/sys/dev/hid/hidraw.c#L643
but HIDIOCGRDESC doesn't perfom anything like that:
https://github.com/freebsd/freebsd-src/blob/d8cf519492523f6dd239ab153029db62749afa52/sys/dev/hid/hidraw.c#L820

Either documentation or implementation has to be updated.

-- 
You are receiving this mail because:
You are the assignee for the bug.