Commit 14ef5c39 authored by Roman Gushchin's avatar Roman Gushchin Committed by Jakub Kicinski

net: macb: implement live mac addr change

Implement live mac addr change for the macb ethernet driver.
Signed-off-by: default avatarRoman Gushchin <roman.gushchin@linux.dev>
Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
Link: https://lore.kernel.org/r/20221104204837.614459-1-roman.gushchin@linux.devSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent e1f4ecab
...@@ -2946,6 +2946,18 @@ static int macb_change_mtu(struct net_device *dev, int new_mtu) ...@@ -2946,6 +2946,18 @@ static int macb_change_mtu(struct net_device *dev, int new_mtu)
return 0; return 0;
} }
static int macb_set_mac_addr(struct net_device *dev, void *addr)
{
int err;
err = eth_mac_addr(dev, addr);
if (err < 0)
return err;
macb_set_hwaddr(netdev_priv(dev));
return 0;
}
static void gem_update_stats(struct macb *bp) static void gem_update_stats(struct macb *bp)
{ {
struct macb_queue *queue; struct macb_queue *queue;
...@@ -3785,7 +3797,7 @@ static const struct net_device_ops macb_netdev_ops = { ...@@ -3785,7 +3797,7 @@ static const struct net_device_ops macb_netdev_ops = {
.ndo_eth_ioctl = macb_ioctl, .ndo_eth_ioctl = macb_ioctl,
.ndo_validate_addr = eth_validate_addr, .ndo_validate_addr = eth_validate_addr,
.ndo_change_mtu = macb_change_mtu, .ndo_change_mtu = macb_change_mtu,
.ndo_set_mac_address = eth_mac_addr, .ndo_set_mac_address = macb_set_mac_addr,
#ifdef CONFIG_NET_POLL_CONTROLLER #ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = macb_poll_controller, .ndo_poll_controller = macb_poll_controller,
#endif #endif
...@@ -4048,6 +4060,8 @@ static int macb_init(struct platform_device *pdev) ...@@ -4048,6 +4060,8 @@ static int macb_init(struct platform_device *pdev)
dev->ethtool_ops = &macb_ethtool_ops; dev->ethtool_ops = &macb_ethtool_ops;
} }
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
/* Set features */ /* Set features */
dev->hw_features = NETIF_F_SG; dev->hw_features = NETIF_F_SG;
......
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