|
@@ -883,6 +883,7 @@ cfg80211_inform_bss_width(struct wiphy *wiphy,
|
|
|
struct cfg80211_bss_ies *ies;
|
|
|
struct ieee80211_channel *channel;
|
|
|
struct cfg80211_internal_bss tmp = {}, *res;
|
|
|
+ bool signal_valid;
|
|
|
|
|
|
if (WARN_ON(!wiphy))
|
|
|
return NULL;
|
|
@@ -919,8 +920,9 @@ cfg80211_inform_bss_width(struct wiphy *wiphy,
|
|
|
rcu_assign_pointer(tmp.pub.beacon_ies, ies);
|
|
|
rcu_assign_pointer(tmp.pub.ies, ies);
|
|
|
|
|
|
- res = cfg80211_bss_update(wiphy_to_rdev(wiphy), &tmp,
|
|
|
- rx_channel == channel);
|
|
|
+ signal_valid = abs(rx_channel->center_freq - channel->center_freq) <=
|
|
|
+ wiphy->max_adj_channel_rssi_comp;
|
|
|
+ res = cfg80211_bss_update(wiphy_to_rdev(wiphy), &tmp, signal_valid);
|
|
|
if (!res)
|
|
|
return NULL;
|
|
|
|
|
@@ -944,6 +946,7 @@ cfg80211_inform_bss_width_frame(struct wiphy *wiphy,
|
|
|
struct cfg80211_internal_bss tmp = {}, *res;
|
|
|
struct cfg80211_bss_ies *ies;
|
|
|
struct ieee80211_channel *channel;
|
|
|
+ bool signal_valid;
|
|
|
size_t ielen = len - offsetof(struct ieee80211_mgmt,
|
|
|
u.probe_resp.variable);
|
|
|
|
|
@@ -991,8 +994,9 @@ cfg80211_inform_bss_width_frame(struct wiphy *wiphy,
|
|
|
tmp.pub.beacon_interval = le16_to_cpu(mgmt->u.probe_resp.beacon_int);
|
|
|
tmp.pub.capability = le16_to_cpu(mgmt->u.probe_resp.capab_info);
|
|
|
|
|
|
- res = cfg80211_bss_update(wiphy_to_rdev(wiphy), &tmp,
|
|
|
- rx_channel == channel);
|
|
|
+ signal_valid = abs(rx_channel->center_freq - channel->center_freq) <=
|
|
|
+ wiphy->max_adj_channel_rssi_comp;
|
|
|
+ res = cfg80211_bss_update(wiphy_to_rdev(wiphy), &tmp, signal_valid);
|
|
|
if (!res)
|
|
|
return NULL;
|
|
|
|