diff mbox series

[15/20] wifi: rtw88: 8812a: Mitigate beacon loss

Message ID d0b834df-801f-4b28-ba6e-d1bcab9801e8@gmail.com
State New
Headers show
Series wifi: rtw88: Add support for RTL8821AU and RTL8812AU | expand

Commit Message

Bitterblue Smith Aug. 11, 2024, 9:05 p.m. UTC
The RTL8812AU has a reception problem, maybe only in the 5 GHz band.
Sometimes, in some positions, it stops receiving anything even though
the distance to the AP is only ~3 meters and there are no obstacles.
Moving it a few centimeters fixes it.

Switch the initial gain to maximum coverage when there is beacon loss.
This only helps sometimes. This is similar to what the official driver
does.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
 drivers/net/wireless/realtek/rtw88/phy.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Ping-Ke Shih Aug. 15, 2024, 7:31 a.m. UTC | #1
Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> The RTL8812AU has a reception problem, maybe only in the 5 GHz band.
> Sometimes, in some positions, it stops receiving anything even though
> the distance to the AP is only ~3 meters and there are no obstacles.
> Moving it a few centimeters fixes it.
> 
> Switch the initial gain to maximum coverage when there is beacon loss.
> This only helps sometimes. This is similar to what the official driver
> does.
> 
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>


Acked-by: Ping-Ke Shih <pkshih@realtek.com>
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtw88/phy.c b/drivers/net/wireless/realtek/rtw88/phy.c
index cfe12a75ff84..fdca4e3c1038 100644
--- a/drivers/net/wireless/realtek/rtw88/phy.c
+++ b/drivers/net/wireless/realtek/rtw88/phy.c
@@ -530,6 +530,13 @@  static void rtw_phy_dig(struct rtw_dev *rtwdev)
 	 */
 	rtw_phy_dig_recorder(dm_info, cur_igi, fa_cnt);
 
+	/* Mitigate beacon loss and connectivity issues, mainly (only?)
+	 * in the 5 GHz band
+	 */
+	if (rtwdev->chip->id == RTW_CHIP_TYPE_8812A && rtwdev->beacon_loss &&
+	    linked && dm_info->total_fa_cnt < DIG_PERF_FA_TH_EXTRA_HIGH)
+		cur_igi = DIG_CVRG_MIN;
+
 	if (cur_igi != pre_igi)
 		rtw_phy_dig_write(rtwdev, cur_igi);
 }