mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bastien Nocera <hadess@hadess.net>
To: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: "open list:HID CORE LAYER" <linux-input@vger.kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	"Jiri Kosina" <jikos@kernel.org>,
	"Peter F . Patel-Schneider" <pfpschneider@gmail.com>,
	"Filipe Laíns" <lains@riseup.net>,
	"Nestor Lopez Casado" <nlopezcasad@logitech.com>
Subject: Re: [v3 4/5] HID: logitech-hidpp: Fix "Sw. Id." for HID++ 2.0 commands
Date: Tue, 30 Aug 2022 15:25:46 +0200	[thread overview]
Message-ID: <5cc941f72c4b18ac9a39b60f00785d4610dd5054.camel@hadess.net> (raw)
In-Reply-To: <CAO-hwJJWDFS7zCbGAvbDCx0e+xNCtr_A4gBx0T5M8WeDVhnPgA@mail.gmail.com>

On Tue, 2022-08-30 at 15:19 +0200, Benjamin Tissoires wrote:
> On Tue, Aug 30, 2022 at 1:39 PM Bastien Nocera <hadess@hadess.net>
> 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 <hadess@hadess.net>
> > ---
> >  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
> > 
> 


  reply	other threads:[~2022-08-30 13:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-30 11:39 [v3 1/5] HID: core: Export hid_match_id() Bastien Nocera
2022-08-30 11:39 ` [v3 2/5] HID: logitech-hidpp: Enable HID++ for all the Logitech Bluetooth devices Bastien Nocera
2022-08-30 11:39 ` [v3 3/5] HID: logitech-hidpp: Remove special-casing of " Bastien Nocera
2022-08-30 11:39 ` [v3 4/5] HID: logitech-hidpp: Fix "Sw. Id." for HID++ 2.0 commands Bastien Nocera
2022-08-30 13:19   ` Benjamin Tissoires
2022-08-30 13:25     ` Bastien Nocera [this message]
2022-08-30 11:39 ` [v3 5/5] HID: logitech-hidpp: Remove hard-coded " Bastien Nocera

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=5cc941f72c4b18ac9a39b60f00785d4610dd5054.camel@hadess.net \
    --to=hadess@hadess.net \
    --cc=benjamin.tissoires@redhat.com \
    --cc=jikos@kernel.org \
    --cc=lains@riseup.net \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nlopezcasad@logitech.com \
    --cc=pfpschneider@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

all inboxes | Powered by JetHome®