summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authoreeh <eeh@NetBSD.org>2000-11-02 00:01:44 +0000
committereeh <eeh@NetBSD.org>2000-11-02 00:01:44 +0000
commit507aaec04ced6cd804a4e81ca4b999f0aeb7b4dc (patch)
tree3565ca2b32fd4ed4b11e9061e5e3420d914cd384 /sys/dev
parent52e63ea477c5d9a58c380c159dcd8ceebe81f079 (diff)
Adapt to the new line discipline scheme.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ofw/ofcons.c14
-rw-r--r--sys/dev/pci/cz.c20
-rw-r--r--sys/dev/qbus/dhu.c22
-rw-r--r--sys/dev/qbus/dl.c18
-rw-r--r--sys/dev/qbus/dz.c24
-rw-r--r--sys/dev/qbus/qd.c18
-rw-r--r--sys/dev/sbus/magma.c18
-rw-r--r--sys/dev/usb/ucom.c20
-rw-r--r--sys/dev/wscons/wsdisplay.c22
9 files changed, 88 insertions, 88 deletions
diff --git a/sys/dev/ofw/ofcons.c b/sys/dev/ofw/ofcons.c
index 40055c231de..4e46ddd8915 100644
--- a/sys/dev/ofw/ofcons.c
+++ b/sys/dev/ofw/ofcons.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ofcons.c,v 1.11 2000/04/14 19:31:50 scw Exp $ */
+/* $NetBSD: ofcons.c,v 1.12 2000/11/02 00:01:44 eeh Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -137,7 +137,7 @@ ofcons_open(dev, flag, mode, p)
callout_reset(&sc->sc_poll_ch, 1, ofcons_poll, sc);
}
- return (*linesw[tp->t_line].l_open)(dev, tp);
+ return (*tp->t_linesw->l_open)(dev, tp);
}
int
@@ -151,7 +151,7 @@ ofcons_close(dev, flag, mode, p)
callout_stop(&sc->sc_poll_ch);
sc->of_flags &= ~OFPOLL;
- (*linesw[tp->t_line].l_close)(tp, flag);
+ (*tp->t_linesw->l_close)(tp, flag);
ttyclose(tp);
return 0;
}
@@ -165,7 +165,7 @@ ofcons_read(dev, uio, flag)
struct ofcons_softc *sc = ofcons_cd.cd_devs[minor(dev)];
struct tty *tp = sc->of_tty;
- return (*linesw[tp->t_line].l_read)(tp, uio, flag);
+ return (*tp->t_linesw->l_read)(tp, uio, flag);
}
int
@@ -177,7 +177,7 @@ ofcons_write(dev, uio, flag)
struct ofcons_softc *sc = ofcons_cd.cd_devs[minor(dev)];
struct tty *tp = sc->of_tty;
- return (*linesw[tp->t_line].l_write)(tp, uio, flag);
+ return (*tp->t_linesw->l_write)(tp, uio, flag);
}
int
@@ -192,7 +192,7 @@ ofcons_ioctl(dev, cmd, data, flag, p)
struct tty *tp = sc->of_tty;
int error;
- if ((error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p)) >= 0)
+ if ((error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, p)) >= 0)
return error;
if ((error = ttioctl(tp, cmd, data, flag, p)) >= 0)
return error;
@@ -270,7 +270,7 @@ ofcons_poll(aux)
while (OF_read(stdin, &ch, 1) > 0) {
if (tp && (tp->t_state & TS_ISOPEN))
- (*linesw[tp->t_line].l_rint)(ch, tp);
+ (*tp->t_linesw->l_rint)(ch, tp);
}
callout_reset(&sc->sc_poll_ch, 1, ofcons_poll, sc);
}
diff --git a/sys/dev/pci/cz.c b/sys/dev/pci/cz.c
index bd0b897563f..2ac6c48b538 100644
--- a/sys/dev/pci/cz.c
+++ b/sys/dev/pci/cz.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cz.c,v 1.10 2000/07/28 06:10:54 thorpej Exp $ */
+/* $NetBSD: cz.c,v 1.11 2000/11/02 00:01:45 eeh Exp $ */
/*-
* Copyright (c) 2000 Zembu Labs, Inc.
@@ -776,7 +776,7 @@ cz_intr(void *arg)
if (!ISSET(tp->t_state, TS_ISOPEN))
break;
- (void) (*linesw[tp->t_line].l_modem)(tp,
+ (void) (*tp->t_linesw->l_modem)(tp,
ISSET(C_RS_DCD, CZTTY_CHAN_READ(sc,
CHNCTL_RS_STATUS)));
break;
@@ -814,7 +814,7 @@ cz_intr(void *arg)
* A break is a \000 character with TTY_FE error
* flags set. So TTY_FE by itself works.
*/
- (*linesw[tp->t_line].l_rint)(TTY_FE, tp);
+ (*tp->t_linesw->l_rint)(TTY_FE, tp);
ttwakeup(tp);
wakeup(tp);
break;
@@ -1068,7 +1068,7 @@ czttyopen(dev_t dev, int flags, int mode, struct proc *p)
if (error)
goto bad;
- error = (*linesw[tp->t_line].l_open)(dev, tp);
+ error = (*tp->t_linesw->l_open)(dev, tp);
if (error)
goto bad;
@@ -1101,7 +1101,7 @@ czttyclose(dev_t dev, int flags, int mode, struct proc *p)
if (!ISSET(tp->t_state, TS_ISOPEN))
return (0);
- (*linesw[tp->t_line].l_close)(tp, flags);
+ (*tp->t_linesw->l_close)(tp, flags);
ttyclose(tp);
if (!ISSET(tp->t_state, TS_ISOPEN) && tp->t_wopen == 0) {
@@ -1127,7 +1127,7 @@ czttyread(dev_t dev, struct uio *uio, int flags)
struct cztty_softc *sc = CZTTY_SOFTC(dev);
struct tty *tp = sc->sc_tty;
- return ((*linesw[tp->t_line].l_read)(tp, uio, flags));
+ return ((*tp->t_linesw->l_read)(tp, uio, flags));
}
/*
@@ -1141,7 +1141,7 @@ czttywrite(dev_t dev, struct uio *uio, int flags)
struct cztty_softc *sc = CZTTY_SOFTC(dev);
struct tty *tp = sc->sc_tty;
- return ((*linesw[tp->t_line].l_write)(tp, uio, flags));
+ return ((*tp->t_linesw->l_write)(tp, uio, flags));
}
/*
@@ -1156,7 +1156,7 @@ czttyioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
struct tty *tp = sc->sc_tty;
int s, error;
- error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);
+ error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, p);
if (error >= 0)
return (error);
@@ -1471,7 +1471,7 @@ czttyparam(struct tty *tp, struct termios *t)
* request.
*/
rs_status = CZTTY_CHAN_READ(sc, CHNCTL_RS_STATUS);
- (void) (*linesw[tp->t_line].l_modem)(tp, ISSET(rs_status, C_RS_DCD));
+ (void) (*tp->t_linesw->l_modem)(tp, ISSET(rs_status, C_RS_DCD));
return (0);
}
@@ -1650,7 +1650,7 @@ cztty_receive(struct cztty_softc *sc, struct tty *tp)
#ifdef HOSTRAMCODE
}
#endif
- (*linesw[tp->t_line].l_rint)(ch, tp);
+ (*tp->t_linesw->l_rint)(ch, tp);
get = (get + 1) % size;
done = 1;
}
diff --git a/sys/dev/qbus/dhu.c b/sys/dev/qbus/dhu.c
index 4878b4ca00a..32a772196ad 100644
--- a/sys/dev/qbus/dhu.c
+++ b/sys/dev/qbus/dhu.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dhu.c,v 1.20 2000/06/05 00:09:18 matt Exp $ */
+/* $NetBSD: dhu.c,v 1.21 2000/11/02 00:01:45 eeh Exp $ */
/*
* Copyright (c) 1996 Ken C. Wellsch. All rights reserved.
* Copyright (c) 1992, 1993
@@ -287,10 +287,10 @@ dhurint(arg)
/* Do MDMBUF flow control, wakeup sleeping opens */
if (c & DHU_STAT_DCD) {
if (!(tp->t_state & TS_CARR_ON))
- (void)(*linesw[tp->t_line].l_modem)(tp, 1);
+ (void)(*tp->t_linesw->l_modem)(tp, 1);
}
else if ((tp->t_state & TS_CARR_ON) &&
- (*linesw[tp->t_line].l_modem)(tp, 0) == 0)
+ (*tp->t_linesw->l_modem)(tp, 0) == 0)
(void) dhumctl(sc, line, 0, DMSET);
/* Do CRTSCTS flow control */
@@ -326,7 +326,7 @@ dhurint(arg)
if (c & DHU_RBUF_PARITY_ERR)
cc |= TTY_PE;
- (*linesw[tp->t_line].l_rint)(cc, tp);
+ (*tp->t_linesw->l_rint)(cc, tp);
}
}
@@ -357,8 +357,8 @@ dhuxint(arg)
sc->sc_dhu[line].dhu_state = STATE_IDLE;
- if (tp->t_line)
- (*linesw[tp->t_line].l_start)(tp);
+ if (tp->t_linesw)
+ (*tp->t_linesw->l_start)(tp);
else
dhustart(tp);
}
@@ -425,7 +425,7 @@ dhuopen(dev, flag, mode, p)
(void) splx(s);
if (error)
return (error);
- return ((*linesw[tp->t_line].l_open)(dev, tp));
+ return ((*tp->t_linesw->l_open)(dev, tp));
}
/*ARGSUSED*/
@@ -446,7 +446,7 @@ dhuclose(dev, flag, mode, p)
tp = sc->sc_dhu[line].dhu_tty;
- (*linesw[tp->t_line].l_close)(tp, flag);
+ (*tp->t_linesw->l_close)(tp, flag);
/* Make sure a BREAK state is not left enabled. */
@@ -472,7 +472,7 @@ dhuread(dev, uio, flag)
sc = dhu_cd.cd_devs[DHU_M2U(minor(dev))];
tp = sc->sc_dhu[DHU_LINE(minor(dev))].dhu_tty;
- return ((*linesw[tp->t_line].l_read)(tp, uio, flag));
+ return ((*tp->t_linesw->l_read)(tp, uio, flag));
}
int
@@ -486,7 +486,7 @@ dhuwrite(dev, uio, flag)
sc = dhu_cd.cd_devs[DHU_M2U(minor(dev))];
tp = sc->sc_dhu[DHU_LINE(minor(dev))].dhu_tty;
- return ((*linesw[tp->t_line].l_write)(tp, uio, flag));
+ return ((*tp->t_linesw->l_write)(tp, uio, flag));
}
/*ARGSUSED*/
@@ -508,7 +508,7 @@ dhuioctl(dev, cmd, data, flag, p)
sc = dhu_cd.cd_devs[unit];
tp = sc->sc_dhu[line].dhu_tty;
- error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);
+ error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, p);
if (error >= 0)
return (error);
error = ttioctl(tp, cmd, data, flag, p);
diff --git a/sys/dev/qbus/dl.c b/sys/dev/qbus/dl.c
index 985cf15e65e..b308290e420 100644
--- a/sys/dev/qbus/dl.c
+++ b/sys/dev/qbus/dl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dl.c,v 1.14 2000/06/05 00:09:18 matt Exp $ */
+/* $NetBSD: dl.c,v 1.15 2000/11/02 00:01:45 eeh Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -261,7 +261,7 @@ dlrint(void *arg)
if (c & DL_RBUF_PARITY_ERR)
cc |= TTY_PE;
- (*linesw[tp->t_line].l_rint)(cc, tp);
+ (*tp->t_linesw->l_rint)(cc, tp);
#if defined(DIAGNOSTIC)
} else {
log(LOG_WARNING, "%s: stray rx interrupt\n",
@@ -279,8 +279,8 @@ dlxint(void *arg)
struct tty *tp = sc->sc_tty;
tp->t_state &= ~(TS_BUSY | TS_FLUSH);
- if (tp->t_line)
- (*linesw[tp->t_line].l_start)(tp);
+ if (tp->t_linesw)
+ (*tp->t_linesw->l_start)(tp);
else
dlstart(tp);
@@ -322,7 +322,7 @@ dlopen(dev_t dev, int flag, int mode, struct proc *p)
} else if ((tp->t_state & TS_XCLUDE) && p->p_ucred->cr_uid != 0)
return EBUSY;
- return ((*linesw[tp->t_line].l_open)(dev, tp));
+ return ((*tp->t_linesw->l_open)(dev, tp));
}
/*ARGSUSED*/
@@ -332,7 +332,7 @@ dlclose(dev_t dev, int flag, int mode, struct proc *p)
struct dl_softc *sc = dl_cd.cd_devs[minor(dev)];
struct tty *tp = sc->sc_tty;
- (*linesw[tp->t_line].l_close)(tp, flag);
+ (*tp->t_linesw->l_close)(tp, flag);
/* Make sure a BREAK state is not left enabled. */
dlbrk(sc, 0);
@@ -346,7 +346,7 @@ dlread(dev_t dev, struct uio *uio, int flag)
struct dl_softc *sc = dl_cd.cd_devs[minor(dev)];
struct tty *tp = sc->sc_tty;
- return ((*linesw[tp->t_line].l_read)(tp, uio, flag));
+ return ((*tp->t_linesw->l_read)(tp, uio, flag));
}
int
@@ -355,7 +355,7 @@ dlwrite(dev_t dev, struct uio *uio, int flag)
struct dl_softc *sc = dl_cd.cd_devs[minor(dev)];
struct tty *tp = sc->sc_tty;
- return ((*linesw[tp->t_line].l_write)(tp, uio, flag));
+ return ((*tp->t_linesw->l_write)(tp, uio, flag));
}
int
@@ -366,7 +366,7 @@ dlioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag, struct proc *p)
int error;
- error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);
+ error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, p);
if (error >= 0)
return (error);
error = ttioctl(tp, cmd, data, flag, p);
diff --git a/sys/dev/qbus/dz.c b/sys/dev/qbus/dz.c
index 6de32f31700..c41817381d9 100644
--- a/sys/dev/qbus/dz.c
+++ b/sys/dev/qbus/dz.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dz.c,v 1.24 2000/06/05 00:09:18 matt Exp $ */
+/* $NetBSD: dz.c,v 1.25 2000/11/02 00:01:45 eeh Exp $ */
/*
* Copyright (c) 1996 Ken C. Wellsch. All rights reserved.
* Copyright (c) 1992, 1993
@@ -206,10 +206,10 @@ dzrint(void *arg)
continue;
if (j == 2) /* Second char wasn't 'D' */
- (*linesw[tp->t_line].l_rint)(27, tp);
+ (*tp->t_linesw->l_rint)(27, tp);
}
#endif
- (*linesw[tp->t_line].l_rint)(cc, tp);
+ (*tp->t_linesw->l_rint)(cc, tp);
}
}
@@ -270,8 +270,8 @@ dzxint(void *arg)
else
ndflush (&tp->t_outq, cl->c_cc);
- if (tp->t_line)
- (*linesw[tp->t_line].l_start)(tp);
+ if (tp->t_linesw)
+ (*tp->t_linesw->l_start)(tp);
else
dzstart(tp);
}
@@ -330,7 +330,7 @@ dzopen(dev_t dev, int flag, int mode, struct proc *p)
(void) splx(s);
if (error)
return (error);
- return ((*linesw[tp->t_line].l_open)(dev, tp));
+ return ((*tp->t_linesw->l_open)(dev, tp));
}
/*ARGSUSED*/
@@ -348,7 +348,7 @@ dzclose(dev_t dev, int flag, int mode, struct proc *p)
tp = sc->sc_dz[line].dz_tty;
- (*linesw[tp->t_line].l_close)(tp, flag);
+ (*tp->t_linesw->l_close)(tp, flag);
/* Make sure a BREAK state is not left enabled. */
(void) dzmctl(sc, line, DML_BRK, DMBIC);
@@ -369,7 +369,7 @@ dzread(dev_t dev, struct uio *uio, int flag)
sc = dz_cd.cd_devs[DZ_I2C(minor(dev))];
tp = sc->sc_dz[DZ_PORT(minor(dev))].dz_tty;
- return ((*linesw[tp->t_line].l_read)(tp, uio, flag));
+ return ((*tp->t_linesw->l_read)(tp, uio, flag));
}
int
@@ -381,7 +381,7 @@ dzwrite(dev_t dev, struct uio *uio, int flag)
sc = dz_cd.cd_devs[DZ_I2C(minor(dev))];
tp = sc->sc_dz[DZ_PORT(minor(dev))].dz_tty;
- return ((*linesw[tp->t_line].l_write)(tp, uio, flag));
+ return ((*tp->t_linesw->l_write)(tp, uio, flag));
}
/*ARGSUSED*/
@@ -398,7 +398,7 @@ dzioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
sc = dz_cd.cd_devs[unit];
tp = sc->sc_dz[line].dz_tty;
- error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);
+ error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, p);
if (error >= 0)
return (error);
error = ttioctl(tp, cmd, data, flag, p);
@@ -661,9 +661,9 @@ dzscan(void *arg)
if ((DZ_READ_BYTE(dr_dcd) | sc->sc_dsr) & bit) {
if (!(tp->t_state & TS_CARR_ON))
- (*linesw[tp->t_line].l_modem) (tp, 1);
+ (*tp->t_linesw->l_modem) (tp, 1);
} else if ((tp->t_state & TS_CARR_ON) &&
- (*linesw[tp->t_line].l_modem)(tp, 0) == 0) {
+ (*tp->t_linesw->l_modem)(tp, 0) == 0) {
DZ_WRITE_BYTE(dr_tcr,
(DZ_READ_WORD(dr_tcrw) & 255) & ~bit);
}
diff --git a/sys/dev/qbus/qd.c b/sys/dev/qbus/qd.c
index 3ae602dacb1..30fba280e20 100644
--- a/sys/dev/qbus/qd.c
+++ b/sys/dev/qbus/qd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: qd.c,v 1.20 2000/06/28 17:09:43 mrg Exp $ */
+/* $NetBSD: qd.c,v 1.21 2000/11/02 00:01:45 eeh Exp $ */
/*-
* Copyright (c) 1988 Regents of the University of California.
@@ -869,7 +869,7 @@ qdopen(dev, flag, mode, p)
* enable intrpts, open line discipline
*/
dga->csr |= GLOBAL_IE; /* turn on the interrupts */
- return ((*linesw[tp->t_line].l_open)(dev, tp));
+ return ((*tp->t_linesw->l_open)(dev, tp));
}
dga->csr |= GLOBAL_IE; /* turn on the interrupts */
return(0);
@@ -1058,7 +1058,7 @@ qdclose(dev, flag, mode, p)
* this is the console
*/
tp = qd_tty[minor_dev];
- (*linesw[tp->t_line].l_close)(tp, flag);
+ (*tp->t_linesw->l_close)(tp, flag);
ttyclose(tp);
tp->t_state = 0;
qdflags[unit].inuse &= ~CONS_DEV;
@@ -1492,7 +1492,7 @@ qdioctl(dev, cmd, datap, flags, p)
tp = qd_tty[minor_dev];
error =
- (*linesw[tp->t_line].l_ioctl)(tp, cmd, datap, flags, p);
+ (*tp->t_linesw->l_ioctl)(tp, cmd, datap, flags, p);
if (error >= 0) {
return(error);
}
@@ -1609,7 +1609,7 @@ qdwrite(dev, uio, flag)
* this is the console...
*/
tp = qd_tty[minor_dev];
- return ((*linesw[tp->t_line].l_write)(tp, uio, flag));
+ return ((*tp->t_linesw->l_write)(tp, uio, flag));
} else if (qdflags[unit].inuse & GRAPHIC_DEV) {
/*
* this is a DMA xfer from user space
@@ -1638,7 +1638,7 @@ qdread(dev, uio, flag)
* this is the console
*/
tp = qd_tty[minor_dev];
- return ((*linesw[tp->t_line].l_read)(tp, uio, flag));
+ return ((*tp->t_linesw->l_read)(tp, uio, flag));
} else if (qdflags[unit].inuse & GRAPHIC_DEV) {
/*
* this is a bitmap-to-processor xfer
@@ -2841,7 +2841,7 @@ GET_TBUTTON:
char *string;
string = q_special[chr & 0x7F];
while(*string)
- (*linesw[tp->t_line].l_rint)(*string++, tp);
+ (*tp->t_linesw->l_rint)(*string++, tp);
}
else {
#ifdef DDB
@@ -2854,9 +2854,9 @@ GET_TBUTTON:
return;
if (j == 2) /* Second char wasn't 'D' */
- (*linesw[tp->t_line].l_rint)(27, tp);
+ (*tp->t_linesw->l_rint)(27, tp);
#endif
- (*linesw[tp->t_line].l_rint)(chr&0177, tp);
+ (*tp->t_linesw->l_rint)(chr&0177, tp);
}
}
}
diff --git a/sys/dev/sbus/magma.c b/sys/dev/sbus/magma.c
index a6afe319844..eacfb8f5a2a 100644
--- a/sys/dev/sbus/magma.c
+++ b/sys/dev/sbus/magma.c
@@ -1,4 +1,4 @@
-/* $NetBSD: magma.c,v 1.8 2000/07/09 20:57:43 pk Exp $ */
+/* $NetBSD: magma.c,v 1.9 2000/11/02 00:01:46 eeh Exp $ */
/*
* magma.c
*
@@ -730,7 +730,7 @@ magma_soft(arg)
log(LOG_WARNING, "%s%x: fifo overflow\n",
mtty->ms_dev.dv_xname, port);
- (*linesw[tp->t_line].l_rint)(data, tp);
+ (*tp->t_linesw->l_rint)(data, tp);
serviced = 1;
}
@@ -742,7 +742,7 @@ magma_soft(arg)
if( ISSET(flags, MTTYF_CARRIER_CHANGED) ) {
dprintf(("%s%x: cd %s\n", mtty->ms_dev.dv_xname,
port, mp->mp_carrier ? "on" : "off"));
- (*linesw[tp->t_line].l_modem)(tp, mp->mp_carrier);
+ (*tp->t_linesw->l_modem)(tp, mp->mp_carrier);
serviced = 1;
}
@@ -755,7 +755,7 @@ magma_soft(arg)
if( ISSET(flags, MTTYF_DONE) ) {
ndflush(&tp->t_outq, mp->mp_txp - tp->t_outq.c_cf);
CLR(tp->t_state, TS_BUSY);
- (*linesw[tp->t_line].l_start)(tp); /* might be some more */
+ (*tp->t_linesw->l_start)(tp); /* might be some more */
serviced = 1;
}
} /* for(each mtty...) */
@@ -944,7 +944,7 @@ mttyopen(dev, flags, mode, p)
if (error != 0)
goto bad;
- error = (*linesw[tp->t_line].l_open)(dev, tp);
+ error = (*tp->t_linesw->l_open)(dev, tp);
if (error != 0)
goto bad;
@@ -975,7 +975,7 @@ mttyclose(dev, flag, mode, p)
struct tty *tp = mp->mp_tty;
int s;
- (*linesw[tp->t_line].l_close)(tp, flag);
+ (*tp->t_linesw->l_close)(tp, flag);
ttyclose(tp);
s = spltty();
@@ -1015,7 +1015,7 @@ mttyread(dev, uio, flags)
struct mtty_port *mp = &ms->ms_port[MAGMA_PORT(dev)];
struct tty *tp = mp->mp_tty;
- return( (*linesw[tp->t_line].l_read)(tp, uio, flags) );
+ return( (*tp->t_linesw->l_read)(tp, uio, flags) );
}
/*
@@ -1031,7 +1031,7 @@ mttywrite(dev, uio, flags)
struct mtty_port *mp = &ms->ms_port[MAGMA_PORT(dev)];
struct tty *tp = mp->mp_tty;
- return( (*linesw[tp->t_line].l_write)(tp, uio, flags) );
+ return( (*tp->t_linesw->l_write)(tp, uio, flags) );
}
/*
@@ -1063,7 +1063,7 @@ mttyioctl(dev, cmd, data, flags, p)
struct tty *tp = mp->mp_tty;
int error;
- error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flags, p);
+ error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flags, p);
if( error >= 0 ) return(error);
error = ttioctl(tp, cmd, data, flags, p);
diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c
index 89fca57d7e5..102f688e8a0 100644
--- a/sys/dev/usb/ucom.c
+++ b/sys/dev/usb/ucom.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ucom.c,v 1.31 2000/10/22 19:01:44 explorer Exp $ */
+/* $NetBSD: ucom.c,v 1.32 2000/11/02 00:01:46 eeh Exp $ */
/*
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -438,7 +438,7 @@ ucomopen(dev_t dev, int flag, int mode, struct proc *p)
if (error)
goto bad;
- error = (*linesw[tp->t_line].l_open)(dev, tp);
+ error = (*tp->t_linesw->l_open)(dev, tp);
if (error)
goto bad;
@@ -482,7 +482,7 @@ ucomclose(dev_t dev, int flag, int mode, struct proc *p)
sc->sc_refcnt++;
- (*linesw[tp->t_line].l_close)(tp, flag);
+ (*tp->t_linesw->l_close)(tp, flag);
ttyclose(tp);
if (!ISSET(tp->t_state, TS_ISOPEN) && tp->t_wopen == 0) {
@@ -514,7 +514,7 @@ ucomread(dev_t dev, struct uio *uio, int flag)
return (EIO);
sc->sc_refcnt++;
- error = ((*linesw[tp->t_line].l_read)(tp, uio, flag));
+ error = ((*tp->t_linesw->l_read)(tp, uio, flag));
if (--sc->sc_refcnt < 0)
usb_detach_wakeup(USBDEV(sc->sc_dev));
return (error);
@@ -531,7 +531,7 @@ ucomwrite(dev_t dev, struct uio *uio, int flag)
return (EIO);
sc->sc_refcnt++;
- error = ((*linesw[tp->t_line].l_write)(tp, uio, flag));
+ error = ((*tp->t_linesw->l_write)(tp, uio, flag));
if (--sc->sc_refcnt < 0)
usb_detach_wakeup(USBDEV(sc->sc_dev));
return (error);
@@ -572,7 +572,7 @@ ucom_do_ioctl(struct ucom_softc *sc, u_long cmd, caddr_t data,
DPRINTF(("ucomioctl: cmd=0x%08lx\n", cmd));
- error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);
+ error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, p);
if (error >= 0)
return (error);
@@ -746,7 +746,7 @@ ucom_status_change(struct ucom_softc *sc)
sc->sc_methods->ucom_get_status(sc->sc_parent, sc->sc_portno,
&sc->sc_lsr, &sc->sc_msr);
if (ISSET((sc->sc_msr ^ old_msr), UMSR_DCD))
- (*linesw[tp->t_line].l_modem)(tp,
+ (*tp->t_linesw->l_modem)(tp,
ISSET(sc->sc_msr, UMSR_DCD));
} else {
sc->sc_lsr = 0;
@@ -807,7 +807,7 @@ ucomparam(struct tty *tp, struct termios *t)
* explicit request.
*/
DPRINTF(("ucomparam: l_modem\n"));
- (void) (*linesw[tp->t_line].l_modem)(tp, 1 /* XXX carrier */ );
+ (void) (*tp->t_linesw->l_modem)(tp, 1 /* XXX carrier */ );
#if 0
XXX what if the hardware is not open
@@ -967,7 +967,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);
+ (*tp->t_linesw->l_start)(tp);
splx(s);
}
@@ -995,7 +995,7 @@ 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;
+ int (*rint)(int c, struct tty *tp) = tp->t_linesw->l_rint;
usbd_status err;
u_int32_t cc;
u_char *cp;
diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c
index ede41427f02..915a52686c3 100644
--- a/sys/dev/wscons/wsdisplay.c
+++ b/sys/dev/wscons/wsdisplay.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplay.c,v 1.41 2000/10/01 03:29:13 takemura Exp $ */
+/* $NetBSD: wsdisplay.c,v 1.42 2000/11/02 00:01:46 eeh Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.41 2000/10/01 03:29:13 takemura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.42 2000/11/02 00:01:46 eeh Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@@ -397,7 +397,7 @@ wsdisplay_closescreen(sc, scr)
/* hangup */
if (WSSCREEN_HAS_TTY(scr)) {
struct tty *tp = scr->scr_tty;
- (*linesw[tp->t_line].l_modem)(tp, 0);
+ (*tp->t_linesw->l_modem)(tp, 0);
}
/* locate the major number */
@@ -727,7 +727,7 @@ wsdisplayopen(dev, flag, mode, p)
return EBUSY;
tp->t_state |= TS_CARR_ON;
- error = ((*linesw[tp->t_line].l_open)(dev, tp));
+ error = ((*tp->t_linesw->l_open)(dev, tp));
if (error)
return (error);
@@ -774,7 +774,7 @@ wsdisplayclose(dev, flag, mode, p)
splx(s);
}
tp = scr->scr_tty;
- (*linesw[tp->t_line].l_close)(tp, flag);
+ (*tp->t_linesw->l_close)(tp, flag);
ttyclose(tp);
}
@@ -827,7 +827,7 @@ wsdisplayread(dev, uio, flag)
return (ENODEV);
tp = scr->scr_tty;
- return ((*linesw[tp->t_line].l_read)(tp, uio, flag));
+ return ((*tp->t_linesw->l_read)(tp, uio, flag));
}
int
@@ -853,7 +853,7 @@ wsdisplaywrite(dev, uio, flag)
return (ENODEV);
tp = scr->scr_tty;
- return ((*linesw[tp->t_line].l_write)(tp, uio, flag));
+ return ((*tp->t_linesw->l_write)(tp, uio, flag));
}
struct tty *
@@ -907,7 +907,7 @@ wsdisplayioctl(dev, cmd, data, flag, p)
/* printf("disc\n"); */
/* do the line discipline ioctls first */
- error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);
+ error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, p);
if (error >= 0)
return (error);
@@ -1307,7 +1307,7 @@ wsdisplay_emulinput(v, data, count)
tp = scr->scr_tty;
while (count-- > 0)
- (*linesw[tp->t_line].l_rint)(*data++, tp);
+ (*tp->t_linesw->l_rint)(*data++, tp);
};
/*
@@ -1334,12 +1334,12 @@ wsdisplay_kbdinput(dev, ks)
tp = scr->scr_tty;
if (KS_GROUP(ks) == KS_GROUP_Ascii)
- (*linesw[tp->t_line].l_rint)(KS_VALUE(ks), tp);
+ (*tp->t_linesw->l_rint)(KS_VALUE(ks), tp);
else if (WSSCREEN_HAS_EMULATOR(scr)) {
count = (*scr->scr_dconf->wsemul->translate)
(scr->scr_dconf->wsemulcookie, ks, &dp);
while (count-- > 0)
- (*linesw[tp->t_line].l_rint)(*dp++, tp);
+ (*tp->t_linesw->l_rint)(*dp++, tp);
}
}