mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-17 05:30:38 +01:00
nl80211: use floats for signal quality calculations
Since we're working with numbers less than one but greater than zero, we need floats. Otherwise stuff just gets clipped.
This commit is contained in:
parent
3f39e6a95f
commit
8faa032a27
1 changed files with 2 additions and 2 deletions
|
|
@ -215,8 +215,8 @@ static guint32 nl80211_mbm_to_percent (gint32 mbm)
|
|||
|
||||
mbm = CLAMP(mbm, NOISE_FLOOR_MBM, SIGNAL_MAX_MBM);
|
||||
|
||||
return 100 - 70 * ((SIGNAL_MAX_MBM - mbm) /
|
||||
(SIGNAL_MAX_MBM - NOISE_FLOOR_MBM));
|
||||
return 100 - 70 * (((float) SIGNAL_MAX_MBM - (float) mbm) /
|
||||
((float) SIGNAL_MAX_MBM - (float) NOISE_FLOOR_MBM));
|
||||
}
|
||||
|
||||
struct nl80211_bss_info {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue