wifi: rtw89: add RSSI based antenna diversity
authorEric Huang <echuang@realtek.com>
Tue, 18 Apr 2023 01:28:19 +0000 (09:28 +0800)
committerKalle Valo <kvalo@kernel.org>
Fri, 5 May 2023 11:58:29 +0000 (14:58 +0300)
commite3715859c75322fae560c46384f944006f367515
treec13c23eb8b4ca3bad47d26ef420e030459a9a0e8
parenta90c613d099ff63587b60bfcfb0f4f1a7bb83252
wifi: rtw89: add RSSI based antenna diversity

RSSI statistics are grouped by CCK, OFDM or non-legacy rate. These
statistics will be collected in training state for both (main/aux)
antenna. There is a time period (ANTDIV_DELAY) for rate adaptive
settle down before start collect statistics when switch antenna.

Antenna diversity checks packet count from training state for each
group and use the most one as the final RSSI for comparison, and
then choose the better one as target antenna.

Signed-off-by: Eric Huang <echuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230418012820.5139-7-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/core.c
drivers/net/wireless/realtek/rtw89/core.h
drivers/net/wireless/realtek/rtw89/phy.c
drivers/net/wireless/realtek/rtw89/phy.h