From owner-freebsd-bugs Tue Oct 15 10:10: 7 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 933E237B401 for ; Tue, 15 Oct 2002 10:10:03 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8E97F43EAA for ; Tue, 15 Oct 2002 10:10:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g9FHA2Co073447 for ; Tue, 15 Oct 2002 10:10:02 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g9FHA2PE073446; Tue, 15 Oct 2002 10:10:02 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E227037B401 for ; Tue, 15 Oct 2002 10:04:06 -0700 (PDT) Received: from relay1.ntu-kpi.kiev.ua (www.ntu-kpi.kiev.ua [212.111.192.161]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5110243E88 for ; Tue, 15 Oct 2002 10:04:05 -0700 (PDT) (envelope-from alter@el.ntu-kpi.kiev.ua) Received: from doppelganger.el.ntu-kpi.kiev.ua (doppelganger.el.ntu-kpi.kiev.ua [10.2.16.2]) by relay1.ntu-kpi.kiev.ua (Postfix) with ESMTP id 7742D19BD4 for ; Tue, 15 Oct 2002 20:04:01 +0300 (EEST) Received: by doppelganger.el.ntu-kpi.kiev.ua (Postfix, from userid 1023) id 144281B6F; Tue, 15 Oct 2002 20:04:01 +0300 (EEST) Message-Id: <20021015170401.144281B6F@doppelganger.el.ntu-kpi.kiev.ua> Date: Tue, 15 Oct 2002 20:04:01 +0300 (EEST) From: Alex Telyatnikov Reply-To: Alex Telyatnikov To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/44098: RealTec-based NIC initialization problem Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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