[argyllcms] Re: HID issue with libusb on Huey

  • From: "Frédéric Crozat" <fred@xxxxxxxxxx>
  • To: argyllcms@xxxxxxxxxxxxx
  • Date: Mon, 17 Dec 2007 15:19:10 +0100

On Dec 17, 2007 1:24 AM, Graeme Gill <graeme@xxxxxxxxxxxxx> wrote:
> Frédéric Crozat wrote:
> > What distribution and what kernel version are you using ?
> I'm using WhiteBox 4 on an old piece of hardware and I updated
> it recently. The kernel is 2.6.9-55.EL
> > Was Huey handled by usbhid driver (as shown in /proc/bus/usb/devices) ?
> The Huey is obviously grabbed by the HID driver, the IOCTL detaches
> it, and libusb then successfully handles it. This is exactly
> the type of approach libhid uses, since it too is based on libusb.
> > I've also tested when usbhid doesn't handle the device and
> > USBDEVFS_IOCTL is failing with the same error.
> It sounds like some change in the USB driver is causing
> this to fail.
> I notice that the IOCTL definitions are rather loosely
> connected to the user mode code - it's not
> like there is a .h file to glue things together with
> symbolic definitions, so it all depends on certain
> magic numbers not changing:
> #define IOCTL_USB_DISCONNECT    _IO('U', 22)
> int usb_detach_kernel_driver_np(usb_dev_handle *dev, int interface)
> {
>    struct usb_ioctl command;
>    int ret;
>    command.ifno = interface;
>    command.ioctl_code = IOCTL_USB_DISCONNECT;
>    command.data = NULL;
>    ret = ioctl(dev->fd, IOCTL_USB_IOCTL, &command);
>    if (ret)
>      USB_ERROR_STR(-errno, "could not detach kernel driver from interface %d: 
> %s",
>          interface, strerror(errno));
>    return 0;
> }
> Short of being able to trace exactly why the driver is rejecting
> the IOCTL, the usual procedure is to play around with the call
> (when it's called, what parameters it has), and see if one can
> stumble on a combination that works :-(

Ok, I have good news. With help from our kernel hacker, I've check why
it wasn't working and it was a problem on my end, since I didn't apply
your patch correctly (I forgot to replace  (p->usbh, iface) with
(p->usbh, 0)).

So, it now works fine with our patch (correctly applied ;) and my udev
rules workaround is no longer needed (as well as the kernel patch
which got merged yesterday ;)

Frederic Crozat

Other related posts: