Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Larry Finger <Larry.Finger@lwfinger.net>
Tested-by: Martín Ernesto Barreyro <barreyromartin@gmail.com>
Cc: Stable <stable@kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Larry Finger and committed by
John W. Linville
eb83bbf5 e6a27165

+8 -2
+8 -2
drivers/net/wireless/rtl818x/rtl8187_rtl8225.c
··· 285 285 ofdm_power = priv->channels[channel - 1].hw_value >> 4; 286 286 287 287 cck_power = min(cck_power, (u8)11); 288 - ofdm_power = min(ofdm_power, (u8)35); 288 + if (ofdm_power > (u8)15) 289 + ofdm_power = 25; 290 + else 291 + ofdm_power += 10; 289 292 290 293 rtl818x_iowrite8(priv, &priv->map->TX_GAIN_CCK, 291 294 rtl8225_tx_gain_cck_ofdm[cck_power / 6] >> 1); ··· 539 536 cck_power += priv->txpwr_base & 0xF; 540 537 cck_power = min(cck_power, (u8)35); 541 538 542 - ofdm_power = min(ofdm_power, (u8)15); 539 + if (ofdm_power > (u8)15) 540 + ofdm_power = 25; 541 + else 542 + ofdm_power += 10; 543 543 ofdm_power += priv->txpwr_base >> 4; 544 544 ofdm_power = min(ofdm_power, (u8)35); 545 545