mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v2 1/6] net: add promiscuous mode configuration support
@ 2022-11-03 13:13 Oleksij Rempel
  2022-11-03 13:13 ` [PATCH v2 2/6] net: dsa: enable promiscuous mode for switch master edev Oleksij Rempel
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Oleksij Rempel @ 2022-11-03 13:13 UTC (permalink / raw)
  To: barebox; +Cc: Oleksij Rempel

This configuration is mostly needed for controllers attached to switches
with different MAC address configurations.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 include/net.h |  3 +++
 net/eth.c     | 10 ++++++++++
 2 files changed, 13 insertions(+)

diff --git a/include/net.h b/include/net.h
index 338033d698..96c2ed1d11 100644
--- a/include/net.h
+++ b/include/net.h
@@ -49,6 +49,8 @@ struct eth_device {
 				 int *length);
 	void (*rx_monitor) (struct eth_device*, void *packet, int length);
 	void (*tx_monitor) (struct eth_device*, void *packet, int length);
+	/* Set promiscuous mode */
+	int  (*set_promiscuous_mode) (struct eth_device*, bool enable);
 
 	struct eth_device *next;
 	void *priv;
@@ -113,6 +115,7 @@ int eth_send(struct eth_device *edev, void *packet, int length);	   /* Send a pa
 int eth_rx(void);			/* Check for received packets	*/
 void eth_open_all(void);
 struct eth_device *of_find_eth_device_by_node(struct device_node *np);
+int eth_set_promiscuous_mode(struct eth_device *edev, bool enable);
 
 /* associate a MAC address to a ethernet device. Should be called by
  * board code for boards which store their MAC address at some unusual
diff --git a/net/eth.c b/net/eth.c
index 8f6ff7db3a..ad4b9d5987 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -31,6 +31,16 @@ struct eth_ethaddr {
 
 static LIST_HEAD(ethaddr_list);
 
+int eth_set_promiscuous_mode(struct eth_device *edev, bool enable)
+{
+	int ret = 0;
+
+	if (edev->set_promiscuous_mode)
+		ret = edev->set_promiscuous_mode(edev, enable);
+
+	return ret;
+}
+
 int eth_set_ethaddr(struct eth_device *edev, const char *ethaddr)
 {
 	int ret;
-- 
2.30.2




^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-11-04  8:54 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-03 13:13 [PATCH v2 1/6] net: add promiscuous mode configuration support Oleksij Rempel
2022-11-03 13:13 ` [PATCH v2 2/6] net: dsa: enable promiscuous mode for switch master edev Oleksij Rempel
2022-11-04  8:26   ` Sascha Hauer
2022-11-04  8:34     ` Ahmad Fatoum
2022-11-03 13:13 ` [PATCH v2 3/6] drivers: net: fec_imx: add promiscuous mode configuration support Oleksij Rempel
2022-11-04  8:29   ` Sascha Hauer
2022-11-04  8:52     ` Sascha Hauer
2022-11-03 13:13 ` [PATCH v2 4/6] net: dsa: fix of_device_ensure_probed*() for switch ports Oleksij Rempel
2022-11-03 13:13 ` [PATCH v2 5/6] ARM: boards: skov-imx6: convert all pr_ to dev_ prints Oleksij Rempel
2022-11-03 13:13 ` [PATCH v2 6/6] ARM: boards: skov-imx6: assigned separate MAC address to LAN2 Oleksij Rempel
2022-11-04  8:25 ` [PATCH v2 1/6] net: add promiscuous mode configuration support Sascha Hauer
2022-11-04  8:37 ` Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox