]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: rtw89: wow: add scan interval option for net-detect
authorChin-Yen Lee <timlee@realtek.com>
Mon, 26 Aug 2024 09:04:39 +0000 (17:04 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Mon, 2 Sep 2024 01:15:02 +0000 (09:15 +0800)
The scan interval option is the period in unit of second for WoWLAN
firmware to do each scan. We get the option from cfg80211 and practice it.
If the interval is too short for firmware to finish one scan, the firmware
will start next scan immediately after finishing one and the WiFi chip
could never enter idle mode to reduce power consumption.

Signed-off-by: Chin-Yen Lee <timlee@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20240826090439.17242-5-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/wow.c

index 0f0f4beec4d9667c1cbc306a512ba8b83296ae96..86e24e07780d9b9eacb86a4ac4d5d770c20b07d5 100644 (file)
@@ -1438,6 +1438,7 @@ static int rtw89_pno_scan_offload(struct rtw89_dev *rtwdev, bool enable)
        struct rtw89_wow_param *rtw_wow = &rtwdev->wow;
        struct ieee80211_vif *wow_vif = rtw_wow->wow_vif;
        struct rtw89_vif *rtwvif = (struct rtw89_vif *)wow_vif->drv_priv;
+       int interval = rtw_wow->nd_config->scan_plans[0].interval;
        struct rtw89_scan_option opt = {};
        int ret;
 
@@ -1457,7 +1458,7 @@ static int rtw89_pno_scan_offload(struct rtw89_dev *rtwdev, bool enable)
 
        opt.enable = enable;
        opt.repeat = RTW89_SCAN_NORMAL;
-       opt.norm_pd = 10; /* in unit of 100ms */
+       opt.norm_pd = max(interval, 1) * 10; /* in unit of 100ms */
        opt.delay = max(rtw_wow->nd_config->delay, 1);
 
        if (rtwdev->chip->chip_gen == RTW89_CHIP_BE) {