Commit 285e4c66 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

amd: a2065/ariadne: use eth_hw_addr_set()

dev_addr is initialized byte by byte from series.

Fixes build on x86 (32bit).
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 69ede309
......@@ -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;
......
......@@ -441,11 +441,11 @@ static int ariadne_open(struct net_device *dev)
/* Set the Ethernet Hardware Address */
lance->RAP = CSR12; /* Physical Address Register, PADR[15:0] */
lance->RDP = ((u_short *)&dev->dev_addr[0])[0];
lance->RDP = ((const u_short *)&dev->dev_addr[0])[0];
lance->RAP = CSR13; /* Physical Address Register, PADR[31:16] */
lance->RDP = ((u_short *)&dev->dev_addr[0])[1];
lance->RDP = ((const u_short *)&dev->dev_addr[0])[1];
lance->RAP = CSR14; /* Physical Address Register, PADR[47:32] */
lance->RDP = ((u_short *)&dev->dev_addr[0])[2];
lance->RDP = ((const u_short *)&dev->dev_addr[0])[2];
/* Set the Init Block Mode */
lance->RAP = CSR15; /* Mode Register */
......@@ -717,6 +717,7 @@ static int ariadne_init_one(struct zorro_dev *z,
unsigned long mem_start = board + ARIADNE_RAM;
struct resource *r1, *r2;
struct net_device *dev;
u8 addr[ETH_ALEN];
u32 serial;
int err;
......@@ -740,12 +741,13 @@ static int ariadne_init_one(struct zorro_dev *z,
r2->name = dev->name;
serial = be32_to_cpu(z->rom.er_SerialNumber);
dev->dev_addr[0] = 0x00;
dev->dev_addr[1] = 0x60;
dev->dev_addr[2] = 0x30;
dev->dev_addr[3] = (serial >> 16) & 0xff;
dev->dev_addr[4] = (serial >> 8) & 0xff;
dev->dev_addr[5] = serial & 0xff;
addr[0] = 0x00;
addr[1] = 0x60;
addr[2] = 0x30;
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 + ARIADNE_RAM_SIZE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment