From f00200d8a459bcf01e832c89518247e88ce28bf0 Mon Sep 17 00:00:00 2001 From: phk Date: Thu, 15 Jul 2004 20:47:41 +0000 Subject: [PATCH] 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. --- sys/alpha/alpha/promcons.c | 2 +- sys/alpha/tlsb/zs_tlsb.c | 2 +- sys/dev/cx/if_cx.c | 2 +- sys/dev/cy/cy.c | 2 +- sys/dev/dcons/dcons.c | 4 ++-- sys/dev/digi/digi.c | 2 +- sys/dev/nmdm/nmdm.c | 2 +- sys/dev/ofw/ofw_console.c | 2 +- sys/dev/rc/rc.c | 2 +- sys/dev/rp/rp.c | 2 +- sys/dev/sab/sab.c | 4 ++-- sys/dev/si/si.c | 2 +- sys/dev/sio/sio.c | 4 ++-- sys/dev/snp/snp.c | 2 +- sys/dev/sx/sx.c | 2 +- sys/dev/syscons/syscons.c | 2 +- sys/dev/syscons/sysmouse.c | 2 +- sys/dev/uart/uart_tty.c | 4 ++-- sys/dev/usb/ubser.c | 6 +++--- sys/dev/usb/ucom.c | 6 +++--- sys/dev/zs/zs.c | 4 ++-- sys/i386/isa/pcvt/pcvt_drv.c | 2 +- sys/ia64/ia64/ssc.c | 2 +- sys/kern/subr_clist.c | 4 ++-- sys/kern/tty.c | 8 ++++---- sys/kern/tty_conf.c | 2 +- sys/kern/tty_pty.c | 2 +- sys/kern/tty_subr.c | 4 ++-- sys/net/ppp_tty.c | 2 +- sys/pc98/cbus/sio.c | 4 ++-- sys/pc98/pc98/sio.c | 4 ++-- sys/sys/tty.h | 4 ++-- 32 files changed, 49 insertions(+), 49 deletions(-) diff --git a/sys/alpha/alpha/promcons.c b/sys/alpha/alpha/promcons.c index 6ced298effd4..30db04d0a307 100644 --- a/sys/alpha/alpha/promcons.c +++ b/sys/alpha/alpha/promcons.c @@ -149,7 +149,7 @@ promclose(dev, flag, mode, td) untimeout(promtimeout, tp, promtimeouthandle); ttyld_close(tp, flag); - ttyclose(tp); + tty_close(tp); return 0; } diff --git a/sys/alpha/tlsb/zs_tlsb.c b/sys/alpha/tlsb/zs_tlsb.c index 90eaddaa6a72..420d685e8c68 100644 --- a/sys/alpha/tlsb/zs_tlsb.c +++ b/sys/alpha/tlsb/zs_tlsb.c @@ -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); diff --git a/sys/dev/cx/if_cx.c b/sys/dev/cx/if_cx.c index c2b877db98ce..638e947dacbd 100644 --- a/sys/dev/cx/if_cx.c +++ b/sys/dev/cx/if_cx.c @@ -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; diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c index 47d75ad20b35..04df7e109ec1 100644 --- a/sys/dev/cy/cy.c +++ b/sys/dev/cy/cy.c @@ -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 */ diff --git a/sys/dev/dcons/dcons.c b/sys/dev/dcons/dcons.c index 26774447ec10..bc33dbe489e2 100644 --- a/sys/dev/dcons/dcons.c +++ b/sys/dev/dcons/dcons.c @@ -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. diff --git a/sys/dev/digi/digi.c b/sys/dev/digi/digi.c index b08cd5892f0b..e0cd291a51ef 100644 --- a/sys/dev/digi/digi.c +++ b/sys/dev/digi/digi.c @@ -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); diff --git a/sys/dev/nmdm/nmdm.c b/sys/dev/nmdm/nmdm.c index 280bb9cf2da7..41a8704305d4 100644 --- a/sys/dev/nmdm/nmdm.c +++ b/sys/dev/nmdm/nmdm.c @@ -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 diff --git a/sys/dev/ofw/ofw_console.c b/sys/dev/ofw/ofw_console.c index 0e1f91dfea7b..986ad2f64b6b 100644 --- a/sys/dev/ofw/ofw_console.c +++ b/sys/dev/ofw/ofw_console.c @@ -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); } diff --git a/sys/dev/rc/rc.c b/sys/dev/rc/rc.c index 49eedbe27a4a..ddb0d4273cbc 100644 --- a/sys/dev/rc/rc.c +++ b/sys/dev/rc/rc.c @@ -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--; diff --git a/sys/dev/rp/rp.c b/sys/dev/rp/rp.c index 87412b163f91..da32de86ae08 100644 --- a/sys/dev/rp/rp.c +++ b/sys/dev/rp/rp.c @@ -1138,7 +1138,7 @@ rpclose(dev, flag, mode, td) rphardclose(rp); tp->t_state &= ~TS_BUSY; - ttyclose(tp); + tty_close(tp); splx(oldspl); diff --git a/sys/dev/sab/sab.c b/sys/dev/sab/sab.c index ab84e367436a..eb9a4f3cf9fe 100644 --- a/sys/dev/sab/sab.c +++ b/sys/dev/sab/sab.c @@ -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); } diff --git a/sys/dev/si/si.c b/sys/dev/si/si.c index 7a64b7be9405..aea1172560cb 100644 --- a/sys/dev/si/si.c +++ b/sys/dev/si/si.c @@ -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: diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 5f099f91988c..f9086db9f40b 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -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) { diff --git a/sys/dev/snp/snp.c b/sys/dev/snp/snp.c index a352707d6e47..6103a5d651f3 100644 --- a/sys/dev/snp/snp.c +++ b/sys/dev/snp/snp.c @@ -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, diff --git a/sys/dev/sx/sx.c b/sys/dev/sx/sx.c index 56110165cced..499529269511 100644 --- a/sys/dev/sx/sx.c +++ b/sys/dev/sx/sx.c @@ -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: diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index 2620ea715abc..669c25673d79 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -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); } diff --git a/sys/dev/syscons/sysmouse.c b/sys/dev/syscons/sysmouse.c index db2487d11f65..ce8fe1207902 100644 --- a/sys/dev/syscons/sysmouse.c +++ b/sys/dev/syscons/sysmouse.c @@ -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; diff --git a/sys/dev/uart/uart_tty.c b/sys/dev/uart/uart_tty.c index f63d4f0ceb27..c4d0220195bc 100644 --- a/sys/dev/uart/uart_tty.c +++ b/sys/dev/uart/uart_tty.c @@ -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")); diff --git a/sys/dev/usb/ubser.c b/sys/dev/usb/ubser.c index 9b43f54f98f9..34cee909f5a1 100644 --- a/sys/dev/usb/ubser.c +++ b/sys/dev/usb/ubser.c @@ -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; diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c index b4759a713f14..9f84df7efc46 100644 --- a/sys/dev/usb/ucom.c +++ b/sys/dev/usb/ucom.c @@ -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) diff --git a/sys/dev/zs/zs.c b/sys/dev/zs/zs.c index 1c400eb0192d..ab13d09e2252 100644 --- a/sys/dev/zs/zs.c +++ b/sys/dev/zs/zs.c @@ -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); } diff --git a/sys/i386/isa/pcvt/pcvt_drv.c b/sys/i386/isa/pcvt/pcvt_drv.c index ac387332654d..16aa04ccf92c 100644 --- a/sys/i386/isa/pcvt/pcvt_drv.c +++ b/sys/i386/isa/pcvt/pcvt_drv.c @@ -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; diff --git a/sys/ia64/ia64/ssc.c b/sys/ia64/ia64/ssc.c index eb035929b8af..a475fb519f5d 100644 --- a/sys/ia64/ia64/ssc.c +++ b/sys/ia64/ia64/ssc.c @@ -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; } diff --git a/sys/kern/subr_clist.c b/sys/kern/subr_clist.c index cc4b32aa3cf2..afa1277e7ac5 100644 --- a/sys/kern/subr_clist.c +++ b/sys/kern/subr_clist.c @@ -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(). diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 36fbb3643e8d..f0172dfd1921 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -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) diff --git a/sys/kern/tty_conf.c b/sys/kern/tty_conf.c index 488e383d4ae1..77a95937547f 100644 --- a/sys/kern/tty_conf.c +++ b/sys/kern/tty_conf.c @@ -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, diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c index 625189ceb61f..13b48be238d0 100644 --- a/sys/kern/tty_pty.c +++ b/sys/kern/tty_pty.c @@ -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); } diff --git a/sys/kern/tty_subr.c b/sys/kern/tty_subr.c index cc4b32aa3cf2..afa1277e7ac5 100644 --- a/sys/kern/tty_subr.c +++ b/sys/kern/tty_subr.c @@ -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(). diff --git a/sys/net/ppp_tty.c b/sys/net/ppp_tty.c index a76234dd9af9..3a14150eb552 100644 --- a/sys/net/ppp_tty.c +++ b/sys/net/ppp_tty.c @@ -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) diff --git a/sys/pc98/cbus/sio.c b/sys/pc98/cbus/sio.c index 74fc077be027..636d75356f47 100644 --- a/sys/pc98/cbus/sio.c +++ b/sys/pc98/cbus/sio.c @@ -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) { diff --git a/sys/pc98/pc98/sio.c b/sys/pc98/pc98/sio.c index 74fc077be027..636d75356f47 100644 --- a/sys/pc98/pc98/sio.c +++ b/sys/pc98/pc98/sio.c @@ -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) { diff --git a/sys/sys/tty.h b/sys/sys/tty.h index 24e83ad2b4b5..b5ea49d650f1 100644 --- a/sys/sys/tty.h +++ b/sys/sys/tty.h @@ -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);