]> git.baikalelectronics.ru Git - kernel.git/commit
rtlwifi: 8192de: Fix used uninitialized variables in power tracking
authorPing-Ke Shih <pkshih@realtek.com>
Fri, 10 May 2019 08:03:32 +0000 (16:03 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 28 May 2019 12:34:01 +0000 (15:34 +0300)
commit8b93c692af9d5e14851e6772b8d9e008120b88c4
treef7249c44c07c654298a7a0b84c813dd3584e3cad
parentf58cc07260147aeb74634a55a45742d9c02b1ecf
rtlwifi: 8192de: Fix used uninitialized variables in power tracking

ofdm_index_old[] is the index of ofdmswing_table[], and used to indicate
initial value of ROFDM0_X{A,B}TXIQIMBALANCE in rtl8192de_phy_reg_2tarray[]
table, and the initial value is corresponding to calibration thermal value
written in efuse, namely rtlefuse->eeprom_thermalmeter. Then, local
variable ofdm_index_old[] save to rtlpriv->dm.ofdm_index[] for operational
use.

If thermal value (temperature) is increasing, output TX power is lower.
So, we calculate the delta between current and calibration thermal value,
then add power to yield expected and the same output TX power.

Thus, ofdm_index[] should be initialized as rtlpriv->dm.ofdm_index[], and
shift to proper index depends on delta of thermal value. Then, new power
value ofdmswing_table[ofdm_index[]] is written to register.

Reported-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/realtek/rtlwifi/rtl8192de/dm.c