Subject: Re: Missile launchers vs uhid
To: Reinoud Zandijk <reinoud@netbsd.org>
From: Stephen Borrill <netbsd@precedence.co.uk>
List: tech-kern
Date: 02/28/2007 16:51:35
On Wed, 28 Feb 2007, Reinoud Zandijk wrote:
> On Wed, Feb 28, 2007 at 02:59:25PM +0000, Stephen Borrill wrote:
>> I've got a USB missile launcher:
>> uhidev0 at uhub0 port 4 configuration 1 interface 0
>> uhidev0: vendor 0x1130 Tenx Nonstandard Devic, rev 1.10/1.00, addr 2,
>> iclass 3/0
>> uhid0 at uhidev0: input=0, output=64, feature=8
>> uhidev1 at uhub0 port 4 configuration 1 interface 1
>> uhidev1: vendor 0x1130 Tenx Nonstandard Devic, rev 1.10/1.00, addr 2,
>> iclass 3/0
>> uhid1 at uhidev1: input=0, output=8, feature=0
>> ...
>> They both claim the device directly and try to detach the kernel uhid
>> driver before writing a very simple usb control message. This seems a lot
>> simpler than messing around with libusbhid, but I can't see how to achieve
>> it on NetBSD.
>
> Is it not a bug in the usbhid code then or is the device a non standard
> USB?

I think it's just a difference between *BSD's API and the Linux one. In 
pkgsrc/libusb, the function to detach is commented out if you are on *BSD:
 	int usb_detach_kernel_driver_np(usb_dev_handle *dev, int interface);

By disabling uhidev (so the missile launcher appears as ugen) and taking 
the above into account, the Linux driver works. So I can shoot things from 
NetBSD now, but it's not an ideal way of doing it (it really is a hid 
device - it appears like that under Windows).

-- 
Stephen