rtl8723ae: Dont use old data for input gain control
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Tue, 8 Jan 2019 22:49:40 +0000 (22:49 +0000)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 1 Feb 2019 12:07:29 +0000 (14:07 +0200)
commit5bb5385fbf3e31e72ee81e05c14f958dab2d53b6
tree31df1cbf8ba738cebbefc887a623a0bb5d87fab0
parent46b87976d7a8a75759a13a6db0e1a5f166011968
rtl8723ae: Dont use old data for input gain control

When no beacon was received, the value in dm.undec_sm_pwdb is most
likely out of date and should not be used to adjust the input path.
Assume instead that the signal level is low.

Fix the state machine in rtl8723e_dm_cck_packet_detection_thresh
which did not clear pre_cck_fa_state when changing cur_cck_pd_state
from CCK_PD_STAGE_LOWRSSI/CCK_FA_STAGE_LOW to CCK_PD_STAGE_HIGHRSSI
and back again to CCK_PD_STAGE_LOWRSSI/CCK_FA_STAGE_LOW, the register
RCCK0_CCA not written to 0x83 on the second change.

Explicitly initialize pre_cck_fa_state/cur_cck_fa_state in
rtl_dm_diginit.

Signed-off-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/realtek/rtlwifi/core.c
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/dm.c