Thomas Sailer wrote:
>
> Johannes Erdfelt wrote:
>
> > I actually partially implemented a patch to create seperate nodes for
> > each endpoint on device through devfs obviating the need for using
> > ioctl's like this. I only got control working, but if there's interest,
> > I'll finish it.
At this point I'm not really keen on that approach.
I don't see enough benefit there to merit a change.
> I thought about this too, but:
>
> 1) It doesn't solve Viro's raves about ioctl's, as the main cause
> for the ioctl's is the inherent structure in the USB transactions
> that isn't easily mapped to a stream of bytes
The ioctls get wrapped in code that looks more reasonable,
and nobody ever sees them again. They're just syntax,
so long as there's no endless growth of them.
It is indeed nasty, but if you compare that to adding new
system calls it looks less so.
They do make a certain type of "simple" thing get hard
though -- talking to devices that treat USB exactly like
a serial cable, sending all data over two bulk (in/out)
endpoints. Like a socket on the filesystem. In other
cases, I don't think the ioctls affect complexity much.
> 2) Gives you atomicity problems.
> Assume a program needs two endpoints, it opens the first,
> then sleeps for whatever reason, in the mean time the
> device gets unplugged and a new device plugged in which
> gets the same device number, then the program wakes up
> and opens the second ep, which will now be an ep of
> the new device.
The flaw there is relying on an unstable mechanism (USB
addresses) in the core of a partially logical (usermode)
naming scheme that is implicitly stable (relationship
between the two endpoint FD names).
The names don't need to relate to USB addresses at all.
They _could_ start at 'a' and count up, with 'ZZZZZZ' as
only an intermediate point, each new device getting a
new name that's never been used before.
- Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]