Date: Thu, 6 Mar 2003 12:04:40 +0100 From: Fabien THOMAS <fabien.thomas@netasq.com> To: freebsd-net@FreeBSD.ORG Subject: rl driver mac address probem Message-ID: <160266830406.20030306120440@netasq.com>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?160266830406.20030306120440>