--- zzzz-none-000/linux-4.9.231/net/wireless/scan.c 2020-07-22 07:10:54.000000000 +0000 +++ falcon-5530-730/linux-4.9.231/net/wireless/scan.c 2022-08-31 08:19:49.000000000 +0000 @@ -70,8 +70,6 @@ MODULE_PARM_DESC(bss_entries_limit, "limit to number of scan BSS entries (per wiphy, default 1000)"); -#define IEEE80211_SCAN_RESULT_EXPIRE (30 * HZ) - static void bss_free(struct cfg80211_internal_bss *bss) { struct cfg80211_bss_ies *ies; @@ -400,7 +398,7 @@ void cfg80211_bss_expire(struct cfg80211_registered_device *rdev) { - __cfg80211_bss_expire(rdev, jiffies - IEEE80211_SCAN_RESULT_EXPIRE); + __cfg80211_bss_expire(rdev, jiffies - rdev->scan_expire_time); } const u8 *cfg80211_find_ie_match(u8 eid, const u8 *ies, int len, @@ -659,7 +657,7 @@ if (!is_valid_ether_addr(bss->pub.bssid)) continue; /* Don't get expired BSS structs */ - if (time_after(now, bss->ts + IEEE80211_SCAN_RESULT_EXPIRE) && + if (time_after(now, bss->ts + rdev->scan_expire_time) && !atomic_read(&bss->hold)) continue; if (is_bss(&bss->pub, bssid, ssid, ssid_len)) { @@ -1269,6 +1267,22 @@ } EXPORT_SYMBOL(cfg80211_unlink_bss); +void cfg80211_set_scan_expire_time(struct wiphy *wiphy, unsigned long time) +{ + struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); + + rdev->scan_expire_time = time; +} +EXPORT_SYMBOL(cfg80211_set_scan_expire_time); + +u32 cfg80211_get_scan_expire_time(struct wiphy *wiphy) +{ + struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); + + return rdev->scan_expire_time; +} +EXPORT_SYMBOL(cfg80211_get_scan_expire_time); + #ifdef CONFIG_CFG80211_WEXT static struct cfg80211_registered_device * cfg80211_get_dev_from_ifindex(struct net *net, int ifindex)