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/sx | |
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/sx')
-rw-r--r-- | sys/dev/sx/sx.c | 18 | ||||
-rw-r--r-- | sys/dev/sx/sx.h | 1 |
2 files changed, 4 insertions, 15 deletions
diff --git a/sys/dev/sx/sx.c b/sys/dev/sx/sx.c index e7f5d82..5611016 100644 --- a/sys/dev/sx/sx.c +++ b/sys/dev/sx/sx.c @@ -281,7 +281,6 @@ sxattach( sc->sc_ports[x].sp_chan = x; sc->sc_ports[x].sp_tty = tp++; sc->sc_ports[x].sp_state = 0; /* internal flag */ - sc->sc_ports[x].sp_dtr_wait = 3 * hz; sc->sc_ports[x].sp_iin.c_iflag = TTYDEF_IFLAG; sc->sc_ports[x].sp_iin.c_oflag = TTYDEF_OFLAG; sc->sc_ports[x].sp_iin.c_cflag = TTYDEF_CFLAG; @@ -391,7 +390,7 @@ open_top: * it to assert. */ while (pp->sp_state & SX_SS_DTR_OFF && SX_DTRPIN(pp)) { - error = tsleep(&pp->sp_dtr_wait, TTIPRI|PCATCH, "sxdtr", 0); + error = tsleep(&tp->t_dtr_wait, TTIPRI|PCATCH, "sxdtr", 0); if (error != 0) goto out; } @@ -603,8 +602,8 @@ sxhardclose( * If we should hold DTR off for a bit and we actually have a * DTR pin to hold down, schedule sxdtrwakeup(). */ - if (pp->sp_dtr_wait != 0 && SX_DTRPIN(pp)) { - timeout(sxdtrwakeup, pp, pp->sp_dtr_wait); + if (tp->t_dtr_wait != 0 && SX_DTRPIN(pp)) { + timeout(sxdtrwakeup, pp, tp->t_dtr_wait); pp->sp_state |= SX_SS_DTR_OFF; } @@ -630,7 +629,7 @@ sxdtrwakeup(void *chan) oldspl = spltty(); pp = (struct sx_port *)chan; pp->sp_state &= ~SX_SS_DTR_OFF; - wakeup(&pp->sp_dtr_wait); + wakeup(&pp->sp_tty->t_dtr_wait); splx(oldspl); } @@ -884,15 +883,6 @@ sxioctl( DPRINT((pp, DBG_IOCTL, "sxioctl(%s) got signals 0x%x\n", devtoname(dev), *(int *)data)); break; - case TIOCMSDTRWAIT: /* Set "wait on close" delay. */ - /* must be root since the wait applies to following logins */ - error = suser(p); - if (error == 0) - pp->sp_dtr_wait = *(int *)data * hz / 100; - break; - case TIOCMGDTRWAIT: /* Get "wait on close" delay. */ - *(int *)data = pp->sp_dtr_wait * 100 / hz; - break; default: error = ENOTTY; } diff --git a/sys/dev/sx/sx.h b/sys/dev/sx/sx.h index 3d4c971..109b212 100644 --- a/sys/dev/sx/sx.h +++ b/sys/dev/sx/sx.h @@ -39,7 +39,6 @@ struct sx_port { struct tty *sp_tty; int sp_state; int sp_active_out; /* callout is open */ - int sp_dtr_wait; /* DTR holddown in hz */ int sp_delta_overflows; u_int sp_wopeners; /* Processes waiting for DCD. */ struct termios sp_iin; /* Initial state. */ |