login
Header Space

 
 

Re: HUAWEI not recognized properly (3 modem)

Previous thread: Re: Azalia driver locks up computer Sony SZ460N by Rob Lytle on Tuesday, December 11, 2007 - 11:48 am. (1 message)

Next thread: Azalia driver locks up computer Sony SZ460N by Rob Lytle on Tuesday, December 11, 2007 - 11:41 am. (1 message)
To: Markus Bergkvist <markus.bergkvist@...>, OpenBSD Misc <misc@...>
Date: Tuesday, December 11, 2007 - 11:58 am

----- Original Message ----- 

the modem you have (vendor id 0x1003) should be an E220 HSDPA modem.
exactly the same device i tried to "run" last week on freebsd, where
i got the same trouble as you.

the problem is, that the device when plugged in, initially reports
itself as a mass-storage device which will cause a cd-rom to be
found.

as far as i could figure out in tests (and some others pointed me in
the right direction of course), the device needs some proper "message"
to be transferred to switch from mass-storage mode into the modem mode.

currently, there is a thread on the freebsd lists with the subject
"huawei e220 hsdpa on freebsd 6.3-BETA2" regarding this.
have a look on it, it'll help you out maybe...

i'm currently testing the c-code which is provided there (i'm not
a guru) but the first one does not look that bad (there are some
errors and problems which i do not really have the time right now
to look into).

sorry, can't tell anything better right now on this,
cheers ;)
To: no@spam@mgedv.net <nospam@...>
Cc: Markus Bergkvist <markus.bergkvist@...>, OpenBSD Misc <misc@...>
Date: Wednesday, December 12, 2007 - 1:09 pm

the following diff to umsm(4) sends the proper message to the device 
to cause the ucom port to appear. 
I still have the problem, that sometimes talking to the ucom will 
cause the device to reset itself, I have not figured out what is 
causing that.

felix

Index: sys/dev/usb/umsm.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/umsm.c,v
retrieving revision 1.16
diff -u -r1.16 umsm.c
--- sys/dev/usb/umsm.c	19 Jun 2007 23:59:27 -0000	1.16
+++ sys/dev/usb/umsm.c	8 Sep 2007 19:50:44 -0000
@@ -58,6 +58,7 @@
 	{ USB_VENDOR_AIRPRIME,	USB_PRODUCT_AIRPRIME_PC5220 },
 	{ USB_VENDOR_DELL,	USB_PRODUCT_DELL_W5500 },
 	{ USB_VENDOR_KYOCERA2,	USB_PRODUCT_KYOCERA2_KPC650 },
+	{ USB_VENDOR_HUAWEI,	USB_PRODUCT_HUAWEI_E220 },
 	{ USB_VENDOR_NOVATEL,	USB_PRODUCT_NOVATEL_EXPRESSCARD },
 	{ USB_VENDOR_NOVATEL,	USB_PRODUCT_NOVATEL_MERLINV620 },
 	{ USB_VENDOR_NOVATEL,	USB_PRODUCT_NOVATEL_S720 },
@@ -123,6 +124,25 @@
 	devinfop = usbd_devinfo_alloc(uaa-&gt;device, 0);
 	printf("\n%s: %s\n", sc-&gt;sc_dev.dv_xname, devinfop);
 	usbd_devinfo_free(devinfop);
+
+	if(uaa-&gt;product == USB_PRODUCT_HUAWEI_E220) {
+		usb_device_request_t req;
+		usbd_status err;
+
+		req.bmRequestType = UT_WRITE_DEVICE;
+		req.bRequest = UR_SET_FEATURE;
+		USETW(req.wValue, 1);
+		USETW(req.wIndex, 0);
+		USETW(req.wLength, 0);
+		err = usbd_do_request(sc-&gt;sc_udev, &amp;req, 0);
+
+		if (err) {
+			printf("%s: failed to initialize device ",
+					sc-&gt;sc_dev.dv_xname);
+			sc-&gt;sc_dying = 1;
+			return;
+		}
+	}
 
 	if (usbd_set_config_index(sc-&gt;sc_udev, UMSM_CONFIG_NO, 1) != 0) {
 		printf("%s: could not set configuration no\n",
Index: share/man/man4/umsm.4
===================================================================
RCS file: /cvs/src/share/man/man4/umsm.4,v
retrieving revision 1.21
diff -u -r1.21 umsm.4
--- share/man/man4/umsm.4	21 Jun 2007 00:26:47 -0000	1.21
+++ share/man/man4/umsm.4	8 Sep 2007 19:50:44 -0000
@@ -38,6 +38,7 @@
...
To: no@spam@mgedv.net <nospam@...>
Cc: Markus Bergkvist <markus.bergkvist@...>, OpenBSD Misc <misc@...>
Date: Wednesday, December 12, 2007 - 1:07 pm

attached diff sends the proper message to the device to cause the
ucom port to appear. I still have the problem, that sometimes talking
to the ucom will cause the device to reset itself, I have not figured
out what is causing that.

felix
Index: sys/dev/usb/umsm.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/umsm.c,v
retrieving revision 1.16
diff -u -r1.16 umsm.c
--- sys/dev/usb/umsm.c	19 Jun 2007 23:59:27 -0000	1.16
+++ sys/dev/usb/umsm.c	8 Sep 2007 19:50:44 -0000
@@ -58,6 +58,7 @@
 	{ USB_VENDOR_AIRPRIME,	USB_PRODUCT_AIRPRIME_PC5220 },
 	{ USB_VENDOR_DELL,	USB_PRODUCT_DELL_W5500 },
 	{ USB_VENDOR_KYOCERA2,	USB_PRODUCT_KYOCERA2_KPC650 },
+	{ USB_VENDOR_HUAWEI,	USB_PRODUCT_HUAWEI_E220 },
 	{ USB_VENDOR_NOVATEL,	USB_PRODUCT_NOVATEL_EXPRESSCARD },
 	{ USB_VENDOR_NOVATEL,	USB_PRODUCT_NOVATEL_MERLINV620 },
 	{ USB_VENDOR_NOVATEL,	USB_PRODUCT_NOVATEL_S720 },
@@ -123,6 +124,25 @@
 	devinfop = usbd_devinfo_alloc(uaa-&gt;device, 0);
 	printf("\n%s: %s\n", sc-&gt;sc_dev.dv_xname, devinfop);
 	usbd_devinfo_free(devinfop);
+
+	if(uaa-&gt;product == USB_PRODUCT_HUAWEI_E220) {
+		usb_device_request_t req;
+		usbd_status err;
+
+		req.bmRequestType = UT_WRITE_DEVICE;
+		req.bRequest = UR_SET_FEATURE;
+		USETW(req.wValue, 1);
+		USETW(req.wIndex, 0);
+		USETW(req.wLength, 0);
+		err = usbd_do_request(sc-&gt;sc_udev, &amp;req, 0);
+
+		if (err) {
+			printf("%s: failed to initialize device ",
+					sc-&gt;sc_dev.dv_xname);
+			sc-&gt;sc_dying = 1;
+			return;
+		}
+	}
 
 	if (usbd_set_config_index(sc-&gt;sc_udev, UMSM_CONFIG_NO, 1) != 0) {
 		printf("%s: could not set configuration no\n",
Index: share/man/man4/umsm.4
===================================================================
RCS file: /cvs/src/share/man/man4/umsm.4,v
retrieving revision 1.21
diff -u -r1.21 umsm.4
--- share/man/man4/umsm.4	21 Jun 2007 00:26:47 -0000	1.21
+++ share/man/man4/umsm.4	8 Sep 2007 19:50:44 -0000
@@ -38,6 +38,7 @@
 .Bl -column "Device  ...
To: Felix Kronlage <fkr@...>
Cc: no@spam@mgedv.net <nospam@...>, OpenBSD Misc <misc@...>
Date: Wednesday, December 12, 2007 - 5:47 pm

I'll test it as soon as I get a chance, currently my laptop gets a page 
fault and enters ddb during boot :-/
Also, I could not apply your diff on -current. Below is an updated diff.

BR,
Markus

--- sys/dev/usb/umsm.c.orig     Wed Dec 12 22:21:44 2007
+++ sys/dev/usb/umsm.c  Wed Dec 12 22:14:21 2007
@@ -58,6 +58,7 @@
         { USB_VENDOR_AIRPRIME,  USB_PRODUCT_AIRPRIME_PC5220 },
         { USB_VENDOR_DELL,      USB_PRODUCT_DELL_W5500 },
         { USB_VENDOR_KYOCERA2,  USB_PRODUCT_KYOCERA2_KPC650 },
+       { USB_VENDOR_HUAWEI,    USB_PRODUCT_HUAWEI_E220 },
         { USB_VENDOR_NOVATEL,   USB_PRODUCT_NOVATEL_EXPRESSCARD },
         { USB_VENDOR_NOVATEL,   USB_PRODUCT_NOVATEL_MERLINV620 },
         { USB_VENDOR_NOVATEL,   USB_PRODUCT_NOVATEL_S720 },
@@ -119,6 +120,25 @@

         bzero(&amp;uca, sizeof(uca));
         sc-&gt;sc_udev = uaa-&gt;device;
+
+       if(uaa-&gt;product == USB_PRODUCT_HUAWEI_E220) {
+               usb_device_request_t req;
+               usbd_status err;
+
+               req.bmRequestType = UT_WRITE_DEVICE;
+               req.bRequest = UR_SET_FEATURE;
+               USETW(req.wValue, 1);
+               USETW(req.wIndex, 0);
+               USETW(req.wLength, 0);
+               err = usbd_do_request(sc-&gt;sc_udev, &amp;req, 0);
+
+               if (err) {
+                       printf("%s: failed to initialize device ",
+                                       sc-&gt;sc_dev.dv_xname);
+                       sc-&gt;sc_dying = 1;
+                       return;
+               }
+       }

         if (usbd_set_config_index(sc-&gt;sc_udev, UMSM_CONFIG_NO, 1) != 0) {
                 printf("%s: could not set configuration no\n",
--- share/man/man4/umsm.4.orig  Wed Dec 12 22:22:33 2007
+++ share/man/man4/umsm.4       Wed Dec 12 22:15:01 2007
@@ -38,6 +38,7 @@
  .Bl -column "Device                " "Bus" -compact -offset 6n
  .It Em "Device         Bus"
  .It Li "AirPrime PC5220" Ta Ta CardBus
+.It Li "Huawei Mobile E220" Ta Ta USB...
To: Felix Kronlage <fkr@...>
Cc: no@spam@mgedv.net <nospam@...>, OpenBSD Misc <misc@...>
Date: Tuesday, December 18, 2007 - 3:48 am

-current is booting on my laptop again, and after applying the diff the 
Huawei E220 is now recognized as

umsm0 at uhub2
  port 1 "HUAWEI Technologies HUAWEI Mobile" rev 1.10/0.00 addr 2
ucom0 at umsm0 portno 0

Anyone who has a ppp.conf that might work with swedish "3" operator 
(Hi3G Access AB) so I can test the modem? I have no real personal 
interest in this modem right now, hence won't take the time to figure it 
out.

/Markus
To: Markus Bergkvist <markus.bergkvist@...>
Cc: Felix Kronlage <fkr@...>, no@spam@mgedv.net <nospam@...>, OpenBSD Misc <misc@...>
Date: Wednesday, December 19, 2007 - 8:40 am

Hi all,

I do have a personal interest in getting such a modem working with OpenBSD -

I have a laptop that is running win just for the sake of that modem,
grrrr...

Thanx for  all yer  work so far
//Johan
To: Johan Petersson <vhdlninja@...>
Cc: Markus Bergkvist <markus.bergkvist@...>, no@spam@mgedv.net <nospam@...>, OpenBSD Misc <misc@...>
Date: Wednesday, December 19, 2007 - 10:47 am

included chat script and pppd option file works for me in Germany with
Vodafone and the Huawei E220 (as well as other Huawei and Sierra Wireless
Devices).

======
/dev/ttyU0
noipdefault
defaultroute
deflate 0
bsdcomp 0
noccp
noaccomp
novj
novjccomp
lock
noauth
#nomagic
debug
#persist
user foo
remotename foo
connect '/usr/sbin/chat -f /etc/ppp/peers/umts.chat.huawei.vodafone'
======

====== Chat Script ==========
ABORT BUSY
ABORT 'NO CARRIER'
ABORT VOICE
ABORT	"NO DIALTONE"
''	AT
OK	AT+CGDCONT=1,"IP","web.vodafone.de"
OK	ATD*99***1#
=============================


felix
-- 
GPG/PGP:   D9AC74D0 / 076E 1E87 3E05 1C7F B1A0  8A48 0D31 9BD3 D9AC 74D0
http://hazardous.org/~fkr - fkr@hazardous.org - fkr@silc|irc  - FKR-RIPE
https://www.bytemine.net/ - bytemine - BSD based Hosting/Solutions/Ideas
To: OpenBSD Misc <misc@...>
Date: Wednesday, December 19, 2007 - 11:11 am

Otherwise this is almost exactly the same as the scripts I use with an
EDGE phone with Finnish operators, it's worked well for me. 

-- 
Jussi Peltola
Previous thread: Re: Azalia driver locks up computer Sony SZ460N by Rob Lytle on Tuesday, December 11, 2007 - 11:48 am. (1 message)

Next thread: Azalia driver locks up computer Sony SZ460N by Rob Lytle on Tuesday, December 11, 2007 - 11:41 am. (1 message)
speck-geostationary