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