Preparation commit for the tty cleanups that will follow in the near
future: rename ttyopen() -> tty_open() and ttyclose() -> tty_close(). We need the ttyopen() and ttyclose() for the new generic cdevsw functions for tty devices in order to have consistent naming.
This commit is contained in:
parent
2f3742942c
commit
f00200d8a4
@ -149,7 +149,7 @@ promclose(dev, flag, mode, td)
|
||||
|
||||
untimeout(promtimeout, tp, promtimeouthandle);
|
||||
ttyld_close(tp, flag);
|
||||
ttyclose(tp);
|
||||
tty_close(tp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -318,7 +318,7 @@ zsclose(struct cdev *dev, int flag, int mode, struct thread *td)
|
||||
s = spltty();
|
||||
untimeout(zs_poll_intr, sc, sc->zst);
|
||||
ttyld_close(tp, flag);
|
||||
ttyclose(tp);
|
||||
tty_close(tp);
|
||||
splx(s);
|
||||
|
||||
return (0);
|
||||
|
@ -1640,7 +1640,7 @@ static int cx_close (struct cdev *dev, int flag, int mode, struct thread *td)
|
||||
cx_set_rts (d->chan, 0);
|
||||
ttydtrwaitstart(d->tty);
|
||||
}
|
||||
ttyclose (d->tty);
|
||||
tty_close (d->tty);
|
||||
splx (s);
|
||||
d->callout = 0;
|
||||
|
||||
|
@ -786,7 +786,7 @@ sioclose(dev, flag, mode, td)
|
||||
ttyld_close(tp, flag);
|
||||
disc_optim(tp, &tp->t_termios, com);
|
||||
comhardclose(com);
|
||||
ttyclose(tp);
|
||||
tty_close(tp);
|
||||
siosettimeout();
|
||||
splx(s);
|
||||
#ifdef broken /* session holds a ref to the tty; can't deallocate */
|
||||
|
@ -230,7 +230,7 @@ dcons_close(struct cdev *dev, int flag, int mode, struct THREAD *td)
|
||||
tp = dev->si_tty;
|
||||
if (tp->t_state & TS_ISOPEN) {
|
||||
ttyld_close(tp, flag);
|
||||
ttyclose(tp);
|
||||
tty_close(tp);
|
||||
}
|
||||
|
||||
return (0);
|
||||
@ -597,7 +597,7 @@ dcons_detach(int port)
|
||||
if (tp->t_state & TS_ISOPEN) {
|
||||
printf("dcons: still opened\n");
|
||||
ttyld_close(tp, 0);
|
||||
ttyclose(tp);
|
||||
tty_close(tp);
|
||||
}
|
||||
/* XXX
|
||||
* must wait until all device are closed.
|
||||
|
@ -893,7 +893,7 @@ digiclose(struct cdev *dev, int flag, int mode, struct thread *td)
|
||||
ttyld_close(tp, flag);
|
||||
ttyldoptim(tp);
|
||||
digihardclose(port);
|
||||
ttyclose(tp);
|
||||
tty_close(tp);
|
||||
if (--sc->opencnt == 0)
|
||||
splx(s);
|
||||
return (0);
|
||||
|
@ -294,7 +294,7 @@ static int
|
||||
nmdmclose(struct cdev *dev, int flag, int mode, struct thread *td)
|
||||
{
|
||||
|
||||
return (ttyclose(dev->si_tty));
|
||||
return (tty_close(dev->si_tty));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -169,7 +169,7 @@ ofw_dev_close(struct cdev *dev, int flag, int mode, struct thread *td)
|
||||
/* XXX Should be replaced with callout_stop(9) */
|
||||
untimeout(ofw_timeout, tp, ofw_timeouthandle);
|
||||
ttyld_close(tp, flag);
|
||||
ttyclose(tp);
|
||||
tty_close(tp);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
@ -951,7 +951,7 @@ rcclose(struct cdev *dev, int flag, int mode, d_thread_t *td)
|
||||
ttyld_close(tp, flag);
|
||||
ttyldoptim(tp);
|
||||
rc_hardclose(rc);
|
||||
ttyclose(tp);
|
||||
tty_close(tp);
|
||||
splx(s);
|
||||
KASSERT(sc->sc_opencount > 0, ("rcclose: non-positive open count"));
|
||||
sc->sc_opencount--;
|
||||
|
@ -1138,7 +1138,7 @@ rpclose(dev, flag, mode, td)
|
||||
rphardclose(rp);
|
||||
|
||||
tp->t_state &= ~TS_BUSY;
|
||||
ttyclose(tp);
|
||||
tty_close(tp);
|
||||
|
||||
splx(oldspl);
|
||||
|
||||
|
@ -706,7 +706,7 @@ sabttyopen(struct cdev *dev, int flags, int mode, struct thread *td)
|
||||
/* XXX handle initial DCD */
|
||||
}
|
||||
|
||||
error = ttyopen(dev, tp);
|
||||
error = tty_open(dev, tp);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
|
||||
@ -728,7 +728,7 @@ sabttyclose(struct cdev *dev, int flags, int mode, struct thread *td)
|
||||
return (0);
|
||||
|
||||
ttyld_close(tp, flags);
|
||||
ttyclose(tp);
|
||||
tty_close(tp);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
@ -804,7 +804,7 @@ siclose(struct cdev *dev, int flag, int mode, struct thread *td)
|
||||
}
|
||||
|
||||
sihardclose(pp);
|
||||
ttyclose(tp);
|
||||
tty_close(tp);
|
||||
pp->sp_state &= ~SS_OPEN;
|
||||
|
||||
out:
|
||||
|
@ -467,7 +467,7 @@ siodetach(dev)
|
||||
if (com->tp && (com->tp->t_state & TS_ISOPEN)) {
|
||||
device_printf(dev, "still open, forcing close\n");
|
||||
ttyld_close(com->tp, 0);
|
||||
ttyclose(com->tp);
|
||||
tty_close(com->tp);
|
||||
} else {
|
||||
if (com->ibuf != NULL)
|
||||
free(com->ibuf, M_DEVBUF);
|
||||
@ -1419,7 +1419,7 @@ sioclose(dev, flag, mode, td)
|
||||
ttyld_close(tp, flag);
|
||||
ttyldoptim(tp);
|
||||
comhardclose(com);
|
||||
ttyclose(tp);
|
||||
tty_close(tp);
|
||||
siosettimeout();
|
||||
splx(s);
|
||||
if (com->gone) {
|
||||
|
@ -52,7 +52,7 @@ static struct cdevsw snp_cdevsw = {
|
||||
};
|
||||
|
||||
static struct linesw snpdisc = {
|
||||
.l_open = ttyopen,
|
||||
.l_open = tty_open,
|
||||
.l_close = snplclose,
|
||||
.l_read = ttread,
|
||||
.l_write = snplwrite,
|
||||
|
@ -548,7 +548,7 @@ sxclose(
|
||||
/* ok. we are now still on the right track.. nuke the hardware */
|
||||
|
||||
sxhardclose(pp);
|
||||
ttyclose(tp);
|
||||
tty_close(tp);
|
||||
pp->sp_state &= ~SX_SS_OPEN;
|
||||
|
||||
out:
|
||||
|
@ -557,7 +557,7 @@ scclose(struct cdev *dev, int flag, int mode, struct thread *td)
|
||||
}
|
||||
spltty();
|
||||
ttyld_close(tp, flag);
|
||||
ttyclose(tp);
|
||||
tty_close(tp);
|
||||
spl0();
|
||||
return(0);
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ smclose(struct cdev *dev, int flag, int mode, struct thread *td)
|
||||
s = spltty();
|
||||
mouse_level = 0;
|
||||
ttyld_close(tp, flag);
|
||||
ttyclose(tp);
|
||||
tty_close(tp);
|
||||
splx(s);
|
||||
|
||||
return 0;
|
||||
|
@ -453,7 +453,7 @@ uart_tty_open(struct cdev *dev, int flags, int mode, struct thread *td)
|
||||
return (error);
|
||||
goto loop;
|
||||
}
|
||||
error = ttyopen(dev, tp);
|
||||
error = tty_open(dev, tp);
|
||||
if (error)
|
||||
return (error);
|
||||
error = ttyld_open(tp, dev);
|
||||
@ -492,7 +492,7 @@ uart_tty_close(struct cdev *dev, int flags, int mode, struct thread *td)
|
||||
sc->sc_pps.ppsparam.mode = 0;
|
||||
|
||||
ttyld_close(tp, flags);
|
||||
ttyclose(tp);
|
||||
tty_close(tp);
|
||||
wakeup(sc);
|
||||
wakeup(TSA_CARR_ON(tp));
|
||||
KASSERT(!(tp->t_state & TS_ISOPEN), ("foo"));
|
||||
|
@ -442,7 +442,7 @@ bad:
|
||||
if (tp != NULL) {
|
||||
if (tp->t_state & TS_ISOPEN) {
|
||||
ttyld_close(tp, 0);
|
||||
ttyclose(tp);
|
||||
tty_close(tp);
|
||||
}
|
||||
}
|
||||
destroy_dev(sc->dev[i]);
|
||||
@ -476,7 +476,7 @@ USB_DETACH(ubser)
|
||||
if (tp != NULL) {
|
||||
if (tp->t_state & TS_ISOPEN) {
|
||||
ttyld_close(tp, 0);
|
||||
ttyclose(tp);
|
||||
tty_close(tp);
|
||||
}
|
||||
}
|
||||
destroy_dev(sc->dev[i]);
|
||||
@ -907,7 +907,7 @@ ubser_open(struct cdev *dev, int flag, int mode, usb_proc_ptr p)
|
||||
wakeup(&sc->sc_opening);
|
||||
splx(s);
|
||||
|
||||
error = ttyopen(dev, tp);
|
||||
error = tty_open(dev, tp);
|
||||
if (error)
|
||||
goto bad;
|
||||
|
||||
|
@ -208,7 +208,7 @@ ucom_detach(struct ucom_softc *sc)
|
||||
device_printf(sc->sc_dev,
|
||||
"still open, forcing close\n");
|
||||
ttyld_close(tp, 0);
|
||||
ttyclose(tp);
|
||||
tty_close(tp);
|
||||
}
|
||||
} else {
|
||||
DPRINTF(("ucom_detach: no tty\n"));
|
||||
@ -388,7 +388,7 @@ ucomopen(struct cdev *dev, int flag, int mode, usb_proc_ptr p)
|
||||
wakeup(&sc->sc_opening);
|
||||
splx(s);
|
||||
|
||||
error = ttyopen(dev, tp);
|
||||
error = tty_open(dev, tp);
|
||||
if (error)
|
||||
goto bad;
|
||||
|
||||
@ -457,7 +457,7 @@ ucomclose(struct cdev *dev, int flag, int mode, usb_proc_ptr p)
|
||||
s = spltty();
|
||||
ttyld_close(tp, flag);
|
||||
ttyldoptim(tp);
|
||||
ttyclose(tp);
|
||||
tty_close(tp);
|
||||
splx(s);
|
||||
|
||||
if (sc->sc_dying)
|
||||
|
@ -492,7 +492,7 @@ zsttyopen(struct cdev *dev, int flags, int mode, struct thread *td)
|
||||
/* XXX handle initial DCD */
|
||||
}
|
||||
|
||||
error = ttyopen(dev, tp);
|
||||
error = tty_open(dev, tp);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
|
||||
@ -514,7 +514,7 @@ zsttyclose(struct cdev *dev, int flags, int mode, struct thread *td)
|
||||
return (0);
|
||||
|
||||
ttyld_close(tp, flags);
|
||||
ttyclose(tp);
|
||||
tty_close(tp);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
@ -354,7 +354,7 @@ pcvt_close(struct cdev *dev, int flag, int mode, struct thread *td)
|
||||
|
||||
ttyld_close(tp, flag);
|
||||
|
||||
ttyclose(tp);
|
||||
tty_close(tp);
|
||||
|
||||
vsx->openf = 0;
|
||||
|
||||
|
@ -186,7 +186,7 @@ sscclose(struct cdev *dev, int flag, int mode, struct thread *td)
|
||||
|
||||
untimeout(ssctimeout, tp, ssctimeouthandle);
|
||||
ttyld_close(tp, flag);
|
||||
ttyclose(tp);
|
||||
tty_close(tp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -81,8 +81,8 @@ clist_init(dummy)
|
||||
{
|
||||
/*
|
||||
* Allocate an initial base set of cblocks as a 'slush'.
|
||||
* We allocate non-slush cblocks with each initial ttyopen() and
|
||||
* deallocate them with each ttyclose().
|
||||
* We allocate non-slush cblocks with each initial tty_open() and
|
||||
* deallocate them with each tty_close().
|
||||
* We should adjust the slush allocation. This can't be done in
|
||||
* the i/o routines because they are sometimes called from
|
||||
* interrupt handlers when it may be unsafe to call malloc().
|
||||
|
@ -230,7 +230,7 @@ SYSCTL_INT(_kern, OID_AUTO, drainwait, CTLFLAG_RW, &drainwait,
|
||||
* Initial open of tty, or (re)entry to standard tty line discipline.
|
||||
*/
|
||||
int
|
||||
ttyopen(struct cdev *device, struct tty *tp)
|
||||
tty_open(struct cdev *device, struct tty *tp)
|
||||
{
|
||||
int s;
|
||||
|
||||
@ -256,12 +256,12 @@ ttyopen(struct cdev *device, struct tty *tp)
|
||||
* Handle close() on a tty line: flush and set to initial state,
|
||||
* bumping generation number so that pending read/write calls
|
||||
* can detect recycling of the tty.
|
||||
* XXX our caller should have done `spltty(); l_close(); ttyclose();'
|
||||
* XXX our caller should have done `spltty(); l_close(); tty_close();'
|
||||
* and l_close() should have flushed, but we repeat the spltty() and
|
||||
* the flush in case there are buggy callers.
|
||||
*/
|
||||
int
|
||||
ttyclose(struct tty *tp)
|
||||
tty_close(struct tty *tp)
|
||||
{
|
||||
int s;
|
||||
|
||||
@ -2761,7 +2761,7 @@ ttyrel(struct tty *tp)
|
||||
|
||||
/*
|
||||
* Allocate a tty struct. Clists in the struct will be allocated by
|
||||
* ttyopen().
|
||||
* tty_open().
|
||||
*/
|
||||
struct tty *
|
||||
ttymalloc(struct tty *tp)
|
||||
|
@ -73,7 +73,7 @@ static struct linesw nodisc = {
|
||||
};
|
||||
|
||||
static struct linesw termios_disc = {
|
||||
.l_open = ttyopen,
|
||||
.l_open = tty_open,
|
||||
.l_close = ttylclose,
|
||||
.l_read = ttread,
|
||||
.l_write = ttwrite,
|
||||
|
@ -207,7 +207,7 @@ ptsclose(struct cdev *dev, int flag, int mode, struct thread *td)
|
||||
|
||||
tp = dev->si_tty;
|
||||
err = ttyld_close(tp, flag);
|
||||
(void) ttyclose(tp);
|
||||
(void) tty_close(tp);
|
||||
return (err);
|
||||
}
|
||||
|
||||
|
@ -81,8 +81,8 @@ clist_init(dummy)
|
||||
{
|
||||
/*
|
||||
* Allocate an initial base set of cblocks as a 'slush'.
|
||||
* We allocate non-slush cblocks with each initial ttyopen() and
|
||||
* deallocate them with each ttyclose().
|
||||
* We allocate non-slush cblocks with each initial tty_open() and
|
||||
* deallocate them with each tty_close().
|
||||
* We should adjust the slush allocation. This can't be done in
|
||||
* the i/o routines because they are sometimes called from
|
||||
* interrupt handlers when it may be unsafe to call malloc().
|
||||
|
@ -234,7 +234,7 @@ pppopen(dev, tp)
|
||||
* Line specific close routine, called from device close routine
|
||||
* and from ttioctl at >= splsofttty().
|
||||
* Detach the tty from the ppp unit.
|
||||
* Mimics part of ttyclose().
|
||||
* Mimics part of tty_close().
|
||||
*/
|
||||
static int
|
||||
pppclose(tp, flag)
|
||||
|
@ -798,7 +798,7 @@ siodetach(dev)
|
||||
if (com->tp && (com->tp->t_state & TS_ISOPEN)) {
|
||||
device_printf(dev, "still open, forcing close\n");
|
||||
ttyld_close(com->tp, 0);
|
||||
ttyclose(com->tp);
|
||||
tty_close(com->tp);
|
||||
} else {
|
||||
if (com->ibuf != NULL)
|
||||
free(com->ibuf, M_DEVBUF);
|
||||
@ -2142,7 +2142,7 @@ sioclose(dev, flag, mode, td)
|
||||
#endif
|
||||
ttyldoptim(tp);
|
||||
comhardclose(com);
|
||||
ttyclose(tp);
|
||||
tty_close(tp);
|
||||
siosettimeout();
|
||||
splx(s);
|
||||
if (com->gone) {
|
||||
|
@ -798,7 +798,7 @@ siodetach(dev)
|
||||
if (com->tp && (com->tp->t_state & TS_ISOPEN)) {
|
||||
device_printf(dev, "still open, forcing close\n");
|
||||
ttyld_close(com->tp, 0);
|
||||
ttyclose(com->tp);
|
||||
tty_close(com->tp);
|
||||
} else {
|
||||
if (com->ibuf != NULL)
|
||||
free(com->ibuf, M_DEVBUF);
|
||||
@ -2142,7 +2142,7 @@ sioclose(dev, flag, mode, td)
|
||||
#endif
|
||||
ttyldoptim(tp);
|
||||
comhardclose(com);
|
||||
ttyclose(tp);
|
||||
tty_close(tp);
|
||||
siosettimeout();
|
||||
splx(s);
|
||||
if (com->gone) {
|
||||
|
@ -311,7 +311,7 @@ void ttwwakeup(struct tty *tp);
|
||||
void ttyblock(struct tty *tp);
|
||||
void ttychars(struct tty *tp);
|
||||
int ttycheckoutq(struct tty *tp, int wait);
|
||||
int ttyclose(struct tty *tp);
|
||||
int tty_close(struct tty *tp);
|
||||
int ttydtrwaitsleep(struct tty *tp);
|
||||
void ttydtrwaitstart(struct tty *tp);
|
||||
void ttyflush(struct tty *tp, int rw);
|
||||
@ -322,7 +322,7 @@ int ttylclose(struct tty *tp, int flag);
|
||||
void ttyldoptim(struct tty *tp);
|
||||
struct tty *ttymalloc(struct tty *tp);
|
||||
int ttymodem(struct tty *tp, int flag);
|
||||
int ttyopen(struct cdev *device, struct tty *tp);
|
||||
int tty_open(struct cdev *device, struct tty *tp);
|
||||
int ttyref(struct tty *tp);
|
||||
int ttyrel(struct tty *tp);
|
||||
int ttysleep(struct tty *tp, void *chan, int pri, char *wmesg, int timo);
|
||||
|
Loading…
x
Reference in New Issue
Block a user