wifi: wilc1000: set station_info flag only when signal value is valid

Set station_info->filled to indicate signal level only when its value is
received successfully using wilc_get_rssi().

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220720160302.231516-4-ajay.kathat@microchip.com
This commit is contained in:
Ajay Singh 2022-07-20 16:03:04 +00:00 committed by Kalle Valo
parent f589b5d941
commit 33d4a577c7
1 changed files with 1 additions and 2 deletions

View File

@ -1312,12 +1312,11 @@ static int dump_station(struct wiphy *wiphy, struct net_device *dev,
if (idx != 0)
return -ENOENT;
sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL);
ret = wilc_get_rssi(vif, &sinfo->signal);
if (ret)
return ret;
sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL);
memcpy(mac, vif->priv.associated_bss, ETH_ALEN);
return 0;
}