Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Jul 2009 00:38:12 +0400
From:      Eygene Ryabinkin <rea-fbsd@codelabs.ru>
To:        bug-followup@FreeBSD.org, freebsd-usb@FreeBSD.org
Subject:   Re: usb/137189: [usb][patch] create and use sysctl nodes for HID report descriptors
Message-ID:  <tncwUCuAY%2BptTyKk7EaSLNvOfmc@w211KWCVxL/DyYiVn0m5Ttk95Ds>
In-Reply-To: <zwXGioeg7oGpbCtzpfQAMfews68@CWODRlDR5RMqbkBfR0/UzHcfNhE>
References:  <20090727194459.393CFB8090@phoenix.codelabs.ru> <200907271950.n6RJo3jj021164@freefall.freebsd.org> <8RwwU1KLz1ezvFiU9HsY6uoNfkU@nflB3XSqYRRHWdyVHMOFGnCK5Pk> </kNvT4PUQiAaILwpSOAKI37SlXY@CWODRlDR5RMqbkBfR0/UzHcfNhE> <zwXGioeg7oGpbCtzpfQAMfews68@CWODRlDR5RMqbkBfR0/UzHcfNhE>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?tncwUCuAY%2BptTyKk7EaSLNvOfmc>