Re: Disconnect of USB Serial device not notifyingapplication

"Dale Martenson" <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <1CD05B980C94AC408B37C82BBABAA3E607DFD25D@mtsexchange.dc.multitech.prv>
On Wednesday, August 15, 2007 9:45 PM, "Pete Zaitcev" wrote:

> On Wed, 15 Aug 2007 21:15:13 -0500, "Dale Martenson"
<[email protected]> wrote:
> 
> > The new MT9234ZBA-USB modem uses the ti_usb_3410_5052 driver which
> > relies on usb-serial. If you remove the USB cable when using this
> > driver, the application remains running and does not realize that
the
> > device is now gone. This was tested on 2.6.9, which I realize is an
old
> > release in kernel years, but it is not clear to me that there have
been
> > any changes which might effect this.
> 
> This is what tty_hangup() does, but it was implemented in 2.6.9.
> It may be just a bug with the order of zeroing for pointers.
> There was a fair amount of code shifting since then around those
> "if (port->tty)". Can you give it a new try to a more recent kernel?

Pete, Thanks! That is exactly what I was looking for. 

Yes, I wish the customer could move to a more recent kernel version, but
they say they can't.

I add a ti_usb_disconnect routine to the ti_usb_3410_5052 driver which
handled the tty_hangup call.

void ti_usb_disconnect(struct usb_interface *interface)
{
	int i;
	struct usb_serial *serial = usb_get_intfdata (interface);
	struct usb_serial_port *port;

	dbg ("%s", __FUNCTION__);

	if (serial) {
		for (i = 0; i < serial->num_ports; ++i) {
			port = serial->port[i];
			if (port && port->tty)
				tty_hangup(port->tty);
		}
	}
	usb_serial_disconnect( interface );
}

Al, I will mark the version as 1.2.1 and give it to the customer. 

--Dale

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.