diff options
author | phk <phk@FreeBSD.org> | 2004-07-11 15:18:39 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-07-11 15:18:39 +0000 |
commit | 3683e698d2b43b057fd00f831207c4322511e44d (patch) | |
tree | 620574f4324dc13c9b729c71899ac553f4582bcc /sys/dev/rp/rp.c | |
parent | f41e48677c13ba754473dc99f8dc21534770132f (diff) | |
download | FreeBSD-src-3683e698d2b43b057fd00f831207c4322511e44d.zip FreeBSD-src-3683e698d2b43b057fd00f831207c4322511e44d.tar.gz |
Introduce ttygone() which indicates that the hardware is detached.
Move dtrwait logic to the generic TTY level.
Diffstat (limited to 'sys/dev/rp/rp.c')
-rw-r--r-- | sys/dev/rp/rp.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/sys/dev/rp/rp.c b/sys/dev/rp/rp.c index 6a9eb63..87412b1 100644 --- a/sys/dev/rp/rp.c +++ b/sys/dev/rp/rp.c @@ -871,7 +871,6 @@ rp_attachcommon(CONTROLLER_T *ctlp, int num_aiops, int num_ports) rp->rp_tty->t_line = 0; /* tty->t_termios = deftermios; */ - rp->dtr_wait = 3 * hz; rp->it_in.c_iflag = 0; rp->it_in.c_oflag = 0; rp->it_in.c_cflag = TTYDEF_CFLAG; @@ -983,7 +982,7 @@ rpopen(dev, flag, mode, td) open_top: while(rp->state & ~SET_DTR) { - error = tsleep(&rp->dtr_wait, TTIPRI | PCATCH, "rpdtr", 0); + error = tsleep(&tp->t_dtr_wait, TTIPRI | PCATCH, "rpdtr", 0); if(error != 0) goto out; } @@ -1174,8 +1173,8 @@ rphardclose(struct rp_port *rp) if(IS_CALLOUT(tp->t_dev)) { sClrDTR(cp); } - if(rp->dtr_wait != 0) { - timeout(rpdtrwakeup, rp, rp->dtr_wait); + if(tp->t_dtr_wait != 0) { + timeout(rpdtrwakeup, rp, tp->t_dtr_wait); rp->state |= ~SET_DTR; } @@ -1222,7 +1221,7 @@ rpdtrwakeup(void *chan) rp = (struct rp_port *)chan; rp->state &= SET_DTR; - wakeup(&rp->dtr_wait); + wakeup(&rp->rp_tty->t_dtr_wait); } static int @@ -1408,17 +1407,6 @@ rpioctl(dev, cmd, data, flag, td) *(int *)data = result; break; - case TIOCMSDTRWAIT: - error = suser(td); - if(error != 0) { - splx(oldspl); - return(error); - } - rp->dtr_wait = *(int *)data * hz/100; - break; - case TIOCMGDTRWAIT: - *(int *)data = rp->dtr_wait * 100/hz; - break; default: splx(oldspl); return ENOTTY; |