aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorTim Harvey2021-06-30 16:50:07 -0700
committerStefano Babic2021-07-10 18:12:41 +0200
commit431f9d72ffa76031808cb2ed9c90d1da3621c8de (patch)
tree3cb774f89a76e1358fe533fd93d9e4ab9ed80775 /net
parent87550a814e0f136c24c025371d96cf1303185569 (diff)
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 <tharvey@gateworks.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Diffstat (limited to 'net')
-rw-r--r--net/dsa-uclass.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/net/dsa-uclass.c b/net/dsa-uclass.c
index 7ea1cb6949c..694664d81bb 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);