From owner-freebsd-usb@FreeBSD.ORG Fri Jul 31 07:19:19 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 541C6106566C for ; Fri, 31 Jul 2009 07:19:19 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe14.tele2.se [212.247.155.161]) by mx1.freebsd.org (Postfix) with ESMTP id DD7D58FC17 for ; Fri, 31 Jul 2009 07:19:18 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=52VOGAJ3MIIA:10 a=gg2W7PyvkLb8p4ie143lBA==:17 a=RUGs7RsqHfnnyCMCypQA:9 a=L7s8rrqG-scMQX_gEnIA:7 a=ZEk0is3KFe6E1ibzgQ618f8LHJwA:4 Received: from [194.248.135.20] (account mc467741@c2i.net HELO laptop.adsl.tele2.no) by mailfe14.swip.net (CommuniGate Pro SMTP 5.2.13) with ESMTPA id 547119737; Fri, 31 Jul 2009 09:19:16 +0200 From: Hans Petter Selasky To: rea-fbsd@codelabs.ru Date: Fri, 31 Jul 2009 09:19:03 +0200 User-Agent: KMail/1.11.4 (FreeBSD/8.0-BETA2; KDE/4.2.4; i386; ; ) References: <20090727194459.393CFB8090@phoenix.codelabs.ru> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907310919.06906.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org, bug-followup@freebsd.org Subject: Re: usb/137189: [usb][patch] create and use sysctl nodes for HID report descriptors 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, 31 Jul 2009 07:19:19 -0000 On Thursday 30 July 2009 22:38:12 Eygene Ryabinkin wrote: > Hans Petter, good day. > > Tue, Jul 28, 2009 at 07:40:27PM +0400, Eygene Ryabinkin wrote: > > HPS wrote: > > > > Why do you dislike the sysctl approach? It is simple and reliable. > > > > > > It's duplicating access to data. There is not that much wrong about > > > it, except it will not work if the device is of another kind. I.E. you > > > would have to patch the HID sysctl node into every driver accessing > > > HID descriptors? > > > > Just now -- yes, I'll need it. But probably I can move this > > functionality into the USB bus level -- it will automatically create > > this sysctl node for all HID children and will dispose it on the detach. > > usb_probe_and_attach() is a candidate for such functionality. Will it > > be bad? > > OK, attached is the reworked version of the sysctl patch: it now creates > the needed nodes automatically (though they still can be created by > explicit call from the driver, as in uhid(4)). As a bonus, kernel got the > ability to install per-USB class post-attach and pre-detach handlers, so > we can do some class-specific things for every driver. What do you think > of it? Hi, I think it's too much code to doo too little, and adds extra complexity, and that doing this via libusb would be much more generic. --HPS