linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anssi Hannula <anssi.hannula@gmail.com>
To: Dmitriy Geels <dmitriy.geels@gmail.com>
Cc: linux-input@vger.kernel.org
Subject: Re: hid-pidff bug: fails to find all required reports of saitek gamepad
Date: Sat, 07 Feb 2009 14:28:49 +0200	[thread overview]
Message-ID: <498D7E81.4060007@gmail.com> (raw)
In-Reply-To: <78f5d6bf0902021029g7e53f16ble27500b52f9498ba@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1923 bytes --]

Dmitriy Geels wrote:
> 2009/2/2 Anssi Hannula <anssi.hannula@gmail.com>:
>>> I don't understand yet, how to fix this bug, so I'm posting this to
>>> maillist with hope on someones help.
>> The error message means that it can't find reports 0xab (create new
>> effect), 0x89 (pid block load), 0x90 (pid block free), that according to
>> your html page are in fact there.
>>
>> Could you provide the output with parameter debug=1 for hid module when
>> device is initialized? It prints the raw HID descriptor and the kernel's
>> interpretation of it.
>> (If you have the hid module built-in, you can use "echo 1 >
>> /sys/modules/hid/parameters/debug")
> 
> I'm discovering this situation, but haven't got much progress. Now I
> consider, that problem is not in hid-pidff, but somewhere deeper, like
> in hid_parse_report().
> 
> I saw strange things: report for usage 0x90 has empty field->logical
> field (should be 0x000f0090, was seen as "checking field->logical ==
> 0x00000000" earlier), that's why it's ignored. Reports, which are 0x25
> and 0x8b, are feature reports and I have no clue yet, why wrong usages
> were put into field->logical.

It is because those collections are defined as "Report collections"
instead of "Logical collections". Linux doesn't know about "Report
collections", but according to HID spec it is also a Logical collection:

"Defines a logical collection that wraps all the fields in a report. A
unique report ID will be contained in this collection. An
application can easily determine whether a device supports a
certain function. Note that any valid Report ID value can be
declared for a Report collection."

Try the attached patch, which simply changes the collection type for
such collections.

> Here is decoded hid descriptor with raw data:
> http://docs.google.com/Doc?id=dhk68r8j_2gvttgsr8
> Here is just raw data: http://docs.google.com/Doc?id=dhk68r8j_38stwrngm

-- 
Anssi Hannula

[-- Attachment #2: hid-logical-subtypes.diff --]
[-- Type: text/plain, Size: 622 bytes --]

--- linux/drivers/hid/hid-core.c.old	2009-02-07 14:17:49.000000000 +0200
+++ linux/drivers/hid/hid-core.c	2009-02-07 14:22:45.000000000 +0200
@@ -142,6 +142,12 @@
 	parser->collection_stack[parser->collection_stack_ptr++] =
 		parser->device->maxcollection;
 
+	/* Report collections (0x03), Named Array collections (0x04) and Usage
+	 * Switch collections (0x05) are subtypes of logical collections
+	 * according to the HID specification */
+	if (type >= 0x03 && type <= 0x05)
+		type = HID_COLLECTION_LOGICAL;
+
 	collection = parser->device->collection +
 		parser->device->maxcollection++;
 	collection->type = type;

  parent reply	other threads:[~2009-02-07 12:28 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-30 19:45 hid-pidff bug: fails to find all required reports of saitek gamepad Dmitriy Geels
2009-02-02 15:50 ` Anssi Hannula
2009-02-02 18:29   ` Dmitriy Geels
2009-02-02 18:48     ` Dmitriy Geels
2009-02-07 12:28     ` Anssi Hannula [this message]
     [not found]       ` <78f5d6bf0902092146x2abaf45an79e4546e75a80356@mail.gmail.com>
2009-02-10  7:49         ` Dmitriy Geels
2009-02-10  7:49         ` Fwd: " Dmitriy Geels
2009-02-10 16:06         ` Anssi Hannula
2009-02-11  9:12           ` Dmitriy Geels
2009-02-11 16:27             ` Anssi Hannula
2009-02-12 18:06               ` Dmitriy Geels
2009-02-12 18:42                 ` Anssi Hannula
2009-02-13  8:33                   ` Dmitriy Geels
2009-02-13 19:43                     ` Anssi Hannula
     [not found]                       ` <78f5d6bf0902141125m1bf9ac00xb2b414e81d81b869@mail.gmail.com>
     [not found]                         ` <49972478.3060207@gmail.com>
2009-02-14 22:33                           ` Dmitriy Geels
2009-02-17 12:16                             ` Dmitriy Geels
2009-02-18 15:45                               ` Anssi Hannula
2009-02-19  6:56                                 ` Dmitriy Geels
     [not found]                                 ` <78f5d6bf0902182254v191cc485x62eb211baaddd36@mail.gmail.com>
     [not found]                                   ` <499D7C66.6090000@gmail.com>
2009-02-26 21:21                                     ` Dmitriy Geels
2009-02-27 16:24                                       ` Anssi Hannula
2009-03-02 18:41                                         ` Dmitriy Geels
2009-03-02 20:35                                           ` Anssi Hannula
2009-03-03  6:28                                             ` Dmitriy Geels
2009-03-03 18:35                                               ` Dmitriy Geels
2009-03-07 14:38                                                 ` Anssi Hannula
2009-03-08  5:18                                                   ` Dmitriy Geels
2009-03-08 10:16                                                     ` Anssi Hannula
2009-03-09 19:08                                                       ` Dmitriy Geels
2009-05-07 23:45                                                         ` Anssi Hannula
2009-05-07 23:57                                                           ` Anssi Hannula
     [not found]                                                             ` <78f5d6bf0906041227w3a58bde0u554a3d3336e17fa6@mail.gmail.com>
2009-06-06 12:14                                                               ` Anssi Hannula
2009-06-09  5:02                                                                 ` Dmitriy Geels
2009-06-09  6:09                                                                   ` Alek Du
2009-06-09  7:37                                                                     ` Dmitriy Geels
2009-06-11  9:38                                                                     ` Dmitriy Geels
2009-06-11 20:11                                                                       ` Dmitriy Geels
2009-07-09 17:41                                                                         ` Dmitriy Geels
2009-07-09 17:58                                                                           ` Anssi Hannula
2009-11-06  9:06                                                                             ` Dmitriy Geels
2009-11-09 12:00                                                                             ` Dmitriy Geels
2009-11-20 14:17                                                                               ` Dmitriy Geels

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=498D7E81.4060007@gmail.com \
    --to=anssi.hannula@gmail.com \
    --cc=dmitriy.geels@gmail.com \
    --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).