Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: macb: implement live mac addr change

Implement live mac addr change for the macb ethernet driver.

Signed-off-by: Roman Gushchin <roman.gushchin@linux.dev>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Link: https://lore.kernel.org/r/20221104204837.614459-1-roman.gushchin@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Roman Gushchin and committed by
Jakub Kicinski
14ef5c39 e1f4ecab

+15 -1
+15 -1
drivers/net/ethernet/cadence/macb_main.c
··· 2946 2946 return 0; 2947 2947 } 2948 2948 2949 + static int macb_set_mac_addr(struct net_device *dev, void *addr) 2950 + { 2951 + int err; 2952 + 2953 + err = eth_mac_addr(dev, addr); 2954 + if (err < 0) 2955 + return err; 2956 + 2957 + macb_set_hwaddr(netdev_priv(dev)); 2958 + return 0; 2959 + } 2960 + 2949 2961 static void gem_update_stats(struct macb *bp) 2950 2962 { 2951 2963 struct macb_queue *queue; ··· 3797 3785 .ndo_eth_ioctl = macb_ioctl, 3798 3786 .ndo_validate_addr = eth_validate_addr, 3799 3787 .ndo_change_mtu = macb_change_mtu, 3800 - .ndo_set_mac_address = eth_mac_addr, 3788 + .ndo_set_mac_address = macb_set_mac_addr, 3801 3789 #ifdef CONFIG_NET_POLL_CONTROLLER 3802 3790 .ndo_poll_controller = macb_poll_controller, 3803 3791 #endif ··· 4059 4047 bp->macbgem_ops.mog_rx = macb_rx; 4060 4048 dev->ethtool_ops = &macb_ethtool_ops; 4061 4049 } 4050 + 4051 + dev->priv_flags |= IFF_LIVE_ADDR_CHANGE; 4062 4052 4063 4053 /* Set features */ 4064 4054 dev->hw_features = NETIF_F_SG;