Re: usbfs, claiming entire usb devices

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

 



On Sun, 3 May 2009, Pantelis Koukousoulas wrote:

> Hi,
> 
> > It has not been worked on.  There was a lot of discussion, and we sort
> > of reached a consensus about what was needed, but no patches have been
> > posted.
> 
> Could you please point me towards / inform me about what was that consensus?
> I got lost in the various threads after a while :)

As I recall, it went something like this:

	There should be a mechanism for userspace to influence 
	automatic binding of the generic driver to USB devices.  If 
	a program wants to gain control a newly-detected device then 
	it can; otherwise the generic driver will handle it in the
	usual way.

	Also, there should be some way for a user program to take
	control of an existing device.

	When a user program gains control of a device, the kernel
	won't automatically install any configuration and won't probe 
	for drivers when the config is changed.  Instead the user
	program is granted full control over all the interfaces.  It
	can do Set-Config or Reset whenever it wants.

	Other programs will be allowed to do harmless input via usbfs
	(like reading the descriptors from the device file) but not any 
	ioctls.  And nobody will be allowed to write to the 
	bConfigurationValue sysfs attribute.

	When the user program gives up control of a device, the kernel
	won't automatically issue any Set-Interface requests (I'm
	not sure this is really a good idea).  It also won't change the 
	configuration or automatically probe for interface drivers.

This doesn't answer all the remaining questions, but it is a start.

> >> P.S., note that it would be fine for my usecase if the user has to
> >> unplug the device, turn it off even
> >> and replug it after the port is "grabbed" to make sure the device is
> >> in a clean state.
> Surely the goal is to "grab" devices. But since these grabs must persist across
> resets/disconnects/reconnects we would effectively grab "ports", right?

No, I don't think so.  It doesn't make sense to grab a port.  Instead 
we would allow the program to intercept all new device registrations 
somehow and decide whether or not to take control of the device.

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