openwrt/package/kernel/mac80211/patches/rtl/038-v6.13-wifi-rtw88-8812a-Mitigate-beacon-loss.patch
Marty Jones 36f6d6ddcd mac80211: realtek: backport support for RTL8812AU/RTL8821AU
Backport support for RTL8812AU/RTL8821AU USB adapters
Manually backported patch:
045-v6.13-wifi-rtw88-Enable-the-new-RTL8821AU-RTL8812AU-driver
Patches from 046 to 051 are pending.

Signed-off-by: Marty Jones <mj8263788@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17079
[Move BPAUTO_WANT_DEV_COREDUMP to original patch]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-30 17:38:19 +01:00

38 lines
1.4 KiB
Diff

From f9e0189cbc2d6447dde392944c769546cdf48140 Mon Sep 17 00:00:00 2001
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Date: Wed, 23 Oct 2024 17:15:13 +0300
Subject: [PATCH] wifi: rtw88: 8812a: Mitigate beacon loss
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>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/203f5043-4fe1-4f35-8b8f-d3b6f44e1fd9@gmail.com
---
drivers/net/wireless/realtek/rtw88/phy.c | 7 +++++++
1 file changed, 7 insertions(+)
--- 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 *
*/
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);
}