History log of /freebsd-9.3-release/sys/kern/tty_compat.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 201532 04-Jan-2010 ed

Make TIOCSTI work again.

It looks like I didn't implement this when I imported MPSAFE TTY.
Applications like mail(1) still use this. I think it's conceptually bad.

Tested by: Pete French <petefrench ticketswitch com>
MFC after: 2 weeks


# 182763 04-Sep-2008 ed

Fix an awful bug inside our COMPAT_43TTY code.

When I migrated tty_compat.c to MPSAFE TTY, I just hooked it up to the
build and fixed it until it compiled and somewhat worked. It turns out
this was not the smartest thing, because the old TTY layer also had a
field called t_flags, which contained a set of sgtty flags.

This means our current COMPAT_43TTY code overwrites the TTY flags,
causing all strange problems to occur. Fix this code to use a new struct
member called t_compatflags. This commit may cause kern/127054 to be
fixed, but this still has to be tested/confirmed by the originator. It
has to be fixed anyway.

PR: kern/127054


# 181905 20-Aug-2008 ed

Integrate the new MPSAFE TTY layer to the FreeBSD operating system.

The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:

- Improved driver model:

The old TTY layer has a driver model that is not abstract enough to
make it friendly to use. A good example is the output path, where the
device drivers directly access the output buffers. This means that an
in-kernel PPP implementation must always convert network buffers into
TTY buffers.

If a PPP implementation would be built on top of the new TTY layer
(still needs a hooks layer, though), it would allow the PPP
implementation to directly hand the data to the TTY driver.

- Improved hotplugging:

With the old TTY layer, it isn't entirely safe to destroy TTY's from
the system. This implementation has a two-step destructing design,
where the driver first abandons the TTY. After all threads have left
the TTY, the TTY layer calls a routine in the driver, which can be
used to free resources (unit numbers, etc).

The pts(4) driver also implements this feature, which means
posix_openpt() will now return PTY's that are created on the fly.

- Improved performance:

One of the major improvements is the per-TTY mutex, which is expected
to improve scalability when compared to the old Giant locking.
Another change is the unbuffered copying to userspace, which is both
used on TTY device nodes and PTY masters.

Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.

Obtained from: //depot/projects/mpsafetty/...
Approved by: philip (ex-mentor)
Discussed: on the lists, at BSDCan, at the DevSummit
Sponsored by: Snow B.V., the Netherlands
dcons(4) fixed by: kan


# 154170 10-Jan-2006 phk

Move the old BSD4.3 tty compatibility from (!BURN_BRIDGES && COMPAT_43)
to COMPAT_43TTY.

Add COMPAT_43TTY to NOTES and */conf/GENERIC

Compile tty_compat.c only under the new option.

Spit out
#warning "Old BSD tty API used, please upgrade."
if ioctl_compat.h gets #included from userland.


# 151386 16-Oct-2005 phk

Make ttsetcompat() static


# 130892 21-Jun-2004 phk

Put the pre FreeBSD-2.x tty compat code under BURN_BRIDGES.


# 130840 21-Jun-2004 phk

New style functions, kill register keyword.


# 130344 11-Jun-2004 phk

Deorbit COMPAT_SUNOS.

We inherited this from the sparc32 port of BSD4.4-Lite1. We have neither
a sparc32 port nor a SunOS4.x compatibility desire these days.


# 129035 07-May-2004 cognet

Compare t_brkc against (char)_POSIX_VDISABLE, not against -1.

Discussed with: bde


# 127911 05-Apr-2004 imp

Remove advertising clause from University of California Regent's license,
per letter dated July 22, 1999.

Approved by: core


# 116182 10-Jun-2003 obrien

Use __FBSDID().


# 93076 24-Mar-2002 bde

Fixed some style bugs in the removal of __P(()). The main ones were
not removing tabs before "__P((", and not outdenting continuation lines
to preserve non-KNF lining up of code with parentheses. Switch to KNF
formatting and/or rewrap the whole prototype in some cases.


# 92723 19-Mar-2002 alfred

Remove __P.


# 50477 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 36735 07-Jun-1998 dfr

This commit fixes various 64bit portability problems required for
FreeBSD/alpha. The most significant item is to change the command
argument to ioctl functions from int to u_long. This change brings us
inline with various other BSD versions. Driver writers may like to
use (__FreeBSD_version == 300003) to detect this change.

The prototype FreeBSD/alpha machdep will follow in a couple of days
time.


# 33825 25-Feb-1998 bde

Don't depend on "implicit int".


# 32773 25-Jan-1998 steve

Fix a couple of operator precedence bugs.

PR: 5450
Submitted by: Sakari Jalovaara <sja@tekla.fi>


# 31778 16-Dec-1997 eivind

Make COMPAT_43 and COMPAT_SUNOS new-style options.


# 31577 06-Dec-1997 bde

Use ENOIOCTL instead of -1 (= ERESTART) for tty ioctls that are
not handled at a particular level. This fixes mainly restarting
of interrupted TIOCDRAINs and TIOCSETA{W,F}s.


# 27845 02-Aug-1997 bde

Removed unused #includes.


# 24207 24-Mar-1997 bde

Don't include <sys/ioctl.h> in the kernel. Stage 5: include
<sys/ioctl_compat.h> and sometimes <sys/filio.h> instead of
<sys/ioctl.h> in tty-related files. <sys/ttycom.h> is still
usually imported bogusly via <sys/termios.h>.


# 22975 22-Feb-1997 peter

Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not
ready for it yet.


# 21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 12819 14-Dec-1995 phk

A Major staticize sweep. Generates a couple of warnings that I'll deal
with later.
A number of unused vars removed.
A number of unused procs removed or #ifdefed.


# 12370 18-Nov-1995 bde

Improved formatting.

Added a comment about possibly better handling of INPCK.

Added a prototype.


# 9861 02-Aug-1995 ache

Preserve current termios speed for TIOCSET*, if it matched with
nearest valid. It means that gtty+stty transaction (without speed
change) not breaks non-standard speeds now.


# 9859 02-Aug-1995 ache

Better approximation for TIOCGETP (gtty) for non-standard speeds.
Old variant returns 38400 for them, now it returns nearest matched
rounded down, expect speeds in range 0 > speed < 50 rounded up
to not produce hangup.


# 9851 02-Aug-1995 ache

Check for valid speed values in pty drive
Check for negative speed values in tty drive
Back out valid speed values checking from tty drive
Suggested by: bde


# 9847 01-Aug-1995 ache

Check for valid speeds in TIOCSET* and return EINVAL for incorrect
values instead of setting garbadge.


# 8876 30-May-1995 rgrimes

Remove trailing whitespace.


# 7758 11-Apr-1995 ache

Extract "set" family functions to separate module, needed for
locking in sio f.e.


# 7594 02-Apr-1995 ache

Back out changes related to locked bits until more elegant solution will be
found. Fix flags declarations.


# 7582 02-Apr-1995 ache

Fix error in TIOCSETC/TIOCSLTC, they need to call TIOCSETA.
Remove static from some functions, needed in sio (later)


# 7581 02-Apr-1995 ache

Return EINVAL instead of setting wrong in/out speed
Fix declaration of cc arrays
Remove static from compatspcodes, will needed in sio (later)


# 7472 29-Mar-1995 ache

c_iflag handling in setting compat modes now more close to V7


# 3510 11-Oct-1994 ache

Better IXANY/IXOFF processing into setflags.
Cosmetique 'tab' fix


# 3509 11-Oct-1994 ache

Fix old cs8->cs7 bug, bringed by rlogin.
Obtained from: FreeBSD 1.x


# 3441 08-Oct-1994 phk

Cosmetics: added ()'s and fixed prinf-formats to make gcc silent.


# 2271 25-Aug-1994 bde

Support speeds 57600 and 115200.
Privatize functions.


# 1817 02-Aug-1994 dg

Added $Id$


# 1549 25-May-1994 rgrimes

The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.

Reviewed by: Rodney W. Grimes
Submitted by: John Dyson and David Greenman


# 1542 24-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1541,
which included commits to RCS files with non-trunk default branches.


# 1541 24-May-1994 rgrimes

BSD 4.4 Lite Kernel Sources