Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Sep 2011 15:41:41 +0200
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        freebsd-hackers@freebsd.org
Cc:        Daniel Grech <dgre090@gmail.com>
Subject:   Re: Detach USB Device Driver and Attach it to ugen driver at runtime
Message-ID:  <201109051541.41092.hselasky@c2i.net>
In-Reply-To: <CAG167sZd4WBSx--ukEb2RXKq0V0-DZJcMYt176bR1Y-snjkFaQ@mail.gmail.com>
References:  <CAG167sZd4WBSx--ukEb2RXKq0V0-DZJcMYt176bR1Y-snjkFaQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 05 September 2011 15:40:44 Daniel Grech wrote:
> Hi, I'm using libusb to gain access to raw USB Data from userspace. My
> problem is that this library only works with devices which are treated as
> generic devices ("handled by the ugen driver"). I need a mechanism that
> will allow me to detach any device specific drivers that are attached to a
> device and attach the ugen driver instead. I want to do this without
> re-compiling the FreeBSD Kernel. Thanks in advance for your help.

Hi,

The following functions should be implemented:

     int
     libusb20_dev_detach_kernel_driver(struct libusb20_device *pdev,
         uint8_t iface_index);


     int libusb_detach_kernel_driver(libusb_device_handle *devh, int
     interface) or int libusb_detach_kernel_driver_np(libusb_device_handle
     *devh, int interface) Detach a kernel driver from an interface.  This is
     needed to claim an interface required by a kernel driver.  Returns 0 on
     success, LIBUSB_ERROR_NOT_FOUND if no kernel driver was active,
     LIBUSB_ERROR_INVALID_PARAM if the interface does not exist,
     LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and a
     LIBUSB_ERROR code on failure. This function is non-portable.

man libusb20

man libusb

--HPS



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