summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1995-07-29 13:40:13 +0000
committerbde <bde@FreeBSD.org>1995-07-29 13:40:13 +0000
commit14ed6d3cb408b96bbf946287814b3a0d8be13a42 (patch)
tree240af9291d5034b8a6fc1ffc02892d0c35a79f52
parent7d793609e88f56616024a50a7086c0f13fd3dade (diff)
downloadFreeBSD-src-14ed6d3cb408b96bbf946287814b3a0d8be13a42.zip
FreeBSD-src-14ed6d3cb408b96bbf946287814b3a0d8be13a42.tar.gz
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.
-rw-r--r--sys/kern/tty.c25
-rw-r--r--sys/kern/tty_conf.c10
-rw-r--r--sys/net/if_ppp.c4
-rw-r--r--sys/net/if_sl.c4
-rw-r--r--sys/sys/tty.h3
5 files changed, 11 insertions, 35 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index b063ef9..c59aaca 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -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 $
*/
/*-
@@ -1299,29 +1299,6 @@ ttymodem(tp, flag)
}
/*
- * 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().
*/
diff --git a/sys/kern/tty_conf.c b/sys/kern/tty_conf.c
index c2acc9b..608c259 100644
--- a/sys/kern/tty_conf.c
+++ b/sys/kern/tty_conf.c
@@ -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
diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c
index 236d5ad..e9d5e65 100644
--- a/sys/net/if_ppp.c
+++ b/sys/net/if_ppp.c
@@ -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 *));
diff --git a/sys/net/if_sl.c b/sys/net/if_sl.c
index 4f5e6b7..d73cca3 100644
--- a/sys/net/if_sl.c
+++ b/sys/net/if_sl.c
@@ -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.
diff --git a/sys/sys/tty.h b/sys/sys/tty.h
index fb6a278..c3843f4 100644
--- a/sys/sys/tty.h
+++ b/sys/sys/tty.h
@@ -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));
OpenPOWER on IntegriCloud