Help with SLIP

Chris Torek chris at mimsy.UUCP
Wed May 11 06:02:15 AEST 1988


Try the following patch on the 4.3BSD Vax.  Mike's CLISTRESERVE and my
SC_OACTIVE code clashed, so I simplified mine.

RCS file: RCS/if_sl.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -c2 -r1.1 -r1.2
*** /tmp/,RCSt1012706	Tue May 10 16:01:26 1988
--- /tmp/,RCSt2012706	Tue May 10 16:01:30 1988
***************
*** 21,25 ****
   */
  
! /* $Header: if_sl.c,v 1.1 87/04/05 08:59:39 chris Exp $ */
  /* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */
  
--- 21,25 ----
   */
  
! /* $Header: if_sl.c,v 1.2 87/09/03 09:47:01 chris Exp $ */
  /* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */
  
***************
*** 70,74 ****
  /* flags */
  #define	SC_ESCAPED	0x0001	/* saw a FRAME_ESCAPE */
- #define	SC_OACTIVE	0x0002	/* output tty is active */
  
  #define FRAME_END	 	0300		/* Frame End */
--- 70,73 ----
***************
*** 215,219 ****
  	}
  	IF_ENQUEUE(&ifp->if_snd, m);
! 	if ((sc->sc_flags & SC_OACTIVE) == 0) {
  		splx(s);
  		slstart(sc->sc_ttyp);
--- 214,218 ----
  	}
  	IF_ENQUEUE(&ifp->if_snd, m);
! 	if (sc->sc_ttyp->t_outq.c_cc == 0) {
  		splx(s);
  		slstart(sc->sc_ttyp);
***************
*** 235,239 ****
  	register int len;
  	register u_char *cp;
! 	int flush, nd, np, n, s;
  	struct mbuf *m2;
  	extern int cfreecount;
--- 234,238 ----
  	register int len;
  	register u_char *cp;
! 	int nd, np, n, s;
  	struct mbuf *m2;
  	extern int cfreecount;
***************
*** 260,265 ****
  		 * and we have something running already, stop here.
  		 */
! 		if (cfreecount < CLISTRESERVE + SLMTU &&
! 		    sc->sc_flags & SC_OACTIVE)
  			return;
  
--- 259,263 ----
  		 * and we have something running already, stop here.
  		 */
! 		if (cfreecount < CLISTRESERVE + SLMTU && tp->t_outq.c_cc > 0)
  			return;
  
***************
*** 270,280 ****
  		IF_DEQUEUE(&sc->sc_if.if_snd, m);
  		if (m == NULL) {
- 			if (tp->t_outq.c_cc == 0)
- 				sc->sc_flags &= ~SC_OACTIVE;
  			splx(s);
  			return;
  		}
- 		flush = !(sc->sc_flags & SC_OACTIVE);
- 		sc->sc_flags |= SC_OACTIVE;
  		splx(s);
  
--- 268,274 ----
***************
*** 284,288 ****
  		 * the line may have been idle for some time.
  		 */
! 		if (flush)
  			(void) putc(FRAME_END, &tp->t_outq);
  
--- 278,282 ----
  		 * the line may have been idle for some time.
  		 */
! 		if (tp->t_outq.c_cc == 0)	/* atomic */
  			(void) putc(FRAME_END, &tp->t_outq);
  
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.wizards mailing list