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

1994/0702/pc/devether.c (diff list | history)

1994/0629/sys/src/9/pc/devether.c:95,1011994/0702/sys/src/9/pc/devether.c:95,101 (short | long | prev | next)
1992/0424    
} 
 
1993/1120    
void 
etherrloop(Ether *ctlr, Etherpkt *pkt, long len) 
1994/0702    
etherrloop(Ether *ctlr, Etherpkt *pkt, long len, int tome) 
1993/1120    
{ 
	ushort type; 
	Netfile *f, **fp, **ep; 
1994/0629/sys/src/9/pc/devether.c:103,1091994/0702/sys/src/9/pc/devether.c:103,109
1993/1120    
	type = (pkt->type[0]<<8)|pkt->type[1]; 
	ep = &ctlr->f[Ntypes]; 
	for(fp = ctlr->f; fp < ep; fp++){ 
1994/0202    
		if((f = *fp) && (f->type == type || f->type < 0)) 
1994/0702    
		if((f = *fp) && ((tome && f->type==type) || f->type < 0)) 
1994/0202    
			qproduce(f->in, pkt->d, len); 
1993/1120    
	} 
} 
1994/0629/sys/src/9/pc/devether.c:111,1271994/0702/sys/src/9/pc/devether.c:111,128
1993/1120    
static int 
etherwloop(Ether *ctlr, Etherpkt *pkt, long len) 
{ 
	int s, different; 
1994/0702    
	int s, tome, bcast; 
1993/1120    
 
	different = memcmp(pkt->d, pkt->s, sizeof(pkt->s)); 
1994/0629    
	if(different && memcmp(pkt->d, ctlr->bcast, sizeof(pkt->d)) 
	&& ctlr->prom==0 && ctlr->all==0) 
1994/0702    
	tome = memcmp(pkt->d, ctlr->ea, sizeof(pkt->d)) == 0; 
	bcast = memcmp(pkt->d, ctlr->bcast, sizeof(pkt->d)) == 0; 
	if(!tome && !bcast && ctlr->prom==0 && ctlr->all==0) 
1993/1120    
		return 0; 
 
	s = splhi(); 
	etherrloop(ctlr, pkt, len); 
1994/0702    
	etherrloop(ctlr, pkt, len, tome||bcast); 
1993/1120    
	splx(s); 
	return !different; 
1994/0702    
 
	return tome; 
1993/1120    
} 
 
1993/1113    
long 


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