summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorOleksij Rempel <o.rempel@pengutronix.de>2022-11-08 07:10:02 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2022-11-08 11:11:24 +0100
commit90682050d1492cf3cae14ca839409db6307cb6ec (patch)
tree88a87eefa80e097b2beccb91408474c0b58bf0c6 /net
parentfdcfd76ee4fec9d348f29320ad413099b5fe1b6d (diff)
downloadbarebox-90682050d1492cf3cae14ca839409db6307cb6ec.tar.gz
net: add promiscuous mode configuration support
This configuration is mostly needed for controllers attached to switches with different MAC address configurations or for debugging networking issues. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20221108061009.4168735-1-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'net')
-rw-r--r--net/eth.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/eth.c b/net/eth.c
index 8f6ff7db3a..19654cdd51 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -31,6 +31,14 @@ struct eth_ethaddr {
static LIST_HEAD(ethaddr_list);
+int eth_set_promisc(struct eth_device *edev, bool enable)
+{
+ if (!edev->set_promisc)
+ return -EOPNOTSUPP;
+
+ return edev->set_promisc(edev, enable);
+}
+
int eth_set_ethaddr(struct eth_device *edev, const char *ethaddr)
{
int ret;