On Mon, 23 Jun 2003 17:25:10 -0600 Jackson Chan <[EMAIL PROTECTED]> wrote:
> Sergey, I think you are right about the bug. > > > This looks like a bug/misfeature in hiddev(output) - it does not support > items > > with Report Count > 1 (when the number of usages for a data item is less > than the > > number of values). > > When I add this logic to the hid-core.c( to .hid_add_field() ), I can get it > to output the data to my device correctly (using the usage index. ie 5 > usages for 5 values). > > usages = parser->global.report_count; > > This ofcourse is not a proper solution because the hid-core is actually > reading my report descriptor incorrectly (as usages never equals the report > count in my descriptor). It's almost like 2 wrongs make a right. > > However, it shows that if I had the number of usages >= the number of > values, I could output. But I don't, so I can't :P :) And as you > explained, the hid spec allows for usages < values. Yes, this is not the proper place for the change. One solution is to redefine hiddev_usage_ref::usage_index as a value index, and change hiddev_ioctl() to compare it against field->report_count instead of field->maxusage. In this case the field name will become incorrect, but there should be no binary compatibility issues - the call will just fail with EINVAL if the kernel is too old. Another solution is to add a new pair of ioctls which will use an extended structure with a value_index field added; however, this is more complex - e.g., if there are duplicate but not adjacent usages in the same report, or if the report ID is not specified and there are duplicate usages in different reports. ------------------------------------------------------- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
