From owner-freebsd-current@FreeBSD.ORG Tue Sep 28 12:40:39 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4DAFA16A4CE; Tue, 28 Sep 2004 12:40:39 +0000 (GMT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 374AC43D48; Tue, 28 Sep 2004 12:40:39 +0000 (GMT) (envelope-from mux@freebsd.org) Received: by elvis.mu.org (Postfix, from userid 1920) id 2A0E05C955; Tue, 28 Sep 2004 05:40:39 -0700 (PDT) Date: Tue, 28 Sep 2004 14:40:39 +0200 From: Maxime Henrion To: current@FreeBSD.org, sparc64@FreeBSD.org Message-ID: <20040928124039.GB61666@elvis.mu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="DocE+STaALJfprDB" Content-Disposition: inline User-Agent: Mutt/1.4.2.1i Subject: Call for testers: patch for the dc(4) driver X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2004 12:40:39 -0000 --DocE+STaALJfprDB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi guys, I need people to give this patch a try and see if it doesn't break anything. It shouldn't cause any harm, but better safe than sorry. This patch allows the dc(4) driver to properly read the MAC address in the EEPROM on FreeBSD/powerpc. Andrew Gallatin tested it successfully on his G4. I'm particularly interested about people using dc(4) on sparc64 since this arcihtecture is big endian. Cheers, Maxime --DocE+STaALJfprDB Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="dc.patch" Index: if_dc.c =================================================================== RCS file: /space2/ncvs/src/sys/pci/if_dc.c,v retrieving revision 1.149 diff -u -p -r1.149 if_dc.c --- if_dc.c 25 Aug 2004 03:37:25 -0000 1.149 +++ if_dc.c 26 Sep 2004 21:57:53 -0000 @@ -584,7 +584,7 @@ dc_eeprom_getword(struct dc_softc *sc, i * Read a sequence of words from the EEPROM. */ static void -dc_read_eeprom(struct dc_softc *sc, caddr_t dest, int off, int cnt, int swap) +dc_read_eeprom(struct dc_softc *sc, caddr_t dest, int off, int cnt, int be) { int i; u_int16_t word = 0, *ptr; @@ -597,10 +597,10 @@ dc_read_eeprom(struct dc_softc *sc, cadd else dc_eeprom_getword(sc, off + i, &word); ptr = (u_int16_t *)(dest + (i * 2)); - if (swap) - *ptr = ntohs(word); + if (be) + *ptr = be16toh(word); else - *ptr = word; + *ptr = le16toh(word); } } --DocE+STaALJfprDB--