public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] USB: expose Huawei E1550 3G modem
@ 2010-04-19 12:45 Stefan Assmann
  2010-04-19 14:00 ` Josua Dietze
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Assmann @ 2010-04-19 12:45 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: linux-usb

From: Stefan Assmann <sassmann@redhat.com>

The Huawei E1550 3G modem is hidden by default and can be exposed by sending
some magic initialization code. This patch takes care of that.

Signed-off-by: Stefan Assmann <sassmann@redhat.com>
---
 drivers/usb/storage/initializers.c |   21 +++++++++++++++++++++
 drivers/usb/storage/initializers.h |    3 +++
 drivers/usb/storage/unusual_devs.h |    5 +++++
 3 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/storage/initializers.c b/drivers/usb/storage/initializers.c
index 105d900..6f2d3be 100644
--- a/drivers/usb/storage/initializers.c
+++ b/drivers/usb/storage/initializers.c
@@ -102,5 +102,26 @@ int usb_stor_huawei_e220_init(struct us_data *us)
 				      USB_TYPE_STANDARD | USB_RECIP_DEVICE,
 				      0x01, 0x0, NULL, 0x0, 1000);
 	US_DEBUGP("Huawei mode set result is %d\n", result);
+
+	return 0;
+}
+
+/* This exposes the HUAWEI E1550 3G modem */
+int usb_stor_huawei_e1550_init(struct us_data *us)
+{
+	int result;
+	static char init_string[] =
+		"\x55\x53\x42\x43\x00\x00\x00\x00"
+		"\x00\x00\x00\x00\x00\x00\x00\x11"
+		"\x06\x00\x00\x00\x00\x00\x00\x00"
+		"\x00\x00\x00\x00\x00\x00\x00";
+
+	memcpy(us->iobuf, init_string, sizeof(init_string) - 1);
+	result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe,
+			us->iobuf,
+			US_BULK_CB_WRAP_LEN,
+			NULL);
+	US_DEBUGP("Huawei mode set result is %d\n", result);
+
 	return 0;
 }
diff --git a/drivers/usb/storage/initializers.h b/drivers/usb/storage/initializers.h
index 529327f..5de8c86 100644
--- a/drivers/usb/storage/initializers.h
+++ b/drivers/usb/storage/initializers.h
@@ -48,3 +48,6 @@ 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);
+
+/* This exposes the HUAWEI E1550 3G modem */
+int usb_stor_huawei_e1550_init(struct us_data *us);
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index ccf1dbb..907a480 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -1814,6 +1814,11 @@ UNUSUAL_DEV(  0x12d1, 0x143F, 0x0000, 0x0000,
 		"Mass Storage",
 		US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
 		0),
+UNUSUAL_DEV(  0x12d1, 0x1446, 0x0000, 0x0000,
+		"HUAWEI MOBILE",
+		"Mass Storage",
+		US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e1550_init,
+		0),

 /* Reported by Vilius Bilinkevicius <vilisas AT xxx DOT lt) */
 UNUSUAL_DEV(  0x132b, 0x000b, 0x0001, 0x0001,
-- 
1.7.0.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-04-19 16:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-19 12:45 [PATCH] USB: expose Huawei E1550 3G modem Stefan Assmann
2010-04-19 14:00 ` Josua Dietze
2010-04-19 14:08   ` Stefan Assmann
2010-04-19 14:19     ` Matthew Dharm
2010-04-19 14:58       ` Stefan Assmann
2010-04-19 15:21         ` Josua Dietze
2010-04-19 16:14         ` Matthew Dharm
2010-04-19 16:17           ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox