wifi: rtw88: Increase the RX gain before scanning
PATCH 1/1 wifi: rtw88: Increase the RX gain before scanning
From: Martin Hrůza <[email protected]>
The driver reduces the RX gain while connected to a network located close by. In this condition scans return few results because the more distant networks can't be heard.
Temporarily increase the RX gain before scanning in order to detect all available networks. Reset the RX gain back to the last recorded value once the scan finishes.
--- drivers/net/wireless/realtek/rtw88/main.c | 3 +++ drivers/net/wireless/realtek/rtw88/phy.c | 20 ++++++++++++++++++++ drivers/net/wireless/realtek/rtw88/phy.h | 2 ++ 3 files changed, 25 insertions(+)
drivers/net/wireless/realtek/rtw88/main.c +3 -0
@@ -1483,6 +1483,8 @@ void rtw_core_scan_start(struct rtw_dev *rtwdev, struct rtw_vif *rtwvif,set_bit (RTW_FLAG_DIG_DISABLE , rtwdev->flags);set_bit (RTW_FLAG_SCANNING , rtwdev->flags); + +rtw_phy_dig_set_max_coverage (rtwdev); } void rtw_core_scan_complete(struct rtw_dev *rtwdev, struct ieee80211_vif *vif,
@@ -1494,6 +1496,7 @@ void rtw_core_scan_complete(struct rtw_dev *rtwdev, struct ieee80211_vif *vif,if (!rtwvif)return ; +rtw_phy_dig_reset (rtwdev);clear_bit (RTW_FLAG_SCANNING , rtwdev->flags);clear_bit (RTW_FLAG_DIG_DISABLE , rtwdev->flags);
drivers/net/wireless/realtek/rtw88/phy.c +20 -0
@@ -370,6 +370,26 @@ static void rtw_phy_statistics(struct rtw_dev *rtwdev)#define DIG_CVRG_MIN 0x1c#define DIG_RSSI_GAIN_OFFSET 15 +void rtw_phy_dig_set_max_coverage (struct rtw_dev *rtwdev) +{ +/* Lower values result in greater coverage. */ +rtw_dbg (rtwdev,RTW_DBG_PHY ,"Setting IGI=%#x for max coverage\n" , +DIG_CVRG_MIN ); + +rtw_phy_dig_write (rtwdev,DIG_CVRG_MIN ); +} + +void rtw_phy_dig_reset (struct rtw_dev *rtwdev) +{ +struct rtw_dm_info *dm_info = &rtwdev->dm_info; +u8 last_igi; + + last_igi = dm_info->igi_history[0 ]; +rtw_dbg (rtwdev,RTW_DBG_PHY ,"Resetting IGI=%#x\n" , last_igi); + +rtw_phy_dig_write (rtwdev, last_igi); +} +static bool rtw_phy_dig_check_damping (struct rtw_dm_info *dm_info) {
drivers/net/wireless/realtek/rtw88/phy.h +2 -0
@@ -146,6 +146,8 @@ static inline int rtw_check_supported_rfe(struct rtw_dev *rtwdev) }void rtw_phy_dig_write (struct rtw_dev *rtwdev,u8 igi); +void rtw_phy_dig_reset (struct rtw_dev *rtwdev); +void rtw_phy_dig_set_max_coverage (struct rtw_dev *rtwdev);struct rtw_power_params {u8 pwr_base;
Signature · 1 line
2.51.1
Quoted 6 lines · Bitterblue Smith
From: Martin Hrůza <[email protected]>
The driver reduces the RX gain while connected to a network located close by. In this condition scans return few results because the more distant networks can't be heard.
Quoted 7 lines
Temporarily increase the RX gain before scanning in order to detect all available networks. Reset the RX gain back to the last recorded value once the scan finishes.
Signed-off-by Martin Hrůza <[email protected]>Signed-off-by Bitterblue Smith <[email protected]>
Ping-Ke Shih
maintainerQuoted 6 lines · Bitterblue Smith
From: Martin Hrůza <[email protected]>
The driver reduces the RX gain while connected to a network located close by. In this condition scans return few results because the more distant networks can't be heard.
Quoted 8 lines
Temporarily increase the RX gain before scanning in order to detect all available networks. Reset the RX gain back to the last recorded value once the scan finishes.
Signed-off-by Martin Hrůza <[email protected]>Signed-off-by Bitterblue Smith <[email protected]>Acked-by Ping-Ke Shih <[email protected]>
1 patch(es) applied to rtw-next branch of rtw.git, thanks.
3f90942473d2 wifi: rtw88: Increase the RX gain before scanning