From owner-svn-src-head@FreeBSD.ORG Tue Oct 14 00:54:15 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D57D1065687; Tue, 14 Oct 2008 00:54:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B1658FC12; Tue, 14 Oct 2008 00:54:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9E0sF27091003; Tue, 14 Oct 2008 00:54:15 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9E0sFKY091002; Tue, 14 Oct 2008 00:54:15 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200810140054.m9E0sFKY091002@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 14 Oct 2008 00:54:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r183859 - head/sys/dev/jme X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Oct 2008 00:54:15 -0000 Author: yongari Date: Tue Oct 14 00:54:15 2008 New Revision: 183859 URL: http://svn.freebsd.org/changeset/base/183859 Log: Make sure to read the last byte of EEPROM descriptor. Previously the last byte of the ethernet address was not read which in turn resulted in getting 5 out of the 6 bytes of ethernet address and always returned ENOENT. I did not notice the bug on FPGA version because of additional configuration data in EEPROM. Pointed out by: bouyer at NetBSD Modified: head/sys/dev/jme/if_jme.c Modified: head/sys/dev/jme/if_jme.c ============================================================================== --- head/sys/dev/jme/if_jme.c Mon Oct 13 23:10:19 2008 (r183858) +++ head/sys/dev/jme/if_jme.c Tue Oct 14 00:54:15 2008 (r183859) @@ -415,11 +415,8 @@ jme_eeprom_macaddr(struct jme_softc *sc) do { if (jme_eeprom_read_byte(sc, offset, &fup) != 0) break; - /* Check for the end of EEPROM descriptor. */ - if ((fup & JME_EEPROM_DESC_END) == JME_EEPROM_DESC_END) - break; - if ((uint8_t)JME_EEPROM_MKDESC(JME_EEPROM_FUNC0, - JME_EEPROM_PAGE_BAR1) == fup) { + if (JME_EEPROM_MKDESC(JME_EEPROM_FUNC0, JME_EEPROM_PAGE_BAR1) == + (fup & (JME_EEPROM_FUNC_MASK | JME_EEPROM_PAGE_MASK))) { if (jme_eeprom_read_byte(sc, offset + 1, ®) != 0) break; if (reg >= JME_PAR0 && @@ -431,6 +428,9 @@ jme_eeprom_macaddr(struct jme_softc *sc) match++; } } + /* Check for the end of EEPROM descriptor. */ + if ((fup & JME_EEPROM_DESC_END) == JME_EEPROM_DESC_END) + break; /* Try next eeprom descriptor. */ offset += JME_EEPROM_DESC_BYTES; } while (match != ETHER_ADDR_LEN && offset < JME_EEPROM_END);