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

natsemi: macsonic: use eth_hw_addr_set()

Byte by byte assignments.

Fixes build on m68k.
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9a962aed
......@@ -203,6 +203,7 @@ static void mac_onboard_sonic_ethernet_addr(struct net_device *dev)
struct sonic_local *lp = netdev_priv(dev);
const int prom_addr = ONBOARD_SONIC_PROM_BASE;
unsigned short val;
u8 addr[ETH_ALEN];
/*
* On NuBus boards we can sometimes look in the ROM resources.
......@@ -213,7 +214,8 @@ static void mac_onboard_sonic_ethernet_addr(struct net_device *dev)
int i;
for (i = 0; i < 6; i++)
dev->dev_addr[i] = SONIC_READ_PROM(i);
addr[i] = SONIC_READ_PROM(i);
eth_hw_addr_set(dev, addr);
if (!INVALID_MAC(dev->dev_addr))
return;
......@@ -222,7 +224,8 @@ static void mac_onboard_sonic_ethernet_addr(struct net_device *dev)
* source has a rather long and detailed historical account of
* why this is so.
*/
bit_reverse_addr(dev->dev_addr);
bit_reverse_addr(addr);
eth_hw_addr_set(dev, addr);
if (!INVALID_MAC(dev->dev_addr))
return;
......@@ -243,14 +246,15 @@ static void mac_onboard_sonic_ethernet_addr(struct net_device *dev)
SONIC_WRITE(SONIC_CEP, 15);
val = SONIC_READ(SONIC_CAP2);
dev->dev_addr[5] = val >> 8;
dev->dev_addr[4] = val & 0xff;
addr[5] = val >> 8;
addr[4] = val & 0xff;
val = SONIC_READ(SONIC_CAP1);
dev->dev_addr[3] = val >> 8;
dev->dev_addr[2] = val & 0xff;
addr[3] = val >> 8;
addr[2] = val & 0xff;
val = SONIC_READ(SONIC_CAP0);
dev->dev_addr[1] = val >> 8;
dev->dev_addr[0] = val & 0xff;
addr[1] = val >> 8;
addr[0] = val & 0xff;
eth_hw_addr_set(dev, addr);
if (!INVALID_MAC(dev->dev_addr))
return;
......@@ -355,13 +359,16 @@ static int mac_onboard_sonic_probe(struct net_device *dev)
static int mac_sonic_nubus_ethernet_addr(struct net_device *dev,
unsigned long prom_addr, int id)
{
u8 addr[ETH_ALEN];
int i;
for(i = 0; i < 6; i++)
dev->dev_addr[i] = SONIC_READ_PROM(i);
addr[i] = SONIC_READ_PROM(i);
/* Some of the addresses are bit-reversed */
if (id != MACSONIC_DAYNA)
bit_reverse_addr(dev->dev_addr);
bit_reverse_addr(addr);
eth_hw_addr_set(dev, addr);
return 0;
}
......
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