GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780) { 
(tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) { 
static int __devinit tg3_get_device_address(struct tg3 *tp){	struct net_device *dev = tp->dev;	u32 hi, lo, mac_offset;#ifdef CONFIG_SPARC64	if (!tg3_get_macaddr_sparc(tp))		return 0;#endif	mac_offset = 0x7c;	if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 &&	     !(tp->tg3_flags & TG3_FLG2_SUN_570X)) ||	    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780) {		if (tr32(TG3PCI_DUAL_MAC_CTRL) & DUAL_MAC_CTRL_ID)			mac_offset = 0xcc;		if (tg3_nvram_lock(tp))			tw32_f(NVRAM_CMD, NVRAM_CMD_RESET);		else			tg3_nvram_unlock(tp);	}	/* First try to get it from MAC address mailbox. */	tg3_read_mem(tp, NIC_SRAM_MAC_ADDR_HIGH_MBOX, &hi);	if ((hi >> 16) == 0x484b) {		dev->dev_addr[0] = (hi >>  8) & 0xff;		dev->dev_addr[1] = (hi >>  0) & 0xff;		tg3_read_mem(tp, NIC_SRAM_MAC_ADDR_LOW_MBOX, &lo);		dev->dev_addr[2] = (lo >> 24) & 0xff;		dev->dev_addr[3] = (lo >> 16) & 0xff;		dev->dev_addr[4] = (lo >>  8) & 0xff;		dev->dev_addr[5] = (lo >>  0) & 0xff;	}	/* Next, try NVRAM. */	else if (!(tp->tg3_flags & TG3_FLG2_SUN_570X) &&		 !tg3_nvram_read(tp, mac_offset + 0, &hi) &&		 !tg3_nvram_read(tp, mac_offset + 4, &lo)) {		dev->dev_addr[0] = ((hi >> 16) & 0xff);		dev->dev_addr[1] = ((hi >> 24) & 0xff);		dev->dev_addr[2] = ((lo >>  0) & 0xff);		dev->dev_addr[3] = ((lo >>  8) & 0xff);		dev->dev_addr[4] = ((lo >> 16) & 0xff);		dev->dev_addr[5] = ((lo >> 24) & 0xff);	}	/* Finally just fetch it out of the MAC control regs. */	else {		hi = tr32(MAC_ADDR_0_HIGH);		lo = tr32(MAC_ADDR_0_LOW);		dev->dev_addr[5] = lo & 0xff;		dev->dev_addr[4] = (lo >> 8) & 0xff;		dev->dev_addr[3] = (lo >> 16) & 0xff;		dev->dev_addr[2] = (lo >> 24) & 0xff;		dev->dev_addr[1] = hi & 0xff;		dev->dev_addr[0] = (hi >> 8) & 0xff;	}	if (!is_valid_ether_addr(&dev->dev_addr[0])) {#ifdef CONFIG_SPARC64		if (!tg3_get_default_macaddr_sparc(tp))			return 0;#endif		return -EINVAL;	}	memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/a4e2b347848bf626b822599329933887dc90e50f/tg3.c/clean/drivers/net/tg3.c