summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-06-04 20:04:52 +0000
committerphk <phk@FreeBSD.org>2004-06-04 20:04:52 +0000
commit06049d3eaf941ee534b340558daac059b6b18912 (patch)
treed6e215bcf253e083595c541ae5d094a1d2c280e4 /sys/dev
parentdb23e347ebdfd57136333ee5b06a73eb4fe8f2c0 (diff)
downloadFreeBSD-src-06049d3eaf941ee534b340558daac059b6b18912.zip
FreeBSD-src-06049d3eaf941ee534b340558daac059b6b18912.tar.gz
Manual edits to change linesw[]-frobbing to ttyld_*() calls.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/cx/if_cx.c29
-rw-r--r--sys/dev/cy/cy.c4
-rw-r--r--sys/dev/digi/digi.c6
-rw-r--r--sys/dev/rc/rc.c4
-rw-r--r--sys/dev/sio/sio.c4
-rw-r--r--sys/dev/syscons/sysmouse.c3
-rw-r--r--sys/dev/usb/ubser.c4
-rw-r--r--sys/dev/usb/ucom.c3
8 files changed, 30 insertions, 27 deletions
diff --git a/sys/dev/cx/if_cx.c b/sys/dev/cx/if_cx.c
index e69aa42..386d418 100644
--- a/sys/dev/cx/if_cx.c
+++ b/sys/dev/cx/if_cx.c
@@ -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 @@ again:
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 @@ 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);
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);
}
}
}
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c
index 8e1a56c..58abf6a 100644
--- a/sys/dev/cy/cy.c
+++ b/sys/dev/cy/cy.c
@@ -1745,8 +1745,8 @@ repeat:
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();
diff --git a/sys/dev/digi/digi.c b/sys/dev/digi/digi.c
index 122fc2f..d13e50f 100644
--- a/sys/dev/digi/digi.c
+++ b/sys/dev/digi/digi.c
@@ -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 @@ end_of_data:
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));
}
diff --git a/sys/dev/rc/rc.c b/sys/dev/rc/rc.c
index 319fa1d..13d00ff 100644
--- a/sys/dev/rc/rc.c
+++ b/sys/dev/rc/rc.c
@@ -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: ;
}
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index 6388387..f384e31 100644
--- a/sys/dev/sio/sio.c
+++ b/sys/dev/sio/sio.c
@@ -2163,8 +2163,8 @@ repeat:
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);
diff --git a/sys/dev/syscons/sysmouse.c b/sys/dev/syscons/sysmouse.c
index 69c0ef3..ab1cd85 100644
--- a/sys/dev/syscons/sysmouse.c
+++ b/sys/dev/syscons/sysmouse.c
@@ -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;
diff --git a/sys/dev/usb/ubser.c b/sys/dev/usb/ubser.c
index f64fd0e..62d20b1 100644
--- a/sys/dev/usb/ubser.c
+++ b/sys/dev/usb/ubser.c
@@ -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);
diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c
index 07d4496..95ac0ab 100644
--- a/sys/dev/usb/ucom.c
+++ b/sys/dev/usb/ucom.c
@@ -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);
OpenPOWER on IntegriCloud