FROMGIT: wifi: cfg80211: skip indicating signal for per-STA profile BSSs

Currently signal of the BSS entry generated from the per-STA profile
indicated as zero, but userspace may consider it as high signal
strength since 0 dBm is a valid RSSI value.

To avoid this don't report the signal to userspace when the BSS entry
created from a per-STA profile.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
Link: https://patch.msgid.link/20240904030917.3602369-3-quic_vjakkam@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 338006731
(cherry picked from commit bff93c89ab
 https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git main)
Change-Id: I321b2674470314f7ad413ddf82f2a595fdc17fac
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
This commit is contained in:
Veerendranath Jakkam 2024-09-04 08:39:16 +05:30 committed by T.J. Mercier
parent 91c873e8a2
commit 931c124949
3 changed files with 19 additions and 11 deletions

View File

@ -187,6 +187,8 @@ struct cfg80211_internal_bss {
*/ */
u8 parent_bssid[ETH_ALEN] __aligned(2); u8 parent_bssid[ETH_ALEN] __aligned(2);
enum bss_source_type bss_source;
/* must be last because of priv member */ /* must be last because of priv member */
struct cfg80211_bss pub; struct cfg80211_bss pub;
}; };

View File

@ -10438,17 +10438,21 @@ static int nl80211_send_bss(struct sk_buff *msg, struct netlink_callback *cb,
NL80211_BSS_CHAIN_SIGNAL)) NL80211_BSS_CHAIN_SIGNAL))
goto nla_put_failure; goto nla_put_failure;
switch (rdev->wiphy.signal_type) { if (intbss->bss_source != BSS_SOURCE_STA_PROFILE) {
case CFG80211_SIGNAL_TYPE_MBM: switch (rdev->wiphy.signal_type) {
if (nla_put_u32(msg, NL80211_BSS_SIGNAL_MBM, res->signal)) case CFG80211_SIGNAL_TYPE_MBM:
goto nla_put_failure; if (nla_put_u32(msg, NL80211_BSS_SIGNAL_MBM,
break; res->signal))
case CFG80211_SIGNAL_TYPE_UNSPEC: goto nla_put_failure;
if (nla_put_u8(msg, NL80211_BSS_SIGNAL_UNSPEC, res->signal)) break;
goto nla_put_failure; case CFG80211_SIGNAL_TYPE_UNSPEC:
break; if (nla_put_u8(msg, NL80211_BSS_SIGNAL_UNSPEC,
default: res->signal))
break; goto nla_put_failure;
break;
default:
break;
}
} }
switch (wdev->iftype) { switch (wdev->iftype) {

View File

@ -1862,6 +1862,7 @@ cfg80211_update_known_bss(struct cfg80211_registered_device *rdev,
known->pub.bssid_index = new->pub.bssid_index; known->pub.bssid_index = new->pub.bssid_index;
known->pub.use_for &= new->pub.use_for; known->pub.use_for &= new->pub.use_for;
known->pub.cannot_use_reasons = new->pub.cannot_use_reasons; known->pub.cannot_use_reasons = new->pub.cannot_use_reasons;
known->bss_source = new->bss_source;
return true; return true;
} }
@ -2198,6 +2199,7 @@ cfg80211_inform_single_bss_data(struct wiphy *wiphy,
IEEE80211_MAX_CHAINS); IEEE80211_MAX_CHAINS);
tmp.pub.use_for = data->use_for; tmp.pub.use_for = data->use_for;
tmp.pub.cannot_use_reasons = data->cannot_use_reasons; tmp.pub.cannot_use_reasons = data->cannot_use_reasons;
tmp.bss_source = data->bss_source;
switch (data->bss_source) { switch (data->bss_source) {
case BSS_SOURCE_MBSSID: case BSS_SOURCE_MBSSID: