<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi<br>
</p>
<div class="moz-cite-prefix">Am 08.10.24 um 17:21 schrieb Benjamin
Tissoires:<br>
</div>
<blockquote type="cite"
cite="mid:rszv4p34oivysoyi337dxwooebipiikzd3pyq7rof5r3agbzce@xejutpd4jcfv">
<pre class="moz-quote-pre" wrap="">On Oct 08 2024, Werner Sembach wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap=""><span
style="white-space: pre-wrap">[...]
</span></pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
Yeah, it just means that you can query or send the data. You can also
use HIDIOCGINPUT() and HIDIOCSOUTPUT() to get a current input report and
set an output report through the hidraw ioctl...
Internally, HIDIOCGINPUT() uses the same code path than
HIDIOCGFEATURE(), but with the report type being an Input instead of a
Feature. Same for HIDIOCSOUTPUT() and HIDIOCSFEATURE().</pre>
</blockquote>
<p>Ok so just a difference in definition not in implementation.</p>
<p>Then I use a get feature report for the device status function
and use it as input and output at the same time, and use a set
output report for the led update function (which technically has a
return value but i think it's always 0 anyway).</p>
<p>I scoured the old thread about exposing WMI calls to userspace,
because I remembered that something here came up already.</p>
<p>1.
<a class="moz-txt-link-freetext" href="https://lore.kernel.org/all/6b32fb73-0544-4a68-95ba-e82406a4b188@gmx.de/">https://lore.kernel.org/all/6b32fb73-0544-4a68-95ba-e82406a4b188@gmx.de/</a>
-> Should be no problem? Because this is not generally exposing
wmi calls, just mapping two explicitly with sanitized input
(whitelisting basically).</p>
<p>2.
<a class="moz-txt-link-freetext" href="https://lore.kernel.org/all/b6d79727-ae94-44b1-aa88-069416435c14@redhat.com/">https://lore.kernel.org/all/b6d79727-ae94-44b1-aa88-069416435c14@redhat.com/</a>
-> Do this concerns this apply here? The actual API to be used
is LampArray and the HID mapped WMI calls are just an "internal"
interface for the BPF driver, but technically UAPI.</p>
<p>Also at Armin and Hans: Do you have comments on this approach?<span
style="white-space: pre-wrap">
</span><span style="white-space: pre-wrap">
</span></p>
<blockquote type="cite"
cite="mid:rszv4p34oivysoyi337dxwooebipiikzd3pyq7rof5r3agbzce@xejutpd4jcfv">
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">(well as far as I can tell the hut doesn't actual specify, if they need to
be feature reports, or am I missing something?)
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
They can be both actually. The HUT is missing what's expected here :(.
However, looking at the HUT RR 84:
<a class="moz-txt-link-freetext" href="https://www.usb.org/sites/default/files/hutrr84_-_lighting_and_illumination_page.pdf">https://www.usb.org/sites/default/files/hutrr84_-_lighting_and_illumination_page.pdf</a>
There is an example of a report descriptor, and they are using Features.
Not Input+Output.
And looking even further (above), in 3.5 Usage Definitions:
3.5.2, 3.5.3 and 3.5.5 all of them are meant to be a feature, like:
LampArrayAttributesReport CL – Feature -
LampAttributesRequestReport CL – Feature –
LampAttributesResponseReport CL – Feature –
LampArrayControlReport CL – Feature –
3.5.4: can be either feature or output, like:
LampMultiUpdateReport CL – Feature/Output –
LampRangeUpdateReport CL – Feature/ Output –
So I guess the MS implementation can handle Feature only for all but the
update commands.</pre>
</blockquote>
Thanks for the link, I guess for the BPF driver I will stick to
feature reports for the LampArray part until there is actually a hid
descriptor spotted in the wild defining LampMultiUpdateReport and
LampRangeUpdateReport as Output and not feature.<br>
<blockquote type="cite"
cite="mid:rszv4p34oivysoyi337dxwooebipiikzd3pyq7rof5r3agbzce@xejutpd4jcfv">
<pre class="moz-quote-pre" wrap="">
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">
and there is the pair with LampAttributesRequestReport and
LampAttributesResponseReport.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
Yeah, not a big deal. The bold IN and OUT are just to say that calling a
setReport on a LampAttributesResponseReport is just ignored AFAIU.
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">
Sorry for my confusion over the hid spec.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
No worries. It is definitely confusing :)</pre>
</blockquote>
<p>On this note as I fathom:</p>
<p>Input Report (usually always get report): Interrupts (the ioctl
just there to repeat the last one?)<br>
</p>
<p>Output Report (usually always set report): Async write, no return
value (Buffer should stay untouched)<br>
</p>
<p>Feature report set: Sync write, no return value (Buffer should
stay untouched)
</p>
<p>Feature report get: Sync read/write (intended only for read, but
not limited to it, uses singular buffer for both input and output)<br>
</p>
<p>I kind of don't get why feature report set exists, but well it's
the specs ^^.</p>
<p>Regards,</p>
<p>Werner<br>
</p>
[*snip*]<br>
</body>
</html>