summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Papp <lpapp@kde.org>2013-11-23 21:49:33 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-25 16:21:00 +0100
commite0be9ed761e730bec7b26bcaba014f028f6340d0 (patch)
tree3935d2056adfc339813eea802e33a02ec6dd2440
parentdc4e899a26cbdfdca7a74871537b83b8dc0bb45f (diff)
Fix the detection of PCI serial ports with sysfs and without udevv5.2.0-rc1
Unfortunately, 0973537c5471288726b929250199a41435729bee caused a serious regression for obtaining detecting PCI serial ports without udev. This was working before since the hard coded fallback mechanism has been up to this task, but the sysfs alternative took the precedence over. A note has also been added to the udev part of the algorithm because we will need to obtain the vendor and product identifiers in a separate block in the future. The vid/pid will be fixed in a separate change once that is well-tested. This patch has no any risk as far as I can tell since it is just adding a new short block to the existing code without much implication. I have tested the change on Linux for my use cases with Qt 4 and then 5, and I cannot find any regression. Everything works as expected both with udev and without, i.e. with sysfs. Thanks go to Aaron Linville for reporting the issue. Task-number: QTBUG-35064 Change-Id: Ieae6f3e94559fb61ede67ff1d8810bb686d46383 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Aaron Linville <aaron@linville.org>
-rw-r--r--dist/changes-5.2.03
-rw-r--r--src/serialport/qserialportinfo_unix.cpp4
2 files changed, 7 insertions, 0 deletions
diff --git a/dist/changes-5.2.0 b/dist/changes-5.2.0
index 20fd35cd..7f3e4c27 100644
--- a/dist/changes-5.2.0
+++ b/dist/changes-5.2.0
@@ -121,3 +121,6 @@ information. /dev/ttyO* (native OMAP UART) is supported by that backend.
- The lock file usage has been extended to support Android as there is no direct
access to the usual Unix lock file system paths. The lock file is now placed
into /data/local/tmp.
+
+- [QTBUG-35064] PCI support has been added to the sysfs backend on Linux to
+support the enumeration of such devices.
diff --git a/src/serialport/qserialportinfo_unix.cpp b/src/serialport/qserialportinfo_unix.cpp
index 971a904b..1ac40fdd 100644
--- a/src/serialport/qserialportinfo_unix.cpp
+++ b/src/serialport/qserialportinfo_unix.cpp
@@ -186,6 +186,8 @@ QList<QSerialPortInfo> QSerialPortInfo::availablePorts()
}
} while (targetDir.cdUp());
+ } else if (targetPath.contains(QStringLiteral("pci"))) {
+ // TODO: Obtain more information about the device
} else {
// unknown types of devices
canAppendToList = false;
@@ -287,6 +289,8 @@ QList<QSerialPortInfo> QSerialPortInfo::availablePorts()
// Skip this devices because this type of subsystem does
// not include a real physical serial device.
canAppendToList = false;
+ } else if (subsys == QStringLiteral("pci")) {
+ // TODO: Obtain more information about the device
} else { // Others types of subsystems.
// Append this devices because we believe that any other types of
// subsystems provide a real serial devices. For example, for devices