linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: Alan Ott <alan@signal11.us>
Cc: Jiri Kosina <jkosina@suse.cz>, Stephane Chatty <chatty@enac.fr>,
	Marcel Holtmann <marcel@holtmann.org>,
	simon.windows@gmail.com, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] Bug in hidraw When a HID Device Contains Multiple Reports
Date: Tue, 27 Apr 2010 09:20:39 +0200	[thread overview]
Message-ID: <4BD69047.3010703@gmail.com> (raw)
In-Reply-To: <4BD61506.1030301@signal11.us>

On 04/27/2010 12:34 AM, Alan Ott wrote:
> Make hidraw not stick an extra byte on the beginning of an IN transfer
> when a HID device contains multiple reports.
...
> I have attached a patch which seems to take care of this problem. Please
> let me know if I have completely misjudged the situation.

Nope, your analysis is correct. It was introduced by me in 85cdaf524. I
apparently forgot to change the hidraw case, so your fix is OK.

> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> index 2e2aa75..0e4a6fb 100644
> --- a/drivers/hid/hid-core.c
> +++ b/drivers/hid/hid-core.c
> @@ -1043,13 +1043,8 @@ void hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size,
>  
>  	if ((hid->claimed & HID_CLAIMED_HIDDEV) && hid->hiddev_report_event)
>  		hid->hiddev_report_event(hid, report);
> -	if (hid->claimed & HID_CLAIMED_HIDRAW) {
> -		/* numbered reports need to be passed with the report num */
> -		if (report_enum->numbered)
> -			hidraw_report_event(hid, data - 1, size + 1);
> -		else
> -			hidraw_report_event(hid, data, size);
> -	}
> +	if (hid->claimed & HID_CLAIMED_HIDRAW)
> +		hidraw_report_event(hid, data, size);
>  
>  	for (a = 0; a < report->maxfield; a++)
>  		hid_input_field(hid, report->field[a], cdata, interrupt);

-- 
js

  reply	other threads:[~2010-04-27  7:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-26 22:34 [PATCH 1/1] Bug in hidraw When a HID Device Contains Multiple Reports Alan Ott
2010-04-27  7:20 ` Jiri Slaby [this message]
2010-04-27  8:25   ` Jiri Kosina

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=4BD69047.3010703@gmail.com \
    --to=jirislaby@gmail.com \
    --cc=alan@signal11.us \
    --cc=chatty@enac.fr \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=simon.windows@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).