Date: Mon, 9 Sep 2002 15:25:08 -1000 (HST) From: Vincent Poy <vince@oahu.WURLDLINK.NET> To: Martin Blapp <mb@imp.ch> Cc: current@FreeBSD.ORG Subject: Re: Uncommitted dc0 fixes ... Message-ID: <20020909130911.U2914-100000@oahu.WURLDLINK.NET> In-Reply-To: <20020905210537.Q31964-100000@levais.imp.ch>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 5 Sep 2002, Martin Blapp wrote: > > When I tried these patches manually handpatching on 08182002 JP > > SNAPSHOT, it took away the error messages like you had mentioned except > > I can ping everything except for the gateway. Also, no other protocols > > would work at all so it seems like something else broke. I took out > > the following and it still made no difference. > > http://www.FreeBSD.org/cgi/query-pr.cgi?pr=misc/32699 > > Can you please test each patch and see which one is responsable ? > > Martin Hi Martin and everyone, I finally updated to the latest -CURRENT last night after pulling the HD from my IBM ThinkPad 770Z and putting it in a loaner Dell Inspiron 8200 P4m-1.7Ghz as I couldn't get the fans to turn on and it keeps shutting off due to overheating. I have both a Siemens/Efficient Networks SpeedStream SS1012 and a SMC Networks SMC8036TX which seems to be identical cards physically as it has the same design and same label printing information layout. As far as testing each patch, here goes: 1) dc driver uses wrong case to read MAC from eeprom. http://www.FreeBSD.org/cgi/query-pr.cgi?pr=kern/35482 This one seems to break data sending/receiving as the only thing that works is pinging and that's only on the alias/secondary IP and not the primary IP network which is completely unpingable. * $FreeBSD: src/sys/pci/if_dcreg.h,v 1.25 2002/05/06 10:55:42 iwasaki Exp *** /usr/temp/if_dcreg.h Mon May 6 03:55:42 2002 --- /usr/src/sys/pci/if_dcreg.h Mon Sep 9 15:14:08 2002 *************** *** 78,83 **** --- 78,84 ---- #define DC_TYPE_PNIC 0xA /* 82c168/82c169 PNIC I */ #define DC_TYPE_XIRCOM 0xB /* Xircom X3201 */ #define DC_TYPE_CONEXANT 0xC /* Conexant LANfinity RS7112 */ + #define DC_TYPE_EN5152B 0xD /* Accton EN5251B. Clone of ADMtek 983B? */ #define DC_IS_MACRONIX(x) \ (x->dc_type == DC_TYPE_98713 || \ *************** *** 86,91 **** --- 87,93 ---- #define DC_IS_ADMTEK(x) \ (x->dc_type == DC_TYPE_AL981 || \ + x->dc_type == DC_TYPE_EN5152B || \ x->dc_type == DC_TYPE_AN985) #define DC_IS_INTEL(x) (x->dc_type == DC_TYPE_21143) *************** *** 890,895 **** --- 892,904 ---- */ #define DC_DEVICEID_EN1217 0x1217 #define DC_DEVICEID_EN2242 0x1216 + #define DC_DEVICEID_EN5251B 0x1216 + + /* + * The Accton EN5251B is sold as the Siemens Speedstream SS1020. + * The EN5251B seems to be a clone of the ADMtek 983 or 983B + */ + #define DC_REVISION_EN5251B 0x11 /* ASSUMING that EN2242's revision differs */ /* * Xircom vendor ID * $FreeBSD: src/sys/pci/if_dc.c,v 1.77 2002/09/04 18:14:17 markm Exp $ *** /usr/temp/if_dc.c Wed Sep 4 11:14:17 2002 --- /usr/src/sys/pci/if_dc.c Mon Sep 9 15:22:09 2002 *************** *** 186,191 **** --- 186,193 ---- "Accton EN1217 10/100BaseTX" }, { DC_VENDORID_ACCTON, DC_DEVICEID_EN2242, "Accton EN2242 MiniPCI 10/100BaseTX" }, + { DC_VENDORID_ACCTON, DC_DEVICEID_EN5251B, + "Siemens SpeedStream SS1020 10/100BaseTX" }, { DC_VENDORID_XIRCOM, DC_DEVICEID_X3201, "Xircom X3201 10/100BaseTX" }, { DC_VENDORID_ABOCOM, DC_DEVICEID_FE2500, *************** *** 1579,1584 **** --- 1581,1589 ---- if (t->dc_did == DC_DEVICEID_DM9102 && rev >= DC_REVISION_DM9102A) t++; + if (t->dc_did == DC_DEVICEID_EN2242 && + rev >= DC_REVISION_EN5251B) + t++; return(t); } t++; *************** *** 1917,1925 **** sc->dc_flags |= DC_TX_ADMTEK_WAR; sc->dc_pmode = DC_PMODE_MII; break; case DC_DEVICEID_AN985: case DC_DEVICEID_FE2500: - case DC_DEVICEID_EN2242: sc->dc_type = DC_TYPE_AN985; sc->dc_flags |= DC_TX_USE_TX_INTR; sc->dc_flags |= DC_TX_ADMTEK_WAR; --- 1922,1939 ---- sc->dc_flags |= DC_TX_ADMTEK_WAR; sc->dc_pmode = DC_PMODE_MII; break; + case DC_DEVICEID_EN2242: /* and DC_DEVICEID_EN5251B: */ + if (revision < DC_REVISION_EN5251B) { + sc->dc_type = DC_TYPE_AN985; + } else { + sc->dc_type = DC_TYPE_EN5152B; + } + sc->dc_flags |= DC_TX_USE_TX_INTR; + sc->dc_flags |= DC_TX_ADMTEK_WAR; + sc->dc_pmode = DC_PMODE_MII; + break; case DC_DEVICEID_AN985: case DC_DEVICEID_FE2500: sc->dc_type = DC_TYPE_AN985; sc->dc_flags |= DC_TX_USE_TX_INTR; sc->dc_flags |= DC_TX_ADMTEK_WAR; *************** *** 2056,2061 **** --- 2070,2076 ---- break; case DC_TYPE_AL981: case DC_TYPE_AN985: + case DC_TYPE_EN5152B: dc_read_eeprom(sc, (caddr_t)&eaddr, DC_AL_EE_NODEADDR, 3, 0); break; case DC_TYPE_CONEXANT: dmesg output is as follows: cardbus1: Expecting link target, got 0x59 cardbus1: Resource not specified in CIS: id=10, size=100 cardbus1: Resource not specified in CIS: id=14, size=400 dc0: <Siemens SpeedStream SS1020 10/100BaseTX> port 0x1000-0x10ff mem 0xf4002000 -0xf40023ff irq 11 at device 0.0 on cardbus1 dc0: Ethernet address: 85:84:33:a0:00:80 miibus1: <MII bus> on dc0 ukphy1: <Generic IEEE 802.3u media interface> on miibus1 ukphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto /usr/src/sys/vm/uma_core.c:1332: could sleep with "dc0" locked from /usr/src/sys /pci/if_dc.c:623 /usr/src/sys/vm/uma_core.c:1332: could sleep with "dc0" locked from /usr/src/sys /pci/if_dc.c:623 /usr/src/sys/vm/uma_core.c:1332: could sleep with "dc0" locked from /usr/src/sys /pci/if_dc.c:623 versus before the patch as follows: cardbus1: Expecting link target, got 0x59 cardbus1: Resource not specified in CIS: id=10, size=100 cardbus1: Resource not specified in CIS: id=14, size=400 dc0: <Accton EN2242 MiniPCI 10/100BaseTX> port 0x1000-0x10ff mem 0xf4002000-0xf4 0023ff irq 11 at device 0.0 on cardbus1 dc0: Ethernet address: 00:04:e2:2e:c3:4e miibus1: <MII bus> on dc0 ukphy1: <Generic IEEE 802.3u media interface> on miibus1 ukphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto /usr/src/sys/vm/uma_core.c:1332: could sleep with "dc0" locked from /usr/src/sys /pci/if_dc.c:621 /usr/src/sys/vm/uma_core.c:1332: could sleep with "dc0" locked from /usr/src/sys /pci/if_dc.c:621 /usr/src/sys/vm/uma_core.c:1332: could sleep with "dc0" locked from /usr/src/sys /pci/if_dc.c:621 Seems to identify everything as a Siemens SpeedStream SS1020. 2) Tulip ether card EN2242 (if_dc.c) use wrong multicast table This one works as far as I can tell. I don't have a IPv6 network to test. http://www.FreeBSD.org/cgi/query-pr.cgi?pr=misc/32699 * $FreeBSD: src/sys/pci/if_dc.c,v 1.77 2002/09/04 18:14:17 markm Exp $ *** /usr/temp/if_dc.c Wed Sep 4 11:14:17 2002 --- /usr/src/sys/pci/if_dc.c Mon Sep 9 16:28:55 2002 *************** *** 1168,1174 **** TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; ! h = dc_crc_be(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); if (h < 32) hashes[0] |= (1 << h); else --- 1168,1178 ---- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; ! if (DC_IS_CENTAUR(sc)) ! h = dc_crc_le(sc, ! LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); ! else ! h = dc_crc_be(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); if (h < 32) hashes[0] |= (1 << h); else *************** *** 1921,1926 **** --- 1925,1931 ---- case DC_DEVICEID_FE2500: case DC_DEVICEID_EN2242: sc->dc_type = DC_TYPE_AN985; + sc->dc_flags |= DC_64BIT_HASH; sc->dc_flags |= DC_TX_USE_TX_INTR; sc->dc_flags |= DC_TX_ADMTEK_WAR; sc->dc_pmode = DC_PMODE_MII; 3) ADMtek AN98x, enable automatically TX underrun recovery This works and works combined with 2 above. http://www.FreeBSD.org/cgi/query-pr.cgi?pr=34236 * $FreeBSD: src/sys/pci/if_dcreg.h,v 1.25 2002/05/06 10:55:42 iwasaki Exp $ *** /usr/temp/if_dcreg.h Mon May 6 03:55:42 2002 --- /usr/src/sys/pci/if_dcreg.h Mon Sep 9 17:08:14 2002 *************** *** 526,531 **** --- 526,532 ---- * ADMtek specific registers and constants for the AL981 and AN985. * The AN985 doesn't use the magic PHY registers. */ + #define DC_AL_CR 0x88 /* Command register */ #define DC_AL_PAR0 0xA4 /* station address */ #define DC_AL_PAR1 0xA8 /* station address */ #define DC_AL_MAR0 0xAC /* multicast hash filter */ *************** *** 540,545 **** --- 541,547 ---- #define DC_ADMTEK_PHYADDR 0x1 #define DC_AL_EE_NODEADDR 4 + #define DC_AL_CR_ATUR 0x00000001 /* Enable automatically TX underrun recovery */ /* End of ADMtek specific registers */ /* * $FreeBSD: src/sys/pci/if_dc.c,v 1.77 2002/09/04 18:14:17 markm Exp $ *** /usr/temp/if_dc.c Wed Sep 4 11:14:17 2002 --- /usr/src/sys/pci/if_dc.c Mon Sep 9 17:11:42 2002 *************** *** 1482,1487 **** --- 1486,1494 ---- } } + if (DC_IS_ADMTEK(sc)) + DC_SETBIT(sc, DC_AL_CR, DC_AL_CR_ATUR); + if ((media & IFM_GMASK) == IFM_FDX) { DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_FULLDUPLEX); if (sc->dc_pmode == DC_PMODE_SYM && DC_IS_PNIC(sc)) 4) Martin's patch... This one works standalone and with 2 and 3 above. It seems to have increase ftp transfer rates too from 8600Kbytes/sec to 10577Kbytes/sec. Ofcourse, for some odd reason, if the ftp was done from a Windows XP Pro machine, it's only 6722KBytes/sec. * $FreeBSD: src/sys/pci/if_dc.c,v 1.77 2002/09/04 18:14:17 markm Exp $ *** /usr/temp/if_dc.c Wed Sep 4 11:14:17 2002 --- /usr/src/sys/pci/if_dc.c Mon Sep 9 17:55:22 2002 *************** *** 1363,1379 **** restart = 1; DC_CLRBIT(sc, DC_NETCFG, (DC_NETCFG_TX_ON|DC_NETCFG_RX_ON)); ! for (i = 0; i < DC_TIMEOUT; i++) { ! isr = CSR_READ_4(sc, DC_ISR); ! if (isr & DC_ISR_TX_IDLE && ! (isr & DC_ISR_RX_STATE) == DC_RXSTATE_STOPPED) ! break; ! DELAY(10); } - - if (i == DC_TIMEOUT) - printf("dc%d: failed to force tx and " - "rx to idle state\n", sc->dc_unit); } if (IFM_SUBTYPE(media) == IFM_100_TX) { --- 1367,1386 ---- restart = 1; DC_CLRBIT(sc, DC_NETCFG, (DC_NETCFG_TX_ON|DC_NETCFG_RX_ON)); ! if (DC_IS_INTEL(sc)) { ! for (i = 0; i < DC_TIMEOUT; i++) { ! isr = CSR_READ_4(sc, DC_ISR); ! if (isr & DC_ISR_TX_IDLE && ! (isr & DC_ISR_RX_STATE) ! == DC_RXSTATE_STOPPED) ! break; ! DELAY(10); ! } ! if (i == DC_TIMEOUT) { ! printf("dc%d: failed to force tx and " ! "rx to idle state\n", sc->dc_unit); ! } } } if (IFM_SUBTYPE(media) == IFM_100_TX) { Cheers, Vince - vince@WURLDLINK.NET - Vice President ________ __ ____ Unix Networking Operations - FreeBSD-Real Unix for Free / / / / | / |[__ ] WurldLink Corporation / / / / | / | __] ] San Francisco - Honolulu - Hong Kong / / / / / |/ / | __] ] HongKong Stars/Gravis UltraSound Mailing Lists Admin /_/_/_/_/|___/|_|[____] Almighty1@IRC - oahu.DAL.NET Hawaii's DALnet IRC Network Server Admin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020909130911.U2914-100000>