Re: Check device use before detaching?

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

 



On Mon, Nov 18, 2013 at 07:10:45AM +0000, Luke-Jr wrote:
> On Monday, November 18, 2013 6:07:37 AM Greg KH wrote:
> > > I want my software to ignore devices that are already in use by other
> > > software. The "other software" might be accessing it via the kernel
> > > drivers, or perhaps libusb. My software (in this case) would be using
> > > libusb, and need to detach the kernel drivers to claim the interface -
> > > even if the kernel driver isn't currently in use.
> > 
> > What types of devices?
> 
> Just tty/serial devices (HID, VCOM, and CDC/ACM)

HID devices are not tty/serial devices, so I'm confused as to what you
want to do with them.

> > And no, there is no "general" way to determine this, sorry, it all
> > depends on the type of device, and for some of them, you really can't
> > tell (think about a keyboard, when is it "in use"?)
> 
> When X has it open?

X opens all input devices all the time, it never closes them.

> > > So, I want to detach the driver so I can use it myself, but only if some
> > > other software isn't already using it.
> > 
> > What will you do with the device?
> 
> Send it work to process, and get results back.

What type of work can you send a keyboard?

And why not just use the kernel interfaces to the device?  That way you
know it works properly with anything else that has opened it at the
time.

greg k-h
--
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