-/* $OpenBSD: rtwn.c,v 1.9 2016/06/17 10:53:55 stsp Exp $ */
+/* $OpenBSD: rtwn.c,v 1.10 2016/07/26 13:00:28 stsp Exp $ */
/*-
* Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
void
rtwn_write_2(struct rtwn_softc *sc, uint16_t addr, uint16_t val)
{
- val = htole16(val);
sc->sc_ops.write_2(sc->sc_ops.cookie, addr, val);
}
void
rtwn_write_4(struct rtwn_softc *sc, uint16_t addr, uint32_t val)
{
- val = htole32(val);
sc->sc_ops.write_4(sc->sc_ops.cookie, addr, val);
}
/* Configure Automatic Rate Fallback Register. */
if (ic->ic_curmode == IEEE80211_MODE_11B) {
if (rates & 0x0c)
- rtwn_write_4(sc, R92C_ARFR(0),
- htole32(rates & 0x0d));
+ rtwn_write_4(sc, R92C_ARFR(0), rates & 0x0d);
else
- rtwn_write_4(sc, R92C_ARFR(0),
- htole32(rates & 0x0f));
+ rtwn_write_4(sc, R92C_ARFR(0), rates & 0x0f);
} else
- rtwn_write_4(sc, R92C_ARFR(0), htole32(rates & 0x0ff5));
+ rtwn_write_4(sc, R92C_ARFR(0), rates & 0x0ff5);
}
if (sc->chip & RTWN_CHIP_88E)
-/* $OpenBSD: if_rtwn.c,v 1.23 2016/07/21 08:38:33 stsp Exp $ */
+/* $OpenBSD: if_rtwn.c,v 1.24 2016/07/26 13:00:28 stsp Exp $ */
/*-
* Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
rtwn_pci_read_2(void *cookie, uint16_t addr)
{
struct rtwn_pci_softc *sc = cookie;
+ uint16_t val;
- return bus_space_read_2(sc->sc_st, sc->sc_sh, addr);
+ val = bus_space_read_2(sc->sc_st, sc->sc_sh, addr);
+ return le16toh(val);
}
uint32_t
rtwn_pci_read_4(void *cookie, uint16_t addr)
{
struct rtwn_pci_softc *sc = cookie;
+ uint32_t val;
- return bus_space_read_4(sc->sc_st, sc->sc_sh, addr);
+ val = bus_space_read_4(sc->sc_st, sc->sc_sh, addr);
+ return le32toh(val);
}
void