From owner-freebsd-usb@FreeBSD.ORG Fri Jun 1 16:13:29 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D9653106564A for ; Fri, 1 Jun 2012 16:13:29 +0000 (UTC) (envelope-from ee@athyriogames.com) Received: from madonna.sslcatacombnetworking.com (madonna.sslcatacombnetworking.com [174.133.19.130]) by mx1.freebsd.org (Postfix) with ESMTP id B01C18FC15 for ; Fri, 1 Jun 2012 16:13:29 +0000 (UTC) Received: from c-98-206-215-156.hsd1.in.comcast.net ([98.206.215.156] helo=laptopv) by madonna.sslcatacombnetworking.com with esmtpa (Exim 4.69) (envelope-from ) id 1SaUNN-0003mO-SU; Fri, 01 Jun 2012 11:07:00 -0500 From: "Engineering" To: "'Hans Petter Selasky'" References: <201205280640.q4S6e6L0035127@freefall.freebsd.org> <201206010910.27817.hselasky@c2i.net> <026d01cd3ffc$d69ca130$83d5e390$@com> <201206011730.31081.hselasky@c2i.net> In-Reply-To: <201206011730.31081.hselasky@c2i.net> Date: Fri, 1 Jun 2012 11:12:20 -0500 Message-ID: <027901cd4011$53ec4ff0$fbc4efd0$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac1ACrHFd3P7YpWLSKWveS1+K4oU9AABXOmQ Content-Language: en-us X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - madonna.sslcatacombnetworking.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - athyriogames.com Cc: freebsd-usb@freebsd.org Subject: RE: Recommendations for programming HID in FreeBSD 9 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2012 16:13:29 -0000 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