diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2006-07-18 20:23:15 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2006-07-18 20:23:15 +0000 |
commit | 1c26fb6426e14051902164b6fbf7e61c8bae7101 (patch) | |
tree | 5d84420f6b82df246ed8fe2e49e98be8df880617 | |
parent | 6b397554dd8606ed003d38555c26b509764a5f69 (diff) |
fix rum_set_chan():
- don't read BBP register R3 since the returned value is unused
- fix RF register R1 setting
- fix RF register R3 setting
- RF settings must be written three times (with only RF R3 changing)
-rw-r--r-- | sys/dev/usb/if_rum.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/sys/dev/usb/if_rum.c b/sys/dev/usb/if_rum.c index e5bbc9b1049..81873114b91 100644 --- a/sys/dev/usb/if_rum.c +++ b/sys/dev/usb/if_rum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rum.c,v 1.8 2006/07/18 20:12:15 damien Exp $ */ +/* $OpenBSD: if_rum.c,v 1.9 2006/07/18 20:23:14 damien Exp $ */ /*- * Copyright (c) 2005, 2006 Damien Bergamini <damien.bergamini@free.fr> * Copyright (c) 2006 Niall O'Higgins <niallo@openbsd.org> @@ -1570,7 +1570,7 @@ void rum_set_chan(struct rum_softc *sc, struct ieee80211_channel *c) { struct ieee80211com *ic = &sc->sc_ic; - uint8_t bbp3, bbp94 = RT2573_BBPR94_DEFAULT; + uint8_t bbp94 = RT2573_BBPR94_DEFAULT; int8_t power; u_int chan; @@ -1588,21 +1588,25 @@ rum_set_chan(struct rum_softc *sc, struct ieee80211_channel *c) } sc->sc_curchan = c; - rum_rf_write(sc, RT2573_RF1, 0x0c808); + rum_rf_write(sc, RT2573_RF1, 0xb03); rum_rf_write(sc, RT2573_RF2, rum_rf2528_r2[chan - 1]); - rum_rf_write(sc, RT2573_RF3, power << 7 | 0x18044); + rum_rf_write(sc, RT2573_RF3, 0x1a014 | power << 7); rum_rf_write(sc, RT2573_RF4, rum_rf2528_r4[chan - 1]); - DELAY(200); + rum_rf_write(sc, RT2573_RF1, 0xb03); + rum_rf_write(sc, RT2573_RF2, rum_rf2528_r2[chan - 1]); + rum_rf_write(sc, RT2573_RF3, 0x1a015 | power << 7); + rum_rf_write(sc, RT2573_RF4, rum_rf2528_r4[chan - 1]); + + rum_rf_write(sc, RT2573_RF1, 0xb03); + rum_rf_write(sc, RT2573_RF2, rum_rf2528_r2[chan - 1]); + rum_rf_write(sc, RT2573_RF3, 0x1a014 | power << 7); + rum_rf_write(sc, RT2573_RF4, rum_rf2528_r4[chan - 1]); - bbp3 = rum_bbp_read(sc, 3); + DELAY(10); if (bbp94 != RT2573_BBPR94_DEFAULT) rum_bbp_write(sc, 94, bbp94); - - /* 5GHz radio needs a 1ms delay here */ - if (IEEE80211_IS_CHAN_5GHZ(c)) - DELAY(1000); } /* |