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

1993/1119/pc/ether8390.c (diff list | history)

1993/1118/sys/src/9/pc/ether8390.c:446,4521993/1119/sys/src/9/pc/ether8390.c:446,455 (short | long | prev | next)
1993/1116    
			for(fp = ether->f; fp < ep; fp++) { 
				f = *fp; 
				if(f && (f->type == type || f->type < 0)) 
1993/1119    
{ 
print("Q%d|", len); 
1993/1116    
					qproduce(f->in, ðer->rpkt, len); 
1993/1119    
} 
1993/1116    
			} 
1992/1222    
		} 
 
1993/1118/sys/src/9/pc/ether8390.c:464,4721993/1119/sys/src/9/pc/ether8390.c:467,475
1992/1222    
} 
 
1993/1118    
static int 
istxbusy(void *arg) 
1993/1119    
istxavail(void *arg) 
1992/1222    
{ 
1993/1118    
	return ((Dp8390*)arg)->busy == 0; 
1993/1119    
	return ((Ether*)arg)->tlen == 0; 
1993/1118    
} 
1993/0212    
 
1993/1118    
static long 
1993/1118/sys/src/9/pc/ether8390.c:478,4941993/1119/sys/src/9/pc/ether8390.c:481,493
1993/1118    
	dp8390 = ether->private; 
	port = dp8390->dp8390; 
1993/0213    
 
1993/1118    
	qlock(ðer->tlock); 
	if(waserror()) { 
		qunlock(ðer->tlock); 
		nexterror(); 
1993/1119    
	tsleep(ðer->tr, istxavail, ether, 10000); 
	if(ether->tlen){ 
		print("dp8390: transmitter jammed\n"); 
		return 0; 
1993/0212    
	} 
1993/1119    
	ether->tlen = n; 
1993/1118    
 
	tsleep(ðer->tr, istxbusy, dp8390, 10000); 
	if(dp8390->busy) 
		print("dp8390: transmitter jammed\n"); 
	dp8390->busy = 1; 
                 
	if(dp8390->ram) 
		memmove((void*)(ether->mem+dp8390->tstart*Dp8390BufSz), buf, n); 
	else 
1993/1118/sys/src/9/pc/ether8390.c:498,5061993/1119/sys/src/9/pc/ether8390.c:497,502
1993/1118    
	dp8390outb(port+Tbcr1, (n>>8) & 0xFF); 
	dp8390outb(port+Cr, Page0|RDMAabort|Txp|Sta); 
 
	poperror(); 
	qunlock(ðer->tlock); 
                 
	return n; 
1993/0212    
} 
 
1993/1118/sys/src/9/pc/ether8390.c:555,5601993/1119/sys/src/9/pc/ether8390.c:551,557
1992/1222    
	 */ 
1993/1118    
	dp8390outb(port+Imr, 0x00); 
	while(isr = dp8390inb(port+Isr)){ 
1993/1119    
print("I%2.2ux|", isr); 
1992/1222    
 
		if(isr & Ovw){ 
1993/1116    
			overflow(ether); 
1993/1118/sys/src/9/pc/ether8390.c:588,5941993/1119/sys/src/9/pc/ether8390.c:585,591
1993/0212    
 
			if(isr & Ptx) 
1993/1116    
				ether->outpackets++; 
1993/1118    
			dp8390->busy = 0; 
1993/1119    
			ether->tlen = 0; 
1993/1116    
			wakeup(ðer->tr); 
1992/1222    
		} 
1993/0212    
 


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