--- Net2/arch/i386/isa/com.c 2018/04/24 18:04:01 1.1.1.1 +++ Net2/arch/i386/isa/com.c 2018/04/24 18:05:03 1.1.1.2 @@ -32,6 +32,7 @@ * * @(#)com.c 7.5 (Berkeley) 5/16/91 */ +static char rcsid[] = "$Header: /var/lib/cvsd/net2/Net2/arch/i386/isa/com.c,v 1.1.1.2 2018/04/24 18:05:03 root Exp $"; #include "com.h" #if NCOM > 0 @@ -215,7 +216,7 @@ comopen(dev, flag, mode, p) while ((flag&O_NONBLOCK) == 0 && (tp->t_cflag&CLOCAL) == 0 && (tp->t_state & TS_CARR_ON) == 0) { tp->t_state |= TS_WOPEN; - if (error = ttysleep(tp, (caddr_t)&tp->t_rawq, TTIPRI | PCATCH, + if (error = ttysleep(tp, (caddr_t)&tp->t_raw, TTIPRI | PCATCH, ttopen, 0)) break; } @@ -521,10 +522,10 @@ comstart(tp) s = spltty(); if (tp->t_state & (TS_TIMEOUT|TS_TTSTOP)) goto out; - if (tp->t_outq.c_cc <= tp->t_lowat) { + if (RB_LEN(&tp->t_out) <= tp->t_lowat) { if (tp->t_state&TS_ASLEEP) { tp->t_state &= ~TS_ASLEEP; - wakeup((caddr_t)&tp->t_outq); + wakeup((caddr_t)&tp->t_out); } if (tp->t_wsel) { selwakeup(tp->t_wsel, tp->t_state & TS_WCOLL); @@ -532,15 +533,15 @@ comstart(tp) tp->t_state &= ~TS_WCOLL; } } - if (tp->t_outq.c_cc == 0) + if (RB_LEN(&tp->t_out) == 0) goto out; if (inb(com+com_lsr) & LSR_TXRDY) { - c = getc(&tp->t_outq); + c = getc(&tp->t_out); tp->t_state |= TS_BUSY; outb(com+com_data, c); if (com_hasfifo & (1 << unit)) - for (c = 1; c < 16 && tp->t_outq.c_cc; ++c) - outb(com+com_data, getc(&tp->t_outq)); + for (c = 1; c < 16 && RB_LEN(&tp->t_out); ++c) + outb(com+com_data, getc(&tp->t_out)); } out: splx(s);