public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: russell@coker.com.au
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH/CFT] de2104x fixes
Date: Sat, 22 Nov 2003 07:07:57 -0500	[thread overview]
Message-ID: <3FBF519D.4070307@pobox.com> (raw)
In-Reply-To: <200311221305.25718.russell@coker.com.au>

[-- Attachment #1: Type: text/plain, Size: 907 bytes --]

Russell Coker wrote:
> On Sat, 22 Nov 2003 05:50, Jeff Garzik <jgarzik@pobox.com> wrote:
> 
>>So, can people give this a test?  It includes a change that, I hope,
>>addresses Russell's problem, as well as a patch from Rask.
> 
> 
> It does not compile for me, below are the warnings and errors.  I am using 
> 2.6.0-test9 with no patches applied other than your patch.
> 
> drivers/net/tulip/de2104x.c: In function `de_open':
> drivers/net/tulip/de2104x.c:1369: warning: unused variable `flags'
> drivers/net/tulip/de2104x.c: In function `__de_set_settings':
> drivers/net/tulip/de2104x.c:1572: error: `dev' undeclared (first use in this 
> function)
> drivers/net/tulip/de2104x.c:1572: error: (Each undeclared identifier is 
> reported only once
> drivers/net/tulip/de2104x.c:1572: error: for each function it appears in.)

Ok, here's a better patch.  It's against 2.6.0-test9-BK-latest 
(currently bk25).

[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 2437 bytes --]

===== drivers/net/tulip/de2104x.c 1.25 vs edited =====
--- 1.25/drivers/net/tulip/de2104x.c	Thu Sep 11 18:46:11 2003
+++ edited/drivers/net/tulip/de2104x.c	Sat Nov 22 07:05:40 2003
@@ -28,8 +28,8 @@
  */
 
 #define DRV_NAME		"de2104x"
-#define DRV_VERSION		"0.6"
-#define DRV_RELDATE		"Sep 1, 2003"
+#define DRV_VERSION		"0.9"
+#define DRV_RELDATE		"Nov 21, 2003"
 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -1366,7 +1366,6 @@
 {
 	struct de_private *de = dev->priv;
 	int rc;
-	unsigned long flags;
 
 	if (netif_msg_ifup(de))
 		printk(KERN_DEBUG "%s: enabling interface\n", dev->name);
@@ -1380,18 +1379,18 @@
 		return rc;
 	}
 
-	rc = de_init_hw(de);
+	rc = request_irq(dev->irq, de_interrupt, SA_SHIRQ, dev->name, dev);
 	if (rc) {
-		printk(KERN_ERR "%s: h/w init failure, err=%d\n",
-		       dev->name, rc);
+		printk(KERN_ERR "%s: IRQ %d request failure, err=%d\n",
+		       dev->name, dev->irq, rc);
 		goto err_out_free;
 	}
 
-	rc = request_irq(dev->irq, de_interrupt, SA_SHIRQ, dev->name, dev);
+	rc = de_init_hw(de);
 	if (rc) {
-		printk(KERN_ERR "%s: IRQ %d request failure, err=%d\n",
-		       dev->name, dev->irq, rc);
-		goto err_out_hw;
+		printk(KERN_ERR "%s: h/w init failure, err=%d\n",
+		       dev->name, rc);
+		goto err_out_free_irq;
 	}
 
 	netif_start_queue(dev);
@@ -1399,10 +1398,8 @@
 
 	return 0;
 
-err_out_hw:
-	spin_lock_irqsave(&de->lock, flags);
-	de_stop_hw(de);
-	spin_unlock_irqrestore(&de->lock, flags);
+err_out_free_irq:
+	free_irq (dev->irq, dev);
 
 err_out_free:
 	de_free_rings(de);
@@ -1514,7 +1511,8 @@
 	return 0;
 }
 
-static int __de_set_settings(struct de_private *de, struct ethtool_cmd *ecmd)
+static int __de_set_settings(struct net_device *dev, struct de_private *de,
+			     struct ethtool_cmd *ecmd)
 {
 	u32 new_media;
 	unsigned int media_lock;
@@ -1571,13 +1569,17 @@
 	    (ecmd->advertising == de->media_advertise))
 		return 0; /* nothing to change */
 	    
-	de_link_down(de);
-	de_stop_rxtx(de);
+	if (netif_running(dev)) {
+		de_link_down(de);
+		de_stop_rxtx(de);
+	}
 	
 	de->media_type = new_media;
 	de->media_lock = media_lock;
 	de->media_advertise = ecmd->advertising;
-	de_set_media(de);
+
+	if (netif_running(dev))
+		de_set_media(de);
 	
 	return 0;
 }
@@ -1615,7 +1617,7 @@
 	int rc;
 
 	spin_lock_irq(&de->lock);
-	rc = __de_set_settings(de, ecmd);
+	rc = __de_set_settings(dev, de, ecmd);
 	spin_unlock_irq(&de->lock);
 
 	return rc;

  parent reply	other threads:[~2003-11-22 12:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-21  9:51 de2104x tulip driver bug in 2.6.0-test9 Russell Coker
2003-11-21 15:32 ` Christian Kujau
2003-11-21 15:47   ` Russell Coker
2003-11-21 18:50 ` [PATCH/CFT] de2104x fixes Jeff Garzik
     [not found]   ` <200311221305.25718.russell@coker.com.au>
2003-11-22 12:07     ` Jeff Garzik [this message]
2003-11-25 12:57   ` Rask Ingemann Lambertsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3FBF519D.4070307@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=russell@coker.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox