Re: 2.4.4-ac8 doesn't work with Lite-On 82c168 PNIC rev 32

From: Jeff Garzik (jgarzik@mandrakesoft.com)
Date: Fri May 11 2001 - 19:49:26 EST


Does this patch, against ac8, help with the PNIC problem?

-- 
Jeff Garzik      | Game called on account of naked chick
Building 1024    |
MandrakeSoft     |

Index: drivers/net/tulip/media.c =================================================================== RCS file: /cvsroot/gkernel/linux_2_4/drivers/net/tulip/media.c,v retrieving revision 1.1.1.30 diff -u -r1.1.1.30 media.c --- drivers/net/tulip/media.c 2001/05/11 23:58:47 1.1.1.30 +++ drivers/net/tulip/media.c 2001/05/12 00:47:16 @@ -255,7 +255,7 @@ case 1: case 3: { int phy_num = p[0]; int init_length = p[1]; - u16 *misc_info; + u16 *misc_info, tmp_info; dev->if_port = 11; new_csr6 = 0x020E0000; @@ -282,8 +282,10 @@ for (i = 0; i < init_length; i++) outl(init_sequence[i], ioaddr + CSR12); } - tp->advertising[phy_num] = get_u16(&misc_info[1]) | 1; - if (startup < 2) { + tmp_info = get_u16(&misc_info[1]); + if (tmp_info) + tp->advertising[phy_num] = tmp_info | 1; + if (tmp_info && startup < 2) { if (tp->mii_advertise == 0) tp->mii_advertise = tp->advertising[phy_num]; if (tulip_debug > 1) Index: drivers/net/tulip/tulip_core.c =================================================================== RCS file: /cvsroot/gkernel/linux_2_4/drivers/net/tulip/tulip_core.c,v retrieving revision 1.1.1.43 diff -u -r1.1.1.43 tulip_core.c --- drivers/net/tulip/tulip_core.c 2001/05/11 23:58:48 1.1.1.43 +++ drivers/net/tulip/tulip_core.c 2001/05/12 00:47:17 @@ -20,10 +20,11 @@ #include <linux/init.h> #include <linux/etherdevice.h> #include <linux/delay.h> +#include <linux/mii.h> #include <asm/unaligned.h> static char version[] __devinitdata = - "Linux Tulip driver version 0.9.14f (May 10, 2001)\n"; + "Linux Tulip driver version 0.9.15cvs (April XX, 2001)\n"; /* A few user-configurable values. */ @@ -1434,7 +1435,7 @@ ((mii_status & 0x8000) == 0 && (mii_status & 0x7800) != 0)) { int mii_reg0 = tulip_mdio_read(dev, phy, 0); int mii_advert = tulip_mdio_read(dev, phy, 4); - int to_advert; + unsigned int to_advert, new_bmcr; if (tp->mii_advertise) to_advert = tp->mii_advertise; @@ -1455,10 +1456,30 @@ board_idx, to_advert, phy, mii_advert); tulip_mdio_write(dev, phy, 4, to_advert); } + /* Enable autonegotiation: some boards default to off. */ - tulip_mdio_write(dev, phy, 0, mii_reg0 | - (tp->full_duplex ? 0x1100 : 0x1000) | - (tulip_media_cap[tp->default_port]&MediaIs100 ? 0x2000:0)); + if (tp->default_port == 0) { + new_bmcr = mii_reg0 | BMCR_ANENABLE; + if (new_bmcr != mii_reg0) + new_bmcr |= BMCR_ANRESTART; + } + /* ...or disable nway, if forcing media */ + else + new_bmcr = mii_reg0 & ~BMCR_ANENABLE; + + if (new_bmcr != mii_reg0) + tulip_mdio_write(dev, phy, MII_BMCR, new_bmcr); + + if (tp->full_duplex) new_bmcr |= BMCR_FULLDPLX; + else new_bmcr &= ~BMCR_FULLDPLX; + if (tulip_media_cap[tp->default_port] & MediaIs100) + new_bmcr |= BMCR_SPEED100; + else new_bmcr &= ~BMCR_SPEED100; + + if (new_bmcr != mii_reg0) { + udelay(10); + tulip_mdio_write(dev, phy, MII_BMCR, new_bmcr); + } } } tp->mii_cnt = phy_idx;

- 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/



This archive was generated by hypermail 2b29 : Tue May 15 2001 - 21:00:29 EST