public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stefan Assmann <sassmann@redhat.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: linux-usb@vger.kernel.org
Subject: [PATCH] USB: expose Huawei E1550 3G modem
Date: Mon, 19 Apr 2010 14:45:37 +0200	[thread overview]
Message-ID: <4BCC5071.4010509@redhat.com> (raw)

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


             reply	other threads:[~2010-04-19 12:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-19 12:45 Stefan Assmann [this message]
2010-04-19 14:00 ` [PATCH] USB: expose Huawei E1550 3G modem 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BCC5071.4010509@redhat.com \
    --to=sassmann@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox