From owner-freebsd-usb@FreeBSD.ORG Thu Jul 30 20:38:17 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 3C2F2106564A; Thu, 30 Jul 2009 20:38:17 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id 93AD58FC1A; Thu, 30 Jul 2009 20:38:16 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) DomainKey-Signature: a=rsa-sha1; q=dns; c=simple; s=one; d=codelabs.ru; h=Received:Date:From:To:Cc:Subject:Message-ID:Reply-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:Sender; b=iZpzobX8+EdzBH9M1qRAdyrED3pjPQBkceQr9SjOL1QbpkpXsAIJVbiwm/L3ntUfiqCRcGMIJYLDOe1ifwEfeoDVghxGrEk8F81Db63vnNX7It5M5QwsNGf+8YCumjYdigEPqu9e+XZuSbAkFw0wqL+7/Z9IBzR2YX91Wuds4aM=; Received: from amnesiac.at.no.dns (ppp91-78-117-58.pppoe.mtu-net.ru [91.78.117.58]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1MWcOE-0000Sf-G4; Fri, 31 Jul 2009 00:38:15 +0400 Date: Fri, 31 Jul 2009 00:38:12 +0400 From: Eygene Ryabinkin To: bug-followup@FreeBSD.org, freebsd-usb@FreeBSD.org Message-ID: References: <20090727194459.393CFB8090@phoenix.codelabs.ru> <200907271950.n6RJo3jj021164@freefall.freebsd.org> <8RwwU1KLz1ezvFiU9HsY6uoNfkU@nflB3XSqYRRHWdyVHMOFGnCK5Pk> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="tThc/1wpZn/ma/RB" Content-Disposition: inline In-Reply-To: Sender: rea-fbsd@codelabs.ru X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: 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 Reply-To: rea-fbsd@codelabs.ru List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2009 20:38:17 -0000 --tThc/1wpZn/ma/RB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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? Thanks! -- Eygene _ ___ _.--. # \`.|\..----...-'` `-._.-'_.-'` # Remember that it is hard / ' ` , __.--' # to read the on-line manual )/' _/ \ `-_, / # while single-stepping the kernel. `-'" `"\_ ,_.-;_.-\_ ', fsc/as # _.-'_./ {_.' ; / # -- FreeBSD Developers handbook {_.-``-' {_/ # --tThc/1wpZn/ma/RB--