summaryrefslogtreecommitdiffstats
path: root/sys/dev/rp
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-06-04 21:55:55 +0000
committerphk <phk@FreeBSD.org>2004-06-04 21:55:55 +0000
commit17b52df3d7ba0c2789f07e8d92f72a03d507f1af (patch)
tree1aba351b2574e6180f5f98824ce4d10b1ba035f7 /sys/dev/rp
parent06049d3eaf941ee534b340558daac059b6b18912 (diff)
downloadFreeBSD-src-17b52df3d7ba0c2789f07e8d92f72a03d507f1af.zip
FreeBSD-src-17b52df3d7ba0c2789f07e8d92f72a03d507f1af.tar.gz
Centralize the line discipline optimization determination in a function
called ttyldoptim(). Use this function from all the relevant drivers. I belive no drivers finger linesw[] directly anymore, paving the way for locking and refcounting.
Diffstat (limited to 'sys/dev/rp')
-rw-r--r--sys/dev/rp/rp.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/sys/dev/rp/rp.c b/sys/dev/rp/rp.c
index f99f403..d77c9a1 100644
--- a/sys/dev/rp/rp.c
+++ b/sys/dev/rp/rp.c
@@ -616,7 +616,6 @@ static int rpparam(struct tty *, struct termios *);
static void rpstart(struct tty *);
static void rpstop(struct tty *, int);
static void rphardclose (struct rp_port *);
-static void rp_disc_optim (struct tty *tp, struct termios *t);
static void rp_do_receive(struct rp_port *rp, struct tty *tp,
CHANNEL_t *cp, unsigned int ChanStatus)
@@ -1089,7 +1088,7 @@ open_top:
}
error = ttyld_open(tp, dev);
- rp_disc_optim(tp, &tp->t_termios);
+ ttyldoptim(tp);
if(tp->t_state & TS_ISOPEN && IS_CALLOUT(dev))
rp->active_out = TRUE;
@@ -1131,7 +1130,7 @@ rpclose(dev, flag, mode, td)
oldspl = spltty();
ttyld_close(tp, flag);
- rp_disc_optim(tp, &tp->t_termios);
+ ttyldoptim(tp);
rphardclose(rp);
tp->t_state &= ~TS_BUSY;
@@ -1321,7 +1320,7 @@ rpioctl(dev, cmd, data, flag, td)
t = &tp->t_termios;
error = ttyioctl(dev, cmd, data, flag, td);
- rp_disc_optim(tp, &tp->t_termios);
+ ttyldoptim(tp);
if(error != ENOTTY)
return(error);
oldspl = spltty();
@@ -1543,7 +1542,7 @@ rpparam(tp, t)
} else {
sDisRTSFlowCtl(cp);
}
- rp_disc_optim(tp, t);
+ ttyldoptim(tp);
if((cflag & CLOCAL) || (sGetChanStatusLo(cp) & CD_ACT)) {
tp->t_state |= TS_CARR_ON;
@@ -1563,22 +1562,6 @@ rpparam(tp, t)
}
static void
-rp_disc_optim(tp, t)
-struct tty *tp;
-struct termios *t;
-{
- if(!(t->c_iflag & (ICRNL | IGNCR | IMAXBEL | INLCR | ISTRIP | IXON))
- &&(!(t->c_iflag & BRKINT) || (t->c_iflag & IGNBRK))
- &&(!(t->c_iflag & PARMRK)
- ||(t->c_iflag & (IGNPAR | IGNBRK)) == (IGNPAR | IGNBRK))
- && !(t->c_lflag & (ECHO | ICANON | IEXTEN | ISIG | PENDIN))
- && linesw[tp->t_line].l_rint == ttyinput)
- tp->t_state |= TS_CAN_BYPASS_L_RINT;
- else
- tp->t_state &= ~TS_CAN_BYPASS_L_RINT;
-}
-
-static void
rpstart(tp)
struct tty *tp;
{
OpenPOWER on IntegriCloud