Date: Fri, 1 Jun 2012 11:12:20 -0500 From: "Engineering" <ee@athyriogames.com> To: "'Hans Petter Selasky'" <hselasky@c2i.net> Cc: freebsd-usb@freebsd.org Subject: RE: Recommendations for programming HID in FreeBSD 9 Message-ID: <027901cd4011$53ec4ff0$fbc4efd0$@com> In-Reply-To: <201206011730.31081.hselasky@c2i.net> References: <201205280640.q4S6e6L0035127@freefall.freebsd.org> <201206010910.27817.hselasky@c2i.net> <026d01cd3ffc$d69ca130$83d5e390$@com> <201206011730.31081.hselasky@c2i.net>
next in thread | previous in thread | raw e-mail | index | archive | help
From: Hans Petter Selasky [mailto:hselasky@c2i.net]
>> uhid is not going to get obsoleted, though using libraries from
user-space is sometimes more convenient.
Thanks HPS (and Xiaofan)
I definitely agree with that, but I've got legacy code...
Last question - I've updated my code to convert the old 'usb_ctl_report' and
such to the new generic descriptors at runtime, and I've got two HIDs up and
running.
As I read uhid.c, it seems to assume only one feature report ID and size. I
have devices that have multiple feature report sizes. And one device which
I'm pretty sure has bad device descriptors, so the size is wrong.
In the BSD7, I added the following fakery to uhid.c:
case USB_SET_REPORTZ: // report id and size are in first two bytes
re = (struct usb_ctl_report *)addr;
id = re->ucr_data[0];
size = re->ucr_data[1];
err = usbd_set_report(sc->sc_iface, re->ucr_report, id,
&re->ucr_data[2],size);
if (err)
{
return (EIO);
}
break;
Do you think it would make sense to do this again with the BSD9 uhid.c?
If so, is there a way to recompile the kernel so it only updates the uhid
part? Pardon my ignorance on that.
Sam
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?027901cd4011$53ec4ff0$fbc4efd0$>
