Module Name: src
Committed By: nonaka
Date: Thu Mar 14 13:08:56 UTC 2013
Modified Files:
src/share/man/man4: u3g.4
src/sys/dev/usb: u3g.c
Log Message:
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
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/share/man/man4/u3g.4
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/usb/u3g.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/share/man/man4/u3g.4
diff -u src/share/man/man4/u3g.4:1.5 src/share/man/man4/u3g.4:1.6
--- src/share/man/man4/u3g.4:1.5 Sat Aug 4 19:48:24 2012
+++ src/share/man/man4/u3g.4 Thu Mar 14 13:08:56 2013
@@ -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 @@ driver supports the following adapters:
.Pp
.Bl -bullet -compact
.It
+Huawei E171
+.It
Huawei E220 (E270?)
.It
Huawei Mobile
Index: src/sys/dev/usb/u3g.c
diff -u src/sys/dev/usb/u3g.c:1.27 src/sys/dev/usb/u3g.c:1.28
--- src/sys/dev/usb/u3g.c:1.27 Thu Nov 1 00:38:43 2012
+++ src/sys/dev/usb/u3g.c Thu Mar 14 13:08:56 2013
@@ -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 @@ static const struct usb_devno u3g_devs[]
{ 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 @@ u3g_huawei_k3765_reinit(usbd_device_hand
}
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 @@ u3ginit_match(device_t parent, cfdata_t
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;