Deleted Added
full compact
ng_tty.c (87599) ng_tty.c (90227)
1
2/*
3 * ng_tty.c
4 *
5 * Copyright (c) 1996-1999 Whistle Communications, Inc.
6 * All rights reserved.
7 *
8 * Subject to the following obligations and disclaimer of warranty, use and

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

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

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

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

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

417 break;
418 if ((sc->qhead = m->m_nextpkt) == NULL)
419 sc->qtail = &sc->qhead;
420 sc->qlen--;
421 QUEUECHECK(sc);
422
423 /* Send as much of it as possible */
424 while (m) {
40 * $Whistle: ng_tty.c,v 1.21 1999/11/01 09:24:52 julian Exp $
41 */
42
43/*
44 * This file implements a terminal line discipline that is also a
45 * netgraph node. Installing this line discipline on a terminal device
46 * instantiates a new netgraph node of this type, which allows access
47 * to the device via the "hook" hook of the node.

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

417 break;
418 if ((sc->qhead = m->m_nextpkt) == NULL)
419 sc->qtail = &sc->qhead;
420 sc->qlen--;
421 QUEUECHECK(sc);
422
423 /* Send as much of it as possible */
424 while (m) {
425 struct mbuf *m2;
426 int sent;
427
428 sent = m->m_len
429 - b_to_q(mtod(m, u_char *), m->m_len, &tp->t_outq);
430 m->m_data += sent;
431 m->m_len -= sent;
432 if (m->m_len > 0)
433 break; /* device can't take no more */
425 int sent;
426
427 sent = m->m_len
428 - b_to_q(mtod(m, u_char *), m->m_len, &tp->t_outq);
429 m->m_data += sent;
430 m->m_len -= sent;
431 if (m->m_len > 0)
432 break; /* device can't take no more */
434 MFREE(m, m2);
435 m = m2;
433 m = m_free(m);
436 }
437
438 /* Put remainder of mbuf chain (if any) back on queue */
439 if (m) {
440 m->m_nextpkt = sc->qhead;
441 sc->qhead = m;
442 if (sc->qtail == &sc->qhead)
443 sc->qtail = &m->m_nextpkt;

--- 246 unchanged lines hidden ---
434 }
435
436 /* Put remainder of mbuf chain (if any) back on queue */
437 if (m) {
438 m->m_nextpkt = sc->qhead;
439 sc->qhead = m;
440 if (sc->qtail == &sc->qhead)
441 sc->qtail = &m->m_nextpkt;

--- 246 unchanged lines hidden ---