From 9882d6055240519e4a165d63efa239127fde4cf0 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Mon, 16 Mar 1992 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1992-03-16 --- port/devlance.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/port/devlance.c b/port/devlance.c index dddf74ad1eca3841a1584eb8d3a8b40c9c41f2a9..17a5928483fc63ef07c025abc30117a2f39ea40d 100644 --- a/port/devlance.c +++ b/port/devlance.c @@ -281,21 +281,20 @@ lanceoput(Queue *q, Block *bp ) if(bp->type == M_CTL){ e = q->ptr; + qlock(&l); if(streamparse("connect", bp)){ + if(e->type == -1) + l.all--; e->type = strtol((char *)bp->rptr, 0, 0); - if(e->type == -1){ - qlock(&l); + if(e->type == -1) l.all++; - qunlock(&l); - } } else if(streamparse("promiscuous", bp)) { e->prom = 1; - qlock(&l); l.prom++; if(l.prom == 1) lancestart(PROM, 1);/**/ - qunlock(&l); } + qunlock(&l); freeb(bp); return; } @@ -351,6 +350,7 @@ lanceoput(Queue *q, Block *bp ) l.misses = 0; print("lance wedged, restarting\n"); lancestart(0, 0); + qunlock(&l.tlock); freeb(bp); return; /* the interrupt routine will qunlock(&l.tlock) */ }