2008-08-09 02:45:41

by Oliver Martin

[permalink] [raw]
Subject: Policy re. cellular USB modem mode switch

Hello,

trying to get my ZTE MF628 HSDPA modem to work left me wondering if
there is an established policy whether or not to include the "mode
switch" code most cellular USB modems need in the kernel or not.
Currently, the MF628 requires a userspace helper called usb_modeswitch
to be called [1] to change from mass storage mode to serial mode.
After, that it can be used with the usbserial driver or preferably,
after one adds the right vendor and product id, with the option driver.

The only other such device I know is the Huawei E220, which doesn't
require any userspace tools since 2.6.20. The usb_modeswitch website
lists quite a lot of devices as supported, do any other of them
*require* the use of this (or another) userspace tool? If so, is this
considered acceptable?

The main reason I'm asking this is to find out if I should try to put
the mode switch code in the kernel or not. In the meantime, I'll reply
to this message with a patch to add the vendor/product id of the MF628
to the option driver, which I guess is needed in any case.

Regards,
Oliver

[1] http://www.draisberghof.de/usb_modeswitch/
http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?t=81


2008-08-09 02:49:37

by Oliver Martin

[permalink] [raw]
Subject: [PATCH] Add vendor/product id of ZTE MF628 to option

This adds the vendor and product id (19d2:0015) of the ZTE MF628 HSDPA
modem to the option driver. It still needs a mode switch command issued
beforehand, this is currently handled by a userspace tool.

Signed-off-by: Oliver Martin <[email protected]>

Index: linux-2.6.27-rc2/drivers/usb/serial/option.c
===================================================================
--- linux-2.6.27-rc2.orig/drivers/usb/serial/option.c 2008-08-08 23:10:09.000000000 +0200
+++ linux-2.6.27-rc2/drivers/usb/serial/option.c 2008-08-08 23:10:33.000000000 +0200
@@ -197,6 +197,10 @@
#define TELIT_VENDOR_ID 0x1bc7
#define TELIT_PRODUCT_UC864E 0x1003

+/* ZTE PRODUCTS */
+#define ZTE_VENDOR_ID 0x19d2
+#define ZTE_PRODUCT_MF628 0x0015
+
static struct usb_device_id option_ids[] = {
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
@@ -308,6 +312,7 @@
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */
{ USB_DEVICE(MAXON_VENDOR_ID, 0x6280) }, /* BP3-USB & BP3-EXT HSDPA */
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) },
+ { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628) },
{ } /* Terminating entry */
};
MODULE_DEVICE_TABLE(usb, option_ids);

2008-08-09 04:39:48

by Greg KH

[permalink] [raw]
Subject: Re: Policy re. cellular USB modem mode switch

On Sat, Aug 09, 2008 at 04:45:30AM +0200, Oliver Martin wrote:
> Hello,
>
> trying to get my ZTE MF628 HSDPA modem to work left me wondering if
> there is an established policy whether or not to include the "mode
> switch" code most cellular USB modems need in the kernel or not.

Questions like this have been hashed out numerous times already on the
linux-usb mailing list.

> Currently, the MF628 requires a userspace helper called usb_modeswitch
> to be called [1] to change from mass storage mode to serial mode.
> After, that it can be used with the usbserial driver or preferably,
> after one adds the right vendor and product id, with the option driver.

Never use the usbserial generic driver with a device you actually want
to go fast :)

The option driver is better.

For switching modes, use the userspace program, it's not going to be
done within the kernel. See the linux-usb archives for details.

thanks,

greg k-h

2008-08-09 05:06:55

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] Add vendor/product id of ZTE MF628 to option

On Sat, Aug 09, 2008 at 04:49:26AM +0200, Oliver Martin wrote:
> This adds the vendor and product id (19d2:0015) of the ZTE MF628 HSDPA
> modem to the option driver. It still needs a mode switch command issued
> beforehand, this is currently handled by a userspace tool.
>
> Signed-off-by: Oliver Martin <[email protected]>

In the future, please CC: any usb patch to the linux-usb mailing list,
and the USB maintainer to make sure it gets picked up properly.
Otherwise, odds are I'll miss it :(

thanks,

greg k-h