Mailing List Archive

[PATCH 1/2] pcnet32: Introduce basic AT 2700/01 FTX support
This patch extends Don Fry's last patch for AT 2700/01 FX to set the
speed/fdx options for the FTX variants of these cards as well.

Additionally the option override has been moved from pcnet32_open to
pcnet32_probe1 because it's only necessary to override the options once.

Tested and works.

Patch applies to 2.6.16-rc3

Signed-off-by: Philippe Seewer <philippe.seewer@bfh.ch>
---

drivers/net/pcnet32.c | 39 ++++++++++++++++++++++++++-------------
include/linux/pci_ids.h | 2 ++
2 files changed, 28 insertions(+), 13 deletions(-)


diff -uprN -X linux-2.6.16-rc3-vanilla/Documentation/dontdiff linux-2.6.16-rc3-vanilla/drivers/net/pcnet32.c linux-2.6.16-rc3/drivers/net/pcnet32.c
--- linux-2.6.16-rc3-vanilla/drivers/net/pcnet32.c 2006-02-13 01:27:25.000000000 +0100
+++ linux-2.6.16-rc3/drivers/net/pcnet32.c 2006-02-17 15:49:41.000000000 +0100
@@ -22,8 +22,8 @@
*************************************************************************/

#define DRV_NAME "pcnet32"
-#define DRV_VERSION "1.31c"
-#define DRV_RELDATE "01.Nov.2005"
+#define DRV_VERSION "1.31d"
+#define DRV_RELDATE "17.Feb.2006"
#define PFX DRV_NAME ": "

static const char *version =
@@ -265,6 +265,8 @@ static int homepna[MAX_UNITS];
* 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.
+ * v1.31d 17 Nov 2006 Philippe Seewer Extended AT 2700/01 FX support
+ * to support FTX variants as well.
*/


@@ -1404,6 +1406,28 @@ pcnet32_probe1(unsigned long ioaddr, int
if (lp->mii)
lp->mii_if.phy_id = ((lp->a.read_bcr (ioaddr, 33)) >> 5) & 0x1f;

+ /*
+ * Override options:
+ * Allied Telesyn AT 2700/2701 FX are 100Mbit only and do not
+ * negotiate. The same goes for AT 2701 FTX on fiber and
+ * autoneg on 2700FTX seems generally broken.
+ */
+ 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 ||
+ lp->pci_dev->subsystem_device == PCI_SUBDEVICE_ID_AT_2700FTX)
+ ||
+ (lp->pci_dev->subsystem_device == PCI_SUBDEVICE_ID_AT_2701FTX &&
+ lp->mii_if.phy_id == 1)
+ )) {
+ if (lp->options & PCNET32_PORT_ASEL) {
+ lp->options = PCNET32_PORT_MII | PCNET32_PORT_FD | PCNET32_PORT_100;
+ if (pcnet32_debug & NETIF_MSG_PROBE)
+ printk(" Setting 100Mb-Full Duplex.\n");
+ }
+ }
+
+
init_timer (&lp->watchdog_timer);
lp->watchdog_timer.data = (unsigned long) dev;
lp->watchdog_timer.function = (void *) &pcnet32_watchdog;
@@ -1614,17 +1638,6 @@ pcnet32_open(struct net_device *dev)
val |= 0x10;
lp->a.write_csr (ioaddr, 124, val);

- /* 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)) {
- 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,
diff -uprN -X linux-2.6.16-rc3-vanilla/Documentation/dontdiff linux-2.6.16-rc3-vanilla/include/linux/pci_ids.h linux-2.6.16-rc3/include/linux/pci_ids.h
--- linux-2.6.16-rc3-vanilla/include/linux/pci_ids.h 2006-02-13 01:27:25.000000000 +0100
+++ linux-2.6.16-rc3/include/linux/pci_ids.h 2006-02-17 15:51:37.000000000 +0100
@@ -1538,7 +1538,9 @@
/* Allied Telesyn */
#define PCI_VENDOR_ID_AT 0x1259
#define PCI_SUBDEVICE_ID_AT_2700FX 0x2701
+#define PCI_SUBDEVICE_ID_AT_2700FTX 0x2702
#define PCI_SUBDEVICE_ID_AT_2701FX 0x2703
+#define PCI_SUBDEVICE_ID_AT_2701FTX 0x2704

#define PCI_VENDOR_ID_ESS 0x125d
#define PCI_DEVICE_ID_ESS_ESS1968 0x1968

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] pcnet32: Introduce basic AT 2700/01 FTX support [ In reply to ]
Philippe,

On a purely mechanical note, the patches do not apply cleanly because
of whitespace changes. Possibly your mailer changed tabs to spaces,
which causes the patch not to apply, and also causes your patch to have
different spacing than the rest of the file. The driver does not
conform to the 8-space indentation guideline/rule, but it is consistent
in 4-space indentation.

I am looking over this change and the following one, to try and
understand what and why you made your changes.

The change made by Thomas Bogendoerfer and modified by myself is much
more flexible than your changes, in that they are not specific just to
the Allied Telesyn boards with multiple Phys. They also allow dynamic
changing of cabling without requiring the driver to be removed/installed
or the card power cycled. I also see little value in the module
parameters, when it can be determined dynamically. Also, maxphy might be
thought to the the maximum number of phys, rather than the maximum phy
number supported. If static selection of the phy to use is passed in as
a module parameter, why also include a maxphy?

As I review your patches I will follow up to the mailing list.

On Fri, Feb 17, 2006 at 05:14:39PM +0100, Seewer Philippe wrote:
>
> This patch extends Don Fry's last patch for AT 2700/01 FX to set the
> speed/fdx options for the FTX variants of these cards as well.
>
> Additionally the option override has been moved from pcnet32_open to
> pcnet32_probe1 because it's only necessary to override the options once.
>
> Tested and works.
>
> Patch applies to 2.6.16-rc3
>
Don Fry
brazilnut@us.ibm.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] pcnet32: Introduce basic AT 2700/01 FTX support [ In reply to ]
Don Fry wrote:
> Philippe,
>
> On a purely mechanical note, the patches do not apply cleanly because
> of whitespace changes. Possibly your mailer changed tabs to spaces,
> which causes the patch not to apply, and also causes your patch to have
> different spacing than the rest of the file. The driver does not
> conform to the 8-space indentation guideline/rule, but it is consistent
> in 4-space indentation.
uhhh.... did i forget to run Lindent..? Or was it that i just
selected-middle clicked them into thunderbird?
what's the recommended procedure oh how to append patches to
mails? (Documentation just says included not attached...)
>
> I am looking over this change and the following one, to try and
> understand what and why you made your changes.
>
> The change made by Thomas Bogendoerfer and modified by myself is much
> more flexible than your changes, in that they are not specific just to
> the Allied Telesyn boards with multiple Phys.
I'm not sure what you are talking about. I didn't see any PHY switching
code in the driver... And the specs specifically say that when more than
one PHY is connected control should revert to software.

> They also allow dynamic
> changing of cabling without requiring the driver to be removed/installed
> or the card power cycled. I also see little value in the module
> parameters, when it can be determined dynamically. Also, maxphy might be
> thought to the the maximum number of phys, rather than the maximum phy
> number supported. If static selection of the phy to use is passed in as
> a module parameter, why also include a maxphy?
maxphy is supposed to be how many PHYs are actually connected to the chip.
I didn't want to introduce a generic PHY scanner (which is possible)
because that would have haa impact on all cards not only cards that actually
have more than one phy.

I really tried to put this into pcnet32_open. But i just didn't work...

>
> As I review your patches I will follow up to the mailing list.
>
> On Fri, Feb 17, 2006 at 05:14:39PM +0100, Seewer Philippe wrote:
>
>>This patch extends Don Fry's last patch for AT 2700/01 FX to set the
>>speed/fdx options for the FTX variants of these cards as well.
>>
>>Additionally the option override has been moved from pcnet32_open to
>>pcnet32_probe1 because it's only necessary to override the options once.
>>
>>Tested and works.
>>
>>Patch applies to 2.6.16-rc3
>>
>
> Don Fry
> brazilnut@us.ibm.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/