2012-05-20 08:29:18

by Andrew Bird

[permalink] [raw]
Subject: [PATCH 1/3] USB: qmi_wwan: Make forced int 4 whitelist generic

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 <[email protected]>
---
drivers/net/usb/qmi_wwan.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index d316503b..62a1a43 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.5.4


2012-05-20 08:29:19

by Andrew Bird

[permalink] [raw]
Subject: [PATCH 2/3] USB: qmi_wwan: Add ZTE (Vodafone) K3765-Z

Add the ZTE (Vodafone) K3765-Z to the whitelist. This requires the
previous patch to make the whitelist with forced interface 4 generic
or the device fails to initialise. After applying this patch and
loading the Option driver without usb-modeswitch's bind all
interfaces trick, a wwan0 net interface and /dev/cdc-wdm0 device
file were created. Using Bjorn Mork's perl connection script a
connection was made to a mobile network using QMI and the network
interface's IPv4 address was configured OK.

Signed-off-by: Andrew Bird <[email protected]>
---
drivers/net/usb/qmi_wwan.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index 62a1a43..0646e45 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -457,6 +457,15 @@ static const struct usb_device_id products[] = {
.bInterfaceProtocol = 0xff,
.driver_info = (unsigned long)&qmi_wwan_force_int4,
},
+ { /* ZTE (Vodafone) K3765-Z */
+ .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
+ .idVendor = 0x19d2,
+ .idProduct = 0x2002,
+ .bInterfaceClass = 0xff,
+ .bInterfaceSubClass = 0xff,
+ .bInterfaceProtocol = 0xff,
+ .driver_info = (unsigned long)&qmi_wwan_force_int4,
+ },
{ /* ZTE (Vodafone) K4505-Z */
.match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
.idVendor = 0x19d2,
--
1.7.5.4

2012-05-20 08:30:29

by Andrew Bird

[permalink] [raw]
Subject: [PATCH 3/3] USB: qmi_wwan: Add ZTE (Vodafone) K3520-Z


Signed-off-by: Andrew Bird <[email protected]>
---
drivers/net/usb/qmi_wwan.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index 0646e45..f64dac3 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,
@@ -430,6 +439,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.5.4

2012-05-20 10:51:11

by Bjørn Mork

[permalink] [raw]
Subject: Re: [PATCH 1/3] USB: qmi_wwan: Make forced int 4 whitelist generic

Andrew Bird <[email protected]> writes:

> 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 <[email protected]>
> ---
> drivers/net/usb/qmi_wwan.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
> index d316503b..62a1a43 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 */

Acked-by: Bjørn Mork <[email protected]>

This fixes a logical error in the code. Minidriver constructs with an
interface whitelist should not use qmi_wwan_bind_gobi. It was made to
prevent binding to the serial interfaces on Gobi devices, and serves no
useful purpose when used with a whitelist. The change is a no-op for
the ZTE MF820D, but is important for new devices.

Thanks for fixing this.


Bjør

2012-05-20 10:52:17

by Bjørn Mork

[permalink] [raw]
Subject: Re: [PATCH 2/3] USB: qmi_wwan: Add ZTE (Vodafone) K3765-Z

Andrew Bird <[email protected]> writes:

> Add the ZTE (Vodafone) K3765-Z to the whitelist.

Acked-by: Bjørn Mork <[email protected]>

2012-05-20 10:54:04

by Bjørn Mork

[permalink] [raw]
Subject: Re: [PATCH 3/3] USB: qmi_wwan: Add ZTE (Vodafone) K3520-Z

Andrew Bird <[email protected]> writes:

> Signed-off-by: Andrew Bird <[email protected]>


Acked-by: Bjørn Mork <[email protected]>

> /* 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,
> @@ -430,6 +439,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,


Looking forward to changing all this to a single line device + interface
number macro in 3.6 :-)


Bjørn

2012-05-20 21:00:40

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 1/3] USB: qmi_wwan: Make forced int 4 whitelist generic

From: Andrew Bird <[email protected]>
Date: Sun, 20 May 2012 09:28:36 +0100

> 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 <[email protected]>

Applied to net-next.

2012-05-20 21:00:49

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 2/3] USB: qmi_wwan: Add ZTE (Vodafone) K3765-Z

From: Andrew Bird <[email protected]>
Date: Sun, 20 May 2012 09:28:37 +0100

> Add the ZTE (Vodafone) K3765-Z to the whitelist. This requires the
> previous patch to make the whitelist with forced interface 4 generic
> or the device fails to initialise. After applying this patch and
> loading the Option driver without usb-modeswitch's bind all
> interfaces trick, a wwan0 net interface and /dev/cdc-wdm0 device
> file were created. Using Bjorn Mork's perl connection script a
> connection was made to a mobile network using QMI and the network
> interface's IPv4 address was configured OK.
>
> Signed-off-by: Andrew Bird <[email protected]>

Applied to net-next.

2012-05-20 21:00:53

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 2/3] USB: qmi_wwan: Add ZTE (Vodafone) K3765-Z

From: Andrew Bird <[email protected]>
Date: Sun, 20 May 2012 09:28:37 +0100

> Add the ZTE (Vodafone) K3765-Z to the whitelist. This requires the
> previous patch to make the whitelist with forced interface 4 generic
> or the device fails to initialise. After applying this patch and
> loading the Option driver without usb-modeswitch's bind all
> interfaces trick, a wwan0 net interface and /dev/cdc-wdm0 device
> file were created. Using Bjorn Mork's perl connection script a
> connection was made to a mobile network using QMI and the network
> interface's IPv4 address was configured OK.
>
> Signed-off-by: Andrew Bird <[email protected]>

Applied to net-next.