Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Dec 2007 07:30:57 +0100
From:      Felix Kronlage <fkr@hazardous.org>
To:        "no@spam@mgedv.net" <nospam@mgedv.net>
Cc:        freebsd-usb@freebsd.org
Subject:   Re: huawei e220 hsdpa on freebsd 6.3-BETA2
Message-ID:  <20071211063056.GA6253@ripley.bytemine.net>
In-Reply-To: <001101c838b4$b7153bf0$14b1a8c0@bstandard.lan>
References:  <200712062018.50262.hselasky@c2i.net> <001101c838b4$b7153bf0$14b1a8c0@bstandard.lan>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Dec 07, 2007 at 10:36:58AM +0100, no@spam@mgedv.net wrote:

> but when loading the ucom/ubsa stuff before umass, the device will
> not be recognised as /dev/cdX and show up as a communication device
> (ucom).

What the card needs (as seen in the linux code) is the correct
"poking" (aka: sending the right init stuff), to make it show the serial
ports. I've not looked at this on FreeBSD, just on OpenBSD. On OpenBSD
I hooked it up to the umsm(4) driver, (since that is the most simple
USB-serial driver we've got) and added the poking. It works, I can dial.
However, sometimes the device starts resetting itself, instead of dialing,
so what I have is not yet perfect ;)

felix

changes to OpenBSD umsm(4) driver:

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",



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071211063056.GA6253>