Obtained from: partly from ancient patches by ache and me via 1.1.5
Remove nullmodem(). It may be useful to have a null modem routine, but nullmodem() wasn't one. nullmodem() was identical to ttymodem() except it didn't implement MDMBUF (carrier) flow control, didn't do any wakeups for off to on carrier transitions, and didn't flush the i/o queues for on to off carrier transitions (flushing has the side effect of waking up readers and writers) although it did generate SIGHUPs. The wakeups must normally be done even if nullmodem() is null in case something is sleeping waiting for a carrier transition. In any case, the wakeups should be harmless. They may cause bogus results for select(), but select() is already bogus for nonstandard line disciplines.
This commit is contained in:
parent
7d793609e8
commit
14ed6d3cb4
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)tty.c 8.8 (Berkeley) 1/21/94
|
||||
* $Id: tty.c,v 1.56 1995/07/22 01:30:31 bde Exp $
|
||||
* $Id: tty.c,v 1.57 1995/07/22 16:45:07 bde Exp $
|
||||
*/
|
||||
|
||||
/*-
|
||||
@ -1298,29 +1298,6 @@ ttymodem(tp, flag)
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Default modem control routine (for other line disciplines).
|
||||
* Return argument flag, to turn off device on carrier drop.
|
||||
*/
|
||||
int
|
||||
nullmodem(tp, flag)
|
||||
register struct tty *tp;
|
||||
int flag;
|
||||
{
|
||||
|
||||
if (flag)
|
||||
SET(tp->t_state, TS_CARR_ON);
|
||||
else {
|
||||
CLR(tp->t_state, TS_CARR_ON);
|
||||
if (!ISSET(tp->t_cflag, CLOCAL)) {
|
||||
if (tp->t_session && tp->t_session->s_leader)
|
||||
psignal(tp->t_session->s_leader, SIGHUP);
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Reinput pending characters after state switch
|
||||
* call at spltty().
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)tty_conf.c 8.4 (Berkeley) 1/21/94
|
||||
* $Id: tty_conf.c,v 1.5 1995/03/21 11:23:58 dufault Exp $
|
||||
* $Id: tty_conf.c,v 1.6 1995/05/30 08:06:10 rgrimes Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -62,7 +62,7 @@ int nullioctl __P((struct tty *tp, int cmd, caddr_t data,
|
||||
|
||||
#define NODISC(n) \
|
||||
{ ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl, \
|
||||
ttyerrinput, ttyerrstart, nullmodem },
|
||||
ttyerrinput, ttyerrstart, ttymodem },
|
||||
|
||||
struct linesw linesw[MAXLDISC] =
|
||||
{
|
||||
@ -70,14 +70,14 @@ struct linesw linesw[MAXLDISC] =
|
||||
ttyinput, ttstart, ttymodem }, /* 0- termios */
|
||||
|
||||
{ ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl,
|
||||
ttyerrinput, ttyerrstart, nullmodem }, /* 1- defunct */
|
||||
ttyerrinput, ttyerrstart, ttymodem }, /* 1- defunct */
|
||||
|
||||
#ifdef COMPAT_43
|
||||
{ ttyopen, ttylclose, ttread, ttwrite, nullioctl,
|
||||
ttyinput, ttstart, ttymodem }, /* 2- NTTYDISC */
|
||||
#else
|
||||
{ ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl,
|
||||
ttyerrinput, ttyerrstart, nullmodem },
|
||||
ttyerrinput, ttyerrstart, ttymodem },
|
||||
#endif
|
||||
|
||||
NODISC(3) /* TABLDISC */
|
||||
@ -98,7 +98,7 @@ static struct linesw nodisc =
|
||||
nullioctl,
|
||||
ttyerrinput,
|
||||
ttyerrstart,
|
||||
nullmodem
|
||||
ttymodem
|
||||
};
|
||||
|
||||
#define LOADABLE_LDISC 6
|
||||
|
@ -69,7 +69,7 @@
|
||||
* Paul Mackerras (paulus@cs.anu.edu.au).
|
||||
*/
|
||||
|
||||
/* $Id: if_ppp.c,v 1.15 1995/07/08 16:34:55 joerg Exp $ */
|
||||
/* $Id: if_ppp.c,v 1.16 1995/07/21 20:52:55 bde Exp $ */
|
||||
/* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */
|
||||
|
||||
#include "ppp.h"
|
||||
@ -146,7 +146,7 @@ int pppstart __P((struct tty *tp));
|
||||
|
||||
static struct linesw pppdisc = {
|
||||
pppopen, pppclose, pppread, pppwrite, ppptioctl,
|
||||
pppinput, pppstart, nullmodem
|
||||
pppinput, pppstart, ttymodem
|
||||
};
|
||||
|
||||
static int pppasyncstart __P((struct ppp_softc *));
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)if_sl.c 8.6 (Berkeley) 2/1/94
|
||||
* $Id: if_sl.c,v 1.25 1995/07/06 11:55:18 davidg Exp $
|
||||
* $Id: if_sl.c,v 1.26 1995/07/07 01:13:49 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -190,7 +190,7 @@ static timeout_t sl_outfill;
|
||||
|
||||
static struct linesw slipdisc =
|
||||
{ slopen, slclose, ttyerrio, ttyerrio, sltioctl,
|
||||
slinput, slstart, nullmodem };
|
||||
slinput, slstart, ttymodem };
|
||||
|
||||
/*
|
||||
* Called from boot code to establish sl interfaces.
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)tty.h 8.6 (Berkeley) 1/21/94
|
||||
* $Id: tty.h,v 1.23 1995/07/22 01:30:45 bde Exp $
|
||||
* $Id: tty.h,v 1.24 1995/07/22 16:45:22 bde Exp $
|
||||
*/
|
||||
|
||||
#ifndef _SYS_TTY_H_
|
||||
@ -225,7 +225,6 @@ int unputc __P((struct clist *q));
|
||||
int ttcompat __P((struct tty *tp, int com, caddr_t data, int flag));
|
||||
int ttsetcompat __P((struct tty *tp, int *com, caddr_t data, struct termios *term));
|
||||
|
||||
int nullmodem __P((struct tty *tp, int flag));
|
||||
void termioschars __P((struct termios *t));
|
||||
int tputchar __P((int c, struct tty *tp));
|
||||
int ttioctl __P((struct tty *tp, int com, void *data, int flag));
|
||||
|
Loading…
x
Reference in New Issue
Block a user