From 4cfd1152d45708393a7ea0b3ae30e3db3b1dd96f Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sat, 23 Feb 1991 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1991-02-23 --- port/stasync.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/port/stasync.c b/port/stasync.c index 4e08c5ed36f0b12707a4a5442b62124f6603cdf2..04d64d0ea2816620f65c75e713af2a9096e1fc2d 100644 --- a/port/stasync.c +++ b/port/stasync.c @@ -178,7 +178,7 @@ aswrite(Async *ap) } void -asputf(Async *ap, int frame) +asputf(Async *ap) { uchar *p; int c; @@ -195,10 +195,8 @@ asputf(Async *ap, int frame) *p++ = 0x00; ap->count = 0; } - if(frame) { - *p++ = FRAME; - *p++ = FRAME; - } + *p++ = FRAME; + *p++ = FRAME; ap->bp->wptr = p; if(asyncdebug > 2) showframe("out", ap, ap->bp->rptr, BLEN(ap->bp)); @@ -215,8 +213,6 @@ asputc(Async *ap, int c) ap->bp = allocb(MAXFRAME+4); p = ap->bp->wptr; if(ap->count <= 0) { - *p++ = FRAME; - *p++ = FRAME; *p++ = d = 0x80|((ap->chan>>5)&0x7e); ap->crc = CRCFUNC(CRCSTART, d); *p++ = d = 0x80|((ap->chan<<1)&0x7e); @@ -228,7 +224,7 @@ asputc(Async *ap, int c) ap->crc = CRCFUNC(ap->crc, c); ap->bp->wptr = p; if(++ap->count >= MAXFRAME-4) - asputf(ap, 0); + asputf(ap); else if(ap->bp->lim - p < 8) aswrite(ap); } @@ -281,7 +277,7 @@ asyncoput(Queue *q, Block *bp) * new frame if the channel number has changed */ if(chan != ap->chan && ap->count > 0) - asputf(ap, 0); + asputf(ap); ap->chan = chan; /* @@ -322,7 +318,7 @@ asyncoput(Queue *q, Block *bp) case BOTS: break; default: - asputf(ap, 1); + asputf(ap); } }