]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
USB: usb-storage: Initialize Huawei E220 properly
authorJohann Wilhelm <johann.wilhelm@student.tugraz.at>
Wed, 5 Sep 2007 11:49:29 +0000 (13:49 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 12 Oct 2007 21:55:24 +0000 (14:55 -0700)
This is a reworked version of this patch:
http://www.mail-archive.com/linux-usb-devel%40lists.sourceforge.net/msg55094/activate_huawei_dev.patch

That properly initializes the HUAWEI E220 devices into multi-port mode.

Signed-off-by: Johann Wilhelm <johann.wilhelm@student.tugraz.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/storage/initializers.c
drivers/usb/storage/initializers.h
drivers/usb/storage/unusual_devs.h

index 3a41740cad97d38b6e04c385fd64dd82f9c85133..ee5b42aa53633b159b259d95bbf208e866a48492 100644 (file)
@@ -90,3 +90,17 @@ int usb_stor_ucr61s2b_init(struct us_data *us)
 
        return (res ? -1 : 0);
 }
+
+/* This places the HUAWEI E220 devices in multi-port mode */
+int usb_stor_huawei_e220_init(struct us_data *us)
+{
+       int result;
+
+       us->iobuf[0] = 0x1;
+       result = usb_stor_control_msg(us, us->send_ctrl_pipe,
+                                     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);
+}
index e2967a4d48a2e30d0fa694f233d10941ec88121a..ad3ffd4236c2af961039f36e3943978ee07fd66a 100644 (file)
@@ -47,3 +47,6 @@ int usb_stor_euscsi_init(struct us_data *us);
 /* 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_huawei_e220_init(struct us_data *us);
index c6b78ba815eaaa94dfd0f90f61690b4c59cb23ec..94b1dd2aeb3b8dda541e9317d4b66df27e21104e 100644 (file)
@@ -1463,6 +1463,17 @@ UNUSUAL_DEV(  0x1210, 0x0003, 0x0100, 0x0100,
                US_SC_DEVICE, US_PR_DEVICE, NULL,
                US_FL_IGNORE_RESIDUE ),
 
+/* Reported by fangxiaozhi <fangxiaozhi60675@huawei.com>
+ * and by linlei <linlei83@huawei.com>
+ * Patch reworked by Johann Wilhelm <johann.wilhelm@student.tugraz.at>
+ * This brings the HUAWEI E220 devices into multi-port mode
+ */
+UNUSUAL_DEV( 0x12d1, 0x1003, 0x0000, 0x0000,
+               "HUAWEI MOBILE",
+               "Mass Storage",
+               US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
+               0),
+
 /* Reported by Vilius Bilinkevicius <vilisas AT xxx DOT lt) */
 UNUSUAL_DEV(  0x132b, 0x000b, 0x0001, 0x0001,
                "Minolta",