summaryrefslogtreecommitdiffstats
path: root/sys/dev/sx
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/sx
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/sx')
-rw-r--r--sys/dev/sx/sx.c30
1 files changed, 2 insertions, 28 deletions
diff --git a/sys/dev/sx/sx.c b/sys/dev/sx/sx.c
index 68266bd..ae50e32 100644
--- a/sys/dev/sx/sx.c
+++ b/sys/dev/sx/sx.c
@@ -71,7 +71,6 @@ static int sx_modem(struct sx_softc *, struct sx_port *, enum sx_mctl, int);
static void sx_write_enable(struct sx_port *, int);
static void sx_start(struct tty *);
static void sx_stop(struct tty *, int);
-static void sx_disc_optim(struct tty *tp, struct termios *t,struct sx_port *pp);
static void sxhardclose(struct sx_port *pp);
static void sxdtrwakeup(void *chan);
static void sx_shutdown_chan(struct sx_port *);
@@ -476,7 +475,7 @@ open_top:
}
error = ttyld_open(tp, dev);
- sx_disc_optim(tp, &tp->t_termios, pp);
+ pp->sp_hotchar = ttyldoptim(tp);
if (tp->t_state & TS_ISOPEN && DEV_IS_CALLOUT(mynor))
pp->sp_active_out = TRUE;
@@ -805,7 +804,7 @@ sxioctl(
}
error = ttyioctl(dev, cmd, data, flag, p);
- sx_disc_optim(tp, &tp->t_termios, pp);
+ pp->sp_hotchar = ttyldoptim(tp);
if (error != ENOTTY)
goto out;
@@ -1921,31 +1920,6 @@ sx_stop(
splx(s);
}
-static void
-sx_disc_optim(
- struct tty *tp,
- struct termios *t,
- struct sx_port *pp)
-{
- /*
- * If we're in "raw" mode, we can bypass ttyinput().
- */
- 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;
- pp->sp_hotchar = linesw[tp->t_line].l_hotchar;
- DPRINT((pp, DBG_OPTIM, "sx_disc_optim: bypass %s, hotchar %x\n",
- (tp->t_state & TS_CAN_BYPASS_L_RINT) ? "yes" : "no",
- pp->sp_hotchar));
-}
-
-
#ifdef SX_DEBUG
void
OpenPOWER on IntegriCloud