Return-Path: MIME-Version: 1.0 In-Reply-To: <2052749237.3448849.1332933329806.JavaMail.root@zmc> References: <2052749237.3448849.1332933329806.JavaMail.root@zmc> Date: Thu, 29 Mar 2012 14:28:01 +0200 Message-ID: Subject: Re: [RFC v2 1/1] HID: User-space I/O driver support for HID subsystem From: David Herrmann To: Nicolas Pouillon Cc: linux-input@vger.kernel.org, jkosina@suse.cz, chen ganir , claudio takahasi , jprvita@openbossa.org, linux-bluetooth@vger.kernel.org, anderson lizardo , Marcel Holtmann Content-Type: text/plain; charset=ISO-8859-1 List-ID: Hi Nicolas On Wed, Mar 28, 2012 at 1:15 PM, Nicolas Pouillon wr= ote: > David, > > ----- Original Message ----- > >> >> + =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 >> > 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