From patchwork Thu Sep 30 22:03:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Ospite X-Patchwork-Id: 221372 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8UM3LZX022126 for ; Thu, 30 Sep 2010 22:03:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755287Ab0I3WDV (ORCPT ); Thu, 30 Sep 2010 18:03:21 -0400 Received: from smtp207.alice.it ([82.57.200.103]:57696 "EHLO smtp207.alice.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752122Ab0I3WDU (ORCPT ); Thu, 30 Sep 2010 18:03:20 -0400 Received: from jcn (82.55.137.163) by smtp207.alice.it (8.5.124.08) (authenticated as fospite@alice.it) id 4C9E16C90064A288; Fri, 1 Oct 2010 00:03:15 +0200 Date: Fri, 1 Oct 2010 00:03:09 +0200 From: Antonio Ospite To: Alan Ott Cc: Jiri Kosina , linux-input@vger.kernel.org Subject: Re: [PATCH v4 1/2] HID: Add Support for Setting and Getting Feature Reports from hidraw Message-Id: <20101001000309.9bb53de4.ospite@studenti.unina.it> In-Reply-To: <4CA40605.6080800@signal11.us> References: <1281442367.12579.206.camel@localhost.localdomain> <1281990059-3562-2-git-send-email-alan@signal11.us> <20100930015104.49fc5acf.ospite@studenti.unina.it> <4CA40605.6080800@signal11.us> X-Mailer: Sylpheed 3.0.2 (GTK+ 2.20.1; x86_64-pc-linux-gnu) X-Face: z*RaLf`X<@C75u6Ig9}{oW$H; 1_\2t5)({*|jhM/Vb; ]yA5\I~93>J<_`<4)A{':UrE Mime-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 30 Sep 2010 22:03:22 +0000 (UTC) diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index df80532..83e1b48 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -875,6 +875,9 @@ static int usbhid_output_raw_report(struct hid_device *hid, __u8 *buf, size_t co ((report_type + 1) << 8) | report_id, interface->desc.bInterfaceNumber, buf, count, USB_CTRL_SET_TIMEOUT); + /* restore report ID into the buffer, some non conformant usb + * device could have mangled it */ + buf[0] = report_id; /* count also the report id, if this was a numbered report. */ if (ret > 0 && skipped_report_id) ret++;