[kernel/f17] Fix device misprobe for Gobi devices (rhbz 829880)
Josh Boyer
jwboyer at fedoraproject.org
Thu Jul 5 17:58:48 UTC 2012
commit 1e9cc93abf6afc2e3ac1fdb4cea7474867115bf6
Author: Josh Boyer <jwboyer at redhat.com>
Date: Thu Jul 5 13:58:22 2012 -0400
Fix device misprobe for Gobi devices (rhbz 829880)
USB-qmi_wwan-Add-ZTE-Vodafone-K3520-Z.patch | 54 ++++++
..._wwan-Make-forced-int-4-whitelist-generic.patch | 47 +++++
kernel.spec | 11 +
net-qmi_wwan-fix-Gobi-device-probing.patch | 194 ++++++++++++++++++++
4 files changed, 306 insertions(+), 0 deletions(-)
---
diff --git a/USB-qmi_wwan-Add-ZTE-Vodafone-K3520-Z.patch b/USB-qmi_wwan-Add-ZTE-Vodafone-K3520-Z.patch
new file mode 100644
index 0000000..9ce05cc
--- /dev/null
+++ b/USB-qmi_wwan-Add-ZTE-Vodafone-K3520-Z.patch
@@ -0,0 +1,54 @@
+From f7142e6c226076fd40c2ebaad9fb0c9a631b790e Mon Sep 17 00:00:00 2001
+From: "Andrew Bird (Sphere Systems)" <ajb at spheresystems.co.uk>
+Date: Sat, 19 May 2012 22:28:38 +0000
+Subject: [PATCH] USB: qmi_wwan: Add ZTE (Vodafone) K3520-Z
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Andrew Bird <ajb at spheresystems.co.uk>
+Acked-by: Bjørn Mork <bjorn at mork.no>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/usb/qmi_wwan.c | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+
+diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
+index b381368..63cfd0b 100644
+--- a/drivers/net/usb/qmi_wwan.c
++++ b/drivers/net/usb/qmi_wwan.c
+@@ -356,6 +356,15 @@ static const struct driver_info qmi_wwan_gobi = {
+ };
+
+ /* ZTE suck at making USB descriptors */
++static const struct driver_info qmi_wwan_force_int1 = {
++ .description = "Qualcomm WWAN/QMI device",
++ .flags = FLAG_WWAN,
++ .bind = qmi_wwan_bind_shared,
++ .unbind = qmi_wwan_unbind_shared,
++ .manage_power = qmi_wwan_manage_power,
++ .data = BIT(1), /* interface whitelist bitmap */
++};
++
+ static const struct driver_info qmi_wwan_force_int4 = {
+ .description = "Qualcomm WWAN/QMI device",
+ .flags = FLAG_WWAN,
+@@ -438,6 +447,15 @@ static const struct usb_device_id products[] = {
+ .bInterfaceProtocol = 0xff,
+ .driver_info = (unsigned long)&qmi_wwan_force_int4,
+ },
++ { /* ZTE (Vodafone) K3520-Z */
++ .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
++ .idVendor = 0x19d2,
++ .idProduct = 0x0055,
++ .bInterfaceClass = 0xff,
++ .bInterfaceSubClass = 0xff,
++ .bInterfaceProtocol = 0xff,
++ .driver_info = (unsigned long)&qmi_wwan_force_int1,
++ },
+ { /* ZTE (Vodafone) K3565-Z */
+ .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
+ .idVendor = 0x19d2,
+--
+1.7.10.2
+
diff --git a/USB-qmi_wwan-Make-forced-int-4-whitelist-generic.patch b/USB-qmi_wwan-Make-forced-int-4-whitelist-generic.patch
new file mode 100644
index 0000000..87e84a0
--- /dev/null
+++ b/USB-qmi_wwan-Make-forced-int-4-whitelist-generic.patch
@@ -0,0 +1,47 @@
+From 00001880cd8faaa349fe2ebb158f7e0cd8026048 Mon Sep 17 00:00:00 2001
+From: "Andrew Bird (Sphere Systems)" <ajb at spheresystems.co.uk>
+Date: Sat, 19 May 2012 22:28:36 +0000
+Subject: [PATCH] USB: qmi_wwan: Make forced int 4 whitelist generic
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Change the forced interface 4 whitelist to use the generic shared
+binder instead of the Gobi specific one. Certain ZTE devices
+(K3520-Z & K3765-Z) don't work with the Gobi version, but function
+quite happily with the generic. This has been tested with the following
+devices:
+K3520-Z
+K3565-Z
+K3765-Z
+K4505-Z
+It hasn't been tested with the ZTE MF820D, which is the only other
+device that uses this whitelist at present. Although Bjorn doesn't
+expect any problems, any testing with that device would be appreciated.
+
+Signed-off-by: Andrew Bird <ajb at spheresystems.co.uk>
+Acked-by: Bjørn Mork <bjorn at mork.no>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/usb/qmi_wwan.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
+index fc1ebef..a0fee0d 100644
+--- a/drivers/net/usb/qmi_wwan.c
++++ b/drivers/net/usb/qmi_wwan.c
+@@ -357,9 +357,9 @@ static const struct driver_info qmi_wwan_gobi = {
+
+ /* ZTE suck at making USB descriptors */
+ static const struct driver_info qmi_wwan_force_int4 = {
+- .description = "Qualcomm Gobi wwan/QMI device",
++ .description = "Qualcomm WWAN/QMI device",
+ .flags = FLAG_WWAN,
+- .bind = qmi_wwan_bind_gobi,
++ .bind = qmi_wwan_bind_shared,
+ .unbind = qmi_wwan_unbind_shared,
+ .manage_power = qmi_wwan_manage_power,
+ .data = BIT(4), /* interface whitelist bitmap */
+--
+1.7.10.2
+
diff --git a/kernel.spec b/kernel.spec
index 83b71bd..e76a768 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -813,6 +813,11 @@ Patch22044: tg3-Apply-short-DMA-frag-workaround-to-5906.patch
#rhbz 830359
Patch22045: drm-nouveau-fbcon-using-nv_two_heads-is-not-a-good-i.patch
+#rhbz 829880
+Patch22046: USB-qmi_wwan-Make-forced-int-4-whitelist-generic.patch
+Patch22047: USB-qmi_wwan-Add-ZTE-Vodafone-K3520-Z.patch
+Patch22048: net-qmi_wwan-fix-Gobi-device-probing.patch
+
# END OF PATCH DEFINITIONS
%endif
@@ -1564,6 +1569,11 @@ ApplyPatch tg3-Apply-short-DMA-frag-workaround-to-5906.patch
#rhbz 830359
ApplyPatch drm-nouveau-fbcon-using-nv_two_heads-is-not-a-good-i.patch
+#rhbz 829880
+ApplyPatch USB-qmi_wwan-Make-forced-int-4-whitelist-generic.patch
+ApplyPatch USB-qmi_wwan-Add-ZTE-Vodafone-K3520-Z.patch
+ApplyPatch net-qmi_wwan-fix-Gobi-device-probing.patch
+
# END OF PATCH APPLICATIONS
%endif
@@ -2425,6 +2435,7 @@ fi
# '-'
%changelog
* Thu Jul 05 2012 Josh Boyer <jwboyer at redhat.com>
+- Fix device misprobe for Gobi devices (rhbz 829880)
- Fix breakage in nouveau with nv_two_heads (rhbz 830359)
- Apply patch to fix tg3 watchdog hangs on BCM5906 devices (rhbz 825123)
- Move sch_htb module into main kernel package (rhbz 836185)
diff --git a/net-qmi_wwan-fix-Gobi-device-probing.patch b/net-qmi_wwan-fix-Gobi-device-probing.patch
new file mode 100644
index 0000000..9dce14f
--- /dev/null
+++ b/net-qmi_wwan-fix-Gobi-device-probing.patch
@@ -0,0 +1,194 @@
+From b9f90eb2740203ff2592efe640409ad48335d1c2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <bjorn at mork.no>
+Date: Thu, 21 Jun 2012 02:45:58 +0000
+Subject: [PATCH] net: qmi_wwan: fix Gobi device probing
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Ignoring interfaces with additional descriptors is not a reliable
+method for locating the correct interface on Gobi devices. There
+is at least one device where this method fails:
+https://bbs.archlinux.org/viewtopic.php?id=143506
+
+The result is that the AT command port (interface #2) is hidden
+from qcserial, preventing traditional serial modem usage:
+
+[ 15.562552] qmi_wwan 4-1.6:1.0: cdc-wdm0: USB WDM device
+[ 15.562691] qmi_wwan 4-1.6:1.0: wwan0: register 'qmi_wwan' at usb-0000:00:1d.0-1.6, Qualcomm Gobi wwan/QMI device, 1e:df:3c:3a:4e:3b
+[ 15.563383] qmi_wwan: probe of 4-1.6:1.1 failed with error -22
+[ 15.564189] qmi_wwan 4-1.6:1.2: cdc-wdm1: USB WDM device
+[ 15.564302] qmi_wwan 4-1.6:1.2: wwan1: register 'qmi_wwan' at usb-0000:00:1d.0-1.6, Qualcomm Gobi wwan/QMI device, 1e:df:3c:3a:4e:3b
+[ 15.564328] qmi_wwan: probe of 4-1.6:1.3 failed with error -22
+[ 15.569376] qcserial 4-1.6:1.1: Qualcomm USB modem converter detected
+[ 15.569440] usb 4-1.6: Qualcomm USB modem converter now attached to ttyUSB0
+[ 15.570372] qcserial 4-1.6:1.3: Qualcomm USB modem converter detected
+[ 15.570430] usb 4-1.6: Qualcomm USB modem converter now attached to ttyUSB1
+
+Use static interface numbers taken from the interface map in
+qcserial for all Gobi devices instead:
+
+ Gobi 1K USB layout:
+ 0: serial port (doesn't respond)
+ 1: serial port (doesn't respond)
+ 2: AT-capable modem port
+ 3: QMI/net
+
+ Gobi 2K+ USB layout:
+ 0: QMI/net
+ 1: DM/DIAG (use libqcdm from ModemManager for communication)
+ 2: AT-capable modem port
+ 3: NMEA
+
+This should be more reliable over all, and will also prevent the
+noisy "probe failed" messages. The whitelisting logic is expected
+to be replaced by direct interface number matching in 3.6.
+
+Reported-by: Heinrich Siebmanns (Harvey) <H.Siebmanns at t-online.de>
+Cc: <stable at vger.kernel.org> # v3.4: 0000188 USB: qmi_wwan: Make forced int 4 whitelist generic
+Cc: <stable at vger.kernel.org> # v3.4: f7142e6 USB: qmi_wwan: Add ZTE (Vodafone) K3520-Z
+Cc: <stable at vger.kernel.org> # v3.4
+Signed-off-by: Bjørn Mork <bjorn at mork.no>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/usb/qmi_wwan.c | 83 +++++++++++++++++++++-----------------------
+ 1 file changed, 40 insertions(+), 43 deletions(-)
+
+diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
+index 3b20678..3767a12 100644
+--- a/drivers/net/usb/qmi_wwan.c
++++ b/drivers/net/usb/qmi_wwan.c
+@@ -257,29 +257,6 @@ err:
+ return rv;
+ }
+
+-/* Gobi devices uses identical class/protocol codes for all interfaces regardless
+- * of function. Some of these are CDC ACM like and have the exact same endpoints
+- * we are looking for. This leaves two possible strategies for identifying the
+- * correct interface:
+- * a) hardcoding interface number, or
+- * b) use the fact that the wwan interface is the only one lacking additional
+- * (CDC functional) descriptors
+- *
+- * Let's see if we can get away with the generic b) solution.
+- */
+-static int qmi_wwan_bind_gobi(struct usbnet *dev, struct usb_interface *intf)
+-{
+- int rv = -EINVAL;
+-
+- /* ignore any interface with additional descriptors */
+- if (intf->cur_altsetting->extralen)
+- goto err;
+-
+- rv = qmi_wwan_bind_shared(dev, intf);
+-err:
+- return rv;
+-}
+-
+ static void qmi_wwan_unbind_shared(struct usbnet *dev, struct usb_interface *intf)
+ {
+ struct usb_driver *subdriver = (void *)dev->data[0];
+@@ -347,15 +324,15 @@ static const struct driver_info qmi_wwan_shared = {
+ .manage_power = qmi_wwan_manage_power,
+ };
+
+-static const struct driver_info qmi_wwan_gobi = {
+- .description = "Qualcomm Gobi wwan/QMI device",
++static const struct driver_info qmi_wwan_force_int0 = {
++ .description = "Qualcomm WWAN/QMI device",
+ .flags = FLAG_WWAN,
+- .bind = qmi_wwan_bind_gobi,
++ .bind = qmi_wwan_bind_shared,
+ .unbind = qmi_wwan_unbind_shared,
+ .manage_power = qmi_wwan_manage_power,
++ .data = BIT(0), /* interface whitelist bitmap */
+ };
+
+-/* ZTE suck at making USB descriptors */
+ static const struct driver_info qmi_wwan_force_int1 = {
+ .description = "Qualcomm WWAN/QMI device",
+ .flags = FLAG_WWAN,
+@@ -365,6 +342,15 @@ static const struct driver_info qmi_wwan_force_int1 = {
+ .data = BIT(1), /* interface whitelist bitmap */
+ };
+
++static const struct driver_info qmi_wwan_force_int3 = {
++ .description = "Qualcomm WWAN/QMI device",
++ .flags = FLAG_WWAN,
++ .bind = qmi_wwan_bind_shared,
++ .unbind = qmi_wwan_unbind_shared,
++ .manage_power = qmi_wwan_manage_power,
++ .data = BIT(3), /* interface whitelist bitmap */
++};
++
+ static const struct driver_info qmi_wwan_force_int4 = {
+ .description = "Qualcomm WWAN/QMI device",
+ .flags = FLAG_WWAN,
+@@ -390,16 +376,23 @@ static const struct driver_info qmi_wwan_force_int4 = {
+ static const struct driver_info qmi_wwan_sierra = {
+ .description = "Sierra Wireless wwan/QMI device",
+ .flags = FLAG_WWAN,
+- .bind = qmi_wwan_bind_gobi,
++ .bind = qmi_wwan_bind_shared,
+ .unbind = qmi_wwan_unbind_shared,
+ .manage_power = qmi_wwan_manage_power,
+ .data = BIT(8) | BIT(19), /* interface whitelist bitmap */
+ };
+
+ #define HUAWEI_VENDOR_ID 0x12D1
++
++/* Gobi 1000 QMI/wwan interface number is 3 according to qcserial */
++#define QMI_GOBI1K_DEVICE(vend, prod) \
++ USB_DEVICE(vend, prod), \
++ .driver_info = (unsigned long)&qmi_wwan_force_int3
++
++/* Gobi 2000 and Gobi 3000 QMI/wwan interface number is 0 according to qcserial */
+ #define QMI_GOBI_DEVICE(vend, prod) \
+ USB_DEVICE(vend, prod), \
+- .driver_info = (unsigned long)&qmi_wwan_gobi
++ .driver_info = (unsigned long)&qmi_wwan_force_int0
+
+ static const struct usb_device_id products[] = {
+ { /* Huawei E392, E398 and possibly others sharing both device id and more... */
+@@ -510,20 +503,24 @@ static const struct usb_device_id products[] = {
+ .bInterfaceProtocol = 0xff,
+ .driver_info = (unsigned long)&qmi_wwan_sierra,
+ },
+- {QMI_GOBI_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
+- {QMI_GOBI_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */
+- {QMI_GOBI_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */
+- {QMI_GOBI_DEVICE(0x04da, 0x250d)}, /* Panasonic Gobi Modem device */
+- {QMI_GOBI_DEVICE(0x413c, 0x8172)}, /* Dell Gobi Modem device */
+- {QMI_GOBI_DEVICE(0x1410, 0xa001)}, /* Novatel Gobi Modem device */
+- {QMI_GOBI_DEVICE(0x0b05, 0x1776)}, /* Asus Gobi Modem device */
+- {QMI_GOBI_DEVICE(0x19d2, 0xfff3)}, /* ONDA Gobi Modem device */
+- {QMI_GOBI_DEVICE(0x05c6, 0x9001)}, /* Generic Gobi Modem device */
+- {QMI_GOBI_DEVICE(0x05c6, 0x9002)}, /* Generic Gobi Modem device */
+- {QMI_GOBI_DEVICE(0x05c6, 0x9202)}, /* Generic Gobi Modem device */
+- {QMI_GOBI_DEVICE(0x05c6, 0x9203)}, /* Generic Gobi Modem device */
+- {QMI_GOBI_DEVICE(0x05c6, 0x9222)}, /* Generic Gobi Modem device */
+- {QMI_GOBI_DEVICE(0x05c6, 0x9009)}, /* Generic Gobi Modem device */
++
++ /* Gobi 1000 devices */
++ {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
++ {QMI_GOBI1K_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */
++ {QMI_GOBI1K_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */
++ {QMI_GOBI1K_DEVICE(0x04da, 0x250d)}, /* Panasonic Gobi Modem device */
++ {QMI_GOBI1K_DEVICE(0x413c, 0x8172)}, /* Dell Gobi Modem device */
++ {QMI_GOBI1K_DEVICE(0x1410, 0xa001)}, /* Novatel Gobi Modem device */
++ {QMI_GOBI1K_DEVICE(0x0b05, 0x1776)}, /* Asus Gobi Modem device */
++ {QMI_GOBI1K_DEVICE(0x19d2, 0xfff3)}, /* ONDA Gobi Modem device */
++ {QMI_GOBI1K_DEVICE(0x05c6, 0x9001)}, /* Generic Gobi Modem device */
++ {QMI_GOBI1K_DEVICE(0x05c6, 0x9002)}, /* Generic Gobi Modem device */
++ {QMI_GOBI1K_DEVICE(0x05c6, 0x9202)}, /* Generic Gobi Modem device */
++ {QMI_GOBI1K_DEVICE(0x05c6, 0x9203)}, /* Generic Gobi Modem device */
++ {QMI_GOBI1K_DEVICE(0x05c6, 0x9222)}, /* Generic Gobi Modem device */
++ {QMI_GOBI1K_DEVICE(0x05c6, 0x9009)}, /* Generic Gobi Modem device */
++
++ /* Gobi 2000 and 3000 devices */
+ {QMI_GOBI_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */
+ {QMI_GOBI_DEVICE(0x05c6, 0x920b)}, /* Generic Gobi 2000 Modem device */
+ {QMI_GOBI_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */
+--
+1.7.10.2
+
More information about the scm-commits
mailing list