summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2010-03-27 16:13:25 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2010-03-27 16:13:25 +0000
commit1aa870172f187fff36a6a7030b2e66e447098198 (patch)
tree761f183f9153333347341391fcbb95f3fed03768 /sys/dev
parent847c04ce9cbcd81b7efc252d2c67b4a191efc5fd (diff)
Fix TX power per rate settings.
Found by Yao Zhao (dragonlinux at gmail dot com)
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/rt2860.c10
-rw-r--r--sys/dev/usb/if_run.c10
2 files changed, 10 insertions, 10 deletions
diff --git a/sys/dev/ic/rt2860.c b/sys/dev/ic/rt2860.c
index 479d7869a3f..89a7babf45c 100644
--- a/sys/dev/ic/rt2860.c
+++ b/sys/dev/ic/rt2860.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2860.c,v 1.41 2010/02/08 18:46:47 damien Exp $ */
+/* $OpenBSD: rt2860.c,v 1.42 2010/03/27 16:13:24 damien Exp $ */
/*-
* Copyright (c) 2007, 2008
@@ -2505,10 +2505,10 @@ rt2860_read_eeprom(struct rt2860_softc *sc)
for (ridx = 0; ridx < 5; ridx++) {
uint32_t reg;
- val = rt2860_eeprom_read(sc, RT2860_EEPROM_RPWR + ridx);
- reg = (uint32_t)val << 16;
- val = rt2860_eeprom_read(sc, RT2860_EEPROM_RPWR + ridx + 1);
- reg |= val;
+ val = rt2860_eeprom_read(sc, RT2860_EEPROM_RPWR + ridx * 2);
+ reg = val;
+ val = rt2860_eeprom_read(sc, RT2860_EEPROM_RPWR + ridx * 2 + 1);
+ reg |= (uint32_t)val << 16;
sc->txpow20mhz[ridx] = reg;
sc->txpow40mhz_2ghz[ridx] = b4inc(reg, delta_2ghz);
diff --git a/sys/dev/usb/if_run.c b/sys/dev/usb/if_run.c
index ab930344697..92cc0505853 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.62 2010/02/25 17:46:20 damien Exp $ */
+/* $OpenBSD: if_run.c,v 1.63 2010/03/27 16:13:24 damien Exp $ */
/*-
* Copyright (c) 2008-2010 Damien Bergamini <damien.bergamini@free.fr>
@@ -1313,10 +1313,10 @@ run_read_eeprom(struct run_softc *sc)
for (ridx = 0; ridx < 5; ridx++) {
uint32_t reg;
- run_srom_read(sc, RT2860_EEPROM_RPWR + ridx, &val);
- reg = (uint32_t)val << 16;
- run_srom_read(sc, RT2860_EEPROM_RPWR + ridx + 1, &val);
- reg |= val;
+ run_srom_read(sc, RT2860_EEPROM_RPWR + ridx * 2, &val);
+ reg = val;
+ run_srom_read(sc, RT2860_EEPROM_RPWR + ridx * 2 + 1, &val);
+ reg |= (uint32_t)val << 16;
sc->txpow20mhz[ridx] = reg;
sc->txpow40mhz_2ghz[ridx] = b4inc(reg, delta_2ghz);