Commit 3d23a05c authored by Claudiu Manoil's avatar Claudiu Manoil Committed by David S. Miller

gianfar: Enable changing mac addr when if up

Use device flag IFF_LIVE_ADDR_CHANGE to signal that
the device supports changing the hardware address when
the device is running.
This allows eth_mac_addr() to change the mac address
also when the network device's interface is open.
This capability is required by certain applications,
like bonding mode 6 (Adaptive Load Balancing).
Signed-off-by: default avatarClaudiu Manoil <claudiu.manoil@freescale.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bc602280
...@@ -516,6 +516,15 @@ static struct net_device_stats *gfar_get_stats(struct net_device *dev) ...@@ -516,6 +516,15 @@ static struct net_device_stats *gfar_get_stats(struct net_device *dev)
return &dev->stats; return &dev->stats;
} }
static int gfar_set_mac_addr(struct net_device *dev, void *p)
{
eth_mac_addr(dev, p);
gfar_set_mac_for_addr(dev, 0, dev->dev_addr);
return 0;
}
static const struct net_device_ops gfar_netdev_ops = { static const struct net_device_ops gfar_netdev_ops = {
.ndo_open = gfar_enet_open, .ndo_open = gfar_enet_open,
.ndo_start_xmit = gfar_start_xmit, .ndo_start_xmit = gfar_start_xmit,
...@@ -526,7 +535,7 @@ static const struct net_device_ops gfar_netdev_ops = { ...@@ -526,7 +535,7 @@ static const struct net_device_ops gfar_netdev_ops = {
.ndo_tx_timeout = gfar_timeout, .ndo_tx_timeout = gfar_timeout,
.ndo_do_ioctl = gfar_ioctl, .ndo_do_ioctl = gfar_ioctl,
.ndo_get_stats = gfar_get_stats, .ndo_get_stats = gfar_get_stats,
.ndo_set_mac_address = eth_mac_addr, .ndo_set_mac_address = gfar_set_mac_addr,
.ndo_validate_addr = eth_validate_addr, .ndo_validate_addr = eth_validate_addr,
#ifdef CONFIG_NET_POLL_CONTROLLER #ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = gfar_netpoll, .ndo_poll_controller = gfar_netpoll,
...@@ -1411,6 +1420,8 @@ static int gfar_probe(struct platform_device *ofdev) ...@@ -1411,6 +1420,8 @@ static int gfar_probe(struct platform_device *ofdev)
dev->features |= NETIF_F_HW_VLAN_CTAG_RX; dev->features |= NETIF_F_HW_VLAN_CTAG_RX;
} }
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
gfar_init_addr_hash_table(priv); gfar_init_addr_hash_table(priv);
/* Insert receive time stamps into padding alignment bytes */ /* Insert receive time stamps into padding alignment bytes */
......
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