Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Mar 2010 14:15:03 +0100
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        Martin Laabs <mailinglists@martinlaabs.de>
Cc:        freebsd-usb@freebsd.org
Subject:   Re: Find Vendor/Product ID from uhid device
Message-ID:  <201003211415.03564.hselasky@c2i.net>
In-Reply-To: <4BA60B0A.3040005@martinlaabs.de>
References:  <4BA52239.8000300@martinlaabs.de> <201003211134.28085.hselasky@c2i.net> <4BA60B0A.3040005@martinlaabs.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday 21 March 2010 13:03:22 Martin Laabs wrote:
> Hello Hans,

Hi Martin,

> 
> Hans Petter Selasky wrote:
> > I would recommend you use libusb in userland to do this. Then you get all
> > the information you need for the ID-match and more.
> 
> Unfortunately the linux-js driver creates a new device in /dev/input which
> is IMHO impossible for a userland program. So I have to detect the usb
> devices in kernel space.

That is not true. Search Google for cuse4bsd :-)
> 
>   If that is not desirable, we
> 
> > can add that information like an IOCTL. usbconfig show_ifdrv might also
> > give you some clues.
> 
> Yes - in fact. I.e. the output I am interested in is
> ugen2.2.0: uhid0: <Logitech Logitech Extreme 3D, class 0/0, rev 1.10/2.04,
> addr 2>
> Now I could figure out that ugen2.2.0 has idVendor=0x046d idProduct=0xc215
> with usbconfig dump_device_desc. After that the driver would check that ids
> against its database and if it would match it would use the /dev/uhid0
> device. (with kopen - see below)
> 

> 
> Do you think it is much effort to add a ioctl to the uhid driver that
> reports the corresponding  usb_device_info struct? This would make porting
> the linux-js driver much more simple for me.
> Or is there a (simple accessible) data structure inside the kernel where I
> can get the information which vendor/product id correspond to a uhidX
> attached device?

This should be quite trivial, if cuse4bsd does not help anything.

Just an idea:

Maybe we can import the linux-js driver into the webcamd framework? Could you 
have a look at it. Then the code changes will be minimal!

--HPS

http://www.selasky.org/hans_petter/video4bsd



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003211415.03564.hselasky>