Deleted Added
full compact
ng_tty.c (140164) ng_tty.c (151085)
1/*
2 * ng_tty.c
3 */
4
5/*-
6 * Copyright (c) 1996-1999 Whistle Communications, Inc.
7 * All rights reserved.
8 *

--- 23 unchanged lines hidden (view full) ---

32 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
36 * OF SUCH DAMAGE.
37 *
38 * Author: Archie Cobbs <archie@freebsd.org>
39 *
1/*
2 * ng_tty.c
3 */
4
5/*-
6 * Copyright (c) 1996-1999 Whistle Communications, Inc.
7 * All rights reserved.
8 *

--- 23 unchanged lines hidden (view full) ---

32 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
36 * OF SUCH DAMAGE.
37 *
38 * Author: Archie Cobbs <archie@freebsd.org>
39 *
40 * $FreeBSD: head/sys/netgraph/ng_tty.c 140164 2005-01-13 07:43:12Z glebius $
40 * $FreeBSD: head/sys/netgraph/ng_tty.c 151085 2005-10-08 11:03:29Z tanimura $
41 * $Whistle: ng_tty.c,v 1.21 1999/11/01 09:24:52 julian Exp $
42 */
43
44/*
45 * This file implements a terminal line discipline that is also a
46 * netgraph node. Installing this line discipline on a terminal device
47 * instantiates a new netgraph node of this type, which allows access
48 * to the device via the "hook" hook of the node.

--- 277 unchanged lines hidden (view full) ---

326 * a time, which is kindof silly.
327 *
328 * Full locking of softc is not required, since we are the only
329 * user of sc->m.
330 */
331static int
332ngt_input(int c, struct tty *tp)
333{
41 * $Whistle: ng_tty.c,v 1.21 1999/11/01 09:24:52 julian Exp $
42 */
43
44/*
45 * This file implements a terminal line discipline that is also a
46 * netgraph node. Installing this line discipline on a terminal device
47 * instantiates a new netgraph node of this type, which allows access
48 * to the device via the "hook" hook of the node.

--- 277 unchanged lines hidden (view full) ---

326 * a time, which is kindof silly.
327 *
328 * Full locking of softc is not required, since we are the only
329 * user of sc->m.
330 */
331static int
332ngt_input(int c, struct tty *tp)
333{
334 const sc_p sc = (sc_p) tp->t_lsc;
335 const node_p node = sc->node;
334 sc_p sc;
335 node_p node;
336 struct mbuf *m;
337 int error = 0;
338
336 struct mbuf *m;
337 int error = 0;
338
339 sc = (sc_p) tp->t_lsc;
339 if (sc == NULL)
340 /* No node attached */
341 return (0);
342
340 if (sc == NULL)
341 /* No node attached */
342 return (0);
343
344 node = sc->node;
345
343 if (tp != sc->tp)
344 panic("ngt_input");
345
346 /* Check for error conditions */
347 if ((tp->t_state & TS_CONNECTED) == 0) {
348 if (sc->flags & FLG_DEBUG)
349 log(LOG_DEBUG, "%s: no carrier\n", NG_NODE_NAME(node));
350 return (0);

--- 348 unchanged lines hidden ---
346 if (tp != sc->tp)
347 panic("ngt_input");
348
349 /* Check for error conditions */
350 if ((tp->t_state & TS_CONNECTED) == 0) {
351 if (sc->flags & FLG_DEBUG)
352 log(LOG_DEBUG, "%s: no carrier\n", NG_NODE_NAME(node));
353 return (0);

--- 348 unchanged lines hidden ---