I sent this message off a week ago (June 8th) and received no reply. Looks like
the mailing list is being spammed, so I suppose it could've been missed.

My concern is: What happens when a user process has a USB serial device (e.g.
/dev/ttyUSB0) open and the USB cable is unplugged. Right now, the process
receives no signal, no EIO from the read() or select(), and has no means of
identifying that the hardware connection is gone.

Furthermore, when the cable is plugged back in, the system allocates
/dev/ttyUSB1 for its use as long as the process still has ttyUSB0 opened.

Is there any way I can identify when a USB cable is unplugged within the
process, without using an external watchdog program that monitors sysfs?

Thanks,
 -Byron

--
Byron Stanoszek                         Ph: (330) 644-3059
Systems Programmer                      Fax: (330) 644-8110
Commercial Timesharing Inc.             Email: [EMAIL PROTECTED]


---------- Forwarded message ---------- Date: Tue, 8 Jun 2004 11:49:51 -0400 (EDT) From: Byron Stanoszek <[EMAIL PROTECTED]> To: [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: Behavior of serial usb driver when unplugged

Hi all,

I'm currently using Linux (2.6.7-rc3) in an embedded system with a 8-port
Sealevel SeaLink 2802 USB device. This is a 8-port RS-232/422 device that
allocates /dev/ttyUSB0 through /dev/ttyUSB7 when plugged in.

If I have a process talking to one of the ports, e.g. 'cat < /dev/ttyUSB0', and
I unplug the USB hub, all ports except ttyUSB0 unregister properly.

Without killing the 'cat' process, plugging the hub back in will make it
allocate /dev/ttyUSB1 through /dev/ttyUSB8, thereby offsetting each USB port#
by 1.

When killing the 'cat' process at this point, the kernel reports:

drivers/usb/serial/ftdi_sio.c: error from flowcontrol urb
drivers/usb/serial/ftdi_sio.c: Error from DTR LOW urb
drivers/usb/serial/ftdi_sio.c: Error from RTS LOW urb

and then unregisters /dev/ttyUSB0.


Is there a way to allow "hotplug" of a USB device to reuse /dev/ttyUSB0 regardless if an application still has that particular tty open?

If not, is there a way I could make the serial subsystem can send an EIO errno
or some other notification when the serial device is disconnected?

Thanks for your help,
 -Byron



-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to