Skip to contentSkip to conversation

Revert "eth: remove the DLink/Sundance (ST201) driver"

PATCH Applied Jakub Kicinski 4 participants 7 messages Sep 1, 2025 – Sep 17, 2025

Subsystems (5)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/2 Revert "eth: remove the DLink/Sundance (ST201) driver"

This reverts commit 8401a108a63302a5a198c7075d857895ca624851.

I got a report from an (anonymous) Sundance user:

Ethernet controller: Sundance Technology Inc / IC Plus Corp IC Plus IP100A Integrated 10/100 Ethernet MAC + PHY (rev 31)

Revert the driver back in. Make following changes:
- update Denis's email address in MAINTAINERS
- adjust to timer API renames:
- del_timer_sync() -> timer_delete_sync()
- from_timer() -> timer_container_of()

Fixes 8401a108a633 ("eth: remove the DLink/Sundance (ST201) driver")

---
cc: [email protected]

---
 MAINTAINERS                           |    6 +
 drivers/net/ethernet/dlink/Kconfig    |   20 +
 drivers/net/ethernet/dlink/Makefile   |    1 +
 drivers/net/ethernet/dlink/sundance.c | 1985 +++++++++++++++++++++++++
 arch/mips/configs/mtx1_defconfig      |    1 +
 arch/powerpc/configs/ppc6xx_defconfig |    1 +
 6 files changed, 2014 insertions(+)
 create mode 100644 drivers/net/ethernet/dlink/sundance.c
MAINTAINERS +6 -0
index 82ece9ec5f0b..9b8873f440b6 100644
@@ -24262,6 +24262,12 @@ S:	Maintained
 F:	Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml
 F:	drivers/input/keyboard/sun4i-lradc-keys.c
 
+SUNDANCE NETWORK DRIVER
+M:	Denis Kirjanov <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	drivers/net/ethernet/dlink/sundance.c
+
 SUNPLUS ETHERNET DRIVER
 M:	Wells Lu <[email protected]>
 L:	[email protected]
drivers/net/ethernet/dlink/Kconfig +20 -0
index e9e13654812c..0d77f84c8e7b 100644
@@ -32,4 +32,24 @@ config DL2K
 	  To compile this driver as a module, choose M here: the
 	  module will be called dl2k.
 
+config SUNDANCE
+	tristate "Sundance Alta support"
+	depends on PCI
+	select CRC32
+	select MII
+	help
+	  This driver is for the Sundance "Alta" chip.
+	  More specific information and updates are available from
+	  <http://www.scyld.com/network/sundance.html>.
+
+config SUNDANCE_MMIO
+	bool "Use MMIO instead of PIO"
+	depends on SUNDANCE
+	help
+	  Enable memory-mapped I/O for interaction with Sundance NIC registers.
+	  Do NOT enable this by default, PIO (enabled when MMIO is disabled)
+	  is known to solve bugs on certain chips.
+
+	  If unsure, say N.
+
 endif # NET_VENDOR_DLINK
drivers/net/ethernet/dlink/Makefile +1 -0
index 38c236eb6007..3ff503c747db 100644
@@ -4,3 +4,4 @@
 #
 
 obj-$(CONFIG_DL2K) += dl2k.o
+obj-$(CONFIG_SUNDANCE) += sundance.o
drivers/net/ethernet/dlink/sundance.c new file +1985 -0

1,985 lines not on this page · raw message

arch/mips/configs/mtx1_defconfig +1 -0
index e4bcdb64df6c..2707ab134639 100644
@@ -273,6 +273,7 @@ CONFIG_DM9102=m
 CONFIG_ULI526X=m
 CONFIG_PCMCIA_XIRCOM=m
 CONFIG_DL2K=m
+CONFIG_SUNDANCE=m
 CONFIG_PCMCIA_FMVJ18X=m
 CONFIG_E100=m
 CONFIG_E1000=m
arch/powerpc/configs/ppc6xx_defconfig +1 -0
index bb359643ddc1..b082c1fae13c 100644
@@ -433,6 +433,7 @@ CONFIG_DM9102=m
 CONFIG_ULI526X=m
 CONFIG_PCMCIA_XIRCOM=m
 CONFIG_DL2K=m
+CONFIG_SUNDANCE=m
 CONFIG_S2IO=m
 CONFIG_FEC_MPC52xx=m
 CONFIG_GIANFAR=m
Signature · 1 line
2.51.0
author maintainer
#1 lore raw

PATCH 2/2 eth: sundance: fix endian issues

Fix sparse warnings about endianness. Store DMA addr to a variable of correct type and then only convert it when writing to the descriptor.

---
 drivers/net/ethernet/dlink/sundance.c | 35 +++++++++++++++------------
 1 file changed, 20 insertions(+), 15 deletions(-)
drivers/net/ethernet/dlink/sundance.c +20 -15
index 29d59c42dfa3..277c50ef773f 100644
@@ -1033,21 +1033,22 @@ static void init_ring(struct net_device *dev)
 
 	/* Fill in the Rx buffers.  Handle allocation failure gracefully. */
 	for (i = 0; i < RX_RING_SIZE; i++) {
+		dma_addr_t addr;
+
 		struct sk_buff *skb =
 			netdev_alloc_skb(dev, np->rx_buf_sz + 2);
 		np->rx_skbuff[i] = skb;
 		if (skb == NULL)
 			break;
 		skb_reserve(skb, 2);	/* 16 byte align the IP header. */
-		np->rx_ring[i].frag.addr = cpu_to_le32(
-			dma_map_single(&np->pci_dev->dev, skb->data,
-				np->rx_buf_sz, DMA_FROM_DEVICE));
-		if (dma_mapping_error(&np->pci_dev->dev,
-					np->rx_ring[i].frag.addr)) {
+		addr = dma_map_single(&np->pci_dev->dev, skb->data,
+				      np->rx_buf_sz, DMA_FROM_DEVICE);
+		if (dma_mapping_error(&np->pci_dev->dev, addr)) {
 			dev_kfree_skb(skb);
 			np->rx_skbuff[i] = NULL;
 			break;
 		}
+		np->rx_ring[i].frag.addr = cpu_to_le32(addr);
 		np->rx_ring[i].frag.length = cpu_to_le32(np->rx_buf_sz | LastFrag);
 	}
 	np->dirty_rx = (unsigned int)(i - RX_RING_SIZE);
@@ -1088,6 +1089,7 @@ start_tx (struct sk_buff *skb, struct net_device *dev)
 {
 	struct netdev_private *np = netdev_priv(dev);
 	struct netdev_desc *txdesc;
+	dma_addr_t addr;
 	unsigned entry;
 
 	/* Calculate the next Tx descriptor entry. */
@@ -1095,13 +1097,14 @@ start_tx (struct sk_buff *skb, struct net_device *dev)
 	np->tx_skbuff[entry] = skb;
 	txdesc = &np->tx_ring[entry];
 
+	addr = dma_map_single(&np->pci_dev->dev, skb->data, skb->len,
+			      DMA_TO_DEVICE);
+	if (dma_mapping_error(&np->pci_dev->dev, addr))
+		goto drop_frame;
+
 	txdesc->next_desc = 0;
 	txdesc->status = cpu_to_le32 ((entry << 2) | DisableAlign);
-	txdesc->frag.addr = cpu_to_le32(dma_map_single(&np->pci_dev->dev,
-				skb->data, skb->len, DMA_TO_DEVICE));
-	if (dma_mapping_error(&np->pci_dev->dev,
-				txdesc->frag.addr))
-			goto drop_frame;
+	txdesc->frag.addr = cpu_to_le32(addr);
 	txdesc->frag.length = cpu_to_le32 (skb->len | LastFrag);
 
 	/* Increment cur_tx before tasklet_schedule() */
@@ -1419,6 +1422,8 @@ static void refill_rx (struct net_device *dev)
 	for (;(np->cur_rx - np->dirty_rx + RX_RING_SIZE) % RX_RING_SIZE > 0;
 		np->dirty_rx = (np->dirty_rx + 1) % RX_RING_SIZE) {
 		struct sk_buff *skb;
+		dma_addr_t addr;
+
 		entry = np->dirty_rx % RX_RING_SIZE;
 		if (np->rx_skbuff[entry] == NULL) {
 			skb = netdev_alloc_skb(dev, np->rx_buf_sz + 2);
@@ -1426,15 +1431,15 @@ static void refill_rx (struct net_device *dev)
 			if (skb == NULL)
 				break;		/* Better luck next round. */
 			skb_reserve(skb, 2);	/* Align IP on 16 byte boundaries */
-			np->rx_ring[entry].frag.addr = cpu_to_le32(
-				dma_map_single(&np->pci_dev->dev, skb->data,
-					np->rx_buf_sz, DMA_FROM_DEVICE));
-			if (dma_mapping_error(&np->pci_dev->dev,
-				    np->rx_ring[entry].frag.addr)) {
+			addr = dma_map_single(&np->pci_dev->dev, skb->data,
+					      np->rx_buf_sz, DMA_FROM_DEVICE);
+			if (dma_mapping_error(&np->pci_dev->dev, addr)) {
 			    dev_kfree_skb_irq(skb);
 			    np->rx_skbuff[entry] = NULL;
 			    break;
 			}
+
+			np->rx_ring[entry].frag.addr = cpu_to_le32(addr);
 		}
 		/* Perhaps we need not reset this field. */
 		np->rx_ring[entry].frag.length =
Signature · 1 line
2.51.0
reviewer Reviewed-by on v1 1/2
#3 lore raw
In reply to Jakub Kicinski
Quoted 6 lines · Jakub Kicinski

This reverts commit 8401a108a63302a5a198c7075d857895ca624851.

I got a report from an (anonymous) Sundance user:

Ethernet controller: Sundance Technology Inc / IC Plus Corp IC Plus IP100A Integrated 10/100 Ethernet MAC + PHY (rev 31)

Quoted 8 lines

Revert the driver back in. Make following changes:
- update Denis's email address in MAINTAINERS
- adjust to timer API renames:
- del_timer_sync() -> timer_delete_sync()
- from_timer() -> timer_container_of()

Fixes 8401a108a633 ("eth: remove the DLink/Sundance (ST201) driver")
#4 lore raw
In reply to Jakub Kicinski
This series was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This series was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 6 lines · On Mon, 1 Sep 2025 14:08:17 -0700 you wrote:

This reverts commit 8401a108a63302a5a198c7075d857895ca624851.

I got a report from an (anonymous) Sundance user:

Ethernet controller: Sundance Technology Inc / IC Plus Corp IC Plus IP100A Integrated 10/100 Ethernet MAC + PHY (rev 31)

Quoted 7 lines

Revert the driver back in. Make following changes:
- update Denis's email address in MAINTAINERS
- adjust to timer API renames:
- del_timer_sync() -> timer_delete_sync()
- from_timer() -> timer_container_of()

[...]

Here is the summary with links:
- [net,1/2] Revert "eth: remove the DLink/Sundance (ST201) driver"

    https://git.kernel.org/netdev/net/c/8b3332c1331c
  - [net,2/2] eth: sundance: fix endian issues
    https://git.kernel.org/netdev/net/c/d2644cbc736f

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#5 lore raw
In reply to Jakub Kicinski

MAINTAINERS S: Maintained · line 24266

Quoted 11 lines · Jakub Kicinski

This reverts commit 8401a108a63302a5a198c7075d857895ca624851.

I got a report from an (anonymous) Sundance user:

Ethernet controller: Sundance Technology Inc / IC Plus Corp IC Plus IP100A Integrated 10/100 Ethernet MAC + PHY (rev 31)

Revert the driver back in. Make following changes:
- update Denis's email address in MAINTAINERS

MAINTAINERS +2 -0
+SUNDANCE NETWORK DRIVER
+M:	Denis Kirjanov <[email protected]>

FWIW this email address does not exist anymore, you may want to replace it with [email protected] (found in archives and added to CC).

Quoted 3 lines
MAINTAINERS +3 -0
+L:	[email protected]
+S:	Maintained
+F:	drivers/net/ethernet/dlink/sundance.c
author maintainer
#6 lore raw
Quoted 5 lines · On Wed, 17 Sep 2025 19:35:48 +0200 David Sterba wrote:

MAINTAINERS S: Maintained · line 24266

Quoted 2 lines
MAINTAINERS +2 -0
+SUNDANCE NETWORK DRIVER
+M:	Denis Kirjanov <[email protected]>  

FWIW this email address does not exist anymore, you may want to replace it with [email protected] (found in archives and added to CC).

Denis, could you send a patch?