Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: USB scanners and PR 50340



On Fri, 18 Mar 2016, Gary Duzan wrote:
=>Dave Tyson <dtyson%anduin.org.uk@localhost> writes:
=>
=>> I note that PR 50340 has been closed and with the latest pkgsrc
=>>under current (amd64) my Mustek 1200 UB scanner seems to work OK
=>>- but I have comment out the uscanner device in the kernel and use
=>>it as a ugen device. It seems that this is the 'new world order'
=>>and the sane backend code to handle uscanner devices is deprecated.
=>>Given this is the case is there any point in still keeping the
=>>
=>> uscanner* at uhub? port ?
=>>
=>> in GENERIC?
=>
=>Quite possibly we should remove (comment out) uscanner in GENERIC.
=>ulpt is more controversial, but cups wants to use libusb too.
=>
=>> I am of the same opinion as the PR originator that it is easier
=>>to control access permissions with a uscanner device rather than
=>>having to open up a whole raft of ugen devices, but I guess the
=>>sane developers feel that using libusb makes support easier...
=>
=>Perhaps if we had something called uscanner that would match scanners
=>and that libusb would fine, we could have the permissions management of
=>direct matching but the cope-with-the-rest-of-the-world benefit of
=>libusb.

  Can we not build some sort of bus-like device to which both the
specialized and generic devices can attach which prevents opening
both at the same time?

An alternative is to have a method to detach the kernel driver so that you can revert to ugen access (and probably method to reattach too). This is true for all usb devices (e.g. uvideo, umass, etc.). libusb has the following API, but we don't have the kernel support for it.


int libusb_kernel_driver_active (libusb_device_handle *dev, int interface_number)
 	Determine if a kernel driver is active on an interface.

int libusb_detach_kernel_driver (libusb_device_handle *dev, int interface_number)
 	Detach a kernel driver from an interface.

int libusb_attach_kernel_driver (libusb_device_handle *dev, int interface_number) Re-attach an interface's kernel driver, which was previously detached using libusb_detach_kernel_driver().

int libusb_set_auto_detach_kernel_driver (libusb_device_handle *dev, int enable)

Being able to detach kernel drivers would allow for USB remoting (e.g. http://usbip.sourceforge.net/ or Citrix Receiver). It would aid development of drivers with rump too.

--
Stephen



Home | Main Index | Thread Index | Old Index