Subject: Re: prototype in GENERIC for APC UPS?
To: Greg Troxel <gdt@ir.bbn.com>
From: Stephen Borrill <netbsd@precedence.co.uk>
List: tech-kern
Date: 04/24/2007 09:31:12
On Mon, 23 Apr 2007, Greg Troxel wrote:
> I think the patch Bernd posted that adds a quirk table to uhid so that
> devices like these UPS units can not attach to uhid is a good one.
> Right now the software out there that wants to talk to these devices
> wants ugen, and it's easy enough to list the ids to get them handed to
> ugen.
>
> It would be even cooler to be able to force a detach from uhid and
> reattach to ugen with a user-space control program.  But that's probably
> much harder.

Absolutely. That's what Linux does (so it must be right!) and which is 
used by some programs using libusb in the following manner:

         /* try to detach device in case usbhid has got hold of it */
         ret = usb_detach_kernel_driver_np(control->handle, 0);

I wonder if there's a way to define a passthru in uhid so that it can be 
treated like ugen, e.g. a USB_USE_RAWDEVICE() ioctl. That would be easier 
than trying to detach uhid

One of the major problems with uhidev, etc. is that the documentation is 
terrible.

-- 
Stephen