diff mbox series

[6/8] net: dc2114x: allow users to decide whether to detect the tx No Carrier errors

Message ID tencent_530296729B25FF3F25431C450033C6E75F08@qq.com
State Accepted
Commit 5fa3e10cec85ddd12d31af14f9fce6c3c0ff37d0
Delegated to: Ramon Fried
Headers show
Series [1/8] net: dc2114x: add support for platforms that don't have pci controllers | expand

Commit Message

Hanyuan Zhao Aug. 9, 2024, 8:56 a.m. UTC
Some IP cores of dc2114x or its variants do not comply so well with
the behaviors described by the official document. A packet could be
sent successfully but reported with No Carrier error. Latest drivers
of this IP core have not detect this error anymore.

Signed-off-by: Hanyuan Zhao <zhaohy22@mails.tsinghua.edu.cn>
---
 drivers/net/Kconfig   | 11 +++++++++++
 drivers/net/dc2114x.c |  2 ++
 2 files changed, 13 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 41b7c66105..d79d8ad9c4 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -748,6 +748,17 @@  config TULIP_SUPPORT_NON_PCI
 	  Say Y to this and you can run this driver on platforms that do not
 	  have PCI controllers.
 
+config TULIP_IGNORE_TX_NO_CARRIER
+	bool "Ignore tx no carrier error"
+	depends on TULIP
+	default n
+	help
+	  Some IP cores of dc2114x or its variants do not comply so well with
+	  the behaviors described by the official document. A packet could be
+	  sent successfully but reported with No Carrier error. Latest drivers
+	  of this IP core do not detect this error anymore. Say Y to this could
+	  disable handling of this error.
+
 config XILINX_AXIEMAC
 	select PHYLIB
 	select MII
diff --git a/drivers/net/dc2114x.c b/drivers/net/dc2114x.c
index 8a285742a1..dc28712221 100644
--- a/drivers/net/dc2114x.c
+++ b/drivers/net/dc2114x.c
@@ -371,7 +371,9 @@  static int dc21x4x_send_common(struct dc2114x_priv *priv, void *packet, int leng
 
 	if (le32_to_cpu(priv->tx_ring[priv->tx_new].status) & TD_ES) {
 		priv->tx_ring[priv->tx_new].status = 0x0;
+#if !CONFIG_IS_ENABLED(TULIP_IGNORE_TX_NO_CARRIER)
 		goto done;
+#endif
 	}
 
 	status = length;