summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty_pty.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-09-25 16:21:39 +0000
committerphk <phk@FreeBSD.org>1999-09-25 16:21:39 +0000
commita2c68c62dba7acc1de5dd6a6141484d9c12844fe (patch)
treec55829a482e5222c5ae63cf589d4fd2a7ec13aec /sys/kern/tty_pty.c
parent869afb6bbe2f0a063d91bf2099b7121d2d03c1b2 (diff)
downloadFreeBSD-src-a2c68c62dba7acc1de5dd6a6141484d9c12844fe.zip
FreeBSD-src-a2c68c62dba7acc1de5dd6a6141484d9c12844fe.tar.gz
This patch clears the way for removing a number of tty related
fields in struct cdevsw: d_stop moved to struct tty. d_reset already unused. d_devtotty linkage now provided by dev_t->si_tty. These fields will be removed from struct cdevsw together with d_params and d_maxio Real Soon Now. The changes in this patch consist of: initialize dev->si_tty in *_open() initialize tty->t_stop remove devtotty functions rename ttpoll to ttypoll a few adjustments to these changes in the generic code a bump of __FreeBSD_version add a couple of FreeBSD tags
Diffstat (limited to 'sys/kern/tty_pty.c')
-rw-r--r--sys/kern/tty_pty.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index 2fe2f5e..9531f7b 100644
--- a/sys/kern/tty_pty.c
+++ b/sys/kern/tty_pty.c
@@ -58,6 +58,7 @@
MALLOC_DEFINE(M_PTY, "ptys", "pty data structures");
static void ptsstart __P((struct tty *tp));
+static void ptsstop __P((struct tty *tp, int rw));
static void ptcwakeup __P((struct tty *tp, int flag));
static void ptyinit __P((int n));
@@ -66,8 +67,6 @@ static d_close_t ptsclose;
static d_read_t ptsread;
static d_write_t ptswrite;
static d_ioctl_t ptyioctl;
-static d_stop_t ptsstop;
-static d_devtotty_t ptydevtotty;
static d_open_t ptcopen;
static d_close_t ptcclose;
static d_read_t ptcread;
@@ -81,10 +80,10 @@ static struct cdevsw pts_cdevsw = {
/* read */ ptsread,
/* write */ ptswrite,
/* ioctl */ ptyioctl,
- /* stop */ ptsstop,
+ /* stop */ nostop,
/* reset */ noreset,
- /* devtotty */ ptydevtotty,
- /* poll */ ttpoll,
+ /* devtotty */ nodevtotty,
+ /* poll */ ttypoll,
/* mmap */ nommap,
/* strategy */ nostrategy,
/* name */ "pts",
@@ -106,7 +105,7 @@ static struct cdevsw ptc_cdevsw = {
/* ioctl */ ptyioctl,
/* stop */ nostop,
/* reset */ noreset,
- /* devtotty */ ptydevtotty,
+ /* devtotty */ nodevtotty,
/* poll */ ptcpoll,
/* mmap */ nommap,
/* strategy */ nostrategy,
@@ -362,6 +361,7 @@ ptcopen(dev, flag, devtype, p)
if (tp->t_oproc)
return (EIO);
tp->t_oproc = ptsstart;
+ tp->t_stop = ptsstop;
(void)(*linesw[tp->t_line].l_modem)(tp, 1);
tp->t_lflag &= ~EXTPROC;
pti = dev->si_drv1;
@@ -647,16 +647,6 @@ block:
goto again;
}
-static struct tty *
-ptydevtotty(dev)
- dev_t dev;
-{
- if (minor(dev) & ~0xff)
- return (NULL);
-
- return dev->si_tty;
-}
-
/*ARGSUSED*/
static int
ptyioctl(dev, cmd, data, flag, p)
OpenPOWER on IntegriCloud