Hello,
I was hoping someone would know the reason for the difference/patch.
This is regarding a bug: This looks like a bug/misfeature in hiddev - it
does not support items with Report Count > 1 (when the number of usages for
a data item < the number of values).
--------------------------------------------------------------------
In Kern 2.4.19-pre6, in hid-core.c
diff -purN linux-2.4.19-pre6/drivers/usb/hid-core.c
linux-2.4.19-pre5/drivers/usb/hid-core.c
--- linux-2.4.19-pre6/drivers/usb/hid-core.c 2003-05-08
13:00:24.000000000 +0200
+++ linux-2.4.19-pre5/drivers/usb/hid-core.c 2003-05-08
13:00:02.000000000 +0200
@@ -202,13 +204,17 @@ static int hid_add_field(struct hid_pars
return -1;
}
- if (parser->global.logical_maximum <=
parser->global.logical_minimum) {
- dbg("logical range invalid %d %d",
parser->global.logical_minimum, parser->global.logical_maximum);
- return -1;
+ if (HID_MAIN_ITEM_VARIABLE & ~flags) { /* ARRAY */
+ if (parser->global.logical_maximum <=
parser->global.logical_minimum) {
+ dbg("logical range invalid %d %d",
parser->global.logical_minimum, parser->global.logical_maximum);
+ return -1;
+ }
+ usages = parser->local.usage_index;
+ /* Hint: we can assume usages < MAX_USAGE here */
+ } else { /* VARIABLE */
+ usages = parser->global.report_count;
}
- usages = parser->local.usage_index;
-
offset = report->size;
report->size += parser->global.report_size *
parser->global.report_count;
--------------------------------------------------------------------
When I undo the change in my 2.4.20(add back the +'s), I can get my hiddev
device to write. Although it is reading my descriptors incorrectly(setting
usages = count), it seems like a possible workaround for my problem.
Does anyone know why this code was removed? and if it is readded, how it
would affect other hid devices? More detail on my bug is below.
Thanks,
Jackson
--------------------------
Details on my bug:
I am trying to write a userspace application for a SMART Board interactive
whiteboard which uses the Linux HID driver. I cannot get hiddev to write to
my device because of this bug:
This looks like a bug/misfeature in hiddev - it does not support items with
Report Count > 1 (when the number of usages for a data item < the number of
values).
hiddev_usage_ref::usage_index is treated as an index of a usage in the
selected data item (and limited by hid_field::maxusage), and also used as an
index into the hid_field::value array. However, the number of usages for a
data item may be less than the number of values - see the HID spec 1.11,
page 40 (50).
While Local items do not carry over to the next Main item,
they may apply to more than one control within a single item. For example,
if an Input item defining five controls is preceded by three Usage tags, the
three usages would be assigned sequentially to the first three controls, and
the third usage would also be assigned to the fourth and fifth controls. If
an item has no controls (Report Count = 0), the Local item tags apply to the
Main item (usually a collection item).
So the configuration with one usage and multiple values is legal. However,
the current hiddev API does not have a way to work with such devices.
OUTPUT[OUTPUT]
Field(0)
Usage(1)
Digitizers.0000
Logical Minimum(0)
Logical Maximum(255)
Report Size(8)
Report Count(5)
Report Offset(0)
Flags( Variable Absolute BufferedByte )
-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel