From patchwork Wed Jun 5 12:44:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 10976911 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9D9901398 for ; Wed, 5 Jun 2019 12:44:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 90E21205F6 for ; Wed, 5 Jun 2019 12:44:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 84ED42894E; Wed, 5 Jun 2019 12:44:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 348B32893E for ; Wed, 5 Jun 2019 12:44:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727850AbfFEMoe (ORCPT ); Wed, 5 Jun 2019 08:44:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46566 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727732AbfFEMoe (ORCPT ); Wed, 5 Jun 2019 08:44:34 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8996F308338F; Wed, 5 Jun 2019 12:44:30 +0000 (UTC) Received: from plouf.redhat.com (ovpn-116-164.ams2.redhat.com [10.36.116.164]) by smtp.corp.redhat.com (Postfix) with ESMTP id 288D960CD6; Wed, 5 Jun 2019 12:44:27 +0000 (UTC) From: Benjamin Tissoires To: Jiri Kosina , Hans de Goede , Dave Hansen , Kai-Heng Feng Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Tissoires , stable@vger.kernel.org Subject: [PATCH 1/4] Revert "HID: Increase maximum report size allowed by hid_field_extract()" Date: Wed, 5 Jun 2019 14:44:05 +0200 Message-Id: <20190605124408.8637-2-benjamin.tissoires@redhat.com> In-Reply-To: <20190605124408.8637-1-benjamin.tissoires@redhat.com> References: <20190605124408.8637-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 05 Jun 2019 12:44:34 +0000 (UTC) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This reverts commit 94a9992f7dbdfb28976b565af220e0c4a117144a. The commit allows for more than 32 bits in hid_field_extract(), but the return value is a 32 bits int. So basically what this commit is doing is just silencing those legitimate errors. Revert to a previous situation in the hope that a proper fix will be impletemented. Fixes: 94a9992f7dbd ("HID: Increase maximum report size allowed by hid_field_extract()") Cc: stable@vger.kernel.org # v5.1 Signed-off-by: Benjamin Tissoires --- drivers/hid/hid-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 08d310723e96..205d6b82a706 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1311,10 +1311,10 @@ static u32 __extract(u8 *report, unsigned offset, int n) u32 hid_field_extract(const struct hid_device *hid, u8 *report, unsigned offset, unsigned n) { - if (n > 256) { - hid_warn(hid, "hid_field_extract() called with n (%d) > 256! (%s)\n", + if (n > 32) { + hid_warn(hid, "hid_field_extract() called with n (%d) > 32! (%s)\n", n, current->comm); - n = 256; + n = 32; } return __extract(report, offset, n); From patchwork Wed Jun 5 12:44:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 10976921 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BC44A13AD for ; Wed, 5 Jun 2019 12:44:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AED5F28944 for ; Wed, 5 Jun 2019 12:44:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A378C2894E; Wed, 5 Jun 2019 12:44:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F67428936 for ; Wed, 5 Jun 2019 12:44:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727890AbfFEMon (ORCPT ); Wed, 5 Jun 2019 08:44:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46574 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727848AbfFEMoe (ORCPT ); Wed, 5 Jun 2019 08:44:34 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A515330860A3; Wed, 5 Jun 2019 12:44:34 +0000 (UTC) Received: from plouf.redhat.com (ovpn-116-164.ams2.redhat.com [10.36.116.164]) by smtp.corp.redhat.com (Postfix) with ESMTP id F1C3061984; Wed, 5 Jun 2019 12:44:31 +0000 (UTC) From: Benjamin Tissoires To: Jiri Kosina , Hans de Goede , Dave Hansen , Kai-Heng Feng Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Tissoires Subject: [PATCH 2/4] Revert "HID: core: Do not call request_module() in async context" Date: Wed, 5 Jun 2019 14:44:06 +0200 Message-Id: <20190605124408.8637-3-benjamin.tissoires@redhat.com> In-Reply-To: <20190605124408.8637-1-benjamin.tissoires@redhat.com> References: <20190605124408.8637-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 05 Jun 2019 12:44:34 +0000 (UTC) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This reverts commit 4ceabaf7909d109db6afbffc4ed182741fc32043. This patch and a025a18fe are giving extended timeouts on boot for at least Ubuntu and OpenSuse. Revert them until we get a better fix. Signed-off-by: Benjamin Tissoires --- drivers/hid/hid-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 205d6b82a706..fd9e7a4c107d 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include @@ -2367,9 +2366,8 @@ int hid_add_device(struct hid_device *hdev) * not first have hid-generic binding only to have it replaced * immediately afterwards with a specialized driver. */ - if (!current_is_async()) - request_module("hid:b%04Xg%04Xv%08Xp%08X", hdev->bus, - hdev->group, hdev->vendor, hdev->product); + request_module("hid:b%04Xg%04Xv%08Xp%08X", + hdev->bus, hdev->group, hdev->vendor, hdev->product); hid_debug_register(hdev, dev_name(&hdev->dev)); ret = device_add(&hdev->dev); From patchwork Wed Jun 5 12:44:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 10976913 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1F52F1398 for ; Wed, 5 Jun 2019 12:44:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0F6CF28936 for ; Wed, 5 Jun 2019 12:44:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 02D9A28944; Wed, 5 Jun 2019 12:44:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97BE82893E for ; Wed, 5 Jun 2019 12:44:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727872AbfFEMoi (ORCPT ); Wed, 5 Jun 2019 08:44:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60860 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727870AbfFEMoh (ORCPT ); Wed, 5 Jun 2019 08:44:37 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9814683F51; Wed, 5 Jun 2019 12:44:37 +0000 (UTC) Received: from plouf.redhat.com (ovpn-116-164.ams2.redhat.com [10.36.116.164]) by smtp.corp.redhat.com (Postfix) with ESMTP id E91F360CD6; Wed, 5 Jun 2019 12:44:35 +0000 (UTC) From: Benjamin Tissoires To: Jiri Kosina , Hans de Goede , Dave Hansen , Kai-Heng Feng Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Tissoires Subject: [PATCH 3/4] Revert "HID: core: Call request_module before doing device_add" Date: Wed, 5 Jun 2019 14:44:07 +0200 Message-Id: <20190605124408.8637-4-benjamin.tissoires@redhat.com> In-Reply-To: <20190605124408.8637-1-benjamin.tissoires@redhat.com> References: <20190605124408.8637-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 05 Jun 2019 12:44:37 +0000 (UTC) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This reverts commit a025a18fecd4429f4ca66b1746001263c052ecbb. This patch and 4ceabaf79 are giving extended timeouts on boot for at least Ubuntu and OpenSuse. Revert them until we get a better fix. Link: https://bugzilla.kernel.org/show_bug.cgi?id=203741 Signed-off-by: Benjamin Tissoires --- drivers/hid/hid-core.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index fd9e7a4c107d..210b81a56e1a 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -2361,14 +2361,6 @@ int hid_add_device(struct hid_device *hdev) dev_set_name(&hdev->dev, "%04X:%04X:%04X.%04X", hdev->bus, hdev->vendor, hdev->product, atomic_inc_return(&id)); - /* - * Try loading the module for the device before the add, so that we do - * not first have hid-generic binding only to have it replaced - * immediately afterwards with a specialized driver. - */ - request_module("hid:b%04Xg%04Xv%08Xp%08X", - hdev->bus, hdev->group, hdev->vendor, hdev->product); - hid_debug_register(hdev, dev_name(&hdev->dev)); ret = device_add(&hdev->dev); if (!ret) From patchwork Wed Jun 5 12:44:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 10976915 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 51C7613AD for ; Wed, 5 Jun 2019 12:44:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3EA2A28396 for ; Wed, 5 Jun 2019 12:44:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 32A122896F; Wed, 5 Jun 2019 12:44:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A7012808F for ; Wed, 5 Jun 2019 12:44:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727931AbfFEMor (ORCPT ); Wed, 5 Jun 2019 08:44:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52398 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727923AbfFEMoq (ORCPT ); Wed, 5 Jun 2019 08:44:46 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EA65B307C94B; Wed, 5 Jun 2019 12:44:45 +0000 (UTC) Received: from plouf.redhat.com (ovpn-116-164.ams2.redhat.com [10.36.116.164]) by smtp.corp.redhat.com (Postfix) with ESMTP id A272A60CD6; Wed, 5 Jun 2019 12:44:38 +0000 (UTC) From: Benjamin Tissoires To: Jiri Kosina , Hans de Goede , Dave Hansen , Kai-Heng Feng Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Tissoires Subject: [PATCH 4/4] HID: logitech-dj: Fix 064d:c52f receiver support Date: Wed, 5 Jun 2019 14:44:08 +0200 Message-Id: <20190605124408.8637-5-benjamin.tissoires@redhat.com> In-Reply-To: <20190605124408.8637-1-benjamin.tissoires@redhat.com> References: <20190605124408.8637-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 05 Jun 2019 12:44:46 +0000 (UTC) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hans de Goede The c52f nano receiver is a mouse only receiver. This means that it needs some special handling compared to the c534 nano receiver: 1) It sends unnumbered mouse reports with a size of 8 bytes, so we need to extend the unnumbered mouse report handling to support reports upto 8 bytes large 2) It mouse reports have the same high-resolution format as those from the gaming mouse receivers 3) It can report consumer/multimedia buttons on its second interface, since this is a mouse-only receiver these must be forwarded to the mouse child device and not to the keyboard child-device (which will not exist) Link: https://bugzilla.kernel.org/show_bug.cgi?id=203619 Signed-off-by: Hans de Goede Signed-off-by: Benjamin Tissoires --- drivers/hid/hid-logitech-dj.c | 42 ++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c index 41baa4dbbfcc..c48e7030d3c9 100644 --- a/drivers/hid/hid-logitech-dj.c +++ b/drivers/hid/hid-logitech-dj.c @@ -128,6 +128,7 @@ enum recvr_type { recvr_type_dj, recvr_type_hidpp, recvr_type_gaming_hidpp, + recvr_type_mouse_only, recvr_type_27mhz, recvr_type_bluetooth, }; @@ -879,9 +880,12 @@ static void logi_dj_recv_queue_notification(struct dj_receiver_dev *djrcv_dev, schedule_work(&djrcv_dev->work); } -static void logi_hidpp_dev_conn_notif_equad(struct hidpp_event *hidpp_report, +static void logi_hidpp_dev_conn_notif_equad(struct hid_device *hdev, + struct hidpp_event *hidpp_report, struct dj_workitem *workitem) { + struct dj_receiver_dev *djrcv_dev = hid_get_drvdata(hdev); + workitem->type = WORKITEM_TYPE_PAIRED; workitem->device_type = hidpp_report->params[HIDPP_PARAM_DEVICE_INFO] & HIDPP_DEVICE_TYPE_MASK; @@ -895,6 +899,8 @@ static void logi_hidpp_dev_conn_notif_equad(struct hidpp_event *hidpp_report, break; case REPORT_TYPE_MOUSE: workitem->reports_supported |= STD_MOUSE | HIDPP; + if (djrcv_dev->type == recvr_type_mouse_only) + workitem->reports_supported |= MULTIMEDIA; break; } } @@ -938,7 +944,7 @@ static void logi_hidpp_recv_queue_notif(struct hid_device *hdev, case 0x01: device_type = "Bluetooth"; /* Bluetooth connect packet contents is the same as (e)QUAD */ - logi_hidpp_dev_conn_notif_equad(hidpp_report, &workitem); + logi_hidpp_dev_conn_notif_equad(hdev, hidpp_report, &workitem); if (!(hidpp_report->params[HIDPP_PARAM_DEVICE_INFO] & HIDPP_MANUFACTURER_MASK)) { hid_info(hdev, "Non Logitech device connected on slot %d\n", @@ -952,18 +958,18 @@ static void logi_hidpp_recv_queue_notif(struct hid_device *hdev, break; case 0x03: device_type = "QUAD or eQUAD"; - logi_hidpp_dev_conn_notif_equad(hidpp_report, &workitem); + logi_hidpp_dev_conn_notif_equad(hdev, hidpp_report, &workitem); break; case 0x04: device_type = "eQUAD step 4 DJ"; - logi_hidpp_dev_conn_notif_equad(hidpp_report, &workitem); + logi_hidpp_dev_conn_notif_equad(hdev, hidpp_report, &workitem); break; case 0x05: device_type = "DFU Lite"; break; case 0x06: device_type = "eQUAD step 4 Lite"; - logi_hidpp_dev_conn_notif_equad(hidpp_report, &workitem); + logi_hidpp_dev_conn_notif_equad(hdev, hidpp_report, &workitem); break; case 0x07: device_type = "eQUAD step 4 Gaming"; @@ -973,11 +979,11 @@ static void logi_hidpp_recv_queue_notif(struct hid_device *hdev, break; case 0x0a: device_type = "eQUAD nano Lite"; - logi_hidpp_dev_conn_notif_equad(hidpp_report, &workitem); + logi_hidpp_dev_conn_notif_equad(hdev, hidpp_report, &workitem); break; case 0x0c: device_type = "eQUAD Lightspeed"; - logi_hidpp_dev_conn_notif_equad(hidpp_report, &workitem); + logi_hidpp_dev_conn_notif_equad(hdev, hidpp_report, &workitem); workitem.reports_supported |= STD_KEYBOARD; break; } @@ -1330,7 +1336,8 @@ static int logi_dj_ll_parse(struct hid_device *hid) if (djdev->reports_supported & STD_MOUSE) { dbg_hid("%s: sending a mouse descriptor, reports_supported: %llx\n", __func__, djdev->reports_supported); - if (djdev->dj_receiver_dev->type == recvr_type_gaming_hidpp) + if (djdev->dj_receiver_dev->type == recvr_type_gaming_hidpp || + djdev->dj_receiver_dev->type == recvr_type_mouse_only) rdcat(rdesc, &rsize, mse_high_res_descriptor, sizeof(mse_high_res_descriptor)); else if (djdev->dj_receiver_dev->type == recvr_type_27mhz) @@ -1573,15 +1580,19 @@ static int logi_dj_raw_event(struct hid_device *hdev, data[0] = data[1]; data[1] = 0; } - /* The 27 MHz mouse-only receiver sends unnumbered mouse data */ + /* + * Mouse-only receivers send unnumbered mouse data. The 27 MHz + * receiver uses 6 byte packets, the nano receiver 8 bytes. + */ if (djrcv_dev->unnumbered_application == HID_GD_MOUSE && - size == 6) { - u8 mouse_report[7]; + size <= 8) { + u8 mouse_report[9]; /* Prepend report id */ mouse_report[0] = REPORT_TYPE_MOUSE; - memcpy(mouse_report + 1, data, 6); - logi_dj_recv_forward_input_report(hdev, mouse_report, 7); + memcpy(mouse_report + 1, data, size); + logi_dj_recv_forward_input_report(hdev, mouse_report, + size + 1); } return false; @@ -1652,6 +1663,7 @@ static int logi_dj_probe(struct hid_device *hdev, case recvr_type_dj: no_dj_interfaces = 3; break; case recvr_type_hidpp: no_dj_interfaces = 2; break; case recvr_type_gaming_hidpp: no_dj_interfaces = 3; break; + case recvr_type_mouse_only: no_dj_interfaces = 2; break; case recvr_type_27mhz: no_dj_interfaces = 2; break; case recvr_type_bluetooth: no_dj_interfaces = 2; break; } @@ -1825,10 +1837,10 @@ static const struct hid_device_id logi_dj_receivers[] = { {HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_UNIFYING_RECEIVER_2), .driver_data = recvr_type_dj}, - { /* Logitech Nano (non DJ) receiver */ + { /* Logitech Nano mouse only receiver */ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_NANO_RECEIVER), - .driver_data = recvr_type_hidpp}, + .driver_data = recvr_type_mouse_only}, { /* Logitech Nano (non DJ) receiver */ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_2),