aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-06-22 07:13:25 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-25 17:07:29 -0400
commit24e095cdc2d7781e756b052291ef0ca7c9edac93 (patch)
treef9a4d7ad76312ce8b559964dc234c5cb65be9e8d /drivers/net/wireless
parentf707f7ae37c514a3871741747bfd8c09d7badb05 (diff)
rt2x00: read 5GHz TX power values from the correct offset
commit 0a6f3a8ebaf13407523c2c7d575b4ca2debd23ba upstream. The current code uses the same index value both for the channel information array and for the TX power table. The index starts from 14, however the index of the TX power table must start from zero. Fix it, in order to get the correct TX power value for a given channel. The changes in rt61pci.c and rt73usb.c are compile tested only. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Acked-by: Stanislaw Gruszka <stf_xl@wp.pl> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/rt2x00/rt2800lib.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c3
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c3
3 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 72f32e5caa4d..519914f33b43 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -6056,8 +6056,8 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
6056 default_power2 = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_A2); 6056 default_power2 = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_A2);
6057 6057
6058 for (i = 14; i < spec->num_channels; i++) { 6058 for (i = 14; i < spec->num_channels; i++) {
6059 info[i].default_power1 = default_power1[i]; 6059 info[i].default_power1 = default_power1[i - 14];
6060 info[i].default_power2 = default_power2[i]; 6060 info[i].default_power2 = default_power2[i - 14];
6061 } 6061 }
6062 } 6062 }
6063 6063
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 0dc8180e251b..883a54c8c5bc 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2825,7 +2825,8 @@ static int rt61pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
2825 tx_power = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_A_START); 2825 tx_power = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_A_START);
2826 for (i = 14; i < spec->num_channels; i++) { 2826 for (i = 14; i < spec->num_channels; i++) {
2827 info[i].max_power = MAX_TXPOWER; 2827 info[i].max_power = MAX_TXPOWER;
2828 info[i].default_power1 = TXPOWER_FROM_DEV(tx_power[i]); 2828 info[i].default_power1 =
2829 TXPOWER_FROM_DEV(tx_power[i - 14]);
2829 } 2830 }
2830 } 2831 }
2831 2832
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 377e09bb0b81..2bbca183f94a 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -2167,7 +2167,8 @@ static int rt73usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
2167 tx_power = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_A_START); 2167 tx_power = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_A_START);
2168 for (i = 14; i < spec->num_channels; i++) { 2168 for (i = 14; i < spec->num_channels; i++) {
2169 info[i].max_power = MAX_TXPOWER; 2169 info[i].max_power = MAX_TXPOWER;
2170 info[i].default_power1 = TXPOWER_FROM_DEV(tx_power[i]); 2170 info[i].default_power1 =
2171 TXPOWER_FROM_DEV(tx_power[i - 14]);
2171 } 2172 }
2172 } 2173 }
2173 2174