QtSystemInfo fails to report a valid wlan0 connection with mako (nexus 4)

Bug #1231196 reported by Ricardo Salveti
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux-mako (Ubuntu)
Undecided
Tim Gardner
qtsystems-opensource-src (Ubuntu)
High
Timo Jyrinki

Bug Description

From src/systeminfo/linux/qnetworkinfo_linux.cpp:
===
QNetworkInfo::NetworkStatus QNetworkInfoPrivate::getNetworkStatus(QNetworkInfo::NetworkMode mode, int interface)
{
    switch (mode) {
    case QNetworkInfo::WlanMode: {
       if (interface < networkInterfaceCount(QNetworkInfo::WlanMode)) {
            QString fileName = (*WLAN_MASK()).at(0);
            fileName.chop(1);
            fileName.append(QString::number(interface));
            QFile carrier(*NETWORK_SYSFS_PATH() + fileName + QStringLiteral("/carrier"));
            if (carrier.open(QIODevice::ReadOnly)) {
                char state;
                if ((carrier.read(&state, 1) == 1) &&
                        (state == '1') &&
                        (networkSignalStrength(QNetworkInfo::WlanMode, interface) > -1)) {
                    return QNetworkInfo::HomeNetwork;
                }
            }
        }
        return QNetworkInfo::NoNetworkAvailable;
    }
===

The issue is that networkSignalStrength reports -1 with mako, as /proc/net/wireless fails to report the right signal strength for it.

Revision history for this message
Ricardo Salveti (rsalveti) wrote :

The following patch at least allows us to properly find if we have a valid network or not, even if the signal is unknown.

diff --git a/src/systeminfo/linux/qnetworkinfo_linux.cpp b/src/systeminfo/linux/qnetworkinfo_linux.cpp
index effdc93..03649c1 100644
--- a/src/systeminfo/linux/qnetworkinfo_linux.cpp
+++ b/src/systeminfo/linux/qnetworkinfo_linux.cpp
@@ -869,8 +869,7 @@ QNetworkInfo::NetworkStatus QNetworkInfoPrivate::getNetworkStatus(QNetworkInfo::
             if (carrier.open(QIODevice::ReadOnly)) {
                 char state;
                 if ((carrier.read(&state, 1) == 1) &&
- (state == '1') &&
- (networkSignalStrength(QNetworkInfo::WlanMode, interface) > -1)) {
+ (state == '1')) {
                     return QNetworkInfo::HomeNetwork;
                 }
             }

Let me also open a bug task for the kernel side.

Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

Is this something we can do now or too late for 13.10

Changed in qtsystems-opensource-src (Ubuntu):
assignee: nobody → Timo Jyrinki (timo-jyrinki)
importance: Undecided → High
Revision history for this message
Tim Gardner (timg-tpi) wrote :

The wifi driver in drivers/staging/prima/CORE/HDD/src simply does not keep statistics. For example, the wext entry point does nothing.

drivers/staging/prima/CORE/HDD/src/wlan_hdd_wext.c:
static struct iw_statistics *get_wireless_stats(struct net_device *dev)
{
   ENTER();
   return NULL;
}

Changed in linux-mako (Ubuntu):
assignee: nobody → Tim Gardner (timg-tpi)
status: New → Won't Fix
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

Adjusted and included that patch to a PPA build at ppa:canonical-qt5-edgers/qt5-daily and packaging branch.

I can confirm it fixes Network Info tab on the test app.

Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

I added it to the landing pipeline / landing asks page.

Changed in qtsystems-opensource-src (Ubuntu):
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qtsystems-opensource-src - 5.0~git20130712-0ubuntu3

---------------
qtsystems-opensource-src (5.0~git20130712-0ubuntu3) saucy; urgency=low

  * debian/patches/wlan_detect.patch
    - Fix WLAN detection (LP: #1231196)
 -- Timo Jyrinki <email address hidden> Mon, 30 Sep 2013 09:03:02 +0300

Changed in qtsystems-opensource-src (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers