Deleted Added
full compact
ng_tty.c (59728) ng_tty.c (65557)
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@whistle.com>
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@whistle.com>
38 *
39 * $FreeBSD: head/sys/netgraph/ng_tty.c 59728 2000-04-28 17:09:00Z julian $
39 * $FreeBSD: head/sys/netgraph/ng_tty.c 65557 2000-09-07 01:33:02Z jasone $
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.

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

72#include <sys/errno.h>
73#include <sys/ioccom.h>
74
75#include <netgraph/ng_message.h>
76#include <netgraph/netgraph.h>
77#include <netgraph/ng_tty.h>
78
79#ifdef __i386__ /* fiddle with the spl locking */
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.

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

72#include <sys/errno.h>
73#include <sys/ioccom.h>
74
75#include <netgraph/ng_message.h>
76#include <netgraph/netgraph.h>
77#include <netgraph/ng_tty.h>
78
79#ifdef __i386__ /* fiddle with the spl locking */
80#include <sys/bus.h>
80#include <machine/ipl.h>
81#include <i386/isa/intr_machdep.h>
82#endif
83
84/* Misc defs */
85#define MAX_MBUFQ 3 /* Max number of queued mbufs */
86#define NGT_HIWATER 400 /* High water mark on output */
87

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

655static int
656ngt_mod_event(module_t mod, int event, void *data)
657{
658 /* struct ng_type *const type = data;*/
659 int s, error = 0;
660
661 switch (event) {
662 case MOD_LOAD:
81#include <machine/ipl.h>
82#include <i386/isa/intr_machdep.h>
83#endif
84
85/* Misc defs */
86#define MAX_MBUFQ 3 /* Max number of queued mbufs */
87#define NGT_HIWATER 400 /* High water mark on output */
88

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

656static int
657ngt_mod_event(module_t mod, int event, void *data)
658{
659 /* struct ng_type *const type = data;*/
660 int s, error = 0;
661
662 switch (event) {
663 case MOD_LOAD:
663#ifdef __i386__
664 /* Insure the soft net "engine" can't run during spltty code */
665 s = splhigh();
666 tty_imask |= softnet_imask; /* spltty() block spl[soft]net() */
667 net_imask |= softtty_imask; /* splimp() block splsofttty() */
668 net_imask |= tty_imask; /* splimp() block spltty() */
669 update_intr_masks();
670 splx(s);
671
664
672 if (bootverbose)
673 log(LOG_DEBUG, "new masks: bio %x, tty %x, net %x\n",
674 bio_imask, tty_imask, net_imask);
675#endif
676
677 /* Register line discipline */
678 s = spltty();
679 if ((ngt_ldisc = ldisc_register(NETGRAPHDISC, &ngt_disc)) < 0) {
680 splx(s);
681 log(LOG_ERR, "%s: can't register line discipline",
682 __FUNCTION__);
683 return (EIO);
684 }

--- 18 unchanged lines hidden ---
665 /* Register line discipline */
666 s = spltty();
667 if ((ngt_ldisc = ldisc_register(NETGRAPHDISC, &ngt_disc)) < 0) {
668 splx(s);
669 log(LOG_ERR, "%s: can't register line discipline",
670 __FUNCTION__);
671 return (EIO);
672 }

--- 18 unchanged lines hidden ---