plan 9 kernel history: overview | file list | diff list

1990/0315/gnot/devdk.c (diff list | history)

1990/0312/sys/src/9/gnot/devdk.c:287,2931990/0315/sys/src/9/gnot/devdk.c:287,293 (short | long | prev | next)
1990/0312    
	line = bp->rptr[0] | (bp->rptr[1]<<8); 
	bp->rptr += 2; 
	if(line<0 || line>=dp->lines){ 
		print("dkmuxiput bad line %d\n", line); 
1990/0315    
		DPRINT("dkmuxiput bad line %d\n", line); 
1990/0312    
		freeb(bp); 
		return; 
	} 
1990/0312/sys/src/9/gnot/devdk.c:297,3081990/0315/sys/src/9/gnot/devdk.c:297,308
1990/0312    
		if(lp->rq) 
			PUTNEXT(lp->rq, bp); 
		else{ 
			print("dkmuxiput unopened line %d\n", line); 
1990/0315    
			DPRINT("dkmuxiput unopened line %d\n", line); 
1990/0312    
			freeb(bp); 
		} 
		qunlock(lp); 
	} else { 
		print("dkmuxiput unopened line %d\n", line); 
1990/0315    
		DPRINT("dkmuxiput unopened line %d\n", line); 
1990/0312    
		freeb(bp); 
	} 
} 
1990/0312/sys/src/9/gnot/devdk.c:412,4171990/0315/sys/src/9/gnot/devdk.c:412,419
1990/0312    
 
	if(bp->base && bp->rptr - bp->base >= 2) 
		bp->rptr -= 2; 
1990/0315    
	else 
		panic("dkoput"); 
1990/0312    
	bp->rptr[0] = line; 
	bp->rptr[1] = line>>8; 
 
1990/0312/sys/src/9/gnot/devdk.c:574,5801990/0315/sys/src/9/gnot/devdk.c:576,581
1990/0312    
{ 
	Chan *c; 
	Dk *dp; 
print("attach\n"); 
 
	/* 
	 *  find a multiplexor with the same name 
1990/0312/sys/src/9/gnot/devdk.c:581,5871990/0315/sys/src/9/gnot/devdk.c:582,587
1990/0312    
	 */ 
	for(dp = dk; dp < &dk[Ndk]; dp++){ 
		qlock(dp); 
print("name %s %lux\n", dp->name, dp->wq); 
		if(dp->wq && strcmp(spec, dp->name)==0) { 
			dp->ref++; 
			qunlock(dp); 
1990/0312/sys/src/9/gnot/devdk.c:593,5991990/0315/sys/src/9/gnot/devdk.c:593,598
1990/0312    
		error(0, Enoifc); 
	c = devattach('k', spec); 
	c->dev = dp - dk; 
print("attach done\n"); 
	return c; 
} 
 
1990/0312/sys/src/9/gnot/devdk.c:1115,11271990/0315/sys/src/9/gnot/devdk.c:1114,1126
1990/0312    
		 *  for the call to come in on). 
		 */ 
		if(!canqlock(lp)){ 
			print("DKbusy1\n"); 
1990/0315    
			DPRINT("DKbusy1\n"); 
1990/0312    
			dkanswer(c, lineno, DKbusy); 
			continue; 
		} else { 
			if(lp->state != Lclosed){ 
				qunlock(lp); 
				print("DKbusy2 %ux\n", lp->state); 
1990/0315    
				DPRINT("DKbusy2 %ux\n", lp->state); 
1990/0312    
				dkanswer(c, lineno, DKbusy); 
				continue; 
			} 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)