Skip to contentSkip to conversation

natsemi: long cable, short cable

PATCH In review Olaf Kirch 2 participants 2 messages Feb 8, 2005 – Feb 11, 2005

Subsystems (2)
lore
Share & tools
lore

Olaf Kirch

author
#0 lore raw

PATCH 1/1 natsemi: long cable, short cable

The current version of the natsemi driver comes with a workaround for a hardware problem that causes link failures on short cables. Unfortunately, this workaround causes massive link failures on _long_ cables (270-300ft). This patch adds a module parameter to disable the workaround if required.

drivers/net/natsemi.c +11 -0
Index: linux-2.6.10/drivers/net/natsemi.c
===================================================================
@@ -186,6 +186,7 @@ static int debug = -1;
 /* Maximum events (Rx packets, etc.) to handle at each interrupt. */
 static int max_interrupt_work = 20;
 static int mtu;
+static int no_cable_magic = 0;
 
 /* Maximum number of multicast addresses to filter (vs. rx-all-multicast).
    This chip uses a 512 element hash table based on the Ethernet CRC.  */
@@ -257,6 +258,7 @@ module_param(debug, int, 0);
 module_param(rx_copybreak, int, 0);
 module_param_array(options, int, NULL, 0);
 module_param_array(full_duplex, int, NULL, 0);
+module_param(no_cable_magic, int, 0);
 MODULE_PARM_DESC(max_interrupt_work, 
 	"DP8381x maximum events handled per interrupt");
 MODULE_PARM_DESC(mtu, "DP8381x MTU (all boards)");
@@ -266,6 +268,9 @@ MODULE_PARM_DESC(rx_copybreak, 
 MODULE_PARM_DESC(options, 
 	"DP8381x: Bits 0-3: media type, bit 17: full duplex");
 MODULE_PARM_DESC(full_duplex, "DP8381x full duplex setting(s) (1)");
+MODULE_PARM_DESC(no_cable_magic,
+	"DP8381x: set no_cable_magic=1 to disable magic workaround for short cables "
+	"(may help with long cables:-)");
 
 /*
 				Theory of Operation
@@ -1578,6 +1583,9 @@ static void do_cable_magic(struct net_de
 	struct netdev_private *np = netdev_priv(dev);
 	void __iomem *ioaddr = ns_ioaddr(dev);
 
+	if (no_cable_magic)
+		return;
+
 	if (dev->if_port != PORT_TP)
 		return;
 
@@ -1623,6 +1631,9 @@ static void undo_cable_magic(struct net_
 	struct netdev_private *np = netdev_priv(dev);
 	void __iomem * ioaddr = ns_ioaddr(dev);
 
+	if (no_cable_magic)
+		return;
+
 	if (dev->if_port != PORT_TP)
 		return;
 
Signature · 2 lines
Olaf Kirch   |  --- o --- Nous sommes du soleil we love when we play
[email protected] |    / | \   sol.dhoop.naytheet.ah kin.ir.samse.qurax
#1 lore raw
Quoted 7 lines · Olaf Kirch

The current version of the natsemi driver comes with a workaround for a hardware problem that causes link failures on short cables. Unfortunately, this workaround causes massive link failures on _long_ cables (270-300ft). This patch adds a module parameter to disable the workaround if required.

I grudgingly applied this.

Hopefully someone will create a private ioctl or ethtool option for this, rather than a module option. This setting needs to be per-interface.

Jeff