login
Header Space

 
 

Re: HUAWEI not recognized properly (3 modem)

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: no@spam@mgedv.net <nospam@...>
Cc: Markus Bergkvist <markus.bergkvist@...>, OpenBSD Misc <misc@...>
Date: Wednesday, December 12, 2007 - 1:09 pm

On Tue, Dec 11, 2007 at 04:58:18PM +0100, no@spam@mgedv.net wrote:


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->device, 0);
 	printf("\n%s: %s\n", sc->sc_dev.dv_xname, devinfop);
 	usbd_devinfo_free(devinfop);
+
+	if(uaa->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->sc_udev, &req, 0);
+
+		if (err) {
+			printf("%s: failed to initialize device ",
+					sc->sc_dev.dv_xname);
+			sc->sc_dying = 1;
+			return;
+		}
+	}
 
 	if (usbd_set_config_index(sc->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                " "Bus" -compact -offset 6n
 .It Em "Device		Bus"
 .It Li "AirPrime PC5220" Ta Ta CardBus
+.It Li "Huawei Mobile E220" Ta Ta USB
 .It Li "Kyocera KPC650" Ta Ta CardBus
 .It Li "Novatel Wireless ES620" Ta Ta USB
 .It Li "ONDA Communication H600" Ta Ta CardBus
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: HUAWEI not recognized properly (3 modem), no@spam@mgedv.net, (Tue Dec 11, 11:58 am)
Re: HUAWEI not recognized properly (3 modem), Felix Kronlage, (Wed Dec 12, 1:09 pm)
Re: HUAWEI not recognized properly (3 modem), Felix Kronlage, (Wed Dec 12, 1:07 pm)
Re: HUAWEI not recognized properly (3 modem), Markus Bergkvist, (Wed Dec 12, 5:47 pm)
Re: HUAWEI not recognized properly (3 modem), Markus Bergkvist, (Tue Dec 18, 3:48 am)
Re: HUAWEI not recognized properly (3 modem), Johan Petersson, (Wed Dec 19, 8:40 am)
Re: HUAWEI not recognized properly (3 modem), Felix Kronlage, (Wed Dec 19, 10:47 am)
Re: HUAWEI not recognized properly (3 modem), Jussi Peltola, (Wed Dec 19, 11:11 am)
speck-geostationary