Re: [PATCH] Active Huawei E220 devs
linlei 60022748 <[email protected]>
| Newsgroups | gmane.linux.usb.devel |
|---|---|
| Message-ID | <[email protected]> |
Phil, Thank you for accept the unusual_devs.h portion of the previous patch. Greg, This is the updated patch, please check it. best wishes Linlei Huawei Technologies Wireless Terminal R&D Dept linlei 60022748 wrote: > 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. Short of Greg's point that the return status of usb_control_msg() isn't checked, the patch looks good to me. Or, more specifically, I'm signing off on the unusual_devs.h portion of it. So when ya'll send an updated version, I'll add my Signed-off-by. -- Phil Dibowitz [email protected] Open Source software and tech docs Insanity Palace of Metallica http://www.phildev.net/ http://www.ipom.com/ "Never write it in C if you can do it in 'awk'; Never do it in 'awk' if 'sed' can handle it; Never use 'sed' when 'tr' can do the job; Never invoke 'tr' when 'cat' is sufficient; Avoid using 'cat' whenever possible" -- Taylor's Laws of Programming ------------------------------------------------------------------------- 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
(text/plain, 2.9 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-26 23:43:54.000000000 +0800 @@ -90,3 +90,16 @@ return (res ? -1 : 0); } + +/* This places the HUAWEI E220 devices in multi-port mode */ +int usb_stor_switch_ports_init(struct us_data *us) +{ + int result = 0; + us->iobuf[0] = 0x1; + result = 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); + US_DEBUGP("usb_control_msg performing result is %d\n", result); + return (result ? 0 : -1); +} + 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-25 23:01:18.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-25 23:01:18.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,