From 5e9f92ecf757c8f55ddae7d0dcec108fef05954d Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 28 Sep 1999 11:45:31 +0000 Subject: Introduce ttyread() and ttywrite() which do the canonical thing. Use them in many tty drivers. Reviewed by: julian, bde --- sys/dev/rp/rp.c | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) (limited to 'sys/dev/rp') diff --git a/sys/dev/rp/rp.c b/sys/dev/rp/rp.c index 5a4cceb..bc846d5 100644 --- a/sys/dev/rp/rp.c +++ b/sys/dev/rp/rp.c @@ -794,7 +794,6 @@ static char driver_name[] = "rp"; static d_open_t rpopen; static d_close_t rpclose; -static d_read_t rpread; static d_write_t rpwrite; static d_ioctl_t rpioctl; @@ -802,7 +801,7 @@ static d_ioctl_t rpioctl; static struct cdevsw rp_cdevsw = { /* open */ rpopen, /* close */ rpclose, - /* read */ rpread, + /* read */ ttyread, /* write */ rpwrite, /* ioctl */ rpioctl, /* poll */ ttypoll, @@ -856,9 +855,6 @@ static int rpparam __P((struct tty *, struct termios *)); static void rpstart __P((struct tty *)); static void rpstop __P((struct tty *, int)); static void rphardclose __P((struct rp_port *)); -#define rpmap nomap -#define rpreset noreset -#define rpstrategy nostrategy static void rp_disc_optim __P((struct tty *tp, struct termios *t, struct rp_port *rp)); @@ -1504,30 +1500,6 @@ rphardclose(struct rp_port *rp) static int -rpread(dev, uio, flag) - dev_t dev; - struct uio *uio; - int flag; -{ - struct rp_port *rp; - struct tty *tp; - int unit, mynor, umynor, port, error = 0; /* SG */ - - umynor = (((minor(dev) >> 16) -1) * 32); /* SG */ - port = (minor(dev) & 0x1f); /* SG */ - mynor = (port + umynor); /* SG */ - unit = minor_to_unit[mynor]; /* SG */ - - if(IS_CONTROL(dev)) - return(ENODEV); - rp = rp_addr(unit) + port; - tp = rp->rp_tty; - error = (*linesw[tp->t_line].l_read)(tp, uio, flag); - return(error); -} - -static -int rpwrite(dev, uio, flag) dev_t dev; struct uio *uio; -- cgit v1.1