wifi: rtw89: rfk: add a completion to wait RF calibration report from C2H event
authorPing-Ke Shih <pkshih@realtek.com>
Fri, 2 Feb 2024 03:06:32 +0000 (11:06 +0800)
committerKalle Valo <kvalo@kernel.org>
Tue, 6 Feb 2024 18:05:21 +0000 (20:05 +0200)
commitad1c86e92698fa524078abc83a0709ccca06dbcd
tree755fd2fb468bca30f94941f3336fd054751f66e6
parentbed41a344426a407ba5e103b2877a2e560e72229
wifi: rtw89: rfk: add a completion to wait RF calibration report from C2H event

The RF calibrations should be executed one by one, so add a completion
to ensure one is finish before next. The report from C2H event contains
state and optional version, and we only check the state for now. We also
care about the time a RF calibration takes, so record start time before
asking firmware to do calibration and get the delta time when receiving
report.

Consider SER recovery, we can't receive C2H event, use half of argument
'ms' as fixed delay that is 2 times of measured maximum time of
calibrations.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240202030642.108385-2-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/core.c
drivers/net/wireless/realtek/rtw89/core.h
drivers/net/wireless/realtek/rtw89/fw.h
drivers/net/wireless/realtek/rtw89/phy.c
drivers/net/wireless/realtek/rtw89/phy.h