/* Read the NIC (Number-In-a-Can) device used to store the MAC address on SN0 / SN00 nodeboards and PCI cards.  */
static void ioc3_get_eaddr_nic(struct ioc3_private *ip)
/* Read the NIC (Number-In-a-Can) device used to store the MAC address on SN0 / SN00 nodeboards and PCI cards.  */
static void ioc3_get_eaddr_nic(struct ioc3_private *ip)
{
	struct ioc3 *ioc3 = ip->regs;
	u8 nic[14];
	int tries = 2;
	int i;
	ioc3_w_gpcr_s(1 << 21);
	while (tries--) {
		if (!nic_init(ioc3))
			break;
		udelay(500);
	}
	if (tries < 0) {
		printk("Failed to read MAC address\n");
		return;
	}
	nic_write_byte(ioc3, 0xf0);
	nic_write_byte(ioc3, 0x00);
	nic_write_byte(ioc3, 0x00);
	for (i = 13; i >= 0; i--)
		nic[i] = nic_read_byte(ioc3);
	for (i = 2; i < 8; i++)
		priv_netdev(ip)->dev_addr[i - 2] = nic[i];
}