val = sonic_read(dev, SONIC_CAP0); 
val = SONIC_READ(SONIC_CAP0); 
int __init mac_onboard_sonic_ethernet_addr(struct net_device* dev){	const int prom_addr = ONBOARD_SONIC_PROM_BASE;	int i;	/* On NuBus boards we can sometimes look in the ROM resources.	   No such luck for comm-slot/onboard. */	for(i = 0; i < 6; i++)		dev->dev_addr[i] = SONIC_READ_PROM(i);	/* Most of the time, the address is bit-reversed.  The NetBSD	   source has a rather long and detailed historical account of	   why this is so. */	if (memcmp(dev->dev_addr, "\x08\x00\x07", 3) &&	    memcmp(dev->dev_addr, "\x00\xA0\x40", 3) &&	    memcmp(dev->dev_addr, "\x00\x05\x02", 3))		bit_reverse_addr(dev->dev_addr);	else		return 0;	/* If we still have what seems to be a bogus address, we'll           look in the CAM.  The top entry should be ours. */	/* Danger! This only works if MacOS has already initialized           the card... */	if (memcmp(dev->dev_addr, "\x08\x00\x07", 3) &&	    memcmp(dev->dev_addr, "\x00\xA0\x40", 3) &&	    memcmp(dev->dev_addr, "\x00\x05\x02", 3))	{		unsigned short val;		printk(KERN_INFO "macsonic: PROM seems to be wrong, trying CAM entry 15\n");				sonic_write(dev, SONIC_CMD, SONIC_CR_RST);		sonic_write(dev, SONIC_CEP, 15);		val = sonic_read(dev, SONIC_CAP2);		dev->dev_addr[5] = val >> 8;		dev->dev_addr[4] = val & 0xff;		val = sonic_read(dev, SONIC_CAP1);		dev->dev_addr[3] = val >> 8;		dev->dev_addr[2] = val & 0xff;		val = sonic_read(dev, SONIC_CAP0);		dev->dev_addr[1] = val >> 8;		dev->dev_addr[0] = val & 0xff;				printk(KERN_INFO "HW Address from CAM 15: ");		for (i = 0; i < 6; i++) {			printk("%2.2x", dev->dev_addr[i]);			if (i < 5)				printk(":");		}		printk("\n");	} else return 0;	if (memcmp(dev->dev_addr, "\x08\x00\x07", 3) &&	    memcmp(dev->dev_addr, "\x00\xA0\x40", 3) &&	    memcmp(dev->dev_addr, "\x00\x05\x02", 3))	{		/*		 * Still nonsense ... messed up someplace!		 */		printk(KERN_ERR "macsonic: ERROR (INVALID MAC)\n");		return -EIO;	} else return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/efcce839360fb3a7b6dedeacaec80f68b0f2d052/macsonic.c/clean/drivers/net/macsonic.c