Date: Tue, 15 Oct 2002 20:04:01 +0300 (EEST) From: Alex Telyatnikov <alter@el.ntu-kpi.kiev.ua> To: FreeBSD-gnats-submit@FreeBSD.org Subject: kern/44098: RealTec-based NIC initialization problem Message-ID: <20021015170401.144281B6F@doppelganger.el.ntu-kpi.kiev.ua>
next in thread | raw e-mail | index | archive | help
>Number: 44098 >Category: kern >Synopsis: RealTec-based NIC initialization problem >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Oct 15 10:10:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Alex Telyatnikov >Release: FreeBSD 4.7-STABLE i386 >Organization: no >Environment: System: FreeBSD ep.kiev.ua 4.7-STABLE FreeBSD 4.7-STABLE #4: Tue Oct 15 19:26:37 EEST 2002 root@ep.kiev.ua:/usr/src47/sys/EP_4_7_v1 i386 CPU: Athlon 1GHz MB: AOpen MK73LE-V OS: FreeBSD 4.7-STABLE >Description: Kernel failed to initialize the following NIC Genius III K023B016 REV:A Chip type RTL8139C, 14155S1, 116B with "rl0: unknown device ID: 0" error message. PCI Info: Vendor/Device ID 10EC/8129 Driver checks Device ID read from NIC's EPROM. My card returns zeros when reading EPROM. It also has internal PHY interface (like 8139) >How-To-Repeat: >Fix: *** /usr/src/sys/pci/if_rl.c Tue Oct 15 17:16:59 2002 --- /usr/src/sys/pci/if_rl.c Tue Oct 15 19:14:05 2002 *************** *** 799,804 **** --- 799,805 ---- struct ifnet *ifp; u_int16_t rl_did = 0; int unit, error = 0, rid; + int r = 0; s = splimp(); *************** *** 915,920 **** --- 916,922 ---- */ rl_read_eeprom(sc, (caddr_t)&rl_did, RL_EE_PCI_DID, 1, 0); + retry_from_pci: if (rl_did == RT_DEVICEID_8139 || rl_did == ACCTON_DEVICEID_5030 || rl_did == DELTA_DEVICEID_8139 || rl_did == ADDTRON_DEVICEID_8139 || rl_did == DLINK_DEVICEID_530TXPLUS) *************** *** 923,928 **** --- 925,937 ---- else if (rl_did == RT_DEVICEID_8129) sc->rl_type = RL_8129; else { + printf("rl%d: unknown device ID from EPROM, retry: %x\n", unit, rl_did); + if(r==0) { + rl_did = pci_get_device(dev); + r = 1; + printf("rl%d: PCI device ID: %x\n", unit, rl_did); + goto retry_from_pci; + } printf("rl%d: unknown device ID: %x\n", unit, rl_did); bus_teardown_intr(dev, sc->rl_irq, sc->rl_intrhand); bus_release_resource(dev, SYS_RES_IRQ, 0, sc->rl_irq); *************** *** 946,955 **** --- 955,973 ---- /* Leave a few bytes before the start of the RX ring buffer. */ sc->rl_cdata.rl_rx_buf_ptr = sc->rl_cdata.rl_rx_buf; sc->rl_cdata.rl_rx_buf += sizeof(u_int64_t); + + retry_iface_type: /* Do MII setup */ if (mii_phy_probe(dev, &sc->rl_miibus, rl_ifmedia_upd, rl_ifmedia_sts)) { + if(r == 1) { + sc->rl_type = (sc->rl_type == RL_8139) ? + RL_8129 : RL_8139; + r = 2; + printf("rl%d: MII without phy (bad EPROM), retry\n", sc->rl_unit); + goto retry_iface_type; + } printf("rl%d: MII without any phy!\n", sc->rl_unit); bus_teardown_intr(dev, sc->rl_irq, sc->rl_intrhand); bus_release_resource(dev, SYS_RES_IRQ, 0, sc->rl_irq); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021015170401.144281B6F>