Skip to contentSkip to conversation

dl2k: Add support for IP1000A-based cards

RFC PATCH In review Ondrej Zary 3 participants 6 messages Aug 23, 2015 – Sep 4, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/2 dl2k: Add support for IP1000A-based cards

Add support for IP1000A chips to dl2k driver. IP1000A chip looks like a TC9020 with integrated PHY.

Tested with Asus NX1101.

---
 drivers/net/ethernet/dlink/Kconfig |    5 ++--
 drivers/net/ethernet/dlink/dl2k.c  |   51 +++++++++++++++++++++++++++++++++---
 drivers/net/ethernet/dlink/dl2k.h  |   15 ++++++++++-
 3 files changed, 65 insertions(+), 6 deletions(-)
drivers/net/ethernet/dlink/Kconfig +3 -2
index f6e858d..ebdc832 100644
@@ -17,15 +17,16 @@ config NET_VENDOR_DLINK
 if NET_VENDOR_DLINK
 
 config DL2K
-	tristate "DL2000/TC902x-based Gigabit Ethernet support"
+	tristate "DL2000/TC902x/IP1000A-based Gigabit Ethernet support"
 	depends on PCI
 	select CRC32
 	---help---
-	  This driver supports DL2000/TC902x-based Gigabit ethernet cards,
+	  This driver supports DL2000/TC902x/IP1000A-based Gigabit ethernet cards,
 	  which includes
 	  D-Link DGE-550T Gigabit Ethernet Adapter.
 	  D-Link DL2000-based Gigabit Ethernet Adapter.
 	  Sundance/Tamarack TC902x Gigabit Ethernet Adapter.
+	  ICPlus IP1000A-based cards
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called dl2k.
drivers/net/ethernet/dlink/dl2k.c +48 -3

99 lines not on this page · raw message

drivers/net/ethernet/dlink/dl2k.h +14 -1
index 23c07b0..8f4f612 100644
@@ -211,6 +211,10 @@ enum ASICCtrl_HiWord_bits {
 	ResetBusy = 0x0400,
 };
 
+#define IPG_AC_LED_MODE		BIT(14)
+#define IPG_AC_LED_SPEED	BIT(27)
+#define IPG_AC_LED_MODE_BIT_1	BIT(29)
+
 /* Transmit Frame Control bits */
 enum TFC_bits {
 	DwordAlign = 0x00000000,
@@ -332,7 +336,10 @@ typedef struct t_SROM {
 	u16 asic_ctrl;		/* 0x02 */
 	u16 sub_vendor_id;	/* 0x04 */
 	u16 sub_system_id;	/* 0x06 */
-	u16 reserved1[12];	/* 0x08-0x1f */
+	u16 pci_base_1;		/* 0x08 (IP1000A only) */
+	u16 pci_base_2;		/* 0x0a (IP1000A only) */
+	u16 led_mode;		/* 0x0c (IP1000A only) */
+	u16 reserved1[9];	/* 0x0e-0x1f */
 	u8 mac_addr[6];		/* 0x20-0x25 */
 	u8 reserved2[10];	/* 0x26-0x2f */
 	u8 sib[204];		/* 0x30-0xfb */
@@ -397,6 +404,7 @@ struct netdev_private {
 	u16 advertising;	/* NWay media advertisement */
 	u16 negotiate;		/* Negotiated media */
 	int phy_addr;		/* PHY addresses. */
+	u16 led_mode;		/* LED mode read from EEPROM (IP1000A only) */
 };
 
 /* The station address location in the EEPROM. */
@@ -407,10 +415,15 @@ struct netdev_private {
         class_mask              of the class are honored during the comparison.
         driver_data             Data private to the driver.
 */
+#define CHIP_IP1000A	1
 
 static const struct pci_device_id rio_pci_tbl[] = {
 	{0x1186, 0x4000, PCI_ANY_ID, PCI_ANY_ID, },
 	{0x13f0, 0x1021, PCI_ANY_ID, PCI_ANY_ID, },
+	{ PCI_VDEVICE(SUNDANCE,	0x1023), CHIP_IP1000A },
+	{ PCI_VDEVICE(SUNDANCE,	0x2021), CHIP_IP1000A },
+	{ PCI_VDEVICE(DLINK,	0x9021), CHIP_IP1000A },
+	{ PCI_VDEVICE(DLINK,	0x4020), CHIP_IP1000A },
 	{ }
 };
 MODULE_DEVICE_TABLE (pci, rio_pci_tbl);
Signature · 1 line
Ondrej Zary
#1 lore raw

RFC PATCH 2/2 ipg: Remove ipg driver

Now that IP1000A chips are supported by dl2k driver, the buggy ipg driver can be removed.

---
 drivers/net/ethernet/Kconfig         |    1 -
 drivers/net/ethernet/Makefile        |    1 -
 drivers/net/ethernet/icplus/Kconfig  |   13 -
 drivers/net/ethernet/icplus/Makefile |    5 -
 drivers/net/ethernet/icplus/ipg.c    | 2300 ----------------------------------
 drivers/net/ethernet/icplus/ipg.h    |  748 -----------
 6 files changed, 3068 deletions(-)
 delete mode 100644 drivers/net/ethernet/icplus/Kconfig
 delete mode 100644 drivers/net/ethernet/icplus/Makefile
 delete mode 100644 drivers/net/ethernet/icplus/ipg.c
 delete mode 100644 drivers/net/ethernet/icplus/ipg.h
drivers/net/ethernet/Kconfig +0 -1
index f3bb178..4fcc7ff 100644
@@ -78,7 +78,6 @@ source "drivers/net/ethernet/ibm/Kconfig"
 source "drivers/net/ethernet/intel/Kconfig"
 source "drivers/net/ethernet/i825xx/Kconfig"
 source "drivers/net/ethernet/xscale/Kconfig"
-source "drivers/net/ethernet/icplus/Kconfig"
 
 config JME
 	tristate "JMicron(R) PCI-Express Gigabit Ethernet support"
drivers/net/ethernet/Makefile +0 -1
index c51014b..05b7471 100644
@@ -41,7 +41,6 @@ obj-$(CONFIG_NET_VENDOR_IBM) += ibm/
 obj-$(CONFIG_NET_VENDOR_INTEL) += intel/
 obj-$(CONFIG_NET_VENDOR_I825XX) += i825xx/
 obj-$(CONFIG_NET_VENDOR_XSCALE) += xscale/
-obj-$(CONFIG_IP1000) += icplus/
 obj-$(CONFIG_JME) += jme.o
 obj-$(CONFIG_KORINA) += korina.o
 obj-$(CONFIG_LANTIQ_ETOP) += lantiq_etop.o
drivers/net/ethernet/icplus/Kconfig deleted +0 -13
deleted file mode 100644
index 14a66e9..0000000
@@ -1,13 +0,0 @@
-#
-# IC Plus device configuration
-#
-
-config IP1000
-	tristate "IP1000 Gigabit Ethernet support"
-	depends on PCI
-	select MII
-	---help---
-	  This driver supports IP1000 gigabit Ethernet cards.
-
-	  To compile this driver as a module, choose M here: the module
-	  will be called ipg.  This is recommended.
drivers/net/ethernet/icplus/Makefile deleted +0 -5
deleted file mode 100644
index 5bc87c1..0000000
@@ -1,5 +0,0 @@
-#
-# Makefile for the IC Plus device drivers
-#
-
-obj-$(CONFIG_IP1000) += ipg.o
drivers/net/ethernet/icplus/ipg.c deleted +0 -2300

2,300 lines not on this page · raw message

drivers/net/ethernet/icplus/ipg.h deleted +0 -748

668 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
Ondrej Zary

Part of the diff is not shown here. View the raw message.

maintainer
#2 lore raw
In reply to Ondrej Zary

From: Ondrej Zary <[email protected]>
Date: Sun, 23 Aug 2015 23:06:27 +0200

Quoted 4 lines

Add support for IP1000A chips to dl2k driver. IP1000A chip looks like a TC9020 with integrated PHY.

Tested with Asus NX1101.

You're saying the PHY support is incomplete, so gigabit isn't even detected for these chips.

So in a way this is a regression of sorts.

Come back with these proposed changes once you have the PHY support situation sorted out.

Thanks.

#3 lore raw
Quoted 11 lines · On Tuesday 25 August 2015 23:04:30 David Miller wrote:

From: Ondrej Zary <[email protected]>
Date: Sun, 23 Aug 2015 23:06:27 +0200

Quoted 4 lines

Add support for IP1000A chips to dl2k driver. IP1000A chip looks like a TC9020 with integrated PHY.

Tested with Asus NX1101.

You're saying the PHY support is incomplete, so gigabit isn't even detected for these chips.

Quoted 6 lines

So in a way this is a regression of sorts.

Come back with these proposed changes once you have the PHY support situation sorted out.

Thanks.

Actually, gigabit works with this patch. The "PHY magic" part contains mii_write(9, 0x0700) which makes gigabit work.

BTW. D-Link DGE-550T is on the way so I'll test that too.

Signature · 1 line
Ondrej Zary
#4 lore raw

Ondrej Zary <[email protected]> :
[...]

Quoted 2 lines

Actually, gigabit works with this patch. The "PHY magic" part contains mii_write(9, 0x0700) which makes gigabit work.

It'd be extatic if you could set mii->supports_gmii for the appropriate PHY so that dl2k.c::rio_get_settings returns sensible gigabit status (note: neither ipg.c nor dl2k.c currently does).

Signature · 1 line
Ueimor
#5 lore raw
In reply to Ondrej Zary
Quoted 17 lines · On Tuesday 25 August 2015 23:26:13 Ondrej Zary wrote:
Quoted 16 lines · On Tuesday 25 August 2015 23:04:30 David Miller wrote:

From: Ondrej Zary <[email protected]>
Date: Sun, 23 Aug 2015 23:06:27 +0200

Quoted 4 lines

Add support for IP1000A chips to dl2k driver. IP1000A chip looks like a TC9020 with integrated PHY.

Tested with Asus NX1101.

You're saying the PHY support is incomplete, so gigabit isn't even detected for these chips.

So in a way this is a regression of sorts.

Come back with these proposed changes once you have the PHY support situation sorted out.

Quoted 6 lines
Quoted 1 line

Thanks.

Actually, gigabit works with this patch. The "PHY magic" part contains mii_write(9, 0x0700) which makes gigabit work.

BTW. D-Link DGE-550T is on the way so I'll test that too.

Just got the DGE-550T (vendor 0x1186, device 0x4000) and it works with the modified driver.

Signature · 1 line
Ondrej Zary