Machine generated patch which changes linedisc calls from accessing

linesw[] directly to using the ttyld...() functions

The ttyld...() functions ar inline so there is no performance hit.
This commit is contained in:
Poul-Henning Kamp 2004-06-04 16:02:56 +00:00
parent d443a4f573
commit 2140d01b27
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=130077
25 changed files with 168 additions and 168 deletions

View File

@ -124,7 +124,7 @@ promopen(dev, flag, mode, td)
splx(s);
error = (*linesw[tp->t_line].l_open)(dev, tp);
error = ttyld_open(tp, dev);
if (error == 0 && setuptimeout) {
polltime = hz / PROM_POLL_HZ;
@ -148,7 +148,7 @@ promclose(dev, flag, mode, td)
return ENXIO;
untimeout(promtimeout, tp, promtimeouthandle);
(*linesw[tp->t_line].l_close)(tp, flag);
ttyld_close(tp, flag);
ttyclose(tp);
return 0;
}
@ -211,7 +211,7 @@ promtimeout(v)
while ((c = promcncheckc(NULL)) != -1) {
if (tp->t_state & TS_ISOPEN)
(*linesw[tp->t_line].l_rint)(c, tp);
ttyld_rint(tp, c);
}
promtimeouthandle = timeout(promtimeout, tp, polltime);
}

View File

@ -291,7 +291,7 @@ zsopen(dev_t dev, int flag, int mode, struct thread *td)
splx(s);
error = (*linesw[tp->t_line].l_open)(dev, tp);
error = ttyld_open(tp, dev);
if (error == 0 && setuptimeout) {
zspolltime = hz / 50;
@ -318,7 +318,7 @@ zsclose(dev_t dev, int flag, int mode, struct thread *td)
s = spltty();
untimeout(zs_poll_intr, sc, sc->zst);
(*linesw[tp->t_line].l_close)(tp, flag);
ttyld_close(tp, flag);
ttyclose(tp);
splx(s);
@ -502,7 +502,7 @@ zsc_tlsb_intr(void *arg)
Debugger("manual escape to debugger");
#endif
if (tp && (tp->t_state & TS_ISOPEN))
(*linesw[tp->t_line].l_rint)(c, tp);
ttyld_rint(tp, c);
DELAY(5);
}
}
@ -517,7 +517,7 @@ zsc_tlsb_intr(void *arg)
Debugger("manual escape to debugger");
#endif
if (tp && (tp->t_state & TS_ISOPEN))
(*linesw[tp->t_line].l_rint)(c, tp);
ttyld_rint(tp, c);
DELAY(5);
}
}

View File

@ -748,7 +748,7 @@ sioopen(dev, flag, mode, td)
* the true carrier.
*/
if (com->prev_modem_status & MSR_DCD || mynor & CALLOUT_MASK)
(*linesw[tp->t_line].l_modem)(tp, 1);
ttyld_modem(tp, 1);
}
/*
* Wait for DCD if necessary.
@ -762,7 +762,7 @@ sioopen(dev, flag, mode, td)
goto out;
goto open_top;
}
error = (*linesw[tp->t_line].l_open)(dev, tp);
error = ttyld_open(tp, dev);
disc_optim(tp, &tp->t_termios, com);
if (tp->t_state & TS_ISOPEN && mynor & CALLOUT_MASK)
com->active_out = TRUE;
@ -793,7 +793,7 @@ sioclose(dev, flag, mode, td)
tp = com->tp;
s = spltty();
cd_etc(com, CD1400_ETC_STOPBREAK);
(*linesw[tp->t_line].l_close)(tp, flag);
ttyld_close(tp, flag);
disc_optim(tp, &tp->t_termios, com);
comhardclose(com);
ttyclose(tp);
@ -919,7 +919,7 @@ siowrite(dev, uio, flag)
* sessions are raw anyhow.
*/
#else
return ((*linesw[tp->t_line].l_write)(tp, uio, flag));
return (ttyld_write(tp, uio, flag));
#endif
}
@ -1018,7 +1018,7 @@ sioinput(com)
if (line_status & LSR_PE)
recv_data |= TTY_PE;
}
(*linesw[tp->t_line].l_rint)(recv_data, tp);
ttyld_rint(tp, recv_data);
critical_enter();
COM_LOCK();
} while (buf < com->iptr);
@ -1772,7 +1772,7 @@ siopoll(void *arg)
com->state &= ~CS_ODONE;
COM_UNLOCK();
critical_exit();
(*linesw[tp->t_line].l_start)(tp);
ttyld_start(tp);
}
if (com_events == 0)
break;

View File

@ -192,7 +192,7 @@ dcons_open(dev_t dev, int flag, int mode, struct THREAD *td)
}
splx(s);
error = (*linesw[tp->t_line].l_open)(dev, tp);
error = ttyld_open(tp, dev);
return (error);
}
@ -209,7 +209,7 @@ dcons_close(dev_t dev, int flag, int mode, struct THREAD *td)
tp = dev->si_tty;
if (tp->t_state & TS_ISOPEN) {
(*linesw[tp->t_line].l_close)(tp, flag);
ttyld_close(tp, flag);
ttyclose(tp);
}
@ -259,7 +259,7 @@ dcons_timeout(void *v)
tp = dc->dev->si_tty;
while ((c = dcons_checkc(dc)) != -1)
if (tp->t_state & TS_ISOPEN)
(*linesw[tp->t_line].l_rint)(c, tp);
ttyld_rint(tp, c);
}
polltime = hz / poll_hz;
if (polltime < 1)
@ -560,7 +560,7 @@ dcons_detach(int port)
if (tp->t_state & TS_ISOPEN) {
printf("dcons: still opened\n");
(*linesw[tp->t_line].l_close)(tp, 0);
ttyld_close(tp, 0);
ttyclose(tp);
}
/* XXX

View File

@ -832,7 +832,7 @@ digiopen(dev_t dev, int flag, int mode, struct thread *td)
/* handle fake and initial DCD for callout devices */
if (bc->mstat & port->cd || mynor & CALLOUT_MASK)
linesw[tp->t_line].l_modem(tp, 1);
ttyld_modem(tp, 1);
}
/* Wait for DCD if necessary */
@ -849,7 +849,7 @@ digiopen(dev_t dev, int flag, int mode, struct thread *td)
}
goto open_top;
}
error = linesw[tp->t_line].l_open(dev, tp);
error = ttyld_open(tp, dev);
DLOG(DIGIDB_OPEN, (sc->dev, "port %d: l_open error = %d\n",
pnum, error));
@ -900,7 +900,7 @@ digiclose(dev_t dev, int flag, int mode, struct thread *td)
DLOG(DIGIDB_CLOSE, (sc->dev, "port %d: closing\n", pnum));
s = spltty();
linesw[tp->t_line].l_close(tp, flag);
ttyld_close(tp, flag);
digi_disc_optim(tp, &tp->t_termios, port);
digihardclose(port);
ttyclose(tp);
@ -970,7 +970,7 @@ digiread(dev_t dev, struct uio *uio, int flag)
KASSERT(sc, ("digi%d: softc not allocated in digiclose\n", unit));
tp = &sc->ttys[pnum];
error = linesw[tp->t_line].l_read(tp, uio, flag);
error = ttyld_read(tp, uio, flag);
DLOG(DIGIDB_READ, (sc->dev, "port %d: read() returns %d\n",
pnum, error));
@ -996,7 +996,7 @@ digiwrite(dev_t dev, struct uio *uio, int flag)
KASSERT(sc, ("digi%d: softc not allocated in digiclose\n", unit));
tp = &sc->ttys[pnum];
error = linesw[tp->t_line].l_write(tp, uio, flag);
error = ttyld_write(tp, uio, flag);
DLOG(DIGIDB_WRITE, (sc->dev, "port %d: write() returns %d\n",
pnum, error));
@ -1651,26 +1651,26 @@ digi_intr(void *vp)
DLOG(DIGIDB_RI, (sc->dev, "port %d: RING\n",
event.pnum));
if (port->send_ring) {
linesw[tp->t_line].l_rint('R', tp);
linesw[tp->t_line].l_rint('I', tp);
linesw[tp->t_line].l_rint('N', tp);
linesw[tp->t_line].l_rint('G', tp);
linesw[tp->t_line].l_rint('\r', tp);
linesw[tp->t_line].l_rint('\n', tp);
ttyld_rint(tp, 'R');
ttyld_rint(tp, 'I');
ttyld_rint(tp, 'N');
ttyld_rint(tp, 'G');
ttyld_rint(tp, '\r');
ttyld_rint(tp, '\n');
}
}
}
if (event.event & BREAK_IND) {
DLOG(DIGIDB_MODEM, (sc->dev, "port %d: BREAK_IND\n",
event.pnum));
linesw[tp->t_line].l_rint(TTY_BI, tp);
ttyld_rint(tp, TTY_BI);
}
if (event.event & (LOWTX_IND | EMPTYTX_IND)) {
DLOG(DIGIDB_IRQ, (sc->dev, "port %d:%s%s\n",
event.pnum,
event.event & LOWTX_IND ? " LOWTX" : "",
event.event & EMPTYTX_IND ? " EMPTYTX" : ""));
(*linesw[tp->t_line].l_start)(tp);
ttyld_start(tp);
}
}
sc->gdata->eout = etail;

View File

@ -154,12 +154,12 @@ nmdm_task_tty(void *arg, int pending __unused)
if (sp->other->dcd) {
if (!(tp->t_state & TS_ISOPEN)) {
sp->other->dcd = 0;
(void)(*linesw[otp->t_line].l_modem)(otp, 0);
(void)ttyld_modem(otp, 0);
}
} else {
if (tp->t_state & TS_ISOPEN) {
sp->other->dcd = 1;
(void)(*linesw[otp->t_line].l_modem)(otp, 1);
(void)ttyld_modem(otp, 1);
}
}
if (tp->t_state & TS_TTSTOP)
@ -169,7 +169,7 @@ nmdm_task_tty(void *arg, int pending __unused)
return;
c = getc(&tp->t_outq);
if (otp->t_state & TS_ISOPEN)
(*linesw[otp->t_line].l_rint)(c, otp);
ttyld_rint(otp, c);
}
if (tp->t_outq.c_cc == 0)
ttwwakeup(tp);
@ -255,7 +255,7 @@ nmdmopen(dev_t dev, int flag, int devtype, struct thread *td)
return (EBUSY);
}
error = (*linesw[tp->t_line].l_open)(dev, tp);
error = ttyld_open(tp, dev);
return (error);
}

View File

@ -138,7 +138,7 @@ ofw_dev_open(dev_t dev, int flag, int mode, struct thread *td)
return (EBUSY);
}
error = (*linesw[tp->t_line].l_open)(dev, tp);
error = ttyld_open(tp, dev);
if (error == 0 && setuptimeout) {
polltime = hz / OFW_POLL_HZ;
@ -165,7 +165,7 @@ ofw_dev_close(dev_t dev, int flag, int mode, struct thread *td)
return (ENXIO);
}
(*linesw[tp->t_line].l_close)(tp, flag);
ttyld_close(tp, flag);
ttyclose(tp);
return (0);
@ -218,7 +218,7 @@ ofw_timeout(void *v)
while ((c = ofw_cons_checkc(NULL)) != -1) {
if (tp->t_state & TS_ISOPEN) {
(*linesw[tp->t_line].l_rint)(c, tp);
ttyld_rint(tp, c);
}
}

View File

@ -738,7 +738,7 @@ rc_pollcard(void *arg)
rc->rc_flags &= ~RC_MODCHG;
sc->sc_scheduled_event -= LOTS_OF_EVENTS;
critical_exit();
(*linesw[tp->t_line].l_modem)(tp, !!(rc->rc_msvr & MSVR_CD));
ttyld_modem(tp, !!(rc->rc_msvr & MSVR_CD));
}
if (rc->rc_flags & RC_DORXFER) {
critical_enter();
@ -810,7 +810,7 @@ done1: ;
rc->rc_flags &= ~RC_DOXXFER;
rc->rc_tp.t_state &= ~TS_BUSY;
critical_exit();
(*linesw[tp->t_line].l_start)(tp);
ttyld_start(tp);
}
if (sc->sc_scheduled_event == 0)
break;
@ -920,7 +920,7 @@ rcopen(dev_t dev, int flag, int mode, d_thread_t *td)
(void) rc_modctl(rc, TIOCM_RTS|TIOCM_DTR, DMSET);
if ((rc->rc_msvr & MSVR_CD) || CALLOUT(dev))
(*linesw[tp->t_line].l_modem)(tp, 1);
ttyld_modem(tp, 1);
}
if (!(tp->t_state & TS_CARR_ON) && !CALLOUT(dev)
&& !(tp->t_cflag & CLOCAL) && !(flag & O_NONBLOCK)) {
@ -931,7 +931,7 @@ rcopen(dev_t dev, int flag, int mode, d_thread_t *td)
goto out;
goto again;
}
error = (*linesw[tp->t_line].l_open)(dev, tp);
error = ttyld_open(tp, dev);
disc_optim(tp, &tp->t_termios, rc);
if ((tp->t_state & TS_ISOPEN) && CALLOUT(dev))
rc->rc_flags |= RC_ACTOUT;
@ -960,7 +960,7 @@ rcclose(dev_t dev, int flag, int mode, d_thread_t *td)
rc->rc_chan, dev);
#endif
s = spltty();
(*linesw[tp->t_line].l_close)(tp, flag);
ttyld_close(tp, flag);
disc_optim(tp, &tp->t_termios, rc);
rc_hardclose(rc);
ttyclose(tp);

View File

@ -660,7 +660,7 @@ static void rp_do_receive(struct rp_port *rp, struct tty *tp,
else if (CharNStat & STMRCVROVRH)
rp->rp_overflows++;
(*linesw[tp->t_line].l_rint)(ch, tp);
ttyld_rint(tp, ch);
ToRecv--;
}
/*
@ -702,7 +702,7 @@ static void rp_do_receive(struct rp_port *rp, struct tty *tp,
}
ch = (u_char) rp_readch1(cp,sGetTxRxDataIO(cp));
spl = spltty();
(*linesw[tp->t_line].l_rint)(ch, tp);
ttyld_rint(tp, ch);
splx(spl);
ToRecv--;
}
@ -731,12 +731,12 @@ static void rp_handle_port(struct rp_port *rp)
if(IntMask & DELTA_CD) {
if(ChanStatus & CD_ACT) {
if(!(tp->t_state & TS_CARR_ON) ) {
(void)(*linesw[tp->t_line].l_modem)(tp, 1);
(void)ttyld_modem(tp, 1);
}
} else {
if((tp->t_state & TS_CARR_ON)) {
(void)(*linesw[tp->t_line].l_modem)(tp, 0);
if((*linesw[tp->t_line].l_modem)(tp, 0) == 0) {
(void)ttyld_modem(tp, 0);
if(ttyld_modem(tp, 0) == 0) {
rphardclose(rp);
}
}
@ -784,7 +784,7 @@ static void rp_do_poll(void *not_used)
tp->t_state &= ~(TS_BUSY);
if(!(tp->t_state & TS_TTSTOP) &&
(count <= rp->rp_restart)) {
(*linesw[tp->t_line].l_start)(tp);
ttyld_start(tp);
}
}
}
@ -1068,7 +1068,7 @@ rpopen(dev, flag, mode, td)
ChanStatus = sGetChanStatus(&rp->rp_channel);
if((IntMask & DELTA_CD) || IS_CALLOUT(dev)) {
if((ChanStatus & CD_ACT) || IS_CALLOUT(dev)) {
(void)(*linesw[tp->t_line].l_modem)(tp, 1);
(void)ttyld_modem(tp, 1);
}
}
@ -1087,7 +1087,7 @@ rpopen(dev, flag, mode, td)
goto out;
goto open_top;
}
error = (*linesw[tp->t_line].l_open)(dev, tp);
error = ttyld_open(tp, dev);
rp_disc_optim(tp, &tp->t_termios);
if(tp->t_state & TS_ISOPEN && IS_CALLOUT(dev))
@ -1130,7 +1130,7 @@ rpclose(dev, flag, mode, td)
tp = rp->rp_tty;
oldspl = spltty();
(*linesw[tp->t_line].l_close)(tp, flag);
ttyld_close(tp, flag);
rp_disc_optim(tp, &tp->t_termios);
rphardclose(rp);
@ -1207,7 +1207,7 @@ rpwrite(dev, uio, flag)
return(error);
}
error = (*linesw[tp->t_line].l_write)(tp, uio, flag);
error = ttyld_write(tp, uio, flag);
return error;
}

View File

@ -622,13 +622,13 @@ sabtty_softintr(struct sabtty_softc *sc)
if (sc->sc_iget == sc->sc_ibuf + sizeof(sc->sc_ibuf))
sc->sc_iget = sc->sc_ibuf;
(*linesw[tp->t_line].l_rint)(data, tp);
ttyld_rint(tp, data);
}
if (sc->sc_tx_done != 0) {
sc->sc_tx_done = 0;
tp->t_state &= ~TS_BUSY;
(*linesw[tp->t_line].l_start)(tp);
ttyld_start(tp);
}
}
@ -698,7 +698,7 @@ sabttyopen(dev_t dev, int flags, int mode, struct thread *td)
if (error != 0)
return (error);
error = (*linesw[tp->t_line].l_open)(dev, tp);
error = ttyld_open(tp, dev);
if (error != 0)
return (error);
@ -715,7 +715,7 @@ sabttyclose(dev_t dev, int flags, int mode, struct thread *td)
if ((tp->t_state & TS_ISOPEN) == 0)
return (0);
(*linesw[tp->t_line].l_close)(tp, flags);
ttyld_close(tp, flags);
ttyclose(tp);
return (0);

View File

@ -714,7 +714,7 @@ siopen(dev_t dev, int flag, int mode, struct thread *td)
/* set initial DCD state */
pp->sp_last_hi_ip = ccbp->hi_ip;
if ((pp->sp_last_hi_ip & IP_DCD) || IS_CALLOUT(mynor)) {
(*linesw[tp->t_line].l_modem)(tp, 1);
ttyld_modem(tp, 1);
}
}
@ -740,7 +740,7 @@ siopen(dev_t dev, int flag, int mode, struct thread *td)
goto open_top;
}
error = (*linesw[tp->t_line].l_open)(dev, tp);
error = ttyld_open(tp, dev);
si_disc_optim(tp, &tp->t_termios, pp);
if (tp->t_state & TS_ISOPEN && IS_CALLOUT(mynor))
pp->sp_active_out = TRUE;
@ -790,7 +790,7 @@ siclose(dev_t dev, int flag, int mode, struct thread *td)
si_write_enable(pp, 0); /* block writes for ttywait() */
/* THIS MAY SLEEP IN TTYWAIT!!! */
(*linesw[tp->t_line].l_close)(tp, flag);
ttyld_close(tp, flag);
si_write_enable(pp, 1);
@ -900,7 +900,7 @@ siwrite(dev_t dev, struct uio *uio, int flag)
}
}
error = (*linesw[tp->t_line].l_write)(tp, uio, flag);
error = ttyld_write(tp, uio, flag);
out:
splx(oldspl);
return (error);
@ -1466,12 +1466,12 @@ si_modem_state(struct si_port *pp, struct tty *tp, int hi_ip)
if (!(pp->sp_last_hi_ip & IP_DCD)) {
DPRINT((pp, DBG_INTR, "modem carr on t_line %d\n",
tp->t_line));
(void)(*linesw[tp->t_line].l_modem)(tp, 1);
(void)ttyld_modem(tp, 1);
}
} else {
if (pp->sp_last_hi_ip & IP_DCD) {
DPRINT((pp, DBG_INTR, "modem carr off\n"));
if ((*linesw[tp->t_line].l_modem)(tp, 0))
if (ttyld_modem(tp, 0))
(void) si_modem(pp, SET, 0);
}
}
@ -1679,7 +1679,7 @@ si_intr(void *arg)
*/
if (ccbp->hi_state & ST_BREAK) {
if (isopen) {
(*linesw[tp->t_line].l_rint)(TTY_BI, tp);
ttyld_rint(tp, TTY_BI);
}
ccbp->hi_state &= ~ST_BREAK; /* A Bit iffy this */
DPRINT((pp, DBG_INTR, "si_intr break\n"));
@ -1808,7 +1808,7 @@ si_intr(void *arg)
*/
for(x = 0; x < n; x++) {
i = si_rxbuf[x];
if ((*linesw[tp->t_line].l_rint)(i, tp)
if (ttyld_rint(tp, i)
== -1) {
pp->sp_delta_overflows++;
}
@ -1821,7 +1821,7 @@ si_intr(void *arg)
/*
* Do TX stuff
*/
(*linesw[tp->t_line].l_start)(tp);
ttyld_start(tp);
} /* end of for (all ports on this controller) */
} /* end of for (all controllers) */
@ -1963,7 +1963,7 @@ si_lstart(void *arg)
ttwwakeup(tp);
/* nudge protocols - eg: ppp */
(*linesw[tp->t_line].l_start)(tp);
ttyld_start(tp);
pp->sp_state &= ~SS_INLSTART;
splx(oldspl);

View File

@ -454,7 +454,7 @@ siodetach(dev)
com->ioportres);
if (com->tp && (com->tp->t_state & TS_ISOPEN)) {
device_printf(dev, "still open, forcing close\n");
(*linesw[com->tp->t_line].l_close)(com->tp, 0);
ttyld_close(com->tp, 0);
ttyclose(com->tp);
} else {
if (com->ibuf != NULL)
@ -1335,7 +1335,7 @@ sioopen(dev, flag, mode, td)
* the true carrier.
*/
if (com->prev_modem_status & MSR_DCD || mynor & CALLOUT_MASK)
(*linesw[tp->t_line].l_modem)(tp, 1);
ttyld_modem(tp, 1);
}
/*
* Wait for DCD if necessary.
@ -1351,7 +1351,7 @@ sioopen(dev, flag, mode, td)
goto out;
goto open_top;
}
error = (*linesw[tp->t_line].l_open)(dev, tp);
error = ttyld_open(tp, dev);
disc_optim(tp, &tp->t_termios, com);
if (tp->t_state & TS_ISOPEN && mynor & CALLOUT_MASK)
com->active_out = TRUE;
@ -1383,7 +1383,7 @@ sioclose(dev, flag, mode, td)
return (ENODEV);
tp = com->tp;
s = spltty();
(*linesw[tp->t_line].l_close)(tp, flag);
ttyld_close(tp, flag);
disc_optim(tp, &tp->t_termios, com);
comhardclose(com);
ttyclose(tp);
@ -1475,7 +1475,7 @@ sioread(dev, uio, flag)
com = com_addr(MINOR_TO_UNIT(mynor));
if (com == NULL || com->gone)
return (ENODEV);
return ((*linesw[com->tp->t_line].l_read)(com->tp, uio, flag));
return (ttyld_read(com->tp, uio, flag));
}
static int
@ -1504,7 +1504,7 @@ siowrite(dev, uio, flag)
*/
if (constty != NULL && unit == comconsole)
constty = NULL;
return ((*linesw[com->tp->t_line].l_write)(com->tp, uio, flag));
return (ttyld_write(com->tp, uio, flag));
}
static void
@ -1657,7 +1657,7 @@ sioinput(com)
if (line_status & LSR_PE)
recv_data |= TTY_PE;
}
(*linesw[tp->t_line].l_rint)(recv_data, tp);
ttyld_rint(tp, recv_data);
mtx_lock_spin(&sio_lock);
} while (buf < com->iptr);
}
@ -2176,7 +2176,7 @@ siopoll(void *dummy)
timeout(siobusycheck, com, hz / 100);
com->extra_state |= CSE_BUSYCHECK;
}
(*linesw[tp->t_line].l_start)(tp);
ttyld_start(tp);
}
if (com_events == 0)
break;

View File

@ -453,7 +453,7 @@ sxopen(
/* set initial DCD state */
if (DEV_IS_CALLOUT(mynor) ||
(sx_modem(sc, pp, GET, 0) & TIOCM_CD)) {
(*linesw[tp->t_line].l_modem)(tp, 1);
ttyld_modem(tp, 1);
}
}
/* whoops! we beat the close! */
@ -475,7 +475,7 @@ sxopen(
goto open_top;
}
error = (*linesw[tp->t_line].l_open)(dev, tp);
error = ttyld_open(tp, dev);
sx_disc_optim(tp, &tp->t_termios, pp);
if (tp->t_state & TS_ISOPEN && DEV_IS_CALLOUT(mynor))
pp->sp_active_out = TRUE;
@ -536,7 +536,7 @@ sxclose(
sx_write_enable(pp, 0); /* block writes for ttywait() */
/* THIS MAY SLEEP IN TTYWAIT!!! */
(*linesw[tp->t_line].l_close)(tp, flag);
ttyld_close(tp, flag);
sx_write_enable(pp, 1);
@ -675,7 +675,7 @@ sxwrite(
goto out;
}
}
error = (*linesw[tp->t_line].l_write)(tp, uio, flag);
error = ttyld_write(tp, uio, flag);
out: splx(oldspl);
DPRINT((pp, DBG_WRITE, "sxwrite out\n"));
return (error);
@ -1313,7 +1313,7 @@ sx_transmit(
* discipline to send more.
*/
if (flags & CD1865_IER_TXRDY) {
(*linesw[tp->t_line].l_start)(tp);
ttyld_start(tp);
pp->sp_state &= ~SX_SS_IXMIT;
DPRINT((pp, DBG_TRANSMIT, "sx_xmit TXRDY out\n"));
return;
@ -1365,11 +1365,11 @@ sx_modem_state(
if ((sx_cd1865_in(sc, CD1865_MSVR) & CD1865_MSVR_CD) == 0) {
DPRINT((pp, DBG_INTR, "modem carr on t_line %d\n",
tp->t_line));
(void)(*linesw[tp->t_line].l_modem)(tp, 1);
(void)ttyld_modem(tp, 1);
}
else { /* CD went down. */
DPRINT((pp, DBG_INTR, "modem carr off\n"));
if ((*linesw[tp->t_line].l_modem)(tp, 0))
if (ttyld_modem(tp, 0))
(void)sx_modem(sc, pp, SET, 0);
}
}
@ -1496,7 +1496,7 @@ sx_receive(
*/
for (x = 0; x < count; x++) {
i = sx_rxbuf[x];
if ((*linesw[tp->t_line].l_rint)(i, tp) == -1)
if (ttyld_rint(tp, i) == -1)
pp->sp_delta_overflows++;
}
}
@ -1561,7 +1561,7 @@ sx_receive_exception(
ch |= TTY_FE;
else if (st & CD1865_RCSR_OE)
ch |= TTY_OE;
(*linesw[tp->t_line].l_rint)(ch, tp);
ttyld_rint(tp, ch);
pp->sp_state &= ~SX_SS_IRCVEXC;
}

View File

@ -495,13 +495,13 @@ scopen(dev_t dev, int flag, int mode, struct thread *td)
tp->t_lflag = TTYDEF_LFLAG;
tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
scparam(tp, &tp->t_termios);
(*linesw[tp->t_line].l_modem)(tp, 1);
ttyld_modem(tp, 1);
}
else
if (tp->t_state & TS_XCLUDE && suser(td))
return(EBUSY);
error = (*linesw[tp->t_line].l_open)(dev, tp);
error = ttyld_open(tp, dev);
scp = sc_get_stat(dev);
if (scp == NULL) {
@ -561,7 +561,7 @@ scclose(dev_t dev, int flag, int mode, struct thread *td)
DPRINTF(5, ("done.\n"));
}
spltty();
(*linesw[tp->t_line].l_close)(tp, flag);
ttyld_close(tp, flag);
ttyclose(tp);
spl0();
return(0);
@ -618,23 +618,23 @@ sckbdevent(keyboard_t *thiskbd, int event, void *arg)
switch (KEYFLAGS(c)) {
case 0x0000: /* normal key */
(*linesw[cur_tty->t_line].l_rint)(KEYCHAR(c), cur_tty);
ttyld_rint(cur_tty, KEYCHAR(c));
break;
case FKEY: /* function key, return string */
cp = kbd_get_fkeystr(thiskbd, KEYCHAR(c), &len);
if (cp != NULL) {
while (len-- > 0)
(*linesw[cur_tty->t_line].l_rint)(*cp++, cur_tty);
ttyld_rint(cur_tty, *cp++);
}
break;
case MKEY: /* meta is active, prepend ESC */
(*linesw[cur_tty->t_line].l_rint)(0x1b, cur_tty);
(*linesw[cur_tty->t_line].l_rint)(KEYCHAR(c), cur_tty);
ttyld_rint(cur_tty, 0x1b);
ttyld_rint(cur_tty, KEYCHAR(c));
break;
case BKEY: /* backtab fixed sequence (esc [ Z) */
(*linesw[cur_tty->t_line].l_rint)(0x1b, cur_tty);
(*linesw[cur_tty->t_line].l_rint)('[', cur_tty);
(*linesw[cur_tty->t_line].l_rint)('Z', cur_tty);
ttyld_rint(cur_tty, 0x1b);
ttyld_rint(cur_tty, '[');
ttyld_rint(cur_tty, 'Z');
break;
}
}
@ -3571,7 +3571,7 @@ sc_paste(scr_stat *scp, u_char *p, int count)
return;
rmap = scp->sc->scr_rmap;
for (; count > 0; --count)
(*linesw[tp->t_line].l_rint)(rmap[*p++], tp);
ttyld_rint(tp, rmap[*p++]);
}
void

View File

@ -92,12 +92,12 @@ smopen(dev_t dev, int flag, int mode, struct thread *td)
tp->t_lflag = TTYDEF_LFLAG;
tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
smparam(tp, &tp->t_termios);
(*linesw[tp->t_line].l_modem)(tp, 1);
ttyld_modem(tp, 1);
} else if (tp->t_state & TS_XCLUDE && suser(td)) {
return EBUSY;
}
return (*linesw[tp->t_line].l_open)(dev, tp);
return ttyld_open(tp, dev);
}
static int
@ -109,7 +109,7 @@ smclose(dev_t dev, int flag, int mode, struct thread *td)
tp = dev->si_tty;
s = spltty();
mouse_level = 0;
(*linesw[tp->t_line].l_close)(tp, flag);
ttyld_close(tp, flag);
ttyclose(tp);
splx(s);
@ -306,7 +306,7 @@ sysmouse_event(mouse_info_t *info)
buf[2] = y >> 1;
buf[4] = y - buf[2];
for (i = 0; i < MOUSE_MSC_PACKETSIZE; ++i)
(*linesw[sysmouse_tty->t_line].l_rint)(buf[i], sysmouse_tty);
ttyld_rint(sysmouse_tty, buf[i]);
if (mouse_level >= 1) {
/* extended part */
z = imax(imin(z, 127), -128);

View File

@ -286,24 +286,24 @@ uart_tty_intr(void *arg)
c |= TTY_FE;
if (xc & UART_STAT_PARERR)
c |= TTY_PE;
(*linesw[tp->t_line].l_rint)(c, tp);
ttyld_rint(tp, c);
}
}
if (pend & UART_IPEND_BREAK) {
if (tp != NULL && !(tp->t_iflag & IGNBRK))
(*linesw[tp->t_line].l_rint)(0, tp);
ttyld_rint(tp, 0);
}
if (pend & UART_IPEND_SIGCHG) {
sig = pend & UART_IPEND_SIGMASK;
if (sig & UART_SIG_DDCD)
(*linesw[tp->t_line].l_modem)(tp, sig & UART_SIG_DCD);
ttyld_modem(tp, sig & UART_SIG_DCD);
if ((sig & UART_SIG_DCTS) && (tp->t_cflag & CCTS_OFLOW) &&
!sc->sc_hwoflow) {
if (sig & UART_SIG_CTS) {
tp->t_state &= ~TS_TTSTOP;
(*linesw[tp->t_line].l_start)(tp);
ttyld_start(tp);
} else
tp->t_state |= TS_TTSTOP;
}
@ -311,7 +311,7 @@ uart_tty_intr(void *arg)
if (pend & UART_IPEND_TXIDLE) {
tp->t_state &= ~TS_BUSY;
(*linesw[tp->t_line].l_start)(tp);
ttyld_start(tp);
}
}
@ -422,7 +422,7 @@ uart_tty_open(dev_t dev, int flags, int mode, struct thread *td)
* Handle initial DCD.
*/
if ((sc->sc_hwsig & UART_SIG_DCD) || sc->sc_callout)
(*linesw[tp->t_line].l_modem)(tp, 1);
ttyld_modem(tp, 1);
}
/*
* Wait for DCD if necessary.
@ -440,7 +440,7 @@ uart_tty_open(dev_t dev, int flags, int mode, struct thread *td)
error = ttyopen(dev, tp);
if (error)
return (error);
error = (*linesw[tp->t_line].l_open)(dev, tp);
error = ttyld_open(tp, dev);
if (error)
return (error);
@ -475,7 +475,7 @@ uart_tty_close(dev_t dev, int flags, int mode, struct thread *td)
/* Disable pulse capturing. */
sc->sc_pps.ppsparam.mode = 0;
(*linesw[tp->t_line].l_close)(tp, flags);
ttyld_close(tp, flags);
ttyclose(tp);
wakeup(sc);
wakeup(TSA_CARR_ON(tp));

View File

@ -440,7 +440,7 @@ USB_ATTACH(ubser)
tp = sc->dev[i]->si_tty;
if (tp != NULL) {
if (tp->t_state & TS_ISOPEN) {
(*linesw[tp->t_line].l_close)(tp, 0);
ttyld_close(tp, 0);
ttyclose(tp);
}
}
@ -474,7 +474,7 @@ USB_DETACH(ubser)
tp = sc->dev[i]->si_tty;
if (tp != NULL) {
if (tp->t_state & TS_ISOPEN) {
(*linesw[tp->t_line].l_close)(tp, 0);
ttyld_close(tp, 0);
ttyclose(tp);
}
}
@ -694,7 +694,7 @@ ubserwritecb(usbd_xfer_handle xfer, usbd_private_handle p, usbd_status status)
CLR(tp->t_state, TS_FLUSH);
else
ndflush(&tp->t_outq, cc);
(*linesw[tp->t_line].l_start)(tp);
ttyld_start(tp);
splx(s);
return;
@ -900,7 +900,7 @@ ubser_open(dev_t dev, int flag, int mode, usb_proc_ptr p)
/*
* Handle initial DCD.
*/
(*linesw[tp->t_line].l_modem)(tp, 1);
ttyld_modem(tp, 1);
}
sc->sc_refcnt++; /* XXX: wrong refcnt on error later on */
@ -912,7 +912,7 @@ ubser_open(dev_t dev, int flag, int mode, usb_proc_ptr p)
if (error)
goto bad;
error = (*linesw[tp->t_line].l_open)(dev, tp);
error = ttyld_open(tp, dev);
if (error)
goto bad;
@ -1013,7 +1013,7 @@ ubser_read(dev_t dev, struct uio *uio, int flag)
if (sc->sc_dying)
return (EIO);
error = (*linesw[tp->t_line].l_read)(tp, uio, flag);
error = ttyld_read(tp, uio, flag);
DPRINTF(("ubser_read: error = %d\n", error));
@ -1035,7 +1035,7 @@ ubser_write(dev_t dev, struct uio *uio, int flag)
if (sc->sc_dying)
return (EIO);
error = (*linesw[tp->t_line].l_write)(tp, uio, flag);
error = ttyld_write(tp, uio, flag);
DPRINTF(("ubser_write: error = %d\n", error));

View File

@ -213,7 +213,7 @@ ucom_detach(struct ucom_softc *sc)
if (tp->t_state & TS_ISOPEN) {
device_printf(sc->sc_dev,
"still open, forcing close\n");
(*linesw[tp->t_line].l_close)(tp, 0);
ttyld_close(tp, 0);
ttyclose(tp);
}
} else {
@ -385,7 +385,7 @@ ucomopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
*/
if (ISSET(sc->sc_msr, UMSR_DCD) ||
(minor(dev) & UCOM_CALLOUT_MASK))
(*linesw[tp->t_line].l_modem)(tp, 1);
ttyld_modem(tp, 1);
ucomstartread(sc);
}
@ -398,7 +398,7 @@ ucomopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
if (error)
goto bad;
error = (*linesw[tp->t_line].l_open)(dev, tp);
error = ttyld_open(tp, dev);
if (error)
goto bad;
@ -461,7 +461,7 @@ ucomclose(dev_t dev, int flag, int mode, usb_proc_ptr p)
goto quit;
s = spltty();
(*linesw[tp->t_line].l_close)(tp, flag);
ttyld_close(tp, flag);
disc_optim(tp, &tp->t_termios, sc);
ttyclose(tp);
splx(s);
@ -503,7 +503,7 @@ ucomread(dev_t dev, struct uio *uio, int flag)
if (sc->sc_dying)
return (EIO);
error = (*linesw[tp->t_line].l_read)(tp, uio, flag);
error = ttyld_read(tp, uio, flag);
DPRINTF(("ucomread: error = %d\n", error));
@ -525,7 +525,7 @@ ucomwrite(dev_t dev, struct uio *uio, int flag)
if (sc->sc_dying)
return (EIO);
error = (*linesw[tp->t_line].l_write)(tp, uio, flag);
error = ttyld_write(tp, uio, flag);
DPRINTF(("ucomwrite: error = %d\n", error));
@ -762,7 +762,7 @@ ucom_status_change(struct ucom_softc *sc)
return;
onoff = ISSET(sc->sc_msr, UMSR_DCD) ? 1 : 0;
DPRINTF(("ucom_status_change: DCD changed to %d\n", onoff));
(*linesw[tp->t_line].l_modem)(tp, onoff);
ttyld_modem(tp, onoff);
}
}
@ -993,7 +993,7 @@ ucomwritecb(usbd_xfer_handle xfer, usbd_private_handle p, usbd_status status)
CLR(tp->t_state, TS_FLUSH);
else
ndflush(&tp->t_outq, cc);
(*linesw[tp->t_line].l_start)(tp);
ttyld_start(tp);
splx(s);
return;

View File

@ -436,13 +436,13 @@ zstty_softintr(struct zstty_softc *sc)
if (sc->sc_iget == sc->sc_ibuf + sizeof(sc->sc_ibuf))
sc->sc_iget = sc->sc_ibuf;
(*linesw[tp->t_line].l_rint)(data, tp);
ttyld_rint(tp, data);
}
if (sc->sc_tx_done != 0) {
sc->sc_tx_done = 0;
tp->t_state &= ~TS_BUSY;
(*linesw[tp->t_line].l_start)(tp);
ttyld_start(tp);
}
}
@ -495,7 +495,7 @@ zsttyopen(dev_t dev, int flags, int mode, struct thread *td)
if (error != 0)
return (error);
error = (*linesw[tp->t_line].l_open)(dev, tp);
error = ttyld_open(tp, dev);
if (error != 0)
return (error);
@ -512,7 +512,7 @@ zsttyclose(dev_t dev, int flags, int mode, struct thread *td)
if ((tp->t_state & TS_ISOPEN) == 0)
return (0);
(*linesw[tp->t_line].l_close)(tp, flags);
ttyld_close(tp, flags);
ttyclose(tp);
return (0);

View File

@ -304,7 +304,7 @@ pcvt_open(dev_t dev, int flag, int mode, struct thread *td)
tp->t_lflag = TTYDEF_LFLAG;
tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
pcvt_param(tp, &tp->t_termios);
(*linesw[tp->t_line].l_modem)(tp, 1); /* fake connection */
ttyld_modem(tp, 1); /* fake connection */
winsz = 1; /* set winsize later */
}
else if (tp->t_state & TS_XCLUDE && suser(td))
@ -312,7 +312,7 @@ pcvt_open(dev_t dev, int flag, int mode, struct thread *td)
return (EBUSY);
}
retval = ((*linesw[tp->t_line].l_open)(dev, tp));
retval = (ttyld_open(tp, dev));
if(winsz == 1)
{
@ -352,7 +352,7 @@ pcvt_close(dev_t dev, int flag, int mode, struct thread *td)
tp = pcvt_tty[i];
(*linesw[tp->t_line].l_close)(tp, flag);
ttyld_close(tp, flag);
ttyclose(tp);
@ -442,13 +442,13 @@ pcvt_timeout(void *arg)
if(*cp == '\0')
{
/* pass a NULL character */
(*linesw[tp->t_line].l_rint)('\0', tp);
ttyld_rint(tp, '\0');
}
/* XXX */ else
#endif /* PCVT_NULLCHARS */
while (*cp)
(*linesw[tp->t_line].l_rint)(*cp++ & 0xff, tp);
ttyld_rint(tp, *cp++ & 0xff);
}
PCVT_DISABLE_INTR ();

View File

@ -164,7 +164,7 @@ sscopen(dev_t dev, int flag, int mode, struct thread *td)
splx(s);
error = (*linesw[tp->t_line].l_open)(dev, tp);
error = ttyld_open(tp, dev);
if (error == 0 && setuptimeout) {
polltime = hz / SSC_POLL_HZ;
@ -185,7 +185,7 @@ sscclose(dev_t dev, int flag, int mode, struct thread *td)
return ENXIO;
untimeout(ssctimeout, tp, ssctimeouthandle);
(*linesw[tp->t_line].l_close)(tp, flag);
ttyld_close(tp, flag);
ttyclose(tp);
return 0;
}
@ -242,7 +242,7 @@ ssctimeout(void *v)
while ((c = ssccncheckc(NULL)) != -1) {
if (tp->t_state & TS_ISOPEN)
(*linesw[tp->t_line].l_rint)(c, tp);
ttyld_rint(tp, c);
}
ssctimeouthandle = timeout(ssctimeout, tp, polltime);
}

View File

@ -1014,10 +1014,10 @@ ttioctl(struct tty *tp, u_long cmd, void *data, int flag)
return (ENXIO);
if (t != tp->t_line) {
s = spltty();
(*linesw[tp->t_line].l_close)(tp, flag);
ttyld_close(tp, flag);
error = (*linesw[t].l_open)(device, tp);
if (error) {
(void)(*linesw[tp->t_line].l_open)(device, tp);
(void)ttyld_open(tp, device);
splx(s);
return (error);
}
@ -1042,7 +1042,7 @@ ttioctl(struct tty *tp, u_long cmd, void *data, int flag)
if (!isctty(p, tp) && suser(td))
return (EACCES);
s = spltty();
(*linesw[tp->t_line].l_rint)(*(u_char *)data, tp);
ttyld_rint(tp, *(u_char *)data);
splx(s);
break;
case TIOCSTOP: /* stop output, like ^S */
@ -2728,7 +2728,7 @@ ttyread(dev_t dev, struct uio *uio, int flag)
("ttyread(): no tty pointer on device (%s)", devtoname(dev)));
if (tp == NULL)
return (ENODEV);
return ((*linesw[tp->t_line].l_read)(tp, uio, flag));
return (ttyld_read(tp, uio, flag));
}
int
@ -2743,7 +2743,7 @@ ttywrite(dev_t dev, struct uio *uio, int flag)
("ttywrite(): no tty pointer on device (%s)", devtoname(dev)));
if (tp == NULL)
return (ENODEV);
return ((*linesw[tp->t_line].l_write)(tp, uio, flag));
return (ttyld_write(tp, uio, flag));
}
int

View File

@ -182,7 +182,7 @@ ptsopen(dev, flag, devtype, td)
else if (pti->pt_prison != td->td_ucred->cr_prison)
return (EBUSY);
if (tp->t_oproc) /* Ctrlr still around. */
(void)(*linesw[tp->t_line].l_modem)(tp, 1);
(void)ttyld_modem(tp, 1);
while ((tp->t_state & TS_CARR_ON) == 0) {
if (flag&FNONBLOCK)
break;
@ -191,7 +191,7 @@ ptsopen(dev, flag, devtype, td)
if (error)
return (error);
}
error = (*linesw[tp->t_line].l_open)(dev, tp);
error = ttyld_open(tp, dev);
if (error == 0)
ptcwakeup(tp, FREAD|FWRITE);
return (error);
@ -207,7 +207,7 @@ ptsclose(dev, flag, mode, td)
int err;
tp = dev->si_tty;
err = (*linesw[tp->t_line].l_close)(tp, flag);
err = ttyld_close(tp, flag);
(void) ttyclose(tp);
return (err);
}
@ -268,7 +268,7 @@ ptsread(dev, uio, flag)
return (error);
} else
if (tp->t_oproc)
error = (*linesw[tp->t_line].l_read)(tp, uio, flag);
error = ttyld_read(tp, uio, flag);
ptcwakeup(tp, FWRITE);
return (error);
}
@ -289,7 +289,7 @@ ptswrite(dev, uio, flag)
tp = dev->si_tty;
if (tp->t_oproc == 0)
return (EIO);
return ((*linesw[tp->t_line].l_write)(tp, uio, flag));
return (ttyld_write(tp, uio, flag));
}
/*
@ -347,7 +347,7 @@ ptcopen(dev, flag, devtype, td)
tp->t_timeout = -1;
tp->t_oproc = ptsstart;
tp->t_stop = ptsstop;
(void)(*linesw[tp->t_line].l_modem)(tp, 1);
(void)ttyld_modem(tp, 1);
tp->t_lflag &= ~EXTPROC;
pti = dev->si_drv1;
pti->pt_prison = td->td_ucred->cr_prison;
@ -367,7 +367,7 @@ ptcclose(dev, flags, fmt, td)
struct tty *tp;
tp = dev->si_tty;
(void)(*linesw[tp->t_line].l_modem)(tp, 0);
(void)ttyld_modem(tp, 0);
/*
* XXX MDMBUF makes no sense for ptys but would inhibit the above
@ -600,7 +600,7 @@ ptcwrite(dev, uio, flag)
wakeup(TSA_HUP_OR_INPUT(tp));
goto block;
}
(*linesw[tp->t_line].l_rint)(*cp++, tp);
ttyld_rint(tp, *cp++);
cnt++;
cc--;
}

View File

@ -782,7 +782,7 @@ siodetach(dev)
com->ioportres);
if (com->tp && (com->tp->t_state & TS_ISOPEN)) {
device_printf(dev, "still open, forcing close\n");
(*linesw[com->tp->t_line].l_close)(com->tp, 0);
ttyld_close(com->tp, 0);
ttyclose(com->tp);
} else {
if (com->ibuf != NULL)
@ -2048,10 +2048,10 @@ sioopen(dev, flag, mode, td)
(!IS_8251(com->pc98_if_type) &&
(com->prev_modem_status & MSR_DCD)) ||
mynor & CALLOUT_MASK)
(*linesw[tp->t_line].l_modem)(tp, 1);
ttyld_modem(tp, 1);
#else
if (com->prev_modem_status & MSR_DCD || mynor & CALLOUT_MASK)
(*linesw[tp->t_line].l_modem)(tp, 1);
ttyld_modem(tp, 1);
#endif
}
/*
@ -2068,7 +2068,7 @@ sioopen(dev, flag, mode, td)
goto out;
goto open_top;
}
error = (*linesw[tp->t_line].l_open)(dev, tp);
error = ttyld_open(tp, dev);
disc_optim(tp, &tp->t_termios, com);
if (tp->t_state & TS_ISOPEN && mynor & CALLOUT_MASK)
com->active_out = TRUE;
@ -2100,7 +2100,7 @@ sioclose(dev, flag, mode, td)
return (ENODEV);
tp = com->tp;
s = spltty();
(*linesw[tp->t_line].l_close)(tp, flag);
ttyld_close(tp, flag);
#ifdef PC98
com->modem_checking = 0;
#endif
@ -2236,7 +2236,7 @@ sioread(dev, uio, flag)
com = com_addr(MINOR_TO_UNIT(mynor));
if (com == NULL || com->gone)
return (ENODEV);
return ((*linesw[com->tp->t_line].l_read)(com->tp, uio, flag));
return (ttyld_read(com->tp, uio, flag));
}
static int
@ -2265,7 +2265,7 @@ siowrite(dev, uio, flag)
*/
if (constty != NULL && unit == comconsole)
constty = NULL;
return ((*linesw[com->tp->t_line].l_write)(com->tp, uio, flag));
return (ttyld_write(com->tp, uio, flag));
}
static void
@ -2430,7 +2430,7 @@ sioinput(com)
if (line_status & LSR_PE)
recv_data |= TTY_PE;
}
(*linesw[tp->t_line].l_rint)(recv_data, tp);
ttyld_rint(tp, recv_data);
mtx_lock_spin(&sio_lock);
} while (buf < com->iptr);
}
@ -3218,7 +3218,7 @@ siopoll(void *dummy)
timeout(siobusycheck, com, hz / 100);
com->extra_state |= CSE_BUSYCHECK;
}
(*linesw[tp->t_line].l_start)(tp);
ttyld_start(tp);
}
if (com_events == 0)
break;
@ -3886,8 +3886,8 @@ commint(dev_t dev)
}
if ((delta & TIOCM_CAR) && (mynor & CALLOUT_MASK) == 0) {
if (stat & TIOCM_CAR )
(void)(*linesw[tp->t_line].l_modem)(tp, 1);
else if ((*linesw[tp->t_line].l_modem)(tp, 0) == 0) {
(void)ttyld_modem(tp, 1);
else if (ttyld_modem(tp, 0) == 0) {
/* negate DTR, RTS */
com_tiocm_bic(com, (tp->t_cflag & HUPCL) ?
TIOCM_DTR|TIOCM_RTS|TIOCM_LE : TIOCM_LE );

View File

@ -782,7 +782,7 @@ siodetach(dev)
com->ioportres);
if (com->tp && (com->tp->t_state & TS_ISOPEN)) {
device_printf(dev, "still open, forcing close\n");
(*linesw[com->tp->t_line].l_close)(com->tp, 0);
ttyld_close(com->tp, 0);
ttyclose(com->tp);
} else {
if (com->ibuf != NULL)
@ -2048,10 +2048,10 @@ sioopen(dev, flag, mode, td)
(!IS_8251(com->pc98_if_type) &&
(com->prev_modem_status & MSR_DCD)) ||
mynor & CALLOUT_MASK)
(*linesw[tp->t_line].l_modem)(tp, 1);
ttyld_modem(tp, 1);
#else
if (com->prev_modem_status & MSR_DCD || mynor & CALLOUT_MASK)
(*linesw[tp->t_line].l_modem)(tp, 1);
ttyld_modem(tp, 1);
#endif
}
/*
@ -2068,7 +2068,7 @@ sioopen(dev, flag, mode, td)
goto out;
goto open_top;
}
error = (*linesw[tp->t_line].l_open)(dev, tp);
error = ttyld_open(tp, dev);
disc_optim(tp, &tp->t_termios, com);
if (tp->t_state & TS_ISOPEN && mynor & CALLOUT_MASK)
com->active_out = TRUE;
@ -2100,7 +2100,7 @@ sioclose(dev, flag, mode, td)
return (ENODEV);
tp = com->tp;
s = spltty();
(*linesw[tp->t_line].l_close)(tp, flag);
ttyld_close(tp, flag);
#ifdef PC98
com->modem_checking = 0;
#endif
@ -2236,7 +2236,7 @@ sioread(dev, uio, flag)
com = com_addr(MINOR_TO_UNIT(mynor));
if (com == NULL || com->gone)
return (ENODEV);
return ((*linesw[com->tp->t_line].l_read)(com->tp, uio, flag));
return (ttyld_read(com->tp, uio, flag));
}
static int
@ -2265,7 +2265,7 @@ siowrite(dev, uio, flag)
*/
if (constty != NULL && unit == comconsole)
constty = NULL;
return ((*linesw[com->tp->t_line].l_write)(com->tp, uio, flag));
return (ttyld_write(com->tp, uio, flag));
}
static void
@ -2430,7 +2430,7 @@ sioinput(com)
if (line_status & LSR_PE)
recv_data |= TTY_PE;
}
(*linesw[tp->t_line].l_rint)(recv_data, tp);
ttyld_rint(tp, recv_data);
mtx_lock_spin(&sio_lock);
} while (buf < com->iptr);
}
@ -3218,7 +3218,7 @@ siopoll(void *dummy)
timeout(siobusycheck, com, hz / 100);
com->extra_state |= CSE_BUSYCHECK;
}
(*linesw[tp->t_line].l_start)(tp);
ttyld_start(tp);
}
if (com_events == 0)
break;
@ -3886,8 +3886,8 @@ commint(dev_t dev)
}
if ((delta & TIOCM_CAR) && (mynor & CALLOUT_MASK) == 0) {
if (stat & TIOCM_CAR )
(void)(*linesw[tp->t_line].l_modem)(tp, 1);
else if ((*linesw[tp->t_line].l_modem)(tp, 0) == 0) {
(void)ttyld_modem(tp, 1);
else if (ttyld_modem(tp, 0) == 0) {
/* negate DTR, RTS */
com_tiocm_bic(com, (tp->t_cflag & HUPCL) ?
TIOCM_DTR|TIOCM_RTS|TIOCM_LE : TIOCM_LE );