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-input
Hi Nicolas On Wed, Mar 28, 2012 at 1:15 PM, Nicolas Pouillon [off-list ref] wr= ote:
David, ----- Original Message -----quoted
quoted
quoted
+ =A0 =A0 strncpy(hid->name, ev->u.create.name, 128); + =A0 =A0 hid->name[127] =3D 0; + =A0 =A0 hid->ll_driver =3D &uhid_hid_driver; + =A0 =A0 hid->hid_get_raw_report =3D uhid_hid_get_raw; + =A0 =A0 hid->hid_output_raw_report =3D uhid_hid_output_raw; + =A0 =A0 hid->bus =3D ev->u.create.bus; + =A0 =A0 hid->vendor =3D ev->u.create.vendor; + =A0 =A0 hid->product =3D ev->u.create.product; + =A0 =A0 hid->version =3D ev->u.create.version; + =A0 =A0 hid->country =3D ev->u.create.country; + =A0 =A0 hid->phys[0] =3D 0; + =A0 =A0 hid->uniq[0] =3D 0; + =A0 =A0 hid->driver_data =3D uhid; + =A0 =A0 hid->dev.parent =3D uhid->parent;Here we have to make sure that we have all required information provid=
ed
quoted
quoted
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). =A0Physical Descriptor blob could be another __user buffer + size in uhid_create_req. =A0String 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