mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Implement the spirit but not the letter of Terrys hot-char patch.
The differences Terrys patch and this patch are: * Remove a lot of un-needed comments. * Don't put l_hotchar at the front of stuct linesw, there is no need to. * Use the #defines for the hotchar in the SLIP and PPP line disciplines
This commit is contained in:
parent
a744622f69
commit
a4daaa09f2
18 changed files with 37 additions and 149 deletions
|
|
@ -27,7 +27,7 @@
|
|||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: cy.c,v 1.59 1997/12/28 06:23:03 bde Exp $
|
||||
* $Id: cy.c,v 1.60 1998/01/24 02:54:17 eivind Exp $
|
||||
*/
|
||||
|
||||
#include "opt_compat.h"
|
||||
|
|
@ -2420,16 +2420,7 @@ disc_optim(tp, t, com)
|
|||
tp->t_state |= TS_CAN_BYPASS_L_RINT;
|
||||
else
|
||||
tp->t_state &= ~TS_CAN_BYPASS_L_RINT;
|
||||
/*
|
||||
* Prepare to reduce input latency for packet
|
||||
* discplines with a end of packet character.
|
||||
*/
|
||||
if (tp->t_line == SLIPDISC)
|
||||
com->hotchar = 0xc0;
|
||||
else if (tp->t_line == PPPDISC)
|
||||
com->hotchar = 0x7e;
|
||||
else
|
||||
com->hotchar = 0;
|
||||
com->hotchar = linesw[tp->t_line].l_hotchar;
|
||||
#ifndef SOFT_HOTCHAR
|
||||
iobase = com->iobase;
|
||||
cd_outb(iobase, CD1400_CAR, com->cy_align, com->unit & CD1400_CAR_CHAN);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: cy.c,v 1.59 1997/12/28 06:23:03 bde Exp $
|
||||
* $Id: cy.c,v 1.60 1998/01/24 02:54:17 eivind Exp $
|
||||
*/
|
||||
|
||||
#include "opt_compat.h"
|
||||
|
|
@ -2420,16 +2420,7 @@ disc_optim(tp, t, com)
|
|||
tp->t_state |= TS_CAN_BYPASS_L_RINT;
|
||||
else
|
||||
tp->t_state &= ~TS_CAN_BYPASS_L_RINT;
|
||||
/*
|
||||
* Prepare to reduce input latency for packet
|
||||
* discplines with a end of packet character.
|
||||
*/
|
||||
if (tp->t_line == SLIPDISC)
|
||||
com->hotchar = 0xc0;
|
||||
else if (tp->t_line == PPPDISC)
|
||||
com->hotchar = 0x7e;
|
||||
else
|
||||
com->hotchar = 0;
|
||||
com->hotchar = linesw[tp->t_line].l_hotchar;
|
||||
#ifndef SOFT_HOTCHAR
|
||||
iobase = com->iobase;
|
||||
cd_outb(iobase, CD1400_CAR, com->cy_align, com->unit & CD1400_CAR_CHAN);
|
||||
|
|
|
|||
|
|
@ -1476,12 +1476,7 @@ disc_optim(tp, t, rc)
|
|||
tp->t_state |= TS_CAN_BYPASS_L_RINT;
|
||||
else
|
||||
tp->t_state &= ~TS_CAN_BYPASS_L_RINT;
|
||||
if (tp->t_line == SLIPDISC)
|
||||
rc->rc_hotchar = 0xc0;
|
||||
else if (tp->t_line == PPPDISC)
|
||||
rc->rc_hotchar = 0x7e;
|
||||
else
|
||||
rc->rc_hotchar = 0;
|
||||
rc->rc_hotchar = linesw[tp->t_line].l_hotchar;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE AUTHORS BE LIABLE.
|
||||
*
|
||||
* $Id: si.c,v 1.64 1998/01/24 02:54:24 eivind Exp $
|
||||
* $Id: si.c,v 1.65 1998/01/31 07:23:09 eivind Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
|
|
@ -2299,18 +2299,7 @@ si_disc_optim(tp, t, pp)
|
|||
tp->t_state |= TS_CAN_BYPASS_L_RINT;
|
||||
else
|
||||
tp->t_state &= ~TS_CAN_BYPASS_L_RINT;
|
||||
|
||||
/*
|
||||
* Prepare to reduce input latency for packet
|
||||
* discplines with a end of packet character.
|
||||
*/
|
||||
if (tp->t_line == SLIPDISC)
|
||||
pp->sp_hotchar = 0xc0;
|
||||
else if (tp->t_line == PPPDISC)
|
||||
pp->sp_hotchar = 0x7e;
|
||||
else
|
||||
pp->sp_hotchar = 0;
|
||||
|
||||
pp->sp_hotchar = linesw[tp->t_line].l_hotchar;
|
||||
DPRINT((pp, DBG_OPTIM, "bypass: %s, hotchar: %x\n",
|
||||
(tp->t_state & TS_CAN_BYPASS_L_RINT) ? "on" : "off",
|
||||
pp->sp_hotchar));
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
|
||||
* $Id: sio.c,v 1.194 1998/01/08 04:53:43 amurai Exp $
|
||||
* $Id: sio.c,v 1.195 1998/01/24 02:54:25 eivind Exp $
|
||||
*/
|
||||
|
||||
#include "opt_comconsole.h"
|
||||
|
|
@ -2548,16 +2548,7 @@ disc_optim(tp, t, com)
|
|||
tp->t_state |= TS_CAN_BYPASS_L_RINT;
|
||||
else
|
||||
tp->t_state &= ~TS_CAN_BYPASS_L_RINT;
|
||||
/*
|
||||
* Prepare to reduce input latency for packet
|
||||
* discplines with a end of packet character.
|
||||
*/
|
||||
if (tp->t_line == SLIPDISC)
|
||||
com->hotchar = 0xc0;
|
||||
else if (tp->t_line == PPPDISC)
|
||||
com->hotchar = 0x7e;
|
||||
else
|
||||
com->hotchar = 0;
|
||||
com->hotchar = linesw[tp->t_line].l_hotchar;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: cy.c,v 1.59 1997/12/28 06:23:03 bde Exp $
|
||||
* $Id: cy.c,v 1.60 1998/01/24 02:54:17 eivind Exp $
|
||||
*/
|
||||
|
||||
#include "opt_compat.h"
|
||||
|
|
@ -2420,16 +2420,7 @@ disc_optim(tp, t, com)
|
|||
tp->t_state |= TS_CAN_BYPASS_L_RINT;
|
||||
else
|
||||
tp->t_state &= ~TS_CAN_BYPASS_L_RINT;
|
||||
/*
|
||||
* Prepare to reduce input latency for packet
|
||||
* discplines with a end of packet character.
|
||||
*/
|
||||
if (tp->t_line == SLIPDISC)
|
||||
com->hotchar = 0xc0;
|
||||
else if (tp->t_line == PPPDISC)
|
||||
com->hotchar = 0x7e;
|
||||
else
|
||||
com->hotchar = 0;
|
||||
com->hotchar = linesw[tp->t_line].l_hotchar;
|
||||
#ifndef SOFT_HOTCHAR
|
||||
iobase = com->iobase;
|
||||
cd_outb(iobase, CD1400_CAR, com->cy_align, com->unit & CD1400_CAR_CHAN);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: istallion.c,v 1.15 1997/12/16 17:40:00 eivind Exp $
|
||||
* $Id: istallion.c,v 1.16 1998/02/09 06:08:33 eivind Exp $
|
||||
*/
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
@ -2507,13 +2507,7 @@ static void stli_ttyoptim(stliport_t *portp, struct termios *tiosp)
|
|||
tp->t_state |= TS_CAN_BYPASS_L_RINT;
|
||||
else
|
||||
tp->t_state &= ~TS_CAN_BYPASS_L_RINT;
|
||||
|
||||
if (tp->t_line == SLIPDISC)
|
||||
portp->hotchar = 0xc0;
|
||||
else if (tp->t_line == PPPDISC)
|
||||
portp->hotchar = 0x7e;
|
||||
else
|
||||
portp->hotchar = 0;
|
||||
portp->hotchar = linesw[tp->t_line].l_hotchar;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
|||
|
|
@ -1476,12 +1476,7 @@ disc_optim(tp, t, rc)
|
|||
tp->t_state |= TS_CAN_BYPASS_L_RINT;
|
||||
else
|
||||
tp->t_state &= ~TS_CAN_BYPASS_L_RINT;
|
||||
if (tp->t_line == SLIPDISC)
|
||||
rc->rc_hotchar = 0xc0;
|
||||
else if (tp->t_line == PPPDISC)
|
||||
rc->rc_hotchar = 0x7e;
|
||||
else
|
||||
rc->rc_hotchar = 0;
|
||||
rc->rc_hotchar = linesw[tp->t_line].l_hotchar;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE AUTHORS BE LIABLE.
|
||||
*
|
||||
* $Id: si.c,v 1.64 1998/01/24 02:54:24 eivind Exp $
|
||||
* $Id: si.c,v 1.65 1998/01/31 07:23:09 eivind Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
|
|
@ -2299,18 +2299,7 @@ si_disc_optim(tp, t, pp)
|
|||
tp->t_state |= TS_CAN_BYPASS_L_RINT;
|
||||
else
|
||||
tp->t_state &= ~TS_CAN_BYPASS_L_RINT;
|
||||
|
||||
/*
|
||||
* Prepare to reduce input latency for packet
|
||||
* discplines with a end of packet character.
|
||||
*/
|
||||
if (tp->t_line == SLIPDISC)
|
||||
pp->sp_hotchar = 0xc0;
|
||||
else if (tp->t_line == PPPDISC)
|
||||
pp->sp_hotchar = 0x7e;
|
||||
else
|
||||
pp->sp_hotchar = 0;
|
||||
|
||||
pp->sp_hotchar = linesw[tp->t_line].l_hotchar;
|
||||
DPRINT((pp, DBG_OPTIM, "bypass: %s, hotchar: %x\n",
|
||||
(tp->t_state & TS_CAN_BYPASS_L_RINT) ? "on" : "off",
|
||||
pp->sp_hotchar));
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
|
||||
* $Id: sio.c,v 1.194 1998/01/08 04:53:43 amurai Exp $
|
||||
* $Id: sio.c,v 1.195 1998/01/24 02:54:25 eivind Exp $
|
||||
*/
|
||||
|
||||
#include "opt_comconsole.h"
|
||||
|
|
@ -2548,16 +2548,7 @@ disc_optim(tp, t, com)
|
|||
tp->t_state |= TS_CAN_BYPASS_L_RINT;
|
||||
else
|
||||
tp->t_state &= ~TS_CAN_BYPASS_L_RINT;
|
||||
/*
|
||||
* Prepare to reduce input latency for packet
|
||||
* discplines with a end of packet character.
|
||||
*/
|
||||
if (tp->t_line == SLIPDISC)
|
||||
com->hotchar = 0xc0;
|
||||
else if (tp->t_line == PPPDISC)
|
||||
com->hotchar = 0x7e;
|
||||
else
|
||||
com->hotchar = 0;
|
||||
com->hotchar = linesw[tp->t_line].l_hotchar;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: stallion.c,v 1.15 1997/12/16 17:40:09 eivind Exp $
|
||||
* $Id: stallion.c,v 1.16 1998/02/09 06:08:42 eivind Exp $
|
||||
*/
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
@ -2556,13 +2556,7 @@ static void stl_ttyoptim(stlport_t *portp, struct termios *tiosp)
|
|||
tp->t_state |= TS_CAN_BYPASS_L_RINT;
|
||||
else
|
||||
tp->t_state &= ~TS_CAN_BYPASS_L_RINT;
|
||||
|
||||
if (tp->t_line == SLIPDISC)
|
||||
portp->hotchar = 0xc0;
|
||||
else if (tp->t_line == PPPDISC)
|
||||
portp->hotchar = 0x7e;
|
||||
else
|
||||
portp->hotchar = 0;
|
||||
portp->hotchar = linesw[tp->t_line].l_hotchar;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
|
||||
* $Id: sio.c,v 1.194 1998/01/08 04:53:43 amurai Exp $
|
||||
* $Id: sio.c,v 1.195 1998/01/24 02:54:25 eivind Exp $
|
||||
*/
|
||||
|
||||
#include "opt_comconsole.h"
|
||||
|
|
@ -2548,16 +2548,7 @@ disc_optim(tp, t, com)
|
|||
tp->t_state |= TS_CAN_BYPASS_L_RINT;
|
||||
else
|
||||
tp->t_state &= ~TS_CAN_BYPASS_L_RINT;
|
||||
/*
|
||||
* Prepare to reduce input latency for packet
|
||||
* discplines with a end of packet character.
|
||||
*/
|
||||
if (tp->t_line == SLIPDISC)
|
||||
com->hotchar = 0xc0;
|
||||
else if (tp->t_line == PPPDISC)
|
||||
com->hotchar = 0x7e;
|
||||
else
|
||||
com->hotchar = 0;
|
||||
com->hotchar = linesw[tp->t_line].l_hotchar;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)if_sl.c 8.6 (Berkeley) 2/1/94
|
||||
* $Id: if_sl.c,v 1.65 1998/01/08 23:41:29 eivind Exp $
|
||||
* $Id: if_sl.c,v 1.66 1998/02/09 06:09:54 eivind Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
|
|
@ -196,7 +196,8 @@ static int slstart __P((struct tty *));
|
|||
|
||||
static struct linesw slipdisc = {
|
||||
slopen, slclose, l_noread, l_nowrite,
|
||||
sltioctl, slinput, slstart, ttymodem
|
||||
sltioctl, slinput, slstart, ttymodem,
|
||||
FRAME_END
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@
|
|||
* Paul Mackerras (paulus@cs.anu.edu.au).
|
||||
*/
|
||||
|
||||
/* $Id: ppp_tty.c,v 1.28 1997/11/18 14:08:51 bde Exp $ */
|
||||
/* $Id: ppp_tty.c,v 1.29 1997/12/06 13:24:37 bde Exp $ */
|
||||
|
||||
#include "ppp.h"
|
||||
#if NPPP > 0
|
||||
|
|
@ -161,8 +161,9 @@ void pppasyncattach __P((void *));
|
|||
*/
|
||||
|
||||
static struct linesw pppdisc = {
|
||||
pppopen, pppclose, pppread, pppwrite, ppptioctl,
|
||||
pppinput, pppstart, ttymodem
|
||||
pppopen, pppclose, pppread, pppwrite,
|
||||
ppptioctl, pppinput, pppstart, ttymodem,
|
||||
PPP_FLAG
|
||||
};
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
|
||||
* $Id: sio.c,v 1.50 1998/01/24 02:54:39 eivind Exp $
|
||||
* $Id: sio.c,v 1.51 1998/02/02 07:59:05 kato Exp $
|
||||
*/
|
||||
|
||||
#include "opt_comconsole.h"
|
||||
|
|
@ -3283,16 +3283,7 @@ disc_optim(tp, t, com)
|
|||
tp->t_state |= TS_CAN_BYPASS_L_RINT;
|
||||
else
|
||||
tp->t_state &= ~TS_CAN_BYPASS_L_RINT;
|
||||
/*
|
||||
* Prepare to reduce input latency for packet
|
||||
* discplines with a end of packet character.
|
||||
*/
|
||||
if (tp->t_line == SLIPDISC)
|
||||
com->hotchar = 0xc0;
|
||||
else if (tp->t_line == PPPDISC)
|
||||
com->hotchar = 0x7e;
|
||||
else
|
||||
com->hotchar = 0;
|
||||
com->hotchar = linesw[tp->t_line].l_hotchar;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
|
||||
* $Id: sio.c,v 1.50 1998/01/24 02:54:39 eivind Exp $
|
||||
* $Id: sio.c,v 1.51 1998/02/02 07:59:05 kato Exp $
|
||||
*/
|
||||
|
||||
#include "opt_comconsole.h"
|
||||
|
|
@ -3283,16 +3283,7 @@ disc_optim(tp, t, com)
|
|||
tp->t_state |= TS_CAN_BYPASS_L_RINT;
|
||||
else
|
||||
tp->t_state &= ~TS_CAN_BYPASS_L_RINT;
|
||||
/*
|
||||
* Prepare to reduce input latency for packet
|
||||
* discplines with a end of packet character.
|
||||
*/
|
||||
if (tp->t_line == SLIPDISC)
|
||||
com->hotchar = 0xc0;
|
||||
else if (tp->t_line == PPPDISC)
|
||||
com->hotchar = 0x7e;
|
||||
else
|
||||
com->hotchar = 0;
|
||||
com->hotchar = linesw[tp->t_line].l_hotchar;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)conf.h 8.5 (Berkeley) 1/9/95
|
||||
* $Id: conf.h,v 1.37 1997/11/22 08:35:42 bde Exp $
|
||||
* $Id: conf.h,v 1.38 1998/01/24 02:01:29 dyson Exp $
|
||||
*/
|
||||
|
||||
#ifndef _SYS_CONF_H_
|
||||
|
|
@ -151,6 +151,7 @@ struct linesw {
|
|||
l_rint_t *l_rint;
|
||||
l_start_t *l_start;
|
||||
l_modem_t *l_modem;
|
||||
u_char l_hotchar;
|
||||
};
|
||||
|
||||
#ifdef KERNEL
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)conf.h 8.5 (Berkeley) 1/9/95
|
||||
* $Id: conf.h,v 1.37 1997/11/22 08:35:42 bde Exp $
|
||||
* $Id: conf.h,v 1.38 1998/01/24 02:01:29 dyson Exp $
|
||||
*/
|
||||
|
||||
#ifndef _SYS_CONF_H_
|
||||
|
|
@ -151,6 +151,7 @@ struct linesw {
|
|||
l_rint_t *l_rint;
|
||||
l_start_t *l_start;
|
||||
l_modem_t *l_modem;
|
||||
u_char l_hotchar;
|
||||
};
|
||||
|
||||
#ifdef KERNEL
|
||||
|
|
|
|||
Loading…
Reference in a new issue