With 2.6.30 kernels we get either a [0..100] or a [0..70] signal quality
range, with most of the mac80211 drivers being on the [0..70] case.
Unfortunately, this is not compatible with older kernels. The only way to fix
this would be to either fix wpa_s to pass the quality and level ranges with
the scan results, or to implement the SIOCGIWRANGE ioctl from connman.
Marcel, which way would suit you better ? The wpa_s solution would be much
more elegant (range with scan results, or implement a custom dbus call for
getting the driver's range) but would take longer until we'd be able to
upgrade to a working wpa_supplicant.
---
plugins/supplicant.c | 18 ++++--------------
1 files changed, 4 insertions(+), 14 deletions(-)
diff --git a/plugins/supplicant.c b/plugins/supplicant.c
index 5a68231..0c8e212 100644
--- a/plugins/supplicant.c
+++ b/plugins/supplicant.c
@@ -1018,21 +1018,11 @@ static void extract_capabilites(DBusMessageIter *value,
static unsigned char calculate_strength(struct supplicant_result *result)
{
- if (result->quality < 0) {
- unsigned char strength;
+ if (result->quality == result->level)
+ return result->quality;
- if (result->level > 0)
- strength = 100 - result->level;
- else
- strength = 120 + result->level;
-
- if (strength > 100)
- strength = 100;
-
- return strength;
- }
-
- return result->quality;
+ /* Quality range will be 0..70 */
+ return (result->quality * 100) / 70;
}
static unsigned short calculate_channel(struct supplicant_result *result)
--
1.6.3.1
--
Intel Open Source Technology Centre
http://oss.intel.com/
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman