From: Alan Ott <alan@signal11.us>
To: Antonio Ospite <ospite@studenti.unina.it>
Cc: Jiri Kosina <jkosina@suse.cz>, linux-input@vger.kernel.org
Subject: Re: [PATCH v4 1/2] HID: Add Support for Setting and Getting Feature Reports from hidraw
Date: Wed, 29 Sep 2010 23:37:41 -0400 [thread overview]
Message-ID: <4CA40605.6080800@signal11.us> (raw)
In-Reply-To: <20100930015104.49fc5acf.ospite@studenti.unina.it>
On 09/29/2010 07:51 PM, Antonio Ospite wrote:
> On Mon, 16 Aug 2010 16:20:58 -0400
> Alan Ott<alan@signal11.us> wrote:
>
>
>> Per the HID Specification, Feature reports must be sent and received on
>> the Configuration endpoint (EP 0) through the Set_Report/Get_Report
>> interfaces. This patch adds two ioctls to hidraw to set and get feature
>> reports to and from the device. Modifications were made to hidraw and
>> usbhid.
>>
>> New hidraw ioctls:
>> HIDIOCSFEATURE - Perform a Set_Report transfer of a Feature report.
>> HIDIOCGFEATURE - Perform a Get_Report transfer of a Feature report.
>>
>> Signed-off-by: Alan Ott<alan@signal11.us>
>> ---
>>
> Some more testing with sixaxis and a question:
>
> HIDIOCGFEATURE on report 0xf5 returns:
> <-- 01 00 00 03 c9 87 34 fd
> ^^ a hw addr from here
>
Maybe I'm confused. Shouldn't the first byte of that be 0xf5? The report
number should be the first byte of the returned buffer.
There's not a chance you're running an old version of this patch is there?
> with the latest six octets being a hw addr; now if I wanted to change
> this, *naively*, I'd send this report with HIDIOCSFEATURE:
> --> f5 01 00 66 55 44 33 22 11
> ^^ report ID _added_ in front of the whole previous buffer
>
> but then when I get the report again to see if the operation succeeded I
> get:
> <-- 01 00 00 66 55 44 33 22
>
> I can make it work if I send:
> --> f5 00 66 55 44 33 22 11
> ^^ report ID _replaced_ buf[0]
>
> then I get the expected:
> <-- 01 00 66 55 44 33 22 11
>
> Am I missing something about the differences about getting a feature
> report and setting it?
>
>
Do you have patches 29129a98e6f and c29771c2d8ce applied? They are in
2.6.36-rc6 (and some previous, but I'm note certain how far back). Those
patches have to do with _sending_ the right bytes (in particular the
report number) on the control endpoint. You seem to be having the
opposite problem though. Let me know to be sure.
> In the HIDIOCGFEATURE doc I read:
> ...
> The report will be returned starting at
> the first byte of the buffer (ie: the report number is not
> returned).
>
> Someone (/me whistling, with hands in pockets) could interpret this
> like a buf++ semantic on a quick read, even if this sentence means
> "only" that _actual_data_ is from buf[1]; but one question stands: what
> is that value returned in buf[0]? Is this unspecified?
>
>
So that was written when I had an incorrect understanding of the
standard. It is wrong. I had originally thought that Report ID's were
not sent on the control endpoint as part of the payload (because it's
redundant, since it's in wValue). I was wrong, and made those two
patches above to correct it.
> Maybe the doc could be made even more explicit about buf[0] to overcame
> non native speakers deficiencies.
> And while at it, can we get rid of the ambiguity of "first byte" for
> "byte 1", the former can even mean buf[0], can't it?
>
Your English is fine, my understanding was wrong :) .
Alan.
next prev parent reply other threads:[~2010-09-30 3:37 UTC|newest]
Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-13 22:20 [PATCH 1/1] Bluetooth: hidp: Add support for hidraw HIDIOCGFEATURE and HIDIOCSFEATURE Alan Ott
2010-06-19 17:49 ` Jiri Kosina
2010-06-28 11:14 ` Antonio Ospite
2010-06-29 7:12 ` David Miller
2010-06-29 7:12 ` David Miller
2010-06-29 8:50 ` Jiri Kosina
2010-06-29 9:07 ` Johan Hedberg
2010-06-29 9:07 ` Johan Hedberg
2010-06-29 12:40 ` Andrei Emeltchenko
2010-06-29 12:40 ` Andrei Emeltchenko
2010-06-29 12:40 ` Andrei Emeltchenko
2010-07-08 21:08 ` Marcel Holtmann
2010-07-08 21:08 ` Marcel Holtmann
2010-07-08 21:11 ` Marcel Holtmann
2010-07-09 3:51 ` Alan Ott
2010-07-09 3:51 ` Alan Ott
2010-07-09 8:01 ` Marcel Holtmann
2010-07-09 8:01 ` Marcel Holtmann
2010-07-09 13:02 ` Alan Ott
2010-07-09 13:02 ` Alan Ott
2010-07-09 13:06 ` Marcel Holtmann
2010-07-09 13:06 ` Marcel Holtmann
2010-07-09 14:06 ` Alan Ott
2010-07-09 14:06 ` Alan Ott
2010-07-09 17:33 ` Marcel Holtmann
2010-07-09 17:33 ` Marcel Holtmann
2010-07-09 18:24 ` Alan Ott
2010-07-09 18:24 ` Alan Ott
2010-07-22 14:14 ` Jiri Kosina
2010-07-22 15:21 ` Marcel Holtmann
2010-07-22 16:58 ` Alan Ott
2010-08-10 11:46 ` Jiri Kosina
2010-08-10 11:46 ` Jiri Kosina
2010-08-10 12:12 ` Marcel Holtmann
2010-08-10 12:12 ` Marcel Holtmann
2010-08-16 20:20 ` [PATCH v4 0/2] Get and Set Feature Reports on HIDRAW (USB and Bluetooth) Alan Ott
2010-08-23 13:00 ` Jiri Kosina
2010-09-02 15:25 ` Jiri Kosina
2010-09-22 12:09 ` Jiri Kosina
2010-11-01 19:23 ` Jiri Kosina
2010-11-08 11:17 ` Antonio Ospite
2010-11-08 11:17 ` Antonio Ospite
2010-09-23 16:25 ` Ville Tervo
2010-09-23 16:25 ` Ville Tervo
2010-09-23 17:07 ` Ping Cheng
2010-09-23 17:07 ` Ping Cheng
2010-09-23 20:16 ` Przemo Firszt
2010-09-23 20:16 ` Przemo Firszt
2010-09-23 23:40 ` Alan Ott
2010-09-23 23:40 ` Alan Ott
2010-08-16 20:20 ` Alan Ott
2010-08-16 20:20 ` Alan Ott
2010-08-16 20:20 ` [PATCH v4 1/2] HID: Add Support for Setting and Getting Feature Reports from hidraw Alan Ott
2010-08-16 20:20 ` Alan Ott
2010-09-28 13:30 ` Antonio Ospite
2010-10-01 13:30 ` Jiri Kosina
2010-10-01 13:30 ` Jiri Kosina
2010-09-29 23:51 ` Antonio Ospite
2010-09-30 3:37 ` Alan Ott [this message]
2010-09-30 22:03 ` Antonio Ospite
2010-10-02 0:00 ` Antonio Ospite
2010-10-02 2:24 ` Alan Ott
2010-10-02 0:30 ` Alan Ott
2010-10-02 7:50 ` Antonio Ospite
2010-10-04 13:37 ` Alan Ott
2010-08-16 20:20 ` Alan Ott
2010-08-16 20:20 ` [PATCH v4 2/2] Bluetooth: hidp: Add support for hidraw HIDIOCGFEATURE and HIDIOCSFEATURE Alan Ott
2010-08-16 20:20 ` Alan Ott
2010-08-16 20:20 ` Alan Ott
2010-09-23 11:51 ` Ville Tervo
2010-09-23 11:51 ` Ville Tervo
2010-09-23 14:16 ` Alan Ott
2010-09-24 10:47 ` Antonio Ospite
2010-09-24 10:47 ` Antonio Ospite
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CA40605.6080800@signal11.us \
--to=alan@signal11.us \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
--cc=ospite@studenti.unina.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.