Re: Detach USB Device Driver and Attach it to ugen driver at runtime

2011-09-06 Thread Hans Petter Selasky
On Tuesday 06 September 2011 03:53:55 Daniel O'Connor wrote:
 On 05/09/2011, at 23:10, 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.
 
 You can access the device via ugen even if a kernel driver has attached to
 it.
 
 I suspect you wouldn't be able to if the kernel driver that did attach is
 in use, but I am not sure.

You can attach even if a kernel driver is attached, though it is best to only 
have one driver attached at the same time.

--HPS
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Detach USB Device Driver and Attach it to ugen driver at runtime

2011-09-05 Thread Daniel Grech
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.
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Detach USB Device Driver and Attach it to ugen driver at runtime

2011-09-05 Thread Hans Petter Selasky
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
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Detach USB Device Driver and Attach it to ugen driver at runtime

2011-09-05 Thread Daniel O'Connor

On 05/09/2011, at 23:10, 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.

You can access the device via ugen even if a kernel driver has attached to it.

I suspect you wouldn't be able to if the kernel driver that did attach is in 
use, but I am not sure.

--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
The nice thing about standards is that there
are so many of them to choose from.
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C






___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org