linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* pcnet32: 79c976 with fiber optic
@ 2004-11-24 17:14 Guido Guenther
  2004-11-25 22:03 ` Alan Cox
  0 siblings, 1 reply; 3+ messages in thread
From: Guido Guenther @ 2004-11-24 17:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: jonmason

Hi,
I have a Allied Telesys using a 79c976 with a fibre optic connectior.
pcnet32 detects the card fine but looses the link when I ifup the
interface. If I use:

--- tmp/linux-2.6.9/drivers/net/pcnet32.c	2004-10-18 23:53:45.000000000 +0200
+++ linux-2.6.9/drivers/net/pcnet32.c	2004-11-24 15:52:27.000000000 +0100
@@ -1425,6 +1425,8 @@
 	val |= 0x10;
     lp->a.write_csr (ioaddr, 124, val);
 
+    printk(KERN_DEBUG "pcnet32: Skipping AMD workaround\n");
+#if 0
     /* 24 Jun 2004 according AMD, in order to change the PHY,
      * DANAS (or DISPM for 79C976) must be set; then select the speed,
      * duplex, and/or enable auto negotiation, and clear DANAS */
@@ -1446,6 +1448,7 @@
 	    lp->a.write_bcr(ioaddr, 32, val);
 	}
     }
+#endif
 
 #ifdef DO_DXSUFLO
     if (lp->dxsuflo) { /* Disable transmit stop on und

it works fine. Any idea what exactly causes the problem?
Cheers,
 -- Guido

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: pcnet32: 79c976 with fiber optic
  2004-11-24 17:14 pcnet32: 79c976 with fiber optic Guido Guenther
@ 2004-11-25 22:03 ` Alan Cox
  2004-11-26  9:21   ` Guido Guenther
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Cox @ 2004-11-25 22:03 UTC (permalink / raw)
  To: Guido Guenther; +Cc: Linux Kernel Mailing List, jonmason

On Mer, 2004-11-24 at 17:14, Guido Guenther wrote:
> it works fine. Any idea what exactly causes the problem?

I've no idea whether the workaround is simply not supposed to be used on
fibre devices (I'm suprised the driver works on fibre full stop 8)). Its
certainly possible to do a cleaner change though even if nobody can work
out why.

Use lspci -v to find the subvendor/subdevice ID for the particular board
assembly and then skip the fixup for that device alone. That should let
you produce a diff that is safely mergable


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: pcnet32: 79c976 with fiber optic
  2004-11-25 22:03 ` Alan Cox
@ 2004-11-26  9:21   ` Guido Guenther
  0 siblings, 0 replies; 3+ messages in thread
From: Guido Guenther @ 2004-11-26  9:21 UTC (permalink / raw)
  To: Alan Cox; +Cc: Linux Kernel Mailing List, jonmason, Thomas Bogendoerfer

On Thu, Nov 25, 2004 at 10:03:36PM +0000, Alan Cox wrote:
> 
> Use lspci -v to find the subvendor/subdevice ID for the particular board
> assembly and then skip the fixup for that device alone. That should let
> you produce a diff that is safely mergable
You mean like:

Skip PHY selection on Allied Telesyn 2701FX, it looses the link
otherwise.

Signed-Off-By: Guido Guenther <agx@sigxcpu.org>

--- tmp/linux-2.6.9/include/linux/pci_ids.h	2004-10-18 23:55:36.000000000 +0200
+++ linux-2.6.9/include/linux/pci_ids.h	2004-11-26 10:11:23.000000000 +0100
@@ -1622,6 +1622,10 @@
 #define PCI_DEVICE_ID_OPTIBASE_VPLEXCC	0x2120
 #define PCI_DEVICE_ID_OPTIBASE_VQUEST	0x2130
 
+/* Allied Telesyn */
+#define PCI_VENDOR_ID_AT    		0x1259
+#define PCI_SUBDEVICE_ID_AT_2701FX	0x2703
+
 #define PCI_VENDOR_ID_ESS		0x125d
 #define PCI_DEVICE_ID_ESS_ESS1968	0x1968
 #define PCI_DEVICE_ID_ESS_AUDIOPCI	0x1969
--- tmp/linux-2.6.9/drivers/net/pcnet32.c	2004-10-18 23:53:45.000000000 +0200
+++ linux-2.6.9/drivers/net/pcnet32.c	2004-11-26 10:18:09.000000000 +0100
@@ -1425,26 +1425,32 @@
 	val |= 0x10;
     lp->a.write_csr (ioaddr, 124, val);
 
-    /* 24 Jun 2004 according AMD, in order to change the PHY,
-     * DANAS (or DISPM for 79C976) must be set; then select the speed,
-     * duplex, and/or enable auto negotiation, and clear DANAS */
-    if (lp->mii && !(lp->options & PCNET32_PORT_ASEL)) {
-	lp->a.write_bcr(ioaddr, 32, lp->a.read_bcr(ioaddr, 32) | 0x0080);
-	/* disable Auto Negotiation, set 10Mpbs, HD */
-	val = lp->a.read_bcr(ioaddr, 32) & ~0xb8;
-	if (lp->options & PCNET32_PORT_FD)
-	    val |= 0x10;
-	if (lp->options & PCNET32_PORT_100)
-	    val |= 0x08;
-	lp->a.write_bcr (ioaddr, 32, val);
+    /* Skip PHY selection on AT2701FX, looses link otherwise */
+    if(lp->pci_dev->subsystem_vendor == PCI_VENDOR_ID_AT && 
+       lp->pci_dev->subsystem_device == PCI_SUBDEVICE_ID_AT_2701FX ) {
+    	printk(KERN_DEBUG "pcnet32: Skipping PHY selection.\n");
     } else {
-	if (lp->options & PCNET32_PORT_ASEL) {
-	    lp->a.write_bcr(ioaddr, 32, lp->a.read_bcr(ioaddr, 32) | 0x0080);
-	    /* enable auto negotiate, setup, disable fd */
-	    val = lp->a.read_bcr(ioaddr, 32) & ~0x98;
-	    val |= 0x20;
-	    lp->a.write_bcr(ioaddr, 32, val);
-	}
+        /* 24 Jun 2004 according AMD, in order to change the PHY,
+         * DANAS (or DISPM for 79C976) must be set; then select the speed,
+         * duplex, and/or enable auto negotiation, and clear DANAS */
+        if (lp->mii && !(lp->options & PCNET32_PORT_ASEL)) {
+    	lp->a.write_bcr(ioaddr, 32, lp->a.read_bcr(ioaddr, 32) | 0x0080);
+    	/* disable Auto Negotiation, set 10Mpbs, HD */
+    	val = lp->a.read_bcr(ioaddr, 32) & ~0xb8;
+    	if (lp->options & PCNET32_PORT_FD)
+    	    val |= 0x10;
+    	if (lp->options & PCNET32_PORT_100)
+    	    val |= 0x08;
+    	lp->a.write_bcr (ioaddr, 32, val);
+        } else {
+    	    if (lp->options & PCNET32_PORT_ASEL) {
+    	        lp->a.write_bcr(ioaddr, 32, lp->a.read_bcr(ioaddr, 32) | 0x0080);
+    	        /* enable auto negotiate, setup, disable fd */
+    	        val = lp->a.read_bcr(ioaddr, 32) & ~0x98;
+    	        val |= 0x20;
+    	        lp->a.write_bcr(ioaddr, 32, val);
+    	    }
+        }
     }
 
 #ifdef DO_DXSUFLO

Cheers,
 -- Guido

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-11-26 21:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-24 17:14 pcnet32: 79c976 with fiber optic Guido Guenther
2004-11-25 22:03 ` Alan Cox
2004-11-26  9:21   ` Guido Guenther

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).