Manual edits to change linesw[]-frobbing to ttyld_*() calls.
This commit is contained in:
parent
8a9a490ba2
commit
fe3ec6224a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=130095
@ -111,6 +111,16 @@ __FBSDID("$FreeBSD$");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if __FreeBSD_version < 502113
|
||||
#define ttyld_modem(foo, bar) ((*linesw[(foo)->t_line].l_modem)((foo), (bar)))
|
||||
#define ttyld_rint(foo, bar) ((*linesw[(foo)->t_line].l_rint)((bar), (foo)))
|
||||
#define ttyld_start(foo) ((*linesw[(foo)->t_line].l_start)((foo)))
|
||||
#define ttyld_open(foo, bar) ((*linesw[(foo)->t_line].l_open) ((bar), (foo)))
|
||||
#define ttyld_close(foo, bar) ((*linesw[(foo)->t_line].l_close) ((foo), (bar)))
|
||||
#define ttyld_read(foo, bar, barf) ((*linesw[(foo)->t_line].l_read) ((foo), (bar), (barf)))
|
||||
#define ttyld_write(foo, bar, barf) ((*linesw[(foo)->t_line].l_write) ((foo), (bar), (barf)))
|
||||
#endif
|
||||
|
||||
/* If we don't have Cronyx's sppp version, we don't have fr support via sppp */
|
||||
#ifndef PP_FR
|
||||
#define PP_FR 0
|
||||
@ -1632,7 +1642,7 @@ static int cx_open (dev_t dev, int flag, int mode, struct thread *td)
|
||||
cx_set_rts (d->chan, 1);
|
||||
d->cd = cx_get_cd (d->chan);
|
||||
if (CALLOUT (dev) || cx_get_cd (d->chan))
|
||||
(*linesw[d->tty.t_line].l_modem) (&d->tty, 1);
|
||||
ttyld_modem(&d->tty, 1);
|
||||
}
|
||||
|
||||
if (! (flag & O_NONBLOCK) && ! (d->tty.t_cflag & CLOCAL) &&
|
||||
@ -1649,7 +1659,7 @@ static int cx_open (dev_t dev, int flag, int mode, struct thread *td)
|
||||
goto again;
|
||||
}
|
||||
|
||||
error = (*linesw[d->tty.t_line].l_open) (dev, &d->tty);
|
||||
error = ttyld_open (&d->tty, dev);
|
||||
disc_optim (&d->tty, &d->tty.t_termios);
|
||||
spl0 ();
|
||||
if (error) {
|
||||
@ -1690,7 +1700,7 @@ static int cx_close (dev_t dev, int flag, int mode, struct thread *td)
|
||||
return 0;
|
||||
}
|
||||
s = splhigh ();
|
||||
(*linesw[d->tty.t_line].l_close) (&d->tty, flag);
|
||||
ttyld_close(&d->tty, flag);
|
||||
disc_optim (&d->tty, &d->tty.t_termios);
|
||||
|
||||
/* Disable receiver.
|
||||
@ -1726,7 +1736,7 @@ static int cx_read (dev_t dev, struct uio *uio, int flag)
|
||||
if (!d || d->chan->mode != M_ASYNC || IF_CUNIT(dev))
|
||||
return EBADF;
|
||||
|
||||
return (*linesw[d->tty.t_line].l_read) (&d->tty, uio, flag);
|
||||
return ttyld_read (&d->tty, uio, flag);
|
||||
}
|
||||
|
||||
static int cx_write (dev_t dev, struct uio *uio, int flag)
|
||||
@ -1737,7 +1747,7 @@ static int cx_write (dev_t dev, struct uio *uio, int flag)
|
||||
if (!d || d->chan->mode != M_ASYNC || IF_CUNIT(dev))
|
||||
return EBADF;
|
||||
|
||||
return (*linesw[d->tty.t_line].l_write) (&d->tty, uio, flag);
|
||||
return ttyld_write (&d->tty, uio, flag);
|
||||
}
|
||||
|
||||
static int cx_modem_status (drv_t *d)
|
||||
@ -2305,8 +2315,7 @@ void cx_softintr ()
|
||||
while (q->end != q->beg) {
|
||||
AQ_POP (q, ic);
|
||||
splx (s);
|
||||
(*linesw[d->tty.t_line].l_rint)
|
||||
(ic, &d->tty);
|
||||
ttyld_rint (&d->tty, ic);
|
||||
s = splhigh ();
|
||||
}
|
||||
}
|
||||
@ -2317,7 +2326,7 @@ void cx_softintr ()
|
||||
s = splhigh ();
|
||||
if (d->intr_action & CX_WRITE) {
|
||||
if (d->tty.t_line)
|
||||
(*linesw[d->tty.t_line].l_start) (&d->tty);
|
||||
ttyld_start (&d->tty);
|
||||
else
|
||||
cx_oproc (&d->tty);
|
||||
d->intr_action &= ~CX_WRITE;
|
||||
@ -2500,12 +2509,12 @@ static void cx_carrier (void *arg)
|
||||
CX_DEBUG (d, ("carrier on\n"));
|
||||
d->cd = 1;
|
||||
splx (s);
|
||||
(*linesw[d->tty.t_line].l_modem) (&d->tty, 1);
|
||||
ttyld_modem(&d->tty, 1);
|
||||
} else {
|
||||
CX_DEBUG (d, ("carrier loss\n"));
|
||||
d->cd = 0;
|
||||
splx (s);
|
||||
(*linesw[d->tty.t_line].l_modem) (&d->tty, 0);
|
||||
ttyld_modem(&d->tty, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1745,8 +1745,8 @@ siopoll(void *arg)
|
||||
COM_UNLOCK();
|
||||
critical_exit();
|
||||
if (delta_modem_status & MSR_DCD)
|
||||
(*linesw[tp->t_line].l_modem)
|
||||
(tp, com->prev_modem_status & MSR_DCD);
|
||||
ttyld_modem(tp,
|
||||
com->prev_modem_status & MSR_DCD);
|
||||
}
|
||||
if (com->extra_state & CSE_ODONE) {
|
||||
critical_enter();
|
||||
|
@ -1601,8 +1601,7 @@ digi_intr(void *vp)
|
||||
tail = top - size;
|
||||
ttwakeup(tp);
|
||||
} else for (; tail < top;) {
|
||||
linesw[tp->t_line].
|
||||
l_rint(port->rxbuf[tail], tp);
|
||||
ttyld_rint(tp, port->rxbuf[tail]);
|
||||
sc->towin(sc, port->rxwin);
|
||||
size--;
|
||||
tail++;
|
||||
@ -1641,8 +1640,7 @@ digi_intr(void *vp)
|
||||
|
||||
if ((event.mstat ^ event.lstat) & port->cd) {
|
||||
sc->hidewin(sc);
|
||||
linesw[tp->t_line].l_modem
|
||||
(tp, event.mstat & port->cd);
|
||||
ttyld_modem(tp, event.mstat & port->cd);
|
||||
sc->setwin(sc, 0);
|
||||
wakeup(TSA_CARR_ON(tp));
|
||||
}
|
||||
|
@ -798,9 +798,9 @@ rc_pollcard(void *arg)
|
||||
}
|
||||
} else {
|
||||
for (; tptr < eptr; tptr++)
|
||||
(*linesw[tp->t_line].l_rint)
|
||||
ttyld_rint(tp,
|
||||
(tptr[0] |
|
||||
rc_rcsrt[tptr[INPUT_FLAGS_SHIFT] & 0xF], tp);
|
||||
rc_rcsrt[tptr[INPUT_FLAGS_SHIFT] & 0xF]));
|
||||
}
|
||||
done1: ;
|
||||
}
|
||||
|
@ -2163,8 +2163,8 @@ siopoll(void *dummy)
|
||||
com->state &= ~CS_CHECKMSR;
|
||||
mtx_unlock_spin(&sio_lock);
|
||||
if (delta_modem_status & MSR_DCD)
|
||||
(*linesw[tp->t_line].l_modem)
|
||||
(tp, com->prev_modem_status & MSR_DCD);
|
||||
ttyld_modem(tp,
|
||||
com->prev_modem_status & MSR_DCD);
|
||||
}
|
||||
if (com->state & CS_ODONE) {
|
||||
mtx_lock_spin(&sio_lock);
|
||||
|
@ -315,8 +315,7 @@ sysmouse_event(mouse_info_t *info)
|
||||
/* buttons 4-10 */
|
||||
buf[7] = (~mouse_status.button >> 3) & 0x7f;
|
||||
for (i = MOUSE_MSC_PACKETSIZE; i < MOUSE_SYS_PACKETSIZE; ++i)
|
||||
(*linesw[sysmouse_tty->t_line].l_rint)(buf[i],
|
||||
sysmouse_tty);
|
||||
ttyld_rint(sysmouse_tty, buf[i]);
|
||||
}
|
||||
|
||||
return mouse_status.flags;
|
||||
|
@ -736,7 +736,6 @@ ubserreadcb(usbd_xfer_handle xfer, usbd_private_handle p, usbd_status status)
|
||||
{
|
||||
struct ubser_softc *sc = (struct ubser_softc *)p;
|
||||
struct tty *tp;
|
||||
int (*rint) (int, struct tty *);
|
||||
usbd_status err;
|
||||
u_int32_t cc;
|
||||
u_char *cp;
|
||||
@ -771,7 +770,6 @@ ubserreadcb(usbd_xfer_handle xfer, usbd_private_handle p, usbd_status status)
|
||||
goto resubmit;
|
||||
DPRINTF(("ubserreadcb: got %d chars for serial %d\n", cc - 1, *cp));
|
||||
tp = sc->dev[*cp]->si_tty;
|
||||
rint = linesw[tp->t_line].l_rint;
|
||||
cp++;
|
||||
cc--;
|
||||
|
||||
@ -804,7 +802,7 @@ ubserreadcb(usbd_xfer_handle xfer, usbd_private_handle p, usbd_status status)
|
||||
/* Give characters to tty layer. */
|
||||
while (cc > 0) {
|
||||
DPRINTFN(7, ("ubserreadcb: char = 0x%02x\n", *cp));
|
||||
if ((*rint)(*cp, tp) == -1) {
|
||||
if (ttyld_rint(tp, *cp) == -1) {
|
||||
/* XXX what should we do? */
|
||||
printf("%s: lost %d chars\n",
|
||||
USBDEVNAME(sc->sc_dev), cc);
|
||||
|
@ -1037,7 +1037,6 @@ ucomreadcb(usbd_xfer_handle xfer, usbd_private_handle p, usbd_status status)
|
||||
{
|
||||
struct ucom_softc *sc = (struct ucom_softc *)p;
|
||||
struct tty *tp = sc->sc_tty;
|
||||
int (*rint) (int c, struct tty *tp) = linesw[tp->t_line].l_rint;
|
||||
usbd_status err;
|
||||
u_int32_t cc;
|
||||
u_char *cp;
|
||||
@ -1097,7 +1096,7 @@ ucomreadcb(usbd_xfer_handle xfer, usbd_private_handle p, usbd_status status)
|
||||
/* Give characters to tty layer. */
|
||||
while (cc > 0) {
|
||||
DPRINTFN(7, ("ucomreadcb: char = 0x%02x\n", *cp));
|
||||
if ((*rint)(*cp, tp) == -1) {
|
||||
if (ttyld_rint(tp, *cp) == -1) {
|
||||
/* XXX what should we do? */
|
||||
printf("%s: lost %d chars\n",
|
||||
USBDEVNAME(sc->sc_dev), cc);
|
||||
|
@ -2078,8 +2078,7 @@ respond(struct video_state *svsp)
|
||||
|
||||
while (*svsp->report_chars && svsp->report_count > 0)
|
||||
{
|
||||
(*linesw[svsp->vs_tty->t_line].l_rint)
|
||||
(*svsp->report_chars++ & 0xff, svsp->vs_tty);
|
||||
ttyld_rint(svsp->vs_tty, *svsp->report_chars++ & 0xff);
|
||||
svsp->report_count--;
|
||||
}
|
||||
}
|
||||
|
@ -2753,7 +2753,7 @@ ttyioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
|
||||
int error;
|
||||
|
||||
tp = dev->si_tty;
|
||||
error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, td);
|
||||
error = ttyld_ioctl(tp, cmd, data, flag, td);
|
||||
if (error == ENOIOCTL)
|
||||
error = ttioctl(tp, cmd, data, flag);
|
||||
if (error != ENOIOCTL)
|
||||
|
@ -3202,8 +3202,8 @@ siopoll(void *dummy)
|
||||
com->state &= ~CS_CHECKMSR;
|
||||
mtx_unlock_spin(&sio_lock);
|
||||
if (delta_modem_status & MSR_DCD)
|
||||
(*linesw[tp->t_line].l_modem)
|
||||
(tp, com->prev_modem_status & MSR_DCD);
|
||||
ttyld_modem(tp,
|
||||
com->prev_modem_status & MSR_DCD);
|
||||
#ifdef PC98
|
||||
}
|
||||
#endif
|
||||
|
@ -3202,8 +3202,8 @@ siopoll(void *dummy)
|
||||
com->state &= ~CS_CHECKMSR;
|
||||
mtx_unlock_spin(&sio_lock);
|
||||
if (delta_modem_status & MSR_DCD)
|
||||
(*linesw[tp->t_line].l_modem)
|
||||
(tp, com->prev_modem_status & MSR_DCD);
|
||||
ttyld_modem(tp,
|
||||
com->prev_modem_status & MSR_DCD);
|
||||
#ifdef PC98
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user