From 17b52df3d7ba0c2789f07e8d92f72a03d507f1af Mon Sep 17 00:00:00 2001 From: phk Date: Fri, 4 Jun 2004 21:55:55 +0000 Subject: 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. --- sys/dev/cy/cy.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'sys/dev/cy') diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c index 58abf6a..9dc95b3 100644 --- a/sys/dev/cy/cy.c +++ b/sys/dev/cy/cy.c @@ -2585,21 +2585,7 @@ disc_optim(tp, t, com) u_char opt; #endif - /* - * XXX can skip a lot more cases if Smarts. Maybe - * (IGNCR | ISTRIP | IXON) in c_iflag. But perhaps we - * shouldn't skip if (TS_CNTTB | TS_LNCH) is set in t_state. - */ - 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; - com->hotchar = linesw[tp->t_line].l_hotchar; + com->hotchar = ttyldoptim(tp); #ifndef SOFT_HOTCHAR opt = com->cor[2] & ~CD1400_COR3_SCD34; if (com->hotchar != 0) { -- cgit v1.1