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

Commit eb83bbf5 authored by Larry Finger's avatar Larry Finger Committed by John W. Linville
Browse files

rtl8187: Fix error in setting OFDM power settings for RTL8187L



After reports of poor performance, a review of the latest vendor driver
(rtl8187_linux_26.1025.0328.2007) for RTL8187L devices was undertaken.

A difference was found in the code used to index the OFDM power tables. When
the Linux driver was changed, my unit works at a much greater range than
before. I think this fixes Bugzilla #12380 and has been tested by at least
two other users.

Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Tested-by: default avatarMartín Ernesto Barreyro <barreyromartin@gmail.com>
Cc: Stable <stable@kernel.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent e6a27165
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -285,7 +285,10 @@ static void rtl8225_rf_set_tx_power(struct ieee80211_hw *dev, int channel)
	ofdm_power = priv->channels[channel - 1].hw_value >> 4;

	cck_power = min(cck_power, (u8)11);
	ofdm_power = min(ofdm_power, (u8)35);
	if (ofdm_power > (u8)15)
		ofdm_power = 25;
	else
		ofdm_power += 10;

	rtl818x_iowrite8(priv, &priv->map->TX_GAIN_CCK,
			 rtl8225_tx_gain_cck_ofdm[cck_power / 6] >> 1);
@@ -536,7 +539,10 @@ static void rtl8225z2_rf_set_tx_power(struct ieee80211_hw *dev, int channel)
	cck_power += priv->txpwr_base & 0xF;
	cck_power = min(cck_power, (u8)35);

	ofdm_power = min(ofdm_power, (u8)15);
	if (ofdm_power > (u8)15)
		ofdm_power = 25;
	else
		ofdm_power += 10;
	ofdm_power += priv->txpwr_base >> 4;
	ofdm_power = min(ofdm_power, (u8)35);