From: Tim Harvey Date: Wed, 30 Jun 2021 23:50:07 +0000 (-0700) Subject: net: dsa: enable master promisc mode if available and needed X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=431f9d72ffa76031808cb2ed9c90d1da3621c8de;p=u-boot.git net: dsa: enable master promisc mode if available and needed If ports have their own unique MAC addrs and master has a set_promisc function, call it so that packets will be received for ports. Signed-off-by: Tim Harvey Reviewed-by: Ramon Fried --- diff --git a/net/dsa-uclass.c b/net/dsa-uclass.c index 7ea1cb6949..694664d81b 100644 --- a/net/dsa-uclass.c +++ b/net/dsa-uclass.c @@ -277,8 +277,15 @@ static int dsa_port_probe(struct udevice *pdev) * has a unique MAC address specified in the environment. */ eth_env_get_enetaddr_by_index("eth", dev_seq(pdev), env_enetaddr); - if (!is_zero_ethaddr(env_enetaddr)) + if (!is_zero_ethaddr(env_enetaddr)) { + /* individual port mac addrs require master to be promisc */ + struct eth_ops *eth_ops = eth_get_ops(master); + + if (eth_ops->set_promisc) + eth_ops->set_promisc(master, 1); + return 0; + } master_pdata = dev_get_plat(master); eth_pdata = dev_get_plat(pdev);