rt2800: fix wrong TX power compensation
authorStanislaw Gruszka <sgruszka@redhat.com>
Mon, 26 Aug 2013 13:18:53 +0000 (15:18 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 26 Oct 2013 20:05:59 +0000 (21:05 +0100)
commit72b55735d2f26b1dfcb206773974c465ca7ef04d
tree811d3f88449f35882a9ac32785174bc1a45e4444
parent0140c2fcecbdc5fdf70a10060147df9d8201d79e
rt2800: fix wrong TX power compensation

commit 6e956da2027c767859128b9bfef085cf2a8e233b upstream.

We should not do temperature compensation on devices without
EXTERNAL_TX_ALC bit set (called DynamicTxAgcControl on vendor driver).
Such devices can have totally bogus TSSI parameters on the EEPROM,
but still threaded by us as valid and result doing wrong TX power
calculations.

This fix inability to connect to AP on slightly longer distance on
some Ralink chips/devices.

Reported-and-tested-by: Fabien ADAM <id2ndr@crocobox.org>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
[bwh: Backported to 3.2: use rt2x00_eeprom_read()]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/wireless/rt2x00/rt2800lib.c