From owner-freebsd-usb@FreeBSD.ORG Tue Jul 28 15:40:31 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 5481C1065670; Tue, 28 Jul 2009 15:40:31 +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 048EB8FC13; Tue, 28 Jul 2009 15:40:30 +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=NUvF/cxoQlL+bWQG1KuyPvIfZz3jS6ZVWCPRcehPmBEKBAGvusvmQTHl6tnojhMrPhMCI8Hx/d3aQFX7vanCdNIziQKZTn68TCyVXPOvlrrKV1YmuNvAg3Ks2wwwIIRqo97D2PTlIl+qaLAp1WCVB+G/z0fc+Uc62817NFqt99E=; Received: from void.codelabs.ru (void.codelabs.ru [144.206.177.25]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1MVomz-0001lN-WB; Tue, 28 Jul 2009 19:40:30 +0400 Date: Tue, 28 Jul 2009 19:40:27 +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: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: rea-fbsd@codelabs.ru 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: Tue, 28 Jul 2009 15:40:31 -0000 HPS wrote: > > I can, but how to relate the device name under devfs to the descriptor > > to be retrieved? > > By unit number and device address, like usbconfig. Yes, but these numbers are the ugen ones; on my system, for example, ums0 maps to ugen5.3.0. >> I can enumerate all HID descriptors via libusb, but I > > can't currently say which device uses them. > > Try: > > usbconfig show_ifdrv Yes, that's better. But can I rely that the first item in the output of the libusb20_dev_get_iface_desc() will be the device name? And still, to get the report descriptor from one device, I should walk the entire USB tree until I'll find the device I am interested in. May be there are some other ways? I understand that enumeration is the principle of the USB bus, but may be there are another ways to directly grab 'struct libusb20_device *' or alike for the devfs node I am interested in? > > 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? -- Eygene _ ___ _.--. # \`.|\..----...-'` `-._.-'_.-'` # Remember that it is hard / ' ` , __.--' # to read the on-line manual )/' _/ \ `-_, / # while single-stepping the kernel. `-'" `"\_ ,_.-;_.-\_ ', fsc/as # _.-'_./ {_.' ; / # -- FreeBSD Developers handbook {_.-``-' {_/ #