Date: Tue, 28 Jul 2009 19:40:27 +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: <zwXGioeg7oGpbCtzpfQAMfews68@CWODRlDR5RMqbkBfR0/UzHcfNhE> In-Reply-To: </kNvT4PUQiAaILwpSOAKI37SlXY@CWODRlDR5RMqbkBfR0/UzHcfNhE> References: <20090727194459.393CFB8090@phoenix.codelabs.ru> <200907271950.n6RJo3jj021164@freefall.freebsd.org> <8RwwU1KLz1ezvFiU9HsY6uoNfkU@nflB3XSqYRRHWdyVHMOFGnCK5Pk> </kNvT4PUQiAaILwpSOAKI37SlXY@CWODRlDR5RMqbkBfR0/UzHcfNhE>
next in thread | previous in thread | raw e-mail | index | archive | help
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 {_.-``-' {_/ #
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?zwXGioeg7oGpbCtzpfQAMfews68>