From 2964bbd7048ac0c1405cc119604e29987dd165df Mon Sep 17 00:00:00 2001 From: Don Fry Date: Tue, 1 Nov 2005 12:50:57 -0800 Subject: [PATCH] [PATCH] pcnet32: AT2700/2701 and Bugzilla 2699 & 4551 This patch is a better fix for Allied Telesyn 2700/2701 FX boards than the change made in early January this year. It allows the user to select the speed/duplex via module_param, but if no selection is made, forces the speed to 100 FD. It fixes both Bugzilla bugs 2669 and 4551. Tested ia32 and ppc64 by myself, and by the originator of bug 2669. Signed-off-by: Don Fry Signed-off-by: Jeff Garzik --- drivers/net/pcnet32.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c index 31e6dd0498..549a073858 100644 --- a/drivers/net/pcnet32.c +++ b/drivers/net/pcnet32.c @@ -22,8 +22,8 @@ *************************************************************************/ #define DRV_NAME "pcnet32" -#define DRV_VERSION "1.31b" -#define DRV_RELDATE "06.Oct.2005" +#define DRV_VERSION "1.31c" +#define DRV_RELDATE "01.Nov.2005" #define PFX DRV_NAME ": " static const char *version = @@ -262,6 +262,9 @@ static int homepna[MAX_UNITS]; * to allow loopback test to work unchanged. * v1.31b 06 Oct 2005 Don Fry changed alloc_ring to show name of device * if allocation fails + * v1.31c 01 Nov 2005 Don Fry Allied Telesyn 2700/2701 FX are 100Mbit only. + * Force 100Mbit FD if Auto (ASEL) is selected. + * See Bugzilla 2669 and 4551. */ @@ -1612,12 +1615,18 @@ pcnet32_open(struct net_device *dev) val |= 0x10; lp->a.write_csr (ioaddr, 124, val); - /* Allied Telesyn AT 2700/2701 FX looses the link, so skip that */ + /* Allied Telesyn AT 2700/2701 FX are 100Mbit only and do not negotiate */ 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 "%s: Skipping PHY selection.\n", dev->name); - } else { + (lp->pci_dev->subsystem_device == PCI_SUBDEVICE_ID_AT_2700FX || + lp->pci_dev->subsystem_device == PCI_SUBDEVICE_ID_AT_2701FX)) { + if (lp->options & PCNET32_PORT_ASEL) { + lp->options = PCNET32_PORT_FD | PCNET32_PORT_100; + if (netif_msg_link(lp)) + printk(KERN_DEBUG "%s: Setting 100Mb-Full Duplex.\n", + dev->name); + } + } + { /* * 24 Jun 2004 according AMD, in order to change the PHY, * DANAS (or DISPM for 79C976) must be set; then select the speed, -- 2.39.5