Commit e311eb91 authored by David S. Miller's avatar David S. Miller

Merge branch 'eth_hw_addr_set'

Jakub Kicinski says:

====================
arch, misc: use eth_hw_addr_set()

Convert remaining misc drivers to use helpers to write
to netdev->dev_addr.

This is the last set :) :)
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 704bc986 7e1dd824
...@@ -276,7 +276,7 @@ static const struct ethtool_ops uml_net_ethtool_ops = { ...@@ -276,7 +276,7 @@ static const struct ethtool_ops uml_net_ethtool_ops = {
void uml_net_setup_etheraddr(struct net_device *dev, char *str) void uml_net_setup_etheraddr(struct net_device *dev, char *str)
{ {
unsigned char *addr = dev->dev_addr; u8 addr[ETH_ALEN];
char *end; char *end;
int i; int i;
...@@ -316,6 +316,7 @@ void uml_net_setup_etheraddr(struct net_device *dev, char *str) ...@@ -316,6 +316,7 @@ void uml_net_setup_etheraddr(struct net_device *dev, char *str)
addr[0] | 0x02, addr[1], addr[2], addr[3], addr[4], addr[0] | 0x02, addr[1], addr[2], addr[3], addr[4],
addr[5]); addr[5]);
} }
eth_hw_addr_set(dev, addr);
return; return;
random: random:
......
...@@ -124,7 +124,7 @@ static char *split_if_spec(char *str, ...) ...@@ -124,7 +124,7 @@ static char *split_if_spec(char *str, ...)
static void setup_etheraddr(struct net_device *dev, char *str) static void setup_etheraddr(struct net_device *dev, char *str)
{ {
unsigned char *addr = dev->dev_addr; u8 addr[ETH_ALEN];
if (str == NULL) if (str == NULL)
goto random; goto random;
...@@ -147,6 +147,7 @@ static void setup_etheraddr(struct net_device *dev, char *str) ...@@ -147,6 +147,7 @@ static void setup_etheraddr(struct net_device *dev, char *str)
if (!is_local_ether_addr(addr)) if (!is_local_ether_addr(addr))
pr_warn("%s: assigning a globally valid ethernet address\n", pr_warn("%s: assigning a globally valid ethernet address\n",
dev->name); dev->name);
eth_hw_addr_set(dev, addr);
return; return;
random: random:
......
...@@ -514,6 +514,7 @@ static const struct net_device_ops xpnet_netdev_ops = { ...@@ -514,6 +514,7 @@ static const struct net_device_ops xpnet_netdev_ops = {
static int __init static int __init
xpnet_init(void) xpnet_init(void)
{ {
u8 addr[ETH_ALEN];
int result; int result;
if (!is_uv_system()) if (!is_uv_system())
...@@ -545,15 +546,17 @@ xpnet_init(void) ...@@ -545,15 +546,17 @@ xpnet_init(void)
xpnet_device->min_mtu = XPNET_MIN_MTU; xpnet_device->min_mtu = XPNET_MIN_MTU;
xpnet_device->max_mtu = XPNET_MAX_MTU; xpnet_device->max_mtu = XPNET_MAX_MTU;
memset(addr, 0, sizeof(addr));
/* /*
* Multicast assumes the LSB of the first octet is set for multicast * Multicast assumes the LSB of the first octet is set for multicast
* MAC addresses. We chose the first octet of the MAC to be unlikely * MAC addresses. We chose the first octet of the MAC to be unlikely
* to collide with any vendor's officially issued MAC. * to collide with any vendor's officially issued MAC.
*/ */
xpnet_device->dev_addr[0] = 0x02; /* locally administered, no OUI */ addr[0] = 0x02; /* locally administered, no OUI */
xpnet_device->dev_addr[XPNET_PARTID_OCTET + 1] = xp_partition_id; addr[XPNET_PARTID_OCTET + 1] = xp_partition_id;
xpnet_device->dev_addr[XPNET_PARTID_OCTET + 0] = (xp_partition_id >> 8); addr[XPNET_PARTID_OCTET + 0] = (xp_partition_id >> 8);
eth_hw_addr_set(xpnet_device, addr);
/* /*
* ether_setup() sets this to a multicast device. We are * ether_setup() sets this to a multicast device. We are
......
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