[patch 1/1] usb-storage: Initialize Huawei E220

Johann Wilhelm <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
From: Johann Wilhelm <[email protected]>
This is a reworked version of this patch:  
http://www.mail-archive.com/linux-usb-devel%40lists.sourceforge.net/msg55094/activate_huawei_dev.patch

Signed-off-by: Johann Wilhelm <[email protected]>
---

diff -uprN -X linux-2.6.22.6/Documentation/dontdiff  
linux-2.6.22.6/drivers/usb/storage/initializers.c  
linux-2.6.22.6_patched/drivers/usb/storage/initializers.c
--- linux-2.6.22.6/drivers/usb/storage/initializers.c	2007-08-31  
08:21:01.000000000 +0200
+++  
linux-2.6.22.6_patched/drivers/usb/storage/initializers.c	2007-09-04  
15:54:35.398703176 +0200
@@ -90,3 +90,15 @@ int usb_stor_ucr61s2b_init(struct us_dat

  	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 = 0;
+	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);
+}
diff -uprN -X linux-2.6.22.6/Documentation/dontdiff  
linux-2.6.22.6/drivers/usb/storage/initializers.h  
linux-2.6.22.6_patched/drivers/usb/storage/initializers.h
--- linux-2.6.22.6/drivers/usb/storage/initializers.h	2007-08-31  
08:21:01.000000000 +0200
+++  
linux-2.6.22.6_patched/drivers/usb/storage/initializers.h	2007-09-03  
12:30:40.814546787 +0200
@@ -47,3 +47,6 @@ int usb_stor_euscsi_init(struct us_data
  /* 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);
diff -uprN -X linux-2.6.22.6/Documentation/dontdiff  
linux-2.6.22.6/drivers/usb/storage/unusual_devs.h  
linux-2.6.22.6_patched/drivers/usb/storage/unusual_devs.h
--- linux-2.6.22.6/drivers/usb/storage/unusual_devs.h	2007-08-31  
08:21:01.000000000 +0200
+++  
linux-2.6.22.6_patched/drivers/usb/storage/unusual_devs.h	2007-09-04  
15:47:47.875479887 +0200
@@ -1394,6 +1394,17 @@ UNUSUAL_DEV(  0x1210, 0x0003, 0x0100, 0x
  		US_SC_DEVICE, US_PR_DEVICE, NULL,
  		US_FL_IGNORE_RESIDUE ),

+/* Reported by fangxiaozhi <[email protected]>
+ * and by linlei <[email protected]>
+ * Patch reworked by Johann Wilhelm <[email protected]>
+ * 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",


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.