[PATCH] Active Huawei E220 devs
linlei 60022748 <[email protected]>
| Newsgroups | gmane.linux.usb.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi there, This patch make the HUAWEI E220 device to map out three ports instead of only one virtural cd port. See the patch for the full explanation, CC's, and sign-off. And please apply. best regards Linlei Huawei Technologies Wireless Terminal R&D Dept ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
activate_huawei_dev.patch
(application/octet-stream, 2.8 KB)
This patch make the HUAWEI E220 device to map out three ports instead of only one virtural cd port. CC: [email protected] CC: [email protected] CC: [email protected] CC: [email protected] CC: fangxiaozhi <[email protected]> Signed-off-by: fangxiaozhi <fangxiaozhi60675.huawei.com> ---------------------------------------- diff -urN -X linux-2.6.21.1-vanilla/Documentation/dontdiff linux-2.6.21.1-vanilla/drivers/usb/storage/initializers.c linux-2.6.21.1/drivers/usb/storage/initializers.c --- linux-2.6.21.1-vanilla/drivers/usb/storage/initializers.c 2007-04-28 05:49:26.000000000 +0800 +++ linux-2.6.21.1/drivers/usb/storage/initializers.c 2007-06-21 19:18:48.000000000 +0800 @@ -90,3 +90,14 @@ return (res ? -1 : 0); } + +/* This places the HUAWEI E220 devices in multi-port mode */ +int usb_stor_switch_ports_init(struct us_data *us) +{ + us->iobuf[0] = 0x1; + (void)usb_control_msg(us->pusb_dev, usb_sndctrlpipe(us->pusb_dev, 0), + USB_REQ_SET_FEATURE, USB_TYPE_STANDARD | USB_RECIP_DEVICE, + 0x01, 0x0, us->iobuf, 0x1, 1000); + return 0; +} + diff -urN -X linux-2.6.21.1-vanilla/Documentation/dontdiff linux-2.6.21.1-vanilla/drivers/usb/storage/initializers.h linux-2.6.21.1/drivers/usb/storage/initializers.h --- linux-2.6.21.1-vanilla/drivers/usb/storage/initializers.h 2007-04-28 05:49:26.000000000 +0800 +++ linux-2.6.21.1/drivers/usb/storage/initializers.h 2007-06-21 19:18:26.000000000 +0800 @@ -47,3 +47,6 @@ /* This function is required to activate all four slots on the UCR-61S2B * flash reader */ int usb_stor_ucr61s2b_init(struct us_data *us); + +/* This places the HUAWEI E220 devices in multi-port mode */ +int usb_stor_switch_ports_init(struct us_data *us); diff -urN -X linux-2.6.21.1-vanilla/Documentation/dontdiff linux-2.6.21.1-vanilla/drivers/usb/storage/unusual_devs.h linux-2.6.21.1/drivers/usb/storage/unusual_devs.h --- linux-2.6.21.1-vanilla/drivers/usb/storage/unusual_devs.h 2007-04-28 05:49:26.000000000 +0800 +++ linux-2.6.21.1/drivers/usb/storage/unusual_devs.h 2007-06-21 19:21:30.000000000 +0800 @@ -1371,14 +1371,15 @@ US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_IGNORE_RESIDUE ), -/* This prevents the kernel from detecting the virtual cd-drive with the - * Windows drivers. <[email protected]> +/* This tells the usb driver to place the HUAWEI E220 devices into multi-port mode + * Reported by fangxiaozhi <[email protected]> + * and by linlei <[email protected]> */ -UNUSUAL_DEV( 0x12d1, 0x1003, 0x0000, 0xffff, +UNUSUAL_DEV( 0x12d1, 0x1003, 0x0000, 0x0000, "HUAWEI", - "E220 USB-UMTS Install", - US_SC_DEVICE, US_PR_DEVICE, NULL, - US_FL_IGNORE_DEVICE), + "HUAWEI MOBILE Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_switch_ports_init, + 0), /* Reported by Vilius Bilinkevicius <vilisas AT xxx DOT lt) */ UNUSUAL_DEV( 0x132b, 0x000b, 0x0001, 0x0001,