diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-11-05 13:42:15 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-11-05 13:42:15 (GMT) |
commit | 84c519862aa3a089471af6fd2174b16a88c10844 (patch) | |
tree | d518b86cdd5c32fc7ab415bd0c862df61f4dd138 | |
parent | ebecf192abe56c405409343acc2f97eaf9124fc3 (diff) | |
parent | 763f3acd879648648465475aef773fe0876934a9 (diff) | |
download | Qt-84c519862aa3a089471af6fd2174b16a88c10844.zip Qt-84c519862aa3a089471af6fd2174b16a88c10844.tar.gz Qt-84c519862aa3a089471af6fd2174b16a88c10844.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-s60-public into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-s60-public:
Prevent multiple modprobe messages for the same phone
Fix detection of N95 with linux 2.6.34+
-rw-r--r-- | tools/runonphone/serenum_unix.cpp | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/tools/runonphone/serenum_unix.cpp b/tools/runonphone/serenum_unix.cpp index db6375e..f5b2521 100644 --- a/tools/runonphone/serenum_unix.cpp +++ b/tools/runonphone/serenum_unix.cpp @@ -100,7 +100,7 @@ QList<SerialPortId> enumerateSerialPorts(int loglevel) // data transmission. // the extra info stores that as a index for the interface if (buf[0] >= 5 && buf[1] == 36 && buf[2] == 6) { // CDC Union - for (int i = 4; i < buf[0]; i++) + for (int i = 3; i < buf[0]; i++) usableInterfaces.append((int) buf[i]); } size -= buf[0]; @@ -146,32 +146,17 @@ QList<SerialPortId> enumerateSerialPorts(int loglevel) // second loop to find the actual data interface. foreach (int i, usableInterfaces) { - for (int m = 0; m < usbConfig.bNumInterfaces; ++m) { - for (int o = 0; o < usbConfig.interface[m].num_altsetting; ++o) { - struct usb_interface_descriptor &descriptor = usbConfig.interface[m].altsetting[o]; - if (descriptor.bInterfaceNumber != i) - continue; - if (descriptor.bInterfaceClass == 10) { // "CDC Data" - if (loglevel > 1) { - qDebug() << " found the data port" - << "bus:" << bus->dirname - << "device" << device->filename - << "interface" << descriptor.bInterfaceNumber; - } - // ### manufacturer and product strings are only readable as root :( - if (!manufacturerString.isEmpty() && !productString.isEmpty()) { - eligibleInterfaces << QString("usb-%1_%2-if%3") - .arg(manufacturerString.replace(QChar(' '), QChar('_'))) - .arg(productString.replace(QChar(' '), QChar('_'))) - .arg(i, 2, 16, QChar('0')); - } else { - eligibleInterfaces << QString("if%1").arg(i, 2, 16, QChar('0')); // fix! - } - eligibleInterfacesInfo << InterfaceInfo(manufacturerString, productString, device->descriptor.idVendor, device->descriptor.idProduct); - } - } + // ### manufacturer and product strings are only readable as root :( + if (!manufacturerString.isEmpty() && !productString.isEmpty()) { + eligibleInterfaces << QString("usb-%1_%2-if%3") + .arg(manufacturerString.replace(QChar(' '), QChar('_'))) + .arg(productString.replace(QChar(' '), QChar('_'))) + .arg(i, 2, 16, QChar('0')); + } else { + eligibleInterfaces << QString("if%1").arg(i, 2, 16, QChar('0')); // fix! } } + eligibleInterfacesInfo << InterfaceInfo(manufacturerString, productString, device->descriptor.idVendor, device->descriptor.idProduct); } } } |