Adapt to the new line discipline scheme.

This commit is contained in:
itohy 2000-11-02 11:00:53 +00:00
parent c070a07602
commit 486a58959c
3 changed files with 11 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: tty_43.c,v 1.10 2000/03/30 11:27:14 augustss Exp $ */
/* $NetBSD: tty_43.c,v 1.11 2000/11/02 11:00:54 itohy Exp $ */
/*-
* Copyright (c) 1982, 1986, 1991, 1993
@ -42,6 +42,7 @@
#include <sys/systm.h>
#include <sys/ioctl.h>
#include <sys/proc.h>
#include <sys/conf.h>
#include <sys/tty.h>
#include <sys/termios.h>
#include <sys/file.h>
@ -224,7 +225,7 @@ ttcompat(tp, com, data, flag, p)
break;
case OTIOCGETD:
*(int *)data = tp->t_line ? tp->t_line : 2;
*(int *)data = tp->t_linesw ? tp->t_linesw->l_no : 2;
break;
case OTIOCSETD: {

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_sl.c,v 1.58 2000/07/12 23:02:38 thorpej Exp $ */
/* $NetBSD: if_sl.c,v 1.59 2000/11/02 11:00:53 itohy Exp $ */
/*
* Copyright (c) 1987, 1989, 1992, 1993
@ -81,6 +81,7 @@
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/file.h>
#include <sys/conf.h>
#include <sys/tty.h>
#include <sys/kernel.h>
#if __NetBSD__
@ -263,7 +264,7 @@ slopen(dev, tp)
if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
return (error);
if (tp->t_line == SLIPDISC)
if (tp->t_linesw && (tp->t_linesw->l_no == SLIPDISC))
return (0);
for (nsl = NSL, sc = sl_softc; --nsl >= 0; sc++)
@ -319,7 +320,7 @@ slclose(tp)
ttywflush(tp);
s = splimp(); /* actually, max(spltty, splsoftnet) */
tp->t_line = 0;
tp->t_linesw = NULL;
tp->t_state = 0;
sc = (struct sl_softc *)tp->t_sc;
if (sc != NULL) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_strip.c,v 1.20 2000/10/02 03:51:18 itojun Exp $ */
/* $NetBSD: if_strip.c,v 1.21 2000/11/02 11:00:53 itohy Exp $ */
/* from: NetBSD: if_sl.c,v 1.38 1996/02/13 22:00:23 christos Exp $ */
/*
@ -107,6 +107,7 @@
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/file.h>
#include <sys/conf.h>
#include <sys/tty.h>
#include <sys/kernel.h>
#if __NetBSD__
@ -450,7 +451,7 @@ stripopen(dev, tp)
if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
return (error);
if (tp->t_line == STRIPDISC)
if (tp->t_linesw && (tp->t_linesw->l_no == SLIPDISC))
return (0);
for (nstrip = NSTRIP, sc = strip_softc; --nstrip >= 0; sc++) {
@ -515,7 +516,7 @@ stripclose(tp)
ttywflush(tp);
s = splimp(); /* actually, max(spltty, splsoftnet) */
tp->t_line = 0;
tp->t_linesw = NULL;
sc = (struct strip_softc *)tp->t_sc;
if (sc != NULL) {
/*