diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2010-02-07 10:10:52 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2010-02-07 10:10:52 +0000 |
commit | 9687c4b4852e1ab8e69b9a522f6f7f4b2236cdb2 (patch) | |
tree | 1a852fcee402fb92b2de24cb2be7db72294fd547 | |
parent | 2319aefc7a3ec1b9314385369d68212eaa85377a (diff) |
add rf init values for rt3572
add settings for 5GHz channels (rt3572 only)
-rw-r--r-- | sys/dev/ic/rt2860reg.h | 104 | ||||
-rw-r--r-- | sys/dev/usb/if_run.c | 16 |
2 files changed, 97 insertions, 23 deletions
diff --git a/sys/dev/ic/rt2860reg.h b/sys/dev/ic/rt2860reg.h index fd9a693f606..0168dfea2a0 100644 --- a/sys/dev/ic/rt2860reg.h +++ b/sys/dev/ic/rt2860reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rt2860reg.h,v 1.20 2010/02/07 09:14:55 damien Exp $ */ +/* $OpenBSD: rt2860reg.h,v 1.21 2010/02/07 10:10:51 damien Exp $ */ /*- * Copyright (c) 2007 @@ -1086,21 +1086,60 @@ static const struct rt2860_rate { { 171, 0x100bb1, 0x1300f5, 0x05e014, 0x001401 }, \ { 173, 0x100bb1, 0x1300f5, 0x05e014, 0x001403 } -#define RT3070_RF3020 \ - { 241, 2, 2 }, \ - { 241, 2, 7 }, \ - { 242, 2, 2 }, \ - { 242, 2, 7 }, \ - { 243, 2, 2 }, \ - { 243, 2, 7 }, \ - { 244, 2, 2 }, \ - { 244, 2, 7 }, \ - { 245, 2, 2 }, \ - { 245, 2, 7 }, \ - { 246, 2, 2 }, \ - { 246, 2, 7 }, \ - { 247, 2, 2 }, \ - { 248, 2, 4 } +#define RT3070_RF3052 \ + { 0xf1, 2, 2 }, \ + { 0xf1, 2, 7 }, \ + { 0xf2, 2, 2 }, \ + { 0xf2, 2, 7 }, \ + { 0xf3, 2, 2 }, \ + { 0xf3, 2, 7 }, \ + { 0xf4, 2, 2 }, \ + { 0xf4, 2, 7 }, \ + { 0xf5, 2, 2 }, \ + { 0xf5, 2, 7 }, \ + { 0xf6, 2, 2 }, \ + { 0xf6, 2, 7 }, \ + { 0xf7, 2, 2 }, \ + { 0xf8, 2, 4 }, \ + { 0x56, 0, 4 }, \ + { 0x56, 0, 6 }, \ + { 0x56, 0, 8 }, \ + { 0x57, 0, 0 }, \ + { 0x57, 0, 2 }, \ + { 0x57, 0, 4 }, \ + { 0x57, 0, 8 }, \ + { 0x57, 0, 10 }, \ + { 0x58, 0, 0 }, \ + { 0x58, 0, 4 }, \ + { 0x58, 0, 6 }, \ + { 0x58, 0, 8 }, \ + { 0x5b, 0, 8 }, \ + { 0x5b, 0, 10 }, \ + { 0x5c, 0, 0 }, \ + { 0x5c, 0, 4 }, \ + { 0x5c, 0, 6 }, \ + { 0x5c, 0, 8 }, \ + { 0x5d, 0, 0 }, \ + { 0x5d, 0, 2 }, \ + { 0x5d, 0, 4 }, \ + { 0x5d, 0, 8 }, \ + { 0x5d, 0, 10 }, \ + { 0x5e, 0, 0 }, \ + { 0x5e, 0, 4 }, \ + { 0x5e, 0, 6 }, \ + { 0x5e, 0, 8 }, \ + { 0x5f, 0, 0 }, \ + { 0x5f, 0, 9 }, \ + { 0x5f, 0, 11 }, \ + { 0x60, 0, 1 }, \ + { 0x60, 0, 5 }, \ + { 0x60, 0, 7 }, \ + { 0x60, 0, 9 }, \ + { 0x61, 0, 1 }, \ + { 0x61, 0, 3 }, \ + { 0x61, 0, 5 }, \ + { 0x61, 0, 7 }, \ + { 0x61, 0, 9 } #define RT3070_DEF_RF \ { 4, 0x40 }, \ @@ -1122,3 +1161,36 @@ static const struct rt2860_rate { { 24, 0x16 }, \ { 25, 0x01 }, \ { 29, 0x1f } + +#define RT3572_DEF_RF \ + { 0, 0x70 }, \ + { 1, 0x81 }, \ + { 2, 0xf1 }, \ + { 3, 0x02 }, \ + { 4, 0x4c }, \ + { 5, 0x05 }, \ + { 6, 0x4a }, \ + { 7, 0xd8 }, \ + { 9, 0xc3 }, \ + { 10, 0xf1 }, \ + { 11, 0xb9 }, \ + { 12, 0x70 }, \ + { 13, 0x65 }, \ + { 14, 0xa0 }, \ + { 15, 0x53 }, \ + { 16, 0x4c }, \ + { 17, 0x23 }, \ + { 18, 0xac }, \ + { 19, 0x93 }, \ + { 20, 0xb3 }, \ + { 21, 0xd0 }, \ + { 22, 0x00 }, \ + { 23, 0x3c }, \ + { 24, 0x16 }, \ + { 25, 0x15 }, \ + { 26, 0x85 }, \ + { 27, 0x00 }, \ + { 28, 0x00 }, \ + { 29, 0x9b }, \ + { 30, 0x09 }, \ + { 31, 0x10 } diff --git a/sys/dev/usb/if_run.c b/sys/dev/usb/if_run.c index 0aa496bba8b..8e660f50a0e 100644 --- a/sys/dev/usb/if_run.c +++ b/sys/dev/usb/if_run.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_run.c,v 1.36 2010/02/07 09:14:55 damien Exp $ */ +/* $OpenBSD: if_run.c,v 1.37 2010/02/07 10:10:51 damien Exp $ */ /*- * Copyright (c) 2008,2009 Damien Bergamini <damien.bergamini@free.fr> @@ -352,15 +352,17 @@ static const struct rfprog { struct { uint8_t n, r, k; -} run_rf3020_freqs[] = { - RT3070_RF3020 +} rt3070_freqs[] = { + RT3070_RF3052 }; static const struct { uint8_t reg; uint8_t val; -} rt3070_def_rf[] = { +} rt3070_def_rf[] = { RT3070_DEF_RF +}, rt3572_def_rf[] = { + RT3572_DEF_RF }; int @@ -2392,10 +2394,10 @@ run_rt3070_set_chan(struct run_softc *sc, u_int chan) txpow1 = sc->txpow1[chan - 1]; txpow2 = sc->txpow2[chan - 1]; - run_rt3070_rf_write(sc, 2, run_rf3020_freqs[chan - 1].n); - run_rt3070_rf_write(sc, 3, run_rf3020_freqs[chan - 1].k); + run_rt3070_rf_write(sc, 2, rt3070_freqs[chan - 1].n); + run_rt3070_rf_write(sc, 3, rt3070_freqs[chan - 1].k); run_rt3070_rf_read(sc, 6, &rf); - rf = (rf & ~0x03) | run_rf3020_freqs[chan - 1].r; + rf = (rf & ~0x03) | rt3070_freqs[chan - 1].r; run_rt3070_rf_write(sc, 6, rf); /* set Tx0 power */ |