lkml.org 
[lkml]   [2009]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: usbfs, claiming entire usb devices
There is a proposal afoot to give user programs the ability to claim
ownership of an entire USB device, rather than just individual
interfaces. In fact, we'd like processes to be able to own whatever
device gets plugged into a particular port on a particular hub.

The question is how the API should work. A simple approach is to have
a sysfs or usbfs file correspond to each port; when a process opens the
file it would be granted ownership of any device plugged into that
port. Since the file is automatically closed when the process ends, we
wouldn't have to worry about ownership never getting released.

But there's a snag. When a process goes to open the usbfs file for a
device, the kernel needs to know whether or not the process owns that
device. In other words, we need to figure out whether or not the
process has opened the corresponding port file.

Is there a simple way to do this? Is it reasonable to search through
all the process's fd's, looking for one that matches a particular
inode?

Or would a completely different API approach be better?

Thanks,

Alan Stern



\
 
 \ /
  Last update: 2009-05-07 21:59    [W:0.037 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site