Commit 33d4a577 authored by Ajay Singh's avatar Ajay Singh Committed by Kalle Valo
Browse files

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: default avatarAjay Singh <ajay.kathat@microchip.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220720160302.231516-4-ajay.kathat@microchip.com
parent f589b5d9
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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;
}