Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6e956da2 authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by John W. Linville
Browse files

rt2800: fix wrong TX power compensation



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: default avatarFabien ADAM <id2ndr@crocobox.org>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 93ba2a85
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -3407,6 +3407,13 @@ static int rt2800_get_gain_calibration_delta(struct rt2x00_dev *rt2x00dev)
	u8 step;
	u8 step;
	int i;
	int i;


	/*
	 * First check if temperature compensation is supported.
	 */
	rt2800_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1, &eeprom);
	if (!rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_EXTERNAL_TX_ALC))
		return 0;

	/*
	/*
	 * Read TSSI boundaries for temperature compensation from
	 * Read TSSI boundaries for temperature compensation from
	 * the EEPROM.
	 * the EEPROM.