"Luiz Fernando N. Capitulino" <[EMAIL PROTECTED]> writes:
>  Hi Sergei,
>
> On Wed, 12 Jul 2006 15:42:14 +0400
> Sergei Organov <[EMAIL PROTECTED]> wrote:
>
> | Suppose I have a usb-serial device managed, say, by the airprime
> | driver. When I connect it, it is attached to the /dev/ttyUSB0, then,
> | every disconnect/connect results in detaching from /dev/ttyUSB0 and
> | attaching back to /dev/ttyUSB0 *unless* there is an application that
> | keeps an opened fd got from open("/dev/ttyUSB0") while
> | disconnect/connect happens, in which case the device is attached to
> | /dev/ttyUSB1.
> | 
> | It's OK that the application keeping the fd open can do nothing sensible
> | with it after corresponding device has been disconnected (and connected
> | back), but can the /dev/ttyUSB0 itself be freed for allocation at
> | disconnect time? Is there something fundamental that prevents it or
> | makes it undesirable?
>
>  It seems to me that the current implementation is the easier way
> to do it.

Probably, but the easiest is not necessary the right one, as we all
know.

> Note that we don't only freed the port-related memory, we have also
> to unregister the tty interface.

To get the naming I described we hopefully need to unregister the tty
interface only. Port memory, URBs, etc., could be freed at close() time
as it is now, I think. One of tricky things is if it's possible to
achieve without excessive modifications of all the usb-serial
drivers. If tty layer supports some "detach" functionality, it could be
easy to achieve, -- just detach tty at disconnect time and then later
free the structure at close time. It seems I need to take a closer look
at all this.

-- 
Sergei.


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to