Skip to contentSkip to conversation

proposed fix to usb-core

DISCUSSION Martin F Krafft 2 participants 2 messages Nov 14, 2003

lore
Share & tools
lore
#0 lore raw

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