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

1997/0415/pc/devether.c (diff list | history)

1997/0408/sys/src/9/pc/devether.c:385,3901997/0415/sys/src/9/pc/devether.c:385,412 (short | long | prev | next)
1997/0327    
		free(ether); 
1992/0403    
} 
1997/0327    
 
1997/0415    
#define POLY 0xedb88320 
 
/* really slow 32 bit crc for ethers */ 
ulong 
ethercrc(uchar *p, int len) 
{ 
	int i, j; 
	ulong crc, b; 
 
	crc = 0xffffffff; 
	for(i = 0; i < len; i++){ 
		b = *p++; 
		for(j = 0; j < 8; j++){ 
			crc = (crc>>1); 
			if((crc^b) & 1) 
				crc ^= POLY; 
			b >>= 1; 
		} 
	} 
	return crc; 
} 
 
1997/0327    
Dev etherdevtab = { 
1997/0408    
	'l', 
	"ether", 


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