Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp4238672rwe; Tue, 30 Aug 2022 07:00:12 -0700 (PDT) X-Google-Smtp-Source: AA6agR55CWRRFJHXXoiUnlSWgQmLRPEQXOwTZakcG2qHa5yn9QU7u1LWpgpb4LyeRPAc2BXE7dw7 X-Received: by 2002:a05:6402:170f:b0:447:9293:234a with SMTP id y15-20020a056402170f00b004479293234amr20554928edu.373.1661868011955; Tue, 30 Aug 2022 07:00:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661868011; cv=none; d=google.com; s=arc-20160816; b=XYmV7tDONJzR9V3/4IL+M7BK5n+I/gF3ZN+2RfhGhkeSauST0KSJRhWP6vjKrC07QF aL2PheS/7+VcOhr3O9T1drLhROOkVTJjFwejUZfdA5UcL6ilL6FVJD3HHFm7JfFVOd4I Uz6tJcCV0zuLssobqBZ5Q9xU4sfLC2Nz7oiBJRA50Ztc9nKrzSyW+8cyDuLQXrcZaicI +LL8johX5RBsEzVUK+dZiqrQNH73VnVH9twhge8pGKhmeE8XFEpniLsvWMW0s7ld4PKs vQ5AKIljBD5cLjRT6OJNN7r6ICUWQUvIhXU6C3I3isd8v6lb7YPHYCoRFtF4C43bL67d lV+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=AXL38zfXQ3oFs5Yen9uoa08iDb794ruZe5CledU9Pgo=; b=Ooif4jQy/syubr/aFkrLuPDakyhvb/nnBlwMZdKxD2endPSz1yFRWmK+xmG5rGF/S0 iGJPfDH382xJGEBKihY5HhOw4+0LfTk0SFae2HvrPX4tKrMEhHAw4zrOejt8Oej7OjtZ TRVBNgZ16iDDCIF0tbZZRxbI2iQerdBJEViJn+ry4RenqKTz82o46rcfbFFR3BsIr5C2 dqodqSsZ8nxyY/w08S0ySUjcZB7dP6zrc5T2f7yGSCA85VJd5FDmNF3DuFPlLnh1hf10 ZI1xiOwjFfWw7KjebvI4bSvSxIN4WJhK9aV7GlUoF8ENqA6PdqXgJ+TB6FZv+EOW2Ynl DaZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg36-20020a170907972400b0073d045866b3si11025279ejc.225.2022.08.30.06.59.36; Tue, 30 Aug 2022 07:00:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229958AbiH3NZ4 convert rfc822-to-8bit (ORCPT + 99 others); Tue, 30 Aug 2022 09:25:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229807AbiH3NZx (ORCPT ); Tue, 30 Aug 2022 09:25:53 -0400 Received: from relay12.mail.gandi.net (relay12.mail.gandi.net [IPv6:2001:4b98:dc4:8::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31AE84E62B; Tue, 30 Aug 2022 06:25:49 -0700 (PDT) Received: (Authenticated sender: hadess@hadess.net) by mail.gandi.net (Postfix) with ESMTPSA id 142D3200004; Tue, 30 Aug 2022 13:25:46 +0000 (UTC) Message-ID: <5cc941f72c4b18ac9a39b60f00785d4610dd5054.camel@hadess.net> Subject: Re: [v3 4/5] HID: logitech-hidpp: Fix "Sw. Id." for HID++ 2.0 commands From: Bastien Nocera To: Benjamin Tissoires Cc: "open list:HID CORE LAYER" , lkml , Jiri Kosina , "Peter F . Patel-Schneider" , Filipe =?ISO-8859-1?Q?La=EDns?= , Nestor Lopez Casado Date: Tue, 30 Aug 2022 15:25:46 +0200 In-Reply-To: References: <20220830113907.4886-1-hadess@hadess.net> <20220830113907.4886-4-hadess@hadess.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.44.4 (3.44.4-1.fc36) MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2022-08-30 at 15:19 +0200, Benjamin Tissoires wrote: > On Tue, Aug 30, 2022 at 1:39 PM Bastien Nocera > wrote: > > > > Always set a non-zero "Sw. Id." in the lower nibble of the > > Function/ASE > > and Software Identifier byte in HID++ 2.0 commands. > > > > As per the "Protocol HID++2.0 essential features" section in > > https://lekensteyn.nl/files/logitech/logitech_hidpp_2.0_specification_draft_2012-06-04.pdf > > " > > Software identifier (4 bits, unsigned) > > > > A number uniquely defining the software that sends a request. The > > firmware must copy the software identifier in the response but does > > not use it in any other ways. > > > > 0 Do not use (allows to distinguish a notification from a > > response). > > " > > > > Link: https://bugzilla.kernel.org/show_bug.cgi?id=215699 > > Signed-off-by: Bastien Nocera > > --- > >  drivers/hid/hid-logitech-hidpp.c | 5 ++++- > >  1 file changed, 4 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid- > > logitech-hidpp.c > > index 98ebedb73d98..9c8088d8879e 100644 > > --- a/drivers/hid/hid-logitech-hidpp.c > > +++ b/drivers/hid/hid-logitech-hidpp.c > > @@ -41,6 +41,9 @@ module_param(disable_tap_to_click, bool, 0644); > >  MODULE_PARM_DESC(disable_tap_to_click, > >         "Disable Tap-To-Click mode reporting for touchpads (only on > > the K400 currently)."); > > > > +/* Define a non-zero software ID to identify our own requests */ > > +#define LINUX_KERNEL_SW_ID                     0x06 > > For consistency, and as Peter already asked, please use 0x01 instead > of 0x06. > > The simple reason is that it was well known that the kernel used 0x01 > from day one, and so we might have userspace application that uses > 0x06, and in this case you are walking on their toes. Done in v4, thanks. > > Cheers, > Benjamin > > > + > >  #define REPORT_ID_HIDPP_SHORT                  0x10 > >  #define REPORT_ID_HIDPP_LONG                   0x11 > >  #define REPORT_ID_HIDPP_VERY_LONG              0x12 > > @@ -343,7 +346,7 @@ static int hidpp_send_fap_command_sync(struct > > hidpp_device *hidpp, > >         else > >                 message->report_id = REPORT_ID_HIDPP_LONG; > >         message->fap.feature_index = feat_index; > > -       message->fap.funcindex_clientid = funcindex_clientid; > > +       message->fap.funcindex_clientid = funcindex_clientid | > > LINUX_KERNEL_SW_ID; > >         memcpy(&message->fap.params, params, param_count); > > > >         ret = hidpp_send_message_sync(hidpp, message, response); > > -- > > 2.37.2 > > >