linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Hübner" <andreas@k4n.de>
To: linux-input@vger.kernel.org
Subject: Re: Saitek PS1000 gamepad - HID descriptor wonky
Date: Sun, 11 Dec 2011 22:48:30 +0100	[thread overview]
Message-ID: <20111211214830.GA14097@tapura> (raw)

Hi Simon!

Let's continue the discussion on the list. I did made some progress
that requires input from the HID maintainers.

> You have to check the rsize, otherwise you might have problems writing
> outside the size of the original descriptor.

That's exactly what I've been doing, or did I miss something?
In fact, I wanted to be absolutely sure and only mess with the descriptor
when the sizes match.  (*rsize == 137)

> Note a D-Pad might be defined as 'Buttons', a 'D-Pad' or as a 'Hat'. You
> need to check out the values change in the HID stream.

It's defined as a 'Hat' with 8 different directions.

> Send me a copy of the original descriptor and I'll have a look.

Should already be on the list. And I was able to identify the culprit so
no need to bother you.

The problem is the following code in hidinput_configure_usage
(drivers/hid/hid-input.c):

	if (field->flags & HID_MAIN_ITEM_CONSTANT)
		goto ignore;

The buttons and the hat are defined with the constant flag enabled.
Now I might be reading the spec wrong, but I'm not so sure that we can
simply skip constant values.
This is the description of the data/constant flag.

    Indicates whether the item is data or a constant
    value. Data indicates the item is defining report
    fields that contain modifiable device data. Constant
    indicates the item is a static read-only field in a
    report and cannot be modified (written) by the
    host.


Well, I need to patch the descriptor nevertheless because it defines a
non-existing sixth axis. Might as well remove the constant flag on the
buttons and hat. However, other devices might be affected as well, so
I'd like to get some input on how to deal with the situation.


Andreas

             reply	other threads:[~2011-12-11 21:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-11 21:48 Andreas Hübner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-11-22 10:28 joydev: support for Saitek PS1000 gamepad Andreas Hübner
2011-11-22 17:13 ` simon
2011-11-23  8:43   ` Andreas Hübner
2011-11-23 15:45     ` Saitek PS1000 gamepad - HID descriptor wonky simon
2011-11-24  8:12       ` Andreas Hübner
     [not found]         ` <30cc35606560d634477e2a288bdf6db3.squirrel@host171.canaca.com>
     [not found]           ` <20111208123424.GA1298@tapura>
     [not found]             ` <a8799dfc5b69fd158ec54b099d231961.squirrel@host171.canaca.com>
     [not found]               ` <20111210131702.GA5620@tapura>
     [not found]                 ` <d13c53ac7f835eaff26cfc2aae0fac6c.squirrel@mungewell.org>
     [not found]                   ` <20111211214010.GA14046@tapura>
2011-12-12 18:49                     ` simon
2011-12-13 19:09                       ` Andreas Hübner
2012-02-22  0:50                       ` Andreas Hübner

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=20111211214830.GA14097@tapura \
    --to=andreas@k4n.de \
    --cc=linux-input@vger.kernel.org \
    /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).