r1629 - in trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian: . patches patches/series

Christoph Hellwig hch-guest@haydn.debian.org
Tue, 21 Sep 2004 16:17:24 -0600


Author: hch-guest
Date: 2004-09-21 16:17:15 -0600 (Tue, 21 Sep 2004)
New Revision: 1629

Added:
   trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/forcedeth-update.dpatch
Modified:
   trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/changelog
   trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/series/2.6.8-7
   trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/tg3-update.dpatch
Log:

  * Update forcedeth driver to fix autoneg on 100Mbit cards (Christoph Hellwig).



Modified: trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/changelog
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/changelog	2004-09-21 22:04:19 UTC (rev 1628)
+++ trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/changelog	2004-09-21 22:17:15 UTC (rev 1629)
@@ -14,6 +14,8 @@
     (Christoph Hellwig).
 
   * Update tg3 driver (Christoph Hellwig).
+  
+  * Update forcedeth driver to fix autoneg on 100Mbit cards (Christoph Hellwig).
 
  -- Jens Schmalzing <jensen@debian.org>  Thu, 16 Sep 2004 10:04:54 +0200
 

Added: trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/forcedeth-update.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/forcedeth-update.dpatch	2004-09-21 22:04:19 UTC (rev 1628)
+++ trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/forcedeth-update.dpatch	2004-09-21 22:17:15 UTC (rev 1629)
@@ -0,0 +1,176 @@
+#! /bin/sh -e 
+## <PATCHNAME>.dpatch by <PATCH_AUTHOR@EMAI>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Description: Update forcedeth driver to upstream BK as of 2004/09/21
+## DP:			(fixes autonegotiation for 100Mbit cards)
+## DP: Patch author: Manfred Spraul <manfred@colorfullife.com>
+## DP: Upstream status: backport
+
+. $(dirname $0)/DPATCH
+
+@DPATCH@
+diff -uNr -p -Xdontdiff kernel-source-2.6.8/drivers/net/forcedeth.c linux-2.5/drivers/net/forcedeth.c
+--- kernel-source-2.6.8/drivers/net/forcedeth.c	2004-08-14 07:36:12.000000000 +0200
++++ linux-2.5/drivers/net/forcedeth.c	2004-09-19 11:47:55.000000000 +0200
+@@ -75,6 +75,7 @@
+  *			   added CK804/MCP04 device IDs, code fixes
+  *			   for registers, link status and other minor fixes.
+  *	0.28: 21 Jun 2004: Big cleanup, making driver mostly endian safe
++ *	0.29: 31 Aug 2004: Add backup timer for link change notification.
+  *
+  * Known bugs:
+  * We suspect that on some hardware no TX done interrupts are generated.
+@@ -86,7 +87,7 @@
+  * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few
+  * superfluous timer interrupts from the nic.
+  */
+-#define FORCEDETH_VERSION		"0.28"
++#define FORCEDETH_VERSION		"0.29"
+ #define DRV_NAME			"forcedeth"
+ 
+ #include <linux/module.h>
+@@ -120,10 +121,11 @@
+  * Hardware access:
+  */
+ 
+-#define DEV_NEED_LASTPACKET1	0x0001
+-#define DEV_IRQMASK_1		0x0002
+-#define DEV_IRQMASK_2		0x0004
+-#define DEV_NEED_TIMERIRQ	0x0008
++#define DEV_NEED_LASTPACKET1	0x0001	/* set LASTPACKET1 in tx flags */
++#define DEV_IRQMASK_1		0x0002  /* use NVREG_IRQMASK_WANTED_1 for irq mask */
++#define DEV_IRQMASK_2		0x0004  /* use NVREG_IRQMASK_WANTED_2 for irq mask */
++#define DEV_NEED_TIMERIRQ	0x0008  /* set the timer irq flag in the irq mask */
++#define DEV_NEED_LINKTIMER	0x0010	/* poll link settings. Relies on the timer irq */
+ 
+ enum {
+ 	NvRegIrqStatus = 0x000,
+@@ -367,6 +369,7 @@ struct ring_desc {
+ 
+ #define OOM_REFILL	(1+HZ/20)
+ #define POLL_WAIT	(1+HZ/100)
++#define LINK_TIMEOUT	(3*HZ)
+ 
+ #define DESC_VER_1	0x0
+ #define DESC_VER_2	0x02100
+@@ -446,6 +449,11 @@ struct fe_priv {
+ 	struct timer_list oom_kick;
+ 	struct timer_list nic_poll;
+ 
++	/* media detection workaround.
++	 * Locking: Within irq hander or disable_irq+spin_lock(&np->lock);
++	 */
++	int need_linktimer;
++	unsigned long link_timeout;
+ 	/*
+ 	 * tx specific fields.
+ 	 */
+@@ -1384,6 +1392,25 @@ set_speed:
+ 	return retval;
+ }
+ 
++static void nv_linkchange(struct net_device *dev)
++{
++	if (nv_update_linkspeed(dev)) {
++		if (netif_carrier_ok(dev)) {
++			nv_stop_rx(dev);
++		} else {
++			netif_carrier_on(dev);
++			printk(KERN_INFO "%s: link up.\n", dev->name);
++		}
++		nv_start_rx(dev);
++	} else {
++		if (netif_carrier_ok(dev)) {
++			netif_carrier_off(dev);
++			printk(KERN_INFO "%s: link down.\n", dev->name);
++			nv_stop_rx(dev);
++		}
++	}
++}
++
+ static void nv_link_irq(struct net_device *dev)
+ {
+ 	u8 *base = get_hwbase(dev);
+@@ -1391,25 +1418,10 @@ static void nv_link_irq(struct net_devic
+ 
+ 	miistat = readl(base + NvRegMIIStatus);
+ 	writel(NVREG_MIISTAT_MASK, base + NvRegMIIStatus);
+-	dprintk(KERN_DEBUG "%s: link change notification, status 0x%x.\n", dev->name, miistat);
++	dprintk(KERN_INFO "%s: link change irq, status 0x%x.\n", dev->name, miistat);
+ 
+-	if (miistat & (NVREG_MIISTAT_LINKCHANGE)) {
+-		if (nv_update_linkspeed(dev)) {
+-			if (netif_carrier_ok(dev)) {
+-				nv_stop_rx(dev);
+-			} else {
+-				netif_carrier_on(dev);
+-				printk(KERN_INFO "%s: link up.\n", dev->name);
+-			}
+-			nv_start_rx(dev);
+-		} else {
+-			if (netif_carrier_ok(dev)) {
+-				netif_carrier_off(dev);
+-				printk(KERN_INFO "%s: link down.\n", dev->name);
+-				nv_stop_rx(dev);
+-			}
+-		}
+-	}
++	if (miistat & (NVREG_MIISTAT_LINKCHANGE))
++		nv_linkchange(dev);
+ 	dprintk(KERN_DEBUG "%s: link change notification done.\n", dev->name);
+ }
+ 
+@@ -1452,6 +1464,12 @@ static irqreturn_t nv_nic_irq(int foo, v
+ 			nv_link_irq(dev);
+ 			spin_unlock(&np->lock);
+ 		}
++		if (np->need_linktimer && time_after(jiffies, np->link_timeout)) {
++			spin_lock(&np->lock);
++			nv_linkchange(dev);
++			spin_unlock(&np->lock);
++			np->link_timeout = jiffies + LINK_TIMEOUT;
++		}
+ 		if (events & (NVREG_IRQ_TX_ERR)) {
+ 			dprintk(KERN_DEBUG "%s: received irq with events 0x%x. Probably TX fail.\n",
+ 						dev->name, events);
+@@ -1816,6 +1834,14 @@ static int __devinit nv_probe(struct pci
+ 		np->irqmask = NVREG_IRQMASK_WANTED_2;
+ 	if (id->driver_data & DEV_NEED_TIMERIRQ)
+ 		np->irqmask |= NVREG_IRQ_TIMER;
++	if (id->driver_data & DEV_NEED_LINKTIMER) {
++		dprintk(KERN_INFO "%s: link timer on.\n", pci_name(pci_dev));
++		np->need_linktimer = 1;
++		np->link_timeout = jiffies + LINK_TIMEOUT;
++	} else {
++		dprintk(KERN_INFO "%s: link timer off.\n", pci_name(pci_dev));
++		np->need_linktimer = 0;
++	}
+ 
+ 	/* find a suitable phy */
+ 	for (i = 1; i < 32; i++) {
+@@ -1909,21 +1935,21 @@ static struct pci_device_id pci_tbl[] = 
+ 		.device = PCI_DEVICE_ID_NVIDIA_NVENET_1,
+ 		.subvendor = PCI_ANY_ID,
+ 		.subdevice = PCI_ANY_ID,
+-		.driver_data = DEV_IRQMASK_1|DEV_NEED_TIMERIRQ,
++		.driver_data = DEV_IRQMASK_1|DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER,
+ 	},
+ 	{	/* nForce2 Ethernet Controller */
+ 		.vendor = PCI_VENDOR_ID_NVIDIA,
+ 		.device = PCI_DEVICE_ID_NVIDIA_NVENET_2,
+ 		.subvendor = PCI_ANY_ID,
+ 		.subdevice = PCI_ANY_ID,
+-		.driver_data = DEV_NEED_LASTPACKET1|DEV_IRQMASK_2|DEV_NEED_TIMERIRQ,
++		.driver_data = DEV_NEED_LASTPACKET1|DEV_IRQMASK_2|DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER,
+ 	},
+ 	{	/* nForce3 Ethernet Controller */
+ 		.vendor = PCI_VENDOR_ID_NVIDIA,
+ 		.device = PCI_DEVICE_ID_NVIDIA_NVENET_3,
+ 		.subvendor = PCI_ANY_ID,
+ 		.subdevice = PCI_ANY_ID,
+-		.driver_data = DEV_NEED_LASTPACKET1|DEV_IRQMASK_2|DEV_NEED_TIMERIRQ,
++		.driver_data = DEV_NEED_LASTPACKET1|DEV_IRQMASK_2|DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER,
+ 	},
+ 	{	/* nForce3 Ethernet Controller */
+ 		.vendor = PCI_VENDOR_ID_NVIDIA,

Modified: trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/series/2.6.8-7
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/series/2.6.8-7	2004-09-21 22:04:19 UTC (rev 1628)
+++ trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/series/2.6.8-7	2004-09-21 22:17:15 UTC (rev 1629)
@@ -4,3 +4,4 @@
 + tcp_default_win_scale.dpatch
 + ata_piix-combinde-mode-fix.dpatch
 + tg3-update.dpatch
++ forcedeth-update.dpatch

Modified: trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/tg3-update.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/tg3-update.dpatch	2004-09-21 22:04:19 UTC (rev 1628)
+++ trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/tg3-update.dpatch	2004-09-21 22:17:15 UTC (rev 1629)
@@ -2,7 +2,7 @@
 ## <PATCHNAME>.dpatch by <PATCH_AUTHOR@EMAI>
 ##
 ## All lines beginning with `## DP:' are a description of the patch.
-## DP: Description: Update tg3 driver to upstrean BK as of 2004/09/21 (modulo firmware)
+## DP: Description: Update tg3 driver to upstream BK as of 2004/09/21 (modulo firmware)
 ## DP: Patch author: David Miller <davem@redhat.com> (+ addition contributors)
 ## DP: Upstream status: backport