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

Previous thread: [00/03] [RFC] USB debugging rework by Greg KH on Friday, August 8, 2008 - 6:38 pm. (12 messages)

Next thread: 2.6.27-rc2: unable to suspend - one task not freezed by Andrey Borzenkov on Friday, August 8, 2008 - 11:18 pm. (4 messages)
From: Oliver Martin
Date: Friday, August 8, 2008 - 7:45 pm

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
--

From: Oliver Martin
Date: Friday, August 8, 2008 - 7:49 pm

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 <oliver.martin@student.tuwien.ac.at>

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);
--

From: Greg KH
Date: Friday, August 8, 2008 - 9:53 pm

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
--

From: Greg KH
Date: Friday, August 8, 2008 - 9:38 pm

Questions like this have been hashed out numerous times already on the

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
--

Previous thread: [00/03] [RFC] USB debugging rework by Greg KH on Friday, August 8, 2008 - 6:38 pm. (12 messages)

Next thread: 2.6.27-rc2: unable to suspend - one task not freezed by Andrey Borzenkov on Friday, August 8, 2008 - 11:18 pm. (4 messages)