diff options
author | Marcus Glocker <mglocker@cvs.openbsd.org> | 2007-01-03 06:20:15 +0000 |
---|---|---|
committer | Marcus Glocker <mglocker@cvs.openbsd.org> | 2007-01-03 06:20:15 +0000 |
commit | edb393fd4feb7eea3b958e595f563ed96806d411 (patch) | |
tree | 0d6c8f185fc00d63bac12acf5ed8d36c72635cc9 | |
parent | b41e70991add49ac866668d0445d65977aa1d84f (diff) |
Replace bus_space_write_2() by the BCW_WRITE16 macro.
-rw-r--r-- | sys/dev/ic/bcw.c | 56 |
1 files changed, 19 insertions, 37 deletions
diff --git a/sys/dev/ic/bcw.c b/sys/dev/ic/bcw.c index b4d0e64849f..fe671c0d890 100644 --- a/sys/dev/ic/bcw.c +++ b/sys/dev/ic/bcw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bcw.c,v 1.19 2007/01/03 06:10:47 mglocker Exp $ */ +/* $OpenBSD: bcw.c,v 1.20 2007/01/03 06:20:14 mglocker Exp $ */ /* * Copyright (c) 2006 Jon Simola <jsimola@gmail.com> @@ -2022,60 +2022,42 @@ bcw_radio_off(struct bcw_softc *sc) switch(sc->sc_phy_type) { case BCW_PHY_TYPEA: /* Magic unexplained values */ - bus_space_write_2(sc->sc_iot, sc->sc_ioh, - BCW_RADIO_CONTROL, 0x04); - bus_space_write_2(sc->sc_iot, sc->sc_ioh, - BCW_RADIO_DATALOW, 0xff); - bus_space_write_2(sc->sc_iot, sc->sc_ioh, - BCW_RADIO_CONTROL, 0x05); - bus_space_write_2(sc->sc_iot, sc->sc_ioh, - BCW_RADIO_DATALOW, 0xfb); - bus_space_write_2(sc->sc_iot, sc->sc_ioh, - BCW_PHY_CONTROL, 0x10); + BCW_WRITE16(sc, BCW_RADIO_CONTROL, 0x04); + BCW_WRITE16(sc, BCW_RADIO_DATALOW, 0xff); + BCW_WRITE16(sc, BCW_RADIO_CONTROL, 0x05); + BCW_WRITE16(sc, BCW_RADIO_DATALOW, 0xfb); + BCW_WRITE16(sc, BCW_PHY_CONTROL, 0x10); sbval16 = bus_space_read_2(sc->sc_iot, sc->sc_ioh, BCW_PHY_DATA); sbval16 |= 0x8; - bus_space_write_2(sc->sc_iot, sc->sc_ioh, - BCW_PHY_CONTROL, 0x10); - bus_space_write_2(sc->sc_iot, sc->sc_ioh, - BCW_PHY_DATA, sbval16); - bus_space_write_2(sc->sc_iot, sc->sc_ioh, - BCW_PHY_CONTROL, 0x11); + BCW_WRITE16(sc, BCW_PHY_CONTROL, 0x10); + BCW_WRITE16(sc, BCW_PHY_DATA, sbval16); + BCW_WRITE16(sc, BCW_PHY_CONTROL, 0x11); sbval16 = bus_space_read_2(sc->sc_iot, sc->sc_ioh, BCW_PHY_DATA); sbval16 |= 0x8; - bus_space_write_2(sc->sc_iot, sc->sc_ioh, - BCW_PHY_CONTROL, 0x11); - bus_space_write_2(sc->sc_iot, sc->sc_ioh, - BCW_PHY_DATA, sbval16); + BCW_WRITE16(sc, BCW_PHY_CONTROL, 0x11); + BCW_WRITE16(sc, BCW_PHY_DATA, sbval16); break; case BCW_PHY_TYPEG: if (sc->sc_core_80211->rev >= 5) { - bus_space_write_2(sc->sc_iot, sc->sc_ioh, - BCW_PHY_CONTROL, 0x811); + BCW_WRITE16(sc, BCW_PHY_CONTROL, 0x811); sbval16 = bus_space_read_2(sc->sc_iot, sc->sc_ioh, BCW_PHY_DATA); sbval16 |= 0x8c; - bus_space_write_2(sc->sc_iot, sc->sc_ioh, - BCW_PHY_CONTROL, 0x811); - bus_space_write_2(sc->sc_iot, sc->sc_ioh, - BCW_PHY_DATA, sbval16); - bus_space_write_2(sc->sc_iot, sc->sc_ioh, - BCW_PHY_CONTROL, 0x812); + BCW_WRITE16(sc, BCW_PHY_CONTROL, 0x811); + BCW_WRITE16(sc, BCW_PHY_DATA, sbval16); + BCW_WRITE16(sc, BCW_PHY_CONTROL, 0x812); sbval16 = bus_space_read_2(sc->sc_iot, sc->sc_ioh, BCW_PHY_DATA); sbval16 &= 0xff73; - bus_space_write_2(sc->sc_iot, sc->sc_ioh, - BCW_PHY_CONTROL, 0x812); - bus_space_write_2(sc->sc_iot, sc->sc_ioh, - BCW_PHY_DATA, sbval16); + BCW_WRITE16(sc, BCW_PHY_CONTROL, 0x812); + BCW_WRITE16(sc, BCW_PHY_DATA, sbval16); } /* FALL-THROUGH */ default: - bus_space_write_2(sc->sc_iot, sc->sc_ioh, - BCW_PHY_CONTROL, 0x15); - bus_space_write_2(sc->sc_iot, sc->sc_ioh, - BCW_PHY_DATA, 0xaa00); + BCW_WRITE16(sc, BCW_PHY_CONTROL, 0x15); + BCW_WRITE16(sc, BCW_PHY_DATA, 0xaa00); } /* end of switch statement to turn off radio */ } |