Re: [Libusb-devel] Two usbfs users can claim the same interface

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

 



On Fri, 2 Oct 2009, Tim Roberts wrote:

> > The initial problem was that it isn't possible (with current libusb) to
> > claim an interface that is unused by a user space program but is in use
> > by a kernel driver (neither libusb_kernel_driver_active() or
> > libusb_claim_interface() can distinguish between userspace and kernel
> > users).  This is solved by a simple libusb change.
> >   
> 
> How would you do that?  Maybe I missed that in the discussion.  A
> user-mode claim is just an ioctl that makes a kernel-mode claim.  How
> can anyone -- either UM or KM -- tell the difference between an
> interface that is claimed by a UM client via usbfs, and an interface
> that is claimed by another KM driver?

David's suggested approach was to have libusb check the current owner
before attempting to claim an interface.  If the current owner was 
"usbfs", libusb would return an error instead of carrying out the 
claim_interface ioctl.

Of course, this approach is subject to a race.  The ownership may 
change inbetween the check and the claim.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux