Re: [RFC v2 1/1] HID: User-space I/O driver support for HID subsystem
From: David Herrmann <hidden>
Date: 2012-03-29 12:28:03
Also in:
linux-bluetooth
Hi Nicolas On Wed, Mar 28, 2012 at 1:15 PM, Nicolas Pouillon [off-list ref] wrote:
David, ----- Original Message -----quoted
quoted
quoted
+ strncpy(hid->name, ev->u.create.name, 128); + hid->name[127] = 0; + hid->ll_driver = &uhid_hid_driver; + hid->hid_get_raw_report = uhid_hid_get_raw; + hid->hid_output_raw_report = uhid_hid_output_raw; + hid->bus = ev->u.create.bus; + hid->vendor = ev->u.create.vendor; + hid->product = ev->u.create.product; + hid->version = ev->u.create.version; + hid->country = ev->u.create.country; + hid->phys[0] = 0; + hid->uniq[0] = 0; + hid->driver_data = uhid; + hid->dev.parent = uhid->parent;Here we have to make sure that we have all required information provided by userspace. Anything else that HID might require to work better. Or that BR/EDR or LE provides additionally over USB.Beside phys and uniq I have copied all information that HIDP and USBHID use. I haven't found any other field that could be of interest here. We can also always add UHID_CREATE2 with additional fields to allow further additions (or use a "size" field as you suggested below).HID report descriptor may reference Physical Descriptor (HID 6.2.3) and String Descriptor entries (USB 9.6.8, HID E.11). Physical Descriptor blob could be another __user buffer + size in uhid_create_req. String descriptor should probably be an event for querying strings.
I haven't seen that hid-core uses them? I pass the report-descriptor to hid_parse_report() and I don't see a way to pass in the phys-desc or string-descriptors. Neither USBHID nor HIDP uses them or am I missing something here? Anyway, we can always add them with a UHID_CREATE_EXT or similar command later if hid-core adds support for them.
hidraw interface also offers access to Feature Reports, adding events to send/receive and query (kernel querying uhid client) feature reports could be of some interest.
Yeah, I haven't implemented this (yet) and I return -EOPNOTSUPP. However, it's on my TODO list. Thanks!
Cheers, -- Nicolas Pouillon
Thanks David -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html