diff options
| author | Sebastien Bacher <seb128@ubuntu.com> | 2020-05-19 16:38:36 +0200 |
|---|---|---|
| committer | Sebastien Bacher <seb128@ubuntu.com> | 2020-05-19 17:09:07 +0200 |
| commit | ccf6dc06bbee82c3d49f451545c5317337e0777e (patch) | |
| tree | a8fddc8c6e2b3b99bebab1d5bb2a64581eff4bfd /src/devices/wifi/nm-wifi-utils.c | |
| parent | f109e55ef130ce84054d5ba3acf4b71cd8c7564a (diff) | |
| parent | 7ffed1e6136de75188f10ba8763bcb942f932f8e (diff) | |
Merge remote-tracking branch 'salsa/debian/master' into ubuntu/master
Diffstat (limited to 'src/devices/wifi/nm-wifi-utils.c')
| -rw-r--r-- | src/devices/wifi/nm-wifi-utils.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/src/devices/wifi/nm-wifi-utils.c b/src/devices/wifi/nm-wifi-utils.c index b9b7ec42..0903dc8b 100644 --- a/src/devices/wifi/nm-wifi-utils.c +++ b/src/devices/wifi/nm-wifi-utils.c @@ -759,6 +759,12 @@ nm_wifi_utils_complete_connection (GBytes *ap_ssid, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "sae", NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "open", NULL); + } else if ( (key_mgmt && !strcmp (key_mgmt, "owe")) + || (ap_rsn_flags & NM_802_11_AP_SEC_KEY_MGMT_OWE)) { + g_object_set (s_wsec, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "owe", + NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "open", + NULL); } else if ( (key_mgmt && !strcmp (key_mgmt, "wpa-psk")) || (ap_wpa_flags & NM_802_11_AP_SEC_KEY_MGMT_PSK) || (ap_rsn_flags & NM_802_11_AP_SEC_KEY_MGMT_PSK)) { @@ -780,25 +786,6 @@ nm_wifi_utils_complete_connection (GBytes *ap_ssid, return TRUE; } -guint32 -nm_wifi_utils_level_to_quality (int val) -{ - if (val < 0) { - /* Assume dBm already; rough conversion: best = -40, worst = -100 */ - val = abs (CLAMP (val, -100, -40) + 40); /* normalize to 0 */ - val = 100 - (int) ((100.0 * (double) val) / 60.0); - } else if (val > 110 && val < 256) { - /* assume old-style WEXT 8-bit unsigned signal level */ - val -= 256; /* subtract 256 to convert to dBm */ - val = abs (CLAMP (val, -100, -40) + 40); /* normalize to 0 */ - val = 100 - (int) ((100.0 * (double) val) / 60.0); - } else { - /* Assume signal is a "quality" percentage */ - } - - return CLAMP (val, 0, 100); -} - gboolean nm_wifi_utils_is_manf_default_ssid (GBytes *ssid) { |