proposed fix to usb-core
We are currently fighting with a problem with the USB HID API, which seems to prevent a user space application to write more than 32 bit into a HID field.
We think that this problem can be solved with one of two little changes to /drivers/usb/hid-core.c (2.4.22 tree):
Function hid_register_field at usb-core.c:96:
static struct hid_field *hid_register_field(struct hid_report *report, unsigned usages, unsigned values)
The function either needs to duplicate the struct hid_usage or grow the size of the last struct hid_usage. The first option is the easiest since it does not require a change of hiddev API. The later option is probably more effective but requires to change the HIDIOCSUSAGE ioctl so that it accepts a struct {void* data, int data_size} instead of just int data.
I would be happy to submit a patch, but would like to hear first which option is favourable. The first costs performance and memory, the second an API change.
Or is there a specific reason why only 32 bits are writeable?
Thanks,
Signature · 10 lines
Martin F. Krafft Artificial Intelligence Laboratory Ph.D. Student Department of Information Technology Email: [email protected] University of Zurich Tel: +41.(0)1.63-54323 Andreasstrasse 15, Office 2.20 http://ailab.ch/people/krafft CH-8050 Zurich, Switzerland Invalid/expired PGP subkeys? Use subkeys.pgp.net as keyserver! "if a man treats life artistically, his brain is his heart." -- oscar wilde
Hi, For information this problem is already know to Vojtech Pavlik
<[email protected]> and was reported last month on linux-usb-devl
(http://marc.theaimsgroup.com/?l=linux-usb-devel&m=106708259416772&w=2).
Cheers,
Signature · 3 lines
Donate to FSF France online : http://rate.affero.net/fsffrance/ Loic Dachary, 12 bd Magenta, 75010 Paris. Tel: 33 1 42 45 07 97 http://www.fsffrance.org/ http://www.dachary.org/loic/gpg.txt