Re: [PATCH] de2104x: disable autonegotiation on broken hardware

From: Jeff Garzik
Date: Thu Sep 23 2010 - 17:03:18 EST


On Thu, Sep 23, 2010 at 4:59 PM, Ondrej Zary <linux@xxxxxxxxxxxxxxxxxxxx> wrote:
> At least on older 21041-AA chips (mine is rev. 11), TP duplex autonegotiation
> causes the card not to work at all (link is up but no packets are transmitted).
>
> de4x5 disables autonegotiation completely. But it seems to work on newer
> (21041-PA rev. 21) so disable it only on rev<20 chips.
>
> Signed-off-by: Ondrej Zary <linux@xxxxxxxxxxxxxxxxxxxx>
>
> --- linux-2.6.36-rc3-orig/drivers/net/tulip/de2104x.c  2010-08-29 17:36:04.000000000 +0200
> +++ linux-2.6.36-rc3/drivers/net/tulip/de2104x.c    Â2010-09-24 00:27:41.000000000 +0200
> @@ -364,6 +364,8 @@ static u16 t21040_csr15[] = { 0, 0, 0x00
> Â/* 21041 transceiver register settings: TP AUTO, BNC, AUI, TP, TP FD*/
> Âstatic u16 t21041_csr13[] = { 0xEF01, 0xEF09, 0xEF09, 0xEF01, 0xEF09, };
> Âstatic u16 t21041_csr14[] = { 0xFFFF, 0xF7FD, 0xF7FD, 0x6F3F, 0x6F3D, };
> +/* If on-chip autonegotiation is broken, use half-duplex (FF3F) instead */
> +static u16 t21041_csr14_brk[] = { 0xFF3F, 0xF7FD, 0xF7FD, 0x6F3F, 0x6F3D, };
> Âstatic u16 t21041_csr15[] = { 0x0008, 0x0006, 0x000E, 0x0008, 0x0008, };
>
>
> @@ -1911,8 +1913,14 @@ fill_defaults:
> Â Â Â Âfor (i = 0; i < DE_MAX_MEDIA; i++) {
> Â Â Â Â Â Â Â Âif (de->media[i].csr13 == 0xffff)
> Â Â Â Â Â Â Â Â Â Â Â Âde->media[i].csr13 = t21041_csr13[i];
> - Â Â Â Â Â Â Â if (de->media[i].csr14 == 0xffff)
> - Â Â Â Â Â Â Â Â Â Â Â de->media[i].csr14 = t21041_csr14[i];
> + Â Â Â Â Â Â Â if (de->media[i].csr14 == 0xffff) {
> + Â Â Â Â Â Â Â Â Â Â Â /* autonegotiation is broken at least on some chip
> + Â Â Â Â Â Â Â Â Â Â Â Â Ârevisions - rev. 0x21 works, 0x11 does not */
> + Â Â Â Â Â Â Â Â Â Â Â if (de->pdev->revision < 0x20)
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â de->media[i].csr14 = t21041_csr14_brk[i];
> + Â Â Â Â Â Â Â Â Â Â Â else
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â de->media[i].csr14 = t21041_csr14[i];
> + Â Â Â Â Â Â Â }

Interesting... I never knew about that quirk.

Acked-by: Jeff Garzik <jgarzik@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/