* [patch 03/10] pcnet32: 79c976 with fiber optic fix
@ 2005-01-05 5:59 akpm
2005-01-06 22:45 ` Jeff Garzik
0 siblings, 1 reply; 4+ messages in thread
From: akpm @ 2005-01-05 5:59 UTC (permalink / raw)
To: jgarzik; +Cc: davem, netdev, akpm, agx, lars
From: Guido Guenther <agx@sigxcpu.org>,
Lars Munch <lars@segv.dk>
Skip PHY selection on Allied Telesyn 2701FX, it looses the link otherwise.
Fix up the AT 2701 as well.
Signed-Off-By: Guido Guenther <agx@sigxcpu.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---
25-akpm/drivers/net/pcnet32.c | 47 ++++++++++++++++++++++++----------------
25-akpm/include/linux/pci_ids.h | 5 ++++
2 files changed, 34 insertions(+), 18 deletions(-)
diff -puN drivers/net/pcnet32.c~pcnet32-79c976-with-fiber-optic drivers/net/pcnet32.c
--- 25/drivers/net/pcnet32.c~pcnet32-79c976-with-fiber-optic 2005-01-04 21:57:35.666712120 -0800
+++ 25-akpm/drivers/net/pcnet32.c 2005-01-04 21:57:35.673711056 -0800
@@ -1429,25 +1429,36 @@ pcnet32_open(struct net_device *dev)
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);
+ /* Allied Telesyn AT 2700/2701 FX looses the link, so skip that */
+ if (lp->pci_dev->subsystem_vendor == PCI_VENDOR_ID_AT &&
+ (lp->pci_dev->subsystem_device == PCI_SUBDEVICE_ID_AT_2700FX ||
+ 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);
+ }
}
}
diff -puN include/linux/pci_ids.h~pcnet32-79c976-with-fiber-optic include/linux/pci_ids.h
--- 25/include/linux/pci_ids.h~pcnet32-79c976-with-fiber-optic 2005-01-04 21:57:35.669711664 -0800
+++ 25-akpm/include/linux/pci_ids.h 2005-01-04 21:57:35.676710600 -0800
@@ -1644,6 +1644,11 @@
#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_2700FX 0x2701
+#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
_
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [patch 03/10] pcnet32: 79c976 with fiber optic fix
2005-01-05 5:59 [patch 03/10] pcnet32: 79c976 with fiber optic fix akpm
@ 2005-01-06 22:45 ` Jeff Garzik
2005-01-06 23:19 ` Don Fry
0 siblings, 1 reply; 4+ messages in thread
From: Jeff Garzik @ 2005-01-06 22:45 UTC (permalink / raw)
To: Don Fry; +Cc: akpm, davem, netdev, agx, lars
akpm@osdl.org wrote:
> From: Guido Guenther <agx@sigxcpu.org>,
> Lars Munch <lars@segv.dk>
>
> Skip PHY selection on Allied Telesyn 2701FX, it looses the link otherwise.
> Fix up the AT 2701 as well.
>
> Signed-Off-By: Guido Guenther <agx@sigxcpu.org>
> Signed-off-by: Andrew Morton <akpm@osdl.org>
Don, any comments?
Jeff
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch 03/10] pcnet32: 79c976 with fiber optic fix
2005-01-06 22:45 ` Jeff Garzik
@ 2005-01-06 23:19 ` Don Fry
2005-01-07 8:36 ` Guido Guenther
0 siblings, 1 reply; 4+ messages in thread
From: Don Fry @ 2005-01-06 23:19 UTC (permalink / raw)
To: Jeff Garzik; +Cc: akpm, davem, netdev, agx, lars
Sorry for the delay, I had a nice vacation and am a little slow getting
through the email.
Three comments:
1) I recently obtained a 2701FX card but I haven't installed it in a
system yet, but I will today.
2) Thomas Bogendorfer was working on a patch to support a board with
both a fiber and copper connection on the same board. He is still
cooking that change, but it changes code in the same place, but in a
different way.
3) I will send another email, later today or tomorrow morning, after I
have been able to do a little testing of the patch.
On Thu, Jan 06, 2005 at 05:45:06PM -0500, Jeff Garzik wrote:
> akpm@osdl.org wrote:
> >From: Guido Guenther <agx@sigxcpu.org>,
> > Lars Munch <lars@segv.dk>
> >
> >Skip PHY selection on Allied Telesyn 2701FX, it looses the link otherwise.
> >Fix up the AT 2701 as well.
> >
> >Signed-Off-By: Guido Guenther <agx@sigxcpu.org>
> >Signed-off-by: Andrew Morton <akpm@osdl.org>
>
> Don, any comments?
>
> Jeff
--
Don Fry
brazilnut@us.ibm.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch 03/10] pcnet32: 79c976 with fiber optic fix
2005-01-06 23:19 ` Don Fry
@ 2005-01-07 8:36 ` Guido Guenther
0 siblings, 0 replies; 4+ messages in thread
From: Guido Guenther @ 2005-01-07 8:36 UTC (permalink / raw)
To: Don Fry; +Cc: Jeff Garzik, akpm, davem, netdev, lars
[-- Attachment #1: Type: text/plain, Size: 414 bytes --]
On Thu, Jan 06, 2005 at 03:19:56PM -0800, Don Fry wrote:
> 2) Thomas Bogendorfer was working on a patch to support a board with
> both a fiber and copper connection on the same board. He is still
> cooking that change, but it changes code in the same place, but in a
> different way.
I sent the patch to Andrew as a "quick fix" to get things working at all
until Thomas's full fix is available.
Cheers,
-- Guido
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-01-07 8:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-05 5:59 [patch 03/10] pcnet32: 79c976 with fiber optic fix akpm
2005-01-06 22:45 ` Jeff Garzik
2005-01-06 23:19 ` Don Fry
2005-01-07 8:36 ` 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).