diff options
author | bde <bde@FreeBSD.org> | 1995-07-31 21:02:00 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1995-07-31 21:02:00 +0000 |
commit | 6161be8527d8436daf7da9ba9caf28dd75239974 (patch) | |
tree | 6db12c5f3b7deb883374e9daa21609a9e76eaa85 /sys/i386/isa/pcvt/pcvt_drv.c | |
parent | fc2f9d98283b5feb3a2c1173667335cdc22e809b (diff) | |
download | FreeBSD-src-6161be8527d8436daf7da9ba9caf28dd75239974.zip FreeBSD-src-6161be8527d8436daf7da9ba9caf28dd75239974.tar.gz |
Obtained from: partly from ancient patches of mine via 1.1.5
Introduce TS_CONNECTED and TS_ZOMBIE states. TS_CONNECTED is set
while a connection is established. It is set while (TS_CARR_ON or
CLOCAL is set) and TS_ZOMBIE is clear. TS_ZOMBIE is set for on to
off transitions of TS_CARR_ON that occur when CLOCAL is clear and
is cleared for off to on transitions of CLOCAL. I/o can only occur
while TS_CONNECTED is set. TS_ZOMBIE prevents further i/o.
Split the input-event sleep address TSA_CARR_ON(tp) into TSA_CARR_ON(tp)
and TSA_HUP_OR_INPUT(tp). The former address is now used only for
off to on carrier transitions and equivalent CLOCAL transitions.
The latter is used for all input events, all carrier transitions
and certain CLOCAL transitions. There are some harmless extra
wakeups for rare connection- related events. Previously there were
too many extra wakeups for non-rare input events.
Drivers now call l_modem() instead of setting TS_CARR_ON directly
to handle even the initial off to on transition of carrier. They
should always have done this. l_modem() now handles TS_CONNECTED
and TS_ZOMBIE as well as TS_CARR_ON.
gnu/isdn/iitty.c:
Set TS_CONNECTED for first open ourself to go with bogusly setting
CLOCAL.
i386/isa/syscons.c, i386/isa/pcvt/pcvt_drv.c:
We fake carrier, so don't also fake CLOCAL.
kern/tty.c:
Testing TS_CONNECTED instead of TS_CARR_ON fixes TIOCCONS forgetting to
test CLOCAL. TS_ISOPEN was tested instead, but that broke when we disabled
the clearing of TS_ISOPEN for certain transitions of CLOCAL.
Testing TS_CONNECTED fixes ttyselect() returning false success for output
to devices in state !TS_CARR_ON && !CLOCAL.
Optimize the other selwakeup() call (this is not related to the other
changes).
kern/tty_pty.c:
ptcopen() can be declared in traditional C now that dev_t isn't short.
Diffstat (limited to 'sys/i386/isa/pcvt/pcvt_drv.c')
-rw-r--r-- | sys/i386/isa/pcvt/pcvt_drv.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/i386/isa/pcvt/pcvt_drv.c b/sys/i386/isa/pcvt/pcvt_drv.c index a8d6c98..d9b69dc 100644 --- a/sys/i386/isa/pcvt/pcvt_drv.c +++ b/sys/i386/isa/pcvt/pcvt_drv.c @@ -433,16 +433,12 @@ pcopen(Dev_t dev, int flag, int mode, struct proc *p) tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED; pcparam(tp, &tp->t_termios); ttsetwater(tp); + (*linesw[tp->t_line].l_modem)(tp, 1); /* fake connection */ + winsz = 1; /* set winsize later */ } else if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0) return (EBUSY); - tp->t_state |= TS_CARR_ON; - tp->t_cflag |= CLOCAL; /* cannot be a modem (:-) */ - - if ((tp->t_state & TS_ISOPEN) == 0) /* is this a "cold" open ? */ - winsz = 1; /* yes, set winsize later */ - #if PCVT_NETBSD || (PCVT_FREEBSD >= 200) retval = ((*linesw[tp->t_line].l_open)(dev, tp)); #else |