From owner-freebsd-net Thu Mar 6 3: 5: 0 2003 Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 960B237B401 for ; Thu, 6 Mar 2003 03:04:57 -0800 (PST) Received: from smtp.completel.fr (smtp.completel.fr [213.244.0.12]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7659E43F85 for ; Thu, 6 Mar 2003 03:04:56 -0800 (PST) (envelope-from fabien.thomas@netasq.com) Received: from netasq.com (unknown [213.30.137.178]) by smtp.completel.fr (Postfix) with ESMTP id B5FA6179EDE for ; Thu, 6 Mar 2003 12:04:52 +0100 (CET) Received: from netasq.com by completel.fr (8.10.1/8.10.1) with ESMTP id h26B7UA22359 for ; Thu, 6 Mar 2003 12:07:30 +0100 (CET) Date: Thu, 6 Mar 2003 12:04:40 +0100 From: Fabien THOMAS X-Mailer: The Bat! (v1.62i) Business Organization: NETASQ X-Priority: 3 (Normal) Message-ID: <160266830406.20030306120440@netasq.com> To: freebsd-net@FreeBSD.ORG Subject: rl driver mac address probem MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi, I've a problem for setting the mac address for the rl driver (ifconfig rl0 ether xx:xx:xx:xx:xx:xx). The chip datasheet said that address can be read as a single byte but it must be written 4 bytes at a time. The patch correct the problem and have been grabbed from the linux driver (but have a read overflow of 2 bytes). is it possible that someone can review & commit the correction fabien --- if_rl.c.orig Thu Mar 6 11:32:58 2003 +++ if_rl.c Thu Mar 6 11:33:37 2003 @@ -1474,7 +1474,7 @@ struct rl_softc *sc = xsc; struct ifnet *ifp = &sc->arpcom.ac_if; struct mii_data *mii; - int s, i; + int s; u_int32_t rxcfg = 0; s = splimp(); @@ -1487,9 +1487,9 @@ rl_stop(sc); /* Init our MAC address */ - for (i = 0; i < ETHER_ADDR_LEN; i++) { - CSR_WRITE_1(sc, RL_IDR0 + i, sc->arpcom.ac_enaddr[i]); - } + CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_WRITECFG); + CSR_WRITE_4(sc, RL_IDR0, *(u_int32_t *)&sc->arpcom.ac_enaddr[0]); + CSR_WRITE_4(sc, RL_IDR4, *(u_int32_t *)&sc->arpcom.ac_enaddr[4]); /* Init the RX buffer pointer register. */ CSR_WRITE_4(sc, RL_RXADDR, vtophys(sc->rl_cdata.rl_rx_buf)); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message