summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-06-04 16:02:56 +0000
committerphk <phk@FreeBSD.org>2004-06-04 16:02:56 +0000
commitba3920e2a2eb1a3101ab8286d24d58fef6fd73aa (patch)
tree3337821fdd2a353d2216412ea8dd39eb5e65f007 /sys/dev
parent958f9d7c7609eaa9fcabd83035ded33f80da2f0d (diff)
downloadFreeBSD-src-ba3920e2a2eb1a3101ab8286d24d58fef6fd73aa.zip
FreeBSD-src-ba3920e2a2eb1a3101ab8286d24d58fef6fd73aa.tar.gz
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.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/cy/cy.c12
-rw-r--r--sys/dev/dcons/dcons.c8
-rw-r--r--sys/dev/digi/digi.c26
-rw-r--r--sys/dev/nmdm/nmdm.c8
-rw-r--r--sys/dev/ofw/ofw_console.c6
-rw-r--r--sys/dev/rc/rc.c10
-rw-r--r--sys/dev/rp/rp.c20
-rw-r--r--sys/dev/sab/sab.c8
-rw-r--r--sys/dev/si/si.c20
-rw-r--r--sys/dev/sio/sio.c16
-rw-r--r--sys/dev/sx/sx.c18
-rw-r--r--sys/dev/syscons/syscons.c22
-rw-r--r--sys/dev/syscons/sysmouse.c8
-rw-r--r--sys/dev/uart/uart_tty.c16
-rw-r--r--sys/dev/usb/ubser.c14
-rw-r--r--sys/dev/usb/ucom.c16
-rw-r--r--sys/dev/zs/zs.c8
17 files changed, 118 insertions, 118 deletions
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c
index c6e7220..8e1a56c 100644
--- a/sys/dev/cy/cy.c
+++ b/sys/dev/cy/cy.c
@@ -748,7 +748,7 @@ open_top:
* 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 @@ open_top:
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 @@ repeat:
com->state &= ~CS_ODONE;
COM_UNLOCK();
critical_exit();
- (*linesw[tp->t_line].l_start)(tp);
+ ttyld_start(tp);
}
if (com_events == 0)
break;
diff --git a/sys/dev/dcons/dcons.c b/sys/dev/dcons/dcons.c
index 1734466..3a5e302 100644
--- a/sys/dev/dcons/dcons.c
+++ b/sys/dev/dcons/dcons.c
@@ -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
diff --git a/sys/dev/digi/digi.c b/sys/dev/digi/digi.c
index 06d8d18..122fc2f 100644
--- a/sys/dev/digi/digi.c
+++ b/sys/dev/digi/digi.c
@@ -832,7 +832,7 @@ open_top:
/* 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 @@ open_top:
}
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 @@ end_of_data:
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;
diff --git a/sys/dev/nmdm/nmdm.c b/sys/dev/nmdm/nmdm.c
index 8855a27..cb25ecb 100644
--- a/sys/dev/nmdm/nmdm.c
+++ b/sys/dev/nmdm/nmdm.c
@@ -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);
}
diff --git a/sys/dev/ofw/ofw_console.c b/sys/dev/ofw/ofw_console.c
index 04ba580..fde41e6 100644
--- a/sys/dev/ofw/ofw_console.c
+++ b/sys/dev/ofw/ofw_console.c
@@ -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);
}
}
diff --git a/sys/dev/rc/rc.c b/sys/dev/rc/rc.c
index 14b3c96..319fa1d 100644
--- a/sys/dev/rc/rc.c
+++ b/sys/dev/rc/rc.c
@@ -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 @@ again:
(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 @@ again:
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);
diff --git a/sys/dev/rp/rp.c b/sys/dev/rp/rp.c
index feff480..f99f403 100644
--- a/sys/dev/rp/rp.c
+++ b/sys/dev/rp/rp.c
@@ -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 @@ open_top:
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 @@ open_top:
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;
}
diff --git a/sys/dev/sab/sab.c b/sys/dev/sab/sab.c
index e546e24..0193431 100644
--- a/sys/dev/sab/sab.c
+++ b/sys/dev/sab/sab.c
@@ -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);
diff --git a/sys/dev/si/si.c b/sys/dev/si/si.c
index b4f8f07..4411d21 100644
--- a/sys/dev/si/si.c
+++ b/sys/dev/si/si.c
@@ -714,7 +714,7 @@ open_top:
/* 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 @@ open_top:
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);
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index ce064c4..6388387 100644
--- a/sys/dev/sio/sio.c
+++ b/sys/dev/sio/sio.c
@@ -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 @@ open_top:
* 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 @@ open_top:
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 @@ repeat:
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;
diff --git a/sys/dev/sx/sx.c b/sys/dev/sx/sx.c
index b3e1cf2..68266bd 100644
--- a/sys/dev/sx/sx.c
+++ b/sys/dev/sx/sx.c
@@ -453,7 +453,7 @@ open_top:
/* 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 @@ open_top:
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;
}
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c
index eb685cf..0608ce5 100644
--- a/sys/dev/syscons/syscons.c
+++ b/sys/dev/syscons/syscons.c
@@ -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
diff --git a/sys/dev/syscons/sysmouse.c b/sys/dev/syscons/sysmouse.c
index b513500..69c0ef3 100644
--- a/sys/dev/syscons/sysmouse.c
+++ b/sys/dev/syscons/sysmouse.c
@@ -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);
diff --git a/sys/dev/uart/uart_tty.c b/sys/dev/uart/uart_tty.c
index 6867299a..f42a7dc 100644
--- a/sys/dev/uart/uart_tty.c
+++ b/sys/dev/uart/uart_tty.c
@@ -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));
diff --git a/sys/dev/usb/ubser.c b/sys/dev/usb/ubser.c
index 59ad8d5..f64fd0e 100644
--- a/sys/dev/usb/ubser.c
+++ b/sys/dev/usb/ubser.c
@@ -440,7 +440,7 @@ bad:
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));
diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c
index e3cf7b6..07d4496 100644
--- a/sys/dev/usb/ucom.c
+++ b/sys/dev/usb/ucom.c
@@ -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;
diff --git a/sys/dev/zs/zs.c b/sys/dev/zs/zs.c
index 6de28ed..4695526 100644
--- a/sys/dev/zs/zs.c
+++ b/sys/dev/zs/zs.c
@@ -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);
OpenPOWER on IntegriCloud