Commit 2edc4bf6 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'hw_addr_set-arch'



Jakub Kicinski says:

====================
net: use eth_hw_addr_set() in arch-specific drivers

Fixups for more arch-specific drivers.

With these (and another patch which didn't fit) the build is more or
less clean with all cross-compilers available on kernel.org. I say
more or less because around half of the arches fail to build for
unrelated reasons right now.

Most of the changes here are for m68k, 32bit x86 and alpha.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 82f60a01 bb52aff3
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -116,6 +116,7 @@ static int hydra_init(struct zorro_dev *z)
    unsigned long ioaddr = board+HYDRA_NIC_BASE;
    const char name[] = "NE2000";
    int start_page, stop_page;
    u8 macaddr[ETH_ALEN];
    int j;
    int err;

@@ -129,7 +130,8 @@ static int hydra_init(struct zorro_dev *z)
	return -ENOMEM;

    for (j = 0; j < ETH_ALEN; j++)
	dev->dev_addr[j] = *((u8 *)(board + HYDRA_ADDRPROM + 2*j));
	macaddr[j] = *((u8 *)(board + HYDRA_ADDRPROM + 2*j));
    eth_hw_addr_set(dev, macaddr);

    /* We must set the 8390 for word mode. */
    z_writeb(0x4b, ioaddr + NE_EN0_DCFG);
+3 −1
Original line number Diff line number Diff line
@@ -292,6 +292,7 @@ static bool mac8390_rsrc_init(struct net_device *dev,
	struct nubus_dirent ent;
	int offset;
	volatile unsigned short *i;
	u8 addr[ETH_ALEN];

	dev->irq = SLOT2IRQ(board->slot);
	/* This is getting to be a habit */
@@ -314,7 +315,8 @@ static bool mac8390_rsrc_init(struct net_device *dev,
		return false;
	}

	nubus_get_rsrc_mem(dev->dev_addr, &ent, 6);
	nubus_get_rsrc_mem(addr, &ent, 6);
	eth_hw_addr_set(dev, addr);

	if (useresources[cardtype] == 1) {
		nubus_rewinddir(&dir);
+3 −1
Original line number Diff line number Diff line
@@ -204,6 +204,7 @@ static int __init ultra_probe1(struct net_device *dev, int ioaddr)
{
	int i, retval;
	int checksum = 0;
	u8 macaddr[ETH_ALEN];
	const char *model_name;
	unsigned char eeprom_irq = 0;
	static unsigned version_printed;
@@ -239,7 +240,8 @@ static int __init ultra_probe1(struct net_device *dev, int ioaddr)
	model_name = (idreg & 0xF0) == 0x20 ? "SMC Ultra" : "SMC EtherEZ";

	for (i = 0; i < 6; i++)
		dev->dev_addr[i] = inb(ioaddr + 8 + i);
		macaddr[i] = inb(ioaddr + 8 + i);
	eth_hw_addr_set(dev, macaddr);

	netdev_info(dev, "%s at %#3x, %pM", model_name,
		    ioaddr, dev->dev_addr);
+3 −1
Original line number Diff line number Diff line
@@ -168,6 +168,7 @@ static int __init wd_probe1(struct net_device *dev, int ioaddr)
	int checksum = 0;
	int ancient = 0;			/* An old card without config registers. */
	int word16 = 0;				/* 0 = 8 bit, 1 = 16 bit */
	u8 addr[ETH_ALEN];
	const char *model_name;
	static unsigned version_printed;
	struct ei_device *ei_local = netdev_priv(dev);
@@ -191,7 +192,8 @@ static int __init wd_probe1(struct net_device *dev, int ioaddr)
		netdev_info(dev, version);

	for (i = 0; i < 6; i++)
		dev->dev_addr[i] = inb(ioaddr + 8 + i);
		addr[i] = inb(ioaddr + 8 + i);
	eth_hw_addr_set(dev, addr);

	netdev_info(dev, "WD80x3 at %#3x, %pM", ioaddr, dev->dev_addr);

+10 −8
Original line number Diff line number Diff line
@@ -680,6 +680,7 @@ static int a2065_init_one(struct zorro_dev *z,
	unsigned long base_addr = board + A2065_LANCE;
	unsigned long mem_start = board + A2065_RAM;
	struct resource *r1, *r2;
	u8 addr[ETH_ALEN];
	u32 serial;
	int err;

@@ -706,17 +707,18 @@ static int a2065_init_one(struct zorro_dev *z,
	r2->name = dev->name;

	serial = be32_to_cpu(z->rom.er_SerialNumber);
	dev->dev_addr[0] = 0x00;
	addr[0] = 0x00;
	if (z->id != ZORRO_PROD_AMERISTAR_A2065) {	/* Commodore */
		dev->dev_addr[1] = 0x80;
		dev->dev_addr[2] = 0x10;
		addr[1] = 0x80;
		addr[2] = 0x10;
	} else {					/* Ameristar */
		dev->dev_addr[1] = 0x00;
		dev->dev_addr[2] = 0x9f;
		addr[1] = 0x00;
		addr[2] = 0x9f;
	}
	dev->dev_addr[3] = (serial >> 16) & 0xff;
	dev->dev_addr[4] = (serial >> 8) & 0xff;
	dev->dev_addr[5] = serial & 0xff;
	addr[3] = (serial >> 16) & 0xff;
	addr[4] = (serial >> 8) & 0xff;
	addr[5] = serial & 0xff;
	eth_hw_addr_set(dev, addr);
	dev->base_addr = (unsigned long)ZTWO_VADDR(base_addr);
	dev->mem_start = (unsigned long)ZTWO_VADDR(mem_start);
	dev->mem_end = dev->mem_start + A2065_RAM_SIZE;
Loading