wifi: rtw89: advertise missing extended scan feature
authorKuan-Chung Chen <damon.chen@realtek.com>
Thu, 22 Feb 2024 06:42:56 +0000 (14:42 +0800)
committerKalle Valo <kvalo@kernel.org>
Tue, 27 Feb 2024 14:55:12 +0000 (16:55 +0200)
Add support for random serial number in probe request and
configure channel dwell time. Advertise corresponding feature flag
NL80211_EXT_FEATURE_SCAN_RANDOM_SN and NL80211_EXT_FEATURE_SET_SCAN_DWELL.
Use the scan request duration as channel dwell time when it is
non-zero, otherwise use the default value.

Signed-off-by: Kuan-Chung Chen <damon.chen@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240222064258.59782-2-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/core.c
drivers/net/wireless/realtek/rtw89/fw.c

index f697e3d..d4bca8c 100644 (file)
@@ -4505,6 +4505,8 @@ static int rtw89_core_register_hw(struct rtw89_dev *rtwdev)
        hw->wiphy->max_remain_on_channel_duration = 1000;
 
        wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CAN_REPLACE_PTK0);
+       wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_SCAN_RANDOM_SN);
+       wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_SET_SCAN_DWELL);
 
        ret = rtw89_core_set_supported_band(rtwdev);
        if (ret) {
index 6389735..f654ad4 100644 (file)
@@ -5739,7 +5739,7 @@ int rtw89_hw_scan_add_chan_list(struct rtw89_dev *rtwdev,
                        goto out;
                }
 
-               if (req->duration_mandatory)
+               if (req->duration)
                        ch_info->period = req->duration;
                else if (channel->band == NL80211_BAND_6GHZ)
                        ch_info->period = RTW89_CHANNEL_TIME_6G +
@@ -5817,7 +5817,7 @@ int rtw89_hw_scan_add_chan_list_be(struct rtw89_dev *rtwdev,
                        goto out;
                }
 
-               if (req->duration_mandatory)
+               if (req->duration)
                        ch_info->period = req->duration;
                else if (channel->band == NL80211_BAND_6GHZ)
                        ch_info->period = RTW89_CHANNEL_TIME_6G + RTW89_DWELL_TIME_6G;