summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/cx.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-09-28 11:45:31 +0000
committerphk <phk@FreeBSD.org>1999-09-28 11:45:31 +0000
commit5e9f92ecf757c8f55ddae7d0dcec108fef05954d (patch)
tree98fbe8a4cc58070df6f9fb9ad41348c78b444f78 /sys/i386/isa/cx.c
parent9f4fe5b99e561702e8ee5934290097d4ef487e94 (diff)
downloadFreeBSD-src-5e9f92ecf757c8f55ddae7d0dcec108fef05954d.zip
FreeBSD-src-5e9f92ecf757c8f55ddae7d0dcec108fef05954d.tar.gz
Introduce ttyread() and ttywrite() which do the canonical thing.
Use them in many tty drivers. Reviewed by: julian, bde
Diffstat (limited to 'sys/i386/isa/cx.c')
-rw-r--r--sys/i386/isa/cx.c28
1 files changed, 2 insertions, 26 deletions
diff --git a/sys/i386/isa/cx.c b/sys/i386/isa/cx.c
index 1eeb42e..9240be5 100644
--- a/sys/i386/isa/cx.c
+++ b/sys/i386/isa/cx.c
@@ -85,8 +85,6 @@ static struct tty cx_tty [NCX*NCHAN]; /* tty data */
static d_open_t cxopen;
static d_close_t cxclose;
-static d_read_t cxread;
-static d_write_t cxwrite;
static d_ioctl_t cxioctl;
#define CDEV_MAJOR 42
@@ -94,8 +92,8 @@ static d_ioctl_t cxioctl;
struct cdevsw cx_cdevsw = {
/* open */ cxopen,
/* close */ cxclose,
- /* read */ cxread,
- /* write */ cxwrite,
+ /* read */ ttyread,
+ /* write */ ttywrite,
/* ioctl */ cxioctl,
/* poll */ ttypoll,
/* mmap */ nommap,
@@ -287,28 +285,6 @@ int cxclose (dev_t dev, int flag, int mode, struct proc *p)
return (0);
}
-int cxread (dev_t dev, struct uio *uio, int flag)
-{
- int unit = UNIT (dev);
- struct tty *tp;
-
- if (unit == UNIT_CTL)
- return (EIO);
- tp = cxchan[unit]->ttyp;
- return ((*linesw[tp->t_line].l_read) (tp, uio, flag));
-}
-
-int cxwrite (dev_t dev, struct uio *uio, int flag)
-{
- int unit = UNIT (dev);
- struct tty *tp;
-
- if (unit == UNIT_CTL)
- return (EIO);
- tp = cxchan[unit]->ttyp;
- return ((*linesw[tp->t_line].l_write) (tp, uio, flag));
-}
-
int cxioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
{
int unit = UNIT (dev);
OpenPOWER on IntegriCloud