Re: usbfs, claiming entire usb devices

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

 



Am Donnerstag, 7. Mai 2009 18:29:08 schrieb Alan Stern:
> On Thu, 7 May 2009, Oliver Neukum wrote:
> > Am Donnerstag, 7. Mai 2009 16:46:11 schrieb Alan Stern:
> > > > I haven't yet given serious thought to the API, sorry (probably this
> > > > will happen next week)
> > >
> > > It isn't as simple as it might sound.  A program could simply write a
> > > hub name and port number to a file.  But what format should we use for
> > > the hub name?  And where should the file be located?  Maybe it would be
> > > easier if we used the hub's own usbfs device file.  But if a program
> > > wanted to claim ports on lots of hubs then it would have to open lots
> > > of files; is that likely to be an issue?
> >
> > If you want to get the ports back when the owner dies, you should use
> > an fd per port.
>
> Why?  Doesn't a single fd or an fd per hub accomplish the same thing?

If you use an fd for more than one port, user space won't be able to transfer
ownership. Unix has well thought out and tested facilities for handling
access to one resource encapsulated in one fd.

One fd per hub has the additional disadvantage of breaking symmetry.
It should not matter whether you want one port of two hubs or two ports
of one hub.

	Regards
		Oliver

--
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