Re: reset_resume() for sierra driver

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

 



On Tue, 2 Feb 2010 15:12:38 +0100
Oliver Neukum <oliver@xxxxxxxxxx> wrote:

> Hi,
> 
> I am implementing reset_resume() in the sierra driver. It seems to me
> that the best way to do that would be to simulate a sudden loss of
> connection. To do so I need to know what a sierra device does if the
> connection simply vanishes. I want to feed emulated error messages
> to the tty layer to make NetworkManager deal nicely with this situation.

The tty layer hangs up a port that vanishes so you just need to do

	tty_hangup(tty)

where tty is a valid reference to the tty. The hangup occurs
*asynchronously* and it can thus be called from an IRQ - but you do need
to make sure you how have a valid refcounted tty handle.

In quite a few drivers that tends to look like

	tty = tty_port_tty_get(&mumble->port);
	if (tty)
		tty_hangup(tty);
	tty_kref_put(tty);

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