Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Add support for the Huawei E171 3G Modem.
details: https://anonhg.NetBSD.org/src/rev/e93262b2b775
branches: trunk
changeset: 785452:e93262b2b775
user: nonaka <nonaka%NetBSD.org@localhost>
date: Thu Mar 14 13:08:56 2013 +0000
description:
Add support for the Huawei E171 3G Modem.
Tested by Saifi Khan at http://mail-index.netbsd.org/netbsd-users/2013/03/14/msg012629.html
diffstat:
share/man/man4/u3g.4 | 6 ++++--
sys/dev/usb/u3g.c | 27 +++++++++++++++++++++++++--
2 files changed, 29 insertions(+), 4 deletions(-)
diffs (89 lines):
diff -r f029df69c0de -r e93262b2b775 share/man/man4/u3g.4
--- a/share/man/man4/u3g.4 Thu Mar 14 12:49:33 2013 +0000
+++ b/share/man/man4/u3g.4 Thu Mar 14 13:08:56 2013 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: u3g.4,v 1.5 2012/08/04 19:48:24 wiz Exp $
+.\" $NetBSD: u3g.4,v 1.6 2013/03/14 13:08:56 nonaka Exp $
.\"
.\" Copyright (c) 2008 AnyWi Technologies
.\" All rights reserved.
@@ -17,7 +17,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd August 4, 2012
+.Dd March 14, 2013
.Dt U3G 4
.Os
.Sh NAME
@@ -56,6 +56,8 @@
.Pp
.Bl -bullet -compact
.It
+Huawei E171
+.It
Huawei E220 (E270?)
.It
Huawei Mobile
diff -r f029df69c0de -r e93262b2b775 sys/dev/usb/u3g.c
--- a/sys/dev/usb/u3g.c Thu Mar 14 12:49:33 2013 +0000
+++ b/sys/dev/usb/u3g.c Thu Mar 14 13:08:56 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: u3g.c,v 1.27 2012/11/01 00:38:43 christos Exp $ */
+/* $NetBSD: u3g.c,v 1.28 2013/03/14 13:08:56 nonaka Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: u3g.c,v 1.27 2012/11/01 00:38:43 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: u3g.c,v 1.28 2013/03/14 13:08:56 nonaka Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -191,6 +191,7 @@
{ USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_EM770W },
{ USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_K3765 },
{ USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_MOBILE },
+ { USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E171 },
/* OEM: Merlin */
{ USB_VENDOR_MERLIN, USB_PRODUCT_MERLIN_V620 },
/* OEM: Novatel */
@@ -427,6 +428,25 @@
}
static int
+u3g_huawei_e171_reinit(usbd_device_handle dev)
+{
+ unsigned char cmd[31];
+
+ /* magic string adapted from some webpage */
+ memset(cmd, 0, sizeof(cmd));
+ cmd[0] = 0x55;
+ cmd[1] = 0x53;
+ cmd[2] = 0x42;
+ cmd[3] = 0x43;
+ cmd[15]= 0x11;
+ cmd[16]= 0x06;
+ cmd[17]= 0x20;
+ cmd[20]= 0x01;
+
+ return send_bulkmsg(dev, cmd, sizeof(cmd));
+}
+
+static int
u3g_sierra_reinit(usbd_device_handle dev)
{
/* Some Sierra devices presents themselves as a umass device with
@@ -484,6 +504,9 @@
case USB_PRODUCT_HUAWEI_K3765INIT:
return u3g_huawei_k3765_reinit(uaa->device);
break;
+ case USB_PRODUCT_HUAWEI_E171INIT:
+ return u3g_huawei_e171_reinit(uaa->device);
+ break;
default:
return u3g_huawei_reinit(uaa->device);
break;
Home |
Main Index |
Thread Index |
Old Index