Download raw body.
uhidev fix for set report output command
> Feedback, OKs?
It is probably worth moving lines 434-448, which setup cmd[2], into the
if, since setting dataoff to zero in the else part makes that assignment
pointless.
> Index: sys/dev/i2c/ihidev.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/i2c/ihidev.c,v
> diff -u -p -u -p -r1.35 ihidev.c
> --- sys/dev/i2c/ihidev.c 6 Jan 2025 02:13:55 -0000 1.35
> +++ sys/dev/i2c/ihidev.c 6 Jan 2025 20:40:39 -0000
> @@ -453,6 +453,22 @@ ihidev_hid_command(struct ihidev_softc *
> cmd[dataoff++] = htole16(sc->hid_desc.wDataRegister)
> >> 8;
> } else {
> + /*
> + * When using the wOutputRegister for a set report
> + * output command, the wCommandRegister command needs
> + * to be omitted, and we write the report data straight
> + * in to the wOutputRegister:
> + *
> + * cmd[0] = wOutputRegister (LSB)
> + * cmd[1] = wOutputRegister (MSB)
> + * cmd[2] = Length Field (LSB)
> + * cmd[3] = Length Field (MSB)
> + * cmd[4] = Report ID
> + * cmd[5] = DATA
> + * ...
> + */
> + cmdlen = 5;
> + dataoff = 0;
> cmd[dataoff++] = htole16(sc->hid_desc.wOutputRegister)
> & 0xff;
> cmd[dataoff++] = htole16(sc->hid_desc.wOutputRegister)
>
uhidev fix for set report output command