--- //depot/vendor/freebsd/src/sys/pci/if_rl.c 2002/11/14 21:42:02 +++ //depot/user/jake/busdma/src/sys/pci/if_rl.c 2002/11/29 17:11:55 @@ -84,6 +84,7 @@ */ #include +#include #include #include #include @@ -858,10 +859,11 @@ { u_char eaddr[ETHER_ADDR_LEN]; u_int32_t command; + u_int16_t as[3]; struct rl_softc *sc; struct ifnet *ifp; u_int16_t rl_did = 0; - int unit, error = 0, rid; + int unit, error = 0, rid, i; sc = device_get_softc(dev); unit = device_get_unit(dev); @@ -961,7 +963,11 @@ /* * Get station address from the EEPROM. */ - rl_read_eeprom(sc, (caddr_t)&eaddr, RL_EE_EADDR, 3, 0); + rl_read_eeprom(sc, (caddr_t)as, RL_EE_EADDR, 3, 0); + for (i = 0; i < 3; i++) { + eaddr[(i * 2) + 0] = as[i] & 0xff; + eaddr[(i * 2) + 1] = as[i] >> 8; + } /* * A RealTek chip was detected. Inform the world. @@ -1188,7 +1194,7 @@ ifp = &sc->arpcom.ac_if; bus_dmamap_sync(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap, - BUS_DMASYNC_POSTWRITE); + BUS_DMASYNC_POSTREAD); cur_rx = (CSR_READ_2(sc, RL_CURRXADDR) + 16) % RL_RXBUFLEN; @@ -1209,7 +1215,7 @@ } #endif /* DEVICE_POLLING */ rxbufpos = sc->rl_cdata.rl_rx_buf + cur_rx; - rxstat = *(u_int32_t *)rxbufpos; + rxstat = le32toh(*(u_int32_t *)rxbufpos); /* * Here's a totally undocumented fact for you. When the