• Ping-Ke Shih's avatar
    rtlwifi: 8192de: Fix used uninitialized variables in power tracking · 0e7d3813
    Ping-Ke Shih authored
    
    
    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: default avatarColin Ian King <colin.king@canonical.com>
    Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
    Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
    0e7d3813
dm.c 43.7 KB